if (!this.owner)
return;
+ if (this.owner.active != ACTIVE_ACTIVE)
+ return;
this = this.owner;
if (this.spawnflags & DOOR_TOGGLE)
return;
if (this.owner.door_finished > time)
return;
+#ifdef SVQC
+ if (this.owner.active != ACTIVE_ACTIVE)
+ return;
+#endif
this.owner.door_finished = time + 2;
if(!((IS_CLIENT(toucher) || toucher.classname == "ENT_CLIENT_PROJECTILE") && !IS_DEAD(toucher)))
#endif
return;
+#ifdef SVQC
+ if (this.owner.active != ACTIVE_ACTIVE)
+ return;
+#endif
if (this.owner.state == STATE_UP)
return;
setorigin(this, this.pos1);
this.velocity = '0 0 0';
this.state = STATE_BOTTOM;
+ this.active = ACTIVE_ACTIVE;
setthink(this, func_null);
this.nextthink = 0;
setblocked(this, door_blocked);
this.use = door_use;
+ this.active = ACTIVE_ACTIVE;
if(this.spawnflags & DOOR_NONSOLID)
this.solid = SOLID_NOT;
setblocked(this, door_blocked);
this.use = door_use;
+ this.active = ACTIVE_ACTIVE;
this.pos1 = '0 0 0';
this.pos2 = this.movedir;
void fd_secret_use(entity this, entity actor, entity trigger)
{
- float temp;
- string message_save;
+ if(this.active != ACTIVE_ACTIVE)
+ return;
SetResourceExplicit(this, RES_HEALTH, 10000);
if(!this.bot_attack)
if (this.origin != this.oldorigin)
return;
- message_save = this.message;
+ string message_save = this.message;
this.message = ""; // no more message
SUB_UseTargets(this, actor, trigger); // fire all targets / killtargets
this.message = message_save;
_sound(this, CH_TRIGGER_SINGLE, this.noise1, VOL_BASE, ATTEN_NORM);
this.nextthink = this.ltime + 0.1;
- temp = 1 - (this.spawnflags & DOOR_SECRET_1ST_LEFT); // 1 or -1
+ int temp = 1 - (this.spawnflags & DOOR_SECRET_1ST_LEFT); // 1 or -1
makevectors(this.mangle);
if (!this.t_width)
return;
if (this.door_finished > time)
return;
+ if (this.active != ACTIVE_ACTIVE)
+ return;
this.door_finished = time + 2;
setorigin(this, this.oldorigin);
setthink(this, func_null);
this.nextthink = 0;
+ this.active = ACTIVE_ACTIVE;
}
/*QUAKED spawnfunc_func_door_secret (0 .5 .8) ? open_once 1st_left 1st_down no_shoot always_shoot
setblocked(this, secret_blocked);
this.speed = 50;
this.use = fd_secret_use;
+ this.active = ACTIVE_ACTIVE;
if(!this.targetname || this.targetname == "")
this.spawnflags |= DOOR_SECRET_YES_SHOOT;
else
this.light_lev = 0;
}
+void dynlight_setactive(entity this, int act)
+{
+ int old_status = this.active;
+ if(act == ACTIVE_TOGGLE)
+ this.active = (this.active == ACTIVE_ACTIVE) ? ACTIVE_NOT : ACTIVE_ACTIVE;
+ else
+ this.active = act;
+
+ if(this.active != old_status)
+ this.light_lev = (this.active == ACTIVE_ACTIVE) ? this.lefty : 0;
+}
+void dynlight_reset(entity this)
+{
+ // TODO should anything else be reset here?
+ this.active = ACTIVE_ACTIVE;
+ this.light_lev = this.lefty;
+}
spawnfunc(dynlight)
{
if (!this.light_lev)
this.color = '1 1 1';
this.lefty = this.light_lev;
this.use = dynlight_use;
+ this.active = ACTIVE_ACTIVE;
+ this.setactive = dynlight_setactive;
+ this.reset = dynlight_reset;
setsize (this, '0 0 0', '0 0 0');
setorigin(this, this.origin);
//this.pflags = PFLAGS_FULLDYNAMIC;
{
if(game_stopped)
return;
+ if(this.active != ACTIVE_ACTIVE)
+ return;
if(this.spawnflags & CHANGELEVEL_MULTIPLAYER)
{
changelevel(this.chmap);
}
+void target_changelevel_reset(entity this)
+{
+ this.active = ACTIVE_ACTIVE;
+}
+
/*target_changelevel
Target to change/end level
KEYS:
spawnfunc(target_changelevel)
{
this.use = target_changelevel_use;
+ this.active = ACTIVE_ACTIVE;
+ this.reset = target_changelevel_reset;
if(!this.count)
{
{
if(!autocvar_g_campaign)
return; // only in campaign
+ if(this.active != ACTIVE_ACTIVE)
+ return;
if(this.cnt)
CampaignLevelWarp(this.cnt - 1); // specific level
CampaignLevelWarp(-1); // next level
}
+void target_levelwarp_reset(entity this)
+{
+ this.active = ACTIVE_ACTIVE;
+}
+
spawnfunc(target_levelwarp)
{
// this.cnt is index (starting from 1) of the campaign level to warp to
// 0 means next level
this.use = target_levelwarp_use;
+ this.active = ACTIVE_ACTIVE;
+ this.reset = target_levelwarp_reset;
}
#endif
void target_spawn_use(entity this, entity actor, entity trigger)
{
+ if(this.active != ACTIVE_ACTIVE)
+ return;
if(this.target == "")
{
// spawn new entity
}
}
+void target_spawn_reset(entity this)
+{
+ // TODO call "spawn first" again?
+ this.active = ACTIVE_ACTIVE;
+}
+
spawnfunc(target_spawn)
{
initialize_field_db();
this.use = target_spawn_use;
+ this.active = ACTIVE_ACTIVE;
+ this.reset = target_spawn_reset;
this.message = strzone(strreplace("'", "\"", this.message));
this.target_spawn_id = ++target_spawn_count;
InitializeEntity(this, target_spawn_spawnfirst, INITPRIO_LAST);
void target_voicescript_use(entity this, entity actor, entity trigger)
{
+ if(this.active != ACTIVE_ACTIVE)
+ return;
if(actor.voicescript != this)
{
actor.voicescript = this;
vs = pl.voicescript;
if(!vs)
return;
+ if(vs.active != ACTIVE_ACTIVE)
+ {
+ pl.voicescript = NULL;
+ return;
+ }
if(vs.message == "")
return;
if (!IS_PLAYER(pl))
}
}
+void target_voicescript_reset(entity this)
+{
+ this.active = ACTIVE_ACTIVE;
+}
+
spawnfunc(target_voicescript)
{
// netname: directory of the sound files
float i, n;
this.use = target_voicescript_use;
+ this.active = ACTIVE_ACTIVE;
+ this.reset = target_voicescript_reset;
n = tokenize_console(this.message);
this.cnt = n / 2;
}
setthink(this, Item_Think);
this.nextthink = time;
+ this.active = ACTIVE_ACTIVE;
if (this.waypointsprite_attached)
{
WaypointSprite_Kill(this.waypointsprite_attached);
}
void spawnpoint_reset(entity this)
{
+ this.active = ACTIVE_ACTIVE;
this.SendFlags |= 1; // update team since it was restored during reset
}