Преглед на файлове

Add extra clientside sanity check (should be there from thestart)

Dydzio преди 1 година
родител
ревизия
e87ed1e80c
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      client/widgets/CExchangeController.cpp

+ 4 - 0
client/widgets/CExchangeController.cpp

@@ -79,6 +79,10 @@ void CExchangeController::moveArmy(bool leftToRight, std::optional<SlotID> heldS
 			});
 		heldSlot = weakestSlot->first;
 	}
+	
+	if (source->getCreature(heldSlot.value()) == nullptr)
+		return;
+
 	LOCPLINT->cb->bulkMoveArmy(source->id, target->id, heldSlot.value());
 }