[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:
2021-04-13 19:57:24 -05:00
parent 48fb510b53
commit 9b84d9dc4d
11 changed files with 80 additions and 74 deletions

View File

@@ -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);