Fixed copying pointer to/from packet
This commit is contained in:
@@ -44,9 +44,7 @@ void serializeBarrier(void* buffer, BarrierPacket* packet) {
|
|||||||
serialCopy(&buffer, &packet->motion.y, sizeof(double));
|
serialCopy(&buffer, &packet->motion.y, sizeof(double));
|
||||||
|
|
||||||
//graphical data
|
//graphical data
|
||||||
for (int i = 0; i < 8; i++) {
|
serialCopy(&buffer, packet->status, sizeof(int) * 8);
|
||||||
serialCopy(&buffer, &packet->status[i], sizeof(int));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void deserializeBarrier(void* buffer, BarrierPacket* packet) {
|
void deserializeBarrier(void* buffer, BarrierPacket* packet) {
|
||||||
@@ -70,7 +68,5 @@ void deserializeBarrier(void* buffer, BarrierPacket* packet) {
|
|||||||
deserialCopy(&buffer, &packet->motion.y, sizeof(double));
|
deserialCopy(&buffer, &packet->motion.y, sizeof(double));
|
||||||
|
|
||||||
//graphical data
|
//graphical data
|
||||||
for (int i = 0; i < 8; i++) {
|
deserialCopy(&buffer, packet->status, sizeof(int) * 8);
|
||||||
deserialCopy(&buffer, &packet->status[i], sizeof(int));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ void copyBarrierToPacket(BarrierPacket* const packet, BarrierData* const barrier
|
|||||||
packet->motion = barrierData->GetMotion();
|
packet->motion = barrierData->GetMotion();
|
||||||
packet->bounds = barrierData->GetBounds();
|
packet->bounds = barrierData->GetBounds();
|
||||||
|
|
||||||
memcpy(barrierData->GetStatusArray(), &packet->status, sizeof(int) * 8);
|
memcpy(packet->status, barrierData->GetStatusArray(), sizeof(int) * 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
void pumpAndChangeRooms(int characterIndex, int newRoomIndex) {
|
void pumpAndChangeRooms(int characterIndex, int newRoomIndex) {
|
||||||
|
|||||||
Reference in New Issue
Block a user