1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Do not place object visible tiles over the top of the map.

This commit is contained in:
Tomasz Zieliński
2023-04-10 19:26:53 +02:00
parent 9ea746a68c
commit 3c87b3934d
7 changed files with 57 additions and 1 deletions

View File

@@ -87,7 +87,12 @@ public:
inline int3 getBlockMapOffset() const
{
return blockMapOffset;
};
};
inline int3 getTopVisibleOffset() const
{
return topVisibleOffset;
}
// Checks if object is visitable from certain direction. X and Y must be between -1..+1
bool isVisitableFrom(si8 X, si8 Y) const;
@@ -137,6 +142,7 @@ private:
std::set<int3> blockedOffsets;
int3 blockMapOffset;
int3 visitableOffset;
int3 topVisibleOffset;
void recalculate();
@@ -146,6 +152,7 @@ private:
void calculateBlockedOffsets();
void calculateBlockMapOffset();
void calculateVisitableOffset();
void calculateTopVisibleOffset();
public:
template <typename Handler> void serialize(Handler &h, const int version)