Browse Source

Fix town portal query when it calls level up query

Adriankhl 2 years ago
parent
commit
8d549bf030
2 changed files with 8 additions and 0 deletions
  1. 5 0
      server/CQuery.cpp
  2. 3 0
      server/CQuery.h

+ 5 - 0
server/CQuery.cpp

@@ -535,6 +535,11 @@ void CGenericQuery::onExposure(QueryPtr topQuery)
 }
 
 void CGenericQuery::setReply(const JsonNode & reply)
+{
+	this->reply = reply;
+}
+
+void CGenericQuery::onRemoval(PlayerColor color)
 {
 	callback(reply);
 }

+ 3 - 0
server/CQuery.h

@@ -11,6 +11,7 @@
 #include "../lib/GameConstants.h"
 #include "../lib/int3.h"
 #include "../lib/NetPacks.h"
+#include "JsonNode.h"
 
 VCMI_LIB_NAMESPACE_BEGIN
 
@@ -198,8 +199,10 @@ public:
 	bool endsByPlayerAnswer() const override;
 	void onExposure(QueryPtr topQuery) override;
 	void setReply(const JsonNode & reply) override;
+	void onRemoval(PlayerColor color) override;
 private:
 	std::function<void(const JsonNode &)> callback;
+	JsonNode reply;
 };
 
 class Queries