diff --git a/CAPI/API/src/logic.cpp b/CAPI/API/src/logic.cpp index 9046c6d..8ea0860 100644 --- a/CAPI/API/src/logic.cpp +++ b/CAPI/API/src/logic.cpp @@ -22,7 +22,7 @@ Logic::Logic(THUAI6::PlayerType type, int64_t ID, THUAI6::ButcherType butcher, T std::vector> Logic::GetButchers() const { - std::lock_guard lock(mtxBuffer); + std::lock_guard lock(mtxState); std::vector> temp; temp.assign(currentState->butchers.begin(), currentState->butchers.end()); logger->debug("Called GetButchers"); @@ -31,7 +31,7 @@ std::vector> Logic::GetButchers() const std::vector> Logic::GetHumans() const { - std::unique_lock lock(mtxBuffer); + std::unique_lock lock(mtxState); std::vector> temp; temp.assign(currentState->humans.begin(), currentState->humans.end()); logger->debug("Called GetHumans"); @@ -40,7 +40,7 @@ std::vector> Logic::GetHumans() const std::vector> Logic::GetProps() const { - std::unique_lock lock(mtxBuffer); + std::unique_lock lock(mtxState); std::vector> temp; temp.assign(currentState->props.begin(), currentState->props.end()); logger->debug("Called GetProps"); @@ -49,28 +49,28 @@ std::vector> Logic::GetProps() const std::shared_ptr Logic::HumanGetSelfInfo() const { - std::unique_lock lock(mtxBuffer); + std::unique_lock lock(mtxState); logger->debug("Called HumanGetSelfInfo"); return currentState->humanSelf; } std::shared_ptr Logic::ButcherGetSelfInfo() const { - std::unique_lock lock(mtxBuffer); + std::unique_lock lock(mtxState); logger->debug("Called ButcherGetSelfInfo"); return currentState->butcherSelf; } std::vector> Logic::GetFullMap() const { - std::unique_lock lock(mtxBuffer); + std::unique_lock lock(mtxState); logger->debug("Called GetFullMap"); return currentState->gamemap; } THUAI6::PlaceType Logic::GetPlaceType(int32_t CellX, int32_t CellY) const { - std::unique_lock lock(mtxBuffer); + std::unique_lock lock(mtxState); logger->debug("Called GetPlaceType"); return currentState->gamemap[CellX][CellY]; }