From b020f21541e8ba88978876945e3419bca3f6b6d4 Mon Sep 17 00:00:00 2001 From: Knightmare66 Date: Thu, 14 May 2020 03:38:00 -0400 Subject: [PATCH] Fixed crucified insanes being screwed up by the clearing of spawnflags bit 8, which conflicts with SF_MONSTER_GOODGUY. This manifiested as glitches such as them sliding downward when they or the player are shot. --- buglist.txt | 5 + game/g_combat.c | 143 ++++++------ game/g_func_decs.h | 1 + game/g_func_list.h | 1 + game/g_local.h | 1 + game/g_monster.c | 7 +- game/g_utils.c | 28 ++- game/m_insane.c | 25 ++- missionpack/g_combat.c | 2 +- missionpack/g_items.c | 4 +- missionpack/g_local.h | 4 +- missionpack/g_monster.c | 42 ++-- missionpack/g_save.c | 2 +- missionpack/g_tracktrain.c | 440 ++++++++++++++++++------------------- missionpack/g_utils.c | 13 +- missionpack/m_brainbeta.c | 4 +- missionpack/m_insane.c | 19 +- missionpack/p_hud.c | 34 +-- missionpack/p_view.c | 14 +- missionpack/q_shared.h | 4 +- 20 files changed, 424 insertions(+), 369 deletions(-) diff --git a/buglist.txt b/buglist.txt index b50606a..ff83670 100644 --- a/buglist.txt +++ b/buglist.txt @@ -39,6 +39,11 @@ fatal error when loading too many md2 models (VirtualAlloc reserve failure) game menu text doesn't show when connected to RA2 server - FIXED by allowing CS_STATUSBAR to overflow thru CS_AIRACCEL-1 + +Crucified insane in jail4 moving downward when player is shot by blaster guard. + Causes startsolid error for key_security_pass spawned by target_spawner in air above floor. + This is due to insane's earlier death by crusher, spawning key_security_pass when crusher overlaps its bbox. + - FIXED by using moreflags edict_t field for internal crucified checks Thirdperson player shadow not drawn correctly at times (start of hangar1) diff --git a/game/g_combat.c b/game/g_combat.c index 3ef93a9..970b3f1 100644 --- a/game/g_combat.c +++ b/game/g_combat.c @@ -75,7 +75,7 @@ qboolean CanDamage (edict_t *targ, edict_t *inflictor) // from inflictor to targ is blocked by a func_tracktrain, AND the targ is riding/driving // the tracktrain, go ahead and hurt him. - if(trace.ent && (trace.ent->flags & FL_TRACKTRAIN) && ((trace.ent->owner == targ) || (targ->groundentity == trace.ent)) ) + if (trace.ent && (trace.ent->flags & FL_TRACKTRAIN) && ((trace.ent->owner == targ) || (targ->groundentity == trace.ent)) ) return true; VectorCopy (targ->s.origin, dest); @@ -203,7 +203,7 @@ void SpawnDamage (int type, vec3_t origin, vec3_t normal) gi.WriteDir (normal); gi.multicast (origin, MULTICAST_PVS); - if(level.num_reflectors) + if (level.num_reflectors) ReflectSparks(type,origin,normal); } @@ -381,7 +381,7 @@ void CallMyFriends (edict_t *targ, edict_t *attacker) { edict_t *teammate; - if(!targ || !attacker) + if (!targ || !attacker) return; // Knightmare- insanes ignore damage- fix crash on fact2? @@ -389,28 +389,28 @@ void CallMyFriends (edict_t *targ, edict_t *attacker) return; // Lazarus dmgteam stuff - if( (attacker->client && !(attacker->flags & FL_NOTARGET)) || (attacker->svflags & SVF_MONSTER)) + if ( (attacker->client && !(attacker->flags & FL_NOTARGET)) || (attacker->svflags & SVF_MONSTER)) { // the attacker is a player or a monster - if( (targ->svflags & SVF_MONSTER) && (targ->dmgteam) && (targ->health > 0) ) + if ( (targ->svflags & SVF_MONSTER) && (targ->dmgteam) && (targ->health > 0) ) { // the target is a live monster on a dmgteam - if( !attacker->dmgteam || strcmp(targ->dmgteam,attacker->dmgteam) ) + if ( !attacker->dmgteam || strcmp(targ->dmgteam,attacker->dmgteam) ) { // attacker is not on same dmgteam as target - if( !Q_stricmp(targ->dmgteam,"player") && attacker->client ) + if ( !Q_stricmp(targ->dmgteam,"player") && attacker->client ) { // Target is a GOOD_GUY, attacked by the player. Allow self-defense, // but don't get other dmgteam teammates involved. // Special case for misc_actors - if ACTOR_BAD_GUY isn't set, // actor stays on the same team and only taunts player - if(!(targ->monsterinfo.aiflags & AI_ACTOR) || (targ->spawnflags & SF_ACTOR_BAD_GUY)) + if (!(targ->monsterinfo.aiflags & AI_ACTOR) || (targ->spawnflags & SF_ACTOR_BAD_GUY)) { targ->enemy = targ->movetarget = targ->goalentity = attacker; targ->monsterinfo.aiflags &= ~AI_FOLLOW_LEADER; - if(visible(targ,targ->enemy)) + if (visible(targ,targ->enemy)) FoundTarget(targ); else HuntTarget(targ); } } - else if( !(targ->svflags & SVF_MONSTER) || !(attacker->svflags & SVF_MONSTER) || + else if ( !(targ->svflags & SVF_MONSTER) || !(attacker->svflags & SVF_MONSTER) || (targ->monsterinfo.aiflags & AI_FREEFORALL) || ((targ->monsterinfo.aiflags & AI_GOOD_GUY) != (attacker->monsterinfo.aiflags & AI_GOOD_GUY)) ) { @@ -420,13 +420,13 @@ void CallMyFriends (edict_t *targ, edict_t *attacker) teammate = G_Find(NULL,FOFS(dmgteam),targ->dmgteam); while(teammate) { - if(teammate != targ) + if (teammate != targ) { - if(teammate->svflags & SVF_MONSTER) + if (teammate->svflags & SVF_MONSTER) { - if(teammate->health > 0 && (teammate->enemy != attacker) && !(teammate->monsterinfo.aiflags & AI_CHASE_THING)) + if (teammate->health > 0 && (teammate->enemy != attacker) && !(teammate->monsterinfo.aiflags & AI_CHASE_THING)) { - if(!teammate->enemy || !teammate->enemy->dmgteam || !attacker->dmgteam ) + if (!teammate->enemy || !teammate->enemy->dmgteam || !attacker->dmgteam ) { // If either 1) this teammate doesn't currently have an enemy, // or 2) the teammate's enemy is not a member of a dmgteam @@ -434,7 +434,7 @@ void CallMyFriends (edict_t *targ, edict_t *attacker) // then set the attacker as the enemy of this teammate DefendMyFriend(teammate,attacker); } - else if(strcmp(teammate->enemy->dmgteam,attacker->dmgteam)) + else if (strcmp(teammate->enemy->dmgteam,attacker->dmgteam)) { // attacker is a member of a team different than the // current enemy @@ -442,7 +442,7 @@ void CallMyFriends (edict_t *targ, edict_t *attacker) } } } - else if(!(teammate->svflags & SVF_DEADMONSTER)) + else if (!(teammate->svflags & SVF_DEADMONSTER)) G_UseTargets(teammate,attacker); } teammate = G_Find(teammate,FOFS(dmgteam),targ->dmgteam); @@ -451,7 +451,7 @@ void CallMyFriends (edict_t *targ, edict_t *attacker) } } } - if( targ->client && (attacker->svflags & SVF_MONSTER) ) + if ( targ->client && (attacker->svflags & SVF_MONSTER) ) { // target is player; attacker is monster... alert "good guys", if any // trace_t tr; @@ -459,16 +459,16 @@ void CallMyFriends (edict_t *targ, edict_t *attacker) teammate = G_Find(NULL,FOFS(dmgteam),"player"); while(teammate) { - if((teammate->health > 0) && !(teammate->monsterinfo.aiflags & AI_CHASE_THING) && (teammate != attacker)) + if ((teammate->health > 0) && !(teammate->monsterinfo.aiflags & AI_CHASE_THING) && (teammate != attacker)) { // Can teammate see player? // tr = gi.trace(teammate->s.origin,vec3_origin,vec3_origin,targ->s.origin,teammate,MASK_OPAQUE); -// if(tr.fraction == 1.0) - if(gi.inPVS(teammate->s.origin,targ->s.origin)) +// if (tr.fraction == 1.0) + if (gi.inPVS(teammate->s.origin,targ->s.origin)) { teammate->enemy = attacker; FoundTarget(teammate); - if(teammate->monsterinfo.aiflags & AI_ACTOR) + if (teammate->monsterinfo.aiflags & AI_ACTOR) { teammate->monsterinfo.aiflags |= AI_FOLLOW_LEADER; teammate->monsterinfo.old_leader = NULL; @@ -480,19 +480,20 @@ void CallMyFriends (edict_t *targ, edict_t *attacker) } } // If player attacks a GOODGUY, turn GOODGUY stuff off - if (attacker->client && (targ->svflags & SVF_MONSTER) && (targ->spawnflags & SF_MONSTER_GOODGUY)) + if (attacker->client && (targ->svflags & SVF_MONSTER) + && UseRegularGoodGuyFlag(targ) && (targ->spawnflags & SF_MONSTER_GOODGUY)) { - if(!(targ->monsterinfo.aiflags & AI_ACTOR) || (targ->spawnflags & SF_ACTOR_BAD_GUY)) + if (!(targ->monsterinfo.aiflags & AI_ACTOR) || (targ->spawnflags & SF_ACTOR_BAD_GUY)) { targ->spawnflags &= ~SF_MONSTER_GOODGUY; targ->monsterinfo.aiflags &= ~(AI_GOOD_GUY + AI_FOLLOW_LEADER); - if(targ->dmgteam && !Q_stricmp(targ->dmgteam,"player")) + if (targ->dmgteam && !Q_stricmp(targ->dmgteam,"player")) targ->dmgteam = NULL; } } // 1.6.1.3 change - one chance and one chance only to call friends -/* if(targ->dmgteam) - if(Q_stricmp(targ->dmgteam,"player")) +/* if (targ->dmgteam) + if (Q_stricmp(targ->dmgteam,"player")) targ->dmgteam = NULL; */ } @@ -500,7 +501,7 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker) { qboolean is_turret; - if( targ->health <= 0 ) + if ( targ->health <= 0 ) return; // If targ is currently chasing a "thing" or we're running a hint_path test, he @@ -537,7 +538,7 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker) VectorCopy(targ->mins,mins); mins[2] += 16; // max step height? not sure about this - if(mins[2] > 0) mins[2] = 0; + if (mins[2] > 0) mins[2] = 0; VectorCopy(targ->maxs,maxs); if ((attacker == world) || (!Q_stricmp(attacker->classname,"func_door") ) || @@ -561,12 +562,12 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker) } } } - else if(!Q_stricmp(attacker->classname,"target_laser")) + else if (!Q_stricmp(attacker->classname,"target_laser")) { // Send the monster in a direction perpendicular to laser // path, whichever direction is closest to current angles thing = SpawnThing(); - if(attacker->movedir[2] > 0.7) + if (attacker->movedir[2] > 0.7) { // Just move straight ahead and hope for the best AngleVectors(targ->s.angles,best_dir,NULL,NULL); @@ -579,7 +580,7 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker) best_dir[1] = best_dir[2]; best_dir[2] = 0; AngleVectors(targ->s.angles,dir,NULL,NULL); - if(DotProduct(best_dir,dir) < 0) + if (DotProduct(best_dir,dir) < 0) VectorNegate(best_dir,best_dir); } } @@ -588,7 +589,7 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker) // Attacked by a point entity or moving brush model // not covered above. Find a vector that will hide the // monster from the attacker. - if(!VectorLength(attacker->size)) { + if (!VectorLength(attacker->size)) { // point entity VectorCopy(attacker->s.origin,atk); } else { @@ -597,9 +598,9 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker) } VectorClear(best_dir); AngleVectors(targ->s.angles,forward,NULL,NULL); - for(i=0; i<32 && best_dist == 0; i++) { + for (i=0; i<32 && best_dist == 0; i++) { // Weight escape route tests in favor of forward-facing direction - if(random() > 0.5) { + if (random() > 0.5) { dir[0] = forward[0] + 0.5*crandom(); dir[1] = forward[1] + 0.5*crandom(); dir[2] = forward[2]; @@ -612,19 +613,19 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker) VectorMA(targ->s.origin, WORLD_SIZE, dir, end); // was 8192 trace1 = gi.trace(targ->s.origin,mins,maxs,end,targ,MASK_MONSTERSOLID); trace2 = gi.trace(trace1.endpos,NULL,NULL,atk,targ,MASK_SOLID); - if(trace2.fraction == 1.0) continue; + if (trace2.fraction == 1.0) continue; dist = trace1.fraction * WORLD_SIZE; // was 8192 - if(dist > best_dist) { + if (dist > best_dist) { best_dist = dist; VectorCopy(dir,best_dir); } } - if(best_dist == 0.) + if (best_dist == 0.) return; thing = SpawnThing(); vectoangles(best_dir,thing->s.angles); } - if( (!Q_stricmp(attacker->classname,"func_door")) || + if ( (!Q_stricmp(attacker->classname,"func_door")) || (!Q_stricmp(attacker->classname,"func_pushable")) ) run = 256; else @@ -634,7 +635,7 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker) dist = trace1.fraction * run; VectorMA(targ->s.origin, dist, best_dir, thing->s.origin); // If monster already has an enemy, use a short lifespan for thing - if(targ->enemy) + if (targ->enemy) thing->touch_debounce_time = level.time + 2.0; else thing->touch_debounce_time = level.time + max(5.0,dist/50.); @@ -679,7 +680,7 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker) if ((targ->monsterinfo.aiflags & AI_TARGET_ANGER) && (targ->enemy)) { // ensure that the subject of our wrath is still present & we're not too beat up - if(targ->enemy->inuse) { + if (targ->enemy->inuse) { float health_ratio = (float)(targ->health) / (float)(targ->max_health); if ((health_ratio > 0.333) && (targ->enemy->inuse)) return; } @@ -715,7 +716,7 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker) targ->oldenemy = targ->enemy; } targ->enemy = attacker; - if(visible(targ,targ->enemy)) + if (visible(targ,targ->enemy)) FoundTarget (targ); else HuntTarget (targ); @@ -734,13 +735,13 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker) // Lazarus: Check IGNORE_SHOTS spawnflag for attacker. If set AND // targ and attacker have same GOODGUY setting, don't respond // to attacks. - if( ( (targ->spawnflags & SF_MONSTER_GOODGUY) != (attacker->spawnflags & SF_MONSTER_GOODGUY) ) || + if ( ( (targ->spawnflags & SF_MONSTER_GOODGUY) != (attacker->spawnflags & SF_MONSTER_GOODGUY) ) || !(attacker->spawnflags & SF_MONSTER_IGNORESHOTS) ) { if (targ->enemy && targ->enemy->client) targ->oldenemy = targ->enemy; targ->enemy = attacker; - if(visible(targ,targ->enemy)) + if (visible(targ,targ->enemy)) FoundTarget (targ); else HuntTarget (targ); @@ -753,7 +754,7 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker) if (targ->enemy && targ->enemy->client) targ->oldenemy = targ->enemy; targ->enemy = attacker; - if(visible(targ,targ->enemy)) + if (visible(targ,targ->enemy)) FoundTarget (targ); else HuntTarget (targ); @@ -765,7 +766,7 @@ void M_ReactToDamage (edict_t *targ, edict_t *attacker) if (targ->enemy && targ->enemy->client) targ->oldenemy = targ->enemy; targ->enemy = attacker->enemy; - if(visible(targ,targ->enemy)) + if (visible(targ,targ->enemy)) FoundTarget (targ); else HuntTarget (targ); @@ -808,7 +809,7 @@ void T_Damage (edict_t *in_targ, edict_t *inflictor, edict_t *in_attacker, vec3_ // Lazarus: If monster/actor is currently being forced to use // specific animations due to target_animation, release that // control over it. - if((targ->think == target_animate) && (targ->svflags & SVF_MONSTER)) + if ((targ->think == target_animate) && (targ->svflags & SVF_MONSTER)) { targ->think = monster_think; targ->nextthink = level.time + FRAMETIME; @@ -824,9 +825,9 @@ void T_Damage (edict_t *in_targ, edict_t *inflictor, edict_t *in_attacker, vec3_ // out of the camera and do the damage to him if (!Q_stricmp(targ->classname,"camplayer")) { - if(targ->target_ent && targ->target_ent->client && targ->target_ent->client->spycam) + if (targ->target_ent && targ->target_ent->client && targ->target_ent->client->spycam) { - if(attacker->enemy == targ) + if (attacker->enemy == targ) { attacker->enemy = targ->target_ent; attacker->goalentity = NULL; @@ -834,23 +835,23 @@ void T_Damage (edict_t *in_targ, edict_t *inflictor, edict_t *in_attacker, vec3_ } targ = targ->target_ent; camera_off(targ); - if(attacker->svflags & SVF_MONSTER) + if (attacker->svflags & SVF_MONSTER) { - if(attacker->spawnflags & SF_MONSTER_GOODGUY) + if ( UseRegularGoodGuyFlag(attacker) && (attacker->spawnflags & SF_MONSTER_GOODGUY) ) { - if(attacker->enemy == targ) + if (attacker->enemy == targ) { attacker->enemy = NULL; attacker->monsterinfo.aiflags &= ~AI_FOLLOW_LEADER; attacker->monsterinfo.attack_finished = 0; attacker->monsterinfo.pausetime = level.time + 100000000; - if(attacker->monsterinfo.stand) + if (attacker->monsterinfo.stand) attacker->monsterinfo.stand(attacker); } } else { - if(attacker->enemy == targ) + if (attacker->enemy == targ) FoundTarget(attacker); } } @@ -1038,7 +1039,7 @@ void T_Damage (edict_t *in_targ, edict_t *inflictor, edict_t *in_attacker, vec3_ { // Knightmare- added support for sparks and blood // SpawnDamage ( BloodType(targ->blood_type), point, normal ); - if(targ->blood_type == 1) + if (targ->blood_type == 1) SpawnDamage (TE_GREENBLOOD, point, normal); else if (targ->blood_type == 2) { @@ -1058,9 +1059,9 @@ void T_Damage (edict_t *in_targ, edict_t *inflictor, edict_t *in_attacker, vec3_ SpawnDamage (te_sparks, point, normal); } - if(targ->client) + if (targ->client) { - if(in_targ != targ) + if (in_targ != targ) { // Then player has taken the place of whatever was originally // damaged, as in switching from func_monitor usage. Limit @@ -1070,34 +1071,34 @@ void T_Damage (edict_t *in_targ, edict_t *inflictor, edict_t *in_attacker, vec3_ targ->client->invincible_framenum = level.framenum+2; targ->pain_debounce_time = max(targ->pain_debounce_time,level.time+0.3); } - else if(level.framenum - targ->client->startframe > 30) + else if (level.framenum - targ->client->startframe > 30) targ->health = targ->health - take; - else if(targ->health > 10) + else if (targ->health > 10) targ->health = max(10,targ->health - take); } else { // Lazarus: For func_explosive target, check spawnflags and, if needed, // damage type - if(targ->classname && !Q_stricmp(targ->classname,"func_explosive")) + if (targ->classname && !Q_stricmp(targ->classname,"func_explosive")) { qboolean good_damage = true; // Knightmare- changed spawnflag - if(targ->spawnflags & 16) // explosion only + if (targ->spawnflags & 16) // explosion only { good_damage = false; - if(mod == MOD_GRENADE) good_damage = true; - if(mod == MOD_G_SPLASH) good_damage = true; - if(mod == MOD_ROCKET) good_damage = true; - if(mod == MOD_R_SPLASH) good_damage = true; - if(mod == MOD_BFG_BLAST) good_damage = true; - if(mod == MOD_HANDGRENADE) good_damage = true; - if(mod == MOD_HG_SPLASH) good_damage = true; - if(mod == MOD_EXPLOSIVE) good_damage = true; - if(mod == MOD_BARREL) good_damage = true; - if(mod == MOD_BOMB) good_damage = true; + if (mod == MOD_GRENADE) good_damage = true; + if (mod == MOD_G_SPLASH) good_damage = true; + if (mod == MOD_ROCKET) good_damage = true; + if (mod == MOD_R_SPLASH) good_damage = true; + if (mod == MOD_BFG_BLAST) good_damage = true; + if (mod == MOD_HANDGRENADE) good_damage = true; + if (mod == MOD_HG_SPLASH) good_damage = true; + if (mod == MOD_EXPLOSIVE) good_damage = true; + if (mod == MOD_BARREL) good_damage = true; + if (mod == MOD_BOMB) good_damage = true; } - if(!good_damage) return; + if (!good_damage) return; } targ->health = targ->health - take; diff --git a/game/g_func_decs.h b/game/g_func_decs.h index fec5a33..d1ed81f 100644 --- a/game/g_func_decs.h +++ b/game/g_func_decs.h @@ -731,6 +731,7 @@ extern void vehicle_disengage ( edict_t * vehicle ) ; extern void vehicle_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; extern void vehicle_blocked ( edict_t * self , edict_t * other ) ; extern void func_vehicle_explode ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern qboolean UseRegularGoodGuyFlag ( edict_t * monster ) ; extern void my_bprintf ( int printlevel , char * fmt , ... ) ; extern qboolean IsIdMap ( void ) ; extern void G_UseTarget ( edict_t * ent , edict_t * activator , edict_t * target ) ; diff --git a/game/g_func_list.h b/game/g_func_list.h index 1198284..d67b0e0 100644 --- a/game/g_func_list.h +++ b/game/g_func_list.h @@ -731,6 +731,7 @@ {"vehicle_touch", (byte *)vehicle_touch}, {"vehicle_blocked", (byte *)vehicle_blocked}, {"func_vehicle_explode", (byte *)func_vehicle_explode}, +{"UseRegularGoodGuyFlag", (byte *)UseRegularGoodGuyFlag}, {"my_bprintf", (byte *)my_bprintf}, {"IsIdMap", (byte *)IsIdMap}, {"G_UseTarget", (byte *)G_UseTarget}, diff --git a/game/g_local.h b/game/g_local.h index 0d8a85d..c37911e 100644 --- a/game/g_local.h +++ b/game/g_local.h @@ -1178,6 +1178,7 @@ void CreatePath (char *path); void G_UseTarget (edict_t *ent, edict_t *activator, edict_t *target); qboolean IsIdMap (void); // Knightmare added void my_bprintf (int printlevel, char *fmt, ...); +qboolean UseRegularGoodGuyFlag (edict_t *monster); // Knightmare added void G_ProjectSource2 (vec3_t point, vec3_t distance, vec3_t forward, vec3_t right, vec3_t up, vec3_t result); float vectoyaw2 (vec3_t vec); diff --git a/game/g_monster.c b/game/g_monster.c index dc37fcc..caf6a8e 100644 --- a/game/g_monster.c +++ b/game/g_monster.c @@ -572,7 +572,9 @@ void monster_use (edict_t *self, edict_t *other, edict_t *activator) // if monster is "used" by player, turn off good guy stuff if (activator->client) { - self->spawnflags &= ~SF_MONSTER_GOODGUY; + if (UseRegularGoodGuyFlag(self)) { + self->spawnflags &= ~SF_MONSTER_GOODGUY; + } self->monsterinfo.aiflags &= ~(AI_GOOD_GUY + AI_FOLLOW_LEADER); if(self->dmgteam && !Q_stricmp(self->dmgteam,"player")) self->dmgteam = NULL; @@ -696,7 +698,8 @@ qboolean monster_start (edict_t *self) } // Lazarus: Good guys - if (self->spawnflags & SF_MONSTER_GOODGUY) { + if ( UseRegularGoodGuyFlag(self) && (self->spawnflags & SF_MONSTER_GOODGUY) ) + { self->monsterinfo.aiflags |= AI_GOOD_GUY; if(!self->dmgteam) { self->dmgteam = gi.TagMalloc(8*sizeof(char), TAG_LEVEL); diff --git a/game/g_utils.c b/game/g_utils.c index 0fc0f76..b13d7e6 100644 --- a/game/g_utils.c +++ b/game/g_utils.c @@ -1159,4 +1159,30 @@ void my_bprintf (int printlevel, char *fmt, ...) safe_cprintf(cl_ent, printlevel, bigbuffer); } -} \ No newline at end of file +} + +// Knightmare added +/* +==================== +UseRegularGoodGuyFlag + +Checks the classname to see if a monster should use +the standard goodguy flag (e.g. not a gekk, stalker, turret, or fixbot). +==================== +*/ +qboolean UseRegularGoodGuyFlag (edict_t *monster) +{ + // check for bad entity reference + if (!monster || !monster->inuse || !monster->classname) + return false; + + if ( /*strcmp(monster->classname, "monster_gekk") + && strcmp(monster->classname, "monster_stalker") + && strcmp(monster->classname, "monster_turret") + && strcmp(monster->classname, "monster_fixbot") + && strcmp(monster->classname, "monster_handler") + &&*/ strcmp(monster->classname, "misc_insane") ) + return true; + + return false; +} diff --git a/game/m_insane.c b/game/m_insane.c index 167355c..f86f598 100644 --- a/game/m_insane.c +++ b/game/m_insane.c @@ -503,7 +503,8 @@ void insane_pain (edict_t *self, edict_t *other, float kick, int damage) return; // no pain anims in nightmare // Don't go into pain frames if crucified. - if (self->spawnflags & 8) +// if (self->spawnflags & 8) + if ( (self->spawnflags & 8) || (self->moreflags & 8) ) // Knightmare- use moreflags field instead { self->monsterinfo.currentmove = &insane_move_struggle_cross; return; @@ -547,7 +548,8 @@ void insane_checkup (edict_t *self) void insane_stand (edict_t *self) { - if (self->spawnflags & 8) // If crucified +// if (self->spawnflags & 8) // If crucified + if ( (self->spawnflags & 8) || (self->moreflags & 8) ) // If crucified // Knightmare- use moreflags field instead { self->monsterinfo.currentmove = &insane_move_cross; self->monsterinfo.aiflags |= AI_STAND_GROUND; @@ -564,7 +566,8 @@ void insane_stand (edict_t *self) void insane_dead (edict_t *self) { - if (self->spawnflags & 8) +// if (self->spawnflags & 8) + if ( (self->spawnflags & 8) || (self->moreflags & 8) ) // Knightmare- use moreflags field instead { self->flags |= FL_FLY; } @@ -580,7 +583,7 @@ void insane_dead (edict_t *self) M_FlyCheck(self); // Lazarus monster fade - if(world->effects & FX_WORLDSPAWN_CORPSEFADE) + if (world->effects & FX_WORLDSPAWN_CORPSEFADE) { self->think=FadeDieSink; self->nextthink=level.time+corpse_fadetime->value; @@ -612,7 +615,8 @@ void insane_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damag self->deadflag = DEAD_DEAD; self->takedamage = DAMAGE_YES; - if (self->spawnflags & 8) +// if (self->spawnflags & 8) + if ( (self->spawnflags & 8) || (self->moreflags & 8) ) // Knightmare- use moreflags field instead { insane_dead (self); } @@ -657,11 +661,11 @@ void SP_misc_insane (edict_t *self) VectorSet (self->mins, -16, -16, -24); VectorSet (self->maxs, 16, 16, 32); - if(!self->health) + if (!self->health) self->health = 100; - if(!self->gib_health) + if (!self->gib_health) self->gib_health = -50; - if(!self->mass) + if (!self->mass) self->mass = 300; self->pain = insane_pain; @@ -689,7 +693,7 @@ void SP_misc_insane (edict_t *self) self->monsterinfo.currentmove = &insane_move_stand_normal; - if(!self->monsterinfo.flies) + if (!self->monsterinfo.flies) self->monsterinfo.flies = 0.30; self->common_name = "Insane Marine"; @@ -698,6 +702,9 @@ void SP_misc_insane (edict_t *self) if (self->spawnflags & 8) // Crucified ? { + // Knightmare- Spawnflag 8 collides with SF_MONSTER_GOODGUY, and can be cleared in some instances. + // This prevents it from screwing up crucified insanes. + self->moreflags |= 8; VectorSet (self->mins, -16, 0, 0); VectorSet (self->maxs, 16, 8, 32); self->flags |= FL_NO_KNOCKBACK; diff --git a/missionpack/g_combat.c b/missionpack/g_combat.c index bf9eebe..6cd8b5e 100644 --- a/missionpack/g_combat.c +++ b/missionpack/g_combat.c @@ -489,7 +489,7 @@ void CallMyFriends (edict_t *targ, edict_t *attacker) && UseSpecialGoodGuyFlag(targ) && (targ->spawnflags & 16) ) { targ->spawnflags &= ~16; - //Knightmare- don't add to body count + // Knightmare- don't add to body count targ->monsterinfo.monsterflags |= MFL_DO_NOT_COUNT; targ->monsterinfo.aiflags &= ~(AI_GOOD_GUY + AI_FOLLOW_LEADER); if (targ->dmgteam && !Q_stricmp(targ->dmgteam,"player")) diff --git a/missionpack/g_items.c b/missionpack/g_items.c index 73e0be1..c1d44d8 100644 --- a/missionpack/g_items.c +++ b/missionpack/g_items.c @@ -1467,7 +1467,7 @@ int PowerArmorType (edict_t *ent) return POWER_ARMOR_NONE; } -//Knightmare- rewrote this to differentiate between power shield and power screen +// Knightmare- rewrote this to differentiate between power shield and power screen void Use_PowerArmor (edict_t *ent, gitem_t *item) { int index; @@ -1816,7 +1816,7 @@ void droptofloor (edict_t *ent) ent->movetype = MOVETYPE_TOSS; ent->touch = Touch_Item; - if (!(ent->spawnflags & ITEM_NO_DROPTOFLOOR)) //Knightmare- allow marked items to spawn in solids + if (!(ent->spawnflags & ITEM_NO_DROPTOFLOOR)) // Knightmare- allow marked items to spawn in solids { v = tv(0,0,-128); VectorAdd (ent->s.origin, v, dest); diff --git a/missionpack/g_local.h b/missionpack/g_local.h index fc3751b..9995c1c 100644 --- a/missionpack/g_local.h +++ b/missionpack/g_local.h @@ -1206,8 +1206,8 @@ qboolean IsIdMap (void); //Knightmare added qboolean IsRogueMap (void); //Knightmare added qboolean IsXatrixMap (void); //Knightmare added qboolean CheckCoop_MapHacks (edict_t *ent); // FS: Coop: Check if we have to modify some stuff for coop so we don't have to rely on distributing ent files -qboolean UseSpecialGoodGuyFlag (edict_t *monster); //Knightmare added -qboolean UseRegularGoodGuyFlag (edict_t *monster); //Knightmare added +qboolean UseSpecialGoodGuyFlag (edict_t *monster); // Knightmare added +qboolean UseRegularGoodGuyFlag (edict_t *monster); // Knightmare added //ROGUE void G_ProjectSource2 (vec3_t point, vec3_t distance, vec3_t forward, vec3_t right, vec3_t up, vec3_t result); diff --git a/missionpack/g_monster.c b/missionpack/g_monster.c index 6dce403..c0e4c90 100644 --- a/missionpack/g_monster.c +++ b/missionpack/g_monster.c @@ -87,22 +87,22 @@ qboolean M_SetDeath(edict_t *self, mmove_t **deathmoves) mmove_t *move=NULL; mmove_t *dmove; - if(self->health > 0) + if (self->health > 0) return false; while(*deathmoves && !move) { dmove = *deathmoves; - if( (self->s.frame >= dmove->firstframe) && + if ( (self->s.frame >= dmove->firstframe) && (self->s.frame <= dmove->lastframe) ) move = dmove; else deathmoves++; } - if(move) + if (move) { self->monsterinfo.currentmove = move; - if(self->monsterinfo.currentmove->endfunc) + if (self->monsterinfo.currentmove->endfunc) self->monsterinfo.currentmove->endfunc(self); self->s.frame = move->lastframe; self->s.skinnum |= 1; @@ -659,7 +659,7 @@ void M_droptofloor (edict_t *ent) #ifdef ROGUE_GRAVITY //PGM - if(ent->gravityVector[2] < 0) + if (ent->gravityVector[2] < 0) { ent->s.origin[2] += 1; VectorCopy (ent->s.origin, end); @@ -918,15 +918,17 @@ void monster_use (edict_t *self, edict_t *other, edict_t *activator) // if monster is "used" by player, turn off good guy stuff if (activator->client) { // Knightmare- gekks and stalkers use different spawnflag - if (UseSpecialGoodGuyFlag(self)) + if (UseSpecialGoodGuyFlag(self)) { self->spawnflags &= ~16; - else if (UseRegularGoodGuyFlag(self)) + } + else if (UseRegularGoodGuyFlag(self)) { self->spawnflags &= ~SF_MONSTER_GOODGUY; - //Knightmare- don't include goodguy monsters turned bad in body count + } + // Knightmare- don't include goodguy monsters turned bad in body count if (self->monsterinfo.aiflags & AI_GOOD_GUY) self->monsterinfo.monsterflags |= MFL_DO_NOT_COUNT; self->monsterinfo.aiflags &= ~(AI_GOOD_GUY + AI_FOLLOW_LEADER); - if(self->dmgteam && !Q_stricmp(self->dmgteam,"player")) + if (self->dmgteam && !Q_stricmp(self->dmgteam,"player")) self->dmgteam = NULL; } @@ -964,7 +966,7 @@ void monster_triggered_spawn (edict_t *self) if (self->enemy && !(self->spawnflags & 1) && !(self->enemy->flags & FL_NOTARGET)) { - if(!(self->enemy->flags & FL_DISGUISED)) // PGM + if (!(self->enemy->flags & FL_DISGUISED)) // PGM FoundTarget (self); else // PMM - just in case, make sure to clear the enemy so FindTarget doesn't get confused self->enemy = NULL; @@ -984,7 +986,7 @@ void monster_triggered_spawn_use (edict_t *self, edict_t *other, edict_t *activa if (activator->client && !(self->monsterinfo.aiflags & AI_GOOD_GUY)) self->enemy = activator; // Lazarus: Add 'em up -// if(!(self->monsterinfo.aiflags & AI_GOOD_GUY)) +// if (!(self->monsterinfo.aiflags & AI_GOOD_GUY)) // level.total_monsters++; self->use = monster_use; } @@ -1026,7 +1028,7 @@ void monster_death_use (edict_t *self) // turn camera off for that player for(i=0,player=g_edicts+1; ivalue; i++, player++) { - if(player->client && player->client->spycam == self) + if (player->client && player->client->spycam == self) camera_off(player); } @@ -1071,7 +1073,7 @@ qboolean monster_start (edict_t *self) || (UseSpecialGoodGuyFlag(self) && (self->spawnflags & 16)) ) { self->monsterinfo.aiflags |= AI_GOOD_GUY; - if(!self->dmgteam) + if (!self->dmgteam) { self->dmgteam = gi.TagMalloc(8*sizeof(char), TAG_LEVEL); strcpy(self->dmgteam,"player"); @@ -1194,7 +1196,7 @@ void monster_start_go (edict_t *self) } // Lazarus: move_origin for func_monitor - if(!VectorLength(self->move_origin)) + if (!VectorLength(self->move_origin)) VectorSet(self->move_origin,0,0,self->viewheight); // check for target to combat_point and change to combattarget @@ -1257,7 +1259,7 @@ void monster_start_go (edict_t *self) { // Lazarus: Don't wipe out target for trigger spawned monsters // that aren't triggered yet - if( !(self->spawnflags & MONSTER_TRIGGER_SPAWN) ) + if ( !(self->spawnflags & MONSTER_TRIGGER_SPAWN) ) { VectorSubtract (self->goalentity->s.origin, self->s.origin, v); self->ideal_yaw = self->s.angles[YAW] = vectoyaw(v); @@ -1378,7 +1380,7 @@ void stationarymonster_triggered_spawn (edict_t *self) if (self->enemy && !(self->spawnflags & 1) && !(self->enemy->flags & FL_NOTARGET)) { - if(!(self->enemy->flags & FL_DISGUISED)) // PGM + if (!(self->enemy->flags & FL_DISGUISED)) // PGM FoundTarget (self); else // PMM - just in case, make sure to clear the enemy so FindTarget doesn't get confused self->enemy = NULL; @@ -1398,7 +1400,7 @@ void stationarymonster_triggered_spawn_use (edict_t *self, edict_t *other, edict if (activator->client && !(self->monsterinfo.aiflags & AI_GOOD_GUY)) self->enemy = activator; // Lazarus: Add 'em up -// if(!(self->monsterinfo.aiflags & AI_GOOD_GUY)) +// if (!(self->monsterinfo.aiflags & AI_GOOD_GUY)) // level.total_monsters++; self->use = monster_use; } @@ -1457,7 +1459,7 @@ void InitiallyDead (edict_t *self) if ((self->max_health <= 0) && !(self->monsterinfo.aiflags & AI_GOOD_GUY)) { level.total_monsters--; - if(self->deadflag != DEAD_DEAD) + if (self->deadflag != DEAD_DEAD) level.killed_monsters--; } if (self->deadflag != DEAD_DEAD) @@ -1465,7 +1467,7 @@ void InitiallyDead (edict_t *self) damage = 1 - self->health; self->health = 1; T_Damage (self, world, world, vec3_origin, self->s.origin, vec3_origin, damage, 0, DAMAGE_NO_ARMOR, 0); - if(self->svflags & SVF_MONSTER) + if (self->svflags & SVF_MONSTER) { self->svflags |= SVF_DEADMONSTER; self->think = monster_think; @@ -1609,7 +1611,7 @@ int PatchMonsterModel (char *modelname) memset (skins[j], 0, MAX_SKINNAME); Com_strcpy( skins[j], sizeof(skins[j]), modelname ); p = strstr( skins[j], "tris.md2" ); - if(!p) + if (!p) { fclose (outfile); gi.dprintf( "Error patching %s\n",modelname); diff --git a/missionpack/g_save.c b/missionpack/g_save.c index a4a8e0f..1155ea3 100644 --- a/missionpack/g_save.c +++ b/missionpack/g_save.c @@ -431,7 +431,7 @@ void InitGame (void) coop = gi.cvar ("coop", "0", CVAR_LATCH); skill = gi.cvar ("skill", "1", CVAR_LATCH); - //Knightmare- increase maxentities + // Knightmare- increase maxentities //maxentities = gi.cvar ("maxentities", "1024", CVAR_LATCH); maxentities = gi.cvar ("maxentities", va("%i",MAX_EDICTS), CVAR_LATCH); gamerules = gi.cvar ("gamerules", "0", CVAR_LATCH); //PGM diff --git a/missionpack/g_tracktrain.c b/missionpack/g_tracktrain.c index 34fa340..2447916 100644 --- a/missionpack/g_tracktrain.c +++ b/missionpack/g_tracktrain.c @@ -102,7 +102,7 @@ void path_track_use (edict_t *self, edict_t *other, edict_t *activator) { char *temp; - if(self->spawnflags & SF_PATH_ALTPATH) + if (self->spawnflags & SF_PATH_ALTPATH) { temp = self->target; self->target = self->target2; @@ -131,7 +131,7 @@ void SP_path_track (edict_t *self) VectorSet (self->mins, -8, -8, -8); VectorSet (self->maxs, 8, 8, 8); self->svflags |= SVF_NOCLIENT; - if(!self->count) self->count = -1; + if (!self->count) self->count = -1; gi.linkentity (self); } @@ -172,16 +172,16 @@ void trackchange_done (edict_t *self) gi.positioned_sound (self->s.origin, self, CHAN_AUTO, self->moveinfo.sound_end, 1, self->attenuation, 0); // was ATTN_NORM self->s.sound = 0; - if(train) + if (train) { VectorClear(train->velocity); VectorClear(train->avelocity); train->spawnflags &= ~SF_TRACKTRAIN_DISABLED; - if(self->spawnflags & SF_TRACK_ACTIVATETRAIN) + if (self->spawnflags & SF_TRACK_ACTIVATETRAIN) { train->moveinfo.state = train->moveinfo.prevstate; - if(train->moveinfo.state && (train->sounds > 0)) { - train->s.sound = gi.soundindex(va("%sspeed%d.wav",train->source,abs(train->moveinfo.state))); + if (train->moveinfo.state && (train->sounds > 0)) { + train->s.sound = gi.soundindex(va("%sspeed%d.wav", train->source, abs(train->moveinfo.state))); #ifdef LOOP_SOUND_ATTENUATION train->s.attenuation = train->attenuation; #endif @@ -193,7 +193,7 @@ void trackchange_done (edict_t *self) train->moveinfo.state = STOP; train->moveinfo.next_speed = 0; } - if(self->moveinfo.state == STATE_MOVEUP) + if (self->moveinfo.state == STATE_MOVEUP) train->target = self->pathtarget; else train->target = self->combattarget; @@ -207,7 +207,7 @@ void trackchange_done (edict_t *self) gi.linkentity(train); tracktrain_next(train); } - if(self->moveinfo.state == STATE_MOVEDOWN) + if (self->moveinfo.state == STATE_MOVEDOWN) self->moveinfo.state = STATE_BOTTOM; else self->moveinfo.state = STATE_TOP; @@ -219,32 +219,32 @@ void trackchange_use (edict_t *self, edict_t *other, edict_t *activator) float time, tt, tr; float tspeed, rspeed; - if((self->moveinfo.state != STATE_TOP) && (self->moveinfo.state != STATE_BOTTOM)) + if ((self->moveinfo.state != STATE_TOP) && (self->moveinfo.state != STATE_BOTTOM)) { // already moving return; } - if(self->target) + if (self->target) { edict_t *track; self->target_ent = G_PickTarget(self->target); - if(self->target_ent) + if (self->target_ent) { // Make sure this sucker is at the path_track it's supposed to // be at - if(self->moveinfo.state == STATE_BOTTOM) + if (self->moveinfo.state == STATE_BOTTOM) track = G_PickTarget(self->combattarget); else track = G_PickTarget(self->pathtarget); - if(!track || (self->target_ent->target_ent != track)) + if (!track || (self->target_ent->target_ent != track)) self->target_ent = NULL; else { vec3_t v; VectorSubtract(track->s.origin,self->target_ent->s.origin,v); - if(VectorLength(v) > self->target_ent->moveinfo.distance) + if (VectorLength(v) > self->target_ent->moveinfo.distance) self->target_ent = NULL; } } @@ -252,7 +252,7 @@ void trackchange_use (edict_t *self, edict_t *other, edict_t *activator) else self->target_ent = NULL; - if(self->target_ent) + if (self->target_ent) self->target_ent->s.sound = 0; // Adjust speed so that "distance" rotation and "height" movement are achieved @@ -263,7 +263,7 @@ void trackchange_use (edict_t *self, edict_t *other, edict_t *activator) time = 0.1 * ((int)(10.*time-0.5)+1); tspeed = -self->viewheight / time; rspeed = self->moveinfo.distance / time; - if(self->moveinfo.state == STATE_BOTTOM) + if (self->moveinfo.state == STATE_BOTTOM) { tspeed = -tspeed; rspeed = -rspeed; @@ -279,7 +279,7 @@ void trackchange_use (edict_t *self, edict_t *other, edict_t *activator) VectorScale(self->movedir,rspeed,self->avelocity); - if(self->target_ent) + if (self->target_ent) { VectorCopy(self->velocity,self->target_ent->velocity); VectorCopy(self->avelocity,self->target_ent->avelocity); @@ -287,7 +287,7 @@ void trackchange_use (edict_t *self, edict_t *other, edict_t *activator) gi.linkentity(self->target_ent); } - if(self->moveinfo.state == STATE_TOP) + if (self->moveinfo.state == STATE_TOP) self->moveinfo.state = STATE_MOVEDOWN; else self->moveinfo.state = STATE_MOVEUP; @@ -331,7 +331,7 @@ void SP_func_trackchange (edict_t *self) self->viewheight = st.height; // Max rotation/translation speed - if(!self->speed) + if (!self->speed) self->speed = 100; VectorCopy(self->s.origin,self->pos1); @@ -350,7 +350,7 @@ void SP_func_trackchange (edict_t *self) self->postthink = train_move_children; //Knightmare- supports movewith // bottom starters: - if(self->spawnflags & SF_TRACK_STARTBOTTOM) + if (self->spawnflags & SF_TRACK_STARTBOTTOM) { vec3_t temp; VectorCopy(self->pos1,temp); @@ -405,7 +405,7 @@ void tracktrain_drive (edict_t *train, edict_t *other ) if (!(other->svflags & SVF_MONSTER)) return; - if(train->spawnflags & (SF_TRACKTRAIN_NOCONTROL | SF_TRACKTRAIN_STARTOFF)) + if (train->spawnflags & (SF_TRACKTRAIN_NOCONTROL | SF_TRACKTRAIN_STARTOFF)) return; // See if monster is in driving position @@ -423,17 +423,17 @@ void tracktrain_drive (edict_t *train, edict_t *other ) // Relax the constraints on driving position just a bit for monsters - if(offset[0] < train->bleft[0] - 16) + if (offset[0] < train->bleft[0] - 16) return; - if(offset[1] < train->bleft[1] - 16) + if (offset[1] < train->bleft[1] - 16) return; - if(offset[2] < train->bleft[2] - 16) + if (offset[2] < train->bleft[2] - 16) return; - if(offset[0] > train->tright[0] + 16) + if (offset[0] > train->tright[0] + 16) return; - if(offset[1] > train->tright[1] + 16) + if (offset[1] > train->tright[1] + 16) return; - if(offset[2] > train->tright[2] + 16) + if (offset[2] > train->tright[2] + 16) return; train->owner = other; @@ -458,8 +458,8 @@ void tracktrain_drive (edict_t *train, edict_t *other ) train->moveinfo.state = FAST; train->moveinfo.next_speed = train->moveinfo.speed; - if(train->sounds) { - train->s.sound = gi.soundindex(va("%sspeed%d.wav",train->source,abs(train->moveinfo.state))); + if (train->sounds) { + train->s.sound = gi.soundindex(va("%sspeed%d.wav", train->source, abs(train->moveinfo.state))); #ifdef LOOP_SOUND_ATTENUATION train->s.attenuation = train->attenuation; #endif @@ -473,7 +473,7 @@ void tracktrain_drive (edict_t *train, edict_t *other ) void tracktrain_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) { - if(self->deathtarget) + if (self->deathtarget) { self->target = self->deathtarget; G_UseTargets (self, attacker); @@ -486,9 +486,9 @@ void tracktrain_disengage (edict_t *train) edict_t *driver; driver = train->owner; - if(!driver) return; + if (!driver) return; - if(driver->client) + if (driver->client) { vec3_t forward, left, up, f1, l1, u1; @@ -508,7 +508,7 @@ void tracktrain_disengage (edict_t *train) } else { - if(train->moveinfo.state != STOP) + if (train->moveinfo.state != STOP) { train->spawnflags |= SF_TRACKTRAIN_SLOWSTOP; train->moveinfo.state = STOP; @@ -520,7 +520,7 @@ void tracktrain_disengage (edict_t *train) } driver->movetype = MOVETYPE_STEP; - if(driver->health > 0) + if (driver->health > 0) VectorCopy(train->velocity,driver->velocity); else VectorClear(driver->velocity); @@ -548,9 +548,9 @@ void tracktrain_think (edict_t *self) int i; edict_t *ent; - if(self->spawnflags & SF_TRACKTRAIN_OTHERMAP) + if (self->spawnflags & SF_TRACKTRAIN_OTHERMAP) { - if( (self->spawnflags & SF_TRACKTRAIN_INDICATOR) && !(self->spawnflags & SF_TRACKTRAIN_ANIMATED)) + if ( (self->spawnflags & SF_TRACKTRAIN_INDICATOR) && !(self->spawnflags & SF_TRACKTRAIN_ANIMATED)) self->s.frame = 6; else self->s.effects &= ~(EF_ANIM_ALL | EF_ANIM_ALLFAST); @@ -569,14 +569,14 @@ void tracktrain_think (edict_t *self) self->nextthink = level.time + FRAMETIME; - if(!self->owner && (self->spawnflags & SF_TRACKTRAIN_DISABLED)) + if (!self->owner && (self->spawnflags & SF_TRACKTRAIN_DISABLED)) return; - if(self->spawnflags & SF_TRACKTRAIN_ANIMATED) + if (self->spawnflags & SF_TRACKTRAIN_ANIMATED) { - if(self->moveinfo.state) + if (self->moveinfo.state) { - if(self->spawnflags & SF_TRACKTRAIN_INDICATOR) + if (self->spawnflags & SF_TRACKTRAIN_INDICATOR) self->s.effects |= EF_ANIM_ALLFAST; else self->s.effects |= EF_ANIM_ALL; @@ -584,29 +584,29 @@ void tracktrain_think (edict_t *self) else self->s.effects &= ~(EF_ANIM_ALL | EF_ANIM_ALLFAST); } - else if(self->spawnflags & SF_TRACKTRAIN_INDICATOR) + else if (self->spawnflags & SF_TRACKTRAIN_INDICATOR) { - if((self->moveinfo.state == STOP) && !self->owner) + if ((self->moveinfo.state == STOP) && !self->owner) { - if(self->spawnflags & SF_TRACKTRAIN_STARTOFF) + if (self->spawnflags & SF_TRACKTRAIN_STARTOFF) self->s.frame = 14; else self->s.frame = 6; } - else if((level.framenum % 5) == 0) + else if ((level.framenum % 5) == 0) self->s.frame = (self->moveinfo.state - RFAST)*2 + (1 - (self->s.frame % 2)); } AngleVectors(self->s.angles, forward, left, up); - if(!(self->spawnflags & SF_TRACKTRAIN_DISABLED)) + if (!(self->spawnflags & SF_TRACKTRAIN_DISABLED)) { VectorCopy(self->velocity,v); speed = VectorLength(v); - if(self->moveinfo.state < STOP) + if (self->moveinfo.state < STOP) speed = -speed; self->moveinfo.current_speed = speed; - if(self->moveinfo.state != STOP) + if (self->moveinfo.state != STOP) self->moveinfo.prevstate = self->moveinfo.state; } @@ -626,7 +626,7 @@ void tracktrain_think (edict_t *self) { // if he's pressing the use key, and he didn't just // get on or off, disengage - if(level.framenum - driver->client->vehicle_framenum > 2) + if (level.framenum - driver->client->vehicle_framenum > 2) { VectorCopy(self->velocity,driver->velocity); tracktrain_disengage(self); @@ -646,19 +646,19 @@ void tracktrain_think (edict_t *self) { if ((driver->client->ucmd.forwardmove > -199) && (driver->client->ucmd.forwardmove < 199)) self->moveinfo.wait = 0; - else if(!self->moveinfo.wait) + else if (!self->moveinfo.wait) { - if(driver->client->ucmd.forwardmove > 0) + if (driver->client->ucmd.forwardmove > 0) { - if(self->moveinfo.state < FAST) + if (self->moveinfo.state < FAST) { self->moveinfo.state++; self->moveinfo.next_speed = self->moveinfo.state * self->moveinfo.speed/3; self->moveinfo.wait = 1; - if((self->spawnflags & SF_TRACKTRAIN_ANIMMASK) == SF_TRACKTRAIN_INDICATOR) + if ((self->spawnflags & SF_TRACKTRAIN_ANIMMASK) == SF_TRACKTRAIN_INDICATOR) self->s.frame = (self->moveinfo.state - RFAST)*2 + (1 - (self->s.frame % 2)); - if(self->moveinfo.state && (self->sounds > 0)) { - self->s.sound = gi.soundindex(va("%sspeed%d.wav",self->source,abs(self->moveinfo.state))); + if (self->moveinfo.state && (self->sounds > 0)) { + self->s.sound = gi.soundindex(va("%sspeed%d.wav", self->source, abs(self->moveinfo.state))); #ifdef LOOP_SOUND_ATTENUATION self->s.attenuation = self->attenuation; #endif @@ -669,15 +669,15 @@ void tracktrain_think (edict_t *self) } else { - if( (self->moveinfo.state > STOP) || + if ( (self->moveinfo.state > STOP) || ((self->moveinfo.state > RFAST) && !(self->spawnflags & SF_TRACKTRAIN_ONEWAY))) { self->moveinfo.state--; self->moveinfo.next_speed = self->moveinfo.state * self->moveinfo.speed/3; self->moveinfo.wait = 1; - if((self->spawnflags & SF_TRACKTRAIN_ANIMMASK) == SF_TRACKTRAIN_INDICATOR) + if ((self->spawnflags & SF_TRACKTRAIN_ANIMMASK) == SF_TRACKTRAIN_INDICATOR) self->s.frame = (self->moveinfo.state - RFAST)*2 + (1 - (self->s.frame % 2)); - if(self->moveinfo.state && (self->sounds > 0)) { + if (self->moveinfo.state && (self->sounds > 0)) { self->s.sound = gi.soundindex(va("%sspeed%d.wav",self->source,abs(self->moveinfo.state))); #ifdef LOOP_SOUND_ATTENUATION self->s.attenuation = self->attenuation; @@ -692,28 +692,28 @@ void tracktrain_think (edict_t *self) else { // Driver is monster. - if(driver->enemy && driver->enemy->inuse) + if (driver->enemy && driver->enemy->inuse) { qboolean vis; vis = visible(driver,driver->enemy); - if(vis) + if (vis) self->monsterinfo.search_time = 0; - if(self->monsterinfo.search_time == 0) + if (self->monsterinfo.search_time == 0) { float dot, r; vec3_t vec; - if(vis) + if (vis) VectorSubtract(driver->enemy->s.origin,driver->s.origin,vec); else VectorSubtract(driver->monsterinfo.last_sighting,driver->s.origin,vec); r = VectorNormalize(vec); dot = DotProduct(vec,forward); - if((r > 2000) && (dot < 0)) + if ((r > 2000) && (dot < 0)) { self->moveinfo.state = -self->moveinfo.state; self->moveinfo.next_speed = self->moveinfo.state * self->moveinfo.speed/3; @@ -725,37 +725,37 @@ void tracktrain_think (edict_t *self) } } // Check for change in direction - if( self->moveinfo.prevstate < STOP && self->moveinfo.state > STOP ) + if ( self->moveinfo.prevstate < STOP && self->moveinfo.state > STOP ) { self->moveinfo.prevstate = self->moveinfo.state; tracktrain_next(self); return; } - else if(self->moveinfo.prevstate > STOP && self->moveinfo.state < STOP) + else if (self->moveinfo.prevstate > STOP && self->moveinfo.state < STOP) { self->moveinfo.prevstate = self->moveinfo.state; tracktrain_next(self); return; } - if(self->moveinfo.current_speed < self->moveinfo.next_speed) + if (self->moveinfo.current_speed < self->moveinfo.next_speed) { speed = self->moveinfo.current_speed + self->moveinfo.accel/10; - if(speed > self->moveinfo.next_speed) speed = self->moveinfo.next_speed; + if (speed > self->moveinfo.next_speed) speed = self->moveinfo.next_speed; } - else if(self->moveinfo.current_speed > self->moveinfo.next_speed) + else if (self->moveinfo.current_speed > self->moveinfo.next_speed) { speed = self->moveinfo.current_speed - self->moveinfo.decel/10; - if(speed < self->moveinfo.next_speed) speed = self->moveinfo.next_speed; + if (speed < self->moveinfo.next_speed) speed = self->moveinfo.next_speed; } VectorSubtract(self->moveinfo.end_origin,self->s.origin,v); distance = VectorLength(v); - if(speed != 0) + if (speed != 0) { time = distance/fabs(speed); time = 0.1 * ((int)(10*time - 0.5)+1); - if( (time > 0) && (distance > 0) ) + if ( (time > 0) && (distance > 0) ) speed = distance/time; } else @@ -781,37 +781,37 @@ void tracktrain_think (edict_t *self) driver->s.origin[2] += 16 * ( fabs(up[0]) + fabs(up[1]) ); yaw = self->avelocity[YAW]*FRAMETIME; - if(yaw != 0) + if (yaw != 0) { driver->s.angles[YAW] += yaw; - if(driver->client) + if (driver->client) { driver->client->ps.pmove.delta_angles[YAW] += ANGLE2SHORT(yaw); driver->client->ps.viewangles[YAW] += yaw; } } pitch = self->avelocity[PITCH]*FRAMETIME; - if(pitch != 0) + if (pitch != 0) { float delta_yaw; delta_yaw = driver->s.angles[YAW] - self->s.angles[YAW]; delta_yaw *= M_PI / 180.; pitch *= cos(delta_yaw); - if(driver->client) + if (driver->client) { driver->client->ps.pmove.delta_angles[PITCH] += ANGLE2SHORT(pitch); driver->client->ps.viewangles[PITCH] += pitch; } } - if((self->moveinfo.state != STOP) || (yaw != 0) || (pitch != 0)) - if(driver->client) + if ((self->moveinfo.state != STOP) || (yaw != 0) || (pitch != 0)) + if (driver->client) driver->client->ps.pmove.pm_type = PM_FREEZE; gi.linkentity(driver); } - else if(self->spawnflags & (SF_TRACKTRAIN_NOCONTROL | SF_TRACKTRAIN_STARTOFF)) + else if (self->spawnflags & (SF_TRACKTRAIN_NOCONTROL | SF_TRACKTRAIN_STARTOFF)) { // No driver, either can't be controlled or is "off" @@ -819,31 +819,31 @@ void tracktrain_think (edict_t *self) { self->moveinfo.next_speed = self->moveinfo.state * self->moveinfo.speed/3; - if(self->moveinfo.current_speed < self->moveinfo.next_speed) + if (self->moveinfo.current_speed < self->moveinfo.next_speed) { speed = self->moveinfo.current_speed + self->moveinfo.accel/10; - if(speed > self->moveinfo.next_speed) speed = self->moveinfo.next_speed; + if (speed > self->moveinfo.next_speed) speed = self->moveinfo.next_speed; } - else if(self->moveinfo.current_speed > self->moveinfo.next_speed) + else if (self->moveinfo.current_speed > self->moveinfo.next_speed) { speed = self->moveinfo.current_speed - self->moveinfo.decel/10; - if(speed < self->moveinfo.next_speed) speed = self->moveinfo.next_speed; + if (speed < self->moveinfo.next_speed) speed = self->moveinfo.next_speed; } - if(speed != 0) + if (speed != 0) { VectorSubtract(self->moveinfo.end_origin,self->s.origin,v); distance = VectorLength(v); time = distance/fabs(speed); time = 0.1 * ((int)(10*time - 0.5)+1); - if( (time > 0) && (distance > 0) ) + if ( (time > 0) && (distance > 0) ) speed = distance/time; VectorNormalize(v); VectorScale(v,fabs(speed),self->velocity); gi.linkentity(self); } - if( !(self->spawnflags & SF_TRACKTRAIN_NOCONTROL) && + if ( !(self->spawnflags & SF_TRACKTRAIN_NOCONTROL) && (self->spawnflags & SF_TRACKTRAIN_STARTOFF) && self->viewmessage ) { @@ -864,17 +864,17 @@ void tracktrain_think (edict_t *self) VectorCopy(f1,offset); VectorAdd(offset,l1,offset); VectorAdd(offset,u1,offset); - if(offset[0] < self->bleft[0]) + if (offset[0] < self->bleft[0]) continue; - if(offset[1] < self->bleft[1]) + if (offset[1] < self->bleft[1]) continue; - if(offset[2] < self->bleft[2]) + if (offset[2] < self->bleft[2]) continue; - if(offset[0] > self->tright[0]) + if (offset[0] > self->tright[0]) continue; - if(offset[1] > self->tright[1]) + if (offset[1] > self->tright[1]) continue; - if(offset[2] > self->tright[2]) + if (offset[2] > self->tright[2]) continue; gi.centerprintf(ent,"%s",self->viewmessage); @@ -882,16 +882,16 @@ void tracktrain_think (edict_t *self) } } - if(!speed) + if (!speed) { - if(self->viewmessage) + if (self->viewmessage) time = 100000; else { VectorClear(self->avelocity); VectorClear(self->avelocity); self->nextthink = 0; - // if(self->movewith_next && (self->movewith_next->movewith_ent == self)) + // if (self->movewith_next && (self->movewith_next->movewith_ent == self)) // set_child_movement(self); gi.linkentity(self); return; @@ -905,35 +905,35 @@ void tracktrain_think (edict_t *self) // No driver, CAN be controlled and isn't currently turned off // self->moveinfo.next_speed = self->moveinfo.state * self->moveinfo.speed/3; - if(self->moveinfo.current_speed < self->moveinfo.next_speed) + if (self->moveinfo.current_speed < self->moveinfo.next_speed) { - if(self->spawnflags & SF_TRACKTRAIN_SLOWSTOP) + if (self->spawnflags & SF_TRACKTRAIN_SLOWSTOP) speed = self->moveinfo.current_speed + self->moveinfo.accel/25; else speed = self->moveinfo.current_speed + self->moveinfo.accel/10; - if(speed > self->moveinfo.next_speed) speed = self->moveinfo.next_speed; + if (speed > self->moveinfo.next_speed) speed = self->moveinfo.next_speed; } - else if(self->moveinfo.current_speed > self->moveinfo.next_speed) + else if (self->moveinfo.current_speed > self->moveinfo.next_speed) { - if(self->spawnflags & SF_TRACKTRAIN_SLOWSTOP) + if (self->spawnflags & SF_TRACKTRAIN_SLOWSTOP) speed = self->moveinfo.current_speed - self->moveinfo.decel/25; else speed = self->moveinfo.current_speed - self->moveinfo.decel/10; - if(speed < self->moveinfo.next_speed) speed = self->moveinfo.next_speed; + if (speed < self->moveinfo.next_speed) speed = self->moveinfo.next_speed; } - if( speed != 0 ) + if ( speed != 0 ) { VectorSubtract(self->moveinfo.end_origin,self->s.origin,v); distance = VectorNormalize(v); time = distance/fabs(speed); time = 0.1 * ((int)(10*time - 0.5)+1); - if( (time > 0) && (distance > 0) ) + if ( (time > 0) && (distance > 0) ) speed = distance/time; VectorScale(v,fabs(speed),self->velocity); gi.linkentity(self); } - else if(self->moveinfo.current_speed != 0) + else if (self->moveinfo.current_speed != 0) { VectorClear(self->velocity); self->s.sound = 0; @@ -946,7 +946,7 @@ void tracktrain_think (edict_t *self) time = 100000; } - if(!(self->spawnflags & SF_TRACKTRAIN_NOCONTROL)) + if (!(self->spawnflags & SF_TRACKTRAIN_NOCONTROL)) { vec3_t angles, offset; @@ -971,20 +971,20 @@ void tracktrain_think (edict_t *self) VectorAdd(offset,l1,offset); VectorAdd(offset,u1,offset); // gi.dprintf("offset=%g %g %g\n",offset[0],offset[1],offset[2]); - if(offset[0] < self->bleft[0]) + if (offset[0] < self->bleft[0]) continue; - if(offset[1] < self->bleft[1]) + if (offset[1] < self->bleft[1]) continue; - if(offset[2] < self->bleft[2]) + if (offset[2] < self->bleft[2]) continue; - if(offset[0] > self->tright[0]) + if (offset[0] > self->tright[0]) continue; - if(offset[1] > self->tright[1]) + if (offset[1] > self->tright[1]) continue; - if(offset[2] > self->tright[2]) + if (offset[2] > self->tright[2]) continue; - if(self->message) + if (self->message) { gi.centerprintf(ent,"%s",self->message); self->message = NULL; @@ -1013,10 +1013,10 @@ void tracktrain_think (edict_t *self) } } } - //if(self->movewith_next && (self->movewith_next->movewith_ent == self)) + //if (self->movewith_next && (self->movewith_next->movewith_ent == self)) // set_child_movement(self); - if( (time < 1.5*FRAMETIME) && !(self->spawnflags & SF_TRACKTRAIN_DISABLED)) + if ( (time < 1.5*FRAMETIME) && !(self->spawnflags & SF_TRACKTRAIN_DISABLED)) self->think = tracktrain_reach_dest; } @@ -1067,7 +1067,7 @@ void tracktrain_blocked (edict_t *self, edict_t *other) if (!self->dmg) return; - if(other->client && (other->groundentity == self)) + if (other->client && (other->groundentity == self)) { // Don't cream riders who've become embedded - just do minor damage // and *maybe* help them get unstuck by pushing them up. @@ -1093,7 +1093,7 @@ void tracktrain_reach_dest (edict_t *self) savetarget = path->target; path->target = path->pathtarget; - if(self->owner) + if (self->owner) G_UseTargets (path, self->owner); else G_UseTargets (path, self); @@ -1102,19 +1102,19 @@ void tracktrain_reach_dest (edict_t *self) // make sure we didn't get killed by a killtarget if (!self->inuse) return; - if(path->spawnflags & SF_PATH_FIREONCE) + if (path->spawnflags & SF_PATH_FIREONCE) path->pathtarget = NULL; } - if(path && (path->spawnflags & SF_PATH_DISABLE_TRAIN)) + if (path && (path->spawnflags & SF_PATH_DISABLE_TRAIN)) { self->spawnflags |= SF_TRACKTRAIN_NOCONTROL; - if(self->owner) + if (self->owner) tracktrain_disengage(self); } - if(path && path->speed) + if (path && path->speed) { - if(path->spawnflags & SF_PATH_ABS_SPEED) + if (path->spawnflags & SF_PATH_ABS_SPEED) { self->moveinfo.speed = path->speed; self->moveinfo.next_speed = self->moveinfo.speed; @@ -1137,7 +1137,7 @@ qboolean is_backing_up (edict_t *train) VectorCopy(train->velocity,v_norm); VectorNormalize(v_norm); AngleVectors(train->s.angles,forward,NULL,NULL); - if(DotProduct(forward,v_norm) < 0.) + if (DotProduct(forward,v_norm) < 0.) return true; else return false; @@ -1152,17 +1152,17 @@ edict_t *NextPathTrack(edict_t *train, edict_t *path) AngleVectors(train->s.angles,forward,NULL,NULL); - if( (train->moveinfo.prevstate < STOP && train->moveinfo.state > STOP) || + if ( (train->moveinfo.prevstate < STOP && train->moveinfo.state > STOP) || (train->moveinfo.prevstate > STOP && train->moveinfo.state < STOP) ) { next = path->prevpath; - if(next) + if (next) { VectorSubtract(next->s.origin,path->s.origin,to_next); VectorNormalize(to_next); - if((train->moveinfo.state > STOP) && (DotProduct(forward,to_next) < 0)) + if ((train->moveinfo.state > STOP) && (DotProduct(forward,to_next) < 0)) next = NULL; - else if((train->moveinfo.state < STOP) && (DotProduct(forward,to_next) > 0)) + else if ((train->moveinfo.state < STOP) && (DotProduct(forward,to_next) > 0)) next = NULL; else { @@ -1172,9 +1172,9 @@ edict_t *NextPathTrack(edict_t *train, edict_t *path) } } - if(train->moveinfo.state == STOP) + if (train->moveinfo.state == STOP) { - if(is_backing_up(train)) + if (is_backing_up(train)) in_reverse = true; else in_reverse = false; @@ -1182,66 +1182,66 @@ edict_t *NextPathTrack(edict_t *train, edict_t *path) else in_reverse = (train->moveinfo.state < STOP ? true : false); - if(in_reverse) + if (in_reverse) { - if(path->spawnflags & SF_PATH_ALTPATH) + if (path->spawnflags & SF_PATH_ALTPATH) { next = G_PickTarget (path->target); - if(next) + if (next) { VectorSubtract(next->s.origin,path->s.origin,to_next); VectorNormalize(to_next); - if(DotProduct(forward,to_next) > 0) + if (DotProduct(forward,to_next) > 0) next = NULL; } } - if(!next) + if (!next) { next = path->prevpath; - if(next) + if (next) { // Ensure we don't flipflop VectorSubtract(next->s.origin,path->s.origin,to_next); VectorNormalize(to_next); - if(DotProduct(forward,to_next) > 0) + if (DotProduct(forward,to_next) > 0) next = NULL; } - if(!next) + if (!next) { // Find path_track whose target or target2 is set to // the current path_track edict_t *e; int i; - for(i=maxclients->value; ivalue; iinuse) + if (!e->inuse) continue; - if(e==path) + if (e==path) continue; - if(!e->classname) + if (!e->classname) continue; - if(Q_stricmp(e->classname,"path_track")) + if (Q_stricmp(e->classname,"path_track")) continue; - if(e->target && !Q_stricmp(e->target,path->targetname)) + if (e->target && !Q_stricmp(e->target,path->targetname)) { next = e; VectorSubtract(next->s.origin,path->s.origin,to_next); VectorNormalize(to_next); - if(DotProduct(forward,to_next) > 0) + if (DotProduct(forward,to_next) > 0) next = NULL; // else // path->prevpath = next; } - if(!next && e->target2 && !Q_stricmp(e->target2,path->targetname)) + if (!next && e->target2 && !Q_stricmp(e->target2,path->targetname)) { next = e; VectorSubtract(next->s.origin,path->s.origin,to_next); VectorNormalize(to_next); - if(DotProduct(forward,to_next) > 0) + if (DotProduct(forward,to_next) > 0) next = NULL; // else // path->prevpath = next; @@ -1254,42 +1254,42 @@ edict_t *NextPathTrack(edict_t *train, edict_t *path) float dot; // Finally, check this path_track's target and target2 - if(path->target) + if (path->target) { next = G_PickTarget (path->target); - if(next) + if (next) { VectorSubtract(next->s.origin,path->s.origin,to_next); VectorNormalize(to_next); dot = DotProduct(forward,to_next); - if(dot > 0) + if (dot > 0) next = NULL; } } - if(path->target2 && !(path->spawnflags & SF_PATH_ALTPATH)) + if (path->target2 && !(path->spawnflags & SF_PATH_ALTPATH)) { edict_t *next2; float dot2; next2 = G_PickTarget (path->target2); - if( next2 == path ) + if ( next2 == path ) next2 = NULL; - if(next2) + if (next2) { VectorSubtract(next2->s.origin,path->s.origin,to_next); VectorNormalize(to_next); dot2 = DotProduct(forward,to_next); - if(dot2 > 0) + if (dot2 > 0) next2 = NULL; - else if(!next) + else if (!next) { next = next2; next2 = NULL; } } - if((next && next2) && (dot2 < dot)) + if ((next && next2) && (dot2 < dot)) next = next2; } } @@ -1299,72 +1299,72 @@ edict_t *NextPathTrack(edict_t *train, edict_t *path) { float dot; - if(path->target) + if (path->target) { next = G_PickTarget (path->target); - if(next) + if (next) { VectorSubtract(next->s.origin,path->s.origin,to_next); VectorNormalize(to_next); dot = DotProduct(forward,to_next); - if(dot < 0) + if (dot < 0) next = NULL; } } - if(path->target2 && !(path->spawnflags & SF_PATH_ALTPATH)) + if (path->target2 && !(path->spawnflags & SF_PATH_ALTPATH)) { edict_t *next2; float dot2; next2 = G_PickTarget (path->target2); - if( next2 == path ) + if ( next2 == path ) next2 = NULL; - if(next2) + if (next2) { VectorSubtract(next2->s.origin,path->s.origin,to_next); VectorNormalize(to_next); dot2 = DotProduct(forward,to_next); - if(dot2 < 0) + if (dot2 < 0) next2 = NULL; - else if(!next) + else if (!next) { next = next2; next2 = NULL; } } - if((next && next2) && (dot2 > dot)) + if ((next && next2) && (dot2 > dot)) next = next2; } - if(next == path) + if (next == path) next = NULL; - if(!next) + if (!next) { // Check for path_tracks that target (or target2) this path_track. edict_t *e; int i; - for(i=maxclients->value; ivalue; iinuse) + if (!e->inuse) continue; - if(e==path) + if (e==path) continue; - if(!e->classname) + if (!e->classname) continue; - if(Q_stricmp(e->classname,"path_track")) + if (Q_stricmp(e->classname,"path_track")) continue; - if(e->target && !Q_stricmp(e->target,path->targetname)) + if (e->target && !Q_stricmp(e->target,path->targetname)) { next = e; VectorSubtract(next->s.origin,path->s.origin,to_next); VectorNormalize(to_next); dot = DotProduct(forward,to_next); - if(dot < 0) + if (dot < 0) next = NULL; } - if(e->target2 && !Q_stricmp(e->target2,path->targetname)) + if (e->target2 && !Q_stricmp(e->target2,path->targetname)) { edict_t *next2; float dot2; @@ -1373,29 +1373,29 @@ edict_t *NextPathTrack(edict_t *train, edict_t *path) VectorSubtract(next2->s.origin,path->s.origin,to_next); VectorNormalize(to_next); dot2 = DotProduct(forward,to_next); - if(dot2 < 0) + if (dot2 < 0) next2 = NULL; - else if(!next) + else if (!next) { next = next2; next2 = NULL; } - if((next && next2) && (dot2 > dot)) + if ((next && next2) && (dot2 > dot)) next = next2; } } } -// if(next) +// if (next) // next->prevpath = path; } - if(developer->value) + if (developer->value) gi.dprintf("prev=%s, current=%s, next=%s\n", (path->prevpath ? path->prevpath->targetname : "nada"), path->targetname, (next ? next->targetname : "nada")); - if(next) + if (next) next->prevpath = path; return next; } @@ -1409,13 +1409,13 @@ void LookAhead( edict_t *train, vec3_t point, float dist ) int n=0; path = train->target_ent; - if(!path || dist < 0) + if (!path || dist < 0) return; while ( dist > 0 ) { n++; - if(n>20) + if (n>20) { gi.dprintf("WTF??? n=%d\n",n); return; @@ -1423,7 +1423,7 @@ void LookAhead( edict_t *train, vec3_t point, float dist ) VectorSubtract(path->s.origin,point,v); length = VectorLength(v); - if(length >= dist) + if (length >= dist) { VectorMA(point,dist/length,v,point); return; @@ -1432,12 +1432,12 @@ void LookAhead( edict_t *train, vec3_t point, float dist ) VectorCopy(path->s.origin,point); // Don't go past a switch -/* if(path->spawnflags & SF_PATH_ALTPATH) +/* if (path->spawnflags & SF_PATH_ALTPATH) { return; } */ path = NextPathTrack(train,path); - if(!path) + if (!path) return; } } @@ -1451,17 +1451,17 @@ void train_angles(edict_t *train) LookAhead(train,v,train->moveinfo.distance); v[2] += train->viewheight; VectorSubtract (v, train->s.origin, v); - if( (train->moveinfo.state < STOP) || (train->moveinfo.state==STOP && is_backing_up(train)) ) + if ( (train->moveinfo.state < STOP) || (train->moveinfo.state==STOP && is_backing_up(train)) ) VectorNegate(v,v); // gi.dprintf("v = %g, %g, %g\n",v[0],v[1],v[2]); - if(VectorLength(v)) + if (VectorLength(v)) { vectoangles2(v,angles); train->ideal_yaw = angles[YAW]; train->ideal_pitch = angles[PITCH]; - if(train->ideal_pitch < 0) train->ideal_pitch += 360; + if (train->ideal_pitch < 0) train->ideal_pitch += 360; } else { @@ -1482,10 +1482,10 @@ void train_angles(edict_t *train) // If yaw angle is > 90, we're about to flipflop (there's no way ideal_yaw // can be more than 90 because the path_track selection code doesn't // allow that - if( (angles[YAW] > 90) || (angles[YAW] < -90) ) + if ( (angles[YAW] > 90) || (angles[YAW] < -90) ) { angles[YAW] += 180; - if(angles[PITCH] != 0) + if (angles[PITCH] != 0) angles[PITCH] += 180; AnglesNormalize(angles); } @@ -1502,16 +1502,16 @@ void tracktrain_turn (edict_t *self) float new_speed; train = self->enemy; - if(!train || !train->inuse) + if (!train || !train->inuse) return; self->nextthink = level.time + FRAMETIME; - if(train->spawnflags & (SF_TRACKTRAIN_DISABLED | SF_TRACKTRAIN_OTHERMAP)) + if (train->spawnflags & (SF_TRACKTRAIN_DISABLED | SF_TRACKTRAIN_OTHERMAP)) return; // Train doesn't turn if at a complete stop - if((train->velocity[0]==0.) && (train->velocity[1]==0.) && (train->velocity[2]==0.)) + if ((train->velocity[0]==0.) && (train->velocity[1]==0.) && (train->velocity[2]==0.)) { VectorClear(train->avelocity); gi.linkentity(train); @@ -1588,7 +1588,7 @@ void tracktrain_turn (edict_t *self) } train->avelocity[YAW] = new_speed; -// if(developer->value) +// if (developer->value) // gi.dprintf ("current yaw: %g ideal yaw: %g yaw speed: %g\n", cur_yaw, idl_yaw, self->enemy->avelocity[1]); if (train->s.angles[YAW] < 0) @@ -1602,12 +1602,12 @@ void tracktrain_turn (edict_t *self) { float roll; - if(train->moveinfo.state < STOP) + if (train->moveinfo.state < STOP) roll = -train->roll; else roll = train->roll; - if(train->spawnflags & SF_TRACKTRAIN_ROLLSPEED) + if (train->spawnflags & SF_TRACKTRAIN_ROLLSPEED) roll *= VectorLength(train->velocity)/train->moveinfo.speed; if ( train->avelocity[YAW] < -5 ) @@ -1696,13 +1696,13 @@ void tracktrain_next (edict_t *self) ent = NextPathTrack(self,self->target_ent); - if(ent && (ent->spawnflags & SF_PATH_DISABLED)) + if (ent && (ent->spawnflags & SF_PATH_DISABLED)) ent = NULL; - if(!ent) + if (!ent) { // Dead end - if(self->owner && (self->owner->svflags & SVF_MONSTER) && !self->target_ent->deathtarget ) + if (self->owner && (self->owner->svflags & SVF_MONSTER) && !self->target_ent->deathtarget ) { // For monster drivers, immediately reverse course at // dead ends (but NOT at dead ends that have a "deathtarget", @@ -1724,12 +1724,12 @@ void tracktrain_next (edict_t *self) self->moveinfo.current_speed = 0; self->moveinfo.next_speed = 0; gi.linkentity(self); - if(self->owner) + if (self->owner) { VectorClear(self->owner->velocity); gi.linkentity(self->owner); } - if(self->target_ent->deathtarget) + if (self->target_ent->deathtarget) { char *temp; temp = self->target_ent->target; @@ -1751,7 +1751,7 @@ void tracktrain_next (edict_t *self) train_angles(self); - if(!(self->spawnflags & SF_TRACKTRAIN_NOCONTROL) || !(self->spawnflags & SF_TRACKTRAIN_STARTOFF)) + if (!(self->spawnflags & SF_TRACKTRAIN_NOCONTROL) || !(self->spawnflags & SF_TRACKTRAIN_STARTOFF)) { self->think = tracktrain_think; self->think(self); @@ -1777,7 +1777,7 @@ void func_tracktrain_find (edict_t *self) return; } - if(ent->speed) + if (ent->speed) { self->moveinfo.speed = ent->speed * self->speed; self->moveinfo.accel = self->moveinfo.decel = self->moveinfo.speed; @@ -1855,14 +1855,14 @@ void func_tracktrain_find (edict_t *self) void tracktrain_use (edict_t *self, edict_t *other, edict_t *activator) { - if(self->spawnflags & SF_TRACKTRAIN_STARTOFF) + if (self->spawnflags & SF_TRACKTRAIN_STARTOFF) { - if(self->spawnflags & SF_TRACKTRAIN_NOCONTROL) + if (self->spawnflags & SF_TRACKTRAIN_NOCONTROL) { self->moveinfo.state = FAST; self->moveinfo.next_speed = self->moveinfo.speed; - if(self->sounds) { - self->s.sound = gi.soundindex(va("%sspeed%d.wav",self->source,abs(self->moveinfo.state))); + if (self->sounds) { + self->s.sound = gi.soundindex(va("%sspeed%d.wav", self->source, abs(self->moveinfo.state))); #ifdef LOOP_SOUND_ATTENUATION self->s.attenuation = self->attenuation; #endif @@ -1876,7 +1876,7 @@ void tracktrain_use (edict_t *self, edict_t *other, edict_t *activator) } else { - if(self->owner) + if (self->owner) tracktrain_disengage(self); self->moveinfo.state = STOP; self->moveinfo.next_speed = 0; @@ -1901,7 +1901,7 @@ void SP_func_tracktrain (edict_t *self) // Wheelbase determines angular velocities if (self->distance) st.distance = self->distance; - if(st.distance) + if (st.distance) self->moveinfo.distance = st.distance; else self->moveinfo.distance = 50; @@ -1909,7 +1909,7 @@ void SP_func_tracktrain (edict_t *self) // Origin rides by "height" above path_tracks if (self->height) st.height = self->height; - if(st.height) + if (st.height) self->viewheight = st.height; else self->viewheight = 4; @@ -1918,7 +1918,7 @@ void SP_func_tracktrain (edict_t *self) self->mass = 2000; // Driving position - if( (VectorLength(self->bleft) == 0) && (VectorLength(self->tright) == 0)) + if ( (VectorLength(self->bleft) == 0) && (VectorLength(self->tright) == 0)) { VectorSet(self->bleft,-8,-8,-8); VectorSet(self->tright,8,8,8); @@ -1965,7 +1965,7 @@ void SP_func_tracktrain (edict_t *self) } self->spawnflags &= ~SF_TRACKTRAIN_DISABLED; // insurance - if(self->spawnflags & SF_TRACKTRAIN_NOCONTROL) + if (self->spawnflags & SF_TRACKTRAIN_NOCONTROL) self->spawnflags |= SF_TRACKTRAIN_STARTOFF; self->use = tracktrain_use; @@ -2018,21 +2018,21 @@ void find_tracktrain (edict_t *self) // This gives game a chance to put player in place before // restarting train - if(!g_edicts[1].linkcount) + if (!g_edicts[1].linkcount) { self->nextthink = level.time + FRAMETIME; return; } train = G_Find(NULL,FOFS(targetname),self->targetname); - while(train && !train_found) + while (train && !train_found) { - if(!Q_stricmp(train->classname,"func_tracktrain")) + if (!Q_stricmp(train->classname,"func_tracktrain")) train_found = true; else train = G_Find(train,FOFS(targetname),self->targetname); } - if(!train_found) + if (!train_found) { gi.dprintf("find_tracktrain: no matching func_tracktrain with targetname=%s\n", self->targetname); @@ -2059,8 +2059,8 @@ void find_tracktrain (edict_t *self) train->source = gi.TagMalloc(10,TAG_LEVEL); Com_sprintf(train->source, 10, "train/%d/", train->sounds); } - if(train->moveinfo.state && (train->sounds > 0)) { - train->s.sound = gi.soundindex(va("%sspeed%d.wav",train->source,abs(train->moveinfo.state))); + if (train->moveinfo.state && (train->sounds > 0)) { + train->s.sound = gi.soundindex(va("%sspeed%d.wav", train->source, abs(train->moveinfo.state))); #ifdef LOOP_SOUND_ATTENUATION train->s.attenuation = train->attenuation; #endif @@ -2074,11 +2074,11 @@ void find_tracktrain (edict_t *self) // Force a wait before taking player input train->moveinfo.wait = 1; - if(self->style && (self->style <= game.maxclients) && &g_edicts[self->style].inuse) + if (self->style && (self->style <= game.maxclients) && &g_edicts[self->style].inuse) { train->owner = &g_edicts[self->style]; train->owner->vehicle = train; - if(train->owner->client) + if (train->owner->client) { train->owner->client->vehicle_framenum = level.framenum; train->owner->client->ps.pmove.pm_flags |= PMF_NO_PREDICTION; @@ -2089,7 +2089,7 @@ void find_tracktrain (edict_t *self) train->owner = NULL; gi.linkentity(train); - if(self->target) + if (self->target) { vec3_t dest; @@ -2099,7 +2099,7 @@ void find_tracktrain (edict_t *self) dest[2] += train->viewheight; VectorCopy (dest, train->moveinfo.end_origin); train_angles(train); - if(!(train->spawnflags & SF_TRACKTRAIN_NOCONTROL) || !(train->spawnflags & SF_TRACKTRAIN_STARTOFF)) + if (!(train->spawnflags & SF_TRACKTRAIN_NOCONTROL) || !(train->spawnflags & SF_TRACKTRAIN_STARTOFF)) { train->think = tracktrain_think; train->think(train); @@ -2113,7 +2113,7 @@ void find_tracktrain (edict_t *self) void SP_info_train_start (edict_t *self) { - if(!self->targetname) + if (!self->targetname) { gi.dprintf("crosslevel train with no targetname\n"); G_FreeEdict(self); diff --git a/missionpack/g_utils.c b/missionpack/g_utils.c index d187e0f..9e5a7ec 100644 --- a/missionpack/g_utils.c +++ b/missionpack/g_utils.c @@ -1258,7 +1258,7 @@ qboolean IsIdMap (void) } -//Knightmare added +// Knightmare added /* ==================== IsXatrixMap @@ -1323,7 +1323,7 @@ qboolean IsXatrixMap (void) return false; } -//Knightmare added +// Knightmare added /* ==================== IsRogueMap @@ -1450,9 +1450,9 @@ qboolean UseSpecialGoodGuyFlag (edict_t *monster) if (!monster || !monster->inuse || !monster->classname) return false; - if (!strcmp(monster->classname, "monster_gekk") + if ( !strcmp(monster->classname, "monster_gekk") || !strcmp(monster->classname, "monster_stalker") - || !strcmp(monster->classname, "monster_handler")) + || !strcmp(monster->classname, "monster_handler") ) return true; return false; @@ -1473,11 +1473,12 @@ qboolean UseRegularGoodGuyFlag (edict_t *monster) if (!monster || !monster->inuse || !monster->classname) return false; - if (strcmp(monster->classname, "monster_gekk") + if ( strcmp(monster->classname, "monster_gekk") && strcmp(monster->classname, "monster_stalker") && strcmp(monster->classname, "monster_turret") && strcmp(monster->classname, "monster_fixbot") - && strcmp(monster->classname, "monster_handler")) + && strcmp(monster->classname, "monster_handler") + && strcmp(monster->classname, "misc_insane") ) return true; return false; diff --git a/missionpack/m_brainbeta.c b/missionpack/m_brainbeta.c index 4031b60..66ad0fc 100644 --- a/missionpack/m_brainbeta.c +++ b/missionpack/m_brainbeta.c @@ -508,7 +508,7 @@ mframe_t brainbeta_frames_attack2 [] = }; mmove_t brainbeta_move_attack2 = {FRAME_attak201, FRAME_attak217, brainbeta_frames_attack2, brainbeta_run}; -//Knightmare- replaced by brainbeta_attack +// Knightmare- replaced by brainbeta_attack /* void brainbeta_melee (edict_t *self) { @@ -968,7 +968,7 @@ void SP_monster_brain_beta (edict_t *self) // self->monsterinfo.dodge = brainbeta_dodge; // pmm self->monsterinfo.attack = brainbeta_attack; - self->monsterinfo.melee = NULL; //was brainbeta_melee; + self->monsterinfo.melee = NULL; // was brainbeta_melee self->monsterinfo.sight = brainbeta_sight; self->monsterinfo.search = brainbeta_search; self->monsterinfo.idle = brainbeta_idle; diff --git a/missionpack/m_insane.c b/missionpack/m_insane.c index e3af0db..bfda8ed 100644 --- a/missionpack/m_insane.c +++ b/missionpack/m_insane.c @@ -482,7 +482,8 @@ void insane_pain (edict_t *self, edict_t *other, float kick, int damage) return; // no pain anims in nightmare // Don't go into pain frames if crucified. - if (self->spawnflags & 8) +// if (self->spawnflags & 8) + if ( (self->spawnflags & 8) || (self->moreflags & 8) ) // Knightmare- use moreflags field instead { self->monsterinfo.currentmove = &insane_move_struggle_cross; return; @@ -526,7 +527,8 @@ void insane_checkup (edict_t *self) void insane_stand (edict_t *self) { - if (self->spawnflags & 8) // If crucified +// if (self->spawnflags & 8) // If crucified + if ( (self->spawnflags & 8) || (self->moreflags & 8) ) // If crucified // Knightmare- use moreflags field instead { self->monsterinfo.currentmove = &insane_move_cross; self->monsterinfo.aiflags |= AI_STAND_GROUND; @@ -543,7 +545,8 @@ void insane_stand (edict_t *self) void insane_dead (edict_t *self) { - if (self->spawnflags & 8) +// if (self->spawnflags & 8) + if ( (self->spawnflags & 8) || (self->moreflags & 8) ) // Knightmare- use moreflags field instead { self->flags |= FL_FLY; } @@ -591,7 +594,8 @@ void insane_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damag self->deadflag = DEAD_DEAD; self->takedamage = DAMAGE_YES; - if (self->spawnflags & 8) +// if (self->spawnflags & 8) + if ( (self->spawnflags & 8) || (self->moreflags & 8) ) // Knightmare- use moreflags field instead { insane_dead (self); } @@ -663,7 +667,7 @@ void SP_misc_insane (edict_t *self) gi.linkentity (self); - if (self->spawnflags & 16) // Stand Ground + if (self->spawnflags & 16) // Stand Ground self->monsterinfo.aiflags |= AI_STAND_GROUND; self->monsterinfo.currentmove = &insane_move_stand_normal; @@ -675,8 +679,11 @@ void SP_misc_insane (edict_t *self) self->monsterinfo.scale = MODEL_SCALE; - if (self->spawnflags & 8) // Crucified ? + if (self->spawnflags & 8) // Crucified ? { + // Knightmare- Spawnflag 8 collides with SF_MONSTER_GOODGUY, and can be cleared in some instances. + // This prevents it from screwing up crucified insanes. + self->moreflags |= 8; VectorSet (self->mins, -16, 0, 0); VectorSet (self->maxs, 16, 8, 32); self->flags |= FL_NO_KNOCKBACK; diff --git a/missionpack/p_hud.c b/missionpack/p_hud.c index 6b9b919..da0397f 100644 --- a/missionpack/p_hud.c +++ b/missionpack/p_hud.c @@ -247,7 +247,7 @@ void DeathmatchScoreboardMessage (edict_t *ent, edict_t *killer) // allow new DM games to override the tag picture if (gamerules && gamerules->value) { - if(DMGame.DogTag) + if (DMGame.DogTag) DMGame.DogTag(cl_ent, killer, &tag); } //ROGUE @@ -421,7 +421,7 @@ void WhatIsIt (edict_t *ent) tr = gi.trace(start, NULL, NULL, end, ent, MASK_SHOT|CONTENTS_SLIME|CONTENTS_LAVA); if (tr.ent > world) { - if(tr.ent->common_name) + if (tr.ent->common_name) ent->client->whatsit = tr.ent->common_name; // else // ent->client->whatsit = tr.ent->classname; @@ -450,16 +450,16 @@ void WhatIsIt (edict_t *ent) VectorSubtract(who->s.origin,viewp,dir); range = VectorLength(dir); VectorMA(viewp, range, forward, entp); - if(entp[0] < who->s.origin[0] - 17) continue; - if(entp[1] < who->s.origin[1] - 17) continue; - if(entp[2] < who->s.origin[2] - 17) continue; - if(entp[0] > who->s.origin[0] + 17) continue; - if(entp[1] > who->s.origin[1] + 17) continue; - if(entp[2] > who->s.origin[2] + 17) continue; + if (entp[0] < who->s.origin[0] - 17) continue; + if (entp[1] < who->s.origin[1] - 17) continue; + if (entp[2] < who->s.origin[2] - 17) continue; + if (entp[0] > who->s.origin[0] + 17) continue; + if (entp[1] > who->s.origin[1] + 17) continue; + if (entp[2] > who->s.origin[2] + 17) continue; best = who; break; } - if(best) + if (best) { ent->client->whatsit = best->item->pickup_name; return; @@ -622,15 +622,15 @@ void G_SetStats (edict_t *ent) else if (ent->client->owned_sphere) { int sphere_time; - if(ent->client->owned_sphere->spawnflags == 1) { // defender + if (ent->client->owned_sphere->spawnflags == 1) { // defender ent->client->ps.stats[STAT_TIMER_ICON] = gi.imageindex ("p_defender"); sphere_time = sk_defender_time->value; } - else if(ent->client->owned_sphere->spawnflags == 2) { // hunter + else if (ent->client->owned_sphere->spawnflags == 2) { // hunter ent->client->ps.stats[STAT_TIMER_ICON] = gi.imageindex ("p_hunter"); sphere_time = sk_hunter_time->value; } - else if(ent->client->owned_sphere->spawnflags == 4) { // vengeance + else if (ent->client->owned_sphere->spawnflags == 4) { // vengeance ent->client->ps.stats[STAT_TIMER_ICON] = gi.imageindex ("p_vengeance"); sphere_time = sk_vengeance_time->value; } @@ -694,9 +694,9 @@ void G_SetStats (edict_t *ent) ent->client->ps.stats[STAT_SELECTED_ITEM] = ent->client->pers.selected_item; // Lazarus vehicle/tracktrain - if(ent->vehicle && !(ent->vehicle->spawnflags & 16)) + if (ent->vehicle && !(ent->vehicle->spawnflags & 16)) { - switch(ent->vehicle->moveinfo.state) + switch (ent->vehicle->moveinfo.state) { case -3: ent->client->ps.stats[STAT_SPEED] = gi.imageindex("speedr3"); break; case -2: ent->client->ps.stats[STAT_SPEED] = gi.imageindex("speedr2"); break; @@ -715,13 +715,13 @@ void G_SetStats (edict_t *ent) { if (ent->client->showscores || ent->client->showhelp || ent->client->showinventory) ent->client->whatsit = NULL; - else if(!(level.framenum % 5)) // only update every 1/2 second + else if (!(level.framenum % 5)) // only update every 1/2 second { char *temp = ent->client->whatsit; ent->client->whatsit = NULL; WhatIsIt(ent); - if(ent->client->whatsit && !temp) + if (ent->client->whatsit && !temp) WhatsIt(ent); } } @@ -778,7 +778,7 @@ void G_SetStats (edict_t *ent) ent->client->ps.stats[STAT_SPECTATOR] = 0; - if(ent->client->zoomed) + if (ent->client->zoomed) ent->client->ps.stats[STAT_ZOOM] = gi.imageindex("zoom"); else ent->client->ps.stats[STAT_ZOOM] = 0; diff --git a/missionpack/p_view.c b/missionpack/p_view.c index 19e7766..e017182 100644 --- a/missionpack/p_view.c +++ b/missionpack/p_view.c @@ -862,7 +862,7 @@ void P_FallingDamage (edict_t *ent) } else // if delta > 7 #ifndef FMOD_FOOTSTEPS - ent->s.event = EV_LOUDSTEP; //Knightmare- loud footstep for softer landing + ent->s.event = EV_LOUDSTEP; // Knightmare- loud footstep for softer landing #else FootStep(ent); #endif @@ -1226,7 +1226,7 @@ void G_SetClientEvent (edict_t *ent) if ( (level.framenum % 10) == 0 ) { #ifndef FMOD_FOOTSTEPS - ent->s.event = EV_WADE_MUD; // Knightmare- move this client-side + ent->s.event = EV_WADE_MUD; // Knightmare- move this client-side #else if ( rand() & 1 ) // gi.sound(ent, CHAN_BODY, gi.soundindex("mud/wade_mud1.wav"), 1, ATTN_NORM, 0); @@ -1263,16 +1263,16 @@ void G_SetClientEvent (edict_t *ent) #endif } // Ladder sounds - else if( (level.framenum % 4) == 0) + else if ( (level.framenum % 4) == 0) { - if(!ent->waterlevel && (ent->movetype != MOVETYPE_NOCLIP) && (fabs(ent->velocity[2]) > 50)) + if (!ent->waterlevel && (ent->movetype != MOVETYPE_NOCLIP) && (fabs(ent->velocity[2]) > 50)) { vec3_t end, forward; trace_t tr; AngleVectors(ent->s.angles,forward,NULL,NULL); VectorMA(ent->s.origin,2,forward,end); tr = gi.trace(ent->s.origin,ent->mins,ent->maxs,end,ent,CONTENTS_LADDER); - if(tr.fraction < 1.0) + if (tr.fraction < 1.0) #ifndef FMOD_FOOTSTEPS ent->s.event = EV_CLIMB_LADDER; // Knightmare- move Lazarus footsteps client-side #else @@ -1378,7 +1378,7 @@ void G_SetClientFrame (edict_t *ent) qboolean duck, run; qboolean floor; - if (ent->s.modelindex != (MAX_MODELS-1)) //was 255 + if (ent->s.modelindex != (MAX_MODELS-1)) // was 255 return; // not in the player model client = ent->client; @@ -1444,7 +1444,7 @@ newanim: client->anim_run = run; // Knightmare- added swimming check - if (!ent->groundentity && (!floor || ent->waterlevel > 2)) //CDawg modify this + if (!ent->groundentity && (!floor || ent->waterlevel > 2)) // CDawg modify this { client->anim_priority = ANIM_JUMP; if (ent->s.frame != FRAME_jump2) diff --git a/missionpack/q_shared.h b/missionpack/q_shared.h index e41f8a8..e12158a 100644 --- a/missionpack/q_shared.h +++ b/missionpack/q_shared.h @@ -1282,7 +1282,7 @@ ROGUE - VERSIONS #define CS_PAKFILE (CS_GENERAL+MAX_GENERAL) #define MAX_CONFIGSTRINGS (CS_PAKFILE+1) -//Knightmare- hacked configstring offsets for backward compatiblity +// Knightmare- hacked configstring offsets for backward compatiblity #define OLD_CS_SOUNDS (CS_MODELS+OLD_MAX_MODELS) #define OLD_CS_IMAGES (OLD_CS_SOUNDS+OLD_MAX_SOUNDS) #define OLD_CS_LIGHTS (OLD_CS_IMAGES+OLD_MAX_IMAGES) @@ -1290,7 +1290,7 @@ ROGUE - VERSIONS #define OLD_CS_PLAYERSKINS (OLD_CS_ITEMS+MAX_ITEMS) #define OLD_CS_GENERAL (OLD_CS_PLAYERSKINS+MAX_CLIENTS) #define OLD_MAX_CONFIGSTRINGS (OLD_CS_GENERAL+MAX_GENERAL) -//end Knightmare +// end Knightmare //==============================================