mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-09-27 18:30:08 +00:00
Dynamically allocate the Player struct in PlayerView.
This way we're not always passing it around by value. Note that the Player structs in CNSharedData are still pass-by-reference. Will probably change this later.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
struct PlayerView {
|
||||
std::list<CNSocket*> viewable;
|
||||
std::list<int32_t> viewableNPCs;
|
||||
Player plr;
|
||||
Player *plr;
|
||||
uint64_t lastHeartbeat;
|
||||
};
|
||||
|
||||
@@ -22,9 +22,8 @@ namespace PlayerManager {
|
||||
|
||||
void addPlayer(CNSocket* key, Player plr);
|
||||
void removePlayer(CNSocket* key);
|
||||
Player getPlayer(CNSocket* key);
|
||||
Player *getPlayer(CNSocket* key);
|
||||
|
||||
void updatePlayer(CNSocket* key, Player plr);
|
||||
void updatePlayerPosition(CNSocket* sock, int X, int Y, int Z);
|
||||
std::list<CNSocket*> getNearbyPlayers(int X, int Y, int dist);
|
||||
|
||||
|
Reference in New Issue
Block a user