From af6e132b37e8b7e89e4c0c7a52e5bb81e4b1b9a8 Mon Sep 17 00:00:00 2001
From: bigbossbro08 <bigbossbro08@gmail.com>
Date: Sun, 10 May 2020 19:54:37 +0600
Subject: [PATCH 1/3] defined out asserts.

---
 src/animation/AnimBlendAssociation.h |  3 +++
 src/animation/AnimBlendHierarchy.h   |  3 +++
 src/animation/AnimBlendNode.h        |  3 +++
 src/audio/AudioCollision.h           |  6 +++++-
 src/audio/AudioManager.h             |  4 ++++
 src/control/AutoPilot.h              |  5 ++++-
 src/control/Garages.h                |  2 ++
 src/control/PathFind.h               |  7 +++++++
 src/control/Phones.h                 |  2 ++
 src/control/Pickups.h                |  2 ++
 src/control/Replay.h                 |  3 +++
 src/core/Camera.h                    |  6 ++++++
 src/core/CdStream.cpp                |  3 +++
 src/core/CdStream.h                  |  3 ++-
 src/core/Placeable.h                 |  5 ++++-
 src/core/PlayerInfo.h                |  3 +++
 src/core/Wanted.h                    |  2 ++
 src/core/World.h                     |  4 ++++
 src/core/common.h                    |  4 ++++
 src/entities/Building.h              |  3 +++
 src/entities/Dummy.h                 |  3 +++
 src/entities/Entity.h                |  3 +++
 src/entities/Physical.h              |  3 +++
 src/entities/Treadable.h             |  3 +++
 src/modelinfo/BaseModelInfo.h        |  2 ++
 src/modelinfo/ClumpModelInfo.h       |  3 +++
 src/modelinfo/SimpleModelInfo.h      |  3 +++
 src/modelinfo/TimeModelInfo.h        |  3 +++
 src/modelinfo/VehicleModelInfo.h     |  3 +++
 src/objects/DummyObject.h            |  3 +++
 src/objects/Object.h                 |  3 +++
 src/peds/DummyPed.h                  |  3 +++
 src/peds/PedIK.h                     |  3 +++
 src/render/2dEffect.h                |  3 +++
 src/render/Coronas.h                 |  3 +++
 src/render/Glass.h                   |  2 ++
 src/render/Particle.h                |  4 +++-
 src/render/ParticleMgr.h             |  6 +++++-
 src/render/Shadows.h                 | 11 +++++++++++
 src/skel/win/win.cpp                 |  2 ++
 src/text/Text.h                      |  3 +++
 src/vehicles/Automobile.h            |  2 ++
 src/vehicles/Boat.h                  |  2 ++
 src/vehicles/Cranes.h                |  2 ++
 src/vehicles/Heli.h                  |  3 +++
 src/vehicles/Plane.h                 |  3 +++
 src/vehicles/Train.h                 |  3 +++
 src/vehicles/Vehicle.h               |  2 ++
 48 files changed, 156 insertions(+), 6 deletions(-)

diff --git a/src/animation/AnimBlendAssociation.h b/src/animation/AnimBlendAssociation.h
index dd4c7a34..4f3be016 100644
--- a/src/animation/AnimBlendAssociation.h
+++ b/src/animation/AnimBlendAssociation.h
@@ -84,4 +84,7 @@ public:
 		return (CAnimBlendAssociation*)((uint8*)l - offsetof(CAnimBlendAssociation, link));
 	}
 };
+
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CAnimBlendAssociation) == 0x40, "CAnimBlendAssociation: error");
+#endif
\ No newline at end of file
diff --git a/src/animation/AnimBlendHierarchy.h b/src/animation/AnimBlendHierarchy.h
index 917e1585..1bf687cc 100644
--- a/src/animation/AnimBlendHierarchy.h
+++ b/src/animation/AnimBlendHierarchy.h
@@ -24,4 +24,7 @@ public:
 	void Uncompress(void);
 	void RemoveUncompressedData(void);
 };
+
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CAnimBlendHierarchy) == 0x28, "CAnimBlendHierarchy: error");
+#endif
\ No newline at end of file
diff --git a/src/animation/AnimBlendNode.h b/src/animation/AnimBlendNode.h
index 361a4134..46f2fee4 100644
--- a/src/animation/AnimBlendNode.h
+++ b/src/animation/AnimBlendNode.h
@@ -26,4 +26,7 @@ public:
 	void GetCurrentTranslation(CVector &trans, float weight);
 	void GetEndTranslation(CVector &trans, float weight);
 };
+
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CAnimBlendNode) == 0x1C, "CAnimBlendNode: error");
+#endif
\ No newline at end of file
diff --git a/src/audio/AudioCollision.h b/src/audio/AudioCollision.h
index 324bab0e..e8711f9a 100644
--- a/src/audio/AudioCollision.h
+++ b/src/audio/AudioCollision.h
@@ -20,7 +20,9 @@ public:
 	// no methods
 };
 
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(cAudioCollision) == 40, "cAudioCollision: error");
+#endif
 
 class cAudioCollisionManager
 {
@@ -35,4 +37,6 @@ public:
 	void AddCollisionToRequestedQueue();
 };
 
-static_assert(sizeof(cAudioCollisionManager) == 852, "cAudioCollisionManager: error");
\ No newline at end of file
+#ifdef CHECK_STRUCT_SIZES 
+static_assert(sizeof(cAudioCollisionManager) == 852, "cAudioCollisionManager: error");
+#endif
\ No newline at end of file
diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h
index 0d0c5d91..5f00eac4 100644
--- a/src/audio/AudioManager.h
+++ b/src/audio/AudioManager.h
@@ -52,7 +52,9 @@ public:
 	uint8 m_AudioEvents;
 };
 
+#ifdef CHECK_STRUCT_SIZES
 static_assert(sizeof(tAudioEntity) == 40, "tAudioEntity: error");
+#endif
 
 class tPedComment
 {
@@ -135,7 +137,9 @@ public:
 	float m_fVelocityChange;
 };
 
+#ifdef CHECK_STRUCT_SIZES
 static_assert(sizeof(cVehicleParams) == 0x18, "cVehicleParams: error");
+#endif
 
 enum {
 	/*
diff --git a/src/control/AutoPilot.h b/src/control/AutoPilot.h
index 345f4cb4..1528db46 100644
--- a/src/control/AutoPilot.h
+++ b/src/control/AutoPilot.h
@@ -119,4 +119,7 @@ public:
 #endif
 
 };
-static_assert(sizeof(CAutoPilot) == 0x70, "CAutoPilot: error");
\ No newline at end of file
+
+#ifdef CHECK_STRUCT_SIZES 
+static_assert(sizeof(CAutoPilot) == 0x70, "CAutoPilot: error");
+#endif
\ No newline at end of file
diff --git a/src/control/Garages.h b/src/control/Garages.h
index 3105f72d..95e7ba5c 100644
--- a/src/control/Garages.h
+++ b/src/control/Garages.h
@@ -172,7 +172,9 @@ class CGarage
 	friend class CCamera;
 };
 
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CGarage) == 140, "CGarage");
+#endif
 
 class CGarages
 {
diff --git a/src/control/PathFind.h b/src/control/PathFind.h
index 8049ea52..d812ac32 100644
--- a/src/control/PathFind.h
+++ b/src/control/PathFind.h
@@ -41,7 +41,10 @@ struct CPedPathNode
 	CPedPathNode* prev;
 	CPedPathNode* next;
 };
+
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CPedPathNode) == 0x10, "CPedPathNode: error");
+#endif
 
 class CPedPath {
 public:
@@ -221,7 +224,11 @@ public:
 
 	void DisplayPathData(void);
 };
+
+
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CPathFind) == 0x49bf4, "CPathFind: error");
+#endif
 
 extern CPathFind ThePaths;
 
diff --git a/src/control/Phones.h b/src/control/Phones.h
index 7fbf403f..01ed370e 100644
--- a/src/control/Phones.h
+++ b/src/control/Phones.h
@@ -32,7 +32,9 @@ public:
 	~CPhone() { }
 };
 
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CPhone) == 0x34, "CPhone: error");
+#endif
 
 class CPhoneInfo {
 public:
diff --git a/src/control/Pickups.h b/src/control/Pickups.h
index 11da5f54..f4e5e560 100644
--- a/src/control/Pickups.h
+++ b/src/control/Pickups.h
@@ -47,7 +47,9 @@ private:
 	void Remove();
 };
 
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CPickup) == 0x1C, "CPickup: error");
+#endif
 
 struct tPickupMessage
 {
diff --git a/src/control/Replay.h b/src/control/Replay.h
index bf70a28a..ec39def8 100644
--- a/src/control/Replay.h
+++ b/src/control/Replay.h
@@ -108,7 +108,10 @@ class CReplay
 		CMatrix camera_pos;
 		CVector player_pos;
 	};
+
+#ifdef CHECK_STRUCT_SIZES
 	static_assert(sizeof(tGeneralPacket) == 88, "tGeneralPacket: error");
+#endif
 
 	struct tClockPacket
 	{
diff --git a/src/core/Camera.h b/src/core/Camera.h
index 51138f99..d69b1be4 100644
--- a/src/core/Camera.h
+++ b/src/core/Camera.h
@@ -260,9 +260,12 @@ public:
 	void Process_FollowPed_Rotation(const CVector &CameraTarget, float TargetOrientation, float, float);
 	void Process_FollowCar_SA(const CVector &CameraTarget, float TargetOrientation, float, float);
 };
+
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CCam) == 0x1A4, "CCam: wrong size");
 static_assert(offsetof(CCam, Alpha) == 0xA8, "CCam: error");
 static_assert(offsetof(CCam, Front) == 0x140, "CCam: error");
+#endif
 
 class CCamPathSplines
 {
@@ -637,6 +640,8 @@ uint32    unknown;	// some counter having to do with music
 	bool IsSphereVisible(const CVector &center, float radius);
 	bool IsBoxVisible(RwV3d *box, const CMatrix *mat);
 };
+
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(offsetof(CCamera, DistanceToWater) == 0xe4, "CCamera: error");
 static_assert(offsetof(CCamera, m_WideScreenOn) == 0x70, "CCamera: error");
 static_assert(offsetof(CCamera, WorldViewerBeingUsed) == 0x75, "CCamera: error");
@@ -650,6 +655,7 @@ static_assert(offsetof(CCamera, m_PreviousCameraPosition) == 0x6B0, "CCamera: er
 static_assert(offsetof(CCamera, m_vecCutSceneOffset) == 0x6F8, "CCamera: error");
 static_assert(offsetof(CCamera, m_arrPathArray) == 0x7a8, "CCamera: error");
 static_assert(sizeof(CCamera) == 0xE9D8, "CCamera: wrong size");
+#endif
 
 extern CCamera TheCamera;
 
diff --git a/src/core/CdStream.cpp b/src/core/CdStream.cpp
index ea79fb9a..3b9eaac5 100644
--- a/src/core/CdStream.cpp
+++ b/src/core/CdStream.cpp
@@ -22,7 +22,10 @@ struct CdReadInfo
 	HANDLE hFile;
 	OVERLAPPED Overlapped;
 };
+
+#ifdef CHECK_STRUCT_SIZES
 VALIDATE_SIZE(CdReadInfo, 0x30);
+#endif
 
 char gCdImageNames[MAX_CDIMAGES+1][64];
 int32 gNumImages;
diff --git a/src/core/CdStream.h b/src/core/CdStream.h
index 9ef71b65..ba74be31 100644
--- a/src/core/CdStream.h
+++ b/src/core/CdStream.h
@@ -25,8 +25,9 @@ struct Queue
 	int32 size;
 };
 
+#ifdef CHECK_STRUCT_SIZES
 VALIDATE_SIZE(Queue, 0x10);
-
+#endif
 
 void CdStreamInitThread(void);
 void CdStreamInit(int32 numChannels);
diff --git a/src/core/Placeable.h b/src/core/Placeable.h
index 7e858283..110a1542 100644
--- a/src/core/Placeable.h
+++ b/src/core/Placeable.h
@@ -31,4 +31,7 @@ public:
 	bool IsWithinArea(float x1, float y1, float x2, float y2);
 	bool IsWithinArea(float x1, float y1, float z1, float x2, float y2, float z2);
 };
-static_assert(sizeof(CPlaceable) == 0x4C, "CPlaceable: error");
\ No newline at end of file
+
+#ifdef CHECK_STRUCT_SIZES 
+static_assert(sizeof(CPlaceable) == 0x4C, "CPlaceable: error");
+#endif
\ No newline at end of file
diff --git a/src/core/PlayerInfo.h b/src/core/PlayerInfo.h
index e970e42d..ae089032 100644
--- a/src/core/PlayerInfo.h
+++ b/src/core/PlayerInfo.h
@@ -80,4 +80,7 @@ public:
 
 	~CPlayerInfo() { };
 };
+
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CPlayerInfo) == 0x13C, "CPlayerInfo: error");
+#endif
diff --git a/src/core/Wanted.h b/src/core/Wanted.h
index e3e407b0..802c3673 100644
--- a/src/core/Wanted.h
+++ b/src/core/Wanted.h
@@ -54,4 +54,6 @@ public:
 	static void SetMaximumWantedLevel(int32 level);
 };
 
+#ifdef CHECK_STRUCT_SIZES
 static_assert(sizeof(CWanted) == 0x204, "CWanted: error");
+#endif
diff --git a/src/core/World.h b/src/core/World.h
index ab3f0192..6fc6681d 100644
--- a/src/core/World.h
+++ b/src/core/World.h
@@ -45,7 +45,11 @@ class CSector
 public:
 	CPtrList m_lists[NUMSECTORENTITYLISTS];
 };
+
+
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CSector) == 0x28, "CSector: error");
+#endif
 
 class CEntity;
 struct CColPoint;
diff --git a/src/core/common.h b/src/core/common.h
index ff8580a1..41773877 100644
--- a/src/core/common.h
+++ b/src/core/common.h
@@ -226,7 +226,11 @@ void re3_assert(const char *expr, const char *filename, unsigned int lineno, con
 #define _TODO(x)
 #define _TODOCONST(x) (x)
 
+#ifdef CHECK_STRUCT_SIZES 
 #define VALIDATE_SIZE(struc, size) static_assert(sizeof(struc) == size, "Invalid structure size of " #struc)
+#else
+#define VALIDATE_SIZE(struc, size)
+#endif
 #define VALIDATE_OFFSET(struc, member, offset) static_assert(offsetof(struc, member) == offset, "The offset of " #member " in " #struc " is not " #offset "...")
 
 #define PERCENT(x, p)                    ((float(x) * (float(p) / 100.0f)))
diff --git a/src/entities/Building.h b/src/entities/Building.h
index 7b837f46..50818189 100644
--- a/src/entities/Building.h
+++ b/src/entities/Building.h
@@ -16,4 +16,7 @@ public:
 
 	virtual bool GetIsATreadable(void) { return false; }
 };
+
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CBuilding) == 0x64, "CBuilding: error");
+#endif
diff --git a/src/entities/Dummy.h b/src/entities/Dummy.h
index fcfd23fb..de0e448b 100644
--- a/src/entities/Dummy.h
+++ b/src/entities/Dummy.h
@@ -15,4 +15,7 @@ public:
 	static void *operator new(size_t);
 	static void operator delete(void*, size_t);
 };
+
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CDummy) == 0x68, "CDummy: error");
+#endif
diff --git a/src/entities/Entity.h b/src/entities/Entity.h
index 330fde69..18254ae4 100644
--- a/src/entities/Entity.h
+++ b/src/entities/Entity.h
@@ -172,4 +172,7 @@ public:
 
 	static void AddSteamsFromGround(CPtrList& list);
 };
+
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CEntity) == 0x64, "CEntity: error");
+#endif
\ No newline at end of file
diff --git a/src/entities/Physical.h b/src/entities/Physical.h
index b47d556e..c9b7402b 100644
--- a/src/entities/Physical.h
+++ b/src/entities/Physical.h
@@ -160,4 +160,7 @@ public:
 	bool CheckCollision(void);
 	bool CheckCollision_SimpleCar(void);
 };
+
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CPhysical) == 0x128, "CPhysical: error");
+#endif
diff --git a/src/entities/Treadable.h b/src/entities/Treadable.h
index 9e4de59a..272b2d4b 100644
--- a/src/entities/Treadable.h
+++ b/src/entities/Treadable.h
@@ -12,4 +12,7 @@ public:
 
 	bool GetIsATreadable(void) { return true; }
 };
+
+#ifdef CHECK_STRUCT_SIZES
 static_assert(sizeof(CTreadable) == 0x94, "CTreadable: error");
+#endif
diff --git a/src/modelinfo/BaseModelInfo.h b/src/modelinfo/BaseModelInfo.h
index fdf1efb6..ce42cb3a 100644
--- a/src/modelinfo/BaseModelInfo.h
+++ b/src/modelinfo/BaseModelInfo.h
@@ -70,4 +70,6 @@ public:
 	uint16 GetNumRefs() const { return m_refCount; }
 };
 
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CBaseModelInfo) == 0x30, "CBaseModelInfo: error");
+#endif
diff --git a/src/modelinfo/ClumpModelInfo.h b/src/modelinfo/ClumpModelInfo.h
index c37a468a..a4ba2c9e 100644
--- a/src/modelinfo/ClumpModelInfo.h
+++ b/src/modelinfo/ClumpModelInfo.h
@@ -50,4 +50,7 @@ public:
 	static RwFrame *FillFrameArrayCB(RwFrame *frame, void *data);
 	static RwFrame *GetFrameFromId(RpClump *clump, int32 id);
 };
+
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CClumpModelInfo) == 0x34, "CClumpModelInfo: error");
+#endif
diff --git a/src/modelinfo/SimpleModelInfo.h b/src/modelinfo/SimpleModelInfo.h
index 8c4173e9..65ff8c52 100644
--- a/src/modelinfo/SimpleModelInfo.h
+++ b/src/modelinfo/SimpleModelInfo.h
@@ -49,4 +49,7 @@ public:
 	void SetRelatedModel(CSimpleModelInfo *m){
 		m_atomics[2] = (RpAtomic*)m; }
 };
+
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CSimpleModelInfo) == 0x4C, "CSimpleModelInfo: error");
+#endif
diff --git a/src/modelinfo/TimeModelInfo.h b/src/modelinfo/TimeModelInfo.h
index f8b7c8ff..cbe171e0 100644
--- a/src/modelinfo/TimeModelInfo.h
+++ b/src/modelinfo/TimeModelInfo.h
@@ -17,4 +17,7 @@ public:
 	void SetOtherTimeModel(int32 other) { m_otherTimeModelID = other; }
 	CTimeModelInfo *FindOtherTimeModel(void);
 };
+
+#ifdef CHECK_STRUCT_SIZES
 static_assert(sizeof(CTimeModelInfo) == 0x58, "CTimeModelInfo: error");
+#endif
\ No newline at end of file
diff --git a/src/modelinfo/VehicleModelInfo.h b/src/modelinfo/VehicleModelInfo.h
index 6946c5c1..160c846b 100644
--- a/src/modelinfo/VehicleModelInfo.h
+++ b/src/modelinfo/VehicleModelInfo.h
@@ -123,4 +123,7 @@ public:
 	static int GetMaximumNumberOfPassengersFromNumberOfDoors(int id);
 	static void SetComponentsToUse(int8 c1, int8 c2) { ms_compsToUse[0] = c1; ms_compsToUse[1] = c2; }
 };
+
+#ifdef CHECK_STRUCT_SIZES
 static_assert(sizeof(CVehicleModelInfo) == 0x1F8, "CVehicleModelInfo: error");
+#endif
diff --git a/src/objects/DummyObject.h b/src/objects/DummyObject.h
index d4dce609..8a0913c5 100644
--- a/src/objects/DummyObject.h
+++ b/src/objects/DummyObject.h
@@ -10,4 +10,7 @@ public:
 	CDummyObject(void) {}
 	CDummyObject(CObject *obj);
 };
+
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CDummyObject) == 0x68, "CDummyObject: error");
+#endif
\ No newline at end of file
diff --git a/src/objects/Object.h b/src/objects/Object.h
index 80b9015c..ff4c896e 100644
--- a/src/objects/Object.h
+++ b/src/objects/Object.h
@@ -97,4 +97,7 @@ public:
 	static void DeleteAllTempObjects();
 	static void DeleteAllTempObjectsInArea(CVector point, float fRadius);
 };
+
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CObject) == 0x198, "CObject: error");
+#endif
diff --git a/src/peds/DummyPed.h b/src/peds/DummyPed.h
index af633dc4..5bb72d87 100644
--- a/src/peds/DummyPed.h
+++ b/src/peds/DummyPed.h
@@ -8,4 +8,7 @@ class CDummyPed : CDummy
 	int32 pedType;
 	int32 unknown;
 };
+
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CDummyPed) == 0x70, "CDummyPed: error");
+#endif
\ No newline at end of file
diff --git a/src/peds/PedIK.h b/src/peds/PedIK.h
index fd9e4702..566193d6 100644
--- a/src/peds/PedIK.h
+++ b/src/peds/PedIK.h
@@ -64,4 +64,7 @@ public:
 	bool LookAtPosition(CVector const& pos);
 	bool RestoreLookAt(void);
 };
+
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CPedIK) == 0x28, "CPedIK: error");
+#endif
diff --git a/src/render/2dEffect.h b/src/render/2dEffect.h
index a24a3f4f..8c583799 100644
--- a/src/render/2dEffect.h
+++ b/src/render/2dEffect.h
@@ -89,4 +89,7 @@ public:
 		}
 	}
 };
+
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(C2dEffect) == 0x34, "C2dEffect: error");
+#endif
\ No newline at end of file
diff --git a/src/render/Coronas.h b/src/render/Coronas.h
index 4b49e40e..d2e79079 100644
--- a/src/render/Coronas.h
+++ b/src/render/Coronas.h
@@ -38,7 +38,10 @@ struct CRegisteredCorona
 
 	void Update(void);
 };
+
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CRegisteredCorona) == 0x80, "CRegisteredCorona: error");
+#endif
 
 class CCoronas
 {
diff --git a/src/render/Glass.h b/src/render/Glass.h
index 51c5aae9..0c715c27 100644
--- a/src/render/Glass.h
+++ b/src/render/Glass.h
@@ -21,7 +21,9 @@ public:
 	void Render(void);
 };
 
+#ifdef CHECK_STRUCT_SIZES
 VALIDATE_SIZE(CFallingGlassPane, 0x70);
+#endif
 
 enum
 {
diff --git a/src/render/Particle.h b/src/render/Particle.h
index b71dc717..ed1528d2 100644
--- a/src/render/Particle.h
+++ b/src/render/Particle.h
@@ -91,4 +91,6 @@ public:
 	static void AddYardieDoorSmoke(CVector const &vecPos, CMatrix const &matMatrix);
 };
 
-VALIDATE_SIZE(CParticle, 0x68);
\ No newline at end of file
+#ifdef CHECK_STRUCT_SIZES
+VALIDATE_SIZE(CParticle, 0x68);
+#endif
\ No newline at end of file
diff --git a/src/render/ParticleMgr.h b/src/render/ParticleMgr.h
index 70845a56..42e3f132 100644
--- a/src/render/ParticleMgr.h
+++ b/src/render/ParticleMgr.h
@@ -64,8 +64,10 @@ struct tParticleSystemData
 	RwRaster      **m_ppRaster;
 	CParticle     *m_pParticles;
 };
-VALIDATE_SIZE(tParticleSystemData, 0x88);
 
+#ifdef CHECK_STRUCT_SIZES
+VALIDATE_SIZE(tParticleSystemData, 0x88);
+#endif
 
 class cParticleSystemMgr
 {
@@ -125,6 +127,8 @@ public:
 	void RangeCheck(tParticleSystemData *pData) { }
 };
 
+#ifdef CHECK_STRUCT_SIZES
 VALIDATE_SIZE(cParticleSystemMgr, 0x2420);
+#endif
 
 extern cParticleSystemMgr mod_ParticleSystemManager;
\ No newline at end of file
diff --git a/src/render/Shadows.h b/src/render/Shadows.h
index 39be343e..8e89024d 100644
--- a/src/render/Shadows.h
+++ b/src/render/Shadows.h
@@ -51,7 +51,10 @@ public:
     CStoredShadow()
 	{  }
 };
+
+#ifdef CHECK_STRUCT_SIZES
 VALIDATE_SIZE(CStoredShadow, 0x30);
+#endif
 
 class CPolyBunch
 {
@@ -65,7 +68,10 @@ public:
     CPolyBunch()
 	{  }
 };
+
+#ifdef CHECK_STRUCT_SIZES
 VALIDATE_SIZE(CPolyBunch, 0x6C);
+#endif
 
 class CStaticShadow
 {
@@ -93,7 +99,10 @@ public:
 
 	void Free();
 };
+
+#ifdef CHECK_STRUCT_SIZES
 VALIDATE_SIZE(CStaticShadow, 0x40);
+#endif
 
 class CPermanentShadow
 {
@@ -115,7 +124,9 @@ public:
 	CPermanentShadow()
 	{  }
 };
+#ifdef CHECK_STRUCT_SIZES
 VALIDATE_SIZE(CPermanentShadow, 0x38);
+#endif
 
 class CPtrList;
 class CAutomobile;
diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp
index d20cc0bf..c16f07d3 100644
--- a/src/skel/win/win.cpp
+++ b/src/skel/win/win.cpp
@@ -90,7 +90,9 @@ static psGlobalType PsGlobal;
 #include "Sprite2d.h"
 #include "AnimViewer.h"
 
+#ifdef CHECK_STRUCT_SIZES 
 VALIDATE_SIZE(psGlobalType, 0x28);
+#endif
 
 // DirectShow interfaces
 IGraphBuilder *pGB = nil;
diff --git a/src/text/Text.h b/src/text/Text.h
index 00d1c5e6..a454a095 100644
--- a/src/text/Text.h
+++ b/src/text/Text.h
@@ -12,8 +12,11 @@ struct CKeyEntry
 	wchar *value;
 	char key[8];
 };
+
 // If this fails, CKeyArray::Load will have to be fixed
+#ifdef CHECK_STRUCT_SIZES
 static_assert(sizeof(CKeyEntry) == 12, "CKeyEntry: error");
+#endif
 
 class CKeyArray
 {
diff --git a/src/vehicles/Automobile.h b/src/vehicles/Automobile.h
index 041302bf..16d1a2ef 100644
--- a/src/vehicles/Automobile.h
+++ b/src/vehicles/Automobile.h
@@ -197,7 +197,9 @@ public:
 	static void SetAllTaxiLights(bool set);
 };
 
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CAutomobile) == 0x5A8, "CAutomobile: error");
+#endif
 
 inline uint8 GetCarDoorFlag(int32 carnode) {
 	switch (carnode) {
diff --git a/src/vehicles/Boat.h b/src/vehicles/Boat.h
index 70407ab9..014b1e48 100644
--- a/src/vehicles/Boat.h
+++ b/src/vehicles/Boat.h
@@ -72,7 +72,9 @@ public:
 
 };
 
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CBoat) == 0x484, "CBoat: error");
+#endif
 
 extern float MAX_WAKE_LENGTH;
 extern float MIN_WAKE_INTERVAL;
diff --git a/src/vehicles/Cranes.h b/src/vehicles/Cranes.h
index c0502638..4d4c8fb4 100644
--- a/src/vehicles/Cranes.h
+++ b/src/vehicles/Cranes.h
@@ -72,7 +72,9 @@ public:
 	float GetHeightToDropoffHeight() { return m_fDropoffHeight + (m_bIsCrusher ? 7.0f : 2.0f); }
 };
 
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CCrane) == 128, "CCrane: error");
+#endif
 
 class CCranes
 {
diff --git a/src/vehicles/Heli.h b/src/vehicles/Heli.h
index 39e4cbcf..d41afb58 100644
--- a/src/vehicles/Heli.h
+++ b/src/vehicles/Heli.h
@@ -95,4 +95,7 @@ public:
 
 	static void ActivateHeli(bool activate);
 };
+
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CHeli) == 0x33C, "CHeli: error");
+#endif
diff --git a/src/vehicles/Plane.h b/src/vehicles/Plane.h
index 79738858..f0c5902b 100644
--- a/src/vehicles/Plane.h
+++ b/src/vehicles/Plane.h
@@ -63,7 +63,10 @@ public:
 	static bool HasCesnaBeenDestroyed(void);
 	static bool HasDropOffCesnaBeenShotDown(void);
 };
+
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CPlane) == 0x29C, "CPlane: error");
+#endif
 
 extern float LandingPoint;
 extern float TakeOffPoint;
diff --git a/src/vehicles/Train.h b/src/vehicles/Train.h
index bf541250..6fb73169 100644
--- a/src/vehicles/Train.h
+++ b/src/vehicles/Train.h
@@ -91,4 +91,7 @@ public:
 		float *totalLength, float *totalDuration, CTrainInterpolationLine *interpLines, bool rightRail);
 	static void UpdateTrains(void);
 };
+
+#ifdef CHECK_STRUCT_SIZES 
 static_assert(sizeof(CTrain) == 0x2E4, "CTrain: error");
+#endif
\ No newline at end of file
diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h
index 110ff97c..d8891628 100644
--- a/src/vehicles/Vehicle.h
+++ b/src/vehicles/Vehicle.h
@@ -291,9 +291,11 @@ public:
 	static bool m_bDisableMouseSteering;
 };
 
+#ifdef CHECK_STRUCT_SIZES
 static_assert(sizeof(CVehicle) == 0x288, "CVehicle: error");
 static_assert(offsetof(CVehicle, m_pCurGroundEntity) == 0x1E0, "CVehicle: error");
 static_assert(offsetof(CVehicle, m_nAlarmState) == 0x1A0, "CVehicle: error");
 static_assert(offsetof(CVehicle, m_nLastWeaponDamage) == 0x228, "CVehicle: error");
+#endif
 
 void DestroyVehicleAndDriverAndPassengers(CVehicle* pVehicle);

From c798e1bacdaabaf140ff3904948fd7cec46c09bb Mon Sep 17 00:00:00 2001
From: bigbossbro08 <bigbossbro08@gmail.com>
Date: Sun, 10 May 2020 21:49:33 +0600
Subject: [PATCH 2/3] Fixed typos and made all assert functions optional

---
 src/animation/AnimBlendAssociation.h |  4 +---
 src/animation/AnimBlendClumpData.h   |  4 ++--
 src/animation/AnimBlendHierarchy.h   |  4 +---
 src/animation/AnimBlendNode.h        |  5 ++---
 src/animation/AnimBlendSequence.h    |  2 +-
 src/audio/AudioCollision.h           |  8 ++------
 src/audio/AudioManager.h             | 17 ++++++-----------
 src/audio/AudioScriptObject.h        |  2 +-
 src/audio/MusicManager.h             |  2 +-
 src/audio/PoliceRadio.h              |  4 ++--
 src/control/AutoPilot.h              |  4 +---
 src/control/Garages.h                |  6 ++----
 src/control/OnscreenTimer.h          |  4 ++--
 src/control/PathFind.h               |  9 ++-------
 src/control/Phones.h                 |  4 +---
 src/control/Pickups.h                |  4 +---
 src/control/Replay.h                 | 20 +++++++++-----------
 src/control/SceneEdit.cpp            |  2 ++
 src/control/Script.cpp               | 10 ++++++++++
 src/control/Script.h                 |  4 ++--
 src/core/Camera.h                    |  4 ++--
 src/core/CdStream.cpp                |  2 --
 src/core/CdStream.h                  |  2 --
 src/core/Frontend.h                  |  2 +-
 src/core/Placeable.h                 |  4 +---
 src/core/PlayerInfo.h                |  4 +---
 src/core/Radar.cpp                   |  2 ++
 src/core/Radar.h                     |  2 +-
 src/core/Wanted.h                    |  4 +---
 src/core/World.h                     |  5 +----
 src/entities/Building.h              |  5 ++---
 src/entities/Dummy.h                 |  5 ++---
 src/entities/Entity.h                |  4 +---
 src/entities/Physical.h              |  4 +---
 src/entities/Treadable.h             |  5 ++---
 src/modelinfo/BaseModelInfo.h        |  6 ++----
 src/modelinfo/ClumpModelInfo.h       |  4 +---
 src/modelinfo/PedModelInfo.h         |  2 +-
 src/modelinfo/SimpleModelInfo.h      |  4 +---
 src/modelinfo/TimeModelInfo.h        |  4 +---
 src/modelinfo/VehicleModelInfo.h     |  4 +---
 src/objects/CutsceneHead.h           |  2 +-
 src/objects/CutsceneObject.h         |  2 +-
 src/objects/DummyObject.h            |  4 +---
 src/objects/Object.h                 |  4 +---
 src/objects/ObjectData.h             |  2 +-
 src/peds/CivilianPed.h               |  2 +-
 src/peds/CopPed.h                    |  2 +-
 src/peds/DummyPed.h                  |  4 +---
 src/peds/EmergencyPed.h              |  2 +-
 src/peds/Gangs.h                     |  2 +-
 src/peds/Ped.h                       |  6 ++++--
 src/peds/PedIK.h                     |  4 +---
 src/peds/PedStats.h                  |  3 ++-
 src/peds/PedType.h                   |  2 +-
 src/peds/PlayerPed.h                 |  2 +-
 src/render/2dEffect.h                |  4 +---
 src/render/Coronas.h                 |  4 +---
 src/render/Glass.h                   |  2 --
 src/render/Particle.h                |  2 --
 src/render/PointLights.h             |  2 +-
 src/render/Shadows.h                 |  3 +--
 src/render/WaterCannon.h             |  2 +-
 src/skel/win/win.cpp                 |  2 --
 src/text/Text.h                      |  4 +---
 src/vehicles/Automobile.h            |  4 +---
 src/vehicles/Boat.h                  |  4 +---
 src/vehicles/Cranes.h                |  4 +---
 src/vehicles/Heli.h                  |  5 ++---
 src/vehicles/Plane.h                 |  4 +---
 src/vehicles/Train.h                 |  4 +---
 src/vehicles/Vehicle.h               |  2 +-
 src/weapons/WeaponInfo.h             |  2 +-
 73 files changed, 110 insertions(+), 184 deletions(-)

diff --git a/src/animation/AnimBlendAssociation.h b/src/animation/AnimBlendAssociation.h
index 4f3be016..d0c60a88 100644
--- a/src/animation/AnimBlendAssociation.h
+++ b/src/animation/AnimBlendAssociation.h
@@ -85,6 +85,4 @@ public:
 	}
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CAnimBlendAssociation) == 0x40, "CAnimBlendAssociation: error");
-#endif
\ No newline at end of file
+VALIDATE_SIZE(CAnimBlendAssociation, 0x40);
diff --git a/src/animation/AnimBlendClumpData.h b/src/animation/AnimBlendClumpData.h
index a537425a..5c511ab8 100644
--- a/src/animation/AnimBlendClumpData.h
+++ b/src/animation/AnimBlendClumpData.h
@@ -26,7 +26,7 @@ struct AnimBlendFrameData
 #endif
 };
 #ifndef PED_SKIN
-static_assert(sizeof(AnimBlendFrameData) == 0x14, "AnimBlendFrameData: error");
+VALIDATE_SIZE(AnimBlendFrameData, 0x14);
 #endif
 
 
@@ -51,5 +51,5 @@ public:
 	void ForAllFrames(void (*cb)(AnimBlendFrameData*, void*), void *arg);
 };
 #ifndef PED_SKIN
-static_assert(sizeof(CAnimBlendClumpData) == 0x14, "CAnimBlendClumpData: error");
+VALIDATE_SIZE(CAnimBlendClumpData, 0x14);
 #endif
diff --git a/src/animation/AnimBlendHierarchy.h b/src/animation/AnimBlendHierarchy.h
index 1bf687cc..0144108d 100644
--- a/src/animation/AnimBlendHierarchy.h
+++ b/src/animation/AnimBlendHierarchy.h
@@ -25,6 +25,4 @@ public:
 	void RemoveUncompressedData(void);
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CAnimBlendHierarchy) == 0x28, "CAnimBlendHierarchy: error");
-#endif
\ No newline at end of file
+VALIDATE_SIZE(CAnimBlendHierarchy, 0x28);
\ No newline at end of file
diff --git a/src/animation/AnimBlendNode.h b/src/animation/AnimBlendNode.h
index 46f2fee4..89924d6a 100644
--- a/src/animation/AnimBlendNode.h
+++ b/src/animation/AnimBlendNode.h
@@ -27,6 +27,5 @@ public:
 	void GetEndTranslation(CVector &trans, float weight);
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CAnimBlendNode) == 0x1C, "CAnimBlendNode: error");
-#endif
\ No newline at end of file
+
+VALIDATE_SIZE(CAnimBlendNode, 0x1C);
diff --git a/src/animation/AnimBlendSequence.h b/src/animation/AnimBlendSequence.h
index 1246d7b4..44ac8886 100644
--- a/src/animation/AnimBlendSequence.h
+++ b/src/animation/AnimBlendSequence.h
@@ -51,5 +51,5 @@ public:
 #endif
 };
 #ifndef PED_SKIN
-static_assert(sizeof(CAnimBlendSequence) == 0x2C, "CAnimBlendSequence: error");
+VALIDATE_SIZE(CAnimBlendSequence, 0x2C);
 #endif
diff --git a/src/audio/AudioCollision.h b/src/audio/AudioCollision.h
index e8711f9a..0a058916 100644
--- a/src/audio/AudioCollision.h
+++ b/src/audio/AudioCollision.h
@@ -20,9 +20,7 @@ public:
 	// no methods
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(cAudioCollision) == 40, "cAudioCollision: error");
-#endif
+VALIDATE_SIZE(cAudioCollision, 40);
 
 class cAudioCollisionManager
 {
@@ -37,6 +35,4 @@ public:
 	void AddCollisionToRequestedQueue();
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(cAudioCollisionManager) == 852, "cAudioCollisionManager: error");
-#endif
\ No newline at end of file
+VALIDATE_SIZE(cAudioCollisionManager, 852);
diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h
index 5f00eac4..3e20b993 100644
--- a/src/audio/AudioManager.h
+++ b/src/audio/AudioManager.h
@@ -35,7 +35,7 @@ public:
 	int8 m_nVolumeChange;
 };
 
-static_assert(sizeof(tSound) == 92, "tSound: error");
+VALIDATE_SIZE(tSound, 92);
 
 class CPhysical;
 class CAutomobile;
@@ -52,9 +52,7 @@ public:
 	uint8 m_AudioEvents;
 };
 
-#ifdef CHECK_STRUCT_SIZES
-static_assert(sizeof(tAudioEntity) == 40, "tAudioEntity: error");
-#endif
+VALIDATE_SIZE(tAudioEntity, 40);
 
 class tPedComment
 {
@@ -67,7 +65,7 @@ public:
 	int8 m_nProcess;
 };
 
-static_assert(sizeof(tPedComment) == 28, "tPedComment: error");
+VALIDATE_SIZE(tPedComment, 28);
 
 class cPedComments
 {
@@ -82,7 +80,7 @@ public:
 	void Process();
 };
 
-static_assert(sizeof(cPedComments) == 1164, "cPedComments: error");
+VALIDATE_SIZE(cPedComments, 1164);
 
 class CEntity;
 
@@ -98,8 +96,7 @@ public:
 	int32 m_nMissionAudioCounter;
 	bool m_bIsPlayed;
 };
-
-static_assert(sizeof(cMissionAudio) == 32, "cMissionAudio: error");
+VALIDATE_SIZE(cMissionAudio, 32);
 
 // name made up
 class cAudioScriptObjectManager
@@ -137,9 +134,7 @@ public:
 	float m_fVelocityChange;
 };
 
-#ifdef CHECK_STRUCT_SIZES
-static_assert(sizeof(cVehicleParams) == 0x18, "cVehicleParams: error");
-#endif
+VALIDATE_SIZE(cVehicleParams, 0x18);
 
 enum {
 	/*
diff --git a/src/audio/AudioScriptObject.h b/src/audio/AudioScriptObject.h
index 4308faee..ecc07fdf 100644
--- a/src/audio/AudioScriptObject.h
+++ b/src/audio/AudioScriptObject.h
@@ -148,6 +148,6 @@ public:
 	static void SaveAllAudioScriptObjects(uint8 *buf, uint32 *size);
 };
 
-static_assert(sizeof(cAudioScriptObject) == 20, "cAudioScriptObject: error");
+VALIDATE_SIZE(cAudioScriptObject, 20);
 
 extern void PlayOneShotScriptObject(uint8 id, CVector const &pos);
\ No newline at end of file
diff --git a/src/audio/MusicManager.h b/src/audio/MusicManager.h
index 5d6f41cf..e8b94da6 100644
--- a/src/audio/MusicManager.h
+++ b/src/audio/MusicManager.h
@@ -84,6 +84,6 @@ public:
 	bool ChangeRadioChannel();
 };
 
-static_assert(sizeof(cMusicManager) == 0x95C, "cMusicManager: error");
+VALIDATE_SIZE(cMusicManager, 0x95C);
 
 extern cMusicManager MusicManager;
diff --git a/src/audio/PoliceRadio.h b/src/audio/PoliceRadio.h
index 0f351f52..c01f21ce 100644
--- a/src/audio/PoliceRadio.h
+++ b/src/audio/PoliceRadio.h
@@ -15,7 +15,7 @@ struct cAMCrime {
 	}
 };
 
-static_assert(sizeof(cAMCrime) == 20, "cAMCrime: error ");
+VALIDATE_SIZE(cAMCrime, 20);
 
 class cPoliceRadioQueue
 {
@@ -43,4 +43,4 @@ public:
 	}
 };
 
-static_assert(sizeof(cPoliceRadioQueue) == 444, "cPoliceRadioQueue: error ");
\ No newline at end of file
+VALIDATE_SIZE(cPoliceRadioQueue, 444);
diff --git a/src/control/AutoPilot.h b/src/control/AutoPilot.h
index 1528db46..337a93c1 100644
--- a/src/control/AutoPilot.h
+++ b/src/control/AutoPilot.h
@@ -120,6 +120,4 @@ public:
 
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CAutoPilot) == 0x70, "CAutoPilot: error");
-#endif
\ No newline at end of file
+VALIDATE_SIZE(CAutoPilot, 0x70);
diff --git a/src/control/Garages.h b/src/control/Garages.h
index 95e7ba5c..00020eb3 100644
--- a/src/control/Garages.h
+++ b/src/control/Garages.h
@@ -75,7 +75,7 @@ public:
 	CVehicle* RestoreCar();
 };
 
-static_assert(sizeof(CStoredCar) == 0x28, "CStoredCar");
+VALIDATE_SIZE(CStoredCar, 0x28);
 
 #define SWITCH_GARAGE_DISTANCE_CLOSE 40.0f
 
@@ -172,9 +172,7 @@ class CGarage
 	friend class CCamera;
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CGarage) == 140, "CGarage");
-#endif
+VALIDATE_SIZE(CGarage, 140);
 
 class CGarages
 {
diff --git a/src/control/OnscreenTimer.h b/src/control/OnscreenTimer.h
index fb139266..3ef7764a 100644
--- a/src/control/OnscreenTimer.h
+++ b/src/control/OnscreenTimer.h
@@ -26,7 +26,7 @@ public:
 	void ProcessForDisplayCounter();
 };
 
-static_assert(sizeof(COnscreenTimerEntry) == 0x74, "COnscreenTimerEntry: error");
+VALIDATE_SIZE(COnscreenTimerEntry, 0x74);
 
 class COnscreenTimer
 {
@@ -46,4 +46,4 @@ public:
 	void AddClock(uint32 offset, char* text);
 };
 
-static_assert(sizeof(COnscreenTimer) == 0x78, "COnscreenTimer: error");
\ No newline at end of file
+VALIDATE_SIZE(COnscreenTimer, 0x78);
diff --git a/src/control/PathFind.h b/src/control/PathFind.h
index d812ac32..bbfdf7b7 100644
--- a/src/control/PathFind.h
+++ b/src/control/PathFind.h
@@ -42,9 +42,7 @@ struct CPedPathNode
 	CPedPathNode* next;
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CPedPathNode) == 0x10, "CPedPathNode: error");
-#endif
+VALIDATE_SIZE(CPedPathNode, 0x10);
 
 class CPedPath {
 public:
@@ -225,10 +223,7 @@ public:
 	void DisplayPathData(void);
 };
 
-
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CPathFind) == 0x49bf4, "CPathFind: error");
-#endif
+VALIDATE_SIZE(CPathFind, 0x49bf4);
 
 extern CPathFind ThePaths;
 
diff --git a/src/control/Phones.h b/src/control/Phones.h
index 01ed370e..14d47ed1 100644
--- a/src/control/Phones.h
+++ b/src/control/Phones.h
@@ -32,9 +32,7 @@ public:
 	~CPhone() { }
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CPhone) == 0x34, "CPhone: error");
-#endif
+VALIDATE_SIZE(CPhone, 0x34);
 
 class CPhoneInfo {
 public:
diff --git a/src/control/Pickups.h b/src/control/Pickups.h
index f4e5e560..b05f5db7 100644
--- a/src/control/Pickups.h
+++ b/src/control/Pickups.h
@@ -47,9 +47,7 @@ private:
 	void Remove();
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CPickup) == 0x1C, "CPickup: error");
-#endif
+VALIDATE_SIZE(CPickup, 0x1C);
 
 struct tPickupMessage
 {
diff --git a/src/control/Replay.h b/src/control/Replay.h
index ec39def8..66bee3bf 100644
--- a/src/control/Replay.h
+++ b/src/control/Replay.h
@@ -109,9 +109,7 @@ class CReplay
 		CVector player_pos;
 	};
 
-#ifdef CHECK_STRUCT_SIZES
-	static_assert(sizeof(tGeneralPacket) == 88, "tGeneralPacket: error");
-#endif
+	VALIDATE_SIZE(tGeneralPacket, 88);
 
 	struct tClockPacket
 	{
@@ -121,7 +119,7 @@ class CReplay
 	private:
 		uint8 __align;
 	};
-	static_assert(sizeof(tClockPacket) == 4, "tClockPacket: error");
+	VALIDATE_SIZE(tClockPacket, 4);
 
 	struct tWeatherPacket
 	{
@@ -130,14 +128,14 @@ class CReplay
 		uint8 new_weather;
 		float interpolation;
 	};
-	static_assert(sizeof(tWeatherPacket) == 8, "tWeatherPacket: error");
+	VALIDATE_SIZE(tWeatherPacket, 8);
 
 	struct tTimerPacket
 	{
 		uint8 type;
 		uint32 timer;
 	};
-	static_assert(sizeof(tTimerPacket) == 8, "tTimerPacket: error");
+	VALIDATE_SIZE(tTimerPacket, 8);
 
 	struct tPedHeaderPacket
 	{
@@ -148,7 +146,7 @@ class CReplay
 	private:
 		uint8 __align[3];
 	};
-	static_assert(sizeof(tPedHeaderPacket) == 8, "tPedHeaderPacket: error");
+	VALIDATE_SIZE(tPedHeaderPacket, 8);
 
 	struct tBulletTracePacket
 	{
@@ -159,7 +157,7 @@ class CReplay
 		CVector inf;
 		CVector sup;
 	};
-	static_assert(sizeof(tBulletTracePacket) == 28, "tBulletTracePacket: error");
+	VALIDATE_SIZE(tBulletTracePacket, 28);
 
 	struct tEndOfFramePacket
 	{
@@ -167,7 +165,7 @@ class CReplay
 	private:
 		uint8 __align[3];
 	};
-	static_assert(sizeof(tEndOfFramePacket) == 4, "tEndOfFramePacket: error");
+	VALIDATE_SIZE(tEndOfFramePacket, 4);
 
 	struct tPedUpdatePacket
 	{
@@ -180,7 +178,7 @@ class CReplay
 		int8 assoc_group_id;
 		uint8 weapon_model;
 	};
-	static_assert(sizeof(tPedUpdatePacket) == 40, "tPedUpdatePacket: error");
+	VALIDATE_SIZE(tPedUpdatePacket, 40);
 
 	struct tVehicleUpdatePacket
 	{
@@ -205,7 +203,7 @@ class CReplay
 		uint8 primary_color;
 		uint8 secondary_color;
 	};
-	static_assert(sizeof(tVehicleUpdatePacket) == 48, "tVehicleUpdatePacket: error");
+	VALIDATE_SIZE(tVehicleUpdatePacket, 48);
 
 private:
 	static uint8 Mode;
diff --git a/src/control/SceneEdit.cpp b/src/control/SceneEdit.cpp
index c8b4242e..54f4dd3a 100644
--- a/src/control/SceneEdit.cpp
+++ b/src/control/SceneEdit.cpp
@@ -68,7 +68,9 @@ static const char* pCommandStrings[] = {
 	"Save Movie", "Load Movie", "Play Movie", "END"
 };
 
+#ifdef CHECK_STRUCT_SIZES
 static_assert(ARRAY_SIZE(pCommandStrings) == CSceneEdit::MOVIE_TOTAL_COMMANDS, "Scene edit: not all commands have names");
+#endif
 
 static int32 NextValidModelId(int32 mi, int32 step)
 {
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index a274c289..df3a489a 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -11205,7 +11205,9 @@ INITSAVEBUF
 	WriteSaveBuf(buf, varSpace);
 	for (uint32 i = 0; i < varSpace; i++)
 		WriteSaveBuf(buf, ScriptSpace[i]);
+#ifdef CHECK_STRUCT_SIZES
 	static_assert(SCRIPT_DATA_SIZE == 968, "CTheScripts::SaveAllScripts");
+#endif
 	uint32 script_data_size = SCRIPT_DATA_SIZE;
 	WriteSaveBuf(buf, script_data_size);
 	WriteSaveBuf(buf, OnAMissionFlag);
@@ -11631,12 +11633,16 @@ void CRunningScript::Save(uint8*& buf)
 	for (int i = 0; i < 8; i++)
 		WriteSaveBuf<char>(buf, m_abScriptName[i]);
 	WriteSaveBuf<uint32>(buf, m_nIp);
+#ifdef CHECK_STRUCT_SIZES
 	static_assert(MAX_STACK_DEPTH == 6, "Compatibility loss: MAX_STACK_DEPTH != 6");
+#endif
 	for (int i = 0; i < MAX_STACK_DEPTH; i++)
 		WriteSaveBuf<uint32>(buf, m_anStack[i]);
 	WriteSaveBuf<uint16>(buf, m_nStackPointer);
 	SkipSaveBuf(buf, 2);
+#ifdef CHECK_STRUCT_SIZES
 	static_assert(NUM_LOCAL_VARS + NUM_TIMERS == 18, "Compatibility loss: NUM_LOCAL_VARS + NUM_TIMERS != 18");
+#endif
 	for (int i = 0; i < NUM_LOCAL_VARS + NUM_TIMERS; i++)
 		WriteSaveBuf<int32>(buf, m_anLocalVariables[i]);
 	WriteSaveBuf<bool>(buf, m_bCondResult);
@@ -11662,12 +11668,16 @@ void CRunningScript::Load(uint8*& buf)
 	for (int i = 0; i < 8; i++)
 		m_abScriptName[i] = ReadSaveBuf<char>(buf);
 	m_nIp = ReadSaveBuf<uint32>(buf);
+#ifdef CHECK_STRUCT_SIZES
 	static_assert(MAX_STACK_DEPTH == 6, "Compatibility loss: MAX_STACK_DEPTH != 6");
+#endif
 	for (int i = 0; i < MAX_STACK_DEPTH; i++)
 		m_anStack[i] = ReadSaveBuf<uint32>(buf);
 	m_nStackPointer = ReadSaveBuf<uint16>(buf);
 	SkipSaveBuf(buf, 2);
+#ifdef CHECK_STRUCT_SIZES
 	static_assert(NUM_LOCAL_VARS + NUM_TIMERS == 18, "Compatibility loss: NUM_LOCAL_VARS + NUM_TIMERS != 18");
+#endif
 	for (int i = 0; i < NUM_LOCAL_VARS + NUM_TIMERS; i++)
 		m_anLocalVariables[i] = ReadSaveBuf<int32>(buf);
 	m_bCondResult = ReadSaveBuf<bool>(buf);
diff --git a/src/control/Script.h b/src/control/Script.h
index 01cad269..acab66cc 100644
--- a/src/control/Script.h
+++ b/src/control/Script.h
@@ -27,7 +27,7 @@ struct intro_script_rectangle
 	~intro_script_rectangle() { }
 };
 
-static_assert(sizeof(intro_script_rectangle) == 0x18, "Script.h: error");
+VALIDATE_SIZE(intro_script_rectangle, 0x18);
 
 enum {
 	SCRIPT_TEXT_MAX_LENGTH = 500
@@ -78,7 +78,7 @@ struct intro_text_line
 	}
 };
 
-static_assert(sizeof(intro_text_line) == 0x414, "Script.h: error");
+VALIDATE_SIZE(intro_text_line, 0x414);
 
 struct script_sphere_struct
 {
diff --git a/src/core/Camera.h b/src/core/Camera.h
index d69b1be4..b197aed3 100644
--- a/src/core/Camera.h
+++ b/src/core/Camera.h
@@ -261,8 +261,8 @@ public:
 	void Process_FollowCar_SA(const CVector &CameraTarget, float TargetOrientation, float, float);
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CCam) == 0x1A4, "CCam: wrong size");
+VALIDATE_SIZE(CCam, 0x1A4);
+#ifdef CHECK_STRUCT_SIZES
 static_assert(offsetof(CCam, Alpha) == 0xA8, "CCam: error");
 static_assert(offsetof(CCam, Front) == 0x140, "CCam: error");
 #endif
diff --git a/src/core/CdStream.cpp b/src/core/CdStream.cpp
index 3b9eaac5..666041e1 100644
--- a/src/core/CdStream.cpp
+++ b/src/core/CdStream.cpp
@@ -23,9 +23,7 @@ struct CdReadInfo
 	OVERLAPPED Overlapped;
 };
 
-#ifdef CHECK_STRUCT_SIZES
 VALIDATE_SIZE(CdReadInfo, 0x30);
-#endif
 
 char gCdImageNames[MAX_CDIMAGES+1][64];
 int32 gNumImages;
diff --git a/src/core/CdStream.h b/src/core/CdStream.h
index ba74be31..ba6c63a3 100644
--- a/src/core/CdStream.h
+++ b/src/core/CdStream.h
@@ -25,9 +25,7 @@ struct Queue
 	int32 size;
 };
 
-#ifdef CHECK_STRUCT_SIZES
 VALIDATE_SIZE(Queue, 0x10);
-#endif
 
 void CdStreamInitThread(void);
 void CdStreamInit(int32 numChannels);
diff --git a/src/core/Frontend.h b/src/core/Frontend.h
index 3286f275..e496f9c0 100644
--- a/src/core/Frontend.h
+++ b/src/core/Frontend.h
@@ -658,7 +658,7 @@ public:
 };
 
 #ifndef IMPROVED_VIDEOMODE
-static_assert(sizeof(CMenuManager) == 0x564, "CMenuManager: error");
+VALIDATE_SIZE(CMenuManager, 0x564);
 #endif
 
 extern CMenuManager FrontEndMenuManager;
diff --git a/src/core/Placeable.h b/src/core/Placeable.h
index 110a1542..970c0d48 100644
--- a/src/core/Placeable.h
+++ b/src/core/Placeable.h
@@ -32,6 +32,4 @@ public:
 	bool IsWithinArea(float x1, float y1, float z1, float x2, float y2, float z2);
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CPlaceable) == 0x4C, "CPlaceable: error");
-#endif
\ No newline at end of file
+VALIDATE_SIZE(CPlaceable, 0x4C);
diff --git a/src/core/PlayerInfo.h b/src/core/PlayerInfo.h
index ae089032..94410753 100644
--- a/src/core/PlayerInfo.h
+++ b/src/core/PlayerInfo.h
@@ -81,6 +81,4 @@ public:
 	~CPlayerInfo() { };
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CPlayerInfo) == 0x13C, "CPlayerInfo: error");
-#endif
+VALIDATE_SIZE(CPlayerInfo, 0x13C);
diff --git a/src/core/Radar.cpp b/src/core/Radar.cpp
index 9406f1bd..ac2712c9 100644
--- a/src/core/Radar.cpp
+++ b/src/core/Radar.cpp
@@ -76,7 +76,9 @@ CSprite2d *CRadar::RadarSprites[RADAR_SPRITE_COUNT] = {
 
 #define RADAR_NUM_TILES (8)
 #define RADAR_TILE_SIZE (RADAR_SIZE_X / RADAR_NUM_TILES)
+#ifdef CHECK_STRUCT_SIZES
 static_assert(RADAR_TILE_SIZE == (RADAR_SIZE_Y / RADAR_NUM_TILES), "CRadar: not a square");
+#endif
 
 #define RADAR_MIN_RANGE (120.0f)
 #define RADAR_MAX_RANGE (350.0f)
diff --git a/src/core/Radar.h b/src/core/Radar.h
index e39a17f0..7d07671d 100644
--- a/src/core/Radar.h
+++ b/src/core/Radar.h
@@ -71,7 +71,7 @@ struct sRadarTrace
 	uint16 m_eBlipDisplay; // eBlipDisplay
 	uint16 m_eRadarSprite; // eRadarSprite
 };
-static_assert(sizeof(sRadarTrace) == 0x30, "sRadarTrace: error");
+VALIDATE_SIZE(sRadarTrace, 0x30);
 
 // Values for screen space
 #define RADAR_LEFT (40.0f)
diff --git a/src/core/Wanted.h b/src/core/Wanted.h
index 802c3673..de36c442 100644
--- a/src/core/Wanted.h
+++ b/src/core/Wanted.h
@@ -54,6 +54,4 @@ public:
 	static void SetMaximumWantedLevel(int32 level);
 };
 
-#ifdef CHECK_STRUCT_SIZES
-static_assert(sizeof(CWanted) == 0x204, "CWanted: error");
-#endif
+VALIDATE_SIZE(CWanted, 0x204);
diff --git a/src/core/World.h b/src/core/World.h
index 6fc6681d..2bcc4e43 100644
--- a/src/core/World.h
+++ b/src/core/World.h
@@ -46,10 +46,7 @@ public:
 	CPtrList m_lists[NUMSECTORENTITYLISTS];
 };
 
-
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CSector) == 0x28, "CSector: error");
-#endif
+VALIDATE_SIZE(CSector, 0x28);
 
 class CEntity;
 struct CColPoint;
diff --git a/src/entities/Building.h b/src/entities/Building.h
index 50818189..3586a8dc 100644
--- a/src/entities/Building.h
+++ b/src/entities/Building.h
@@ -17,6 +17,5 @@ public:
 	virtual bool GetIsATreadable(void) { return false; }
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CBuilding) == 0x64, "CBuilding: error");
-#endif
+VALIDATE_SIZE(CBuilding, 0x64);
+
diff --git a/src/entities/Dummy.h b/src/entities/Dummy.h
index de0e448b..3717a01c 100644
--- a/src/entities/Dummy.h
+++ b/src/entities/Dummy.h
@@ -16,6 +16,5 @@ public:
 	static void operator delete(void*, size_t);
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CDummy) == 0x68, "CDummy: error");
-#endif
+VALIDATE_SIZE(CDummy, 0x68);
+
diff --git a/src/entities/Entity.h b/src/entities/Entity.h
index 18254ae4..eca462cd 100644
--- a/src/entities/Entity.h
+++ b/src/entities/Entity.h
@@ -173,6 +173,4 @@ public:
 	static void AddSteamsFromGround(CPtrList& list);
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CEntity) == 0x64, "CEntity: error");
-#endif
\ No newline at end of file
+VALIDATE_SIZE(CEntity, 0x64);
diff --git a/src/entities/Physical.h b/src/entities/Physical.h
index c9b7402b..c84686ed 100644
--- a/src/entities/Physical.h
+++ b/src/entities/Physical.h
@@ -161,6 +161,4 @@ public:
 	bool CheckCollision_SimpleCar(void);
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CPhysical) == 0x128, "CPhysical: error");
-#endif
+VALIDATE_SIZE(CPhysical, 0x128);
diff --git a/src/entities/Treadable.h b/src/entities/Treadable.h
index 272b2d4b..c3160f47 100644
--- a/src/entities/Treadable.h
+++ b/src/entities/Treadable.h
@@ -13,6 +13,5 @@ public:
 	bool GetIsATreadable(void) { return true; }
 };
 
-#ifdef CHECK_STRUCT_SIZES
-static_assert(sizeof(CTreadable) == 0x94, "CTreadable: error");
-#endif
+VALIDATE_SIZE(CTreadable, 0x94);
+
diff --git a/src/modelinfo/BaseModelInfo.h b/src/modelinfo/BaseModelInfo.h
index ce42cb3a..783f871f 100644
--- a/src/modelinfo/BaseModelInfo.h
+++ b/src/modelinfo/BaseModelInfo.h
@@ -15,7 +15,7 @@ enum ModelInfoType : uint8
 	MITYPE_PED       = 6,
 	MITYPE_XTRACOMPS = 7,
 };
-static_assert(sizeof(ModelInfoType) == 1, "ModeInfoType: error");
+VALIDATE_SIZE(ModelInfoType, 1);
 
 class C2dEffect;
 
@@ -70,6 +70,4 @@ public:
 	uint16 GetNumRefs() const { return m_refCount; }
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CBaseModelInfo) == 0x30, "CBaseModelInfo: error");
-#endif
+VALIDATE_SIZE(CBaseModelInfo, 0x30);
diff --git a/src/modelinfo/ClumpModelInfo.h b/src/modelinfo/ClumpModelInfo.h
index a4ba2c9e..58b6de11 100644
--- a/src/modelinfo/ClumpModelInfo.h
+++ b/src/modelinfo/ClumpModelInfo.h
@@ -51,6 +51,4 @@ public:
 	static RwFrame *GetFrameFromId(RpClump *clump, int32 id);
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CClumpModelInfo) == 0x34, "CClumpModelInfo: error");
-#endif
+VALIDATE_SIZE(CClumpModelInfo, 0x34);
diff --git a/src/modelinfo/PedModelInfo.h b/src/modelinfo/PedModelInfo.h
index a2bfd122..84ada087 100644
--- a/src/modelinfo/PedModelInfo.h
+++ b/src/modelinfo/PedModelInfo.h
@@ -55,5 +55,5 @@ public:
 #endif
 };
 #ifndef PED_SKIN
-static_assert(sizeof(CPedModelInfo) == 0x48, "CPedModelInfo: error");
+VALIDATE_SIZE(CPedModelInfo, 0x48);
 #endif
\ No newline at end of file
diff --git a/src/modelinfo/SimpleModelInfo.h b/src/modelinfo/SimpleModelInfo.h
index 65ff8c52..ee63f24b 100644
--- a/src/modelinfo/SimpleModelInfo.h
+++ b/src/modelinfo/SimpleModelInfo.h
@@ -50,6 +50,4 @@ public:
 		m_atomics[2] = (RpAtomic*)m; }
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CSimpleModelInfo) == 0x4C, "CSimpleModelInfo: error");
-#endif
+VALIDATE_SIZE(CSimpleModelInfo, 0x4C);
diff --git a/src/modelinfo/TimeModelInfo.h b/src/modelinfo/TimeModelInfo.h
index cbe171e0..73b6ab26 100644
--- a/src/modelinfo/TimeModelInfo.h
+++ b/src/modelinfo/TimeModelInfo.h
@@ -18,6 +18,4 @@ public:
 	CTimeModelInfo *FindOtherTimeModel(void);
 };
 
-#ifdef CHECK_STRUCT_SIZES
-static_assert(sizeof(CTimeModelInfo) == 0x58, "CTimeModelInfo: error");
-#endif
\ No newline at end of file
+VALIDATE_SIZE(CTimeModelInfo, 0x58);
diff --git a/src/modelinfo/VehicleModelInfo.h b/src/modelinfo/VehicleModelInfo.h
index 160c846b..ba25d3cd 100644
--- a/src/modelinfo/VehicleModelInfo.h
+++ b/src/modelinfo/VehicleModelInfo.h
@@ -124,6 +124,4 @@ public:
 	static void SetComponentsToUse(int8 c1, int8 c2) { ms_compsToUse[0] = c1; ms_compsToUse[1] = c2; }
 };
 
-#ifdef CHECK_STRUCT_SIZES
-static_assert(sizeof(CVehicleModelInfo) == 0x1F8, "CVehicleModelInfo: error");
-#endif
+VALIDATE_SIZE(CVehicleModelInfo, 0x1F8);
diff --git a/src/objects/CutsceneHead.h b/src/objects/CutsceneHead.h
index 0a70353d..c931eb01 100644
--- a/src/objects/CutsceneHead.h
+++ b/src/objects/CutsceneHead.h
@@ -24,5 +24,5 @@ public:
 	void PlayAnimation(const char *animName);
 };
 #ifndef PED_SKIN
-static_assert(sizeof(CCutsceneHead) == 0x19C, "CCutsceneHead: error");
+VALIDATE_SIZE(CCutsceneHead, 0x19C);
 #endif
diff --git a/src/objects/CutsceneObject.h b/src/objects/CutsceneObject.h
index 9c4036bf..407adcc7 100644
--- a/src/objects/CutsceneObject.h
+++ b/src/objects/CutsceneObject.h
@@ -29,5 +29,5 @@ public:
 	void RemoveLighting(bool reset);
 };
 #ifndef PED_SKIN
-static_assert(sizeof(CCutsceneObject) == 0x198, "CCutsceneObject: error");
+VALIDATE_SIZE(CCutsceneObject, 0x198);
 #endif
diff --git a/src/objects/DummyObject.h b/src/objects/DummyObject.h
index 8a0913c5..d6f88335 100644
--- a/src/objects/DummyObject.h
+++ b/src/objects/DummyObject.h
@@ -11,6 +11,4 @@ public:
 	CDummyObject(CObject *obj);
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CDummyObject) == 0x68, "CDummyObject: error");
-#endif
\ No newline at end of file
+VALIDATE_SIZE(CDummyObject, 0x68);
diff --git a/src/objects/Object.h b/src/objects/Object.h
index ff4c896e..79589dc9 100644
--- a/src/objects/Object.h
+++ b/src/objects/Object.h
@@ -98,6 +98,4 @@ public:
 	static void DeleteAllTempObjectsInArea(CVector point, float fRadius);
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CObject) == 0x198, "CObject: error");
-#endif
+VALIDATE_SIZE(CObject, 0x198);
diff --git a/src/objects/ObjectData.h b/src/objects/ObjectData.h
index e3a5c1bd..e25c1aeb 100644
--- a/src/objects/ObjectData.h
+++ b/src/objects/ObjectData.h
@@ -16,7 +16,7 @@ public:
 	uint8 m_nSpecialCollisionResponseCases;
 	bool m_bCameraToAvoidThisObject;
 };
-static_assert(sizeof(CObjectInfo) == 0x20, "CObjectInfo: error");
+VALIDATE_SIZE(CObjectInfo, 0x20);
 
 class CObjectData
 {
diff --git a/src/peds/CivilianPed.h b/src/peds/CivilianPed.h
index 88d034c8..8418a99f 100644
--- a/src/peds/CivilianPed.h
+++ b/src/peds/CivilianPed.h
@@ -12,5 +12,5 @@ public:
 	void ProcessControl(void);
 };
 #ifndef PED_SKIN
-static_assert(sizeof(CCivilianPed) == 0x53C, "CCivilianPed: error");
+VALIDATE_SIZE(CCivilianPed, 0x53C);
 #endif
diff --git a/src/peds/CopPed.h b/src/peds/CopPed.h
index d63aef06..5346d9a1 100644
--- a/src/peds/CopPed.h
+++ b/src/peds/CopPed.h
@@ -37,5 +37,5 @@ public:
 };
 
 #ifndef PED_SKIN
-static_assert(sizeof(CCopPed) == 0x558, "CCopPed: error");
+VALIDATE_SIZE(CCopPed, 0x558);
 #endif
diff --git a/src/peds/DummyPed.h b/src/peds/DummyPed.h
index 5bb72d87..ea617c76 100644
--- a/src/peds/DummyPed.h
+++ b/src/peds/DummyPed.h
@@ -9,6 +9,4 @@ class CDummyPed : CDummy
 	int32 unknown;
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CDummyPed) == 0x70, "CDummyPed: error");
-#endif
\ No newline at end of file
+VALIDATE_SIZE(CDummyPed, 0x70);
diff --git a/src/peds/EmergencyPed.h b/src/peds/EmergencyPed.h
index 6d3dac79..390ba0bd 100644
--- a/src/peds/EmergencyPed.h
+++ b/src/peds/EmergencyPed.h
@@ -37,5 +37,5 @@ public:
 	void MedicAI(void);
 };
 #ifndef PED_SKIN
-static_assert(sizeof(CEmergencyPed) == 0x554, "CEmergencyPed: error");
+VALIDATE_SIZE(CEmergencyPed, 0x554);
 #endif
diff --git a/src/peds/Gangs.h b/src/peds/Gangs.h
index dd7a7f93..c8ea2916 100644
--- a/src/peds/Gangs.h
+++ b/src/peds/Gangs.h
@@ -10,7 +10,7 @@ struct CGangInfo
 	CGangInfo();
 };
 
-static_assert(sizeof(CGangInfo) == 0x10, "CGangInfo: error");
+VALIDATE_SIZE(CGangInfo, 0x10);
 
 enum {
 	GANG_MAFIA = 0,
diff --git a/src/peds/Ped.h b/src/peds/Ped.h
index 9f105e7a..e399b7e4 100644
--- a/src/peds/Ped.h
+++ b/src/peds/Ped.h
@@ -82,7 +82,7 @@ struct FightMove
 	uint8 damage;
 	uint8 flags;
 };
-static_assert(sizeof(FightMove) == 0x18, "FightMove: error");
+VALIDATE_SIZE(FightMove, 0x18);
 
 // TODO: This is eFightState on mobile.
 enum PedFightMoves
@@ -896,6 +896,7 @@ public:
 void FinishFuckUCB(CAnimBlendAssociation *assoc, void *arg);
 
 #ifndef PED_SKIN
+#ifdef CHECK_STRUCT_SIZES
 static_assert(offsetof(CPed, m_nPedState) == 0x224, "CPed: error");
 static_assert(offsetof(CPed, m_pCurSurface) == 0x2FC, "CPed: error");
 static_assert(offsetof(CPed, m_pMyVehicle) == 0x310, "CPed: error");
@@ -907,5 +908,6 @@ static_assert(offsetof(CPed, m_lookTimer) == 0x4CC, "CPed: error");
 static_assert(offsetof(CPed, m_bodyPartBleeding) == 0x4F2, "CPed: error");
 static_assert(offsetof(CPed, m_pedInObjective) == 0x16C, "CPed: error");
 static_assert(offsetof(CPed, m_pEventEntity) == 0x19C, "CPed: error");
-static_assert(sizeof(CPed) == 0x53C, "CPed: error");
+#endif
+VALIDATE_SIZE(CPed, 0x53C);
 #endif
diff --git a/src/peds/PedIK.h b/src/peds/PedIK.h
index 566193d6..a1cb5d13 100644
--- a/src/peds/PedIK.h
+++ b/src/peds/PedIK.h
@@ -65,6 +65,4 @@ public:
 	bool RestoreLookAt(void);
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CPedIK) == 0x28, "CPedIK: error");
-#endif
+VALIDATE_SIZE(CPedIK, 0x28);
diff --git a/src/peds/PedStats.h b/src/peds/PedStats.h
index 4c35e8ee..df97bdb8 100644
--- a/src/peds/PedStats.h
+++ b/src/peds/PedStats.h
@@ -76,4 +76,5 @@ public:
 	static void LoadPedStats(void);
 	static ePedStats GetPedStatType(char *name);
 };
-static_assert(sizeof(CPedStats) == 0x34, "CPedStats: error");
+
+VALIDATE_SIZE(CPedStats, 0x34);
diff --git a/src/peds/PedType.h b/src/peds/PedType.h
index c0c72550..3a765da1 100644
--- a/src/peds/PedType.h
+++ b/src/peds/PedType.h
@@ -91,4 +91,4 @@ public:
 	static bool IsThreat(int type, int threat) { return ms_apPedType[type]->m_threats & threat; }
 };
 
-static_assert(sizeof(CPedType) == 0x20, "CPedType: error");
+VALIDATE_SIZE(CPedType, 0x20);
diff --git a/src/peds/PlayerPed.h b/src/peds/PlayerPed.h
index 61b70f89..e8173c8c 100644
--- a/src/peds/PlayerPed.h
+++ b/src/peds/PlayerPed.h
@@ -85,5 +85,5 @@ public:
 };
 
 #ifndef PED_SKIN
-static_assert(sizeof(CPlayerPed) == 0x5F0, "CPlayerPed: error");
+VALIDATE_SIZE(CPlayerPed, 0x5F0);
 #endif
diff --git a/src/render/2dEffect.h b/src/render/2dEffect.h
index 8c583799..2a71a8d5 100644
--- a/src/render/2dEffect.h
+++ b/src/render/2dEffect.h
@@ -90,6 +90,4 @@ public:
 	}
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(C2dEffect) == 0x34, "C2dEffect: error");
-#endif
\ No newline at end of file
+VALIDATE_SIZE(C2dEffect, 0x34);
diff --git a/src/render/Coronas.h b/src/render/Coronas.h
index d2e79079..46eb4315 100644
--- a/src/render/Coronas.h
+++ b/src/render/Coronas.h
@@ -39,9 +39,7 @@ struct CRegisteredCorona
 	void Update(void);
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CRegisteredCorona) == 0x80, "CRegisteredCorona: error");
-#endif
+VALIDATE_SIZE(CRegisteredCorona, 0x80);
 
 class CCoronas
 {
diff --git a/src/render/Glass.h b/src/render/Glass.h
index 0c715c27..51c5aae9 100644
--- a/src/render/Glass.h
+++ b/src/render/Glass.h
@@ -21,9 +21,7 @@ public:
 	void Render(void);
 };
 
-#ifdef CHECK_STRUCT_SIZES
 VALIDATE_SIZE(CFallingGlassPane, 0x70);
-#endif
 
 enum
 {
diff --git a/src/render/Particle.h b/src/render/Particle.h
index ed1528d2..7f02e318 100644
--- a/src/render/Particle.h
+++ b/src/render/Particle.h
@@ -91,6 +91,4 @@ public:
 	static void AddYardieDoorSmoke(CVector const &vecPos, CMatrix const &matMatrix);
 };
 
-#ifdef CHECK_STRUCT_SIZES
 VALIDATE_SIZE(CParticle, 0x68);
-#endif
\ No newline at end of file
diff --git a/src/render/PointLights.h b/src/render/PointLights.h
index 56b84f71..9e94328f 100644
--- a/src/render/PointLights.h
+++ b/src/render/PointLights.h
@@ -13,7 +13,7 @@ public:
 	int8 fogType;
 	bool castExtraShadows;
 };
-static_assert(sizeof(CRegisteredPointLight) == 0x2C, "CRegisteredPointLight: error");
+VALIDATE_SIZE(CRegisteredPointLight, 0x2C);
 
 class CPointLights
 {
diff --git a/src/render/Shadows.h b/src/render/Shadows.h
index 8e89024d..ef56d336 100644
--- a/src/render/Shadows.h
+++ b/src/render/Shadows.h
@@ -124,9 +124,8 @@ public:
 	CPermanentShadow()
 	{  }
 };
-#ifdef CHECK_STRUCT_SIZES
+
 VALIDATE_SIZE(CPermanentShadow, 0x38);
-#endif
 
 class CPtrList;
 class CAutomobile;
diff --git a/src/render/WaterCannon.h b/src/render/WaterCannon.h
index d2d20863..a37bdd12 100644
--- a/src/render/WaterCannon.h
+++ b/src/render/WaterCannon.h
@@ -25,7 +25,7 @@ public:
 	void PushPeds(void);
 };
 
-static_assert(sizeof(CWaterCannon) == 412, "CWaterCannon: error");
+VALIDATE_SIZE(CWaterCannon, 412);
 
 class CWaterCannons
 {
diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp
index c16f07d3..d20cc0bf 100644
--- a/src/skel/win/win.cpp
+++ b/src/skel/win/win.cpp
@@ -90,9 +90,7 @@ static psGlobalType PsGlobal;
 #include "Sprite2d.h"
 #include "AnimViewer.h"
 
-#ifdef CHECK_STRUCT_SIZES 
 VALIDATE_SIZE(psGlobalType, 0x28);
-#endif
 
 // DirectShow interfaces
 IGraphBuilder *pGB = nil;
diff --git a/src/text/Text.h b/src/text/Text.h
index a454a095..4255e2a5 100644
--- a/src/text/Text.h
+++ b/src/text/Text.h
@@ -14,9 +14,7 @@ struct CKeyEntry
 };
 
 // If this fails, CKeyArray::Load will have to be fixed
-#ifdef CHECK_STRUCT_SIZES
-static_assert(sizeof(CKeyEntry) == 12, "CKeyEntry: error");
-#endif
+VALIDATE_SIZE(CKeyEntry, 12);
 
 class CKeyArray
 {
diff --git a/src/vehicles/Automobile.h b/src/vehicles/Automobile.h
index 16d1a2ef..a3e8ac17 100644
--- a/src/vehicles/Automobile.h
+++ b/src/vehicles/Automobile.h
@@ -197,9 +197,7 @@ public:
 	static void SetAllTaxiLights(bool set);
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CAutomobile) == 0x5A8, "CAutomobile: error");
-#endif
+VALIDATE_SIZE(CAutomobile, 0x5A8);
 
 inline uint8 GetCarDoorFlag(int32 carnode) {
 	switch (carnode) {
diff --git a/src/vehicles/Boat.h b/src/vehicles/Boat.h
index 014b1e48..3cc3513d 100644
--- a/src/vehicles/Boat.h
+++ b/src/vehicles/Boat.h
@@ -72,9 +72,7 @@ public:
 
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CBoat) == 0x484, "CBoat: error");
-#endif
+VALIDATE_SIZE(CBoat, 0x484);
 
 extern float MAX_WAKE_LENGTH;
 extern float MIN_WAKE_INTERVAL;
diff --git a/src/vehicles/Cranes.h b/src/vehicles/Cranes.h
index 4d4c8fb4..6d877d82 100644
--- a/src/vehicles/Cranes.h
+++ b/src/vehicles/Cranes.h
@@ -72,9 +72,7 @@ public:
 	float GetHeightToDropoffHeight() { return m_fDropoffHeight + (m_bIsCrusher ? 7.0f : 2.0f); }
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CCrane) == 128, "CCrane: error");
-#endif
+VALIDATE_SIZE(CCrane, 128);
 
 class CCranes
 {
diff --git a/src/vehicles/Heli.h b/src/vehicles/Heli.h
index d41afb58..cf3f791f 100644
--- a/src/vehicles/Heli.h
+++ b/src/vehicles/Heli.h
@@ -96,6 +96,5 @@ public:
 	static void ActivateHeli(bool activate);
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CHeli) == 0x33C, "CHeli: error");
-#endif
+VALIDATE_SIZE(CHeli, 0x33C);
+
diff --git a/src/vehicles/Plane.h b/src/vehicles/Plane.h
index f0c5902b..7e822d64 100644
--- a/src/vehicles/Plane.h
+++ b/src/vehicles/Plane.h
@@ -64,9 +64,7 @@ public:
 	static bool HasDropOffCesnaBeenShotDown(void);
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CPlane) == 0x29C, "CPlane: error");
-#endif
+VALIDATE_SIZE(CPlane, 0x29C);
 
 extern float LandingPoint;
 extern float TakeOffPoint;
diff --git a/src/vehicles/Train.h b/src/vehicles/Train.h
index 6fb73169..6aa76fa8 100644
--- a/src/vehicles/Train.h
+++ b/src/vehicles/Train.h
@@ -92,6 +92,4 @@ public:
 	static void UpdateTrains(void);
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(sizeof(CTrain) == 0x2E4, "CTrain: error");
-#endif
\ No newline at end of file
+VALIDATE_SIZE(CTrain, 0x2E4);
diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h
index d8891628..76c2b90c 100644
--- a/src/vehicles/Vehicle.h
+++ b/src/vehicles/Vehicle.h
@@ -291,8 +291,8 @@ public:
 	static bool m_bDisableMouseSteering;
 };
 
+VALIDATE_SIZE(CVehicle, 0x288);
 #ifdef CHECK_STRUCT_SIZES
-static_assert(sizeof(CVehicle) == 0x288, "CVehicle: error");
 static_assert(offsetof(CVehicle, m_pCurGroundEntity) == 0x1E0, "CVehicle: error");
 static_assert(offsetof(CVehicle, m_nAlarmState) == 0x1A0, "CVehicle: error");
 static_assert(offsetof(CVehicle, m_nLastWeaponDamage) == 0x228, "CVehicle: error");
diff --git a/src/weapons/WeaponInfo.h b/src/weapons/WeaponInfo.h
index 3bafd324..b5882082 100644
--- a/src/weapons/WeaponInfo.h
+++ b/src/weapons/WeaponInfo.h
@@ -46,4 +46,4 @@ public:
 	static void Shutdown(void);
 };
 
-static_assert(sizeof(CWeaponInfo) == 0x54, "CWeaponInfo: error");
\ No newline at end of file
+VALIDATE_SIZE(CWeaponInfo, 0x54);
\ No newline at end of file

From b4abb6ddd8c2daee13cc9f83f17286fdf286c798 Mon Sep 17 00:00:00 2001
From: bigbossbro08 <bigbossbro08@gmail.com>
Date: Sun, 10 May 2020 22:04:36 +0600
Subject: [PATCH 3/3] fixed few more typos

---
 src/core/Camera.h      | 20 +-------------------
 src/core/Radar.cpp     |  2 --
 src/peds/Ped.h         | 13 -------------
 src/vehicles/Vehicle.h |  5 -----
 4 files changed, 1 insertion(+), 39 deletions(-)

diff --git a/src/core/Camera.h b/src/core/Camera.h
index b197aed3..94bcbd23 100644
--- a/src/core/Camera.h
+++ b/src/core/Camera.h
@@ -262,10 +262,6 @@ public:
 };
 
 VALIDATE_SIZE(CCam, 0x1A4);
-#ifdef CHECK_STRUCT_SIZES
-static_assert(offsetof(CCam, Alpha) == 0xA8, "CCam: error");
-static_assert(offsetof(CCam, Front) == 0x140, "CCam: error");
-#endif
 
 class CCamPathSplines
 {
@@ -641,21 +637,7 @@ uint32    unknown;	// some counter having to do with music
 	bool IsBoxVisible(RwV3d *box, const CMatrix *mat);
 };
 
-#ifdef CHECK_STRUCT_SIZES 
-static_assert(offsetof(CCamera, DistanceToWater) == 0xe4, "CCamera: error");
-static_assert(offsetof(CCamera, m_WideScreenOn) == 0x70, "CCamera: error");
-static_assert(offsetof(CCamera, WorldViewerBeingUsed) == 0x75, "CCamera: error");
-static_assert(offsetof(CCamera, m_uiNumberOfTrainCamNodes) == 0x84, "CCamera: error");
-static_assert(offsetof(CCamera, m_uiTransitionState) == 0x89, "CCamera: error");
-static_assert(offsetof(CCamera, m_uiTimeTransitionStart) == 0x94, "CCamera: error");
-static_assert(offsetof(CCamera, m_BlurBlue) == 0x9C, "CCamera: error");
-static_assert(offsetof(CCamera, Cams) == 0x1A4, "CCamera: error");
-static_assert(offsetof(CCamera, pToGarageWeAreIn) == 0x690, "CCamera: error");
-static_assert(offsetof(CCamera, m_PreviousCameraPosition) == 0x6B0, "CCamera: error");
-static_assert(offsetof(CCamera, m_vecCutSceneOffset) == 0x6F8, "CCamera: error");
-static_assert(offsetof(CCamera, m_arrPathArray) == 0x7a8, "CCamera: error");
-static_assert(sizeof(CCamera) == 0xE9D8, "CCamera: wrong size");
-#endif
+VALIDATE_SIZE(CCamera, 0xE9D8);
 
 extern CCamera TheCamera;
 
diff --git a/src/core/Radar.cpp b/src/core/Radar.cpp
index ac2712c9..9406f1bd 100644
--- a/src/core/Radar.cpp
+++ b/src/core/Radar.cpp
@@ -76,9 +76,7 @@ CSprite2d *CRadar::RadarSprites[RADAR_SPRITE_COUNT] = {
 
 #define RADAR_NUM_TILES (8)
 #define RADAR_TILE_SIZE (RADAR_SIZE_X / RADAR_NUM_TILES)
-#ifdef CHECK_STRUCT_SIZES
 static_assert(RADAR_TILE_SIZE == (RADAR_SIZE_Y / RADAR_NUM_TILES), "CRadar: not a square");
-#endif
 
 #define RADAR_MIN_RANGE (120.0f)
 #define RADAR_MAX_RANGE (350.0f)
diff --git a/src/peds/Ped.h b/src/peds/Ped.h
index e399b7e4..56e527c5 100644
--- a/src/peds/Ped.h
+++ b/src/peds/Ped.h
@@ -896,18 +896,5 @@ public:
 void FinishFuckUCB(CAnimBlendAssociation *assoc, void *arg);
 
 #ifndef PED_SKIN
-#ifdef CHECK_STRUCT_SIZES
-static_assert(offsetof(CPed, m_nPedState) == 0x224, "CPed: error");
-static_assert(offsetof(CPed, m_pCurSurface) == 0x2FC, "CPed: error");
-static_assert(offsetof(CPed, m_pMyVehicle) == 0x310, "CPed: error");
-static_assert(offsetof(CPed, m_nPedType) == 0x32C, "CPed: error");
-static_assert(offsetof(CPed, m_pCollidingEntity) == 0x34C, "CPed: error");
-static_assert(offsetof(CPed, m_weapons) == 0x35C, "CPed: error");
-static_assert(offsetof(CPed, m_currentWeapon) == 0x498, "CPed: error");
-static_assert(offsetof(CPed, m_lookTimer) == 0x4CC, "CPed: error");
-static_assert(offsetof(CPed, m_bodyPartBleeding) == 0x4F2, "CPed: error");
-static_assert(offsetof(CPed, m_pedInObjective) == 0x16C, "CPed: error");
-static_assert(offsetof(CPed, m_pEventEntity) == 0x19C, "CPed: error");
-#endif
 VALIDATE_SIZE(CPed, 0x53C);
 #endif
diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h
index 76c2b90c..f7205c7d 100644
--- a/src/vehicles/Vehicle.h
+++ b/src/vehicles/Vehicle.h
@@ -292,10 +292,5 @@ public:
 };
 
 VALIDATE_SIZE(CVehicle, 0x288);
-#ifdef CHECK_STRUCT_SIZES
-static_assert(offsetof(CVehicle, m_pCurGroundEntity) == 0x1E0, "CVehicle: error");
-static_assert(offsetof(CVehicle, m_nAlarmState) == 0x1A0, "CVehicle: error");
-static_assert(offsetof(CVehicle, m_nLastWeaponDamage) == 0x228, "CVehicle: error");
-#endif
 
 void DestroyVehicleAndDriverAndPassengers(CVehicle* pVehicle);