remove 6x69 command 01 check

This commit is contained in:
Martin Michelsen
2024-01-24 21:09:01 -08:00
parent 082f88d242
commit 6ac2ceca45
+3 -16
View File
@@ -1275,22 +1275,9 @@ static void on_npc_control(shared_ptr<Client> c, uint8_t command, uint8_t flag,
throw runtime_error("cannot create or modify NPC in the lobby");
}
int32_t npc_entity_id = -1;
switch (cmd.command) {
case 0:
case 3:
npc_entity_id = cmd.param2;
break;
case 1:
npc_entity_id = cmd.param1;
break;
case 2:
break;
default:
throw runtime_error("invalid 6x69 command");
}
if ((npc_entity_id >= 0) && (npc_entity_id < 4) && l->clients[npc_entity_id]) {
throw runtime_error("cannot create or modify NPC in existing player slot");
if ((cmd.command == 0 || cmd.command == 3) &&
((cmd.param2 >= 0) && (cmd.param2 < 4) && l->clients[cmd.param2])) {
throw runtime_error("cannot create NPC in existing player slot");
}
forward_subcommand(c, command, flag, data, size);