MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / OnOperateObject

Function OnOperateObject

Source/msg.cpp:1853–1872  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1851}
1852
1853size_t OnOperateObject(const TCmd &pCmd, size_t pnum)
1854{
1855 const auto &message = reinterpret_cast<const TCmdLoc &>(pCmd);
1856
1857 if (gbBufferMsgs == 1) {
1858 SendPacket(pnum, &message, sizeof(message));
1859 } else {
1860 Player &player = Players[pnum];
1861 WorldTilePosition position { message.x, message.y };
1862 assert(InDungeonBounds(position));
1863 if (player.isOnActiveLevel()) {
1864 Object *object = FindObjectAtPosition(position);
1865 if (object != nullptr)
1866 SyncOpObject(player, message.bCmd, *object);
1867 }
1868 DeltaSyncObject(position, message.bCmd, player);
1869 }
1870
1871 return sizeof(message);
1872}
1873
1874size_t OnBreakObject(const TCmd &pCmd, size_t pnum)
1875{

Callers 1

ParseCmdFunction · 0.85

Calls 6

InDungeonBoundsFunction · 0.85
FindObjectAtPositionFunction · 0.85
SyncOpObjectFunction · 0.85
DeltaSyncObjectFunction · 0.85
isOnActiveLevelMethod · 0.80
SendPacketFunction · 0.70

Tested by

no test coverage detected