diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/bg_pmove.c | 3 | ||||
-rw-r--r-- | src/game/bg_public.h | 7 | ||||
-rw-r--r-- | src/game/g_active.c | 8 | ||||
-rw-r--r-- | src/game/g_client.c | 2 | ||||
-rw-r--r-- | src/game/g_local.h | 4 | ||||
-rw-r--r-- | src/game/g_weapon.c | 22 |
6 files changed, 32 insertions, 14 deletions
diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 4afdfaac..80ee0138 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -552,6 +552,9 @@ static qboolean PM_CheckPounce( void ) pm->ps->pm_flags |= PMF_BACKWARDS_JUMP; } + pm->pmext->pouncePayload = pm->ps->stats[ STAT_MISC ]; + pm->ps->stats[ STAT_MISC ] = 0; + return qtrue; } diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 2b723421..69a44072 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -149,12 +149,17 @@ typedef enum #define PMF_ALL_TIMES (PMF_TIME_WATERJUMP|PMF_TIME_LAND|PMF_TIME_KNOCKBACK|PMF_TIME_WALLJUMP) +typedef struct +{ + int pouncePayload; +} pmoveExt_t; + #define MAXTOUCH 32 typedef struct { // state (in / out) playerState_t *ps; - + pmoveExt_t *pmext; // command (in) usercmd_t cmd; int tracemask; // collide against these types of surfaces diff --git a/src/game/g_active.c b/src/game/g_active.c index b0fdb56f..a496c226 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -519,13 +519,8 @@ void ClientTimerActions( gentity_t *ent, int msec ) if( !( ucmd->buttons & BUTTON_ATTACK2 ) ) { - if( client->ps.stats[ STAT_MISC ] > 0 ) - { + if( client->pmext.pouncePayload > 0 ) client->allowedToPounce = qtrue; - client->pouncePayload = client->ps.stats[ STAT_MISC ]; - } - - client->ps.stats[ STAT_MISC ] = 0; } if( client->ps.stats[ STAT_MISC ] > pounceSpeed ) @@ -1137,6 +1132,7 @@ void ClientThink_real( gentity_t *ent ) } pm.ps = &client->ps; + pm.pmext = &client->pmext; pm.cmd = *ucmd; if( pm.ps->pm_type == PM_DEAD ) diff --git a/src/game/g_client.c b/src/game/g_client.c index fcbc8f3b..284ac2f3 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -762,6 +762,7 @@ void respawn( gentity_t *ent ) SpawnCorpse( ent ); //TA: Clients can't respawn - they must go thru the class cmd + ent->client->pers.classSelection = PCL_NONE; ClientSpawn( ent, NULL, NULL, NULL ); } @@ -1230,6 +1231,7 @@ void ClientBegin( int clientNum ) // world to the new position flags = client->ps.eFlags; memset( &client->ps, 0, sizeof( client->ps ) ); + memset( &client->pmext, 0, sizeof( client->pmext ) ); client->ps.eFlags = flags; // locate ent at a spawn point diff --git a/src/game/g_local.h b/src/game/g_local.h index cbe9401d..07a32ab2 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -347,6 +347,9 @@ struct gclient_s // ps MUST be the first element, because the server expects it playerState_t ps; // communicated by server to clients + // exported into pmove, but not communicated to clients + pmoveExt_t pmext; + // the rest of the structure is private to game clientPersistant_t pers; clientSession_t sess; @@ -418,7 +421,6 @@ struct gclient_s int medKitIncrementTime; int lastCreepSlowTime; // time until creep can be removed - int pouncePayload; // amount of damage pounce attack will do qboolean allowedToPounce; qboolean charging; diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index d57f259f..18c3b8fc 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -579,9 +579,16 @@ void LCChargeFire( gentity_t *ent, qboolean secondary ) gentity_t *m; if( secondary ) - m = fire_luciferCannon( ent, muzzle, forward, LCANNON_SECONDARY_DAMAGE, LCANNON_SECONDARY_RADIUS ); + { + m = fire_luciferCannon( ent, muzzle, forward, LCANNON_SECONDARY_DAMAGE, + LCANNON_SECONDARY_RADIUS ); + ent->client->ps.weaponTime = LCANNON_REPEAT; + } else + { m = fire_luciferCannon( ent, muzzle, forward, ent->client->ps.stats[ STAT_MISC ], LCANNON_RADIUS ); + ent->client->ps.weaponTime = LCANNON_CHARGEREPEAT; + } ent->client->ps.stats[ STAT_MISC ] = 0; } @@ -1260,15 +1267,15 @@ qboolean CheckPounceAttack( gentity_t *ent ) VectorSet( mins, -LEVEL3_POUNCE_WIDTH, -LEVEL3_POUNCE_WIDTH, -LEVEL3_POUNCE_WIDTH ); VectorSet( maxs, LEVEL3_POUNCE_WIDTH, LEVEL3_POUNCE_WIDTH, LEVEL3_POUNCE_WIDTH ); - if( !ent->client->allowedToPounce ) - return qfalse; - if( ent->client->ps.groundEntityNum != ENTITYNUM_NONE ) { ent->client->allowedToPounce = qfalse; - return qfalse; + ent->client->pmext.pouncePayload = 0; } + if( !ent->client->allowedToPounce ) + return qfalse; + if( ent->client->ps.weaponTime ) return qfalse; @@ -1303,7 +1310,10 @@ qboolean CheckPounceAttack( gentity_t *ent ) if( !traceEnt->takedamage ) return qfalse; - damage = (int)( ( (float)ent->client->pouncePayload / (float)LEVEL3_POUNCE_SPEED ) * LEVEL3_POUNCE_DMG ); + damage = (int)( ( (float)ent->client->pmext.pouncePayload + / (float)LEVEL3_POUNCE_SPEED ) * LEVEL3_POUNCE_DMG ); + + ent->client->pmext.pouncePayload = 0; G_Damage( traceEnt, ent, ent, forward, tr.endpos, damage, DAMAGE_NO_KNOCKBACK|DAMAGE_NO_LOCDAMAGE, MOD_LEVEL3_POUNCE ); |