ソースを参照

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

Piotr 8 年 前
コミット
069f295165
1 ファイル変更10 行追加0 行削除
  1. 10 0
      lib/spells/AdventureSpellMechanics.cpp

+ 10 - 0
lib/spells/AdventureSpellMechanics.cpp

@@ -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)
 	{