From 8146f6014c632b7cf99383ccee9dc267b34cac50 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 10 Feb 2014 10:56:27 +0000 Subject: [PATCH] Don't crash if for some reason your CONs don't define actors like SHOTSPARK1, which has its strength value used in hardcoded behavior. git-svn-id: https://svn.eduke32.com/eduke32@4318 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/duke3d.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index 8ecefd524..e6ad99dd2 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -164,9 +164,9 @@ static inline int32_t G_HaveActor(int32_t actortile) static inline int32_t G_InitialActorStrength(int32_t actortile) { #ifdef LUNATIC - return g_elActors[actortile].strength; + return G_HaveActor(actortile) ? g_elActors[actortile].strength : 0; #else - return g_tile[actortile].execPtr[0]; + return G_HaveActor(actortile) ? g_tile[actortile].execPtr[0] : 0; #endif }