mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-10-21 04:40:21 +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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user