diff options
author | Tim Angus <tim@ngus.net> | 2005-11-27 00:00:16 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2005-11-27 00:00:16 +0000 |
commit | 046697c4b9369c02e730f1e16617e09876619864 (patch) | |
tree | 738d39079d13eb84b4d932f2a032e61cae570dbd /src/game | |
parent | 3460e8bf9381c61e1bef98b78d320a8bd52b7f5f (diff) |
* Fixed death by poison MOD s/antitox/medkit/
* Fixed Marauders momentarily disappearing when wall jumping
* Fixed a potential crash bug involving the use of generic1
* Fixed being able to build multiple coincident repeaters if there is no reactor
* Fixed incorrect message when invoking "buy ammo" with an energy weapon and no reactor present
* Fixed invoking "reload" during a weapon reload causing an unnecessary reload
* Fixed aliens having the wrong blood colour when shot with a las gun
* Fixed hovel causing invisible builders
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/bg_misc.c | 6 | ||||
-rw-r--r-- | src/game/g_active.c | 2 | ||||
-rw-r--r-- | src/game/g_buildable.c | 22 | ||||
-rw-r--r-- | src/game/g_cmds.c | 31 | ||||
-rw-r--r-- | src/game/g_combat.c | 9 | ||||
-rw-r--r-- | src/game/g_weapon.c | 1 |
6 files changed, 49 insertions, 22 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index 10bb419b..579137fe 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -4589,6 +4589,9 @@ void BG_PlayerStateToEntityState( playerState_t *ps, entityState_t *s, qboolean s->loopSound = ps->loopSound; s->generic1 = ps->generic1; + + if( s->generic1 <= WPM_NONE || s->generic1 >= WPM_NUM_WEAPONMODES ) + s->generic1 = WPM_PRIMARY; } @@ -4696,6 +4699,9 @@ void BG_PlayerStateToEntityStateExtraPolate( playerState_t *ps, entityState_t *s s->loopSound = ps->loopSound; s->generic1 = ps->generic1; + + if( s->generic1 <= WPM_NONE || s->generic1 >= WPM_NUM_WEAPONMODES ) + s->generic1 = WPM_PRIMARY; } /* diff --git a/src/game/g_active.c b/src/game/g_active.c index ca9c7db4..846397db 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -1103,7 +1103,7 @@ void ClientThink_real( gentity_t *ent ) { int lastWeapon = ent->s.weapon; - //remove anti toxin + //remove grenade BG_DeactivateUpgrade( UP_GRENADE, client->ps.stats ); BG_RemoveUpgradeFromInventory( UP_GRENADE, client->ps.stats ); diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index d83e76b7..5d014a22 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -1227,6 +1227,7 @@ void AHovel_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int //prevent lerping builder->client->ps.eFlags ^= EF_TELEPORT_BIT; + builder->client->ps.eFlags &= ~EF_NODRAW; G_SetOrigin( builder, newOrigin ); VectorCopy( newOrigin, builder->client->ps.origin ); @@ -2545,7 +2546,26 @@ itemBuildError_t G_itemFits( gentity_t *ent, buildable_t buildable, int distance } if( i >= level.num_entities ) - reason = IBE_RPTWARN; + { + //no reactor present + + //check for other nearby repeaters + for ( i = 1, tempent = g_entities + i; i < level.num_entities; i++, tempent++ ) + { + if( tempent->s.eType != ET_BUILDABLE ) + continue; + + if( tempent->s.modelindex == BA_H_REPEATER && + Distance( tempent->s.origin, entity_origin ) < REPEATER_BASESIZE ) + { + reason = IBE_RPTWARN2; + break; + } + } + + if( reason == IBE_NONE ) + reason = IBE_RPTWARN; + } else if( G_isPower( entity_origin ) ) reason = IBE_RPTWARN2; } diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 840fc3bb..4491cd77 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1503,20 +1503,26 @@ void Cmd_Buy_f( gentity_t *ent ) //special case to keep norf happy if( weapon == WP_NONE && upgrade == UP_AMMO ) + buyingEnergyAmmo = BG_FindUsesEnergyForWeapon( ent->client->ps.weapon ); + + if( buyingEnergyAmmo ) { - //if we're buying ammo, there is a reactor/repeater in range and - //our current weapon uses energy - if( ( G_BuildableRange( ent->client->ps.origin, 100, BA_H_REACTOR ) || - G_BuildableRange( ent->client->ps.origin, 100, BA_H_REPEATER ) ) && - BG_FindUsesEnergyForWeapon( ent->client->ps.weapon ) ) - buyingEnergyAmmo = qtrue; + //no armoury nearby + if( ( !G_BuildableRange( ent->client->ps.origin, 100, BA_H_REACTOR ) && + !G_BuildableRange( ent->client->ps.origin, 100, BA_H_REPEATER ) ) ) + { + G_SendCommandFromServer( ent-g_entities, va( "print \"You must be near a reactor or repeater\n\"" ) ); + return; + } } - - //no armoury nearby - if( !G_BuildableRange( ent->client->ps.origin, 100, BA_H_ARMOURY ) && !buyingEnergyAmmo ) + else { - G_SendCommandFromServer( ent-g_entities, va( "print \"You must be near a powered armoury\n\"" ) ); - return; + //no armoury nearby + if( !G_BuildableRange( ent->client->ps.origin, 100, BA_H_ARMOURY ) ) + { + G_SendCommandFromServer( ent-g_entities, va( "print \"You must be near a powered armoury\n\"" ) ); + return; + } } if( weapon != WP_NONE ) @@ -1918,7 +1924,8 @@ Cmd_Reload_f */ void Cmd_Reload_f( gentity_t *ent ) { - ent->client->ps.pm_flags |= PMF_WEAPON_RELOAD; + if( ent->client->ps.weaponstate != WEAPON_RELOADING ) + ent->client->ps.pm_flags |= PMF_WEAPON_RELOAD; } /* diff --git a/src/game/g_combat.c b/src/game/g_combat.c index 732e50f2..e869c046 100644 --- a/src/game/g_combat.c +++ b/src/game/g_combat.c @@ -51,7 +51,6 @@ LookAtKiller void LookAtKiller( gentity_t *self, gentity_t *inflictor, gentity_t *attacker ) { vec3_t dir; - vec3_t angles; if ( attacker && attacker != self ) VectorSubtract( attacker->s.pos.trBase, self->s.pos.trBase, dir ); @@ -59,15 +58,11 @@ void LookAtKiller( gentity_t *self, gentity_t *inflictor, gentity_t *attacker ) VectorSubtract( inflictor->s.pos.trBase, self->s.pos.trBase, dir ); else { - self->client->ps.generic1 = self->s.angles[ YAW ]; + self->client->ps.stats[ STAT_VIEWLOCK ] = self->s.angles[ YAW ]; return; } - self->client->ps.generic1 = vectoyaw( dir ); - - angles[ YAW ] = vectoyaw( dir ); - angles[ PITCH ] = 0; - angles[ ROLL ] = 0; + self->client->ps.stats[ STAT_VIEWLOCK ] = vectoyaw( dir ); } // these are just for logging, the client prints its own messages diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index 3f523071..8f204ef5 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -494,7 +494,6 @@ void lasGunFire( gentity_t *ent ) tent->s.weapon = ent->s.weapon; tent->s.generic1 = ent->s.generic1; //weaponMode } - tent->s.otherEntityNum = ent->s.number; if( traceEnt->takedamage ) G_Damage( traceEnt, ent, ent, forward, tr.endpos, LASGUN_DAMAGE, 0, MOD_LASGUN ); |