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

Function OnBreakObject

Source/msg.cpp:1874–1893  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1872}
1873
1874size_t OnBreakObject(const TCmd &pCmd, size_t pnum)
1875{
1876 const auto &message = reinterpret_cast<const TCmdLoc &>(pCmd);
1877
1878 if (gbBufferMsgs == 1) {
1879 SendPacket(pnum, &message, sizeof(message));
1880 } else {
1881 Player &player = Players[pnum];
1882 WorldTilePosition position { message.x, message.y };
1883 assert(InDungeonBounds(position));
1884 if (player.isOnActiveLevel()) {
1885 Object *object = FindObjectAtPosition(position);
1886 if (object != nullptr)
1887 SyncBreakObj(player, *object);
1888 }
1889 DeltaSyncObject(position, CMD_BREAKOBJ, player);
1890 }
1891
1892 return sizeof(message);
1893}
1894
1895size_t OnChangePlayerItems(const TCmd *pCmd, size_t pnum)
1896{

Callers 1

ParseCmdFunction · 0.85

Calls 6

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

Tested by

no test coverage detected