[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

@@ -45,6 +45,9 @@ Entity *EntityRef::getEntity() const {
void BaseNPC::enterIntoViewOf(CNSocket *sock) {
INITSTRUCT(sP_FE2CL_NPC_ENTER, pkt);
pkt.NPCAppearanceData = appearanceData;
pkt.NPCAppearanceData.iX = x;
pkt.NPCAppearanceData.iY = y;
pkt.NPCAppearanceData.iZ = z;
sock->sendPacket(pkt, P_FE2CL_NPC_ENTER);
}
@@ -54,7 +57,7 @@ void Bus::enterIntoViewOf(CNSocket *sock) {
// TODO: Potentially decouple this from BaseNPC?
pkt.AppearanceData = {
3, appearanceData.iNPC_ID, appearanceData.iNPCType,
appearanceData.iX, appearanceData.iY, appearanceData.iZ
x, y, z
};
sock->sendPacket(pkt, P_FE2CL_TRANSPORTATION_ENTER);