mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-11-16 23:10:09 +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:
@@ -58,8 +58,8 @@ void NPCManager::updatePlayerNPCS(CNSocket* sock, PlayerView& view) {
|
||||
std::list<int32_t> noView;
|
||||
|
||||
for (auto& pair : NPCs) {
|
||||
int diffX = abs(view.plr.x - pair.second.appearanceData.iX);
|
||||
int diffY = abs(view.plr.y - pair.second.appearanceData.iY);
|
||||
int diffX = abs(view.plr->x - pair.second.appearanceData.iX);
|
||||
int diffY = abs(view.plr->y - pair.second.appearanceData.iY);
|
||||
|
||||
if (diffX < settings::VIEWDISTANCE && diffY < settings::VIEWDISTANCE) {
|
||||
yesView.push_back(pair.first);
|
||||
|
||||
Reference in New Issue
Block a user