瀏覽代碼

CasualtiesAfterBattle: dont remove catapult artifact. Fix 2346 issue

ArseniyShestakov 10 年之前
父節點
當前提交
5aadc1ed6f
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 0 1
      AI/VCAI/VCAI.cpp
  2. 2 1
      server/CGameHandler.cpp

+ 0 - 1
AI/VCAI/VCAI.cpp

@@ -1054,7 +1054,6 @@ void VCAI::pickBestArtifacts(const CGHeroInstance * h, const CGHeroInstance * ot
 
 				if(location.slot == ArtifactPosition::MACH4) // don't attempt to move catapult
 					continue;
-				//FIXME: why do we really attempt to move catapults between heroes in first case?
 
 				auto s = location.getSlot();
 				if (!s || s->locked) //we can't move locks

+ 2 - 1
server/CGameHandler.cpp

@@ -5846,7 +5846,8 @@ CasualtiesAfterBattle::CasualtiesAfterBattle(const CArmedInstance *army, BattleI
 		if (!st->count && !st->base) //we can imagine stacks of war mahcines that are not spawned by artifacts?
 		{
 			auto warMachine = VLC->arth->creatureToMachineID(st->type->idNumber);
-			if (warMachine != ArtifactID::NONE)
+			//catapult artifact remain even if "creature" killed in siege
+			if(warMachine != ArtifactID::NONE && warMachine != ArtifactID::CATAPULT)
 			{
 				auto hero = dynamic_cast<const CGHeroInstance*> (army);
 				if (hero)