fix invalid players from showing up in api response

This commit is contained in:
Aaron Kimbre 2025-01-15 15:50:30 -06:00
parent 9542216650
commit 3faf9eea45

View File

@ -17,7 +17,11 @@ void to_json(json& data, const PlayerData& playerData) {
}
void to_json(json& data, const PlayerContainer& playerContainer) {
data = playerContainer.GetAllPlayers();
data = json::array();
for(auto& playerData : playerContainer.GetAllPlayers()) {
if (playerData.first == LWOOBJID_EMPTY) continue;
data.push_back(playerData.second);
}
}
void to_json(json& data, const TeamContainer& teamContainer) {