From ca510f36a1f153f33346ee3ec42f01b0607f0781 Mon Sep 17 00:00:00 2001 From: Walter Julius Hennecke Date: Fri, 26 Oct 2012 13:32:55 +0200 Subject: [PATCH] Moved list of self destruct safezone into level locals --- code/game/g_local.h | 6 +++++- code/game/g_main.c | 4 ++-- code/game/g_utils.c | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/code/game/g_local.h b/code/game/g_local.h index d2e8d2a..35de7c5 100644 --- a/code/game/g_local.h +++ b/code/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/code/game/g_main.c b/code/game/g_main.c index 6ac51cd..408288f 100644 --- a/code/game/g_main.c +++ b/code/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/code/game/g_utils.c b/code/game/g_utils.c index 556b3d3..5fd6210 100644 --- a/code/game/g_utils.c +++ b/code/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;