1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

server queries is now stored as unique_ptr

This commit is contained in:
Ivan Savenko
2023-07-24 00:10:01 +03:00
parent e8e6c02a4a
commit c217d7717a
6 changed files with 47 additions and 32 deletions

View File

@@ -9,6 +9,7 @@
*/
#include "StdInc.h"
#include "../lib/gameState/CGameState.h"
#include "CQuery.h"
#include "CGameHandler.h"
#include "ServerSpellCastEnvironment.h"
@@ -90,8 +91,8 @@ bool ServerSpellCastEnvironment::moveHero(ObjectInstanceID hid, int3 dst, bool t
void ServerSpellCastEnvironment::genericQuery(Query * request, PlayerColor color, std::function<void(const JsonNode&)> callback)
{
auto query = std::make_shared<CGenericQuery>(&gh->queries, color, callback);
auto query = std::make_shared<CGenericQuery>(gh->queries.get(), color, callback);
request->queryID = query->queryID;
gh->queries.addQuery(query);
gh->queries->addQuery(query);
gh->sendAndApply(request);
}