Explorar o código

Attempt to track down crash on battle end

Ivan Savenko hai 1 ano
pai
achega
3afbd03089
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      server/battles/BattleResultProcessor.cpp

+ 3 - 0
server/battles/BattleResultProcessor.cpp

@@ -142,6 +142,9 @@ CasualtiesAfterBattle::CasualtiesAfterBattle(const CBattleInfoCallback & battle,
 
 
 void CasualtiesAfterBattle::updateArmy(CGameHandler *gh)
 void CasualtiesAfterBattle::updateArmy(CGameHandler *gh)
 {
 {
+	if (gh->getObjInstance(army->id) == nullptr)
+		throw std::runtime_error("Object " + army->getObjectName() + " is not on the map!");
+
 	for (TStackAndItsNewCount &ncount : newStackCounts)
 	for (TStackAndItsNewCount &ncount : newStackCounts)
 	{
 	{
 		if (ncount.second > 0)
 		if (ncount.second > 0)