summaryrefslogtreecommitdiffstats
path: root/src/entities/Entity.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-05-19 00:49:09 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-05-19 00:49:09 +0200
commit6510b15704998b14b89fa453ba9d142f85c30dd5 (patch)
treee194a3641474f3a0818bb4ff2dd139f2c293e804 /src/entities/Entity.cpp
parentfixes for braking and cloud rotation at high fps (diff)
downloadre3-6510b15704998b14b89fa453ba9d142f85c30dd5.tar
re3-6510b15704998b14b89fa453ba9d142f85c30dd5.tar.gz
re3-6510b15704998b14b89fa453ba9d142f85c30dd5.tar.bz2
re3-6510b15704998b14b89fa453ba9d142f85c30dd5.tar.lz
re3-6510b15704998b14b89fa453ba9d142f85c30dd5.tar.xz
re3-6510b15704998b14b89fa453ba9d142f85c30dd5.tar.zst
re3-6510b15704998b14b89fa453ba9d142f85c30dd5.zip
Diffstat (limited to 'src/entities/Entity.cpp')
-rw-r--r--src/entities/Entity.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/entities/Entity.cpp b/src/entities/Entity.cpp
index b35ddb25..e83df204 100644
--- a/src/entities/Entity.cpp
+++ b/src/entities/Entity.cpp
@@ -28,6 +28,8 @@
#include "Bones.h"
#include "Debug.h"
#include "Renderer.h"
+#include "Ped.h"
+#include "Dummy.h"
int gBuildings;
@@ -1028,3 +1030,18 @@ CEntity::LoadEntityFlags(uint8*& buf)
}
#endif
+
+bool IsEntityPointerValid(CEntity* pEntity)
+{
+ if (!pEntity)
+ return false;
+ switch (pEntity->GetType()) {
+ case ENTITY_TYPE_NOTHING: return false;
+ case ENTITY_TYPE_BUILDING: return IsBuildingPointerValid((CBuilding*)pEntity);
+ case ENTITY_TYPE_VEHICLE: return IsVehiclePointerValid((CVehicle*)pEntity);
+ case ENTITY_TYPE_PED: return IsPedPointerValid((CPed*)pEntity);
+ case ENTITY_TYPE_OBJECT: return IsObjectPointerValid((CObject*)pEntity);
+ case ENTITY_TYPE_DUMMY: return IsDummyPointerValid((CDummy*)pEntity);
+ }
+ return false;
+}