From f114499b28f96a87e25e9233cf5454c55eb2d22d Mon Sep 17 00:00:00 2001 From: DragonAura <32223554+DragonAura@users.noreply.github.com> Date: Sat, 17 Dec 2022 20:22:25 +0800 Subject: [PATCH] fix: read map first --- CAPI/API/src/logic.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CAPI/API/src/logic.cpp b/CAPI/API/src/logic.cpp index b41d9d8..51a57e2 100644 --- a/CAPI/API/src/logic.cpp +++ b/CAPI/API/src/logic.cpp @@ -230,6 +230,7 @@ void Logic::LoadBuffer(protobuf::MessageToClient& message) std::cout << "Buffer clear!" << std::endl; // 读取新的信息 // 读取消息的选择待补充,之后需要另外判断;具体做法应该是先读到自己,然后按照自己的视野做处理。此处暂时全部读了进来 + bufferState->gamemap = Proto2THUAI6::Protobuf2THUAI6Map(message.map_message()); if (playerType == THUAI6::PlayerType::HumanPlayer) { for (auto itr = message.human_message().begin(); itr != message.human_message().end(); itr++) @@ -318,7 +319,6 @@ void Logic::LoadBuffer(protobuf::MessageToClient& message) } } } - bufferState->gamemap = Proto2THUAI6::Protobuf2THUAI6Map(message.map_message()); if (asynchronous) { { @@ -457,4 +457,4 @@ void Logic::Main(CreateAIFunc createAI, std::string IP, std::string port) std::cout << "Connection error!" << std::endl; return; } -} \ No newline at end of file +}