mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Do not place guardes treasure on roads. Do not place guards next to roads.
This commit is contained in:
@@ -417,6 +417,24 @@ void rmg::Object::setGuardedIfMonster(const Instance& object)
|
||||
}
|
||||
}
|
||||
|
||||
int3 rmg::Object::getGuardPos() const
|
||||
{
|
||||
if (guarded)
|
||||
{
|
||||
for (auto & instance : dInstances)
|
||||
{
|
||||
if (instance.object().ID == Obj::MONSTER)
|
||||
{
|
||||
return instance.object().pos;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return int3(-1,-1,-1);
|
||||
}
|
||||
}
|
||||
|
||||
void Object::Instance::finalize(RmgMap & map, CRandomGenerator & rng)
|
||||
{
|
||||
if(!map.isOnMap(getPosition(true)))
|
||||
|
||||
Reference in New Issue
Block a user