浏览代码

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

Dydzio 10 月之前
父节点
当前提交
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());
 }