From f838ccedddd4fa7a8637f5a97e017958a064125f Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Thu, 17 Oct 2013 13:54:12 +0000 Subject: [PATCH] - fixes Inferno Castle Gate --- client/CCastleInterface.cpp | 1 + server/CGameHandler.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/client/CCastleInterface.cpp b/client/CCastleInterface.cpp index f3c8069be..e29a9d144 100644 --- a/client/CCastleInterface.cpp +++ b/client/CCastleInterface.cpp @@ -924,6 +924,7 @@ void CCastleInterface::castleTeleport(int where) { const CGTownInstance * dest = LOCPLINT->cb->getTown(ObjectInstanceID(where)); LOCPLINT->cb->teleportHero(town->visitingHero, dest); + LOCPLINT->eraseCurrentPathOf(town->visitingHero, false); } void CCastleInterface::townChange() diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index 964ae8abc..2d3516043 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -1794,9 +1794,9 @@ bool CGameHandler::teleportHero(ObjectInstanceID hid, ObjectInstanceID dstid, ui const CGTownInstance *from = h->visitedTown; if(((h->getOwner() != t->getOwner()) && complain("Cannot teleport hero to another player")) - || ((!from || from->hasBuilt(BuildingID::CASTLE_GATE, ETownType::INFERNO)) + || ((!from || !from->hasBuilt(BuildingID::CASTLE_GATE, ETownType::INFERNO)) && complain("Hero must be in town with Castle gate for teleporting")) - || (t->hasBuilt(BuildingID::CASTLE_GATE, ETownType::INFERNO) + || (!t->hasBuilt(BuildingID::CASTLE_GATE, ETownType::INFERNO) && complain("Cannot teleport hero to town without Castle gate in it"))) return false; int3 pos = t->visitablePos();