| 1851 | } |
| 1852 | |
| 1853 | size_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 | |
| 1874 | size_t OnBreakObject(const TCmd &pCmd, size_t pnum) |
| 1875 | { |
no test coverage detected