Browse Source

Merge branch 'poke646' into poke646_vendetta

poke646_vendetta
Andrey Akhmichin 5 years ago
parent
commit
a56016fbf2
  1. 2
      cl_dll/ammo.cpp
  2. 2
      cl_dll/entity.cpp
  3. 4
      cl_dll/ev_hldm.cpp
  4. 2
      cl_dll/health.cpp
  5. 2
      cl_dll/hud.cpp
  6. 5
      cl_dll/hud.h
  7. 2
      cl_dll/hud_redraw.cpp
  8. 384
      cl_dll/poke646/scope.cpp
  9. 16
      dlls/crossbow.cpp
  10. 27
      dlls/gauss.cpp
  11. 2
      dlls/mortar.cpp
  12. 53
      dlls/poke646/firetrail.cpp
  13. 2
      dlls/poke646/mp3.cpp
  14. 1558
      dlls/poke646/robocop.cpp
  15. 2
      dlls/satchel.cpp
  16. 4
      dlls/shotgun.cpp

2
cl_dll/ammo.cpp

@ -533,7 +533,7 @@ int CHudAmmo::MsgFunc_HideWeapon( const char *pszName, int iSize, void *pbuf ) @@ -533,7 +533,7 @@ int CHudAmmo::MsgFunc_HideWeapon( const char *pszName, int iSize, void *pbuf )
return 1;
if( !( gHUD.m_iHideHUDDisplay & HIDEHUD_WEAPONS ) )
gHUD.m_flScaleColorTime = gHUD.m_flTime + 2.0;
gHUD.m_flScaleColorTime = gHUD.m_flTime + 2.0f;
if( gHUD.m_iHideHUDDisplay & ( HIDEHUD_WEAPONS | HIDEHUD_ALL ) )
{

2
cl_dll/entity.cpp

@ -96,7 +96,7 @@ void DLLEXPORT HUD_TxferLocalOverrides( struct entity_state_s *state, const stru @@ -96,7 +96,7 @@ void DLLEXPORT HUD_TxferLocalOverrides( struct entity_state_s *state, const stru
// Fire prevention
state->iuser4 = client->iuser4;
bDrawScope = client->iuser4;
// bDrawScope = client->iuser4;
}
/*

4
cl_dll/ev_hldm.cpp

@ -732,9 +732,9 @@ void EV_TrainPitchAdjust( event_args_t *args ) @@ -732,9 +732,9 @@ void EV_TrainPitchAdjust( event_args_t *args )
us_params = (unsigned short)args->iparam1;
stop = args->bparam1;
m_flVolume = (float)( us_params & 0x003f ) / 40.0;
m_flVolume = (float)( us_params & 0x003f ) / 40.0f;
noise = (int)( ( ( us_params ) >> 12 ) & 0x0007 );
pitch = (int)( 10.0 * (float)( ( us_params >> 6 ) & 0x003f ) );
pitch = (int)( 10.0f * (float)( ( us_params >> 6 ) & 0x003f ) );
switch( noise )
{

2
cl_dll/health.cpp

@ -180,7 +180,7 @@ void CHudHealth::GetPainColor( int &r, int &g, int &b ) @@ -180,7 +180,7 @@ void CHudHealth::GetPainColor( int &r, int &g, int &b )
else
{
UnpackRGB( r, g, b, RGB_YELLOWISH );
float f = ( sin( ( 16 - gHUD.m_flTime ) * m_iHealth ) + 1.0 ) * 0.5;
float f = ( sin( ( 16 - gHUD.m_flTime ) * m_iHealth ) + 1.0f ) * 0.5f;
r = (int)( r * f * 58.0f );
g = (int)( g * f );
b = (int)( b * f );

2
cl_dll/hud.cpp

@ -36,6 +36,7 @@ extern client_sprite_t *GetSpriteList( client_sprite_t *pList, const char *psz, @@ -36,6 +36,7 @@ extern client_sprite_t *GetSpriteList( client_sprite_t *pList, const char *psz,
extern cvar_t *sensitivity;
cvar_t *cl_lw = NULL;
cvar_t *cl_viewbob = NULL;
cvar_t *adjust_fov = NULL;
void ShutdownInput( void );
@ -220,6 +221,7 @@ void CHud::Init( void ) @@ -220,6 +221,7 @@ void CHud::Init( void )
m_pCvarDraw = CVAR_CREATE( "hud_draw", "1", FCVAR_ARCHIVE );
cl_lw = gEngfuncs.pfnGetCvarPointer( "cl_lw" );
cl_viewbob = CVAR_CREATE( "cl_viewbob", "0", FCVAR_ARCHIVE );
adjust_fov = gEngfuncs.pfnGetCvarPointer( "r_adjust_fov" ); // Xash3D widescreen fix
m_pSpriteList = NULL;

5
cl_dll/hud.h

@ -567,9 +567,12 @@ class CHudScope @@ -567,9 +567,12 @@ class CHudScope
{
public:
int DrawScope( void );
int DrawText( void );
private:
HSPRITE m_hSprite;
struct model_s *m_hSpriteModel;
HSPRITE m_hSprite;
char m_szDist[16];
};
//

2
cl_dll/hud_redraw.cpp

@ -178,6 +178,8 @@ int CHud::Redraw( float flTime, int intermission ) @@ -178,6 +178,8 @@ int CHud::Redraw( float flTime, int intermission )
}
*/
gHUD.m_Scope.DrawText();
return 1;
}

384
cl_dll/poke646/scope.cpp

@ -26,271 +26,179 @@ @@ -26,271 +26,179 @@
#include "pm_shared.h"
#include "pm_defs.h"
#include "pmtrace.h"
extern bool bDrawScope;
extern vec3_t v_origin; // last view origin
extern vec3_t v_angles; // last view angle
extern vec3_t v_cl_angles; // last client/mouse angle
extern vec3_t v_sim_org; // last sim origin
extern cvar_t *adjust_fov;
int CHudScope::DrawScope()
{
vec3_t angles, forward, right, up;
vec3_t dir, delta, vert;
int frame;
float flDist, x, y;
pmtrace_t *trace;
if( !bDrawScope )
return 1;
if (!m_hSprite)
m_hSprite = SPR_Load("sprites/scopeborder.spr");
int halfScopeHeight = ScreenHeight / 2;
int halfScopeWidth = halfScopeHeight;
int x, y;
struct model_s* hSpriteModel = (struct model_s *)gEngfuncs.GetSpritePointer(m_hSprite);
gEngfuncs.pTriAPI->RenderMode(kRenderTransTexture); //additive
//
// Top left Half scope.
//
x = ScreenWidth / 2 - halfScopeWidth;
y = 0;
gEngfuncs.pTriAPI->SpriteTexture(hSpriteModel, 0);
gEngfuncs.pTriAPI->Color4f( 1.0, 1.0, 1.0, 1.0 );
gEngfuncs.pTriAPI->CullFace(TRI_NONE);
gEngfuncs.pTriAPI->Begin(TRI_QUADS);
//top left
gEngfuncs.pTriAPI->TexCoord2f(0.3f, 0.3f); // 0 0
gEngfuncs.pTriAPI->Vertex3f(x, y, 0);
//bottom left
gEngfuncs.pTriAPI->TexCoord2f(0.3f, 1.0f); // 0 1
gEngfuncs.pTriAPI->Vertex3f(x, y + halfScopeHeight, 0);
//bottom right
gEngfuncs.pTriAPI->TexCoord2f(1.0f, 1.0f); // 1 1
gEngfuncs.pTriAPI->Vertex3f(x + halfScopeWidth, y + halfScopeHeight, 0);
//top right
gEngfuncs.pTriAPI->TexCoord2f(1.0f, 0.3f); // 1 0
gEngfuncs.pTriAPI->Vertex3f(x + halfScopeWidth, y, 0);
gEngfuncs.pTriAPI->End();
//
// Top right Half scope.
//
x = ScreenWidth / 2;
y = 0;
gEngfuncs.pTriAPI->SpriteTexture(hSpriteModel, 1);
gEngfuncs.pTriAPI->CullFace(TRI_NONE);
gEngfuncs.pTriAPI->Begin(TRI_QUADS);
//top left
gEngfuncs.pTriAPI->TexCoord2f(0.0f, 0.3f);
gEngfuncs.pTriAPI->Vertex3f(x, y, 0);
//bottom left
gEngfuncs.pTriAPI->TexCoord2f(0.0f, 1.0f);
gEngfuncs.pTriAPI->Vertex3f(x, y + halfScopeHeight, 0);
//bottom right
gEngfuncs.pTriAPI->TexCoord2f(0.7f, 1.0f);
gEngfuncs.pTriAPI->Vertex3f(x + halfScopeWidth, y + halfScopeHeight, 0);
//top right
gEngfuncs.pTriAPI->TexCoord2f(0.7f, 0.3f);
gEngfuncs.pTriAPI->Vertex3f(x + halfScopeWidth, y, 0);
gEngfuncs.pTriAPI->End();
//
// Bottom left Half scope.
//
x = ScreenWidth / 2 - halfScopeWidth;
y = ScreenHeight / 2;
gEngfuncs.pTriAPI->SpriteTexture(hSpriteModel, 2);
gEngfuncs.pTriAPI->CullFace(TRI_NONE);
gEngfuncs.pTriAPI->Begin(TRI_QUADS);
//top left
gEngfuncs.pTriAPI->TexCoord2f(0.3f, 0.0f);
gEngfuncs.pTriAPI->Vertex3f(x, y, 0);
//bottom left
gEngfuncs.pTriAPI->TexCoord2f(0.3f, 0.7f);
gEngfuncs.pTriAPI->Vertex3f(x, y + halfScopeHeight, 0);
//bottom right
gEngfuncs.pTriAPI->TexCoord2f(1.0f, 0.7f);
gEngfuncs.pTriAPI->Vertex3f(x + halfScopeWidth, y + halfScopeHeight, 0);
//top right
gEngfuncs.pTriAPI->TexCoord2f(1.0f, 0.0f);
gEngfuncs.pTriAPI->Vertex3f(x + halfScopeWidth, y, 0);
gEngfuncs.pTriAPI->End();
//
// Bottom right Half scope.
//
x = ScreenWidth / 2;
y = ScreenHeight / 2;
gEngfuncs.pTriAPI->SpriteTexture(hSpriteModel, 3);
gEngfuncs.pTriAPI->CullFace(TRI_NONE);
gEngfuncs.pTriAPI->Begin(TRI_QUADS);
//top left
gEngfuncs.pTriAPI->TexCoord2f(0.0f, 0.0f);
gEngfuncs.pTriAPI->Vertex3f(x, y, 0);
//bottom left
gEngfuncs.pTriAPI->TexCoord2f(0.0f, 0.7f);
gEngfuncs.pTriAPI->Vertex3f(x, y + halfScopeHeight, 0);
//bottom right
gEngfuncs.pTriAPI->TexCoord2f(0.7f, 0.7f);
gEngfuncs.pTriAPI->Vertex3f(x + halfScopeWidth, y + halfScopeHeight, 0);
//top right
gEngfuncs.pTriAPI->TexCoord2f(0.7f, 0.0f);
gEngfuncs.pTriAPI->Vertex3f(x + halfScopeWidth, y, 0);
gEngfuncs.pTriAPI->End();
gEngfuncs.pTriAPI->RenderMode(kRenderNormal); // normal
gEngfuncs.pTriAPI->Color4f(1.0, 0.0, 0.0, 1.0);
int w = ScreenWidth / 2 - halfScopeWidth + 5;
//
// Left black bar
//
gEngfuncs.pTriAPI->SpriteTexture(hSpriteModel, 0);
gEngfuncs.pTriAPI->CullFace(TRI_NONE);
gEngfuncs.pTriAPI->Begin(TRI_QUADS);
//top left
gEngfuncs.pTriAPI->TexCoord2f(0.0f, 0.0f);
gEngfuncs.pTriAPI->Vertex3f(0, 0, 0);
//bottom left
gEngfuncs.pTriAPI->TexCoord2f(0.0f, 1.0f);
gEngfuncs.pTriAPI->Vertex3f(0, ScreenHeight, 0);
//bottom right
gEngfuncs.pTriAPI->TexCoord2f(1.0f, 1.0f);
gEngfuncs.pTriAPI->Vertex3f(w, ScreenHeight, 0);
//top right
gEngfuncs.pTriAPI->TexCoord2f(1.0f, 0.0f);
gEngfuncs.pTriAPI->Vertex3f(w, 0, 0);
gEngfuncs.pTriAPI->End();
x = ScreenWidth / 2 + halfScopeWidth - 5;
//
// Right black bar
//
gEngfuncs.pTriAPI->CullFace(TRI_NONE);
gEngfuncs.pTriAPI->Begin(TRI_QUADS);
gEngfuncs.pTriAPI->Color4f(0.0, 1.0, 0.0, 1.0);
//top left
gEngfuncs.pTriAPI->TexCoord2f(0.0f, 0.0f);
gEngfuncs.pTriAPI->Vertex3f(x, 0, 0);
//bottom left
gEngfuncs.pTriAPI->TexCoord2f(0.0f, 1.0f);
gEngfuncs.pTriAPI->Vertex3f(x, ScreenHeight, 0);
//bottom right
gEngfuncs.pTriAPI->TexCoord2f(1.0f, 1.0f);
gEngfuncs.pTriAPI->Vertex3f(ScreenWidth, ScreenHeight, 0);
//top right
gEngfuncs.pTriAPI->TexCoord2f(1.0f, 0.0f);
gEngfuncs.pTriAPI->Vertex3f(ScreenWidth, 0, 0);
gEngfuncs.pTriAPI->End();
gEngfuncs.pTriAPI->RenderMode(kRenderNormal); //return to normal
if( !m_hSprite )
{
m_hSprite = SPR_Load( "sprites/scopeborder.spr" );
m_hSpriteModel = (struct model_s *)gEngfuncs.GetSpritePointer( m_hSprite );
}
vec3_t forward;
AngleVectors(v_angles, forward, NULL, NULL);
VectorScale(forward, 1024, forward);
VectorAdd(forward, v_origin, forward);
pmtrace_t * trace = gEngfuncs.PM_TraceLine(v_origin, forward, PM_TRACELINE_PHYSENTSONLY, 2, -1);
gEngfuncs.GetViewAngles( angles );
AngleVectors( angles, forward, right, up );
float dist = (trace->endpos - v_origin).Length();
float meters = dist * 0.021527f; // Convert hammer units to meters.
VectorMA( v_origin, 8192.0f, forward, dir );
trace = gEngfuncs.PM_TraceLine( v_origin, dir, PM_TRACELINE_PHYSENTSONLY, 2, -1 );
VectorSubtract( trace->endpos, v_origin, delta );
char szDistance[16];
sprintf(szDistance, "%.2f m", meters);
flDist = Length( delta );
int len = strlen(szDistance);
if( flDist >= 118.0f )
sprintf( m_szDist, "%.2f m", flDist * 0.0254f );
else
strcpy( m_szDist, "-.-- m" );
int x1, y1;
x = ScreenWidth / 2 + ((float)halfScopeWidth * 0.7f);
y = ScreenHeight / 2 - ((float)halfScopeHeight * 0.0625f);
x = tan( gHUD.m_iFOV * 0.008726646259971648 ) * 11.0;
y = x * 0.00390625;
x1 = x + 1;
y1 = y + 1;
gEngfuncs.pTriAPI->RenderMode( kRenderTransTexture ); //additive
gEngfuncs.pTriAPI->CullFace( TRI_NONE );
char c;
int i;
int r, g, b;
if( adjust_fov && adjust_fov->value )
VectorMA( v_origin, 8.0f, forward, dir );
else
VectorMA( v_origin, 10.0f, forward, dir );
r = g = b = 15;
frame = 0;
for (i = 0; i < len; i++)
while( true )
{
TextMessageDrawChar(x1, y1, szDistance[i], r, g, b);
c = szDistance[i];
x1 += gHUD.m_scrinfo.charWidths[c];
if( !gEngfuncs.pTriAPI->SpriteTexture( m_hSpriteModel, frame ) )
break;
gEngfuncs.pTriAPI->Color4f( 1.0f, 1.0f, 1.0f, 1.0f );
gEngfuncs.pTriAPI->Begin( TRI_QUADS );
gEngfuncs.pTriAPI->Brightness( 1.0f );
gEngfuncs.pTriAPI->TexCoord2f( 0.0f, 1.0f );
switch( frame )
{
case 0:
VectorMA( dir, -x, right, vert );
break;
case 1:
VectorCopy( dir, vert );
break;
case 2:
VectorMA( dir, -x, up, vert );
VectorMA( vert, -x, right, vert );
break;
case 3:
VectorMA( dir, -x, up, vert );
break;
}
gEngfuncs.pTriAPI->Vertex3fv( vert );
gEngfuncs.pTriAPI->Brightness( 1.0f );
gEngfuncs.pTriAPI->TexCoord2f( 0.0f, 0.0f );
switch( frame )
{
case 0:
VectorMA( dir, x, up, vert );
VectorMA( vert, -x, right, vert );
break;
case 1:
VectorMA( dir, x, up, vert );
break;
case 2:
VectorMA( dir, y, up, vert );
VectorMA( vert, -x, right, vert );
break;
case 3:
VectorCopy( dir, vert );
break;
}
gEngfuncs.pTriAPI->Vertex3fv( vert );
gEngfuncs.pTriAPI->Brightness( 1.0f );
gEngfuncs.pTriAPI->TexCoord2f( 1.0f, 0.0f );
switch( frame )
{
case 0:
VectorMA( dir, x, up, vert );
break;
case 1:
VectorMA( dir, x, up, vert );
VectorMA( vert, x, right, vert );
break;
case 2:
VectorCopy( dir, vert );
break;
case 3:
VectorMA( dir, y, up, vert );
VectorMA( vert, x, right, vert );
break;
}
gEngfuncs.pTriAPI->Vertex3fv( vert );
gEngfuncs.pTriAPI->Brightness( 1.0f );
gEngfuncs.pTriAPI->TexCoord2f( 1.0f, 1.0f );
switch( frame )
{
case 0:
VectorCopy( dir, vert );
break;
case 1:
VectorMA( dir, x, right, vert );
break;
case 2:
VectorMA( dir, -x, up, vert );
break;
case 3:
VectorMA( dir, -x, up, vert );
VectorMA( vert, x, right, vert );
break;
}
gEngfuncs.pTriAPI->Vertex3fv( vert );
gEngfuncs.pTriAPI->End();
if( ++frame >= 4 )
{
gEngfuncs.pTriAPI->RenderMode( kRenderNormal );
cl_entity_t *viewmodel = gEngfuncs.GetViewModel();
viewmodel->curstate.rendermode = kRenderGlow;
viewmodel->curstate.renderamt = 5;
break;
}
}
r = 255;
g = b = 0;
return 1;
}
for (i = 0; i < len; i++)
{
TextMessageDrawChar(x, y, szDistance[i], r, g, b);
int CHudScope::DrawText()
{
int w, h;
c = szDistance[i];
x += gHUD.m_scrinfo.charWidths[c];
}
if( !bDrawScope )
return 1;
GetConsoleStringSize( m_szDist, &w, &h );
// gEngfuncs.Con_Printf("CMLWBR trace distance: %.3f\n", meters);
DrawSetTextColor( 1.0f, 0.25f, 0.25f );
DrawConsoleString( ScreenWidth * 0.82f - w, ScreenHeight * 0.49f - h, m_szDist );
return 1;
}

16
dlls/crossbow.cpp

@ -407,7 +407,7 @@ void CCrossbow::ZoomOut() @@ -407,7 +407,7 @@ void CCrossbow::ZoomOut()
m_fInZoom = 0;
m_pPlayer->pev->iuser4 = m_fInZoom;
m_pPlayer->pev->viewmodel = MAKE_STRING( "models/v_cmlwbr.mdl" );
UTIL_ScreenFade( m_pPlayer, g_vecZero, 0.2, 0.1, 255, FFADE_IN );
UTIL_ScreenFade( m_pPlayer, g_vecZero, 0.2f, 0.1f, 255, FFADE_IN );
}
void CCrossbow::SecondaryAttack()
@ -415,7 +415,7 @@ void CCrossbow::SecondaryAttack() @@ -415,7 +415,7 @@ void CCrossbow::SecondaryAttack()
if( m_fInZoom == 2 )
{
ZoomOut();
m_flNextPrimaryAttack = m_flNextSecondaryAttack = m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.7;
m_flNextPrimaryAttack = m_flNextSecondaryAttack = m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.7f;
}
else
{
@ -423,10 +423,11 @@ void CCrossbow::SecondaryAttack() @@ -423,10 +423,11 @@ void CCrossbow::SecondaryAttack()
++m_fInZoom;
m_pPlayer->pev->iuser4 = m_fInZoom;
m_pPlayer->pev->viewmodel = 0;
UTIL_ScreenFade( m_pPlayer, g_vecZero, 0.1, 0.1, 255, FFADE_IN );
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5;
UTIL_ScreenFade( m_pPlayer, g_vecZero, 0.1f, 0.1f, 255, FFADE_IN );
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5f;
}
EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/cmlwbr_zoom.wav", RANDOM_FLOAT( 0.95, 1.0 ), ATTN_NORM, 0, 93 + RANDOM_LONG( 0, 0xF ) );
EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/cmlwbr_zoom.wav", RANDOM_FLOAT( 0.95f, 1.0f ), ATTN_NORM, 0, 93 + RANDOM_LONG( 0, 0xF ) );
}
void CCrossbow::ToggleDrawn()
@ -479,10 +480,11 @@ void CCrossbow::WeaponIdle( void ) @@ -479,10 +480,11 @@ void CCrossbow::WeaponIdle( void )
if( m_flTimeWeaponIdle < UTIL_WeaponTimeBase() )
{
int iAnim;
if( m_fInAttack || !m_iClip )
{
float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 );
if( flRand <= 0.75 || m_fInZoom )
if( flRand <= 0.75f || m_fInZoom )
{
iAnim = m_fInAttack ? CROSSBOW_IDLE1 : CROSSBOW_IDLE2;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.1f;
@ -496,7 +498,7 @@ void CCrossbow::WeaponIdle( void ) @@ -496,7 +498,7 @@ void CCrossbow::WeaponIdle( void )
else
{
iAnim = CROSSBOW_DRAWBACK;
EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/cmlwbr_drawback.wav", RANDOM_FLOAT( 0.9, 1.0 ), ATTN_NORM, 0, 93 + RANDOM_LONG( 0, 0xF ) );
EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/cmlwbr_drawback.wav", RANDOM_FLOAT( 0.9f, 1.0f ), ATTN_NORM, 0, 93 + RANDOM_LONG( 0, 0xF ) );
m_flNextSecondaryAttack = m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.3f;
SetThink( &CCrossbow::ToggleDrawn );
pev->nextthink = gpGlobals->time + 1.2f;

27
dlls/gauss.cpp

@ -60,7 +60,6 @@ float CXS::GetFullChargeTime( void ) @@ -60,7 +60,6 @@ float CXS::GetFullChargeTime( void )
return 4.0f;
}
void CXS::Spawn()
{
Precache();
@ -289,15 +288,15 @@ void CXS::SecondaryAttack() @@ -289,15 +288,15 @@ void CXS::SecondaryAttack()
if( m_pPlayer->m_flStartCharge < gpGlobals->time - 10.0f )
{
// Player charged up too long. Zap him.
EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/xs_moan1.wav", 1.0, ATTN_NORM, 0, 80 + RANDOM_LONG( 0, 0x3f ) );
EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/xs_moan3.wav", 1.0, ATTN_NORM, 0, 75 + RANDOM_LONG( 0, 0x3f ) );
EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/xs_moan1.wav", 1.0f, ATTN_NORM, 0, 80 + RANDOM_LONG( 0, 0x3f ) );
EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/xs_moan3.wav", 1.0f, ATTN_NORM, 0, 75 + RANDOM_LONG( 0, 0x3f ) );
m_fInAttack = 0;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.2;
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.2f;
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0f;
#ifndef CLIENT_DLL
m_pPlayer->TakeDamage( VARS( eoNullEntity ), VARS( eoNullEntity ), 50, DMG_POISON );
UTIL_ScreenFade( m_pPlayer, Vector( 192, 224, 0 ), 2, 0.5, 128, FFADE_IN );
UTIL_ScreenFade( m_pPlayer, Vector( 192, 224, 0 ), 2, 0.5f, 128, FFADE_IN );
#endif
SendWeaponAnim( XS_IDLE );
@ -380,12 +379,12 @@ void CXS::Fire( Vector vecOrigSrc, Vector vecDir, float flDamage ) @@ -380,12 +379,12 @@ void CXS::Fire( Vector vecOrigSrc, Vector vecDir, float flDamage )
pXSBeam->pev->owner = m_pPlayer->edict();
pXSBeam->Init();
EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/xs_shot.wav", flDamage * 0.0025 + 0.5, ATTN_NORM, 0, 85 + RANDOM_LONG( 0, 16 ) );
EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/xs_shot.wav", flDamage * 0.0025f + 0.5f, ATTN_NORM, 0, 85 + RANDOM_LONG( 0, 16 ) );
// This reliable event is used to stop the spinning sound
// It's delayed by a fraction of second to make sure it is delayed by 1 frame on the client
// It's sent reliably anyway, which could lead to other delays
PLAYBACK_EVENT_FULL( FEV_RELIABLE, m_pPlayer->edict(), m_usXSSpin, 0.01, (float *)&m_pPlayer->pev->origin, (float *)&m_pPlayer->pev->angles, 0.0, 0.0, 0, 0, 0, 1 );
PLAYBACK_EVENT_FULL( FEV_RELIABLE, m_pPlayer->edict(), m_usXSSpin, 0.01f, (float *)&m_pPlayer->pev->origin, (float *)&m_pPlayer->pev->angles, 0.0f, 0.0f, 0, 0, 0, 1 );
pev->effects |= EF_MUZZLEFLASH;
}
@ -395,9 +394,9 @@ void CXS::Reload() @@ -395,9 +394,9 @@ void CXS::Reload()
if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 || m_iClip == XS_MAX_CLIP )
return;
if( !m_fInAttack && DefaultReload( XS_MAX_CLIP, XS_RELOAD, 3.5 ) )
if( !m_fInAttack && DefaultReload( XS_MAX_CLIP, XS_RELOAD, 3.5f ) )
{
EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/xs_reload.wav", 0.8, ATTN_NORM, 0, ATTN_NORM );
EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/xs_reload.wav", 0.8f, ATTN_NORM, 0, ATTN_NORM );
}
}
@ -432,11 +431,11 @@ void CXS::WeaponIdle( void ) @@ -432,11 +431,11 @@ void CXS::WeaponIdle( void )
{
StartFire();
m_fInAttack = 0;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.2;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.2f;
// Need to set m_flNextPrimaryAttack so the weapon gets a chance to complete its secondary fire animation. - Solokiller
if( m_iClip <= 0 )
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.5;
m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.5f;
}
else
{
@ -465,7 +464,7 @@ class CXSAmmo : public CBasePlayerAmmo @@ -465,7 +464,7 @@ class CXSAmmo : public CBasePlayerAmmo
{
void EXPORT FallThink()
{
pev->nextthink = gpGlobals->time + 0.1;
pev->nextthink = gpGlobals->time + 0.1f;
if( pev->flags & FL_ONGROUND )
{
@ -491,7 +490,7 @@ class CXSAmmo : public CBasePlayerAmmo @@ -491,7 +490,7 @@ class CXSAmmo : public CBasePlayerAmmo
CBasePlayerAmmo::Spawn();
SetThink( &CXSAmmo::FallThink );
pev->nextthink = gpGlobals->time + 0.1;
pev->nextthink = gpGlobals->time + 0.1f;
}
void Precache( void )
{

2
dlls/mortar.cpp

@ -256,7 +256,7 @@ void CMortar::MortarExplode( void ) @@ -256,7 +256,7 @@ void CMortar::MortarExplode( void )
WRITE_COORD( pev->origin.z + 32 );
WRITE_COORD( pev->origin.x );
WRITE_COORD( pev->origin.y );
WRITE_COORD( pev->origin.z + 32 + pev->dmg * 2 / .2 ); // reach damage radius over .3 seconds
WRITE_COORD( pev->origin.z + 32 + pev->dmg * 2 / 0.2f ); // reach damage radius over .3 seconds
WRITE_SHORT( m_blastwave );
WRITE_BYTE( 0 ); // startframe
WRITE_BYTE( 0 ); // framerate

53
dlls/poke646/firetrail.cpp

@ -24,9 +24,9 @@ @@ -24,9 +24,9 @@
class CFireTrail : public CBaseEntity
{
public:
void Spawn(void);
void Think(void);
void Touch(CBaseEntity *pOther);
void Spawn( void );
void Think( void );
void Touch( CBaseEntity *pOther );
int ObjectCaps(void) { return FCAP_DONT_SAVE; }
int Save( CSave &save );
@ -36,7 +36,7 @@ private: @@ -36,7 +36,7 @@ private:
int m_spriteScale; // what's the exact fireball sprite scale?
};
LINK_ENTITY_TO_CLASS( fire_trail, CFireTrail );
LINK_ENTITY_TO_CLASS( fire_trail, CFireTrail )
TYPEDESCRIPTION CFireTrail::m_SaveData[] =
{
@ -47,37 +47,37 @@ IMPLEMENT_SAVERESTORE( CFireTrail, CBaseEntity ) @@ -47,37 +47,37 @@ IMPLEMENT_SAVERESTORE( CFireTrail, CBaseEntity )
void CFireTrail::Spawn( void )
{
pev->velocity = RANDOM_FLOAT(100.0f, 150.0f) * pev->angles;
pev->velocity = RANDOM_FLOAT( 100.0f, 150.0f ) * pev->angles;
if( RANDOM_LONG( 0, 1 ) )
pev->velocity.x += RANDOM_FLOAT(-300.f, -100.f);
pev->velocity.x += RANDOM_FLOAT(-300.0f, -100.0f);
else
pev->velocity.x += RANDOM_FLOAT(100.f, 300.f);
pev->velocity.x += RANDOM_FLOAT(100.0f, 300.0f);
if( RANDOM_LONG( 0, 1 ) )
pev->velocity.y += RANDOM_FLOAT(-300.f, -100.f);
pev->velocity.y += RANDOM_FLOAT(-300.0f, -100.0f);
else
pev->velocity.y += RANDOM_FLOAT(100.f, 300.f);
pev->velocity.y += RANDOM_FLOAT(100.0f, 300.0f);
if( pev->velocity.z >= 0 )
pev->velocity.z += 200;
pev->velocity.z += 200.0f;
else
pev->velocity.z -= 200;
pev->velocity.z -= 200.0f;
m_spriteScale = RANDOM_LONG( 7, 13 );
pev->movetype = MOVETYPE_BOUNCE;
pev->gravity = 0.5;
pev->nextthink = gpGlobals->time + 0.1;
pev->gravity = 0.5f;
pev->nextthink = gpGlobals->time + 0.1f;
pev->solid = SOLID_NOT;
SET_MODEL(edict(), "models/grenade.mdl"); // Need a model, just use the grenade, we don't draw it anyway
UTIL_SetSize(pev, g_vecZero, g_vecZero);
SET_MODEL( edict(), "models/grenade.mdl" ); // Need a model, just use the grenade, we don't draw it anyway
UTIL_SetSize( pev, g_vecZero, g_vecZero );
pev->effects |= EF_NODRAW;
pev->speed = RANDOM_FLOAT(0.5, 1.5);
pev->speed = RANDOM_FLOAT( 0.5f, 1.5f );
pev->maxspeed = pev->speed;
pev->angles = g_vecZero;
}
void CFireTrail::Think(void)
void CFireTrail::Think( void )
{
MESSAGE_BEGIN( MSG_PAS, SVC_TEMPENTITY, pev->origin );
WRITE_BYTE( TE_EXPLOSION);
@ -90,22 +90,23 @@ void CFireTrail::Think(void) @@ -90,22 +90,23 @@ void CFireTrail::Think(void)
WRITE_BYTE( TE_EXPLFLAG_NOSOUND );
MESSAGE_END();
pev->speed -= 0.1;
if (pev->speed > 0)
pev->nextthink = gpGlobals->time + 0.1;
pev->speed -= 0.1f;
if( pev->speed > 0 )
pev->nextthink = gpGlobals->time + 0.1f;
else
UTIL_Remove(this);
UTIL_Remove( this );
pev->flags &= ~FL_ONGROUND;
}
void CFireTrail::Touch(CBaseEntity *pOther)
void CFireTrail::Touch( CBaseEntity *pOther )
{
if (pev->flags & FL_ONGROUND)
pev->velocity = pev->velocity * 0.1;
if( pev->flags & FL_ONGROUND )
pev->velocity = pev->velocity * 0.1f;
else
pev->velocity = pev->velocity * 0.6;
pev->velocity = pev->velocity * 0.6f;
if ((pev->velocity.x*pev->velocity.x + pev->velocity.y*pev->velocity.y) < 10.0)
if( ( pev->velocity.x * pev->velocity.x + pev->velocity.y * pev->velocity.y ) < 10.0f )
pev->speed = 0;
}

2
dlls/poke646/mp3.cpp

@ -46,7 +46,7 @@ void CAmbientMP3::Spawn( void ) @@ -46,7 +46,7 @@ void CAmbientMP3::Spawn( void )
}
else
{
ALERT( at_console, "ambient_mp3 without soundfile at: %f, %f, %f, removing self...\n", pev->origin.x, pev->origin.y, pev->origin.z );
ALERT( at_console, "ambient_mp3 without soundfile at: %f, %f, %f, removing self...\n", (double)pev->origin.x, (double)pev->origin.y, (double)pev->origin.z );
UTIL_Remove( this );
}
}

1558
dlls/poke646/robocop.cpp

File diff suppressed because it is too large Load Diff

2
dlls/satchel.cpp

@ -487,7 +487,7 @@ void CPipebomb::PipebombReload() @@ -487,7 +487,7 @@ void CPipebomb::PipebombReload()
if( i < 2 )
{
m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5;
m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5f;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase();
m_chargeReady = SATCHEL_RELOAD;
}

4
dlls/shotgun.cpp

@ -155,11 +155,11 @@ void CShotgun::PrimaryAttack() @@ -155,11 +155,11 @@ void CShotgun::PrimaryAttack()
PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usSingleFire, 0.0, g_vecZero, g_vecZero, vecDir.x, vecDir.y, 0, 0, 0, 0 );
m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.2;
m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.2f;
if( m_iClip != 0 )
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 6.0f;
else
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.2;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.2f;
m_fInSpecialReload = 0;

Loading…
Cancel
Save