예제 #1
0
파일: hl_weapons.cpp 프로젝트: Skumek/hlsdk
/*
=====================
HUD_PostRunCmd

Client calls this during prediction, after it has moved the player and updated any info changed into to->
time is the current client clock based on prediction
cmd is the command that caused the movement, etc
runfuncs is 1 if this is the first time we've predicted this command.  If so, sounds and effects should play, otherwise, they should
be ignored
=====================
*/
void CL_DLLEXPORT HUD_PostRunCmd( struct local_state_s *from, struct local_state_s *to, struct usercmd_s *cmd, int runfuncs, double time, unsigned int random_seed )
{
//	RecClPostRunCmd(from, to, cmd, runfuncs, time, random_seed);

	g_runfuncs = runfuncs;

#if defined( CLIENT_WEAPONS )
	if ( cl_lw && cl_lw->value )
	{
		HUD_WeaponsPostThink( from, to, cmd, time, random_seed );
	}
	else
#endif
	{
		to->client.fov = g_lastFOV;
	}

	if ( g_irunninggausspred == 1 )
	{
		Vector forward;
		gEngfuncs.pfnAngleVectors( v_angles, forward, NULL, NULL );
		to->client.velocity = to->client.velocity - forward * g_flApplyVel * 5; 
		g_irunninggausspred = false;
	}
	
	// All games can use FOV state
	g_lastFOV = to->client.fov;
}
예제 #2
0
파일: hl_weapons.cpp 프로젝트: Skumek/hlsdk
/*
=====================
HUD_PostRunCmd

Client calls this during prediction, after it has moved the player and updated any info changed into to->
time is the current client clock based on prediction
cmd is the command that caused the movement, etc
runfuncs is 1 if this is the first time we've predicted this command.  If so, sounds and effects should play, otherwise, they should
be ignored
=====================
*/
void EXPORT HUD_PostRunCmd( struct local_state_s *from, struct local_state_s *to, struct usercmd_s *cmd, int runfuncs, double time, unsigned int random_seed )
{
	g_runfuncs = runfuncs;

	// We'll always do prediction of disc throwing
	if ( cl_lw && cl_lw->value )
	{
		// Allowed to fire?
		if ( g_iCannotFire == FALSE )
			HUD_WeaponsPostThink( from, to, cmd, time, random_seed );
	}
	else
	{
		to->client.fov = g_lastFOV;
	}

	// Store of final sequence, etc. for client side animation
	if ( g_runfuncs )
	{
		Ricochet_SetSequence( to->playerstate.sequence, to->playerstate.gaitsequence );
		Ricochet_SetOrientation( to->playerstate.origin, cmd->viewangles );
	}

	// See if we stepped on a jump pad
	Ricochet_CheckJumpPads( from, to );

	// All games can use FOV state
	g_lastFOV = to->client.fov;
}
예제 #3
0
/*
=====================
HUD_PostRunCmd

Client calls this during prediction, after it has moved the player and updated any info changed into to->
time is the current client clock based on prediction
cmd is the command that caused the movement, etc
runfuncs is 1 if this is the first time we've predicted this command.  If so, sounds and effects should play, otherwise, they should
be ignored
=====================
*/
void _DLLEXPORT HUD_PostRunCmd( local_state_t *from, local_state_t *to, struct usercmd_s *cmd, int runfuncs, double time, unsigned int random_seed )
{
	g_runfuncs = runfuncs;
//#if defined( CLIENT_WEAPONS )
	/*if ( cl_lw && cl_lw->value )
	{
		HUD_WeaponsPostThink( from, to, cmd, time, random_seed );
	}
	else
#endif
	{
		to->client.fov = g_lastFOV;
		g_iWeaponFlags = from->weapondata[ from->client.m_iId ].m_iWeaponState;
		g_iPlayerFlags = from->client.flags;
		g_iFreezeTimeOver	= !(from->client.iuser3 & PLAYER_FREEZE_TIME_OVER);
		g_bInBombZone		= (from->client.iuser3 & PLAYER_IN_BOMB_ZONE) != 0;
		g_bHoldingShield	= (from->client.iuser3 & PLAYER_HOLDING_SHIELD) != 0;
		g_bGlockBurstMode   = false; // will be taken from g_iWeaponFlags
	}*/

	HUD_WeaponsPostThink( from, to, cmd, time, random_seed );

	if ( g_runfuncs )
	{
		g_gaitseq	= to->playerstate.gaitsequence;
		g_rseq		= to->playerstate.sequence;
		g_clang		= cmd->viewangles;
		g_clorg		= to->playerstate.origin;
	}

	// All games can use FOV state
	g_lastFOV = to->client.fov;
}
예제 #4
0
파일: hl_weapons.cpp 프로젝트: Arkshine/NS
/*
=====================
HUD_PostRunCmd

Client calls this during prediction, after it has moved the player and updated any info changed into to->
time is the current client clock based on prediction
cmd is the command that caused the movement, etc
runfuncs is 1 if this is the first time we've predicted this command.  If so, sounds and effects should play, otherwise, they should
be ignored
=====================
*/
void CL_DLLEXPORT HUD_PostRunCmd( struct local_state_s *from, struct local_state_s *to, struct usercmd_s *cmd, int runfuncs, double time, unsigned int random_seed )
{
	RecClPostRunCmd(from, to, cmd, runfuncs, time, random_seed);

	g_runfuncs = runfuncs;

	if ( cl_lw && cl_lw->value )
	{
		HUD_WeaponsPostThink( from, to, cmd, time, random_seed );
	}
	else
	{
		to->client.fov = g_lastFOV;
	}

	// Check to see whether too play local jetpack effects
	if(runfuncs)
	{
		static sLastTime = 0;
		float theTimePassed = time - sLastTime;

		//CheckJetpack();
		
		//UpdateJetpackLights();

		sLastTime = time;
	}

	// All games can use FOV state
	g_lastFOV = to->client.fov;
}
예제 #5
0
/*
=====================
HUD_PostRunCmd

Client calls this during prediction, after it has moved the player and updated any info changed into to->
time is the current client clock based on prediction
cmd is the command that caused the movement, etc
runfuncs is 1 if this is the first time we've predicted this command.  If so, sounds and effects should play, otherwise, they should
be ignored
=====================
*/
void _DLLEXPORT HUD_PostRunCmd( struct local_state_s *from, struct local_state_s *to, struct usercmd_s *cmd, int runfuncs, double time, unsigned int random_seed )
{
	g_runfuncs = runfuncs;

	// Only run post think stuff for glock for the sample
	//  implementation
	if ( cl_lw && cl_lw->value )
	{
		HUD_WeaponsPostThink( from, to, cmd, time, random_seed );
	}
	else
	{
		to->client.fov = g_lastFOV;
	}

	Dmc_CheckTeleporters( from, to ); // See if we stepped on a jump pad

	// All games can use FOV state
	g_lastFOV = to->client.fov;
}