1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Merge pull request #1590 from vcmi/fix-1579

#1579 - check z coord as well
This commit is contained in:
Andrii Danylchenko 2023-02-18 14:31:31 +02:00 committed by GitHub
commit 3033b9751e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1865,6 +1865,9 @@ void CGameState::placeHeroesInTowns()
{
for(CGTownInstance *t : k->second.towns)
{
if(h->visitablePos().z != t->visitablePos().z)
continue;
bool heroOnTownBlockableTile = t->blockingAt(h->visitablePos().x, h->visitablePos().y);
// current hero position is at one of blocking tiles of current town
@ -1896,6 +1899,9 @@ void CGameState::initVisitingAndGarrisonedHeroes()
{
for(CGTownInstance *t : k->second.towns)
{
if(h->visitablePos().z != t->visitablePos().z)
continue;
if (t->visitableAt(h->visitablePos().x, h->visitablePos().y))
{
assert(t->visitingHero == nullptr);