From 588e941d3c5926f1cacb6213ef17709984aa0580 Mon Sep 17 00:00:00 2001 From: gsemaj Date: Fri, 16 Apr 2021 12:30:22 -0400 Subject: [PATCH] Fix eggs not entering chunks and add update tabledata --- src/Eggs.cpp | 8 ++++---- src/Eggs.hpp | 2 +- src/Entities.cpp | 2 +- tdata | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Eggs.cpp b/src/Eggs.cpp index 20f9b45..683582d 100644 --- a/src/Eggs.cpp +++ b/src/Eggs.cpp @@ -143,10 +143,10 @@ static void eggStep(CNServer* serv, time_t currTime) { } -void Eggs::npcDataToEggData(sNPCAppearanceData* npc, sShinyAppearanceData* egg) { - egg->iX = npc->iX; - egg->iY = npc->iY; - egg->iZ = npc->iZ; +void Eggs::npcDataToEggData(int x, int y, int z, sNPCAppearanceData* npc, sShinyAppearanceData* egg) { + egg->iX = x; + egg->iY = y; + egg->iZ = z; // client doesn't care about egg->iMapNum egg->iShinyType = npc->iNPCType; egg->iShiny_ID = npc->iNPC_ID; diff --git a/src/Eggs.hpp b/src/Eggs.hpp index 2e5a782..2155272 100644 --- a/src/Eggs.hpp +++ b/src/Eggs.hpp @@ -18,5 +18,5 @@ namespace Eggs { /// returns -1 on fail int eggBuffPlayer(CNSocket* sock, int skillId, int eggId, int duration); - void npcDataToEggData(sNPCAppearanceData* npc, sShinyAppearanceData* egg); + void npcDataToEggData(int x, int y, int z, sNPCAppearanceData* npc, sShinyAppearanceData* egg); } diff --git a/src/Entities.cpp b/src/Entities.cpp index f0597af..973a78c 100644 --- a/src/Entities.cpp +++ b/src/Entities.cpp @@ -66,7 +66,7 @@ void Bus::enterIntoViewOf(CNSocket *sock) { void Egg::enterIntoViewOf(CNSocket *sock) { INITSTRUCT(sP_FE2CL_SHINY_ENTER, pkt); - Eggs::npcDataToEggData(&appearanceData, &pkt.ShinyAppearanceData); + Eggs::npcDataToEggData(x, y, z, &appearanceData, &pkt.ShinyAppearanceData); sock->sendPacket(pkt, P_FE2CL_SHINY_ENTER); } diff --git a/tdata b/tdata index 0106669..f822f16 160000 --- a/tdata +++ b/tdata @@ -1 +1 @@ -Subproject commit 01066697e49b7c8c323347559d65ca75527d03e3 +Subproject commit f822f1640d8cf0e46539b75f561aeaeb1d68c9a9