summaryrefslogtreecommitdiff
path: root/src/rw/VisibilityPlugins.cpp
diff options
context:
space:
mode:
authorwithmorten <morten.with@gmail.com>2021-01-31 01:19:25 +0100
committerwithmorten <morten.with@gmail.com>2021-01-31 01:19:25 +0100
commit2e37001881eab8932dafcfd345fd9bb641bb70f4 (patch)
treeeb00d6f01ec00c3aec6cd5f05c8332d9398a3094 /src/rw/VisibilityPlugins.cpp
parente5190481e4301f0d7a7667f97090ac73ef8445f3 (diff)
fix UB and new renderer crashes
Diffstat (limited to 'src/rw/VisibilityPlugins.cpp')
-rw-r--r--src/rw/VisibilityPlugins.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rw/VisibilityPlugins.cpp b/src/rw/VisibilityPlugins.cpp
index bdde5e33..3a303194 100644
--- a/src/rw/VisibilityPlugins.cpp
+++ b/src/rw/VisibilityPlugins.cpp
@@ -96,6 +96,10 @@ CVisibilityPlugins::InitAlphaEntityList(void)
bool
CVisibilityPlugins::InsertEntityIntoSortedList(CEntity *e, float dist)
{
+#ifdef FIX_BUGS
+ if (!e->m_rwObject) return true;
+#endif
+
AlphaObjectInfo item;
item.entity = e;
item.sort = dist;