diff --git a/src/ChatCommands.cc b/src/ChatCommands.cc index 1d674ea1..dcc1628e 100644 --- a/src/ChatCommands.cc +++ b/src/ChatCommands.cc @@ -1513,7 +1513,7 @@ static void server_command_infinite_hp(shared_ptr c, const std::string&) c->config.toggle_flag(Client::Flag::INFINITE_HP_ENABLED); bool enabled = c->config.check_flag(Client::Flag::INFINITE_HP_ENABLED); send_text_message_printf(c, "$C6Infinite HP %s", enabled ? "enabled" : "disabled"); - if (enabled && l->is_game()) { + if (enabled && l->is_game() && is_v1_or_v2(c->version())) { send_remove_conditions(c); } } @@ -1524,7 +1524,7 @@ static void proxy_command_infinite_hp(shared_ptr ses ses->config.toggle_flag(Client::Flag::INFINITE_HP_ENABLED); bool enabled = ses->config.check_flag(Client::Flag::INFINITE_HP_ENABLED); send_text_message_printf(ses->client_channel, "$C6Infinite HP %s", enabled ? "enabled" : "disabled"); - if (enabled && ses->is_in_game) { + if (enabled && ses->is_in_game && is_v1_or_v2(ses->version())) { send_remove_conditions(ses->client_channel, ses->lobby_client_id); send_remove_conditions(ses->server_channel, ses->lobby_client_id); } diff --git a/src/ProxyCommands.cc b/src/ProxyCommands.cc index 33c34bb8..c772c2a8 100644 --- a/src/ProxyCommands.cc +++ b/src/ProxyCommands.cc @@ -1717,7 +1717,7 @@ static HandlerResult C_6x(shared_ptr ses, uint16_t c ses->floor = cmd.floor; } else if (data[0] == 0x0C) { - if (ses->config.check_flag(Client::Flag::INFINITE_HP_ENABLED)) { + if (is_v1_or_v2(ses->version()) && ses->config.check_flag(Client::Flag::INFINITE_HP_ENABLED)) { send_remove_conditions(ses->client_channel, ses->lobby_client_id); send_remove_conditions(ses->server_channel, ses->lobby_client_id); } diff --git a/src/ReceiveSubcommands.cc b/src/ReceiveSubcommands.cc index 0b240b1b..2f7ef119 100644 --- a/src/ReceiveSubcommands.cc +++ b/src/ReceiveSubcommands.cc @@ -1183,7 +1183,7 @@ static void on_received_condition(shared_ptr c, uint8_t command, uint8_t auto l = c->require_lobby(); if (l->is_game()) { forward_subcommand(c, command, flag, data, size); - if (cmd.client_id == c->lobby_client_id) { + if (is_v1_or_v2(c->version()) && (cmd.client_id == c->lobby_client_id)) { bool player_cheats_enabled = l->check_flag(Lobby::Flag::CHEATS_ENABLED) || (c->license->flags & License::Flag::CHEAT_ANYWHERE); if (player_cheats_enabled && c->config.check_flag(Client::Flag::INFINITE_HP_ENABLED)) { send_remove_conditions(c); diff --git a/tests/GC-Episode2PrivateDrops2P.test.txt b/tests/GC-Episode2PrivateDrops2P.test.txt index 9657eba9..5e8e45b6 100644 --- a/tests/GC-Episode2PrivateDrops2P.test.txt +++ b/tests/GC-Episode2PrivateDrops2P.test.txt @@ -5270,16 +5270,6 @@ I 94381 2023-12-29 15:39:50 - [Commands] Sending to C-2 (Jess) (version=GC_V3 co 0000 | B0 00 24 00 00 00 00 00 00 00 00 00 09 43 36 49 | $ C6I 0010 | 6E 66 69 6E 69 74 65 20 48 50 20 65 6E 61 62 6C | nfinite HP enabl 0020 | 65 64 00 00 | ed -I 94381 2023-12-29 15:39:50 - [Commands] Sending to C-2 (Jess) (version=GC_V3 command=60 flag=00) -0000 | 60 00 34 00 0D 03 00 00 00 00 00 00 00 00 00 00 | ` 4 -0010 | 0D 03 00 00 01 00 00 00 00 00 00 00 0D 03 00 00 | -0020 | 02 00 00 00 00 00 00 00 0D 03 00 00 03 00 00 00 | -0030 | 00 00 00 00 | -I 94381 2023-12-29 15:39:50 - [Commands] Sending to C-5 (Jonah) (version=GC_V3 command=60 flag=00) -0000 | 60 00 34 00 0D 03 00 00 00 00 00 00 00 00 00 00 | ` 4 -0010 | 0D 03 00 00 01 00 00 00 00 00 00 00 0D 03 00 00 | -0020 | 02 00 00 00 00 00 00 00 0D 03 00 00 03 00 00 00 | -0030 | 00 00 00 00 | I 94381 2023-12-29 15:39:51 - [Commands] Received from C-5 (Jonah) (version=GC_V3 command=60 flag=00) 0000 | 60 00 14 00 40 04 01 00 6D 1F 81 44 39 99 3B 44 | ` @ m D9 ;D 0010 | 00 00 00 00 | diff --git a/tests/GC-ForestGame.test.txt b/tests/GC-ForestGame.test.txt index 973b0601..2ba91eaf 100644 --- a/tests/GC-ForestGame.test.txt +++ b/tests/GC-ForestGame.test.txt @@ -1200,11 +1200,6 @@ I 49108 2023-05-26 16:19:14 - [Commands] Sending to C-2 (Jess) (version=GC comma 0000 | B0 00 24 00 00 00 00 00 00 00 00 00 09 43 36 49 | $ C6I 0010 | 6E 66 69 6E 69 74 65 20 48 50 20 65 6E 61 62 6C | nfinite HP enabl 0020 | 65 64 00 00 | ed -I 49108 2023-05-26 16:19:14 - [Commands] Sending to C-2 (Jess) (version=GC command=B0 flag=00) -0000 | 60 00 34 00 0D 03 00 00 00 00 00 00 00 00 00 00 | ` 4 -0010 | 0D 03 00 00 01 00 00 00 00 00 00 00 0D 03 00 00 | -0020 | 02 00 00 00 00 00 00 00 0D 03 00 00 03 00 00 00 | -0030 | 00 00 00 00 | I 49108 2023-05-26 16:19:16 - [Commands] Received from C-2 (Jess) (version=GC command=06 flag=00) 0000 | 06 00 18 00 00 00 00 00 00 00 00 00 09 45 24 69 | E$i 0010 | 6E 66 74 70 00 00 00 00 | nftp