From b4839dadccf966818b3740cdacc4952e7c30aeed Mon Sep 17 00:00:00 2001 From: ephphatha Date: Sat, 6 Aug 2022 17:37:46 +1000 Subject: [PATCH] Dedupe operate object network commands --- Source/msg.cpp | 2 -- Source/msg.h | 6 ------ Source/objects.cpp | 4 ++-- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/Source/msg.cpp b/Source/msg.cpp index 1c2636592..590bece7e 100644 --- a/Source/msg.cpp +++ b/Source/msg.cpp @@ -2534,7 +2534,6 @@ void DeltaLoadLevel() switch (it->second.bCmd) { case CMD_OPENDOOR: case CMD_OPERATEOBJ: - case CMD_PLROPOBJ: DeltaSyncOpObject(*object); it++; break; @@ -3038,7 +3037,6 @@ size_t ParseCmd(int pnum, const TCmd *pCmd) case CMD_OPENDOOR: case CMD_CLOSEDOOR: case CMD_OPERATEOBJ: - case CMD_PLROPOBJ: return OnOperateObject(*pCmd, pnum); case CMD_BREAKOBJ: return OnBreakObject(*pCmd, pnum); diff --git a/Source/msg.h b/Source/msg.h index d0309793e..c13f8b8b1 100644 --- a/Source/msg.h +++ b/Source/msg.h @@ -266,12 +266,6 @@ enum _cmd_id : uint8_t { // int8_t x // int8_t y CMD_OPERATEOBJ, - // Player operate object. - // - // body (TCmdLoc): - // int8_t x - // int8_t y - CMD_PLROPOBJ, // Break object. // // body (TCmdLoc): diff --git a/Source/objects.cpp b/Source/objects.cpp index 83f65bf9a..39880b6f9 100644 --- a/Source/objects.cpp +++ b/Source/objects.cpp @@ -2105,7 +2105,7 @@ void OperateChest(const Player &player, Object &chest, bool sendLootMsg) chest._oTrapFlag = false; } if (&player == MyPlayer) - NetSendCmdLoc(MyPlayerId, false, CMD_PLROPOBJ, chest.position); + NetSendCmdLoc(MyPlayerId, false, CMD_OPERATEOBJ, chest.position); } void OperateMushroomPatch(const Player &player, Object &mushroomPatch) @@ -3090,7 +3090,7 @@ void OperateShrine(Player &player, Object &shrine, _sfx_id sType) } if (&player == MyPlayer) - NetSendCmdLoc(MyPlayerId, false, CMD_PLROPOBJ, shrine.position); + NetSendCmdLoc(MyPlayerId, false, CMD_OPERATEOBJ, shrine.position); } void OperateBookStand(Object &bookStand, bool sendmsg, bool sendLootMsg)