Browse Source

Dedupe operate object network commands

pull/5209/head
ephphatha 4 years ago committed by Anders Jenbo
parent
commit
b4839dadcc
  1. 2
      Source/msg.cpp
  2. 6
      Source/msg.h
  3. 4
      Source/objects.cpp

2
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);

6
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):

4
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)

Loading…
Cancel
Save