1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-15 20:03:15 +02:00

Do not summon boat from another boat, fixes #2294 (#353)

This commit is contained in:
Piotr
2017-07-22 22:47:29 +02:00
committed by ArseniyShestakov
parent 747ef0d222
commit 069f295165

View File

@@ -136,6 +136,16 @@ SummonBoatMechanics::SummonBoatMechanics(const CSpell * s):
ESpellCastResult SummonBoatMechanics::applyAdventureEffects(const SpellCastEnvironment * env, const AdventureSpellCastParameters & parameters) const
{
if(parameters.caster->boat)
{
InfoWindow iw;
iw.player = parameters.caster->tempOwner;
iw.text.addTxt(MetaString::GENERAL_TXT, 333);//%s is already in boat
iw.text.addReplacement(parameters.caster->name);
env->sendAndApply(&iw);
return ESpellCastResult::CANCEL;
}
int3 summonPos = parameters.caster->bestLocation();
if(summonPos.x < 0)
{