From 7210441878e2ef1e9f7091fc90ae6ebff7385a3e Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Wed, 5 Nov 2025 23:06:17 -0800 Subject: [PATCH] allow 6x17 for enemies and objects --- src/ReceiveSubcommands.cc | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/ReceiveSubcommands.cc b/src/ReceiveSubcommands.cc index 53223ace..99e42d09 100644 --- a/src/ReceiveSubcommands.cc +++ b/src/ReceiveSubcommands.cc @@ -3750,11 +3750,8 @@ static asio::awaitable on_set_entity_pos_and_angle_6x17(shared_ptr } // 6x17 is used to transport players to the other part of the Vol Opt boss - // arena, so phase 2 can begin. We only allow 6x17 if the sender is the - // leader and both players (sender and receiver) are in the Vol Opt arena. - if (cmd.header.entity_id >= 0x1000) { - throw runtime_error("client sent 6x17 command affecting a non-player entity"); - } + // arena, so phase 2 can begin. We only allow 6x17 in the Monitor Room (Vol + // Opt arena). if (l->episode != Episode::EP1) { throw runtime_error("client sent 6x17 command in non-Ep1 game"); } @@ -3764,11 +3761,13 @@ static asio::awaitable on_set_entity_pos_and_angle_6x17(shared_ptr // If the target is on a different floor or does not exist, just drop the // command instead of raising; this could have been due to a data race - auto target = l->clients.at(cmd.header.entity_id); - if (!target || target->floor != c->floor) { - co_return; + if (cmd.header.entity_id < 0x1000) { + auto target = l->clients.at(cmd.header.entity_id); + if (!target || target->floor != c->floor) { + co_return; + } + target->pos = cmd.pos; } - target->pos = cmd.pos; co_await forward_subcommand_with_entity_id_transcode_t(c, msg); }