From 40dff8ac1765c460b2330be42a54c41c7a8aff4a Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Wed, 11 Sep 2024 16:08:26 +0000 Subject: [PATCH 1/2] Fix town visit via Town Portal not generating town visit query --- server/CGameHandler.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index 13cf68c43..eaff4edc7 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -973,12 +973,11 @@ bool CGameHandler::moveHero(ObjectInstanceID hid, int3 dst, EMovementMode moveme doMove(TryMoveHero::TELEPORTATION, guardsCheck, DONT_VISIT_DEST, LEAVING_TILE); // visit town for town portal \ castle gates - // do not use generic visitObjectOnTile to avoid double-teleporting - // if this moveHero call was triggered by teleporter + // do not visit any other objects, e.g. monoliths to avoid double-teleporting if (objectToVisit) { if (CGTownInstance * town = dynamic_cast(objectToVisit)) - town->onHeroVisit(h); + objectVisited(town, h); } return true; From 76ee49f4ec784f01f4ab1a779800535f8da8f82b Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Wed, 11 Sep 2024 16:08:49 +0000 Subject: [PATCH 2/2] Do not visit building on forced construction, e.g. from events --- server/CGameHandler.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index eaff4edc7..f7c922684 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -2142,10 +2142,13 @@ bool CGameHandler::buildStructure(ObjectInstanceID tid, BuildingID requestedID, // now when everything is built - reveal tiles for lookout tower changeFogOfWar(t->getSightCenter(), t->getSightRadius(), t->getOwner(), ETileVisibility::REVEALED); - if(t->garrisonHero) //garrison hero first - consistent with original H3 Mana Vortex and Battle Scholar Academy levelup windows order - objectVisited(t, t->garrisonHero); - if(t->visitingHero) - objectVisited(t, t->visitingHero); + if (!force) + { + if(t->garrisonHero) //garrison hero first - consistent with original H3 Mana Vortex and Battle Scholar Academy levelup windows order + objectVisited(t, t->garrisonHero); + if(t->visitingHero) + objectVisited(t, t->visitingHero); + } checkVictoryLossConditionsForPlayer(t->tempOwner); return true;