1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Mapping of deletable coordinates to objects on map start

This commit is contained in:
Dydzio
2024-09-26 20:05:46 +02:00
parent cf5ce96aeb
commit 9004b88c7e
4 changed files with 34 additions and 9 deletions

View File

@@ -62,16 +62,9 @@ void NewTurnProcessor::handleTimeEvents(PlayerColor color)
}
//remove objects specified by event
for(int3 coordinate : event.deletedObjectsCoordinates)
for(const CGObjectInstance * objectToRemove : event.deletedObjectsInstances)
{
if(gameHandler->isInTheMap(coordinate))
{
auto objects = gameHandler->getBlockingObjs(coordinate);
for(const CGObjectInstance * object : objects)
{
gameHandler->removeObject(object, PlayerColor::NEUTRAL);
}
}
gameHandler->removeObject(objectToRemove, PlayerColor::NEUTRAL);
}
gameHandler->sendAndApply(&iw); //show dialog
}