1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-21 00:19:29 +02:00

Move visit query to a separate class, remove no longer needed Cast.h

This commit is contained in:
Ivan Savenko
2024-09-04 14:32:36 +00:00
parent 29f87d6407
commit 81af66d35b
13 changed files with 109 additions and 117 deletions

View File

@ -14,7 +14,6 @@
#include "../CGameHandler.h"
#include "../../lib/serializer/Cast.h"
#include "../../lib/networkPacks/PacksForServer.h"
std::ostream & operator<<(std::ostream & out, const CQuery & query)
@ -116,7 +115,7 @@ void CQuery::setReply(std::optional<int32_t> reply)
bool CQuery::blockAllButReply(const CPack * pack) const
{
//We accept only query replies from correct player
if(auto reply = dynamic_ptr_cast<QueryReply>(pack))
if(auto reply = dynamic_cast<const QueryReply*>(pack))
return !vstd::contains(players, reply->player);
return true;