浏览代码

Remove static variable

Ivan Savenko 4 月之前
父节点
当前提交
790c5cb455
共有 2 个文件被更改,包括 1 次插入2 次删除
  1. 0 2
      client/Client.cpp
  2. 1 0
      client/Client.h

+ 0 - 2
client/Client.cpp

@@ -363,8 +363,6 @@ std::optional<BattleAction> CClient::makeSurrenderRetreatDecision(PlayerColor pl
 
 int CClient::sendRequest(const CPackForServer & request, PlayerColor player, bool waitTillRealize)
 {
-	static ui32 requestCounter = 1;
-
 	ui32 requestID = requestCounter++;
 	logNetwork->trace("Sending a request \"%s\". It'll have an ID=%d.", typeid(request).name(), requestID);
 

+ 1 - 0
client/Client.h

@@ -125,6 +125,7 @@ public:
 class CClient : public Environment, public IClient
 {
 	std::shared_ptr<CGameState> gamestate;
+	int requestCounter = 1;
 public:
 	std::map<PlayerColor, std::shared_ptr<CGameInterface>> playerint;
 	std::map<PlayerColor, std::shared_ptr<CBattleGameInterface>> battleints;