Fix eggs not entering chunks and add update tabledata

This commit is contained in:
gsemaj 2021-04-16 12:30:22 -04:00
parent f5600912cb
commit 588e941d3c
4 changed files with 7 additions and 7 deletions

View File

@ -143,10 +143,10 @@ static void eggStep(CNServer* serv, time_t currTime) {
} }
void Eggs::npcDataToEggData(sNPCAppearanceData* npc, sShinyAppearanceData* egg) { void Eggs::npcDataToEggData(int x, int y, int z, sNPCAppearanceData* npc, sShinyAppearanceData* egg) {
egg->iX = npc->iX; egg->iX = x;
egg->iY = npc->iY; egg->iY = y;
egg->iZ = npc->iZ; egg->iZ = z;
// client doesn't care about egg->iMapNum // client doesn't care about egg->iMapNum
egg->iShinyType = npc->iNPCType; egg->iShinyType = npc->iNPCType;
egg->iShiny_ID = npc->iNPC_ID; egg->iShiny_ID = npc->iNPC_ID;

View File

@ -18,5 +18,5 @@ namespace Eggs {
/// returns -1 on fail /// returns -1 on fail
int eggBuffPlayer(CNSocket* sock, int skillId, int eggId, int duration); 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);
} }

View File

@ -66,7 +66,7 @@ void Bus::enterIntoViewOf(CNSocket *sock) {
void Egg::enterIntoViewOf(CNSocket *sock) { void Egg::enterIntoViewOf(CNSocket *sock) {
INITSTRUCT(sP_FE2CL_SHINY_ENTER, pkt); 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); sock->sendPacket(pkt, P_FE2CL_SHINY_ENTER);
} }

2
tdata

@ -1 +1 @@
Subproject commit 01066697e49b7c8c323347559d65ca75527d03e3 Subproject commit f822f1640d8cf0e46539b75f561aeaeb1d68c9a9