[WIP] Convert most of Chunking to Entity-based system

Player and all NPCs now have a common superclass, with virtual functions
so smooth over shared behavior. EntityRef is a simple class that points
to an arbitrary Entity.

This commit is not yet functional.
This commit is contained in:
2021-03-21 02:42:45 +01:00
parent 49f1cb0f00
commit 224ffe05e7
13 changed files with 394 additions and 365 deletions

View File

@@ -165,7 +165,7 @@ static void transportWarpHandler(CNSocket* sock, CNPacketData* data) {
if (target == nullptr)
return;
// we warped; update position and chunks
Chunking::updatePlayerChunk(sock, plr->chunkPos, std::make_tuple(0, 0, 0)); // force player to reload chunks
Chunking::updateEntityChunk({sock}, plr->chunkPos, std::make_tuple(0, 0, 0)); // force player to reload chunks
PlayerManager::updatePlayerPosition(sock, target->x, target->y, target->z, INSTANCE_OVERWORLD, plr->angle);
}