mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-29 00:41:38 +02:00
bugfixing:
- fixed parsing of campaign bonuses (conversion to building ID) - CONTROL event condition can be also fulfilled by allies - fix for crash on opening exchange window in Russian version
This commit is contained in:
@ -2438,16 +2438,20 @@ bool CGameState::checkForVictory( PlayerColor player, const EventCondition & con
|
||||
}
|
||||
case EventCondition::CONTROL:
|
||||
{
|
||||
// list of players that need to control object to fulfull condition
|
||||
// NOTE: cgameinfocallback specified explicitly in order to get const version
|
||||
auto & team = CGameInfoCallback::getPlayerTeam(player)->players;
|
||||
|
||||
if (condition.object) // mode A - flag one specific object, like town
|
||||
{
|
||||
return condition.object->tempOwner == player;
|
||||
return team.count(condition.object->tempOwner) != 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
for(auto & elem : map->objects) // mode B - flag all objects of this type
|
||||
{
|
||||
//check not flagged objs
|
||||
if(elem && elem->tempOwner != player && elem->ID == condition.objectType)
|
||||
if ( elem && elem->ID == condition.objectType && team.count(elem->tempOwner) == 0 )
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user