mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Merge pull request #603 from dydzio0614/AiPrisonValueFix
Fix wrong AI prison value handling
This commit is contained in:
commit
f6ab4c1f63
@ -64,7 +64,12 @@ boost::optional<int> MapObjectsEvaluator::getObjectValue(const CGObjectInstance
|
||||
auto hero = dynamic_cast<const CGHeroInstance*>(obj);
|
||||
return getObjectValue(obj->ID, hero->type->heroClass->id);
|
||||
}
|
||||
if(obj->ID == Obj::CREATURE_GENERATOR1 || obj->ID == Obj::CREATURE_GENERATOR4)
|
||||
else if(obj->ID == Obj::PRISON)
|
||||
{
|
||||
//special case: in-game prison subID is captured hero ID, but config has one subID with index 0 for normal prison - use that one
|
||||
return getObjectValue(obj->ID, 0);
|
||||
}
|
||||
else if(obj->ID == Obj::CREATURE_GENERATOR1 || obj->ID == Obj::CREATURE_GENERATOR4)
|
||||
{
|
||||
auto dwelling = dynamic_cast<const CGDwelling *>(obj);
|
||||
int aiValue = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user