[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-games-devel
Subject: Re: [Kde-games-devel] KsirK ready for kdegames ?
From: Dirk <dirkrathlev () gmx ! de>
Date: 2007-01-29 20:31:03
Message-ID: 45BE5987.3090108 () gmx ! de
[Download RAW message or body]
Hi,
Kleag wrote:
>> * There seems to be a maximum number of moves i can do per turn, but i
>>
> can't
>
>> find any place to see how much moves i have left.
>>
> If this is the case, it is a bug ! There is no officialy such limit :-)
>
Can confirm this. But it happens only if you move armies, not when
attacking (at least I think so).
And I think, you need nicer flags. I found them a little bit hard to
distinguish.
I took a short look at the code btw. I think there are quite some
cleanups and optimisations to do, but this can happen in svn. I really
like this game, so I'll be glad if I could help fixing the remaining
issues once it's in svn.
Attached is a small optimization patch.. I hope, I didn't miss anything.
Best regards,
Dirk
["small_opt.diff" (text/x-diff)]
Index: ksirk/GameLogic/aiColsonPlayer.cpp
===================================================================
--- ksirk/GameLogic/aiColsonPlayer.cpp (Revision 223)
+++ ksirk/GameLogic/aiColsonPlayer.cpp (Arbeitskopie)
@@ -69,17 +69,11 @@ Fortify();
return std::make_pair(static_cast<Country*>(0), static_cast<Country*>(0));
}
- for (unsigned int i=0; i<m_world->getCountries().size(); i++)
- {
- if (i == Attack_SrcCountry)
- {
- src = m_world->getCountries().at(i);
- }
- if (i == Attack_DestCountry)
- {
- dest = m_world->getCountries().at(i);
- }
- }
+ // if-clauses to intimate previus behaviour, maybe unnecessary
+ if ( (Attack_SrcCountry>=0) && (Attack_SrcCountry<m_world->getCountries().size() )
+ src = m_world->getCountries().at(Attack_SrcCountry);
+ if ( (Attack_DestCountry>=0) && (Attack_DestCountry<m_world->getCountries().size() )
+ dest = m_world->getCountries().at(Attack_DestCountry);
// kDebug() << "choosed belligerants " << src << " and " << dest << endl;
return std::make_pair(src,dest);
}
_______________________________________________
kde-games-devel mailing list
kde-games-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-games-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic