mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-19 00:17:56 +02:00
Fixes for handling of oversized map dwellings
- Marked large version of H3 Unicorn's Glade as not usable for random dwelling replacement - Shifted oversized dwellings - that have at most 2x2 as blocked tile, but have non-blocked tile column will now be placed correctly - This fixes incorrect random dwelling replacement of the only oversized H3 dwelling - Portal of Glory - Game will now detect & report invalid dwelling templates from mods - Updated docs to clarify dwellings format
This commit is contained in:
@ -500,6 +500,23 @@ void ObjectTemplate::calculateVisitableOffset()
|
||||
visitableOffset = int3(0, 0, 0);
|
||||
}
|
||||
|
||||
int3 ObjectTemplate::getCornerOffset() const
|
||||
{
|
||||
assert(isVisitable());
|
||||
|
||||
int3 ret = visitableOffset;
|
||||
for (const auto & tile : blockedOffsets)
|
||||
{
|
||||
ret = {
|
||||
std::min(-tile.x, ret.x),
|
||||
std::min(-tile.y, ret.y),
|
||||
ret.z
|
||||
};
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool ObjectTemplate::canBePlacedAt(TerrainId terrainID) const
|
||||
{
|
||||
if (anyLandTerrain)
|
||||
|
Reference in New Issue
Block a user