mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-14 02:33:51 +02:00
- fixes Inferno Castle Gate
This commit is contained in:
parent
40d3290a35
commit
f838cceddd
@ -924,6 +924,7 @@ void CCastleInterface::castleTeleport(int where)
|
|||||||
{
|
{
|
||||||
const CGTownInstance * dest = LOCPLINT->cb->getTown(ObjectInstanceID(where));
|
const CGTownInstance * dest = LOCPLINT->cb->getTown(ObjectInstanceID(where));
|
||||||
LOCPLINT->cb->teleportHero(town->visitingHero, dest);
|
LOCPLINT->cb->teleportHero(town->visitingHero, dest);
|
||||||
|
LOCPLINT->eraseCurrentPathOf(town->visitingHero, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CCastleInterface::townChange()
|
void CCastleInterface::townChange()
|
||||||
|
@ -1794,9 +1794,9 @@ bool CGameHandler::teleportHero(ObjectInstanceID hid, ObjectInstanceID dstid, ui
|
|||||||
const CGTownInstance *from = h->visitedTown;
|
const CGTownInstance *from = h->visitedTown;
|
||||||
if(((h->getOwner() != t->getOwner())
|
if(((h->getOwner() != t->getOwner())
|
||||||
&& complain("Cannot teleport hero to another player"))
|
&& 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"))
|
&& 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")))
|
&& complain("Cannot teleport hero to town without Castle gate in it")))
|
||||||
return false;
|
return false;
|
||||||
int3 pos = t->visitablePos();
|
int3 pos = t->visitablePos();
|
||||||
|
Loading…
Reference in New Issue
Block a user