From fe0d776b466a8787b0185f7683d0866891919b53 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Fri, 5 Aug 2005 02:09:00 +0000 Subject: * Disabled weapon dropping after buying ammo for now * Basilisk now loosens grip if getting damaged --- src/game/bg_pmove.c | 2 +- src/game/g_cmds.c | 5 +++-- src/game/g_weapon.c | 5 ++++- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src/game') diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 4f48592f..b28366be 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->pm_flags & PMF_WEAPON_SWITCH ) + if( pm->ps->weapon != pm->cmd.weapon && 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_cmds.c b/src/game/g_cmds.c index abea0146..5199bd66 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1518,8 +1518,9 @@ static void G_GiveClientMaxAmmo( gentity_t *ent, qboolean buyingEnergyAmmo ) 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 ) ); + //FIXME: needs to work even if weapon is the same + //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_weapon.c b/src/game/g_weapon.c index 132bc83d..3518bb9c 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -813,7 +813,10 @@ void CheckGrabAttack( gentity_t *ent ) } traceEnt->client->ps.stats[ STAT_STATE ] |= SS_GRABBED; - traceEnt->client->lastGrabTime = level.time; + + //if getting damaged, don't reset the grab time + if( ( ent->client->lastDamageTime + ALIEN_REGEN_DAMAGE_TIME ) < level.time ) + traceEnt->client->lastGrabTime = level.time; } else if( traceEnt->s.eType == ET_BUILDABLE && traceEnt->s.modelindex == BA_H_MGTURRET ) -- cgit