mirror of
https://github.com/CraftyBoss/SuperMarioOdysseyOnline.git
synced 2024-11-25 12:45:17 +00:00
9227e37623
- sizeof(bool) is implementation defined. The server assumes it's 4 but for me it was 1 (tested with Release too) which caused some bugs - Structs aren't guaranteed to be packed. The compiler is free to change the layout, which we wouldn't want to for the Packet structs that we deserialize on the server.
34 lines
No EOL
988 B
C
34 lines
No EOL
988 B
C
#pragma once
|
|
|
|
#include "Packet.h"
|
|
#include "al/util.hpp"
|
|
#include "algorithms/PlayerAnims.h"
|
|
|
|
struct PACKED PlayerInf : Packet {
|
|
PlayerInf() : Packet() {mType = PacketType::PLAYERINF; mPacketSize = sizeof(PlayerInf) - sizeof(Packet);};
|
|
sead::Vector3f playerPos;
|
|
sead::Quatf playerRot;
|
|
float animBlendWeights[6];
|
|
PlayerAnims::Type actName;
|
|
PlayerAnims::Type subActName;
|
|
|
|
bool operator==(const PlayerInf &rhs) const {
|
|
bool isWeightsEqual = true;
|
|
for (size_t i = 0; i < 6; i++)
|
|
{
|
|
if(animBlendWeights[i] != rhs.animBlendWeights[i]) {
|
|
isWeightsEqual = false;
|
|
break;
|
|
}
|
|
}
|
|
return (
|
|
playerPos == rhs.playerPos &&
|
|
playerRot == rhs.playerRot &&
|
|
isWeightsEqual &&
|
|
actName == rhs.actName &&
|
|
subActName == rhs.subActName
|
|
);
|
|
}
|
|
|
|
bool operator!=(const PlayerInf& rhs) const { return !operator==(rhs); }
|
|
}; |