From 7693b09407dcecaecac5d657f76347457e3acc73 Mon Sep 17 00:00:00 2001 From: Walter Julius Hennecke Date: Fri, 26 Oct 2012 13:33:49 +0200 Subject: [PATCH] Moved self destruct safe zones list into level locals --- game/g_local.h | 6 +++++- game/g_main.c | 4 ++-- game/g_utils.c | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/game/g_local.h b/game/g_local.h index d2e8d2a..35de7c5 100644 --- a/game/g_local.h +++ b/game/g_local.h @@ -696,6 +696,10 @@ typedef struct { int numBrushEnts; //!< number of entities in the level that use brushmodels + // selft destruct safezones + list_p selfdestructSafeZones; + list_p locations; + } level_locals_t; @@ -2042,7 +2046,6 @@ struct luaAlertState_s { luaAlertState_t *luaAlertState; // self destruct -list_p selfdestructSafeZones; typedef struct safeZone_s safeZone_t; struct safeZone_s { char* name; @@ -2051,4 +2054,5 @@ struct safeZone_s { vec3_t mins; } safeZone_s; + #endif //_G_LOCAL_H_ diff --git a/game/g_main.c b/game/g_main.c index 6ac51cd..408288f 100644 --- a/game/g_main.c +++ b/game/g_main.c @@ -2044,8 +2044,8 @@ void G_ShutdownGame( int restart ) { } // free self destruct safe zones - if(selfdestructSafeZones != NULL) { - destroy_list(selfdestructSafeZones); + if(level.selfdestructSafeZones != NULL) { + destroy_list(level.selfdestructSafeZones); } #ifdef SQL diff --git a/game/g_utils.c b/game/g_utils.c index 556b3d3..5fd6210 100644 --- a/game/g_utils.c +++ b/game/g_utils.c @@ -509,8 +509,8 @@ void G_UseTargets2( gentity_t *ent, gentity_t *activator, char *target ) { } /* self destruct safe zones */ - if(selfdestructSafeZones != NULL && selfdestructSafeZones->length > 0) { - szIter = list_iterator(selfdestructSafeZones, FRONT); + if(level.selfdestructSafeZones != NULL && level.selfdestructSafeZones->length > 0) { + szIter = list_iterator(level.selfdestructSafeZones, FRONT); for(sz = (safeZone_t *)list_next(szIter); sz != NULL; sz = (safeZone_t *)list_next(szIter)) { if(!strcmp(sz->name, target)) { sz->active = (qboolean)!sz->active;