---- /dev/humancontroller  ---- a21dca8 perform footjob diff --git src/game/bg_misc.c src/game/bg_misc.c index 238d67a..469fcda 100644 --- src/game/bg_misc.c +++ src/game/bg_misc.c @@ -4619,6 +4619,7 @@ char *eventnames[ ] = "EV_FOOTSTEP_SQUELCH", "EV_FOOTSPLASH", "EV_FOOTWADE", + "EV_FOOTJOB", "EV_SWIM", "EV_STEP_4", diff --git src/game/bg_pmove.c src/game/bg_pmove.c index ca251f2..c9d9ac0 100644 --- src/game/bg_pmove.c +++ src/game/bg_pmove.c @@ -2395,7 +2395,6 @@ static void PM_CheckDuck (void) PM_Footsteps =============== */ -extern void FootStepAttack( pmove_t *pm ); static void PM_Footsteps( void ) { float bobmove; @@ -2588,7 +2587,7 @@ static void PM_Footsteps( void ) // direccion de caminar //if ( pm->ps->stats[ STAT_PCLASS ] == PCL_HUMAN_BSUIT2 ) if ( BG_InventoryContainsUpgrade( UP_BATTLESUIT, pm->ps->stats ) ) - FootStepAttack( pm ); + PM_AddEvent( EV_FOOTJOB ); } else if( pm->waterlevel == 1 ) { diff --git src/game/bg_public.h src/game/bg_public.h index abad1e9..34c8d5d 100644 --- src/game/bg_public.h +++ src/game/bg_public.h @@ -493,6 +493,7 @@ typedef enum EV_FOOTSTEP_SQUELCH, EV_FOOTSPLASH, EV_FOOTWADE, + EV_FOOTJOB, EV_SWIM, EV_STEP_4, diff --git src/game/g_active.c src/game/g_active.c index d2973ae..e094be1 100644 --- src/game/g_active.c +++ src/game/g_active.c @@ -1073,6 +1073,10 @@ void ClientEvents( gentity_t *ent, int oldEventSequence ) ent->noammo = qtrue; break; + case EV_FOOTJOB: + G_FootJob( ent ); + break; + default: break; } diff --git src/game/g_local.h src/game/g_local.h index a36522b..eaa8d5c 100644 --- src/game/g_local.h +++ src/game/g_local.h @@ -1196,6 +1196,7 @@ void CheckGrabAttack( gentity_t *ent ); qboolean CheckPounceAttack( gentity_t *ent ); void ChargeAttack( gentity_t *ent, gentity_t *victim ); void G_UpdateZaps( int msec ); +void G_FootJob( gentity_t *ent ); // diff --git src/game/g_weapon.c src/game/g_weapon.c index 99938a3..5fe82f8 100644 --- src/game/g_weapon.c +++ src/game/g_weapon.c @@ -222,12 +222,13 @@ void meleeAttack( gentity_t *ent, float range, float width, int damage, meansOfD /* ============== -FootStepAttack +G_FootJob ============== -It must be called from PM_Footsteps only. +It must be called from PM_... only. <-- WROOOOONG !!!1! */ -extern void FootStepAttack( pmove_t *pm ) +void G_FootJob( gentity_t *ent ) { + playerState_t *ps = &ent->client->ps; trace_t tr; vec3_t end; //vec3_t muzzle, forward, right, up; @@ -240,17 +241,17 @@ extern void FootStepAttack( pmove_t *pm ) VectorSet( maxs, BSUIT_FOOTSTEP_W, BSUIT_FOOTSTEP_W, BSUIT_FOOTSTEP_W ); // set aiming directions - vectoangles( pm->ps->velocity, angleToTarget); + vectoangles( ps->velocity, angleToTarget); AngleVectors( angleToTarget, forward, right, up ); - VectorCopy( pm->ps->origin, muzzle ); - muzzle[2] -= pm->ps->viewheight; + VectorCopy( ps->origin, muzzle ); + muzzle[2] -= ps->viewheight; VectorMA(muzzle, 1, forward, muzzle); VectorMA(muzzle, 1, right, muzzle); SnapVector(muzzle); VectorMA(muzzle, BSUIT_FOOTSTEP_W, forward, end); G_UnlaggedOn( muzzle, BSUIT_FOOTSTEP_W ); - pm->trace( &tr, muzzle, mins, maxs, end, pm->ps->clientNum, MASK_SHOT ); + trap_Trace( &tr, muzzle, mins, maxs, end, ps->clientNum, MASK_SHOT ); G_UnlaggedOff( ); if( tr.surfaceFlags & SURF_NOIMPACT )