Skip to content

Commit

Permalink
Added a more aggressive form of g_awardpushing. Set it to 2 and we no…
Browse files Browse the repository at this point in the history
… longer forget you. Also blowing yourself up with a rocket gives a point to the last attacker too.
  • Loading branch information
sago007 committed Oct 20, 2016
1 parent f06aa8b commit cb6f540
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 31 deletions.
35 changes: 19 additions & 16 deletions code/cgame/cg_event.c
Expand Up @@ -325,22 +325,25 @@ static void CG_Obituary( entityState_t *ent ) {
message = "tried to invade";
message2 = "'s personal space";
break;
case MOD_LAVA:
message = "was given a hot bath by";
break;
case MOD_SLIME:
message = "was given a acid bath by";
break;
case MOD_FALLING:
message = "was given a small push by";
break;
case MOD_TRIGGER_HURT:
message = "was helped on the way by";
break;
case MOD_CRUSH:
message = "was crushed in";
message2 = "'s trap";
break;
case MOD_LAVA:
message = "was given a hot bath by";
break;
case MOD_SLIME:
message = "was given a acid bath by";
break;
case MOD_FALLING:
message = "was given a small push by";
break;
case MOD_TRIGGER_HURT:
message = "was helped on the way by";
break;
case MOD_CRUSH:
message = "was crushed in";
message2 = "'s trap";
break;
case MOD_SUICIDE:
message = "was too eager against";
break;
default:
message = "was killed by";
break;
Expand Down
4 changes: 2 additions & 2 deletions code/game/g_active.c
Expand Up @@ -1134,9 +1134,9 @@ void ClientThink_real( gentity_t *ent ) {
return;
}

if ( pm.waterlevel <= 1 && pm.ps->groundEntityNum!=ENTITYNUM_NONE && client->lastSentFlyingTime+500>level.time) {
if ( g_awardpushing.integer < 2 && pm.waterlevel <= 1 && pm.ps->groundEntityNum!=ENTITYNUM_NONE && client->lastSentFlyingTime+500>level.time) {
if ( ! (pm.ps->pm_flags & PMF_TIME_KNOCKBACK) ) {
client->lastSentFlying = -1;
client->lastSentFlying = -1;
}
}

Expand Down
29 changes: 16 additions & 13 deletions code/game/g_combat.c
Expand Up @@ -1058,26 +1058,29 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
return;
}
}
//Sago: This was moved up
client = targ->client;

//Sago: See if the client was sent flying
//Check if damage is by somebody who is not a player!
if( (!attacker || attacker->s.eType != ET_PLAYER) && client && client->lastSentFlying>-1 && ( mod==MOD_FALLING || mod==MOD_LAVA || mod==MOD_SLIME || mod==MOD_TRIGGER_HURT || mod==MOD_SUICIDE) ) {
if( client->lastSentFlyingTime+5000<level.time) {
client->lastSentFlying = -1; //More than 5 seconds, not a kill!
} else {
//G_Printf("LastSentFlying %i\n",client->lastSentFlying);
attacker = &g_entities[client->lastSentFlying];
}
}

if ( !inflictor ) {
inflictor = &g_entities[ENTITYNUM_WORLD];
}
if ( !attacker ) {
attacker = &g_entities[ENTITYNUM_WORLD];
}

if ( (attacker == &g_entities[ENTITYNUM_WORLD] || attacker == targ || attacker->s.eType != ET_PLAYER) && client && client->lastSentFlying>-1 &&
( mod==MOD_FALLING || mod==MOD_LAVA || mod==MOD_SLIME || mod==MOD_TRIGGER_HURT || mod==MOD_SUICIDE || g_awardpushing.integer > 1)) {
if( client->lastSentFlyingTime+5000<level.time) {
//More than 5 seconds, not a kill!
client->lastSentFlying = -1;
}
else {
attacker = &g_entities[client->lastSentFlying];
if (! ( mod==MOD_FALLING || mod==MOD_LAVA || mod==MOD_SLIME || mod==MOD_TRIGGER_HURT || mod==MOD_SUICIDE) ) {
//If non environmental kill then consider it a(n assisted) suicide.
mod = MOD_SUICIDE;
}
}
}

// shootable doors / buttons don't actually have any health
if ( targ->s.eType == ET_MOVER ) {
Expand Down Expand Up @@ -1270,7 +1273,7 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
if ( client ) {
if ( attacker ) {
client->ps.persistant[PERS_ATTACKER] = attacker->s.number;
} else if(client->lastSentFlying) {
} else if(client->lastSentFlying > -1) {
client->ps.persistant[PERS_ATTACKER] = client->lastSentFlying;
} else {
client->ps.persistant[PERS_ATTACKER] = ENTITYNUM_WORLD;
Expand Down

0 comments on commit cb6f540

Please sign in to comment.