From 82854604b8d9d9a1284b923ea3b7b0203c762034 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Wed, 24 Jan 2024 21:51:37 -0800 Subject: [PATCH] remove unnecessary check --- src/ReceiveSubcommands.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ReceiveSubcommands.cc b/src/ReceiveSubcommands.cc index 28847a92..ddba8d07 100644 --- a/src/ReceiveSubcommands.cc +++ b/src/ReceiveSubcommands.cc @@ -1275,8 +1275,7 @@ static void on_npc_control(shared_ptr c, uint8_t command, uint8_t flag, throw runtime_error("cannot create or modify NPC in the lobby"); } - if ((cmd.command == 0 || cmd.command == 3) && - ((cmd.param2 >= 0) && (cmd.param2 < 4) && l->clients[cmd.param2])) { + if ((cmd.command == 0 || cmd.command == 3) && ((cmd.param2 < 4) && l->clients[cmd.param2])) { throw runtime_error("cannot create NPC in existing player slot"); }