mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-12-22 03:50:04 +00:00
[refactor] BaseNPC now uses Entity XYZ fields for handling positions
- fixed many references to Entity.appearanceData.i[XYZ] to use the base Entity XYZ values - BaseNPC::enterIntoViewOf grabs the position from the base Entity XYZ values - NPCManager::updateNPCPosition updates the base Entity XYZ values - MobAI.c/deadStep() also sends it's packet based on the Entity XYZ values
This commit is contained in:
@@ -271,8 +271,8 @@ static void stepNPCPathing() {
|
||||
queue->pop(); // remove point from front of queue
|
||||
|
||||
// calculate displacement
|
||||
int dXY = hypot(point.x - npc->appearanceData.iX, point.y - npc->appearanceData.iY); // XY plane distance
|
||||
int distanceBetween = hypot(dXY, point.z - npc->appearanceData.iZ); // total distance
|
||||
int dXY = hypot(point.x - npc->x, point.y - npc->y); // XY plane distance
|
||||
int distanceBetween = hypot(dXY, point.z - npc->z); // total distance
|
||||
|
||||
// update NPC location to update viewables
|
||||
NPCManager::updateNPCPosition(npc->appearanceData.iNPC_ID, point.x, point.y, point.z, npc->instanceID, npc->appearanceData.iAngle);
|
||||
|
||||
Reference in New Issue
Block a user