mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
Show popup dialog instead of server error when using TP from water
This commit is contained in:
@@ -535,6 +535,18 @@ ESpellCastResult TownPortalMechanics::applyAdventureEffects(SpellCastEnvironment
|
||||
return ESpellCastResult::ERROR;
|
||||
}
|
||||
|
||||
const TerrainTile & from = env->getMap()->getTile(parameters.caster->getHeroCaster()->visitablePos());
|
||||
const TerrainTile & dest = env->getMap()->getTile(destination->visitablePos());
|
||||
|
||||
if(!dest.isClear(&from))
|
||||
{
|
||||
InfoWindow iw;
|
||||
iw.player = parameters.caster->getCasterOwner();
|
||||
iw.text.appendLocalString(EMetaText::GENERAL_TXT, 135);
|
||||
env->apply(&iw);
|
||||
return ESpellCastResult::ERROR;
|
||||
}
|
||||
|
||||
return ESpellCastResult::OK;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user