Close to zone; spawn struct isn't right.

This commit is contained in:
KimLS
2024-11-17 19:53:09 -08:00
parent 004b0e1176
commit f6f9d275e8
4 changed files with 73 additions and 35 deletions
+20
View File
@@ -2322,6 +2322,26 @@ namespace Larion
delete in;
}
ENCODE(OP_SendZonepoints)
{
SETUP_VAR_ENCODE(ZonePoints);
ALLOC_VAR_ENCODE(structs::ZonePoints, sizeof(structs::ZonePoints) + sizeof(structs::ZonePoint_Entry) * (emu->count + 1));
eq->count = emu->count;
for (uint32 i = 0; i < emu->count; ++i)
{
eq->zpe[i].iterator = emu->zpe[i].iterator;
eq->zpe[i].x = emu->zpe[i].x;
eq->zpe[i].y = emu->zpe[i].y;
eq->zpe[i].z = emu->zpe[i].z;
eq->zpe[i].heading = emu->zpe[i].heading;
eq->zpe[i].zoneid = emu->zpe[i].zoneid;
eq->zpe[i].zoneinstance = emu->zpe[i].zoneinstance;
}
FINISH_ENCODE();
}
// DECODE methods
DECODE(OP_ZoneEntry)
+1
View File
@@ -15,6 +15,7 @@ E(OP_CharInventory)
E(OP_NewZone)
E(OP_SpawnDoor)
E(OP_GroundSpawn)
E(OP_SendZonepoints)
//list of packets we need to decode on the way in:
D(OP_ZoneEntry)
+17
View File
@@ -297,6 +297,23 @@ namespace Larion {
/*132*/
};
struct ZonePoint_Entry {
/*00*/ uint32 iterator;
/*04*/ float y;
/*08*/ float x;
/*12*/ float z;
/*16*/ float heading;
/*20*/ uint16 zoneid;
/*22*/ uint16 zoneinstance;
/*24*/ uint32 unknown024;
/*28*/ uint32 unknown028;
/*32*/
};
struct ZonePoints {
/*00*/ uint32 count;
/*04*/ struct ZonePoint_Entry zpe[0]; // Always add one extra to the end after all zonepoints
};
#pragma pack()