mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Show popup dialog instead of server error when using TP from water
This commit is contained in:
parent
6c45353aa7
commit
3fc4383153
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user