Gun stats, more cleanup

This commit is contained in:
Dino 2023-09-03 09:48:24 -04:00
parent cbf9ebbba3
commit 4f75e08261
5 changed files with 170 additions and 96 deletions

View file

@ -453,7 +453,7 @@ void PlaceHolder( edict_t * ent ); // p_weapon.c
void ShellTouch(edict_t * self, edict_t * other, cplane_t * plane, csurface_t * surf)
{
if (self->owner->client->curr_weap == M3_NUM)
if (self->owner->client->curr_weap == IT_WEAPON_M3)
gi.sound(self, CHAN_WEAPON, gi.soundindex("weapons/shellhit1.wav"), 1, ATTN_STATIC, 0);
else if (random() < 0.5)
gi.sound(self, CHAN_WEAPON, gi.soundindex("weapons/tink1.wav"), 0.2, ATTN_STATIC, 0);
@ -519,30 +519,30 @@ void EjectShell(edict_t * self, vec3_t start, int toggle)
// zucc spent a fair amount of time hacking these until they look ok,
// several of them could be improved however.
if (self->client->curr_weap == MK23_NUM) {
if (self->client->curr_weap == IT_WEAPON_MK23) {
VectorMA(start, left ? -7 : .4, right, start);
VectorMA(start, left ? 5 : 2, forward, start);
VectorMA(start, left ? -10 : -8, up, start);
} else if (self->client->curr_weap == M4_NUM) {
} else if (self->client->curr_weap == IT_WEAPON_M4) {
VectorMA(start, left ? -10 : 5, right, start);
VectorMA(start, left ? 6 : 12, forward, start);
VectorMA(start, left ? -9 : -11, up, start);
} else if (self->client->curr_weap == MP5_NUM) {
} else if (self->client->curr_weap == IT_WEAPON_MP5) {
VectorMA(start, left ? -10 : 6, right, start);
VectorMA(start, left ? 6 : 8, forward, start);
VectorMA(start, left ? -9 : -10, up, start);
} else if (self->client->curr_weap == SNIPER_NUM) {
} else if (self->client->curr_weap == IT_WEAPON_SNIPER) {
VectorMA(start, fix * 11, right, start);
VectorMA(start, 2, forward, start);
VectorMA(start, -11, up, start);
} else if (self->client->curr_weap == M3_NUM) {
} else if (self->client->curr_weap == IT_WEAPON_M3) {
VectorMA(start, left ? -9 : 3, right, start);
VectorMA(start, left ? 4 : 4, forward, start);
VectorMA(start, left ? -1 : -1, up, start);
}
else if (self->client->curr_weap == DUAL_NUM) {
else if (self->client->curr_weap == IT_WEAPON_DUALMK23) {
if (self->client->pers.hand == LEFT_HANDED)
VectorMA(start, ((toggle == 1) ? 8 : -8), right, start);
else
@ -654,9 +654,9 @@ void EjectShell(edict_t * self, vec3_t start, int toggle)
VectorCopy(start, shell->old_origin);
if (fix == 0) // we want some velocity on those center handed ones
fix = 1;
if (self->client->curr_weap == SNIPER_NUM)
if (self->client->curr_weap == IT_WEAPON_SNIPER)
VectorMA(shell->velocity, fix * (-35 + random() * -60), right, shell->velocity);
else if (self->client->curr_weap == DUAL_NUM) {
else if (self->client->curr_weap == IT_WEAPON_DUALMK23) {
if (self->client->pers.hand == LEFT_HANDED)
VectorMA(shell->velocity,
(toggle == 1 ? 1 : -1) * (35 + random() * 60), right, shell->velocity);
@ -666,7 +666,7 @@ void EjectShell(edict_t * self, vec3_t start, int toggle)
} else
VectorMA(shell->velocity, fix * (35 + random() * 60), right, shell->velocity);
VectorMA(shell->avelocity, 500, right, shell->avelocity);
if (self->client->curr_weap == SNIPER_NUM)
if (self->client->curr_weap == IT_WEAPON_SNIPER)
VectorMA(shell->velocity, 60 + 40, up, shell->velocity);
else
VectorMA(shell->velocity, 60 + random() * 90, up, shell->velocity);
@ -674,9 +674,9 @@ void EjectShell(edict_t * self, vec3_t start, int toggle)
shell->movetype = MOVETYPE_BOUNCE;
shell->solid = SOLID_BBOX;
if( (self->client->curr_weap == M3_NUM) || (self->client->curr_weap == HC_NUM) )
if( (self->client->curr_weap == IT_WEAPON_M3) || (self->client->curr_weap == IT_WEAPON_HANDCANNON) )
shell->s.modelindex = gi.modelindex("models/weapons/shell/tris2.md2");
else if( (self->client->curr_weap == SNIPER_NUM) || (self->client->curr_weap == M4_NUM) )
else if( (self->client->curr_weap == IT_WEAPON_SNIPER) || (self->client->curr_weap == IT_WEAPON_M4) )
shell->s.modelindex = gi.modelindex("models/weapons/shell/tris3.md2");
else
shell->s.modelindex = gi.modelindex("models/weapons/shell/tris.md2");
@ -798,7 +798,7 @@ void AttachToEntity( edict_t *self, edict_t *onto )
UpdateAttachedPos( self );
}
qboolean CanBeAttachedTo( const edict_t *ent )
bool CanBeAttachedTo( const edict_t *ent )
{
return (ent && ( (Q_strnicmp( ent->classname, "func_door", 9 ) == 0)
|| (Q_stricmp( ent->classname, "func_plat" ) == 0)
@ -810,7 +810,7 @@ qboolean CanBeAttachedTo( const edict_t *ent )
void AddDecal(edict_t * self, trace_t * tr)
{
edict_t *decal, *dec;
qboolean attached;
bool attached;
if (bholelimit->value < 1)
return;
@ -862,7 +862,7 @@ void AddSplat(edict_t * self, vec3_t point, trace_t * tr)
{
edict_t *splat, *spt;
float r;
qboolean attached;
bool attached;
if (splatlimit->value < 1)
return;
@ -966,56 +966,56 @@ void GetAmmo( edict_t *ent, char *buf )
if( IS_ALIVE(ent) && ent->client->weapon )
{
switch( ent->client->curr_weap )
switch( ent->client->pers.weapon->id )
{
case MK23_NUM:
case IT_WEAPON_MK23:
sprintf( buf, "%d round%s (%d extra mag%s)",
ent->client->mk23_rds, ent->client->mk23_rds == 1 ? "" : "s",
ent->client->inventory[ent->client->ammo_index],
ent->client->inventory[ent->client->ammo_index] == 1 ? "" : "s");
return;
case MP5_NUM:
case IT_WEAPON_MP5:
sprintf( buf, "%d round%s (%d extra mag%s)",
ent->client->mp5_rds, ent->client->mp5_rds == 1 ? "" : "s",
ent->client->inventory[ent->client->ammo_index],
ent->client->inventory[ent->client->ammo_index] == 1 ? "" : "s");
return;
case M4_NUM:
case IT_WEAPON_M4:
sprintf( buf, "%d round%s (%d extra mag%s)",
ent->client->m4_rds, ent->client->m4_rds == 1 ? "" : "s",
ent->client->inventory[ent->client->ammo_index],
ent->client->inventory[ent->client->ammo_index] == 1 ? "" : "s");
return;
case M3_NUM:
case IT_WEAPON_M3:
sprintf( buf, "%d shell%s (%d extra shell%s)",
ent->client->shot_rds, ent->client->shot_rds == 1 ? "" : "s",
ent->client->inventory[ent->client->ammo_index],
ent->client->inventory[ent->client->ammo_index] == 1 ? "" : "s");
return;
case HC_NUM:
case IT_WEAPON_HANDCANNON:
sprintf( buf, "%d shell%s (%d extra shell%s)",
ent->client->cannon_rds, ent->client->cannon_rds == 1 ? "" : "s",
ent->client->inventory[ent->client->ammo_index],
ent->client->inventory[ent->client->ammo_index] == 1 ? "" : "s");
return;
case SNIPER_NUM:
case IT_WEAPON_SNIPER:
sprintf( buf, "%d round%s (%d extra round%s)",
ent->client->sniper_rds, ent->client->sniper_rds == 1 ? "" : "s",
ent->client->inventory[ent->client->ammo_index],
ent->client->inventory[ent->client->ammo_index] == 1 ? "" : "s");
return;
case DUAL_NUM:
case IT_WEAPON_DUALMK23:
sprintf( buf, "%d round%s (%d extra mag%s)",
ent->client->dual_rds, ent->client->dual_rds == 1 ? "" : "s",
ent->client->inventory[ent->client->ammo_index],
ent->client->inventory[ent->client->ammo_index] == 1 ? "" : "s");
return;
case KNIFE_NUM:
ammo = INV_AMMO( ent, KNIFE_NUM );
case IT_WEAPON_KNIFE:
ammo = INV_AMMO( ent, IT_WEAPON_KNIFE );
sprintf( buf, "%d kni%s", ammo, (ammo == 1) ? "fe" : "ves" );
return;
case GRENADE_NUM:
ammo = INV_AMMO( ent, GRENADE_NUM );
case IT_WEAPON_GRENADES:
ammo = INV_AMMO( ent, IT_WEAPON_GRENADES );
sprintf( buf, "%d grenade%s", ammo, (ammo == 1) ? "" : "s" );
return;
}

View file

@ -977,13 +977,11 @@ void JoinTeam (edict_t * ent, int desired_team, int skip_menuclose)
if (ctf->value)
{
ent->client->resp.ctf_state = CTF_STATE_START;
gi.bprintf (PRINT_HIGH, "%s %s %s.\n", ent->client->pers.netname, a, CTFTeamName(desired_team));
IRC_printf (IRC_T_GAME, "%n %s %n.", ent->client->pers.netname, a, CTFTeamName(desired_team));
gi.LocBroadcast_Print (PRINT_HIGH, "%s %s %s.\n", ent->client->pers.netname, a, CTFTeamName(desired_team));
}
else
{
gi.bprintf (PRINT_HIGH, "%s %s %s.\n", ent->client->pers.netname, a, TeamName(desired_team));
IRC_printf (IRC_T_GAME, "%n %s %n.", ent->client->pers.netname, a, TeamName(desired_team));
gi.LocBroadcast_Print (PRINT_HIGH, "%s %s %s.\n", ent->client->pers.netname, a, TeamName(desired_team));
}
ent->client->resp.joined_team = level.realFramenum;
@ -1044,8 +1042,7 @@ void LeaveTeam (edict_t * ent)
genderstr = GENDER_STR(ent, "his", "her", "its");
gi.bprintf (PRINT_HIGH, "%s left %s team.\n", ent->client->pers.netname, genderstr);
IRC_printf (IRC_T_GAME, "%n left %n team.", ent->client->pers.netname, genderstr);
gi.LocBroadcast_Print (PRINT_HIGH, "%s left %s team.\n", ent->client->pers.netname, genderstr);
MM_LeftTeam( ent );
EspLeaderLeftTeam ( ent );
@ -1203,8 +1200,9 @@ void OpenWeaponMenu (edict_t * ent)
if ((int)wp_flags->value & WPF_MASK)
{
for (menuEntry = menu_items, i = 0; i < count; i++, menuEntry++) {
if (!WPF_ALLOWED(menuEntry->itemNum))
continue;
// TOD: Work in weapon bans
// if (!WPF_ALLOWED(menuEntry->itemNum))
// continue;
weapmenu[pos].text = menu_itemnames[menuEntry->itemNum];
weapmenu[pos].SelectFunc = menuEntry->SelectFunc;
@ -1346,7 +1344,7 @@ void CleanLevel ()
if (!ent->classname)
continue;
switch (ent->typeNum) {
case MK23_NUM:
case IT_WEAPON_MK23:
case IT_WEAPON_MP5:
case IT_WEAPON_M4:
case IT_WEAPON_M3:
@ -1664,14 +1662,15 @@ static void SpawnPlayers(void)
// make sure teamplay spawners always have some weapon, warmup starts only after weapon selected
if (!ent->client->pers.chosenWeapon) {
if (WPF_ALLOWED(IT_WEAPON_MP5)) {
ent->client->pers.chosenWeapon = GetItemByIndex(IT_WEAPON_MP5);
} else if (WPF_ALLOWED(MK23_NUM)) {
ent->client->pers.chosenWeapon = GetItemByIndex(MK23_NUM);
} else if (WPF_ALLOWED(IT_WEAPON_KNIFE)) {
ent->client->pers.chosenWeapon = GetItemByIndex(IT_WEAPON_KNIFE);
} else {
ent->client->pers.chosenWeapon = GetItemByIndex(MK23_NUM);
// TODO: Work in weapon bans
// if (WPF_ALLOWED(IT_WEAPON_MP5)) {
// ent->client->pers.chosenWeapon = GetItemByIndex(IT_WEAPON_MP5);
// } else if (WPF_ALLOWED(IT_WEAPON_MK23)) {
// ent->client->pers.chosenWeapon = GetItemByIndex(IT_WEAPON_MK23);
// } else if (WPF_ALLOWED(IT_WEAPON_KNIFE)) {
// ent->client->pers.chosenWeapon = GetItemByIndex(IT_WEAPON_KNIFE);
// } else {
ent->client->pers.chosenWeapon = GetItemByIndex(IT_WEAPON_MK23);
}
}
@ -1862,11 +1861,9 @@ void MakeAllLivePlayersObservers (void)
void PrintScores (void)
{
if (teamCount == 3) {
gi.bprintf (PRINT_HIGH, "Current score is %s: %d to %s: %d to %s: %d\n", TeamName (TEAM1), teams[TEAM1].score, TeamName (TEAM2), teams[TEAM2].score, TeamName (TEAM3), teams[TEAM3].score);
IRC_printf (IRC_T_TOPIC, "Current score on map %n is %n: %k to %n: %k to %n: %k", level.mapname, TeamName (TEAM1), teams[TEAM1].score, TeamName (TEAM2), teams[TEAM2].score, TeamName (TEAM3), teams[TEAM3].score);
gi.LocBroadcast_Print (PRINT_HIGH, "Current score is %s: %d to %s: %d to %s: %d\n", TeamName (TEAM1), teams[TEAM1].score, TeamName (TEAM2), teams[TEAM2].score, TeamName (TEAM3), teams[TEAM3].score);
} else {
gi.bprintf (PRINT_HIGH, "Current score is %s: %d to %s: %d\n", TeamName (TEAM1), teams[TEAM1].score, TeamName (TEAM2), teams[TEAM2].score);
IRC_printf (IRC_T_TOPIC, "Current score on map %n is %n: %k to %n: %k", level.mapname, TeamName (TEAM1), teams[TEAM1].score, TeamName (TEAM2), teams[TEAM2].score);
gi.LocBroadcast_Print (PRINT_HIGH, "Current score is %s: %d to %s: %d\n", TeamName (TEAM1), teams[TEAM1].score, TeamName (TEAM2), teams[TEAM2].score);
}
}
@ -1890,8 +1887,7 @@ bool CheckTimelimit( void )
MakeAllLivePlayersObservers();
ctfgame.halftime = 0;
} else {
gi.bprintf( PRINT_HIGH, "Timelimit hit.\n" );
IRC_printf( IRC_T_GAME, "Timelimit hit." );
gi.LocBroadcast_Print( PRINT_HIGH, "Timelimit hit.\n" );
if (!(gameSettings & GS_ROUNDBASED))
ResetPlayers();
EndDMLevel();
@ -1942,8 +1938,7 @@ static bool CheckRoundTimeLimit( void )
{
int winTeam = NOTEAM;
gi.bprintf( PRINT_HIGH, "Round timelimit hit.\n" );
IRC_printf( IRC_T_GAME, "Round timelimit hit." );
gi.LocBroadcast_Print( PRINT_HIGH, "Round timelimit hit.\n" );
winTeam = CheckForForcedWinner();
if (WonGame( winTeam ))
@ -2004,8 +1999,7 @@ static bool CheckRoundLimit( void )
team_round_going = team_round_countdown = team_game_going = 0;
MakeAllLivePlayersObservers();
} else {
gi.bprintf( PRINT_HIGH, "Roundlimit hit.\n" );
IRC_printf( IRC_T_GAME, "Roundlimit hit." );
gi.LocBroadcast_Print( PRINT_HIGH, "Roundlimit hit.\n" );
EndDMLevel();
}
team_round_going = team_round_countdown = team_game_going = 0;
@ -2023,12 +2017,10 @@ int WonGame (int winner)
int i;
char arg[64];
gi.bprintf (PRINT_HIGH, "The round is over:\n");
IRC_printf (IRC_T_GAME, "The round is over:");
gi.LocBroadcast_Print (PRINT_HIGH, "The round is over:\n");
if (winner == WINNER_TIE)
{
gi.bprintf (PRINT_HIGH, "It was a tie, no points awarded!\n");
IRC_printf (IRC_T_GAME, "It was a tie, no points awarded!");
gi.LocBroadcast_Print (PRINT_HIGH, "It was a tie, no points awarded!\n");
if(use_warnings->value)
gi.sound(&g_edicts[0], CHAN_VOICE | CHAN_NO_PHS_ADD, level.snd_teamwins[0], 1.0, ATTN_NONE, 0.0);
@ -2045,17 +2037,15 @@ int WonGame (int winner)
if (player)
{
gi.bprintf (PRINT_HIGH, "%s was victorious!\n",
gi.LocBroadcast_Print (PRINT_HIGH, "%s was victorious!\n",
player->client->pers.netname);
IRC_printf (IRC_T_GAME, "%n was victorious!",
player->client->pers.netname);
TourneyWinner (player);
}
}
else
{
gi.bprintf (PRINT_HIGH, "%s won!\n", TeamName(winner));
IRC_printf (IRC_T_GAME, "%n won!", TeamName(winner));
gi.LocBroadcast_Print (PRINT_HIGH, "%s won!\n", TeamName(winner));
// AQ:TNG Igor[Rock] changing sound dir
if(use_warnings->value)
gi.sound(&g_edicts[0], CHAN_VOICE | CHAN_NO_PHS_ADD, level.snd_teamwins[winner], 1.0, ATTN_NONE, 0.0);
@ -2295,7 +2285,7 @@ int CheckTeamRules (void)
strftime( ltm, 64, "%Y%m%d-%H%M%S", now );
snprintf( mvdstring, sizeof(mvdstring), "mvdrecord %s-%s\n", ltm, level.mapname );
gi.AddCommandString( mvdstring );
gi.bprintf( PRINT_HIGH, "Starting MVD recording to file %s-%s.mvd2\n", ltm, level.mapname );
gi.LocBroadcast_Print( PRINT_HIGH, "Starting MVD recording to file %s-%s.mvd2\n", ltm, level.mapname );
}
// JBravo: End MVD2
}

View file

@ -1621,13 +1621,28 @@ extern int sm_meat_index;
extern int snd_fry;
// Action Add
extern cvar_t *teamdm;
extern cvar_t *teamdm_respawn;
extern cvar_t *respawn_effect;
extern cvar_t *use_warnings;
extern cvar_t *use_killcounts;
extern cvar_t *use_rewards;
extern cvar_t *motd_time;
extern cvar_t *actionmaps;
extern cvar_t *roundtimelimit;
extern cvar_t *maxteamkills;
extern cvar_t *twbanrounds;
extern cvar_t *tkbanrounds;
extern cvar_t *limchasecam;
extern cvar_t *roundlimit;
extern int snd_silencer;
extern int snd_headshot;
extern int snd_vesthit;
extern int snd_knifethrow;
extern int snd_kick;
extern int snd_noammo;
extern int meansOfDeath;
extern mod_id_t meansOfDeath;
// zucc for hitlocation of death
extern int locOfDeath;
// stop an armor piercing round that hits a vest
@ -1944,14 +1959,39 @@ constexpr item_id_t weap_ids[] = {
IT_WEAPON_SNIPER
};
typedef enum {
enum damage_loc_t {
LOC_HDAM, // head
LOC_CDAM, // chest
LOC_SDAM, // stomach
LOC_LDAM, // legs
LOC_KVLR_HELMET, // kevlar helmet Freud, for %D
LOC_KVLR_VEST, // kevlar vest Freud, for %D
LOC_NO, // Shot by shotgun or handcannon
LOC_MAX // must be last
};
enum award_t {
ACCURACY,
IMPRESSIVE,
EXCELLENT
};
enum gender_t {
GENDER_MALE,
GENDER_FEMALE,
GENDER_NEUTRAL
} gender_t;
};
#define GENDER_STR( ent, he, she, it ) (((ent)->client->pers.gender == GENDER_MALE) ? he : (((ent)->client->pers.gender == GENDER_FEMALE) ? she : it))
struct gunStats_t
{
int shots; //Number of shots
int hits; //Number of hits
int headshots; //Number of headshots
int kills; //Number of kills
int damage; //Damage dealt
};
//======================================================================
// Action Add End
@ -2824,6 +2864,32 @@ struct client_respawn_t
aqteam_t team;
int32_t sniper_mode;
int32_t idletime;
int32_t totalidletime;
int32_t tourneynumber;
edict_t *kickvote;
char *mapvote; // pointer to map voted on (if any)
char *cvote; // pointer to config voted on (if any)
bool scramblevote; // want scramble
int32_t ignore_time; // framenum when the player called ignore - to prevent spamming
int32_t stat_mode; // Automatical Send of statistics to client
int32_t stat_mode_intermission;
int32_t kills;
int32_t shotsTotal; //Total number of shots
int32_t hitsTotal; //Total number of hits
int32_t streakKills; //Kills in a row
int32_t roundStreakKills; //Kills in a row in that round
int32_t streakHS; //Headshots in a Row
int32_t streakKillsHighest; //Highest kills in a row
int32_t streakHSHighest; //Highest headshots in a Row
int32_t hitsLocations[LOC_MAX]; //Number of hits for different locations
gunStats_t gunstats[MOD_TOTAL]; //Number of shots/hits for different guns, adjusted to MOD_TOTAL to allow grenade, kick and punch stats
};
// Action Add
@ -3067,6 +3133,7 @@ struct gclient_t
gtime_t last_attacker_time;
// Action Add
char ip[64]; // For banning IPs
int32_t unique_item_total;
int32_t unique_weapon_total;

View file

@ -153,6 +153,22 @@ cvar_t *ai_movement_disabled;
// Action Add
//======================================================================
cvar_t *teamdm;
cvar_t *teamdm_respawn;
cvar_t *respawn_effect;
cvar_t *use_warnings;
cvar_t *use_killcounts;
cvar_t *use_rewards;
cvar_t *motd_time;
cvar_t *actionmaps;
cvar_t *roundtimelimit;
cvar_t *maxteamkills;
cvar_t *twbanrounds;
cvar_t *tkbanrounds;
cvar_t *limchasecam;
cvar_t *roundlimit;
cvar_t *allitem;
cvar_t *allweapon;
cvar_t *unique_items;
@ -163,6 +179,7 @@ cvar_t *weapon_respawn;
cvar_t *ammo_respawn;
cvar_t *hc_single;
cvar_t *use_punch;
cvar_t *radiolog;
cvar_t *radio_max;
cvar_t *radio_time;
cvar_t *radio_ban;

View file

@ -118,9 +118,6 @@ void Add_Frag(edict_t * ent, int mod)
gi.LocBroadcast_Print(PRINT_MEDIUM,
"%s has %d kills in a row and receives %d frags for the kill!\n",
ent->client->pers.netname, ent->client->resp.streakKills, frags );
IRC_printf(IRC_T_GAME,
"%n has %k kills in a row and receives %k frags for the kill!",
ent->client->pers.netname, ent->client->resp.streakKills, frags );
}
ent->client->resp.score += frags;
@ -181,7 +178,7 @@ void Subtract_Frag(edict_t * ent)
teams[ent->client->resp.team].score--;
}
void Add_Death( edict_t *ent, qboolean end_streak )
void Add_Death( edict_t *ent, bool end_streak )
{
if( in_warmup )
return;
@ -616,7 +613,6 @@ void ClientObituary(edict_t *self, edict_t *inflictor, edict_t *attacker, mod_t
sprintf(death_msg, "%s %s %s\n",
self->client->pers.netname, special_message, self->client->attacker->client->pers.netname);
PrintDeathMessage(death_msg, self);
IRC_printf(IRC_T_KILL, death_msg);
AddKilledPlayer(self->client->attacker, self);
#if USE_AQTION
@ -648,7 +644,6 @@ void ClientObituary(edict_t *self, edict_t *inflictor, edict_t *attacker, mod_t
{
sprintf( death_msg, "%s %s\n", self->client->pers.netname, message );
PrintDeathMessage(death_msg, self );
IRC_printf( IRC_T_DEATH, death_msg );
if (!teamplay->value || team_round_going || !ff_afterround->value) {
Subtract_Frag( self );
@ -995,7 +990,6 @@ void ClientObituary(edict_t *self, edict_t *inflictor, edict_t *attacker, mod_t
sprintf(death_msg, "%s%s %s%s\n", self->client->pers.netname,
message, attacker->client->pers.netname, message2);
PrintDeathMessage(death_msg, self);
IRC_printf(IRC_T_KILL, death_msg);
AddKilledPlayer(attacker, self);
#if USE_AQTION
@ -1026,7 +1020,6 @@ void ClientObituary(edict_t *self, edict_t *inflictor, edict_t *attacker, mod_t
sprintf(death_msg, "%s died\n", self->client->pers.netname);
PrintDeathMessage(death_msg, self);
IRC_printf(IRC_T_DEATH, death_msg);
#if USE_AQTION
if (stat_logs->value) { // Only create stats logs if stat_logs is 1
@ -1049,7 +1042,7 @@ void EjectItem(edict_t * ent, gitem_t * item)
ent->client->v_angle[YAW] -= spread;
drop = Drop_Item(ent, item);
ent->client->v_angle[YAW] += spread;
drop->spawnflags = DROPPED_PLAYER_ITEM;
drop->spawnflags = SPAWNFLAG_ITEM_DROPPED_PLAYER;
}
}
@ -1065,7 +1058,7 @@ void EjectWeapon(edict_t * ent, gitem_t * item)
ent->client->v_angle[YAW] -= spread;
drop = Drop_Item(ent, item);
ent->client->v_angle[YAW] += spread;
drop->spawnflags = DROPPED_PLAYER_ITEM;
drop->spawnflags = SPAWNFLAG_ITEM_DROPPED_PLAYER;
if (!in_warmup)
drop->think = temp_think_specweap;
}
@ -1097,7 +1090,7 @@ void EjectMedKit( edict_t *ent, int medkit )
void TossItemsOnDeath(edict_t * ent)
{
gitem_t *item;
qboolean quad = false;
bool quad = false;
int i;
// don't bother dropping stuff when allweapons/items is active
@ -1115,15 +1108,15 @@ void TossItemsOnDeath(edict_t * ent)
if (allweapon->value)// don't drop weapons if allweapons is on
return;
if (WPF_ALLOWED(MK23_NUM) && WPF_ALLOWED(DUAL_NUM)) {
//if (WPF_ALLOWED(MK23_NUM) && WPF_ALLOWED(IT_WEAPON_DUALMK23)) {
// give the player a dual pistol so they can be sure to drop one
item = GET_ITEM(DUAL_NUM);
ent->client->inventory[ITEM_INDEX(item)]++;
EjectItem(ent, item);
}
item = GET_ITEM(IT_WEAPON_DUALMK23);
ent->client->inventory[ITEM_INDEX(item)]++;
EjectItem(ent, item);
//}
// check for every item we want to drop when a player dies
for (i = MP5_NUM; i < DUAL_NUM; i++) {
for (i = MP5_NUM; i < IT_WEAPON_DUALMK23; i++) {
item = GET_ITEM( i );
while (ent->client->inventory[ITEM_INDEX( item )] > 0) {
ent->client->inventory[ITEM_INDEX( item )]--;
@ -1131,35 +1124,35 @@ void TossItemsOnDeath(edict_t * ent)
}
}
item = GET_ITEM(KNIFE_NUM);
item = GET_ITEM(IT_WEAPON_KNIFE);
if (ent->client->inventory[ITEM_INDEX(item)] > 0) {
EjectItem(ent, item);
}
// special items
if (!DMFLAGS(DF_QUAD_DROP))
quad = false;
else
quad = (ent->client->quad_framenum > (level.framenum + HZ));
// if (!DMFLAGS(DF_QUAD_DROP))
// quad = false;
// else
// quad = (ent->client->quad_framenum > (level.framenum + HZ));
}
void TossClientWeapon(edict_t * self)
{
gitem_t *item;
edict_t *drop;
qboolean quad;
bool quad;
float spread;
item = self->client->weapon;
item = self->client->pers.weapon->id;
if (!self->client->inventory[self->client->ammo_index])
item = NULL;
if (item && (strcmp(item->pickup_name, "Blaster") == 0))
item = NULL;
if (!DMFLAGS(DF_QUAD_DROP))
quad = false;
else
quad = (self->client->quad_framenum > (level.framenum + HZ));
// if (!DMFLAGS(DF_QUAD_DROP))
// quad = false;
// else
// quad = (self->client->quad_framenum > (level.framenum + HZ));
if (item && quad)
spread = 22.5;
@ -1170,7 +1163,7 @@ void TossClientWeapon(edict_t * self)
self->client->v_angle[YAW] -= spread;
drop = Drop_Item(self, item);
self->client->v_angle[YAW] += spread;
drop->spawnflags = DROPPED_PLAYER_ITEM;
drop->spawnflags = SPAWNFLAG_ITEM_DROPPED_PLAYER;
}
}
@ -3719,8 +3712,15 @@ bool ClientConnect(edict_t *ent, char *userinfo, const char *social_id, bool isB
}
#endif
// check for a spectator
// define value
char value[MAX_INFO_VALUE] = { 0 };
if (gi.Info_ValueForKey(userinfo, "ip", value, sizeof(value))){
// Append to pers.ip
Q_strlcat(ent->client->pers.ip, value, sizeof(ent->client->pers.ip));
}
// check for a spectator
gi.Info_ValueForKey(userinfo, "spectator", value, sizeof(value));
if (deathmatch->integer && *value && strcmp(value, "0"))