mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
parent
043700f310
commit
869214f44b
@ -839,7 +839,9 @@ void CCreatureHandler::loadStackExp(Bonus & b, BonusList & bl, std::string & src
|
||||
case 'e':
|
||||
b.type = Bonus::DOUBLE_DAMAGE_CHANCE; break;
|
||||
case 'g':
|
||||
b.type = Bonus::SPELL_DAMAGE_REDUCTION; break;
|
||||
b.type = Bonus::SPELL_DAMAGE_REDUCTION;
|
||||
b.subtype = -1; //all magic schools
|
||||
break;
|
||||
case 'R':
|
||||
b.type = Bonus::ADDITIONAL_RETALIATION; break;
|
||||
|
||||
|
@ -798,26 +798,24 @@ DLL_EXPORT void SetObjectProperty::applyGs( CGameState *gs )
|
||||
return;
|
||||
}
|
||||
|
||||
if(what == ObjProperty::OWNER)
|
||||
CArmedInstance *cai = dynamic_cast<CArmedInstance *>(obj);
|
||||
if(what == ObjProperty::OWNER && cai)
|
||||
{
|
||||
if(CArmedInstance *cai = dynamic_cast<CArmedInstance *>(obj))
|
||||
if(obj->ID == TOWNI_TYPE)
|
||||
{
|
||||
if(obj->ID == TOWNI_TYPE)
|
||||
{
|
||||
CGTownInstance *t = static_cast<CGTownInstance*>(obj);
|
||||
if(t->tempOwner < PLAYER_LIMIT)
|
||||
gs->getPlayer(t->tempOwner)->towns -= t;
|
||||
if(val < PLAYER_LIMIT)
|
||||
gs->getPlayer(val)->towns.push_back(t);
|
||||
}
|
||||
|
||||
CBonusSystemNode *nodeToMove = cai->whatShouldBeAttached();
|
||||
nodeToMove->detachFrom(cai->whereShouldBeAttached(gs));
|
||||
obj->setProperty(what,val);
|
||||
nodeToMove->attachTo(cai->whereShouldBeAttached(gs));
|
||||
CGTownInstance *t = static_cast<CGTownInstance*>(obj);
|
||||
if(t->tempOwner < PLAYER_LIMIT)
|
||||
gs->getPlayer(t->tempOwner)->towns -= t;
|
||||
if(val < PLAYER_LIMIT)
|
||||
gs->getPlayer(val)->towns.push_back(t);
|
||||
}
|
||||
|
||||
CBonusSystemNode *nodeToMove = cai->whatShouldBeAttached();
|
||||
nodeToMove->detachFrom(cai->whereShouldBeAttached(gs));
|
||||
obj->setProperty(what,val);
|
||||
nodeToMove->attachTo(cai->whereShouldBeAttached(gs));
|
||||
}
|
||||
else
|
||||
else //not an armed instance
|
||||
{
|
||||
obj->setProperty(what,val);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user