mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2026-01-21 14:20:26 +00:00
[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:
@@ -361,11 +361,12 @@ static void npcRotateCommand(std::string full, std::vector<std::string>& args, C
|
||||
}
|
||||
|
||||
static void refreshCommand(std::string full, std::vector<std::string>& args, CNSocket* sock) {
|
||||
Player* plr = PlayerManager::getPlayer(sock);
|
||||
EntityRef ref = {sock};
|
||||
Entity* plr = ref.getEntity();
|
||||
ChunkPos currentChunk = plr->chunkPos;
|
||||
ChunkPos nullChunk = std::make_tuple(0, 0, 0);
|
||||
Chunking::updatePlayerChunk(sock, currentChunk, nullChunk);
|
||||
Chunking::updatePlayerChunk(sock, nullChunk, currentChunk);
|
||||
Chunking::updateEntityChunk(ref, currentChunk, nullChunk);
|
||||
Chunking::updateEntityChunk(ref, nullChunk, currentChunk);
|
||||
}
|
||||
|
||||
static void instanceCommand(std::string full, std::vector<std::string>& args, CNSocket* sock) {
|
||||
|
||||
Reference in New Issue
Block a user