1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Remove pointer to objects from TerrainTile

This commit is contained in:
Ivan Savenko
2025-03-19 14:40:45 +00:00
parent 63d00b080e
commit cd7732456a
26 changed files with 164 additions and 113 deletions

View File

@@ -96,8 +96,7 @@ struct DLL_LINKAGE TerrainTile
/// Checks for blocking objects and terraint type (water / land).
bool isClear(const TerrainTile * from = nullptr) const;
/// Gets the ID of the top visitable object or -1 if there is none.
Obj topVisitableId(bool excludeTop = false) const;
CGObjectInstance * topVisitableObj(bool excludeTop = false) const;
ObjectInstanceID topVisitableObj(bool excludeTop = false) const;
inline bool isWater() const;
inline bool isLand() const;
EDiggingStatus getDiggingStatus(bool excludeTop = true) const;
@@ -127,8 +126,8 @@ struct DLL_LINKAGE TerrainTile
/// 7th bit - whether tile is coastal (allows disembarking if land or block movement if water); 8th bit - Favorable Winds effect
ui8 extTileFlags;
std::vector<CGObjectInstance *> visitableObjects;
std::vector<CGObjectInstance *> blockingObjects;
std::vector<ObjectInstanceID> visitableObjects;
std::vector<ObjectInstanceID> blockingObjects;
template <typename Handler>
void serialize(Handler & h)