updates to g_fx.c

This commit is contained in:
Walter Julius Hennecke 2014-11-10 20:52:14 +01:00
parent 15c3ae39ae
commit 801359c672

View file

@ -6,7 +6,7 @@
#include "g_combat.h" #include "g_combat.h"
#include "g_syscalls.h" #include "g_syscalls.h"
#define SPARK_STARTOFF 1 static const uint8_t SPARK_STARTOFF = 1;
/*QUAKED fx_spark (0 0 1) (-8 -8 -8) (8 8 8) STARTOFF /*QUAKED fx_spark (0 0 1) (-8 -8 -8) (8 8 8) STARTOFF
-----DESCRIPTION----- -----DESCRIPTION-----
Emits sparks at the specified point in the specified direction. Emits sparks at the specified point in the specified direction.
@ -29,7 +29,8 @@ static void spark_think( gentity_t *ent )
G_AddEvent(ent, EV_FX_SPARK, 0); G_AddEvent(ent, EV_FX_SPARK, 0);
if (ent->targetname != NULL && ent->targetname[0] != 0) { //toggleable effect needs to be updated more often if (ent->targetname != NULL && ent->targetname[0] != 0) { //toggleable effect needs to be updated more often
ent->nextthink = level.time + 1000; ent->nextthink = level.time + 1000;
} else { }
else {
ent->nextthink = level.time + 10000; // send a refresh message every 10 seconds ent->nextthink = level.time + 10000; // send a refresh message every 10 seconds
} }
} }
@ -64,7 +65,7 @@ static void spark_link( gentity_t *ent )
if (target == NULL) if (target == NULL)
{ {
DEVELOPER(G_Printf(S_COLOR_YELLOW "[Enitiy-Error] spark_link: target specified but not found: %s\n", ent->target);); DEVELOPER(G_Logger(LL_ERROR, S_COLOR_YELLOW "[Entity-Error] spark_link: target specified but not found: %s\n", ent->target););
G_FreeEntity(ent); G_FreeEntity(ent);
return; return;
} }
@ -132,8 +133,8 @@ which means it sends 10 times the information that an untoggleable steam will se
"damage" - damage to apply when caught in steam vent, default - zero damage (no damage). Don't add this unless you really have to. "damage" - damage to apply when caught in steam vent, default - zero damage (no damage). Don't add this unless you really have to.
*/ */
#define STEAM_STARTOFF 1 static const uint8_t STEAM_STARTOFF = 1;
#define STEAM_UNLINKED 999 static const uint16_t STEAM_UNLINKED = 999;
//------------------------------------------ //------------------------------------------
static void steam_think(gentity_t *ent) static void steam_think(gentity_t *ent)
@ -141,7 +142,8 @@ static void steam_think( gentity_t *ent )
G_AddEvent(ent, EV_FX_STEAM, 0); G_AddEvent(ent, EV_FX_STEAM, 0);
if (ent->targetname != NULL && ent->targetname[0] != 0) { //toggleable effect needs to be updated more often if (ent->targetname != NULL && ent->targetname[0] != 0) { //toggleable effect needs to be updated more often
ent->nextthink = level.time + 1000; ent->nextthink = level.time + 1000;
} else { }
else {
ent->nextthink = level.time + 10000; // send a refresh message every 10 seconds ent->nextthink = level.time + 10000; // send a refresh message every 10 seconds
} }
@ -210,9 +212,10 @@ static void steam_link( gentity_t *ent )
if (target == NULL) if (target == NULL)
{ {
if (ent->target != NULL) { if (ent->target != NULL) {
DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] steam_link: unable to find target %s\n", ent->target);); DEVELOPER(G_Logger(LL_ERROR, S_COLOR_YELLOW "[Entity-Error] steam_link: unable to find target %s\n", ent->target););
} else { }
DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] steam_link: unable to find target\n");); else {
DEVELOPER(G_Logger(LL_ERROR, S_COLOR_YELLOW "[Entity-Error] steam_link: unable to find target\n"););
} }
G_FreeEntity(ent); G_FreeEntity(ent);
@ -230,7 +233,8 @@ static void steam_link( gentity_t *ent )
if (ent->targetname != NULL && ent->targetname[0] != 0) { // toggleable steam needs to be updated more often if (ent->targetname != NULL && ent->targetname[0] != 0) { // toggleable steam needs to be updated more often
ent->s.time = 1000; ent->s.time = 1000;
} else { }
else {
ent->s.time = 10000; ent->s.time = 10000;
} }
@ -247,7 +251,8 @@ static void steam_link( gentity_t *ent )
if ((ent->targetname != NULL) && ((ent->spawnflags & STEAM_STARTOFF) == 0)) { // toggleable steam needs to be updated more often if ((ent->targetname != NULL) && ((ent->spawnflags & STEAM_STARTOFF) == 0)) { // toggleable steam needs to be updated more often
ent->nextthink = level.time + 1000; ent->nextthink = level.time + 1000;
} else { }
else {
ent->nextthink = level.time + 10000; ent->nextthink = level.time + 10000;
} }
@ -255,7 +260,8 @@ static void steam_link( gentity_t *ent )
if (ent->targetname != NULL && ent->targetname[0] != 0) { if (ent->targetname != NULL && ent->targetname[0] != 0) {
if ((ent->spawnflags & STEAM_STARTOFF) == 0) { if ((ent->spawnflags & STEAM_STARTOFF) == 0) {
ent->count = 1; ent->count = 1;
} else { }
else {
ent->count = 0; ent->count = 0;
} }
} }
@ -300,10 +306,12 @@ which means it sends 10 times the information that an untoggleable steam will se
*/ */
#define BOLT_SPARKS 1 enum fx_boldSpawnflags_e {
#define BOLT_BORG 2 BOLT_SPARKS = 1,
#define BOLT_TAPER 4 BOLT_BORG = 2,
#define BOLT_SMOOTH 8 BOLT_TAPER = 4,
BOLT_SMOOTH = 8
};
//------------------------------------------ //------------------------------------------
static void bolt_think(gentity_t *ent) static void bolt_think(gentity_t *ent)
@ -315,7 +323,8 @@ static void bolt_think( gentity_t *ent )
ent->s.time2 = (int)ent->wait; ent->s.time2 = (int)ent->wait;
if (ent->targetname != NULL && ent->targetname[0] != 0) { //toggleable effect needs to be updated more often if (ent->targetname != NULL && ent->targetname[0] != 0) { //toggleable effect needs to be updated more often
ent->nextthink = level.time + 1000; ent->nextthink = level.time + 1000;
} else { }
else {
ent->nextthink = level.time + 10000; // send a refresh message every 10 seconds ent->nextthink = level.time + 10000; // send a refresh message every 10 seconds
} }
@ -371,15 +380,16 @@ static void bolt_link( gentity_t *ent )
if (ent->target != NULL && ent->target[0] != 0) if (ent->target != NULL && ent->target[0] != 0)
{ {
target = G_Find(target, FOFS(targetname), ent->target); target = G_Find(target, FOFS(targetname), ent->target);
} else { }
DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] bolt_link: ent->target is NULL\n");); else {
DEVELOPER(G_Logger(LL_ERROR, S_COLOR_YELLOW "[Entity-Error] bolt_link: ent->target is NULL\n"););
G_FreeEntity(ent); G_FreeEntity(ent);
return; return;
} }
if (target == NULL) if (target == NULL)
{ {
DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] bolt_link: unable to find target %s\n", ent->target);); DEVELOPER(G_Logger(LL_ERROR, "[Entity-Error] bolt_link: unable to find target %s\n", ent->target););
G_FreeEntity(ent); G_FreeEntity(ent);
return; return;
} }
@ -481,7 +491,7 @@ which means it sends 10 times the information that an untoggleable steam will se
"damage" - type of drips. 0 = water, 1 = oil, 2 = green "damage" - type of drips. 0 = water, 1 = oil, 2 = green
"random" - (0...1) degree of drippiness. 0 = one drip, 1 = Niagara Falls "random" - (0...1) degree of drippiness. 0 = one drip, 1 = Niagara Falls
*/ */
#define DRIP_STARTOFF 1 static const uint8_t DRIP_STARTOFF = 1;
//------------------------------------------ //------------------------------------------
static void drip_think(gentity_t *ent) static void drip_think(gentity_t *ent)
@ -528,7 +538,7 @@ Use with caution as this refreshes 10 times a second.
"targetname" - name of entity when used turns this ent on/off "targetname" - name of entity when used turns this ent on/off
"target" - link to an info_notnull entity or similar to position where the end point of this FX is "target" - link to an info_notnull entity or similar to position where the end point of this FX is
*/ */
#define FOUNTAIN_STARTOFF 1 static const uint8_t FOUNTAIN_STARTOFF = 1;
static void fountain_think(gentity_t *ent) static void fountain_think(gentity_t *ent)
{ {
@ -559,14 +569,15 @@ void SP_fx_fountain ( gentity_t *ent ) {
if (ent->target != NULL && ent->target[0] != 0) { if (ent->target != NULL && ent->target[0] != 0) {
target = G_Find(target, FOFS(targetname), ent->target); target = G_Find(target, FOFS(targetname), ent->target);
} else { }
DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] fx_fountain: ent->target is NULL\n");); else {
DEVELOPER(G_Logger(LL_ERROR, S_COLOR_YELLOW "[Entity-Error] fx_fountain: ent->target is NULL\n"););
G_FreeEntity(ent); G_FreeEntity(ent);
return; return;
} }
if (target == NULL) { if (target == NULL) {
DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] fx_fountain: Unable to find target point: %s\n", ent->target);); DEVELOPER(G_Logger(LL_ERROR, S_COLOR_YELLOW "[Entity-Error] fx_fountain: Unable to find target point: %s\n", ent->target););
G_FreeEntity(ent); G_FreeEntity(ent);
return; return;
} }
@ -582,7 +593,8 @@ void SP_fx_fountain ( gentity_t *ent ) {
//on and/or off state //on and/or off state
if ((ent->spawnflags & FOUNTAIN_STARTOFF) == 0) { if ((ent->spawnflags & FOUNTAIN_STARTOFF) == 0) {
ent->count = 1; ent->count = 1;
} else { }
else {
ent->count = 0; ent->count = 0;
} }
@ -723,15 +735,16 @@ static void blow_chunks_link( gentity_t *ent )
if (ent->target != NULL && ent->target[0] != 0) { if (ent->target != NULL && ent->target[0] != 0) {
target = G_Find(target, FOFS(targetname), ent->target); target = G_Find(target, FOFS(targetname), ent->target);
} else { }
DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] blow_chunks_link: ent->target is NULL\n");); else {
DEVELOPER(G_Logger(LL_ERROR, S_COLOR_YELLOW "[Entity-Error] blow_chunks_link: ent->target is NULL\n"););
G_FreeEntity(ent); G_FreeEntity(ent);
return; return;
} }
if (target == NULL) if (target == NULL)
{ {
DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] blow_chunks_link: unable to find target %s\n", ent->target);); DEVELOPER(G_Logger(LL_ERROR, S_COLOR_YELLOW "[Entity-Error] blow_chunks_link: unable to find target %s\n", ent->target););
G_FreeEntity(ent); G_FreeEntity(ent);
return; return;
} }
@ -780,7 +793,7 @@ Emits cloud of thick black smoke from specified point.
"targetname" - fires only when used "targetname" - fires only when used
"radius" - size of the smoke puffs (default 16.0) "radius" - size of the smoke puffs (default 16.0)
*/ */
#define SMOKE_STARTOFF 1 static const uint8_t SMOKE_STARTOFF = 1;
//------------------------------------------ //------------------------------------------
static void smoke_think(gentity_t *ent) static void smoke_think(gentity_t *ent)
@ -887,7 +900,7 @@ Creates a triggerable explosion aimed at a specific point
"radius" - blast radius (default 50) "radius" - blast radius (default 50)
"targetname" - explodes each time it's used "targetname" - explodes each time it's used
*/ */
#define ELEC_EXP_NODAMAGE 4 static const uint8_t ELEC_EXP_NODAMAGE = 4;
//------------------------------------------ //------------------------------------------
static void electrical_explosion_use(gentity_t *self, /*@unused@*/ gentity_t *other, /*@unused@*/ gentity_t *activator) static void electrical_explosion_use(gentity_t *self, /*@unused@*/ gentity_t *other, /*@unused@*/ gentity_t *activator)
@ -969,10 +982,13 @@ A phaser effect for use as a ship's weapon.
"delay" - delay the effect, but not the sound. Can be used to adjust the timing between effect and customSnd "delay" - delay the effect, but not the sound. Can be used to adjust the timing between effect and customSnd
"impact" - set to 1 if you want an impact to be drawn "impact" - set to 1 if you want an impact to be drawn
*/ */
#define PHASER_FX_NOSOUND 1 enum fx_phaserSpawnflags_e {
#define PHASER_FX_DISRUPTOR 2 PHASER_FX_NOSOUND = 1,
#define PHASER_FX_LOCKED 4 PHASER_FX_DISRUPTOR = 2,
#define PHASER_FX_UNLINKED 999 PHASER_FX_LOCKED = 4
};
static const uint16_t PHASER_FX_UNLINKED = 999;
static void phaser_use(gentity_t *ent, /*@unused@*/ gentity_t *other, gentity_t *activator) { static void phaser_use(gentity_t *ent, /*@unused@*/ gentity_t *other, gentity_t *activator) {
G_LocLogger(LL_TRACE, "%s - begin\n", __FUNCTION__); G_LocLogger(LL_TRACE, "%s - begin\n", __FUNCTION__);
@ -986,7 +1002,8 @@ static void phaser_use(gentity_t *ent, /*@unused@*/ gentity_t *other, gentity_t
if (Q_stricmp(ent->swapname, activator->target) == 0) { if (Q_stricmp(ent->swapname, activator->target) == 0) {
G_Logger(LL_DEBUG, "locking/unlocking\n"); G_Logger(LL_DEBUG, "locking/unlocking\n");
ent->flags ^= FL_LOCKED; ent->flags ^= FL_LOCKED;
} else { }
else {
if ((ent->flags & FL_LOCKED) != 0){ if ((ent->flags & FL_LOCKED) != 0){
trap_SendServerCommand(activator - g_entities, va("print \"^1Phasers are offline.\n\"")); trap_SendServerCommand(activator - g_entities, va("print \"^1Phasers are offline.\n\""));
G_AddEvent(ent, EV_GENERAL_SOUND, ent->n00bCount); G_AddEvent(ent, EV_GENERAL_SOUND, ent->n00bCount);
@ -1016,14 +1033,15 @@ static void phaser_link(gentity_t *ent) {
if (ent->target != NULL && ent->target[0] != 0) { if (ent->target != NULL && ent->target[0] != 0) {
target = G_Find(target, FOFS(targetname), ent->target); target = G_Find(target, FOFS(targetname), ent->target);
} else { }
else {
G_LocLogger(LL_ERROR, "[Entity-Error] phaser_link: ent->target is NULL\n"); G_LocLogger(LL_ERROR, "[Entity-Error] phaser_link: ent->target is NULL\n");
G_FreeEntity(ent); G_FreeEntity(ent);
return; return;
} }
if (target == NULL) { if (target == NULL) {
G_Logger(LL_ERROR, "[Enity-Error] Could not find target %s for fx_phaser at %s!\n", ent->target, vtos(ent->r.currentOrigin)); G_Logger(LL_ERROR, "[Entity-Error] Could not find target %s for fx_phaser at %s!\n", ent->target, vtos(ent->r.currentOrigin));
G_FreeEntity(ent); G_FreeEntity(ent);
G_LocLogger(LL_TRACE, "%s - end\n", __FUNCTION__); G_LocLogger(LL_TRACE, "%s - end\n", __FUNCTION__);
return; return;
@ -1067,7 +1085,8 @@ void SP_fx_phaser(gentity_t *ent) {
if ((ent->spawnflags & PHASER_FX_NOSOUND) == 0) { if ((ent->spawnflags & PHASER_FX_NOSOUND) == 0) {
ent->s.time = G_SoundIndex(sound); ent->s.time = G_SoundIndex(sound);
} else { }
else {
ent->s.time = G_SoundIndex("NULL"); ent->s.time = G_SoundIndex("NULL");
} }
@ -1075,7 +1094,8 @@ void SP_fx_phaser(gentity_t *ent) {
if (ent->wait <= 0.0f) { if (ent->wait <= 0.0f) {
ent->s.time2 = 3000; ent->s.time2 = 3000;
} else { }
else {
ent->s.time2 = (int)(ent->wait * 1000.0f); ent->s.time2 = (int)(ent->wait * 1000.0f);
} }
@ -1116,9 +1136,11 @@ Torpedos can be limited and can be set to any value within their maximum range b
"count" - ammount of torpedos that can be fired (defaults to -1 = infinite) "count" - ammount of torpedos that can be fired (defaults to -1 = infinite)
"speed" - a speed modifier (default: 2.5) "speed" - a speed modifier (default: 2.5)
*/ */
#define TORPEDO_FX_QUANTUM 1 enum fx_torpedoSpawnflags_e {
#define TORPEDO_FX_NOSOUND 2 TORPEDO_FX_QUANTUM = 1,
#define TORPEDO_FX_LOCKED 4 TORPEDO_FX_NOSOUND = 2,
TORPEDO_FX_LOCKED = 4
};
static void fx_torpedo_use(gentity_t* ent, gentity_t*other, gentity_t *activator); static void fx_torpedo_use(gentity_t* ent, gentity_t*other, gentity_t *activator);
@ -1135,7 +1157,8 @@ static void fx_torpedo_use(gentity_t *ent, /*@unused@*/ gentity_t *other, gentit
if (Q_stricmp(ent->swapname, activator->target) == 0) { if (Q_stricmp(ent->swapname, activator->target) == 0) {
G_Logger(LL_DEBUG, "lock/unlock\n"); G_Logger(LL_DEBUG, "lock/unlock\n");
ent->flags ^= FL_LOCKED; ent->flags ^= FL_LOCKED;
} else { }
else {
if ((ent->flags & FL_LOCKED) != 0){ if ((ent->flags & FL_LOCKED) != 0){
trap_SendServerCommand(activator - g_entities, va("print \"^1Torpedo launcher is offline.\n\"")); trap_SendServerCommand(activator - g_entities, va("print \"^1Torpedo launcher is offline.\n\""));
G_AddEvent(ent, EV_GENERAL_SOUND, ent->n00bCount); G_AddEvent(ent, EV_GENERAL_SOUND, ent->n00bCount);
@ -1172,7 +1195,8 @@ static void fx_torpedo_link(gentity_t *ent) {
if (ent->target != NULL && ent->target[0] != 0) { if (ent->target != NULL && ent->target[0] != 0) {
target = G_Find(target, FOFS(targetname), ent->target); target = G_Find(target, FOFS(targetname), ent->target);
} else { }
else {
G_Logger(LL_ERROR, "[Entity-Error] fx_torpedo_link: ent->target is NULL\n"); G_Logger(LL_ERROR, "[Entity-Error] fx_torpedo_link: ent->target is NULL\n");
G_FreeEntity(ent); G_FreeEntity(ent);
G_LocLogger(LL_TRACE, "%s - end\n", __FUNCTION__); G_LocLogger(LL_TRACE, "%s - end\n", __FUNCTION__);
@ -1236,7 +1260,8 @@ void SP_fx_torpedo(gentity_t *ent) {
if ((ent->spawnflags & 2) == 0) { if ((ent->spawnflags & 2) == 0) {
ent->s.time = G_SoundIndex(sound); ent->s.time = G_SoundIndex(sound);
G_Logger(LL_DEBUG, "using sound %s with sound index %d\n", sound, ent->s.time); G_Logger(LL_DEBUG, "using sound %s with sound index %d\n", sound, ent->s.time);
} else { }
else {
ent->s.time = G_SoundIndex("NULL"); ent->s.time = G_SoundIndex("NULL");
} }
@ -1245,7 +1270,8 @@ void SP_fx_torpedo(gentity_t *ent) {
if ((ent->spawnflags & 2) == 0) { if ((ent->spawnflags & 2) == 0) {
ent->n00bCount = G_SoundIndex(sound); ent->n00bCount = G_SoundIndex(sound);
G_Logger(LL_DEBUG, "using soundNoAmmo %s with sound index %d\n", sound, ent->n00bCount); G_Logger(LL_DEBUG, "using soundNoAmmo %s with sound index %d\n", sound, ent->n00bCount);
} else { }
else {
ent->n00bCount = G_SoundIndex("NULL"); ent->n00bCount = G_SoundIndex("NULL");
} }
@ -1267,13 +1293,14 @@ If you want to use a bunch of fires use fx_fire.
"targetname" - toggles effect on/off whenver used, requires 10x more thinks "targetname" - toggles effect on/off whenver used, requires 10x more thinks
"size" - how big the fire shoud be (default: 10) "size" - how big the fire shoud be (default: 10)
*/ */
#define PARTICLE_FIRE_STARTOFF 1 static const uint8_t PARTICLE_FIRE_STARTOFF = 1;
static void particleFire_think(gentity_t *ent) { static void particleFire_think(gentity_t *ent) {
G_AddEvent(ent, EV_FX_PARTICLEFIRE, ent->count); G_AddEvent(ent, EV_FX_PARTICLEFIRE, ent->count);
if (ent->targetname != NULL && ent->targetname[0] != 0) { if (ent->targetname != NULL && ent->targetname[0] != 0) {
ent->nextthink = level.time + 1000; ent->nextthink = level.time + 1000;
} else { }
else {
ent->nextthink = level.time + 10000; ent->nextthink = level.time + 10000;
} }
} }
@ -1302,13 +1329,15 @@ void SP_fx_particleFire(gentity_t *ent) {
G_SpawnInt("size", "10", &size); G_SpawnInt("size", "10", &size);
if (size == 0) { if (size == 0) {
ent->count = 10; ent->count = 10;
} else { }
else {
ent->count = size; ent->count = size;
} }
if (ent->targetname != NULL && ent->targetname[0] != 0) { if (ent->targetname != NULL && ent->targetname[0] != 0) {
ent->s.time2 = 1000; ent->s.time2 = 1000;
} else { }
else {
ent->s.time2 = 10000; ent->s.time2 = 10000;
} }
@ -1321,7 +1350,8 @@ void SP_fx_particleFire(gentity_t *ent) {
if ((ent->spawnflags & PARTICLE_FIRE_STARTOFF) == 0) { if ((ent->spawnflags & PARTICLE_FIRE_STARTOFF) == 0) {
ent->count = 1; ent->count = 1;
} else { }
else {
ent->count = 0; ent->count = 0;
} }
@ -1350,13 +1380,14 @@ A fire affect based on the adminguns fire effect.
"size" - how big the fire shoud be (default: 64) "size" - how big the fire shoud be (default: 64)
"angles" - fires angles (default: 0 0 0 = UP) "angles" - fires angles (default: 0 0 0 = UP)
*/ */
#define FIRE_FX_STARTOFF 1 static const uint8_t FIRE_FX_STARTOFF = 1;
static void fire_think(gentity_t *ent) { static void fire_think(gentity_t *ent) {
G_AddEvent(ent, EV_FX_FIRE, 1); G_AddEvent(ent, EV_FX_FIRE, 1);
if (ent->targetname != NULL && ent->targetname[0] != 0) { if (ent->targetname != NULL && ent->targetname[0] != 0) {
ent->nextthink = level.time + 1000; ent->nextthink = level.time + 1000;
} else { }
else {
ent->nextthink = level.time + 10000; ent->nextthink = level.time + 10000;
} }
} }
@ -1385,14 +1416,16 @@ void SP_fx_fire(gentity_t *ent) {
G_SpawnInt("size", "64", &size); G_SpawnInt("size", "64", &size);
if (size == 0) { if (size == 0) {
ent->s.time = 64; ent->s.time = 64;
} else { }
else {
ent->s.time = size; ent->s.time = size;
} }
ent->s.angles2[2] = 1.0f; ent->s.angles2[2] = 1.0f;
if (ent->targetname != NULL && ent->targetname[0] != 0) { if (ent->targetname != NULL && ent->targetname[0] != 0) {
ent->s.time2 = 1000; ent->s.time2 = 1000;
} else { }
else {
ent->s.time2 = 10000; ent->s.time2 = 10000;
} }
@ -1404,7 +1437,8 @@ void SP_fx_fire(gentity_t *ent) {
if ((ent->spawnflags & FIRE_FX_STARTOFF) == 0) { if ((ent->spawnflags & FIRE_FX_STARTOFF) == 0) {
ent->count = 1; ent->count = 1;
} else { }
else {
ent->count = 0; ent->count = 0;
} }
@ -1433,7 +1467,7 @@ Emits slowly moving steam puffs that rise up from the specified point
"targetname" - toggles effect on/off whenver used "targetname" - toggles effect on/off whenver used
"distance" - smoke puff size ( default 3.0 ) "distance" - smoke puff size ( default 3.0 )
*/ */
#define COOCKING_STEAM_STARTOFF 1 static const uint8_t COOCKING_STEAM_STARTOFF = 1;
//------------------------------------------ //------------------------------------------
static void cooking_steam_think(gentity_t *ent) static void cooking_steam_think(gentity_t *ent)
@ -1478,14 +1512,16 @@ void SP_fx_cooking_steam( gentity_t *ent )
if ((ent->spawnflags & COOCKING_STEAM_STARTOFF) == 0) { if ((ent->spawnflags & COOCKING_STEAM_STARTOFF) == 0) {
ent->count = 1; ent->count = 1;
} else { }
else {
ent->count = 0; ent->count = 0;
} }
if (ent->targetname == NULL || ent->targetname[0] != 0 || (ent->spawnflags & COOCKING_STEAM_STARTOFF) == 0) { if (ent->targetname == NULL || ent->targetname[0] != 0 || (ent->spawnflags & COOCKING_STEAM_STARTOFF) == 0) {
ent->think = cooking_steam_think; ent->think = cooking_steam_think;
ent->nextthink = level.time + 2000; ent->nextthink = level.time + 2000;
} else { }
else {
ent->think = NULL; ent->think = NULL;
ent->nextthink = -1; ent->nextthink = -1;
} }
@ -1504,7 +1540,7 @@ Spawns smoke puffs.
-----KEYS----- -----KEYS-----
"targetname" - toggles effect on/off whenver used "targetname" - toggles effect on/off whenver used
*/ */
#define ELEC_FIRE_STARTOFF 1 static const uint8_t ELEC_FIRE_STARTOFF = 1;
//------------------------------------------ //------------------------------------------
static void electric_fire_think(gentity_t *ent) static void electric_fire_think(gentity_t *ent)
@ -1542,14 +1578,16 @@ void SP_fx_electricfire( gentity_t *ent )
if ((ent->spawnflags & ELEC_FIRE_STARTOFF) == 0) { if ((ent->spawnflags & ELEC_FIRE_STARTOFF) == 0) {
ent->count = 1; ent->count = 1;
} else { }
else {
ent->count = 0; ent->count = 0;
} }
if (ent->targetname == NULL || ent->targetname[0] == 0 || (ent->spawnflags & ELEC_FIRE_STARTOFF) == 0) { if (ent->targetname == NULL || ent->targetname[0] == 0 || (ent->spawnflags & ELEC_FIRE_STARTOFF) == 0) {
ent->think = electric_fire_think; ent->think = electric_fire_think;
ent->nextthink = level.time + 500; ent->nextthink = level.time + 500;
} else { }
else {
ent->think = NULL; ent->think = NULL;
ent->nextthink = -1; ent->nextthink = -1;
} }
@ -1587,12 +1625,14 @@ Emits freaky orange bolts, sending pulses down the length of the beam if desired
"random" - bolt chaos (0.1 = too calm, 0.4 = default, 1.0 or higher = pretty wicked) "random" - bolt chaos (0.1 = too calm, 0.4 = default, 1.0 or higher = pretty wicked)
"radius" - radius of the bolt (3.0 = default) "radius" - radius of the bolt (3.0 = default)
*/ */
#define FORGE_BOLT_STARTOFF 1 enum fx_forgeBoltSpawnflags_e {
#define FORGE_BOLT_DELAYED 2 FORGE_BOLT_STARTOFF = 1,
#define FORGE_BOLT_SPARKS 4 FORGE_BOLT_DELAYED = 2,
#define FORGE_BOLT_PULSE 8 FORGE_BOLT_SPARKS = 4,
#define FORGE_BOLT_TAPER 16 FORGE_BOLT_PULSE = 8,
#define FORGE_BOLT_SMOOTH 32 FORGE_BOLT_TAPER = 16,
FORGE_BOLT_SMOOTH = 32
};
//------------------------------------------ //------------------------------------------
static void forge_bolt_think(gentity_t *ent) static void forge_bolt_think(gentity_t *ent)
@ -1652,7 +1692,8 @@ static void forge_bolt_link( gentity_t *ent )
if (ent->target != NULL && ent->target[0] != 0) { if (ent->target != NULL && ent->target[0] != 0) {
target = G_Find(target, FOFS(targetname), ent->target); target = G_Find(target, FOFS(targetname), ent->target);
} else { }
else {
DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] forge_bolt_link: ent->target is NULL\n");); DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] forge_bolt_link: ent->target is NULL\n"););
G_FreeEntity(ent); G_FreeEntity(ent);
return; return;
@ -1677,14 +1718,16 @@ static void forge_bolt_link( gentity_t *ent )
// This is used as the toggle switch // This is used as the toggle switch
if ((ent->spawnflags & FORGE_BOLT_STARTOFF) == 0) { if ((ent->spawnflags & FORGE_BOLT_STARTOFF) == 0) {
ent->count = 1; ent->count = 1;
} else { }
else {
ent->count = 0; ent->count = 0;
} }
if (ent->targetname == NULL || ent->targetname[0] == 0 || (ent->spawnflags & FORGE_BOLT_STARTOFF) == 0) { if (ent->targetname == NULL || ent->targetname[0] == 0 || (ent->spawnflags & FORGE_BOLT_STARTOFF) == 0) {
ent->think = forge_bolt_think; ent->think = forge_bolt_think;
ent->nextthink = level.time + 1000; ent->nextthink = level.time + 1000;
} else { }
else {
ent->think = NULL; ent->think = NULL;
ent->nextthink = -1; ent->nextthink = -1;
} }
@ -1704,7 +1747,8 @@ void SP_fx_forge_bolt( gentity_t *ent )
// See if effect is supposed to be delayed // See if effect is supposed to be delayed
if ((ent->spawnflags & FORGE_BOLT_DELAYED) != 0) { if ((ent->spawnflags & FORGE_BOLT_DELAYED) != 0) {
G_SpawnFloat("wait", "2.0", &ent->wait); G_SpawnFloat("wait", "2.0", &ent->wait);
} else { }
else {
// Effect is continuous // Effect is continuous
ent->wait = 0.1f; ent->wait = 0.1f;
} }
@ -1738,7 +1782,7 @@ Emits plasma jet directed from the specified point to the specified point. Jet s
(default 0 0 180 0) Blue (default 0 0 180 0) Blue
"damage" - damage PER FRAME, default zero "damage" - damage PER FRAME, default zero
*/ */
#define PLASMA_FX_STARTOFF 1 static const uint8_t PLASMA_FX_STARTOFF = 1;
//------------------------------------------ //------------------------------------------
static void plasma_think(gentity_t *ent) static void plasma_think(gentity_t *ent)
@ -1779,7 +1823,8 @@ static void plasma_use( gentity_t *self, /*@unused@*/ gentity_t *other, /*@unuse
self->think = NULL; self->think = NULL;
self->nextthink = -1; self->nextthink = -1;
self->count = 0; self->count = 0;
} else { }
else {
self->think = plasma_think; self->think = plasma_think;
self->nextthink = level.time + 200; self->nextthink = level.time + 200;
self->count = 1; self->count = 1;
@ -1793,7 +1838,8 @@ static void plasma_link( gentity_t *ent )
if (ent->target != NULL && ent->target[0] != 0) { if (ent->target != NULL && ent->target[0] != 0) {
target = G_Find(target, FOFS(targetname), ent->target); target = G_Find(target, FOFS(targetname), ent->target);
} else { }
else {
DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] plasma_link: ent->target is NULL\n");); DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] plasma_link: ent->target is NULL\n"););
G_FreeEntity(ent); G_FreeEntity(ent);
return; return;
@ -1813,7 +1859,8 @@ static void plasma_link( gentity_t *ent )
if (ent->targetname == NULL || ent->targetname[0] == 0 || (ent->spawnflags & PLASMA_FX_STARTOFF) == 0) { if (ent->targetname == NULL || ent->targetname[0] == 0 || (ent->spawnflags & PLASMA_FX_STARTOFF) == 0) {
ent->think = plasma_think; ent->think = plasma_think;
ent->nextthink = level.time + 200; ent->nextthink = level.time + 200;
} else { }
else {
ent->think = NULL; ent->think = NULL;
ent->nextthink = -1; ent->nextthink = -1;
} }
@ -1847,7 +1894,8 @@ void SP_fx_plasma( gentity_t *ent )
// This is used as the toggle switch // This is used as the toggle switch
if ((ent->spawnflags & PLASMA_FX_STARTOFF) == 0) { if ((ent->spawnflags & PLASMA_FX_STARTOFF) == 0) {
ent->count = 1; ent->count = 1;
} else { }
else {
ent->count = 0; ent->count = 0;
} }
@ -1870,7 +1918,7 @@ Creates streaming particles that travel between two points--for Stasis level. ON
"target" - (required) End point for particle stream. "target" - (required) End point for particle stream.
"targetname" - toggle effect on/off each time used. "targetname" - toggle effect on/off each time used.
*/ */
#define ENERGY_STREAM_STARTOFF 1 static const uint8_t ENERGY_STREAM_STARTOFF = 1;
//------------------------------------------ //------------------------------------------
static void stream_think(gentity_t *ent) static void stream_think(gentity_t *ent)
@ -1912,7 +1960,8 @@ static void stream_use( gentity_t *self, /*@unused@*/ gentity_t *other, /*@unuse
self->think = stream_think; self->think = stream_think;
self->nextthink = level.time + 200; self->nextthink = level.time + 200;
self->count = 0; self->count = 0;
} else { }
else {
self->think = NULL; self->think = NULL;
self->nextthink = -1; self->nextthink = -1;
self->count = 1; self->count = 1;
@ -1926,7 +1975,8 @@ static void stream_link( gentity_t *ent )
if (ent->target != NULL && ent->target[0] != 0) { if (ent->target != NULL && ent->target[0] != 0) {
target = G_Find(target, FOFS(targetname), ent->target); target = G_Find(target, FOFS(targetname), ent->target);
} else { }
else {
DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] stream_link: ent->target is NULL\n");); DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] stream_link: ent->target is NULL\n"););
G_FreeEntity(ent); G_FreeEntity(ent);
return; return;
@ -1943,7 +1993,8 @@ static void stream_link( gentity_t *ent )
if (ent->targetname == NULL || ent->targetname[0] == 0 || (ent->spawnflags & ENERGY_STREAM_STARTOFF) == 0) { if (ent->targetname == NULL || ent->targetname[0] == 0 || (ent->spawnflags & ENERGY_STREAM_STARTOFF) == 0) {
ent->think = stream_think; ent->think = stream_think;
ent->nextthink = level.time + 200; ent->nextthink = level.time + 200;
} else if ( (ent->spawnflags & 1) != 0 ) { }
else if ((ent->spawnflags & 1) != 0) {
ent->think = NULL; ent->think = NULL;
ent->nextthink = -1; ent->nextthink = -1;
} }
@ -1964,7 +2015,8 @@ void SP_fx_stream( gentity_t *ent )
if ((ent->spawnflags & ENERGY_STREAM_STARTOFF) == 0) { if ((ent->spawnflags & ENERGY_STREAM_STARTOFF) == 0) {
ent->count = 1; ent->count = 1;
} else { }
else {
ent->count = 0; ent->count = 0;
} }
@ -1988,7 +2040,7 @@ Creates streaming particles that travel between two points--for forge level.
"target" - (required) End point for particle stream. "target" - (required) End point for particle stream.
"targetname" - fires only when used "targetname" - fires only when used
*/ */
#define TRANSPORTER_STREAM_STARTOFF 1 static const uint8_t TRANSPORTER_STREAM_STARTOFF = 1;
//------------------------------------------ //------------------------------------------
static void transporter_stream_think(gentity_t *ent) static void transporter_stream_think(gentity_t *ent)
@ -2004,7 +2056,8 @@ static void transporter_stream_use( gentity_t *self, /*@unused@*/ gentity_t *oth
self->think = transporter_stream_think; self->think = transporter_stream_think;
self->nextthink = level.time + 200; self->nextthink = level.time + 200;
self->count = 0; self->count = 0;
} else { }
else {
self->think = NULL; self->think = NULL;
self->nextthink = -1; self->nextthink = -1;
self->count = 1; self->count = 1;
@ -2018,7 +2071,8 @@ static void transporter_stream_link( gentity_t *ent )
if (ent->target != NULL && ent->target[0] != 0) { if (ent->target != NULL && ent->target[0] != 0) {
target = G_Find(target, FOFS(targetname), ent->target); target = G_Find(target, FOFS(targetname), ent->target);
} else { }
else {
DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] transporter_stream_link: ent->target is NULL\n");); DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] transporter_stream_link: ent->target is NULL\n"););
G_FreeEntity(ent); G_FreeEntity(ent);
return; return;
@ -2036,14 +2090,16 @@ static void transporter_stream_link( gentity_t *ent )
if ((ent->spawnflags & 1) == 0) { if ((ent->spawnflags & 1) == 0) {
ent->count = 1; ent->count = 1;
} else { }
else {
ent->count = 0; ent->count = 0;
} }
if (ent->targetname == NULL || ent->targetname[0] == 0 || (ent->spawnflags & TRANSPORTER_STREAM_STARTOFF) == 0) { if (ent->targetname == NULL || ent->targetname[0] == 0 || (ent->spawnflags & TRANSPORTER_STREAM_STARTOFF) == 0) {
ent->think = transporter_stream_think; ent->think = transporter_stream_think;
ent->nextthink = level.time + 200; ent->nextthink = level.time + 200;
} else { }
else {
ent->think = NULL; ent->think = NULL;
ent->nextthink = -1; ent->nextthink = -1;
} }
@ -2097,7 +2153,8 @@ static void explosion_trail_link( gentity_t *ent )
if (ent->target != NULL && ent->target[0] != 0) { if (ent->target != NULL && ent->target[0] != 0) {
target = G_Find(target, FOFS(targetname), ent->target); target = G_Find(target, FOFS(targetname), ent->target);
} else { }
else {
DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] explosion_trail_link: ent->target is NULL\n");); DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] explosion_trail_link: ent->target is NULL\n"););
G_FreeEntity(ent); G_FreeEntity(ent);
return; return;
@ -2150,8 +2207,10 @@ A borg tracing beam that either carves out a cone or swings like a pendulum, swe
"target" - (required) End point for trace beam, should be placed at the very center of the trace area. "target" - (required) End point for trace beam, should be placed at the very center of the trace area.
"targetname" - fires only when used "targetname" - fires only when used
*/ */
#define BORG_ENERGY_BEAM_STARTOFF 1 enum fx_borgEnerGyBeamSpawnflags_e {
#define BORG_ENERGY_BEAM_CONE 2 BORG_ENERGY_BEAM_STARTOFF = 1,
BORG_ENERGY_BEAM_CONE = 2
};
//------------------------------------------ //------------------------------------------
static void borg_energy_beam_think(gentity_t *ent) static void borg_energy_beam_think(gentity_t *ent)
@ -2167,7 +2226,8 @@ static void borg_energy_beam_use( gentity_t *self, /*@unused@*/ gentity_t *other
self->think = borg_energy_beam_think; self->think = borg_energy_beam_think;
self->nextthink = level.time + 200; self->nextthink = level.time + 200;
self->count = 0; self->count = 0;
} else { }
else {
self->think = NULL; self->think = NULL;
self->nextthink = -1; self->nextthink = -1;
self->count = 1; self->count = 1;
@ -2181,7 +2241,8 @@ static void borg_energy_beam_link( gentity_t *ent )
if (ent->target != NULL && ent->target[0] != 0) { if (ent->target != NULL && ent->target[0] != 0) {
target = G_Find(target, FOFS(targetname), ent->target); target = G_Find(target, FOFS(targetname), ent->target);
} else { }
else {
DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] borg_energy_beam_link: ent->target is NULL\n");); DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] borg_energy_beam_link: ent->target is NULL\n"););
G_FreeEntity(ent); G_FreeEntity(ent);
return; return;
@ -2199,14 +2260,16 @@ static void borg_energy_beam_link( gentity_t *ent )
if ((ent->spawnflags & 1) == 0) { if ((ent->spawnflags & 1) == 0) {
ent->count = 1; ent->count = 1;
} else { }
else {
ent->count = 0; ent->count = 0;
} }
if (ent->targetname == NULL || ent->targetname[0] == 0 || (ent->spawnflags & BORG_ENERGY_BEAM_STARTOFF) == 0) { if (ent->targetname == NULL || ent->targetname[0] == 0 || (ent->spawnflags & BORG_ENERGY_BEAM_STARTOFF) == 0) {
ent->think = borg_energy_beam_think; ent->think = borg_energy_beam_think;
ent->nextthink = level.time + 200; ent->nextthink = level.time + 200;
} else { }
else {
ent->think = NULL; ent->think = NULL;
ent->nextthink = -1; ent->nextthink = -1;
} }
@ -2255,8 +2318,10 @@ Creates a shimmering cone or cylinder of colored light that stretches between tw
"targetname" - fires only when used "targetname" - fires only when used
"wait" - how long in ms to stay on before turning itself off ( default 2 seconds (2000 ms), -1 to disable auto shut off ) "wait" - how long in ms to stay on before turning itself off ( default 2 seconds (2000 ms), -1 to disable auto shut off )
*/ */
#define SHIMMERY_THING_STARTOFF 1 enum fx_shimmeryThingSpawnflags_e {
#define SHIMMERY_THING_TAPER 2 SHIMMERY_THING_STARTOFF = 1,
SHIMMERY_THING_TAPER = 2
};
//------------------------------------------ //------------------------------------------
static void shimmery_thing_think(gentity_t *ent) static void shimmery_thing_think(gentity_t *ent)
@ -2264,7 +2329,8 @@ static void shimmery_thing_think( gentity_t *ent )
G_AddEvent(ent, EV_FX_SHIMMERY_THING, 0); G_AddEvent(ent, EV_FX_SHIMMERY_THING, 0);
if (ent->wait >= 0.0f) { if (ent->wait >= 0.0f) {
ent->nextthink = level.time + ent->wait; ent->nextthink = level.time + ent->wait;
} else { }
else {
ent->nextthink = -1; ent->nextthink = -1;
} }
} }
@ -2276,7 +2342,8 @@ static void shimmery_thing_use( gentity_t *self, /*@unused@*/ gentity_t *other,
self->think = shimmery_thing_think; self->think = shimmery_thing_think;
self->nextthink = level.time + 200; self->nextthink = level.time + 200;
self->count = 0; self->count = 0;
} else { }
else {
self->think = NULL; self->think = NULL;
self->nextthink = -1; self->nextthink = -1;
self->count = 1; self->count = 1;
@ -2290,7 +2357,8 @@ static void shimmery_thing_link( gentity_t *ent )
if (ent->target != NULL && ent->target[0] != 0) { if (ent->target != NULL && ent->target[0] != 0) {
target = G_Find(target, FOFS(targetname), ent->target); target = G_Find(target, FOFS(targetname), ent->target);
} else { }
else {
DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] shimmery_thing_link: ent->target is NULL\n");); DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] shimmery_thing_link: ent->target is NULL\n"););
G_FreeEntity(ent); G_FreeEntity(ent);
return; return;
@ -2308,7 +2376,8 @@ static void shimmery_thing_link( gentity_t *ent )
if ((ent->spawnflags & SHIMMERY_THING_STARTOFF) == 0) { if ((ent->spawnflags & SHIMMERY_THING_STARTOFF) == 0) {
ent->count = 1; ent->count = 1;
} else { }
else {
ent->count = 0; ent->count = 0;
} }
@ -2319,7 +2388,8 @@ static void shimmery_thing_link( gentity_t *ent )
if (ent->targetname == NULL || ent->targetname[0] == 0 || (ent->spawnflags & SHIMMERY_THING_STARTOFF) == 0) { if (ent->targetname == NULL || ent->targetname[0] == 0 || (ent->spawnflags & SHIMMERY_THING_STARTOFF) == 0) {
ent->think = shimmery_thing_think; ent->think = shimmery_thing_think;
ent->nextthink = level.time + 200; ent->nextthink = level.time + 200;
} else { }
else {
ent->think = NULL; ent->think = NULL;
ent->nextthink = -1; ent->nextthink = -1;
} }
@ -2365,9 +2435,10 @@ NO_PROXIMITY_FX - Will deactivate proximity-fx associated with this. Check it if
"message" - moves start point of the beam to this ent's origin. Only useful if the beam connects 2 movers. "message" - moves start point of the beam to this ent's origin. Only useful if the beam connects 2 movers.
"targetname" - toggles effect on/off each time it's used "targetname" - toggles effect on/off each time it's used
*/ */
enum fx_borgBoltSpawnflags_e {
#define BORG_BOLT_FX_STARTOFF 1 BORG_BOLT_FX_STARTOFF = 1,
#define BORG_BOLT_FX_NO_PROXIMITY_FX 2 BORG_BOLT_FX_NO_PROXIMITY_FX = 2
};
//------------------------------------------ //------------------------------------------
static void borg_bolt_think(gentity_t *ent) static void borg_bolt_think(gentity_t *ent)
@ -2375,7 +2446,8 @@ static void borg_bolt_think( gentity_t *ent )
if ((ent->spawnflags & BORG_BOLT_FX_NO_PROXIMITY_FX) != 0) { if ((ent->spawnflags & BORG_BOLT_FX_NO_PROXIMITY_FX) != 0) {
G_AddEvent(ent, EV_FX_BORG_BOLT, 0); G_AddEvent(ent, EV_FX_BORG_BOLT, 0);
ent->nextthink = level.time + 100 + random() * 25; ent->nextthink = level.time + 100 + random() * 25;
} else { }
else {
G_AddEvent(ent, EV_FX_BORG_BOLT, 1); G_AddEvent(ent, EV_FX_BORG_BOLT, 1);
ent->nextthink = level.time + 50; ent->nextthink = level.time + 50;
} }
@ -2389,7 +2461,8 @@ static void borg_bolt_use( gentity_t *self, /*@unused@*/ gentity_t *other, /*@un
self->think = NULL; self->think = NULL;
self->nextthink = -1; self->nextthink = -1;
self->count = 0; self->count = 0;
} else { }
else {
self->think = borg_bolt_think; self->think = borg_bolt_think;
self->nextthink = level.time + 200; self->nextthink = level.time + 200;
self->count = 1; self->count = 1;
@ -2404,7 +2477,8 @@ static void borg_bolt_link( gentity_t *ent )
if (ent->target != NULL && ent->target[0] != 0) { if (ent->target != NULL && ent->target[0] != 0) {
target = G_Find(target, FOFS(targetname), ent->target); target = G_Find(target, FOFS(targetname), ent->target);
} else { }
else {
DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] borg_bolt_link: ent->target is NULL\n");); DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] borg_bolt_link: ent->target is NULL\n"););
G_FreeEntity(ent); G_FreeEntity(ent);
return; return;
@ -2422,7 +2496,8 @@ static void borg_bolt_link( gentity_t *ent )
if (target2 == NULL) { if (target2 == NULL) {
DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Warning] borg_bolt_link: unable to find target2 %s falling back to using ent's origin\n", ent->target);); DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Warning] borg_bolt_link: unable to find target2 %s falling back to using ent's origin\n", ent->target););
} else { }
else {
VectorCopy(target2->s.origin, ent->s.origin); VectorCopy(target2->s.origin, ent->s.origin);
} }
} }
@ -2434,14 +2509,16 @@ static void borg_bolt_link( gentity_t *ent )
// This is used as the toggle switch // This is used as the toggle switch
if ((ent->spawnflags & BORG_BOLT_FX_STARTOFF) == 0) { if ((ent->spawnflags & BORG_BOLT_FX_STARTOFF) == 0) {
ent->count = 1; ent->count = 1;
} else { }
else {
ent->count = 0; ent->count = 0;
} }
if (ent->targetname == NULL || ent->targetname[0] == 0 || (ent->spawnflags & BORG_BOLT_FX_STARTOFF) == 0) { if (ent->targetname == NULL || ent->targetname[0] == 0 || (ent->spawnflags & BORG_BOLT_FX_STARTOFF) == 0) {
ent->think = borg_bolt_think; ent->think = borg_bolt_think;
ent->nextthink = level.time + 1000; ent->nextthink = level.time + 1000;
} else { }
else {
ent->think = NULL; ent->think = NULL;
ent->nextthink = -1; ent->nextthink = -1;
} }