1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Use exact position of object to remove + add object name to list of objects to remove

This commit is contained in:
godric3
2024-09-30 19:17:21 +02:00
parent 253af651cc
commit e50ba14bbe
7 changed files with 35 additions and 10 deletions

View File

@ -489,6 +489,16 @@ const CGObjectInstance * CMap::getObjectiveObjectFrom(const int3 & pos, Obj type
return bestMatch;
}
const CGObjectInstance * CMap::getObjectFrom(const int3 & pos)
{
for(CGObjectInstance * object : objects)
{
if(object->pos == pos)
return object;
}
return nullptr;
}
void CMap::checkForObjectives()
{
// NOTE: probably should be moved to MapFormatH3M.cpp