aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/r2server.h
diff options
context:
space:
mode:
authorEmma Miler <emma.pi@protonmail.com>2022-11-14 01:11:59 +0100
committerGitHub <noreply@github.com>2022-11-14 00:11:59 +0000
commit0c6d1f4e79d31de6fde4979a72afacdd6d13ca60 (patch)
tree06a9f21b76ac94d8ee11cf109ea3a32ac584982c /NorthstarDLL/r2server.h
parent2139e0ec6d95ed7c5f673b53dec71f39a013dd93 (diff)
downloadNorthstarLauncher-0c6d1f4e79d31de6fde4979a72afacdd6d13ca60.tar.gz
NorthstarLauncher-0c6d1f4e79d31de6fde4979a72afacdd6d13ca60.zip
New syntax for reversed structs (#324)
* Initial commit Co-Authored-By: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> * Format change * Revert `VPKData` definition * Add `FIELDS` macro Co-authored-by: BobTheBob <32057864+BobTheBob9@users.noreply.github.com>
Diffstat (limited to 'NorthstarDLL/r2server.h')
-rw-r--r--NorthstarDLL/r2server.h24
1 files changed, 11 insertions, 13 deletions
diff --git a/NorthstarDLL/r2server.h b/NorthstarDLL/r2server.h
index 235dde7f..aadfdefe 100644
--- a/NorthstarDLL/r2server.h
+++ b/NorthstarDLL/r2server.h
@@ -9,22 +9,20 @@ namespace R2
class CBaseEntity;
extern CBaseEntity* (*Server_GetEntityByIndex)(int index);
-#pragma pack(push, 1)
- struct CBasePlayer
+ // clang-format off
+ OFFSET_STRUCT(CBasePlayer)
{
- char pad[0x58];
- uint32_t m_nPlayerIndex;
+ STRUCT_SIZE(0x1D02);
+ FIELD(0x58, uint32_t m_nPlayerIndex)
- // +0x5C
- char pad1[0x1C34];
- bool m_hasBadReputation; // 0x1C90
- char m_communityName[64]; // 0x1C91
- char m_communityClanTag[16]; // 0x1CD1
- char m_factionName[16]; // 0x1CE1
- char m_hardwareIcon[16]; // 0x1CF1
- bool m_happyHourActive; // 0x1D01
+ FIELD(0x1C90, bool m_hasBadReputation)
+ FIELD(0x1C91, char m_communityName[64])
+ FIELD(0x1CD1, char m_communityClanTag[16])
+ FIELD(0x1CE1, char m_factionName[16])
+ FIELD(0x1CF1, char m_hardwareIcon[16])
+ FIELD(0x1D01, bool m_happyHourActive)
};
-#pragma pack(pop)
+ // clang-format on
extern CBasePlayer*(__fastcall* UTIL_PlayerByIndex)(int playerIndex);
} // namespace R2