mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-26 22:57:00 +02:00
Simplified code
This commit is contained in:
parent
45c971a405
commit
6d6137accc
@ -1383,10 +1383,8 @@ bool CGameState::checkForVictory(const PlayerColor & player, const EventConditio
|
||||
int total = 0; //creature counter
|
||||
for(auto object : map->objects)
|
||||
{
|
||||
const CArmedInstance *ai = nullptr;
|
||||
if(object
|
||||
&& object->tempOwner == player //object controlled by player
|
||||
&& (ai = dynamic_cast<const CArmedInstance *>(object.get()))) //contains army
|
||||
const CArmedInstance *ai = dynamic_cast<const CArmedInstance *>(object.get());
|
||||
if(ai && ai->getOwner() == player)
|
||||
{
|
||||
for(const auto & elem : ai->Slots()) //iterate through army
|
||||
if(elem.second->getId() == condition.objectType.as<CreatureID>()) //it's searched creature
|
||||
|
Loading…
Reference in New Issue
Block a user