Moved list of self destruct safezone into level locals

This commit is contained in:
Walter Julius Hennecke 2012-10-26 13:32:55 +02:00
parent 2f85e31baf
commit ca510f36a1
3 changed files with 9 additions and 5 deletions

View file

@ -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_

View file

@ -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

View file

@ -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;