Browse Source

fix: read map first

tags/0.1.0
DragonAura GitHub 2 years ago
parent
commit
f114499b28
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      CAPI/API/src/logic.cpp

+ 2
- 2
CAPI/API/src/logic.cpp View File

@@ -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;
}
}
}

Loading…
Cancel
Save