| 1872 | } |
| 1873 | |
| 1874 | size_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 | |
| 1895 | size_t OnChangePlayerItems(const TCmd *pCmd, size_t pnum) |
| 1896 | { |
no test coverage detected