in g_team.c:
void Team_DroppedFlagThink(gentity_t *ent) {
if( ent->item->giTag == PW_REDFLAG ) {
G_Script_ScriptEvent( &g_entities[ent->s.otherEntityNum], "trigger", "returned" );
Team_ReturnFlagSound( ent, TEAM_AXIS );
Team_ResetFlag( ent );
if( level.gameManager ) {
G_Script_ScriptEvent( level.gameManager, "trigger", "axis_object_returned" );
}
trap_SendServerCommand(-1, "cp \"Axis have returned the objective!\" 2");
} else if( ent->item->giTag == PW_BLUEFLAG ) {
G_Script_ScriptEvent( &g_entities[ent->s.otherEntityNum], "trigger", "returned" );
Team_ReturnFlagSound( ent, TEAM_ALLIES );
Team_ResetFlag( ent );
if( level.gameManager ) {
G_Script_ScriptEvent( level.gameManager, "trigger", "allied_object_returned" );
}
// trap_SendServerCommand(-1, "cp \"Allies have returned the objective!\" 2");
}
// Reset Flag will delete this entity
}
Without having any clue of the inner workings of anything , it seems to me like the line near the end should NOT be comented out? Would putting that back in be considered a bugfix, not change anything or actually break things?
in g_stats.c:
void G_LogKill( gentity_t* ent, weapon_t weap ) {
weap = BG_DuplicateWeapon(weap);
if(!ent->client) {
return;
}
// SNISERTODO
if(ent->client->sess.playerType == PC_SOLDIER) {
int i, j;
qboolean pass = qtrue;
ent->client->soliderKillTimes[ent->client->soldierKillMarker++] = level.timeCurrent;
if ( ent->client->soldierKillMarker >= NUM_SOLDIERKILL_TIMES ) {
ent->client->soldierKillMarker = 0;
}
for( i = 0, j = ent->client->soldierKillMarker; i < NUM_SOLDIERKILL_TIMES; i++ ) {
if( !ent->client->soliderKillTimes[j] || (ent->client->soliderKillTimes[j] < level.timeCurrent - SOLDIERKILL_MAXTIME) ) {
pass = qfalse;
break;
}
if( ++j == NUM_SOLDIERKILL_TIMES ) {
j = 0;
}
}
}
ent->client->pers.playerStats.weaponStats[weap].kills++;
trap_PbStat ( ent - g_entities , "kill" ,
va ( "%d %d %d" , ent->client->sess.sessionTeam , ent->client->sess.playerType , weap ) ) ;
}
Elsewhere NUM_SOLDIERKILL_TIMES is defined as 10, and SOLDIERKILL_MAXTIME as 60000.
Now this seems to be a leftover, as the variable pass isn’t actually used. So my question is, what exactly does it check for? Could someone less confused than me explain it in plain text?
(I’d like to change it so any class gets an battle sense XP bonus if they kill more than X enemies in Y seconds, but to do that I’d first have to understand this heh :D)
