fix 6x69 client ID check

This commit is contained in:
Martin Michelsen
2023-12-22 15:26:03 -08:00
parent cf0588afc8
commit d7bdbf19d1
2 changed files with 2 additions and 5 deletions
+1 -4
View File
@@ -1017,10 +1017,7 @@ static void on_npc_control(shared_ptr<Client> c, uint8_t command, uint8_t flag,
if (!l->is_game()) {
throw runtime_error("cannot create NPCs in the lobby");
}
if (cmd.npc_client_id >= 4) {
throw runtime_error("NPC client ID is not valid");
}
if (l->clients[cmd.npc_client_id]) {
if ((cmd.npc_entity_id < 4) && l->clients[cmd.npc_entity_id]) {
throw runtime_error("cannot overwrite existing player with NPC");
}
forward_subcommand(c, command, flag, data, size);