summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2005-08-03 00:57:31 +0000
committerTim Angus <tim@ngus.net>2005-08-03 00:57:31 +0000
commite645491f02fbd53a4d466fd34df798b5955ba48e (patch)
tree946fb5e26e832c37663986a1f567aad2434b8309 /src/game
parent91217e0614b92948cbaa1dfc62a8f9a80a81a3fe (diff)
* Weapon switch forced when buying a weapon/ammo
* Fixed a bug where getting killed by certain buildables reduced your score
Diffstat (limited to 'src/game')
-rw-r--r--src/game/bg_pmove.c2
-rw-r--r--src/game/g_buildable.c14
-rw-r--r--src/game/g_cmds.c4
-rw-r--r--src/game/g_combat.c2
4 files changed, 14 insertions, 8 deletions
diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c
index b28366be..4f48592f 100644
--- a/src/game/bg_pmove.c
+++ b/src/game/bg_pmove.c
@@ -2683,7 +2683,7 @@ static void PM_Weapon( void )
pm->ps->pm_flags &= ~PMF_USE_ITEM_HELD;
//something external thinks a weapon change is necessary
- if( pm->ps->weapon != pm->cmd.weapon && pm->ps->pm_flags & PMF_WEAPON_SWITCH )
+ if( pm->ps->pm_flags & PMF_WEAPON_SWITCH )
{
pm->ps->pm_flags &= ~PMF_WEAPON_SWITCH;
PM_BeginWeaponChange( pm->cmd.weapon );
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 57480191..47815cb5 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -527,7 +527,7 @@ Called when an alien spawn dies
*/
void ASpawn_Melt( gentity_t *self )
{
- G_SelectiveRadiusDamage( self->s.pos.trBase, self->parent, self->splashDamage,
+ G_SelectiveRadiusDamage( self->s.pos.trBase, self, self->splashDamage,
self->splashRadius, self, self->splashMethodOfDeath, PTE_ALIENS );
//start creep recession
@@ -566,7 +566,7 @@ void ASpawn_Blast( gentity_t *self )
VectorCopy( self->s.origin2, dir );
//do a bit of radius damage
- G_SelectiveRadiusDamage( self->s.pos.trBase, self->parent, self->splashDamage,
+ G_SelectiveRadiusDamage( self->s.pos.trBase, self, self->splashDamage,
self->splashRadius, self, self->splashMethodOfDeath, PTE_ALIENS );
//pretty events and item cleanup
@@ -777,7 +777,7 @@ void ABarricade_Blast( gentity_t *self )
VectorCopy( self->s.origin2, dir );
//do a bit of radius damage
- G_SelectiveRadiusDamage( self->s.pos.trBase, self->parent, self->splashDamage,
+ G_SelectiveRadiusDamage( self->s.pos.trBase, self, self->splashDamage,
self->splashRadius, self, self->splashMethodOfDeath, PTE_ALIENS );
//pretty events and item cleanup
@@ -870,7 +870,7 @@ void AAcidTube_Damage( gentity_t *self )
}
//do some damage
- G_SelectiveRadiusDamage( self->s.pos.trBase, self->parent, self->splashDamage,
+ G_SelectiveRadiusDamage( self->s.pos.trBase, self, self->splashDamage,
self->splashRadius, self, self->splashMethodOfDeath, PTE_ALIENS );
}
@@ -1185,7 +1185,7 @@ void AHovel_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
VectorCopy( self->s.origin2, dir );
//do a bit of radius damage
- G_SelectiveRadiusDamage( self->s.pos.trBase, self->parent, self->splashDamage,
+ G_SelectiveRadiusDamage( self->s.pos.trBase, self, self->splashDamage,
self->splashRadius, self, self->splashMethodOfDeath, PTE_ALIENS );
//pretty events and item cleanup
@@ -1472,7 +1472,7 @@ void HRpt_Think( gentity_t *self )
if( ent->s.eType != ET_BUILDABLE )
continue;
- if( ent->s.modelindex == BA_H_REACTOR )
+ if( ent->s.modelindex == BA_H_REACTOR && ent->spawned )
reactor = qtrue;
}
}
@@ -2143,7 +2143,7 @@ void HSpawn_Blast( gentity_t *self )
self->timestamp = level.time;
//do some radius damage
- G_RadiusDamage( self->s.pos.trBase, self->parent, self->splashDamage,
+ G_RadiusDamage( self->s.pos.trBase, self, self->splashDamage,
self->splashRadius, self, self->splashMethodOfDeath );
self->think = freeBuildable;
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 67720b40..abea0146 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -1516,6 +1516,10 @@ static void G_GiveClientMaxAmmo( gentity_t *ent, qboolean buyingEnergyAmmo )
BG_PackAmmoArray( i, ent->client->ps.ammo, ent->client->ps.powerups,
quan, clips, maxClips );
+
+ //force a weapon change
+ ent->client->ps.pm_flags |= PMF_WEAPON_SWITCH;
+ trap_SendServerCommand( ent-g_entities, va( "weaponswitch %d", ent->client->ps.weapon ) );
}
}
}
diff --git a/src/game/g_combat.c b/src/game/g_combat.c
index 7b84ccc2..974578c3 100644
--- a/src/game/g_combat.c
+++ b/src/game/g_combat.c
@@ -208,6 +208,8 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
self->client->ps.persistant[ PERS_KILLED ]++;
+ G_Printf( "attacker->classname: %s\n inflictor->classname: %s\n",
+ attacker->classname, inflictor->classname );
if( attacker && attacker->client )
{
attacker->client->lastkilled_client = self->s.number;