diff --git a/.gitignore b/.gitignore index adcc4f7b..3d6ad540 100644 --- a/.gitignore +++ b/.gitignore @@ -18,5 +18,9 @@ cmake_install.cmake *.vsproj *.sln .waf-* +waf-* +.waf3-* +waf3-* .lock* *.pyc +.vscode/ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 80c2c5d9..03d3a004 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,6 +65,10 @@ if(64BIT AND CMAKE_SIZEOF_VOID_P EQUAL 4) message(FATAL_ERROR "You enabled XASH_64BIT, but compiler can't create 64 bit code!") endif() +# Xash3D FWGS Library Naming Scheme compliance +# see documentation: https://github.com/FWGS/xash3d-fwgs/blob/master/Documentation/library-naming.md +include(LibraryNaming) + if(64BIT) message(STATUS "Building for 64 Bit") else() @@ -86,6 +90,12 @@ if(${CMAKE_VERSION} VERSION_LESS "3.0.2") endmacro() endif() +if(NOT MSVC) + #add_compile_options(-Wempty-body) # GCC/Clang flag + add_compile_options(-Wreturn-type) # GCC/Clang flag +endif() + + if(BUILD_CLIENT) add_subdirectory(cl_dll) endif() diff --git a/README.md b/README.md index be0a5fa8..fe9e883f 100644 --- a/README.md +++ b/README.md @@ -43,19 +43,12 @@ There're dsp projects for Visual Studio 6 in `cl_dll` and `dlls` directories, bu TODO -### Linux +### Unix-like - (cd dlls && make) - (cd cl_dll && make) +To use waf, you need to install python (2.7 minimum) -### OS X - -Nothing here. - -### FreeBSD - - (cd dlls && gmake CXX=clang++ CC=clang) - (cd cl_dll && gmake CXX=clang++ CC=clang) + (./waf configure -T release) + (./waf) ### Android @@ -68,9 +61,9 @@ To enable building the goldsource compatible client library add GOLDSOURCE_SUPPO cmake .. -DGOLDSOURCE_SUPPORT=ON -or when using make without cmake: +or when using waf: - make GOLDSOURCE_SUPPORT=1 + ./waf configure -T release --enable-goldsrc-support Unlike original client by Valve the resulting client library will not depend on vgui or SDL2 just like the one that's used in FWGS Xash3d. diff --git a/cl_dll/CMakeLists.txt b/cl_dll/CMakeLists.txt index 1143eefe..cde35d14 100644 --- a/cl_dll/CMakeLists.txt +++ b/cl_dll/CMakeLists.txt @@ -25,6 +25,11 @@ project (CLDLL) set (CLDLL_LIBRARY client) +include(CheckIncludeFile) +check_include_file("tgmath.h" HAVE_TGMATH_H) +if(HAVE_TGMATH_H) + add_definitions(-DHAVE_TGMATH_H) +endif() add_definitions(-DCLIENT_WEAPONS -DCLIENT_DLL) @@ -125,15 +130,15 @@ if (GOLDSOURCE_SUPPORT) target_link_libraries( ${CLDLL_LIBRARY} ${CMAKE_DL_LIBS} ) endif() +if(WIN32) + target_link_libraries( ${CLDLL_LIBRARY} user32.lib ) +endif() + set_target_properties (${CLDLL_LIBRARY} PROPERTIES POSITION_INDEPENDENT_CODE 1) if(APPLE OR WIN32 OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux") set(CLDLL_NAME "client") - if(64BIT) - set(CLDLL_NAME "client64") - endif() - set_target_properties(${CLDLL_LIBRARY} PROPERTIES OUTPUT_NAME ${CLDLL_NAME} PREFIX "") diff --git a/cl_dll/GameStudioModelRenderer.cpp b/cl_dll/GameStudioModelRenderer.cpp index 570b3375..f32def43 100644 --- a/cl_dll/GameStudioModelRenderer.cpp +++ b/cl_dll/GameStudioModelRenderer.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include "studio_util.h" #include "r_studioint.h" diff --git a/cl_dll/GameStudioModelRenderer_Sample.cpp b/cl_dll/GameStudioModelRenderer_Sample.cpp index ee8e8f9c..8910d809 100644 --- a/cl_dll/GameStudioModelRenderer_Sample.cpp +++ b/cl_dll/GameStudioModelRenderer_Sample.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include "studio_util.h" #include "r_studioint.h" diff --git a/cl_dll/MOTD.cpp b/cl_dll/MOTD.cpp index 439fb9c4..7947a15f 100644 --- a/cl_dll/MOTD.cpp +++ b/cl_dll/MOTD.cpp @@ -80,13 +80,13 @@ int CHudMOTD::Draw( float fTime ) { ypos = ROW_RANGE_MIN + 7 + scroll; if( ypos > ROW_RANGE_MIN + 4 ) - scroll-= ( ypos - ( ROW_RANGE_MIN + 4 ) ) / 3.0; + scroll-= ( ypos - ( ROW_RANGE_MIN + 4 ) ) / 3.0f; if( ypos + height < ROW_RANGE_MAX ) - scroll+= ( ROW_RANGE_MAX - ( ypos + height ) ) / 3.0; + scroll+= ( ROW_RANGE_MAX - ( ypos + height ) ) / 3.0f; ypos_r = ROW_RANGE_MIN; height = ROW_RANGE_MAX; } - int ymax = ypos + height; + // int ymax = ypos + height; if( xmax > ScreenWidth - 30 ) xmax = ScreenWidth - 30; gHUD.DrawDarkRectangle( xpos - 5, ypos_r - 5, xmax - xpos + 10, height + 10 ); while( *ch ) @@ -157,7 +157,7 @@ int CHudMOTD::MsgFunc_MOTD( const char *pszName, int iSize, void *pbuf ) if( length > m_iMaxLength ) { m_iMaxLength = length; - length = 0; + // length = 0; } m_bShow = true; } diff --git a/cl_dll/Makefile b/cl_dll/Makefile deleted file mode 100644 index 0ff4dadf..00000000 --- a/cl_dll/Makefile +++ /dev/null @@ -1,93 +0,0 @@ -CC?=gcc -CXX?=g++ -SRCS+=../dlls/crossbow.cpp -SRCS+=../dlls/crowbar.cpp -SRCS+=../dlls/egon.cpp -SRCS+=./ev_hldm.cpp -SRCS+=../dlls/gauss.cpp -SRCS+=../dlls/handgrenade.cpp -SRCS+=./hl/hl_baseentity.cpp -SRCS+=./hl/hl_events.cpp -SRCS+=./hl/hl_objects.cpp -SRCS+=./hl/hl_weapons.cpp -SRCS+=../dlls/glock.cpp -SRCS+=../dlls/hornetgun.cpp -#SRCS+=../common/interface.cpp -SRCS+=../dlls/mp5.cpp -SRCS+=../dlls/python.cpp -SRCS+=../dlls/rpg.cpp -SRCS+=../dlls/satchel.cpp -SRCS+=../dlls/shotgun.cpp -SRCS+=../dlls/squeakgrenade.cpp -SRCS+=../dlls/tripmine.cpp -#SRCS+=../game_shared/voice_banmgr.cpp -#SRCS+=../game_shared/voice_status.cpp -SRCS+=./ammo.cpp -SRCS+=./ammo_secondary.cpp -SRCS+=./ammohistory.cpp -SRCS+=./battery.cpp -SRCS+=./cdll_int.cpp -SRCS+=./com_weapons.cpp -SRCS+=./death.cpp -SRCS+=./demo.cpp -SRCS+=./entity.cpp -SRCS+=./ev_common.cpp -SRCS+=./events.cpp -SRCS+=./flashlight.cpp -SRCS+=./GameStudioModelRenderer.cpp -SRCS+=./geiger.cpp -SRCS+=./health.cpp -SRCS+=./hud.cpp -SRCS+=./hud_msg.cpp -SRCS+=./hud_redraw.cpp -#SRCS+=./hud_servers.cpp -SRCS+=./hud_spectator.cpp -SRCS+=./hud_update.cpp -SRCS+=./in_camera.cpp -SRCS+=./input.cpp -SRCS+=./input_mouse.cpp -SRCS+=./input_goldsource.cpp -SRCS+=./menu.cpp -SRCS+=./message.cpp -SRCS+=./overview.cpp -SRCS+=./parsemsg.cpp -SRCS_C+=../pm_shared/pm_debug.c -SRCS_C+=../pm_shared/pm_math.c -SRCS_C+=../pm_shared/pm_shared.c -SRCS+=./saytext.cpp -SRCS+=./status_icons.cpp -SRCS+=./statusbar.cpp -SRCS+=./studio_util.cpp -SRCS+=./StudioModelRenderer.cpp -SRCS+=./text_message.cpp -SRCS+=./train.cpp -SRCS+=./tri.cpp -SRCS+=./util.cpp -SRCS+=./view.cpp -SRCS+=./input_xash3d.cpp -SRCS+=./scoreboard.cpp -SRCS+=./MOTD.cpp -INCLUDES = -I../common -I. -I../game_shared -I../pm_shared -I../engine -I../dlls -I../utils/false_vgui/include -DEFINES = -Wno-write-strings -Dstricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -DCLIENT_WEAPONS -DCLIENT_DLL -CFLAGS = -m32 -OBJS = $(SRCS:.cpp=.o) $(SRCS_C:.c=.o) - -LIBS=-lm -ifeq ($(GOLDSOURCE_SUPPORT),1) - DEFINES += -DGOLDSOURCE_SUPPORT -endif - -ifeq ($(shell uname -s),Linux) - LIBS += -ldl -endif - -%.o : %.c - $(CC) $(CFLAGS) $(INCLUDES) $(DEFINES) -fPIC -c $< -o $@ - -%.o : %.cpp - $(CXX) $(CFLAGS) $(INCLUDES) $(DEFINES) -fPIC -c $< -o $@ -client.so : $(OBJS) - $(CXX) $(CFLAGS) $(OBJS) -o client.so -shared -Wl,--no-undefined -fPIC $(LIBS) - -clean: - $(RM) $(OBJS) diff --git a/cl_dll/StudioModelRenderer.cpp b/cl_dll/StudioModelRenderer.cpp index a9859244..1994c2a7 100644 --- a/cl_dll/StudioModelRenderer.cpp +++ b/cl_dll/StudioModelRenderer.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include "studio_util.h" #include "r_studioint.h" @@ -138,27 +138,27 @@ void CStudioModelRenderer::StudioCalcBoneAdj( float dadt, float *adj, const byte int a, b; a = ( pcontroller1[j] + 128 ) % 256; b = ( pcontroller2[j] + 128 ) % 256; - value = ( ( a * dadt ) + ( b * ( 1 - dadt ) ) - 128 ) * ( 360.0 / 256.0 ) + pbonecontroller[j].start; + value = ( ( a * dadt ) + ( b * ( 1.0f - dadt ) ) - 128.0f ) * ( 360.0f / 256.0f ) + pbonecontroller[j].start; } else { - value = ( ( pcontroller1[i] * dadt + ( pcontroller2[i] ) * ( 1.0 - dadt ) ) ) * ( 360.0 / 256.0 ) + pbonecontroller[j].start; + value = ( ( pcontroller1[i] * dadt + ( pcontroller2[i] ) * ( 1.0f - dadt ) ) ) * ( 360.0f / 256.0f ) + pbonecontroller[j].start; } } else { - value = ( pcontroller1[i] * dadt + pcontroller2[i] * ( 1.0 - dadt ) ) / 255.0; - if( value < 0 ) value = 0; - if( value > 1.0 ) value = 1.0; - value = ( 1.0 - value ) * pbonecontroller[j].start + value * pbonecontroller[j].end; + value = ( pcontroller1[i] * dadt + pcontroller2[i] * ( 1.0f - dadt ) ) / 255.0f; + if( value < 0.0f ) value = 0.0f; + if( value > 1.0f ) value = 1.0f; + value = ( 1.0f - value ) * pbonecontroller[j].start + value * pbonecontroller[j].end; } // Con_DPrintf( "%d %d %f : %f\n", m_pCurrentEntity->curstate.controller[j], m_pCurrentEntity->latched.prevcontroller[j], value, dadt ); } else { - value = mouthopen / 64.0; - if( value > 1.0 ) value = 1.0; - value = ( 1.0 - value ) * pbonecontroller[j].start + value * pbonecontroller[j].end; + value = mouthopen / 64.0f; + if( value > 1.0f ) value = 1.0f; + value = ( 1.0f - value ) * pbonecontroller[j].start + value * pbonecontroller[j].end; // Con_DPrintf( "%d %f\n", mouthopen, value ); } switch( pbonecontroller[j].type & STUDIO_TYPES ) @@ -166,7 +166,7 @@ void CStudioModelRenderer::StudioCalcBoneAdj( float dadt, float *adj, const byte case STUDIO_XR: case STUDIO_YR: case STUDIO_ZR: - adj[j] = value * ( M_PI / 180.0 ); + adj[j] = value * ( M_PI_F / 180.0f ); break; case STUDIO_X: case STUDIO_Y: @@ -305,7 +305,7 @@ void CStudioModelRenderer::StudioCalcBonePosition( int frame, float s, mstudiobo // and there's more data in the span if( panimvalue->num.valid > k + 1 ) { - pos[j] += ( panimvalue[k + 1].value * ( 1.0 - s ) + s * panimvalue[k + 2].value ) * pbone->scale[j]; + pos[j] += ( panimvalue[k + 1].value * ( 1.0f - s ) + s * panimvalue[k + 2].value ) * pbone->scale[j]; } else { @@ -317,7 +317,7 @@ void CStudioModelRenderer::StudioCalcBonePosition( int frame, float s, mstudiobo // are we at the end of the repeating values section and there's another section with data? if( panimvalue->num.total <= k + 1 ) { - pos[j] += ( panimvalue[panimvalue->num.valid].value * ( 1.0 - s ) + s * panimvalue[panimvalue->num.valid + 2].value ) * pbone->scale[j]; + pos[j] += ( panimvalue[panimvalue->num.valid].value * ( 1.0f - s ) + s * panimvalue[panimvalue->num.valid + 2].value ) * pbone->scale[j]; } else { @@ -344,12 +344,12 @@ void CStudioModelRenderer::StudioSlerpBones( vec4_t q1[], float pos1[][3], vec4_ vec4_t q3; float s1; - if( s < 0 ) - s = 0; - else if( s > 1.0 ) - s = 1.0; + if( s < 0.0f ) + s = 0.0f; + else if( s > 1.0f ) + s = 1.0f; - s1 = 1.0 - s; + s1 = 1.0f - s; for( i = 0; i < m_pStudioHeader->numbones; i++ ) { @@ -410,17 +410,17 @@ void CStudioModelRenderer::StudioPlayerBlend( mstudioseqdesc_t *pseqdesc, int *p *pBlend = ( *pPitch * 3 ); if( *pBlend < pseqdesc->blendstart[0] ) { - *pPitch -= pseqdesc->blendstart[0] / 3.0; + *pPitch -= pseqdesc->blendstart[0] / 3.0f; *pBlend = 0; } else if( *pBlend > pseqdesc->blendend[0] ) { - *pPitch -= pseqdesc->blendend[0] / 3.0; + *pPitch -= pseqdesc->blendend[0] / 3.0f; *pBlend = 255; } else { - if( pseqdesc->blendend[0] - pseqdesc->blendstart[0] < 0.1 ) // catch qc error + if( pseqdesc->blendend[0] - pseqdesc->blendstart[0] < 0.1f ) // catch qc error *pBlend = 127; else *pBlend = 255 * ( *pBlend - pseqdesc->blendstart[0] ) / ( pseqdesc->blendend[0] - pseqdesc->blendstart[0] ); @@ -475,11 +475,11 @@ void CStudioModelRenderer::StudioSetUpTransform( int trivial_accept ) if( m_fDoInterp ) { // ugly hack to interpolate angle, position. current is reached 0.1 seconds after being set - f = f - 1.0; + f = f - 1.0f; } else { - f = 0; + f = 0.0f; } for( i = 0; i < 3; i++ ) @@ -489,7 +489,7 @@ void CStudioModelRenderer::StudioSetUpTransform( int trivial_accept ) // NOTE: Because multiplayer lag can be relatively large, we don't want to cap // f at 1.5 anymore. - //if( f > -1.0 && f < 1.5 ) {} + //if( f > -1.0f && f < 1.5f ) {} //Con_DPrintf( "%.0f %.0f\n",m_pCurrentEntity->msg_angles[0][YAW], m_pCurrentEntity->msg_angles[1][YAW] ); for( i = 0; i < 3; i++ ) { @@ -499,13 +499,13 @@ void CStudioModelRenderer::StudioSetUpTransform( int trivial_accept ) ang2 = m_pCurrentEntity->latched.prevangles[i]; d = ang1 - ang2; - if( d > 180 ) + if( d > 180.0f ) { - d -= 360; + d -= 360.0f; } - else if( d < -180 ) + else if( d < -180.0f ) { - d += 360; + d += 360.0f; } angles[i] += d * f; @@ -547,9 +547,9 @@ void CStudioModelRenderer::StudioSetUpTransform( int trivial_accept ) { for( i = 0; i < 4; i++ ) { - (*m_paliastransform)[0][i] *= m_fSoftwareXScale * ( 1.0 / ( ZISCALE * 0x10000 ) ); - (*m_paliastransform)[1][i] *= m_fSoftwareYScale * ( 1.0 / ( ZISCALE * 0x10000 ) ); - (*m_paliastransform)[2][i] *= 1.0 / ( ZISCALE * 0x10000 ); + (*m_paliastransform)[0][i] *= m_fSoftwareXScale * ( 1.0f / ( ZISCALE * 0x10000 ) ); + (*m_paliastransform)[1][i] *= m_fSoftwareYScale * ( 1.0f / ( ZISCALE * 0x10000 ) ); + (*m_paliastransform)[2][i] *= 1.0f / ( ZISCALE * 0x10000 ); } } } @@ -567,14 +567,14 @@ StudioEstimateInterpolant */ float CStudioModelRenderer::StudioEstimateInterpolant( void ) { - float dadt = 1.0; + float dadt = 1.0f; - if( m_fDoInterp && ( m_pCurrentEntity->curstate.animtime >= m_pCurrentEntity->latched.prevanimtime + 0.01 ) ) + if( m_fDoInterp && ( m_pCurrentEntity->curstate.animtime >= m_pCurrentEntity->latched.prevanimtime + 0.01f ) ) { - dadt = ( m_clTime - m_pCurrentEntity->curstate.animtime ) / 0.1; - if( dadt > 2.0 ) + dadt = ( m_clTime - m_pCurrentEntity->curstate.animtime ) / 0.1f; + if( dadt > 2.0f ) { - dadt = 2.0; + dadt = 2.0f; } } return dadt; @@ -598,14 +598,14 @@ void CStudioModelRenderer::StudioCalcRotations( float pos[][3], vec4_t *q, mstud if( f > pseqdesc->numframes - 1 ) { - f = 0; // bah, fix this bug with changing sequences too fast + f = 0.0f; // bah, fix this bug with changing sequences too fast } // BUG ( somewhere else ) but this code should validate this data. // This could cause a crash if the frame # is negative, so we'll go ahead // and clamp it here - else if( f < -0.01 ) + else if( f < -0.01f ) { - f = -0.01; + f = -0.01f; } frame = (int)f; @@ -635,18 +635,18 @@ void CStudioModelRenderer::StudioCalcRotations( float pos[][3], vec4_t *q, mstud if( pseqdesc->motiontype & STUDIO_X ) { - pos[pseqdesc->motionbone][0] = 0.0; + pos[pseqdesc->motionbone][0] = 0.0f; } if( pseqdesc->motiontype & STUDIO_Y ) { - pos[pseqdesc->motionbone][1] = 0.0; + pos[pseqdesc->motionbone][1] = 0.0f; } if( pseqdesc->motiontype & STUDIO_Z ) { - pos[pseqdesc->motionbone][2] = 0.0; + pos[pseqdesc->motionbone][2] = 0.0f; } - s = 0 * ( ( 1.0 - ( f - (int)( f ) ) ) / ( pseqdesc->numframes ) ) * m_pCurrentEntity->curstate.framerate; + s = 0 * ( ( 1.0f - ( f - (int)( f ) ) ) / ( pseqdesc->numframes ) ) * m_pCurrentEntity->curstate.framerate; if( pseqdesc->motiontype & STUDIO_LX ) { @@ -679,15 +679,15 @@ void CStudioModelRenderer::StudioFxTransform( cl_entity_t *ent, float transform[ int axis = gEngfuncs.pfnRandomLong( 0, 1 ); if( axis == 1 ) // Choose between x & z axis = 2; - VectorScale( transform[axis], gEngfuncs.pfnRandomFloat( 1, 1.484 ), transform[axis] ); + VectorScale( transform[axis], gEngfuncs.pfnRandomFloat( 1.0f, 1.484f ), transform[axis] ); } else if( gEngfuncs.pfnRandomLong( 0, 49 ) == 0 ) { float offset; - int axis = gEngfuncs.pfnRandomLong(0,1); + /*int axis = gEngfuncs.pfnRandomLong(0,1); if( axis == 1 ) // Choose between x & z - axis = 2; - offset = gEngfuncs.pfnRandomFloat( -10, 10 ); + axis = 2;*/ + offset = gEngfuncs.pfnRandomFloat( -10.0f, 10.0f ); transform[gEngfuncs.pfnRandomLong( 0, 2 )][3] += offset; } break; @@ -695,7 +695,7 @@ void CStudioModelRenderer::StudioFxTransform( cl_entity_t *ent, float transform[ { float scale; - scale = 1.0 + ( m_clTime - ent->curstate.animtime ) * 10.0; + scale = 1.0f + ( m_clTime - ent->curstate.animtime ) * 10.0f; if( scale > 2 ) // Don't blow up more than 200% scale = 2; transform[0][1] *= scale; @@ -734,7 +734,7 @@ float CStudioModelRenderer::StudioEstimateFrame( mstudioseqdesc_t *pseqdesc ) if( pseqdesc->numframes <= 1 ) { - f = 0; + f = 0.0; } else { @@ -1188,10 +1188,10 @@ void CStudioModelRenderer::StudioEstimateGait( entity_state_t *pplayer ) vec3_t est_velocity; dt = ( m_clTime - m_clOldTime ); - if( dt < 0 ) - dt = 0; - else if( dt > 1.0 ) - dt = 1; + if( dt < 0.0f ) + dt = 0.0f; + else if( dt > 1.0f ) + dt = 1.0f; if( dt == 0 || m_pPlayerInfo->renderframe == m_nFrameCount ) { @@ -1221,29 +1221,29 @@ void CStudioModelRenderer::StudioEstimateGait( entity_state_t *pplayer ) if( est_velocity[1] == 0 && est_velocity[0] == 0 ) { float flYawDiff = m_pCurrentEntity->angles[YAW] - m_pPlayerInfo->gaityaw; - flYawDiff = flYawDiff - (int)( flYawDiff / 360 ) * 360; - if( flYawDiff > 180 ) - flYawDiff -= 360; - if( flYawDiff < -180 ) - flYawDiff += 360; + flYawDiff = flYawDiff - (int)( flYawDiff / 360.0f ) * 360.0f; + if( flYawDiff > 180.0f ) + flYawDiff -= 360.0f; + if( flYawDiff < -180.0f ) + flYawDiff += 360.0f; - if( dt < 0.25 ) - flYawDiff *= dt * 4; + if( dt < 0.25f ) + flYawDiff *= dt * 4.0f; else flYawDiff *= dt; m_pPlayerInfo->gaityaw += flYawDiff; - m_pPlayerInfo->gaityaw = m_pPlayerInfo->gaityaw - (int)( m_pPlayerInfo->gaityaw / 360 ) * 360; + m_pPlayerInfo->gaityaw = m_pPlayerInfo->gaityaw - (int)( m_pPlayerInfo->gaityaw / 360.0f ) * 360.0f; m_flGaitMovement = 0; } else { - m_pPlayerInfo->gaityaw = ( atan2( est_velocity[1], est_velocity[0] ) * 180 / M_PI ); - if( m_pPlayerInfo->gaityaw > 180 ) - m_pPlayerInfo->gaityaw = 180; - if( m_pPlayerInfo->gaityaw < -180 ) - m_pPlayerInfo->gaityaw = -180; + m_pPlayerInfo->gaityaw = ( atan2( est_velocity[1], est_velocity[0] ) * 180.0f / M_PI_F ); + if( m_pPlayerInfo->gaityaw > 180.0f ) + m_pPlayerInfo->gaityaw = 180.0f; + if( m_pPlayerInfo->gaityaw < -180.0f ) + m_pPlayerInfo->gaityaw = -180.0f; } } @@ -1277,10 +1277,10 @@ void CStudioModelRenderer::StudioProcessGait( entity_state_t *pplayer ) // Con_DPrintf( "%f %d\n", m_pCurrentEntity->angles[PITCH], m_pCurrentEntity->blending[0] ); dt = ( m_clTime - m_clOldTime ); - if( dt < 0 ) - dt = 0; - else if( dt > 1.0 ) - dt = 1; + if( dt < 0.0f ) + dt = 0.0f; + else if( dt > 1.0f ) + dt = 1.0f; StudioEstimateGait( pplayer ); @@ -1288,38 +1288,38 @@ void CStudioModelRenderer::StudioProcessGait( entity_state_t *pplayer ) // calc side to side turning flYaw = m_pCurrentEntity->angles[YAW] - m_pPlayerInfo->gaityaw; - flYaw = flYaw - (int)( flYaw / 360 ) * 360; - if( flYaw < -180 ) - flYaw = flYaw + 360; - if( flYaw > 180 ) - flYaw = flYaw - 360; + flYaw = flYaw - (int)( flYaw / 360.0f ) * 360.0f; + if( flYaw < -180.0f ) + flYaw = flYaw + 360.0f; + if( flYaw > 180.0f ) + flYaw = flYaw - 360.0f; - if( flYaw > 120 ) + if( flYaw > 120.0f ) { - m_pPlayerInfo->gaityaw = m_pPlayerInfo->gaityaw - 180; + m_pPlayerInfo->gaityaw = m_pPlayerInfo->gaityaw - 180.0f; m_flGaitMovement = -m_flGaitMovement; - flYaw = flYaw - 180; + flYaw = flYaw - 180.0f; } - else if( flYaw < -120 ) + else if( flYaw < -120.0f ) { - m_pPlayerInfo->gaityaw = m_pPlayerInfo->gaityaw + 180; + m_pPlayerInfo->gaityaw = m_pPlayerInfo->gaityaw + 180.0f; m_flGaitMovement = -m_flGaitMovement; - flYaw = flYaw + 180; + flYaw = flYaw + 180.0f; } // adjust torso - m_pCurrentEntity->curstate.controller[0] = ( ( flYaw / 4.0 ) + 30 ) / ( 60.0 / 255.0 ); - m_pCurrentEntity->curstate.controller[1] = ( ( flYaw / 4.0 ) + 30 ) / ( 60.0 / 255.0 ); - m_pCurrentEntity->curstate.controller[2] = ( ( flYaw / 4.0 ) + 30 ) / ( 60.0 / 255.0 ); - m_pCurrentEntity->curstate.controller[3] = ( ( flYaw / 4.0 ) + 30 ) / ( 60.0 / 255.0 ); + m_pCurrentEntity->curstate.controller[0] = ( ( flYaw / 4.0f ) + 30.0f ) / ( 60.0f / 255.0f ); + m_pCurrentEntity->curstate.controller[1] = ( ( flYaw / 4.0f ) + 30.0f ) / ( 60.0f / 255.0f ); + m_pCurrentEntity->curstate.controller[2] = ( ( flYaw / 4.0f ) + 30.0f ) / ( 60.0f / 255.0f ); + m_pCurrentEntity->curstate.controller[3] = ( ( flYaw / 4.0f ) + 30.0f ) / ( 60.0f / 255.0f ); m_pCurrentEntity->latched.prevcontroller[0] = m_pCurrentEntity->curstate.controller[0]; m_pCurrentEntity->latched.prevcontroller[1] = m_pCurrentEntity->curstate.controller[1]; m_pCurrentEntity->latched.prevcontroller[2] = m_pCurrentEntity->curstate.controller[2]; m_pCurrentEntity->latched.prevcontroller[3] = m_pCurrentEntity->curstate.controller[3]; m_pCurrentEntity->angles[YAW] = m_pPlayerInfo->gaityaw; - if( m_pCurrentEntity->angles[YAW] < -0 ) - m_pCurrentEntity->angles[YAW] += 360; + if( m_pCurrentEntity->angles[YAW] < -0.0f ) + m_pCurrentEntity->angles[YAW] += 360.0f; m_pCurrentEntity->latched.prevangles[YAW] = m_pCurrentEntity->angles[YAW]; if( pplayer->gaitsequence >= m_pStudioHeader->numseq ) diff --git a/cl_dll/ammo.cpp b/cl_dll/ammo.cpp index 4104acff..7be34e23 100644 --- a/cl_dll/ammo.cpp +++ b/cl_dll/ammo.cpp @@ -77,7 +77,7 @@ void WeaponsResource::LoadWeaponSprites( WEAPON *pWeapon ) else iRes = 640; - char sz[128]; + char sz[256]; if( !pWeapon ) return; @@ -152,7 +152,7 @@ void WeaponsResource::LoadWeaponSprites( WEAPON *pWeapon ) pWeapon->hInactive = SPR_Load( sz ); pWeapon->rcInactive = p->rc; - gHR.iHistoryGap = max( gHR.iHistoryGap, pWeapon->rcActive.bottom - pWeapon->rcActive.top ); + gHR.iHistoryGap = Q_max( gHR.iHistoryGap, pWeapon->rcActive.bottom - pWeapon->rcActive.top ); } else pWeapon->hInactive = 0; @@ -174,7 +174,7 @@ void WeaponsResource::LoadWeaponSprites( WEAPON *pWeapon ) pWeapon->hAmmo = SPR_Load( sz ); pWeapon->rcAmmo = p->rc; - gHR.iHistoryGap = max( gHR.iHistoryGap, pWeapon->rcActive.bottom - pWeapon->rcActive.top ); + gHR.iHistoryGap = Q_max( gHR.iHistoryGap, pWeapon->rcActive.bottom - pWeapon->rcActive.top ); } else pWeapon->hAmmo = 0; @@ -186,7 +186,7 @@ void WeaponsResource::LoadWeaponSprites( WEAPON *pWeapon ) pWeapon->hAmmo2 = SPR_Load( sz ); pWeapon->rcAmmo2 = p->rc; - gHR.iHistoryGap = max( gHR.iHistoryGap, pWeapon->rcActive.bottom - pWeapon->rcActive.top ); + gHR.iHistoryGap = Q_max( gHR.iHistoryGap, pWeapon->rcActive.bottom - pWeapon->rcActive.top ); } else pWeapon->hAmmo2 = 0; @@ -320,7 +320,7 @@ int CHudAmmo::VidInit( void ) giBucketWidth = gHUD.GetSpriteRect( m_HUD_bucket0 ).right - gHUD.GetSpriteRect( m_HUD_bucket0 ).left; giBucketHeight = gHUD.GetSpriteRect( m_HUD_bucket0 ).bottom - gHUD.GetSpriteRect( m_HUD_bucket0 ).top; - gHR.iHistoryGap = max( gHR.iHistoryGap, gHUD.GetSpriteRect( m_HUD_bucket0 ).bottom - gHUD.GetSpriteRect( m_HUD_bucket0 ).top ); + gHR.iHistoryGap = Q_max( gHR.iHistoryGap, gHUD.GetSpriteRect( m_HUD_bucket0 ).bottom - gHUD.GetSpriteRect( m_HUD_bucket0 ).top ); // If we've already loaded weapons, let's get new sprites gWR.LoadAllWeaponSprites(); @@ -861,10 +861,10 @@ int CHudAmmo::Draw( float flTime ) AmmoWidth = gHUD.GetSpriteRect( gHUD.m_HUD_number_0 ).right - gHUD.GetSpriteRect( gHUD.m_HUD_number_0 ).left; - a = (int)max( MIN_ALPHA, m_fFade ); + a = (int)Q_max( MIN_ALPHA, m_fFade ); if( m_fFade > 0 ) - m_fFade -= ( gHUD.m_flTimeDelta * 20 ); + m_fFade -= ( (float)gHUD.m_flTimeDelta * 20.0f ); UnpackRGB( r, g, b, RGB_YELLOWISH ); diff --git a/cl_dll/ammo_secondary.cpp b/cl_dll/ammo_secondary.cpp index 148d29b7..4034c86f 100644 --- a/cl_dll/ammo_secondary.cpp +++ b/cl_dll/ammo_secondary.cpp @@ -61,9 +61,9 @@ int CHudAmmoSecondary::Draw( float flTime ) // draw secondary ammo icons above normal ammo readout int a, x, y, r, g, b, AmmoWidth; UnpackRGB( r, g, b, RGB_YELLOWISH ); - a = (int)max( MIN_ALPHA, m_fFade ); + a = (int)Q_max( MIN_ALPHA, m_fFade ); if( m_fFade > 0 ) - m_fFade -= ( gHUD.m_flTimeDelta * 20 ); // slowly lower alpha to fade out icons + m_fFade -= ( (float)gHUD.m_flTimeDelta * 20.0f ); // slowly lower alpha to fade out icons ScaleColors( r, g, b, a ); AmmoWidth = gHUD.GetSpriteRect( gHUD.m_HUD_number_0 ).right - gHUD.GetSpriteRect( gHUD.m_HUD_number_0 ).left; @@ -142,7 +142,7 @@ int CHudAmmoSecondary::MsgFunc_SecAmmoVal( const char *pszName, int iSize, void int count = 0; for( int i = 0; i < MAX_SEC_AMMO_VALUES; i++ ) { - count += max( 0, m_iAmmoAmounts[i] ); + count += Q_max( 0, m_iAmmoAmounts[i] ); } if( count == 0 ) diff --git a/cl_dll/ammohistory.cpp b/cl_dll/ammohistory.cpp index 4b1e6745..a3961da7 100644 --- a/cl_dll/ammohistory.cpp +++ b/cl_dll/ammohistory.cpp @@ -111,7 +111,7 @@ int HistoryResource::DrawAmmoHistory( float flTime ) { if( rgAmmoHistory[i].type ) { - rgAmmoHistory[i].DisplayTime = min( rgAmmoHistory[i].DisplayTime, gHUD.m_flTime + HISTORY_DRAW_TIME ); + rgAmmoHistory[i].DisplayTime = Q_min( rgAmmoHistory[i].DisplayTime, gHUD.m_flTime + HISTORY_DRAW_TIME ); if( rgAmmoHistory[i].DisplayTime <= flTime ) { @@ -127,7 +127,7 @@ int HistoryResource::DrawAmmoHistory( float flTime ) int r, g, b; UnpackRGB( r, g, b, RGB_YELLOWISH ); float scale = ( rgAmmoHistory[i].DisplayTime - flTime ) * 80; - ScaleColors( r, g, b, min( scale, 255 ) ); + ScaleColors( r, g, b, Q_min( scale, 255 ) ); // Draw the pic int ypos = ScreenHeight - (AMMO_PICKUP_PICK_HEIGHT + (AMMO_PICKUP_GAP * i)); @@ -158,7 +158,7 @@ int HistoryResource::DrawAmmoHistory( float flTime ) UnpackRGB( r, g, b, RGB_REDISH ); // if the weapon doesn't have ammo, display it as red float scale = ( rgAmmoHistory[i].DisplayTime - flTime ) * 80; - ScaleColors( r, g, b, min( scale, 255 ) ); + ScaleColors( r, g, b, Q_min( scale, 255 ) ); int ypos = ScreenHeight - ( AMMO_PICKUP_PICK_HEIGHT + ( AMMO_PICKUP_GAP * i ) ); int xpos = ScreenWidth - ( weap->rcInactive.right - weap->rcInactive.left ); @@ -176,7 +176,7 @@ int HistoryResource::DrawAmmoHistory( float flTime ) UnpackRGB( r, g, b, RGB_YELLOWISH ); float scale = ( rgAmmoHistory[i].DisplayTime - flTime ) * 80; - ScaleColors( r, g, b, min( scale, 255 ) ); + ScaleColors( r, g, b, Q_min( scale, 255 ) ); int ypos = ScreenHeight - ( AMMO_PICKUP_PICK_HEIGHT + ( AMMO_PICKUP_GAP * i ) ); int xpos = ScreenWidth - ( rect.right - rect.left ) - 10; diff --git a/cl_dll/battery.cpp b/cl_dll/battery.cpp index 2f26057f..b6cd9e0b 100644 --- a/cl_dll/battery.cpp +++ b/cl_dll/battery.cpp @@ -78,7 +78,7 @@ int CHudBattery::Draw( float flTime ) wrect_t rc; rc = *m_prc2; - rc.top += m_iHeight * ( (float)( 100 - ( min( 100,m_iBat ) ) ) * 0.01 ); // battery can go from 0 to 100 so * 0.01 goes from 0 to 1 + rc.top += m_iHeight * ( (float)( 100 - ( Q_min( 100, m_iBat ) ) ) * 0.01f ); // battery can go from 0 to 100 so * 0.01 goes from 0 to 1 UnpackRGB( r, g, b, RGB_YELLOWISH ); @@ -91,7 +91,7 @@ int CHudBattery::Draw( float flTime ) if( m_fFade > FADE_TIME ) m_fFade = FADE_TIME; - m_fFade -= ( gHUD.m_flTimeDelta * 20 ); + m_fFade -= ( (float)gHUD.m_flTimeDelta * 20.0f ); if( m_fFade <= 0 ) { a = 128; diff --git a/cl_dll/cdll_int.cpp b/cl_dll/cdll_int.cpp index 45bbcd67..29edfbde 100644 --- a/cl_dll/cdll_int.cpp +++ b/cl_dll/cdll_int.cpp @@ -124,7 +124,7 @@ HUD_ConnectionlessPacket int DLLEXPORT HUD_ConnectionlessPacket( const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size ) { // Parse stuff from args - int max_buffer_size = *response_buffer_size; + // int max_buffer_size = *response_buffer_size; // Zero it out since we aren't going to respond. // If we wanted to response, we'd write data into response_buffer diff --git a/cl_dll/cl_util.h b/cl_dll/cl_util.h index 0cb65f32..7ba3bc7e 100644 --- a/cl_dll/cl_util.h +++ b/cl_dll/cl_util.h @@ -148,8 +148,8 @@ inline void CenterPrint( const char *string ) inline void PlaySound( const char *szSound, float vol ) { gEngfuncs.pfnPlaySoundByName( szSound, vol ); } inline void PlaySound( int iSound, float vol ) { gEngfuncs.pfnPlaySoundByIndex( iSound, vol ); } -#define max(a, b) (((a) > (b)) ? (a) : (b)) -#define min(a, b) (((a) < (b)) ? (a) : (b)) +#define Q_max(a, b) (((a) > (b)) ? (a) : (b)) +#define Q_min(a, b) (((a) < (b)) ? (a) : (b)) #define fabs(x) ((x) > 0 ? (x) : 0 - (x)) void ScaleColors( int &r, int &g, int &b, int a ); diff --git a/cl_dll/com_weapons.cpp b/cl_dll/com_weapons.cpp index 198c533a..4b9ae338 100644 --- a/cl_dll/com_weapons.cpp +++ b/cl_dll/com_weapons.cpp @@ -161,7 +161,7 @@ Always 0.0 on client, even if not predicting weapons ( won't get called */ float UTIL_WeaponTimeBase( void ) { - return 0.0; + return 0.0f; } static unsigned int glSeed = 0; @@ -254,7 +254,7 @@ float UTIL_SharedRandomFloat( unsigned int seed, float low, float high ) tensixrand = U_Random() & 65535; - offset = (float)tensixrand / 65536.0; + offset = (float)tensixrand / 65536.0f; return ( low + offset * range ); } diff --git a/cl_dll/death.cpp b/cl_dll/death.cpp index 579fc255..d2c41e38 100644 --- a/cl_dll/death.cpp +++ b/cl_dll/death.cpp @@ -71,7 +71,7 @@ int CHudDeathNotice::Init( void ) HOOK_MESSAGE( DeathMsg ); - CVAR_CREATE( "hud_deathnotice_time", "6", 0 ); + CVAR_CREATE( "hud_deathnotice_time", "6", FCVAR_ARCHIVE ); return 1; } @@ -106,7 +106,7 @@ int CHudDeathNotice::Draw( float flTime ) continue; } - rgDeathNoticeList[i].flDisplayTime = min( rgDeathNoticeList[i].flDisplayTime, gHUD.m_flTime + DEATHNOTICE_DISPLAY_TIME ); + rgDeathNoticeList[i].flDisplayTime = Q_min( rgDeathNoticeList[i].flDisplayTime, gHUD.m_flTime + DEATHNOTICE_DISPLAY_TIME ); // Only draw if the viewport will let me // vgui dropped out @@ -204,7 +204,7 @@ int CHudDeathNotice::MsgFunc_DeathMsg( const char *pszName, int iSize, void *pbu // Get the Victim's name const char *victim_name = ""; // If victim is -1, the killer killed a specific, non-player object (like a sentrygun) - if( ( (char)victim ) != -1 ) + if( ( (signed char)victim ) != -1 ) victim_name = g_PlayerInfoList[victim].name; if( !victim_name ) { @@ -219,7 +219,7 @@ int CHudDeathNotice::MsgFunc_DeathMsg( const char *pszName, int iSize, void *pbu } // Is it a non-player object kill? - if( ( (char)victim ) == -1 ) + if( ( (signed char)victim ) == -1 ) { rgDeathNoticeList[i].iNonPlayerKill = TRUE; diff --git a/cl_dll/demo.cpp b/cl_dll/demo.cpp index f114ead0..63e333be 100644 --- a/cl_dll/demo.cpp +++ b/cl_dll/demo.cpp @@ -88,12 +88,12 @@ void DLLEXPORT Demo_ReadBuffer( int size, unsigned char *buffer ) g_demosniperorg[1] = *(float *)&buffer[i]; i += sizeof(float); g_demosniperorg[2] = *(float *)&buffer[i]; - i += sizeof(float); + // i += sizeof(float); } break; case TYPE_ZOOM: g_demozoom = *(float *)&buffer[i]; - i += sizeof(float); + // i += sizeof(float); break; default: gEngfuncs.Con_DPrintf( "Unknown demo buffer type, skipping.\n" ); diff --git a/cl_dll/entity.cpp b/cl_dll/entity.cpp index 40649fa7..6a7fdc79 100644 --- a/cl_dll/entity.cpp +++ b/cl_dll/entity.cpp @@ -319,12 +319,12 @@ void Particles( void ) curtime = gEngfuncs.GetClientTime(); - if( ( curtime - lasttime ) < 2.0 ) + if( ( curtime - lasttime ) < 2.0f ) return; if( !color ) { - color = gEngfuncs.pfnRegisterVariable ( "color","255 0 0", 0 ); + color = gEngfuncs.pfnRegisterVariable( "color", "255 0 0", 0 ); } lasttime = curtime; @@ -342,8 +342,8 @@ void Particles( void ) for( j = 0; j < 3; j++ ) { - p->org[j] = v_origin[j] + gEngfuncs.pfnRandomFloat( -32.0, 32.0 ); - p->vel[j] = gEngfuncs.pfnRandomFloat( -100.0, 100.0 ); + p->org[j] = v_origin[j] + gEngfuncs.pfnRandomFloat( -32.0f, 32.0f ); + p->vel[j] = gEngfuncs.pfnRandomFloat( -100.0f, 100.0f ); } if( color ) @@ -361,7 +361,7 @@ void Particles( void ) gEngfuncs.pEfxAPI->R_GetPackedColor( &p->packedColor, p->color ); // p->die is set to current time so all you have to do is add an additional time to it - p->die += 3.0; + p->die += 3.0f; } } */ @@ -384,7 +384,7 @@ void TempEnts( void ) curtime = gEngfuncs.GetClientTime(); - if( ( curtime - lasttime ) < 10.0 ) + if( ( curtime - lasttime ) < 10.0f ) return; lasttime = curtime; @@ -417,11 +417,11 @@ void TempEnts( void ) p->entity.curstate.origin[j] = origin[j]; // Store velocity in baseline origin - p->entity.baseline.origin[j] = gEngfuncs.pfnRandomFloat( -100, 100 ); + p->entity.baseline.origin[j] = gEngfuncs.pfnRandomFloat( -100.0f, 100.0f ); } // p->die is set to current time so all you have to do is add an additional time to it - p->die += 10.0; + p->die += 10.0f; } } */ @@ -626,7 +626,7 @@ void DLLEXPORT HUD_TempEntUpdate ( //freq = client_time * 0.01; fastFreq = client_time * 5.5; gravity = -frametime * cl_gravity; - gravitySlow = gravity * 0.5; + gravitySlow = gravity * 0.5f; while( pTemp ) { @@ -634,7 +634,7 @@ void DLLEXPORT HUD_TempEntUpdate ( active = 1; - life = pTemp->die - client_time; + life = pTemp->die - (float)client_time; pnext = pTemp->next; if( life < 0 ) { @@ -674,9 +674,9 @@ void DLLEXPORT HUD_TempEntUpdate ( gEngfuncs.pEfxAPI->R_SparkEffect( pTemp->entity.origin, 8, -200, 200 ); // Reduce life - pTemp->entity.baseline.framerate -= 0.1; + pTemp->entity.baseline.framerate -= 0.1f; - if( pTemp->entity.baseline.framerate <= 0.0 ) + if( pTemp->entity.baseline.framerate <= 0.0f ) { pTemp->die = client_time; } @@ -700,11 +700,11 @@ void DLLEXPORT HUD_TempEntUpdate ( } else if( pTemp->flags & FTENT_SINEWAVE ) { - pTemp->x += pTemp->entity.baseline.origin[0] * frametime; - pTemp->y += pTemp->entity.baseline.origin[1] * frametime; + pTemp->x += pTemp->entity.baseline.origin[0] * (float)frametime; + pTemp->y += pTemp->entity.baseline.origin[1] * (float)frametime; pTemp->entity.origin[0] = pTemp->x + sin( pTemp->entity.baseline.origin[2] + client_time * pTemp->entity.prevstate.frame ) * ( 10 * pTemp->entity.curstate.framerate ); - pTemp->entity.origin[1] = pTemp->y + sin( pTemp->entity.baseline.origin[2] + fastFreq + 0.7 ) * ( 8 * pTemp->entity.curstate.framerate ); + pTemp->entity.origin[1] = pTemp->y + sin( pTemp->entity.baseline.origin[2] + fastFreq + 0.7f ) * ( 8 * pTemp->entity.curstate.framerate ); pTemp->entity.origin[2] += pTemp->entity.baseline.origin[2] * frametime; } else if( pTemp->flags & FTENT_SPIRAL ) @@ -713,19 +713,19 @@ void DLLEXPORT HUD_TempEntUpdate ( s = sin( pTemp->entity.baseline.origin[2] + fastFreq ); c = cos( pTemp->entity.baseline.origin[2] + fastFreq );*/ - pTemp->entity.origin[0] += pTemp->entity.baseline.origin[0] * frametime + 8 * sin( client_time * 20 + (size_t)pTemp ); - pTemp->entity.origin[1] += pTemp->entity.baseline.origin[1] * frametime + 4 * sin( client_time * 30 + (size_t)pTemp ); - pTemp->entity.origin[2] += pTemp->entity.baseline.origin[2] * frametime; + pTemp->entity.origin[0] += pTemp->entity.baseline.origin[0] * (float)frametime + 8 * sin( client_time * 20 + (size_t)pTemp ); + pTemp->entity.origin[1] += pTemp->entity.baseline.origin[1] * (float)frametime + 4 * sin( client_time * 30 + (size_t)pTemp ); + pTemp->entity.origin[2] += pTemp->entity.baseline.origin[2] * (float)frametime; } else { for( i = 0; i < 3; i++ ) - pTemp->entity.origin[i] += pTemp->entity.baseline.origin[i] * frametime; + pTemp->entity.origin[i] += pTemp->entity.baseline.origin[i] * (float)frametime; } if( pTemp->flags & FTENT_SPRANIMATE ) { - pTemp->entity.curstate.frame += frametime * pTemp->entity.curstate.framerate; + pTemp->entity.curstate.frame += (float)frametime * pTemp->entity.curstate.framerate; if( pTemp->entity.curstate.frame >= pTemp->frameMax ) { pTemp->entity.curstate.frame = pTemp->entity.curstate.frame - (int)( pTemp->entity.curstate.frame ); @@ -755,9 +755,9 @@ void DLLEXPORT HUD_TempEntUpdate ( if( pTemp->flags & FTENT_ROTATE ) { - pTemp->entity.angles[0] += pTemp->entity.baseline.angles[0] * frametime; - pTemp->entity.angles[1] += pTemp->entity.baseline.angles[1] * frametime; - pTemp->entity.angles[2] += pTemp->entity.baseline.angles[2] * frametime; + pTemp->entity.angles[0] += pTemp->entity.baseline.angles[0] * (float)frametime; + pTemp->entity.angles[1] += pTemp->entity.baseline.angles[1] * (float)frametime; + pTemp->entity.angles[2] += pTemp->entity.baseline.angles[2] * (float)frametime; VectorCopy( pTemp->entity.angles, pTemp->entity.latched.prevangles ); } @@ -809,7 +809,7 @@ void DLLEXPORT HUD_TempEntUpdate ( { // Chop spark speeds a bit more // - VectorScale( pTemp->entity.baseline.origin, 0.6, pTemp->entity.baseline.origin ); + VectorScale( pTemp->entity.baseline.origin, 0.6f, pTemp->entity.baseline.origin ); if( Length( pTemp->entity.baseline.origin ) < 10 ) { @@ -829,13 +829,13 @@ void DLLEXPORT HUD_TempEntUpdate ( float proj, damp; // Place at contact point - VectorMA( pTemp->entity.prevstate.origin, traceFraction * frametime, pTemp->entity.baseline.origin, pTemp->entity.origin ); + VectorMA( pTemp->entity.prevstate.origin, traceFraction * (float)frametime, pTemp->entity.baseline.origin, pTemp->entity.origin ); // Damp velocity damp = pTemp->bounceFactor; if( pTemp->flags & ( FTENT_GRAVITY | FTENT_SLOWGRAVITY ) ) { - damp *= 0.5; - if( traceNormal[2] > 0.9 ) // Hit floor? + damp *= 0.5f; + if( traceNormal[2] > 0.9f ) // Hit floor? { if( pTemp->entity.baseline.origin[2] <= 0 && pTemp->entity.baseline.origin[2] >= gravity*3 ) { diff --git a/cl_dll/ev_hldm.cpp b/cl_dll/ev_hldm.cpp index f8fefad5..9b100439 100644 --- a/cl_dll/ev_hldm.cpp +++ b/cl_dll/ev_hldm.cpp @@ -72,18 +72,18 @@ void EV_SnarkFire( struct event_args_s *args ); void EV_TrainPitchAdjust( struct event_args_s *args ); } -#define VECTOR_CONE_1DEGREES Vector( 0.00873, 0.00873, 0.00873 ) -#define VECTOR_CONE_2DEGREES Vector( 0.01745, 0.01745, 0.01745 ) -#define VECTOR_CONE_3DEGREES Vector( 0.02618, 0.02618, 0.02618 ) -#define VECTOR_CONE_4DEGREES Vector( 0.03490, 0.03490, 0.03490 ) -#define VECTOR_CONE_5DEGREES Vector( 0.04362, 0.04362, 0.04362 ) -#define VECTOR_CONE_6DEGREES Vector( 0.05234, 0.05234, 0.05234 ) -#define VECTOR_CONE_7DEGREES Vector( 0.06105, 0.06105, 0.06105 ) -#define VECTOR_CONE_8DEGREES Vector( 0.06976, 0.06976, 0.06976 ) -#define VECTOR_CONE_9DEGREES Vector( 0.07846, 0.07846, 0.07846 ) -#define VECTOR_CONE_10DEGREES Vector( 0.08716, 0.08716, 0.08716 ) -#define VECTOR_CONE_15DEGREES Vector( 0.13053, 0.13053, 0.13053 ) -#define VECTOR_CONE_20DEGREES Vector( 0.17365, 0.17365, 0.17365 ) +#define VECTOR_CONE_1DEGREES Vector( 0.00873f, 0.00873f, 0.00873f ) +#define VECTOR_CONE_2DEGREES Vector( 0.01745f, 0.01745f, 0.01745f ) +#define VECTOR_CONE_3DEGREES Vector( 0.02618f, 0.02618f, 0.02618f ) +#define VECTOR_CONE_4DEGREES Vector( 0.03490f, 0.03490f, 0.03490f ) +#define VECTOR_CONE_5DEGREES Vector( 0.04362f, 0.04362f, 0.04362f ) +#define VECTOR_CONE_6DEGREES Vector( 0.05234f, 0.05234f, 0.05234f ) +#define VECTOR_CONE_7DEGREES Vector( 0.06105f, 0.06105f, 0.06105f ) +#define VECTOR_CONE_8DEGREES Vector( 0.06976f, 0.06976f, 0.06976f ) +#define VECTOR_CONE_9DEGREES Vector( 0.07846f, 0.07846f, 0.07846f ) +#define VECTOR_CONE_10DEGREES Vector( 0.08716f, 0.08716f, 0.08716f ) +#define VECTOR_CONE_15DEGREES Vector( 0.13053f, 0.13053f, 0.13053f ) +#define VECTOR_CONE_20DEGREES Vector( 0.17365f, 0.17365f, 0.17365f ) // play a strike sound based on the texture that was hit by the attack traceline. VecSrc/VecEnd are the // original traceline endpoints used by the attacker, iBulletType is the type of bullet that hit the texture. @@ -425,7 +425,7 @@ void EV_HLDM_FireBullets( int idx, float *forward, float *right, float *up, int tracer = EV_HLDM_CheckTracer( idx, vecSrc, tr.endpos, forward, right, iBulletType, iTracerFreq, tracerCount ); // do damage, paint decals - if( tr.fraction != 1.0 ) + if( tr.fraction != 1.0f ) { switch( iBulletType ) { @@ -901,14 +901,14 @@ void EV_FireGauss( event_args_t *args ) if( EV_IsLocal( idx ) ) { - V_PunchAxis( 0, -2.0 ); + V_PunchAxis( 0.0f, -2.0f ); gEngfuncs.pEventAPI->EV_WeaponAnimation( GAUSS_FIRE2, 2 ); if( m_fPrimaryFire == false ) g_flApplyVel = flDamage; } - gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/gauss2.wav", 0.5 + flDamage * ( 1.0 / 400.0 ), ATTN_NORM, 0, 85 + gEngfuncs.pfnRandomLong( 0, 0x1f ) ); + gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/gauss2.wav", 0.5f + flDamage * ( 1.0f / 400.0f ), ATTN_NORM, 0, 85 + gEngfuncs.pfnRandomLong( 0, 0x1f ) ); while( flDamage > 10 && nMaxHits > 0 ) { @@ -943,10 +943,10 @@ void EV_FireGauss( event_args_t *args ) idx | 0x1000, tr.endpos, m_iBeam, - 0.1, - m_fPrimaryFire ? 1.0 : 2.5, - 0.0, - m_fPrimaryFire ? 128.0 : flDamage, + 0.1f, + m_fPrimaryFire ? 1.0f : 2.5f, + 0.0f, + m_fPrimaryFire ? 128.0f : flDamage, 0, 0, 0, @@ -960,10 +960,10 @@ void EV_FireGauss( event_args_t *args ) gEngfuncs.pEfxAPI->R_BeamPoints( vecSrc, tr.endpos, m_iBeam, - 0.1, - m_fPrimaryFire ? 1.0 : 2.5, - 0.0, - m_fPrimaryFire ? 128.0 : flDamage, + 0.1f, + m_fPrimaryFire ? 1.0f : 2.5f, + 0.0f, + m_fPrimaryFire ? 128.0f : flDamage, 0, 0, 0, @@ -985,13 +985,13 @@ void EV_FireGauss( event_args_t *args ) n = -DotProduct( tr.plane.normal, forward ); - if( n < 0.5 ) // 60 degrees + if( n < 0.5f ) // 60 degrees { // ALERT( at_console, "reflect %f\n", n ); // reflect vec3_t r; - VectorMA( forward, 2.0 * n, tr.plane.normal, r ); + VectorMA( forward, 2.0f * n, tr.plane.normal, r ); flMaxFrac = flMaxFrac - tr.fraction; @@ -1000,18 +1000,18 @@ void EV_FireGauss( event_args_t *args ) VectorMA( tr.endpos, 8.0, forward, vecSrc ); VectorMA( vecSrc, 8192.0, forward, vecDest ); - gEngfuncs.pEfxAPI->R_TempSprite( tr.endpos, vec3_origin, 0.2, m_iGlow, kRenderGlow, kRenderFxNoDissipation, flDamage * n / 255.0, flDamage * n * 0.5 * 0.1, FTENT_FADEOUT ); + gEngfuncs.pEfxAPI->R_TempSprite( tr.endpos, vec3_origin, 0.2, m_iGlow, kRenderGlow, kRenderFxNoDissipation, flDamage * n / 255.0f, flDamage * n * 0.5f * 0.1f, FTENT_FADEOUT ); vec3_t fwd; VectorAdd( tr.endpos, tr.plane.normal, fwd ); - gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, tr.endpos, fwd, m_iBalls, 3, 0.1, gEngfuncs.pfnRandomFloat( 10, 20 ) / 100.0, 100, + gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, tr.endpos, fwd, m_iBalls, 3, 0.1, gEngfuncs.pfnRandomFloat( 10.0f, 20.0f ) / 100.0f, 100, 255, 100 ); // lose energy - if( n == 0 ) + if( n == 0.0f ) { - n = 0.1; + n = 0.1f; } flDamage = flDamage * ( 1 - n ); @@ -1021,7 +1021,7 @@ void EV_FireGauss( event_args_t *args ) // tunnel EV_HLDM_DecalGunshot( &tr, BULLET_MONSTER_12MM ); - gEngfuncs.pEfxAPI->R_TempSprite( tr.endpos, vec3_origin, 1.0, m_iGlow, kRenderGlow, kRenderFxNoDissipation, flDamage / 255.0, 6.0, FTENT_FADEOUT ); + gEngfuncs.pEfxAPI->R_TempSprite( tr.endpos, vec3_origin, 1.0, m_iGlow, kRenderGlow, kRenderFxNoDissipation, flDamage / 255.0f, 6.0f, FTENT_FADEOUT ); // limit it to one hole punch if( fHasPunched ) @@ -1067,7 +1067,7 @@ void EV_FireGauss( event_args_t *args ) { vec3_t fwd; VectorSubtract( tr.endpos, forward, fwd ); - gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, tr.endpos, fwd, m_iBalls, 3, 0.1, gEngfuncs.pfnRandomFloat( 10, 20 ) / 100.0, 100, + gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, tr.endpos, fwd, m_iBalls, 3, 0.1, gEngfuncs.pfnRandomFloat( 10.0f, 20.0f ) / 100.0f, 100, 255, 100 ); } @@ -1076,13 +1076,13 @@ void EV_FireGauss( event_args_t *args ) EV_HLDM_DecalGunshot( &beam_tr, BULLET_MONSTER_12MM ); - gEngfuncs.pEfxAPI->R_TempSprite( beam_tr.endpos, vec3_origin, 0.1, m_iGlow, kRenderGlow, kRenderFxNoDissipation, flDamage / 255.0, 6.0, FTENT_FADEOUT ); + gEngfuncs.pEfxAPI->R_TempSprite( beam_tr.endpos, vec3_origin, 0.1, m_iGlow, kRenderGlow, kRenderFxNoDissipation, flDamage / 255.0f, 6.0f, FTENT_FADEOUT ); // balls { vec3_t fwd; VectorSubtract( beam_tr.endpos, forward, fwd ); - gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, beam_tr.endpos, fwd, m_iBalls, (int)( flDamage * 0.3 ), 0.1, gEngfuncs.pfnRandomFloat( 10, 20 ) / 100.0, 200, + gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, beam_tr.endpos, fwd, m_iBalls, (int)( flDamage * 0.3f ), 0.1, gEngfuncs.pfnRandomFloat( 10.0f, 20.0f ) / 100.0f, 200, 255, 40 ); } @@ -1102,11 +1102,11 @@ void EV_FireGauss( event_args_t *args ) { // slug doesn't punch through ever with primary // fire, so leave a little glowy bit and make some balls - gEngfuncs.pEfxAPI->R_TempSprite( tr.endpos, vec3_origin, 0.2, m_iGlow, kRenderGlow, kRenderFxNoDissipation, 200.0 / 255.0, 0.3, FTENT_FADEOUT ); + gEngfuncs.pEfxAPI->R_TempSprite( tr.endpos, vec3_origin, 0.2, m_iGlow, kRenderGlow, kRenderFxNoDissipation, 200.0f / 255.0f, 0.3, FTENT_FADEOUT ); { vec3_t fwd; VectorAdd( tr.endpos, tr.plane.normal, fwd ); - gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, tr.endpos, fwd, m_iBalls, 8, 0.6, gEngfuncs.pfnRandomFloat( 10, 20 ) / 100.0, 100, + gEngfuncs.pEfxAPI->R_Sprite_Trail( TE_SPRITETRAIL, tr.endpos, fwd, m_iBalls, 8, 0.6, gEngfuncs.pfnRandomFloat( 10.0f, 20.0f ) / 100.0f, 100, 255, 200 ); } } @@ -1238,7 +1238,7 @@ void EV_FireCrossbow2( event_args_t *args ) VectorMA( vecSrc, 8192, forward, vecEnd ); gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/xbow_fire1.wav", 1, ATTN_NORM, 0, 93 + gEngfuncs.pfnRandomLong( 0, 0xF ) ); - gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_ITEM, "weapons/xbow_reload1.wav", gEngfuncs.pfnRandomFloat( 0.95, 1.0 ), ATTN_NORM, 0, 93 + gEngfuncs.pfnRandomLong( 0, 0xF ) ); + gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_ITEM, "weapons/xbow_reload1.wav", gEngfuncs.pfnRandomFloat( 0.95f, 1.0f ), ATTN_NORM, 0, 93 + gEngfuncs.pfnRandomLong( 0, 0xF ) ); if( EV_IsLocal( idx ) ) { @@ -1257,7 +1257,7 @@ void EV_FireCrossbow2( event_args_t *args ) gEngfuncs.pEventAPI->EV_PlayerTrace( vecSrc, vecEnd, PM_STUDIO_BOX, -1, &tr ); //We hit something - if( tr.fraction < 1.0 ) + if( tr.fraction < 1.0f ) { physent_t *pe = gEngfuncs.pEventAPI->EV_GetPhysent( tr.ent ); @@ -1277,7 +1277,7 @@ void EV_FireCrossbow2( event_args_t *args ) //Stick to world but don't stick to glass, it might break and leave the bolt floating. It can still stick to other non-transparent breakables though. else if( pe->rendermode == kRenderNormal ) { - gEngfuncs.pEventAPI->EV_PlaySound( 0, tr.endpos, CHAN_BODY, "weapons/xbow_hit1.wav", gEngfuncs.pfnRandomFloat( 0.95, 1.0 ), ATTN_NORM, 0, PITCH_NORM ); + gEngfuncs.pEventAPI->EV_PlaySound( 0, tr.endpos, CHAN_BODY, "weapons/xbow_hit1.wav", gEngfuncs.pfnRandomFloat( 0.95f, 1.0f ), ATTN_NORM, 0, PITCH_NORM ); //Not underwater, do some sparks... if( gEngfuncs.PM_PointContents( tr.endpos, NULL ) != CONTENTS_WATER ) @@ -1313,7 +1313,7 @@ void EV_FireCrossbow( event_args_t *args ) VectorCopy( args->origin, origin ); gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_WEAPON, "weapons/xbow_fire1.wav", 1, ATTN_NORM, 0, 93 + gEngfuncs.pfnRandomLong( 0, 0xF ) ); - gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_ITEM, "weapons/xbow_reload1.wav", gEngfuncs.pfnRandomFloat( 0.95, 1.0 ), ATTN_NORM, 0, 93 + gEngfuncs.pfnRandomLong( 0, 0xF ) ); + gEngfuncs.pEventAPI->EV_PlaySound( idx, origin, CHAN_ITEM, "weapons/xbow_reload1.wav", gEngfuncs.pfnRandomFloat( 0.95f, 1.0f ), ATTN_NORM, 0, 93 + gEngfuncs.pfnRandomLong( 0, 0xF ) ); //Only play the weapon anims if I shot it. if( EV_IsLocal( idx ) ) @@ -1323,7 +1323,7 @@ void EV_FireCrossbow( event_args_t *args ) else if ( args->iparam2 ) gEngfuncs.pEventAPI->EV_WeaponAnimation( CROSSBOW_FIRE3, 1 ); - V_PunchAxis( 0, -2.0 ); + V_PunchAxis( 0.0f, -2.0f ); } } //====================== @@ -1541,13 +1541,13 @@ void EV_EgonStop( event_args_t *args ) { if( pBeam ) { - pBeam->die = 0.0; + pBeam->die = 0.0f; pBeam = NULL; } if( pBeam2 ) { - pBeam2->die = 0.0; + pBeam2->die = 0.0f; pBeam2 = NULL; } @@ -1667,10 +1667,10 @@ void EV_TripmineFire( event_args_t *args ) // Now add in all of the players. gEngfuncs.pEventAPI->EV_SetSolidPlayers ( idx - 1 ); gEngfuncs.pEventAPI->EV_SetTraceHull( 2 ); - gEngfuncs.pEventAPI->EV_PlayerTrace( vecSrc, vecSrc + forward * 128, PM_NORMAL, -1, &tr ); + gEngfuncs.pEventAPI->EV_PlayerTrace( vecSrc, vecSrc + forward * 128.0f, PM_NORMAL, -1, &tr ); //Hit something solid - if( tr.fraction < 1.0 ) + if( tr.fraction < 1.0f ) gEngfuncs.pEventAPI->EV_WeaponAnimation ( TRIPMINE_DRAW, 0 ); gEngfuncs.pEventAPI->EV_PopPMStates(); @@ -1722,7 +1722,7 @@ void EV_SnarkFire( event_args_t *args ) gEngfuncs.pEventAPI->EV_PlayerTrace( vecSrc + forward * 20, vecSrc + forward * 64, PM_NORMAL, -1, &tr ); //Find space to drop the thing. - if( tr.allsolid == 0 && tr.startsolid == 0 && tr.fraction > 0.25 ) + if( tr.allsolid == 0 && tr.startsolid == 0 && tr.fraction > 0.25f ) gEngfuncs.pEventAPI->EV_WeaponAnimation( SQUEAK_THROW, 0 ); gEngfuncs.pEventAPI->EV_PopPMStates(); @@ -1751,9 +1751,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 ) { diff --git a/cl_dll/flashlight.cpp b/cl_dll/flashlight.cpp index ee3d6d22..3ec69973 100644 --- a/cl_dll/flashlight.cpp +++ b/cl_dll/flashlight.cpp @@ -50,7 +50,7 @@ void CHudFlashlight::Reset( void ) m_fFade = 0; m_fOn = 0; m_iBat = 100; - m_flBat = 1.0; + m_flBat = 1.0f; } int CHudFlashlight::VidInit( void ) @@ -75,7 +75,7 @@ int CHudFlashlight::MsgFunc_FlashBat( const char *pszName, int iSize, void *pbu BEGIN_READ( pbuf, iSize ); int x = READ_BYTE(); m_iBat = x; - m_flBat = ( (float)x ) / 100.0; + m_flBat = ( (float)x ) / 100.0f; return 1; } @@ -86,7 +86,7 @@ int CHudFlashlight::MsgFunc_Flashlight( const char *pszName, int iSize, void *p m_fOn = READ_BYTE(); int x = READ_BYTE(); m_iBat = x; - m_flBat = ( (float)x ) / 100.0; + m_flBat = ( (float)x ) / 100.0f; return 1; } @@ -119,7 +119,7 @@ int CHudFlashlight::Draw( float flTime ) else a = MIN_ALPHA; - if( m_flBat < 0.20 ) + if( m_flBat < 0.20f ) UnpackRGB( r,g,b, RGB_REDISH ); else UnpackRGB( r,g,b, RGB_YELLOWISH ); @@ -144,7 +144,7 @@ int CHudFlashlight::Draw( float flTime ) // draw the flashlight energy level x = ScreenWidth - m_iWidth - m_iWidth / 2; - int iOffset = m_iWidth * ( 1.0 - m_flBat ); + int iOffset = m_iWidth * ( 1.0f - m_flBat ); if( iOffset < m_iWidth ) { rc = *m_prc2; diff --git a/cl_dll/geiger.cpp b/cl_dll/geiger.cpp index 097889b9..89d2b951 100644 --- a/cl_dll/geiger.cpp +++ b/cl_dll/geiger.cpp @@ -66,7 +66,7 @@ int CHudGeiger::Draw( float flTime ) int pct; float flvol = 0.0f; //int rg[3]; - int i; + int i = 0; if( m_iGeigerRange < 1000 && m_iGeigerRange > 0 ) { @@ -78,7 +78,7 @@ int CHudGeiger::Draw( float flTime ) else if( m_iGeigerRange > 600 ) { pct = 2; - flvol = 0.4; //Con_Printf( "range > 600\n" ); + flvol = 0.4f; //Con_Printf( "range > 600\n" ); //rg[0] = 1; //rg[1] = 1; i = 2; @@ -86,7 +86,7 @@ int CHudGeiger::Draw( float flTime ) else if( m_iGeigerRange > 500 ) { pct = 4; - flvol = 0.5; //Con_Printf( "range > 500\n" ); + flvol = 0.5f; //Con_Printf( "range > 500\n" ); //rg[0] = 1; //rg[1] = 2; i = 2; @@ -94,7 +94,7 @@ int CHudGeiger::Draw( float flTime ) else if( m_iGeigerRange > 400 ) { pct = 8; - flvol = 0.6; //Con_Printf( "range > 400\n" ); + flvol = 0.6f; //Con_Printf( "range > 400\n" ); //rg[0] = 1; //rg[1] = 2; //rg[2] = 3; @@ -103,7 +103,7 @@ int CHudGeiger::Draw( float flTime ) else if( m_iGeigerRange > 300 ) { pct = 8; - flvol = 0.7; //Con_Printf( "range > 300\n" ); + flvol = 0.7f; //Con_Printf( "range > 300\n" ); //rg[0] = 2; //rg[1] = 3; //rg[2] = 4; @@ -112,7 +112,7 @@ int CHudGeiger::Draw( float flTime ) else if( m_iGeigerRange > 200 ) { pct = 28; - flvol = 0.78; //Con_Printf( "range > 200\n" ); + flvol = 0.78f; //Con_Printf( "range > 200\n" ); //rg[0] = 2; //rg[1] = 3; //rg[2] = 4; @@ -121,7 +121,7 @@ int CHudGeiger::Draw( float flTime ) else if( m_iGeigerRange > 150 ) { pct = 40; - flvol = 0.80; //Con_Printf( "range > 150\n" ); + flvol = 0.80f; //Con_Printf( "range > 150\n" ); //rg[0] = 3; //rg[1] = 4; //rg[2] = 5; @@ -139,7 +139,7 @@ int CHudGeiger::Draw( float flTime ) else if( m_iGeigerRange > 75 ) { pct = 80; - flvol = 0.9; //Con_Printf( "range > 75\n" ); + flvol = 0.9f; //Con_Printf( "range > 75\n" ); //gflGeigerDelay = cl.time + GEIGERDELAY * 0.75; //rg[0] = 4; //rg[1] = 5; @@ -149,7 +149,7 @@ int CHudGeiger::Draw( float flTime ) else if( m_iGeigerRange > 50 ) { pct = 90; - flvol = 0.95; //Con_Printf( "range > 50\n" ); + flvol = 0.95f; //Con_Printf( "range > 50\n" ); //rg[0] = 5; //rg[1] = 6; i = 2; @@ -157,17 +157,17 @@ int CHudGeiger::Draw( float flTime ) else { pct = 95; - flvol = 1.0; //Con_Printf( "range < 50\n" ); + flvol = 1.0f; //Con_Printf( "range < 50\n" ); //rg[0] = 5; //rg[1] = 6; i = 2; } - flvol = ( flvol * ( ( rand() & 127 ) ) / 255 ) + 0.25; // UTIL_RandomFloat( 0.25, 0.5 ); + flvol = ( flvol * ( ( rand() & 127 ) ) / 255 ) + 0.25f; // UTIL_RandomFloat( 0.25f, 0.5f ); if( ( rand() & 127 ) < pct || ( rand() & 127 ) < pct ) { - //S_StartDynamicSound( -1, 0, rgsfx[rand() % i], r_origin, flvol, 1.0, 0, 100 ); + //S_StartDynamicSound( -1, 0, rgsfx[rand() % i], r_origin, flvol, 1.0f, 0, 100 ); char sz[256]; int j = rand() & 1; diff --git a/cl_dll/health.cpp b/cl_dll/health.cpp index eebf0eb0..e14182b8 100644 --- a/cl_dll/health.cpp +++ b/cl_dll/health.cpp @@ -18,9 +18,9 @@ // implementation of CHudHealth class // -#include "stdio.h" -#include "stdlib.h" -#include "math.h" +#include +#include +#include #include "hud.h" #include "cl_util.h" @@ -152,13 +152,14 @@ int CHudHealth::MsgFunc_Damage( const char *pszName, int iSize, void *pbuf ) // Green <-> Yellow <-> Red ramp void CHudHealth::GetPainColor( int &r, int &g, int &b ) { +#if 0 int iHealth = m_iHealth; if( iHealth > 25 ) iHealth -= 25; else if( iHealth < 0 ) iHealth = 0; -#if 0 + g = iHealth * 255 / 100; r = 255 - g; b = 0; @@ -191,7 +192,7 @@ int CHudHealth::Draw( float flTime ) // Has health changed? Flash the health # if( m_fFade ) { - m_fFade -= ( gHUD.m_flTimeDelta * 20 ); + m_fFade -= ( (float)gHUD.m_flTimeDelta * 20.0f ); if( m_fFade <= 0 ) { a = MIN_ALPHA; @@ -270,28 +271,28 @@ void CHudHealth::CalcDamageDirection( vec3_t vecFrom ) } else { - if( side > 0 ) + if( side > 0.0f ) { - if( side > 0.3 ) - m_fAttackFront = max( m_fAttackFront, side ); + if( side > 0.3f ) + m_fAttackFront = Q_max( m_fAttackFront, side ); } else { float f = fabs( side ); - if( f > 0.3 ) - m_fAttackRear = max( m_fAttackRear, f ); + if( f > 0.3f ) + m_fAttackRear = Q_max( m_fAttackRear, f ); } - if( front > 0 ) + if( front > 0.0f ) { - if( front > 0.3 ) - m_fAttackRight = max( m_fAttackRight, front ); + if( front > 0.3f ) + m_fAttackRight = Q_max( m_fAttackRight, front ); } else { float f = fabs( front ); - if( f > 0.3 ) - m_fAttackLeft = max( m_fAttackLeft, f ); + if( f > 0.3f ) + m_fAttackLeft = Q_max( m_fAttackLeft, f ); } } } @@ -310,54 +311,54 @@ int CHudHealth::DrawPain( float flTime ) float fFade = gHUD.m_flTimeDelta * 2; // SPR_Draw top - if( m_fAttackFront > 0.4 ) + if( m_fAttackFront > 0.4f ) { GetPainColor( r, g, b ); - shade = a * max( m_fAttackFront, 0.5 ); + shade = a * Q_max( m_fAttackFront, 0.5f ); ScaleColors( r, g, b, shade ); SPR_Set( m_hSprite, r, g, b ); x = ScreenWidth / 2 - SPR_Width( m_hSprite, 0 ) / 2; y = ScreenHeight / 2 - SPR_Height( m_hSprite, 0 ) * 3; SPR_DrawAdditive( 0, x, y, NULL ); - m_fAttackFront = max( 0, m_fAttackFront - fFade ); + m_fAttackFront = Q_max( 0, m_fAttackFront - fFade ); } else m_fAttackFront = 0; - if( m_fAttackRight > 0.4 ) + if( m_fAttackRight > 0.4f ) { GetPainColor( r, g, b ); - shade = a * max( m_fAttackRight, 0.5 ); + shade = a * Q_max( m_fAttackRight, 0.5f ); ScaleColors( r, g, b, shade ); SPR_Set( m_hSprite, r, g, b ); x = ScreenWidth / 2 + SPR_Width( m_hSprite, 1 ) * 2; y = ScreenHeight / 2 - SPR_Height( m_hSprite,1 ) / 2; SPR_DrawAdditive( 1, x, y, NULL ); - m_fAttackRight = max( 0, m_fAttackRight - fFade ); + m_fAttackRight = Q_max( 0, m_fAttackRight - fFade ); } else m_fAttackRight = 0; - if( m_fAttackRear > 0.4 ) + if( m_fAttackRear > 0.4f ) { GetPainColor( r, g, b ); - shade = a * max( m_fAttackRear, 0.5 ); + shade = a * Q_max( m_fAttackRear, 0.5f ); ScaleColors( r, g, b, shade ); SPR_Set( m_hSprite, r, g, b ); x = ScreenWidth / 2 - SPR_Width( m_hSprite, 2 ) / 2; y = ScreenHeight / 2 + SPR_Height( m_hSprite, 2 ) * 2; SPR_DrawAdditive( 2, x, y, NULL ); - m_fAttackRear = max( 0, m_fAttackRear - fFade ); + m_fAttackRear = Q_max( 0, m_fAttackRear - fFade ); } else m_fAttackRear = 0; - if( m_fAttackLeft > 0.4 ) + if( m_fAttackLeft > 0.4f ) { GetPainColor( r, g, b ); - shade = a * max( m_fAttackLeft, 0.5 ); + shade = a * Q_max( m_fAttackLeft, 0.5f ); ScaleColors( r, g, b, shade ); SPR_Set( m_hSprite, r, g, b ); @@ -365,7 +366,7 @@ int CHudHealth::DrawPain( float flTime ) y = ScreenHeight / 2 - SPR_Height( m_hSprite,3 ) / 2; SPR_DrawAdditive( 3, x, y, NULL ); - m_fAttackLeft = max( 0, m_fAttackLeft - fFade ); + m_fAttackLeft = Q_max( 0, m_fAttackLeft - fFade ); } else m_fAttackLeft = 0; @@ -382,7 +383,7 @@ int CHudHealth::DrawDamage( float flTime ) UnpackRGB( r, g, b, RGB_YELLOWISH ); - a = (int)( fabs( sin( flTime * 2 ) ) * 256.0 ); + a = (int)( fabs( sin( flTime * 2.0f ) ) * 256.0f ); ScaleColors( r, g, b, a ); @@ -397,7 +398,7 @@ int CHudHealth::DrawDamage( float flTime ) SPR_Set( gHUD.GetSprite( m_HUD_dmg_bio + i ), r, g, b ); SPR_DrawAdditive( 0, pdmg->x, pdmg->y, &gHUD.GetSpriteRect( m_HUD_dmg_bio + i ) ); - pdmg->fExpire = min( flTime + DMG_IMAGE_LIFE, pdmg->fExpire ); + pdmg->fExpire = Q_min( flTime + DMG_IMAGE_LIFE, pdmg->fExpire ); if( pdmg->fExpire <= flTime // when the time has expired && a < 40 ) // and the flash is at the low point of the cycle @@ -461,7 +462,7 @@ void CHudHealth::UpdateTiles( float flTime, long bitsDamage ) if( pdmg->y ) pdmg->y -= giDmgHeight; } - pdmg = &m_dmg[i]; + // pdmg = &m_dmg[i]; } } diff --git a/cl_dll/hl/hl_objects.cpp b/cl_dll/hl/hl_objects.cpp index 55822dcb..788b09e3 100644 --- a/cl_dll/hl/hl_objects.cpp +++ b/cl_dll/hl/hl_objects.cpp @@ -68,25 +68,25 @@ void UpdateBeams( void ) if( pBeam ) { pBeam->target = tr.endpos; - pBeam->die = gEngfuncs.GetClientTime() + 0.1; // We keep it alive just a little bit forward in the future, just in case. + pBeam->die = gEngfuncs.GetClientTime() + 0.1f; // We keep it alive just a little bit forward in the future, just in case. } if( pBeam2 ) { pBeam2->target = tr.endpos; - pBeam2->die = gEngfuncs.GetClientTime() + 0.1; // We keep it alive just a little bit forward in the future, just in case. + pBeam2->die = gEngfuncs.GetClientTime() + 0.1f; // We keep it alive just a little bit forward in the future, just in case. } if( pFlare ) // Vit_amiN: beam flare { pFlare->entity.origin = tr.endpos; - pFlare->die = gEngfuncs.GetClientTime() + 0.1; // We keep it alive just a little bit forward in the future, just in case. + pFlare->die = gEngfuncs.GetClientTime() + 0.1f; // We keep it alive just a little bit forward in the future, just in case. if( gEngfuncs.GetMaxClients() != 1 ) // Singleplayer always draws the egon's energy beam flare { pFlare->flags |= FTENT_NOMODEL; - if( !( tr.allsolid || tr.ent <= 0 || tr.fraction == 1.0 ) ) // Beam hit some non-world entity + if( !( tr.allsolid || tr.ent <= 0 || tr.fraction == 1.0f ) ) // Beam hit some non-world entity { physent_t *pEntity = gEngfuncs.pEventAPI->EV_GetPhysent( tr.ent ); diff --git a/cl_dll/hl/hl_weapons.cpp b/cl_dll/hl/hl_weapons.cpp index 75161a9e..f305f321 100644 --- a/cl_dll/hl/hl_weapons.cpp +++ b/cl_dll/hl/hl_weapons.cpp @@ -163,7 +163,7 @@ BOOL CBasePlayerWeapon::DefaultReload( int iClipSize, int iAnim, float fDelay, i m_fInReload = TRUE; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0f; return TRUE; } @@ -218,8 +218,8 @@ BOOL CBasePlayerWeapon::DefaultDeploy( const char *szViewModel, const char *szWe SendWeaponAnim( iAnim, skiplocal, body ); g_irunninggausspred = false; - m_pPlayer->m_flNextAttack = 0.5; - m_flTimeWeaponIdle = 1.0; + m_pPlayer->m_flNextAttack = 0.5f; + m_flTimeWeaponIdle = 1.0f; return TRUE; } @@ -233,7 +233,7 @@ BOOL CBasePlayerWeapon::PlayEmptySound( void ) { if( m_iPlayEmptySound ) { - HUD_PlaySound( "weapons/357_cock1.wav", 0.8 ); + HUD_PlaySound( "weapons/357_cock1.wav", 0.8f ); m_iPlayEmptySound = 0; return 0; } @@ -296,8 +296,8 @@ Vector CBaseEntity::FireBulletsPlayer ( ULONG cShots, Vector vecSrc, Vector vecD { // get circular gaussian spread do { - x = RANDOM_FLOAT( -0.5, 0.5 ) + RANDOM_FLOAT( -0.5, 0.5 ); - y = RANDOM_FLOAT( -0.5, 0.5 ) + RANDOM_FLOAT( -0.5, 0.5 ); + x = RANDOM_FLOAT( -0.5f, 0.5f ) + RANDOM_FLOAT( -0.5f, 0.5f ); + y = RANDOM_FLOAT( -0.5f, 0.5f ) + RANDOM_FLOAT( -0.5f, 0.5f ); z = x * x + y * y; } while( z > 1 ); } @@ -305,13 +305,13 @@ Vector CBaseEntity::FireBulletsPlayer ( ULONG cShots, Vector vecSrc, Vector vecD { //Use player's random seed. // get circular gaussian spread - x = UTIL_SharedRandomFloat( shared_rand + iShot, -0.5, 0.5 ) + UTIL_SharedRandomFloat( shared_rand + ( 1 + iShot ) , -0.5, 0.5 ); - y = UTIL_SharedRandomFloat( shared_rand + ( 2 + iShot ), -0.5, 0.5 ) + UTIL_SharedRandomFloat( shared_rand + ( 3 + iShot ), -0.5, 0.5 ); - z = x * x + y * y; + x = UTIL_SharedRandomFloat( shared_rand + iShot, -0.5f, 0.5f ) + UTIL_SharedRandomFloat( shared_rand + ( 1 + iShot ) , -0.5f, 0.5f ); + y = UTIL_SharedRandomFloat( shared_rand + ( 2 + iShot ), -0.5f, 0.5f ) + UTIL_SharedRandomFloat( shared_rand + ( 3 + iShot ), -0.5f, 0.5f ); + // z = x * x + y * y; } } - return Vector( x * vecSpread.x, y * vecSpread.y, 0.0 ); + return Vector( x * vecSpread.x, y * vecSpread.y, 0.0f ); } /* @@ -323,7 +323,7 @@ Handles weapon firing, reloading, etc. */ void CBasePlayerWeapon::ItemPostFrame( void ) { - if( ( m_fInReload ) && ( m_pPlayer->m_flNextAttack <= 0.0 ) ) + if( ( m_fInReload ) && ( m_pPlayer->m_flNextAttack <= 0.0f ) ) { #if 0 // FIXME, need ammo on client to make this work right // complete the reload. @@ -338,7 +338,7 @@ void CBasePlayerWeapon::ItemPostFrame( void ) m_fInReload = FALSE; } - if( ( m_pPlayer->pev->button & IN_ATTACK2 ) && ( m_flNextSecondaryAttack <= 0.0 ) ) + if( ( m_pPlayer->pev->button & IN_ATTACK2 ) && ( m_flNextSecondaryAttack <= 0.0f ) ) { if( pszAmmo2() && !m_pPlayer->m_rgAmmo[SecondaryAmmoIndex()] ) { @@ -348,7 +348,7 @@ void CBasePlayerWeapon::ItemPostFrame( void ) SecondaryAttack(); m_pPlayer->pev->button &= ~IN_ATTACK2; } - else if( ( m_pPlayer->pev->button & IN_ATTACK ) && ( m_flNextPrimaryAttack <= 0.0 ) ) + else if( ( m_pPlayer->pev->button & IN_ATTACK ) && ( m_flNextPrimaryAttack <= 0.0f ) ) { if( ( m_iClip == 0 && pszAmmo1() ) || ( iMaxClip() == -1 && !m_pPlayer->m_rgAmmo[PrimaryAmmoIndex()] ) ) { @@ -368,7 +368,7 @@ void CBasePlayerWeapon::ItemPostFrame( void ) m_fFireOnEmpty = FALSE; // weapon is useable. Reload if empty and weapon has waited as long as it has to after firing - if( m_iClip == 0 && !( iFlags() & ITEM_FLAG_NOAUTORELOAD ) && m_flNextPrimaryAttack < 0.0 ) + if( m_iClip == 0 && !( iFlags() & ITEM_FLAG_NOAUTORELOAD ) && m_flNextPrimaryAttack < 0.0f ) { Reload(); return; @@ -483,7 +483,7 @@ Don't actually trace, but act like the trace didn't hit anything. void UTIL_TraceLine( const Vector &vecStart, const Vector &vecEnd, IGNORE_MONSTERS igmon, edict_t *pentIgnore, TraceResult *ptr ) { memset( ptr, 0, sizeof(*ptr) ); - ptr->flFraction = 1.0; + ptr->flFraction = 1.0f; } /* @@ -944,73 +944,73 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm pto->iuser3 = pCurrent->m_fireState; // Decrement weapon counters, server does this at same time ( during post think, after doing everything else ) - pto->m_flNextReload -= cmd->msec / 1000.0; - pto->m_fNextAimBonus -= cmd->msec / 1000.0; - pto->m_flNextPrimaryAttack -= cmd->msec / 1000.0; - pto->m_flNextSecondaryAttack -= cmd->msec / 1000.0; - pto->m_flTimeWeaponIdle -= cmd->msec / 1000.0; - pto->fuser1 -= cmd->msec / 1000.0; + pto->m_flNextReload -= cmd->msec / 1000.0f; + pto->m_fNextAimBonus -= cmd->msec / 1000.0f; + pto->m_flNextPrimaryAttack -= cmd->msec / 1000.0f; + pto->m_flNextSecondaryAttack -= cmd->msec / 1000.0f; + pto->m_flTimeWeaponIdle -= cmd->msec / 1000.0f; + pto->fuser1 -= cmd->msec / 1000.0f; to->client.vuser3[2] = pCurrent->m_iSecondaryAmmoType; to->client.vuser4[0] = pCurrent->m_iPrimaryAmmoType; to->client.vuser4[1] = player.m_rgAmmo[pCurrent->m_iPrimaryAmmoType]; to->client.vuser4[2] = player.m_rgAmmo[pCurrent->m_iSecondaryAmmoType]; -/* if( pto->m_flPumpTime != -9999 ) +/* if( pto->m_flPumpTime != -9999.0f ) { - pto->m_flPumpTime -= cmd->msec / 1000.0; - if( pto->m_flPumpTime < -0.001 ) - pto->m_flPumpTime = -0.001; + pto->m_flPumpTime -= cmd->msec / 1000.0f; + if( pto->m_flPumpTime < -0.001f ) + pto->m_flPumpTime = -0.001f; }*/ - if( pto->m_fNextAimBonus < -1.0 ) + if( pto->m_fNextAimBonus < -1.0f ) { - pto->m_fNextAimBonus = -1.0; + pto->m_fNextAimBonus = -1.0f; } - if( pto->m_flNextPrimaryAttack < -1.0 ) + if( pto->m_flNextPrimaryAttack < -1.0f ) { - pto->m_flNextPrimaryAttack = -1.0; + pto->m_flNextPrimaryAttack = -1.0f; } - if( pto->m_flNextSecondaryAttack < -0.001 ) + if( pto->m_flNextSecondaryAttack < -0.001f ) { - pto->m_flNextSecondaryAttack = -0.001; + pto->m_flNextSecondaryAttack = -0.001f; } - if( pto->m_flTimeWeaponIdle < -0.001 ) + if( pto->m_flTimeWeaponIdle < -0.001f ) { - pto->m_flTimeWeaponIdle = -0.001; + pto->m_flTimeWeaponIdle = -0.001f; } - if( pto->m_flNextReload < -0.001 ) + if( pto->m_flNextReload < -0.001f ) { - pto->m_flNextReload = -0.001; + pto->m_flNextReload = -0.001f; } - if( pto->fuser1 < -0.001 ) + if( pto->fuser1 < -0.001f ) { - pto->fuser1 = -0.001; + pto->fuser1 = -0.001f; } } // m_flNextAttack is now part of the weapons, but is part of the player instead - to->client.m_flNextAttack -= cmd->msec / 1000.0; - if( to->client.m_flNextAttack < -0.001 ) + to->client.m_flNextAttack -= cmd->msec / 1000.0f; + if( to->client.m_flNextAttack < -0.001f ) { - to->client.m_flNextAttack = -0.001; + to->client.m_flNextAttack = -0.001f; } - to->client.fuser2 -= cmd->msec / 1000.0; - if( to->client.fuser2 < -0.001 ) + to->client.fuser2 -= cmd->msec / 1000.0f; + if( to->client.fuser2 < -0.001f ) { - to->client.fuser2 = -0.001; + to->client.fuser2 = -0.001f; } - to->client.fuser3 -= cmd->msec / 1000.0; - if( to->client.fuser3 < -0.001 ) + to->client.fuser3 -= cmd->msec / 1000.0f; + if( to->client.fuser3 < -0.001f ) { - to->client.fuser3 = -0.001; + to->client.fuser3 = -0.001f; } // Store off the last position from the predicted state. diff --git a/cl_dll/hud.cpp b/cl_dll/hud.cpp index 62c32b41..9652770d 100644 --- a/cl_dll/hud.cpp +++ b/cl_dll/hud.cpp @@ -190,8 +190,9 @@ void CHud::Init( void ) m_iLogo = 0; m_iFOV = 0; - CVAR_CREATE( "zoom_sensitivity_ratio", "1.2", 0 ); - default_fov = CVAR_CREATE( "default_fov", "90", 0 ); + CVAR_CREATE( "zoom_sensitivity_ratio", "1.2", FCVAR_ARCHIVE ); + CVAR_CREATE( "cl_autowepswitch", "1", FCVAR_ARCHIVE | FCVAR_USERINFO ); + default_fov = CVAR_CREATE( "default_fov", "90", FCVAR_ARCHIVE ); m_pCvarStealMouse = CVAR_CREATE( "hud_capturemouse", "1", FCVAR_ARCHIVE ); m_pCvarDraw = CVAR_CREATE( "hud_draw", "1", FCVAR_ARCHIVE ); cl_lw = gEngfuncs.pfnGetCvarPointer( "cl_lw" ); diff --git a/cl_dll/hud_redraw.cpp b/cl_dll/hud_redraw.cpp index 4a46a519..579c0897 100644 --- a/cl_dll/hud_redraw.cpp +++ b/cl_dll/hud_redraw.cpp @@ -15,7 +15,8 @@ // // hud_redraw.cpp // -#include +#include + #include "hud.h" #include "cl_util.h" //#include "triangleapi.h" @@ -75,7 +76,7 @@ void CHud::Think( void ) if( m_iFOV == 0 ) { // only let players adjust up in fov, and only if they are not overriden by something else - m_iFOV = max( default_fov->value, 90 ); + m_iFOV = Q_max( default_fov->value, 90 ); } } @@ -86,7 +87,7 @@ int CHud::Redraw( float flTime, int intermission ) { m_fOldTime = m_flTime; // save time of previous redraw m_flTime = flTime; - m_flTimeDelta = (double)m_flTime - m_fOldTime; + m_flTimeDelta = (double)( m_flTime - m_fOldTime ); static float m_flShotTime = 0; // Clock was reset, reset delta @@ -97,7 +98,7 @@ int CHud::Redraw( float flTime, int intermission ) { // Take a screenshot if the client's got the cvar set if( CVAR_GET_FLOAT( "hud_takesshots" ) != 0 ) - m_flShotTime = flTime + 1.0; // Take a screenshot in a second + m_flShotTime = flTime + 1.0f; // Take a screenshot in a second } if( m_flShotTime && m_flShotTime < flTime ) diff --git a/cl_dll/hud_spectator.cpp b/cl_dll/hud_spectator.cpp index edb743ba..f666b5e6 100644 --- a/cl_dll/hud_spectator.cpp +++ b/cl_dll/hud_spectator.cpp @@ -69,10 +69,10 @@ void SpectatorSpray( void ) VectorScale( forward, 128, forward ); VectorAdd( forward, v_origin, forward ); pmtrace_t * trace = gEngfuncs.PM_TraceLine( v_origin, forward, PM_TRACELINE_PHYSENTSONLY, 2, -1 ); - if( trace->fraction != 1.0 ) + if( trace->fraction != 1.0f ) { sprintf( string, "drc_spray %.2f %.2f %.2f %i", - trace->endpos[0], trace->endpos[1], trace->endpos[2], trace->ent ); + (double)trace->endpos[0], (double)trace->endpos[1], (double)trace->endpos[2], trace->ent ); gEngfuncs.pfnServerCmd( string ); } } @@ -355,7 +355,7 @@ int CHudSpectator::Draw( float flTime ) int lx; char string[256]; - float * color; + float *color; // draw only in spectator mode if( !g_iUser1 ) @@ -820,8 +820,8 @@ bool CHudSpectator::IsActivePlayer( cl_entity_t *ent ) bool CHudSpectator::ParseOverviewFile() { - char filename[255] = { 0 }; - char levelname[255] = { 0 }; + char filename[512] = { 0 }; + char levelname[256] = { 0 }; char token[1024] = { 0 }; float height; @@ -842,7 +842,7 @@ bool CHudSpectator::ParseOverviewFile() m_OverviewData.layersHeights[0] = 0.0f; strcpy( m_OverviewData.map, gEngfuncs.pfnGetLevelName() ); - if( strlen( m_OverviewData.map ) == 0 ) + if( m_OverviewData.map[0] == '\0' ) return false; // not active yet strcpy( levelname, m_OverviewData.map + 5 ); @@ -987,15 +987,15 @@ void CHudSpectator::DrawOverviewLayer() float screenaspect, xs, ys, xStep, yStep, x, y, z; int ix, iy, i, xTiles, yTiles, frame; - qboolean hasMapImage = m_MapSprite?TRUE:FALSE; - model_t * dummySprite = (struct model_s *)gEngfuncs.GetSpritePointer( m_hsprUnkownMap); + qboolean hasMapImage = m_MapSprite ? TRUE : FALSE; + model_t *dummySprite = (struct model_s *)gEngfuncs.GetSpritePointer( m_hsprUnkownMap ); - if ( hasMapImage) + if( hasMapImage ) { - i = m_MapSprite->numframes / (4*3); - i = sqrt(float(i)); - xTiles = i*4; - yTiles = i*3; + i = m_MapSprite->numframes / ( 4 * 3 ); + i = sqrt( float( i ) ); + xTiles = i * 4; + yTiles = i * 3; } else { @@ -1014,7 +1014,7 @@ void CHudSpectator::DrawOverviewLayer() gEngfuncs.pTriAPI->RenderMode( kRenderTransTexture ); gEngfuncs.pTriAPI->CullFace( TRI_NONE ); - gEngfuncs.pTriAPI->Color4f( 1.0, 1.0, 1.0, 1.0 ); + gEngfuncs.pTriAPI->Color4f( 1.0f, 1.0f, 1.0f, 1.0f ); frame = 0; @@ -1143,7 +1143,7 @@ void CHudSpectator::DrawOverviewEntities() gEngfuncs.pTriAPI->Begin( TRI_QUADS ); - gEngfuncs.pTriAPI->Color4f( 1.0, 1.0, 1.0, 1.0 ); + gEngfuncs.pTriAPI->Color4f( 1.0f, 1.0f, 1.0f, 1.0f ); gEngfuncs.pTriAPI->TexCoord2f(1, 0); VectorMA( origin, 16.0f * sizeScale, up, point ); @@ -1183,28 +1183,28 @@ void CHudSpectator::DrawOverviewEntities() hSpriteModel = (struct model_s *)gEngfuncs.GetSpritePointer( m_hsprBeam ); gEngfuncs.pTriAPI->SpriteTexture( hSpriteModel, 0 ); - gEngfuncs.pTriAPI->Color4f( r, g, b, 0.3 ); + gEngfuncs.pTriAPI->Color4f( r, g, b, 0.3f ); gEngfuncs.pTriAPI->Begin( TRI_QUADS ); - gEngfuncs.pTriAPI->TexCoord2f( 1, 0 ); - gEngfuncs.pTriAPI->Vertex3f( origin[0] + 4, origin[1] + 4, origin[2] - zScale ); - gEngfuncs.pTriAPI->TexCoord2f( 0, 0 ); - gEngfuncs.pTriAPI->Vertex3f( origin[0] - 4, origin[1] - 4, origin[2] - zScale ); - gEngfuncs.pTriAPI->TexCoord2f( 0, 1 ); - gEngfuncs.pTriAPI->Vertex3f( origin[0] - 4, origin[1] - 4, z ); - gEngfuncs.pTriAPI->TexCoord2f( 1, 1 ); - gEngfuncs.pTriAPI->Vertex3f( origin[0] + 4, origin[1] + 4, z ); + gEngfuncs.pTriAPI->TexCoord2f( 1.0f, 0.0f ); + gEngfuncs.pTriAPI->Vertex3f( origin[0] + 4.0f, origin[1] + 4.0f, origin[2] - zScale ); + gEngfuncs.pTriAPI->TexCoord2f( 0.0f, 0.0f ); + gEngfuncs.pTriAPI->Vertex3f( origin[0] - 4.0f, origin[1] - 4.0f, origin[2] - zScale ); + gEngfuncs.pTriAPI->TexCoord2f( 0.0f, 1.0f ); + gEngfuncs.pTriAPI->Vertex3f( origin[0] - 4.0f, origin[1] - 4.0f, z ); + gEngfuncs.pTriAPI->TexCoord2f( 1.0f, 1.0f ); + gEngfuncs.pTriAPI->Vertex3f( origin[0] + 4.0f, origin[1] + 4.0f, z ); gEngfuncs.pTriAPI->End(); gEngfuncs.pTriAPI->Begin( TRI_QUADS ); - gEngfuncs.pTriAPI->TexCoord2f( 1, 0 ); - gEngfuncs.pTriAPI->Vertex3f( origin[0] - 4, origin[1] + 4, origin[2] - zScale ); - gEngfuncs.pTriAPI->TexCoord2f( 0, 0 ); - gEngfuncs.pTriAPI->Vertex3f( origin[0] + 4, origin[1] - 4, origin[2] - zScale ); - gEngfuncs.pTriAPI->TexCoord2f( 0, 1 ); - gEngfuncs.pTriAPI->Vertex3f( origin[0] + 4, origin[1] - 4, z ); - gEngfuncs.pTriAPI->TexCoord2f( 1, 1 ); - gEngfuncs.pTriAPI->Vertex3f( origin[0] - 4, origin[1] + 4, z ); + gEngfuncs.pTriAPI->TexCoord2f( 1.0f, 0.0f ); + gEngfuncs.pTriAPI->Vertex3f( origin[0] - 4.0f, origin[1] + 4.0f, origin[2] - zScale ); + gEngfuncs.pTriAPI->TexCoord2f( 0.0f, 0.0f ); + gEngfuncs.pTriAPI->Vertex3f( origin[0] + 4.0f, origin[1] - 4.0f, origin[2] - zScale ); + gEngfuncs.pTriAPI->TexCoord2f( 0.0f, 1.0f ); + gEngfuncs.pTriAPI->Vertex3f( origin[0] + 4.0f, origin[1] - 4.0f, z ); + gEngfuncs.pTriAPI->TexCoord2f( 1.0f, 1.0f ); + gEngfuncs.pTriAPI->Vertex3f( origin[0] - 4.0f, origin[1] + 4.0f, z ); gEngfuncs.pTriAPI->End(); // calculate screen position for name and infromation in hud::draw() @@ -1265,7 +1265,7 @@ void CHudSpectator::DrawOverviewEntities() gEngfuncs.pTriAPI->RenderMode( kRenderTransAdd ); gEngfuncs.pTriAPI->SpriteTexture( hSpriteModel, 0 ); - gEngfuncs.pTriAPI->Color4f( r, g, b, 1.0 ); + gEngfuncs.pTriAPI->Color4f( r, g, b, 1.0f ); AngleVectors( angles, forward, NULL, NULL ); VectorScale( forward, 512.0f, forward ); @@ -1282,13 +1282,13 @@ void CHudSpectator::DrawOverviewEntities() VectorTransform( forward, rmatrix , left ); gEngfuncs.pTriAPI->Begin( TRI_TRIANGLES ); - gEngfuncs.pTriAPI->TexCoord2f( 0, 0 ); + gEngfuncs.pTriAPI->TexCoord2f( 0.0f, 0.0f ); gEngfuncs.pTriAPI->Vertex3f( x + right[0], y + right[1], ( z + right[2] ) * zScale); - gEngfuncs.pTriAPI->TexCoord2f( 0, 1 ); + gEngfuncs.pTriAPI->TexCoord2f( 0.0f, 1.0f ); gEngfuncs.pTriAPI->Vertex3f( x, y, z * zScale ); - gEngfuncs.pTriAPI->TexCoord2f( 1, 1 ); + gEngfuncs.pTriAPI->TexCoord2f( 1.0f, 1.0f ); gEngfuncs.pTriAPI->Vertex3f( x + left[0], y + left[1], ( z + left[2] ) * zScale ); gEngfuncs.pTriAPI->End (); } @@ -1329,7 +1329,7 @@ void CHudSpectator::CheckOverviewEntities() bool CHudSpectator::AddOverviewEntity( int type, struct cl_entity_s *ent, const char *modelname) { HSPRITE hSprite = 0; - double duration = -1.0f; // duration -1 means show it only this frame; + double duration = -1.0; // duration -1 means show it only this frame; if( !ent ) return false; diff --git a/cl_dll/hud_update.cpp b/cl_dll/hud_update.cpp index cecbb625..f431bbaf 100644 --- a/cl_dll/hud_update.cpp +++ b/cl_dll/hud_update.cpp @@ -16,7 +16,7 @@ // hud_update.cpp // -#include +#include #include "hud.h" #include "cl_util.h" #include diff --git a/cl_dll/in_camera.cpp b/cl_dll/in_camera.cpp index 12ad41f4..3b089577 100644 --- a/cl_dll/in_camera.cpp +++ b/cl_dll/in_camera.cpp @@ -28,16 +28,16 @@ extern cl_enginefunc_t gEngfuncs; //-------------------------------------------------- Constants -#define CAM_DIST_DELTA 1.0 -#define CAM_ANGLE_DELTA 2.5 -#define CAM_ANGLE_SPEED 2.5 -#define CAM_MIN_DIST 30.0 -#define CAM_ANGLE_MOVE .5 -#define MAX_ANGLE_DIFF 10.0 -#define PITCH_MAX 90.0 -#define PITCH_MIN 0 -#define YAW_MAX 135.0 -#define YAW_MIN -135.0 +#define CAM_DIST_DELTA 1.0f +#define CAM_ANGLE_DELTA 2.5f +#define CAM_ANGLE_SPEED 2.5f +#define CAM_MIN_DIST 30.0f +#define CAM_ANGLE_MOVE 0.5f +#define MAX_ANGLE_DIFF 10.0f +#define PITCH_MAX 90.0f +#define PITCH_MIN 0.0f +#define YAW_MAX 135.0f +#define YAW_MIN -135.0f enum ECAM_Command { @@ -91,35 +91,35 @@ float MoveToward( float cur, float goal, float maxspeed ) { if( cur != goal ) { - if( fabs( cur - goal ) > 180.0 ) + if( fabs( cur - goal ) > 180.0f ) { if( cur < goal ) - cur += 360.0; + cur += 360.0f; else - cur -= 360.0; + cur -= 360.0f; } if( cur < goal ) { - if( cur < goal - 1.0 ) - cur += ( goal - cur ) / 4.0; + if( cur < goal - 1.0f ) + cur += ( goal - cur ) * 0.25f; else cur = goal; } else { - if( cur > goal + 1.0 ) - cur -= ( cur - goal ) / 4.0; + if( cur > goal + 1.0f ) + cur -= ( cur - goal ) * 0.25f; else cur = goal; } } // bring cur back into range - if( cur < 0 ) - cur += 360.0; - else if( cur >= 360 ) - cur -= 360; + if( cur < 0.0f ) + cur += 360.0f; + else if( cur >= 360.0f ) + cur -= 360.0f; return cur; } @@ -172,7 +172,7 @@ void DLLEXPORT CAM_Think( void ) if( cam_contain->value ) { gEngfuncs.GetClientOrigin( origin ); - ext[0] = ext[1] = ext[2] = 0.0; + ext[0] = ext[1] = ext[2] = 0.0f; } #endif camAngles[PITCH] = cam_idealpitch->value; @@ -195,7 +195,7 @@ void DLLEXPORT CAM_Think( void ) //keep the camera within certain limits around the player (ie avoid certain bad viewing angles) if( cam_mouse.x>gEngfuncs.GetWindowCenterX() ) { - //if( ( camAngles[YAW] >= 225.0 ) || ( camAngles[YAW] < 135.0 ) ) + //if( ( camAngles[YAW] >= 225.0f ) || ( camAngles[YAW] < 135.0f ) ) if( camAngles[YAW] < c_maxyaw->value ) { camAngles[YAW] += CAM_ANGLE_MOVE * ( ( cam_mouse.x - gEngfuncs.GetWindowCenterX() ) / 2 ); @@ -207,7 +207,7 @@ void DLLEXPORT CAM_Think( void ) } else if( cam_mouse.x 225.0 ) ) + //if( ( camAngles[YAW] <= 135.0f ) || ( camAngles[YAW] > 225.0f ) ) if( camAngles[YAW] > c_minyaw->value ) { camAngles[YAW] -= CAM_ANGLE_MOVE * ( ( gEngfuncs.GetWindowCenterX() - cam_mouse.x ) / 2 ); @@ -363,10 +363,10 @@ void DLLEXPORT CAM_Think( void ) if( camAngles[PITCH] - viewangles[PITCH] != cam_idealpitch->value ) camAngles[PITCH] = MoveToward( camAngles[PITCH], cam_idealpitch->value + viewangles[PITCH], CAM_ANGLE_SPEED ); - if( fabs( camAngles[2] - cam_idealdist->value ) < 2.0 ) + if( fabs( camAngles[2] - cam_idealdist->value ) < 2.0f ) camAngles[2] = cam_idealdist->value; else - camAngles[2] += ( cam_idealdist->value - camAngles[2] ) / 4.0; + camAngles[2] += ( cam_idealdist->value - camAngles[2] ) * 0.25f; } #ifdef LATER if( cam_contain->value ) @@ -382,9 +382,9 @@ void DLLEXPORT CAM_Think( void ) // check line from r_refdef.vieworg to pnt memset( &clip, 0, sizeof(moveclip_t) ); - ext[0] = ext[1] = ext[2] = 0.0; + ext[0] = ext[1] = ext[2] = 0.0f; clip.trace = SV_ClipMoveToEntity( sv.edicts, r_refdef.vieworg, ext, ext, pnt ); - if( clip.trace.fraction != 1.0 ) + if( clip.trace.fraction != 1.0f ) return; } #endif diff --git a/cl_dll/input.cpp b/cl_dll/input.cpp index 0abd542b..eab15acf 100644 --- a/cl_dll/input.cpp +++ b/cl_dll/input.cpp @@ -169,7 +169,7 @@ int KB_ConvertString( char *in, char **ppout ) *pEnd = '\0'; pBinding = NULL; - if( strlen( binding + 1 ) > 0 ) + if( binding[1] != '\0' ) { // See if there is a binding for binding? pBinding = gEngfuncs.Key_LookupBinding( binding + 1 ); @@ -819,7 +819,7 @@ void DLLEXPORT CL_CreateMove( float frametime, struct usercmd_s *cmd, int active // clip to maxspeed spd = gEngfuncs.GetClientMaxspeed(); - if( spd != 0.0 ) + if( spd != 0.0f ) { // scale the 3 speeds so that the total velocity is not > cl.maxspeed float fmov = sqrt( ( cmd->forwardmove * cmd->forwardmove ) + ( cmd->sidemove * cmd->sidemove ) + ( cmd->upmove * cmd->upmove ) ); diff --git a/cl_dll/input_xash3d.cpp b/cl_dll/input_xash3d.cpp index 2ff572ee..2be1ffb3 100644 --- a/cl_dll/input_xash3d.cpp +++ b/cl_dll/input_xash3d.cpp @@ -82,42 +82,42 @@ void IN_ToggleButtons( float forwardmove, float sidemove ) } } - if( forwardmove > 0.7 && !( moveflags & F ) ) + if( forwardmove > 0.7f && !( moveflags & F ) ) { moveflags |= F; in_forward.state |= BUTTON_DOWN; } - if( forwardmove < 0.7 && ( moveflags & F ) ) + if( forwardmove < 0.7f && ( moveflags & F ) ) { moveflags &= ~F; in_forward.state &= ~BUTTON_DOWN; } - if( forwardmove < -0.7 && !( moveflags & B ) ) + if( forwardmove < -0.7f && !( moveflags & B ) ) { moveflags |= B; in_back.state |= BUTTON_DOWN; } - if( forwardmove > -0.7 && ( moveflags & B ) ) + if( forwardmove > -0.7f && ( moveflags & B ) ) { moveflags &= ~B; in_back.state &= ~BUTTON_DOWN; } - if( sidemove > 0.9 && !( moveflags & R ) ) + if( sidemove > 0.9f && !( moveflags & R ) ) { moveflags |= R; in_moveright.state |= BUTTON_DOWN; } - if( sidemove < 0.9 && ( moveflags & R ) ) + if( sidemove < 0.9f && ( moveflags & R ) ) { moveflags &= ~R; in_moveright.state &= ~BUTTON_DOWN; } - if( sidemove < -0.9 && !( moveflags & L ) ) + if( sidemove < -0.9f && !( moveflags & L ) ) { moveflags |= L; in_moveleft.state |= BUTTON_DOWN; } - if( sidemove > -0.9 && ( moveflags & L ) ) + if( sidemove > -0.9f && ( moveflags & L ) ) { moveflags &= ~L; in_moveleft.state &= ~BUTTON_DOWN; diff --git a/cl_dll/message.cpp b/cl_dll/message.cpp index bbd59d9a..29834a13 100644 --- a/cl_dll/message.cpp +++ b/cl_dll/message.cpp @@ -66,22 +66,22 @@ float CHudMessage::FadeBlend( float fadein, float fadeout, float hold, float loc float fadeTime = fadein + hold; float fadeBlend; - if( localTime < 0 ) + if( localTime < 0.0f ) return 0; if( localTime < fadein ) { - fadeBlend = 1 - ( ( fadein - localTime ) / fadein ); + fadeBlend = 1.0f - ( ( fadein - localTime ) / fadein ); } else if( localTime > fadeTime ) { - if( fadeout > 0 ) - fadeBlend = 1 - ( ( localTime - fadeTime ) / fadeout ); + if( fadeout > 0.0f ) + fadeBlend = 1.0f - ( ( localTime - fadeTime ) / fadeout ); else - fadeBlend = 0; + fadeBlend = 0.0f; } else - fadeBlend = 1; + fadeBlend = 1.0f; return fadeBlend; } @@ -91,14 +91,14 @@ int CHudMessage::XPosition( float x, int width, int totalWidth ) { int xPos; - if( x == -1 ) + if( x == -1.0f ) { xPos = ( ScreenWidth - width ) / 2; } else { - if( x < 0 ) - xPos = ( 1.0 + x ) * ScreenWidth - totalWidth; // Alight right + if( x < 0.0f ) + xPos = ( 1.0f + x ) * ScreenWidth - totalWidth; // Alight right else xPos = x * ScreenWidth; } @@ -116,12 +116,12 @@ int CHudMessage::YPosition( float y, int height ) int yPos; if( y == -1 ) // Centered? - yPos = ( ScreenHeight - height ) * 0.5; + yPos = ( ScreenHeight - height ) * 0.5f; else { // Alight bottom? if ( y < 0 ) - yPos = ( 1.0 + y ) * ScreenHeight - height; // Alight bottom + yPos = ( 1.0f + y ) * ScreenHeight - height; // Alight bottom else // align top yPos = y * ScreenHeight; } @@ -164,18 +164,20 @@ void CHudMessage::MessageScanNextChar( void ) float deltaTime = m_parms.time - m_parms.charTime; destRed = destGreen = destBlue = 0; - if ( m_parms.time > m_parms.fadeTime ) + if( m_parms.time > m_parms.fadeTime ) { blend = m_parms.fadeBlend; } - else if ( deltaTime > m_parms.pMessage->fxtime ) + else if( deltaTime > m_parms.pMessage->fxtime ) + { blend = 0; // pure dest + } else { destRed = m_parms.pMessage->r2; destGreen = m_parms.pMessage->g2; destBlue = m_parms.pMessage->b2; - blend = 255 - (deltaTime * (1.0/m_parms.pMessage->fxtime) * 255.0 + 0.5); + blend = 255 - ( deltaTime * ( 1.0f / m_parms.pMessage->fxtime) * 255.0f + 0.5f ); } } break; @@ -208,7 +210,7 @@ void CHudMessage::MessageScanStart( void ) if( m_parms.time < m_parms.pMessage->fadein ) { - m_parms.fadeBlend = ( ( m_parms.pMessage->fadein - m_parms.time ) * ( 1.0 / m_parms.pMessage->fadein ) * 255 ); + m_parms.fadeBlend = ( ( m_parms.pMessage->fadein - m_parms.time ) * ( 1.0f / m_parms.pMessage->fadein ) * 255 ); } else if( m_parms.time > m_parms.fadeTime ) { @@ -350,9 +352,9 @@ int CHudMessage::Draw( float fTime ) // Assume m_parms.time contains last time if( m_pMessages[i] ) { - pMessage = m_pMessages[i]; + // pMessage = m_pMessages[i]; if( m_startTime[i] > gHUD.m_flTime ) - m_startTime[i] = gHUD.m_flTime + m_parms.time - m_startTime[i] + 0.2; // Server takes 0.2 seconds to spawn, adjust for this + m_startTime[i] = gHUD.m_flTime + m_parms.time - m_startTime[i] + 0.2f; // Server takes 0.2 seconds to spawn, adjust for this } } @@ -428,11 +430,11 @@ void CHudMessage::MessageAdd( const char *pName, float time ) g_pCustomMessage.g2 = 110; g_pCustomMessage.b2 = 0; g_pCustomMessage.a2 = 0; - g_pCustomMessage.x = -1; // Centered - g_pCustomMessage.y = 0.7; - g_pCustomMessage.fadein = 0.01; - g_pCustomMessage.fadeout = 1.5; - g_pCustomMessage.fxtime = 0.25; + g_pCustomMessage.x = -1.0f; // Centered + g_pCustomMessage.y = 0.7f; + g_pCustomMessage.fadein = 0.01f; + g_pCustomMessage.fadeout = 1.5f; + g_pCustomMessage.fxtime = 0.25f; g_pCustomMessage.holdtime = 5; g_pCustomMessage.pName = g_pCustomName; strcpy( g_pCustomText, pName ); @@ -452,9 +454,9 @@ void CHudMessage::MessageAdd( const char *pName, float time ) } // get rid of any other messages in same location (only one displays at a time) - if( fabs( tempMessage->y - m_pMessages[j]->y ) < 0.0001 ) + if( fabs( tempMessage->y - m_pMessages[j]->y ) < 0.0001f ) { - if ( fabs( tempMessage->x - m_pMessages[j]->x ) < 0.0001 ) + if( fabs( tempMessage->x - m_pMessages[j]->x ) < 0.0001f ) { m_pMessages[j] = NULL; } diff --git a/cl_dll/saytext.cpp b/cl_dll/saytext.cpp index 8f2e2520..bf8eca80 100644 --- a/cl_dll/saytext.cpp +++ b/cl_dll/saytext.cpp @@ -96,10 +96,7 @@ int CHudSayText::Draw( float flTime ) int y = Y_START; // make sure the scrolltime is within reasonable bounds, to guard against the clock being reset - flScrollTime = min( flScrollTime, flTime + m_HUD_saytext_time->value ); - - // make sure the scrolltime is within reasonable bounds, to guard against the clock being reset - flScrollTime = min( flScrollTime, flTime + m_HUD_saytext_time->value ); + flScrollTime = Q_min( flScrollTime, flTime + m_HUD_saytext_time->value ); if( flScrollTime <= flTime ) { @@ -126,8 +123,8 @@ int CHudSayText::Draw( float flTime ) static char buf[MAX_PLAYER_NAME_LENGTH + 32]; // draw the first x characters in the player color - strncpy( buf, g_szLineBuffer[i], min(g_iNameLengths[i], MAX_PLAYER_NAME_LENGTH + 32 ) ); - buf[min( g_iNameLengths[i], MAX_PLAYER_NAME_LENGTH + 31 )] = 0; + strncpy( buf, g_szLineBuffer[i], Q_min(g_iNameLengths[i], MAX_PLAYER_NAME_LENGTH + 32 ) ); + buf[Q_min( g_iNameLengths[i], MAX_PLAYER_NAME_LENGTH + 31 )] = 0; DrawSetTextColor( g_pflNameColors[i][0], g_pflNameColors[i][1], g_pflNameColors[i][2] ); int x = DrawConsoleString( LINE_START, y, buf ); @@ -196,7 +193,7 @@ void CHudSayText::SayTextPrint( const char *pszBuf, int iBufSize, int clientInde } } - strncpy( g_szLineBuffer[i], pszBuf, max( iBufSize - 1, MAX_CHARS_PER_LINE - 1 ) ); + strncpy( g_szLineBuffer[i], pszBuf, Q_max( iBufSize - 1, MAX_CHARS_PER_LINE - 1 ) ); // make sure the text fits in one line EnsureTextFitsInOneLineAndWrapIfHaveTo( i ); @@ -262,7 +259,7 @@ void CHudSayText::EnsureTextFitsInOneLineAndWrapIfHaveTo( int line ) if( !last_break ) last_break = x - 1; - x = last_break; + // x = last_break; // find an empty string slot int j; diff --git a/cl_dll/scoreboard.cpp b/cl_dll/scoreboard.cpp index d4bdecb8..721980f3 100644 --- a/cl_dll/scoreboard.cpp +++ b/cl_dll/scoreboard.cpp @@ -171,12 +171,12 @@ int CHudScoreboard::Draw( float fTime ) DrawUtfString( PL_RANGE_MAX + xpos_rel - 35, ypos, ScreenWidth, "pkt loss", 255, 140, 0 ); } - list_slot += 1.2; + list_slot += 1.2f; ypos = ROW_RANGE_MIN + ( list_slot * ROW_GAP ); // xpos = NAME_RANGE_MIN + xpos_rel; FillRGBA( xpos - 4, ypos, FAR_RIGHT -2, 1, 255, 140, 0, 255 ); // draw the seperator line - list_slot += 0.8; + list_slot += 0.8f; if( !gHUD.m_Teamplay ) { @@ -328,7 +328,7 @@ int CHudScoreboard::Draw( float fTime ) } // draw all the players who are not in a team - list_slot += 0.5; + list_slot += 0.5f; DrawPlayers( xpos_rel, list_slot, 0, "" ); return 1; @@ -561,7 +561,7 @@ int CHudScoreboard::MsgFunc_TeamInfo( const char *pszName, int iSize, void *pbuf if( g_TeamInfo[j].name[0] == '\0' ) break; } - m_iNumTeams = max( j, m_iNumTeams ); + m_iNumTeams = Q_max( j, m_iNumTeams ); strncpy( g_TeamInfo[j].name, g_PlayerExtraInfo[i].teamname, MAX_TEAM_NAME ); g_TeamInfo[j].players = 0; diff --git a/cl_dll/statusbar.cpp b/cl_dll/statusbar.cpp index 98b317c5..79f30b7e 100644 --- a/cl_dll/statusbar.cpp +++ b/cl_dll/statusbar.cpp @@ -197,7 +197,7 @@ int CHudStatusBar::Draw( float fTime ) // let user set status ID bar centering if( ( i == STATUSBAR_ID_LINE ) && CVAR_GET_FLOAT( "hud_centerid" ) ) { - x = max( 0, max( 2, ( ScreenWidth - TextWidth ) ) / 2 ); + x = Q_max( 0, Q_max( 2, ( ScreenWidth - TextWidth ) ) / 2 ); y = ( ScreenHeight / 2 ) + ( TextHeight * CVAR_GET_FLOAT( "hud_centerid" ) ); } diff --git a/cl_dll/studio_util.cpp b/cl_dll/studio_util.cpp index 6e488dcb..7ac385fe 100644 --- a/cl_dll/studio_util.cpp +++ b/cl_dll/studio_util.cpp @@ -23,13 +23,13 @@ void AngleMatrix( const float *angles, float (*matrix)[4] ) float angle; float sr, sp, sy, cr, cp, cy; - angle = angles[YAW] * ( M_PI*2 / 360 ); + angle = angles[YAW] * ( M_PI_F * 2.0f / 360.0f ); sy = sin( angle ); cy = cos( angle ); - angle = angles[PITCH] * ( M_PI*2 / 360 ); + angle = angles[PITCH] * ( M_PI_F * 2.0f / 360.0f ); sp = sin( angle ); cp = cos( angle ); - angle = angles[ROLL] * ( M_PI*2 / 360 ); + angle = angles[ROLL] * ( M_PI_F * 2.0f / 360.0f ); sr = sin( angle ); cr = cos( angle ); @@ -43,9 +43,9 @@ void AngleMatrix( const float *angles, float (*matrix)[4] ) matrix[0][2] = (cr * sp * cy + -sr * -sy); matrix[1][2] = (cr * sp * sy + -sr* cy); matrix[2][2] = cr * cp; - matrix[0][3] = 0.0; - matrix[1][3] = 0.0; - matrix[2][3] = 0.0; + matrix[0][3] = 0.0f; + matrix[1][3] = 0.0f; + matrix[2][3] = 0.0f; } /* @@ -73,9 +73,9 @@ CrossProduct */ void CrossProduct( const float *v1, const float *v2, float *cross ) { - cross[0] = v1[1]*v2[2] - v1[2]*v2[1]; - cross[1] = v1[2]*v2[0] - v1[0]*v2[2]; - cross[2] = v1[0]*v2[1] - v1[1]*v2[0]; + cross[0] = v1[1] * v2[2] - v1[2] * v2[1]; + cross[1] = v1[2] * v2[0] - v1[0] * v2[2]; + cross[2] = v1[0] * v2[1] - v1[1] * v2[0]; } /* @@ -139,13 +139,13 @@ void AngleQuaternion( float *angles, vec4_t quaternion ) float sr, sp, sy, cr, cp, cy; // FIXME: rescale the inputs to 1/2 angle - angle = angles[2] * 0.5; + angle = angles[2] * 0.5f; sy = sin( angle ); cy = cos( angle ); - angle = angles[1] * 0.5; + angle = angles[1] * 0.5f; sp = sin( angle ); cp = cos( angle ); - angle = angles[0] * 0.5; + angle = angles[0] * 0.5f; sr = sin( angle ); cr = cos( angle ); @@ -185,18 +185,18 @@ void QuaternionSlerp( vec4_t p, vec4_t q, float t, vec4_t qt ) cosom = p[0] * q[0] + p[1] * q[1] + p[2] * q[2] + p[3] * q[3]; - if( ( 1.0 + cosom ) > 0.000001 ) + if( ( 1.0f + cosom ) > 0.000001f ) { - if( ( 1.0 - cosom ) > 0.000001 ) + if( ( 1.0f - cosom ) > 0.000001f ) { omega = acos( cosom ); sinom = sin( omega ); - sclp = sin( ( 1.0 - t ) * omega ) / sinom; + sclp = sin( ( 1.0f - t ) * omega ) / sinom; sclq = sin( t * omega ) / sinom; } else { - sclp = 1.0 - t; + sclp = 1.0f - t; sclq = t; } for( i = 0; i < 4; i++ ) @@ -210,8 +210,8 @@ void QuaternionSlerp( vec4_t p, vec4_t q, float t, vec4_t qt ) qt[1] = q[0]; qt[2] = -q[3]; qt[3] = q[2]; - sclp = sin( ( 1.0 - t ) * ( 0.5 * M_PI ) ); - sclq = sin( t * ( 0.5 * M_PI ) ); + sclp = sin( ( 1.0f - t ) * ( 0.5f * M_PI_F ) ); + sclq = sin( t * ( 0.5f * M_PI_F ) ); for( i = 0; i < 3; i++ ) { qt[i] = sclp * p[i] + sclq * qt[i]; @@ -227,17 +227,17 @@ QuaternionMatrix */ void QuaternionMatrix( vec4_t quaternion, float (*matrix)[4] ) { - matrix[0][0] = 1.0 - 2.0 * quaternion[1] * quaternion[1] - 2.0 * quaternion[2] * quaternion[2]; - matrix[1][0] = 2.0 * quaternion[0] * quaternion[1] + 2.0 * quaternion[3] * quaternion[2]; - matrix[2][0] = 2.0 * quaternion[0] * quaternion[2] - 2.0 * quaternion[3] * quaternion[1]; + matrix[0][0] = 1.0f - 2.0f * quaternion[1] * quaternion[1] - 2.0f * quaternion[2] * quaternion[2]; + matrix[1][0] = 2.0f * quaternion[0] * quaternion[1] + 2.0f * quaternion[3] * quaternion[2]; + matrix[2][0] = 2.0f * quaternion[0] * quaternion[2] - 2.0f * quaternion[3] * quaternion[1]; - matrix[0][1] = 2.0 * quaternion[0] * quaternion[1] - 2.0 * quaternion[3] * quaternion[2]; - matrix[1][1] = 1.0 - 2.0 * quaternion[0] * quaternion[0] - 2.0 * quaternion[2] * quaternion[2]; - matrix[2][1] = 2.0 * quaternion[1] * quaternion[2] + 2.0 * quaternion[3] * quaternion[0]; + matrix[0][1] = 2.0f * quaternion[0] * quaternion[1] - 2.0f * quaternion[3] * quaternion[2]; + matrix[1][1] = 1.0f - 2.0f * quaternion[0] * quaternion[0] - 2.0f * quaternion[2] * quaternion[2]; + matrix[2][1] = 2.0f * quaternion[1] * quaternion[2] + 2.0f * quaternion[3] * quaternion[0]; - matrix[0][2] = 2.0 * quaternion[0] * quaternion[2] + 2.0 * quaternion[3] * quaternion[1]; - matrix[1][2] = 2.0 * quaternion[1] * quaternion[2] - 2.0 * quaternion[3] * quaternion[0]; - matrix[2][2] = 1.0 - 2.0 * quaternion[0] * quaternion[0] - 2.0 * quaternion[1] * quaternion[1]; + matrix[0][2] = 2.0f * quaternion[0] * quaternion[2] + 2.0f * quaternion[3] * quaternion[1]; + matrix[1][2] = 2.0f * quaternion[1] * quaternion[2] - 2.0f * quaternion[3] * quaternion[0]; + matrix[2][2] = 1.0f - 2.0f * quaternion[0] * quaternion[0] - 2.0f * quaternion[1] * quaternion[1]; } /* diff --git a/cl_dll/studio_util.h b/cl_dll/studio_util.h index 83de704c..12d165c5 100644 --- a/cl_dll/studio_util.h +++ b/cl_dll/studio_util.h @@ -13,6 +13,10 @@ #define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h #endif +#ifndef M_PI_F +#define M_PI_F (float)M_PI +#endif + #ifndef PITCH // MOVEMENT INFO // up / down diff --git a/cl_dll/util.cpp b/cl_dll/util.cpp index 655bde64..cda9fdf4 100644 --- a/cl_dll/util.cpp +++ b/cl_dll/util.cpp @@ -18,9 +18,9 @@ // implementation of class-less helper functions // -#include "stdio.h" -#include "stdlib.h" -#include "math.h" +#include +#include +#include #include "hud.h" #include "cl_util.h" @@ -30,20 +30,22 @@ #define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h #endif +#ifndef M_PI_F +#define M_PI_F (float)M_PI +#endif + extern vec3_t vec3_origin; #ifdef _MSC_VER vec3_t vec3_origin; #endif -double sqrt( double x ); - float Length( const float *v ) { int i; float length; - length = 0; + length = 0.0f; for( i = 0; i < 3; i++ ) length += v[i] * v[i]; length = sqrt( length ); // FIXME @@ -55,29 +57,29 @@ void VectorAngles( const float *forward, float *angles ) { float tmp, yaw, pitch; - if( forward[1] == 0 && forward[0] == 0 ) + if( forward[1] == 0.0f && forward[0] == 0.0f ) { - yaw = 0; - if( forward[2] > 0 ) - pitch = 90; + yaw = 0.0f; + if( forward[2] > 0.0f ) + pitch = 90.0f; else - pitch = 270; + pitch = 270.0f; } else { - yaw = ( atan2( forward[1], forward[0]) * 180 / M_PI ); - if( yaw < 0 ) - yaw += 360; + yaw = ( atan2( forward[1], forward[0]) * 180.0f / M_PI_F ); + if( yaw < 0.0f ) + yaw += 360.0f; tmp = sqrt( forward[0] * forward[0] + forward[1] * forward[1] ); - pitch = ( atan2( forward[2], tmp ) * 180 / M_PI ); - if( pitch < 0 ) - pitch += 360; + pitch = ( atan2( forward[2], tmp ) * 180.0f / M_PI_F ); + if( pitch < 0.0f ) + pitch += 360.0f; } angles[0] = pitch; angles[1] = yaw; - angles[2] = 0; + angles[2] = 0.0f; } float VectorNormalize( float *v ) @@ -89,7 +91,7 @@ float VectorNormalize( float *v ) if( length ) { - ilength = 1 / length; + ilength = 1.0f / length; v[0] *= ilength; v[1] *= ilength; v[2] *= ilength; diff --git a/cl_dll/util_vector.h b/cl_dll/util_vector.h index 477d97be..93166a6b 100644 --- a/cl_dll/util_vector.h +++ b/cl_dll/util_vector.h @@ -20,9 +20,9 @@ #define UTIL_VECTOR_H // Misc C-runtime library headers -#include "stdio.h" -#include "stdlib.h" -#include "math.h" +#include +#include +#include // Header file containing definition of globalvars_t and entvars_t typedef unsigned int func_t; // diff --git a/cl_dll/view.cpp b/cl_dll/view.cpp index daecc3af..9ce6208e 100644 --- a/cl_dll/view.cpp +++ b/cl_dll/view.cpp @@ -40,6 +40,10 @@ extern "C" #define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h #endif +#ifndef M_PI_F +#define M_PI_F (float)M_PI +#endif + extern "C" { int CL_IsThirdPerson( void ); @@ -126,13 +130,13 @@ void V_NormalizeAngles( float *angles ) // Normalize angles for( i = 0; i < 3; i++ ) { - if( angles[i] > 180.0 ) + if( angles[i] > 180.0f ) { - angles[i] -= 360.0; + angles[i] -= 360.0f; } - else if( angles[i] < -180.0 ) + else if( angles[i] < -180.0f ) { - angles[i] += 360.0; + angles[i] += 360.0f; } } } @@ -160,13 +164,13 @@ void V_InterpolateAngles( float *start, float *end, float *output, float frac ) ang2 = end[i]; d = ang2 - ang1; - if( d > 180 ) + if( d > 180.0f ) { - d -= 360; + d -= 360.0f; } - else if( d < -180 ) + else if( d < -180.0f ) { - d += 360; + d += 360.0f; } output[i] = ang1 + d * frac; @@ -199,11 +203,11 @@ float V_CalcBob( struct ref_params_s *pparams ) if( cycle < cl_bobup->value ) { - cycle = M_PI * cycle / cl_bobup->value; + cycle = M_PI_F * cycle / cl_bobup->value; } else { - cycle = M_PI + M_PI * ( cycle - cl_bobup->value )/( 1.0 - cl_bobup->value ); + cycle = M_PI_F + M_PI_F * ( cycle - cl_bobup->value )/( 1.0f - cl_bobup->value ); } // bob is proportional to simulated velocity in the xy plane @@ -212,9 +216,9 @@ float V_CalcBob( struct ref_params_s *pparams ) vel[2] = 0; bob = sqrt( vel[0] * vel[0] + vel[1] * vel[1] ) * cl_bob->value; - bob = bob * 0.3 + bob * 0.7 * sin(cycle); - bob = min( bob, 4 ); - bob = max( bob, -7 ); + bob = bob * 0.3f + bob * 0.7f * sin(cycle); + bob = Q_min( bob, 4.0f ); + bob = Q_max( bob, -7.0f ); return bob; } @@ -234,7 +238,7 @@ float V_CalcRoll( vec3_t angles, vec3_t velocity, float rollangle, float rollspe AngleVectors( angles, forward, right, up ); side = DotProduct( velocity, right ); - sign = side < 0 ? -1 : 1; + sign = side < 0.0f ? -1.0f : 1.0f; side = fabs( side ); value = rollangle; @@ -290,11 +294,11 @@ void V_CalcGunAngle( struct ref_params_s *pparams ) return; viewent->angles[YAW] = pparams->viewangles[YAW] + pparams->crosshairangle[YAW]; - viewent->angles[PITCH] = -pparams->viewangles[PITCH] + pparams->crosshairangle[PITCH] * 0.25; + viewent->angles[PITCH] = -pparams->viewangles[PITCH] + pparams->crosshairangle[PITCH] * 0.25f; viewent->angles[ROLL] -= v_idlescale * sin( pparams->time * v_iroll_cycle.value ) * v_iroll_level.value; // don't apply all of the v_ipitch to prevent normally unseen parts of viewmodel from coming into view. - viewent->angles[PITCH] -= v_idlescale * sin( pparams->time * v_ipitch_cycle.value ) * ( v_ipitch_level.value * 0.5 ); + viewent->angles[PITCH] -= v_idlescale * sin( pparams->time * v_ipitch_cycle.value ) * ( v_ipitch_level.value * 0.5f ); viewent->angles[YAW] -= v_idlescale * sin( pparams->time * v_iyaw_cycle.value ) * v_iyaw_level.value; VectorCopy( viewent->angles, viewent->curstate.angles ); @@ -453,15 +457,15 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) } gEngfuncs.V_CalcShake(); - gEngfuncs.V_ApplyShake( pparams->vieworg, pparams->viewangles, 1.0 ); + gEngfuncs.V_ApplyShake( pparams->vieworg, pparams->viewangles, 1.0f ); // never let view origin sit exactly on a node line, because a water plane can // dissapear when viewed with the eye exactly on it. // FIXME, we send origin at 1/128 now, change this? // the server protocol only specifies to 1/16 pixel, so add 1/32 in each axis - pparams->vieworg[0] += 1.0 / 32; - pparams->vieworg[1] += 1.0 / 32; - pparams->vieworg[2] += 1.0 / 32; + pparams->vieworg[0] += 1.0f / 32.0f; + pparams->vieworg[1] += 1.0f / 32.0f; + pparams->vieworg[2] += 1.0f / 32.0f; // Check for problems around water, move the viewer artificially if necessary // -- this prevents drawing errors in GL due to waves @@ -481,13 +485,13 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) pwater = gEngfuncs.GetEntityByIndex( waterEntity ); if( pwater && ( pwater->model != NULL ) ) { - waterDist += ( pwater->curstate.scale * 16 ); // Add in wave height + waterDist += ( pwater->curstate.scale * 16.0f ); // Add in wave height } } } else { - waterEntity = 0; // Don't need this in software + // waterEntity = 0; // Don't need this in software } VectorCopy( pparams->vieworg, point ); @@ -553,7 +557,7 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) { vec3_t ofs; - ofs[0] = ofs[1] = ofs[2] = 0.0; + ofs[0] = ofs[1] = ofs[2] = 0.0f; CL_CameraOffset( (float *)&ofs ); @@ -586,18 +590,18 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) VectorAdd( view->origin, pparams->viewheight, view->origin ); // Let the viewmodel shake at about 10% of the amplitude - gEngfuncs.V_ApplyShake( view->origin, view->angles, 0.9 ); + gEngfuncs.V_ApplyShake( view->origin, view->angles, 0.9f ); for( i = 0; i < 3; i++ ) { - view->origin[i] += bob * 0.4 * pparams->forward[i]; + view->origin[i] += bob * 0.4f * pparams->forward[i]; } view->origin[2] += bob; // throw in a little tilt. - view->angles[YAW] -= bob * 0.5; - view->angles[ROLL] -= bob * 1; - view->angles[PITCH] -= bob * 0.3; + view->angles[YAW] -= bob * 0.5f; + view->angles[ROLL] -= bob * 1.0f; + view->angles[PITCH] -= bob * 0.3f; if( cl_viewbob && cl_viewbob->value ) VectorCopy( view->angles, view->curstate.angles ); @@ -605,25 +609,25 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) // pushing the view origin down off of the same X/Z plane as the ent's origin will give the // gun a very nice 'shifting' effect when the player looks up/down. If there is a problem // with view model distortion, this may be a cause. (SJB). - view->origin[2] -= 1; + view->origin[2] -= 1.0f; // fudge position around to keep amount of weapon visible // roughly equal with different FOV - if( pparams->viewsize == 110 ) + if( pparams->viewsize == 110.0f ) { - view->origin[2] += 1; + view->origin[2] += 1.0f; } - else if( pparams->viewsize == 100 ) + else if( pparams->viewsize == 100.0f ) { - view->origin[2] += 2; + view->origin[2] += 2.0f; } - else if( pparams->viewsize == 90 ) + else if( pparams->viewsize == 90.0f ) { - view->origin[2] += 1; + view->origin[2] += 1.0f; } - else if( pparams->viewsize == 80 ) + else if( pparams->viewsize == 80.0f ) { - view->origin[2] += 0.5; + view->origin[2] += 0.5f; } // Add in the punchangle, if any @@ -636,7 +640,7 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) // smooth out stair step ups #if 1 - if( !pparams->smoothing && pparams->onground && pparams->simorg[2] - oldz > 0 ) + if( !pparams->smoothing && pparams->onground && pparams->simorg[2] - oldz > 0.0f ) { float steptime; @@ -646,11 +650,11 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) //FIXME I_Error( "steptime < 0" ); steptime = 0; - oldz += steptime * 150; + oldz += steptime * 150.0f; if( oldz > pparams->simorg[2] ) oldz = pparams->simorg[2]; - if( pparams->simorg[2] - oldz > 18 ) - oldz = pparams->simorg[2]- 18; + if( pparams->simorg[2] - oldz > 18.0f ) + oldz = pparams->simorg[2]- 18.0f; pparams->vieworg[2] += oldz - pparams->simorg[2]; view->origin[2] += oldz - pparams->simorg[2]; } @@ -665,7 +669,7 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) VectorSubtract( pparams->simorg, lastorg, delta ); - if( Length( delta ) != 0.0 ) + if( Length( delta ) != 0.0f ) { VectorCopy( pparams->simorg, ViewInterp.Origins[ViewInterp.CurrentOrigin & ORIGIN_MASK] ); ViewInterp.OriginTime[ViewInterp.CurrentOrigin & ORIGIN_MASK] = pparams->time; @@ -682,9 +686,9 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) int foundidx; float t; - if( cl_vsmoothing->value < 0.0 ) + if( cl_vsmoothing->value < 0.0f ) { - gEngfuncs.Cvar_SetValue( "cl_vsmoothing", 0.0 ); + gEngfuncs.Cvar_SetValue( "cl_vsmoothing", 0.0f ); } t = pparams->time - cl_vsmoothing->value; @@ -696,7 +700,7 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) break; } - if( i < ORIGIN_MASK && ViewInterp.OriginTime[foundidx & ORIGIN_MASK] != 0.0 ) + if( i < ORIGIN_MASK && ViewInterp.OriginTime[foundidx & ORIGIN_MASK] != 0.0f ) { // Interpolate vec3_t delta; @@ -708,12 +712,12 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) if( dt > 0.0 ) { frac = ( t - ViewInterp.OriginTime[foundidx & ORIGIN_MASK] ) / dt; - frac = min( 1.0, frac ); + frac = Q_min( 1.0, frac ); VectorSubtract( ViewInterp.Origins[( foundidx + 1 ) & ORIGIN_MASK], ViewInterp.Origins[foundidx & ORIGIN_MASK], delta ); VectorMA( ViewInterp.Origins[foundidx & ORIGIN_MASK], frac, delta, neworg ); // Dont interpolate large changes - if( Length( delta ) < 64 ) + if( Length( delta ) < 64.0f ) { VectorSubtract( neworg, pparams->simorg, delta ); @@ -735,13 +739,13 @@ void V_CalcNormalRefdef( struct ref_params_s *pparams ) float pitch = camAngles[0]; // Normalize angles - if( pitch > 180 ) - pitch -= 360.0; - else if( pitch < -180 ) - pitch += 360; + if( pitch > 180.0f ) + pitch -= 360.0f; + else if( pitch < -180.0f ) + pitch += 360.0f; // Player pitch is inverted - pitch /= -3.0; + pitch /= -3.0f; // Slam local player's pitch value ent->angles[0] = pitch; @@ -796,7 +800,7 @@ void V_SmoothInterpolateAngles( float * startAngle, float * endAngle, float * fi { frac = degreesPerSec * v_frametime; - threshhold= degreesPerSec / 4; + threshhold= degreesPerSec / 4.0f; if( absd < threshhold ) { @@ -811,7 +815,7 @@ void V_SmoothInterpolateAngles( float * startAngle, float * endAngle, float * fi } else { - if( d > 0 ) + if( d > 0.0f ) finalAngle[i] = startAngle[i] + frac; else finalAngle[i] = startAngle[i] - frac; @@ -907,7 +911,7 @@ void V_GetChaseOrigin( float * angles, float * origin, float distance, float * r VectorCopy( ent1->origin, newOrigin ); if( ent1->player ) - newOrigin[2] += 17; // head level of living player + newOrigin[2] += 17.0f; // head level of living player // get new angle towards second target if( ent2 ) @@ -921,7 +925,7 @@ void V_GetChaseOrigin( float * angles, float * origin, float distance, float * r // if no second target is given, look down to dead player newAngle[0] = 90.0f; newAngle[1] = 0.0f; - newAngle[2] = 0; + newAngle[2] = 0.0f; } // and smooth view @@ -962,12 +966,12 @@ void V_GetSingleTargetCam( cl_entity_t * ent1, float * angle, float * origin ) if( ent1->player ) { if( deadPlayer ) - newOrigin[2] += 2; //laying on ground + newOrigin[2] += 2.0f; //laying on ground else - newOrigin[2] += 17; // head level of living player + newOrigin[2] += 17.0f; // head level of living player } else - newOrigin[2]+= 8; // object, tricky, must be above bomb in CS + newOrigin[2]+= 8.0f; // object, tricky, must be above bomb in CS // we have no second target, choose view direction based on // show front of primary target @@ -1005,13 +1009,13 @@ float MaxAngleBetweenAngles( float *a1, float *a2 ) for( int i = 0; i < 3; i++ ) { d = a2[i] - a1[i]; - if( d > 180 ) + if( d > 180.0f ) { - d -= 360; + d -= 360.0f; } - else if( d < -180 ) + else if( d < -180.0f ) { - d += 360; + d += 360.0f; } d = fabs( d ); @@ -1046,9 +1050,9 @@ void V_GetDoubleTargetsCam( cl_entity_t *ent1, cl_entity_t *ent2, float *angle, VectorCopy( ent1->origin, newOrigin ); if( ent1->player ) - newOrigin[2] += 17; // head level of living player + newOrigin[2] += 17.0f; // head level of living player else - newOrigin[2] += 8; // object, tricky, must be above bomb in CS + newOrigin[2] += 8.0f; // object, tricky, must be above bomb in CS // get new angle towards second target VectorSubtract( ent2->origin, ent1->origin, newAngle ); @@ -1151,9 +1155,9 @@ void V_GetDirectedChasePosition(cl_entity_t *ent1, cl_entity_t *ent2,float *angl VectorCopy( ent1->origin, newOrigin ); if( ent1->player ) - newOrigin[2] += 17; // head level of living player + newOrigin[2] += 17.0f; // head level of living player else - newOrigin[2] += 8; // object, tricky, must be above bomb in CS + newOrigin[2] += 8.0f; // object, tricky, must be above bomb in CS V_GetChaseOrigin( angle, newOrigin, distance, origin ); } @@ -1192,14 +1196,14 @@ void V_GetChasePos( int target, float *cl_angles, float *origin, float *angles ) if( cl_angles == NULL ) // no mouse angles given, use entity angles ( locked mode ) { VectorCopy( ent->angles, angles); - angles[0] *= -1; + angles[0] *= -1.0f; } else VectorCopy( cl_angles, angles ); VectorCopy( ent->origin, origin ); - origin[2] += 28; // DEFAULT_VIEWHEIGHT - some offset + origin[2] += 28.0f; // DEFAULT_VIEWHEIGHT - some offset V_GetChaseOrigin( angles, origin, cl_chasedist->value, origin ); } @@ -1234,15 +1238,15 @@ void V_GetInEyePos( int target, float *origin, float *angles ) if( ent->curstate.solid == SOLID_NOT ) { - angles[ROLL] = 80; // dead view angle - origin[2] += -8 ; // PM_DEAD_VIEWHEIGHT + angles[ROLL] = 80.0f; // dead view angle + origin[2] += -8.0f; // PM_DEAD_VIEWHEIGHT } else if( ent->curstate.usehull == 1 ) - origin[2] += 12; // VEC_DUCK_VIEW; + origin[2] += 12.0f; // VEC_DUCK_VIEW; else // exacty eye position can't be caluculated since it depends on // client values like cl_bobcycle, this offset matches the default values - origin[2] += 28; // DEFAULT_VIEWHEIGHT + origin[2] += 28.0f; // DEFAULT_VIEWHEIGHT } void V_GetMapFreePosition( float *cl_angles, float *origin, float *angles ) @@ -1306,7 +1310,7 @@ void V_GetMapChasePosition( int target, float *cl_angles, float *origin, float * VectorNormalize( forward ); - VectorMA( origin, -1536, forward, origin ); + VectorMA( origin, -1536.0f, forward, origin ); } int V_FindViewModelByWeaponModel( int weaponindex ) @@ -1565,8 +1569,8 @@ void V_DropPunchAngle( float frametime, float *ev_punchangle ) float len; len = VectorNormalize( ev_punchangle ); - len -= ( 10.0 + len * 0.5 ) * frametime; - len = max( len, 0.0 ); + len -= ( 10.0f + len * 0.5f ) * (float)frametime; + len = Q_max( len, 0.0f ); VectorScale( ev_punchangle, len, ev_punchangle ); } @@ -1617,14 +1621,14 @@ float CalcFov( float fov_x, float width, float height ) float a; float x; - if( fov_x < 1 || fov_x > 179 ) - fov_x = 90; // error, set to 90 + if( fov_x < 1.0f || fov_x > 179.0f ) + fov_x = 90.0f; // error, set to 90 - x = width / tan( fov_x / 360 * M_PI ); + x = width / tan( fov_x / 360.0f * M_PI_F ); a = atan ( height / x ); - a = a * 360 / M_PI; + a = a * 360.0f / M_PI_F; return a; } @@ -1646,8 +1650,8 @@ void V_Move( int mx, int my ) fov = CalcFov( in_fov, (float)ScreenWidth, (float)ScreenHeight ); - c_x = (float)ScreenWidth / 2.0; - c_y = (float)ScreenHeight / 2.0; + c_x = (float)ScreenWidth / 2.0f; + c_y = (float)ScreenHeight / 2.0f; dx = (float)mx - c_x; dy = (float)my - c_y; @@ -1656,8 +1660,8 @@ void V_Move( int mx, int my ) fx = dx / c_x; fy = dy / c_y; - dX = fx * in_fov / 2.0 ; - dY = fy * fov / 2.0; + dX = fx * in_fov / 2.0f; + dY = fy * fov / 2.0f; newangles = v_angles; @@ -1672,10 +1676,10 @@ void V_Move( int mx, int my ) // Trace tr = *( gEngfuncs.PM_TraceLine( (float *)&v_origin, (float *)&farpoint, PM_TRACELINE_PHYSENTSONLY, 2 /*point sized hull*/, -1 ) ); - if( tr.fraction != 1.0 && tr.ent != 0 ) + if( tr.fraction != 1.0f && tr.ent != 0 ) { hitent = PM_GetPhysEntInfo( tr.ent ); - PM_ParticleLine( (float *)&v_origin, (float *)&tr.endpos, 5, 1.0, 0.0 ); + PM_ParticleLine( (float *)&v_origin, (float *)&tr.endpos, 5, 1.0f, 0.0f ); } else { diff --git a/cl_dll/wscript b/cl_dll/wscript index d0bd0951..b45242d5 100644 --- a/cl_dll/wscript +++ b/cl_dll/wscript @@ -4,15 +4,17 @@ from waflib import Utils import os - + def options(opt): # stub return def configure(conf): - if conf.env.GOLDSRC: - if conf.env.DEST_OS != 'win32': - conf.check_cc(lib='dl') + if conf.env.GOLDSRC and conf.env.DEST_OS != 'win32': + conf.check_cc(lib='dl') + + if conf.env.DEST_OS == 'win32': + conf.check_cxx( lib='user32' ) def build(bld): source = bld.path.parent.ant_glob([ @@ -45,22 +47,25 @@ def build(bld): defines += ['GOLDSOURCE_SUPPORT'] libs = [] - if bld.env.GOLDSRC: + if bld.env.GOLDSRC and bld.env.DEST_OS != 'win32': libs += ['DL'] - if bld.env.DEST_OS2 not in ['android']: + if bld.env.DEST_OS == 'win32': + libs += ["USER32"] + + if bld.env.DEST_OS not in ['android']: install_path = os.path.join(bld.env.GAMEDIR, bld.env.CLIENT_DIR) else: install_path = bld.env.PREFIX bld.shlib( source = source, - target = 'client', + target = 'client' + bld.env.POSTFIX, features = 'c cxx', includes = includes, defines = defines, use = libs, install_path = install_path, subsystem = bld.env.MSVC_SUBSYSTEM, - idx = 1 + idx = bld.get_taskgen_count() ) diff --git a/cmake/LibraryNaming.cmake b/cmake/LibraryNaming.cmake new file mode 100644 index 00000000..22581078 --- /dev/null +++ b/cmake/LibraryNaming.cmake @@ -0,0 +1,107 @@ +include(CheckSymbolExists) + +# generated(see comments in public/build.h) +set(CMAKE_REQUIRED_INCLUDES "${CMAKE_SOURCE_DIR}/public/") +check_symbol_exists(XASH_64BIT "build.h" XASH_64BIT) +check_symbol_exists(XASH_AMD64 "build.h" XASH_AMD64) +check_symbol_exists(XASH_ANDROID "build.h" XASH_ANDROID) +check_symbol_exists(XASH_APPLE "build.h" XASH_APPLE) +check_symbol_exists(XASH_ARM "build.h" XASH_ARM) +check_symbol_exists(XASH_ARM64 "build.h" XASH_ARM64) +check_symbol_exists(XASH_ARM_HARDFP "build.h" XASH_ARM_HARDFP) +check_symbol_exists(XASH_ARM_SOFTFP "build.h" XASH_ARM_SOFTFP) +check_symbol_exists(XASH_ARMv4 "build.h" XASH_ARMv4) +check_symbol_exists(XASH_ARMv5 "build.h" XASH_ARMv5) +check_symbol_exists(XASH_ARMv6 "build.h" XASH_ARMv6) +check_symbol_exists(XASH_ARMv7 "build.h" XASH_ARMv7) +check_symbol_exists(XASH_BIG_ENDIAN "build.h" XASH_BIG_ENDIAN) +check_symbol_exists(XASH_BSD "build.h" XASH_BSD) +check_symbol_exists(XASH_E2K "build.h" XASH_E2K) +check_symbol_exists(XASH_EMSCRIPTEN "build.h" XASH_EMSCRIPTEN) +check_symbol_exists(XASH_FREEBSD "build.h" XASH_FREEBSD) +check_symbol_exists(XASH_IOS "build.h" XASH_IOS) +check_symbol_exists(XASH_JS "build.h" XASH_JS) +check_symbol_exists(XASH_LINUX "build.h" XASH_LINUX) +check_symbol_exists(XASH_LITTLE_ENDIAN "build.h" XASH_LITTLE_ENDIAN) +check_symbol_exists(XASH_MINGW "build.h" XASH_MINGW) +check_symbol_exists(XASH_MIPS "build.h" XASH_MIPS) +check_symbol_exists(XASH_MOBILE_PLATFORM "build.h" XASH_MOBILE_PLATFORM) +check_symbol_exists(XASH_MSVC "build.h" XASH_MSVC) +check_symbol_exists(XASH_NETBSD "build.h" XASH_NETBSD) +check_symbol_exists(XASH_OPENBSD "build.h" XASH_OPENBSD) +check_symbol_exists(XASH_WIN32 "build.h" XASH_WIN32) +check_symbol_exists(XASH_WIN64 "build.h" XASH_WIN64) +check_symbol_exists(XASH_X86 "build.h" XASH_X86) +unset(CMAKE_REQUIRED_INCLUDES) + +# engine/common/build.c +if(XASH_ANDROID) + set(BUILDOS "android") +elseif(XASH_WIN32 OR XASH_LINUX OR XASH_APPLE) + set(BUILDOS "") # no prefix for default OS +elseif(XASH_FREEBSD) + set(BUILDOS "freebsd") +elseif(XASH_NETBSD) + set(BUILDOS "netbsd") +elseif(XASH_OPENBSD) + set(BUILDOS "openbsd") +elseif(XASH_EMSCRIPTEN) + set(BUILDOS "emscripten") +else() + message(SEND_ERROR "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug") +endif() + +if(XASH_AMD64) + set(BUILDARCH "amd64") +elseif(XASH_X86) + set(BUILDARCH "") +elseif(XASH_ARM64) + set(BUILDARCH "arm64") +elseif(XASH_ARM) + set(BUILDARCH "armv") + if(XASH_ARMv7) + set(BUILDARCH "${BUILDARCH}7") + elseif(XASH_ARMv6) + set(BUILDARCH "${BUILDARCH}6") + elseif(XASH_ARMv5) + set(BUILDARCH "${BUILDARCH}5") + elseif(XASH_ARMv4) + set(BUILDARCH "${BUILDARCH}4") + else() + message(SEND_ERROR "Unknown ARM") + endif() + + if(XASH_ARM_HARDFP) + set(BUILDARCH "${BUILDARCH}hf") + else() + set(BUILDARCH "${BUILDARCH}l") + endif() +elseif(XASH_MIPS AND XASH_BIG_ENDIAN) + set(BUILDARCH "mips") +elseif(XASH_MIPS AND XASH_LITTLE_ENDIAN) + set(BUILDARCH "mipsel") +elseif(XASH_JS) + set(BUILDARCH "javascript") +elseif(XASH_E2K) + set(BUILDARCH "e2k") +else() + message(SEND_ERROR "Place your architecture name here! If this is a mistake, try to fix conditions above and report a bug") +endif() + +if(BUILDOS STREQUAL "android") + set(POSTFIX "") # force disable for Android, as Android ports aren't distributed in normal way and doesn't follow library naming +elif(BUILDOS AND BUILDARCH) + set(POSTFIX "_${BUILDOS}_${BUILDARCH}") +elseif(BUILDARCH) + set(POSTFIX "_${BUILDARCH}") +else() + set(POSTFIX "") +endif() + +message(STATUS "Library postfix: " ${POSTFIX}) + +set(CMAKE_RELEASE_POSTFIX ${POSTFIX}) +set(CMAKE_DEBUG_POSTFIX ${POSTFIX}) +set(CMAKE_RELWITHDEBINFO_POSTFIX ${POSTFIX}) +set(CMAKE_MINSIZEREL_POSTFIX ${POSTFIX}) +set(CMAKE_POSTFIX ${POSTFIX}) diff --git a/common/com_model.h b/common/com_model.h index abc8e8e6..631373fc 100644 --- a/common/com_model.h +++ b/common/com_model.h @@ -173,7 +173,7 @@ typedef struct mleaf_s } mleaf_t; -typedef struct msurface_s +struct msurface_s { int visframe; // should be drawn when node is crossed @@ -205,7 +205,7 @@ typedef struct msurface_s color24 *samples; // note: this is the actual lightmap data for this surface decal_t *pdecals; -} msurface_t; +}; typedef struct msurfmesh_s { diff --git a/common/mathlib.h b/common/mathlib.h index 6bcf76eb..afe44352 100644 --- a/common/mathlib.h +++ b/common/mathlib.h @@ -16,22 +16,31 @@ #pragma once #ifndef MATHLIB_H #define MATHLIB_H +#ifndef __cplusplus #include +#ifdef HAVE_TGMATH_H +#include +#endif // HAVE_TGMATH_H +#else // __cplusplus +#include +#endif // __cplusplus typedef float vec_t; -typedef vec_t vec2_t[2]; -#ifndef DID_VEC3_T_DEFINE +#if !defined DID_VEC3_T_DEFINE #define DID_VEC3_T_DEFINE typedef vec_t vec3_t[3]; #endif -typedef vec_t vec4_t[4]; // x,y,z,w #ifndef M_PI #define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h #endif +#ifndef M_PI_F +#define M_PI_F (float)M_PI +#endif + struct mplane_s; extern vec3_t vec3_origin; diff --git a/dlls/CMakeLists.txt b/dlls/CMakeLists.txt index ccaa0279..67a34e11 100644 --- a/dlls/CMakeLists.txt +++ b/dlls/CMakeLists.txt @@ -25,6 +25,12 @@ project (SVDLL) set (SVDLL_LIBRARY server) +include(CheckIncludeFile) +check_include_file("tgmath.h" HAVE_TGMATH_H) +if(HAVE_TGMATH_H) + add_definitions(-DHAVE_TGMATH_H) +endif() + add_definitions(-DCLIENT_WEAPONS) if(NOT MSVC) @@ -159,9 +165,6 @@ set_target_properties (${SVDLL_LIBRARY} PROPERTIES if(APPLE OR WIN32 OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux") set(SVDLL_NAME "${SERVER_LIBRARY_NAME}") - if(64BIT) - set(SVDLL_NAME "${SERVER_LIBRARY_NAME}64") - endif() set_target_properties(${SVDLL_LIBRARY} PROPERTIES OUTPUT_NAME ${SVDLL_NAME} diff --git a/dlls/Makefile b/dlls/Makefile deleted file mode 100644 index 3599b9c7..00000000 --- a/dlls/Makefile +++ /dev/null @@ -1,190 +0,0 @@ -# -# Half-Life Full SDK 2.3 hl_i386.so Makefile for x86 Linux -# -# October 2002 by Leon Hartwig (hartwig@valvesoftware.com) -# - -DLLNAME=hl - -ARCH=i386 - -#make sure this is the correct compiler for your system -CC?=gcc -CXX?=g++ - -DLL_SRCDIR=. -ENGINE_SRCDIR=../engine -COMMON_SRCDIR=../common -WPN_SHARED_SRCDIR=./wpn_shared -PM_SHARED_SRCDIR=../pm_shared -GAME_SHARED_SRCDIR=../game_shared - -DLL_OBJDIR=$(DLL_SRCDIR)/obj -WPN_SHARED_OBJDIR=$(WPN_SHARED_SRCDIR)/obj -PM_SHARED_OBJDIR=$(PM_SHARED_SRCDIR)/obj -GAME_SHARED_OBJDIR=$(GAME_SHARED_SRCDIR)/obj - -BASE_CFLAGS= -Dstricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp \ - -DCLIENT_WEAPONS -DNO_VOICEGAMEMGR - -#safe optimization -CFLAGS=$(BASE_CFLAGS) -m32 -w -O1 - -#full optimization -#CFLAGS=$(BASE_CFLAGS) -w -O1 -m486 -ffast-math -funroll-loops \ - -fomit-frame-pointer -fexpensive-optimizations \ - -malign-loops=2 -malign-jumps=2 -malign-functions=2 - -#use these when debugging -#CFLAGS=$(BASE_CFLAGS) -g - -INCLUDEDIRS=-I. -I$(ENGINE_SRCDIR) -I$(COMMON_SRCDIR) -I$(PM_SHARED_SRCDIR) -I$(GAME_SHARED_SRCDIR) - -LDFLAGS= - -SHLIBEXT=so -SHLIBCFLAGS=-fPIC -SHLIBLDFLAGS=-shared - -DO_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) $(INCLUDEDIRS) -o $@ -c $< -DO_CXX=$(CXX) $(CFLAGS) $(SHLIBCFLAGS) $(INCLUDEDIRS) -o $@ -c $< - -############################################################################# -# SETUP AND BUILD -# GAME -############################################################################# - -$(DLL_OBJDIR)/%.o: $(DLL_SRCDIR)/%.cpp - $(DO_CXX) - -$(WPN_SHARED_OBJDIR)/%.o: $(WPN_SHARED_SRCDIR)/%.cpp - $(DO_CXX) - -$(GAME_SHARED_OBJDIR)/%.o: $(GAME_SHARED_SRCDIR)/%.cpp - $(DO_CXX) - -$(PM_SHARED_OBJDIR)/%.o: $(PM_SHARED_SRCDIR)/%.c - $(DO_CC) - -OBJ = \ - $(DLL_OBJDIR)/aflock.o \ - $(DLL_OBJDIR)/agrunt.o \ - $(DLL_OBJDIR)/airtank.o \ - $(DLL_OBJDIR)/animating.o \ - $(DLL_OBJDIR)/animation.o \ - $(DLL_OBJDIR)/apache.o \ - $(DLL_OBJDIR)/barnacle.o \ - $(DLL_OBJDIR)/barney.o \ - $(DLL_OBJDIR)/bigmomma.o \ - $(DLL_OBJDIR)/bloater.o \ - $(DLL_OBJDIR)/bmodels.o \ - $(DLL_OBJDIR)/bullsquid.o \ - $(DLL_OBJDIR)/buttons.o \ - $(DLL_OBJDIR)/cbase.o \ - $(DLL_OBJDIR)/client.o \ - $(DLL_OBJDIR)/combat.o \ - $(DLL_OBJDIR)/controller.o \ - $(DLL_OBJDIR)/crossbow.o \ - $(DLL_OBJDIR)/crowbar.o \ - $(DLL_OBJDIR)/defaultai.o \ - $(DLL_OBJDIR)/doors.o \ - $(DLL_OBJDIR)/effects.o \ - $(DLL_OBJDIR)/egon.o \ - $(DLL_OBJDIR)/explode.o \ - $(DLL_OBJDIR)/flyingmonster.o \ - $(DLL_OBJDIR)/func_break.o \ - $(DLL_OBJDIR)/func_tank.o \ - $(DLL_OBJDIR)/game.o \ - $(DLL_OBJDIR)/gamerules.o \ - $(DLL_OBJDIR)/gargantua.o \ - $(DLL_OBJDIR)/gauss.o \ - $(DLL_OBJDIR)/genericmonster.o \ - $(DLL_OBJDIR)/ggrenade.o \ - $(DLL_OBJDIR)/globals.o \ - $(DLL_OBJDIR)/gman.o \ - $(DLL_OBJDIR)/h_ai.o \ - $(DLL_OBJDIR)/h_battery.o \ - $(DLL_OBJDIR)/h_cine.o \ - $(DLL_OBJDIR)/h_cycler.o \ - $(DLL_OBJDIR)/h_export.o \ - $(DLL_OBJDIR)/handgrenade.o \ - $(DLL_OBJDIR)/hassassin.o \ - $(DLL_OBJDIR)/headcrab.o \ - $(DLL_OBJDIR)/healthkit.o \ - $(DLL_OBJDIR)/hgrunt.o \ - $(DLL_OBJDIR)/hornet.o \ - $(DLL_OBJDIR)/hornetgun.o \ - $(DLL_OBJDIR)/houndeye.o \ - $(DLL_OBJDIR)/ichthyosaur.o \ - $(DLL_OBJDIR)/islave.o \ - $(DLL_OBJDIR)/items.o \ - $(DLL_OBJDIR)/leech.o \ - $(DLL_OBJDIR)/lights.o \ - $(DLL_OBJDIR)/maprules.o \ - $(DLL_OBJDIR)/monstermaker.o \ - $(DLL_OBJDIR)/monsters.o \ - $(DLL_OBJDIR)/monsterstate.o \ - $(DLL_OBJDIR)/mortar.o \ - $(DLL_OBJDIR)/mp5.o \ - $(DLL_OBJDIR)/multiplay_gamerules.o \ - $(DLL_OBJDIR)/nihilanth.o \ - $(DLL_OBJDIR)/nodes.o \ - $(DLL_OBJDIR)/observer.o \ - $(DLL_OBJDIR)/osprey.o \ - $(DLL_OBJDIR)/pathcorner.o \ - $(DLL_OBJDIR)/plane.o \ - $(DLL_OBJDIR)/plats.o \ - $(DLL_OBJDIR)/player.o \ - $(DLL_OBJDIR)/playermonster.o \ - $(DLL_OBJDIR)/python.o \ - $(DLL_OBJDIR)/rat.o \ - $(DLL_OBJDIR)/roach.o \ - $(DLL_OBJDIR)/rpg.o \ - $(DLL_OBJDIR)/satchel.o \ - $(DLL_OBJDIR)/schedule.o \ - $(DLL_OBJDIR)/scientist.o \ - $(DLL_OBJDIR)/scripted.o \ - $(DLL_OBJDIR)/shotgun.o \ - $(DLL_OBJDIR)/singleplay_gamerules.o \ - $(DLL_OBJDIR)/skill.o \ - $(DLL_OBJDIR)/sound.o \ - $(DLL_OBJDIR)/soundent.o \ - $(DLL_OBJDIR)/spectator.o \ - $(DLL_OBJDIR)/squadmonster.o \ - $(DLL_OBJDIR)/squeakgrenade.o \ - $(DLL_OBJDIR)/subs.o \ - $(DLL_OBJDIR)/talkmonster.o \ - $(DLL_OBJDIR)/teamplay_gamerules.o \ - $(DLL_OBJDIR)/tempmonster.o \ - $(DLL_OBJDIR)/tentacle.o \ - $(DLL_OBJDIR)/triggers.o \ - $(DLL_OBJDIR)/tripmine.o \ - $(DLL_OBJDIR)/turret.o \ - $(DLL_OBJDIR)/util.o \ - $(DLL_OBJDIR)/weapons.o \ - $(DLL_OBJDIR)/world.o \ - $(DLL_OBJDIR)/xen.o \ - $(DLL_OBJDIR)/zombie.o \ - $(DLL_OBJDIR)/glock.o \ - $(PM_SHARED_OBJDIR)/pm_debug.o \ - $(PM_SHARED_OBJDIR)/pm_math.o \ - $(PM_SHARED_OBJDIR)/pm_shared.o -# $(GAME_SHARED_OBJDIR)/voice_gamemgr.o - -$(DLLNAME)_$(ARCH).$(SHLIBEXT) : neat $(OBJ) - $(CXX) $(CFLAGS) $(SHLIBLDFLAGS) $(LDFLAGS) -o $@ $(OBJ) - -neat: - -mkdir $(DLL_OBJDIR) - -mkdir $(WPN_SHARED_OBJDIR) - -mkdir $(GAME_SHARED_OBJDIR) - -mkdir $(PM_SHARED_OBJDIR) -clean: - -rm -f $(OBJ) - -rm -f $(DLLNAME)_$(ARCH).$(SHLIBEXT) -spotless: clean - -rm -r $(DLL_OBJDIR) - -rm -r $(WPN_SHARED_OBJDIR) - -rm -r $(GAME_SHARED_OBJDIR) - -rm -r $(PM_SHARED_OBJDIR) - diff --git a/dlls/aflock.cpp b/dlls/aflock.cpp index d50a8165..f69a99a9 100644 --- a/dlls/aflock.cpp +++ b/dlls/aflock.cpp @@ -22,7 +22,7 @@ #include "squadmonster.h" #define AFLOCK_MAX_RECRUIT_RADIUS 1024 -#define AFLOCK_FLY_SPEED 125 +#define AFLOCK_FLY_SPEED 125.0f #define AFLOCK_TURN_RATE 75 #define AFLOCK_ACCELERATE 10 #define AFLOCK_CHECK_DIST 192 @@ -200,7 +200,7 @@ void CFlockingFlyerFlock::SpawnFlock( void ) vecSpot.x = RANDOM_FLOAT( -R, R ); vecSpot.y = RANDOM_FLOAT( -R, R ); - vecSpot.z = RANDOM_FLOAT( 0, 16 ); + vecSpot.z = RANDOM_FLOAT( 0.0f, 16.0f ); vecSpot = pev->origin + vecSpot; UTIL_SetOrigin( pBoid->pev, vecSpot ); @@ -211,7 +211,7 @@ void CFlockingFlyerFlock::SpawnFlock( void ) pBoid->pev->angles = pev->angles; pBoid->pev->frame = 0; - pBoid->pev->nextthink = gpGlobals->time + 0.2; + pBoid->pev->nextthink = gpGlobals->time + 0.2f; pBoid->SetThink( &CFlockingFlyer::IdleThink ); if( pBoid != pLeader ) @@ -229,7 +229,7 @@ void CFlockingFlyer::Spawn() SpawnCommonCode(); pev->frame = 0; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; SetThink( &CFlockingFlyer::IdleThink ); } @@ -284,7 +284,7 @@ void CFlockingFlyer::Killed( entvars_t *pevAttacker, int iGib ) while( pSquad ) { - pSquad->m_flAlertTime = gpGlobals->time + 15; + pSquad->m_flAlertTime = gpGlobals->time + 15.0f; pSquad = (CFlockingFlyer *)pSquad->m_pSquadNext; } @@ -302,7 +302,7 @@ void CFlockingFlyer::Killed( entvars_t *pevAttacker, int iGib ) pev->movetype = MOVETYPE_TOSS; SetThink( &CFlockingFlyer::FallHack ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } void CFlockingFlyer::FallHack( void ) @@ -312,7 +312,7 @@ void CFlockingFlyer::FallHack( void ) if( !FClassnameIs ( pev->groundentity, "worldspawn" ) ) { pev->flags &= ~FL_ONGROUND; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } else { @@ -334,13 +334,13 @@ void CFlockingFlyer::SpawnCommonCode() pev->health = 1; m_fPathBlocked = FALSE;// obstacles will be detected - m_flFieldOfView = 0.2; + m_flFieldOfView = 0.2f; //SET_MODEL( ENT( pev ), "models/aflock.mdl" ); SET_MODEL( ENT( pev ), "models/boid.mdl" ); - //UTIL_SetSize( pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) ); - UTIL_SetSize( pev, Vector( -5, -5, 0 ), Vector( 5, 5, 2 ) ); + //UTIL_SetSize( pev, Vector( 0.0f, 0.0f, 0.0f ), Vector( 0.0f, 0.0f, 0.0f ) ); + UTIL_SetSize( pev, Vector( -5.0f, -5.0f, 0.0f ), Vector( 5.0f, 5.0f, 2.0f ) ); } //========================================================= @@ -348,38 +348,38 @@ void CFlockingFlyer::SpawnCommonCode() void CFlockingFlyer::BoidAdvanceFrame() { float flapspeed = ( pev->speed - pev->armorvalue ) / AFLOCK_ACCELERATE; - pev->armorvalue = pev->armorvalue * .8 + pev->speed * .2; + pev->armorvalue = pev->armorvalue * 0.8f + pev->speed * 0.2f; - if( flapspeed < 0 ) + if( flapspeed < 0.0f ) flapspeed = -flapspeed; - if( flapspeed < 0.25 ) - flapspeed = 0.25; - if( flapspeed > 1.9 ) - flapspeed = 1.9; + if( flapspeed < 0.25f ) + flapspeed = 0.25f; + if( flapspeed > 1.9f ) + flapspeed = 1.9f; pev->framerate = flapspeed; // lean - pev->avelocity.x = -( pev->angles.x + flapspeed * 5 ); + pev->avelocity.x = -( pev->angles.x + flapspeed * 5.0f ); // bank pev->avelocity.z = -( pev->angles.z + pev->avelocity.y ); // pev->framerate = flapspeed; - StudioFrameAdvance( 0.1 ); + StudioFrameAdvance( 0.1f ); } //========================================================= //========================================================= void CFlockingFlyer::IdleThink( void ) { - pev->nextthink = gpGlobals->time + 0.2; + pev->nextthink = gpGlobals->time + 0.2f; // see if there's a client in the same pvs as the monster if( !FNullEnt( FIND_CLIENT_IN_PVS( edict() ) ) ) { SetThink( &CFlockingFlyer::Start ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } } @@ -388,7 +388,7 @@ void CFlockingFlyer::IdleThink( void ) //========================================================= void CFlockingFlyer::Start( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( IsLeader() ) { @@ -473,7 +473,7 @@ void CFlockingFlyer::SpreadFlock() // can average in a course that points away from the leader. flSpeed = pList->pev->velocity.Length(); pList->pev->velocity = pList->pev->velocity.Normalize(); - pList->pev->velocity = ( pList->pev->velocity + vecDir ) * 0.5; + pList->pev->velocity = ( pList->pev->velocity + vecDir ) * 0.5f; pList->pev->velocity = pList->pev->velocity * flSpeed; } @@ -529,28 +529,28 @@ BOOL CFlockingFlyer::FPathBlocked() // check for obstacle ahead UTIL_TraceLine( pev->origin, pev->origin + gpGlobals->v_forward * AFLOCK_CHECK_DIST, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { m_flLastBlockedTime = gpGlobals->time; fBlocked = TRUE; } // extra wide checks - UTIL_TraceLine( pev->origin + gpGlobals->v_right * 12, pev->origin + gpGlobals->v_right * 12 + gpGlobals->v_forward * AFLOCK_CHECK_DIST, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction != 1.0 ) + UTIL_TraceLine( pev->origin + gpGlobals->v_right * 12.0f, pev->origin + gpGlobals->v_right * 12.0f + gpGlobals->v_forward * AFLOCK_CHECK_DIST, ignore_monsters, ENT( pev ), &tr ); + if( tr.flFraction != 1.0f ) { m_flLastBlockedTime = gpGlobals->time; fBlocked = TRUE; } - UTIL_TraceLine( pev->origin - gpGlobals->v_right * 12, pev->origin - gpGlobals->v_right * 12 + gpGlobals->v_forward * AFLOCK_CHECK_DIST, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction != 1.0 ) + UTIL_TraceLine( pev->origin - gpGlobals->v_right * 12.0f, pev->origin - gpGlobals->v_right * 12.0f + gpGlobals->v_forward * AFLOCK_CHECK_DIST, ignore_monsters, ENT( pev ), &tr ); + if( tr.flFraction != 1.0f ) { m_flLastBlockedTime = gpGlobals->time; fBlocked = TRUE; } - if( !fBlocked && gpGlobals->time - m_flLastBlockedTime > 6 ) + if( !fBlocked && gpGlobals->time - m_flLastBlockedTime > 6.0f ) { // not blocked, and it's been a few seconds since we've actually been blocked. m_flFakeBlockedTime = gpGlobals->time + RANDOM_LONG( 1, 3 ); @@ -570,7 +570,7 @@ void CFlockingFlyer::FlockLeaderThink( void ) float flLeftSide; float flRightSide; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; UTIL_MakeVectors( pev->angles ); @@ -587,7 +587,7 @@ void CFlockingFlyer::FlockLeaderThink( void ) m_fPathBlocked = FALSE; if( pev->speed <= AFLOCK_FLY_SPEED ) - pev->speed += 5; + pev->speed += 5.0f; pev->velocity = gpGlobals->v_forward * pev->speed; @@ -643,8 +643,8 @@ void CFlockingFlyer::FlockLeaderThink( void ) // check and make sure we aren't about to plow into the ground, don't let it happen UTIL_TraceLine( pev->origin, pev->origin - gpGlobals->v_up * 16, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction != 1.0 && pev->velocity.z < 0 ) - pev->velocity.z = 0; + if( tr.flFraction != 1.0f && pev->velocity.z < 0.0f ) + pev->velocity.z = 0.0f; // maybe it did, though. if( FBitSet( pev->flags, FL_ONGROUND ) ) @@ -675,7 +675,7 @@ void CFlockingFlyer::FlockFollowerThink( void ) Vector vecDirToLeader; float flDistToLeader; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( IsLeader() || !InSquad() ) { @@ -698,19 +698,19 @@ void CFlockingFlyer::FlockFollowerThink( void ) // if we're too far away, speed up if( flDistToLeader > AFLOCK_TOO_FAR ) { - m_flGoalSpeed = m_pSquadLeader->pev->velocity.Length() * 1.5; + m_flGoalSpeed = m_pSquadLeader->pev->velocity.Length() * 1.5f; } // if we're too close, slow down else if( flDistToLeader < AFLOCK_TOO_CLOSE ) { - m_flGoalSpeed = m_pSquadLeader->pev->velocity.Length() * 0.5; + m_flGoalSpeed = m_pSquadLeader->pev->velocity.Length() * 0.5f; } } else { // wait up! the leader isn't out in front, so we slow down to let him pass - m_flGoalSpeed = m_pSquadLeader->pev->velocity.Length() * 0.5; + m_flGoalSpeed = m_pSquadLeader->pev->velocity.Length() * 0.5f; } SpreadFlock2(); @@ -722,13 +722,13 @@ void CFlockingFlyer::FlockFollowerThink( void ) if( flDistToLeader > AFLOCK_TOO_FAR ) { vecDirToLeader = vecDirToLeader.Normalize(); - pev->velocity = (pev->velocity + vecDirToLeader) * 0.5; + pev->velocity = (pev->velocity + vecDirToLeader) * 0.5f; } // clamp speeds and handle acceleration - if( m_flGoalSpeed > AFLOCK_FLY_SPEED * 2 ) + if( m_flGoalSpeed > AFLOCK_FLY_SPEED * 2.0f ) { - m_flGoalSpeed = AFLOCK_FLY_SPEED * 2; + m_flGoalSpeed = AFLOCK_FLY_SPEED * 2.0f; } if( pev->speed < m_flGoalSpeed ) @@ -783,7 +783,7 @@ void CFlockingFlyer::FlockFollowerThink( void ) // else slide left else { - m_vecAdjustedVelocity = gpGlobals->v_right * -1; + m_vecAdjustedVelocity = gpGlobals->v_right * -1.0f; } } return; diff --git a/dlls/agrunt.cpp b/dlls/agrunt.cpp index cb47ac65..28374a6b 100644 --- a/dlls/agrunt.cpp +++ b/dlls/agrunt.cpp @@ -64,7 +64,7 @@ int iAgruntMuzzleFlash; #define AGRUNT_AE_LEFT_PUNCH ( 12 ) #define AGRUNT_AE_RIGHT_PUNCH ( 13 ) -#define AGRUNT_MELEE_DIST 100 +#define AGRUNT_MELEE_DIST 100.0f class CAGrunt : public CSquadMonster { @@ -77,8 +77,8 @@ public: void HandleAnimEvent( MonsterEvent_t *pEvent ); void SetObjectCollisionBox( void ) { - pev->absmin = pev->origin + Vector( -32, -32, 0 ); - pev->absmax = pev->origin + Vector( 32, 32, 85 ); + pev->absmin = pev->origin + Vector( -32.0f, -32.0f, 0.0f ); + pev->absmax = pev->origin + Vector( 32.0f, 32.0f, 85.0f ); } Schedule_t *GetSchedule( void ); @@ -219,7 +219,7 @@ void CAGrunt::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir // hit armor if( pev->dmgtime != gpGlobals->time || ( RANDOM_LONG( 0, 10 ) < 1 ) ) { - UTIL_Ricochet( ptr->vecEndPos, RANDOM_FLOAT( 1, 2 ) ); + UTIL_Ricochet( ptr->vecEndPos, RANDOM_FLOAT( 1.0f, 2.0f ) ); pev->dmgtime = gpGlobals->time; } @@ -227,11 +227,11 @@ void CAGrunt::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir { Vector vecTracerDir = vecDir; - vecTracerDir.x += RANDOM_FLOAT( -0.3, 0.3 ); - vecTracerDir.y += RANDOM_FLOAT( -0.3, 0.3 ); - vecTracerDir.z += RANDOM_FLOAT( -0.3, 0.3 ); + vecTracerDir.x += RANDOM_FLOAT( -0.3f, 0.3f ); + vecTracerDir.y += RANDOM_FLOAT( -0.3f, 0.3f ); + vecTracerDir.z += RANDOM_FLOAT( -0.3f, 0.3f ); - vecTracerDir = vecTracerDir * -512; + vecTracerDir = vecTracerDir * -512.0f; MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, ptr->vecEndPos ); WRITE_BYTE( TE_TRACER ); @@ -245,9 +245,9 @@ void CAGrunt::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir MESSAGE_END(); } - flDamage -= 20; - if( flDamage <= 0 ) - flDamage = 0.1;// don't hurt the monster much, but allow bits_COND_LIGHT_DAMAGE to be generated + flDamage -= 20.0f; + if( flDamage <= 0.0f ) + flDamage = 0.1f;// don't hurt the monster much, but allow bits_COND_LIGHT_DAMAGE to be generated } else { @@ -263,7 +263,7 @@ void CAGrunt::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir //========================================================= void CAGrunt::StopTalking( void ) { - m_flNextWordTime = m_flNextSpeakTime = gpGlobals->time + 10 + RANDOM_LONG( 0, 10 ); + m_flNextWordTime = m_flNextSpeakTime = gpGlobals->time + 10.0f + RANDOM_LONG( 0, 10 ); } //========================================================= @@ -285,7 +285,7 @@ BOOL CAGrunt::ShouldSpeak( void ) // if not going to talk because of this, put the talk time // into the future a bit, so we don't talk immediately after // going into combat - m_flNextSpeakTime = gpGlobals->time + 3; + m_flNextSpeakTime = gpGlobals->time + 3.0f; return FALSE; } } @@ -312,7 +312,7 @@ void CAGrunt::PrescheduleThink( void ) m_iLastWord = num; // play a new sound - EMIT_SOUND( ENT( pev ), CHAN_VOICE, pIdleSounds[num], 1.0, ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_VOICE, pIdleSounds[num], 1.0f, ATTN_NORM ); // is this word our last? if( RANDOM_LONG( 1, 10 ) <= 1 ) @@ -322,7 +322,7 @@ void CAGrunt::PrescheduleThink( void ) } else { - m_flNextWordTime = gpGlobals->time + RANDOM_FLOAT( 0.5, 1 ); + m_flNextWordTime = gpGlobals->time + RANDOM_FLOAT( 0.5f, 1.0f ); } } } @@ -335,7 +335,7 @@ void CAGrunt::DeathSound( void ) { StopTalking(); - EMIT_SOUND( ENT( pev ), CHAN_VOICE, pDieSounds[RANDOM_LONG( 0, ARRAYSIZE( pDieSounds ) - 1 )], 1.0, ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_VOICE, pDieSounds[RANDOM_LONG( 0, ARRAYSIZE( pDieSounds ) - 1 )], 1.0f, ATTN_NORM ); } //========================================================= @@ -345,7 +345,7 @@ void CAGrunt::AlertSound( void ) { StopTalking(); - EMIT_SOUND( ENT( pev ), CHAN_VOICE, pAlertSounds[RANDOM_LONG( 0, ARRAYSIZE( pAlertSounds ) - 1 )], 1.0, ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_VOICE, pAlertSounds[RANDOM_LONG( 0, ARRAYSIZE( pAlertSounds ) - 1 )], 1.0f, ATTN_NORM ); } //========================================================= @@ -355,7 +355,7 @@ void CAGrunt::AttackSound( void ) { StopTalking(); - EMIT_SOUND( ENT( pev ), CHAN_VOICE, pAttackSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackSounds ) - 1 )], 1.0, ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_VOICE, pAttackSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackSounds ) - 1 )], 1.0f, ATTN_NORM ); } //========================================================= @@ -368,11 +368,11 @@ void CAGrunt::PainSound( void ) return; } - m_flNextPainTime = gpGlobals->time + 0.6; + m_flNextPainTime = gpGlobals->time + 0.6f; StopTalking(); - EMIT_SOUND( ENT( pev ), CHAN_VOICE, pPainSounds[RANDOM_LONG( 0, ARRAYSIZE( pPainSounds ) - 1 )], 1.0, ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_VOICE, pPainSounds[RANDOM_LONG( 0, ARRAYSIZE( pPainSounds ) - 1 )], 1.0f, ATTN_NORM ); } //========================================================= @@ -443,15 +443,15 @@ void CAGrunt::HandleAnimEvent( MonsterEvent_t *pEvent ) pev->effects = EF_MUZZLEFLASH; // make angles +-180 - if( angDir.x > 180 ) + if( angDir.x > 180.0f ) { - angDir.x = angDir.x - 360; + angDir.x = angDir.x - 360.0f; } SetBlending( 0, angDir.x ); GetAttachment( 0, vecArmPos, vecArmDir ); - vecArmPos = vecArmPos + vecDirToEnemy * 32; + vecArmPos = vecArmPos + vecDirToEnemy * 32.0f; MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, vecArmPos ); WRITE_BYTE( TE_SPRITE ); WRITE_COORD( vecArmPos.x ); // pos @@ -463,10 +463,10 @@ void CAGrunt::HandleAnimEvent( MonsterEvent_t *pEvent ) MESSAGE_END(); CBaseEntity *pHornet = CBaseEntity::Create( "hornet", vecArmPos, UTIL_VecToAngles( vecDirToEnemy ), edict() ); - UTIL_MakeVectors ( pHornet->pev->angles ); - pHornet->pev->velocity = gpGlobals->v_forward * 300; + UTIL_MakeVectors( pHornet->pev->angles ); + pHornet->pev->velocity = gpGlobals->v_forward * 300.0f; - switch( RANDOM_LONG ( 0 , 2 ) ) + switch( RANDOM_LONG( 0, 2 ) ) { case 0: EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, "agrunt/ag_fire1.wav", 1.0, ATTN_NORM, 0, 100 ); @@ -507,7 +507,7 @@ void CAGrunt::HandleAnimEvent( MonsterEvent_t *pEvent ) EMIT_SOUND_DYN( ENT( pev ), CHAN_BODY, "player/pl_ladder1.wav", 1, ATTN_NORM, 0, 70 ); break; case 1: - EMIT_SOUND_DYN( ENT( pev ), CHAN_BODY, "player/pl_ladder3.wav", 1, ATTN_NORM, 0 ,70); + EMIT_SOUND_DYN( ENT( pev ), CHAN_BODY, "player/pl_ladder3.wav", 1, ATTN_NORM, 0, 70 ); break; } break; @@ -518,17 +518,17 @@ void CAGrunt::HandleAnimEvent( MonsterEvent_t *pEvent ) if( pHurt ) { - pHurt->pev->punchangle.y = -25; - pHurt->pev->punchangle.x = 8; + pHurt->pev->punchangle.y = -25.0f; + pHurt->pev->punchangle.x = 8.0f; // OK to use gpGlobals without calling MakeVectors, cause CheckTraceHullAttack called it above. if( pHurt->IsPlayer() ) { // this is a player. Knock him around. - pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_right * 250; + pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_right * 250.0f; } - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackHitSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackHitSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackHitSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackHitSounds ) - 1 )], 1.0f, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); Vector vecArmPos, vecArmAng; GetAttachment( 0, vecArmPos, vecArmAng ); @@ -537,7 +537,7 @@ void CAGrunt::HandleAnimEvent( MonsterEvent_t *pEvent ) else { // Play a random attack miss sound - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackMissSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackMissSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackMissSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackMissSounds ) - 1 )], 1.0f, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); } } break; @@ -547,17 +547,17 @@ void CAGrunt::HandleAnimEvent( MonsterEvent_t *pEvent ) if( pHurt ) { - pHurt->pev->punchangle.y = 25; - pHurt->pev->punchangle.x = 8; + pHurt->pev->punchangle.y = 25.0f; + pHurt->pev->punchangle.x = 8.0f; // OK to use gpGlobals without calling MakeVectors, cause CheckTraceHullAttack called it above. if( pHurt->IsPlayer() ) { // this is a player. Knock him around. - pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_right * -250; + pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_right * -250.0f; } - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackHitSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackHitSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackHitSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackHitSounds ) - 1 )], 1.0f, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); Vector vecArmPos, vecArmAng; GetAttachment( 0, vecArmPos, vecArmAng ); @@ -566,7 +566,7 @@ void CAGrunt::HandleAnimEvent( MonsterEvent_t *pEvent ) else { // Play a random attack miss sound - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackMissSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackMissSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackMissSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackMissSounds ) - 1 )], 1.0f, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); } } break; @@ -584,21 +584,21 @@ void CAGrunt::Spawn() Precache(); SET_MODEL( ENT( pev ), "models/agrunt.mdl" ); - UTIL_SetSize( pev, Vector( -32, -32, 0 ), Vector( 32, 32, 64 ) ); + UTIL_SetSize( pev, Vector( -32.0f, -32.0f, 0.0f ), Vector( 32.0f, 32.0f, 64.0f ) ); pev->solid = SOLID_SLIDEBOX; pev->movetype = MOVETYPE_STEP; m_bloodColor = BLOOD_COLOR_GREEN; pev->effects = 0; pev->health = gSkillData.agruntHealth; - m_flFieldOfView = 0.2;// indicates the width of this monster's forward view cone ( as a dotproduct result ) + m_flFieldOfView = 0.2f;// indicates the width of this monster's forward view cone ( as a dotproduct result ) m_MonsterState = MONSTERSTATE_NONE; m_afCapability = 0; m_afCapability |= bits_CAP_SQUAD; - m_HackedGunPos = Vector( 24, 64, 48 ); + m_HackedGunPos = Vector( 24.0f, 64.0f, 48.0f ); - m_flNextSpeakTime = m_flNextWordTime = gpGlobals->time + 10 + RANDOM_LONG( 0, 10 ); + m_flNextSpeakTime = m_flNextWordTime = gpGlobals->time + 10.0f + RANDOM_LONG( 0, 10 ); MonsterInit(); } @@ -651,8 +651,8 @@ Task_t tlAGruntFail[] = { { TASK_STOP_MOVING, 0 }, { TASK_SET_ACTIVITY, (float)ACT_IDLE }, - { TASK_WAIT, (float)2 }, - { TASK_WAIT_PVS, (float)0 }, + { TASK_WAIT, 2.0f }, + { TASK_WAIT_PVS, 0.0f }, }; Schedule_t slAGruntFail[] = @@ -674,8 +674,8 @@ Task_t tlAGruntCombatFail[] = { { TASK_STOP_MOVING, 0 }, { TASK_SET_ACTIVITY, (float)ACT_IDLE }, - { TASK_WAIT_FACE_ENEMY, (float)2 }, - { TASK_WAIT_PVS, (float)0 }, + { TASK_WAIT_FACE_ENEMY, 2.0f }, + { TASK_WAIT_PVS, 0.0f }, }; Schedule_t slAGruntCombatFail[] = @@ -697,9 +697,9 @@ Schedule_t slAGruntCombatFail[] = //========================================================= Task_t tlAGruntStandoff[] = { - { TASK_STOP_MOVING, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, { TASK_SET_ACTIVITY, (float)ACT_IDLE }, - { TASK_WAIT_FACE_ENEMY, (float)2 }, + { TASK_WAIT_FACE_ENEMY, 2.0f }, }; Schedule_t slAGruntStandoff[] = @@ -722,8 +722,8 @@ Schedule_t slAGruntStandoff[] = //========================================================= Task_t tlAGruntSuppressHornet[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_RANGE_ATTACK1, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_RANGE_ATTACK1, 0.0f }, }; Schedule_t slAGruntSuppress[] = @@ -742,9 +742,9 @@ Schedule_t slAGruntSuppress[] = //========================================================= Task_t tlAGruntRangeAttack1[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_FACE_ENEMY, (float)0 }, - { TASK_RANGE_ATTACK1, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_FACE_ENEMY, 0.0f }, + { TASK_RANGE_ATTACK1, 0.0f }, }; Schedule_t slAGruntRangeAttack1[] = @@ -788,13 +788,13 @@ Schedule_t slAGruntHiddenRangeAttack[] = //========================================================= Task_t tlAGruntTakeCoverFromEnemy[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_WAIT, (float)0.2 }, - { TASK_FIND_COVER_FROM_ENEMY, (float)0 }, - { TASK_RUN_PATH, (float)0 }, - { TASK_WAIT_FOR_MOVEMENT, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_WAIT, 0.2f }, + { TASK_FIND_COVER_FROM_ENEMY, 0.0f }, + { TASK_RUN_PATH, 0.0f }, + { TASK_WAIT_FOR_MOVEMENT, 0.0f }, { TASK_REMEMBER, (float)bits_MEMORY_INCOVER }, - { TASK_FACE_ENEMY, (float)0 }, + { TASK_FACE_ENEMY, 0.0f }, }; Schedule_t slAGruntTakeCoverFromEnemy[] = @@ -813,13 +813,13 @@ Schedule_t slAGruntTakeCoverFromEnemy[] = //========================================================= Task_t tlAGruntVictoryDance[] = { - { TASK_STOP_MOVING, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, { TASK_SET_FAIL_SCHEDULE, (float)SCHED_AGRUNT_THREAT_DISPLAY }, - { TASK_WAIT, (float)0.2 }, - { TASK_AGRUNT_GET_PATH_TO_ENEMY_CORPSE, (float)0 }, - { TASK_WALK_PATH, (float)0 }, - { TASK_WAIT_FOR_MOVEMENT, (float)0 }, - { TASK_FACE_ENEMY, (float)0 }, + { TASK_WAIT, 0.2f }, + { TASK_AGRUNT_GET_PATH_TO_ENEMY_CORPSE, 0.0f }, + { TASK_WALK_PATH, 0.0f }, + { TASK_WAIT_FOR_MOVEMENT, 0.0f }, + { TASK_FACE_ENEMY, 0.0f }, { TASK_PLAY_SEQUENCE, (float)ACT_CROUCH }, { TASK_PLAY_SEQUENCE, (float)ACT_VICTORY_DANCE }, { TASK_PLAY_SEQUENCE, (float)ACT_VICTORY_DANCE }, @@ -851,8 +851,8 @@ Schedule_t slAGruntVictoryDance[] = //========================================================= Task_t tlAGruntThreatDisplay[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_FACE_ENEMY, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_FACE_ENEMY, 0.0f }, { TASK_PLAY_SEQUENCE, (float)ACT_THREAT_DISPLAY }, }; @@ -909,7 +909,7 @@ BOOL CAGrunt::FCanCheckAttacks( void ) //========================================================= BOOL CAGrunt::CheckMeleeAttack1( float flDot, float flDist ) { - if( HasConditions( bits_COND_SEE_ENEMY ) && flDist <= AGRUNT_MELEE_DIST && flDot >= 0.6 && m_hEnemy != 0 ) + if( HasConditions( bits_COND_SEE_ENEMY ) && flDist <= AGRUNT_MELEE_DIST && flDot >= 0.6f && m_hEnemy != 0 ) { return TRUE; } @@ -930,7 +930,7 @@ BOOL CAGrunt::CheckRangeAttack1( float flDot, float flDist ) return m_fCanHornetAttack; } - if( HasConditions( bits_COND_SEE_ENEMY ) && flDist >= AGRUNT_MELEE_DIST && flDist <= 1024 && flDot >= 0.5 && NoFriendlyFire() ) + if( HasConditions( bits_COND_SEE_ENEMY ) && flDist >= AGRUNT_MELEE_DIST && flDist <= 1024.0f && flDot >= 0.5f && NoFriendlyFire() ) { TraceResult tr; Vector vecArmPos, vecArmDir; @@ -939,18 +939,18 @@ BOOL CAGrunt::CheckRangeAttack1( float flDot, float flDist ) // !!!LATER - we may wish to do something different for projectile weapons as opposed to instant-hit UTIL_MakeVectors( pev->angles ); GetAttachment( 0, vecArmPos, vecArmDir ); - //UTIL_TraceLine( vecArmPos, vecArmPos + gpGlobals->v_forward * 256, ignore_monsters, ENT( pev ), &tr ); + //UTIL_TraceLine( vecArmPos, vecArmPos + gpGlobals->v_forward * 256.0f, ignore_monsters, ENT( pev ), &tr ); UTIL_TraceLine( vecArmPos, m_hEnemy->BodyTarget( vecArmPos ), dont_ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction == 1.0 || tr.pHit == m_hEnemy->edict() ) + if( tr.flFraction == 1.0f || tr.pHit == m_hEnemy->edict() ) { - m_flNextHornetAttackCheck = gpGlobals->time + RANDOM_FLOAT( 2, 5 ); + m_flNextHornetAttackCheck = gpGlobals->time + RANDOM_FLOAT( 2.0f, 5.0f ); m_fCanHornetAttack = TRUE; return m_fCanHornetAttack; } } - m_flNextHornetAttackCheck = gpGlobals->time + 0.2;// don't check for half second if this check wasn't successful + m_flNextHornetAttackCheck = gpGlobals->time + 0.2f;// don't check for half second if this check wasn't successful m_fCanHornetAttack = FALSE; return m_fCanHornetAttack; } @@ -965,7 +965,7 @@ void CAGrunt::StartTask( Task_t *pTask ) case TASK_AGRUNT_GET_PATH_TO_ENEMY_CORPSE: { UTIL_MakeVectors( pev->angles ); - if( BuildRoute( m_vecEnemyLKP - gpGlobals->v_forward * 50, bits_MF_TO_LOCATION, NULL ) ) + if( BuildRoute( m_vecEnemyLKP - gpGlobals->v_forward * 50.0f, bits_MF_TO_LOCATION, NULL ) ) { TaskComplete(); } @@ -995,20 +995,20 @@ void CAGrunt::StartTask( Task_t *pTask ) UTIL_VecToAngles( m_vecEnemyLKP - pev->origin ); - UTIL_TraceLine( Center() + gpGlobals->v_forward * 128, m_vecEnemyLKP, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction == 1.0 ) + UTIL_TraceLine( Center() + gpGlobals->v_forward * 128.0f, m_vecEnemyLKP, ignore_monsters, ENT( pev ), &tr ); + if( tr.flFraction == 1.0f ) { - MakeIdealYaw( pev->origin + gpGlobals->v_right * 128 ); + MakeIdealYaw( pev->origin + gpGlobals->v_right * 128.0f ); fSkip = TRUE; TaskComplete(); } if( !fSkip ) { - UTIL_TraceLine( Center() - gpGlobals->v_forward * 128, m_vecEnemyLKP, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction == 1.0 ) + UTIL_TraceLine( Center() - gpGlobals->v_forward * 128.0f, m_vecEnemyLKP, ignore_monsters, ENT( pev ), &tr ); + if( tr.flFraction == 1.0f ) { - MakeIdealYaw( pev->origin - gpGlobals->v_right * 128 ); + MakeIdealYaw( pev->origin - gpGlobals->v_right * 128.0f ); fSkip = TRUE; TaskComplete(); } @@ -1016,10 +1016,10 @@ void CAGrunt::StartTask( Task_t *pTask ) if( !fSkip ) { - UTIL_TraceLine( Center() + gpGlobals->v_forward * 256, m_vecEnemyLKP, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction == 1.0 ) + UTIL_TraceLine( Center() + gpGlobals->v_forward * 256.0f, m_vecEnemyLKP, ignore_monsters, ENT( pev ), &tr ); + if( tr.flFraction == 1.0f ) { - MakeIdealYaw( pev->origin + gpGlobals->v_right * 256 ); + MakeIdealYaw( pev->origin + gpGlobals->v_right * 256.0f ); fSkip = TRUE; TaskComplete(); } @@ -1027,10 +1027,10 @@ void CAGrunt::StartTask( Task_t *pTask ) if( !fSkip ) { - UTIL_TraceLine( Center() - gpGlobals->v_forward * 256, m_vecEnemyLKP, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction == 1.0 ) + UTIL_TraceLine( Center() - gpGlobals->v_forward * 256.0f, m_vecEnemyLKP, ignore_monsters, ENT( pev ), &tr ); + if( tr.flFraction == 1.0f ) { - MakeIdealYaw( pev->origin - gpGlobals->v_right * 256 ); + MakeIdealYaw( pev->origin - gpGlobals->v_right * 256.0f ); fSkip = TRUE; TaskComplete(); } diff --git a/dlls/animating.cpp b/dlls/animating.cpp index 95e8b86b..cab2c198 100644 --- a/dlls/animating.cpp +++ b/dlls/animating.cpp @@ -43,27 +43,27 @@ IMPLEMENT_SAVERESTORE( CBaseAnimating, CBaseDelay ) //========================================================= float CBaseAnimating::StudioFrameAdvance( float flInterval ) { - if( flInterval == 0.0 ) + if( flInterval == 0.0f ) { flInterval = gpGlobals->time - pev->animtime; - if( flInterval <= 0.001 ) + if( flInterval <= 0.001f ) { pev->animtime = gpGlobals->time; - return 0.0; + return 0.0f; } } if( !pev->animtime ) - flInterval = 0.0; + flInterval = 0.0f; pev->frame += flInterval * m_flFrameRate * pev->framerate; pev->animtime = gpGlobals->time; - if( pev->frame < 0.0 || pev->frame >= 256.0 ) + if( pev->frame < 0.0f || pev->frame >= 256.0f ) { if( m_fSequenceLoops ) - pev->frame -= (int)( pev->frame / 256.0 ) * 256.0; + pev->frame -= (int)( pev->frame / 256.0f ) * 256.0f; else - pev->frame = ( pev->frame < 0.0 ) ? 0 : 255; + pev->frame = ( pev->frame < 0.0f ) ? 0.0f : 255.0f; m_fSequenceFinished = TRUE; // just in case it wasn't caught in GetEvents } @@ -142,7 +142,7 @@ void CBaseAnimating::DispatchAnimEvents( float flInterval ) } // FIXME: I have to do this or some events get missed, and this is probably causing the problem below - flInterval = 0.1; + flInterval = 0.1f; // FIX: this still sometimes hits events twice float flStart = pev->frame + ( m_flLastEventCheck - pev->animtime ) * m_flFrameRate * pev->framerate; @@ -150,7 +150,7 @@ void CBaseAnimating::DispatchAnimEvents( float flInterval ) m_flLastEventCheck = pev->animtime + flInterval; m_fSequenceFinished = FALSE; - if( flEnd >= 256 || flEnd <= 0.0 ) + if( flEnd >= 256.0f || flEnd <= 0.0f ) m_fSequenceFinished = TRUE; int index = 0; @@ -258,7 +258,7 @@ void CBaseAnimating::SetSequenceBox( void ) { // expand box for rotation // find min / max for rotations - float yaw = pev->angles.y * ( M_PI / 180.0 ); + float yaw = pev->angles.y * ( M_PI_F / 180.0f ); Vector xvector, yvector; xvector.x = cos( yaw ); @@ -270,8 +270,8 @@ void CBaseAnimating::SetSequenceBox( void ) bounds[0] = mins; bounds[1] = maxs; - Vector rmin( 9999, 9999, 9999 ); - Vector rmax( -9999, -9999, -9999 ); + Vector rmin( 9999.0f, 9999.0f, 9999.0f ); + Vector rmax( -9999.0f, -9999.0f, -9999.0f ); Vector base, transformed; for( int i = 0; i <= 1; i++ ) @@ -304,8 +304,8 @@ void CBaseAnimating::SetSequenceBox( void ) } } } - rmin.z = 0; - rmax.z = rmin.z + 1; + rmin.z = 0.0f; + rmax.z = rmin.z + 1.0f; UTIL_SetSize( pev, rmin, rmax ); } } diff --git a/dlls/animation.cpp b/dlls/animation.cpp index f84ec380..6ebddc01 100644 --- a/dlls/animation.cpp +++ b/dlls/animation.cpp @@ -203,7 +203,7 @@ void SequencePrecache( void *pmodel, const char *pSequenceName ) // of it's name if it is. if( IsSoundEvent( pevent[i].event ) ) { - if( !strlen( pevent[i].options ) ) + if( pevent[i].options[0] == '\0' ) { ALERT( at_error, "Bad sound event %d in sequence %s :: %s (sound is \"%s\")\n", pevent[i].event, pstudiohdr->name, pSequenceName, pevent[i].options ); } @@ -226,8 +226,8 @@ void GetSequenceInfo( void *pmodel, entvars_t *pev, float *pflFrameRate, float * if( pev->sequence >= pstudiohdr->numseq ) { - *pflFrameRate = 0.0; - *pflGroundSpeed = 0.0; + *pflFrameRate = 0.0f; + *pflGroundSpeed = 0.0f; return; } @@ -235,14 +235,14 @@ void GetSequenceInfo( void *pmodel, entvars_t *pev, float *pflFrameRate, float * if( pseqdesc->numframes > 1 ) { - *pflFrameRate = 256 * pseqdesc->fps / ( pseqdesc->numframes - 1 ); + *pflFrameRate = 256.0f * pseqdesc->fps / ( pseqdesc->numframes - 1 ); *pflGroundSpeed = sqrt( pseqdesc->linearmovement[0] * pseqdesc->linearmovement[0] + pseqdesc->linearmovement[1] * pseqdesc->linearmovement[1] + pseqdesc->linearmovement[2] * pseqdesc->linearmovement[2] ); *pflGroundSpeed = *pflGroundSpeed * pseqdesc->fps / ( pseqdesc->numframes - 1 ); } else { - *pflFrameRate = 256.0; - *pflGroundSpeed = 0.0; + *pflFrameRate = 256.0f; + *pflGroundSpeed = 0.0f; } } @@ -279,13 +279,13 @@ int GetAnimationEvent( void *pmodel, entvars_t *pev, MonsterEvent_t *pMonsterEve if( pseqdesc->numframes > 1 ) { - flStart *= ( pseqdesc->numframes - 1 ) / 256.0; - flEnd *= (pseqdesc->numframes - 1) / 256.0; + flStart *= ( pseqdesc->numframes - 1 ) / 256.0f; + flEnd *= (pseqdesc->numframes - 1) / 256.0f; } else { - flStart = 0; - flEnd = 1.0; + flStart = 0.0f; + flEnd = 1.0f; } for( ; index < pseqdesc->numevents; index++ ) @@ -333,19 +333,19 @@ float SetController( void *pmodel, entvars_t *pev, int iController, float flValu flValue = -flValue; // does the controller not wrap? - if( pbonecontroller->start + 359.0 >= pbonecontroller->end ) + if( pbonecontroller->start + 359.0f >= pbonecontroller->end ) { - if( flValue > ( ( pbonecontroller->start + pbonecontroller->end ) / 2.0 ) + 180 ) - flValue = flValue - 360; - if( flValue < ( ( pbonecontroller->start + pbonecontroller->end) / 2.0 ) - 180 ) - flValue = flValue + 360; + if( flValue > ( ( pbonecontroller->start + pbonecontroller->end ) * 0.5f ) + 180.0f ) + flValue = flValue - 360.0f; + if( flValue < ( ( pbonecontroller->start + pbonecontroller->end ) * 0.5f ) - 180.0f ) + flValue = flValue + 360.0f; } else { - if( flValue > 360 ) - flValue = flValue - (int)( flValue / 360.0 ) * 360.0; - else if( flValue < 0 ) - flValue = flValue + (int)( ( flValue / -360.0 ) + 1 ) * 360.0; + if( flValue > 360.0f ) + flValue = flValue - (int)( flValue / 360.0f ) * 360.0f; + else if( flValue < 0.0f ) + flValue = flValue + (int)( ( flValue / -360.0f ) + 1.0f ) * 360.0f; } } @@ -357,7 +357,7 @@ float SetController( void *pmodel, entvars_t *pev, int iController, float flValu setting = 255; pev->controller[iController] = setting; - return setting * ( 1.0 / 255.0 ) * (pbonecontroller->end - pbonecontroller->start ) + pbonecontroller->start; + return setting * ( 1.0f / 255.0f ) * (pbonecontroller->end - pbonecontroller->start ) + pbonecontroller->start; } float SetBlending( void *pmodel, entvars_t *pev, int iBlender, float flValue ) @@ -382,12 +382,12 @@ float SetBlending( void *pmodel, entvars_t *pev, int iBlender, float flValue ) flValue = -flValue; // does the controller not wrap? - if( pseqdesc->blendstart[iBlender] + 359.0 >= pseqdesc->blendend[iBlender] ) + if( pseqdesc->blendstart[iBlender] + 359.0f >= pseqdesc->blendend[iBlender] ) { - if( flValue > ( ( pseqdesc->blendstart[iBlender] + pseqdesc->blendend[iBlender] ) / 2.0 ) + 180 ) - flValue = flValue - 360; - if( flValue < ( ( pseqdesc->blendstart[iBlender] + pseqdesc->blendend[iBlender] ) / 2.0 ) - 180 ) - flValue = flValue + 360; + if( flValue > ( ( pseqdesc->blendstart[iBlender] + pseqdesc->blendend[iBlender] ) * 0.5f ) + 180.0f ) + flValue = flValue - 360.0f; + if( flValue < ( ( pseqdesc->blendstart[iBlender] + pseqdesc->blendend[iBlender] ) * 0.5f ) - 180.0f ) + flValue = flValue + 360.0f; } } @@ -400,7 +400,7 @@ float SetBlending( void *pmodel, entvars_t *pev, int iBlender, float flValue ) pev->blending[iBlender] = setting; - return setting * ( 1.0 / 255.0 ) * ( pseqdesc->blendend[iBlender] - pseqdesc->blendstart[iBlender] ) + pseqdesc->blendstart[iBlender]; + return setting * ( 1.0f / 255.0f ) * ( pseqdesc->blendend[iBlender] - pseqdesc->blendstart[iBlender] ) + pseqdesc->blendstart[iBlender]; } int FindTransition( void *pmodel, int iEndingAnim, int iGoalAnim, int *piDir ) diff --git a/dlls/apache.cpp b/dlls/apache.cpp index b3cfcf87..e69d72e9 100644 --- a/dlls/apache.cpp +++ b/dlls/apache.cpp @@ -42,8 +42,8 @@ class CApache : public CBaseMonster void SetObjectCollisionBox( void ) { - pev->absmin = pev->origin + Vector( -300, -300, -172 ); - pev->absmax = pev->origin + Vector( 300, 300, 8 ); + pev->absmin = pev->origin + Vector( -300.0f, -300.0f, -172.0f ); + pev->absmax = pev->origin + Vector( 300.0f, 300.0f, 8.0f ); } void EXPORT HuntThink( void ); @@ -123,14 +123,14 @@ void CApache::Spawn( void ) pev->solid = SOLID_BBOX; SET_MODEL( ENT( pev ), "models/apache.mdl" ); - UTIL_SetSize( pev, Vector( -32, -32, -64 ), Vector( 32, 32, 0 ) ); + UTIL_SetSize( pev, Vector( -32.0f, -32.0f, -64.0f ), Vector( 32.0f, 32.0f, 0.0f ) ); UTIL_SetOrigin( pev, pev->origin ); pev->flags |= FL_MONSTER; pev->takedamage = DAMAGE_AIM; pev->health = gSkillData.apacheHealth; - m_flFieldOfView = -0.707; // 270 degrees + m_flFieldOfView = -0.707f; // 270 degrees pev->sequence = 0; ResetSequenceInfo(); @@ -146,7 +146,7 @@ void CApache::Spawn( void ) { SetThink( &CApache::HuntThink ); SetTouch( &CApache::FlyTouch ); - pev->nextthink = gpGlobals->time + 1.0; + pev->nextthink = gpGlobals->time + 1.0f; } m_iRockets = 10; @@ -178,47 +178,47 @@ void CApache::Precache( void ) void CApache::NullThink( void ) { StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.5; + pev->nextthink = gpGlobals->time + 0.5f; } void CApache::StartupUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) { SetThink( &CApache::HuntThink ); SetTouch( &CApache::FlyTouch ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; SetUse( NULL ); } void CApache::Killed( entvars_t *pevAttacker, int iGib ) { pev->movetype = MOVETYPE_TOSS; - pev->gravity = 0.3; + pev->gravity = 0.3f; STOP_SOUND( ENT( pev ), CHAN_STATIC, "apache/ap_rotor2.wav" ); - UTIL_SetSize( pev, Vector( -32, -32, -64 ), Vector( 32, 32, 0 ) ); + UTIL_SetSize( pev, Vector( -32.0f, -32.0f, -64.0f ), Vector( 32.0f, 32.0f, 0.0f ) ); SetThink( &CApache::DyingThink ); SetTouch( &CApache::CrashTouch ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; pev->health = 0; pev->takedamage = DAMAGE_NO; if( pev->spawnflags & SF_NOWRECKAGE ) { - m_flNextRocket = gpGlobals->time + 4.0; + m_flNextRocket = gpGlobals->time + 4.0f; } else { - m_flNextRocket = gpGlobals->time + 15.0; + m_flNextRocket = gpGlobals->time + 15.0f; } } void CApache::DyingThink( void ) { StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; - pev->avelocity = pev->avelocity * 1.02; + pev->avelocity = pev->avelocity * 1.02f; // still falling? if( m_flNextRocket > gpGlobals->time ) @@ -226,9 +226,9 @@ void CApache::DyingThink( void ) // random explosions MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, pev->origin ); WRITE_BYTE( TE_EXPLOSION ); // This just makes a dynamic light now - WRITE_COORD( pev->origin.x + RANDOM_FLOAT( -150, 150 ) ); - WRITE_COORD( pev->origin.y + RANDOM_FLOAT( -150, 150 ) ); - WRITE_COORD( pev->origin.z + RANDOM_FLOAT( -150, -50 ) ); + WRITE_COORD( pev->origin.x + RANDOM_FLOAT( -150.0f, 150.0f ) ); + WRITE_COORD( pev->origin.y + RANDOM_FLOAT( -150.0f, 150.0f ) ); + WRITE_COORD( pev->origin.z + RANDOM_FLOAT( -150.0f, -50.0f ) ); WRITE_SHORT( g_sModelIndexFireball ); WRITE_BYTE( RANDOM_LONG( 0, 29 ) + 30 ); // scale * 10 WRITE_BYTE( 12 ); // framerate @@ -238,15 +238,15 @@ void CApache::DyingThink( void ) // lots of smoke MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, pev->origin ); WRITE_BYTE( TE_SMOKE ); - WRITE_COORD( pev->origin.x + RANDOM_FLOAT( -150, 150 ) ); - WRITE_COORD( pev->origin.y + RANDOM_FLOAT( -150, 150 ) ); - WRITE_COORD( pev->origin.z + RANDOM_FLOAT( -150, -50 ) ); + WRITE_COORD( pev->origin.x + RANDOM_FLOAT( -150.0f, 150.0f ) ); + WRITE_COORD( pev->origin.y + RANDOM_FLOAT( -150.0f, 150.0f ) ); + WRITE_COORD( pev->origin.z + RANDOM_FLOAT( -150.0f, -50.0f ) ); WRITE_SHORT( g_sModelIndexSmoke ); WRITE_BYTE( 100 ); // scale * 10 WRITE_BYTE( 10 ); // framerate MESSAGE_END(); - Vector vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5; + Vector vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5f; MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, vecSpot ); WRITE_BYTE( TE_BREAKMODEL ); @@ -283,19 +283,19 @@ void CApache::DyingThink( void ) // don't stop it we touch a entity pev->flags &= ~FL_ONGROUND; - pev->nextthink = gpGlobals->time + 0.2; + pev->nextthink = gpGlobals->time + 0.2f; return; } else { - Vector vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5; + Vector vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5f; /* MESSAGE_BEGIN( MSG_BROADCAST, SVC_TEMPENTITY ); WRITE_BYTE( TE_EXPLOSION); // This just makes a dynamic light now WRITE_COORD( vecSpot.x ); WRITE_COORD( vecSpot.y ); - WRITE_COORD( vecSpot.z + 300 ); + WRITE_COORD( vecSpot.z + 300.0f ); WRITE_SHORT( g_sModelIndexFireball ); WRITE_BYTE( 250 ); // scale * 10 WRITE_BYTE( 8 ); // framerate @@ -307,7 +307,7 @@ void CApache::DyingThink( void ) WRITE_BYTE( TE_SPRITE ); WRITE_COORD( vecSpot.x ); WRITE_COORD( vecSpot.y ); - WRITE_COORD( vecSpot.z + 256 ); + WRITE_COORD( vecSpot.z + 256.0f ); WRITE_SHORT( m_iExplode ); WRITE_BYTE( 120 ); // scale * 10 WRITE_BYTE( 255 ); // brightness @@ -318,7 +318,7 @@ void CApache::DyingThink( void ) WRITE_BYTE( TE_SMOKE ); WRITE_COORD( vecSpot.x ); WRITE_COORD( vecSpot.y ); - WRITE_COORD( vecSpot.z + 512 ); + WRITE_COORD( vecSpot.z + 512.0f ); WRITE_SHORT( g_sModelIndexSmoke ); WRITE_BYTE( 250 ); // scale * 10 WRITE_BYTE( 5 ); // framerate @@ -346,7 +346,7 @@ void CApache::DyingThink( void ) WRITE_BYTE( 0 ); // speed MESSAGE_END(); - EMIT_SOUND( ENT( pev ), CHAN_STATIC, "weapons/mortarhit.wav", 1.0, 0.3 ); + EMIT_SOUND( ENT( pev ), CHAN_STATIC, "weapons/mortarhit.wav", 1.0f, 0.3f ); RadiusDamage( pev->origin, pev, pev, 300, CLASS_NONE, DMG_BLAST ); @@ -354,22 +354,22 @@ void CApache::DyingThink( void ) { CBaseEntity *pWreckage = Create( "cycler_wreckage", pev->origin, pev->angles ); // SET_MODEL( ENT( pWreckage->pev ), STRING( pev->model ) ); - UTIL_SetSize( pWreckage->pev, Vector( -200, -200, -128 ), Vector( 200, 200, -32 ) ); + UTIL_SetSize( pWreckage->pev, Vector( -200.0f, -200.0f, -128.0f ), Vector( 200.0f, 200.0f, -32.0f ) ); pWreckage->pev->frame = pev->frame; pWreckage->pev->sequence = pev->sequence; pWreckage->pev->framerate = 0; - pWreckage->pev->dmgtime = gpGlobals->time + 5; + pWreckage->pev->dmgtime = gpGlobals->time + 5.0f; } // gibs - vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5; + vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5f; MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, vecSpot ); WRITE_BYTE( TE_BREAKMODEL); // position WRITE_COORD( vecSpot.x ); WRITE_COORD( vecSpot.y ); - WRITE_COORD( vecSpot.z + 64 ); + WRITE_COORD( vecSpot.z + 64.0f ); // size WRITE_COORD( 400 ); @@ -398,7 +398,7 @@ void CApache::DyingThink( void ) MESSAGE_END(); SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } } @@ -410,7 +410,7 @@ void CApache::FlyTouch( CBaseEntity *pOther ) TraceResult tr = UTIL_GetGlobalTrace(); // UNDONE, do a real bounce - pev->velocity = pev->velocity + tr.vecPlaneNormal * ( pev->velocity.Length() + 200 ); + pev->velocity = pev->velocity + tr.vecPlaneNormal * ( pev->velocity.Length() + 200.0f ); } } @@ -427,13 +427,13 @@ void CApache::CrashTouch( CBaseEntity *pOther ) void CApache::GibMonster( void ) { - // EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "common/bodysplat.wav", 0.75, ATTN_NORM, 0, 200 ); + // EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "common/bodysplat.wav", 0.75f, ATTN_NORM, 0, 200 ); } void CApache::HuntThink( void ) { StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; ShowDamage(); @@ -455,15 +455,15 @@ void CApache::HuntThink( void ) } // generic speed up - if( m_flGoalSpeed < 800 ) - m_flGoalSpeed += 5; + if( m_flGoalSpeed < 800.0f ) + m_flGoalSpeed += 5.0f; if( m_hEnemy != 0 ) { // ALERT( at_console, "%s\n", STRING( m_hEnemy->pev->classname ) ); if( FVisible( m_hEnemy ) ) { - if( m_flLastSeen < gpGlobals->time - 5 ) + if( m_flLastSeen < gpGlobals->time - 5.0f ) m_flPrevSeen = gpGlobals->time; m_flLastSeen = gpGlobals->time; m_posTarget = m_hEnemy->Center(); @@ -482,7 +482,7 @@ void CApache::HuntThink( void ) { // ALERT( at_console, "%.0f\n", flLength ); - if( flLength < 128 ) + if( flLength < 128.0f ) { m_pGoalEnt = UTIL_FindEntityByTargetname( NULL, STRING( m_pGoalEnt->pev->target ) ); if( m_pGoalEnt ) @@ -499,11 +499,11 @@ void CApache::HuntThink( void ) m_posDesired = pev->origin; } - if( flLength > 250 ) // 500 + if( flLength > 250.0f ) // 500 { - // float flLength2 = ( m_posTarget - pev->origin ).Length() * ( 1.5 - DotProduct( ( m_posTarget - pev->origin ).Normalize(), pev->velocity.Normalize() ) ); + // float flLength2 = ( m_posTarget - pev->origin ).Length() * ( 1.5f - DotProduct( ( m_posTarget - pev->origin ).Normalize(), pev->velocity.Normalize() ) ); // if( flLength2 < flLength ) - if( m_flLastSeen + 90 > gpGlobals->time && DotProduct( ( m_posTarget - pev->origin ).Normalize(), ( m_posDesired - pev->origin ).Normalize() ) > 0.25 ) + if( m_flLastSeen + 90.0f > gpGlobals->time && DotProduct( ( m_posTarget - pev->origin ).Normalize(), ( m_posDesired - pev->origin ).Normalize() ) > 0.25f ) { m_vecDesired = ( m_posTarget - pev->origin ).Normalize(); } @@ -520,47 +520,47 @@ void CApache::HuntThink( void ) Flight(); // ALERT( at_console, "%.0f %.0f %.0f\n", gpGlobals->time, m_flLastSeen, m_flPrevSeen ); - if( ( m_flLastSeen + 1 > gpGlobals->time ) && ( m_flPrevSeen + 2 < gpGlobals->time ) ) + if( ( m_flLastSeen + 1.0f > gpGlobals->time ) && ( m_flPrevSeen + 2.0f < gpGlobals->time ) ) { if( FireGun() ) { // slow down if we're fireing - if( m_flGoalSpeed > 400 ) - m_flGoalSpeed = 400; + if( m_flGoalSpeed > 400.0f ) + m_flGoalSpeed = 400.0f; } // don't fire rockets and gun on easy mode if( g_iSkillLevel == SKILL_EASY ) - m_flNextRocket = gpGlobals->time + 10.0; + m_flNextRocket = gpGlobals->time + 10.0f; } UTIL_MakeAimVectors( pev->angles ); - Vector vecEst = ( gpGlobals->v_forward * 800 + pev->velocity ).Normalize(); - // ALERT( at_console, "%d %d %d %4.2f\n", pev->angles.x < 0, DotProduct( pev->velocity, gpGlobals->v_forward ) > -100, m_flNextRocket < gpGlobals->time, DotProduct( m_vecTarget, vecEst ) ); + Vector vecEst = ( gpGlobals->v_forward * 800.0f + pev->velocity ).Normalize(); + // ALERT( at_console, "%d %d %d %4.2f\n", pev->angles.x < 0.0f, DotProduct( pev->velocity, gpGlobals->v_forward ) > -100.0f, m_flNextRocket < gpGlobals->time, DotProduct( m_vecTarget, vecEst ) ); if( ( m_iRockets % 2 ) == 1 ) { FireRocket(); - m_flNextRocket = gpGlobals->time + 0.5; + m_flNextRocket = gpGlobals->time + 0.5f; if( m_iRockets <= 0 ) { - m_flNextRocket = gpGlobals->time + 10; + m_flNextRocket = gpGlobals->time + 10.0f; m_iRockets = 10; } } - else if( pev->angles.x < 0 && DotProduct( pev->velocity, gpGlobals->v_forward ) > -100 && m_flNextRocket < gpGlobals->time ) + else if( pev->angles.x < 0.0f && DotProduct( pev->velocity, gpGlobals->v_forward ) > -100.0f && m_flNextRocket < gpGlobals->time ) { - if( m_flLastSeen + 60 > gpGlobals->time ) + if( m_flLastSeen + 60.0f > gpGlobals->time ) { if( m_hEnemy != 0 ) { // make sure it's a good shot - if( DotProduct( m_vecTarget, vecEst ) > .965 ) + if( DotProduct( m_vecTarget, vecEst ) > .965f ) { TraceResult tr; - UTIL_TraceLine( pev->origin, pev->origin + vecEst * 4096, ignore_monsters, edict(), &tr ); - if( (tr.vecEndPos - m_posTarget ).Length() < 512 ) + UTIL_TraceLine( pev->origin, pev->origin + vecEst * 4096.0f, ignore_monsters, edict(), &tr ); + if( (tr.vecEndPos - m_posTarget ).Length() < 512.0f ) FireRocket(); } } @@ -568,9 +568,9 @@ void CApache::HuntThink( void ) { TraceResult tr; - UTIL_TraceLine( pev->origin, pev->origin + vecEst * 4096, dont_ignore_monsters, edict(), &tr ); + UTIL_TraceLine( pev->origin, pev->origin + vecEst * 4096.0f, dont_ignore_monsters, edict(), &tr ); // just fire when close - if( ( tr.vecEndPos - m_posTarget ).Length() < 512 ) + if( ( tr.vecEndPos - m_posTarget ).Length() < 512.0f ) FireRocket(); } } @@ -580,34 +580,34 @@ void CApache::HuntThink( void ) void CApache::Flight( void ) { // tilt model 5 degrees - Vector vecAdj = Vector( 5.0, 0, 0 ); + Vector vecAdj = Vector( 5.0f, 0.0f, 0.0f ); // estimate where I'll be facing in one seconds - UTIL_MakeAimVectors( pev->angles + pev->avelocity * 2 + vecAdj ); - // Vector vecEst1 = pev->origin + pev->velocity + gpGlobals->v_up * m_flForce - Vector( 0, 0, 384 ); + UTIL_MakeAimVectors( pev->angles + pev->avelocity * 2.0f + vecAdj ); + // Vector vecEst1 = pev->origin + pev->velocity + gpGlobals->v_up * m_flForce - Vector( 0.0f, 0.0f, 384.0f ); // float flSide = DotProduct( m_posDesired - vecEst1, gpGlobals->v_right ); float flSide = DotProduct( m_vecDesired, gpGlobals->v_right ); - if( flSide < 0 ) + if( flSide < 0.0f ) { - if( pev->avelocity.y < 60 ) + if( pev->avelocity.y < 60.0f ) { - pev->avelocity.y += 8; // 9 * ( 3.0 / 2.0 ); + pev->avelocity.y += 8.0f; // 9 * ( 3.0 / 2.0 ); } } else { - if( pev->avelocity.y > -60 ) + if( pev->avelocity.y > -60.0f ) { - pev->avelocity.y -= 8; // 9 * ( 3.0 / 2.0 ); + pev->avelocity.y -= 8.0f; // 9 * ( 3.0 / 2.0 ); } } - pev->avelocity.y *= 0.98; + pev->avelocity.y *= 0.98f; // estimate where I'll be in two seconds - UTIL_MakeAimVectors( pev->angles + pev->avelocity * 1 + vecAdj ); - Vector vecEst = pev->origin + pev->velocity * 2.0 + gpGlobals->v_up * m_flForce * 20 - Vector( 0, 0, 384 * 2 ); + UTIL_MakeAimVectors( pev->angles + pev->avelocity * 1.0f + vecAdj ); + Vector vecEst = pev->origin + pev->velocity * 2.0f + gpGlobals->v_up * m_flForce * 20.0f - Vector( 0.0f, 0.0f, 384.0f * 2.0f ); // add immediate force UTIL_MakeAimVectors( pev->angles + vecAdj ); @@ -615,11 +615,11 @@ void CApache::Flight( void ) pev->velocity.y += gpGlobals->v_up.y * m_flForce; pev->velocity.z += gpGlobals->v_up.z * m_flForce; // add gravity - pev->velocity.z -= 38.4; // 32ft/sec + pev->velocity.z -= 38.4f; // 32ft/sec float flSpeed = pev->velocity.Length(); - float flDir = DotProduct( Vector( gpGlobals->v_forward.x, gpGlobals->v_forward.y, 0 ), Vector( pev->velocity.x, pev->velocity.y, 0 ) ); + float flDir = DotProduct( Vector( gpGlobals->v_forward.x, gpGlobals->v_forward.y, 0.0f ), Vector( pev->velocity.x, pev->velocity.y, 0.0f ) ); if( flDir < 0 ) flSpeed = -flSpeed; @@ -629,62 +629,62 @@ void CApache::Flight( void ) float flSlip = -DotProduct( m_posDesired - vecEst, gpGlobals->v_right ); // fly sideways - if( flSlip > 0 ) + if( flSlip > 0.0f ) { - if( pev->angles.z > -30 && pev->avelocity.z > -15 ) - pev->avelocity.z -= 4; + if( pev->angles.z > -30.0f && pev->avelocity.z > -15.0f ) + pev->avelocity.z -= 4.0f; else - pev->avelocity.z += 2; + pev->avelocity.z += 2.0f; } else { - if( pev->angles.z < 30 && pev->avelocity.z < 15 ) - pev->avelocity.z += 4; + if( pev->angles.z < 30 && pev->avelocity.z < 15.0f ) + pev->avelocity.z += 4.0f; else - pev->avelocity.z -= 2; + pev->avelocity.z -= 2.0f; } // sideways drag - pev->velocity.x = pev->velocity.x * ( 1.0 - fabs( gpGlobals->v_right.x ) * 0.05 ); - pev->velocity.y = pev->velocity.y * ( 1.0 - fabs( gpGlobals->v_right.y ) * 0.05 ); - pev->velocity.z = pev->velocity.z * ( 1.0 - fabs( gpGlobals->v_right.z ) * 0.05 ); + pev->velocity.x = pev->velocity.x * ( 1.0f - fabs( gpGlobals->v_right.x ) * 0.05f ); + pev->velocity.y = pev->velocity.y * ( 1.0f - fabs( gpGlobals->v_right.y ) * 0.05f ); + pev->velocity.z = pev->velocity.z * ( 1.0f - fabs( gpGlobals->v_right.z ) * 0.05f ); // general drag - pev->velocity = pev->velocity * 0.995; + pev->velocity = pev->velocity * 0.995f; // apply power to stay correct height - if( m_flForce < 80 && vecEst.z < m_posDesired.z ) + if( m_flForce < 80.0f && vecEst.z < m_posDesired.z ) { - m_flForce += 12; + m_flForce += 12.0f; } - else if( m_flForce > 30 ) + else if( m_flForce > 30.0f ) { if( vecEst.z > m_posDesired.z ) - m_flForce -= 8; + m_flForce -= 8.0f; } // pitch forward or back to get to target - if( flDist > 0 && flSpeed < m_flGoalSpeed /* && flSpeed < flDist */ && pev->angles.x + pev->avelocity.x > -40 ) + if( flDist > 0.0f && flSpeed < m_flGoalSpeed /* && flSpeed < flDist */ && pev->angles.x + pev->avelocity.x > -40.0f ) { // ALERT( at_console, "F " ); // lean forward - pev->avelocity.x -= 12.0; + pev->avelocity.x -= 12.0f; } - else if( flDist < 0 && flSpeed > -50 && pev->angles.x + pev->avelocity.x < 20 ) + else if( flDist < 0.0f && flSpeed > -50.0f && pev->angles.x + pev->avelocity.x < 20.0f ) { // ALERT( at_console, "B " ); // lean backward - pev->avelocity.x += 12.0; + pev->avelocity.x += 12.0f; } - else if( pev->angles.x + pev->avelocity.x > 0 ) + else if( pev->angles.x + pev->avelocity.x > 0.0f ) { // ALERT( at_console, "f " ); - pev->avelocity.x -= 4.0; + pev->avelocity.x -= 4.0f; } - else if( pev->angles.x + pev->avelocity.x < 0 ) + else if( pev->angles.x + pev->avelocity.x < 0.0f ) { // ALERT( at_console, "b " ); - pev->avelocity.x += 4.0; + pev->avelocity.x += 4.0f; } // ALERT( at_console, "%.0f %.0f : %.0f %.0f : %.0f %.0f : %.0f\n", pev->origin.x, pev->velocity.x, flDist, flSpeed, pev->angles.x, pev->avelocity.x, m_flForce ); @@ -693,8 +693,8 @@ void CApache::Flight( void ) // make rotor, engine sounds if( m_iSoundState == 0 ) { - EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, "apache/ap_rotor2.wav", 1.0, 0.3, 0, 110 ); - // EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, "apache/ap_whine1.wav", 0.5, 0.2, 0, 110 ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, "apache/ap_rotor2.wav", 1.0f, 0.3f, 0, 110 ); + // EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, "apache/ap_whine1.wav", 0.5f, 0.2f, 0, 110 ); m_iSoundState = SND_CHANGE_PITCH; // hack for going through level transitions } @@ -708,22 +708,22 @@ void CApache::Flight( void ) { float pitch = DotProduct( pev->velocity - pPlayer->pev->velocity, ( pPlayer->pev->origin - pev->origin ).Normalize() ); - pitch = (int)( 100 + pitch / 50.0 ); + pitch = (int)( 100.0f + pitch / 50.0f ); - if( pitch > 250 ) - pitch = 250; - if( pitch < 50 ) - pitch = 50; - if( pitch == 100 ) - pitch = 101; + if( pitch > 250.0f ) + pitch = 250.0f; + if( pitch < 50.0f ) + pitch = 50.0f; + if( pitch == 100.0f ) + pitch = 101.0f; - float flVol = ( m_flForce / 100.0 ) + .1; - if( flVol > 1.0 ) - flVol = 1.0; + /*float flVol = ( m_flForce / 100.0f ) + 0.1f; + if( flVol > 1.0f ) + flVol = 1.0f;*/ - EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, "apache/ap_rotor2.wav", 1.0, 0.3, SND_CHANGE_PITCH | SND_CHANGE_VOL, pitch ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, "apache/ap_rotor2.wav", 1.0f, 0.3f, SND_CHANGE_PITCH | SND_CHANGE_VOL, pitch ); } - // EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, "apache/ap_whine1.wav", flVol, 0.2, SND_CHANGE_PITCH | SND_CHANGE_VOL, pitch ); + // EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, "apache/ap_whine1.wav", flVol, 0.2f, SND_CHANGE_PITCH | SND_CHANGE_VOL, pitch ); // ALERT( at_console, "%.0f %.2f\n", pitch, flVol ); } @@ -731,27 +731,27 @@ void CApache::Flight( void ) void CApache::FireRocket( void ) { - static float side = 1.0; + static float side = 1.0f; if( m_iRockets <= 0 ) return; UTIL_MakeAimVectors( pev->angles ); - Vector vecSrc = pev->origin + 1.5 * ( gpGlobals->v_forward * 21 + gpGlobals->v_right * 70 * side + gpGlobals->v_up * -79 ); + Vector vecSrc = pev->origin + 1.5f * ( gpGlobals->v_forward * 21.0f + gpGlobals->v_right * 70.0f * side + gpGlobals->v_up * -79.0f ); switch( m_iRockets % 5 ) { case 0: - vecSrc = vecSrc + gpGlobals->v_right * 10; + vecSrc = vecSrc + gpGlobals->v_right * 10.0f; break; case 1: - vecSrc = vecSrc - gpGlobals->v_right * 10; + vecSrc = vecSrc - gpGlobals->v_right * 10.0f; break; case 2: - vecSrc = vecSrc + gpGlobals->v_up * 10; + vecSrc = vecSrc + gpGlobals->v_up * 10.0f; break; case 3: - vecSrc = vecSrc - gpGlobals->v_up * 10; + vecSrc = vecSrc - gpGlobals->v_up * 10.0f; break; case 4: break; @@ -769,7 +769,7 @@ void CApache::FireRocket( void ) CBaseEntity *pRocket = CBaseEntity::Create( "hvr_rocket", vecSrc, pev->angles, edict() ); if( pRocket ) - pRocket->pev->velocity = pev->velocity + gpGlobals->v_forward * 100; + pRocket->pev->velocity = pev->velocity + gpGlobals->v_forward * 100.0f; m_iRockets--; @@ -794,23 +794,23 @@ BOOL CApache::FireGun() Vector angles = UTIL_VecToAngles( vecOut ); angles.x = -angles.x; - if( angles.y > 180 ) - angles.y = angles.y - 360; - if( angles.y < -180 ) - angles.y = angles.y + 360; - if( angles.x > 180 ) - angles.x = angles.x - 360; - if( angles.x < -180 ) - angles.x = angles.x + 360; + if( angles.y > 180.0f ) + angles.y = angles.y - 360.0f; + if( angles.y < -180.0f ) + angles.y = angles.y + 360.0f; + if( angles.x > 180.0f ) + angles.x = angles.x - 360.0f; + if( angles.x < -180.0f ) + angles.x = angles.x + 360.0f; if( angles.x > m_angGun.x ) - m_angGun.x = Q_min( angles.x, m_angGun.x + 12 ); + m_angGun.x = Q_min( angles.x, m_angGun.x + 12.0f ); if( angles.x < m_angGun.x ) - m_angGun.x = Q_max( angles.x, m_angGun.x - 12 ); + m_angGun.x = Q_max( angles.x, m_angGun.x - 12.0f ); if( angles.y > m_angGun.y ) - m_angGun.y = Q_min( angles.y, m_angGun.y + 12 ); + m_angGun.y = Q_min( angles.y, m_angGun.y + 12.0f ); if( angles.y < m_angGun.y ) - m_angGun.y = Q_max( angles.y, m_angGun.y - 12 ); + m_angGun.y = Q_max( angles.y, m_angGun.y - 12.0f ); m_angGun.y = SetBoneController( 0, m_angGun.y ); m_angGun.x = SetBoneController( 1, m_angGun.x ); @@ -819,11 +819,11 @@ BOOL CApache::FireGun() GetAttachment( 0, posBarrel, angBarrel ); Vector vecGun = ( posBarrel - posGun ).Normalize(); - if( DotProduct( vecGun, vecTarget ) > 0.98 ) + if( DotProduct( vecGun, vecTarget ) > 0.98f ) { #if 1 FireBullets( 1, posGun, vecGun, VECTOR_CONE_4DEGREES, 8192, BULLET_MONSTER_12MM, 1 ); - EMIT_SOUND( ENT( pev ), CHAN_WEAPON, "turret/tu_fire1.wav", 1, 0.3 ); + EMIT_SOUND( ENT( pev ), CHAN_WEAPON, "turret/tu_fire1.wav", 1, 0.3f ); #else static float flNext; TraceResult tr; @@ -840,7 +840,7 @@ BOOL CApache::FireGun() if( flNext < gpGlobals->time ) { - flNext = gpGlobals->time + 0.5; + flNext = gpGlobals->time + 0.5f; m_pBeam->SetStartPos( tr.vecEndPos ); } #endif @@ -882,14 +882,14 @@ int CApache::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float if( bitsDamageType & DMG_BLAST ) { - flDamage *= 2; + flDamage *= 2.0f; } /* - if( ( bitsDamageType & DMG_BULLET ) && flDamage > 50 ) + if( ( bitsDamageType & DMG_BULLET ) && flDamage > 50.0f ) { // clip bullet damage at 50 - flDamage = 50; + flDamage = 50.0f; } */ @@ -910,13 +910,13 @@ void CApache::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir { // ALERT( at_console, "%.0f\n", flDamage ); AddMultiDamage( pevAttacker, this, flDamage, bitsDamageType ); - m_iDoSmokePuff = 3 + ( flDamage / 5.0 ); + m_iDoSmokePuff = 3.0f + ( flDamage / 5.0f ); } else { // do half damage in the body - // AddMultiDamage( pevAttacker, this, flDamage / 2.0, bitsDamageType ); - UTIL_Ricochet( ptr->vecEndPos, 2.0 ); + // AddMultiDamage( pevAttacker, this, flDamage / 2.0f, bitsDamageType ); + UTIL_Ricochet( ptr->vecEndPos, 2.0f ); } } @@ -961,9 +961,9 @@ void CApacheHVR::Spawn( void ) UTIL_MakeAimVectors( pev->angles ); m_vecForward = gpGlobals->v_forward; - pev->gravity = 0.5; + pev->gravity = 0.5f; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; pev->dmg = 150; } @@ -972,7 +972,7 @@ void CApacheHVR::Precache( void ) { PRECACHE_MODEL( "models/HVR.mdl" ); m_iTrail = PRECACHE_MODEL( "sprites/smoke.spr" ); - PRECACHE_SOUND("weapons/rocket1.wav"); + PRECACHE_SOUND( "weapons/rocket1.wav" ); } void CApacheHVR::IgniteThink( void ) @@ -983,7 +983,7 @@ void CApacheHVR::IgniteThink( void ) pev->effects |= EF_LIGHT; // make rocket sound - EMIT_SOUND( ENT( pev ), CHAN_VOICE, "weapons/rocket1.wav", 1, 0.5 ); + EMIT_SOUND( ENT( pev ), CHAN_VOICE, "weapons/rocket1.wav", 1, 0.5f ); // rocket trail MESSAGE_BEGIN( MSG_BROADCAST, SVC_TEMPENTITY ); @@ -1000,13 +1000,13 @@ void CApacheHVR::IgniteThink( void ) // set to accelerate SetThink( &CApacheHVR::AccelerateThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } void CApacheHVR::AccelerateThink( void ) { // check world boundaries - if( pev->origin.x < -4096 || pev->origin.x > 4096 || pev->origin.y < -4096 || pev->origin.y > 4096 || pev->origin.z < -4096 || pev->origin.z > 4096 ) + if( pev->origin.x < -4096.0f || pev->origin.x > 4096.0f || pev->origin.y < -4096.0f || pev->origin.y > 4096.0f || pev->origin.z < -4096.0f || pev->origin.z > 4096.0f ) { UTIL_Remove( this ); return; @@ -1014,14 +1014,14 @@ void CApacheHVR::AccelerateThink( void ) // accelerate float flSpeed = pev->velocity.Length(); - if( flSpeed < 1800 ) + if( flSpeed < 1800.0f ) { - pev->velocity = pev->velocity + m_vecForward * 200; + pev->velocity = pev->velocity + m_vecForward * 200.0f; } // re-aim pev->angles = UTIL_VecToAngles( pev->velocity ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } #endif diff --git a/dlls/barnacle.cpp b/dlls/barnacle.cpp index ecc1f5d4..8db34740 100644 --- a/dlls/barnacle.cpp +++ b/dlls/barnacle.cpp @@ -60,8 +60,8 @@ public: #ifdef BARNACLE_FIX_VISIBILITY void SetObjectCollisionBox( void ) { - pev->absmin = pev->origin + Vector( -16, -16, -m_flCachedLength ); - pev->absmax = pev->origin + Vector( 16, 16, 0 ); + pev->absmin = pev->origin + Vector( -16.0f, -16.0f, -m_flCachedLength ); + pev->absmax = pev->origin + Vector( 16.0f, 16.0f, 0.0f ); } #endif }; @@ -117,7 +117,7 @@ void CBarnacle::Spawn() Precache(); SET_MODEL( ENT( pev ), "models/barnacle.mdl" ); - UTIL_SetSize( pev, Vector( -16, -16, -32 ), Vector( 16, 16, 0 ) ); + UTIL_SetSize( pev, Vector( -16.0f, -16.0f, -32.0f ), Vector( 16.0f, 16.0f, 0.0f ) ); pev->solid = SOLID_SLIDEBOX; pev->movetype = MOVETYPE_NONE; @@ -125,20 +125,20 @@ void CBarnacle::Spawn() m_bloodColor = BLOOD_COLOR_RED; pev->effects = EF_INVLIGHT; // take light from the ceiling pev->health = 25; - m_flFieldOfView = 0.5;// indicates the width of this monster's forward view cone ( as a dotproduct result ) + m_flFieldOfView = 0.5f;// indicates the width of this monster's forward view cone ( as a dotproduct result ) m_MonsterState = MONSTERSTATE_NONE; - m_flKillVictimTime = 0; - m_flCachedLength = 32; // mins.z + m_flKillVictimTime = 0.0f; + m_flCachedLength = 32.0f; // mins.z m_cGibs = 0; m_fLiftingPrey = FALSE; - m_flTongueAdj = -100; + m_flTongueAdj = -100.0f; InitBoneControllers(); SetActivity( ACT_IDLE ); SetThink( &CBarnacle::BarnacleThink ); - pev->nextthink = gpGlobals->time + 0.5; + pev->nextthink = gpGlobals->time + 0.5f; UTIL_SetOrigin( pev, pev->origin ); } @@ -168,7 +168,7 @@ void CBarnacle::BarnacleThink( void ) UTIL_SetOrigin( pev, pev->origin ); } #endif - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( m_hEnemy != 0 ) { @@ -197,8 +197,8 @@ void CBarnacle::BarnacleThink( void ) vecNewEnemyOrigin.y = pev->origin.y; // guess as to where their neck is - vecNewEnemyOrigin.x -= 6 * cos( m_hEnemy->pev->angles.y * M_PI / 180.0 ); - vecNewEnemyOrigin.y -= 6 * sin( m_hEnemy->pev->angles.y * M_PI / 180.0 ); + vecNewEnemyOrigin.x -= 6.0f * cos( m_hEnemy->pev->angles.y * M_PI_F / 180.0f ); + vecNewEnemyOrigin.y -= 6.0f * sin( m_hEnemy->pev->angles.y * M_PI_F / 180.0f ); m_flAltitude -= BARNACLE_PULL_SPEED; vecNewEnemyOrigin.z += BARNACLE_PULL_SPEED; @@ -212,7 +212,7 @@ void CBarnacle::BarnacleThink( void ) pVictim = m_hEnemy->MyMonsterPointer(); - m_flKillVictimTime = gpGlobals->time + 10;// now that the victim is in place, the killing bite will be administered in 10 seconds. + m_flKillVictimTime = gpGlobals->time + 10.0f;// now that the victim is in place, the killing bite will be administered in 10 seconds. if( pVictim ) { @@ -228,7 +228,7 @@ void CBarnacle::BarnacleThink( void ) // prey is lifted fully into feeding position and is dangling there. pVictim = m_hEnemy->MyMonsterPointer(); - if( m_flKillVictimTime != -1 && gpGlobals->time > m_flKillVictimTime ) + if( m_flKillVictimTime != -1.0f && gpGlobals->time > m_flKillVictimTime ) { // kill! if( pVictim ) @@ -265,7 +265,7 @@ void CBarnacle::BarnacleThink( void ) // barnacle has no prey right now, so just idle and check to see if anything is touching the tongue. // If idle and no nearby client, don't think so often if( FNullEnt( FIND_CLIENT_IN_PVS( edict() ) ) ) - pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 1, 1.5 ); // Stagger a bit to keep barnacles from thinking on the same frame + pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 1.0f, 1.5f ); // Stagger a bit to keep barnacles from thinking on the same frame if( m_fSequenceFinished ) { @@ -304,7 +304,7 @@ void CBarnacle::BarnacleThink( void ) EMIT_SOUND( ENT( pev ), CHAN_WEAPON, "barnacle/bcl_alert2.wav", 1, ATTN_NORM ); SetSequenceByName( "attack1" ); - m_flTongueAdj = -20; + m_flTongueAdj = -20.0f; m_hEnemy = pTouchEnt; @@ -339,7 +339,7 @@ void CBarnacle::BarnacleThink( void ) // ALERT( at_console, "tounge %f\n", m_flAltitude + m_flTongueAdj ); SetBoneController( 0, -( m_flAltitude + m_flTongueAdj ) ); - StudioFrameAdvance( 0.1 ); + StudioFrameAdvance( 0.1f ); } //========================================================= @@ -377,9 +377,9 @@ void CBarnacle::Killed( entvars_t *pevAttacker, int iGib ) SetActivity( ACT_DIESIMPLE ); SetBoneController( 0, 0 ); - StudioFrameAdvance( 0.1 ); + StudioFrameAdvance( 0.1f ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; SetThink( &CBarnacle::WaitTillDead ); } @@ -387,9 +387,9 @@ void CBarnacle::Killed( entvars_t *pevAttacker, int iGib ) //========================================================= void CBarnacle::WaitTillDead( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; - float flInterval = StudioFrameAdvance( 0.1 ); + float flInterval = StudioFrameAdvance( 0.1f ); DispatchAnimEvents( flInterval ); if( m_fSequenceFinished ) @@ -421,21 +421,21 @@ void CBarnacle::Precache() // to see if any entity is touching it. Also stores the length // of the trace in the int pointer provided. //========================================================= -#define BARNACLE_CHECK_SPACING 8 +#define BARNACLE_CHECK_SPACING 8.0f CBaseEntity *CBarnacle::TongueTouchEnt( float *pflLength ) { TraceResult tr; float length; // trace once to hit architecture and see if the tongue needs to change position. - UTIL_TraceLine( pev->origin, pev->origin - Vector ( 0, 0, 2048 ), ignore_monsters, ENT( pev ), &tr ); + UTIL_TraceLine( pev->origin, pev->origin - Vector ( 0.0f, 0.0f, 2048.0f ), ignore_monsters, ENT( pev ), &tr ); length = fabs( pev->origin.z - tr.vecEndPos.z ); if( pflLength ) { *pflLength = length; } - Vector delta = Vector( BARNACLE_CHECK_SPACING, BARNACLE_CHECK_SPACING, 0 ); + Vector delta = Vector( BARNACLE_CHECK_SPACING, BARNACLE_CHECK_SPACING, 0.0f ); Vector mins = pev->origin - delta; Vector maxs = pev->origin + delta; maxs.z = pev->origin.z; diff --git a/dlls/barney.cpp b/dlls/barney.cpp index 3fc5aef0..dd91de44 100644 --- a/dlls/barney.cpp +++ b/dlls/barney.cpp @@ -266,7 +266,7 @@ void CBarney::AlertSound( void ) { if( FOkToSpeak() ) { - PlaySentence( "BA_ATTACK", RANDOM_FLOAT( 2.8, 3.2 ), VOL_NORM, ATTN_IDLE ); + PlaySentence( "BA_ATTACK", RANDOM_FLOAT( 2.8f, 3.2f ), VOL_NORM, ATTN_IDLE ); } } } @@ -305,22 +305,22 @@ void CBarney::SetYawSpeed( void ) //========================================================= BOOL CBarney::CheckRangeAttack1( float flDot, float flDist ) { - if( flDist <= 1024 && flDot >= 0.5 ) + if( flDist <= 1024.0f && flDot >= 0.5f ) { if( gpGlobals->time > m_checkAttackTime ) { TraceResult tr; - Vector shootOrigin = pev->origin + Vector( 0, 0, 55 ); + Vector shootOrigin = pev->origin + Vector( 0.0f, 0.0f, 55.0f ); CBaseEntity *pEnemy = m_hEnemy; Vector shootTarget = ( ( pEnemy->BodyTarget( shootOrigin ) - pEnemy->pev->origin ) + m_vecEnemyLKP ); UTIL_TraceLine( shootOrigin, shootTarget, dont_ignore_monsters, ENT( pev ), &tr ); - m_checkAttackTime = gpGlobals->time + 1; - if( tr.flFraction == 1.0 || ( tr.pHit != NULL && CBaseEntity::Instance( tr.pHit ) == pEnemy ) ) + m_checkAttackTime = gpGlobals->time + 1.0f; + if( tr.flFraction == 1.0f || ( tr.pHit != NULL && CBaseEntity::Instance( tr.pHit ) == pEnemy ) ) m_lastAttackCheck = TRUE; else m_lastAttackCheck = FALSE; - m_checkAttackTime = gpGlobals->time + 1.5; + m_checkAttackTime = gpGlobals->time + 1.5f; } return m_lastAttackCheck; } @@ -352,9 +352,9 @@ void CBarney::BarneyFirePistol( void ) pitchShift = 0; else pitchShift -= 5; - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, "barney/ba_attack2.wav", 1, ATTN_NORM, 0, 100 + pitchShift ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, "barney/ba_attack2.wav", 1.0f, ATTN_NORM, 0, 100 + pitchShift ); - CSoundEnt::InsertSound( bits_SOUND_COMBAT, pev->origin, 384, 0.3 ); + CSoundEnt::InsertSound( bits_SOUND_COMBAT, pev->origin, 384, 0.3f ); // UNDONE: Reload? m_cAmmoLoaded--;// take away a bullet! @@ -402,7 +402,7 @@ void CBarney::Spawn() pev->movetype = MOVETYPE_STEP; m_bloodColor = BLOOD_COLOR_RED; pev->health = gSkillData.barneyHealth; - pev->view_ofs = Vector ( 0, 0, 50 );// position of the eyes relative to monster's origin. + pev->view_ofs = Vector( 0.0f, 0.0f, 50.0f );// position of the eyes relative to monster's origin. m_flFieldOfView = VIEW_FIELD_WIDE; // NOTE: we need a wide field of view so npc will notice player and say hello m_MonsterState = MONSTERSTATE_NONE; @@ -476,15 +476,15 @@ void CBarney::TalkInit() static BOOL IsFacing( entvars_t *pevTest, const Vector &reference ) { Vector vecDir = reference - pevTest->origin; - vecDir.z = 0; + vecDir.z = 0.0f; vecDir = vecDir.Normalize(); Vector forward, angle; angle = pevTest->v_angle; - angle.x = 0; + angle.x = 0.0f; UTIL_MakeVectorsPrivate( angle, forward, NULL, NULL ); // He's facing me, he meant it - if( DotProduct( forward, vecDir ) > 0.96 ) // +/- 15 degrees or so + if( DotProduct( forward, vecDir ) > 0.96f ) // +/- 15 degrees or so { return TRUE; } @@ -539,18 +539,18 @@ void CBarney::PainSound( void ) if( gpGlobals->time < m_painTime ) return; - m_painTime = gpGlobals->time + RANDOM_FLOAT( 0.5, 0.75 ); + m_painTime = gpGlobals->time + RANDOM_FLOAT( 0.5f, 0.75f ); switch( RANDOM_LONG( 0, 2 ) ) { case 0: - EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "barney/ba_pain1.wav", 1, ATTN_NORM, 0, GetVoicePitch() ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "barney/ba_pain1.wav", 1.0f, ATTN_NORM, 0, GetVoicePitch() ); break; case 1: - EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "barney/ba_pain2.wav", 1, ATTN_NORM, 0, GetVoicePitch() ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "barney/ba_pain2.wav", 1.0f, ATTN_NORM, 0, GetVoicePitch() ); break; case 2: - EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "barney/ba_pain3.wav", 1, ATTN_NORM, 0, GetVoicePitch() ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "barney/ba_pain3.wav", 1.0f, ATTN_NORM, 0, GetVoicePitch() ); break; } } @@ -563,10 +563,10 @@ void CBarney::DeathSound( void ) switch( RANDOM_LONG( 0, 2 ) ) { case 0: - EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "barney/ba_die1.wav", 1, ATTN_NORM, 0, GetVoicePitch() ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "barney/ba_die1.wav", 1.0f, ATTN_NORM, 0, GetVoicePitch() ); break; case 1: - EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "barney/ba_die2.wav", 1, ATTN_NORM, 0, GetVoicePitch() ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "barney/ba_die2.wav", 1.0f, ATTN_NORM, 0, GetVoicePitch() ); break; case 2: EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "barney/ba_die3.wav", 1, ATTN_NORM, 0, GetVoicePitch() ); @@ -582,17 +582,17 @@ void CBarney::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir case HITGROUP_STOMACH: if (bitsDamageType & ( DMG_BULLET | DMG_SLASH | DMG_BLAST ) ) { - flDamage = flDamage / 2; + flDamage = flDamage * 0.5f; } break; case 10: if( bitsDamageType & ( DMG_BULLET | DMG_SLASH | DMG_CLUB ) ) { - flDamage -= 20; - if( flDamage <= 0 ) + flDamage -= 20.0f; + if( flDamage <= 0.0f ) { - UTIL_Ricochet( ptr->vecEndPos, 1.0 ); - flDamage = 0.01; + UTIL_Ricochet( ptr->vecEndPos, 1.0f ); + flDamage = 0.01f; } } diff --git a/dlls/bigmomma.cpp b/dlls/bigmomma.cpp index 434d6134..d67d10f7 100644 --- a/dlls/bigmomma.cpp +++ b/dlls/bigmomma.cpp @@ -150,8 +150,8 @@ IMPLEMENT_SAVERESTORE( CBMortar, CBaseEntity ) #define bits_COND_NODE_SEQUENCE ( bits_COND_SPECIAL1 ) // pev->netname contains the name of a sequence to play // Attack distance constants -#define BIG_ATTACKDIST 170 -#define BIG_MORTARDIST 800 +#define BIG_ATTACKDIST 170.0f +#define BIG_MORTARDIST 800.0f #define BIG_MAXCHILDREN 20 // Max # of live headcrab children #define bits_MEMORY_CHILDPAIR ( bits_MEMORY_CUSTOM1 ) @@ -255,8 +255,8 @@ public: if( m_crabTime < gpGlobals->time && m_crabCount < BIG_MAXCHILDREN ) { // Don't spawn crabs inside each other - Vector mins = pev->origin - Vector( 32, 32, 0 ); - Vector maxs = pev->origin + Vector( 32, 32, 0 ); + Vector mins = pev->origin - Vector( 32.0f, 32.0f, 0.0f ); + Vector maxs = pev->origin + Vector( 32.0f, 32.0f, 0.0f ); CBaseEntity *pList[2]; int count = UTIL_EntitiesInBox( pList, 2, mins, maxs, FL_MONSTER ); @@ -275,8 +275,8 @@ public: void SetObjectCollisionBox( void ) { - pev->absmin = pev->origin + Vector( -95, -95, 0 ); - pev->absmax = pev->origin + Vector( 95, 95, 190 ); + pev->absmin = pev->origin + Vector( -95.0f, -95.0f, 0.0f ); + pev->absmax = pev->origin + Vector( 95.0f, 95.0f, 190.0f ); } BOOL CheckMeleeAttack1( float flDot, float flDist ); // Slash @@ -418,6 +418,7 @@ void CBigMomma::SetYawSpeed( void ) break; default: ys = 90; + break; } pev->yaw_speed = ys; } @@ -440,9 +441,9 @@ void CBigMomma::HandleAnimEvent( MonsterEvent_t *pEvent ) UTIL_MakeVectorsPrivate( pev->angles, forward, right, NULL ); - Vector center = pev->origin + forward * 128; - Vector mins = center - Vector( 64, 64, 0 ); - Vector maxs = center + Vector( 64, 64, 64 ); + Vector center = pev->origin + forward * 128.0f; + Vector mins = center - Vector( 64.0f, 64.0f, 0.0f ); + Vector maxs = center + Vector( 64.0f, 64.0f, 64.0f ); CBaseEntity *pList[8]; int count = UTIL_EntitiesInBox( pList, 8, mins, maxs, FL_MONSTER | FL_CLIENT ); @@ -460,22 +461,22 @@ void CBigMomma::HandleAnimEvent( MonsterEvent_t *pEvent ) if( pHurt ) { pHurt->TakeDamage( pev, pev, gSkillData.bigmommaDmgSlash, DMG_CRUSH | DMG_SLASH ); - pHurt->pev->punchangle.x = 15; + pHurt->pev->punchangle.x = 15.0f; switch( pEvent->event ) { case BIG_AE_MELEE_ATTACKBR: - pHurt->pev->velocity = pHurt->pev->velocity + ( forward * 150 ) + Vector( 0, 0, 250 ) - ( right * 200 ); + pHurt->pev->velocity = pHurt->pev->velocity + ( forward * 150.0f ) + Vector( 0.0f, 0.0f, 250.0f ) - ( right * 200.0f ); break; case BIG_AE_MELEE_ATTACKBL: - pHurt->pev->velocity = pHurt->pev->velocity + ( forward * 150 ) + Vector( 0, 0, 250 ) + ( right * 200 ); + pHurt->pev->velocity = pHurt->pev->velocity + ( forward * 150.0f ) + Vector( 0.0f, 0.0f, 250.0f ) + ( right * 200.0f ); break; case BIG_AE_MELEE_ATTACK1: - pHurt->pev->velocity = pHurt->pev->velocity + ( forward * 220 ) + Vector( 0, 0, 200 ); + pHurt->pev->velocity = pHurt->pev->velocity + ( forward * 220.0f ) + Vector( 0.0f, 0.0f, 200.0f ); break; } pHurt->pev->flags &= ~FL_ONGROUND; - EMIT_SOUND_DYN( edict(), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackHitSounds ), 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); + EMIT_SOUND_DYN( edict(), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pAttackHitSounds ), 1.0f, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); } } break; @@ -515,10 +516,10 @@ void CBigMomma::HandleAnimEvent( MonsterEvent_t *pEvent ) case BIG_AE_JUMP_FORWARD: ClearBits( pev->flags, FL_ONGROUND ); - UTIL_SetOrigin( pev, pev->origin + Vector( 0, 0, 1) );// take him off ground so engine doesn't instantly reset onground + UTIL_SetOrigin( pev, pev->origin + Vector( 0.0f, 0.0f, 1.0f ) );// take him off ground so engine doesn't instantly reset onground UTIL_MakeVectors( pev->angles ); - pev->velocity = gpGlobals->v_forward * 200 + gpGlobals->v_up * 500; + pev->velocity = gpGlobals->v_forward * 200.0f + gpGlobals->v_up * 500.0f; break; case BIG_AE_EARLY_TARGET: { @@ -541,11 +542,11 @@ void CBigMomma::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecD // didn't hit the sack? if( pev->dmgtime != gpGlobals->time || ( RANDOM_LONG( 0, 10 ) < 1 ) ) { - UTIL_Ricochet( ptr->vecEndPos, RANDOM_FLOAT( 1, 2) ); + UTIL_Ricochet( ptr->vecEndPos, RANDOM_FLOAT( 1.0f, 2.0f ) ); pev->dmgtime = gpGlobals->time; } - flDamage = 0.1;// don't hurt the monster much, but allow bits_COND_LIGHT_DAMAGE to be generated + flDamage = 0.1f;// don't hurt the monster much, but allow bits_COND_LIGHT_DAMAGE to be generated } else if( gpGlobals->time > m_painSoundTime ) { @@ -560,7 +561,7 @@ int CBigMomma::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, floa { // Don't take any acid damage -- BigMomma's mortar is acid if( bitsDamageType & DMG_ACID ) - flDamage = 0; + flDamage = 0.0f; if( !HasMemory( bits_MEMORY_PATH_FINISHED ) ) { @@ -584,20 +585,20 @@ void CBigMomma::LayHeadcrab( void ) // Is this the second crab in a pair? if( HasMemory( bits_MEMORY_CHILDPAIR ) ) { - m_crabTime = gpGlobals->time + RANDOM_FLOAT( 5, 10 ); + m_crabTime = gpGlobals->time + RANDOM_FLOAT( 5.0f, 10.0f ); Forget( bits_MEMORY_CHILDPAIR ); } else { - m_crabTime = gpGlobals->time + RANDOM_FLOAT( 0.5, 2.5 ); + m_crabTime = gpGlobals->time + RANDOM_FLOAT( 0.5f, 2.5f ); Remember( bits_MEMORY_CHILDPAIR ); } TraceResult tr; - UTIL_TraceLine( pev->origin, pev->origin - Vector( 0, 0, 100 ), ignore_monsters, edict(), &tr ); + UTIL_TraceLine( pev->origin, pev->origin - Vector( 0.0f, 0.0f, 100.0f ), ignore_monsters, edict(), &tr ); UTIL_DecalTrace( &tr, DECAL_MOMMABIRTH ); - EMIT_SOUND_DYN( edict(), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pBirthSounds ), 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); + EMIT_SOUND_DYN( edict(), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pBirthSounds ), 1.0f, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); m_crabCount++; } @@ -614,15 +615,15 @@ void CBigMomma::DeathNotice( entvars_t *pevChild ) void CBigMomma::LaunchMortar( void ) { - m_mortarTime = gpGlobals->time + RANDOM_FLOAT( 2, 15 ); + m_mortarTime = gpGlobals->time + RANDOM_FLOAT( 2.0f, 15.0f ); Vector startPos = pev->origin; - startPos.z += 180; + startPos.z += 180.0f; - EMIT_SOUND_DYN( edict(), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pSackSounds ), 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); + EMIT_SOUND_DYN( edict(), CHAN_WEAPON, RANDOM_SOUND_ARRAY( pSackSounds ), 1.0f, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); CBMortar *pBomb = CBMortar::Shoot( edict(), startPos, pev->movedir ); - pBomb->pev->gravity = 1.0; - MortarSpray( startPos, Vector( 0, 0, 1 ), gSpitSprite, 24 ); + pBomb->pev->gravity = 1.0f; + MortarSpray( startPos, Vector( 0.0f, 0.0f, 1.0f ), gSpitSprite, 24 ); } //========================================================= @@ -633,14 +634,14 @@ void CBigMomma::Spawn() Precache(); SET_MODEL( ENT( pev ), "models/big_mom.mdl" ); - UTIL_SetSize( pev, Vector( -32, -32, 0 ), Vector( 32, 32, 64 ) ); + UTIL_SetSize( pev, Vector( -32.0f, -32.0f, 0.0f ), Vector( 32.0f, 32.0f, 64.0f ) ); pev->solid = SOLID_SLIDEBOX; pev->movetype = MOVETYPE_STEP; m_bloodColor = BLOOD_COLOR_GREEN; - pev->health = 150 * gSkillData.bigmommaHealthFactor; - pev->view_ofs = Vector( 0, 0, 128 );// position of the eyes relative to monster's origin. - m_flFieldOfView = 0.3;// indicates the width of this monster's forward view cone ( as a dotproduct result ) + pev->health = 150.0f * gSkillData.bigmommaHealthFactor; + pev->view_ofs = Vector( 0.0f, 0.0f, 128.0f );// position of the eyes relative to monster's origin. + m_flFieldOfView = 0.3f;// indicates the width of this monster's forward view cone ( as a dotproduct result ) m_MonsterState = MONSTERSTATE_NONE; MonsterInit(); @@ -732,7 +733,7 @@ void CBigMomma::NodeReach( void ) // Slash BOOL CBigMomma::CheckMeleeAttack1( float flDot, float flDist ) { - if( flDot >= 0.7 ) + if( flDot >= 0.7f ) { if( flDist <= BIG_ATTACKDIST ) return TRUE; @@ -756,8 +757,8 @@ BOOL CBigMomma::CheckRangeAttack1( float flDot, float flDist ) if( pEnemy ) { Vector startPos = pev->origin; - startPos.z += 180; - pev->movedir = VecCheckSplatToss( pev, startPos, pEnemy->BodyTarget( pev->origin ), RANDOM_FLOAT( 150, 500 ) ); + startPos.z += 180.0f; + pev->movedir = VecCheckSplatToss( pev, startPos, pEnemy->BodyTarget( pev->origin ), RANDOM_FLOAT( 150.0f, 500.0f ) ); if( pev->movedir != g_vecZero ) return TRUE; } @@ -893,7 +894,7 @@ void CBigMomma::StartTask( Task_t *pTask ) case TASK_NODE_DELAY: m_nodeTime = gpGlobals->time + pTask->flData; TaskComplete(); - ALERT( at_aiconsole, "BM: FAIL! Delay %.2f\n", pTask->flData ); + ALERT( at_aiconsole, "BM: FAIL! Delay %.2f\n", (double)pTask->flData ); break; case TASK_PROCESS_NODE: ALERT( at_aiconsole, "BM: Reached node %s\n", STRING( pev->netname ) ); @@ -934,7 +935,7 @@ void CBigMomma::StartTask( Task_t *pTask ) if( m_hTargetEnt->pev->spawnflags & SF_INFOBM_WAIT ) ALERT( at_aiconsole, "BM: Wait at node %s forever\n", STRING( pev->netname ) ); else - ALERT( at_aiconsole, "BM: Wait at node %s for %.2f\n", STRING( pev->netname ), GetNodeDelay() ); + ALERT( at_aiconsole, "BM: Wait at node %s for %.2f\n", STRING( pev->netname ), (double)GetNodeDelay() ); break; @@ -1034,12 +1035,12 @@ Vector VecCheckSplatToss( entvars_t *pev, const Vector &vecSpot1, Vector vecSpot float flGravity = g_psv_gravity->value; // calculate the midpoint and apex of the 'triangle' - vecMidPoint = vecSpot1 + ( vecSpot2 - vecSpot1 ) * 0.5; - UTIL_TraceLine( vecMidPoint, vecMidPoint + Vector( 0, 0, maxHeight ), ignore_monsters, ENT( pev ), &tr ); + vecMidPoint = vecSpot1 + ( vecSpot2 - vecSpot1 ) * 0.5f; + UTIL_TraceLine( vecMidPoint, vecMidPoint + Vector( 0.0f, 0.0f, maxHeight ), ignore_monsters, ENT( pev ), &tr ); vecApex = tr.vecEndPos; UTIL_TraceLine( vecSpot1, vecApex, dont_ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { // fail! return g_vecZero; @@ -1048,17 +1049,17 @@ Vector VecCheckSplatToss( entvars_t *pev, const Vector &vecSpot1, Vector vecSpot // Don't worry about actually hitting the target, this won't hurt us! // How high should the grenade travel (subtract 15 so the grenade doesn't hit the ceiling)? - float height = vecApex.z - vecSpot1.z - 15; + float height = vecApex.z - vecSpot1.z - 15.0f; // How fast does the grenade need to travel to reach that height given gravity? - float speed = sqrt( 2 * flGravity * height ); + float speed = sqrt( 2.0f * flGravity * height ); // How much time does it take to get there? float time = speed / flGravity; vecGrenadeVel = vecSpot2 - vecSpot1; - vecGrenadeVel.z = 0; + vecGrenadeVel.z = 0.0f; // Travel half the distance to the target in that time (apex is at the midpoint) - vecGrenadeVel = vecGrenadeVel * ( 0.5 / time ); + vecGrenadeVel = vecGrenadeVel * ( 0.5f / time ); // Speed to offset gravity at the desired height vecGrenadeVel.z = speed; @@ -1099,26 +1100,26 @@ void CBMortar::Spawn( void ) SET_MODEL( ENT( pev ), "sprites/mommaspit.spr" ); pev->frame = 0; - pev->scale = 0.5; + pev->scale = 0.5f; UTIL_SetSize( pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) ); m_maxFrame = (float) MODEL_FRAMES( pev->modelindex ) - 1; - pev->dmgtime = gpGlobals->time + 0.4; + pev->dmgtime = gpGlobals->time + 0.4f; } void CBMortar::Animate( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( gpGlobals->time > pev->dmgtime ) { - pev->dmgtime = gpGlobals->time + 0.2; + pev->dmgtime = gpGlobals->time + 0.2f; MortarSpray( pev->origin, -pev->velocity.Normalize(), gSpitSprite, 3 ); } if( pev->frame++ ) { - if ( pev->frame > m_maxFrame ) + if( pev->frame > m_maxFrame ) { pev->frame = 0; } @@ -1133,9 +1134,9 @@ CBMortar *CBMortar::Shoot( edict_t *pOwner, Vector vecStart, Vector vecVelocity UTIL_SetOrigin( pSpit->pev, vecStart ); pSpit->pev->velocity = vecVelocity; pSpit->pev->owner = pOwner; - pSpit->pev->scale = 2.5; + pSpit->pev->scale = 2.5f; pSpit->SetThink( &CBMortar::Animate ); - pSpit->pev->nextthink = gpGlobals->time + 0.1; + pSpit->pev->nextthink = gpGlobals->time + 0.1f; return pSpit; } @@ -1164,13 +1165,13 @@ void CBMortar::Touch( CBaseEntity *pOther ) { // make a splat on the wall - UTIL_TraceLine( pev->origin, pev->origin + pev->velocity * 10, dont_ignore_monsters, ENT( pev ), &tr ); + UTIL_TraceLine( pev->origin, pev->origin + pev->velocity * 10.0f, dont_ignore_monsters, ENT( pev ), &tr ); UTIL_DecalTrace( &tr, DECAL_MOMMASPLAT ); } else { tr.vecEndPos = pev->origin; - tr.vecPlaneNormal = -1 * pev->velocity.Normalize(); + tr.vecPlaneNormal = -1.0f * pev->velocity.Normalize(); } // make some flecks diff --git a/dlls/bmodels.cpp b/dlls/bmodels.cpp index fe56b6ac..a8b8f00f 100644 --- a/dlls/bmodels.cpp +++ b/dlls/bmodels.cpp @@ -42,7 +42,7 @@ extern DLL_GLOBAL Vector g_vecAttackDir; // Vector VecBModelOrigin( entvars_t* pevBModel ) { - return pevBModel->absmin + ( pevBModel->size * 0.5 ); + return pevBModel->absmin + ( pevBModel->size * 0.5f ); } // =================== FUNC_WALL ============================================== @@ -162,8 +162,8 @@ void CFuncConveyor::Spawn( void ) pev->skin = 0; // Don't want the engine thinking we've got special contents on this brush } - if( pev->speed == 0 ) - pev->speed = 100; + if( pev->speed == 0.0f ) + pev->speed = 100.0f; UpdateSpeed( pev->speed ); } @@ -172,7 +172,7 @@ void CFuncConveyor::Spawn( void ) void CFuncConveyor::UpdateSpeed( float speed ) { // Encode it as an integer with 4 fractional bits - int speedCode = (int)( fabs( speed ) * 16.0 ); + int speedCode = (int)( fabs( speed ) * 16.0f ); if( speed < 0 ) pev->rendercolor.x = 1; @@ -303,17 +303,17 @@ void CFuncRotating::KeyValue( KeyValueData* pkvd ) { if( FStrEq( pkvd->szKeyName, "fanfriction" ) ) { - m_flFanFriction = atof( pkvd->szValue ) / 100; + m_flFanFriction = atof( pkvd->szValue ) * 0.01f; pkvd->fHandled = TRUE; } else if( FStrEq( pkvd->szKeyName, "Volume" ) ) { - m_flVolume = atof( pkvd->szValue ) / 10.0; + m_flVolume = atof( pkvd->szValue ) * 0.1f; - if( m_flVolume > 1.0 ) - m_flVolume = 1.0; - if( m_flVolume < 0.0 ) - m_flVolume = 0.0; + if( m_flVolume > 1.0f ) + m_flVolume = 1.0f; + if( m_flVolume < 0.0f ) + m_flVolume = 0.0f; pkvd->fHandled = TRUE; } else if( FStrEq( pkvd->szKeyName, "spawnorigin" ) ) @@ -352,8 +352,8 @@ void CFuncRotating::Spawn() m_pitch = PITCH_NORM - 1; // maintain compatibility with previous maps - if( m_flVolume == 0.0 ) - m_flVolume = 1.0; + if( m_flVolume == 0.0f ) + m_flVolume = 1.0f; // if the designer didn't set a sound attenuation, default to one. m_flAttenuation = ATTN_NORM; @@ -372,21 +372,21 @@ void CFuncRotating::Spawn() } // prevent divide by zero if level designer forgets friction! - if( m_flFanFriction == 0 ) + if( m_flFanFriction == 0.0f ) { - m_flFanFriction = 1; + m_flFanFriction = 1.0f; } if( FBitSet( pev->spawnflags, SF_BRUSH_ROTATE_Z_AXIS ) ) - pev->movedir = Vector( 0, 0, 1 ); + pev->movedir = Vector( 0.0f, 0.0f, 1.0f ); else if( FBitSet( pev->spawnflags, SF_BRUSH_ROTATE_X_AXIS ) ) - pev->movedir = Vector( 1, 0, 0 ); + pev->movedir = Vector( 1.0f, 0.0f, 0.0f ); else - pev->movedir = Vector( 0, 1, 0 ); // y-axis + pev->movedir = Vector( 0.0f, 1.0f, 0.0f ); // y-axis // check for reverse rotation if( FBitSet( pev->spawnflags, SF_BRUSH_ROTATE_BACKWARDS ) ) - pev->movedir = pev->movedir * -1; + pev->movedir = pev->movedir * -1.0f; // some rotating objects like fake volumetric lights will not be solid. if( FBitSet( pev->spawnflags, SF_ROTATING_NOT_SOLID ) ) @@ -406,8 +406,8 @@ void CFuncRotating::Spawn() SetUse( &CFuncRotating::RotatingUse ); // did level designer forget to assign speed? - if( pev->speed <= 0 ) - pev->speed = 0; + if( pev->speed <= 0.0f ) + pev->speed = 0.0f; // Removed this per level designers request. -- JAY // if( pev->dmg == 0 ) @@ -417,7 +417,7 @@ void CFuncRotating::Spawn() if( FBitSet( pev->spawnflags, SF_BRUSH_ROTATE_INSTANT ) ) { SetThink( &CBaseEntity::SUB_CallUseToggle ); - pev->nextthink = pev->ltime + 1.5; // leave a magic delay for client to start up + pev->nextthink = pev->ltime + 1.5f; // leave a magic delay for client to start up } // can this brush inflict pain? if( FBitSet( pev->spawnflags, SF_BRUSH_HURT ) ) @@ -434,7 +434,7 @@ void CFuncRotating::Precache( void ) BOOL NullSound = FALSE; // set up fan sounds - if( !FStringNull( pev->message ) && strlen( szSoundFile ) > 0 ) + if( !FStringNull( pev->message ) && szSoundFile[0] != '\0' ) { // if a path is set for a wave, use it } @@ -476,7 +476,7 @@ void CFuncRotating::Precache( void ) // make sure we restart the sound. 1.5 sec delay is magic number. KDB SetThink( &CFuncRotating::SpinUp ); - pev->nextthink = pev->ltime + 1.5; + pev->nextthink = pev->ltime + 1.5f; } } @@ -527,7 +527,7 @@ void CFuncRotating::RampPitchVol( int fUp ) // calc volume and pitch as % of final vol and pitch fpct = vecCur / vecFinal; //if (fUp) - // fvol = m_flVolume * (0.5 + fpct/2.0); // spinup volume ramps up from 50% max vol + // fvol = m_flVolume * (0.5f + fpct/2.0f); // spinup volume ramps up from 50% max vol //else fvol = m_flVolume * fpct; // slowdown volume ramps down to 0 @@ -549,7 +549,7 @@ void CFuncRotating::SpinUp( void ) { Vector vecAVel;//rotational velocity - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; pev->avelocity = pev->avelocity + ( pev->movedir * ( pev->speed * m_flFanFriction ) ); vecAVel = pev->avelocity;// cache entity's rotational velocity @@ -580,23 +580,23 @@ void CFuncRotating::SpinDown( void ) Vector vecAVel;//rotational velocity vec_t vecdir; - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; pev->avelocity = pev->avelocity - ( pev->movedir * ( pev->speed * m_flFanFriction ) );//spin down slower than spinup vecAVel = pev->avelocity;// cache entity's rotational velocity - if( pev->movedir.x != 0 ) + if( pev->movedir.x != 0.0f ) vecdir = pev->movedir.x; - else if( pev->movedir.y != 0 ) + else if( pev->movedir.y != 0.0f ) vecdir = pev->movedir.y; else vecdir = pev->movedir.z; // if we've met or exceeded target speed, set target speed and stop thinking // (note: must check for movedir > 0 or < 0) - if( ( ( vecdir > 0 ) && ( vecAVel.x <= 0 && vecAVel.y <= 0 && vecAVel.z <= 0 ) ) || - ( ( vecdir < 0 ) && ( vecAVel.x >= 0 && vecAVel.y >= 0 && vecAVel.z >= 0 ) ) ) + if( ( ( vecdir > 0.0f ) && ( vecAVel.x <= 0.0f && vecAVel.y <= 0.0f && vecAVel.z <= 0.0f ) ) || + ( ( vecdir < 0.0f ) && ( vecAVel.x >= 0.0f && vecAVel.y >= 0.0f && vecAVel.z >= 0.0f ) ) ) { pev->avelocity = g_vecZero;// set speed in case we overshot @@ -615,7 +615,7 @@ void CFuncRotating::SpinDown( void ) void CFuncRotating::Rotate( void ) { - pev->nextthink = pev->ltime + 10; + pev->nextthink = pev->ltime + 10.0f; } //========================================================= @@ -633,15 +633,15 @@ void CFuncRotating::RotatingUse( CBaseEntity *pActivator, CBaseEntity *pCaller, //EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, STRING( pev->noiseStop ), // m_flVolume, m_flAttenuation, 0, m_pitch ); - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; } else// fan is not moving, so start it { SetThink( &CFuncRotating::SpinUp ); EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, STRING( pev->noiseRunning ), - 0.01, m_flAttenuation, 0, FANPITCHMIN ); + 0.01f, m_flAttenuation, 0, FANPITCHMIN ); - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; } } else if( !FBitSet( pev->spawnflags, SF_BRUSH_ACCDCC ) )//this is a normal start/stop brush. @@ -654,7 +654,7 @@ void CFuncRotating::RotatingUse( CBaseEntity *pActivator, CBaseEntity *pCaller, // EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, STRING( pev->noiseStop ), // m_flVolume, m_flAttenuation, 0, m_pitch ); - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; // pev->avelocity = g_vecZero; } else @@ -729,7 +729,7 @@ void CPendulum::KeyValue( KeyValueData *pkvd ) } else if( FStrEq( pkvd->szKeyName, "damp" ) ) { - m_damp = atof( pkvd->szValue ) * 0.001; + m_damp = atof( pkvd->szValue ) * 0.001f; pkvd->fHandled = TRUE; } else @@ -752,18 +752,18 @@ void CPendulum::Spawn( void ) if( m_distance == 0 ) return; - if( pev->speed == 0 ) - pev->speed = 100; + if( pev->speed == 0.0f ) + pev->speed = 100.0f; - m_accel = ( pev->speed * pev->speed ) / ( 2 * fabs( m_distance ) ); // Calculate constant acceleration from speed and distance + m_accel = ( pev->speed * pev->speed ) / ( 2.0f * fabs( m_distance ) ); // Calculate constant acceleration from speed and distance m_maxSpeed = pev->speed; m_start = pev->angles; - m_center = pev->angles + ( m_distance * 0.5 ) * pev->movedir; + m_center = pev->angles + ( m_distance * 0.5f ) * pev->movedir; if( FBitSet( pev->spawnflags, SF_BRUSH_ROTATE_INSTANT ) ) { SetThink( &CBaseEntity::SUB_CallUseToggle ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } pev->speed = 0; SetUse( &CPendulum::PendulumUse ); @@ -790,14 +790,14 @@ void CPendulum::PendulumUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_ } else { - pev->speed = 0; // Dead stop + pev->speed = 0.0f; // Dead stop SetThink( NULL ); pev->avelocity = g_vecZero; } } else { - pev->nextthink = pev->ltime + 0.1; // Start the pendulum moving + pev->nextthink = pev->ltime + 0.1f; // Start the pendulum moving m_time = gpGlobals->time; // Save time to calculate dt SetThink( &CPendulum::Swing ); m_dampSpeed = m_maxSpeed; @@ -807,7 +807,7 @@ void CPendulum::PendulumUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_ void CPendulum::Stop( void ) { pev->angles = m_start; - pev->speed = 0; + pev->speed = 0.0f; SetThink( NULL ); pev->avelocity = g_vecZero; } @@ -825,7 +825,7 @@ void CPendulum::Swing( void ) dt = gpGlobals->time - m_time; // How much time has passed? m_time = gpGlobals->time; // Remember the last time called - if( delta > 0 && m_accel > 0 ) + if( delta > 0.0f && m_accel > 0.0f ) pev->speed -= m_accel * dt; // Integrate velocity else pev->speed += m_accel * dt; @@ -838,12 +838,12 @@ void CPendulum::Swing( void ) pev->avelocity = pev->speed * pev->movedir; // Call this again - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; if( m_damp ) { m_dampSpeed -= m_damp * m_dampSpeed * dt; - if( m_dampSpeed < 30.0 ) + if( m_dampSpeed < 30.0f ) { pev->angles = m_center; pev->speed = 0; @@ -869,7 +869,7 @@ void CPendulum::Touch( CBaseEntity *pOther ) return; // calculate damage based on rotation speed - float damage = pev->dmg * pev->speed * 0.01; + float damage = pev->dmg * pev->speed * 0.01f; if( damage < 0 ) damage = -damage; diff --git a/dlls/bullsquid.cpp b/dlls/bullsquid.cpp index 8db94c25..01c9e590 100644 --- a/dlls/bullsquid.cpp +++ b/dlls/bullsquid.cpp @@ -27,7 +27,7 @@ #include "soundent.h" #include "game.h" -#define SQUID_SPRINT_DIST 256 // how close the squid has to get before starting to sprint and refusing to swerve +#define SQUID_SPRINT_DIST 256.0f // how close the squid has to get before starting to sprint and refusing to swerve int iSquidSpitSprite; @@ -91,7 +91,7 @@ void CSquidSpit::Spawn( void ) SET_MODEL( ENT( pev ), "sprites/bigspit.spr" ); pev->frame = 0; - pev->scale = 0.5; + pev->scale = 0.5f; UTIL_SetSize( pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) ); @@ -100,7 +100,7 @@ void CSquidSpit::Spawn( void ) void CSquidSpit::Animate( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( pev->frame++ ) { @@ -121,7 +121,7 @@ void CSquidSpit::Shoot( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity pSpit->pev->owner = ENT( pevOwner ); pSpit->SetThink( &CSquidSpit::Animate ); - pSpit->pev->nextthink = gpGlobals->time + 0.1; + pSpit->pev->nextthink = gpGlobals->time + 0.1f; } void CSquidSpit::Touch( CBaseEntity *pOther ) @@ -130,7 +130,7 @@ void CSquidSpit::Touch( CBaseEntity *pOther ) int iPitch; // splat sound - iPitch = RANDOM_FLOAT( 90, 110 ); + iPitch = RANDOM_FLOAT( 90.0f, 110.0f ); EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "bullchicken/bc_acid1.wav", 1, ATTN_NORM, 0, iPitch ); @@ -242,7 +242,7 @@ int CBullsquid::IgnoreConditions( void ) { int iIgnore = CBaseMonster::IgnoreConditions(); - if( gpGlobals->time - m_flLastHurtTime <= 20 ) + if( gpGlobals->time - m_flLastHurtTime <= 20.0f ) { // haven't been hurt in 20 seconds, so let the squid care about stink. iIgnore = bits_COND_SMELL | bits_COND_SMELL_FOOD; @@ -266,7 +266,7 @@ int CBullsquid::IgnoreConditions( void ) //========================================================= int CBullsquid::IRelationship( CBaseEntity *pTarget ) { - if( gpGlobals->time - m_flLastHurtTime < 5 && FClassnameIs( pTarget->pev, "monster_headcrab" ) ) + if( gpGlobals->time - m_flLastHurtTime < 5.0f && FClassnameIs( pTarget->pev, "monster_headcrab" ) ) { // if squid has been hurt in the last 5 seconds, and is getting relationship for a headcrab, // tell squid to disregard crab. @@ -287,7 +287,7 @@ int CBullsquid::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, flo // if the squid is running, has an enemy, was hurt by the enemy, hasn't been hurt in the last 3 seconds, and isn't too close to the enemy, // it will swerve. (whew). - if( m_hEnemy != 0 && IsMoving() && pevAttacker == m_hEnemy->pev && gpGlobals->time - m_flLastHurtTime > 3 ) + if( m_hEnemy != 0 && IsMoving() && pevAttacker == m_hEnemy->pev && gpGlobals->time - m_flLastHurtTime > 3.0f ) { flDist = ( pev->origin - m_hEnemy->pev->origin ).Length2D(); @@ -295,7 +295,7 @@ int CBullsquid::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, flo { flDist = ( pev->origin - m_Route[m_iRouteIndex].vecLocation ).Length2D();// reusing flDist. - if( FTriangulate( pev->origin, m_Route[m_iRouteIndex].vecLocation, flDist * 0.5, m_hEnemy, &vecApex ) ) + if( FTriangulate( pev->origin, m_Route[m_iRouteIndex].vecLocation, flDist * 0.5f, m_hEnemy, &vecApex ) ) { InsertWaypoint( vecApex, bits_MF_TO_DETOUR | bits_MF_DONT_SIMPLIFY ); } @@ -316,17 +316,17 @@ int CBullsquid::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, flo //========================================================= BOOL CBullsquid::CheckRangeAttack1( float flDot, float flDist ) { - if( IsMoving() && flDist >= 512 ) + if( IsMoving() && flDist >= 512.0f ) { // squid will far too far behind if he stops running to spit at this distance from the enemy. return FALSE; } - if( flDist > 64 && flDist <= 784 && flDot >= 0.5 && gpGlobals->time >= m_flNextSpitTime ) + if( flDist > 64.0f && flDist <= 784.0f && flDot >= 0.5f && gpGlobals->time >= m_flNextSpitTime ) { if( m_hEnemy != 0 ) { - if( fabs( pev->origin.z - m_hEnemy->pev->origin.z ) > 256 ) + if( fabs( pev->origin.z - m_hEnemy->pev->origin.z ) > 256.0f ) { // don't try to spit at someone up really high or down really low. return FALSE; @@ -336,12 +336,12 @@ BOOL CBullsquid::CheckRangeAttack1( float flDot, float flDist ) if( IsMoving() ) { // don't spit again for a long time, resume chasing enemy. - m_flNextSpitTime = gpGlobals->time + 5; + m_flNextSpitTime = gpGlobals->time + 5.0f; } else { // not moving, so spit again pretty soon. - m_flNextSpitTime = gpGlobals->time + 0.5; + m_flNextSpitTime = gpGlobals->time + 0.5f; } return TRUE; @@ -356,7 +356,7 @@ BOOL CBullsquid::CheckRangeAttack1( float flDot, float flDist ) //========================================================= BOOL CBullsquid::CheckMeleeAttack1( float flDot, float flDist ) { - if( m_hEnemy->pev->health <= gSkillData.bullsquidDmgWhip && flDist <= 85 && flDot >= 0.7 ) + if( m_hEnemy->pev->health <= gSkillData.bullsquidDmgWhip && flDist <= 85.0f && flDot >= 0.7f ) { return TRUE; } @@ -371,7 +371,7 @@ BOOL CBullsquid::CheckMeleeAttack1( float flDot, float flDist ) //========================================================= BOOL CBullsquid::CheckMeleeAttack2( float flDot, float flDist ) { - if( flDist <= 85 && flDot >= 0.7 && !HasConditions( bits_COND_CAN_MELEE_ATTACK1 ) ) // The player & bullsquid can be as much as their bboxes + if( flDist <= 85.0f && flDot >= 0.7f && !HasConditions( bits_COND_CAN_MELEE_ATTACK1 ) ) // The player & bullsquid can be as much as their bboxes { // apart (48 * sqrt(3)) and he can still attack (85 is a little more than 48*sqrt(3)) return TRUE; } @@ -504,7 +504,7 @@ void CBullsquid::SetYawSpeed( void ) ys = 0; - switch ( m_Activity ) + switch( m_Activity ) { case ACT_WALK: ys = 90; @@ -543,13 +543,13 @@ void CBullsquid::HandleAnimEvent( MonsterEvent_t *pEvent ) // !!!HACKHACK - the spot at which the spit originates (in front of the mouth) was measured in 3ds and hardcoded here. // we should be able to read the position of bones at runtime for this info. - vecSpitOffset = ( gpGlobals->v_right * 8 + gpGlobals->v_forward * 37 + gpGlobals->v_up * 23 ); + vecSpitOffset = ( gpGlobals->v_right * 8.0f + gpGlobals->v_forward * 37.0f + gpGlobals->v_up * 23.0f ); vecSpitOffset = ( pev->origin + vecSpitOffset ); vecSpitDir = ( ( m_hEnemy->pev->origin + m_hEnemy->pev->view_ofs ) - vecSpitOffset ).Normalize(); - vecSpitDir.x += RANDOM_FLOAT( -0.05, 0.05 ); - vecSpitDir.y += RANDOM_FLOAT( -0.05, 0.05 ); - vecSpitDir.z += RANDOM_FLOAT( -0.05, 0 ); + vecSpitDir.x += RANDOM_FLOAT( -0.05f, 0.05f ); + vecSpitDir.y += RANDOM_FLOAT( -0.05f, 0.05f ); + vecSpitDir.z += RANDOM_FLOAT( -0.05f, 0.0f ); // do stuff for this event. AttackSound(); @@ -569,7 +569,7 @@ void CBullsquid::HandleAnimEvent( MonsterEvent_t *pEvent ) WRITE_BYTE( 25 ); // noise ( client will divide by 100 ) MESSAGE_END(); - CSquidSpit::Shoot( pev, vecSpitOffset, vecSpitDir * 900 ); + CSquidSpit::Shoot( pev, vecSpitOffset, vecSpitDir * 900.0f ); } break; case BSQUID_AE_BITE: @@ -579,10 +579,10 @@ void CBullsquid::HandleAnimEvent( MonsterEvent_t *pEvent ) if( pHurt ) { - //pHurt->pev->punchangle.z = -15; - //pHurt->pev->punchangle.x = -45; - pHurt->pev->velocity = pHurt->pev->velocity - gpGlobals->v_forward * 100; - pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_up * 100; + //pHurt->pev->punchangle.z = -15.0f; + //pHurt->pev->punchangle.x = -45.0f; + pHurt->pev->velocity = pHurt->pev->velocity - gpGlobals->v_forward * 100.0f; + pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_up * 100.0f; } } break; @@ -592,10 +592,10 @@ void CBullsquid::HandleAnimEvent( MonsterEvent_t *pEvent ) if( pHurt ) { - pHurt->pev->punchangle.z = -20; - pHurt->pev->punchangle.x = 20; - pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_right * 200; - pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_up * 100; + pHurt->pev->punchangle.z = -20.0f; + pHurt->pev->punchangle.x = 20.0f; + pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_right * 200.0f; + pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_up * 100.0f; } } break; @@ -616,8 +616,8 @@ void CBullsquid::HandleAnimEvent( MonsterEvent_t *pEvent ) } // jump into air for 0.8 (24/30) seconds - //pev->velocity.z += ( 0.875 * flGravity ) * 0.5; - pev->velocity.z += ( 0.625 * flGravity ) * 0.5; + //pev->velocity.z += ( 0.875f * flGravity ) * 0.5f; + pev->velocity.z += ( 0.625f * flGravity ) * 0.5f; } break; case BSQUID_AE_THROW: @@ -630,14 +630,14 @@ void CBullsquid::HandleAnimEvent( MonsterEvent_t *pEvent ) if( pHurt ) { // croonchy bite sound - iPitch = RANDOM_FLOAT( 90, 110 ); + iPitch = RANDOM_FLOAT( 90.0f, 110.0f ); switch( RANDOM_LONG( 0, 1 ) ) { case 0: - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, "bullchicken/bc_bite2.wav", 1, ATTN_NORM, 0, iPitch ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, "bullchicken/bc_bite2.wav", 1.0f, ATTN_NORM, 0, iPitch ); break; case 1: - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, "bullchicken/bc_bite3.wav", 1, ATTN_NORM, 0, iPitch ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, "bullchicken/bc_bite3.wav", 1.0f, ATTN_NORM, 0, iPitch ); break; } @@ -646,12 +646,12 @@ void CBullsquid::HandleAnimEvent( MonsterEvent_t *pEvent ) //pHurt->pev->punchangle.y = RANDOM_LONG( 0, 89 ) - 45; // screeshake transforms the viewmodel as well as the viewangle. No problems with seeing the ends of the viewmodels. - UTIL_ScreenShake( pHurt->pev->origin, 25.0, 1.5, 0.7, 2 ); + UTIL_ScreenShake( pHurt->pev->origin, 25.0f, 1.5f, 0.7f, 2.0f ); if( pHurt->IsPlayer() ) { UTIL_MakeVectors( pev->angles ); - pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_forward * 300 + gpGlobals->v_up * 300; + pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_forward * 300.0f + gpGlobals->v_up * 300.0f; } } } @@ -669,14 +669,14 @@ void CBullsquid::Spawn() Precache(); SET_MODEL( ENT( pev ), "models/bullsquid.mdl" ); - UTIL_SetSize( pev, Vector( -32, -32, 0 ), Vector( 32, 32, 64 ) ); + UTIL_SetSize( pev, Vector( -32.0f, -32.0f, 0.0f ), Vector( 32.0f, 32.0f, 64.0f ) ); pev->solid = SOLID_SLIDEBOX; pev->movetype = MOVETYPE_STEP; m_bloodColor = BLOOD_COLOR_GREEN; pev->effects = 0; pev->health = gSkillData.bullsquidHealth; - m_flFieldOfView = 0.2;// indicates the width of this monster's forward view cone ( as a dotproduct result ) + m_flFieldOfView = 0.2f;// indicates the width of this monster's forward view cone ( as a dotproduct result ) m_MonsterState = MONSTERSTATE_NONE; m_fCanThreatDisplay = TRUE; @@ -789,7 +789,7 @@ void CBullsquid::RunAI( void ) // chasing enemy. Sprint for last bit if( ( pev->origin - m_hEnemy->pev->origin).Length2D() < SQUID_SPRINT_DIST ) { - pev->framerate = 1.25; + pev->framerate = 1.25f; } } } @@ -802,8 +802,8 @@ void CBullsquid::RunAI( void ) Task_t tlSquidRangeAttack1[] = { { TASK_STOP_MOVING, 0 }, - { TASK_FACE_IDEAL, (float)0 }, - { TASK_RANGE_ATTACK1, (float)0 }, + { TASK_FACE_IDEAL, 0.0f }, + { TASK_RANGE_ATTACK1, 0.0f }, { TASK_SET_ACTIVITY, (float)ACT_IDLE }, }; @@ -826,9 +826,9 @@ Schedule_t slSquidRangeAttack1[] = Task_t tlSquidChaseEnemy1[] = { { TASK_SET_FAIL_SCHEDULE, (float)SCHED_RANGE_ATTACK1 },// !!!OEM - this will stop nasty squid oscillation. - { TASK_GET_PATH_TO_ENEMY, (float)0 }, - { TASK_RUN_PATH, (float)0 }, - { TASK_WAIT_FOR_MOVEMENT, (float)0 }, + { TASK_GET_PATH_TO_ENEMY, 0.0f }, + { TASK_RUN_PATH, 0.0f }, + { TASK_WAIT_FOR_MOVEMENT, 0.0f }, }; Schedule_t slSquidChaseEnemy[] = @@ -852,10 +852,10 @@ Schedule_t slSquidChaseEnemy[] = Task_t tlSquidHurtHop[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_SOUND_WAKE, (float)0 }, - { TASK_SQUID_HOPTURN, (float)0 }, - { TASK_FACE_ENEMY, (float)0 },// in case squid didn't turn all the way in the air. + { TASK_STOP_MOVING, 0.0f }, + { TASK_SOUND_WAKE, 0.0f }, + { TASK_SQUID_HOPTURN, 0.0f }, + { TASK_FACE_ENEMY, 0.0f },// in case squid didn't turn all the way in the air. }; Schedule_t slSquidHurtHop[] = @@ -871,10 +871,10 @@ Schedule_t slSquidHurtHop[] = Task_t tlSquidSeeCrab[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_SOUND_WAKE, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_SOUND_WAKE, 0.0f }, { TASK_PLAY_SEQUENCE, (float)ACT_EXCITED }, - { TASK_FACE_ENEMY, (float)0 }, + { TASK_FACE_ENEMY, 0.0f }, }; Schedule_t slSquidSeeCrab[] = @@ -892,20 +892,20 @@ Schedule_t slSquidSeeCrab[] = // squid walks to something tasty and eats it. Task_t tlSquidEat[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_EAT, (float)10 },// this is in case the squid can't get to the food - { TASK_STORE_LASTPOSITION, (float)0 }, - { TASK_GET_PATH_TO_BESTSCENT, (float)0 }, - { TASK_WALK_PATH, (float)0 }, - { TASK_WAIT_FOR_MOVEMENT, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_EAT, 10.0f },// this is in case the squid can't get to the food + { TASK_STORE_LASTPOSITION, 0.0f }, + { TASK_GET_PATH_TO_BESTSCENT, 0.0f }, + { TASK_WALK_PATH, 0.0f }, + { TASK_WAIT_FOR_MOVEMENT, 0.0f }, { TASK_PLAY_SEQUENCE, (float)ACT_EAT }, { TASK_PLAY_SEQUENCE, (float)ACT_EAT }, { TASK_PLAY_SEQUENCE, (float)ACT_EAT }, - { TASK_EAT, (float)50 }, - { TASK_GET_PATH_TO_LASTPOSITION, (float)0 }, - { TASK_WALK_PATH, (float)0 }, - { TASK_WAIT_FOR_MOVEMENT, (float)0 }, - { TASK_CLEAR_LASTPOSITION, (float)0 }, + { TASK_EAT, 50.0f }, + { TASK_GET_PATH_TO_LASTPOSITION, 0.0f }, + { TASK_WALK_PATH, 0.0f }, + { TASK_WAIT_FOR_MOVEMENT, 0.0f }, + { TASK_CLEAR_LASTPOSITION, 0.0f }, }; Schedule_t slSquidEat[] = @@ -928,21 +928,21 @@ Schedule_t slSquidEat[] = // the squid. This schedule plays a sniff animation before going to the source of food. Task_t tlSquidSniffAndEat[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_EAT, (float)10 },// this is in case the squid can't get to the food + { TASK_STOP_MOVING, 0.0f }, + { TASK_EAT, 10.0f },// this is in case the squid can't get to the food { TASK_PLAY_SEQUENCE, (float)ACT_DETECT_SCENT }, - { TASK_STORE_LASTPOSITION, (float)0 }, - { TASK_GET_PATH_TO_BESTSCENT, (float)0 }, - { TASK_WALK_PATH, (float)0 }, - { TASK_WAIT_FOR_MOVEMENT, (float)0 }, + { TASK_STORE_LASTPOSITION, 0.0f }, + { TASK_GET_PATH_TO_BESTSCENT, 0.0f }, + { TASK_WALK_PATH, 0.0f }, + { TASK_WAIT_FOR_MOVEMENT, 0.0f }, { TASK_PLAY_SEQUENCE, (float)ACT_EAT }, { TASK_PLAY_SEQUENCE, (float)ACT_EAT }, { TASK_PLAY_SEQUENCE, (float)ACT_EAT }, - { TASK_EAT, (float)50 }, - { TASK_GET_PATH_TO_LASTPOSITION, (float)0 }, - { TASK_WALK_PATH, (float)0 }, - { TASK_WAIT_FOR_MOVEMENT, (float)0 }, - { TASK_CLEAR_LASTPOSITION, (float)0 }, + { TASK_EAT, 50.0f }, + { TASK_GET_PATH_TO_LASTPOSITION, 0.0f }, + { TASK_WALK_PATH, 0.0f }, + { TASK_WAIT_FOR_MOVEMENT, 0.0f }, + { TASK_CLEAR_LASTPOSITION, 0.0f }, }; Schedule_t slSquidSniffAndEat[] = @@ -964,18 +964,18 @@ Schedule_t slSquidSniffAndEat[] = // squid does this to stinky things. Task_t tlSquidWallow[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_EAT, (float)10 },// this is in case the squid can't get to the stinkiness - { TASK_STORE_LASTPOSITION, (float)0 }, - { TASK_GET_PATH_TO_BESTSCENT, (float)0 }, - { TASK_WALK_PATH, (float)0 }, - { TASK_WAIT_FOR_MOVEMENT, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_EAT, 10.0f },// this is in case the squid can't get to the stinkiness + { TASK_STORE_LASTPOSITION, 0.0f }, + { TASK_GET_PATH_TO_BESTSCENT, 0.0f }, + { TASK_WALK_PATH, 0.0f }, + { TASK_WAIT_FOR_MOVEMENT, 0.0f }, { TASK_PLAY_SEQUENCE, (float)ACT_INSPECT_FLOOR }, - { TASK_EAT, (float)50 },// keeps squid from eating or sniffing anything else for a while. - { TASK_GET_PATH_TO_LASTPOSITION, (float)0 }, - { TASK_WALK_PATH, (float)0 }, - { TASK_WAIT_FOR_MOVEMENT, (float)0 }, - { TASK_CLEAR_LASTPOSITION, (float)0 }, + { TASK_EAT, 50.0f },// keeps squid from eating or sniffing anything else for a while. + { TASK_GET_PATH_TO_LASTPOSITION, 0.0f }, + { TASK_WALK_PATH, 0.0f }, + { TASK_WAIT_FOR_MOVEMENT, 0.0f }, + { TASK_CLEAR_LASTPOSITION, 0.0f }, }; Schedule_t slSquidWallow[] = diff --git a/dlls/buttons.cpp b/dlls/buttons.cpp index 90bc42e5..8344c814 100644 --- a/dlls/buttons.cpp +++ b/dlls/buttons.cpp @@ -163,7 +163,7 @@ void CMultiSource::Spawn() pev->solid = SOLID_NOT; pev->movetype = MOVETYPE_NONE; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; pev->spawnflags |= SF_MULTI_INIT; // Until it's initialized SetThink( &CMultiSource::Register ); } @@ -476,7 +476,7 @@ void CBaseButton::Spawn() if( FBitSet( pev->spawnflags, SF_BUTTON_SPARK_IF_OFF ) )// this button should spark in OFF state { SetThink( &CBaseButton::ButtonSpark ); - pev->nextthink = gpGlobals->time + 0.5;// no hurry, make sure everything else spawns + pev->nextthink = gpGlobals->time + 0.5f;// no hurry, make sure everything else spawns } SetMovedir( pev ); @@ -485,29 +485,29 @@ void CBaseButton::Spawn() pev->solid = SOLID_BSP; SET_MODEL( ENT( pev ), STRING( pev->model ) ); - if( pev->speed == 0 ) - pev->speed = 40; + if( pev->speed == 0.0f ) + pev->speed = 40.0f; if( pev->health > 0 ) { pev->takedamage = DAMAGE_YES; } - if( m_flWait == 0 ) - m_flWait = 1; - if( m_flLip == 0 ) - m_flLip = 4; + if( m_flWait == 0.0f ) + m_flWait = 1.0f; + if( m_flLip == 0.0f ) + m_flLip = 4.0f; m_toggle_state = TS_AT_BOTTOM; m_vecPosition1 = pev->origin; // Subtract 2 from size because the engine expands bboxes by 1 in all directions making the size too big - m_vecPosition2 = m_vecPosition1 + ( pev->movedir * ( fabs( pev->movedir.x * ( pev->size.x - 2 ) ) + fabs( pev->movedir.y * ( pev->size.y - 2 ) ) + fabs( pev->movedir.z * ( pev->size.z - 2 ) ) - m_flLip ) ); + m_vecPosition2 = m_vecPosition1 + ( pev->movedir * ( fabs( pev->movedir.x * ( pev->size.x - 2.0f ) ) + fabs( pev->movedir.y * ( pev->size.y - 2.0f ) ) + fabs( pev->movedir.z * ( pev->size.z - 2.0f ) ) - m_flLip ) ); // Is this a non-moving button? - if( ( ( m_vecPosition2 - m_vecPosition1 ).Length() < 1 ) || ( pev->spawnflags & SF_BUTTON_DONTMOVE ) ) + if( ( ( m_vecPosition2 - m_vecPosition1 ).Length() < 1.0f ) || ( pev->spawnflags & SF_BUTTON_DONTMOVE ) ) m_vecPosition2 = m_vecPosition1; - m_fStayPushed = m_flWait == -1 ? TRUE : FALSE; + m_fStayPushed = m_flWait == -1.0f ? TRUE : FALSE; m_fRotating = FALSE; // if the button is flagged for USE button activation only, take away it's touch function and add a use function @@ -607,11 +607,11 @@ const char *ButtonSound( int sound ) // void DoSpark( entvars_t *pev, const Vector &location ) { - Vector tmp = location + pev->size * 0.5; + Vector tmp = location + pev->size * 0.5f; UTIL_Sparks( tmp ); - float flVolume = RANDOM_FLOAT( 0.25 , 0.75 ) * 0.4;//random volume range - switch( (int)( RANDOM_FLOAT( 0, 1 ) * 6 ) ) + float flVolume = RANDOM_FLOAT( 0.25f, 0.75f ) * 0.4f;//random volume range + switch( (int)( RANDOM_FLOAT( 0.0f, 1.0f ) * 6.0f ) ) { case 0: EMIT_SOUND( ENT( pev ), CHAN_VOICE, "buttons/spark1.wav", flVolume, ATTN_NORM ); @@ -637,7 +637,7 @@ void DoSpark( entvars_t *pev, const Vector &location ) void CBaseButton::ButtonSpark( void ) { SetThink( &CBaseButton::ButtonSpark ); - pev->nextthink = gpGlobals->time + 0.1 + RANDOM_FLOAT( 0, 1.5 );// spark again at random interval + pev->nextthink = gpGlobals->time + 0.1f + RANDOM_FLOAT( 0.0f, 1.5f );// spark again at random interval DoSpark( pev, pev->mins ); } @@ -657,7 +657,7 @@ void CBaseButton::ButtonUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_ { if( !m_fStayPushed && FBitSet( pev->spawnflags, SF_BUTTON_TOGGLE ) ) { - EMIT_SOUND( ENT( pev ), CHAN_VOICE, STRING( pev->noise ), 1, ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_VOICE, STRING( pev->noise ), 1.0f, ATTN_NORM ); //SUB_UseTargets( m_eoActivator ); ButtonReturn(); @@ -694,7 +694,7 @@ CBaseButton::BUTTON_CODE CBaseButton::ButtonResponseToTouch( void ) void CBaseButton::ButtonTouch( CBaseEntity *pOther ) { // Ignore touches by anything but players - if( !FClassnameIs( pOther->pev, "player" ) ) + if( !pOther->IsPlayer() ) return; m_hActivator = pOther; @@ -795,7 +795,7 @@ void CBaseButton::ButtonReturn( void ) { ASSERT( m_toggle_state == TS_AT_TOP ); m_toggle_state = TS_GOING_DOWN; - + SetMoveDone( &CBaseButton::ButtonBackHome ); if( !m_fRotating ) LinearMove( m_vecPosition1, pev->speed ); @@ -852,7 +852,7 @@ void CBaseButton::ButtonBackHome( void ) if( FBitSet( pev->spawnflags, SF_BUTTON_SPARK_IF_OFF ) ) { SetThink( &CBaseButton::ButtonSpark ); - pev->nextthink = gpGlobals->time + 0.5;// no hurry. + pev->nextthink = gpGlobals->time + 0.5f;// no hurry. } } @@ -883,7 +883,7 @@ void CRotButton::Spawn( void ) // check for clockwise rotation if( FBitSet( pev->spawnflags, SF_DOOR_ROTATE_BACKWARDS ) ) - pev->movedir = pev->movedir * -1; + pev->movedir = pev->movedir * -1.0f; pev->movetype = MOVETYPE_PUSH; @@ -894,8 +894,8 @@ void CRotButton::Spawn( void ) SET_MODEL( ENT( pev ), STRING( pev->model ) ); - if( pev->speed == 0 ) - pev->speed = 40; + if( pev->speed == 0.0f ) + pev->speed = 40.0f; if( m_flWait == 0 ) m_flWait = 1; @@ -910,7 +910,7 @@ void CRotButton::Spawn( void ) m_vecAngle2 = pev->angles + pev->movedir * m_flMoveDistance; ASSERTSZ( m_vecAngle1 != m_vecAngle2, "rotating button start/end positions are equal" ); - m_fStayPushed = m_flWait == -1 ? TRUE : FALSE; + m_fStayPushed = m_flWait == -1.0f ? TRUE : FALSE; m_fRotating = TRUE; // if the button is flagged for USE button activation only, take away it's touch function and add a use function @@ -984,10 +984,10 @@ void CMomentaryRotButton::Spawn( void ) { CBaseToggle::AxisDir( pev ); - if( pev->speed == 0 ) - pev->speed = 100; + if( pev->speed == 0.0f ) + pev->speed = 100.0f; - if( m_flMoveDistance < 0 ) + if( m_flMoveDistance < 0.0f ) { m_start = pev->angles + pev->movedir * m_flMoveDistance; m_end = pev->angles; @@ -1087,14 +1087,14 @@ void CMomentaryRotButton::UpdateSelf( float value ) } m_lastUsed = 1; - pev->nextthink = pev->ltime + 0.1; - if( m_direction > 0 && value >= 1.0 ) + pev->nextthink = pev->ltime + 0.1f; + if( m_direction > 0 && value >= 1.0f ) { pev->avelocity = g_vecZero; pev->angles = m_end; return; } - else if( m_direction < 0 && value <= 0 ) + else if( m_direction < 0 && value <= 0.0f ) { pev->avelocity = g_vecZero; pev->angles = m_start; @@ -1106,9 +1106,9 @@ void CMomentaryRotButton::UpdateSelf( float value ) // HACKHACK -- If we're going slow, we'll get multiple player packets per frame, bump nexthink on each one to avoid stalling if( pev->nextthink < pev->ltime ) - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; else - pev->nextthink += 0.1; + pev->nextthink += 0.1f; pev->avelocity = m_direction * pev->speed * pev->movedir; SetThink( &CMomentaryRotButton::Off ); @@ -1140,7 +1140,7 @@ void CMomentaryRotButton::Off( void ) if( FBitSet( pev->spawnflags, SF_PENDULUM_AUTO_RETURN ) && m_returnSpeed > 0 ) { SetThink( &CMomentaryRotButton::Return ); - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; m_direction = -1; } else @@ -1152,23 +1152,23 @@ void CMomentaryRotButton::Return( void ) float value = CBaseToggle::AxisDelta( pev->spawnflags, pev->angles, m_start ) / m_flMoveDistance; UpdateAllButtons( value, 0 ); // This will end up calling UpdateSelfReturn() n times, but it still works right - if( value > 0 ) + if( value > 0.0f ) UpdateTarget( value ); } void CMomentaryRotButton::UpdateSelfReturn( float value ) { - if( value <= 0 ) + if( value <= 0.0f ) { pev->avelocity = g_vecZero; pev->angles = m_start; - pev->nextthink = -1; + pev->nextthink = -1.0f; SetThink( NULL ); } else { pev->avelocity = -m_returnSpeed * pev->movedir; - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; } } @@ -1221,10 +1221,10 @@ void CEnvSpark::Spawn( void ) else SetThink( &CEnvSpark::SparkThink ); - pev->nextthink = gpGlobals->time + 0.1 + RANDOM_FLOAT( 0, 1.5 ); + pev->nextthink = gpGlobals->time + 0.1f + RANDOM_FLOAT( 0.0f, 1.5f ); - if( m_flDelay <= 0 ) - m_flDelay = 1.5; + if( m_flDelay <= 0.0f ) + m_flDelay = 1.5f; Precache(); } @@ -1259,7 +1259,7 @@ void CEnvSpark::KeyValue( KeyValueData *pkvd ) void EXPORT CEnvSpark::SparkThink( void ) { - pev->nextthink = gpGlobals->time + 0.1 + RANDOM_FLOAT( 0, m_flDelay ); + pev->nextthink = gpGlobals->time + 0.1f + RANDOM_FLOAT( 0.0f, m_flDelay ); DoSpark( pev, pev->origin ); } @@ -1267,7 +1267,7 @@ void EXPORT CEnvSpark::SparkStart( CBaseEntity *pActivator, CBaseEntity *pCaller { SetUse( &CEnvSpark::SparkStop ); SetThink( &CEnvSpark::SparkThink ); - pev->nextthink = gpGlobals->time + 0.1 + RANDOM_FLOAT( 0, m_flDelay ); + pev->nextthink = gpGlobals->time + 0.1f + RANDOM_FLOAT( 0.0f, m_flDelay ); } void EXPORT CEnvSpark::SparkStop( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) @@ -1305,7 +1305,7 @@ void CButtonTarget::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE { if( !ShouldToggle( useType, (int)pev->frame ) ) return; - pev->frame = 1-pev->frame; + pev->frame = 1 - pev->frame; if( pev->frame ) SUB_UseTargets( pActivator, USE_ON, 0 ); else diff --git a/dlls/cbase.cpp b/dlls/cbase.cpp index 8750bddf..4e6292ba 100644 --- a/dlls/cbase.cpp +++ b/dlls/cbase.cpp @@ -136,8 +136,8 @@ int DispatchSpawn( edict_t *pent ) if( pEntity ) { // Initialize these or entities who don't link to the world won't have anything in here - pEntity->pev->absmin = pEntity->pev->origin - Vector( 1, 1, 1 ); - pEntity->pev->absmax = pEntity->pev->origin + Vector( 1, 1, 1 ); + pEntity->pev->absmin = pEntity->pev->origin - Vector( 1.0f, 1.0f, 1.0f ); + pEntity->pev->absmax = pEntity->pev->origin + Vector( 1.0f, 1.0f, 1.0f ); pEntity->Spawn(); @@ -533,13 +533,13 @@ int CBaseEntity::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, fl // figure momentum add (don't let hurt brushes or other triggers move player) if( ( !FNullEnt( pevInflictor ) ) && (pev->movetype == MOVETYPE_WALK || pev->movetype == MOVETYPE_STEP ) && ( pevAttacker->solid != SOLID_TRIGGER ) ) { - Vector vecDir = pev->origin - ( pevInflictor->absmin + pevInflictor->absmax ) * 0.5; + Vector vecDir = pev->origin - ( pevInflictor->absmin + pevInflictor->absmax ) * 0.5f; vecDir = vecDir.Normalize(); - float flForce = flDamage * ( ( 32 * 32 * 72.0 ) / ( pev->size.x * pev->size.y * pev->size.z ) ) * 5; + float flForce = flDamage * ( ( 32.0f * 32.0f * 72.0f ) / ( pev->size.x * pev->size.y * pev->size.z ) ) * 5.0f; - if( flForce > 1000.0 ) - flForce = 1000.0; + if( flForce > 1000.0f ) + flForce = 1000.0f; pev->velocity = pev->velocity + vecDir * flForce; } @@ -681,7 +681,7 @@ void CBaseEntity::MakeDormant( void ) // Don't draw SetBits( pev->effects, EF_NODRAW ); // Don't think - pev->nextthink = 0; + pev->nextthink = 0.0f; // Relink UTIL_SetOrigin( pev, pev->origin ); } @@ -694,30 +694,30 @@ int CBaseEntity::IsDormant( void ) BOOL CBaseEntity::IsInWorld( void ) { // position - if( pev->origin.x >= 4096 ) + if( pev->origin.x >= 4096.0f ) return FALSE; - if( pev->origin.y >= 4096 ) + if( pev->origin.y >= 4096.0f ) return FALSE; - if( pev->origin.z >= 4096 ) + if( pev->origin.z >= 4096.0f ) return FALSE; - if( pev->origin.x <= -4096 ) + if( pev->origin.x <= -4096.0f ) return FALSE; - if( pev->origin.y <= -4096 ) + if( pev->origin.y <= -4096.0f ) return FALSE; - if( pev->origin.z <= -4096 ) + if( pev->origin.z <= -4096.0f ) return FALSE; // speed - if( pev->velocity.x >= 2000 ) + if( pev->velocity.x >= 2000.0f ) return FALSE; - if( pev->velocity.y >= 2000 ) + if( pev->velocity.y >= 2000.0f ) return FALSE; - if( pev->velocity.z >= 2000 ) + if( pev->velocity.z >= 2000.0f ) return FALSE; - if( pev->velocity.x <= -2000 ) + if( pev->velocity.x <= -2000.0f ) return FALSE; - if( pev->velocity.y <= -2000 ) + if( pev->velocity.y <= -2000.0f ) return FALSE; - if( pev->velocity.z <= -2000 ) + if( pev->velocity.z <= -2000.0f ) return FALSE; return TRUE; diff --git a/dlls/cbase.h b/dlls/cbase.h index e200d7b0..a15638ab 100644 --- a/dlls/cbase.h +++ b/dlls/cbase.h @@ -363,6 +363,7 @@ public: #define SetTouch( a ) TouchSet( static_cast (a), #a ) #define SetUse( a ) UseSet( static_cast (a), #a ) #define SetBlocked( a ) BlockedSet( static_cast (a), #a ) +#define ResetThink() SetThink(NULL) #else diff --git a/dlls/client.cpp b/dlls/client.cpp index f96302d0..cade437a 100644 --- a/dlls/client.cpp +++ b/dlls/client.cpp @@ -73,7 +73,7 @@ void set_suicide_frame( entvars_t *pev ) pev->solid = SOLID_NOT; pev->movetype = MOVETYPE_TOSS; pev->deadflag = DEAD_DEAD; - pev->nextthink = -1; + pev->nextthink = -1.0f; } @@ -170,7 +170,7 @@ void ClientKill( edict_t *pEntity ) if( pl->m_fNextSuicideTime > gpGlobals->time ) return; // prevent suiciding too ofter - pl->m_fNextSuicideTime = gpGlobals->time + 1; // don't let them suicide for 5 seconds after suiciding + pl->m_fNextSuicideTime = gpGlobals->time + 1.0f; // don't let them suicide for 5 seconds after suiciding // have the player kill themself pev->health = 0; @@ -196,6 +196,7 @@ void ClientPutInServer( edict_t *pEntity ) pPlayer = GetClassPtr( (CBasePlayer *)pev ); pPlayer->SetCustomDecalFrames( -1 ); // Assume none; + pPlayer->SetPrefsFromUserinfo( g_engfuncs.pfnGetInfoKeyBuffer( pEntity ) ); // Allocate a CBasePlayer for pev, and call spawn pPlayer->Spawn(); @@ -494,7 +495,7 @@ void ClientCommand( edict_t *pEntity ) } else if( FStrEq(pcmd, "give" ) ) { - if( g_flWeaponCheat != 0.0 ) + if( g_flWeaponCheat != 0.0f ) { int iszItem = ALLOC_STRING( CMD_ARGV( 1 ) ); // Make a copy of the classname GetClassPtr( (CBasePlayer *)pev )->GiveNamedItem( STRING( iszItem ) ); @@ -502,7 +503,7 @@ void ClientCommand( edict_t *pEntity ) } else if( FStrEq( pcmd, "fire" ) ) { - if( g_flWeaponCheat != 0.0 ) + if( g_flWeaponCheat != 0.0f ) { CBaseEntity *pPlayer = CBaseEntity::Instance( pEntity ); if( CMD_ARGC() > 1 ) @@ -1203,7 +1204,7 @@ int AddToFullPack( struct entity_state_s *state, int e, edict_t *ent, edict_t *h // // Round animtime to nearest millisecond - state->animtime = (int)( 1000.0 * ent->v.animtime ) / 1000.0; + state->animtime = (int)( 1000.0f * ent->v.animtime ) / 1000.0f; memcpy( state->origin, ent->v.origin, 3 * sizeof(float) ); memcpy( state->angles, ent->v.angles, 3 * sizeof(float) ); @@ -1661,12 +1662,12 @@ int GetWeaponData( struct edict_s *player, struct weapon_data_s *info ) item->m_iId = II.iId; item->m_iClip = gun->m_iClip; - item->m_flTimeWeaponIdle = Q_max( gun->m_flTimeWeaponIdle, -0.001 ); - item->m_flNextPrimaryAttack = Q_max( gun->m_flNextPrimaryAttack, -0.001 ); - item->m_flNextSecondaryAttack = Q_max( gun->m_flNextSecondaryAttack, -0.001 ); + item->m_flTimeWeaponIdle = Q_max( gun->m_flTimeWeaponIdle, -0.001f ); + item->m_flNextPrimaryAttack = Q_max( gun->m_flNextPrimaryAttack, -0.001f ); + item->m_flNextSecondaryAttack = Q_max( gun->m_flNextSecondaryAttack, -0.001f ); item->m_fInReload = gun->m_fInReload; item->m_fInSpecialReload = gun->m_fInSpecialReload; - item->fuser1 = Q_max( gun->pev->fuser1, -0.001 ); + item->fuser1 = Q_max( gun->pev->fuser1, -0.001f ); item->fuser2 = gun->m_flStartThrow; item->fuser3 = gun->m_flReleaseThrow; item->iuser1 = gun->m_chargeReady; @@ -1931,7 +1932,7 @@ One of the ENGINE_FORCE_UNMODIFIED files failed the consistency check for the sp int InconsistentFile( const edict_t *player, const char *filename, char *disconnect_message ) { // Server doesn't care? - if( CVAR_GET_FLOAT( "mp_consistency" ) != 1 ) + if( CVAR_GET_FLOAT( "mp_consistency" ) != 1.0f ) return 0; // Default behavior is to kick the player diff --git a/dlls/combat.cpp b/dlls/combat.cpp index 9f221cc9..df079af7 100644 --- a/dlls/combat.cpp +++ b/dlls/combat.cpp @@ -48,8 +48,8 @@ void CGib::LimitVelocity( void ) // ceiling at 1500. The gib velocity equation is not bounded properly. Rather than tune it // in 3 separate places again, I'll just limit it here. - if( length > 1500.0 ) - pev->velocity = pev->velocity.Normalize() * 1500; // This should really be sv_maxvelocity * 0.75 or something + if( length > 1500.0f ) + pev->velocity = pev->velocity.Normalize() * 1500.0f; // This should really be sv_maxvelocity * 0.75 or something } @@ -72,9 +72,9 @@ void CGib::SpawnStickyGibs( entvars_t *pevVictim, Vector vecOrigin, int cGibs ) if( pevVictim ) { - pGib->pev->origin.x = vecOrigin.x + RANDOM_FLOAT( -3, 3 ); - pGib->pev->origin.y = vecOrigin.y + RANDOM_FLOAT( -3, 3 ); - pGib->pev->origin.z = vecOrigin.z + RANDOM_FLOAT( -3, 3 ); + pGib->pev->origin.x = vecOrigin.x + RANDOM_FLOAT( -3.0f, 3.0f ); + pGib->pev->origin.y = vecOrigin.y + RANDOM_FLOAT( -3.0f, 3.0f ); + pGib->pev->origin.z = vecOrigin.z + RANDOM_FLOAT( -3.0f, 3.0f ); /* pGib->pev->origin.x = pevVictim->absmin.x + pevVictim->size.x * ( RANDOM_FLOAT( 0, 1 ) ); @@ -83,32 +83,32 @@ void CGib::SpawnStickyGibs( entvars_t *pevVictim, Vector vecOrigin, int cGibs ) */ // make the gib fly away from the attack vector - pGib->pev->velocity = g_vecAttackDir * -1; + pGib->pev->velocity = g_vecAttackDir * -1.0f; // mix in some noise - pGib->pev->velocity.x += RANDOM_FLOAT( -0.15, 0.15 ); - pGib->pev->velocity.y += RANDOM_FLOAT( -0.15, 0.15 ); - pGib->pev->velocity.z += RANDOM_FLOAT( -0.15, 0.15 ); + pGib->pev->velocity.x += RANDOM_FLOAT( -0.15f, 0.15f ); + pGib->pev->velocity.y += RANDOM_FLOAT( -0.15f, 0.15f ); + pGib->pev->velocity.z += RANDOM_FLOAT( -0.15f, 0.15f ); - pGib->pev->velocity = pGib->pev->velocity * 900; + pGib->pev->velocity = pGib->pev->velocity * 900.0f; - pGib->pev->avelocity.x = RANDOM_FLOAT( 250, 400 ); - pGib->pev->avelocity.y = RANDOM_FLOAT( 250, 400 ); + pGib->pev->avelocity.x = RANDOM_FLOAT( 250.0f, 400.0f ); + pGib->pev->avelocity.y = RANDOM_FLOAT( 250.0f, 400.0f ); // copy owner's blood color pGib->m_bloodColor = ( CBaseEntity::Instance( pevVictim ) )->BloodColor(); if( pevVictim->health > -50 ) { - pGib->pev->velocity = pGib->pev->velocity * 0.7; + pGib->pev->velocity = pGib->pev->velocity * 0.7f; } else if( pevVictim->health > -200 ) { - pGib->pev->velocity = pGib->pev->velocity * 2; + pGib->pev->velocity = pGib->pev->velocity * 2.0f; } else { - pGib->pev->velocity = pGib->pev->velocity * 4; + pGib->pev->velocity = pGib->pev->velocity * 4.0f; } pGib->pev->movetype = MOVETYPE_TOSS; @@ -148,31 +148,31 @@ void CGib::SpawnHeadGib( entvars_t *pevVictim ) entvars_t *pevPlayer; pevPlayer = VARS( pentPlayer ); - pGib->pev->velocity = ( ( pevPlayer->origin + pevPlayer->view_ofs ) - pGib->pev->origin ).Normalize() * 300; - pGib->pev->velocity.z += 100; + pGib->pev->velocity = ( ( pevPlayer->origin + pevPlayer->view_ofs ) - pGib->pev->origin ).Normalize() * 300.0f; + pGib->pev->velocity.z += 100.0f; } else { - pGib->pev->velocity = Vector( RANDOM_FLOAT( -100, 100 ), RANDOM_FLOAT( -100, 100 ), RANDOM_FLOAT( 200, 300 ) ); + pGib->pev->velocity = Vector( RANDOM_FLOAT( -100.0f, 100.0f ), RANDOM_FLOAT( -100.0f, 100.0f ), RANDOM_FLOAT( 200.0f, 300.0f ) ); } - pGib->pev->avelocity.x = RANDOM_FLOAT( 100, 200 ); - pGib->pev->avelocity.y = RANDOM_FLOAT( 100, 300 ); + pGib->pev->avelocity.x = RANDOM_FLOAT( 100.0f, 200.0f ); + pGib->pev->avelocity.y = RANDOM_FLOAT( 100.0f, 300.0f ); // copy owner's blood color pGib->m_bloodColor = ( CBaseEntity::Instance( pevVictim ) )->BloodColor(); if( pevVictim->health > -50 ) { - pGib->pev->velocity = pGib->pev->velocity * 0.7; + pGib->pev->velocity = pGib->pev->velocity * 0.7f; } else if( pevVictim->health > -200 ) { - pGib->pev->velocity = pGib->pev->velocity * 2; + pGib->pev->velocity = pGib->pev->velocity * 2.0f; } else { - pGib->pev->velocity = pGib->pev->velocity * 4; + pGib->pev->velocity = pGib->pev->velocity * 4.0f; } } pGib->LimitVelocity(); @@ -210,37 +210,37 @@ void CGib::SpawnRandomGibs( entvars_t *pevVictim, int cGibs, int human ) if( pevVictim ) { // spawn the gib somewhere in the monster's bounding volume - pGib->pev->origin.x = pevVictim->absmin.x + pevVictim->size.x * (RANDOM_FLOAT ( 0 , 1 ) ); - pGib->pev->origin.y = pevVictim->absmin.y + pevVictim->size.y * (RANDOM_FLOAT ( 0 , 1 ) ); - pGib->pev->origin.z = pevVictim->absmin.z + pevVictim->size.z * (RANDOM_FLOAT ( 0 , 1 ) ) + 1; // absmin.z is in the floor because the engine subtracts 1 to enlarge the box + pGib->pev->origin.x = pevVictim->absmin.x + pevVictim->size.x * ( RANDOM_FLOAT( 0.0f, 1.0f ) ); + pGib->pev->origin.y = pevVictim->absmin.y + pevVictim->size.y * ( RANDOM_FLOAT( 0.0f, 1.0f ) ); + pGib->pev->origin.z = pevVictim->absmin.z + pevVictim->size.z * ( RANDOM_FLOAT( 0.0f, 1.0f ) ) + 1.0f; // absmin.z is in the floor because the engine subtracts 1 to enlarge the box // make the gib fly away from the attack vector - pGib->pev->velocity = g_vecAttackDir * -1; + pGib->pev->velocity = g_vecAttackDir * -1.0f; // mix in some noise - pGib->pev->velocity.x += RANDOM_FLOAT( -0.25, 0.25 ); - pGib->pev->velocity.y += RANDOM_FLOAT( -0.25, 0.25 ); - pGib->pev->velocity.z += RANDOM_FLOAT( -0.25, 0.25 ); + pGib->pev->velocity.x += RANDOM_FLOAT( -0.25f, 0.25f ); + pGib->pev->velocity.y += RANDOM_FLOAT( -0.25f, 0.25f ); + pGib->pev->velocity.z += RANDOM_FLOAT( -0.25f, 0.25f ); - pGib->pev->velocity = pGib->pev->velocity * RANDOM_FLOAT( 300, 400 ); + pGib->pev->velocity = pGib->pev->velocity * RANDOM_FLOAT( 300.0f, 400.0f ); - pGib->pev->avelocity.x = RANDOM_FLOAT( 100, 200 ); - pGib->pev->avelocity.y = RANDOM_FLOAT( 100, 300 ); + pGib->pev->avelocity.x = RANDOM_FLOAT( 100.0f, 200.0f ); + pGib->pev->avelocity.y = RANDOM_FLOAT( 100.0f, 300.0f ); // copy owner's blood color pGib->m_bloodColor = ( CBaseEntity::Instance( pevVictim ) )->BloodColor(); if( pevVictim->health > -50 ) { - pGib->pev->velocity = pGib->pev->velocity * 0.7; + pGib->pev->velocity = pGib->pev->velocity * 0.7f; } else if( pevVictim->health > -200 ) { - pGib->pev->velocity = pGib->pev->velocity * 2; + pGib->pev->velocity = pGib->pev->velocity * 2.0f; } else { - pGib->pev->velocity = pGib->pev->velocity * 4; + pGib->pev->velocity = pGib->pev->velocity * 4.0f; } pGib->pev->solid = SOLID_BBOX; @@ -360,7 +360,7 @@ Activity CBaseMonster::GetDeathActivity( void ) deathActivity = ACT_DIESIMPLE;// in case we can't find any special deaths to do. UTIL_MakeVectors( pev->angles ); - flDot = DotProduct( gpGlobals->v_forward, g_vecAttackDir * -1 ); + flDot = DotProduct( gpGlobals->v_forward, g_vecAttackDir * -1.0f ); switch( m_LastHitGroup ) { @@ -374,11 +374,11 @@ Activity CBaseMonster::GetDeathActivity( void ) case HITGROUP_GENERIC: // try to pick a death based on attack direction fTriedDirection = TRUE; - if( flDot > 0.3 ) + if( flDot > 0.3f ) { deathActivity = ACT_DIEFORWARD; } - else if( flDot <= -0.3 ) + else if( flDot <= -0.3f ) { deathActivity = ACT_DIEBACKWARD; } @@ -387,11 +387,11 @@ Activity CBaseMonster::GetDeathActivity( void ) // try to pick a death based on attack direction fTriedDirection = TRUE; - if( flDot > 0.3 ) + if( flDot > 0.3f ) { deathActivity = ACT_DIEFORWARD; } - else if( flDot <= -0.3 ) + else if( flDot <= -0.3f ) { deathActivity = ACT_DIEBACKWARD; } @@ -410,11 +410,11 @@ Activity CBaseMonster::GetDeathActivity( void ) else { // cannot perform the ideal region-specific death, so try a direction. - if( flDot > 0.3 ) + if( flDot > 0.3f ) { deathActivity = ACT_DIEFORWARD; } - else if( flDot <= -0.3 ) + else if( flDot <= -0.3f ) { deathActivity = ACT_DIEBACKWARD; } @@ -430,9 +430,9 @@ Activity CBaseMonster::GetDeathActivity( void ) if( deathActivity == ACT_DIEFORWARD ) { // make sure there's room to fall forward - UTIL_TraceHull( vecSrc, vecSrc + gpGlobals->v_forward * 64, dont_ignore_monsters, head_hull, edict(), &tr ); + UTIL_TraceHull( vecSrc, vecSrc + gpGlobals->v_forward * 64.0f, dont_ignore_monsters, head_hull, edict(), &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { deathActivity = ACT_DIESIMPLE; } @@ -441,9 +441,9 @@ Activity CBaseMonster::GetDeathActivity( void ) if( deathActivity == ACT_DIEBACKWARD ) { // make sure there's room to fall backward - UTIL_TraceHull( vecSrc, vecSrc - gpGlobals->v_forward * 64, dont_ignore_monsters, head_hull, edict(), &tr ); + UTIL_TraceHull( vecSrc, vecSrc - gpGlobals->v_forward * 64.0f, dont_ignore_monsters, head_hull, edict(), &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { deathActivity = ACT_DIESIMPLE; } @@ -459,12 +459,12 @@ Activity CBaseMonster::GetDeathActivity( void ) Activity CBaseMonster::GetSmallFlinchActivity( void ) { Activity flinchActivity; - BOOL fTriedDirection; + // BOOL fTriedDirection; //float flDot; - fTriedDirection = FALSE; + // fTriedDirection = FALSE; UTIL_MakeVectors( pev->angles ); - //flDot = DotProduct( gpGlobals->v_forward, g_vecAttackDir * -1 ); + //flDot = DotProduct( gpGlobals->v_forward, g_vecAttackDir * -1.0f ); switch( m_LastHitGroup ) { @@ -515,9 +515,9 @@ void CBaseMonster::BecomeDead( void ) // make the corpse fly away from the attack vector pev->movetype = MOVETYPE_TOSS; //pev->flags &= ~FL_ONGROUND; - //pev->origin.z += 2; - //pev->velocity = g_vecAttackDir * -1; - //pev->velocity = pev->velocity * RANDOM_FLOAT( 300, 400 ); + //pev->origin.z += 2.0f; + //pev->velocity = g_vecAttackDir * -1.0f; + //pev->velocity = pev->velocity * RANDOM_FLOAT( 300.0f, 400.0f ); } BOOL CBaseMonster::ShouldGibMonster( int iGib ) @@ -534,12 +534,12 @@ void CBaseMonster::CallGibMonster( void ) if( HasHumanGibs() ) { - if( CVAR_GET_FLOAT( "violence_hgibs" ) == 0 ) + if( CVAR_GET_FLOAT( "violence_hgibs" ) == 0.0f ) fade = TRUE; } else if( HasAlienGibs() ) { - if( CVAR_GET_FLOAT( "violence_agibs" ) == 0 ) + if( CVAR_GET_FLOAT( "violence_agibs" ) == 0.0f ) fade = TRUE; } @@ -639,7 +639,7 @@ void CBaseEntity::SUB_StartFadeOut( void ) pev->solid = SOLID_NOT; pev->avelocity = g_vecZero; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; SetThink( &CBaseEntity::SUB_FadeOut ); } @@ -648,12 +648,12 @@ void CBaseEntity::SUB_FadeOut( void ) if( pev->renderamt > 7 ) { pev->renderamt -= 7; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } else { pev->renderamt = 0; - pev->nextthink = gpGlobals->time + 0.2; + pev->nextthink = gpGlobals->time + 0.2f; SetThink( &CBaseEntity::SUB_Remove ); } } @@ -687,7 +687,7 @@ void CGib::WaitTillLand( void ) else { // wait and check again in another half second. - pev->nextthink = gpGlobals->time + 0.5; + pev->nextthink = gpGlobals->time + 0.5f; } } @@ -704,18 +704,18 @@ void CGib::BounceGibTouch( CBaseEntity *pOther ) if( pev->flags & FL_ONGROUND ) { - pev->velocity = pev->velocity * 0.9; - pev->angles.x = 0; - pev->angles.z = 0; - pev->avelocity.x = 0; - pev->avelocity.z = 0; + pev->velocity = pev->velocity * 0.9f; + pev->angles.x = 0.0f; + pev->angles.z = 0.0f; + pev->avelocity.x = 0.0f; + pev->avelocity.z = 0.0f; } else { if( g_Language != LANGUAGE_GERMAN && m_cBloodDecals > 0 && m_bloodColor != DONT_BLEED ) { - vecSpot = pev->origin + Vector( 0, 0, 8 );//move up a bit, and trace down. - UTIL_TraceLine( vecSpot, vecSpot + Vector( 0, 0, -24 ), ignore_monsters, ENT( pev ), &tr ); + vecSpot = pev->origin + Vector( 0.0f, 0.0f, 8.0f );//move up a bit, and trace down. + UTIL_TraceLine( vecSpot, vecSpot + Vector( 0.0f, 0.0f, -24.0f ), ignore_monsters, ENT( pev ), &tr ); UTIL_BloodDecalTrace( &tr, m_bloodColor ); @@ -727,7 +727,7 @@ void CGib::BounceGibTouch( CBaseEntity *pOther ) float volume; float zvel = fabs( pev->velocity.z ); - volume = 0.8 * Q_min( 1.0, ( (float)zvel ) / 450.0 ); + volume = 0.8f * Q_min( 1.0f, zvel / 450.0f ); CBreakable::MaterialSoundRandom( edict(), (Materials)m_material, volume ); } @@ -743,7 +743,7 @@ void CGib::StickyGibTouch( CBaseEntity *pOther ) TraceResult tr; SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + 10; + pev->nextthink = gpGlobals->time + 10.0f; if( !FClassnameIs( pOther->pev, "worldspawn" ) ) { @@ -751,11 +751,11 @@ void CGib::StickyGibTouch( CBaseEntity *pOther ) return; } - UTIL_TraceLine( pev->origin, pev->origin + pev->velocity * 32, ignore_monsters, ENT( pev ), &tr ); + UTIL_TraceLine( pev->origin, pev->origin + pev->velocity * 32.0f, ignore_monsters, ENT( pev ), &tr ); UTIL_BloodDecalTrace( &tr, m_bloodColor ); - pev->velocity = tr.vecPlaneNormal * -1; + pev->velocity = tr.vecPlaneNormal * -1.0f; pev->angles = UTIL_VecToAngles( pev->velocity ); pev->velocity = g_vecZero; pev->avelocity = g_vecZero; @@ -768,7 +768,7 @@ void CGib::StickyGibTouch( CBaseEntity *pOther ) void CGib::Spawn( const char *szGibModel ) { pev->movetype = MOVETYPE_BOUNCE; - pev->friction = 0.55; // deading the bounce a bit + pev->friction = 0.55f; // deading the bounce a bit // sometimes an entity inherits the edict from a former piece of glass, // and will spawn using the same render FX or rendermode! bad! @@ -781,7 +781,7 @@ void CGib::Spawn( const char *szGibModel ) SET_MODEL( ENT( pev ), szGibModel ); UTIL_SetSize( pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) ); - pev->nextthink = gpGlobals->time + 4; + pev->nextthink = gpGlobals->time + 4.0f; m_lifeTime = 25; SetThink( &CGib::WaitTillLand ); SetTouch( &CGib::BounceGibTouch ); @@ -927,7 +927,7 @@ int CBaseMonster::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, f } else { - m_vecEnemyLKP = pev->origin + ( g_vecAttackDir * 64 ); + m_vecEnemyLKP = pev->origin + ( g_vecAttackDir * 64.0f ); } MakeIdealYaw( m_vecEnemyLKP ); @@ -935,12 +935,12 @@ int CBaseMonster::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, f // add pain to the conditions // !!!HACKHACK - fudged for now. Do we want to have a virtual function to determine what is light and // heavy damage per monster class? - if( flDamage > 0 ) + if( flDamage > 0.0f ) { SetConditions( bits_COND_LIGHT_DAMAGE ); } - if( flDamage >= 20 ) + if( flDamage >= 20.0f ) { SetConditions( bits_COND_HEAVY_DAMAGE ); } @@ -965,7 +965,7 @@ int CBaseMonster::DeadTakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacke CBaseEntity *pInflictor = CBaseEntity::Instance( pevInflictor ); if( pInflictor ) { - vecDir = ( pInflictor->Center() - Vector ( 0, 0, 10 ) - Center() ).Normalize(); + vecDir = ( pInflictor->Center() - Vector ( 0.0f, 0.0f, 10.0f ) - Center() ).Normalize(); vecDir = g_vecAttackDir = vecDir.Normalize(); } } @@ -973,8 +973,8 @@ int CBaseMonster::DeadTakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacke #if 0// turn this back on when the bounding box issues are resolved. pev->flags &= ~FL_ONGROUND; - pev->origin.z += 1; - + pev->origin.z += 1.0f; + // let the damage scoot the corpse around a bit. if( !FNullEnt( pevInflictor ) && ( pevAttacker->solid != SOLID_TRIGGER ) ) { @@ -991,7 +991,7 @@ int CBaseMonster::DeadTakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacke return 0; } // Accumulate corpse gibbing damage, so you can gib with multiple hits - pev->health -= flDamage * 0.1; + pev->health -= flDamage * 0.1f; } return 1; @@ -999,11 +999,11 @@ int CBaseMonster::DeadTakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacke float CBaseMonster::DamageForce( float damage ) { - float force = damage * ( ( 32 * 32 * 72.0 ) / ( pev->size.x * pev->size.y * pev->size.z ) ) * 5; + float force = damage * ( ( 32.0f * 32.0f * 72.0f ) / ( pev->size.x * pev->size.y * pev->size.z ) ) * 5.0f; - if( force > 1000.0 ) + if( force > 1000.0f ) { - force = 1000.0; + force = 1000.0f; } return force; @@ -1023,11 +1023,11 @@ void RadiusDamage( Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacke if( flRadius ) falloff = flDamage / flRadius; else - falloff = 1.0; + falloff = 1.0f; int bInWater = ( UTIL_PointContents( vecSrc ) == CONTENTS_WATER ); - vecSrc.z += 1;// in case grenade is lying on the ground + vecSrc.z += 1.0f;// in case grenade is lying on the ground if( !pevAttacker ) pevAttacker = pevInflictor; @@ -1054,27 +1054,27 @@ void RadiusDamage( Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacke UTIL_TraceLine( vecSrc, vecSpot, dont_ignore_monsters, ENT( pevInflictor ), &tr ); - if( tr.flFraction == 1.0 || tr.pHit == pEntity->edict() ) + if( tr.flFraction == 1.0f || tr.pHit == pEntity->edict() ) { // the explosion can 'see' this entity, so hurt them! if( tr.fStartSolid ) { // if we're stuck inside them, fixup the position and distance tr.vecEndPos = vecSrc; - tr.flFraction = 0.0; + tr.flFraction = 0.0f; } // decrease damage for an ent that's farther from the bomb. flAdjustedDamage = ( vecSrc - tr.vecEndPos ).Length() * falloff; flAdjustedDamage = flDamage - flAdjustedDamage; - if( flAdjustedDamage < 0 ) + if( flAdjustedDamage < 0.0f ) { - flAdjustedDamage = 0; + flAdjustedDamage = 0.0f; } // ALERT( at_console, "hit %s\n", STRING( pEntity->pev->classname ) ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { ClearMultiDamage(); pEntity->TraceAttack( pevInflictor, flAdjustedDamage, ( tr.vecEndPos - vecSrc ).Normalize(), &tr, bitsDamageType ); @@ -1091,12 +1091,12 @@ void RadiusDamage( Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacke void CBaseMonster::RadiusDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int iClassIgnore, int bitsDamageType ) { - ::RadiusDamage( pev->origin, pevInflictor, pevAttacker, flDamage, flDamage * 2.5, iClassIgnore, bitsDamageType ); + ::RadiusDamage( pev->origin, pevInflictor, pevAttacker, flDamage, flDamage * 2.5f, iClassIgnore, bitsDamageType ); } void CBaseMonster::RadiusDamage( Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int iClassIgnore, int bitsDamageType ) { - ::RadiusDamage( vecSrc, pevInflictor, pevAttacker, flDamage, flDamage * 2.5, iClassIgnore, bitsDamageType ); + ::RadiusDamage( vecSrc, pevInflictor, pevAttacker, flDamage, flDamage * 2.5f, iClassIgnore, bitsDamageType ); } //========================================================= @@ -1117,7 +1117,7 @@ CBaseEntity* CBaseMonster::CheckTraceHullAttack( float flDist, int iDamage, int UTIL_MakeAimVectors( pev->angles ); Vector vecStart = pev->origin; - vecStart.z += pev->size.z * 0.5; + vecStart.z += pev->size.z * 0.5f; Vector vecEnd = vecStart + ( gpGlobals->v_forward * flDist ); UTIL_TraceHull( vecStart, vecEnd, dont_ignore_monsters, head_hull, ENT( pev ), &tr ); @@ -1219,7 +1219,7 @@ BOOL CBaseEntity::FVisible( CBaseEntity *pEntity ) UTIL_TraceLine( vecLookerOrigin, vecTargetOrigin, ignore_monsters, ignore_glass, ENT( pev )/*pentIgnore*/, &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { return FALSE;// Line of sight is not established } @@ -1242,7 +1242,7 @@ BOOL CBaseEntity::FVisible( const Vector &vecOrigin ) UTIL_TraceLine( vecLookerOrigin, vecOrigin, ignore_monsters, ignore_glass, ENT( pev )/*pentIgnore*/, &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { return FALSE;// Line of sight is not established } @@ -1259,7 +1259,7 @@ TraceAttack */ void CBaseEntity::TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType) { - Vector vecOrigin = ptr->vecEndPos - vecDir * 4; + Vector vecOrigin = ptr->vecEndPos - vecDir * 4.0f; if( pev->takedamage ) { @@ -1281,7 +1281,7 @@ void CBaseEntity::TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vec //========================================================= void CBaseMonster::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType ) { - Vector vecOrigin = ptr->vecEndPos - vecDir * 4; + Vector vecOrigin = ptr->vecEndPos - vecDir * 4.0f; ALERT( at_console, "%d\n", ptr->iHitgroup ); @@ -1367,8 +1367,8 @@ void CBaseEntity::FireBullets( ULONG cShots, Vector vecSrc, Vector vecDirShootin // get circular gaussian spread float x, y, z; do { - x = RANDOM_FLOAT( -0.5, 0.5 ) + RANDOM_FLOAT( -0.5, 0.5 ); - y = RANDOM_FLOAT( -0.5, 0.5 ) + RANDOM_FLOAT( -0.5, 0.5 ); + x = RANDOM_FLOAT( -0.5f, 0.5f ) + RANDOM_FLOAT( -0.5f, 0.5f ); + y = RANDOM_FLOAT( -0.5f, 0.5f ) + RANDOM_FLOAT( -0.5f, 0.5f ); z = x * x + y * y; } while (z > 1); @@ -1388,7 +1388,7 @@ void CBaseEntity::FireBullets( ULONG cShots, Vector vecSrc, Vector vecDirShootin if( IsPlayer() ) { // adjust tracer position for player - vecTracerSrc = vecSrc + Vector( 0, 0, -4 ) + gpGlobals->v_right * 2 + gpGlobals->v_forward * 16; + vecTracerSrc = vecSrc + Vector( 0.0f, 0.0f, -4.0f ) + gpGlobals->v_right * 2.0f + gpGlobals->v_forward * 16.0f; } else { @@ -1416,7 +1416,7 @@ void CBaseEntity::FireBullets( ULONG cShots, Vector vecSrc, Vector vecDirShootin } } // do damage, paint decals - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { CBaseEntity *pEntity = CBaseEntity::Instance( tr.pHit ); @@ -1463,7 +1463,7 @@ void CBaseEntity::FireBullets( ULONG cShots, Vector vecSrc, Vector vecDirShootin } } // make bullet trails - UTIL_BubbleTrail( vecSrc, tr.vecEndPos, (int)( ( flDistance * tr.flFraction ) / 64.0 ) ); + UTIL_BubbleTrail( vecSrc, tr.vecEndPos, (int)( ( flDistance * tr.flFraction ) / 64.0f ) ); } ApplyMultiDamage( pev, pevAttacker ); } @@ -1496,8 +1496,8 @@ Vector CBaseEntity::FireBulletsPlayer( ULONG cShots, Vector vecSrc, Vector vecDi { //Use player's random seed. // get circular gaussian spread - x = UTIL_SharedRandomFloat( shared_rand + iShot, -0.5, 0.5 ) + UTIL_SharedRandomFloat( shared_rand + ( 1 + iShot ) , -0.5, 0.5 ); - y = UTIL_SharedRandomFloat( shared_rand + ( 2 + iShot ), -0.5, 0.5 ) + UTIL_SharedRandomFloat( shared_rand + ( 3 + iShot ), -0.5, 0.5 ); + x = UTIL_SharedRandomFloat( shared_rand + iShot, -0.5f, 0.5f ) + UTIL_SharedRandomFloat( shared_rand + ( 1 + iShot ) , -0.5f, 0.5f ); + y = UTIL_SharedRandomFloat( shared_rand + ( 2 + iShot ), -0.5f, 0.5f ) + UTIL_SharedRandomFloat( shared_rand + ( 3 + iShot ), -0.5f, 0.5f ); //z = x * x + y * y; Vector vecDir = vecDirShooting + @@ -1509,7 +1509,7 @@ Vector CBaseEntity::FireBulletsPlayer( ULONG cShots, Vector vecSrc, Vector vecDi UTIL_TraceLine( vecSrc, vecEnd, dont_ignore_monsters, ENT( pev )/*pentIgnore*/, &tr ); // do damage, paint decals - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { CBaseEntity *pEntity = CBaseEntity::Instance( tr.pHit ); @@ -1549,7 +1549,7 @@ Vector CBaseEntity::FireBulletsPlayer( ULONG cShots, Vector vecSrc, Vector vecDi } } // make bullet trails - UTIL_BubbleTrail( vecSrc, tr.vecEndPos, (int)( ( flDistance * tr.flFraction ) / 64.0 ) ); + UTIL_BubbleTrail( vecSrc, tr.vecEndPos, (int)( ( flDistance * tr.flFraction ) / 64.0f ) ); } ApplyMultiDamage( pev, pevAttacker ); @@ -1589,33 +1589,33 @@ void CBaseEntity::TraceBleed( float flDamage, Vector vecDir, TraceResult *ptr, i } } */ - if( flDamage < 10 ) + if( flDamage < 10.0f ) { - flNoise = 0.1; + flNoise = 0.1f; cCount = 1; } - else if( flDamage < 25 ) + else if( flDamage < 25.0f ) { - flNoise = 0.2; + flNoise = 0.2f; cCount = 2; } else { - flNoise = 0.3; + flNoise = 0.3f; cCount = 4; } for( i = 0; i < cCount; i++ ) { - vecTraceDir = vecDir * -1;// trace in the opposite direction the shot came from (the direction the shot is going) + vecTraceDir = vecDir * -1.0f;// trace in the opposite direction the shot came from (the direction the shot is going) vecTraceDir.x += RANDOM_FLOAT( -flNoise, flNoise ); vecTraceDir.y += RANDOM_FLOAT( -flNoise, flNoise ); vecTraceDir.z += RANDOM_FLOAT( -flNoise, flNoise ); - UTIL_TraceLine( ptr->vecEndPos, ptr->vecEndPos + vecTraceDir * -172, ignore_monsters, ENT( pev ), &Bloodtr ); + UTIL_TraceLine( ptr->vecEndPos, ptr->vecEndPos + vecTraceDir * -172.0f, ignore_monsters, ENT( pev ), &Bloodtr ); - if( Bloodtr.flFraction != 1.0 ) + if( Bloodtr.flFraction != 1.0f ) { UTIL_BloodDecalTrace( &Bloodtr, BloodColor() ); } @@ -1653,7 +1653,7 @@ void CBaseMonster::MakeDamageBloodDecal( int cCount, float flNoise, TraceResult vecTraceDir.y += RANDOM_FLOAT( -flNoise, flNoise ); vecTraceDir.z += RANDOM_FLOAT( -flNoise, flNoise ); - UTIL_TraceLine( ptr->vecEndPos, ptr->vecEndPos + vecTraceDir * 172, ignore_monsters, ENT( pev ), &Bloodtr ); + UTIL_TraceLine( ptr->vecEndPos, ptr->vecEndPos + vecTraceDir * 172.0f, ignore_monsters, ENT( pev ), &Bloodtr ); /* MESSAGE_BEGIN( MSG_BROADCAST, SVC_TEMPENTITY ); @@ -1668,7 +1668,7 @@ void CBaseMonster::MakeDamageBloodDecal( int cCount, float flNoise, TraceResult MESSAGE_END(); */ - if( Bloodtr.flFraction != 1.0 ) + if( Bloodtr.flFraction != 1.0f ) { UTIL_BloodDecalTrace( &Bloodtr, BloodColor() ); } diff --git a/dlls/controller.cpp b/dlls/controller.cpp index e1d57517..1f851766 100644 --- a/dlls/controller.cpp +++ b/dlls/controller.cpp @@ -190,9 +190,9 @@ void CController::Killed( entvars_t *pevAttacker, int iGib ) // shut off balls /* m_iBall[0] = 0; - m_iBallTime[0] = gpGlobals->time + 4.0; + m_iBallTime[0] = gpGlobals->time + 4.0f; m_iBall[1] = 0; - m_iBallTime[1] = gpGlobals->time + 4.0; + m_iBallTime[1] = gpGlobals->time + 4.0f; */ // fade balls @@ -281,9 +281,9 @@ void CController::HandleAnimEvent( MonsterEvent_t *pEvent ) MESSAGE_END(); m_iBall[0] = 192; - m_iBallTime[0] = gpGlobals->time + atoi( pEvent->options ) / 15.0; + m_iBallTime[0] = gpGlobals->time + atoi( pEvent->options ) / 15.0f; m_iBall[1] = 255; - m_iBallTime[1] = gpGlobals->time + atoi( pEvent->options ) / 15.0; + m_iBallTime[1] = gpGlobals->time + atoi( pEvent->options ) / 15.0f; } break; case CONTROLLER_AE_BALL_SHOOT: @@ -308,7 +308,7 @@ void CController::HandleAnimEvent( MonsterEvent_t *pEvent ) CBaseMonster *pBall = (CBaseMonster*)Create( "controller_head_ball", vecStart, pev->angles, edict() ); - pBall->pev->velocity = Vector( 0, 0, 32 ); + pBall->pev->velocity = Vector( 0.0f, 0.0f, 32.0f ); pBall->m_hEnemy = m_hEnemy; m_iBall[0] = 0; @@ -319,23 +319,23 @@ void CController::HandleAnimEvent( MonsterEvent_t *pEvent ) { AttackSound(); m_flShootTime = gpGlobals->time; - m_flShootEnd = m_flShootTime + atoi( pEvent->options ) / 15.0; + m_flShootEnd = m_flShootTime + atoi( pEvent->options ) / 15.0f; } break; case CONTROLLER_AE_POWERUP_FULL: { m_iBall[0] = 255; - m_iBallTime[0] = gpGlobals->time + atoi( pEvent->options ) / 15.0; + m_iBallTime[0] = gpGlobals->time + atoi( pEvent->options ) / 15.0f; m_iBall[1] = 255; - m_iBallTime[1] = gpGlobals->time + atoi( pEvent->options ) / 15.0; + m_iBallTime[1] = gpGlobals->time + atoi( pEvent->options ) / 15.0f; } break; case CONTROLLER_AE_POWERUP_HALF: { m_iBall[0] = 192; - m_iBallTime[0] = gpGlobals->time + atoi( pEvent->options ) / 15.0; + m_iBallTime[0] = gpGlobals->time + atoi( pEvent->options ) / 15.0f; m_iBall[1] = 192; - m_iBallTime[1] = gpGlobals->time + atoi( pEvent->options ) / 15.0; + m_iBallTime[1] = gpGlobals->time + atoi( pEvent->options ) / 15.0f; } break; default: @@ -352,14 +352,14 @@ void CController::Spawn() Precache(); SET_MODEL( ENT( pev ), "models/controller.mdl" ); - UTIL_SetSize( pev, Vector( -32, -32, 0 ), Vector( 32, 32, 64 ) ); + UTIL_SetSize( pev, Vector( -32.0f, -32.0f, 0.0f ), Vector( 32.0f, 32.0f, 64.0f ) ); pev->solid = SOLID_SLIDEBOX; pev->movetype = MOVETYPE_FLY; pev->flags |= FL_FLY; m_bloodColor = BLOOD_COLOR_GREEN; pev->health = gSkillData.controllerHealth; - pev->view_ofs = Vector( 0, 0, -2 );// position of the eyes relative to monster's origin. + pev->view_ofs = Vector( 0.0f, 0.0f, -2.0f );// position of the eyes relative to monster's origin. m_flFieldOfView = VIEW_FIELD_FULL;// indicates the width of this monster's forward view cone ( as a dotproduct result ) m_MonsterState = MONSTERSTATE_NONE; @@ -409,8 +409,8 @@ void CController::UpdateOnRemove() // Chase enemy schedule Task_t tlControllerChaseEnemy[] = { - { TASK_GET_PATH_TO_ENEMY, (float)128 }, - { TASK_WAIT_FOR_MOVEMENT, (float)0 }, + { TASK_GET_PATH_TO_ENEMY, 128.0f }, + { TASK_WAIT_FOR_MOVEMENT, 0.0f }, }; Schedule_t slControllerChaseEnemy[] = @@ -427,10 +427,10 @@ Schedule_t slControllerChaseEnemy[] = Task_t tlControllerStrafe[] = { - { TASK_WAIT, (float)0.2 }, - { TASK_GET_PATH_TO_ENEMY, (float)128 }, - { TASK_WAIT_FOR_MOVEMENT, (float)0 }, - { TASK_WAIT, (float)1 }, + { TASK_WAIT, 0.2f }, + { TASK_GET_PATH_TO_ENEMY, 128.0f }, + { TASK_WAIT_FOR_MOVEMENT, 0.0f }, + { TASK_WAIT, 1.0f }, }; Schedule_t slControllerStrafe[] = @@ -446,10 +446,10 @@ Schedule_t slControllerStrafe[] = Task_t tlControllerTakeCover[] = { - { TASK_WAIT, (float)0.2 }, - { TASK_FIND_COVER_FROM_ENEMY, (float)0 }, - { TASK_WAIT_FOR_MOVEMENT, (float)0 }, - { TASK_WAIT, (float)1 }, + { TASK_WAIT, 0.2f }, + { TASK_FIND_COVER_FROM_ENEMY, 0.0f }, + { TASK_WAIT_FOR_MOVEMENT, 0.0f }, + { TASK_WAIT, 1.0f }, }; Schedule_t slControllerTakeCover[] = @@ -504,7 +504,7 @@ void CController::StartTask( Task_t *pTask ) break; case TASK_GET_PATH_TO_ENEMY_LKP: { - if( BuildNearestRoute( m_vecEnemyLKP, pev->view_ofs, pTask->flData, (m_vecEnemyLKP - pev->origin).Length() + 1024 ) ) + if( BuildNearestRoute( m_vecEnemyLKP, pev->view_ofs, pTask->flData, (m_vecEnemyLKP - pev->origin).Length() + 1024.0f ) ) { TaskComplete(); } @@ -526,7 +526,7 @@ void CController::StartTask( Task_t *pTask ) return; } - if( BuildNearestRoute( pEnemy->pev->origin, pEnemy->pev->view_ofs, pTask->flData, ( pEnemy->pev->origin - pev->origin).Length() + 1024 ) ) + if( BuildNearestRoute( pEnemy->pev->origin, pEnemy->pev->view_ofs, pTask->flData, ( pEnemy->pev->origin - pev->origin).Length() + 1024.0f ) ) { TaskComplete(); } @@ -559,8 +559,8 @@ Vector Intersect( Vector vecSrc, Vector vecDst, Vector vecMove, float flSpeed ) } else { - t = b * b - 4 * a * c; - t = sqrt( t ) / ( 2.0 * a ); + t = b * b - 4.0f * a * c; + t = sqrt( t ) / ( 2.0f * a ); float t1 = -b +t; float t2 = -b -t; @@ -572,10 +572,10 @@ Vector Intersect( Vector vecSrc, Vector vecDst, Vector vecMove, float flSpeed ) // ALERT( at_console, "Intersect %f\n", t ); - if( t < 0.1 ) - t = 0.1; - if( t > 10.0 ) - t = 10.0; + if( t < 0.1f ) + t = 0.1f; + if( t > 10.0f ) + t = 10.0f; Vector vecHit = vecTo + vecMove * t; return vecHit.Normalize() * flSpeed; @@ -583,7 +583,7 @@ Vector Intersect( Vector vecSrc, Vector vecDst, Vector vecMove, float flSpeed ) int CController::LookupFloat() { - if( m_velocity.Length() < 32.0 ) + if( m_velocity.Length() < 32.0f ) { return LookupSequence( "up" ); } @@ -636,21 +636,21 @@ void CController::RunTask( Task_t *pTask ) { if( HasConditions( bits_COND_SEE_ENEMY ) ) { - m_vecEstVelocity = m_vecEstVelocity * 0.5 + m_hEnemy->pev->velocity * 0.5; + m_vecEstVelocity = m_vecEstVelocity * 0.5f + m_hEnemy->pev->velocity * 0.5f; } else { - m_vecEstVelocity = m_vecEstVelocity * 0.8; + m_vecEstVelocity = m_vecEstVelocity * 0.8f; } vecDir = Intersect( vecSrc, m_hEnemy->BodyTarget( pev->origin ), m_vecEstVelocity, gSkillData.controllerSpeedBall ); - float delta = 0.03490; // +-2 degree + float delta = 0.03490f; // +-2 degree vecDir = vecDir + Vector( RANDOM_FLOAT( -delta, delta ), RANDOM_FLOAT( -delta, delta ), RANDOM_FLOAT( -delta, delta ) ) * gSkillData.controllerSpeedBall; vecSrc = vecSrc + vecDir * ( gpGlobals->time - m_flShootTime ); CBaseMonster *pBall = (CBaseMonster*)Create( "controller_energy_ball", vecSrc, pev->angles, edict() ); pBall->pev->velocity = vecDir; } - m_flShootTime += 0.2; + m_flShootTime += 0.2f; } if( m_flShootTime > m_flShootEnd ) @@ -725,7 +725,7 @@ Schedule_t *CController::GetSchedule( void ) { case MONSTERSTATE_COMBAT: { - // Vector vecTmp = Intersect( Vector( 0, 0, 0 ), Vector( 100, 4, 7 ), Vector( 2, 10, -3 ), 20.0 ); + // Vector vecTmp = Intersect( Vector( 0, 0, 0 ), Vector( 100, 4, 7 ), Vector( 2, 10, -3 ), 20.0f ); // dead enemy if( HasConditions( bits_COND_LIGHT_DAMAGE ) ) @@ -777,7 +777,7 @@ Schedule_t *CController::GetScheduleOfType( int Type ) //========================================================= BOOL CController::CheckRangeAttack1( float flDot, float flDist ) { - if( flDot > 0.5 && flDist > 256 && flDist <= 2048 ) + if( flDot > 0.5f && flDist > 256.0f && flDist <= 2048.0f ) { return TRUE; } @@ -786,7 +786,7 @@ BOOL CController::CheckRangeAttack1( float flDot, float flDist ) BOOL CController::CheckRangeAttack2( float flDot, float flDist ) { - if( flDot > 0.5 && flDist > 64 && flDist <= 2048 ) + if( flDot > 0.5f && flDist > 64.0f && flDist <= 2048.0f ) { return TRUE; } @@ -805,10 +805,10 @@ void CController::SetActivity( Activity NewActivity ) switch( m_Activity ) { case ACT_WALK: - m_flGroundSpeed = 100; + m_flGroundSpeed = 100.0f; break; default: - m_flGroundSpeed = 100; + m_flGroundSpeed = 100.0f; break; } } @@ -831,14 +831,14 @@ void CController::RunAI( void ) m_pBall[i] = CSprite::SpriteCreate( "sprites/xspark4.spr", pev->origin, TRUE ); m_pBall[i]->SetTransparency( kRenderGlow, 255, 255, 255, 255, kRenderFxNoDissipation ); m_pBall[i]->SetAttachment( edict(), ( i + 3 ) ); - m_pBall[i]->SetScale( 1.0 ); + m_pBall[i]->SetScale( 1.0f ); } float t = m_iBallTime[i] - gpGlobals->time; - if( t > 0.1 ) - t = 0.1 / t; + if( t > 0.1f ) + t = 0.1f / t; else - t = 1.0; + t = 1.0f; m_iBallCurrent[i] += ( m_iBall[i] - m_iBallCurrent[i] ) * t; @@ -912,9 +912,9 @@ void CController::Move( float flInterval ) // to that entity for the CheckLocalMove and Triangulate functions. pTargetEnt = NULL; - if( m_flGroundSpeed == 0 ) + if( m_flGroundSpeed == 0.0f ) { - m_flGroundSpeed = 100; + m_flGroundSpeed = 100.0f; // TaskFail(); // return; } @@ -966,7 +966,8 @@ void CController::Move( float flInterval ) { DispatchBlocked( edict(), pBlocker->edict() ); } - if( pBlocker && m_moveWaitTime > 0 && pBlocker->IsMoving() && !pBlocker->IsPlayer() && (gpGlobals->time-m_flMoveWaitFinished) > 3.0 ) + + if( pBlocker && m_moveWaitTime > 0 && pBlocker->IsMoving() && !pBlocker->IsPlayer() && (gpGlobals->time-m_flMoveWaitFinished) > 3.0f ) { // Can we still move toward our target? if( flDist < m_flGroundSpeed ) @@ -992,7 +993,7 @@ void CController::Move( float flInterval ) if( m_moveWaitTime > 0 ) { FRefreshRoute(); - m_flMoveWaitFinished = gpGlobals->time + m_moveWaitTime * 0.5; + m_flMoveWaitFinished = gpGlobals->time + m_moveWaitTime * 0.5f; } else { @@ -1030,10 +1031,10 @@ void CController::Move( float flInterval ) Stop(); RouteClear(); } - } while( flMoveDist > 0 && flCheckDist > 0 ); + } while( flMoveDist > 0.0f && flCheckDist > 0.0f ); // cut corner? - if( flWaypointDist < 128 ) + if( flWaypointDist < 128.0f ) { if( m_movementGoal == MOVEGOAL_ENEMY ) RouteSimplify( m_hEnemy ); @@ -1041,19 +1042,19 @@ void CController::Move( float flInterval ) RouteSimplify( m_hTargetEnt ); FRefreshRoute(); - if( m_flGroundSpeed > 100 ) - m_flGroundSpeed -= 40; + if( m_flGroundSpeed > 100.0f ) + m_flGroundSpeed -= 40.0f; } else { - if( m_flGroundSpeed < 400 ) - m_flGroundSpeed += 10; + if( m_flGroundSpeed < 400.0f ) + m_flGroundSpeed += 10.0f; } } BOOL CController::ShouldAdvanceRoute( float flWaypointDist ) { - if( flWaypointDist <= 32 ) + if( flWaypointDist <= 32.0f ) { return TRUE; } @@ -1076,7 +1077,7 @@ int CController::CheckLocalMove( const Vector &vecStart, const Vector &vecEnd, C } // ALERT( at_console, "check %d %d %f\n", tr.fStartSolid, tr.fAllSolid, tr.flFraction ); - if( tr.fStartSolid || tr.flFraction < 1.0 ) + if( tr.fStartSolid || tr.flFraction < 1.0f ) { if( pTarget && pTarget->edict() == gpGlobals->trace_ent ) return LOCALMOVE_VALID; @@ -1096,7 +1097,7 @@ void CController::MoveExecute( CBaseEntity *pTargetEnt, const Vector &vecDir, fl // float flTotal = m_flGroundSpeed * pev->framerate * flInterval; // UTIL_MoveToOrigin ( ENT( pev ), m_Route[m_iRouteIndex].vecLocation, flTotal, MOVE_STRAFE ); - m_velocity = m_velocity * 0.8 + m_flGroundSpeed * vecDir * 0.2; + m_velocity = m_velocity * 0.8f + m_flGroundSpeed * vecDir * 0.2f; UTIL_MoveToOrigin( ENT( pev ), pev->origin + m_velocity, m_velocity.Length() * flInterval, MOVE_STRAFE ); } @@ -1133,7 +1134,7 @@ void CControllerHeadBall::Spawn( void ) pev->rendercolor.y = 255; pev->rendercolor.z = 255; pev->renderamt = 255; - pev->scale = 2.0; + pev->scale = 2.0f; UTIL_SetSize(pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) ); UTIL_SetOrigin( pev, pev->origin ); @@ -1143,7 +1144,7 @@ void CControllerHeadBall::Spawn( void ) m_vecIdeal = Vector( 0, 0, 0 ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; m_hOwner = Instance( pev->owner ); pev->dmgtime = gpGlobals->time; @@ -1158,7 +1159,7 @@ void CControllerHeadBall::Precache( void ) void CControllerHeadBall::HuntThink( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; pev->renderamt -= 5; @@ -1219,12 +1220,12 @@ void CControllerHeadBall::HuntThink( void ) WRITE_BYTE( 10 ); // speed MESSAGE_END(); - UTIL_EmitAmbientSound( ENT( pev ), tr.vecEndPos, "weapons/electro4.wav", 0.5, ATTN_NORM, 0, RANDOM_LONG( 140, 160 ) ); + UTIL_EmitAmbientSound( ENT( pev ), tr.vecEndPos, "weapons/electro4.wav", 0.5f, ATTN_NORM, 0, RANDOM_LONG( 140, 160 ) ); - m_flNextAttack = gpGlobals->time + 3.0; + m_flNextAttack = gpGlobals->time + 3.0f; SetThink( &CControllerHeadBall::DieThink ); - pev->nextthink = gpGlobals->time + 0.3; + pev->nextthink = gpGlobals->time + 0.3f; } //Crawl(); @@ -1239,31 +1240,31 @@ void CControllerHeadBall::MovetoTarget( Vector vecTarget ) { // accelerate float flSpeed = m_vecIdeal.Length(); - if( flSpeed == 0 ) + if( flSpeed == 0.0f ) { m_vecIdeal = pev->velocity; flSpeed = m_vecIdeal.Length(); } - if( flSpeed > 400 ) + if( flSpeed > 400.0f ) { - m_vecIdeal = m_vecIdeal.Normalize() * 400; + m_vecIdeal = m_vecIdeal.Normalize() * 400.0f; } - m_vecIdeal = m_vecIdeal + ( vecTarget - pev->origin ).Normalize() * 100; + m_vecIdeal = m_vecIdeal + ( vecTarget - pev->origin ).Normalize() * 100.0f; pev->velocity = m_vecIdeal; } void CControllerHeadBall::Crawl( void ) { - Vector vecAim = Vector( RANDOM_FLOAT( -1, 1 ), RANDOM_FLOAT( -1, 1 ), RANDOM_FLOAT( -1, 1 ) ).Normalize(); - Vector vecPnt = pev->origin + pev->velocity * 0.3 + vecAim * 64; + Vector vecAim = Vector( RANDOM_FLOAT( -1.0f, 1.0f ), RANDOM_FLOAT( -1.0f, 1.0f ), RANDOM_FLOAT( -1.0f, 1.0f ) ).Normalize(); + Vector vecPnt = pev->origin + pev->velocity * 0.3f + vecAim * 64.0f; MESSAGE_BEGIN( MSG_BROADCAST, SVC_TEMPENTITY ); WRITE_BYTE( TE_BEAMENTPOINT ); WRITE_SHORT( entindex() ); - WRITE_COORD( vecPnt.x); - WRITE_COORD( vecPnt.y); - WRITE_COORD( vecPnt.z); + WRITE_COORD( vecPnt.x ); + WRITE_COORD( vecPnt.y ); + WRITE_COORD( vecPnt.z ); WRITE_SHORT( g_sModelIndexLaser ); WRITE_BYTE( 0 ); // frame start WRITE_BYTE( 10 ); // framerate @@ -1286,7 +1287,7 @@ void CControllerHeadBall::BounceTouch( CBaseEntity *pOther ) float n = -DotProduct( tr.vecPlaneNormal, vecDir ); - vecDir = 2.0 * tr.vecPlaneNormal * n + vecDir; + vecDir = 2.0f * tr.vecPlaneNormal * n + vecDir; m_vecIdeal = vecDir * m_vecIdeal.Length(); } @@ -1316,7 +1317,7 @@ void CControllerZapBall::Spawn( void ) pev->rendercolor.y = 255; pev->rendercolor.z = 255; pev->renderamt = 255; - pev->scale = 0.5; + pev->scale = 0.5f; UTIL_SetSize( pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) ); UTIL_SetOrigin( pev, pev->origin ); @@ -1326,7 +1327,7 @@ void CControllerZapBall::Spawn( void ) m_hOwner = Instance( pev->owner ); pev->dmgtime = gpGlobals->time; // keep track of when ball spawned - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } void CControllerZapBall::Precache( void ) @@ -1338,11 +1339,11 @@ void CControllerZapBall::Precache( void ) void CControllerZapBall::AnimateThink( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; pev->frame = ( (int)pev->frame + 1 ) % 11; - if( gpGlobals->time - pev->dmgtime > 5 || pev->velocity.Length() < 10 ) + if( gpGlobals->time - pev->dmgtime > 5 || pev->velocity.Length() < 10.0f ) { SetTouch( NULL ); UTIL_Remove( this ); @@ -1367,10 +1368,10 @@ void CControllerZapBall::ExplodeTouch( CBaseEntity *pOther ) } ClearMultiDamage(); - pOther->TraceAttack(pevOwner, gSkillData.controllerDmgBall, pev->velocity.Normalize(), &tr, DMG_ENERGYBEAM ); + pOther->TraceAttack( pevOwner, gSkillData.controllerDmgBall, pev->velocity.Normalize(), &tr, DMG_ENERGYBEAM ); ApplyMultiDamage( pevOwner, pevOwner ); - UTIL_EmitAmbientSound( ENT( pev ), tr.vecEndPos, "weapons/electro4.wav", 0.3, ATTN_NORM, 0, RANDOM_LONG( 90, 99 ) ); + UTIL_EmitAmbientSound( ENT( pev ), tr.vecEndPos, "weapons/electro4.wav", 0.3f, ATTN_NORM, 0, RANDOM_LONG( 90, 99 ) ); } UTIL_Remove( this ); diff --git a/dlls/crossbow.cpp b/dlls/crossbow.cpp index c3f73f4f..f0526188 100644 --- a/dlls/crossbow.cpp +++ b/dlls/crossbow.cpp @@ -67,7 +67,7 @@ void CCrossbowBolt::Spawn() pev->movetype = MOVETYPE_FLY; pev->solid = SOLID_BBOX; - pev->gravity = 0.5; + pev->gravity = 0.5f; SET_MODEL( ENT( pev ), "models/crossbow_bolt.mdl" ); @@ -76,7 +76,7 @@ void CCrossbowBolt::Spawn() SetTouch( &CCrossbowBolt::BoltTouch ); SetThink( &CCrossbowBolt::BubbleThink ); - pev->nextthink = gpGlobals->time + 0.2; + pev->nextthink = gpGlobals->time + 0.2f; } void CCrossbowBolt::Precache() @@ -140,7 +140,7 @@ void CCrossbowBolt::BoltTouch( CBaseEntity *pOther ) } else { - EMIT_SOUND_DYN( ENT( pev ), CHAN_BODY, "weapons/xbow_hit1.wav", RANDOM_FLOAT( 0.95, 1.0 ), ATTN_NORM, 0, 98 + RANDOM_LONG( 0, 7 ) ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_BODY, "weapons/xbow_hit1.wav", RANDOM_FLOAT( 0.95f, 1.0f ), ATTN_NORM, 0, 98 + RANDOM_LONG( 0, 7 ) ); SetThink( &CBaseEntity::SUB_Remove ); pev->nextthink = gpGlobals->time;// this will get changed below if the bolt is allowed to stick in what it hit. @@ -149,25 +149,25 @@ void CCrossbowBolt::BoltTouch( CBaseEntity *pOther ) { // if what we hit is static architecture, can stay around for a while. Vector vecDir = pev->velocity.Normalize(); - UTIL_SetOrigin( pev, pev->origin - vecDir * 12 ); + UTIL_SetOrigin( pev, pev->origin - vecDir * 12.0f ); pev->angles = UTIL_VecToAngles( vecDir ); pev->solid = SOLID_NOT; pev->movetype = MOVETYPE_FLY; pev->velocity = Vector( 0, 0, 0 ); pev->avelocity.z = 0; pev->angles.z = RANDOM_LONG( 0, 360 ); - pev->nextthink = gpGlobals->time + 10.0; + pev->nextthink = gpGlobals->time + 10.0f; } else if( pOther->pev->movetype == MOVETYPE_PUSH || pOther->pev->movetype == MOVETYPE_PUSHSTEP ) { Vector vecDir = pev->velocity.Normalize(); - UTIL_SetOrigin( pev, pev->origin - vecDir * 12 ); + UTIL_SetOrigin( pev, pev->origin - vecDir * 12.0f ); pev->angles = UTIL_VecToAngles( vecDir ); pev->solid = SOLID_NOT; pev->velocity = Vector( 0, 0, 0 ); pev->avelocity.z = 0; pev->angles.z = RANDOM_LONG( 0, 360 ); - pev->nextthink = gpGlobals->time + 10.0; + pev->nextthink = gpGlobals->time + 10.0f; if (gPhysicsInterfaceInitialized) { // g-cont. Setup movewith feature @@ -185,18 +185,18 @@ void CCrossbowBolt::BoltTouch( CBaseEntity *pOther ) if( g_pGameRules->IsMultiplayer() ) { SetThink( &CCrossbowBolt::ExplodeThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } } void CCrossbowBolt::BubbleThink( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( pev->waterlevel == 0 ) return; - UTIL_BubbleTrail( pev->origin - pev->velocity * 0.1, pev->origin, 1 ); + UTIL_BubbleTrail( pev->origin - pev->velocity * 0.1f, pev->origin, 1 ); } void CCrossbowBolt::ExplodeThink( void ) @@ -328,7 +328,7 @@ void CCrossbow::Holster( int skiplocal /* = 0 */ ) SecondaryAttack(); } - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; if( m_iClip ) SendWeaponAnim( CROSSBOW_HOLSTER1 ); else @@ -353,7 +353,7 @@ void CCrossbow::PrimaryAttack( void ) // this function only gets called in multiplayer void CCrossbow::FireSniperBolt() { - m_flNextPrimaryAttack = GetNextAttackDelay( 0.75 ); + m_flNextPrimaryAttack = GetNextAttackDelay( 0.75f ); if( m_iClip == 0 ) { @@ -373,14 +373,14 @@ void CCrossbow::FireSniperBolt() flags = 0; #endif - PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usCrossbow2, 0.0, g_vecZero, g_vecZero, 0, 0, m_iClip, m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType], 0, 0 ); + PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usCrossbow2, 0.0f, g_vecZero, g_vecZero, 0, 0, m_iClip, m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType], 0, 0 ); // player "shoot" animation m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); Vector anglesAim = m_pPlayer->pev->v_angle + m_pPlayer->pev->punchangle; UTIL_MakeVectors( anglesAim ); - Vector vecSrc = m_pPlayer->GetGunPosition() - gpGlobals->v_up * 2; + Vector vecSrc = m_pPlayer->GetGunPosition() - gpGlobals->v_up * 2.0f; Vector vecDir = gpGlobals->v_forward; UTIL_TraceLine( vecSrc, vecSrc + vecDir * 8192, dont_ignore_monsters, m_pPlayer->edict(), &tr ); @@ -416,7 +416,7 @@ void CCrossbow::FireBolt() flags = 0; #endif - PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usCrossbow, 0.0, g_vecZero, g_vecZero, 0, 0, m_iClip, m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType], 0, 0 ); + PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usCrossbow, 0.0f, g_vecZero, g_vecZero, 0, 0, m_iClip, m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType], 0, 0 ); // player "shoot" animation m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); @@ -427,7 +427,7 @@ void CCrossbow::FireBolt() anglesAim.x = -anglesAim.x; #ifndef CLIENT_DLL - Vector vecSrc = m_pPlayer->GetGunPosition() - gpGlobals->v_up * 2; + Vector vecSrc = m_pPlayer->GetGunPosition() - gpGlobals->v_up * 2.0f; Vector vecDir = gpGlobals->v_forward; CCrossbowBolt *pBolt = CCrossbowBolt::BoltCreate(); @@ -445,21 +445,21 @@ void CCrossbow::FireBolt() pBolt->pev->velocity = vecDir * BOLT_AIR_VELOCITY; pBolt->pev->speed = BOLT_AIR_VELOCITY; } - pBolt->pev->avelocity.z = 10; + pBolt->pev->avelocity.z = 10.0f; #endif if( !m_iClip && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 ) // HEV suit - indicate out of ammo condition m_pPlayer->SetSuitUpdate( "!HEV_AMO0", FALSE, 0 ); - m_flNextPrimaryAttack = GetNextAttackDelay( 0.75 ); + m_flNextPrimaryAttack = GetNextAttackDelay( 0.75f ); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.75; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.75f; if( m_iClip != 0 ) - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 5.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 5.0f; else - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.75; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.75f; } void CCrossbow::SecondaryAttack() @@ -475,8 +475,8 @@ void CCrossbow::SecondaryAttack() m_fInZoom = 1; } - pev->nextthink = UTIL_WeaponTimeBase() + 0.1; - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0; + pev->nextthink = UTIL_WeaponTimeBase() + 0.1f; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0f; } void CCrossbow::Reload( void ) @@ -489,9 +489,9 @@ void CCrossbow::Reload( void ) SecondaryAttack(); } - if( DefaultReload( CROSSBOW_MAX_CLIP, CROSSBOW_RELOAD, 4.5 ) ) + if( DefaultReload( CROSSBOW_MAX_CLIP, CROSSBOW_RELOAD, 4.5f ) ) { - EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/xbow_reload1.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/xbow_reload1.wav", RANDOM_FLOAT( 0.95f, 1.0f ), ATTN_NORM, 0, 93 + RANDOM_LONG( 0, 0xF ) ); } } @@ -504,7 +504,7 @@ void CCrossbow::WeaponIdle( void ) if( m_flTimeWeaponIdle < UTIL_WeaponTimeBase() ) { float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 ); - if( flRand <= 0.75 ) + if( flRand <= 0.75f ) { if( m_iClip ) { @@ -521,12 +521,12 @@ void CCrossbow::WeaponIdle( void ) if( m_iClip ) { SendWeaponAnim( CROSSBOW_FIDGET1 ); - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 90.0 / 30.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 90.0f / 30.0f; } else { SendWeaponAnim( CROSSBOW_FIDGET2 ); - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 80.0 / 30.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 80.0f / 30.0f; } m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); } diff --git a/dlls/crowbar.cpp b/dlls/crowbar.cpp index 8a0ba9a3..ddcb15d8 100644 --- a/dlls/crowbar.cpp +++ b/dlls/crowbar.cpp @@ -105,7 +105,7 @@ BOOL CCrowbar::Deploy() void CCrowbar::Holster( int skiplocal /* = 0 */ ) { - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; SendWeaponAnim( CROWBAR_HOLSTER ); } @@ -120,9 +120,9 @@ void FindHullIntersection( const Vector &vecSrc, TraceResult &tr, float *mins, f distance = 1e6f; - vecHullEnd = vecSrc + ( ( vecHullEnd - vecSrc ) * 2 ); + vecHullEnd = vecSrc + ( ( vecHullEnd - vecSrc ) * 2.0f ); UTIL_TraceLine( vecSrc, vecHullEnd, dont_ignore_monsters, pEntity, &tmpTrace ); - if( tmpTrace.flFraction < 1.0 ) + if( tmpTrace.flFraction < 1.0f ) { tr = tmpTrace; return; @@ -139,7 +139,7 @@ void FindHullIntersection( const Vector &vecSrc, TraceResult &tr, float *mins, f vecEnd.z = vecHullEnd.z + minmaxs[k][2]; UTIL_TraceLine( vecSrc, vecEnd, dont_ignore_monsters, pEntity, &tmpTrace ); - if( tmpTrace.flFraction < 1.0 ) + if( tmpTrace.flFraction < 1.0f ) { float thisDistance = ( tmpTrace.vecEndPos - vecSrc ).Length(); if( thisDistance < distance ) @@ -159,7 +159,7 @@ void CCrowbar::PrimaryAttack() { #ifndef CLIENT_DLL SetThink( &CCrowbar::SwingAgain ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; #endif } } @@ -182,15 +182,15 @@ int CCrowbar::Swing( int fFirst ) UTIL_MakeVectors( m_pPlayer->pev->v_angle ); Vector vecSrc = m_pPlayer->GetGunPosition(); - Vector vecEnd = vecSrc + gpGlobals->v_forward * 32; + Vector vecEnd = vecSrc + gpGlobals->v_forward * 32.0f; UTIL_TraceLine( vecSrc, vecEnd, dont_ignore_monsters, ENT( m_pPlayer->pev ), &tr ); #ifndef CLIENT_DLL - if( tr.flFraction >= 1.0 ) + if( tr.flFraction >= 1.0f ) { UTIL_TraceHull( vecSrc, vecEnd, dont_ignore_monsters, head_hull, ENT( m_pPlayer->pev ), &tr ); - if( tr.flFraction < 1.0 ) + if( tr.flFraction < 1.0f ) { // Calculate the point of intersection of the line (or hull) and the object we hit // This is and approximation of the "best" intersection @@ -204,11 +204,11 @@ int CCrowbar::Swing( int fFirst ) if( fFirst ) { PLAYBACK_EVENT_FULL( FEV_NOTHOST, m_pPlayer->edict(), m_usCrowbar, - 0.0, g_vecZero, g_vecZero, 0, 0, 0, + 0.0f, g_vecZero, g_vecZero, 0, 0, 0, 0, 0, 0 ); } - if( tr.flFraction >= 1.0 ) + if( tr.flFraction >= 1.0f ) { if( fFirst ) { @@ -245,7 +245,7 @@ int CCrowbar::Swing( int fFirst ) CBaseEntity *pEntity = CBaseEntity::Instance( tr.pHit ); // play thwack, smack, or dong sound - float flVol = 1.0; + float flVol = 1.0f; int fHitWorld = TRUE; if( pEntity ) @@ -255,9 +255,9 @@ int CCrowbar::Swing( int fFirst ) // UTIL_WeaponTimeBase() is always 0 and m_flNextPrimaryAttack is >= -1.0f, thus making // m_flNextPrimaryAttack + 1 < UTIL_WeaponTimeBase() always evaluate to false. #ifdef CLIENT_WEAPONS - if( ( m_flNextPrimaryAttack + 1 == UTIL_WeaponTimeBase() ) || g_pGameRules->IsMultiplayer() ) + if( ( m_flNextPrimaryAttack + 1.0f == UTIL_WeaponTimeBase() ) || g_pGameRules->IsMultiplayer() ) #else - if( ( m_flNextPrimaryAttack + 1 < UTIL_WeaponTimeBase() ) || g_pGameRules->IsMultiplayer() ) + if( ( m_flNextPrimaryAttack + 1.0f < UTIL_WeaponTimeBase() ) || g_pGameRules->IsMultiplayer() ) #endif { // first swing does full damage @@ -266,7 +266,7 @@ int CCrowbar::Swing( int fFirst ) else { // subsequent swings do half - pEntity->TraceAttack( m_pPlayer->pev, gSkillData.plrDmgCrowbar / 2, gpGlobals->v_forward, &tr, DMG_CLUB ); + pEntity->TraceAttack( m_pPlayer->pev, gSkillData.plrDmgCrowbar * 0.5f, gpGlobals->v_forward, &tr, DMG_CLUB ); } ApplyMultiDamage( m_pPlayer->pev, m_pPlayer->pev ); @@ -276,20 +276,27 @@ int CCrowbar::Swing( int fFirst ) switch( RANDOM_LONG( 0, 2 ) ) { case 0: - EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/cbar_hitbod1.wav", 1, ATTN_NORM ); + EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/cbar_hitbod1.wav", 1.0f, ATTN_NORM ); break; case 1: - EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/cbar_hitbod2.wav", 1, ATTN_NORM ); + EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/cbar_hitbod2.wav", 1.0f, ATTN_NORM ); break; case 2: - EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/cbar_hitbod3.wav", 1, ATTN_NORM ); + EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/cbar_hitbod3.wav", 1.0f, ATTN_NORM ); break; } + m_pPlayer->m_iWeaponVolume = CROWBAR_BODYHIT_VOLUME; + if( !pEntity->IsAlive() ) + { +#ifdef CROWBAR_FIX_RAPID_CROWBAR + m_flNextPrimaryAttack = GetNextAttackDelay(0.25); +#endif return TRUE; + } else - flVol = 0.1; + flVol = 0.1f; fHitWorld = FALSE; } @@ -300,14 +307,14 @@ int CCrowbar::Swing( int fFirst ) if( fHitWorld ) { - float fvolbar = TEXTURETYPE_PlaySound( &tr, vecSrc, vecSrc + ( vecEnd - vecSrc ) * 2, BULLET_PLAYER_CROWBAR ); + float fvolbar = TEXTURETYPE_PlaySound( &tr, vecSrc, vecSrc + ( vecEnd - vecSrc ) * 2.0f, BULLET_PLAYER_CROWBAR ); if( g_pGameRules->IsMultiplayer() ) { // override the volume here, cause we don't play texture sounds in multiplayer, // and fvolbar is going to be 0 from the above call. - fvolbar = 1; + fvolbar = 1.0f; } // also play crowbar strike @@ -328,9 +335,13 @@ int CCrowbar::Swing( int fFirst ) m_pPlayer->m_iWeaponVolume = (int)( flVol * CROWBAR_WALLHIT_VOLUME ); SetThink( &CCrowbar::Smack ); - pev->nextthink = UTIL_WeaponTimeBase() + 0.2; + pev->nextthink = UTIL_WeaponTimeBase() + 0.2f; +#endif +#if CROWBAR_DELAY_FIX + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25f; +#else + m_flNextPrimaryAttack = GetNextAttackDelay( 0.25f ); #endif - m_flNextPrimaryAttack = GetNextAttackDelay( 0.25 ); } #ifdef CROWBAR_IDLE_ANIM m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); @@ -345,22 +356,22 @@ void CCrowbar::WeaponIdle( void ) { int iAnim; float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 ); - if( flRand > 0.9 ) + if( flRand > 0.9f ) { iAnim = CROWBAR_IDLE2; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0 / 30.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0f / 30.0f; } else { - if( flRand > 0.5 ) + if( flRand > 0.5f ) { iAnim = CROWBAR_IDLE; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0 / 30.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0f / 30.0f; } else { iAnim = CROWBAR_IDLE3; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0 / 30.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 160.0f / 30.0f; } } SendWeaponAnim( iAnim ); diff --git a/dlls/doors.cpp b/dlls/doors.cpp index 085ee441..235669af 100644 --- a/dlls/doors.cpp +++ b/dlls/doors.cpp @@ -89,9 +89,9 @@ TYPEDESCRIPTION CBaseDoor::m_SaveData[] = IMPLEMENT_SAVERESTORE( CBaseDoor, CBaseToggle ) -#define DOOR_SENTENCEWAIT 6 -#define DOOR_SOUNDWAIT 3 -#define BUTTON_SOUNDWAIT 0.5 +#define DOOR_SENTENCEWAIT 6.0f +#define DOOR_SOUNDWAIT 3.0f +#define BUTTON_SOUNDWAIT 0.5f // play door or button locked or unlocked sounds. // pass in pointer to valid locksound struct. @@ -119,9 +119,9 @@ void PlayLockSounds( entvars_t *pev, locksound_t *pls, int flocked, int fbutton float fvol; if( fplaysound && fplaysentence ) - fvol = 0.25; + fvol = 0.25f; else - fvol = 1.0; + fvol = 1.0f; // if there is a locked sound, and we've debounced, play sound if( fplaysound ) @@ -138,7 +138,7 @@ void PlayLockSounds( entvars_t *pev, locksound_t *pls, int flocked, int fbutton int iprev = pls->iLockedSentence; pls->iLockedSentence = SENTENCEG_PlaySequentialSz( ENT( pev ), STRING( pls->sLockedSentence ), - 0.85, ATTN_NORM, 0, 100, pls->iLockedSentence, FALSE ); + 0.85f, ATTN_NORM, 0, 100, pls->iLockedSentence, FALSE ); pls->iUnlockedSentence = 0; // make sure we don't keep calling last sentence in list @@ -157,9 +157,9 @@ void PlayLockSounds( entvars_t *pev, locksound_t *pls, int flocked, int fbutton // if playing both sentence and sound, lower sound volume so we hear sentence if( fplaysound && fplaysentence ) - fvol = 0.25; + fvol = 0.25f; else - fvol = 1.0; + fvol = 1.0f; // play 'door unlocked' sound if set if( fplaysound ) @@ -174,7 +174,7 @@ void PlayLockSounds( entvars_t *pev, locksound_t *pls, int flocked, int fbutton int iprev = pls->iUnlockedSentence; pls->iUnlockedSentence = SENTENCEG_PlaySequentialSz( ENT( pev ), STRING( pls->sUnlockedSentence ), - 0.85, ATTN_NORM, 0, 100, pls->iUnlockedSentence, FALSE ); + 0.85f, ATTN_NORM, 0, 100, pls->iUnlockedSentence, FALSE ); pls->iLockedSentence = 0; // make sure we don't keep calling last sentence in list @@ -231,7 +231,7 @@ void CBaseDoor::KeyValue( KeyValueData *pkvd ) } else if( FStrEq( pkvd->szKeyName, "WaveHeight" ) ) { - pev->scale = atof( pkvd->szValue ) * ( 1.0 / 8.0 ); + pev->scale = atof( pkvd->szValue ) * ( 1.0f / 8.0f ); pkvd->fHandled = TRUE; } else @@ -293,13 +293,13 @@ void CBaseDoor::Spawn() UTIL_SetOrigin( pev, pev->origin ); SET_MODEL( ENT( pev ), STRING( pev->model ) ); - if( pev->speed == 0 ) - pev->speed = 100; + if( pev->speed == 0.0f ) + pev->speed = 100.0f; m_vecPosition1 = pev->origin; // Subtract 2 from size because the engine expands bboxes by 1 in all directions making the size too big - m_vecPosition2 = m_vecPosition1 + ( pev->movedir * ( fabs( pev->movedir.x * ( pev->size.x - 2 ) ) + fabs( pev->movedir.y * ( pev->size.y - 2 ) ) + fabs( pev->movedir.z * ( pev->size.z - 2 ) ) - m_flLip ) ); + m_vecPosition2 = m_vecPosition1 + ( pev->movedir * ( fabs( pev->movedir.x * ( pev->size.x - 2.0f ) ) + fabs( pev->movedir.y * ( pev->size.y - 2.0f ) ) + fabs( pev->movedir.z * ( pev->size.z - 2.0f ) ) - m_flLip ) ); ASSERTSZ( m_vecPosition1 != m_vecPosition2, "door start/end positions are equal" ); if( FBitSet( pev->spawnflags, SF_DOOR_START_OPEN ) ) { @@ -520,10 +520,8 @@ void CBaseDoor::Precache( void ) // void CBaseDoor::DoorTouch( CBaseEntity *pOther ) { - entvars_t *pevToucher = pOther->pev; - // Ignore touches by anything but players - if( !FClassnameIs( pevToucher, "player" ) ) + if( !pOther->IsPlayer() ) return; // If door has master, and it's not ready to trigger, @@ -542,7 +540,7 @@ void CBaseDoor::DoorTouch( CBaseEntity *pOther ) m_hActivator = pOther;// remember who activated the door - if( DoorActivate()) + if( DoorActivate() ) SetTouch( NULL ); // Temporarily disable the touch function, until movement is finished. } @@ -613,7 +611,7 @@ void CBaseDoor::DoorGoUp( void ) SetMoveDone( &CBaseDoor::DoorHitTop ); if( FClassnameIs( pev, "func_door_rotating" ) ) // !!! BUGBUG Triggered doors don't work with this yet { - float sign = 1.0; + float sign = 1.0f; if( m_hActivator != 0 ) { @@ -623,14 +621,14 @@ void CBaseDoor::DoorGoUp( void ) { Vector vec = pevActivator->origin - pev->origin; Vector angles = pevActivator->angles; - angles.x = 0; - angles.z = 0; + angles.x = 0.0f; + angles.z = 0.0f; UTIL_MakeVectors( angles ); - //Vector vnext = ( pevToucher->origin + ( pevToucher->velocity * 10 ) ) - pev->origin; + //Vector vnext = ( pevToucher->origin + ( pevToucher->velocity * 10.f ) ) - pev->origin; UTIL_MakeVectors( pevActivator->angles ); - Vector vnext = ( pevActivator->origin + ( gpGlobals->v_forward * 10 ) ) - pev->origin; - if( ( vec.x * vnext.y - vec.y * vnext.x ) < 0 ) - sign = -1.0; + Vector vnext = ( pevActivator->origin + ( gpGlobals->v_forward * 10.f ) ) - pev->origin; + if( ( vec.x * vnext.y - vec.y * vnext.x ) < 0.0f ) + sign = -1.0f; } } AngularMove( m_vecAngle2*sign, pev->speed ); @@ -647,7 +645,7 @@ void CBaseDoor::DoorHitTop( void ) if( !FBitSet( pev->spawnflags, SF_DOOR_SILENT ) ) { STOP_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMoving ) ); - EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseArrived ), 1, ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseArrived ), 1.0f, ATTN_NORM ); } ASSERT( m_toggle_state == TS_GOING_UP ); @@ -666,9 +664,9 @@ void CBaseDoor::DoorHitTop( void ) pev->nextthink = pev->ltime + m_flWait; SetThink( &CBaseDoor::DoorGoDown ); - if( m_flWait == -1 ) + if( m_flWait == -1.0f ) { - pev->nextthink = -1; + pev->nextthink = -1.0f; } } @@ -686,7 +684,7 @@ void CBaseDoor::DoorGoDown( void ) { if( !FBitSet( pev->spawnflags, SF_DOOR_SILENT ) ) if( m_toggle_state != TS_GOING_UP && m_toggle_state != TS_GOING_DOWN ) - EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMoving ), 1, ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMoving ), 1.0f, ATTN_NORM ); #ifdef DOOR_ASSERT ASSERT( m_toggle_state == TS_AT_TOP ); #endif // DOOR_ASSERT @@ -707,7 +705,7 @@ void CBaseDoor::DoorHitBottom( void ) if( !FBitSet( pev->spawnflags, SF_DOOR_SILENT ) ) { STOP_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMoving ) ); - EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseArrived ), 1, ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseArrived ), 1.0f, ATTN_NORM ); } ASSERT( m_toggle_state == TS_GOING_DOWN ); @@ -747,7 +745,7 @@ void CBaseDoor::Blocked( CBaseEntity *pOther ) // if a door has a negative wait, it would never come back if blocked, // so let it just squash the object to death real fast - if( m_flWait >= 0 ) + if( m_flWait >= 0.0f ) { // BMod Start - Door sound fix. if( !FBitSet( pev->spawnflags, SF_DOOR_SILENT ) ) @@ -780,7 +778,7 @@ void CBaseDoor::Blocked( CBaseEntity *pOther ) { pDoor = GetClassPtr( (CBaseDoor *)VARS( pentTarget ) ); - if( pDoor->m_flWait >= 0 ) + if( pDoor->m_flWait >= 0.0f ) { if( pDoor->pev->velocity == pev->velocity && pDoor->pev->avelocity == pev->velocity ) { @@ -868,8 +866,8 @@ void CRotDoor::Spawn( void ) // check for clockwise rotation if( FBitSet( pev->spawnflags, SF_DOOR_ROTATE_BACKWARDS ) ) - pev->movedir = pev->movedir * -1; - + pev->movedir = pev->movedir * -1.0f; + //m_flWait = 2; who the hell did this? (sjb) m_vecAngle1 = pev->angles; m_vecAngle2 = pev->angles + pev->movedir * m_flMoveDistance; @@ -885,8 +883,8 @@ void CRotDoor::Spawn( void ) UTIL_SetOrigin( pev, pev->origin ); SET_MODEL( ENT( pev ), STRING( pev->model ) ); - if( pev->speed == 0 ) - pev->speed = 100; + if( pev->speed == 0.0f ) + pev->speed = 100.0f; // DOOR_START_OPEN is to allow an entity to be lighted in the closed position // but spawn in the open position @@ -897,7 +895,7 @@ void CRotDoor::Spawn( void ) Vector vecSav = m_vecAngle1; m_vecAngle2 = m_vecAngle1; m_vecAngle1 = vecSav; - pev->movedir = pev->movedir * -1; + pev->movedir = pev->movedir * -1.0f; } m_toggle_state = TS_AT_BOTTOM; @@ -960,14 +958,14 @@ void CMomentaryDoor::Spawn( void ) UTIL_SetOrigin( pev, pev->origin ); SET_MODEL( ENT( pev ), STRING( pev->model ) ); - if( pev->speed == 0 ) - pev->speed = 100; - if( pev->dmg == 0 ) - pev->dmg = 2; + if( pev->speed == 0.0f ) + pev->speed = 100.0f; + if( pev->dmg == 0.0f ) + pev->dmg = 2.0f; m_vecPosition1 = pev->origin; // Subtract 2 from size because the engine expands bboxes by 1 in all directions making the size too big - m_vecPosition2 = m_vecPosition1 + ( pev->movedir * ( fabs( pev->movedir.x * ( pev->size.x - 2 ) ) + fabs( pev->movedir.y * ( pev->size.y - 2 ) ) + fabs( pev->movedir.z * ( pev->size.z - 2 ) ) - m_flLip ) ); + m_vecPosition2 = m_vecPosition1 + ( pev->movedir * ( fabs( pev->movedir.x * ( pev->size.x - 2.0f ) ) + fabs( pev->movedir.y * ( pev->size.y - 2.0f ) ) + fabs( pev->movedir.z * ( pev->size.z - 2.0f ) ) - m_flLip ) ); ASSERTSZ( m_vecPosition1 != m_vecPosition2, "door start/end positions are equal" ); if( FBitSet( pev->spawnflags, SF_DOOR_START_OPEN ) ) @@ -1091,23 +1089,23 @@ void CMomentaryDoor::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP if( useType != USE_SET ) // Momentary buttons will pass down a float in here return; - if( value > 1.0 ) - value = 1.0; - if( value < 0.0 ) - value = 0.0; + if( value > 1.0f ) + value = 1.0f; + if( value < 0.0f ) + value = 0.0f; Vector move = m_vecPosition1 + ( value * ( m_vecPosition2 - m_vecPosition1 ) ); Vector delta = move - pev->origin; - //float speed = delta.Length() * 10; - float speed = delta.Length() / 0.1; // move there in 0.1 sec + //float speed = delta.Length() * 10.0f; + float speed = delta.Length() / 0.1f; // move there in 0.1 sec if( speed != 0 ) { // This entity only thinks when it moves, so if it's thinking, it's in the process of moving // play the sound when it starts moving(not yet thinking) - if( pev->nextthink < pev->ltime || pev->nextthink == 0 ) - EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMoving ), 1, ATTN_NORM ); + if( pev->nextthink < pev->ltime || pev->nextthink == 0.0f ) + EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMoving ), 1.0f, ATTN_NORM ); // If we already moving to designated point, return else if( move == m_vecFinalDest ) return; @@ -1120,13 +1118,13 @@ void CMomentaryDoor::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP void CMomentaryDoor::MomentaryMoveDone( void ) { SetThink(&CMomentaryDoor::StopMoveSound); - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; } void CMomentaryDoor::StopMoveSound() { STOP_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseMoving ) ); - EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseArrived ), 1, ATTN_NORM ); - pev->nextthink = -1; + EMIT_SOUND( ENT( pev ), CHAN_STATIC, STRING( pev->noiseArrived ), 1.0f, ATTN_NORM ); + pev->nextthink = -1.0f; ResetThink(); } diff --git a/dlls/effects.cpp b/dlls/effects.cpp index bd12f8aa..e6ad257f 100644 --- a/dlls/effects.cpp +++ b/dlls/effects.cpp @@ -85,7 +85,7 @@ void CBubbling::Spawn( void ) if( !( pev->spawnflags & SF_BUBBLES_STARTOFF ) ) { SetThink( &CBubbling::FizzThink ); - pev->nextthink = gpGlobals->time + 2.0; + pev->nextthink = gpGlobals->time + 2.0f; m_state = 1; } else @@ -105,7 +105,7 @@ void CBubbling::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE use if( m_state ) { SetThink( &CBubbling::FizzThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } else { @@ -145,9 +145,9 @@ void CBubbling::FizzThink( void ) MESSAGE_END(); if( m_frequency > 19 ) - pev->nextthink = gpGlobals->time + 0.5; + pev->nextthink = gpGlobals->time + 0.5f; else - pev->nextthink = gpGlobals->time + 2.5 - ( 0.1 * m_frequency ); + pev->nextthink = gpGlobals->time + 2.5f - ( 0.1f * m_frequency ); } // -------------------------------------------------- @@ -453,7 +453,7 @@ void CLightning::Spawn( void ) if( pev->dmg > 0 ) { SetThink( &CLightning::DamageThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } if( pev->targetname ) { @@ -479,7 +479,7 @@ void CLightning::Spawn( void ) if( FStringNull( pev->targetname ) || FBitSet( pev->spawnflags, SF_BEAM_STARTON ) ) { SetThink( &CLightning::StrikeThink ); - pev->nextthink = gpGlobals->time + 1.0; + pev->nextthink = gpGlobals->time + 1.0f; } } } @@ -593,7 +593,7 @@ void CLightning::StrikeUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_T else { SetThink( &CLightning::StrikeThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } if( !FBitSet( pev->spawnflags, SF_BEAM_TOGGLE ) ) @@ -615,7 +615,7 @@ void CLightning::StrikeThink( void ) if( m_life != 0 ) { if( pev->spawnflags & SF_BEAM_RANDOM ) - pev->nextthink = gpGlobals->time + m_life + RANDOM_FLOAT( 0, m_restrike ); + pev->nextthink = gpGlobals->time + m_life + RANDOM_FLOAT( 0.0f, m_restrike ); else pev->nextthink = gpGlobals->time + m_life + m_restrike; } @@ -695,7 +695,7 @@ void CLightning::StrikeThink( void ) WRITE_SHORT( m_spriteTexture ); WRITE_BYTE( m_frameStart ); // framestart WRITE_BYTE( (int)pev->framerate ); // framerate - WRITE_BYTE( (int)( m_life * 10.0 ) ); // life + WRITE_BYTE( (int)( m_life * 10.0f ) ); // life WRITE_BYTE( m_boltWidth ); // width WRITE_BYTE( m_noiseAmplitude ); // noise WRITE_BYTE( (int)pev->rendercolor.x ); // r, g, b @@ -717,7 +717,7 @@ void CLightning::StrikeThink( void ) void CBeam::BeamDamage( TraceResult *ptr ) { RelinkBeam(); - if( ptr->flFraction != 1.0 && ptr->pHit != NULL ) + if( ptr->flFraction != 1.0f && ptr->pHit != NULL ) { CBaseEntity *pHit = CBaseEntity::Instance( ptr->pHit ); if( pHit ) @@ -737,7 +737,7 @@ void CBeam::BeamDamage( TraceResult *ptr ) void CLightning::DamageThink( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; TraceResult tr; UTIL_TraceLine( GetStartPos(), GetEndPos(), dont_ignore_monsters, NULL, &tr ); BeamDamage( &tr ); @@ -757,7 +757,7 @@ void CLightning::Zap( const Vector &vecSrc, const Vector &vecDest ) WRITE_SHORT( m_spriteTexture ); WRITE_BYTE( m_frameStart ); // framestart WRITE_BYTE( (int)pev->framerate ); // framerate - WRITE_BYTE( (int)( m_life * 10.0) ); // life + WRITE_BYTE( (int)( m_life * 10.0f ) ); // life WRITE_BYTE( m_boltWidth ); // width WRITE_BYTE( m_noiseAmplitude ); // noise WRITE_BYTE( (int)pev->rendercolor.x ); // r, g, b @@ -792,32 +792,32 @@ void CLightning::RandomArea( void ) { Vector vecSrc = pev->origin; - Vector vecDir1 = Vector( RANDOM_FLOAT( -1.0, 1.0 ), RANDOM_FLOAT( -1.0, 1.0 ),RANDOM_FLOAT( -1.0, 1.0 ) ); + Vector vecDir1 = Vector( RANDOM_FLOAT( -1.0f, 1.0f ), RANDOM_FLOAT( -1.0f, 1.0f ),RANDOM_FLOAT( -1.0f, 1.0f ) ); vecDir1 = vecDir1.Normalize(); TraceResult tr1; UTIL_TraceLine( vecSrc, vecSrc + vecDir1 * m_radius, ignore_monsters, ENT( pev ), &tr1 ); - if( tr1.flFraction == 1.0 ) + if( tr1.flFraction == 1.0f ) continue; Vector vecDir2; do { - vecDir2 = Vector( RANDOM_FLOAT( -1.0, 1.0 ), RANDOM_FLOAT( -1.0, 1.0 ),RANDOM_FLOAT( -1.0, 1.0 ) ); - } while( DotProduct( vecDir1, vecDir2 ) > 0 ); + vecDir2 = Vector( RANDOM_FLOAT( -1.0f, 1.0f ), RANDOM_FLOAT( -1.0f, 1.0f ),RANDOM_FLOAT( -1.0f, 1.0f ) ); + } while( DotProduct( vecDir1, vecDir2 ) > 0.0f ); vecDir2 = vecDir2.Normalize(); TraceResult tr2; UTIL_TraceLine( vecSrc, vecSrc + vecDir2 * m_radius, ignore_monsters, ENT( pev ), &tr2 ); - if( tr2.flFraction == 1.0 ) + if( tr2.flFraction == 1.0f ) continue; - if( ( tr1.vecEndPos - tr2.vecEndPos ).Length() < m_radius * 0.1 ) + if( ( tr1.vecEndPos - tr2.vecEndPos ).Length() < m_radius * 0.1f ) continue; UTIL_TraceLine( tr1.vecEndPos, tr2.vecEndPos, ignore_monsters, ENT( pev ), &tr2 ); - if( tr2.flFraction != 1.0 ) + if( tr2.flFraction != 1.0f ) continue; Zap( tr1.vecEndPos, tr2.vecEndPos ); @@ -832,15 +832,15 @@ void CLightning::RandomPoint( Vector &vecSrc ) for( iLoops = 0; iLoops < 10; iLoops++ ) { - Vector vecDir1 = Vector( RANDOM_FLOAT( -1.0, 1.0 ), RANDOM_FLOAT( -1.0, 1.0 ),RANDOM_FLOAT( -1.0, 1.0 ) ); + Vector vecDir1 = Vector( RANDOM_FLOAT( -1.0f, 1.0f ), RANDOM_FLOAT( -1.0f, 1.0f ), RANDOM_FLOAT( -1.0f, 1.0f ) ); vecDir1 = vecDir1.Normalize(); TraceResult tr1; UTIL_TraceLine( vecSrc, vecSrc + vecDir1 * m_radius, ignore_monsters, ENT( pev ), &tr1 ); - if( ( tr1.vecEndPos - vecSrc ).Length() < m_radius * 0.1 ) + if( ( tr1.vecEndPos - vecSrc ).Length() < m_radius * 0.1f ) continue; - if( tr1.flFraction == 1.0 ) + if( tr1.flFraction == 1.0f ) continue; Zap( vecSrc, tr1.vecEndPos ); @@ -1066,7 +1066,7 @@ void CLaser::StrikeThink( void ) UTIL_TraceLine( pev->origin, m_firePosition, dont_ignore_monsters, NULL, &tr ); FireAtPoint( tr ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } class CGlow : public CPointEntity @@ -1104,8 +1104,8 @@ void CGlow::Spawn( void ) SET_MODEL( ENT( pev ), STRING( pev->model ) ); m_maxFrame = (float) MODEL_FRAMES( pev->modelindex ) - 1; - if( m_maxFrame > 1.0 && pev->framerate != 0 ) - pev->nextthink = gpGlobals->time + 0.1; + if( m_maxFrame > 1.0f && pev->framerate != 0 ) + pev->nextthink = gpGlobals->time + 0.1f; m_lastTime = gpGlobals->time; } @@ -1114,7 +1114,7 @@ void CGlow::Think( void ) { Animate( pev->framerate * ( gpGlobals->time - m_lastTime ) ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; m_lastTime = gpGlobals->time; } @@ -1197,7 +1197,7 @@ void CSprite::AnimateThink( void ) { Animate( pev->framerate * ( gpGlobals->time - m_lastTime ) ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; m_lastTime = gpGlobals->time; } @@ -1234,7 +1234,7 @@ void CSprite::ExpandThink( void ) } else { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; m_lastTime = gpGlobals->time; } } @@ -1265,7 +1265,7 @@ void CSprite::TurnOff( void ) void CSprite::TurnOn( void ) { pev->effects = 0; - if( ( pev->framerate && m_maxFrame > 1.0 ) || ( pev->spawnflags & SF_SPRITE_ONCE ) ) + if( ( pev->framerate && m_maxFrame > 1.0f ) || ( pev->spawnflags & SF_SPRITE_ONCE ) ) { SetThink( &CSprite::AnimateThink ); pev->nextthink = gpGlobals->time; @@ -1422,9 +1422,9 @@ void CGibShooter::ShootThink( void ) vecShootDir = pev->movedir; - vecShootDir = vecShootDir + gpGlobals->v_right * RANDOM_FLOAT( -1, 1 ) * m_flVariance;; - vecShootDir = vecShootDir + gpGlobals->v_forward * RANDOM_FLOAT( -1, 1 ) * m_flVariance;; - vecShootDir = vecShootDir + gpGlobals->v_up * RANDOM_FLOAT( -1, 1 ) * m_flVariance;; + vecShootDir = vecShootDir + gpGlobals->v_right * RANDOM_FLOAT( -1.0f, 1.0f ) * m_flVariance;; + vecShootDir = vecShootDir + gpGlobals->v_forward * RANDOM_FLOAT( -1.0f, 1.0f ) * m_flVariance;; + vecShootDir = vecShootDir + gpGlobals->v_up * RANDOM_FLOAT( -1.0f, 1.0f ) * m_flVariance;; vecShootDir = vecShootDir.Normalize(); CGib *pGib = CreateGib(); @@ -1434,12 +1434,12 @@ void CGibShooter::ShootThink( void ) pGib->pev->origin = pev->origin; pGib->pev->velocity = vecShootDir * m_flGibVelocity; - pGib->pev->avelocity.x = RANDOM_FLOAT( 100, 200 ); - pGib->pev->avelocity.y = RANDOM_FLOAT( 100, 300 ); + pGib->pev->avelocity.x = RANDOM_FLOAT( 100.0f, 200.0f ); + pGib->pev->avelocity.y = RANDOM_FLOAT( 100.0f, 300.0f ); float thinkTime = pGib->pev->nextthink - gpGlobals->time; - pGib->m_lifeTime = ( m_flGibLife * RANDOM_FLOAT( 0.95, 1.05 ) ); // +/- 5% + pGib->m_lifeTime = ( m_flGibLife * RANDOM_FLOAT( 0.95f, 1.05f ) ); // +/- 5% if( pGib->m_lifeTime < thinkTime ) { pGib->pev->nextthink = gpGlobals->time + pGib->m_lifeTime; @@ -1584,7 +1584,7 @@ void CTestEffect::TestThink( void ) TraceResult tr; Vector vecSrc = pev->origin; - Vector vecDir = Vector( RANDOM_FLOAT( -1.0, 1.0 ), RANDOM_FLOAT( -1.0, 1.0 ),RANDOM_FLOAT( -1.0, 1.0 ) ); + Vector vecDir = Vector( RANDOM_FLOAT( -1.0f, 1.0f ), RANDOM_FLOAT( -1.0f, 1.0f ),RANDOM_FLOAT( -1.0f, 1.0f ) ); vecDir = vecDir.Normalize(); UTIL_TraceLine( vecSrc, vecSrc + vecDir * 128, ignore_monsters, ENT( pev ), &tr ); @@ -1598,7 +1598,7 @@ void CTestEffect::TestThink( void ) m_pBeam[m_iBeam] = pbeam; m_iBeam++; #if 0 - Vector vecMid = ( vecSrc + tr.vecEndPos ) * 0.5; + Vector vecMid = ( vecSrc + tr.vecEndPos ) * 0.5f; MESSAGE_BEGIN( MSG_BROADCAST, SVC_TEMPENTITY ); WRITE_BYTE( TE_DLIGHT ); WRITE_COORD( vecMid.x ); // X @@ -1614,15 +1614,15 @@ void CTestEffect::TestThink( void ) #endif } - if( t < 3.0 ) + if( t < 3.0f ) { for( i = 0; i < m_iBeam; i++ ) { - t = ( gpGlobals->time - m_flBeamTime[i] ) / ( 3 + m_flStartTime - m_flBeamTime[i] ); - m_pBeam[i]->SetBrightness( (int)( 255 * t ) ); + t = ( gpGlobals->time - m_flBeamTime[i] ) / ( 3.0f + m_flStartTime - m_flBeamTime[i] ); + m_pBeam[i]->SetBrightness( (int)( 255.0f * t ) ); // m_pBeam[i]->SetScrollRate( 20 * t ); } - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } else { @@ -1640,7 +1640,7 @@ void CTestEffect::TestThink( void ) void CTestEffect::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) { SetThink( &CTestEffect::TestThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; m_flStartTime = gpGlobals->time; } @@ -1740,7 +1740,7 @@ Vector CBlood::BloodPosition( CBaseEntity *pActivator ) else pPlayer = g_engfuncs.pfnPEntityOfEntIndex( 1 ); if( pPlayer ) - return( pPlayer->v.origin + pPlayer->v.view_ofs ) + Vector( RANDOM_FLOAT( -10, 10 ), RANDOM_FLOAT( -10, 10 ), RANDOM_FLOAT( -10, 10 ) ); + return( pPlayer->v.origin + pPlayer->v.view_ofs ) + Vector( RANDOM_FLOAT( -10.0f, 10.0f ), RANDOM_FLOAT( -10.0f, 10.0f ), RANDOM_FLOAT( -10.0f, 10.0f ) ); } return pev->origin; @@ -1760,7 +1760,7 @@ void CBlood::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useTyp TraceResult tr; UTIL_TraceLine( start, start + forward * BloodAmount() * 2, ignore_monsters, NULL, &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) UTIL_BloodDecalTrace( &tr, Color() ); } } @@ -1998,8 +1998,8 @@ void CMessage::Spawn( void ) pev->impulse = 0; // No volume, use normal - if( pev->scale <= 0 ) - pev->scale = 1.0; + if( pev->scale <= 0.0f ) + pev->scale = 1.0f; } void CMessage::Precache( void ) @@ -2197,7 +2197,7 @@ void CItemSoda::Spawn( void ) UTIL_SetSize( pev, Vector( 0, 0, 0 ), Vector( 0, 0, 0 ) ); SetThink( &CItemSoda::CanThink ); - pev->nextthink = gpGlobals->time + 0.5; + pev->nextthink = gpGlobals->time + 0.5f; } void CItemSoda::CanThink( void ) diff --git a/dlls/egon.cpp b/dlls/egon.cpp index 6f248309..a52e58ab 100644 --- a/dlls/egon.cpp +++ b/dlls/egon.cpp @@ -32,8 +32,8 @@ #define EGON_SOUND_RUN "weapons/egon_run3.wav" #define EGON_SOUND_STARTUP "weapons/egon_windup2.wav" -#define EGON_SWITCH_NARROW_TIME 0.75 // Time it takes to switch fire modes -#define EGON_SWITCH_WIDE_TIME 1.5 +#define EGON_SWITCH_NARROW_TIME 0.75f // Time it takes to switch fire modes +#define EGON_SWITCH_WIDE_TIME 1.5f enum egon_e { EGON_IDLE1 = 0, @@ -105,7 +105,7 @@ int CEgon::AddToPlayer( CBasePlayer *pPlayer ) void CEgon::Holster( int skiplocal /* = 0 */ ) { - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; SendWeaponAnim( EGON_HOLSTER ); EndAttack(); @@ -190,20 +190,20 @@ void CEgon::Attack( void ) { if( !HasAmmo() ) { - m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.25; + m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.25f; PlayEmptySound( ); return; } m_flAmmoUseTime = gpGlobals->time;// start using ammo ASAP. - PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usEgonFire, 0.0, g_vecZero, g_vecZero, 0.0, 0.0, m_fireState, m_fireMode, 1, 0 ); + PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usEgonFire, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, m_fireState, m_fireMode, 1, 0 ); m_shakeTime = 0; m_pPlayer->m_iWeaponVolume = EGON_PRIMARY_VOLUME; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.1; - pev->fuser1 = UTIL_WeaponTimeBase() + 2; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.1f; + pev->fuser1 = UTIL_WeaponTimeBase() + 2.0f; pev->dmgtime = gpGlobals->time + GetPulseInterval(); m_fireState = FIRE_CHARGE; @@ -216,14 +216,14 @@ void CEgon::Attack( void ) if( pev->fuser1 <= UTIL_WeaponTimeBase() ) { - PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usEgonFire, 0, g_vecZero, g_vecZero, 0.0, 0.0, m_fireState, m_fireMode, 0, 0 ); + PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usEgonFire, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, m_fireState, m_fireMode, 0, 0 ); pev->fuser1 = 1000; } if( !HasAmmo() ) { EndAttack(); - m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0; + m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0f; } break; } @@ -238,12 +238,12 @@ void CEgon::PrimaryAttack( void ) void CEgon::Fire( const Vector &vecOrigSrc, const Vector &vecDir ) { - Vector vecDest = vecOrigSrc + vecDir * 2048; + Vector vecDest = vecOrigSrc + vecDir * 2048.0f; edict_t *pentIgnore; TraceResult tr; pentIgnore = m_pPlayer->edict(); - Vector tmpSrc = vecOrigSrc + gpGlobals->v_up * -8 + gpGlobals->v_right * 3; + Vector tmpSrc = vecOrigSrc + gpGlobals->v_up * -8.0f + gpGlobals->v_right * 3.0f; // ALERT( at_console, "." ); @@ -292,7 +292,7 @@ void CEgon::Fire( const Vector &vecOrigSrc, const Vector &vecDir ) if( gpGlobals->time >= m_flAmmoUseTime ) { UseAmmo( 1 ); - m_flAmmoUseTime = gpGlobals->time + 0.1; + m_flAmmoUseTime = gpGlobals->time + 0.1f; } } else @@ -301,7 +301,7 @@ void CEgon::Fire( const Vector &vecOrigSrc, const Vector &vecDir ) if( gpGlobals->time >= m_flAmmoUseTime ) { UseAmmo( 1 ); - m_flAmmoUseTime = gpGlobals->time + 0.166; + m_flAmmoUseTime = gpGlobals->time + 0.166f; } } @@ -325,7 +325,7 @@ void CEgon::Fire( const Vector &vecOrigSrc, const Vector &vecDir ) if( g_pGameRules->IsMultiplayer() ) { // radius damage a little more potent in multiplayer. - ::RadiusDamage( tr.vecEndPos, pev, m_pPlayer->pev, gSkillData.plrDmgEgonWide/4, 128, CLASS_NONE, DMG_ENERGYBEAM | DMG_BLAST | DMG_ALWAYSGIB ); + ::RadiusDamage( tr.vecEndPos, pev, m_pPlayer->pev, gSkillData.plrDmgEgonWide * 0.25f, 128, CLASS_NONE, DMG_ENERGYBEAM | DMG_BLAST | DMG_ALWAYSGIB ); } if( !m_pPlayer->IsAlive() ) @@ -337,7 +337,7 @@ void CEgon::Fire( const Vector &vecOrigSrc, const Vector &vecDir ) if( gpGlobals->time >= m_flAmmoUseTime ) { UseAmmo( 1 ); - m_flAmmoUseTime = gpGlobals->time + 0.2; + m_flAmmoUseTime = gpGlobals->time + 0.2f; } } else @@ -346,15 +346,15 @@ void CEgon::Fire( const Vector &vecOrigSrc, const Vector &vecDir ) if( gpGlobals->time >= m_flAmmoUseTime ) { UseAmmo( 1 ); - m_flAmmoUseTime = gpGlobals->time + 0.1; + m_flAmmoUseTime = gpGlobals->time + 0.1f; } } pev->dmgtime = gpGlobals->time + GetDischargeInterval(); if( m_shakeTime < gpGlobals->time ) { - UTIL_ScreenShake( tr.vecEndPos, 5.0, 150.0, 0.75, 250.0 ); - m_shakeTime = gpGlobals->time + 1.5; + UTIL_ScreenShake( tr.vecEndPos, 5.0f, 150.0f, 0.75f, 250.0f ); + m_shakeTime = gpGlobals->time + 1.5f; } } #endif @@ -384,12 +384,12 @@ void CEgon::UpdateEffect( const Vector &startPoint, const Vector &endPoint, floa m_pBeam->SetWidth( (int)( 40 - ( timeBlend * 20 ) ) ); if( m_fireMode == FIRE_WIDE ) - m_pBeam->SetColor( (int)( 30 + ( 25 * timeBlend ) ), (int)( 30 + ( 30 * timeBlend ) ), (int)( 64 + 80 * fabs( sin( gpGlobals->time * 10 ) ) ) ); + m_pBeam->SetColor( (int)( 30 + ( 25 * timeBlend ) ), (int)( 30 + ( 30 * timeBlend ) ), (int)( 64 + 80 * fabs( sin( gpGlobals->time * 10.0f ) ) ) ); else - m_pBeam->SetColor( (int)( 60 + ( 25 * timeBlend ) ), (int)( 120 + ( 30 * timeBlend ) ), (int)( 64 + 80 * fabs( sin( gpGlobals->time *10 ) ) ) ); + m_pBeam->SetColor( (int)( 60 + ( 25 * timeBlend ) ), (int)( 120 + ( 30 * timeBlend ) ), (int)( 64 + 80 * fabs( sin( gpGlobals->time * 10.0f ) ) ) ); UTIL_SetOrigin( m_pSprite->pev, endPoint ); - m_pSprite->pev->frame += 8 * gpGlobals->frametime; + m_pSprite->pev->frame += 8.0f * gpGlobals->frametime; if( m_pSprite->pev->frame > m_pSprite->Frames() ) m_pSprite->pev->frame = 0; @@ -480,17 +480,17 @@ void CEgon::WeaponIdle( void ) int iAnim; - float flRand = RANDOM_FLOAT( 0, 1 ); + float flRand = RANDOM_FLOAT( 0.0f, 1.0f ); - if( flRand <= 0.5 ) + if( flRand <= 0.5f ) { iAnim = EGON_IDLE1; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10.0f, 15.0f ); } else { iAnim = EGON_FIDGET1; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0f; } SendWeaponAnim( iAnim ); @@ -504,10 +504,10 @@ void CEgon::EndAttack( void ) if( m_fireState != FIRE_OFF ) //Checking the button just in case!. bMakeNoise = true; - PLAYBACK_EVENT_FULL( FEV_GLOBAL | FEV_RELIABLE, m_pPlayer->edict(), m_usEgonStop, 0, m_pPlayer->pev->origin, m_pPlayer->pev->angles, 0.0, 0.0, bMakeNoise, 0, 0, 0 ); + PLAYBACK_EVENT_FULL( FEV_GLOBAL | FEV_RELIABLE, m_pPlayer->edict(), m_usEgonStop, 0.0f, m_pPlayer->pev->origin, m_pPlayer->pev->angles, 0.0f, 0.0f, bMakeNoise, 0, 0, 0 ); - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0; - m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0f; + m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5f; m_fireState = FIRE_OFF; diff --git a/dlls/explode.cpp b/dlls/explode.cpp index f605dc02..a5815ddb 100644 --- a/dlls/explode.cpp +++ b/dlls/explode.cpp @@ -38,21 +38,21 @@ LINK_ENTITY_TO_CLASS( spark_shower, CShower ) void CShower::Spawn( void ) { - pev->velocity = RANDOM_FLOAT( 200, 300 ) * pev->angles; - pev->velocity.x += RANDOM_FLOAT( -100.f, 100.f ); - pev->velocity.y += RANDOM_FLOAT( -100.f, 100.f ); + pev->velocity = RANDOM_FLOAT( 200.0f, 300.0f ) * pev->angles; + pev->velocity.x += RANDOM_FLOAT( -100.0f, 100.0f ); + pev->velocity.y += RANDOM_FLOAT( -100.0f, 100.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; pev->movetype = MOVETYPE_BOUNCE; pev->gravity = 0.5; - pev->nextthink = gpGlobals->time + 0.1; + 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 ); pev->effects |= EF_NODRAW; - pev->speed = RANDOM_FLOAT( 0.5, 1.5 ); + pev->speed = RANDOM_FLOAT( 0.5f, 1.5f ); pev->angles = g_vecZero; } @@ -61,9 +61,9 @@ void CShower::Think( void ) { UTIL_Sparks( pev->origin ); - pev->speed -= 0.1; - if( pev->speed > 0 ) - pev->nextthink = gpGlobals->time + 0.1; + pev->speed -= 0.1f; + if( pev->speed > 0.0f ) + pev->nextthink = gpGlobals->time + 0.1f; else UTIL_Remove( this ); pev->flags &= ~FL_ONGROUND; @@ -72,12 +72,12 @@ void CShower::Think( void ) void CShower::Touch( CBaseEntity *pOther ) { if( pev->flags & FL_ONGROUND ) - pev->velocity = pev->velocity * 0.1; + 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 ) - pev->speed = 0; + if( ( pev->velocity.x * pev->velocity.x + pev->velocity.y * pev->velocity.y ) < 10.0f ) + pev->speed = 0.0f; } class CEnvExplosion : public CBaseMonster @@ -130,17 +130,17 @@ void CEnvExplosion::Spawn( void ) */ float flSpriteScale; - flSpriteScale = ( m_iMagnitude - 50 ) * 0.6; + flSpriteScale = ( m_iMagnitude - 50 ) * 0.6f; /* - if( flSpriteScale > 50 ) + if( flSpriteScale > 50.0f ) { - flSpriteScale = 50; + flSpriteScale = 50.0f; } */ - if( flSpriteScale < 10 ) + if( flSpriteScale < 10.0f ) { - flSpriteScale = 10; + flSpriteScale = 10.0f; } m_spriteScale = (int)flSpriteScale; @@ -155,14 +155,14 @@ void CEnvExplosion::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE Vector vecSpot;// trace starts here! - vecSpot = pev->origin + Vector( 0, 0, 8 ); + vecSpot = pev->origin + Vector( 0.0f, 0.0f, 8.0f ); - UTIL_TraceLine( vecSpot, vecSpot + Vector( 0, 0, -40 ), ignore_monsters, ENT( pev ), &tr ); + UTIL_TraceLine( vecSpot, vecSpot + Vector( 0.0f, 0.0f, -40.0f ), ignore_monsters, ENT( pev ), &tr ); // Pull out of the wall a bit - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { - pev->origin = tr.vecEndPos + ( tr.vecPlaneNormal * ( m_iMagnitude - 24 ) * 0.6 ); + pev->origin = tr.vecEndPos + ( tr.vecPlaneNormal * ( m_iMagnitude - 24 ) * 0.6f ); } else { @@ -172,7 +172,7 @@ void CEnvExplosion::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE // draw decal if( !( pev->spawnflags & SF_ENVEXPLOSION_NODECAL ) ) { - if( RANDOM_FLOAT( 0, 1 ) < 0.5 ) + if( RANDOM_FLOAT( 0.0f, 1.0f ) < 0.5f ) { UTIL_DecalTrace( &tr, DECAL_SCORCH1 ); } @@ -217,7 +217,7 @@ void CEnvExplosion::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE } SetThink( &CEnvExplosion::Smoke ); - pev->nextthink = gpGlobals->time + 0.3; + pev->nextthink = gpGlobals->time + 0.3f; // draw sparks if( !( pev->spawnflags & SF_ENVEXPLOSION_NOSPARKS ) ) diff --git a/dlls/extdll.h b/dlls/extdll.h index 4610db5e..eb8c37ec 100644 --- a/dlls/extdll.h +++ b/dlls/extdll.h @@ -51,19 +51,26 @@ #ifndef TRUE #define TRUE (!FALSE) #endif +#include +#include typedef unsigned int ULONG; typedef unsigned char BYTE; typedef int BOOL; #define MAX_PATH PATH_MAX -#include -#include +#ifndef PATH_MAX +#define PATH_MAX 4096 +#endif #endif //_WIN32 // Misc C-runtime library headers -#include "stdio.h" -#include "stdlib.h" -#include "stddef.h" -#include "math.h" +#include +#include +#include +#include + +#ifndef M_PI_F +#define M_PI_F (float)M_PI +#endif #if defined(__LP64__) || defined(__LLP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) #define XASH_64BIT diff --git a/dlls/flyingmonster.cpp b/dlls/flyingmonster.cpp index c9822898..424f1dec 100644 --- a/dlls/flyingmonster.cpp +++ b/dlls/flyingmonster.cpp @@ -36,18 +36,18 @@ int CFlyingMonster::CheckLocalMove( const Vector &vecStart, const Vector &vecEnd TraceResult tr; - UTIL_TraceHull( vecStart + Vector( 0, 0, 32 ), vecEnd + Vector( 0, 0, 32 ), dont_ignore_monsters, large_hull, edict(), &tr ); + UTIL_TraceHull( vecStart + Vector( 0.0f, 0.0f, 32.0f ), vecEnd + Vector( 0.0f, 0.0f, 32.0f ), dont_ignore_monsters, large_hull, edict(), &tr ); // ALERT( at_console, "%.0f %.0f %.0f : ", vecStart.x, vecStart.y, vecStart.z ); // ALERT( at_console, "%.0f %.0f %.0f\n", vecEnd.x, vecEnd.y, vecEnd.z ); if( pflDist ) { - *pflDist = ( ( tr.vecEndPos - Vector( 0, 0, 32 ) ) - vecStart ).Length();// get the distance. + *pflDist = ( ( tr.vecEndPos - Vector( 0.0f, 0.0f, 32.0f ) ) - vecStart ).Length();// get the distance. } // ALERT( at_console, "check %d %d %f\n", tr.fStartSolid, tr.fAllSolid, tr.flFraction ); - if( tr.fStartSolid || tr.flFraction < 1.0 ) + if( tr.fStartSolid || tr.flFraction < 1.0f ) { if( pTarget && pTarget->edict() == gpGlobals->trace_ent ) return LOCALMOVE_VALID; @@ -78,8 +78,8 @@ void CFlyingMonster::Stop( void ) m_flightSpeed = 0; m_IdealActivity = stopped; } - pev->angles.z = 0; - pev->angles.x = 0; + pev->angles.z = 0.0f; + pev->angles.x = 0.0f; m_vecTravel = g_vecZero; } @@ -88,16 +88,16 @@ float CFlyingMonster::ChangeYaw( int speed ) if( pev->movetype == MOVETYPE_FLY ) { float diff = FlYawDiff(); - float target = 0; + float target = 0.0f; if( m_IdealActivity != GetStoppedActivity() ) { - if( diff < -20 ) - target = 90; - else if( diff > 20 ) - target = -90; + if( diff < -20.0f ) + target = 90.0f; + else if( diff > 20.0f ) + target = -90.0f; } - pev->angles.z = UTIL_Approach( target, pev->angles.z, 220.0 * gpGlobals->frametime ); + pev->angles.z = UTIL_Approach( target, pev->angles.z, 220.0f * gpGlobals->frametime ); } return CBaseMonster::ChangeYaw( speed ); } @@ -141,7 +141,7 @@ BOOL CFlyingMonster::ShouldAdvanceRoute( float flWaypointDist ) if( m_Route[m_iRouteIndex].iType & bits_MF_IS_GOAL ) flWaypointDist = ( m_Route[m_iRouteIndex].vecLocation - pev->origin ).Length(); - if( flWaypointDist <= 64 + ( m_flGroundSpeed * gpGlobals->frametime ) ) + if( flWaypointDist <= 64.0f + ( m_flGroundSpeed * gpGlobals->frametime ) ) return TRUE; return FALSE; @@ -151,7 +151,7 @@ void CFlyingMonster::MoveExecute( CBaseEntity *pTargetEnt, const Vector &vecDir, { if( pev->movetype == MOVETYPE_FLY ) { - if( gpGlobals->time - m_stopTime > 1.0 ) + if( gpGlobals->time - m_stopTime > 1.0f ) { if( m_IdealActivity != m_movementActivity ) { @@ -163,12 +163,12 @@ void CFlyingMonster::MoveExecute( CBaseEntity *pTargetEnt, const Vector &vecDir, if( m_IdealActivity != m_movementActivity ) { - m_flightSpeed = UTIL_Approach( 100, m_flightSpeed, 75 * gpGlobals->frametime ); + m_flightSpeed = UTIL_Approach( 100, m_flightSpeed, 75.0f * gpGlobals->frametime ); if( m_flightSpeed < 100 ) m_stopTime = gpGlobals->time; } else - m_flightSpeed = UTIL_Approach( 20, m_flightSpeed, 300 * gpGlobals->frametime ); + m_flightSpeed = UTIL_Approach( 20, m_flightSpeed, 300.0f * gpGlobals->frametime ); if( CheckLocalMove( pev->origin, vecMove, pTargetEnt, NULL ) ) { @@ -193,10 +193,10 @@ float CFlyingMonster::CeilingZ( const Vector &position ) Vector minUp = position; Vector maxUp = position; - maxUp.z += 4096.0; + maxUp.z += 4096.0f; UTIL_TraceLine( position, maxUp, ignore_monsters, NULL, &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) maxUp.z = tr.vecEndPos.z; if( ( pev->flags ) & FL_SWIM ) @@ -214,7 +214,7 @@ BOOL CFlyingMonster::ProbeZ( const Vector &position, const Vector &probe, float // SWIMING & !WATER // or FLYING & WATER // - *pFraction = 0.0; + *pFraction = 0.0f; return TRUE; // We hit a water boundary because we are where we don't belong. } int conProbe = UTIL_PointContents( probe ); @@ -223,7 +223,7 @@ BOOL CFlyingMonster::ProbeZ( const Vector &position, const Vector &probe, float // The probe is either entirely inside the water (for fish) or entirely // outside the water (for birds). // - *pFraction = 1.0; + *pFraction = 1.0f; return FALSE; } @@ -233,9 +233,9 @@ BOOL CFlyingMonster::ProbeZ( const Vector &position, const Vector &probe, float float minProbeLength = 0; float diff = maxProbeLength - minProbeLength; - while( diff > 1.0 ) + while( diff > 1.0f ) { - float midProbeLength = minProbeLength + diff / 2.0; + float midProbeLength = minProbeLength + diff / 2.0f; Vector midProbeVec = midProbeLength * ProbeUnit; if( UTIL_PointContents( position + midProbeVec ) == conPosition ) { @@ -257,11 +257,11 @@ float CFlyingMonster::FloorZ( const Vector &position ) TraceResult tr; Vector down = position; - down.z -= 2048; + down.z -= 2048.0f; UTIL_TraceLine( position, down, ignore_monsters, NULL, &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) return tr.vecEndPos.z; return down.z; diff --git a/dlls/func_break.cpp b/dlls/func_break.cpp index 0cc3675f..98432d06 100644 --- a/dlls/func_break.cpp +++ b/dlls/func_break.cpp @@ -271,7 +271,7 @@ void CBreakable::MaterialSoundRandom( edict_t *pEdict, Materials soundMaterial, pSoundList = MaterialSoundList( soundMaterial, soundCount ); if( soundCount ) - EMIT_SOUND( pEdict, CHAN_BODY, pSoundList[RANDOM_LONG( 0, soundCount - 1 )], volume, 1.0 ); + EMIT_SOUND( pEdict, CHAN_BODY, pSoundList[RANDOM_LONG( 0, soundCount - 1 )], volume, 1.0f ); } void CBreakable::Precache( void ) @@ -432,7 +432,7 @@ void CBreakable::BreakTouch( CBaseEntity *pOther ) if( FBitSet( pev->spawnflags, SF_BREAK_TOUCH ) ) { // can be broken when run into - flDamage = pevToucher->velocity.Length() * 0.01; + flDamage = pevToucher->velocity.Length() * 0.01f; if( flDamage >= pev->health ) { @@ -453,10 +453,10 @@ void CBreakable::BreakTouch( CBaseEntity *pOther ) SetThink( &CBreakable::Die ); SetTouch( NULL ); - if( m_flDelay == 0 ) + if( m_flDelay == 0.0f ) { // !!!BUGBUG - why doesn't zero delay work? - m_flDelay = 0.1; + m_flDelay = 0.1f; } pev->nextthink = pev->ltime + m_flDelay; @@ -491,7 +491,7 @@ void CBreakable::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vec { UTIL_Sparks( ptr->vecEndPos ); - float flVolume = RANDOM_FLOAT( 0.7 , 1.0 );//random volume range + float flVolume = RANDOM_FLOAT( 0.7f, 1.0f );//random volume range switch( RANDOM_LONG( 0, 1 ) ) { case 0: @@ -504,7 +504,7 @@ void CBreakable::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vec } break; case matUnbreakableGlass: - UTIL_Ricochet( ptr->vecEndPos, RANDOM_FLOAT( 0.5, 1.5 ) ); + UTIL_Ricochet( ptr->vecEndPos, RANDOM_FLOAT( 0.5f, 1.5f ) ); break; default: break; @@ -527,7 +527,7 @@ int CBreakable::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, flo // (that is, no actual entity projectile was involved in the attack so use the shooter's origin). if( pevAttacker == pevInflictor ) { - vecTemp = pevInflictor->origin - ( pev->absmin + ( pev->size * 0.5 ) ); + vecTemp = pevInflictor->origin - ( pev->absmin + ( pev->size * 0.5f ) ); // if a client hit the breakable with a crowbar, and breakable is crowbar-sensitive, break it now. if( FBitSet ( pevAttacker->flags, FL_CLIENT ) && @@ -537,7 +537,7 @@ int CBreakable::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, flo else // an actual missile was involved. { - vecTemp = pevInflictor->origin - ( pev->absmin + ( pev->size * 0.5 ) ); + vecTemp = pevInflictor->origin - ( pev->absmin + ( pev->size * 0.5f ) ); } if( !IsBreakable() ) @@ -545,11 +545,11 @@ int CBreakable::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, flo // Breakables take double damage from the crowbar if( bitsDamageType & DMG_CLUB ) - flDamage *= 2; + flDamage *= 2.0f; // Boxes / glass / etc. don't take much poison damage, just the impact of the dart - consider that 10% if( bitsDamageType & DMG_POISON ) - flDamage *= 0.1; + flDamage *= 0.1f; // this global is still used for glass and other non-monster killables, along with decals. g_vecAttackDir = vecTemp.Normalize(); @@ -586,10 +586,10 @@ void CBreakable::Die( void ) // The more negative pev->health, the louder // the sound should be. - fvol = RANDOM_FLOAT( 0.85, 1.0 ) + ( fabs( pev->health ) / 100.0 ); + fvol = RANDOM_FLOAT( 0.85f, 1.0 ) + ( fabs( pev->health ) / 100.0f ); - if( fvol > 1.0 ) - fvol = 1.0; + if( fvol > 1.0f ) + fvol = 1.0f; switch( m_Material ) { @@ -667,7 +667,7 @@ void CBreakable::Die( void ) } if( m_Explosion == expDirected ) - vecVelocity = g_vecAttackDir * 200; + vecVelocity = g_vecAttackDir * 200.0f; else { vecVelocity.x = 0; @@ -675,7 +675,7 @@ void CBreakable::Die( void ) vecVelocity.z = 0; } - vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5; + vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5f; MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, vecSpot ); WRITE_BYTE( TE_BREAKMODEL ); @@ -710,11 +710,11 @@ void CBreakable::Die( void ) WRITE_BYTE( cFlag ); MESSAGE_END(); - float size = pev->size.x; + /*float size = pev->size.x; if( size < pev->size.y ) size = pev->size.y; if( size < pev->size.z ) - size = pev->size.z; + size = pev->size.z;*/ // !!! HACK This should work! // Build a box above the entity that looks like an 8 pixel high sheet @@ -744,7 +744,7 @@ void CBreakable::Die( void ) SUB_UseTargets( NULL, USE_TOGGLE, 0 ); SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; if( m_iszSpawnObject ) CBaseEntity::Create( STRING( m_iszSpawnObject ), VecBModelOrigin( pev ), pev->angles, edict() ); @@ -838,7 +838,7 @@ void CPushable::Spawn( void ) UTIL_SetOrigin( pev, pev->origin ); // Multiply by area of the box's cross-section (assume 1000 units^3 standard volume) - pev->skin = (int)( ( pev->skin * ( pev->maxs.x - pev->mins.x ) * ( pev->maxs.y - pev->mins.y ) ) * 0.0005 ); + pev->skin = (int)( ( pev->skin * ( pev->maxs.x - pev->mins.x ) * ( pev->maxs.y - pev->mins.y ) ) * 0.0005f ); m_soundTime = 0; } @@ -862,11 +862,11 @@ void CPushable::KeyValue( KeyValueData *pkvd ) { case 0: // Point - UTIL_SetSize( pev, Vector( -8, -8, -8 ), Vector( 8, 8, 8 ) ); + UTIL_SetSize( pev, Vector( -8.0f, -8.0f, -8.0f ), Vector( 8.0f, 8.0f, 8.0f ) ); break; case 2: // Big Hull!?!? !!!BUGBUG Figure out what this hull really is - UTIL_SetSize( pev, VEC_DUCK_HULL_MIN*2, VEC_DUCK_HULL_MAX * 2 ); + UTIL_SetSize( pev, VEC_DUCK_HULL_MIN * 2.0f, VEC_DUCK_HULL_MAX * 2.0f ); break; case 3: // Player duck @@ -920,7 +920,7 @@ void CPushable::Move( CBaseEntity *pOther, int push ) { // Only push if floating if( pev->waterlevel > 0 ) - pev->velocity.z += pevToucher->velocity.z * 0.1; + pev->velocity.z += pevToucher->velocity.z * 0.1f; return; } @@ -943,13 +943,13 @@ void CPushable::Move( CBaseEntity *pOther, int push ) if( pev->waterlevel < 1 ) return; else - factor = 0.1; + factor = 0.1f; } else - factor = 1; + factor = 1.0f; } else - factor = 0.25; + factor = 0.25f; pev->velocity.x += pevToucher->velocity.x * factor; pev->velocity.y += pevToucher->velocity.y * factor; @@ -964,15 +964,15 @@ void CPushable::Move( CBaseEntity *pOther, int push ) { pevToucher->velocity.x = pev->velocity.x; pevToucher->velocity.y = pev->velocity.y; - if( ( gpGlobals->time - m_soundTime ) > 0.7 ) + if( ( gpGlobals->time - m_soundTime ) > 0.7f ) { m_soundTime = gpGlobals->time; if( length > 0 && FBitSet( pev->flags,FL_ONGROUND ) ) { m_lastSound = RANDOM_LONG( 0, 2 ); - EMIT_SOUND( ENT( pev ), CHAN_WEAPON, m_soundNames[m_lastSound], 0.5, ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_WEAPON, m_soundNames[m_lastSound], 0.5f, ATTN_NORM ); //SetThink( &StopSound ); - //pev->nextthink = pev->ltime + 0.1; + //pev->nextthink = pev->ltime + 0.1f; } else STOP_SOUND( ENT( pev ), CHAN_WEAPON, m_soundNames[m_lastSound] ); diff --git a/dlls/func_tank.cpp b/dlls/func_tank.cpp index a3dba841..fd6ff1e7 100644 --- a/dlls/func_tank.cpp +++ b/dlls/func_tank.cpp @@ -66,7 +66,7 @@ public: virtual int ObjectCaps( void ) { return CBaseEntity :: ObjectCaps() & ~FCAP_ACROSS_TRANSITION; } inline BOOL IsActive( void ) { return (pev->spawnflags & SF_TANK_ACTIVE)?TRUE:FALSE; } - inline void TankActivate( void ) { pev->spawnflags |= SF_TANK_ACTIVE; pev->nextthink = pev->ltime + 0.1; m_fireLast = 0; } + inline void TankActivate( void ) { pev->spawnflags |= SF_TANK_ACTIVE; pev->nextthink = pev->ltime + 0.1f; m_fireLast = 0; } inline void TankDeactivate( void ) { pev->spawnflags &= ~SF_TANK_ACTIVE; m_fireLast = 0; StopRotSound(); } inline BOOL CanFire( void ) { return (gpGlobals->time - m_lastSightTime) < m_persist; } BOOL InRange( float range ); @@ -185,7 +185,7 @@ void CFuncTank::Spawn( void ) m_pitchCenter = pev->angles.x; if( IsActive() ) - pev->nextthink = pev->ltime + 1.0; + pev->nextthink = pev->ltime + 1.0f; m_sightOrigin = BarrelPosition(); // Point at the end of the barrel @@ -363,7 +363,7 @@ BOOL CFuncTank::StartControl( CBasePlayer *pController ) m_pController->m_iHideHUD |= HIDEHUD_WEAPONS; m_vecControllerUsePos = m_pController->pev->origin; - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; return TRUE; } @@ -389,7 +389,7 @@ void CFuncTank::StopControl() m_pController = NULL; if( IsActive() ) - pev->nextthink = pev->ltime + 1.0; + pev->nextthink = pev->ltime + 1.0f; } // Called each frame by the player's ItemPostFrame @@ -405,7 +405,7 @@ void CFuncTank::ControllerPostFrame( void ) Vector vecForward; UTIL_MakeVectorsPrivate( pev->angles, vecForward, NULL, NULL ); - m_fireLast = gpGlobals->time - ( 1 / m_fireRate ) - 0.01; // to make sure the gun doesn't fire too many bullets + m_fireLast = gpGlobals->time - ( 1.0f / m_fireRate ) - 0.01f; // to make sure the gun doesn't fire too many bullets Fire( BarrelPosition(), vecForward, m_pController->pev ); @@ -413,7 +413,7 @@ void CFuncTank::ControllerPostFrame( void ) if( m_pController && m_pController->IsPlayer() ) ( (CBasePlayer *)m_pController )->m_iWeaponVolume = LOUD_GUN_VOLUME; - m_flNextAttack = gpGlobals->time + ( 1 / m_fireRate ); + m_flNextAttack = gpGlobals->time + ( 1.0f / m_fireRate ); } } ////////////// END NEW STUFF ////////////// @@ -491,19 +491,19 @@ void CFuncTank::TrackTarget( void ) // Tanks attempt to mirror the player's angles angles = m_pController->pev->v_angle; angles[0] = 0 - angles[0]; - pev->nextthink = pev->ltime + 0.05; + pev->nextthink = pev->ltime + 0.05f; } else { if( IsActive() ) - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; else return; if( FNullEnt( pPlayer ) ) { if( IsActive() ) - pev->nextthink = pev->ltime + 2; // Wait 2 secs + pev->nextthink = pev->ltime + 2.0f; // Wait 2 secs return; } pTarget = FindTarget( pPlayer ); @@ -520,7 +520,7 @@ void CFuncTank::TrackTarget( void ) UTIL_TraceLine( barrelEnd, targetPosition, dont_ignore_monsters, edict(), &tr ); - if( tr.flFraction == 1.0 || tr.pHit == pTarget ) + if( tr.flFraction == 1.0f || tr.pHit == pTarget ) { CBaseEntity *pInstance = CBaseEntity::Instance(pTarget); if( InRange( range ) && pInstance && pInstance->IsAlive() ) @@ -626,12 +626,12 @@ void CFuncTank::AdjustAnglesForBarrel( Vector &angles, float distance ) if( m_barrelPos.y ) { r2 = m_barrelPos.y * m_barrelPos.y; - angles.y += ( 180.0 / M_PI ) * atan2( m_barrelPos.y, sqrt( d2 - r2 ) ); + angles.y += ( 180.0f / M_PI_F ) * atan2( m_barrelPos.y, sqrt( d2 - r2 ) ); } if( m_barrelPos.z ) { r2 = m_barrelPos.z * m_barrelPos.z; - angles.x += ( 180.0 / M_PI ) * atan2( -m_barrelPos.z, sqrt( d2 - r2 ) ); + angles.x += ( 180.0f / M_PI_F ) * atan2( -m_barrelPos.z, sqrt( d2 - r2 ) ); } } } @@ -644,9 +644,9 @@ void CFuncTank::Fire( const Vector &barrelEnd, const Vector &forward, entvars_t if( m_iszSpriteSmoke ) { CSprite *pSprite = CSprite::SpriteCreate( STRING( m_iszSpriteSmoke ), barrelEnd, TRUE ); - pSprite->AnimateAndDie( RANDOM_FLOAT( 15.0, 20.0 ) ); + pSprite->AnimateAndDie( RANDOM_FLOAT( 15.0f, 20.0f ) ); pSprite->SetTransparency( kRenderTransAlpha, (int)pev->rendercolor.x, (int)pev->rendercolor.y, (int)pev->rendercolor.z, 255, kRenderFxNone ); - pSprite->pev->velocity.z = RANDOM_FLOAT( 40, 80 ); + pSprite->pev->velocity.z = RANDOM_FLOAT( 40.0f, 80.0f ); pSprite->SetScale( m_spriteScale ); } if( m_iszSpriteFlash ) @@ -657,7 +657,7 @@ void CFuncTank::Fire( const Vector &barrelEnd, const Vector &forward, entvars_t pSprite->SetScale( m_spriteScale ); // Hack Hack, make it stick around for at least 100 ms. - pSprite->pev->nextthink += 0.1; + pSprite->pev->nextthink += 0.1f; } SUB_UseTargets( this, USE_TOGGLE, 0 ); } @@ -670,8 +670,8 @@ void CFuncTank::TankTrace( const Vector &vecStart, const Vector &vecForward, con float x, y, z; do { - x = RANDOM_FLOAT( -0.5, 0.5 ) + RANDOM_FLOAT( -0.5, 0.5 ); - y = RANDOM_FLOAT( -0.5, 0.5 ) + RANDOM_FLOAT( -0.5, 0.5 ); + x = RANDOM_FLOAT( -0.5f, 0.5f ) + RANDOM_FLOAT( -0.5f, 0.5f ); + y = RANDOM_FLOAT( -0.5f, 0.5f ) + RANDOM_FLOAT( -0.5f, 0.5f ); z = x * x + y * y; } while( z > 1 ); Vector vecDir = vecForward + @@ -847,7 +847,7 @@ void CFuncTankLaser::Fire( const Vector &barrelEnd, const Vector &forward, entva m_laserTime = gpGlobals->time; m_pLaser->TurnOn(); - m_pLaser->pev->dmgtime = gpGlobals->time - 1.0; + m_pLaser->pev->dmgtime = gpGlobals->time - 1.0f; m_pLaser->FireAtPoint( tr ); m_pLaser->pev->nextthink = 0; } @@ -1014,7 +1014,7 @@ void CFuncTankControls::Spawn( void ) UTIL_SetSize( pev, pev->mins, pev->maxs ); UTIL_SetOrigin( pev, pev->origin ); - pev->nextthink = gpGlobals->time + 0.3; // After all the func_tank's have spawned + pev->nextthink = gpGlobals->time + 0.3f; // After all the func_tank's have spawned CBaseEntity::Spawn(); } diff --git a/dlls/gamerules.cpp b/dlls/gamerules.cpp index f59788c4..bfbbf59e 100644 --- a/dlls/gamerules.cpp +++ b/dlls/gamerules.cpp @@ -303,6 +303,11 @@ void CGameRules::RefreshSkillData ( void ) gSkillData.plrArm = GetSkillCvar( "sk_player_arm" ); } +void CGameRules::ClientUserInfoChanged( CBasePlayer *pPlayer, char *infobuffer ) +{ + pPlayer->SetPrefsFromUserinfo( infobuffer ); +} + //========================================================= // instantiate the proper game rules object //========================================================= diff --git a/dlls/gamerules.h b/dlls/gamerules.h index 04c6eea5..22c73a47 100644 --- a/dlls/gamerules.h +++ b/dlls/gamerules.h @@ -98,7 +98,7 @@ public: virtual BOOL AllowAutoTargetCrosshair( void ) { return TRUE; }; virtual BOOL ClientCommand( CBasePlayer *pPlayer, const char *pcmd ) { return FALSE; }; // handles the user commands; returns TRUE if command handled properly - virtual void ClientUserInfoChanged( CBasePlayer *pPlayer, char *infobuffer ) {} // the player has changed userinfo; can change it now + virtual void ClientUserInfoChanged( CBasePlayer *pPlayer, char *infobuffer ); // the player has changed userinfo; can change it now // Client kills/scoring virtual int IPointsForKill( CBasePlayer *pAttacker, CBasePlayer *pKilled ) = 0;// how many points do I award whoever kills this player? diff --git a/dlls/gargantua.cpp b/dlls/gargantua.cpp index f3155d7f..b82bb02f 100644 --- a/dlls/gargantua.cpp +++ b/dlls/gargantua.cpp @@ -34,7 +34,7 @@ //========================================================= // Gargantua Monster //========================================================= -const float GARG_ATTACKDIST = 80.0; +const float GARG_ATTACKDIST = 80.0f; // Garg animation events #define GARG_AE_SLASH_LEFT 1 @@ -43,7 +43,7 @@ const float GARG_ATTACKDIST = 80.0; #define GARG_AE_RIGHT_FOOT 4 #define GARG_AE_STOMP 5 #define GARG_AE_BREATHE 6 -#define STOMP_FRAMETIME 0.015 // gpGlobals->frametime +#define STOMP_FRAMETIME 0.015f // gpGlobals->frametime // Gargantua is immune to any damage but this #define GARG_DAMAGE (DMG_ENERGYBEAM|DMG_CRUSH|DMG_MORTAR|DMG_BLAST) @@ -114,16 +114,16 @@ void CStomp::Spawn( void ) pev->model = MAKE_STRING( GARG_STOMP_SPRITE_NAME ); pev->rendermode = kRenderTransTexture; pev->renderamt = 0; - EMIT_SOUND_DYN( edict(), CHAN_BODY, GARG_STOMP_BUZZ_SOUND, 1, ATTN_NORM, 0, PITCH_NORM * 0.55 ); + EMIT_SOUND_DYN( edict(), CHAN_BODY, GARG_STOMP_BUZZ_SOUND, 1, ATTN_NORM, 0, PITCH_NORM * 0.55f ); } -#define STOMP_INTERVAL 0.025 +#define STOMP_INTERVAL 0.025f void CStomp::Think( void ) { TraceResult tr; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; // Do damage for this frame Vector vecStart = pev->origin; @@ -145,7 +145,7 @@ void CStomp::Think( void ) // Accelerate the effect pev->speed = pev->speed + ( STOMP_FRAMETIME ) * pev->framerate; - pev->framerate = pev->framerate + ( STOMP_FRAMETIME ) * 1500; + pev->framerate = pev->framerate + ( STOMP_FRAMETIME ) * 1500.0f; // Move and spawn trails while( gpGlobals->time - pev->dmgtime > STOMP_INTERVAL ) @@ -158,9 +158,9 @@ void CStomp::Think( void ) { UTIL_TraceLine( pev->origin, pev->origin - Vector( 0, 0, 500 ), ignore_monsters, edict(), &tr ); pSprite->pev->origin = tr.vecEndPos; - pSprite->pev->velocity = Vector( RANDOM_FLOAT( -200, 200 ), RANDOM_FLOAT( -200, 200 ), 175 ); - // pSprite->AnimateAndDie( RANDOM_FLOAT( 8.0, 12.0 ) ); - pSprite->pev->nextthink = gpGlobals->time + 0.3; + pSprite->pev->velocity = Vector( RANDOM_FLOAT( -200.0f, 200.0f ), RANDOM_FLOAT( -200.0f, 200.0f ), 175 ); + // pSprite->AnimateAndDie( RANDOM_FLOAT( 8.0f, 12.0f ) ); + pSprite->pev->nextthink = gpGlobals->time + 0.3f; pSprite->SetThink( &CBaseEntity::SUB_Remove ); pSprite->SetTransparency( kRenderTransAdd, 255, 255, 255, 255, kRenderFxFadeFast ); } @@ -474,7 +474,7 @@ void CGargantua::StompAttack( void ) EMIT_SOUND_DYN( edict(), CHAN_WEAPON, pStompSounds[RANDOM_LONG( 0, ARRAYSIZE( pStompSounds ) - 1 )], 1.0, ATTN_GARG, 0, PITCH_NORM + RANDOM_LONG( -10, 10 ) ); UTIL_TraceLine( pev->origin, pev->origin - Vector(0,0,20), ignore_monsters, edict(), &trace ); - if( trace.flFraction < 1.0 ) + if( trace.flFraction < 1.0f ) UTIL_DecalTrace( &trace, DECAL_GARGSTOMP1 ); } @@ -559,9 +559,9 @@ void CGargantua::FlameUpdate( void ) UTIL_TraceLine( vecStart, vecEnd, dont_ignore_monsters, edict(), &trace ); m_pFlame[i]->SetStartPos( trace.vecEndPos ); - m_pFlame[i+2]->SetStartPos( ( vecStart * 0.6 ) + ( trace.vecEndPos * 0.4 ) ); + m_pFlame[i+2]->SetStartPos( ( vecStart * 0.6f ) + ( trace.vecEndPos * 0.4f ) ); - if( trace.flFraction != 1.0 && gpGlobals->time > m_streakTime ) + if( trace.flFraction != 1.0f && gpGlobals->time > m_streakTime ) { StreakSplash( trace.vecEndPos, trace.vecPlaneNormal, 6, 20, 50, 400 ); streaks = TRUE; @@ -577,7 +577,7 @@ void CGargantua::FlameUpdate( void ) WRITE_COORD( vecStart.x ); // origin WRITE_COORD( vecStart.y ); WRITE_COORD( vecStart.z ); - WRITE_COORD( RANDOM_FLOAT( 32, 48 ) ); // radius + WRITE_COORD( RANDOM_FLOAT( 32.0f, 48.0f ) ); // radius WRITE_BYTE( 255 ); // R WRITE_BYTE( 255 ); // G WRITE_BYTE( 255 ); // B @@ -597,7 +597,7 @@ void CGargantua::FlameDamage( Vector vecStart, Vector vecEnd, entvars_t *pevInfl float flAdjustedDamage; Vector vecSpot; - Vector vecMid = ( vecStart + vecEnd ) * 0.5; + Vector vecMid = ( vecStart + vecEnd ) * 0.5f; float searchRadius = ( vecStart - vecMid).Length(); @@ -627,15 +627,15 @@ void CGargantua::FlameDamage( Vector vecStart, Vector vecEnd, entvars_t *pevInfl UTIL_TraceLine( vecSrc, vecSpot, dont_ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction == 1.0 || tr.pHit == pEntity->edict() ) + if( tr.flFraction == 1.0f || tr.pHit == pEntity->edict() ) { // the explosion can 'see' this entity, so hurt them! // decrease damage for an ent that's farther from the flame. dist = ( vecSrc - tr.vecEndPos ).Length(); - if( dist > 64 ) + if( dist > 64.0f ) { - flAdjustedDamage = flDamage - ( dist - 64 ) * 0.4; + flAdjustedDamage = flDamage - ( dist - 64.0f ) * 0.4f; if( flAdjustedDamage <= 0 ) continue; } @@ -645,7 +645,7 @@ void CGargantua::FlameDamage( Vector vecStart, Vector vecEnd, entvars_t *pevInfl } // ALERT( at_console, "hit %s\n", STRING( pEntity->pev->classname ) ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { ClearMultiDamage(); pEntity->TraceAttack( pevInflictor, flAdjustedDamage, ( tr.vecEndPos - vecSrc ).Normalize(), &tr, bitsDamageType ); @@ -679,7 +679,7 @@ void CGargantua::PrescheduleThink( void ) { if( !HasConditions( bits_COND_SEE_ENEMY ) ) { - m_seeTime = gpGlobals->time + 5; + m_seeTime = gpGlobals->time + 5.0f; EyeOff(); } else @@ -860,7 +860,7 @@ int CGargantua::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, flo if( IsAlive() ) { if( !( bitsDamageType & GARG_DAMAGE ) ) - flDamage *= 0.01; + flDamage *= 0.01f; if( bitsDamageType & DMG_BLAST ) SetConditions( bits_COND_LIGHT_DAMAGE ); } @@ -875,13 +875,13 @@ void CGargantua::DeathEffect( void ) Vector deathPos = pev->origin + gpGlobals->v_forward * 100; // Create a spiral of streaks - CSpiral::Create( deathPos, ( pev->absmax.z - pev->absmin.z ) * 0.6, 125, 1.5 ); + CSpiral::Create( deathPos, ( pev->absmax.z - pev->absmin.z ) * 0.6f, 125, 1.5 ); Vector position = pev->origin; position.z += 32; for( i = 0; i < 7; i+=2 ) { - SpawnExplosion( position, 70, ( i * 0.3 ), 60 + ( i * 20 ) ); + SpawnExplosion( position, 70, ( i * 0.3f ), 60 + ( i * 20 ) ); position.z += 15; } @@ -889,7 +889,7 @@ void CGargantua::DeathEffect( void ) pSmoker->pev->health = 1; // 1 smoke balls pSmoker->pev->scale = 46; // 4.6X normal size pSmoker->pev->dmg = 0; // 0 radial distribution - pSmoker->pev->nextthink = gpGlobals->time + 2.5; // Start in 2.5 seconds + pSmoker->pev->nextthink = gpGlobals->time + 2.5f; // Start in 2.5 seconds } void CGargantua::Killed( entvars_t *pevAttacker, int iGib ) @@ -909,7 +909,7 @@ BOOL CGargantua::CheckMeleeAttack1( float flDot, float flDist ) { //ALERT( at_aiconsole, "CheckMelee(%f, %f)\n", flDot, flDist ); - if( flDot >= 0.7 ) + if( flDot >= 0.7f ) { if( flDist <= GARG_ATTACKDIST ) return TRUE; @@ -924,7 +924,7 @@ BOOL CGargantua::CheckMeleeAttack2( float flDot, float flDist ) if( gpGlobals->time > m_flameTime ) { - if( flDot >= 0.8 && flDist > GARG_ATTACKDIST ) + if( flDot >= 0.8f && flDist > GARG_ATTACKDIST ) { if ( flDist <= GARG_FLAME_LENGTH ) return TRUE; @@ -946,7 +946,7 @@ BOOL CGargantua::CheckRangeAttack1( float flDot, float flDist ) { if( gpGlobals->time > m_seeTime ) { - if( flDot >= 0.7 && flDist > GARG_ATTACKDIST ) + if( flDot >= 0.7f && flDist > GARG_ATTACKDIST ) { return TRUE; } @@ -965,7 +965,7 @@ void CGargantua::HandleAnimEvent( MonsterEvent_t *pEvent ) case GARG_AE_SLASH_LEFT: { // HACKHACK!!! - CBaseEntity *pHurt = GargantuaCheckTraceHullAttack( GARG_ATTACKDIST + 10.0, gSkillData.gargantuaDmgSlash, DMG_SLASH ); + CBaseEntity *pHurt = GargantuaCheckTraceHullAttack( GARG_ATTACKDIST + 10.0f, gSkillData.gargantuaDmgSlash, DMG_SLASH ); if( pHurt ) { if( pHurt->pev->flags & ( FL_MONSTER | FL_CLIENT ) ) @@ -992,7 +992,7 @@ void CGargantua::HandleAnimEvent( MonsterEvent_t *pEvent ) break; case GARG_AE_STOMP: StompAttack(); - m_seeTime = gpGlobals->time + 12; + m_seeTime = gpGlobals->time + 12.0f; break; case GARG_AE_BREATHE: EMIT_SOUND_DYN( edict(), CHAN_VOICE, pBreatheSounds[RANDOM_LONG( 0, ARRAYSIZE( pBreatheSounds ) - 1 )], 1.0, ATTN_GARG, 0, PITCH_NORM + RANDOM_LONG( -10, 10 ) ); @@ -1021,7 +1021,7 @@ CBaseEntity* CGargantua::GargantuaCheckTraceHullAttack(float flDist, int iDamage UTIL_MakeVectors( pev->angles ); Vector vecStart = pev->origin; vecStart.z += 64; - Vector vecEnd = vecStart + ( gpGlobals->v_forward * flDist ) - ( gpGlobals->v_up * flDist * 0.3 ); + Vector vecEnd = vecStart + ( gpGlobals->v_forward * flDist ) - ( gpGlobals->v_up * flDist * 0.3f ); UTIL_TraceHull( vecStart, vecEnd, dont_ignore_monsters, head_hull, ENT( pev ), &tr ); @@ -1065,7 +1065,7 @@ void CGargantua::StartTask( Task_t *pTask ) case TASK_FLAME_SWEEP: FlameCreate(); m_flWaitFinished = gpGlobals->time + pTask->flData; - m_flameTime = gpGlobals->time + 6; + m_flameTime = gpGlobals->time + 6.0f; m_flameX = 0; m_flameY = 0; break; @@ -1075,7 +1075,7 @@ void CGargantua::StartTask( Task_t *pTask ) TaskComplete(); break; case TASK_DIE: - m_flWaitFinished = gpGlobals->time + 1.6; + m_flWaitFinished = gpGlobals->time + 1.6f; DeathEffect(); // FALL THROUGH default: @@ -1099,7 +1099,7 @@ void CGargantua::RunTask( Task_t *pTask ) pev->rendercolor.y = 0; pev->rendercolor.z = 0; StopAnimation(); - pev->nextthink = gpGlobals->time + 0.15; + pev->nextthink = gpGlobals->time + 0.15f; SetThink( &CBaseEntity::SUB_Remove ); int i; int parts = MODEL_FRAMES( gGargGibModel ); @@ -1118,7 +1118,7 @@ void CGargantua::RunTask( Task_t *pTask ) pGib->m_material = matNone; pGib->pev->origin = pev->origin; pGib->pev->velocity = UTIL_RandomBloodVector() * RANDOM_FLOAT( 300, 500 ); - pGib->pev->nextthink = gpGlobals->time + 1.25; + pGib->pev->nextthink = gpGlobals->time + 1.25f; pGib->SetThink( &CBaseEntity::SUB_FadeOut ); } MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, pev->origin ); @@ -1194,10 +1194,10 @@ void CGargantua::RunTask( Task_t *pTask ) if( cancel ) { - m_flWaitFinished -= 0.5; - m_flameTime -= 0.5; + m_flWaitFinished -= 0.5f; + m_flameTime -= 0.5f; } - // FlameControls( angles.x + 2 * sin( gpGlobals->time * 8 ), angles.y + 28 * sin( gpGlobals->time * 8.5 ) ); + // FlameControls( angles.x + 2.0f * sin( gpGlobals->time * 8.0f ), angles.y + 28.0f * sin( gpGlobals->time * 8.5f ) ); FlameControls( angles.x, angles.y ); } break; @@ -1235,13 +1235,13 @@ void CSmoker::Think( void ) WRITE_COORD( pev->origin.y + RANDOM_FLOAT( -pev->dmg, pev->dmg ) ); WRITE_COORD( pev->origin.z); WRITE_SHORT( g_sModelIndexSmoke ); - WRITE_BYTE( RANDOM_LONG(pev->scale, pev->scale * 1.1 ) ); + WRITE_BYTE( RANDOM_LONG(pev->scale, pev->scale * 1.1f ) ); WRITE_BYTE( RANDOM_LONG( 8, 14 ) ); // framerate MESSAGE_END(); pev->health--; if( pev->health > 0 ) - pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 0.1, 0.2 ); + pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 0.1f, 0.2f ); else UTIL_Remove( this ); } @@ -1274,7 +1274,7 @@ CSpiral *CSpiral::Create( const Vector &origin, float height, float radius, floa return pSpiral; } -#define SPIRAL_INTERVAL 0.1 //025 +#define SPIRAL_INTERVAL 0.1f //025 void CSpiral::Think( void ) { @@ -1285,7 +1285,7 @@ void CSpiral::Think( void ) Vector position = pev->origin; Vector direction = Vector(0,0,1); - float fraction = 1.0 / pev->speed; + float fraction = 1.0f / pev->speed; float radius = ( pev->scale * pev->health ) * fraction; diff --git a/dlls/gauss.cpp b/dlls/gauss.cpp index 21377783..8bff79a1 100644 --- a/dlls/gauss.cpp +++ b/dlls/gauss.cpp @@ -52,10 +52,10 @@ float CGauss::GetFullChargeTime( void ) if( g_pGameRules->IsMultiplayer() ) #endif { - return 1.5; + return 1.5f; } - return 4; + return 4.0f; } #ifdef CLIENT_DLL @@ -138,9 +138,9 @@ BOOL CGauss::Deploy() void CGauss::Holster( int skiplocal /* = 0 */ ) { - PLAYBACK_EVENT_FULL( FEV_RELIABLE | FEV_GLOBAL, m_pPlayer->edict(), m_usGaussFire, 0.01, m_pPlayer->pev->origin, m_pPlayer->pev->angles, 0.0, 0.0, 0, 0, 0, 1 ); + PLAYBACK_EVENT_FULL( FEV_RELIABLE | FEV_GLOBAL, m_pPlayer->edict(), m_usGaussFire, 0.01f, m_pPlayer->pev->origin, m_pPlayer->pev->angles, 0.0, 0.0, 0, 0, 0, 1 ); - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; SendWeaponAnim( GAUSS_HOLSTER ); m_fInAttack = 0; @@ -152,14 +152,14 @@ void CGauss::PrimaryAttack() if( m_pPlayer->pev->waterlevel == 3 ) { PlayEmptySound(); - m_flNextSecondaryAttack = m_flNextPrimaryAttack = GetNextAttackDelay( 0.15 ); + m_flNextSecondaryAttack = m_flNextPrimaryAttack = GetNextAttackDelay( 0.15f ); return; } if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] < 2 ) { PlayEmptySound(); - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; return; } @@ -170,8 +170,8 @@ void CGauss::PrimaryAttack() StartFire(); m_fInAttack = 0; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0; - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.2; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0f; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.2f; } void CGauss::SecondaryAttack() @@ -190,7 +190,7 @@ void CGauss::SecondaryAttack() PlayEmptySound(); } - m_flNextSecondaryAttack = m_flNextPrimaryAttack = GetNextAttackDelay( 0.5 ); + m_flNextSecondaryAttack = m_flNextPrimaryAttack = GetNextAttackDelay( 0.5f ); return; } @@ -199,7 +199,7 @@ void CGauss::SecondaryAttack() if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 ) { EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/357_cock1.wav", 0.8, ATTN_NORM ); - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; return; } @@ -213,11 +213,11 @@ void CGauss::SecondaryAttack() SendWeaponAnim( GAUSS_SPINUP ); m_fInAttack = 1; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5f; m_pPlayer->m_flStartCharge = gpGlobals->time; m_pPlayer->m_flAmmoStartCharge = UTIL_WeaponTimeBase() + GetFullChargeTime(); - PLAYBACK_EVENT_FULL( FEV_NOTHOST, m_pPlayer->edict(), m_usGaussSpin, 0.0, g_vecZero, g_vecZero, 0.0, 0.0, 110, 0, 0, 0 ); + PLAYBACK_EVENT_FULL( FEV_NOTHOST, m_pPlayer->edict(), m_usGaussSpin, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, 110, 0, 0, 0 ); m_iSoundState = SND_CHANGE_PITCH; } @@ -242,7 +242,7 @@ void CGauss::SecondaryAttack() // out of ammo! force the gun to fire StartFire(); m_fInAttack = 0; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0f; m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1; return; } @@ -257,12 +257,12 @@ void CGauss::SecondaryAttack() #endif { m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--; - m_pPlayer->m_flNextAmmoBurn = UTIL_WeaponTimeBase() + 0.1; + m_pPlayer->m_flNextAmmoBurn = UTIL_WeaponTimeBase() + 0.1f; } else { m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--; - m_pPlayer->m_flNextAmmoBurn = UTIL_WeaponTimeBase() + 0.3; + m_pPlayer->m_flNextAmmoBurn = UTIL_WeaponTimeBase() + 0.3f; } } @@ -281,25 +281,25 @@ void CGauss::SecondaryAttack() if( m_iSoundState == 0 ) ALERT( at_console, "sound state %d\n", m_iSoundState ); - PLAYBACK_EVENT_FULL( FEV_NOTHOST, m_pPlayer->edict(), m_usGaussSpin, 0.0, g_vecZero, g_vecZero, 0.0, 0.0, pitch, 0, ( m_iSoundState == SND_CHANGE_PITCH ) ? 1 : 0, 0 ); + PLAYBACK_EVENT_FULL( FEV_NOTHOST, m_pPlayer->edict(), m_usGaussSpin, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, pitch, 0, ( m_iSoundState == SND_CHANGE_PITCH ) ? 1 : 0, 0 ); m_iSoundState = SND_CHANGE_PITCH; // hack for going through level transitions m_pPlayer->m_iWeaponVolume = GAUSS_PRIMARY_CHARGE_VOLUME; - // m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.1; - if( m_pPlayer->m_flStartCharge < gpGlobals->time - 10 ) + // m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.1f; + 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/electro4.wav", 1.0, ATTN_NORM, 0, 80 + RANDOM_LONG( 0, 0x3f ) ); - EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/electro6.wav", 1.0, ATTN_NORM, 0, 75 + RANDOM_LONG( 0, 0x3f ) ); + EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/electro4.wav", 1.0f, ATTN_NORM, 0, 80 + RANDOM_LONG( 0, 0x3f ) ); + EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/electro6.wav", 1.0f, ATTN_NORM, 0, 75 + RANDOM_LONG( 0, 0x3f ) ); m_fInAttack = 0; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0; - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0f; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0f; #ifndef CLIENT_DLL m_pPlayer->TakeDamage( VARS( eoNullEntity ), VARS( eoNullEntity ), 50, DMG_SHOCK ); - UTIL_ScreenFade( m_pPlayer, Vector( 255, 128, 0 ), 2, 0.5, 128, FFADE_IN ); + UTIL_ScreenFade( m_pPlayer, Vector( 255, 128, 0 ), 2, 0.5f, 128, FFADE_IN ); #endif SendWeaponAnim( GAUSS_IDLE ); @@ -325,18 +325,18 @@ void CGauss::StartFire( void ) if( gpGlobals->time - m_pPlayer->m_flStartCharge > GetFullChargeTime() ) { - flDamage = 200; + flDamage = 200.0f; } else { - flDamage = 200 * ( ( gpGlobals->time - m_pPlayer->m_flStartCharge ) / GetFullChargeTime() ); + flDamage = 200.0f * ( ( gpGlobals->time - m_pPlayer->m_flStartCharge ) / GetFullChargeTime() ); } if( m_fPrimaryFire ) { // fixed damage on primary attack #ifdef CLIENT_DLL - flDamage = 20; + flDamage = 20.0f; #else flDamage = gSkillData.plrDmgGauss; #endif @@ -350,7 +350,7 @@ void CGauss::StartFire( void ) if( !m_fPrimaryFire ) { - m_pPlayer->pev->velocity = m_pPlayer->pev->velocity - gpGlobals->v_forward * flDamage * 5; + m_pPlayer->pev->velocity = m_pPlayer->pev->velocity - gpGlobals->v_forward * flDamage * 5.0f; } if( !g_pGameRules->IsMultiplayer() ) @@ -364,7 +364,7 @@ void CGauss::StartFire( void ) } // time until aftershock 'static discharge' sound - m_pPlayer->m_flPlayAftershock = gpGlobals->time + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0.3, 0.8 ); + m_pPlayer->m_flPlayAftershock = gpGlobals->time + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0.3f, 0.8f ); Fire( vecSrc, vecAiming, flDamage ); } @@ -375,9 +375,9 @@ void CGauss::Fire( Vector vecOrigSrc, Vector vecDir, float flDamage ) TraceResult tr, beam_tr; #ifndef CLIENT_DLL Vector vecSrc = vecOrigSrc; - Vector vecDest = vecSrc + vecDir * 8192; + Vector vecDest = vecSrc + vecDir * 8192.0f; edict_t *pentIgnore; - float flMaxFrac = 1.0; + float flMaxFrac = 1.0f; int nTotal = 0; int fHasPunched = 0; int fFirstBeam = 1; @@ -389,13 +389,13 @@ void CGauss::Fire( Vector vecOrigSrc, Vector vecDir, float flDamage ) g_irunninggausspred = true; #endif // The main firing event is sent unreliably so it won't be delayed. - PLAYBACK_EVENT_FULL( FEV_NOTHOST, m_pPlayer->edict(), m_usGaussFire, 0.0, m_pPlayer->pev->origin, m_pPlayer->pev->angles, flDamage, 0.0, 0, 0, m_fPrimaryFire ? 1 : 0, 0 ); + PLAYBACK_EVENT_FULL( FEV_NOTHOST, m_pPlayer->edict(), m_usGaussFire, 0.0f, m_pPlayer->pev->origin, m_pPlayer->pev->angles, flDamage, 0.0, 0, 0, m_fPrimaryFire ? 1 : 0, 0 ); // 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_NOTHOST | FEV_RELIABLE, m_pPlayer->edict(), m_usGaussFire, 0.01, m_pPlayer->pev->origin, m_pPlayer->pev->angles, 0.0, 0.0, 0, 0, 0, 1 ); + PLAYBACK_EVENT_FULL( FEV_NOTHOST | FEV_RELIABLE, m_pPlayer->edict(), m_usGaussFire, 0.01f, m_pPlayer->pev->origin, m_pPlayer->pev->angles, 0.0, 0.0, 0, 0, 0, 1 ); /*ALERT( at_console, "%f %f %f\n%f %f %f\n", vecSrc.x, vecSrc.y, vecSrc.z, @@ -442,7 +442,7 @@ void CGauss::Fire( Vector vecOrigSrc, Vector vecDir, float flDamage ) n = -DotProduct( tr.vecPlaneNormal, vecDir ); - if( n < 0.5 ) // 60 degrees + if( n < 0.5f ) // 60 degrees { // ALERT( at_console, "reflect %f\n", n ); // reflect @@ -451,8 +451,8 @@ void CGauss::Fire( Vector vecOrigSrc, Vector vecDir, float flDamage ) r = 2.0 * tr.vecPlaneNormal * n + vecDir; flMaxFrac = flMaxFrac - tr.flFraction; vecDir = r; - vecSrc = tr.vecEndPos + vecDir * 8; - vecDest = vecSrc + vecDir * 8192; + vecSrc = tr.vecEndPos + vecDir * 8.0f; + vecDest = vecSrc + vecDir * 8192.0f; // explode a bit m_pPlayer->RadiusDamage( tr.vecEndPos, pev, m_pPlayer->pev, flDamage * n, CLASS_NONE, DMG_BLAST ); @@ -460,8 +460,8 @@ void CGauss::Fire( Vector vecOrigSrc, Vector vecDir, float flDamage ) nTotal += 34; // lose energy - if( n == 0 ) n = 0.1; - flDamage = flDamage * ( 1 - n ); + if( n == 0.0f ) n = 0.1f; + flDamage = flDamage * ( 1.0f - n ); } else { @@ -485,8 +485,8 @@ void CGauss::Fire( Vector vecOrigSrc, Vector vecDir, float flDamage ) if( n < flDamage ) { - if( n == 0 ) - n = 1; + if( n == 0.0f ) + n = 1.0f; flDamage -= n; // ALERT( at_console, "punch %f\n", n ); @@ -498,16 +498,16 @@ void CGauss::Fire( Vector vecOrigSrc, Vector vecDir, float flDamage ) if( g_pGameRules->IsMultiplayer() ) { - damage_radius = flDamage * 1.75; // Old code == 2.5 + damage_radius = flDamage * 1.75f; // Old code == 2.5 } else { - damage_radius = flDamage * 2.5; + damage_radius = flDamage * 2.5f; } ::RadiusDamage( beam_tr.vecEndPos + vecDir * 8, pev, m_pPlayer->pev, flDamage, damage_radius, CLASS_NONE, DMG_BLAST ); - CSoundEnt::InsertSound( bits_SOUND_COMBAT, pev->origin, NORMAL_EXPLOSION_VOLUME, 3.0 ); + CSoundEnt::InsertSound( bits_SOUND_COMBAT, pev->origin, NORMAL_EXPLOSION_VOLUME, 3.0f ); nTotal += 53; @@ -553,18 +553,18 @@ void CGauss::WeaponIdle( void ) switch( RANDOM_LONG( 0, 3 ) ) { case 0: - EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/electro4.wav", RANDOM_FLOAT( 0.7, 0.8 ), ATTN_NORM ); + EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/electro4.wav", RANDOM_FLOAT( 0.7f, 0.8f ), ATTN_NORM ); break; case 1: - EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/electro5.wav", RANDOM_FLOAT( 0.7, 0.8 ), ATTN_NORM ); + EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/electro5.wav", RANDOM_FLOAT( 0.7f, 0.8f ), ATTN_NORM ); break; case 2: - EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/electro6.wav", RANDOM_FLOAT( 0.7, 0.8 ), ATTN_NORM ); + EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/electro6.wav", RANDOM_FLOAT( 0.7f, 0.8f ), ATTN_NORM ); break; case 3: break; // no sound } - m_pPlayer->m_flPlayAftershock = 0.0; + m_pPlayer->m_flPlayAftershock = 0.0f; } if( m_flTimeWeaponIdle > UTIL_WeaponTimeBase() ) @@ -574,30 +574,30 @@ void CGauss::WeaponIdle( void ) { StartFire(); m_fInAttack = 0; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0f; // Need to set m_flNextPrimaryAttack so the weapon gets a chance to complete its secondary fire animation. - Solokiller if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 ) - m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.5; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.5f; } else { int iAnim; - float flRand = RANDOM_FLOAT( 0, 1 ); - if( flRand <= 0.5 ) + float flRand = RANDOM_FLOAT( 0.0f, 1.0f ); + if( flRand <= 0.5f ) { iAnim = GAUSS_IDLE; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10.0f, 15.0f ); } - else if( flRand <= 0.75 ) + else if( flRand <= 0.75f ) { iAnim = GAUSS_IDLE2; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10.0f, 15.0f ); } else { iAnim = GAUSS_FIDGET; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0f; } #ifndef CLIENT_DLL SendWeaponAnim( iAnim ); diff --git a/dlls/ggrenade.cpp b/dlls/ggrenade.cpp index 0ca516c4..60b658b9 100644 --- a/dlls/ggrenade.cpp +++ b/dlls/ggrenade.cpp @@ -57,9 +57,9 @@ void CGrenade::Explode( TraceResult *pTrace, int bitsDamageType ) pev->takedamage = DAMAGE_NO; // Pull out of the wall a bit - if( pTrace->flFraction != 1.0 ) + if( pTrace->flFraction != 1.0f ) { - pev->origin = pTrace->vecEndPos + ( pTrace->vecPlaneNormal * ( pev->dmg - 24 ) * 0.6 ); + pev->origin = pTrace->vecEndPos + ( pTrace->vecPlaneNormal * ( pev->dmg - 24 ) * 0.6f ); } int iContents = UTIL_PointContents( pev->origin ); @@ -77,7 +77,7 @@ void CGrenade::Explode( TraceResult *pTrace, int bitsDamageType ) { WRITE_SHORT( g_sModelIndexWExplosion ); } - WRITE_BYTE( ( pev->dmg - 50 ) * .60 ); // scale * 10 + WRITE_BYTE( ( pev->dmg - 50 ) * 0.6f ); // scale * 10 WRITE_BYTE( 15 ); // framerate WRITE_BYTE( TE_EXPLFLAG_NONE ); MESSAGE_END(); @@ -93,7 +93,7 @@ void CGrenade::Explode( TraceResult *pTrace, int bitsDamageType ) RadiusDamage( pev, pevOwner, pev->dmg, CLASS_NONE, bitsDamageType ); - if( RANDOM_FLOAT( 0, 1 ) < 0.5 ) + if( RANDOM_FLOAT( 0, 1 ) < 0.5f ) { UTIL_DecalTrace( pTrace, DECAL_SCORCH1 ); } @@ -120,7 +120,7 @@ void CGrenade::Explode( TraceResult *pTrace, int bitsDamageType ) pev->effects |= EF_NODRAW; SetThink( &CGrenade::Smoke ); pev->velocity = g_vecZero; - pev->nextthink = gpGlobals->time + 0.3; + pev->nextthink = gpGlobals->time + 0.3f; if( iContents != CONTENTS_WATER ) { @@ -144,7 +144,7 @@ void CGrenade::Smoke( void ) WRITE_COORD( pev->origin.y ); WRITE_COORD( pev->origin.z ); WRITE_SHORT( g_sModelIndexSmoke ); - WRITE_BYTE( (int)( ( pev->dmg - 50 ) * 0.80 ) ); // scale * 10 + WRITE_BYTE( (int)( ( pev->dmg - 50 ) * 0.8f ) ); // scale * 10 WRITE_BYTE( 12 ); // framerate MESSAGE_END(); } @@ -207,12 +207,12 @@ void CGrenade::DangerSoundThink( void ) return; } - CSoundEnt::InsertSound( bits_SOUND_DANGER, pev->origin + pev->velocity * 0.5, (int)pev->velocity.Length(), 0.2 ); - pev->nextthink = gpGlobals->time + 0.2; + CSoundEnt::InsertSound( bits_SOUND_DANGER, pev->origin + pev->velocity * 0.5f, (int)pev->velocity.Length(), 0.2 ); + pev->nextthink = gpGlobals->time + 0.2f; if( pev->waterlevel != 0 ) { - pev->velocity = pev->velocity * 0.5; + pev->velocity = pev->velocity * 0.5f; } } @@ -233,7 +233,7 @@ void CGrenade::BounceTouch( CBaseEntity *pOther ) pOther->TraceAttack( pevOwner, 1, gpGlobals->v_forward, &tr, DMG_CLUB ); ApplyMultiDamage( pev, pevOwner ); } - m_flNextAttack = gpGlobals->time + 1.0; // debounce + m_flNextAttack = gpGlobals->time + 1.0f; // debounce } Vector vecTestVelocity; @@ -243,7 +243,7 @@ void CGrenade::BounceTouch( CBaseEntity *pOther ) // or thrown very far tend to slow down too quickly for me to always catch just by testing velocity. // trimming the Z velocity a bit seems to help quite a bit. vecTestVelocity = pev->velocity; - vecTestVelocity.z *= 0.45; + vecTestVelocity.z *= 0.45f; if( !m_fRegisteredSound && vecTestVelocity.Length() <= 60 ) { @@ -253,14 +253,14 @@ void CGrenade::BounceTouch( CBaseEntity *pOther ) // go ahead and emit the danger sound. // register a radius louder than the explosion, so we make sure everyone gets out of the way - CSoundEnt::InsertSound( bits_SOUND_DANGER, pev->origin, (int)( pev->dmg / 0.4 ), 0.3 ); + CSoundEnt::InsertSound( bits_SOUND_DANGER, pev->origin, (int)( pev->dmg / 0.4f ), 0.3f ); m_fRegisteredSound = TRUE; } if( pev->flags & FL_ONGROUND ) { // add a bit of static friction - pev->velocity = pev->velocity * 0.8; + pev->velocity = pev->velocity * 0.8f; pev->sequence = RANDOM_LONG( 1, 1 ); } @@ -269,11 +269,11 @@ void CGrenade::BounceTouch( CBaseEntity *pOther ) // play bounce sound BounceSound(); } - pev->framerate = pev->velocity.Length() / 200.0; - if( pev->framerate > 1.0 ) - pev->framerate = 1; - else if( pev->framerate < 0.5 ) - pev->framerate = 0; + pev->framerate = pev->velocity.Length() / 200.0f; + if( pev->framerate > 1.0f ) + pev->framerate = 1.0f; + else if( pev->framerate < 0.5f ) + pev->framerate = 0.0f; } void CGrenade::SlideTouch( CBaseEntity *pOther ) @@ -286,7 +286,7 @@ void CGrenade::SlideTouch( CBaseEntity *pOther ) if( pev->flags & FL_ONGROUND ) { // add a bit of static friction - pev->velocity = pev->velocity * 0.95; + pev->velocity = pev->velocity * 0.95f; if( pev->velocity.x != 0 || pev->velocity.y != 0 ) { @@ -324,7 +324,7 @@ void CGrenade::TumbleThink( void ) } StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( pev->dmgtime - 1 < gpGlobals->time ) { @@ -337,8 +337,8 @@ void CGrenade::TumbleThink( void ) } if( pev->waterlevel != 0 ) { - pev->velocity = pev->velocity * 0.5; - pev->framerate = 0.2; + pev->velocity = pev->velocity * 0.5f; + pev->framerate = 0.2f; } } @@ -399,21 +399,21 @@ CGrenade *CGrenade::ShootTimed( entvars_t *pevOwner, Vector vecStart, Vector vec pGrenade->pev->dmgtime = gpGlobals->time + time; pGrenade->SetThink( &CGrenade::TumbleThink ); - pGrenade->pev->nextthink = gpGlobals->time + 0.1; - if( time < 0.1 ) + pGrenade->pev->nextthink = gpGlobals->time + 0.1f; + if( time < 0.1f ) { pGrenade->pev->nextthink = gpGlobals->time; pGrenade->pev->velocity = Vector( 0, 0, 0 ); } pGrenade->pev->sequence = RANDOM_LONG( 3, 6 ); - pGrenade->pev->framerate = 1.0; + pGrenade->pev->framerate = 1.0f; // Tumble through the air // pGrenade->pev->avelocity.x = -400; - pGrenade->pev->gravity = 0.5; - pGrenade->pev->friction = 0.8; + pGrenade->pev->gravity = 0.5f; + pGrenade->pev->friction = 0.8f; SET_MODEL( ENT( pGrenade->pev ), "models/w_grenade.mdl" ); pGrenade->pev->dmg = 100; @@ -445,7 +445,7 @@ CGrenade *CGrenade::ShootSatchelCharge( entvars_t *pevOwner, Vector vecStart, Ve pGrenade->SetTouch( &CGrenade::SlideTouch ); pGrenade->pev->spawnflags = SF_DETONATE; - pGrenade->pev->friction = 0.9; + pGrenade->pev->friction = 0.9f; return pGrenade; } diff --git a/dlls/glock.cpp b/dlls/glock.cpp index 89dd189e..db0cf082 100644 --- a/dlls/glock.cpp +++ b/dlls/glock.cpp @@ -106,12 +106,12 @@ BOOL CGlock::Deploy() void CGlock::SecondaryAttack( void ) { - GlockFire( 0.1, 0.2, FALSE ); + GlockFire( 0.1f, 0.2f, FALSE ); } void CGlock::PrimaryAttack( void ) { - GlockFire( 0.01, 0.3, TRUE ); + GlockFire( 0.01f, 0.3f, TRUE ); } void CGlock::GlockFire( float flSpread, float flCycleTime, BOOL fUseAutoAim ) @@ -121,7 +121,7 @@ void CGlock::GlockFire( float flSpread, float flCycleTime, BOOL fUseAutoAim ) if( m_fFireOnEmpty ) { PlayEmptySound(); - m_flNextPrimaryAttack = GetNextAttackDelay( 0.2 ); + m_flNextPrimaryAttack = GetNextAttackDelay( 0.2f ); } return; @@ -187,9 +187,9 @@ void CGlock::Reload( void ) int iResult; if( m_iClip == 0 ) - iResult = DefaultReload( GLOCK_MAX_CLIP, GLOCK_RELOAD, 1.5 ); + iResult = DefaultReload( GLOCK_MAX_CLIP, GLOCK_RELOAD, 1.5f ); else - iResult = DefaultReload( GLOCK_MAX_CLIP, GLOCK_RELOAD_NOT_EMPTY, 1.5 ); + iResult = DefaultReload( GLOCK_MAX_CLIP, GLOCK_RELOAD_NOT_EMPTY, 1.5f ); if( iResult ) { @@ -212,20 +212,20 @@ void CGlock::WeaponIdle( void ) int iAnim; float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0.0, 1.0 ); - if( flRand <= 0.3 + 0 * 0.75 ) + if( flRand <= 0.3f + 0 * 0.75f ) { iAnim = GLOCK_IDLE3; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 49.0 / 16; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 49.0f / 16.0f; } - else if( flRand <= 0.6 + 0 * 0.875 ) + else if( flRand <= 0.6f + 0 * 0.875f ) { iAnim = GLOCK_IDLE1; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 60.0 / 16.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 60.0f / 16.0f; } else { iAnim = GLOCK_IDLE2; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 40.0 / 16.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 40.0f / 16.0f; } SendWeaponAnim( iAnim, 1 ); } diff --git a/dlls/h_ai.cpp b/dlls/h_ai.cpp index d8a35547..0cc5d306 100644 --- a/dlls/h_ai.cpp +++ b/dlls/h_ai.cpp @@ -62,7 +62,7 @@ BOOL FBoxVisible( entvars_t *pevLooker, entvars_t *pevTarget, Vector &vecTargetO UTIL_TraceLine( vecLookerOrigin, vecTarget, ignore_monsters, ignore_glass, ENT( pevLooker )/*pentIgnore*/, &tr ); - if( tr.flFraction == 1.0 ) + if( tr.flFraction == 1.0f ) { vecTargetOrigin = vecTarget; return TRUE;// line of sight is valid. @@ -120,10 +120,10 @@ Vector VecCheckToss( entvars_t *pev, const Vector &vecSpot1, Vector vecSpot2, fl float distance2 = vecMidPoint.z - vecSpot2.z; // How long will it take for the grenade to travel this distance - float time1 = sqrt( distance1 / ( 0.5 * flGravity ) ); - float time2 = sqrt( distance2 / ( 0.5 * flGravity ) ); + float time1 = sqrt( distance1 / ( 0.5f * flGravity ) ); + float time2 = sqrt( distance2 / ( 0.5f * flGravity ) ); - if( time1 < 0.1 ) + if( time1 < 0.1f ) { // too close return g_vecZero; @@ -139,7 +139,7 @@ Vector VecCheckToss( entvars_t *pev, const Vector &vecSpot1, Vector vecSpot2, fl vecApex.z = vecMidPoint.z; UTIL_TraceLine( vecSpot1, vecApex, dont_ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { // fail! return g_vecZero; @@ -147,7 +147,7 @@ Vector VecCheckToss( entvars_t *pev, const Vector &vecSpot1, Vector vecSpot2, fl // UNDONE: either ignore monsters or change it to not care if we hit our enemy UTIL_TraceLine( vecSpot2, vecApex, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { // fail! return g_vecZero; @@ -168,24 +168,24 @@ Vector VecCheckThrow( entvars_t *pev, const Vector &vecSpot1, Vector vecSpot2, f // throw at a constant time float time = vecGrenadeVel.Length() / flSpeed; - vecGrenadeVel = vecGrenadeVel * ( 1.0 / time ); + vecGrenadeVel = vecGrenadeVel * ( 1.0f / time ); // adjust upward toss to compensate for gravity loss - vecGrenadeVel.z += flGravity * time * 0.5; + vecGrenadeVel.z += flGravity * time * 0.5f; - Vector vecApex = vecSpot1 + ( vecSpot2 - vecSpot1 ) * 0.5; - vecApex.z += 0.5 * flGravity * ( time * 0.5 ) * ( time * 0.5 ); + Vector vecApex = vecSpot1 + ( vecSpot2 - vecSpot1 ) * 0.5f; + vecApex.z += 0.5f * flGravity * ( time * 0.5f ) * ( time * 0.5f ); TraceResult tr; UTIL_TraceLine( vecSpot1, vecApex, dont_ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { // fail! return g_vecZero; } UTIL_TraceLine( vecSpot2, vecApex, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { // fail! return g_vecZero; diff --git a/dlls/h_battery.cpp b/dlls/h_battery.cpp index dabbc06c..f0cf612b 100644 --- a/dlls/h_battery.cpp +++ b/dlls/h_battery.cpp @@ -106,8 +106,12 @@ void CRecharge::Precache() void CRecharge::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) { + // Make sure that we have a caller + if( !pActivator ) + return; + // if it's not a player, ignore - if( !FClassnameIs( pActivator->pev, "player" ) ) + if( !pActivator->IsPlayer() ) return; // if there is no juice left, turn it off @@ -122,36 +126,29 @@ void CRecharge::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE use { if( m_flSoundTime <= gpGlobals->time ) { - m_flSoundTime = gpGlobals->time + 0.62; + m_flSoundTime = gpGlobals->time + 0.62f; EMIT_SOUND( ENT( pev ), CHAN_ITEM, "items/suitchargeno1.wav", 0.85, ATTN_NORM ); } return; } - pev->nextthink = pev->ltime + 0.25; + pev->nextthink = pev->ltime + 0.25f; SetThink( &CRecharge::Off ); // Time to recharge yet? if( m_flNextCharge >= gpGlobals->time ) return; - // Make sure that we have a caller - if( !pActivator ) - return; - m_hActivator = pActivator; - //only recharge the player - if( !m_hActivator->IsPlayer() ) - return; - // Play the on sound or the looping charging sound if( !m_iOn ) { m_iOn++; EMIT_SOUND( ENT( pev ), CHAN_ITEM, "items/suitchargeok1.wav", 0.85, ATTN_NORM ); - m_flSoundTime = 0.56 + gpGlobals->time; + m_flSoundTime = 0.56f + gpGlobals->time; } + if( ( m_iOn == 1 ) && ( m_flSoundTime <= gpGlobals->time ) ) { m_iOn++; @@ -169,7 +166,7 @@ void CRecharge::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE use } // govern the rate of charge - m_flNextCharge = gpGlobals->time + 0.1; + m_flNextCharge = gpGlobals->time + 0.1f; } void CRecharge::Recharge( void ) diff --git a/dlls/h_cine.cpp b/dlls/h_cine.cpp index bb07e02c..55e7a631 100644 --- a/dlls/h_cine.cpp +++ b/dlls/h_cine.cpp @@ -126,7 +126,7 @@ void CLegacyCineMonster :: CineSpawn( const char *szModel ) if ( FStringNull(pev->targetname) ) { SetThink( &CLegacyCineMonster::CineThink ); - pev->nextthink += 1.0; + pev->nextthink += 1.0f; } } @@ -167,7 +167,7 @@ void CLegacyCineMonster :: CineThink( void ) if (!pev->animtime) ResetSequenceInfo( ); - pev->nextthink = gpGlobals->time + 1.0; + pev->nextthink = gpGlobals->time + 1.0f; if (pev->spawnflags != 0 && m_fSequenceFinished) { @@ -196,14 +196,14 @@ void CCineBlood :: BloodGush ( void ) { Vector vecSplatDir; TraceResult tr; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; - UTIL_MakeVectors(pev->angles); - if ( pev->health-- < 0 ) - REMOVE_ENTITY(ENT(pev)); + UTIL_MakeVectors( pev->angles ); + if( pev->health-- < 0 ) + REMOVE_ENTITY( ENT( pev ) ); // CHANGE_METHOD ( ENT(pev), em_think, SUB_Remove ); - if ( RANDOM_FLOAT ( 0 , 1 ) < 0.7 )// larger chance of globs + if ( RANDOM_FLOAT ( 0.0f, 1.0f ) < 0.7f )// larger chance of globs { UTIL_BloodDrips( pev->origin, UTIL_RandomBloodVector(), BLOOD_COLOR_RED, 10 ); } @@ -212,13 +212,13 @@ void CCineBlood :: BloodGush ( void ) UTIL_BloodStream( pev->origin, UTIL_RandomBloodVector(), BLOOD_COLOR_RED, RANDOM_LONG(50, 150) ); } - if ( RANDOM_FLOAT ( 0, 1 ) < 0.75 ) + if ( RANDOM_FLOAT ( 0, 1 ) < 0.75f ) { // decals the floor with blood. vecSplatDir = Vector ( 0 , 0 , -1 ); - vecSplatDir = vecSplatDir + (RANDOM_FLOAT(-1,1) * 0.6 * gpGlobals->v_right) + (RANDOM_FLOAT(-1,1) * 0.6 * gpGlobals->v_forward);// randomize a bit + vecSplatDir = vecSplatDir + (RANDOM_FLOAT(-1,1) * 0.6f * gpGlobals->v_right) + (RANDOM_FLOAT(-1,1) * 0.6f * gpGlobals->v_forward);// randomize a bit UTIL_TraceLine( pev->origin + Vector ( 0, 0 , 64) , pev->origin + vecSplatDir * 256, ignore_monsters, ENT(pev), &tr); - if ( tr.flFraction != 1.0 ) + if ( tr.flFraction != 1.0f ) { // Decal with a bloodsplat UTIL_BloodDecalTrace( &tr, BLOOD_COLOR_RED ); diff --git a/dlls/h_cycler.cpp b/dlls/h_cycler.cpp index 5daad4a2..1c5a9150 100644 --- a/dlls/h_cycler.cpp +++ b/dlls/h_cycler.cpp @@ -96,7 +96,7 @@ void CCycler::GenericCyclerSpawn( const char *szModel, Vector vecMin, Vector vec { if( !szModel || !*szModel ) { - ALERT( at_error, "cycler at %.0f %.0f %0.f missing modelname", pev->origin.x, pev->origin.y, pev->origin.z ); + ALERT( at_error, "cycler at %.0f %.0f %0.f missing modelname", (double)pev->origin.x, (double)pev->origin.y, (double)pev->origin.z ); REMOVE_ENTITY( ENT( pev ) ); return; } @@ -125,7 +125,7 @@ void CCycler::Spawn() m_flFrameRate = 75; m_flGroundSpeed = 0; - pev->nextthink += 1.0; + pev->nextthink += 1.0f; ResetSequenceInfo(); @@ -145,7 +145,7 @@ void CCycler::Spawn() // void CCycler::Think( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( m_animate ) { @@ -161,7 +161,7 @@ void CCycler::Think( void ) m_flLastEventCheck = gpGlobals->time; pev->frame = 0; if( !m_animate ) - pev->framerate = 0.0; // FIX: don't reset framerate + pev->framerate = 0.0f; // FIX: don't reset framerate } } @@ -172,9 +172,9 @@ void CCycler::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useTy { m_animate = !m_animate; if( m_animate ) - pev->framerate = 1.0; + pev->framerate = 1.0f; else - pev->framerate = 0.0; + pev->framerate = 0.0f; } // @@ -189,7 +189,7 @@ int CCycler::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float ResetSequenceInfo(); - if( m_flFrameRate == 0.0 ) + if( m_flFrameRate == 0.0f ) { pev->sequence = 0; ResetSequenceInfo(); @@ -198,10 +198,10 @@ int CCycler::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float } else { - pev->framerate = 1.0; - StudioFrameAdvance( 0.1 ); + pev->framerate = 1.0f; + StudioFrameAdvance( 0.1f ); pev->framerate = 0; - ALERT( at_console, "sequence: %d, frame %.0f\n", pev->sequence, pev->frame ); + ALERT( at_console, "sequence: %d, frame %.0f\n", pev->sequence, (double)pev->frame ); } return 0; @@ -224,7 +224,7 @@ public: inline int ShouldAnimate( void ) { - return m_animate && m_maxFrame > 1.0; + return m_animate && m_maxFrame > 1.0f; } int m_animate; @@ -251,7 +251,7 @@ void CCyclerSprite::Spawn( void ) pev->effects = 0; pev->frame = 0; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; m_animate = 1; m_lastTime = gpGlobals->time; @@ -266,7 +266,7 @@ void CCyclerSprite::Think( void ) if( ShouldAnimate() ) Animate( pev->framerate * ( gpGlobals->time - m_lastTime ) ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; m_lastTime = gpGlobals->time; } @@ -278,9 +278,9 @@ void CCyclerSprite::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE int CCyclerSprite::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType ) { - if( m_maxFrame > 1.0 ) + if( m_maxFrame > 1.0f ) { - Animate( 1.0 ); + Animate( 1.0f ); } return 1; } @@ -327,7 +327,7 @@ void CWeaponCycler::Spawn() BOOL CWeaponCycler::Deploy() { m_pPlayer->pev->viewmodel = m_iszModel; - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0f; SendWeaponAnim( 0 ); m_iClip = 0; return TRUE; @@ -335,14 +335,14 @@ BOOL CWeaponCycler::Deploy() void CWeaponCycler::Holster( int skiplocal /* = 0 */ ) { - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; } void CWeaponCycler::PrimaryAttack() { SendWeaponAnim( pev->sequence ); - m_flNextPrimaryAttack = gpGlobals->time + 0.3; + m_flNextPrimaryAttack = gpGlobals->time + 0.3f; } void CWeaponCycler::SecondaryAttack( void ) @@ -356,14 +356,14 @@ void CWeaponCycler::SecondaryAttack( void ) GetSequenceInfo( pmodel, pev, &flFrameRate, &flGroundSpeed ); pev->modelindex = 0; - if( flFrameRate == 0.0 ) + if( flFrameRate == 0.0f ) { pev->sequence = 0; } SendWeaponAnim( pev->sequence ); - m_flNextSecondaryAttack = gpGlobals->time + 0.3; + m_flNextSecondaryAttack = gpGlobals->time + 0.3f; } // Flaming Wreakage @@ -397,7 +397,7 @@ void CWreckage::Spawn( void ) pev->effects = 0; pev->frame = 0; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( pev->model ) { @@ -418,7 +418,7 @@ void CWreckage::Precache() void CWreckage::Think( void ) { StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.2; + pev->nextthink = gpGlobals->time + 0.2f; if( pev->dmgtime ) { diff --git a/dlls/handgrenade.cpp b/dlls/handgrenade.cpp index c2bbd7f9..4d866708 100644 --- a/dlls/handgrenade.cpp +++ b/dlls/handgrenade.cpp @@ -89,7 +89,7 @@ BOOL CHandGrenade::CanHolster( void ) void CHandGrenade::Holster( int skiplocal /* = 0 */ ) { - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] ) { @@ -104,11 +104,11 @@ void CHandGrenade::Holster( int skiplocal /* = 0 */ ) if( m_flStartThrow ) { - m_flStartThrow = 0; - m_flReleaseThrow = 0; + m_flStartThrow = 0.0f; + m_flReleaseThrow = 0.0f; } - EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "common/null.wav", 1.0, ATTN_NORM ); + EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "common/null.wav", 1.0f, ATTN_NORM ); } void CHandGrenade::PrimaryAttack() @@ -116,16 +116,16 @@ void CHandGrenade::PrimaryAttack() if( !m_flStartThrow && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] > 0 ) { m_flStartThrow = gpGlobals->time; - m_flReleaseThrow = 0; + m_flReleaseThrow = 0.0f; SendWeaponAnim( HANDGRENADE_PINPULL ); - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5f; } } void CHandGrenade::WeaponIdle( void ) { - if( m_flReleaseThrow == 0 && m_flStartThrow ) + if( m_flReleaseThrow == 0.0f && m_flStartThrow ) m_flReleaseThrow = gpGlobals->time; if( m_flTimeWeaponIdle > UTIL_WeaponTimeBase() ) @@ -135,33 +135,33 @@ void CHandGrenade::WeaponIdle( void ) { Vector angThrow = m_pPlayer->pev->v_angle + m_pPlayer->pev->punchangle; - if( angThrow.x < 0 ) - angThrow.x = -10 + angThrow.x * ( ( 90 - 10 ) / 90.0 ); + if( angThrow.x < 0.0f ) + angThrow.x = -10.0f + angThrow.x * ( ( 90.0f - 10.0f ) / 90.0f ); else - angThrow.x = -10 + angThrow.x * ( ( 90 + 10 ) / 90.0 ); + angThrow.x = -10.0f + angThrow.x * ( ( 90.0f + 10.0f ) / 90.0f ); - float flVel = ( 90 - angThrow.x ) * 4; - if( flVel > 500 ) - flVel = 500; + float flVel = ( 90.0f - angThrow.x ) * 4.0f; + if( flVel > 500.0f ) + flVel = 500.0f; UTIL_MakeVectors( angThrow ); - Vector vecSrc = m_pPlayer->pev->origin + m_pPlayer->pev->view_ofs + gpGlobals->v_forward * 16; + Vector vecSrc = m_pPlayer->pev->origin + m_pPlayer->pev->view_ofs + gpGlobals->v_forward * 16.0f; Vector vecThrow = gpGlobals->v_forward * flVel + m_pPlayer->pev->velocity; // alway explode 3 seconds after the pin was pulled - float time = m_flStartThrow - gpGlobals->time + 3.0; - if( time < 0 ) - time = 0; + float time = m_flStartThrow - gpGlobals->time + 3.0f; + if( time < 0.0f ) + time = 0.0f; CGrenade::ShootTimed( m_pPlayer->pev, vecSrc, vecThrow, time ); - if( flVel < 500 ) + if( flVel < 500.0f ) { SendWeaponAnim( HANDGRENADE_THROW1 ); } - else if( flVel < 1000 ) + else if( flVel < 1000.0f ) { SendWeaponAnim( HANDGRENADE_THROW2 ); } @@ -173,10 +173,10 @@ void CHandGrenade::WeaponIdle( void ) // player "shoot" animation m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); - m_flReleaseThrow = 0; - m_flStartThrow = 0; - m_flNextPrimaryAttack = GetNextAttackDelay( 0.5 ); - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5; + m_flReleaseThrow = 0.0f; + m_flStartThrow = 0.0f; + m_flNextPrimaryAttack = GetNextAttackDelay( 0.5f ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5f; m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--; @@ -185,14 +185,14 @@ void CHandGrenade::WeaponIdle( void ) // just threw last grenade // set attack times in the future, and weapon idle in the future so we can see the whole throw // animation, weapon idle will automatically retire the weapon for us. - m_flTimeWeaponIdle = m_flNextSecondaryAttack = m_flNextPrimaryAttack = GetNextAttackDelay( 0.5 );// ensure that the animation can finish playing + m_flTimeWeaponIdle = m_flNextSecondaryAttack = m_flNextPrimaryAttack = GetNextAttackDelay( 0.5f );// ensure that the animation can finish playing } return; } - else if( m_flReleaseThrow > 0 ) + else if( m_flReleaseThrow > 0.0f ) { // we've finished the throw, restart. - m_flStartThrow = 0; + m_flStartThrow = 0.0f; if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] ) { @@ -204,24 +204,24 @@ void CHandGrenade::WeaponIdle( void ) return; } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); - m_flReleaseThrow = -1; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10.0f, 15.0f ); + m_flReleaseThrow = -1.0f; return; } if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] ) { int iAnim; - float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 ); - if( flRand <= 0.75 ) + float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0.0f, 1.0f ); + if( flRand <= 0.75f ) { iAnim = HANDGRENADE_IDLE; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 );// how long till we do this again. + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10.0f, 15.0f );// how long till we do this again. } else { iAnim = HANDGRENADE_FIDGET; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 75.0 / 30.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 75.0f / 30.0f; } SendWeaponAnim( iAnim ); diff --git a/dlls/hassassin.cpp b/dlls/hassassin.cpp index f51ed4cb..c98c940f 100644 --- a/dlls/hassassin.cpp +++ b/dlls/hassassin.cpp @@ -193,15 +193,15 @@ void CHAssassin::Shoot( void ) Vector vecShootOrigin = GetGunPosition(); Vector vecShootDir = ShootAtEnemy( vecShootOrigin ); - if( m_flLastShot + 2 < gpGlobals->time ) + if( m_flLastShot + 2.0f < gpGlobals->time ) { - m_flDiviation = 0.10; + m_flDiviation = 0.10f; } else { - m_flDiviation -= 0.01; - if( m_flDiviation < 0.02 ) - m_flDiviation = 0.02; + m_flDiviation -= 0.01f; + if( m_flDiviation < 0.02f ) + m_flDiviation = 0.02f; } m_flLastShot = gpGlobals->time; @@ -214,10 +214,10 @@ void CHAssassin::Shoot( void ) switch( RANDOM_LONG( 0, 1 ) ) { case 0: - EMIT_SOUND( ENT( pev ), CHAN_WEAPON, "weapons/pl_gun1.wav", RANDOM_FLOAT( 0.6, 0.8 ), ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_WEAPON, "weapons/pl_gun1.wav", RANDOM_FLOAT( 0.6f, 0.8f ), ATTN_NORM ); break; case 1: - EMIT_SOUND( ENT( pev ), CHAN_WEAPON, "weapons/pl_gun2.wav", RANDOM_FLOAT( 0.6, 0.8 ), ATTN_NORM ); + EMIT_SOUND( ENT( pev ), CHAN_WEAPON, "weapons/pl_gun2.wav", RANDOM_FLOAT( 0.6f, 0.8f ), ATTN_NORM ); break; } @@ -247,7 +247,7 @@ void CHAssassin::HandleAnimEvent( MonsterEvent_t *pEvent ) UTIL_MakeVectors( pev->angles ); CGrenade::ShootTimed( pev, pev->origin + gpGlobals->v_forward * 34 + Vector( 0, 0, 32 ), m_vecTossVelocity, 2.0 ); - m_flNextGrenadeCheck = gpGlobals->time + 6;// wait six seconds before even looking again to see if a grenade can be thrown. + m_flNextGrenadeCheck = gpGlobals->time + 6.0f;// wait six seconds before even looking again to see if a grenade can be thrown. m_fThrowGrenade = FALSE; // !!!LATER - when in a group, only try to throw grenade if ordered. } @@ -259,7 +259,7 @@ void CHAssassin::HandleAnimEvent( MonsterEvent_t *pEvent ) pev->movetype = MOVETYPE_TOSS; pev->flags &= ~FL_ONGROUND; pev->velocity = m_vecJumpVelocity; - m_flNextJump = gpGlobals->time + 3.0; + m_flNextJump = gpGlobals->time + 3.0f; } return; default: @@ -597,7 +597,7 @@ IMPLEMENT_CUSTOM_SCHEDULES( CHAssassin, CBaseMonster ) //========================================================= BOOL CHAssassin::CheckMeleeAttack1( float flDot, float flDist ) { - if( m_flNextJump < gpGlobals->time && ( flDist <= 128 || HasMemory( bits_MEMORY_BADJUMP ) ) && m_hEnemy != 0 ) + if( m_flNextJump < gpGlobals->time && ( flDist <= 128.0f || HasMemory( bits_MEMORY_BADJUMP ) ) && m_hEnemy != 0 ) { TraceResult tr; @@ -605,15 +605,15 @@ BOOL CHAssassin::CheckMeleeAttack1( float flDot, float flDist ) UTIL_TraceHull( pev->origin + Vector( 0, 0, 36 ), vecDest + Vector( 0, 0, 36 ), dont_ignore_monsters, human_hull, ENT( pev ), &tr ); - if( tr.fStartSolid || tr.flFraction < 1.0 ) + if( tr.fStartSolid || tr.flFraction < 1.0f ) { return FALSE; } float flGravity = g_psv_gravity->value; - float time = sqrt( 160 / ( 0.5 * flGravity ) ); - float speed = flGravity * time / 160; + float time = sqrt( 160.0f / ( 0.5f * flGravity ) ); + float speed = flGravity * time / 160.0f; m_vecJumpVelocity = ( vecDest - pev->origin ) * speed; return TRUE; diff --git a/dlls/headcrab.cpp b/dlls/headcrab.cpp index 60e03c10..dea97ebe 100644 --- a/dlls/headcrab.cpp +++ b/dlls/headcrab.cpp @@ -170,7 +170,7 @@ int CHeadCrab::Classify( void ) //========================================================= Vector CHeadCrab::Center( void ) { - return Vector( pev->origin.x, pev->origin.y, pev->origin.z + 6 ); + return Vector( pev->origin.x, pev->origin.y, pev->origin.z + 6.0f ); } Vector CHeadCrab::BodyTarget( const Vector &posSrc ) @@ -241,7 +241,7 @@ void CHeadCrab::HandleAnimEvent( MonsterEvent_t *pEvent ) // Scale the sideways velocity to get there at the right time vecJumpDir = m_hEnemy->pev->origin + m_hEnemy->pev->view_ofs - pev->origin; - vecJumpDir = vecJumpDir * ( 1.0 / time ); + vecJumpDir = vecJumpDir * ( 1.0f / time ); // Speed to offset gravity at the desired height vecJumpDir.z = speed; @@ -249,23 +249,23 @@ void CHeadCrab::HandleAnimEvent( MonsterEvent_t *pEvent ) // Don't jump too far/fast float distance = vecJumpDir.Length(); - if( distance > 650 ) + if( distance > 650.0f ) { - vecJumpDir = vecJumpDir * ( 650.0 / distance ); + vecJumpDir = vecJumpDir * ( 650.0f / distance ); } } else { // jump hop, don't care where - vecJumpDir = Vector( gpGlobals->v_forward.x, gpGlobals->v_forward.y, gpGlobals->v_up.z ) * 350; + vecJumpDir = Vector( gpGlobals->v_forward.x, gpGlobals->v_forward.y, gpGlobals->v_up.z ) * 350.0f; } - int iSound = RANDOM_LONG(0,2); + int iSound = RANDOM_LONG( 0, 2 ); if( iSound != 0 ) EMIT_SOUND_DYN( edict(), CHAN_VOICE, pAttackSounds[iSound], GetSoundVolue(), ATTN_IDLE, 0, GetVoicePitch() ); pev->velocity = vecJumpDir; - m_flNextAttack = gpGlobals->time + 2; + m_flNextAttack = gpGlobals->time + 2.0f; } break; default: @@ -370,7 +370,7 @@ void CHeadCrab::LeapTouch( CBaseEntity *pOther ) void CHeadCrab::PrescheduleThink( void ) { // make the crab coo a little bit in combat state - if( m_MonsterState == MONSTERSTATE_COMBAT && RANDOM_FLOAT( 0, 5 ) < 0.1 ) + if( m_MonsterState == MONSTERSTATE_COMBAT && RANDOM_FLOAT( 0, 5 ) < 0.1f ) { IdleSound(); } @@ -401,7 +401,7 @@ void CHeadCrab::StartTask( Task_t *pTask ) //========================================================= BOOL CHeadCrab::CheckRangeAttack1( float flDot, float flDist ) { - if( FBitSet( pev->flags, FL_ONGROUND ) && flDist <= 256 && flDot >= 0.65 ) + if( FBitSet( pev->flags, FL_ONGROUND ) && flDist <= 256 && flDot >= 0.65f ) { return TRUE; } @@ -416,7 +416,7 @@ BOOL CHeadCrab::CheckRangeAttack2( float flDot, float flDist ) return FALSE; // BUGBUG: Why is this code here? There is no ACT_RANGE_ATTACK2 animation. I've disabled it for now. #if 0 - if( FBitSet( pev->flags, FL_ONGROUND ) && flDist > 64 && flDist <= 256 && flDot >= 0.5 ) + if( FBitSet( pev->flags, FL_ONGROUND ) && flDist > 64 && flDist <= 256 && flDot >= 0.5f ) { return TRUE; } @@ -487,11 +487,11 @@ public: void Spawn( void ); void Precache( void ); void SetYawSpeed( void ); - float GetDamageAmount( void ) { return gSkillData.headcrabDmgBite * 0.3; } + float GetDamageAmount( void ) { return gSkillData.headcrabDmgBite * 0.3f; } BOOL CheckRangeAttack1( float flDot, float flDist ); Schedule_t *GetScheduleOfType ( int Type ); virtual int GetVoicePitch( void ) { return PITCH_NORM + RANDOM_LONG( 40, 50 ); } - virtual float GetSoundVolue( void ) { return 0.8; } + virtual float GetSoundVolue( void ) { return 0.8f; } }; LINK_ENTITY_TO_CLASS( monster_babycrab, CBabyCrab ) @@ -504,7 +504,7 @@ void CBabyCrab::Spawn( void ) pev->renderamt = 192; UTIL_SetSize( pev, Vector( -12, -12, 0 ), Vector( 12, 12, 24 ) ); - pev->health = gSkillData.headcrabHealth * 0.25; // less health than full grown + pev->health = gSkillData.headcrabHealth * 0.25f; // less health than full grown } void CBabyCrab::Precache( void ) @@ -526,7 +526,7 @@ BOOL CBabyCrab::CheckRangeAttack1( float flDot, float flDist ) return TRUE; // A little less accurate, but jump from closer - if( flDist <= 180 && flDot >= 0.55 ) + if( flDist <= 180.0f && flDot >= 0.55f ) return TRUE; } diff --git a/dlls/healthkit.cpp b/dlls/healthkit.cpp index e1744479..9e111300 100644 --- a/dlls/healthkit.cpp +++ b/dlls/healthkit.cpp @@ -192,13 +192,13 @@ void CWallHealth::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE u { if( m_flSoundTime <= gpGlobals->time ) { - m_flSoundTime = gpGlobals->time + 0.62; + m_flSoundTime = gpGlobals->time + 0.62f; EMIT_SOUND( ENT( pev ), CHAN_ITEM, "items/medshotno1.wav", 1.0, ATTN_NORM ); } return; } - pev->nextthink = pev->ltime + 0.25; + pev->nextthink = pev->ltime + 0.25f; SetThink( &CWallHealth::Off ); // Time to recharge yet? @@ -210,7 +210,7 @@ void CWallHealth::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE u { m_iOn++; EMIT_SOUND( ENT( pev ), CHAN_ITEM, "items/medshot4.wav", 1.0, ATTN_NORM ); - m_flSoundTime = 0.56 + gpGlobals->time; + m_flSoundTime = 0.56f + gpGlobals->time; } if( ( m_iOn == 1 ) && ( m_flSoundTime <= gpGlobals->time ) ) { @@ -225,7 +225,7 @@ void CWallHealth::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE u } // govern the rate of charge - m_flNextCharge = gpGlobals->time + 0.1; + m_flNextCharge = gpGlobals->time + 0.1f; } void CWallHealth::Recharge( void ) diff --git a/dlls/hgrunt.cpp b/dlls/hgrunt.cpp index 62c947f1..7f7e39e5 100644 --- a/dlls/hgrunt.cpp +++ b/dlls/hgrunt.cpp @@ -356,7 +356,7 @@ BOOL CHGrunt::FOkToSpeak( void ) //========================================================= void CHGrunt::JustSpoke( void ) { - CTalkMonster::g_talkWaitTime = gpGlobals->time + RANDOM_FLOAT( 1.5, 2.0 ); + CTalkMonster::g_talkWaitTime = gpGlobals->time + RANDOM_FLOAT( 1.5f, 2.0f ); m_iSentence = HGRUNT_SENT_NONE; } @@ -375,7 +375,7 @@ void CHGrunt::PrescheduleThink( void ) } else { - if( gpGlobals->time - MySquadLeader()->m_flLastEnemySightTime > 5 ) + if( gpGlobals->time - MySquadLeader()->m_flLastEnemySightTime > 5.0f ) { // been a while since we've seen the enemy MySquadLeader()->m_fEnemyEluded = TRUE; @@ -423,13 +423,13 @@ BOOL CHGrunt::CheckMeleeAttack1( float flDot, float flDist ) { return FALSE; } - } - if( flDist <= 64 && flDot >= 0.7 && - pEnemy->Classify() != CLASS_ALIEN_BIOWEAPON && - pEnemy->Classify() != CLASS_PLAYER_BIOWEAPON ) - { - return TRUE; + if( flDist <= 64.0f && flDot >= 0.7f && + pEnemy->Classify() != CLASS_ALIEN_BIOWEAPON && + pEnemy->Classify() != CLASS_PLAYER_BIOWEAPON ) + { + return TRUE; + } } return FALSE; } @@ -444,7 +444,7 @@ BOOL CHGrunt::CheckMeleeAttack1( float flDot, float flDist ) //========================================================= BOOL CHGrunt::CheckRangeAttack1( float flDot, float flDist ) { - if( !HasConditions( bits_COND_ENEMY_OCCLUDED ) && flDist <= 2048 && flDot >= 0.5 && NoFriendlyFire() ) + if( !HasConditions( bits_COND_ENEMY_OCCLUDED ) && flDist <= 2048.0f && flDot >= 0.5f && NoFriendlyFire() ) { TraceResult tr; @@ -459,7 +459,7 @@ BOOL CHGrunt::CheckRangeAttack1( float flDot, float flDist ) // verify that a bullet fired from the gun will hit the enemy before the world. UTIL_TraceLine( vecSrc, m_hEnemy->BodyTarget( vecSrc ), ignore_monsters, ignore_glass, ENT( pev ), &tr ); - if( tr.flFraction == 1.0 ) + if( tr.flFraction == 1.0f ) { return TRUE; } @@ -541,7 +541,7 @@ BOOL CHGrunt::CheckRangeAttack2( float flDot, float flDist ) } } - if( ( vecTarget - pev->origin ).Length2D() <= 256 ) + if( ( vecTarget - pev->origin ).Length2D() <= 256.0f ) { // crap, I don't want to blow myself up m_flNextGrenadeCheck = gpGlobals->time + 1; // one full second. @@ -567,7 +567,7 @@ BOOL CHGrunt::CheckRangeAttack2( float flDot, float flDist ) // don't throw m_fThrowGrenade = FALSE; // don't check again for a while. - m_flNextGrenadeCheck = gpGlobals->time + 1; // one full second. + m_flNextGrenadeCheck = gpGlobals->time + 1.0f; // one full second. } } else @@ -581,14 +581,14 @@ BOOL CHGrunt::CheckRangeAttack2( float flDot, float flDist ) // throw a hand grenade m_fThrowGrenade = TRUE; // don't check again for a while. - m_flNextGrenadeCheck = gpGlobals->time + 0.3; // 1/3 second. + m_flNextGrenadeCheck = gpGlobals->time + 0.3f; // 1/3 second. } else { // don't throw m_fThrowGrenade = FALSE; // don't check again for a while. - m_flNextGrenadeCheck = gpGlobals->time + 1; // one full second. + m_flNextGrenadeCheck = gpGlobals->time + 1.0f; // one full second. } } @@ -611,7 +611,7 @@ void CHGrunt::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir if( flDamage <= 0 ) { UTIL_Ricochet( ptr->vecEndPos, 1.0 ); - flDamage = 0.01; + flDamage = 0.01f; } } // it's head shot anyways @@ -752,7 +752,7 @@ CBaseEntity *CHGrunt::Kick( void ) UTIL_MakeVectors( pev->angles ); Vector vecStart = pev->origin; - vecStart.z += pev->size.z * 0.5; + vecStart.z += pev->size.z * 0.5f; Vector vecEnd = vecStart + ( gpGlobals->v_forward * 70 ); UTIL_TraceHull( vecStart, vecEnd, dont_ignore_monsters, head_hull, ENT( pev ), &tr ); @@ -895,9 +895,9 @@ void CHGrunt::HandleAnimEvent( MonsterEvent_t *pEvent ) CGrenade::ShootContact( pev, GetGunPosition(), m_vecTossVelocity ); m_fThrowGrenade = FALSE; if( g_iSkillLevel == SKILL_HARD ) - m_flNextGrenadeCheck = gpGlobals->time + RANDOM_FLOAT( 2, 5 );// wait a random amount of time before shooting again + m_flNextGrenadeCheck = gpGlobals->time + RANDOM_FLOAT( 2.0f, 5.0f );// wait a random amount of time before shooting again else - m_flNextGrenadeCheck = gpGlobals->time + 6;// wait six seconds before even looking again to see if a grenade can be thrown. + m_flNextGrenadeCheck = gpGlobals->time + 6.0f;// wait six seconds before even looking again to see if a grenade can be thrown. } break; case HGRUNT_AE_GREN_DROP: @@ -2392,7 +2392,7 @@ void CHGruntRepel::RepelUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_ pBeam->SetFlags( BEAM_FSOLID ); pBeam->SetColor( 255, 255, 255 ); pBeam->SetThink( &CBaseEntity::SUB_Remove ); - pBeam->pev->nextthink = gpGlobals->time + -4096.0 * tr.flFraction / pGrunt->pev->velocity.z + 0.5; + pBeam->pev->nextthink = gpGlobals->time + -4096.0f * tr.flFraction / pGrunt->pev->velocity.z + 0.5f; UTIL_Remove( this ); } diff --git a/dlls/hornet.cpp b/dlls/hornet.cpp index 758ba7e9..782e1a27 100644 --- a/dlls/hornet.cpp +++ b/dlls/hornet.cpp @@ -69,14 +69,14 @@ void CHornet::Spawn( void ) if( g_pGameRules->IsMultiplayer() ) { // hornets don't live as long in multiplayer - m_flStopAttack = gpGlobals->time + 3.5; + m_flStopAttack = gpGlobals->time + 3.5f; } else { - m_flStopAttack = gpGlobals->time + 5.0; + m_flStopAttack = gpGlobals->time + 5.0f; } - m_flFieldOfView = 0.9; // +- 25 degrees + m_flFieldOfView = 0.9f; // +- 25 degrees if( RANDOM_LONG( 1, 5 ) <= 2 ) { @@ -95,9 +95,9 @@ void CHornet::Spawn( void ) SetTouch( &CHornet::DieTouch ); SetThink( &CHornet::StartTrack ); - edict_t *pSoundEnt = pev->owner; + /*edict_t *pSoundEnt = pev->owner; if( !pSoundEnt ) - pSoundEnt = edict(); + pSoundEnt = edict();*/ if( !FNullEnt( pev->owner ) && ( pev->owner->v.flags & FL_CLIENT ) ) { @@ -109,7 +109,7 @@ void CHornet::Spawn( void ) pev->dmg = gSkillData.monDmgHornet; } - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; ResetSequenceInfo(); } @@ -169,7 +169,7 @@ void CHornet::StartTrack( void ) SetTouch( &CHornet::TrackTouch ); SetThink( &CHornet::TrackTarget ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } //========================================================= @@ -182,7 +182,7 @@ void CHornet::StartDart( void ) SetTouch( &CHornet::DartTouch ); SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + 4; + pev->nextthink = gpGlobals->time + 4.0f; } void CHornet::IgniteTrail( void ) @@ -253,7 +253,7 @@ void CHornet::TrackTarget( void ) { SetTouch( NULL ); SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; return; } @@ -271,12 +271,12 @@ void CHornet::TrackTarget( void ) } else { - m_vecEnemyLKP = m_vecEnemyLKP + pev->velocity * m_flFlySpeed * 0.1; + m_vecEnemyLKP = m_vecEnemyLKP + pev->velocity * m_flFlySpeed * 0.1f; } vecDirToEnemy = ( m_vecEnemyLKP - pev->origin ).Normalize(); - if( pev->velocity.Length() < 0.1 ) + if( pev->velocity.Length() < 0.1f ) vecFlightDir = vecDirToEnemy; else vecFlightDir = pev->velocity.Normalize(); @@ -284,7 +284,7 @@ void CHornet::TrackTarget( void ) // measure how far the turn is, the wider the turn, the slow we'll go this time. flDelta = DotProduct( vecFlightDir, vecDirToEnemy ); - if( flDelta < 0.5 ) + if( flDelta < 0.5f ) { // hafta turn wide again. play sound switch( RANDOM_LONG( 0, 2 ) ) @@ -304,7 +304,7 @@ void CHornet::TrackTarget( void ) if( flDelta <= 0 && m_iHornetType == HORNET_TYPE_RED ) { // no flying backwards, but we don't want to invert this, cause we'd go fast when we have to turn REAL far. - flDelta = 0.25; + flDelta = 0.25f; } pev->velocity = ( vecFlightDir + vecDirToEnemy ).Normalize(); @@ -312,20 +312,20 @@ void CHornet::TrackTarget( void ) if( pev->owner && ( pev->owner->v.flags & FL_MONSTER ) ) { // random pattern only applies to hornets fired by monsters, not players. - pev->velocity.x += RANDOM_FLOAT( -0.10, 0.10 );// scramble the flight dir a bit. - pev->velocity.y += RANDOM_FLOAT( -0.10, 0.10 ); - pev->velocity.z += RANDOM_FLOAT( -0.10, 0.10 ); + pev->velocity.x += RANDOM_FLOAT( -0.10f, 0.10f );// scramble the flight dir a bit. + pev->velocity.y += RANDOM_FLOAT( -0.10f, 0.10f ); + pev->velocity.z += RANDOM_FLOAT( -0.10f, 0.10f ); } switch( m_iHornetType ) { case HORNET_TYPE_RED: pev->velocity = pev->velocity * ( m_flFlySpeed * flDelta );// scale the dir by the ( speed * width of turn ) - pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 0.1, 0.3 ); + pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 0.1f, 0.3f ); break; case HORNET_TYPE_ORANGE: pev->velocity = pev->velocity * m_flFlySpeed;// do not have to slow down to turn. - pev->nextthink = gpGlobals->time + 0.1;// fixed think time + pev->nextthink = gpGlobals->time + 0.1f;// fixed think time break; } @@ -337,7 +337,7 @@ void CHornet::TrackTarget( void ) // (only in the single player game) if( m_hEnemy != 0 && !g_pGameRules->IsMultiplayer() ) { - if( flDelta >= 0.4 && ( pev->origin - m_vecEnemyLKP ).Length() <= 300 ) + if( flDelta >= 0.4f && ( pev->origin - m_vecEnemyLKP ).Length() <= 300 ) { MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, pev->origin ); WRITE_BYTE( TE_SPRITE ); @@ -362,8 +362,8 @@ void CHornet::TrackTarget( void ) EMIT_SOUND( ENT( pev ), CHAN_VOICE, "hornet/ag_buzz3.wav", HORNET_BUZZ_VOLUME, ATTN_NORM ); break; } - pev->velocity = pev->velocity * 2; - pev->nextthink = gpGlobals->time + 1.0; + pev->velocity = pev->velocity * 2.0f; + pev->nextthink = gpGlobals->time + 1.0f; // don't attack again m_flStopAttack = gpGlobals->time; } @@ -388,10 +388,10 @@ void CHornet::TrackTouch( CBaseEntity *pOther ) pev->velocity = pev->velocity.Normalize(); - pev->velocity.x *= -1; - pev->velocity.y *= -1; + pev->velocity.x *= -1.0f; + pev->velocity.y *= -1.0f; - pev->origin = pev->origin + pev->velocity * 4; // bounce the hornet off a bit. + pev->origin = pev->origin + pev->velocity * 4.0f; // bounce the hornet off a bit. pev->velocity = pev->velocity * m_flFlySpeed; return; @@ -431,5 +431,5 @@ void CHornet::DieTouch( CBaseEntity *pOther ) pev->solid = SOLID_NOT; SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + 1;// stick around long enough for the sound to finish! + pev->nextthink = gpGlobals->time + 1.0f;// stick around long enough for the sound to finish! } diff --git a/dlls/hornetgun.cpp b/dlls/hornetgun.cpp index 909ba342..5e903b0d 100644 --- a/dlls/hornetgun.cpp +++ b/dlls/hornetgun.cpp @@ -113,7 +113,7 @@ BOOL CHgun::Deploy() void CHgun::Holster( int skiplocal /* = 0 */ ) { - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; SendWeaponAnim( HGUN_DOWN ); //!!!HACKHACK - can't select hornetgun if it's empty! no way to get ammo for it, either. @@ -127,17 +127,17 @@ void CHgun::PrimaryAttack() { Reload(); - if(m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0) + if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 ) { return; } #ifndef CLIENT_DLL UTIL_MakeVectors( m_pPlayer->pev->v_angle ); - CBaseEntity *pHornet = CBaseEntity::Create( "hornet", m_pPlayer->GetGunPosition( ) + gpGlobals->v_forward * 16 + gpGlobals->v_right * 8 + gpGlobals->v_up * -12, m_pPlayer->pev->v_angle, m_pPlayer->edict() ); - pHornet->pev->velocity = gpGlobals->v_forward * 300; + CBaseEntity *pHornet = CBaseEntity::Create( "hornet", m_pPlayer->GetGunPosition() + gpGlobals->v_forward * 16.0f + gpGlobals->v_right * 8.0f + gpGlobals->v_up * -12.0f, m_pPlayer->pev->v_angle, m_pPlayer->edict() ); + pHornet->pev->velocity = gpGlobals->v_forward * 300.0f; - m_flRechargeTime = gpGlobals->time + 0.5; + m_flRechargeTime = gpGlobals->time + 0.5f; #endif m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--; @@ -150,16 +150,16 @@ void CHgun::PrimaryAttack() #else flags = 0; #endif - PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usHornetFire, 0.0, g_vecZero, g_vecZero, 0.0, 0.0, FIREMODE_TRACK, 0, 0, 0 ); + PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usHornetFire, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, FIREMODE_TRACK, 0, 0, 0 ); // player "shoot" animation m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); - m_flNextPrimaryAttack = m_flNextPrimaryAttack + 0.25; + m_flNextPrimaryAttack = m_flNextPrimaryAttack + 0.25f; if( m_flNextPrimaryAttack < UTIL_WeaponTimeBase() ) { - m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25f; } m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); @@ -181,49 +181,49 @@ void CHgun::SecondaryAttack( void ) UTIL_MakeVectors( m_pPlayer->pev->v_angle ); - vecSrc = m_pPlayer->GetGunPosition() + gpGlobals->v_forward * 16 + gpGlobals->v_right * 8 + gpGlobals->v_up * -12; + vecSrc = m_pPlayer->GetGunPosition() + gpGlobals->v_forward * 16.0f + gpGlobals->v_right * 8.0f + gpGlobals->v_up * -12.0f; m_iFirePhase++; switch( m_iFirePhase ) { case 1: - vecSrc = vecSrc + gpGlobals->v_up * 8; + vecSrc = vecSrc + gpGlobals->v_up * 8.0f; break; case 2: - vecSrc = vecSrc + gpGlobals->v_up * 8; - vecSrc = vecSrc + gpGlobals->v_right * 8; + vecSrc = vecSrc + gpGlobals->v_up * 8.0f; + vecSrc = vecSrc + gpGlobals->v_right * 8.0f; break; case 3: - vecSrc = vecSrc + gpGlobals->v_right * 8; + vecSrc = vecSrc + gpGlobals->v_right * 8.0f; break; case 4: - vecSrc = vecSrc + gpGlobals->v_up * -8; - vecSrc = vecSrc + gpGlobals->v_right * 8; + vecSrc = vecSrc + gpGlobals->v_up * -8.0f; + vecSrc = vecSrc + gpGlobals->v_right * 8.0f; break; case 5: - vecSrc = vecSrc + gpGlobals->v_up * -8; + vecSrc = vecSrc + gpGlobals->v_up * -8.0f; break; case 6: - vecSrc = vecSrc + gpGlobals->v_up * -8; - vecSrc = vecSrc + gpGlobals->v_right * -8; + vecSrc = vecSrc + gpGlobals->v_up * -8.0f; + vecSrc = vecSrc + gpGlobals->v_right * -8.0f; break; case 7: - vecSrc = vecSrc + gpGlobals->v_right * -8; + vecSrc = vecSrc + gpGlobals->v_right * -8.0f; break; case 8: - vecSrc = vecSrc + gpGlobals->v_up * 8; - vecSrc = vecSrc + gpGlobals->v_right * -8; + vecSrc = vecSrc + gpGlobals->v_up * 8.0f; + vecSrc = vecSrc + gpGlobals->v_right * -8.0f; m_iFirePhase = 0; break; } pHornet = CBaseEntity::Create( "hornet", vecSrc, m_pPlayer->pev->v_angle, m_pPlayer->edict() ); - pHornet->pev->velocity = gpGlobals->v_forward * 1200; + pHornet->pev->velocity = gpGlobals->v_forward * 1200.0f; pHornet->pev->angles = UTIL_VecToAngles( pHornet->pev->velocity ); pHornet->SetThink( &CHornet::StartDart ); - m_flRechargeTime = gpGlobals->time + 0.5; + m_flRechargeTime = gpGlobals->time + 0.5f; #endif int flags; #if defined( CLIENT_WEAPONS ) @@ -231,7 +231,7 @@ void CHgun::SecondaryAttack( void ) #else flags = 0; #endif - PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usHornetFire, 0.0, g_vecZero, g_vecZero, 0.0, 0.0, FIREMODE_FAST, 0, 0, 0 ); + PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usHornetFire, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, FIREMODE_FAST, 0, 0, 0 ); m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--; m_pPlayer->m_iWeaponVolume = NORMAL_GUN_VOLUME; @@ -240,8 +240,8 @@ void CHgun::SecondaryAttack( void ) // player "shoot" animation m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); - m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.1; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); + m_flNextPrimaryAttack = m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.1f; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10.0f, 15.0f ); } void CHgun::Reload( void ) @@ -252,7 +252,7 @@ void CHgun::Reload( void ) while( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] < HORNET_MAX_CARRY && m_flRechargeTime < gpGlobals->time ) { m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]++; - m_flRechargeTime += 0.5; + m_flRechargeTime += 0.5f; } } @@ -264,21 +264,21 @@ void CHgun::WeaponIdle( void ) return; int iAnim; - float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 ); - if( flRand <= 0.75 ) + float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0.0f, 1.0f ); + if( flRand <= 0.75f ) { iAnim = HGUN_IDLE1; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 30.0 / 16 * ( 2 ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 30.0f / 16.0f * 2.0f; } - else if( flRand <= 0.875 ) + else if( flRand <= 0.875f ) { iAnim = HGUN_FIDGETSWAY; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 40.0 / 16.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 40.0f / 16.0f; } else { iAnim = HGUN_FIDGETSHAKE; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 35.0 / 16.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 35.0f / 16.0f; } SendWeaponAnim( iAnim ); } diff --git a/dlls/houndeye.cpp b/dlls/houndeye.cpp index 940b68ea..2b8cadb0 100644 --- a/dlls/houndeye.cpp +++ b/dlls/houndeye.cpp @@ -32,8 +32,8 @@ extern CGraph WorldGraph; // houndeye does 20 points of damage spread over a sphere 384 units in diameter, and each additional // squad member increases the BASE damage by 110%, per the spec. #define HOUNDEYE_MAX_SQUAD_SIZE 4 -#define HOUNDEYE_MAX_ATTACK_RADIUS 384 -#define HOUNDEYE_SQUAD_BONUS (float)1.1 +#define HOUNDEYE_MAX_ATTACK_RADIUS 384.0f +#define HOUNDEYE_SQUAD_BONUS 1.1f #define HOUNDEYE_EYE_FRAMES 4 // how many different switchable maps for the eye @@ -192,7 +192,7 @@ BOOL CHoundeye::FCanActiveIdle( void ) //========================================================= BOOL CHoundeye::CheckRangeAttack1( float flDot, float flDist ) { - if( flDist <= ( HOUNDEYE_MAX_ATTACK_RADIUS * 0.5 ) && flDot >= 0.3 ) + if( flDist <= ( HOUNDEYE_MAX_ATTACK_RADIUS * 0.5f ) && flDot >= 0.3f ) { return TRUE; } @@ -285,8 +285,8 @@ void CHoundeye::HandleAnimEvent( MonsterEvent_t *pEvent ) pev->flags &= ~FL_ONGROUND; - pev->velocity = gpGlobals->v_forward * -200; - pev->velocity.z += ( 0.6 * flGravity ) * 0.5; + pev->velocity = gpGlobals->v_forward * -200.0f; + pev->velocity.z += ( 0.6f * flGravity ) * 0.5f; break; } case HOUND_AE_THUMP: @@ -565,10 +565,10 @@ void CHoundeye::SonicAttack( void ) WRITE_BYTE( TE_BEAMCYLINDER ); WRITE_COORD( pev->origin.x ); WRITE_COORD( pev->origin.y ); - WRITE_COORD( pev->origin.z + 16 ); + WRITE_COORD( pev->origin.z + 16.0f ); WRITE_COORD( pev->origin.x ); WRITE_COORD( pev->origin.y ); - WRITE_COORD( pev->origin.z + 16 + HOUNDEYE_MAX_ATTACK_RADIUS / .2 ); // reach damage radius over .3 seconds + WRITE_COORD( pev->origin.z + 16.0f + HOUNDEYE_MAX_ATTACK_RADIUS / 0.2f ); // reach damage radius over .3 seconds WRITE_SHORT( m_iSpriteTexture ); WRITE_BYTE( 0 ); // startframe WRITE_BYTE( 0 ); // framerate @@ -586,10 +586,10 @@ void CHoundeye::SonicAttack( void ) WRITE_BYTE( TE_BEAMCYLINDER ); WRITE_COORD( pev->origin.x ); WRITE_COORD( pev->origin.y ); - WRITE_COORD( pev->origin.z + 16 ); + WRITE_COORD( pev->origin.z + 16.0f ); WRITE_COORD( pev->origin.x ); WRITE_COORD( pev->origin.y ); - WRITE_COORD( pev->origin.z + 16 + ( HOUNDEYE_MAX_ATTACK_RADIUS / 2 ) / .2 ); // reach damage radius over .3 seconds + WRITE_COORD( pev->origin.z + 16.0f + ( HOUNDEYE_MAX_ATTACK_RADIUS / 2.0f ) / 0.2f ); // reach damage radius over .3 seconds WRITE_SHORT( m_iSpriteTexture ); WRITE_BYTE( 0 ); // startframe WRITE_BYTE( 0 ); // framerate @@ -638,7 +638,7 @@ void CHoundeye::SonicAttack( void ) // if this entity is a client, and is not in full view, inflict half damage. We do this so that players still // take the residual damage if they don't totally leave the houndeye's effective radius. We restrict it to clients // so that monsters in other parts of the level don't take the damage and get pissed. - flAdjustedDamage *= 0.5; + flAdjustedDamage *= 0.5f; } else if( !FClassnameIs( pEntity->pev, "func_breakable" ) && !FClassnameIs( pEntity->pev, "func_pushable" ) ) { @@ -802,17 +802,17 @@ void CHoundeye::RunTask( Task_t *pTask ) float life; life = ( ( 255 - pev->frame ) / ( pev->framerate * m_flFrameRate ) ); - if( life < 0.1 ) - life = 0.1; + if( life < 0.1f ) + life = 0.1f; MESSAGE_BEGIN( MSG_PAS, SVC_TEMPENTITY, pev->origin ); WRITE_BYTE( TE_IMPLOSION ); WRITE_COORD( pev->origin.x ); WRITE_COORD( pev->origin.y ); - WRITE_COORD( pev->origin.z + 16 ); - WRITE_BYTE( 50 * life + 100 ); // radius - WRITE_BYTE( pev->frame / 25.0 ); // count - WRITE_BYTE( life * 10 ); // life + WRITE_COORD( pev->origin.z + 16.0f ); + WRITE_BYTE( 50.0f * life + 100.0f ); // radius + WRITE_BYTE( pev->frame / 25.0f ); // count + WRITE_BYTE( life * 10.0f ); // life MESSAGE_END(); if( m_fSequenceFinished ) @@ -836,7 +836,7 @@ void CHoundeye::RunTask( Task_t *pTask ) void CHoundeye::PrescheduleThink( void ) { // if the hound is mad and is running, make hunt noises. - if( m_MonsterState == MONSTERSTATE_COMBAT && m_Activity == ACT_RUN && RANDOM_FLOAT( 0, 1 ) < 0.2 ) + if( m_MonsterState == MONSTERSTATE_COMBAT && m_Activity == ACT_RUN && RANDOM_FLOAT( 0, 1 ) < 0.2f ) { WarnSound(); } @@ -882,8 +882,8 @@ void CHoundeye::PrescheduleThink( void ) //========================================================= Task_t tlHoundGuardPack[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_GUARD, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_GUARD, 0.0f }, }; Schedule_t slHoundGuardPack[] = @@ -1079,14 +1079,14 @@ Task_t tlHoundCombatFailPVS[] = { { TASK_STOP_MOVING, 0 }, { TASK_HOUND_THREAT_DISPLAY, 0 }, - { TASK_WAIT_FACE_ENEMY, (float)1 }, + { TASK_WAIT_FACE_ENEMY, 1.0f }, }; Schedule_t slHoundCombatFailPVS[] = { { tlHoundCombatFailPVS, - ARRAYSIZE ( tlHoundCombatFailPVS ), + ARRAYSIZE( tlHoundCombatFailPVS ), bits_COND_NEW_ENEMY | bits_COND_LIGHT_DAMAGE | bits_COND_HEAVY_DAMAGE, @@ -1260,13 +1260,13 @@ Schedule_t *CHoundeye::GetSchedule( void ) if( HasConditions( bits_COND_LIGHT_DAMAGE | bits_COND_HEAVY_DAMAGE ) ) { - if( RANDOM_FLOAT( 0, 1 ) <= 0.4 ) + if( RANDOM_FLOAT( 0.0f, 1.0f ) <= 0.4f ) { TraceResult tr; UTIL_MakeVectors( pev->angles ); UTIL_TraceHull( pev->origin, pev->origin + gpGlobals->v_forward * -128, dont_ignore_monsters, head_hull, ENT( pev ), &tr ); - if( tr.flFraction == 1.0 ) + if( tr.flFraction == 1.0f ) { // it's clear behind, so the hound will jump return GetScheduleOfType( SCHED_HOUND_HOP_RETREAT ); diff --git a/dlls/ichthyosaur.cpp b/dlls/ichthyosaur.cpp index 53f57a27..56ff96af 100644 --- a/dlls/ichthyosaur.cpp +++ b/dlls/ichthyosaur.cpp @@ -32,7 +32,7 @@ #define SEARCH_RETRY 16 -#define ICHTHYOSAUR_SPEED 150 +#define ICHTHYOSAUR_SPEED 150.0f extern CGraph WorldGraph; @@ -328,7 +328,7 @@ int CIchthyosaur::Classify( void ) //========================================================= BOOL CIchthyosaur::CheckMeleeAttack1( float flDot, float flDist ) { - if( flDot >= 0.7 && m_flEnemyTouched > gpGlobals->time - 0.2 ) + if( flDot >= 0.7f && m_flEnemyTouched > gpGlobals->time - 0.2f ) { return TRUE; } @@ -366,7 +366,7 @@ void CIchthyosaur::CombatUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE //========================================================= BOOL CIchthyosaur::CheckRangeAttack1( float flDot, float flDist ) { - if( flDot > -0.7 && (m_bOnAttack || ( flDist <= 192 && m_idealDist <= 192 ) ) ) + if( flDot > -0.7f && (m_bOnAttack || ( flDist <= 192 && m_idealDist <= 192 ) ) ) { return TRUE; } @@ -420,22 +420,22 @@ void CIchthyosaur::HandleAnimEvent( MonsterEvent_t *pEvent ) { CBaseEntity *pHurt = m_hEnemy; - if( m_flEnemyTouched < gpGlobals->time - 0.2 && ( m_hEnemy->BodyTarget( pev->origin ) - pev->origin).Length() > ( 32 + 16 + 32 ) ) + if( m_flEnemyTouched < gpGlobals->time - 0.2f && ( m_hEnemy->BodyTarget( pev->origin ) - pev->origin).Length() > ( 32.0f + 16.0f + 32.0f ) ) break; Vector vecShootDir = ShootAtEnemy( pev->origin ); UTIL_MakeAimVectors( pev->angles ); - if( DotProduct( vecShootDir, gpGlobals->v_forward ) > 0.707 ) + if( DotProduct( vecShootDir, gpGlobals->v_forward ) > 0.707f ) { m_bOnAttack = TRUE; pHurt->pev->punchangle.z = -18; pHurt->pev->punchangle.x = 5; - pHurt->pev->velocity = pHurt->pev->velocity - gpGlobals->v_right * 300; + pHurt->pev->velocity = pHurt->pev->velocity - gpGlobals->v_right * 300.0f; if( pHurt->IsPlayer() ) { - pHurt->pev->angles.x += RANDOM_FLOAT( -35, 35 ); - pHurt->pev->angles.y += RANDOM_FLOAT( -90, 90 ); + pHurt->pev->angles.x += RANDOM_FLOAT( -35.0f, 35.0f ); + pHurt->pev->angles.y += RANDOM_FLOAT( -90.0f, 90.0f ); pHurt->pev->angles.z = 0; pHurt->pev->fixangle = TRUE; } @@ -454,7 +454,7 @@ void CIchthyosaur::HandleAnimEvent( MonsterEvent_t *pEvent ) if( bDidAttack ) { - Vector vecSrc = pev->origin + gpGlobals->v_forward * 32; + Vector vecSrc = pev->origin + gpGlobals->v_forward * 32.0f; UTIL_Bubbles( vecSrc - Vector( 8, 8, 8 ), vecSrc + Vector( 8, 8, 8 ), 16 ); } } @@ -478,7 +478,7 @@ void CIchthyosaur::Spawn() m_MonsterState = MONSTERSTATE_NONE; SetBits(pev->flags, FL_SWIM); SetFlyingSpeed( ICHTHYOSAUR_SPEED ); - SetFlyingMomentum( 2.5 ); // Set momentum constant + SetFlyingMomentum( 2.5f ); // Set momentum constant m_afCapability = bits_CAP_RANGE_ATTACK1 | bits_CAP_SWIM; @@ -634,9 +634,9 @@ void CIchthyosaur::RunTask( Task_t *pTask ) Vector vecSwim = CrossProduct( vecDelta, Vector( 0, 0, 1 ) ).Normalize(); if( DotProduct( vecSwim, m_SaveVelocity ) < 0 ) - vecSwim = vecSwim * -1.0; + vecSwim = vecSwim * -1.0f; - Vector vecPos = vecFrom + vecDelta * m_idealDist + vecSwim * 32; + Vector vecPos = vecFrom + vecDelta * m_idealDist + vecSwim * 32.0f; // ALERT( at_console, "vecPos %.0f %.0f %.0f\n", vecPos.x, vecPos.y, vecPos.z ); @@ -644,16 +644,16 @@ void CIchthyosaur::RunTask( Task_t *pTask ) UTIL_TraceHull( vecFrom, vecPos, ignore_monsters, large_hull, m_hEnemy->edict(), &tr ); - if( tr.flFraction > 0.5 ) + if( tr.flFraction > 0.5f ) vecPos = tr.vecEndPos; - m_SaveVelocity = m_SaveVelocity * 0.8 + 0.2 * ( vecPos - pev->origin ).Normalize() * m_flightSpeed; + m_SaveVelocity = m_SaveVelocity * 0.8f + 0.2f * ( vecPos - pev->origin ).Normalize() * m_flightSpeed; // ALERT( at_console, "m_SaveVelocity %.2f %.2f %.2f\n", m_SaveVelocity.x, m_SaveVelocity.y, m_SaveVelocity.z ); if( HasConditions( bits_COND_ENEMY_FACING_ME ) && m_hEnemy->FVisible( this ) ) { - m_flNextAlert -= 0.1; + m_flNextAlert -= 0.1f; if( m_idealDist < m_flMaxDist ) { @@ -670,12 +670,12 @@ void CIchthyosaur::RunTask( Task_t *pTask ) } if( m_flMinSpeed < m_flMaxSpeed ) { - m_flMinSpeed += 0.5; + m_flMinSpeed += 0.5f; } } else { - m_flNextAlert += 0.1; + m_flNextAlert += 0.1f; if( m_idealDist > 128 ) { @@ -690,7 +690,7 @@ void CIchthyosaur::RunTask( Task_t *pTask ) } else { - m_flNextAlert = gpGlobals->time + 0.2; + m_flNextAlert = gpGlobals->time + 0.2f; } if( m_flNextAlert < gpGlobals->time ) @@ -716,7 +716,7 @@ void CIchthyosaur::RunTask( Task_t *pTask ) break; case TASK_ICHTHYOSAUR_FLOAT: pev->angles.x = UTIL_ApproachAngle( 0, pev->angles.x, 20 ); - pev->velocity = pev->velocity * 0.8; + pev->velocity = pev->velocity * 0.8f; if( pev->waterlevel > 1 && pev->velocity.z < 64 ) { pev->velocity.z += 8; @@ -740,7 +740,7 @@ float CIchthyosaur::VectorToPitch( const Vector &vec ) pitch = 0; else { - pitch = (int) ( atan2( vec.z, sqrt( vec.x * vec.x + vec.y * vec.y ) ) * 180 / M_PI ); + pitch = (int) ( atan2( vec.z, sqrt( vec.x * vec.x + vec.y * vec.y ) ) * 180.0f / M_PI_F ); if( pitch < 0 ) pitch += 360; } @@ -793,7 +793,7 @@ float CIchthyosaur::ChangePitch( int speed ) else if( diff > 20 ) target = -45; } - pev->angles.x = UTIL_Approach(target, pev->angles.x, 220.0 * 0.1 ); + pev->angles.x = UTIL_Approach(target, pev->angles.x, 220.0f * 0.1f ); } return 0; } @@ -812,7 +812,7 @@ float CIchthyosaur::ChangeYaw( int speed ) else if( diff > 20 ) target = -20; } - pev->angles.z = UTIL_Approach( target, pev->angles.z, 220.0 * 0.1 ); + pev->angles.z = UTIL_Approach( target, pev->angles.z, 220.0f * 0.1f ); } return CFlyingMonster::ChangeYaw( speed ); } @@ -843,9 +843,9 @@ void CIchthyosaur::MonsterThink( void ) if( m_flBlink < gpGlobals->time ) { pev->skin = EYE_CLOSED; - if( m_flBlink + 0.2 < gpGlobals->time ) + if( m_flBlink + 0.2f < gpGlobals->time ) { - m_flBlink = gpGlobals->time + RANDOM_FLOAT( 3, 4 ); + m_flBlink = gpGlobals->time + RANDOM_FLOAT( 3.0f, 4.0f ); if( m_bOnAttack ) pev->skin = EYE_MAD; else @@ -873,7 +873,7 @@ void CIchthyosaur::Swim() if( FBitSet( pev->flags, FL_ONGROUND ) ) { - pev->angles.x = 0; + pev->angles.x = 0.0f; pev->angles.y += RANDOM_FLOAT( -45, 45 ); ClearBits( pev->flags, FL_ONGROUND ); @@ -894,15 +894,15 @@ void CIchthyosaur::Swim() if( m_IdealActivity == ACT_RUN ) SetActivity( ACT_WALK ); if( m_IdealActivity == ACT_WALK ) - pev->framerate = m_flightSpeed / 150.0; + pev->framerate = m_flightSpeed / 150.0f; // ALERT( at_console, "walk %.2f\n", pev->framerate ); } else { if( m_IdealActivity == ACT_WALK ) SetActivity( ACT_RUN ); - if( m_IdealActivity == ACT_RUN) - pev->framerate = m_flightSpeed / 150.0; + if( m_IdealActivity == ACT_RUN ) + pev->framerate = m_flightSpeed / 150.0f; // ALERT( at_console, "run %.2f\n", pev->framerate ); } /* @@ -935,10 +935,10 @@ void CIchthyosaur::Swim() // ALERT( at_console, "%f : %f\n", Angles.x, Forward.z ); float flDot = DotProduct( Forward, m_SaveVelocity ); - if( flDot > 0.5 ) + if( flDot > 0.5f ) pev->velocity = m_SaveVelocity = m_SaveVelocity * m_flightSpeed; else if( flDot > 0 ) - pev->velocity = m_SaveVelocity = m_SaveVelocity * m_flightSpeed * ( flDot + 0.5 ); + pev->velocity = m_SaveVelocity = m_SaveVelocity * m_flightSpeed * ( flDot + 0.5f ); else pev->velocity = m_SaveVelocity = m_SaveVelocity * 80; @@ -957,7 +957,7 @@ void CIchthyosaur::Swim() // if( Angles.x > 180 ) Angles.x = Angles.x - 360; - pev->angles.x = UTIL_Approach( Angles.x, pev->angles.x, 50 * 0.1 ); + pev->angles.x = UTIL_Approach( Angles.x, pev->angles.x, 50 * 0.1f ); if( pev->angles.x < -80 ) pev->angles.x = -80; if( pev->angles.x > 80 ) @@ -981,12 +981,12 @@ void CIchthyosaur::Swim() turn = Angles.y - pev->angles.y - 360; } - float speed = m_flightSpeed * 0.1; + float speed = m_flightSpeed * 0.1f; // ALERT( at_console, "speed %.0f %f\n", turn, speed ); if( fabs( turn ) > speed ) { - if( turn < 0.0 ) + if( turn < 0.0f ) { turn = -speed; } @@ -997,15 +997,15 @@ void CIchthyosaur::Swim() } pev->angles.y += turn; pev->angles.z -= turn; - pev->angles.y = fmod( ( pev->angles.y + 360.0 ), 360.0 ); + pev->angles.y = fmod( ( pev->angles.y + 360.0f ), 360.0f ); static float yaw_adj; - yaw_adj = yaw_adj * 0.8 + turn; + yaw_adj = yaw_adj * 0.8f + turn; // ALERT( at_console, "yaw %f : %f\n", turn, yaw_adj ); - SetBoneController( 0, -yaw_adj / 4.0 ); + SetBoneController( 0, -yaw_adj * 0.25f ); // Roll Smoothing // @@ -1022,7 +1022,7 @@ void CIchthyosaur::Swim() { turn = Angles.z - pev->angles.z - 360; } - speed = m_flightSpeed / 2 * 0.1; + speed = m_flightSpeed / 2 * 0.1f; if( fabs( turn ) < speed ) { @@ -1030,7 +1030,7 @@ void CIchthyosaur::Swim() } else { - if( turn < 0.0 ) + if( turn < 0.0f ) { pev->angles.z -= speed; } @@ -1058,12 +1058,12 @@ Vector CIchthyosaur::DoProbe( const Vector &Probe ) TraceResult tr; TRACE_MONSTER_HULL( edict(), pev->origin, Probe, dont_ignore_monsters, edict(), &tr ); - if( tr.fAllSolid || tr.flFraction < 0.99 ) + if( tr.fAllSolid || tr.flFraction < 0.99f ) { - if( tr.flFraction < 0.0 ) - tr.flFraction = 0.0; - if( tr.flFraction > 1.0 ) - tr.flFraction = 1.0; + if( tr.flFraction < 0.0f ) + tr.flFraction = 0.0f; + if( tr.flFraction > 1.0f ) + tr.flFraction = 1.0f; if( tr.flFraction < frac ) { frac = tr.flFraction; @@ -1080,7 +1080,7 @@ Vector CIchthyosaur::DoProbe( const Vector &Probe ) Vector SteeringVector = CrossProduct( NormalToProbeAndWallNormal, ProbeDir ); float SteeringForce = m_flightSpeed * ( 1 -frac ) * ( DotProduct( WallNormal.Normalize(), m_SaveVelocity.Normalize() ) ); - if( SteeringForce < 0.0 ) + if( SteeringForce < 0.0f ) { SteeringForce = -SteeringForce; } diff --git a/dlls/islave.cpp b/dlls/islave.cpp index b516c09b..51883be3 100644 --- a/dlls/islave.cpp +++ b/dlls/islave.cpp @@ -467,7 +467,7 @@ BOOL CISlave::CheckRangeAttack2( float flDot, float flDist ) TraceResult tr; UTIL_TraceLine( EyePosition(), pEntity->EyePosition(), ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction == 1.0 || tr.pHit == pEntity->edict() ) + if( tr.flFraction == 1.0f || tr.pHit == pEntity->edict() ) { if( pEntity->pev->deadflag == DEAD_DEAD ) { @@ -639,10 +639,13 @@ Schedule_t *CISlave::GetSchedule( void ) ASSERT( pSound != NULL ); - if( pSound && ( pSound->m_iType & bits_SOUND_DANGER ) ) - return GetScheduleOfType( SCHED_TAKE_COVER_FROM_BEST_SOUND ); - if( pSound->m_iType & bits_SOUND_COMBAT ) - m_afMemory |= bits_MEMORY_PROVOKED; + if( pSound ) + { + if( pSound->m_iType & bits_SOUND_DANGER ) + return GetScheduleOfType( SCHED_TAKE_COVER_FROM_BEST_SOUND ); + if( pSound->m_iType & bits_SOUND_COMBAT ) + m_afMemory |= bits_MEMORY_PROVOKED; + } } switch( m_MonsterState ) @@ -723,7 +726,7 @@ void CISlave::ArmBeam( int side ) } // Couldn't find anything close enough - if( flDist == 1.0 ) + if( flDist == 1.0f ) return; DecalGunshot( &tr, BULLET_PLAYER_CROWBAR ); diff --git a/dlls/items.cpp b/dlls/items.cpp index 1d45c34d..0824c097 100644 --- a/dlls/items.cpp +++ b/dlls/items.cpp @@ -96,7 +96,7 @@ void CItem::Spawn( void ) if( DROP_TO_FLOOR(ENT( pev ) ) == 0 ) { - ALERT(at_error, "Item %s fell out of level at %f,%f,%f\n", STRING( pev->classname ), pev->origin.x, pev->origin.y, pev->origin.z); + ALERT(at_error, "Item %s fell out of level at %f,%f,%f\n", STRING( pev->classname ), (double)pev->origin.x, (double)pev->origin.y, (double)pev->origin.z); UTIL_Remove( this ); return; } @@ -237,7 +237,7 @@ class CItemBattery : public CItem // Suit reports new power level // For some reason this wasn't working in release build -- round it. - pct = (int)( (float)( pPlayer->pev->armorvalue * 100.0 ) * ( 1.0 / MAX_NORMAL_BATTERY ) + 0.5 ); + pct = (int)( (float)( pPlayer->pev->armorvalue * 100.0f ) * ( 1.0f / MAX_NORMAL_BATTERY ) + 0.5f ); pct = ( pct / 5 ); if( pct > 0 ) pct--; diff --git a/dlls/leech.cpp b/dlls/leech.cpp index 1d64eae1..092f338e 100644 --- a/dlls/leech.cpp +++ b/dlls/leech.cpp @@ -48,12 +48,12 @@ #define LEECH_ACCELERATE 10 #define LEECH_CHECK_DIST 45 -#define LEECH_SWIM_SPEED 50 -#define LEECH_SWIM_ACCEL 80 -#define LEECH_SWIM_DECEL 10 +#define LEECH_SWIM_SPEED 50.0f +#define LEECH_SWIM_ACCEL 80.0f +#define LEECH_SWIM_DECEL 10.0f #define LEECH_TURN_RATE 90 #define LEECH_SIZEX 10 -#define LEECH_FRAMETIME 0.1 +#define LEECH_FRAMETIME 0.1f #define DEBUG_BEAMS 0 @@ -209,16 +209,16 @@ void CLeech::RecalculateWaterlevel( void ) TraceResult tr; UTIL_TraceLine( pev->origin, vecTest, missile, edict(), &tr ); - if( tr.flFraction != 1.0 ) - m_bottom = tr.vecEndPos.z + 1; + if( tr.flFraction != 1.0f ) + m_bottom = tr.vecEndPos.z + 1.0f; else m_bottom = vecTest.z; m_top = UTIL_WaterLevel( pev->origin, pev->origin.z, pev->origin.z + 400 ) - 1; // Chop off 20% of the outside range - float newBottom = m_bottom * 0.8 + m_top * 0.2; - m_top = m_bottom * 0.2 + m_top * 0.8; + float newBottom = m_bottom * 0.8f + m_top * 0.2f; + m_top = m_bottom * 0.2f + m_top * 0.8f; m_bottom = newBottom; m_height = RANDOM_FLOAT( m_bottom, m_top ); m_waterTime = gpGlobals->time + RANDOM_FLOAT( 5, 7 ); @@ -259,14 +259,14 @@ void CLeech::AttackSound( void ) { if( gpGlobals->time > m_attackSoundTime ) { - EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pAttackSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackSounds ) - 1 )], 1.0, ATTN_NORM, 0, PITCH_NORM ); - m_attackSoundTime = gpGlobals->time + 0.5; + EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pAttackSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackSounds ) - 1 )], 1.0f, ATTN_NORM, 0, PITCH_NORM ); + m_attackSoundTime = gpGlobals->time + 0.5f; } } void CLeech::AlertSound( void ) { - EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pAlertSounds[RANDOM_LONG( 0, ARRAYSIZE( pAlertSounds ) - 1 )], 1.0, ATTN_NORM * 0.5, 0, PITCH_NORM ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pAlertSounds[RANDOM_LONG( 0, ARRAYSIZE( pAlertSounds ) - 1 )], 1.0f, ATTN_NORM * 0.5f, 0, PITCH_NORM ); } void CLeech::Precache( void ) @@ -289,7 +289,7 @@ int CLeech::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float f // Nudge the leech away from the damage if( pevInflictor ) { - pev->velocity = ( pev->origin - pevInflictor->origin ).Normalize() * 25; + pev->velocity = ( pev->origin - pevInflictor->origin ).Normalize() * 25.0f; } return CBaseMonster::TakeDamage( pevInflictor, pevAttacker, flDamage, bitsDamageType ); @@ -315,7 +315,7 @@ void CLeech::HandleAnimEvent( MonsterEvent_t *pEvent ) dir = dir.Normalize(); face = face.Normalize(); - if( DotProduct( dir, face ) > 0.9 ) // Only take damage if the leech is facing the prey + if( DotProduct( dir, face ) > 0.9f ) // Only take damage if the leech is facing the prey pEnemy->TakeDamage( pev, pev, gSkillData.leechDmgBite, DMG_SLASH ); } m_stateTime -= 2; @@ -354,12 +354,12 @@ float CLeech::ObstacleDistance( CBaseEntity *pTarget ) if( tr.fStartSolid ) { - pev->speed = -LEECH_SWIM_SPEED * 0.5; + pev->speed = -LEECH_SWIM_SPEED * 0.5f; //ALERT( at_console, "Stuck from (%f %f %f) to (%f %f %f)\n", pev->oldorigin.x, pev->oldorigin.y, pev->oldorigin.z, pev->origin.x, pev->origin.y, pev->origin.z ); //UTIL_SetOrigin( pev, pev->oldorigin ); } - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { if( ( pTarget == NULL || tr.pHit != pTarget->edict() ) ) { @@ -377,16 +377,16 @@ float CLeech::ObstacleDistance( CBaseEntity *pTarget ) // extra wide checks vecTest = pev->origin + gpGlobals->v_right * LEECH_SIZEX * 2 + gpGlobals->v_forward * LEECH_CHECK_DIST; UTIL_TraceLine( pev->origin, vecTest, missile, edict(), &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) return tr.flFraction; vecTest = pev->origin - gpGlobals->v_right * LEECH_SIZEX * 2 + gpGlobals->v_forward * LEECH_CHECK_DIST; UTIL_TraceLine( pev->origin, vecTest, missile, edict(), &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) return tr.flFraction; // Didn't hit either side, so stop testing for another 0.5 - 1 seconds - m_sideTime = gpGlobals->time + RANDOM_FLOAT( 0.5, 1 ); + m_sideTime = gpGlobals->time + RANDOM_FLOAT( 0.5f, 1.0f ); } return 1.0; } @@ -408,7 +408,7 @@ void CLeech::DeadThink( void ) } } StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; // Apply damage velocity, but keep out of the walls if( pev->velocity.x != 0 || pev->velocity.y != 0 ) @@ -416,11 +416,11 @@ void CLeech::DeadThink( void ) TraceResult tr; // Look 0.5 seconds ahead - UTIL_TraceLine( pev->origin, pev->origin + pev->velocity * 0.5, missile, edict(), &tr ); - if( tr.flFraction != 1.0 ) + UTIL_TraceLine( pev->origin, pev->origin + pev->velocity * 0.5f, missile, edict(), &tr ); + if( tr.flFraction != 1.0f ) { - pev->velocity.x = 0; - pev->velocity.y = 0; + pev->velocity.x = 0.0f; + pev->velocity.y = 0.0f; } } } @@ -428,15 +428,15 @@ void CLeech::DeadThink( void ) void CLeech::UpdateMotion( void ) { float flapspeed = ( pev->speed - m_flAccelerate ) / LEECH_ACCELERATE; - m_flAccelerate = m_flAccelerate * 0.8 + pev->speed * 0.2; + m_flAccelerate = m_flAccelerate * 0.8f + pev->speed * 0.2f; if( flapspeed < 0 ) flapspeed = -flapspeed; - flapspeed += 1.0; - if( flapspeed < 0.5 ) - flapspeed = 0.5; - if( flapspeed > 1.9 ) - flapspeed = 1.9; + flapspeed += 1.0f; + if( flapspeed < 0.5f ) + flapspeed = 0.5f; + if( flapspeed > 1.9f ) + flapspeed = 1.9f; pev->framerate = flapspeed; @@ -445,9 +445,9 @@ void CLeech::UpdateMotion( void ) else pev->avelocity.y = pev->ideal_yaw * m_obstacle; - if( pev->avelocity.y > 150 ) + if( pev->avelocity.y > 150.0f ) m_IdealActivity = ACT_TURN_LEFT; - else if( pev->avelocity.y < -150 ) + else if( pev->avelocity.y < -150.0f ) m_IdealActivity = ACT_TURN_RIGHT; else m_IdealActivity = ACT_SWIM; @@ -463,10 +463,10 @@ void CLeech::UpdateMotion( void ) else targetPitch = 0; - pev->angles.x = UTIL_Approach( targetPitch, pev->angles.x, 60 * LEECH_FRAMETIME ); + pev->angles.x = UTIL_Approach( targetPitch, pev->angles.x, 60.0f * LEECH_FRAMETIME ); // bank - pev->avelocity.z = -( pev->angles.z + ( pev->avelocity.y * 0.25 ) ); + pev->avelocity.z = -( pev->angles.z + ( pev->avelocity.y * 0.25f ) ); if( m_MonsterState == MONSTERSTATE_COMBAT && HasConditions( bits_COND_CAN_MELEE_ATTACK1 ) ) m_IdealActivity = ACT_MELEE_ATTACK1; @@ -479,11 +479,11 @@ void CLeech::UpdateMotion( void ) pev->velocity = g_vecZero; // Animation will intersect the floor if either of these is non-zero - pev->angles.z = 0; - pev->angles.x = 0; + pev->angles.z = 0.0f; + pev->angles.x = 0.0f; - if( pev->framerate < 1.0 ) - pev->framerate = 1.0; + if( pev->framerate < 1.0f ) + pev->framerate = 1.0f; } else if( pev->movetype == MOVETYPE_TOSS ) { @@ -505,11 +505,11 @@ void CLeech::UpdateMotion( void ) if( !m_pt ) m_pt = CBeam::BeamCreate( "sprites/laserbeam.spr", 5 ); m_pb->PointsInit( pev->origin, pev->origin + gpGlobals->v_forward * LEECH_CHECK_DIST ); - m_pt->PointsInit( pev->origin, pev->origin - gpGlobals->v_right * ( pev->avelocity.y * 0.25 ) ); + m_pt->PointsInit( pev->origin, pev->origin - gpGlobals->v_right * ( pev->avelocity.y * 0.25f ) ); if( m_fPathBlocked ) { float color = m_obstacle * 30; - if( m_obstacle == 1.0 ) + if( m_obstacle == 1.0f ) color = 0; if( color > 255 ) color = 255; @@ -532,12 +532,12 @@ void CLeech::SwimThink( void ) if( FNullEnt( FIND_CLIENT_IN_PVS( edict() ) ) ) { - pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 1, 1.5 ); + pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 1.0f, 1.5f ); pev->velocity = g_vecZero; return; } else - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; targetSpeed = LEECH_SWIM_SPEED; @@ -572,10 +572,10 @@ void CLeech::SwimThink( void ) targetYaw = UTIL_AngleDiff( targetYaw, UTIL_AngleMod( pev->angles.y ) ); - if( targetYaw < ( -LEECH_TURN_RATE * 0.75 ) ) - targetYaw = ( -LEECH_TURN_RATE * 0.75 ); - else if( targetYaw > ( LEECH_TURN_RATE * 0.75 ) ) - targetYaw = ( LEECH_TURN_RATE * 0.75 ); + if( targetYaw < ( -LEECH_TURN_RATE * 0.75f ) ) + targetYaw = ( -LEECH_TURN_RATE * 0.75f ); + else if( targetYaw > ( LEECH_TURN_RATE * 0.75f ) ) + targetYaw = ( LEECH_TURN_RATE * 0.75f ); else targetSpeed *= 2; } @@ -584,7 +584,7 @@ void CLeech::SwimThink( void ) if( m_zTime < gpGlobals->time ) { float newHeight = RANDOM_FLOAT( m_bottom, m_top ); - m_height = 0.5 * m_height + 0.5 * newHeight; + m_height = 0.5f * m_height + 0.5f * newHeight; m_zTime = gpGlobals->time + RANDOM_FLOAT( 1, 4 ); } if( RANDOM_LONG( 0, 100 ) < 10 ) @@ -602,11 +602,11 @@ void CLeech::SwimThink( void ) m_obstacle = ObstacleDistance( pTarget ); pev->oldorigin = pev->origin; - if( m_obstacle < 0.1 ) - m_obstacle = 0.1; + if( m_obstacle < 0.1f ) + m_obstacle = 0.1f; // is the way ahead clear? - if( m_obstacle == 1.0 ) + if( m_obstacle == 1.0f ) { // if the leech is turning, stop the trend. if( m_flTurning != 0 ) @@ -621,7 +621,7 @@ void CLeech::SwimThink( void ) } else { - m_obstacle = 1.0 / m_obstacle; + m_obstacle = 1.0f / m_obstacle; // IF we get this far in the function, the leader's path is blocked! m_fPathBlocked = TRUE; @@ -639,12 +639,12 @@ void CLeech::SwimThink( void ) // turn left, right or random depending on clearance ratio float delta = ( flRightSide - flLeftSide ); - if( delta > 0.1 || ( delta > -0.1 && RANDOM_LONG( 0, 100 ) < 50 ) ) + if( delta > 0.1f || ( delta > -0.1f && RANDOM_LONG( 0, 100 ) < 50 ) ) m_flTurning = -LEECH_TURN_RATE; else m_flTurning = LEECH_TURN_RATE; } - pev->speed = UTIL_Approach( -( LEECH_SWIM_SPEED * 0.5 ), pev->speed, LEECH_SWIM_DECEL * LEECH_FRAMETIME * m_obstacle ); + pev->speed = UTIL_Approach( -( LEECH_SWIM_SPEED * 0.5f ), pev->speed, LEECH_SWIM_DECEL * LEECH_FRAMETIME * m_obstacle ); pev->velocity = gpGlobals->v_forward * pev->speed; } pev->ideal_yaw = m_flTurning + targetYaw; diff --git a/dlls/lights.cpp b/dlls/lights.cpp index 13e6d3a9..9ff839c3 100644 --- a/dlls/lights.cpp +++ b/dlls/lights.cpp @@ -162,9 +162,9 @@ void CEnvLight::KeyValue( KeyValueData* pkvd ) } // simulate qrad direct, ambient,and gamma adjustments, as well as engine scaling - r = (int)( pow( r / 114.0, 0.6 ) * 264.0 ); - g = (int)( pow( g / 114.0, 0.6 ) * 264.0 ); - b = (int)( pow( b / 114.0, 0.6 ) * 264.0 ); + r = (int)( pow( r / 114.0f, 0.6f ) * 264.0f ); + g = (int)( pow( g / 114.0f, 0.6f ) * 264.0f ); + b = (int)( pow( b / 114.0f, 0.6f ) * 264.0f ); pkvd->fHandled = TRUE; sprintf( szColor, "%d", r ); @@ -185,11 +185,11 @@ void CEnvLight::Spawn( void ) char szVector[64]; UTIL_MakeAimVectors( pev->angles ); - sprintf( szVector, "%f", gpGlobals->v_forward.x ); + sprintf( szVector, "%f", (double)gpGlobals->v_forward.x ); CVAR_SET_STRING( "sv_skyvec_x", szVector ); - sprintf( szVector, "%f", gpGlobals->v_forward.y ); + sprintf( szVector, "%f", (double)gpGlobals->v_forward.y ); CVAR_SET_STRING( "sv_skyvec_y", szVector ); - sprintf( szVector, "%f", gpGlobals->v_forward.z ); + sprintf( szVector, "%f", (double)gpGlobals->v_forward.z ); CVAR_SET_STRING( "sv_skyvec_z", szVector ); CLight::Spawn(); diff --git a/dlls/monsters.cpp b/dlls/monsters.cpp index 3ff235ee..e14dbace 100644 --- a/dlls/monsters.cpp +++ b/dlls/monsters.cpp @@ -262,7 +262,8 @@ void CBaseMonster::Listen( void ) } //iSound = g_pSoundEnt->m_SoundPool[iSound].m_iNext; - iSound = pCurrentSound->m_iNext; + if( pCurrentSound ) + iSound = pCurrentSound->m_iNext; } } @@ -431,18 +432,21 @@ CSound *CBaseMonster::PBestSound( void ) { pSound = CSoundEnt::SoundPointerForIndex( iThisSound ); - if( pSound && pSound->FIsSound() ) + if( pSound ) { - flDist = ( pSound->m_vecOrigin - EarPosition() ).Length(); - - if( flDist < flBestDist ) + if( pSound->FIsSound() ) { - iBestSound = iThisSound; - flBestDist = flDist; - } - } + flDist = ( pSound->m_vecOrigin - EarPosition() ).Length(); - iThisSound = pSound->m_iNextAudible; + if( flDist < flBestDist ) + { + iBestSound = iThisSound; + flBestDist = flDist; + } + } + + iThisSound = pSound->m_iNextAudible; + } } if( iBestSound >= 0 ) { @@ -513,7 +517,7 @@ CSound *CBaseMonster::PBestScent( void ) //========================================================= void CBaseMonster::MonsterThink( void ) { - pev->nextthink = gpGlobals->time + 0.1;// keep monster thinking. + pev->nextthink = gpGlobals->time + 0.1f;// keep monster thinking. RunAI(); @@ -850,10 +854,10 @@ void CBaseMonster::RouteSimplify( CBaseEntity *pTargetEnt ) Vector vecTest, vecSplit; // Halfway between this and next - vecTest = ( m_Route[m_iRouteIndex + i + 1].vecLocation + m_Route[m_iRouteIndex + i].vecLocation ) * 0.5; + vecTest = ( m_Route[m_iRouteIndex + i + 1].vecLocation + m_Route[m_iRouteIndex + i].vecLocation ) * 0.5f; // Halfway between this and previous - vecSplit = ( m_Route[m_iRouteIndex + i].vecLocation + vecStart ) * 0.5; + vecSplit = ( m_Route[m_iRouteIndex + i].vecLocation + vecStart ) * 0.5f; int iType = ( m_Route[m_iRouteIndex + i].iType | bits_MF_TO_DETOUR ) & ~bits_MF_NOT_TO_MASK; if( CheckLocalMove( vecStart, vecTest, pTargetEnt, NULL ) == LOCALMOVE_VALID ) @@ -927,7 +931,7 @@ BOOL CBaseMonster::FBecomeProne( void ) //========================================================= BOOL CBaseMonster::CheckRangeAttack1( float flDot, float flDist ) { - if( flDist > 64 && flDist <= 784 && flDot >= 0.5 ) + if( flDist > 64.0f && flDist <= 784.0f && flDot >= 0.5f ) { return TRUE; } @@ -939,7 +943,7 @@ BOOL CBaseMonster::CheckRangeAttack1( float flDot, float flDist ) //========================================================= BOOL CBaseMonster::CheckRangeAttack2( float flDot, float flDist ) { - if( flDist > 64 && flDist <= 512 && flDot >= 0.5 ) + if( flDist > 64.0f && flDist <= 512.0f && flDot >= 0.5f ) { return TRUE; } @@ -952,7 +956,7 @@ BOOL CBaseMonster::CheckRangeAttack2( float flDot, float flDist ) BOOL CBaseMonster::CheckMeleeAttack1( float flDot, float flDist ) { // Decent fix to keep folks from kicking/punching hornets and snarks is to check the onground flag(sjb) - if( flDist <= 64 && flDot >= 0.7 && m_hEnemy != 0 && FBitSet( m_hEnemy->pev->flags, FL_ONGROUND ) ) + if( flDist <= 64.0f && flDot >= 0.7f && m_hEnemy != 0 && FBitSet( m_hEnemy->pev->flags, FL_ONGROUND ) ) { return TRUE; } @@ -964,7 +968,7 @@ BOOL CBaseMonster::CheckMeleeAttack1( float flDot, float flDist ) //========================================================= BOOL CBaseMonster::CheckMeleeAttack2( float flDot, float flDist ) { - if( flDist <= 64 && flDot >= 0.7 ) + if( flDist <= 64.0f && flDot >= 0.7f ) { return TRUE; } @@ -1062,7 +1066,7 @@ int CBaseMonster::CheckEnemy( CBaseEntity *pEnemy ) // distance to enemy's origin flDistToEnemy = ( vecEnemyPos - pev->origin ).Length(); - vecEnemyPos.z += pEnemy->pev->size.z * 0.5; + vecEnemyPos.z += pEnemy->pev->size.z * 0.5f; // distance to enemy's head float flDistToEnemy2 = ( vecEnemyPos - pev->origin ).Length(); @@ -1099,7 +1103,7 @@ int CBaseMonster::CheckEnemy( CBaseEntity *pEnemy ) if( pEnemy->pev->velocity != Vector( 0, 0, 0 ) ) { // trail the enemy a bit - m_vecEnemyLKP = m_vecEnemyLKP - pEnemy->pev->velocity * RANDOM_FLOAT( -0.05, 0 ); + m_vecEnemyLKP = m_vecEnemyLKP - pEnemy->pev->velocity * RANDOM_FLOAT( -0.05f, 0.0f ); } else { @@ -1135,7 +1139,7 @@ int CBaseMonster::CheckEnemy( CBaseEntity *pEnemy ) if( m_Route[i].iType == ( bits_MF_IS_GOAL | bits_MF_TO_ENEMY ) ) { // UNDONE: Should we allow monsters to override this distance (80?) - if( ( m_Route[i].vecLocation - m_vecEnemyLKP ).Length() > 80 ) + if( ( m_Route[i].vecLocation - m_vecEnemyLKP ).Length() > 80.0f ) { // Refresh FRefreshRoute(); @@ -1357,7 +1361,7 @@ int CBaseMonster::CheckLocalMove( const Vector &vecStart, const Vector &vecEnd, { // The monster can move to a spot UNDER the target, but not to it. Don't try to triangulate, go directly to the node graph. // UNDONE: Magic # 64 -- this used to be pev->size.z but that won't work for small creatures like the headcrab - if( fabs( vecEnd.z - pev->origin.z ) > 64 ) + if( fabs( vecEnd.z - pev->origin.z ) > 64.0f ) { iReturn = LOCALMOVE_INVALID_DONT_TRIANGULATE; } @@ -1478,7 +1482,7 @@ void CBaseMonster::AdvanceRoute( float distance ) } else // At goal!!! { - if( distance < m_flGroundSpeed * 0.2 /* FIX */ ) + if( distance < m_flGroundSpeed * 0.2f /* FIX */ ) { MovementComplete(); } @@ -1612,13 +1616,13 @@ BOOL CBaseMonster::FTriangulate( const Vector &vecStart, const Vector &vecEnd, f // If the hull width is less than 24, use 24 because CheckLocalMove uses a min of // 24. sizeX = pev->size.x; - if( sizeX < 24.0 ) - sizeX = 24.0; - else if( sizeX > 48.0 ) - sizeX = 48.0; + if( sizeX < 24.0f ) + sizeX = 24.0f; + else if( sizeX > 48.0f ) + sizeX = 48.0f; sizeZ = pev->size.z; - //if( sizeZ < 24.0 ) - // sizeZ = 24.0; + //if( sizeZ < 24.0f ) + // sizeZ = 24.0f; vecForward = ( vecEnd - vecStart ).Normalize(); @@ -1856,7 +1860,7 @@ void CBaseMonster::Move( float flInterval ) DispatchBlocked( edict(), pBlocker->edict() ); } - if( pBlocker && m_moveWaitTime > 0 && pBlocker->IsMoving() && !pBlocker->IsPlayer() && ( gpGlobals->time-m_flMoveWaitFinished ) > 3.0 ) + if( pBlocker && m_moveWaitTime > 0 && pBlocker->IsMoving() && !pBlocker->IsPlayer() && ( gpGlobals->time-m_flMoveWaitFinished ) > 3.0f ) { // Can we still move toward our target? if( flDist < m_flGroundSpeed ) @@ -1891,10 +1895,10 @@ void CBaseMonster::Move( float flInterval ) else { // Don't get stuck - if( ( gpGlobals->time - m_flMoveWaitFinished ) < 0.2 ) + if( ( gpGlobals->time - m_flMoveWaitFinished ) < 0.2f ) Remember( bits_MEMORY_MOVE_FAILED ); - m_flMoveWaitFinished = gpGlobals->time + 0.1; + m_flMoveWaitFinished = gpGlobals->time + 0.1f; } } else @@ -1957,10 +1961,10 @@ void CBaseMonster::MoveExecute( CBaseEntity *pTargetEnt, const Vector &vecDir, f float flTotal = m_flGroundSpeed * pev->framerate * flInterval; float flStep; - while( flTotal > 0.001 ) + while( flTotal > 0.001f ) { // don't walk more than 16 units or stairs stop working - flStep = Q_min( 16.0, flTotal ); + flStep = Q_min( 16.0f, flTotal ); UTIL_MoveToOrigin( ENT( pev ), m_Route[m_iRouteIndex].vecLocation, flStep, MOVE_NORMAL ); flTotal -= flStep; } @@ -2008,14 +2012,14 @@ void CBaseMonster::MonsterInit( void ) m_hEnemy = NULL; - m_flDistTooFar = 1024.0; - m_flDistLook = 2048.0; + m_flDistTooFar = 1024.0f; + m_flDistLook = 2048.0f; // set eye position SetEyePosition(); SetThink( &CBaseMonster::MonsterInitThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; SetUse( &CBaseMonster::MonsterUse ); } @@ -2117,7 +2121,7 @@ void CBaseMonster::StartMonster( void ) // Delay drop to floor to make sure each door in the level has had its chance to spawn // Spread think times so that they don't all happen at the same time (Carmack) SetThink( &CBaseMonster::CallMonsterThink ); - pev->nextthink += RANDOM_FLOAT( 0.1, 0.4 ); // spread think times. + pev->nextthink += RANDOM_FLOAT( 0.1f, 0.4f ); // spread think times. // Vit_amiN: fixed -- now it doesn't touch any scripted_sequence target if( !FStringNull( pev->targetname ) && !m_pCine )// wait until triggered @@ -2214,12 +2218,12 @@ BOOL CBaseMonster::FindCover( Vector vecThreat, Vector vecViewOffset, float flMi flMaxDist = 784; } - if( flMinDist > 0.5 * flMaxDist ) + if( flMinDist > 0.5f * flMaxDist ) { #if _DEBUG ALERT( at_console, "FindCover MinDist (%.0f) too close to MaxDist (%.0f)\n", flMinDist, flMaxDist ); #endif - flMinDist = 0.5 * flMaxDist; + flMinDist = 0.5f * flMaxDist; } if( !WorldGraph.m_fGraphPresent || !WorldGraph.m_fGraphPointersSet ) @@ -2264,7 +2268,7 @@ BOOL CBaseMonster::FindCover( Vector vecThreat, Vector vecViewOffset, float flMi UTIL_TraceLine( node.m_vecOrigin + vecViewOffset, vecLookersOffset, ignore_monsters, ignore_glass, ENT( pev ), &tr ); // if this node will block the threat's line of sight to me... - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { // ..and is also closer to me than the threat, or the same distance from myself and the threat the node is good. if( ( iMyNode == iThreatNode ) || WorldGraph.PathLength( iMyNode, nodeNumber, iMyHullIndex, m_afCapability ) <= WorldGraph.PathLength( iThreatNode, nodeNumber, iMyHullIndex, m_afCapability ) ) @@ -2318,12 +2322,12 @@ BOOL CBaseMonster::BuildNearestRoute( Vector vecThreat, Vector vecViewOffset, fl flMaxDist = 784; } - if( flMinDist > 0.5 * flMaxDist ) + if( flMinDist > 0.5f * flMaxDist ) { #if _DEBUG ALERT( at_console, "FindCover MinDist (%.0f) too close to MaxDist (%.0f)\n", flMinDist, flMaxDist ); #endif - flMinDist = 0.5 * flMaxDist; + flMinDist = 0.5f * flMaxDist; } if( !WorldGraph.m_fGraphPresent || !WorldGraph.m_fGraphPointersSet ) @@ -2362,12 +2366,12 @@ BOOL CBaseMonster::BuildNearestRoute( Vector vecThreat, Vector vecViewOffset, fl // can I see where I want to be from there? UTIL_TraceLine( node.m_vecOrigin + pev->view_ofs, vecLookersOffset, ignore_monsters, edict(), &tr ); - if( tr.flFraction == 1.0 ) + if( tr.flFraction == 1.0f ) { // try to actually get there if( BuildRoute( node.m_vecOrigin, bits_MF_TO_LOCATION, NULL ) ) { - flMaxDist = flDist; + // flMaxDist = flDist; m_vecMoveGoal = node.m_vecOrigin; return TRUE; // UNDONE: keep looking for something closer! } @@ -2814,7 +2818,7 @@ int CBaseMonster::FindHintNode( void ) { UTIL_TraceLine( pev->origin + pev->view_ofs, node.m_vecOrigin + pev->view_ofs, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction == 1.0 ) + if( tr.flFraction == 1.0f ) { WorldGraph.m_iLastActiveIdleSearch = nodeNumber + 1; // next monster that searches for hint nodes will start where we left off. return nodeNumber;// take it! @@ -2872,7 +2876,7 @@ void CBaseMonster::ReportAIState( void ) { ALERT( level, " Moving " ); if( m_flMoveWaitFinished > gpGlobals->time ) - ALERT( level, ": Stopped for %.2f. ", m_flMoveWaitFinished - gpGlobals->time ); + ALERT( level, ": Stopped for %.2f. ", (double)(m_flMoveWaitFinished - gpGlobals->time) ); else if( m_IdealActivity == GetStoppedActivity() ) ALERT( level, ": In stopped anim. " ); } @@ -2897,7 +2901,7 @@ void CBaseMonster::ReportAIState( void ) } ALERT( level, "\n" ); - ALERT( level, "Yaw speed:%3.1f,Health: %3.1f\n", pev->yaw_speed, pev->health ); + ALERT( level, "Yaw speed:%3.1f,Health: %3.1f\n", (double)pev->yaw_speed, (double)pev->health ); if( pev->spawnflags & SF_MONSTER_PRISONER ) ALERT( level, " PRISONER! " ); if( pev->spawnflags & SF_MONSTER_PREDISASTER ) @@ -3095,7 +3099,7 @@ BOOL CBaseMonster::FindLateralCover( const Vector &vecThreat, const Vector &vecV // it's faster to check the SightEnt's visibility to the potential spot than to check the local move, so we do that first. UTIL_TraceLine( vecThreat + vecViewOffset, vecLeftTest + pev->view_ofs, ignore_monsters, ignore_glass, ENT( pev )/*pentIgnore*/, &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { if( FValidateCover( vecLeftTest ) && CheckLocalMove( pev->origin, vecLeftTest, NULL, NULL ) == LOCALMOVE_VALID ) { @@ -3109,7 +3113,7 @@ BOOL CBaseMonster::FindLateralCover( const Vector &vecThreat, const Vector &vecV // it's faster to check the SightEnt's visibility to the potential spot than to check the local move, so we do that first. UTIL_TraceLine( vecThreat + vecViewOffset, vecRightTest + pev->view_ofs, ignore_monsters, ignore_glass, ENT(pev)/*pentIgnore*/, &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { if( FValidateCover( vecRightTest ) && CheckLocalMove( pev->origin, vecRightTest, NULL, NULL ) == LOCALMOVE_VALID ) { @@ -3145,7 +3149,7 @@ Vector CBaseMonster::ShootAtEnemy( const Vector &shootOrigin ) //========================================================= BOOL CBaseMonster::FacingIdeal( void ) { - if( fabs( FlYawDiff() ) <= 0.006 )//!!!BUGBUG - no magic numbers!!! + if( fabs( FlYawDiff() ) <= 0.006f )//!!!BUGBUG - no magic numbers!!! { return TRUE; } @@ -3198,7 +3202,7 @@ void CBaseMonster::CorpseFallThink( void ) UTIL_SetOrigin( pev, pev->origin );// link into world. } else - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } // Call after animation/pose is set up @@ -3223,7 +3227,7 @@ void CBaseMonster::MonsterInitDead( void ) // Setup health counters, etc. BecomeDead(); SetThink( &CBaseMonster::CorpseFallThink ); - pev->nextthink = gpGlobals->time + 0.5; + pev->nextthink = gpGlobals->time + 0.5f; } //========================================================= @@ -3278,7 +3282,7 @@ BOOL CBaseMonster::BBoxFlat( void ) { return FALSE; } - flLength = flLength2; + // flLength = flLength2; return TRUE; } diff --git a/dlls/mp5.cpp b/dlls/mp5.cpp index 426f738a..fcfbd179 100644 --- a/dlls/mp5.cpp +++ b/dlls/mp5.cpp @@ -126,14 +126,14 @@ void CMP5::PrimaryAttack() if( m_pPlayer->pev->waterlevel == 3 ) { PlayEmptySound(); - m_flNextPrimaryAttack = 0.15; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.15f; return; } if( m_iClip <= 0 ) { PlayEmptySound(); - m_flNextPrimaryAttack = 0.15; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.15f; return; } @@ -151,9 +151,9 @@ void CMP5::PrimaryAttack() Vector vecAiming = m_pPlayer->GetAutoaimVector( AUTOAIM_5DEGREES ); Vector vecDir; #ifdef CLIENT_DLL - if( !bIsMultiplayer() ) + if( bIsMultiplayer() ) #else - if( !g_pGameRules->IsMultiplayer() ) + if( g_pGameRules->IsMultiplayer() ) #endif { // optimized multiplayer. Widened to make it easier to hit a moving player @@ -171,16 +171,16 @@ void CMP5::PrimaryAttack() #else flags = 0; #endif - PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usMP5, 0.0, g_vecZero, g_vecZero, vecDir.x, vecDir.y, 0, 0, 0, 0 ); + PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usMP5, 0.0f, g_vecZero, g_vecZero, vecDir.x, vecDir.y, 0, 0, 0, 0 ); if( !m_iClip && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 ) // HEV suit - indicate out of ammo condition m_pPlayer->SetSuitUpdate( "!HEV_AMO0", FALSE, 0 ); - m_flNextPrimaryAttack = GetNextAttackDelay( 0.1 ); + m_flNextPrimaryAttack = GetNextAttackDelay( 0.1f ); if( m_flNextPrimaryAttack < UTIL_WeaponTimeBase() ) - m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.1; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.1f; m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); } @@ -191,7 +191,7 @@ void CMP5::SecondaryAttack( void ) if( m_pPlayer->pev->waterlevel == 3 ) { PlayEmptySound( ); - m_flNextPrimaryAttack = 0.15; + m_flNextPrimaryAttack = 0.15f; return; } @@ -205,7 +205,7 @@ void CMP5::SecondaryAttack( void ) m_pPlayer->m_iWeaponFlash = BRIGHT_GUN_FLASH; m_pPlayer->m_iExtraSoundTypes = bits_SOUND_DANGER; - m_pPlayer->m_flStopExtraSoundTime = UTIL_WeaponTimeBase() + 0.2; + m_pPlayer->m_flStopExtraSoundTime = UTIL_WeaponTimeBase() + 0.2f; m_pPlayer->m_rgAmmo[m_iSecondaryAmmoType]--; @@ -216,8 +216,8 @@ void CMP5::SecondaryAttack( void ) // we don't add in player velocity anymore. CGrenade::ShootContact( m_pPlayer->pev, - m_pPlayer->pev->origin + m_pPlayer->pev->view_ofs + gpGlobals->v_forward * 16, - gpGlobals->v_forward * 800 ); + m_pPlayer->pev->origin + m_pPlayer->pev->view_ofs + gpGlobals->v_forward * 16.0f, + gpGlobals->v_forward * 800.0f ); int flags; #if defined( CLIENT_WEAPONS ) @@ -227,9 +227,9 @@ void CMP5::SecondaryAttack( void ) #endif PLAYBACK_EVENT( flags, m_pPlayer->edict(), m_usMP52 ); - m_flNextPrimaryAttack = GetNextAttackDelay( 1 ); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 5;// idle pretty soon after shooting. + m_flNextPrimaryAttack = GetNextAttackDelay( 1.0f ); + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0f; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 5.0f;// idle pretty soon after shooting. if( !m_pPlayer->m_rgAmmo[m_iSecondaryAmmoType] ) // HEV suit - indicate out of ammo condition @@ -241,7 +241,7 @@ void CMP5::Reload( void ) if( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 || m_iClip == MP5_MAX_CLIP ) return; - DefaultReload( MP5_MAX_CLIP, MP5_RELOAD, 1.5 ); + DefaultReload( MP5_MAX_CLIP, MP5_RELOAD, 1.5f ); } void CMP5::WeaponIdle( void ) diff --git a/dlls/multiplay_gamerules.cpp b/dlls/multiplay_gamerules.cpp index de91ac6e..90dc4f3b 100644 --- a/dlls/multiplay_gamerules.cpp +++ b/dlls/multiplay_gamerules.cpp @@ -319,6 +319,11 @@ BOOL CHalfLifeMultiplay::FShouldSwitchWeapon( CBasePlayer *pPlayer, CBasePlayerI return TRUE; } + if( !pPlayer->m_iAutoWepSwitch ) + { + return FALSE; + } + if( !pPlayer->m_pActiveItem->CanHolster() ) { // can't put away the active item. @@ -1331,7 +1336,8 @@ int ReloadMapCycleFile( const char *filename, mapcycle_t *cycle ) hasbuffer = 0; pFileList = COM_Parse( pFileList ); - if( strlen( com_token ) <= 0 ) + + if( com_token[0] == '\0' ) break; strcpy( szMap, com_token ); @@ -1340,7 +1346,8 @@ int ReloadMapCycleFile( const char *filename, mapcycle_t *cycle ) if( COM_TokenWaiting( pFileList ) ) { pFileList = COM_Parse( pFileList ); - if( strlen( com_token ) > 0 ) + + if( com_token[0] != '\0' ) { hasbuffer = 1; strcpy( szBuffer, com_token ); @@ -1496,7 +1503,8 @@ void ExtractCommandString( char *s, char *szCommand ) *o = 0; strcat( szCommand, pkey ); - if( strlen( value ) > 0 ) + + if( value[0] != '\0' ) { strcat( szCommand, " " ); strcat( szCommand, value ); @@ -1631,13 +1639,15 @@ void CHalfLifeMultiplay::ChangeLevel( void ) { ALERT( at_console, "PLAYER COUNT: min %i max %i current %i\n", minplayers, maxplayers, curplayers ); } - if( strlen( szRules ) > 0 ) + + if( szRules[0] != '\0' ) { ALERT( at_console, "RULES: %s\n", szRules ); } CHANGE_LEVEL( szNextMap, NULL ); - if( strlen( szCommands ) > 0 ) + + if( szCommands[0] != '\0' ) { SERVER_COMMAND( szCommands ); } diff --git a/dlls/nihilanth.cpp b/dlls/nihilanth.cpp index 1d072db4..29e1073e 100644 --- a/dlls/nihilanth.cpp +++ b/dlls/nihilanth.cpp @@ -298,7 +298,7 @@ void CNihilanth::Spawn( void ) InitBoneControllers(); SetThink( &CNihilanth::StartupThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; m_vecDesired = Vector( 1, 0, 0 ); m_posDesired = Vector( pev->origin.x, pev->origin.y, 512 ); @@ -391,13 +391,13 @@ void CNihilanth::DeathSound( void ) void CNihilanth::NullThink( void ) { StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.5; + pev->nextthink = gpGlobals->time + 0.5f; } void CNihilanth::StartupUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) { SetThink( &CNihilanth::HuntThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; SetUse( &CNihilanth::CommandUse ); } @@ -429,7 +429,7 @@ void CNihilanth::StartupThink( void ) SetThink( &CNihilanth::HuntThink ); SetUse( &CNihilanth::CommandUse ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } void CNihilanth::Killed( entvars_t *pevAttacker, int iGib ) @@ -439,7 +439,7 @@ void CNihilanth::Killed( entvars_t *pevAttacker, int iGib ) void CNihilanth::DyingThink( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; DispatchAnimEvents(); StudioFrameAdvance(); @@ -494,13 +494,13 @@ void CNihilanth::DyingThink( void ) do { vecDir = Vector( RANDOM_FLOAT( -1, 1 ), RANDOM_FLOAT( -1, 1 ), RANDOM_FLOAT( -1, 1 ) ); - } while( DotProduct( vecDir, vecDir ) > 1.0 ); + } while( DotProduct( vecDir, vecDir ) > 1.0f ); switch( RANDOM_LONG( 1, 4 ) ) { case 1: // head - vecDir.z = fabs( vecDir.z ) * 0.5; + vecDir.z = fabs( vecDir.z ) * 0.5f; vecDir = vecDir + 2 * gpGlobals->v_up; break; case 2: @@ -551,7 +551,7 @@ void CNihilanth::DyingThink( void ) GetAttachment( 0, vecSrc, vecAngles ); CNihilanthHVR *pEntity = (CNihilanthHVR *)Create( "nihilanth_energy_ball", vecSrc, pev->angles, edict() ); - pEntity->pev->velocity = Vector( RANDOM_FLOAT( -0.7, 0.7 ), RANDOM_FLOAT( -0.7, 0.7 ), 1.0 ) * 600.0; + pEntity->pev->velocity = Vector( RANDOM_FLOAT( -0.7f, 0.7f ), RANDOM_FLOAT( -0.7f, 0.7f ), 1.0f ) * 600.0f; pEntity->GreenBallInit(); return; @@ -619,7 +619,7 @@ void CNihilanth::ShootBalls( void ) vecDir = ( m_posTarget - pev->origin ).Normalize(); vecSrc = vecSrc + vecDir * ( gpGlobals->time - m_flShootTime ); pEntity = (CNihilanthHVR *)Create( "nihilanth_energy_ball", vecSrc, pev->angles, edict() ); - pEntity->pev->velocity = vecDir * 200.0; + pEntity->pev->velocity = vecDir * 200.0f; pEntity->ZapInit( m_hEnemy ); GetAttachment( 3, vecHand, vecAngle ); @@ -628,10 +628,10 @@ void CNihilanth::ShootBalls( void ) vecDir = ( m_posTarget - pev->origin ).Normalize(); vecSrc = vecSrc + vecDir * ( gpGlobals->time - m_flShootTime ); pEntity = (CNihilanthHVR *)Create( "nihilanth_energy_ball", vecSrc, pev->angles, edict() ); - pEntity->pev->velocity = vecDir * 200.0; + pEntity->pev->velocity = vecDir * 200.0f; pEntity->ZapInit( m_hEnemy ); } - m_flShootTime += 0.2; + m_flShootTime += 0.2f; } } } @@ -698,8 +698,8 @@ void CNihilanth::NextActivity() { m_pBall->SetTransparency( kRenderTransAdd, 255, 255, 255, 255, kRenderFxNoDissipation ); m_pBall->SetAttachment( edict(), 1 ); - m_pBall->SetScale( 4.0 ); - m_pBall->pev->framerate = 10.0; + m_pBall->SetScale( 4.0f ); + m_pBall->pev->framerate = 10.0f; m_pBall->TurnOn(); } } @@ -724,7 +724,7 @@ void CNihilanth::NextActivity() if( ( pev->health < gSkillData.nihilanthHealth / 2 || m_iActiveSpheres < N_SPHERES / 2 ) && m_hRecharger == 0 && m_iLevel <= 9 ) { - char szName[64]; + char szName[128]; CBaseEntity *pEnt = NULL; CBaseEntity *pRecharger = NULL; @@ -766,13 +766,13 @@ void CNihilanth::NextActivity() if( m_hRecharger != 0 ) { // at we at power up yet? - if( flDist < 128.0 ) + if( flDist < 128.0f ) { int iseq = LookupSequence( "recharge" ); if( iseq != pev->sequence ) { - char szText[64]; + char szText[128]; sprintf( szText, "%s%d", m_szDrawUse, m_iLevel ); FireTargets( szText, this, this, USE_ON, 1.0 ); @@ -808,7 +808,7 @@ void CNihilanth::NextActivity() { if( m_flLastSeen + 5 > gpGlobals->time && flDist < 256 && flDot > 0 ) { - if( m_irritation >= 2 && pev->health < gSkillData.nihilanthHealth / 2.0 ) + if( m_irritation >= 2 && pev->health < gSkillData.nihilanthHealth / 2.0f ) { pev->sequence = LookupSequence( "attack1_open" ); } @@ -820,7 +820,7 @@ void CNihilanth::NextActivity() } else { - char szText[64]; + char szText[128]; sprintf( szText, "%s%d", m_szTeleportTouch, m_iTeleport ); CBaseEntity *pTouch = UTIL_FindEntityByTargetname( NULL, szText ); @@ -848,7 +848,7 @@ void CNihilanth::NextActivity() void CNihilanth::HuntThink( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; DispatchAnimEvents(); StudioFrameAdvance(); @@ -877,7 +877,7 @@ void CNihilanth::HuntThink( void ) pev->frame = 0; NextActivity(); ResetSequenceInfo(); - pev->framerate = 2.0 - 1.0 * ( pev->health / gSkillData.nihilanthHealth ); + pev->framerate = 2.0f - 1.0f * ( pev->health / gSkillData.nihilanthHealth ); } // look for current enemy @@ -885,7 +885,7 @@ void CNihilanth::HuntThink( void ) { if( FVisible( m_hEnemy ) ) { - if( m_flLastSeen < gpGlobals->time - 5 ) + if( m_flLastSeen < gpGlobals->time - 5.0f ) m_flPrevSeen = gpGlobals->time; m_flLastSeen = gpGlobals->time; m_posTarget = m_hEnemy->pev->origin; @@ -933,7 +933,7 @@ void CNihilanth::Flight( void ) m_avelocity.y -= 6; // 9 * ( 3.0 / 2.0 ); } } - m_avelocity.y *= 0.98; + m_avelocity.y *= 0.98f; // estimate where I'll be in two seconds Vector vecEst = pev->origin + m_velocity * 2.0 + gpGlobals->v_up * m_flForce * 20; @@ -944,20 +944,20 @@ void CNihilanth::Flight( void ) m_velocity.y += gpGlobals->v_up.y * m_flForce; m_velocity.z += gpGlobals->v_up.z * m_flForce; - float flSpeed = m_velocity.Length(); + /*float flSpeed = m_velocity.Length(); float flDir = DotProduct( Vector( gpGlobals->v_forward.x, gpGlobals->v_forward.y, 0 ), Vector( m_velocity.x, m_velocity.y, 0 ) ); if( flDir < 0 ) - flSpeed = -flSpeed; + flSpeed = -flSpeed;*/ //float flDist = DotProduct( m_posDesired - vecEst, gpGlobals->v_forward ); // sideways drag - m_velocity.x = m_velocity.x * ( 1.0 - fabs( gpGlobals->v_right.x ) * 0.05 ); - m_velocity.y = m_velocity.y * ( 1.0 - fabs( gpGlobals->v_right.y ) * 0.05 ); - m_velocity.z = m_velocity.z * ( 1.0 - fabs( gpGlobals->v_right.z ) * 0.05 ); + m_velocity.x = m_velocity.x * ( 1.0f - fabs( gpGlobals->v_right.x ) * 0.05f ); + m_velocity.y = m_velocity.y * ( 1.0f - fabs( gpGlobals->v_right.y ) * 0.05f ); + m_velocity.z = m_velocity.z * ( 1.0f - fabs( gpGlobals->v_right.z ) * 0.05f ); // general drag - m_velocity = m_velocity * 0.995; + m_velocity = m_velocity * 0.995f; // apply power to stay correct height if( m_flForce < 100 && vecEst.z < m_posDesired.z ) @@ -970,8 +970,8 @@ void CNihilanth::Flight( void ) m_flForce -= 10; } - UTIL_SetOrigin( pev, pev->origin + m_velocity * 0.1 ); - pev->angles = pev->angles + m_avelocity * 0.1; + UTIL_SetOrigin( pev, pev->origin + m_velocity * 0.1f ); + pev->angles = pev->angles + m_avelocity * 0.1f; // ALERT( at_console, "%5.0f %5.0f : %4.0f : %3.0f : %2.0f\n", m_posDesired.z, pev->origin.z, m_velocity.z, m_avelocity.y, m_flForce ); } @@ -1093,14 +1093,14 @@ void CNihilanth::HandleAnimEvent( MonsterEvent_t *pEvent ) MESSAGE_END(); m_flShootTime = gpGlobals->time; - m_flShootEnd = gpGlobals->time + 1.0; + m_flShootEnd = gpGlobals->time + 1.0f; } break; case 3: // prayer if( m_hEnemy != 0 ) { - char szText[32]; + char szText[128]; sprintf( szText, "%s%d", m_szTeleportTouch, m_iTeleport ); CBaseEntity *pTouch = UTIL_FindEntityByTargetname( NULL, szText ); @@ -1155,7 +1155,7 @@ void CNihilanth::HandleAnimEvent( MonsterEvent_t *pEvent ) MESSAGE_END(); m_flShootTime = gpGlobals->time; - m_flShootEnd = gpGlobals->time + 1.0; + m_flShootEnd = gpGlobals->time + 1.0f; } } break; @@ -1192,7 +1192,7 @@ void CNihilanth::HandleAnimEvent( MonsterEvent_t *pEvent ) Vector vecSrc, vecAngles; GetAttachment( 0, vecSrc, vecAngles ); CNihilanthHVR *pEntity = (CNihilanthHVR *)Create( "nihilanth_energy_ball", vecSrc, pev->angles, edict() ); - pEntity->pev->velocity = Vector( RANDOM_FLOAT( -0.7, 0.7 ), RANDOM_FLOAT( -0.7, 0.7 ), 1.0 ) * 600.0; + pEntity->pev->velocity = Vector( RANDOM_FLOAT( -0.7f, 0.7f ), RANDOM_FLOAT( -0.7f, 0.7f ), 1.0f ) * 600.0f; pEntity->GreenBallInit(); */ break; @@ -1299,7 +1299,7 @@ void CNihilanthHVR::Spawn( void ) pev->rendermode = kRenderTransAdd; pev->renderamt = 255; - pev->scale = 3.0; + pev->scale = 3.0f; } void CNihilanthHVR::Precache( void ) @@ -1328,7 +1328,7 @@ void CNihilanthHVR::CircleInit( CBaseEntity *pTarget ) pev->rendercolor.x = 255; pev->rendercolor.y = 224; pev->rendercolor.z = 192; - pev->scale = 2.0; + pev->scale = 2.0f; m_nFrames = 1; pev->renderamt = 255; @@ -1337,7 +1337,7 @@ void CNihilanthHVR::CircleInit( CBaseEntity *pTarget ) SetThink( &CNihilanthHVR::HoverThink ); SetTouch( &CNihilanthHVR::BounceTouch ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; m_hTargetEnt = pTarget; } @@ -1359,7 +1359,7 @@ CBaseEntity *CNihilanthHVR::RandomClassname( const char *szName ) void CNihilanthHVR::HoverThink( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( m_hTargetEnt != 0 ) { @@ -1428,21 +1428,21 @@ void CNihilanthHVR::ZapInit( CBaseEntity *pEnemy ) pev->rendercolor.x = 255; pev->rendercolor.y = 255; pev->rendercolor.z = 255; - pev->scale = 2.0; + pev->scale = 2.0f; - pev->velocity = ( pEnemy->pev->origin - pev->origin ).Normalize() * 200; + pev->velocity = ( pEnemy->pev->origin - pev->origin ).Normalize() * 200.0f; m_hEnemy = pEnemy; SetThink( &CNihilanthHVR::ZapThink ); SetTouch( &CNihilanthHVR::ZapTouch ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; EMIT_SOUND_DYN( edict(), CHAN_WEAPON, "debris/zap4.wav", 1, ATTN_NORM, 0, 100 ); } void CNihilanthHVR::ZapThink( void ) { - pev->nextthink = gpGlobals->time + 0.05; + pev->nextthink = gpGlobals->time + 0.05f; // check world boundaries if( m_hEnemy == 0 || pev->origin.x < -4096 || pev->origin.x > 4096 || pev->origin.y < -4096 || pev->origin.y > 4096 || pev->origin.z < -4096 || pev->origin.z > 4096 ) @@ -1454,7 +1454,7 @@ void CNihilanthHVR::ZapThink( void ) if( pev->velocity.Length() < 2000 ) { - pev->velocity = pev->velocity * 1.2; + pev->velocity = pev->velocity * 1.2f; } // MovetoTarget( m_hEnemy->Center() ); @@ -1496,7 +1496,7 @@ void CNihilanthHVR::ZapThink( void ) SetTouch( NULL ); UTIL_Remove( this ); - pev->nextthink = gpGlobals->time + 0.2; + pev->nextthink = gpGlobals->time + 0.2f; return; } @@ -1535,7 +1535,7 @@ void CNihilanthHVR::ZapTouch( CBaseEntity *pOther ) SetTouch( NULL ); UTIL_Remove( this ); - pev->nextthink = gpGlobals->time + 0.2; + pev->nextthink = gpGlobals->time + 0.2f; } void CNihilanthHVR::TeleportInit( CNihilanth *pOwner, CBaseEntity *pEnemy, CBaseEntity *pTarget, CBaseEntity *pTouch ) @@ -1546,7 +1546,7 @@ void CNihilanthHVR::TeleportInit( CNihilanth *pOwner, CBaseEntity *pEnemy, CBase pev->rendercolor.x = 255; pev->rendercolor.y = 255; pev->rendercolor.z = 255; - pev->velocity.z *= 0.2; + pev->velocity.z *= 0.2f; SET_MODEL( edict(), "sprites/exit1.spr" ); @@ -1557,7 +1557,7 @@ void CNihilanthHVR::TeleportInit( CNihilanth *pOwner, CBaseEntity *pEnemy, CBase SetThink( &CNihilanthHVR::TeleportThink ); SetTouch( &CNihilanthHVR::TeleportTouch ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; EMIT_SOUND_DYN( edict(), CHAN_WEAPON, "x/x_teleattack1.wav", 1, 0.2, 0, 100 ); } @@ -1570,7 +1570,7 @@ void CNihilanthHVR::GreenBallInit() pev->rendercolor.x = 255; pev->rendercolor.y = 255; pev->rendercolor.z = 255; - pev->scale = 1.0; + pev->scale = 1.0f; SET_MODEL( edict(), "sprites/exit1.spr" ); @@ -1579,7 +1579,7 @@ void CNihilanthHVR::GreenBallInit() void CNihilanthHVR::TeleportThink( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; // check world boundaries if( m_hEnemy == 0 || !m_hEnemy->IsAlive() || pev->origin.x < -4096 || pev->origin.x > 4096 || pev->origin.y < -4096 || pev->origin.y > 4096 || pev->origin.z < -4096 || pev->origin.z > 4096 ) @@ -1669,13 +1669,13 @@ void CNihilanthHVR::TeleportTouch( CBaseEntity *pOther ) void CNihilanthHVR::DissipateThink( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; - if( pev->scale > 5.0 ) + if( pev->scale > 5.0f ) UTIL_Remove( this ); pev->renderamt -= 2; - pev->scale += 0.1; + pev->scale += 0.1f; if( m_hTargetEnt != 0 ) { @@ -1811,7 +1811,7 @@ void CNihilanthHVR::BounceTouch( CBaseEntity *pOther ) float n = -DotProduct( tr.vecPlaneNormal, vecDir ); - vecDir = 2.0 * tr.vecPlaneNormal * n + vecDir; + vecDir = 2.0f * tr.vecPlaneNormal * n + vecDir; m_vecIdeal = vecDir * m_vecIdeal.Length(); } diff --git a/dlls/nodes.cpp b/dlls/nodes.cpp index 6babe01d..c8e5649c 100644 --- a/dlls/nodes.cpp +++ b/dlls/nodes.cpp @@ -667,7 +667,7 @@ int CGraph::FindShortestPath( int *piPath, int iStart, int iDest, int iHull, int // for ( i = 0; i < m_cNodes; i++) { - m_pNodes[i].m_flClosestSoFar = -1.0; + m_pNodes[i].m_flClosestSoFar = -1.0f; } m_pNodes[iStart].m_flClosestSoFar = 0.0; @@ -709,8 +709,8 @@ int CGraph::FindShortestPath( int *piPath, int iStart, int iDest, int iHull, int } } float flOurDistance = flCurrentDistance + m_pLinkPool[m_pNodes[iCurrentNode].m_iFirstLink + i].m_flWeight; - if( m_pNodes[iVisitNode].m_flClosestSoFar < -0.5 - || flOurDistance < m_pNodes[iVisitNode].m_flClosestSoFar - 0.001 ) + if( m_pNodes[iVisitNode].m_flClosestSoFar < -0.5f + || flOurDistance < m_pNodes[iVisitNode].m_flClosestSoFar - 0.001f ) { m_pNodes[iVisitNode].m_flClosestSoFar = flOurDistance; m_pNodes[iVisitNode].m_iPreviousNode = iCurrentNode; @@ -719,7 +719,7 @@ int CGraph::FindShortestPath( int *piPath, int iStart, int iDest, int iHull, int } } } - if( m_pNodes[iDest].m_flClosestSoFar < -0.5 ) + if( m_pNodes[iDest].m_flClosestSoFar < -0.5f ) { // Destination is unreachable, no path found. return 0; @@ -837,7 +837,7 @@ void CGraph::CheckNode( Vector vecOrigin, int iNode ) // make sure that vecOrigin can trace to this node! UTIL_TraceLine( vecOrigin, m_pNodes[iNode].m_vecOriginPeek, ignore_monsters, 0, &tr ); - if( tr.flFraction == 1.0 ) + if( tr.flFraction == 1.0f ) { m_iNearest = iNode; m_flShortest = flDist; @@ -907,7 +907,7 @@ int CGraph::FindNearestNode( const Vector &vecOrigin, int afNodeTypes ) } m_iNearest = -1; - m_flShortest = 999999.0; // just a big number. + m_flShortest = 999999.0f; // just a big number. // If we can find a visible point, then let CalcBounds set the limits, but if // we have no visible point at all to start with, then don't restrict the limits. @@ -1276,7 +1276,7 @@ int CGraph::LinkVisibleNodes( CLink *pLinkPool, FILE *file, int *piBadNode ) if( tr.fStartSolid ) continue; - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { // trace hit a brush ent, trace backwards to make sure that this ent is the only thing in the way. pTraceEnt = tr.pHit;// store the ent that the trace hit, for comparison @@ -1442,14 +1442,14 @@ int CGraph::RejectInlineLinks( CLink *pLinkPool, FILE *file ) flDistToTestNode = vec2DirToTestNode.Length(); vec2DirToTestNode = vec2DirToTestNode.Normalize(); - if( DotProduct( vec2DirToCheckNode, vec2DirToTestNode ) >= 0.998 ) + if( DotProduct( vec2DirToCheckNode, vec2DirToTestNode ) >= 0.998f ) { // there's a chance that TestNode intersects the line to CheckNode. If so, we should disconnect the link to CheckNode. if( flDistToTestNode < flDistToCheckNode ) { if( file ) { - fprintf( file, "REJECTED NODE %3d through Node %3d, Dot = %8f\n", pLinkPool[pSrcNode->m_iFirstLink + j].m_iDestNode, pLinkPool[pSrcNode->m_iFirstLink + k].m_iDestNode, DotProduct( vec2DirToCheckNode, vec2DirToTestNode ) ); + fprintf( file, "REJECTED NODE %3d through Node %3d, Dot = %8f\n", pLinkPool[pSrcNode->m_iFirstLink + j].m_iDestNode, pLinkPool[pSrcNode->m_iFirstLink + k].m_iDestNode, (double)DotProduct( vec2DirToCheckNode, vec2DirToTestNode ) ); } pLinkPool[pSrcNode->m_iFirstLink + j] = pLinkPool[pSrcNode->m_iFirstLink + ( pSrcNode->m_cNumLinks - 1 )]; @@ -1516,7 +1516,7 @@ void CTestHull::Spawn( entvars_t *pevMasterNode ) else { SetThink( &CTestHull::DropDelay ); - pev->nextthink = gpGlobals->time + 1; + pev->nextthink = gpGlobals->time + 1.0f; } // Make this invisible @@ -1537,7 +1537,7 @@ void CTestHull::DropDelay( void ) SetThink( &CTestHull::CallBuildNodeGraph ); - pev->nextthink = gpGlobals->time + 1; + pev->nextthink = gpGlobals->time + 1.0f; } //========================================================= @@ -1623,7 +1623,7 @@ void CTestHull::ShowBadNode( void ) UTIL_ParticleEffect( pev->origin + gpGlobals->v_right * 64, g_vecZero, 255, 25 ); UTIL_ParticleEffect( pev->origin - gpGlobals->v_right * 64, g_vecZero, 255, 25 ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } extern BOOL gTouchDisabled; @@ -1737,7 +1737,7 @@ void CTestHull::BuildNodeGraph( void ) fprintf( file, "Location %4d,%4d,%4d\n",(int)WorldGraph.m_pNodes[i].m_vecOrigin.x, (int)WorldGraph.m_pNodes[i].m_vecOrigin.y, (int)WorldGraph.m_pNodes[i].m_vecOrigin.z ); fprintf( file, "HintType: %4d\n", WorldGraph.m_pNodes[i].m_sHintType ); fprintf( file, "HintActivity: %4d\n", WorldGraph.m_pNodes[i].m_sHintActivity ); - fprintf( file, "HintYaw: %4f\n", WorldGraph.m_pNodes[i].m_flHintYaw ); + fprintf( file, "HintYaw: %4f\n", (double)WorldGraph.m_pNodes[i].m_flHintYaw ); fprintf( file, "-------------------------------------------------------------------------------\n" ); } fprintf( file, "\n\n" ); @@ -1959,7 +1959,7 @@ void CTestHull::BuildNodeGraph( void ) TraceResult tr; UTIL_TraceHull( pSrcNode->m_vecOrigin + Vector( 0, 0, 32 ), pDestNode->m_vecOriginPeek + Vector( 0, 0, 32 ), ignore_monsters, large_hull, ENT( pev ), &tr ); - if( tr.fStartSolid || tr.flFraction < 1.0 ) + if( tr.fStartSolid || tr.flFraction < 1.0f ) { pTempPool[pSrcNode->m_iFirstLink + j].m_afLinkInfo &= ~bits_LINK_FLY_HULL; } @@ -2533,7 +2533,7 @@ int CGraph::FLoadGraph( const char *szMapName ) if( length < 0 ) goto ShortFile; memcpy( m_pHashLinks, pMemFile, sizeof(short) * m_nHashLinks ); - pMemFile += sizeof(short) * m_nHashLinks; + // pMemFile += sizeof(short) * m_nHashLinks; // Set the graph present flag, clear the pointers set flag // @@ -3517,7 +3517,7 @@ void CGraph::TestRoutingTables( void ) ALERT( at_aiconsole, "No link.\n" ); } } - if( fabs( flDistance1 - flDistance2 ) > 0.10 ) + if( fabs( flDistance1 - flDistance2 ) > 0.1f ) { #else if( cPathSize1 != cPathSize2 || memcmp( pMyPath, pMyPath2, sizeof(int) * cPathSize1 ) != 0 ) @@ -3641,7 +3641,7 @@ void CNodeViewer::Spawn() int start = 0; int end; do{ - end = m_nVisited; + // end = m_nVisited; // ALERT( at_console, "%d :", m_nVisited ); for( end = m_nVisited; start < end; start++ ) { diff --git a/dlls/observer.cpp b/dlls/observer.cpp index 22fa3818..79e1c9c1 100644 --- a/dlls/observer.cpp +++ b/dlls/observer.cpp @@ -103,7 +103,7 @@ void CBasePlayer::Observer_HandleButtons() else Observer_SetMode( OBS_CHASE_FREE ); // don't use OBS_CHASE_LOCKED anymore - m_flNextObserverInput = gpGlobals->time + 0.2; + m_flNextObserverInput = gpGlobals->time + 0.2f; } // Attack moves to the next player @@ -111,7 +111,7 @@ void CBasePlayer::Observer_HandleButtons() { Observer_FindNextPlayer( false ); - m_flNextObserverInput = gpGlobals->time + 0.2; + m_flNextObserverInput = gpGlobals->time + 0.2f; } // Attack2 moves to the prev player @@ -119,7 +119,7 @@ void CBasePlayer::Observer_HandleButtons() { Observer_FindNextPlayer( true ); - m_flNextObserverInput = gpGlobals->time + 0.2; + m_flNextObserverInput = gpGlobals->time + 0.2f; } } diff --git a/dlls/osprey.cpp b/dlls/osprey.cpp index 6a421645..670ad3b7 100644 --- a/dlls/osprey.cpp +++ b/dlls/osprey.cpp @@ -170,7 +170,7 @@ void COsprey::Spawn( void ) if( !( pev->spawnflags & SF_WAITFORTRIGGER ) ) { - pev->nextthink = gpGlobals->time + 1.0; + pev->nextthink = gpGlobals->time + 1.0f; } m_pos2 = pev->origin; @@ -198,7 +198,7 @@ void COsprey::Precache( void ) void COsprey::CommandUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } void COsprey::FindAllThink( void ) @@ -223,7 +223,7 @@ void COsprey::FindAllThink( void ) return; } SetThink( &COsprey::FlyThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; m_startTime = gpGlobals->time; } @@ -238,8 +238,8 @@ void COsprey::DeployThink( void ) Vector vecSrc; TraceResult tr; - UTIL_TraceLine( pev->origin, pev->origin + Vector( 0, 0, -4096.0 ), ignore_monsters, ENT( pev ), &tr ); - CSoundEnt::InsertSound( bits_SOUND_DANGER, tr.vecEndPos, 400, 0.3 ); + UTIL_TraceLine( pev->origin, pev->origin + Vector( 0.0f, 0.0f, -4096.0f ), ignore_monsters, ENT( pev ), &tr ); + CSoundEnt::InsertSound( bits_SOUND_DANGER, tr.vecEndPos, 400, 0.3f ); vecSrc = pev->origin + vecForward * 32 + vecRight * 100 + vecUp * -96; m_hRepel[0] = MakeGrunt( vecSrc ); @@ -254,7 +254,7 @@ void COsprey::DeployThink( void ) m_hRepel[3] = MakeGrunt( vecSrc ); SetThink( &COsprey::HoverThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } BOOL COsprey::HasDead() @@ -279,7 +279,7 @@ CBaseMonster *COsprey::MakeGrunt( Vector vecSrc ) CBaseMonster *pGrunt; TraceResult tr; - UTIL_TraceLine( vecSrc, vecSrc + Vector( 0, 0, -4096.0 ), dont_ignore_monsters, ENT( pev ), &tr ); + UTIL_TraceLine( vecSrc, vecSrc + Vector( 0.0f, 0.0f, -4096.0f ), dont_ignore_monsters, ENT( pev ), &tr ); if( tr.pHit && Instance( tr.pHit )->pev->solid != SOLID_BSP ) return NULL; @@ -302,7 +302,7 @@ CBaseMonster *COsprey::MakeGrunt( Vector vecSrc ) pBeam->SetFlags( BEAM_FSOLID ); pBeam->SetColor( 255, 255, 255 ); pBeam->SetThink( &CBaseEntity::SUB_Remove ); - pBeam->pev->nextthink = gpGlobals->time + -4096.0 * tr.flFraction / pGrunt->pev->velocity.z + 0.5; + pBeam->pev->nextthink = gpGlobals->time + -4096.0f * tr.flFraction / pGrunt->pev->velocity.z + 0.5f; // ALERT( at_console, "%d at %.0f %.0f %.0f\n", i, m_vecOrigin[i].x, m_vecOrigin[i].y, m_vecOrigin[i].z ); pGrunt->m_vecLastPosition = m_vecOrigin[i]; @@ -331,7 +331,7 @@ void COsprey::HoverThink( void ) SetThink( &COsprey::FlyThink ); } - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; UTIL_MakeAimVectors( pev->angles ); ShowDamage(); } @@ -349,7 +349,7 @@ void COsprey::UpdateGoal() m_vel2 = gpGlobals->v_forward * m_pGoalEnt->pev->speed; m_startTime = m_startTime + m_dTime; - m_dTime = 2.0 * ( m_pos1 - m_pos2 ).Length() / ( m_vel1.Length() + m_pGoalEnt->pev->speed ); + m_dTime = 2.0f * ( m_pos1 - m_pos2 ).Length() / ( m_vel1.Length() + m_pGoalEnt->pev->speed ); if( m_ang1.y - m_ang2.y < -180 ) { @@ -374,7 +374,7 @@ void COsprey::UpdateGoal() void COsprey::FlyThink( void ) { StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( m_pGoalEnt == NULL && !FStringNull( pev->target) )// this monster has a target { @@ -384,13 +384,18 @@ void COsprey::FlyThink( void ) if( gpGlobals->time > m_startTime + m_dTime ) { - if( m_pGoalEnt->pev->speed == 0 ) + if( m_pGoalEnt ) { - SetThink( &COsprey::DeployThink ); + if( m_pGoalEnt->pev->speed == 0 ) + { + SetThink( &COsprey::DeployThink ); + } + + do{ + m_pGoalEnt = CBaseEntity::Instance( FIND_ENTITY_BY_TARGETNAME( NULL, STRING( m_pGoalEnt->pev->target ) ) ); + } while( m_pGoalEnt && m_pGoalEnt->pev->speed < 400 && !HasDead() ); } - do{ - m_pGoalEnt = CBaseEntity::Instance( FIND_ENTITY_BY_TARGETNAME( NULL, STRING( m_pGoalEnt->pev->target ) ) ); - } while( m_pGoalEnt->pev->speed < 400 && !HasDead() ); + UpdateGoal(); } @@ -401,13 +406,13 @@ void COsprey::FlyThink( void ) void COsprey::Flight() { float t = ( gpGlobals->time - m_startTime ); - float scale = 1.0 / m_dTime; + float scale = 1.0f / m_dTime; - float f = UTIL_SplineFraction( t * scale, 1.0 ); + float f = UTIL_SplineFraction( t * scale, 1.0f ); - Vector pos = ( m_pos1 + m_vel1 * t ) * ( 1.0 - f ) + ( m_pos2 - m_vel2 * ( m_dTime - t ) ) * f; - Vector ang = ( m_ang1 ) * ( 1.0 - f ) + ( m_ang2 ) * f; - m_velocity = m_vel1 * ( 1.0 - f ) + m_vel2 * f; + Vector pos = ( m_pos1 + m_vel1 * t ) * ( 1.0f - f ) + ( m_pos2 - m_vel2 * ( m_dTime - t ) ) * f; + Vector ang = ( m_ang1 ) * ( 1.0f - f ) + ( m_ang2 ) * f; + m_velocity = m_vel1 * ( 1.0f - f ) + m_vel2 * f; UTIL_SetOrigin( pev, pos ); pev->angles = ang; @@ -416,18 +421,18 @@ void COsprey::Flight() // float flSpeed = DotProduct( gpGlobals->v_forward, pev->velocity ); - float m_flIdealtilt = ( 160 - flSpeed ) / 10.0; + float m_flIdealtilt = ( 160.0f - flSpeed ) / 10.0f; // ALERT( at_console, "%f %f\n", flSpeed, flIdealtilt ); if( m_flRotortilt < m_flIdealtilt ) { - m_flRotortilt += 0.5; + m_flRotortilt += 0.5f; if ( m_flRotortilt > 0 ) m_flRotortilt = 0; } if( m_flRotortilt > m_flIdealtilt ) { - m_flRotortilt -= 0.5; + m_flRotortilt -= 0.5f; if( m_flRotortilt < -90 ) m_flRotortilt = -90; } @@ -450,7 +455,7 @@ void COsprey::Flight() { float pitch = DotProduct( m_velocity - pPlayer->pev->velocity, ( pPlayer->pev->origin - pev->origin ).Normalize() ); - pitch = (int)( 100 + pitch / 75.0 ); + pitch = (int)( 100 + pitch / 75.0f ); if( pitch > 250 ) pitch = 250; @@ -474,7 +479,7 @@ void COsprey::Flight() void COsprey::HitTouch( CBaseEntity *pOther ) { - pev->nextthink = gpGlobals->time + 2.0; + pev->nextthink = gpGlobals->time + 2.0f; } /* @@ -496,7 +501,7 @@ int COsprey::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float void COsprey::Killed( entvars_t *pevAttacker, int iGib ) { pev->movetype = MOVETYPE_TOSS; - pev->gravity = 0.3; + pev->gravity = 0.3f; pev->velocity = m_velocity; pev->avelocity = Vector( RANDOM_FLOAT( -20, 20 ), 0, RANDOM_FLOAT( -50, 50 ) ); STOP_SOUND( ENT( pev ), CHAN_STATIC, "apache/ap_rotor4.wav" ); @@ -504,11 +509,11 @@ void COsprey::Killed( entvars_t *pevAttacker, int iGib ) UTIL_SetSize( pev, Vector( -32, -32, -64 ), Vector( 32, 32, 0 ) ); SetThink( &COsprey::DyingThink ); SetTouch( &COsprey::CrashTouch ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; pev->health = 0; pev->takedamage = DAMAGE_NO; - m_startTime = gpGlobals->time + 4.0; + m_startTime = gpGlobals->time + 4.0f; } void COsprey::CrashTouch( CBaseEntity *pOther ) @@ -526,9 +531,9 @@ void COsprey::CrashTouch( CBaseEntity *pOther ) void COsprey::DyingThink( void ) { StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; - pev->avelocity = pev->avelocity * 1.02; + pev->avelocity = pev->avelocity * 1.02f; // still falling? if( m_startTime > gpGlobals->time ) @@ -536,14 +541,14 @@ void COsprey::DyingThink( void ) UTIL_MakeAimVectors( pev->angles ); ShowDamage(); - Vector vecSpot = pev->origin + pev->velocity * 0.2; + Vector vecSpot = pev->origin + pev->velocity * 0.2f; // random explosions MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, vecSpot ); WRITE_BYTE( TE_EXPLOSION ); // This just makes a dynamic light now - WRITE_COORD( vecSpot.x + RANDOM_FLOAT( -150, 150 ) ); - WRITE_COORD( vecSpot.y + RANDOM_FLOAT( -150, 150 ) ); - WRITE_COORD( vecSpot.z + RANDOM_FLOAT( -150, -50 ) ); + WRITE_COORD( vecSpot.x + RANDOM_FLOAT( -150.0f, 150.0f ) ); + WRITE_COORD( vecSpot.y + RANDOM_FLOAT( -150.0f, 150.0f ) ); + WRITE_COORD( vecSpot.z + RANDOM_FLOAT( -150.0f, -50.0f ) ); WRITE_SHORT( g_sModelIndexFireball ); WRITE_BYTE( RANDOM_LONG( 0, 29 ) + 30 ); // scale * 10 WRITE_BYTE( 12 ); // framerate @@ -553,15 +558,15 @@ void COsprey::DyingThink( void ) // lots of smoke MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, vecSpot ); WRITE_BYTE( TE_SMOKE ); - WRITE_COORD( vecSpot.x + RANDOM_FLOAT( -150, 150 ) ); - WRITE_COORD( vecSpot.y + RANDOM_FLOAT( -150, 150 ) ); - WRITE_COORD( vecSpot.z + RANDOM_FLOAT( -150, -50 ) ); + WRITE_COORD( vecSpot.x + RANDOM_FLOAT( -150.0f, 150.0f ) ); + WRITE_COORD( vecSpot.y + RANDOM_FLOAT( -150.0f, 150.0f ) ); + WRITE_COORD( vecSpot.z + RANDOM_FLOAT( -150.0f, -50.0f ) ); WRITE_SHORT( g_sModelIndexSmoke ); WRITE_BYTE( 100 ); // scale * 10 WRITE_BYTE( 10 ); // framerate MESSAGE_END(); - vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5; + vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5f; MESSAGE_BEGIN( MSG_PVS, SVC_TEMPENTITY, vecSpot ); WRITE_BYTE( TE_BREAKMODEL); @@ -598,12 +603,12 @@ void COsprey::DyingThink( void ) // don't stop it we touch a entity pev->flags &= ~FL_ONGROUND; - pev->nextthink = gpGlobals->time + 0.2; + pev->nextthink = gpGlobals->time + 0.2f; return; } else { - Vector vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5; + Vector vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5f; /* MESSAGE_BEGIN( MSG_BROADCAST, SVC_TEMPENTITY ); @@ -662,12 +667,12 @@ void COsprey::DyingThink( void ) WRITE_BYTE( 0 ); // speed MESSAGE_END(); - EMIT_SOUND( ENT( pev ), CHAN_STATIC, "weapons/mortarhit.wav", 1.0, 0.3 ); + EMIT_SOUND( ENT( pev ), CHAN_STATIC, "weapons/mortarhit.wav", 1.0, 0.3f ); RadiusDamage( pev->origin, pev, pev, 300, CLASS_NONE, DMG_BLAST ); // gibs - vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5; + vecSpot = pev->origin + ( pev->mins + pev->maxs ) * 0.5f; MESSAGE_BEGIN( MSG_PAS, SVC_TEMPENTITY, vecSpot ); WRITE_BYTE( TE_BREAKMODEL); @@ -684,7 +689,7 @@ void COsprey::DyingThink( void ) // velocity WRITE_COORD( m_velocity.x ); WRITE_COORD( m_velocity.y ); - WRITE_COORD( fabs( m_velocity.z ) * 0.25 ); + WRITE_COORD( fabs( m_velocity.z ) * 0.25f ); // randomization WRITE_BYTE( 40 ); @@ -751,7 +756,7 @@ void COsprey::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir return; else m_flRightHealth -= flDamage; - m_iDoLeftSmokePuff = 3 + ( flDamage / 5.0 ); + m_iDoLeftSmokePuff = 3 + ( flDamage / 5.0f ); } if( ptr->iHitgroup == 2 ) @@ -760,7 +765,7 @@ void COsprey::TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir return; else m_flLeftHealth -= flDamage; - m_iDoRightSmokePuff = 3 + ( flDamage / 5.0 ); + m_iDoRightSmokePuff = 3 + ( flDamage / 5.0f ); } // hit hard, hits cockpit, hits engines diff --git a/dlls/plats.cpp b/dlls/plats.cpp index 5a96a36b..0f2dbe70 100644 --- a/dlls/plats.cpp +++ b/dlls/plats.cpp @@ -358,8 +358,7 @@ void CPlatTrigger::SpawnInsideTrigger( CFuncPlat *pPlatform ) void CPlatTrigger::Touch( CBaseEntity *pOther ) { // Ignore touches by non-players - entvars_t *pevToucher = pOther->pev; - if( !FClassnameIs( pevToucher, "player" ) ) + if( !pOther->IsPlayer() ) return; CFuncPlat *pPlatform = (CFuncPlat*)(CBaseEntity*)m_hPlatform; @@ -586,7 +585,7 @@ void CFuncPlatRot::RotMove( Vector &destAngle, float time ) Vector vecDestDelta = destAngle - pev->angles; // Travel time is so short, we're practically there already; so make it so. - if( time >= 0.1 ) + if( time >= 0.1f ) pev->avelocity = vecDestDelta / time; else { @@ -648,7 +647,7 @@ void CFuncTrain::Blocked( CBaseEntity *pOther ) if( gpGlobals->time < m_flActivateFinished ) return; - m_flActivateFinished = gpGlobals->time + 0.5; + m_flActivateFinished = gpGlobals->time + 0.5f; pOther->TakeDamage( pev, pev, pev->dmg, DMG_CRUSH ); } @@ -745,7 +744,7 @@ void CFuncTrain::Next( void ) { // don't copy speed from target if it is 0 (uninitialized) pev->speed = m_pevCurrentTarget->speed; - ALERT( at_aiconsole, "Train %s speed to %4.2f\n", STRING( pev->targetname ), pev->speed ); + ALERT( at_aiconsole, "Train %s speed to %4.2f\n", STRING( pev->targetname ), (double)pev->speed ); } m_pevCurrentTarget = pTarg->pev;// keep track of this since path corners change our target for us. @@ -755,7 +754,7 @@ void CFuncTrain::Next( void ) { // Path corner has indicated a teleport to the next corner. SetBits( pev->effects, EF_NOINTERP ); - UTIL_SetOrigin( pev, pTarg->pev->origin - ( pev->mins + pev->maxs ) * 0.5 ); + UTIL_SetOrigin( pev, pTarg->pev->origin - ( pev->mins + pev->maxs ) * 0.5f ); Wait(); // Get on with doing the next path corner. } else @@ -773,7 +772,7 @@ void CFuncTrain::Next( void ) ClearBits( pev->effects, EF_NOINTERP ); SetMoveDone( &CFuncTrain::Wait ); - LinearMove( pTarg->pev->origin - ( pev->mins + pev->maxs )* 0.5, pev->speed ); + LinearMove( pTarg->pev->origin - ( pev->mins + pev->maxs ) * 0.5f, pev->speed ); } } @@ -792,7 +791,7 @@ void CFuncTrain::Activate( void ) if( FStringNull( pev->targetname ) ) { // not triggered, so start immediately - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; SetThink( &CFuncTrain::Next ); } else @@ -836,7 +835,7 @@ void CFuncTrain::Spawn( void ) m_activated = FALSE; if( m_volume == 0 ) - m_volume = 0.85; + m_volume = 0.85f; } void CFuncTrain::Precache( void ) @@ -884,7 +883,7 @@ void CFuncTrain::OverrideReset( void ) else // Keep moving for 0.1 secs, then find path_corner again and restart { SetThink( &CFuncTrain::Next ); - pev->nextthink = pev->ltime + 0.1; + pev->nextthink = pev->ltime + 0.1f; } } } @@ -939,7 +938,7 @@ void CFuncTrackTrain::KeyValue( KeyValueData *pkvd ) else if( FStrEq( pkvd->szKeyName, "volume" ) ) { m_flVolume = (float)atoi( pkvd->szValue ); - m_flVolume *= 0.1; + m_flVolume *= 0.1f; pkvd->fHandled = TRUE; } else if( FStrEq( pkvd->szKeyName, "bank" ) ) @@ -978,7 +977,7 @@ void CFuncTrackTrain::Blocked( CBaseEntity *pOther ) else pevOther->velocity = ( pevOther->origin - pev->origin ).Normalize() * pev->dmg; - ALERT( at_aiconsole, "TRAIN(%s): Blocked by %s (dmg:%.2f)\n", STRING( pev->targetname ), STRING( pOther->pev->classname ), pev->dmg ); + ALERT( at_aiconsole, "TRAIN(%s): Blocked by %s (dmg:%.2f)\n", STRING( pev->targetname ), STRING( pOther->pev->classname ), (double)pev->dmg ); if( pev->dmg <= 0 ) return; // we can't hurt this thing, so we're not concerned with it @@ -1011,7 +1010,7 @@ void CFuncTrackTrain::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TY { float delta = value; - delta = ( (int)( pev->speed * 4 ) / (int)m_speed )*0.25 + 0.25 * delta; + delta = ( (int)( pev->speed * 4 ) / (int)m_speed ) * 0.25f + 0.25f * delta; if( delta > 1 ) delta = 1; else if ( delta < -1 ) @@ -1023,7 +1022,7 @@ void CFuncTrackTrain::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TY } pev->speed = m_speed * delta; Next(); - ALERT( at_aiconsole, "TRAIN(%s), speed to %.2f\n", STRING( pev->targetname ), pev->speed ); + ALERT( at_aiconsole, "TRAIN(%s), speed to %.2f\n", STRING( pev->targetname ), (double)pev->speed ); } } @@ -1101,13 +1100,13 @@ void CFuncTrackTrain::UpdateSound( void ) unsigned short us_encode; unsigned short us_sound = ( ( unsigned short )( m_sounds ) & 0x0007 ) << 12; - unsigned short us_pitch = ( ( unsigned short )( flpitch / 10.0 ) & 0x003f ) << 6; - unsigned short us_volume = ( ( unsigned short )( m_flVolume * 40.0 ) & 0x003f ); + unsigned short us_pitch = ( ( unsigned short )( flpitch / 10.0f ) & 0x003f ) << 6; + unsigned short us_volume = ( ( unsigned short )( m_flVolume * 40.0f ) & 0x003f ); us_encode = us_sound | us_pitch | us_volume; - PLAYBACK_EVENT_FULL( FEV_RELIABLE | FEV_UPDATE, edict(), m_usAdjustPitch, 0.0, - g_vecZero, g_vecZero, 0.0, 0.0, us_encode, 0, 0, 0 ); + PLAYBACK_EVENT_FULL( FEV_RELIABLE | FEV_UPDATE, edict(), m_usAdjustPitch, 0.0f, + g_vecZero, g_vecZero, 0.0f, 0.0f, us_encode, 0, 0, 0 ); } } @@ -1136,7 +1135,7 @@ void CFuncTrackTrain::Next( void ) Vector nextPos = pev->origin; nextPos.z -= m_height; - CPathTrack *pnext = m_ppath->LookAhead( &nextPos, pev->speed * 0.1, 1 ); + CPathTrack *pnext = m_ppath->LookAhead( &nextPos, pev->speed * 0.1f, 1 ); nextPos.z += m_height; pev->velocity = ( nextPos - pev->origin ) * 10; @@ -1210,7 +1209,7 @@ void CFuncTrackTrain::Next( void ) { // don't copy speed from target if it is 0 (uninitialized) pev->speed = pFire->pev->speed; - ALERT( at_aiconsole, "TrackTrain %s speed to %4.2f\n", STRING( pev->targetname ), pev->speed ); + ALERT( at_aiconsole, "TrackTrain %s speed to %4.2f\n", STRING( pev->targetname ), (double)pev->speed ); } } @@ -1349,7 +1348,7 @@ void CFuncTrackTrain::Find( void ) if( pev->spawnflags & SF_TRACKTRAIN_NOPITCH ) pev->angles.x = 0; UTIL_SetOrigin( pev, nextPos ); - NextThink( pev->ltime + 0.1, FALSE ); + NextThink( pev->ltime + 0.1f, FALSE ); SetThink( &CFuncTrackTrain::Next ); pev->speed = m_startSpeed; @@ -1398,14 +1397,14 @@ void CFuncTrackTrain::NearestPath( void ) if( pev->speed != 0 ) { - NextThink( pev->ltime + 0.1, FALSE ); + NextThink( pev->ltime + 0.1f, FALSE ); SetThink( &CFuncTrackTrain::Next ); } } void CFuncTrackTrain::OverrideReset( void ) { - NextThink( pev->ltime + 0.1, FALSE ); + NextThink( pev->ltime + 0.1f, FALSE ); SetThink( &CFuncTrackTrain::NearestPath ); } @@ -1464,7 +1463,7 @@ void CFuncTrackTrain::Spawn( void ) // start trains on the next frame, to make sure their targets have had // a chance to spawn/activate - NextThink( pev->ltime + 0.1, FALSE ); + NextThink( pev->ltime + 0.1f, FALSE ); SetThink( &CFuncTrackTrain::Find ); Precache(); } @@ -1473,8 +1472,8 @@ void CFuncTrackTrain::Precache( void ) { const char *pszSound; - if( m_flVolume == 0.0 ) - m_flVolume = 1.0; + if( m_flVolume == 0.0f ) + m_flVolume = 1.0f; switch( m_sounds ) { @@ -1668,7 +1667,7 @@ void CFuncTrackChange::Spawn( void ) } EnableUse(); - pev->nextthink = pev->ltime + 2.0; + pev->nextthink = pev->ltime + 2.0f; SetThink( &CFuncTrackChange::Find ); Precache(); } @@ -1715,7 +1714,7 @@ void CFuncTrackChange::KeyValue( KeyValueData *pkvd ) void CFuncTrackChange::OverrideReset( void ) { - pev->nextthink = pev->ltime + 1.0; + pev->nextthink = pev->ltime + 1.0f; SetThink( &CFuncTrackChange::Find ); } @@ -1741,7 +1740,7 @@ void CFuncTrackChange::Find( void ) ALERT( at_error, "Can't find train for track change! %s\n", STRING( m_trainName ) ); return; } - Vector center = ( pev->absmin + pev->absmax ) * 0.5; + Vector center = ( pev->absmin + pev->absmax ) * 0.5f; m_trackBottom = m_trackBottom->Nearest( center ); m_trackTop = m_trackTop->Nearest( center ); UpdateAutoTargets( m_toggle_state ); @@ -1751,7 +1750,7 @@ void CFuncTrackChange::Find( void ) else { ALERT( at_error, "Can't find train for track change! %s\n", STRING( m_trainName ) ); - target = FIND_ENTITY_BY_TARGETNAME( NULL, STRING( m_trainName ) ); + // target = FIND_ENTITY_BY_TARGETNAME( NULL, STRING( m_trainName ) ); } } else @@ -1808,7 +1807,7 @@ void CFuncTrackChange::UpdateTrain( Vector &dest ) local.z = DotProduct( offset, gpGlobals->v_up ); local = local - offset; - m_train->pev->velocity = pev->velocity + ( local * ( 1.0 / time ) ); + m_train->pev->velocity = pev->velocity + ( local * ( 1.0f / time ) ); } void CFuncTrackChange::GoDown( void ) @@ -2109,7 +2108,7 @@ void CGunTarget::Spawn( void ) if( pev->spawnflags & FGUNTARGET_START_ON ) { SetThink( &CGunTarget::Start ); - pev->nextthink = pev->ltime + 0.3; + pev->nextthink = pev->ltime + 0.3f; } } @@ -2122,7 +2121,7 @@ void CGunTarget::Activate( void ) if( pTarg ) { m_hTargetEnt = pTarg; - UTIL_SetOrigin( pev, pTarg->pev->origin - ( pev->mins + pev->maxs ) * 0.5 ); + UTIL_SetOrigin( pev, pTarg->pev->origin - ( pev->mins + pev->maxs ) * 0.5f ); } } @@ -2144,7 +2143,7 @@ void CGunTarget::Next( void ) return; } SetMoveDone( &CGunTarget::Wait ); - LinearMove( pTarget->pev->origin - ( pev->mins + pev->maxs ) * 0.5, pev->speed ); + LinearMove( pTarget->pev->origin - ( pev->mins + pev->maxs ) * 0.5f, pev->speed ); } void CGunTarget::Wait( void ) diff --git a/dlls/player.cpp b/dlls/player.cpp index 926bf1e1..6b741778 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -66,8 +66,8 @@ extern CGraph WorldGraph; #define TRAIN_FAST 0x04 #define TRAIN_BACK 0x05 -#define FLASH_DRAIN_TIME 1.2 //100 units/3 minutes -#define FLASH_CHARGE_TIME 0.2 // 100 units/20 seconds (seconds per unit) +#define FLASH_DRAIN_TIME 1.2f //100 units/3 minutes +#define FLASH_CHARGE_TIME 0.2f // 100 units/20 seconds (seconds per unit) // Global Savedata for player TYPEDESCRIPTION CBasePlayer::m_playerSaveData[] = @@ -242,11 +242,11 @@ void CBasePlayer::Pain( void ) { float flRndSound;//sound randomizer - flRndSound = RANDOM_FLOAT( 0, 1 ); + flRndSound = RANDOM_FLOAT( 0.0f, 1.0f ); - if( flRndSound <= 0.33 ) + if( flRndSound <= 0.33f ) EMIT_SOUND( ENT( pev ), CHAN_VOICE, "player/pl_pain5.wav", 1, ATTN_NORM ); - else if( flRndSound <= 0.66 ) + else if( flRndSound <= 0.66f ) EMIT_SOUND( ENT( pev ), CHAN_VOICE, "player/pl_pain6.wav", 1, ATTN_NORM ); else EMIT_SOUND( ENT( pev ), CHAN_VOICE, "player/pl_pain7.wav", 1, ATTN_NORM ); @@ -257,7 +257,7 @@ Vector VecVelocityForDamage( float flDamage ) Vector vec( RANDOM_FLOAT( -100, 100 ), RANDOM_FLOAT( -100, 100 ), RANDOM_FLOAT( 200, 300 ) ); if( flDamage > -50 ) - vec = vec * 0.7; + vec = vec * 0.7f; else if( flDamage > -200 ) vec = vec * 2; else @@ -314,15 +314,15 @@ int TrainSpeed( int iSpeed, int iMax ) fMax = (float)iMax; fSpeed = iSpeed; - fSpeed = fSpeed/fMax; + fSpeed = fSpeed / fMax; if( iSpeed < 0 ) iRet = TRAIN_BACK; - else if( iSpeed == 0 ) + else if( iSpeed == 0.0f ) iRet = TRAIN_NEUTRAL; - else if( fSpeed < 0.33 ) + else if( fSpeed < 0.33f ) iRet = TRAIN_SLOW; - else if( fSpeed < 0.66 ) + else if( fSpeed < 0.66f ) iRet = TRAIN_MEDIUM; else iRet = TRAIN_FAST; @@ -921,7 +921,7 @@ void CBasePlayer::Killed( entvars_t *pevAttacker, int iGib ) pev->angles.z = 0; SetThink( &CBasePlayer::PlayerDeathThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } // Set the activity based on an event or current state @@ -1722,7 +1722,7 @@ void CBasePlayer::UpdateStatusBar() Vector vecEnd = vecSrc + ( gpGlobals->v_forward * MAX_ID_RANGE ); UTIL_TraceLine( vecSrc, vecEnd, dont_ignore_monsters, edict(), &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { if( !FNullEnt( tr.pHit ) ) { @@ -1740,7 +1740,7 @@ void CBasePlayer::UpdateStatusBar() newSBarState[SBAR_ID_TARGETARMOR] = (int)pEntity->pev->armorvalue; //No need to get it % based since 100 it's the max. } - m_flStatusBarDisappearDelay = gpGlobals->time + 1.0; + m_flStatusBarDisappearDelay = gpGlobals->time + 1.0f; } } else if( m_flStatusBarDisappearDelay > gpGlobals->time ) @@ -1869,7 +1869,7 @@ void CBasePlayer::PreThink( void ) UTIL_TraceLine( pev->origin, pev->origin + Vector( 0, 0, -38 ), ignore_monsters, ENT( pev ), &trainTrace ); // HACKHACK - Just look for the func_tracktrain classname - if( trainTrace.flFraction != 1.0 && trainTrace.pHit ) + if( trainTrace.flFraction != 1.0f && trainTrace.pHit ) pTrain = CBaseEntity::Instance( trainTrace.pHit ); if( !pTrain || !( pTrain->ObjectCaps() & FCAP_DIRECTIONAL_USE ) || !pTrain->OnControls( pev ) ) @@ -2022,7 +2022,7 @@ void CBasePlayer::CheckTimeBasedDamage() return; // only check for time based damage approx. every 2 seconds - if( fabs( gpGlobals->time - m_tbdPrev ) < 2.0 ) + if( fabs( gpGlobals->time - m_tbdPrev ) < 2.0f ) return; m_tbdPrev = gpGlobals->time; @@ -2176,7 +2176,7 @@ Things powered by the battery // if in range of radiation source, ping geiger counter -#define GEIGERDELAY 0.25 +#define GEIGERDELAY 0.25f void CBasePlayer::UpdateGeigerCounter( void ) { @@ -2213,8 +2213,8 @@ Play suit update if it's time ================ */ -#define SUITUPDATETIME 3.5 -#define SUITFIRSTUPDATETIME 0.1 +#define SUITUPDATETIME 3.5f +#define SUITFIRSTUPDATETIME 0.1f void CBasePlayer::CheckSuitUpdate() { @@ -2617,23 +2617,23 @@ pt_end: if( gun && gun->UseDecrement() ) { - gun->m_flNextPrimaryAttack = Q_max( gun->m_flNextPrimaryAttack - gpGlobals->frametime, -1.0 ); - gun->m_flNextSecondaryAttack = Q_max( gun->m_flNextSecondaryAttack - gpGlobals->frametime, -0.001 ); + gun->m_flNextPrimaryAttack = Q_max( gun->m_flNextPrimaryAttack - gpGlobals->frametime, -1.0f ); + gun->m_flNextSecondaryAttack = Q_max( gun->m_flNextSecondaryAttack - gpGlobals->frametime, -0.001f ); - if( gun->m_flTimeWeaponIdle != 1000 ) + if( gun->m_flTimeWeaponIdle != 1000.0f ) { - gun->m_flTimeWeaponIdle = Q_max( gun->m_flTimeWeaponIdle - gpGlobals->frametime, -0.001 ); + gun->m_flTimeWeaponIdle = Q_max( gun->m_flTimeWeaponIdle - gpGlobals->frametime, -0.001f ); } - if( gun->pev->fuser1 != 1000 ) + if( gun->pev->fuser1 != 1000.0f ) { - gun->pev->fuser1 = Q_max( gun->pev->fuser1 - gpGlobals->frametime, -0.001 ); + gun->pev->fuser1 = Q_max( gun->pev->fuser1 - gpGlobals->frametime, -0.001f ); } // Only decrement if not flagged as NO_DECREMENT - /*if( gun->m_flPumpTime != 1000 ) + /*if( gun->m_flPumpTime != 1000.0f ) { - gun->m_flPumpTime = Q_max( gun->m_flPumpTime - gpGlobals->frametime, -0.001 ); + gun->m_flPumpTime = Q_max( gun->m_flPumpTime - gpGlobals->frametime, -0.001f ); }*/ } @@ -2643,23 +2643,23 @@ pt_end: } m_flNextAttack -= gpGlobals->frametime; - if( m_flNextAttack < -0.001 ) - m_flNextAttack = -0.001; + if( m_flNextAttack < -0.001f ) + m_flNextAttack = -0.001f; - if( m_flNextAmmoBurn != 1000 ) + if( m_flNextAmmoBurn != 1000.0f ) { m_flNextAmmoBurn -= gpGlobals->frametime; - if( m_flNextAmmoBurn < -0.001 ) - m_flNextAmmoBurn = -0.001; + if( m_flNextAmmoBurn < -0.001f ) + m_flNextAmmoBurn = -0.001f; } - if( m_flAmmoStartCharge != 1000 ) + if( m_flAmmoStartCharge != 1000.0f ) { m_flAmmoStartCharge -= gpGlobals->frametime; - if( m_flAmmoStartCharge < -0.001 ) - m_flAmmoStartCharge = -0.001; + if( m_flAmmoStartCharge < -0.001f ) + m_flAmmoStartCharge = -0.001f; } #else return; @@ -2762,7 +2762,7 @@ edict_t *EntSelectSpawnPoint( CBaseEntity *pPlayer ) } // If startspot is set, (re)spawn there. - if( FStringNull( gpGlobals->startspot ) || !strlen(STRING( gpGlobals->startspot ) ) ) + if( FStringNull( gpGlobals->startspot ) || (STRING( gpGlobals->startspot ) )[0] == '\0') { pSpot = UTIL_FindEntityByClassname( NULL, "info_player_start" ); if( !FNullEnt( pSpot ) ) @@ -2803,8 +2803,8 @@ void CBasePlayer::Spawn( void ) pev->deadflag = DEAD_NO; pev->dmg_take = 0; pev->dmg_save = 0; - pev->friction = 1.0; - pev->gravity = 1.0; + pev->friction = 1.0f; + pev->gravity = 1.0f; m_bitsHUDDamage = -1; m_bitsDamageType = 0; m_afPhysicsFlags = 0; @@ -2818,12 +2818,12 @@ void CBasePlayer::Spawn( void ) m_flNextDecalTime = 0;// let this player decal as soon as he spawns. - m_flgeigerDelay = gpGlobals->time + 2.0; // wait a few seconds until user-defined message registrations + m_flgeigerDelay = gpGlobals->time + 2.0f; // wait a few seconds until user-defined message registrations // are recieved by all clients m_flTimeStepSound = 0; m_iStepLeft = 0; - m_flFieldOfView = 0.5;// some monsters use this to determine whether or not the player is looking at them. + m_flFieldOfView = 0.5f;// some monsters use this to determine whether or not the player is looking at them. m_bloodColor = BLOOD_COLOR_RED; m_flNextAttack = UTIL_WeaponTimeBase(); @@ -2876,6 +2876,8 @@ void CBasePlayer::Spawn( void ) m_flNextChatTime = gpGlobals->time; + m_iAutoWepSwitch = 1; + g_pGameRules->PlayerSpawn( this ); } @@ -3173,7 +3175,7 @@ void CSprayCan::Spawn( entvars_t *pevOwner ) pev->owner = ENT( pevOwner ); pev->frame = 0; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; EMIT_SOUND( ENT( pev ), CHAN_VOICE, "player/sprayer.wav", 1, ATTN_NORM ); } @@ -3212,7 +3214,7 @@ void CSprayCan::Think( void ) UTIL_Remove( this ); } - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } class CBloodSplat : public CBaseEntity @@ -3229,7 +3231,7 @@ void CBloodSplat::Spawn( entvars_t *pevOwner ) pev->owner = ENT( pevOwner ); SetThink( &CBloodSplat::Spray ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } void CBloodSplat::Spray( void ) @@ -3244,7 +3246,7 @@ void CBloodSplat::Spray( void ) UTIL_BloodDecalTrace( &tr, BLOOD_COLOR_RED ); } SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } //============================================== @@ -3273,7 +3275,7 @@ CBaseEntity *FindEntityForward( CBaseEntity *pMe ) UTIL_MakeVectors( pMe->pev->v_angle ); UTIL_TraceLine( pMe->pev->origin + pMe->pev->view_ofs,pMe->pev->origin + pMe->pev->view_ofs + gpGlobals->v_forward * 8192,dont_ignore_monsters, pMe->edict(), &tr ); - if( tr.flFraction != 1.0 && !FNullEnt( tr.pHit ) ) + if( tr.flFraction != 1.0f && !FNullEnt( tr.pHit ) ) { CBaseEntity *pHit = CBaseEntity::Instance( tr.pHit ); return pHit; @@ -3409,7 +3411,7 @@ void CBasePlayer::ImpulseCommands() UTIL_MakeVectors( pev->v_angle ); UTIL_TraceLine( pev->origin + pev->view_ofs, pev->origin + pev->view_ofs + gpGlobals->v_forward * 128, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { // line hit something, so paint a decal m_flNextDecalTime = gpGlobals->time + decalfrequency.value; @@ -3431,7 +3433,7 @@ void CBasePlayer::ImpulseCommands() void CBasePlayer::CheatImpulseCommands( int iImpulse ) { #if !defined( HLDEMO_BUILD ) - if( g_flWeaponCheat == 0.0 ) + if( g_flWeaponCheat == 0.0f ) { return; } @@ -3580,7 +3582,7 @@ void CBasePlayer::CheatImpulseCommands( int iImpulse ) UTIL_MakeVectors( pev->v_angle ); UTIL_TraceLine( pev->origin + pev->view_ofs, pev->origin + pev->view_ofs + gpGlobals->v_forward * 128, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction != 1.0 ) + if( tr.flFraction != 1.0f ) { // line hit something, so paint a decal CBloodSplat *pBlood = GetClassPtr( (CBloodSplat *)NULL ); @@ -4102,7 +4104,7 @@ void CBasePlayer::UpdateClientData( void ) if( m_flNextSBarUpdateTime < gpGlobals->time ) { UpdateStatusBar(); - m_flNextSBarUpdateTime = gpGlobals->time + 0.2; + m_flNextSBarUpdateTime = gpGlobals->time + 0.2f; } // Send the current bhopcap state. @@ -4158,6 +4160,18 @@ int CBasePlayer::Illumination( void ) return iIllum; } +void CBasePlayer::SetPrefsFromUserinfo( char *infobuffer ) +{ + const char *pszKeyVal; + + pszKeyVal = g_engfuncs.pfnInfoKeyValue( infobuffer, "cl_autowepswitch" ); + + if( pszKeyVal[0] != '\0' ) + m_iAutoWepSwitch = atoi( pszKeyVal ); + else + m_iAutoWepSwitch = 1; +} + void CBasePlayer::EnableControl( BOOL fControl ) { if( !fControl ) @@ -4193,7 +4207,7 @@ Vector CBasePlayer::GetAutoaimVector( float flDelta ) } Vector vecSrc = GetGunPosition(); - float flDist = 8192; + float flDist = 8192.0f; // always use non-sticky autoaim // UNDONE: use sever variable to chose! @@ -4236,11 +4250,11 @@ Vector CBasePlayer::GetAutoaimVector( float flDelta ) // UNDONE: use sever variable to chose! if( 0 || g_iSkillLevel == SKILL_EASY ) { - m_vecAutoAim = m_vecAutoAim * 0.67 + angles * 0.33; + m_vecAutoAim = m_vecAutoAim * 0.67f + angles * 0.33f; } else { - m_vecAutoAim = angles * 0.9; + m_vecAutoAim = angles * 0.9f; } // m_vecAutoAim = m_vecAutoAim * 0.99; @@ -4338,16 +4352,16 @@ Vector CBasePlayer::AutoaimDeflection( Vector &vecSrc, float flDist, float flDel if( DotProduct( dir, gpGlobals->v_forward ) < 0 ) continue; - dot = fabs( DotProduct( dir, gpGlobals->v_right ) ) + fabs( DotProduct( dir, gpGlobals->v_up ) ) * 0.5; + dot = fabs( DotProduct( dir, gpGlobals->v_right ) ) + fabs( DotProduct( dir, gpGlobals->v_up ) ) * 0.5f; // tweek for distance - dot *= 1.0 + 0.2 * ( ( center - vecSrc ).Length() / flDist ); + dot *= 1.0f + 0.2f * ( ( center - vecSrc ).Length() / flDist ); if( dot > bestdot ) continue; // to far to turn UTIL_TraceLine( vecSrc, center, dont_ignore_monsters, edict(), &tr ); - if( tr.flFraction != 1.0 && tr.pHit != pEdict ) + if( tr.flFraction != 1.0f && tr.pHit != pEdict ) { // ALERT( at_console, "hit %s, can't see %s\n", STRING( tr.pHit->v.classname ), STRING( pEdict->v.classname ) ); continue; @@ -4432,7 +4446,7 @@ void CBasePlayer::DropPlayerItem( char *pszItemName ) return; } - if( !strlen( pszItemName ) ) + if( pszItemName[0] == '\0' ) { // if this string has no length, the client didn't type a name! // assume player wants to drop the active item. @@ -4784,7 +4798,7 @@ void CInfoIntermission::Spawn( void ) pev->effects = EF_NODRAW; pev->v_angle = g_vecZero; - pev->nextthink = gpGlobals->time + 2;// let targets spawn! + pev->nextthink = gpGlobals->time + 2.0f;// let targets spawn! } void CInfoIntermission::Think( void ) diff --git a/dlls/player.h b/dlls/player.h index 6fc06dbb..571a025d 100644 --- a/dlls/player.h +++ b/dlls/player.h @@ -307,14 +307,12 @@ public: void TabulateAmmo( void ); - Vector m_vecLastViewAngles; - float m_flStartCharge; float m_flAmmoStartCharge; float m_flPlayAftershock; float m_flNextAmmoBurn;// while charging, when to absorb another unit of player's ammo? - //Player ID + // Player ID void InitStatusBar( void ); void UpdateStatusBar( void ); int m_izSBarState[SBAR_END]; @@ -323,8 +321,14 @@ public: char m_SbarString0[SBAR_STRING_SIZE]; char m_SbarString1[SBAR_STRING_SIZE]; + void SetPrefsFromUserinfo( char *infobuffer ); + float m_flNextChatTime; + int m_iAutoWepSwitch; + + Vector m_vecLastViewAngles; + bool m_bSentBhopcap; // If false, the player just joined and needs a bhopcap message. }; diff --git a/dlls/python.cpp b/dlls/python.cpp index 88aa34b5..d8bfd35f 100644 --- a/dlls/python.cpp +++ b/dlls/python.cpp @@ -123,8 +123,8 @@ void CPython::Holster( int skiplocal /* = 0 */ ) SecondaryAttack(); } - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0f; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10.0f, 15.0f ); SendWeaponAnim( PYTHON_HOLSTER ); } @@ -150,7 +150,7 @@ void CPython::SecondaryAttack( void ) m_pPlayer->pev->fov = m_pPlayer->m_iFOV = 40; } - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5f; } void CPython::PrimaryAttack() @@ -159,7 +159,7 @@ void CPython::PrimaryAttack() if( m_pPlayer->pev->waterlevel == 3 ) { PlayEmptySound(); - m_flNextPrimaryAttack = 0.15; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.15f; return; } @@ -170,7 +170,7 @@ void CPython::PrimaryAttack() else { PlayEmptySound(); - m_flNextPrimaryAttack = 0.15; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.15f; } return; @@ -206,8 +206,8 @@ void CPython::PrimaryAttack() // HEV suit - indicate out of ammo condition m_pPlayer->SetSuitUpdate( "!HEV_AMO0", FALSE, 0 ); - m_flNextPrimaryAttack = 0.75; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); + m_flNextPrimaryAttack = 0.75f; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10.0f, 15.0f ); } void CPython::Reload( void ) @@ -227,9 +227,9 @@ void CPython::Reload( void ) #else bUseScope = g_pGameRules->IsMultiplayer(); #endif - if( DefaultReload( PYTHON_MAX_CLIP, PYTHON_RELOAD, 2.0, bUseScope ) ) + if( DefaultReload( PYTHON_MAX_CLIP, PYTHON_RELOAD, 2.0f, bUseScope ) ) { - m_flSoundDelay = 1.5; + m_flSoundDelay = 1.5f; } } @@ -242,8 +242,8 @@ void CPython::WeaponIdle( void ) // ALERT( at_console, "%.2f\n", gpGlobals->time - m_flSoundDelay ); if( m_flSoundDelay != 0 && m_flSoundDelay <= UTIL_WeaponTimeBase() ) { - EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/357_reload1.wav", RANDOM_FLOAT( 0.8, 0.9 ), ATTN_NORM ); - m_flSoundDelay = 0; + EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "weapons/357_reload1.wav", RANDOM_FLOAT( 0.8f, 0.9f ), ATTN_NORM ); + m_flSoundDelay = 0.0f; } if( m_flTimeWeaponIdle > UTIL_WeaponTimeBase() ) @@ -251,25 +251,25 @@ void CPython::WeaponIdle( void ) int iAnim; float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0.0f, 1.0f ); - if( flRand <= 0.5 ) + if( flRand <= 0.5f ) { iAnim = PYTHON_IDLE1; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 70.0 / 30.0 ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 70.0f / 30.0f ); } - else if( flRand <= 0.7 ) + else if( flRand <= 0.7f ) { iAnim = PYTHON_IDLE2; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 60.0 / 30.0 ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 60.0f / 30.0f ); } - else if( flRand <= 0.9 ) + else if( flRand <= 0.9f ) { iAnim = PYTHON_IDLE3; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 88.0 / 30.0 ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 88.0f / 30.0f ); } else { iAnim = PYTHON_FIDGET; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 170.0 / 30.0 ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 170.0f / 30.0f ); } int bUseScope = FALSE; diff --git a/dlls/roach.cpp b/dlls/roach.cpp index 692b4beb..66e9702d 100644 --- a/dlls/roach.cpp +++ b/dlls/roach.cpp @@ -190,7 +190,7 @@ void CRoach::MonsterThink( void ) if( FNullEnt( FIND_CLIENT_IN_PVS( edict() ) ) ) pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 1, 1.5 ); else - pev->nextthink = gpGlobals->time + 0.1;// keep monster thinking + pev->nextthink = gpGlobals->time + 0.1f;// keep monster thinking float flInterval = StudioFrameAdvance(); // animate @@ -262,7 +262,7 @@ void CRoach::MonsterThink( void ) pSound = CSoundEnt::SoundPointerForIndex( m_iAudibleList ); // roach smells food and is just standing around. Go to food unless food isn't on same z-plane. - if( pSound && fabs( pSound->m_vecOrigin.z - pev->origin.z ) <= 3.0 ) + if( pSound && fabs( pSound->m_vecOrigin.z - pev->origin.z ) <= 3.0f ) { PickNewDest( ROACH_SMELL_FOOD ); SetActivity( ACT_WALK ); diff --git a/dlls/rpg.cpp b/dlls/rpg.cpp index fe1fd8a9..0b5b5f7b 100644 --- a/dlls/rpg.cpp +++ b/dlls/rpg.cpp @@ -134,14 +134,14 @@ void CRpgRocket::Spawn( void ) SetThink( &CRpgRocket::IgniteThink ); SetTouch( &CGrenade::ExplodeTouch ); - pev->angles.x -= 30; + pev->angles.x -= 30.0f; UTIL_MakeVectors( pev->angles ); - pev->angles.x = -( pev->angles.x + 30 ); + pev->angles.x = -( pev->angles.x + 30.0f ); - pev->velocity = gpGlobals->v_forward * 250; - pev->gravity = 0.5; + pev->velocity = gpGlobals->v_forward * 250.0f; + pev->gravity = 0.5f; - pev->nextthink = gpGlobals->time + 0.4; + pev->nextthink = gpGlobals->time + 0.4f; pev->dmg = gSkillData.plrDmgRPG; } @@ -177,7 +177,7 @@ void CRpgRocket::IgniteThink( void ) pev->effects |= EF_LIGHT; // make rocket sound - EMIT_SOUND( ENT( pev ), CHAN_VOICE, "weapons/rocket1.wav", 1, 0.5 ); + EMIT_SOUND( ENT( pev ), CHAN_VOICE, "weapons/rocket1.wav", 1, 0.5f ); // rocket trail MESSAGE_BEGIN( MSG_BROADCAST, SVC_TEMPENTITY ); @@ -196,7 +196,7 @@ void CRpgRocket::IgniteThink( void ) // set to follow laser spot SetThink( &CRpgRocket::FollowThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } void CRpgRocket::FollowThink( void ) @@ -217,7 +217,7 @@ void CRpgRocket::FollowThink( void ) { UTIL_TraceLine( pev->origin, pOther->pev->origin, dont_ignore_monsters, ENT( pev ), &tr ); // ALERT( at_console, "%f\n", tr.flFraction ); - if( tr.flFraction >= 0.90 ) + if( tr.flFraction >= 0.9f ) { vecDir = pOther->pev->origin - pev->origin; flDist = vecDir.Length(); @@ -235,23 +235,23 @@ void CRpgRocket::FollowThink( void ) // this acceleration and turning math is totally wrong, but it seems to respond well so don't change it. float flSpeed = pev->velocity.Length(); - if( gpGlobals->time - m_flIgniteTime < 1.0 ) + if( gpGlobals->time - m_flIgniteTime < 1.0f ) { - pev->velocity = pev->velocity * 0.2 + vecTarget * ( flSpeed * 0.8 + 400 ); + pev->velocity = pev->velocity * 0.2f + vecTarget * ( flSpeed * 0.8f + 400.0f ); if( pev->waterlevel == 3 ) { // go slow underwater - if( pev->velocity.Length() > 300 ) + if( pev->velocity.Length() > 300.0f ) { - pev->velocity = pev->velocity.Normalize() * 300; + pev->velocity = pev->velocity.Normalize() * 300.0f; } - UTIL_BubbleTrail( pev->origin - pev->velocity * 0.1, pev->origin, 4 ); + UTIL_BubbleTrail( pev->origin - pev->velocity * 0.1f, pev->origin, 4 ); } else { - if( pev->velocity.Length() > 2000 ) + if( pev->velocity.Length() > 2000.0f ) { - pev->velocity = pev->velocity.Normalize() * 2000; + pev->velocity = pev->velocity.Normalize() * 2000.0f; } } } @@ -262,8 +262,8 @@ void CRpgRocket::FollowThink( void ) pev->effects = 0; STOP_SOUND( ENT( pev ), CHAN_VOICE, "weapons/rocket1.wav" ); } - pev->velocity = pev->velocity * 0.2 + vecTarget * flSpeed * 0.798; - if( pev->waterlevel == 0 && pev->velocity.Length() < 1500 ) + pev->velocity = pev->velocity * 0.2f + vecTarget * flSpeed * 0.798f; + if( pev->waterlevel == 0 && pev->velocity.Length() < 1500.0f ) { if( CRpg *pLauncher = (CRpg*)( (CBaseEntity*)( m_hLauncher ) ) ) { @@ -275,7 +275,7 @@ void CRpgRocket::FollowThink( void ) } // ALERT( at_console, "%.0f\n", flSpeed ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } #endif @@ -297,7 +297,7 @@ void CRpg::Reload( void ) // Set the next attack time into the future so that WeaponIdle will get called more often // than reload, allowing the RPG LTD to be updated - m_flNextPrimaryAttack = GetNextAttackDelay( 0.5 ); + m_flNextPrimaryAttack = GetNextAttackDelay( 0.5f ); if( m_cActiveRockets && m_fSpotActive ) { @@ -309,8 +309,8 @@ void CRpg::Reload( void ) #ifndef CLIENT_DLL if( m_pSpot && m_fSpotActive ) { - m_pSpot->Suspend( 2.1 ); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 2.1; + m_pSpot->Suspend( 2.1f ); + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 2.1f; } #endif @@ -417,7 +417,7 @@ void CRpg::Holster( int skiplocal /* = 0 */ ) { m_fInReload = FALSE;// cancel any reload in progress. - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; SendWeaponAnim( RPG_HOLSTER1 ); @@ -442,7 +442,7 @@ void CRpg::PrimaryAttack() m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); UTIL_MakeVectors( m_pPlayer->pev->v_angle ); - Vector vecSrc = m_pPlayer->GetGunPosition() + gpGlobals->v_forward * 16 + gpGlobals->v_right * 8 + gpGlobals->v_up * -8; + Vector vecSrc = m_pPlayer->GetGunPosition() + gpGlobals->v_forward * 16.0f + gpGlobals->v_right * 8.0f + gpGlobals->v_up * -8.0f; CRpgRocket *pRocket = CRpgRocket::CreateRpgRocket( vecSrc, m_pPlayer->pev->v_angle, m_pPlayer, this ); @@ -463,15 +463,15 @@ void CRpg::PrimaryAttack() m_iClip--; - m_flNextPrimaryAttack = GetNextAttackDelay( 1.5 ); - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.5; + m_flNextPrimaryAttack = GetNextAttackDelay( 1.5f ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.5f; ResetEmptySound(); } else { PlayEmptySound(); - m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.2; + m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.2f; } UpdateSpot(); } @@ -487,7 +487,7 @@ void CRpg::SecondaryAttack() m_pSpot = NULL; } #endif - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.2; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.2f; } void CRpg::WeaponIdle( void ) @@ -502,15 +502,15 @@ void CRpg::WeaponIdle( void ) ResetEmptySound(); int iAnim; - float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 ); - if( flRand <= 0.75 || m_fSpotActive ) + float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0.0f, 1.0f ); + if( flRand <= 0.75f || m_fSpotActive ) { if( m_iClip == 0 ) iAnim = RPG_IDLE_UL; else iAnim = RPG_IDLE; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 90.0 / 15.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 90.0f / 15.0f; } else { @@ -519,14 +519,14 @@ void CRpg::WeaponIdle( void ) else iAnim = RPG_FIDGET; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0f; } SendWeaponAnim( iAnim ); } else { - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0f; } } @@ -535,6 +535,9 @@ void CRpg::UpdateSpot( void ) #ifndef CLIENT_DLL if( m_fSpotActive ) { + if (m_pPlayer->pev->viewmodel == 0) + return; + if( !m_pSpot ) { m_pSpot = CLaserSpot::CreateSpot(); @@ -545,7 +548,7 @@ void CRpg::UpdateSpot( void ) Vector vecAiming = gpGlobals->v_forward; TraceResult tr; - UTIL_TraceLine( vecSrc, vecSrc + vecAiming * 8192, dont_ignore_monsters, ENT( m_pPlayer->pev ), &tr ); + UTIL_TraceLine( vecSrc, vecSrc + vecAiming * 8192.0f, dont_ignore_monsters, ENT( m_pPlayer->pev ), &tr ); UTIL_SetOrigin( m_pSpot->pev, tr.vecEndPos ); } diff --git a/dlls/satchel.cpp b/dlls/satchel.cpp index dc8724bd..09e431c5 100644 --- a/dlls/satchel.cpp +++ b/dlls/satchel.cpp @@ -88,10 +88,10 @@ void CSatchelCharge::Spawn( void ) SetTouch( &CSatchelCharge::SatchelSlide ); SetUse( &CGrenade::DetonateUse ); SetThink( &CSatchelCharge::SatchelThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; - pev->gravity = 0.5; - pev->friction = 0.8; + pev->gravity = 0.5f; + pev->friction = 0.8f; pev->dmg = gSkillData.plrDmgSatchel; // ResetSequenceInfo(); @@ -113,14 +113,14 @@ void CSatchelCharge::SatchelSlide( CBaseEntity *pOther ) TraceResult tr; UTIL_TraceLine( pev->origin, pev->origin - Vector( 0, 0, 10 ), ignore_monsters, edict(), &tr ); - if( tr.flFraction < 1.0 ) + if( tr.flFraction < 1.0f ) { // add a bit of static friction pev->velocity = pev->velocity * 0.95; pev->avelocity = pev->avelocity * 0.9; // play sliding sound, volume based on velocity } - if( !( pev->flags & FL_ONGROUND ) && pev->velocity.Length2D() > 10 ) + if( !( pev->flags & FL_ONGROUND ) && pev->velocity.Length2D() > 10.0f ) { // Fix for a bug in engine: when object isn't moving, but its speed isn't 0 and on ground isn't set if( pev->origin != m_lastBounceOrigin ) @@ -135,7 +135,7 @@ void CSatchelCharge::SatchelThink( void ) { // There is no model animation so commented this out to prevent net traffic // StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( !IsInWorld() ) { @@ -146,8 +146,8 @@ void CSatchelCharge::SatchelThink( void ) if( pev->waterlevel == 3 ) { pev->movetype = MOVETYPE_FLY; - pev->velocity = pev->velocity * 0.8; - pev->avelocity = pev->avelocity * 0.9; + pev->velocity = pev->velocity * 0.8f; + pev->avelocity = pev->avelocity * 0.9f; pev->velocity.z += 8; } else if( pev->waterlevel == 0 ) @@ -156,7 +156,7 @@ void CSatchelCharge::SatchelThink( void ) } else { - pev->velocity.z -= 8; + pev->velocity.z -= 8.0f; } } @@ -292,8 +292,8 @@ BOOL CSatchel::CanDeploy( void ) BOOL CSatchel::Deploy() { - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0f; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10.0f, 15.0f ); if( m_chargeReady ) return DefaultDeploy( "models/v_satchel_radio.mdl", "models/p_satchel_radio.mdl", SATCHEL_RADIO_DRAW, "hive" ); @@ -305,7 +305,7 @@ BOOL CSatchel::Deploy() void CSatchel::Holster( int skiplocal /* = 0 */ ) { - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; if( m_chargeReady ) { @@ -315,7 +315,7 @@ void CSatchel::Holster( int skiplocal /* = 0 */ ) { SendWeaponAnim( SATCHEL_DROP ); } - EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "common/null.wav", 1.0, ATTN_NORM ); + EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "common/null.wav", 1.0f, ATTN_NORM ); if( !m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] && m_chargeReady != SATCHEL_READY ) { @@ -353,9 +353,9 @@ void CSatchel::PrimaryAttack() } m_chargeReady = SATCHEL_RELOAD; - m_flNextPrimaryAttack = GetNextAttackDelay( 0.5 ); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5; + m_flNextPrimaryAttack = GetNextAttackDelay( 0.5f ); + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5f; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5f; break; } case SATCHEL_RELOAD: @@ -400,8 +400,8 @@ void CSatchel::Throw( void ) m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--; - m_flNextPrimaryAttack = GetNextAttackDelay( 1.0 ); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5; + m_flNextPrimaryAttack = GetNextAttackDelay( 1.0f ); + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5f; } } @@ -441,8 +441,8 @@ void CSatchel::WeaponIdle( void ) // use tripmine animations strcpy( m_pPlayer->m_szAnimExtention, "trip" ); - m_flNextPrimaryAttack = GetNextAttackDelay( 0.5 ); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5; + m_flNextPrimaryAttack = GetNextAttackDelay( 0.5f ); + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5f; m_chargeReady = SATCHEL_IDLE; break; } diff --git a/dlls/schedule.cpp b/dlls/schedule.cpp index 4a5cefca..2a4cc311 100644 --- a/dlls/schedule.cpp +++ b/dlls/schedule.cpp @@ -414,7 +414,7 @@ void CBaseMonster::RunTask( Task_t *pTask ) distance = ( m_vecMoveGoal - pev->origin ).Length2D(); // Re-evaluate when you think your finished, or the target has moved too far - if( ( distance < pTask->flData ) || ( m_vecMoveGoal - m_hTargetEnt->pev->origin ).Length() > pTask->flData * 0.5 ) + if( ( distance < pTask->flData ) || ( m_vecMoveGoal - m_hTargetEnt->pev->origin ).Length() > pTask->flData * 0.5f ) { m_vecMoveGoal = m_hTargetEnt->pev->origin; distance = ( m_vecMoveGoal - pev->origin ).Length2D(); @@ -1378,7 +1378,7 @@ Schedule_t *CBaseMonster::GetSchedule( void ) if( HasConditions( bits_COND_LIGHT_DAMAGE | bits_COND_HEAVY_DAMAGE ) ) { - if( fabs( FlYawDiff() ) < ( 1.0 - m_flFieldOfView ) * 60 ) // roughly in the correct direction + if( fabs( FlYawDiff() ) < ( 1.0f - m_flFieldOfView ) * 60.0f ) // roughly in the correct direction { return GetScheduleOfType( SCHED_TAKE_COVER_FROM_ORIGIN ); } diff --git a/dlls/scientist.cpp b/dlls/scientist.cpp index cc506b6f..e679770a 100644 --- a/dlls/scientist.cpp +++ b/dlls/scientist.cpp @@ -135,7 +135,7 @@ IMPLEMENT_SAVERESTORE( CScientist, CTalkMonster ) Task_t tlFollow[] = { { TASK_SET_FAIL_SCHEDULE, (float)SCHED_CANT_FOLLOW }, // If you fail, bail out of follow - { TASK_MOVE_TO_TARGET_RANGE, (float)128 }, // Move within 128 of target ent (client) + { TASK_MOVE_TO_TARGET_RANGE, 128.0f }, // Move within 128 of target ent (client) //{ TASK_SET_SCHEDULE, (float)SCHED_TARGET_FACE }, }; @@ -157,7 +157,7 @@ Schedule_t slFollow[] = Task_t tlFollowScared[] = { { TASK_SET_FAIL_SCHEDULE, (float)SCHED_TARGET_CHASE },// If you fail, follow normally - { TASK_MOVE_TO_TARGET_RANGE_SCARED, (float)128 }, // Move within 128 of target ent (client) + { TASK_MOVE_TO_TARGET_RANGE_SCARED, 128.0f }, // Move within 128 of target ent (client) //{ TASK_SET_SCHEDULE, (float)SCHED_TARGET_FACE_SCARED }, }; @@ -177,7 +177,7 @@ Schedule_t slFollowScared[] = Task_t tlFaceTargetScared[] = { - { TASK_FACE_TARGET, (float)0 }, + { TASK_FACE_TARGET, 0.0f }, { TASK_SET_ACTIVITY, (float)ACT_CROUCHIDLE }, { TASK_SET_SCHEDULE, (float)SCHED_TARGET_CHASE_SCARED }, }; @@ -196,7 +196,7 @@ Schedule_t slFaceTargetScared[] = Task_t tlStopFollowing[] = { - { TASK_CANT_FOLLOW, (float)0 }, + { TASK_CANT_FOLLOW, 0.0f }, }; Schedule_t slStopFollowing[] = @@ -212,12 +212,12 @@ Schedule_t slStopFollowing[] = Task_t tlHeal[] = { - { TASK_MOVE_TO_TARGET_RANGE, (float)50 }, // Move within 60 of target ent (client) + { TASK_MOVE_TO_TARGET_RANGE, 50.0f }, // Move within 60 of target ent (client) { TASK_SET_FAIL_SCHEDULE, (float)SCHED_TARGET_CHASE }, // If you fail, catch up with that guy! (change this to put syringe away and then chase) - { TASK_FACE_IDEAL, (float)0 }, - { TASK_SAY_HEAL, (float)0 }, + { TASK_FACE_IDEAL, 0.0f }, + { TASK_SAY_HEAL, 0.0f }, { TASK_PLAY_SEQUENCE_FACE_TARGET, (float)ACT_ARM }, // Whip out the needle - { TASK_HEAL, (float)0 }, // Put it in the player + { TASK_HEAL, 0.0f }, // Put it in the player { TASK_PLAY_SEQUENCE_FACE_TARGET, (float)ACT_DISARM }, // Put away the needle }; @@ -234,8 +234,8 @@ Schedule_t slHeal[] = Task_t tlFaceTarget[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_FACE_TARGET, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_FACE_TARGET, 0.0f }, { TASK_SET_ACTIVITY, (float)ACT_IDLE }, { TASK_SET_SCHEDULE, (float)SCHED_TARGET_CHASE }, }; @@ -256,9 +256,9 @@ Schedule_t slFaceTarget[] = Task_t tlSciPanic[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_FACE_ENEMY, (float)0 }, - { TASK_SCREAM, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_FACE_ENEMY, 0.0f }, + { TASK_SCREAM, 0.0f }, { TASK_PLAY_SEQUENCE_FACE_ENEMY, (float)ACT_EXCITED }, // This is really fear-stricken excitement { TASK_SET_ACTIVITY, (float)ACT_IDLE }, }; @@ -278,7 +278,7 @@ Task_t tlIdleSciStand[] = { { TASK_STOP_MOVING, 0 }, { TASK_SET_ACTIVITY, (float)ACT_IDLE }, - { TASK_WAIT, (float)2 }, // repick IDLESTAND every two seconds. + { TASK_WAIT, 2.0f }, // repick IDLESTAND every two seconds. { TASK_TLK_HEADRESET, (float)0 }, // reset head position }; @@ -309,10 +309,10 @@ Schedule_t slIdleSciStand[] = Task_t tlScientistCover[] = { { TASK_SET_FAIL_SCHEDULE, (float)SCHED_PANIC }, // If you fail, just panic! - { TASK_STOP_MOVING, (float)0 }, - { TASK_FIND_COVER_FROM_ENEMY, (float)0 }, - { TASK_RUN_PATH_SCARED, (float)0 }, - { TASK_TURN_LEFT, (float)179 }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_FIND_COVER_FROM_ENEMY, 0.0f }, + { TASK_RUN_PATH_SCARED, 0.0f }, + { TASK_TURN_LEFT, 179.0f }, { TASK_SET_SCHEDULE, (float)SCHED_HIDE }, }; @@ -330,10 +330,10 @@ Schedule_t slScientistCover[] = Task_t tlScientistHide[] = { { TASK_SET_FAIL_SCHEDULE, (float)SCHED_PANIC }, // If you fail, just panic! - { TASK_STOP_MOVING, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, { TASK_PLAY_SEQUENCE, (float)ACT_CROUCH }, { TASK_SET_ACTIVITY, (float)ACT_CROUCHIDLE }, // FIXME: This looks lame - { TASK_WAIT_RANDOM, (float)10.0 }, + { TASK_WAIT_RANDOM, 10.0f }, }; Schedule_t slScientistHide[] = @@ -355,12 +355,12 @@ Schedule_t slScientistHide[] = Task_t tlScientistStartle[] = { { TASK_SET_FAIL_SCHEDULE, (float)SCHED_PANIC }, // If you fail, just panic! - { TASK_RANDOM_SCREAM, (float)0.3 }, // Scream 30% of the time - { TASK_STOP_MOVING, (float)0 }, + { TASK_RANDOM_SCREAM, 0.3f }, // Scream 30% of the time + { TASK_STOP_MOVING, 0.0f }, { TASK_PLAY_SEQUENCE_FACE_ENEMY, (float)ACT_CROUCH }, - { TASK_RANDOM_SCREAM, (float)0.1 }, // Scream again 10% of the time + { TASK_RANDOM_SCREAM, 0.1f }, // Scream again 10% of the time { TASK_PLAY_SEQUENCE_FACE_ENEMY, (float)ACT_CROUCHIDLE }, - { TASK_WAIT_RANDOM, (float)1.0 }, + { TASK_WAIT_RANDOM, 1.0f }, }; Schedule_t slScientistStartle[] = @@ -380,9 +380,9 @@ Schedule_t slScientistStartle[] = Task_t tlFear[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_FACE_ENEMY, (float)0 }, - { TASK_SAY_FEAR, (float)0 }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_FACE_ENEMY, 0.0f }, + { TASK_SAY_FEAR, 0.0f }, //{ TASK_PLAY_SEQUENCE, (float)ACT_FEAR_DISPLAY }, }; @@ -428,7 +428,7 @@ void CScientist::Scream( void ) { Talk( 10 ); m_hTalkTarget = m_hEnemy; - PlaySentence( "SC_SCREAM", RANDOM_FLOAT( 3, 6 ), VOL_NORM, ATTN_NORM ); + PlaySentence( "SC_SCREAM", RANDOM_FLOAT( 3.0f, 6.0f ), VOL_NORM, ATTN_NORM ); } } @@ -455,7 +455,7 @@ void CScientist::StartTask( Task_t *pTask ) TaskComplete(); break; case TASK_RANDOM_SCREAM: - if( RANDOM_FLOAT( 0, 1 ) < pTask->flData ) + if( RANDOM_FLOAT( 0.0f, 1.0f ) < pTask->flData ) Scream(); TaskComplete(); break; @@ -482,8 +482,10 @@ void CScientist::StartTask( Task_t *pTask ) break; case TASK_MOVE_TO_TARGET_RANGE_SCARED: { - if( ( m_hTargetEnt->pev->origin - pev->origin).Length() < 1 ) + if( ( m_hTargetEnt->pev->origin - pev->origin ).Length() < 1.0f ) + { TaskComplete(); + } else { m_vecMoveGoal = m_hTargetEnt->pev->origin; @@ -523,7 +525,7 @@ void CScientist::RunTask( Task_t *pTask ) distance = ( m_vecMoveGoal - pev->origin ).Length2D(); // Re-evaluate when you think your finished, or the target has moved too far - if( ( distance < pTask->flData ) || ( m_vecMoveGoal - m_hTargetEnt->pev->origin ).Length() > pTask->flData * 0.5 ) + if( ( distance < pTask->flData ) || ( m_vecMoveGoal - m_hTargetEnt->pev->origin ).Length() > pTask->flData * 0.5f ) { m_vecMoveGoal = m_hTargetEnt->pev->origin; distance = ( m_vecMoveGoal - pev->origin ).Length2D(); @@ -771,7 +773,7 @@ void CScientist::PainSound( void ) if( gpGlobals->time < m_painTime ) return; - m_painTime = gpGlobals->time + RANDOM_FLOAT( 0.5, 0.75 ); + m_painTime = gpGlobals->time + RANDOM_FLOAT( 0.5f, 0.75f ); switch( RANDOM_LONG( 0, 4 ) ) { @@ -1047,7 +1049,7 @@ MONSTERSTATE CScientist::GetIdealState( void ) BOOL CScientist::CanHeal( void ) { - if( ( m_healTime > gpGlobals->time ) || ( m_hTargetEnt == 0 ) || ( m_hTargetEnt->pev->health > ( m_hTargetEnt->pev->max_health * 0.5 ) ) ) + if( ( m_healTime > gpGlobals->time ) || ( m_hTargetEnt == 0 ) || ( m_hTargetEnt->pev->health > ( m_hTargetEnt->pev->max_health * 0.5f ) ) ) return FALSE; return TRUE; @@ -1059,7 +1061,7 @@ void CScientist::Heal( void ) return; Vector target = m_hTargetEnt->pev->origin - pev->origin; - if( target.Length() > 100 ) + if( target.Length() > 100.0f ) return; m_hTargetEnt->TakeHealth( gSkillData.scientistHeal, DMG_GENERIC ); @@ -1238,7 +1240,7 @@ void CSittingScientist::Spawn() ResetSequenceInfo(); SetThink( &CSittingScientist::SittingThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; DROP_TO_FLOOR( ENT( pev ) ); } @@ -1366,13 +1368,13 @@ void CSittingScientist::SittingThink( void ) pev->frame = 0; SetBoneController( 0, m_headTurn ); } - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } // prepare sitting scientist to answer a question void CSittingScientist::SetAnswerQuestion( CTalkMonster *pSpeaker ) { - m_flResponseDelay = gpGlobals->time + RANDOM_FLOAT( 3, 4 ); + m_flResponseDelay = gpGlobals->time + RANDOM_FLOAT( 3.0f, 4.0f ); m_hTalkTarget = (CBaseMonster *)pSpeaker; } diff --git a/dlls/scripted.cpp b/dlls/scripted.cpp index 41638b39..4c04a9f7 100644 --- a/dlls/scripted.cpp +++ b/dlls/scripted.cpp @@ -136,10 +136,10 @@ void CCineMonster::Spawn( void ) if( FStringNull( pev->targetname ) || !FStringNull( m_iszIdle ) ) { SetThink( &CCineMonster::CineThink ); - pev->nextthink = gpGlobals->time + 1.0; + pev->nextthink = gpGlobals->time + 1.0f; // Wait to be used? if( pev->targetname ) - m_startTime = gpGlobals->time + 1E6; + m_startTime = gpGlobals->time + (float)1E6; } if( pev->spawnflags & SF_SCRIPT_NOINTERRUPT ) m_interruptable = FALSE; @@ -185,7 +185,7 @@ void CCineMonster::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE if( pTarget->m_scriptState == SCRIPT_PLAYING ) return; - m_startTime = gpGlobals->time + 0.05; + m_startTime = gpGlobals->time + 0.05f; } else { @@ -356,7 +356,7 @@ void CCineMonster::PossessEntity( void ) pTarget->pev->effects |= EF_NOINTERP; pTarget->pev->angles.y = pev->angles.y; pTarget->m_scriptState = SCRIPT_WAIT; - m_startTime = gpGlobals->time + 1E6; + m_startTime = gpGlobals->time + (float)1E6; // UNDONE: Add a flag to do this so people can fixup physics after teleporting monsters // pTarget->pev->flags &= ~FL_ONGROUND; break; @@ -424,7 +424,7 @@ void CCineAI::PossessEntity( void ) pTarget->pev->effects |= EF_NOINTERP; pTarget->pev->angles.y = pev->angles.y; pTarget->m_scriptState = SCRIPT_WAIT; - m_startTime = gpGlobals->time + 1E6; + m_startTime = gpGlobals->time + (float)1E6; // UNDONE: Add a flag to do this so people can fixup physics after teleporting monsters pTarget->pev->flags &= ~FL_ONGROUND; break; @@ -466,7 +466,7 @@ void CCineMonster::CineThink( void ) { CancelScript(); ALERT( at_aiconsole, "script \"%s\" can't find monster \"%s\"\n", STRING( pev->targetname ), STRING( m_iszEntity ) ); - pev->nextthink = gpGlobals->time + 1.0; + pev->nextthink = gpGlobals->time + 1.0f; } } @@ -544,7 +544,7 @@ void CCineMonster::SequenceDone( CBaseMonster *pMonster ) if( !( pev->spawnflags & SF_SCRIPT_REPEATABLE ) ) { SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } // This is done so that another sequence can take over the monster when triggered by the first @@ -713,7 +713,7 @@ void CCineMonster::DelayStart( int state ) { pTarget->m_iDelay--; if( pTarget->m_iDelay <= 0 ) - pTarget->m_startTime = gpGlobals->time + 0.05; + pTarget->m_startTime = gpGlobals->time + 0.05f; } } pentCine = FIND_ENTITY_BY_TARGETNAME( pentCine, STRING( pev->targetname ) ); @@ -836,7 +836,7 @@ BOOL CBaseMonster::CineCleanup() // UNDONE: ugly hack. Don't move monster if they don't "seem" to move // this really needs to be done with the AX,AY,etc. flags, but that aren't consistantly // being set, so animations that really do move won't be caught. - if( ( oldOrigin - new_origin).Length2D() < 8.0 ) + if( ( oldOrigin - new_origin).Length2D() < 8.0f ) new_origin = oldOrigin; pev->origin.x = new_origin.x; @@ -974,7 +974,7 @@ void CScriptedSentence::KeyValue( KeyValueData *pkvd ) } else if( FStrEq( pkvd->szKeyName, "volume" ) ) { - m_flVolume = atof( pkvd->szValue ) * 0.1; + m_flVolume = atof( pkvd->szValue ) * 0.1f; pkvd->fHandled = TRUE; } else if( FStrEq( pkvd->szKeyName, "listener" ) ) @@ -1004,7 +1004,7 @@ void CScriptedSentence::Spawn( void ) if( !pev->targetname ) { SetThink( &CScriptedSentence::FindThink ); - pev->nextthink = gpGlobals->time + 1.0; + pev->nextthink = gpGlobals->time + 1.0f; } switch( pev->impulse ) @@ -1030,8 +1030,8 @@ void CScriptedSentence::Spawn( void ) pev->impulse = 0; // No volume, use normal - if( m_flVolume <= 0 ) - m_flVolume = 1.0; + if( m_flVolume <= 0.0f ) + m_flVolume = 1.0f; } void CScriptedSentence::FindThink( void ) @@ -1050,7 +1050,7 @@ void CScriptedSentence::FindThink( void ) else { //ALERT( at_console, "%s: can't find monster %s\n", STRING( m_iszSentence ), STRING( m_iszEntity ) ); - pev->nextthink = gpGlobals->time + m_flRepeat + 0.5; + pev->nextthink = gpGlobals->time + m_flRepeat + 0.5f; } } @@ -1058,7 +1058,7 @@ void CScriptedSentence::DelayThink( void ) { m_active = TRUE; if( !pev->targetname ) - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; SetThink( &CScriptedSentence::FindThink ); } @@ -1068,14 +1068,17 @@ BOOL CScriptedSentence::AcceptableSpeaker( CBaseMonster *pMonster ) { if( pev->spawnflags & SF_SENTENCE_FOLLOWERS ) { - if( pMonster->m_hTargetEnt == 0 || !FClassnameIs( pMonster->m_hTargetEnt->pev, "player" ) ) + if( pMonster->m_hTargetEnt == 0 || !pMonster->m_hTargetEnt->IsPlayer() ) return FALSE; } + BOOL override; + if( pev->spawnflags & SF_SENTENCE_INTERRUPT ) override = TRUE; else override = FALSE; + if( pMonster->CanPlaySentence( override ) ) return TRUE; } @@ -1143,7 +1146,7 @@ BOOL CScriptedSentence::StartSentence( CBaseMonster *pTarget ) } pTarget->PlayScriptedSentence( STRING( m_iszSentence ), m_flDuration, m_flVolume, m_flAttenuation, bConcurrent, pListener ); - ALERT( at_aiconsole, "Playing sentence %s (%.1f)\n", STRING( m_iszSentence ), m_flDuration ); + ALERT( at_aiconsole, "Playing sentence %s (%.1f)\n", STRING( m_iszSentence ), (double)m_flDuration ); SUB_UseTargets( NULL, USE_TOGGLE, 0 ); return TRUE; } @@ -1189,7 +1192,7 @@ void CFurniture::Spawn() pev->sequence = 0; pev->frame = 0; - //pev->nextthink += 1.0; + //pev->nextthink += 1.0f; //SetThink( &WalkMonsterDelay ); ResetSequenceInfo(); diff --git a/dlls/shotgun.cpp b/dlls/shotgun.cpp index 03944087..90ec7e8c 100644 --- a/dlls/shotgun.cpp +++ b/dlls/shotgun.cpp @@ -119,7 +119,7 @@ void CShotgun::PrimaryAttack() if( m_pPlayer->pev->waterlevel == 3 ) { PlayEmptySound(); - m_flNextPrimaryAttack = GetNextAttackDelay( 0.15 ); + m_flNextPrimaryAttack = GetNextAttackDelay( 0.15f ); return; } @@ -173,14 +173,14 @@ void CShotgun::PrimaryAttack() m_pPlayer->SetSuitUpdate( "!HEV_AMO0", FALSE, 0 ); //if( m_iClip != 0 ) - m_flPumpTime = gpGlobals->time + 0.5; + m_flPumpTime = gpGlobals->time + 0.5f; - m_flNextPrimaryAttack = GetNextAttackDelay( 0.75 ); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.75; + m_flNextPrimaryAttack = GetNextAttackDelay( 0.75f ); + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.75f; if( m_iClip != 0 ) - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 5.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 5.0f; else - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.75; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.75f; m_fInSpecialReload = 0; } @@ -190,7 +190,7 @@ void CShotgun::SecondaryAttack( void ) if( m_pPlayer->pev->waterlevel == 3 ) { PlayEmptySound(); - m_flNextPrimaryAttack = GetNextAttackDelay( 0.15 ); + m_flNextPrimaryAttack = GetNextAttackDelay( 0.15f ); return; } @@ -237,19 +237,19 @@ void CShotgun::SecondaryAttack( void ) vecDir = m_pPlayer->FireBulletsPlayer( 12, vecSrc, vecAiming, VECTOR_CONE_10DEGREES, 2048, BULLET_PLAYER_BUCKSHOT, 0, 0, m_pPlayer->pev, m_pPlayer->random_seed ); } - PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usDoubleFire, 0.0, g_vecZero, g_vecZero, vecDir.x, vecDir.y, 0, 0, 0, 0 ); + PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usDoubleFire, 0.0f, g_vecZero, g_vecZero, vecDir.x, vecDir.y, 0, 0, 0, 0 ); if( !m_iClip && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 ) // HEV suit - indicate out of ammo condition m_pPlayer->SetSuitUpdate( "!HEV_AMO0", FALSE, 0 ); //if( m_iClip != 0 ) - m_flPumpTime = gpGlobals->time + 0.95; + m_flPumpTime = gpGlobals->time + 0.95f; - m_flNextPrimaryAttack = GetNextAttackDelay( 1.5 ); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.5; + m_flNextPrimaryAttack = GetNextAttackDelay( 1.5f ); + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.5f; if( m_iClip != 0 ) - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 6.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 6.0f; else m_flTimeWeaponIdle = 1.5; @@ -270,10 +270,10 @@ void CShotgun::Reload( void ) { SendWeaponAnim( SHOTGUN_START_RELOAD ); m_fInSpecialReload = 1; - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.6; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.6; - m_flNextPrimaryAttack = GetNextAttackDelay( 1.0 ); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.6f; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.6f; + m_flNextPrimaryAttack = GetNextAttackDelay( 1.0f ); + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0f; return; } else if( m_fInSpecialReload == 1 ) @@ -290,8 +290,8 @@ void CShotgun::Reload( void ) SendWeaponAnim( SHOTGUN_RELOAD ); - m_flNextReload = UTIL_WeaponTimeBase() + 0.5; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5; + m_flNextReload = UTIL_WeaponTimeBase() + 0.5f; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5f; } else { @@ -338,27 +338,27 @@ void CShotgun::WeaponIdle( void ) // play cocking sound EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/scock1.wav", 1, ATTN_NORM, 0, 95 + RANDOM_LONG( 0, 0x1f ) ); m_fInSpecialReload = 0; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.5; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.5f; } } else { int iAnim; float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 ); - if( flRand <= 0.8 ) + if( flRand <= 0.8f ) { iAnim = SHOTGUN_IDLE_DEEP; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 60.0 / 12.0 );// * RANDOM_LONG( 2, 5 ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 60.0f / 12.0f );// * RANDOM_LONG( 2, 5 ); } - else if( flRand <= 0.95 ) + else if( flRand <= 0.95f ) { iAnim = SHOTGUN_IDLE; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 20.0 / 9.0 ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 20.0f / 9.0f ); } else { iAnim = SHOTGUN_IDLE4; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 20.0 / 9.0 ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + ( 20.0f / 9.0f ); } SendWeaponAnim( iAnim ); } diff --git a/dlls/singleplay_gamerules.cpp b/dlls/singleplay_gamerules.cpp index 9a46e722..7f722e30 100644 --- a/dlls/singleplay_gamerules.cpp +++ b/dlls/singleplay_gamerules.cpp @@ -75,6 +75,11 @@ BOOL CHalfLifeRules::FShouldSwitchWeapon( CBasePlayer *pPlayer, CBasePlayerItem return TRUE; } + if( !pPlayer->m_iAutoWepSwitch ) + { + return FALSE; + } + if( !pPlayer->m_pActiveItem->CanHolster() ) { return FALSE; diff --git a/dlls/sound.cpp b/dlls/sound.cpp index 6637fe53..688b4016 100644 --- a/dlls/sound.cpp +++ b/dlls/sound.cpp @@ -184,10 +184,10 @@ void CAmbientGeneric::Spawn( void ) const char *szSoundFile = STRING( pev->message ); - if( FStringNull( pev->message ) || strlen( szSoundFile ) < 1 ) + if( FStringNull( pev->message ) || szSoundFile[0] == '\0' ) { - ALERT( at_error, "EMPTY AMBIENT AT: %f, %f, %f\n", pev->origin.x, pev->origin.y, pev->origin.z ); - pev->nextthink = gpGlobals->time + 0.1; + ALERT( at_error, "EMPTY AMBIENT AT: %f, %f, %f\n", (double)pev->origin.x, (double)pev->origin.y, (double)pev->origin.z ); + pev->nextthink = gpGlobals->time + 0.1f; SetThink( &CBaseEntity::SUB_Remove ); return; } @@ -199,7 +199,7 @@ void CAmbientGeneric::Spawn( void ) // start thinking yet. SetThink( &CAmbientGeneric::RampThink ); - pev->nextthink = 0; + pev->nextthink = 0.0f; // allow on/off switching via 'use' function. @@ -218,7 +218,7 @@ void CAmbientGeneric::Precache( void ) { const char *szSoundFile = STRING( pev->message ); - if( !FStringNull( pev->message ) && strlen( szSoundFile ) > 1 ) + if( !FStringNull( pev->message ) && szSoundFile[0] != '\0' ) { if( *szSoundFile != '!' ) PRECACHE_SOUND( szSoundFile ); @@ -236,9 +236,9 @@ void CAmbientGeneric::Precache( void ) if( m_fActive ) { UTIL_EmitAmbientSound( ENT( pev ), pev->origin, szSoundFile, - ( m_dpv.vol * 0.01 ), m_flAttenuation, SND_SPAWNING, m_dpv.pitch ); + ( m_dpv.vol * 0.01f ), m_flAttenuation, SND_SPAWNING, m_dpv.pitch ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } } @@ -280,7 +280,7 @@ void CAmbientGeneric::RampThink( void ) if( pitch < m_dpv.pitchstart ) { - pitch = m_dpv.pitchstart; + // pitch = m_dpv.pitchstart; m_dpv.spindown = 0; // done with ramp down // shut sound off @@ -324,7 +324,7 @@ void CAmbientGeneric::RampThink( void ) if( vol < m_dpv.volstart ) { - vol = m_dpv.volstart; + // vol = m_dpv.volstart; m_dpv.fadeout = 0; // done with ramp down // shut sound off @@ -433,11 +433,11 @@ void CAmbientGeneric::RampThink( void ) pitch = PITCH_NORM + 1; // don't send 'no pitch' ! UTIL_EmitAmbientSound( ENT( pev ), pev->origin, szSoundFile, - ( vol * 0.01 ), m_flAttenuation, flags, pitch ); + ( vol * 0.01f ), m_flAttenuation, flags, pitch ); } // update ramps at 5hz - pev->nextthink = gpGlobals->time + 0.2; + pev->nextthink = gpGlobals->time + 0.2f; return; } @@ -548,12 +548,12 @@ void CAmbientGeneric::ToggleUse( CBaseEntity *pActivator, CBaseEntity *pCaller, fraction = value; - if( fraction > 1.0 ) - fraction = 1.0; - if( fraction < 0.0 ) - fraction = 0.01; + if( fraction > 1.0f ) + fraction = 1.0f; + if( fraction < 0.0f ) + fraction = 0.01f; - m_dpv.pitch = (int)( fraction * 255 ); + m_dpv.pitch = (int)( fraction * 255.0f ); UTIL_EmitAmbientSound( ENT( pev ), pev->origin, szSoundFile, 0, 0, SND_CHANGE_PITCH, m_dpv.pitch ); return; @@ -584,7 +584,7 @@ void CAmbientGeneric::ToggleUse( CBaseEntity *pActivator, CBaseEntity *pCaller, if( m_dpv.pitchrun > 255 ) m_dpv.pitchrun = 255; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } } else @@ -602,7 +602,7 @@ void CAmbientGeneric::ToggleUse( CBaseEntity *pActivator, CBaseEntity *pCaller, m_dpv.fadeout = m_dpv.fadeoutsav; m_dpv.fadein = 0; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } else UTIL_EmitAmbientSound( ENT( pev ), pev->origin, szSoundFile, 0, 0, SND_STOP, 0 ); @@ -625,9 +625,9 @@ void CAmbientGeneric::ToggleUse( CBaseEntity *pActivator, CBaseEntity *pCaller, // init all ramp params for startup InitModulationParms(); - UTIL_EmitAmbientSound( ENT( pev ), pev->origin, szSoundFile, ( m_dpv.vol * 0.01 ), m_flAttenuation, 0, m_dpv.pitch ); + UTIL_EmitAmbientSound( ENT( pev ), pev->origin, szSoundFile, ( m_dpv.vol * 0.01f ), m_flAttenuation, 0, m_dpv.pitch ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } } @@ -962,10 +962,10 @@ void CEnvSound::Think( void ) // not in range. do nothing, fall through to think_fast... env_sound_Think_fast: - pev->nextthink = gpGlobals->time + 0.25; + pev->nextthink = gpGlobals->time + 0.25f; return; env_sound_Think_slow: - pev->nextthink = gpGlobals->time + 0.75; + pev->nextthink = gpGlobals->time + 0.75f; return; } @@ -977,7 +977,7 @@ env_sound_Think_slow: void CEnvSound::Spawn() { // spread think times - pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 0.0, 0.5 ); + pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 0.0f, 0.5f ); } // ==================== SENTENCE GROUPS, UTILITY FUNCTIONS ====================================== @@ -1281,9 +1281,9 @@ void SENTENCEG_Init() if( !buffer[j] ) continue; - if( gcallsentences > CVOXFILESENTENCEMAX ) + if( gcallsentences >= CVOXFILESENTENCEMAX ) { - ALERT( at_error, "Too many sentences in sentences.txt!\n" ); + ALERT( at_error, "Too many sentences in sentences.txt! >%d\n", gcallsentences ); break; } @@ -1400,7 +1400,7 @@ void EMIT_SOUND_SUIT( edict_t *entity, const char *sample ) if( RANDOM_LONG( 0, 1 ) ) pitch = RANDOM_LONG( 0, 6 ) + 98; - if( fvol > 0.05 ) + if( fvol > 0.05f ) EMIT_SOUND_DYN( entity, CHAN_STATIC, sample, fvol, ATTN_NORM, 0, pitch ); } @@ -1415,7 +1415,7 @@ void EMIT_GROUPID_SUIT( edict_t *entity, int isentenceg ) if( RANDOM_LONG( 0, 1 ) ) pitch = RANDOM_LONG( 0, 6 ) + 98; - if( fvol > 0.05 ) + if( fvol > 0.05f ) SENTENCEG_PlayRndI( entity, isentenceg, fvol, ATTN_NORM, 0, pitch ); } @@ -1430,7 +1430,7 @@ void EMIT_GROUPNAME_SUIT( edict_t *entity, const char *groupname ) if( RANDOM_LONG( 0, 1 ) ) pitch = RANDOM_LONG( 0, 6 ) + 98; - if( fvol > 0.05 ) + if( fvol > 0.05f ) SENTENCEG_PlayRndSz( entity, groupname, fvol, ATTN_NORM, 0, pitch ); } @@ -1523,7 +1523,7 @@ float TEXTURETYPE_PlaySound( TraceResult *ptr, Vector vecSrc, Vector vecEnd, in float fattn = ATTN_NORM; if( !g_pGameRules->PlayTextureSounds() ) - return 0.0; + return 0.0f; CBaseEntity *pEntity = CBaseEntity::Instance( ptr->pHit ); @@ -1572,44 +1572,44 @@ float TEXTURETYPE_PlaySound( TraceResult *ptr, Vector vecSrc, Vector vecEnd, in { default: case CHAR_TEX_CONCRETE: - fvol = 0.9; - fvolbar = 0.6; + fvol = 0.9f; + fvolbar = 0.6f; rgsz[0] = "player/pl_step1.wav"; rgsz[1] = "player/pl_step2.wav"; cnt = 2; break; case CHAR_TEX_METAL: - fvol = 0.9; - fvolbar = 0.3; + fvol = 0.9f; + fvolbar = 0.3f; rgsz[0] = "player/pl_metal1.wav"; rgsz[1] = "player/pl_metal2.wav"; cnt = 2; break; case CHAR_TEX_DIRT: - fvol = 0.9; - fvolbar = 0.1; + fvol = 0.9f; + fvolbar = 0.1f; rgsz[0] = "player/pl_dirt1.wav"; rgsz[1] = "player/pl_dirt2.wav"; rgsz[2] = "player/pl_dirt3.wav"; cnt = 3; break; case CHAR_TEX_VENT: - fvol = 0.5; - fvolbar = 0.3; + fvol = 0.5f; + fvolbar = 0.3f; rgsz[0] = "player/pl_duct1.wav"; rgsz[1] = "player/pl_duct1.wav"; cnt = 2; break; case CHAR_TEX_GRATE: - fvol = 0.9; - fvolbar = 0.5; + fvol = 0.9f; + fvolbar = 0.5f; rgsz[0] = "player/pl_grate1.wav"; rgsz[1] = "player/pl_grate4.wav"; cnt = 2; break; case CHAR_TEX_TILE: - fvol = 0.8; - fvolbar = 0.2; + fvol = 0.8f; + fvolbar = 0.2f; rgsz[0] = "player/pl_tile1.wav"; rgsz[1] = "player/pl_tile3.wav"; rgsz[2] = "player/pl_tile2.wav"; @@ -1617,8 +1617,8 @@ float TEXTURETYPE_PlaySound( TraceResult *ptr, Vector vecSrc, Vector vecEnd, in cnt = 4; break; case CHAR_TEX_SLOSH: - fvol = 0.9; - fvolbar = 0.0; + fvol = 0.9f; + fvolbar = 0.0f; rgsz[0] = "player/pl_slosh1.wav"; rgsz[1] = "player/pl_slosh3.wav"; rgsz[2] = "player/pl_slosh2.wav"; @@ -1626,8 +1626,8 @@ float TEXTURETYPE_PlaySound( TraceResult *ptr, Vector vecSrc, Vector vecEnd, in cnt = 4; break; case CHAR_TEX_WOOD: - fvol = 0.9; - fvolbar = 0.2; + fvol = 0.9f; + fvolbar = 0.2f; rgsz[0] = "debris/wood1.wav"; rgsz[1] = "debris/wood2.wav"; rgsz[2] = "debris/wood3.wav"; @@ -1635,8 +1635,8 @@ float TEXTURETYPE_PlaySound( TraceResult *ptr, Vector vecSrc, Vector vecEnd, in break; case CHAR_TEX_GLASS: case CHAR_TEX_COMPUTER: - fvol = 0.8; - fvolbar = 0.2; + fvol = 0.8f; + fvolbar = 0.2f; rgsz[0] = "debris/glass1.wav"; rgsz[1] = "debris/glass2.wav"; rgsz[2] = "debris/glass3.wav"; @@ -1644,12 +1644,12 @@ float TEXTURETYPE_PlaySound( TraceResult *ptr, Vector vecSrc, Vector vecEnd, in break; case CHAR_TEX_FLESH: if( iBulletType == BULLET_PLAYER_CROWBAR ) - return 0.0; // crowbar already makes this sound - fvol = 1.0; - fvolbar = 0.2; + return 0.0f; // crowbar already makes this sound + fvol = 1.0f; + fvolbar = 0.2f; rgsz[0] = "weapons/bullet_hit1.wav"; rgsz[1] = "weapons/bullet_hit2.wav"; - fattn = 1.0; + fattn = 1.0f; cnt = 2; break; } @@ -1658,17 +1658,17 @@ float TEXTURETYPE_PlaySound( TraceResult *ptr, Vector vecSrc, Vector vecEnd, in if( pEntity && FClassnameIs( pEntity->pev, "func_breakable" ) ) { // drop volumes, the object will already play a damaged sound - fvol /= 1.5; - fvolbar /= 2.0; + fvol /= 1.5f; + fvolbar /= 2.0f; } else if( chTextureType == CHAR_TEX_COMPUTER ) { // play random spark if computer - if( ptr->flFraction != 1.0 && RANDOM_LONG( 0, 1 ) ) + if( ptr->flFraction != 1.0f && RANDOM_LONG( 0, 1 ) ) { UTIL_Sparks( ptr->vecEndPos ); - float flVolume = RANDOM_FLOAT( 0.7, 1.0 );//random volume range + float flVolume = RANDOM_FLOAT( 0.7f, 1.0f );//random volume range switch( RANDOM_LONG( 0, 1 ) ) { case 0: @@ -1732,10 +1732,10 @@ void CSpeaker::Spawn( void ) { const char *szSoundFile = STRING( pev->message ); - if( !m_preset && ( FStringNull( pev->message ) || strlen( szSoundFile ) < 1 ) ) + if( !m_preset && ( FStringNull( pev->message ) || szSoundFile[0] == '\0' ) ) { - ALERT( at_error, "SPEAKER with no Level/Sentence! at: %f, %f, %f\n", pev->origin.x, pev->origin.y, pev->origin.z ); - pev->nextthink = gpGlobals->time + 0.1; + ALERT( at_error, "SPEAKER with no Level/Sentence! at: %f, %f, %f\n", (double)pev->origin.x, (double)pev->origin.y, (double)pev->origin.z ); + pev->nextthink = gpGlobals->time + 0.1f; SetThink( &CBaseEntity::SUB_Remove ); return; } @@ -1743,7 +1743,7 @@ void CSpeaker::Spawn( void ) pev->movetype = MOVETYPE_NONE; SetThink( &CSpeaker::SpeakerThink ); - pev->nextthink = 0.0; + pev->nextthink = 0.0f; // allow on/off switching via 'use' function. SetUse( &CSpeaker::ToggleUse ); @@ -1751,27 +1751,27 @@ void CSpeaker::Spawn( void ) Precache(); } -#define ANNOUNCE_MINUTES_MIN 0.25 -#define ANNOUNCE_MINUTES_MAX 2.25 +#define ANNOUNCE_MINUTES_MIN 0.25f +#define ANNOUNCE_MINUTES_MAX 2.25f void CSpeaker::Precache( void ) { if( !FBitSet( pev->spawnflags, SPEAKER_START_SILENT ) ) // set first announcement time for random n second - pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 5.0, 15.0 ); + pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 5.0f, 15.0f ); } void CSpeaker::SpeakerThink( void ) { - const char* szSoundFile = NULL; - float flvolume = pev->health * 0.1; - float flattenuation = 0.3; + const char* szSoundFile = ""; + float flvolume = pev->health * 0.1f; + float flattenuation = 0.3f; int flags = 0; int pitch = 100; // Wait for the talkmonster to finish first. if( gpGlobals->time <= CTalkMonster::g_talkWaitTime ) { - pev->nextthink = CTalkMonster::g_talkWaitTime + RANDOM_FLOAT( 5, 10 ); + pev->nextthink = CTalkMonster::g_talkWaitTime + RANDOM_FLOAT( 5.0f, 10.0f ); return; } @@ -1828,7 +1828,7 @@ void CSpeaker::SpeakerThink( void ) flvolume, flattenuation, flags, pitch ); // shut off and reset - pev->nextthink = 0.0; + pev->nextthink = 0.0f; } else { @@ -1837,9 +1837,9 @@ void CSpeaker::SpeakerThink( void ) ALERT( at_console, "Level Design Error!\nSPEAKER has bad sentence group name: %s\n",szSoundFile ); // set next announcement time for random 5 to 10 minute delay - pev->nextthink = gpGlobals->time + RANDOM_FLOAT( ANNOUNCE_MINUTES_MIN * 60.0, ANNOUNCE_MINUTES_MAX * 60.0 ); + pev->nextthink = gpGlobals->time + RANDOM_FLOAT( ANNOUNCE_MINUTES_MIN * 60.0f, ANNOUNCE_MINUTES_MAX * 60.0f ); - CTalkMonster::g_talkWaitTime = gpGlobals->time + 5; // time delay until it's ok to speak: used so that two NPCs don't talk at once + CTalkMonster::g_talkWaitTime = gpGlobals->time + 5.0f; // time delay until it's ok to speak: used so that two NPCs don't talk at once } return; @@ -1850,7 +1850,7 @@ void CSpeaker::SpeakerThink( void ) // void CSpeaker::ToggleUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) { - int fActive = ( pev->nextthink > 0.0 ); + int fActive = ( pev->nextthink > 0.0f ); // fActive is TRUE only if an announcement is pending @@ -1865,14 +1865,14 @@ void CSpeaker::ToggleUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP if( useType == USE_ON ) { // turn on announcements - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; return; } if( useType == USE_OFF ) { // turn off announcements - pev->nextthink = 0.0; + pev->nextthink = 0.0f; return; } @@ -1880,12 +1880,12 @@ void CSpeaker::ToggleUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP if( fActive ) { // turn off announcements - pev->nextthink = 0.0; + pev->nextthink = 0.0f; } else { // turn on announcements - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } } diff --git a/dlls/soundent.cpp b/dlls/soundent.cpp index 08000f28..7d9583f0 100644 --- a/dlls/soundent.cpp +++ b/dlls/soundent.cpp @@ -82,7 +82,7 @@ void CSoundEnt::Spawn( void ) pev->solid = SOLID_NOT; Initialize(); - pev->nextthink = gpGlobals->time + 1; + pev->nextthink = gpGlobals->time + 1.0f; } //========================================================= @@ -95,7 +95,7 @@ void CSoundEnt::Think( void ) int iSound; int iPreviousSound; - pev->nextthink = gpGlobals->time + 0.3;// how often to check the sound list. + pev->nextthink = gpGlobals->time + 0.3f;// how often to check the sound list. iPreviousSound = SOUNDLIST_EMPTY; iSound = m_iActiveSound; diff --git a/dlls/squadmonster.cpp b/dlls/squadmonster.cpp index 3d476b50..cbf3f19f 100644 --- a/dlls/squadmonster.cpp +++ b/dlls/squadmonster.cpp @@ -355,7 +355,7 @@ int CSquadMonster::SquadRecruit( int searchRadius, int maxMembers ) { TraceResult tr; UTIL_TraceLine( pev->origin + pev->view_ofs, pRecruit->pev->origin + pev->view_ofs, ignore_monsters, pRecruit->edict(), &tr );// try to hit recruit with a traceline. - if( tr.flFraction == 1.0 ) + if( tr.flFraction == 1.0f ) { if( !SquadAdd( pRecruit ) ) break; @@ -457,6 +457,7 @@ BOOL CSquadMonster::NoFriendlyFire( void ) Vector vecLeftSide; Vector vecRightSide; Vector v_left; + Vector v_dir; //!!!BUGBUG - to fix this, the planes must be aligned to where the monster will be firing its gun, not the direction it is facing!!! if( m_hEnemy != 0 ) @@ -471,9 +472,13 @@ BOOL CSquadMonster::NoFriendlyFire( void ) //UTIL_MakeVectors( pev->angles ); - vecLeftSide = pev->origin - ( gpGlobals->v_right * ( pev->size.x * 1.5 ) ); - vecRightSide = pev->origin + ( gpGlobals->v_right * ( pev->size.x * 1.5 ) ); - v_left = gpGlobals->v_right * -1; + // vecLeftSide = pev->origin - ( gpGlobals->v_right * ( pev->size.x * 1.5f ) ); + // vecRightSide = pev->origin + ( gpGlobals->v_right * ( pev->size.x * 1.5f ) ); + v_dir = gpGlobals->v_right * ( pev->size.x * 1.5f ); + vecLeftSide = pev->origin - v_dir; + vecRightSide = pev->origin + v_dir; + + v_left = gpGlobals->v_right * -1.0f; leftPlane.InitializePlane( gpGlobals->v_right, vecLeftSide ); rightPlane.InitializePlane( v_left, vecRightSide ); diff --git a/dlls/squeakgrenade.cpp b/dlls/squeakgrenade.cpp index a7295599..7e8a9d92 100644 --- a/dlls/squeakgrenade.cpp +++ b/dlls/squeakgrenade.cpp @@ -87,7 +87,7 @@ TYPEDESCRIPTION CSqueakGrenade::m_SaveData[] = IMPLEMENT_SAVERESTORE( CSqueakGrenade, CGrenade ) -#define SQUEEK_DETONATE_DELAY 15.0 +#define SQUEEK_DETONATE_DELAY 15.0f int CSqueakGrenade::Classify( void ) { @@ -120,25 +120,25 @@ void CSqueakGrenade::Spawn( void ) pev->solid = SOLID_BBOX; SET_MODEL( ENT( pev ), "models/w_squeak.mdl" ); - UTIL_SetSize( pev, Vector( -4, -4, 0 ), Vector( 4, 4, 8 ) ); + UTIL_SetSize( pev, Vector( -4.0f, -4.0f, 0.0f ), Vector( 4.0f, 4.0f, 8.0f ) ); UTIL_SetOrigin( pev, pev->origin ); SetTouch( &CSqueakGrenade::SuperBounceTouch ); SetThink( &CSqueakGrenade::HuntThink ); - pev->nextthink = gpGlobals->time + 0.1; - m_flNextHunt = gpGlobals->time + 1E6; + pev->nextthink = gpGlobals->time + 0.1f; + m_flNextHunt = gpGlobals->time + (float)1E6; pev->flags |= FL_MONSTER; pev->takedamage = DAMAGE_AIM; pev->health = gSkillData.snarkHealth; - pev->gravity = 0.5; - pev->friction = 0.5; + pev->gravity = 0.5f; + pev->friction = 0.5f; pev->dmg = gSkillData.snarkDmgPop; m_flDie = gpGlobals->time + SQUEEK_DETONATE_DELAY; - m_flFieldOfView = 0; // 180 degrees + m_flFieldOfView = 0.0f; // 180 degrees if( pev->owner ) m_hOwner = Instance( pev->owner ); @@ -166,7 +166,7 @@ void CSqueakGrenade::Killed( entvars_t *pevAttacker, int iGib ) pev->model = iStringNull;// make invisible SetThink( &CBaseEntity::SUB_Remove ); SetTouch( NULL ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; // since squeak grenades never leave a body behind, clear out their takedamage now. // Squeaks do a bit of radius damage when they pop, and that radius damage will @@ -174,9 +174,9 @@ void CSqueakGrenade::Killed( entvars_t *pevAttacker, int iGib ) pev->takedamage = DAMAGE_NO; // play squeek blast - EMIT_SOUND_DYN( ENT( pev ), CHAN_ITEM, "squeek/sqk_blast1.wav", 1, 0.5, 0, PITCH_NORM ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_ITEM, "squeek/sqk_blast1.wav", 1, 0.5f, 0, PITCH_NORM ); - CSoundEnt::InsertSound( bits_SOUND_COMBAT, pev->origin, SMALL_EXPLOSION_VOLUME, 3.0 ); + CSoundEnt::InsertSound( bits_SOUND_COMBAT, pev->origin, SMALL_EXPLOSION_VOLUME, 3.0f ); UTIL_BloodDrips( pev->origin, g_vecZero, BloodColor(), 80 ); @@ -194,7 +194,7 @@ void CSqueakGrenade::Killed( entvars_t *pevAttacker, int iGib ) void CSqueakGrenade::GibMonster( void ) { - EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "common/bodysplat.wav", 0.75, ATTN_NORM, 0, 200 ); + EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "common/bodysplat.wav", 0.75f, ATTN_NORM, 0, 200 ); } void CSqueakGrenade::HuntThink( void ) @@ -209,7 +209,7 @@ void CSqueakGrenade::HuntThink( void ) } StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; // explode when ready if( gpGlobals->time >= m_flDie ) @@ -227,8 +227,8 @@ void CSqueakGrenade::HuntThink( void ) { pev->movetype = MOVETYPE_FLY; } - pev->velocity = pev->velocity * 0.9; - pev->velocity.z += 8.0; + pev->velocity = pev->velocity * 0.9f; + pev->velocity.z += 8.0f; } else if( pev->movetype == MOVETYPE_FLY ) { @@ -239,7 +239,7 @@ void CSqueakGrenade::HuntThink( void ) if( m_flNextHunt > gpGlobals->time ) return; - m_flNextHunt = gpGlobals->time + 2.0; + m_flNextHunt = gpGlobals->time + 2.0f; //CBaseEntity *pOther = NULL; Vector vecDir; @@ -259,16 +259,16 @@ void CSqueakGrenade::HuntThink( void ) } // squeek if it's about time blow up - if( ( m_flDie - gpGlobals->time <= 0.5 ) && ( m_flDie - gpGlobals->time >= 0.3 ) ) + if( ( m_flDie - gpGlobals->time <= 0.5f ) && ( m_flDie - gpGlobals->time >= 0.3f ) ) { EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "squeek/sqk_die1.wav", 1, ATTN_NORM, 0, 100 + RANDOM_LONG( 0, 0x3F ) ); - CSoundEnt::InsertSound( bits_SOUND_COMBAT, pev->origin, 256, 0.25 ); + CSoundEnt::InsertSound( bits_SOUND_COMBAT, pev->origin, 256, 0.25f ); } // higher pitch as squeeker gets closer to detonation time - float flpitch = 155.0 - 60.0 * ( ( m_flDie - gpGlobals->time ) / SQUEEK_DETONATE_DELAY ); - if( flpitch < 80 ) - flpitch = 80; + /*float flpitch = 155.0f - 60.0f * ( ( m_flDie - gpGlobals->time ) / SQUEEK_DETONATE_DELAY ); + if( flpitch < 80.0f ) + flpitch = 80.0f;*/ if( m_hEnemy != 0 ) { @@ -279,16 +279,16 @@ void CSqueakGrenade::HuntThink( void ) } float flVel = pev->velocity.Length(); - float flAdj = 50.0 / ( flVel + 10.0 ); + float flAdj = 50.0f / ( flVel + 10.0f ); - if( flAdj > 1.2 ) - flAdj = 1.2; + if( flAdj > 1.2f ) + flAdj = 1.2f; // ALERT( at_console, "think : enemy\n"); // ALERT( at_console, "%.0f %.2f %.2f %.2f\n", flVel, m_vecTarget.x, m_vecTarget.y, m_vecTarget.z ); - pev->velocity = pev->velocity * flAdj + m_vecTarget * 300; + pev->velocity = pev->velocity * flAdj + m_vecTarget * 300.0f; } if( pev->flags & FL_ONGROUND ) @@ -304,7 +304,7 @@ void CSqueakGrenade::HuntThink( void ) } } - if( ( pev->origin - m_posPrev ).Length() < 1.0 ) + if( ( pev->origin - m_posPrev ).Length() < 1.0f ) { pev->velocity.x = RANDOM_FLOAT( -100, 100 ); pev->velocity.y = RANDOM_FLOAT( -100, 100 ); @@ -329,15 +329,15 @@ void CSqueakGrenade::SuperBounceTouch( CBaseEntity *pOther ) // at least until we've bounced once pev->owner = NULL; - pev->angles.x = 0; - pev->angles.z = 0; + pev->angles.x = 0.0f; + pev->angles.z = 0.0f; // avoid bouncing too much if( m_flNextHit > gpGlobals->time ) return; // higher pitch as squeeker gets closer to detonation time - flpitch = 155.0 - 60.0 * ( ( m_flDie - gpGlobals->time ) / SQUEEK_DETONATE_DELAY ); + flpitch = 155.0f - 60.0f * ( ( m_flDie - gpGlobals->time ) / SQUEEK_DETONATE_DELAY ); if( pOther->pev->takedamage && m_flNextAttack < gpGlobals->time ) { @@ -358,11 +358,11 @@ void CSqueakGrenade::SuperBounceTouch( CBaseEntity *pOther ) ApplyMultiDamage( pev, pev ); pev->dmg += gSkillData.snarkDmgPop; // add more explosion damage - // m_flDie += 2.0; // add more life + // m_flDie += 2.0f; // add more life // make bite sound - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, "squeek/sqk_deploy1.wav", 1.0, ATTN_NORM, 0, (int)flpitch ); - m_flNextAttack = gpGlobals->time + 0.5; + EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, "squeek/sqk_deploy1.wav", 1.0f, ATTN_NORM, 0, (int)flpitch ); + m_flNextAttack = gpGlobals->time + 0.5f; } } else @@ -371,7 +371,7 @@ void CSqueakGrenade::SuperBounceTouch( CBaseEntity *pOther ) } } - m_flNextHit = gpGlobals->time + 0.1; + m_flNextHit = gpGlobals->time + 0.1f; m_flNextHunt = gpGlobals->time; if( g_pGameRules->IsMultiplayer() ) @@ -387,23 +387,23 @@ void CSqueakGrenade::SuperBounceTouch( CBaseEntity *pOther ) if( !( pev->flags & FL_ONGROUND ) ) { // play bounce sound - float flRndSound = RANDOM_FLOAT( 0, 1 ); + float flRndSound = RANDOM_FLOAT( 0.0f, 1.0f ); - if( flRndSound <= 0.33 ) + if( flRndSound <= 0.33f ) EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "squeek/sqk_hunt1.wav", 1, ATTN_NORM, 0, (int)flpitch ); - else if( flRndSound <= 0.66 ) + else if( flRndSound <= 0.66f ) EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "squeek/sqk_hunt2.wav", 1, ATTN_NORM, 0, (int)flpitch ); else EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "squeek/sqk_hunt3.wav", 1, ATTN_NORM, 0, (int)flpitch ); - CSoundEnt::InsertSound( bits_SOUND_COMBAT, pev->origin, 256, 0.25 ); + CSoundEnt::InsertSound( bits_SOUND_COMBAT, pev->origin, 256, 0.25f ); } else { // skittering sound - CSoundEnt::InsertSound( bits_SOUND_COMBAT, pev->origin, 100, 0.1 ); + CSoundEnt::InsertSound( bits_SOUND_COMBAT, pev->origin, 100, 0.1f ); } - m_flNextBounceSoundTime = gpGlobals->time + 0.5;// half second. + m_flNextBounceSoundTime = gpGlobals->time + 0.5f;// half second. } #endif @@ -421,7 +421,7 @@ void CSqueak::Spawn() pev->sequence = 1; pev->animtime = gpGlobals->time; - pev->framerate = 1.0; + pev->framerate = 1.0f; } void CSqueak::Precache( void ) @@ -456,9 +456,9 @@ int CSqueak::GetItemInfo( ItemInfo *p ) BOOL CSqueak::Deploy() { // play hunt sound - float flRndSound = RANDOM_FLOAT( 0, 1 ); + float flRndSound = RANDOM_FLOAT( 0.0f, 1.0f ); - if( flRndSound <= 0.5 ) + if( flRndSound <= 0.5f ) EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "squeek/sqk_hunt2.wav", 1, ATTN_NORM, 0, 100 ); else EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "squeek/sqk_hunt3.wav", 1, ATTN_NORM, 0, 100 ); @@ -470,7 +470,7 @@ BOOL CSqueak::Deploy() void CSqueak::Holster( int skiplocal /* = 0 */ ) { - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; if( !m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] ) { @@ -480,7 +480,7 @@ void CSqueak::Holster( int skiplocal /* = 0 */ ) } SendWeaponAnim( SQUEAK_DOWN ); - EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "common/null.wav", 1.0, ATTN_NORM ); + EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "common/null.wav", 1.0f, ATTN_NORM ); } void CSqueak::PrimaryAttack() @@ -500,7 +500,7 @@ void CSqueak::PrimaryAttack() } // find place to toss monster - UTIL_TraceLine( trace_origin + gpGlobals->v_forward * 20, trace_origin + gpGlobals->v_forward * 64, dont_ignore_monsters, NULL, &tr ); + UTIL_TraceLine( trace_origin + gpGlobals->v_forward * 20.0f, trace_origin + gpGlobals->v_forward * 64.0f, dont_ignore_monsters, NULL, &tr ); int flags; #ifdef CLIENT_WEAPONS @@ -508,20 +508,20 @@ void CSqueak::PrimaryAttack() #else flags = 0; #endif - PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usSnarkFire, 0.0, g_vecZero, g_vecZero, 0.0, 0.0, 0, 0, 0, 0 ); + PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usSnarkFire, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, 0, 0, 0, 0 ); - if( tr.fAllSolid == 0 && tr.fStartSolid == 0 && tr.flFraction > 0.25 ) + if( tr.fAllSolid == 0 && tr.fStartSolid == 0 && tr.flFraction > 0.25f ) { // player "shoot" animation m_pPlayer->SetAnimation( PLAYER_ATTACK1 ); #ifndef CLIENT_DLL CBaseEntity *pSqueak = CBaseEntity::Create( "monster_snark", tr.vecEndPos, m_pPlayer->pev->v_angle, m_pPlayer->edict() ); - pSqueak->pev->velocity = gpGlobals->v_forward * 200 + m_pPlayer->pev->velocity; + pSqueak->pev->velocity = gpGlobals->v_forward * 200.0f + m_pPlayer->pev->velocity; #endif // play hunt sound - float flRndSound = RANDOM_FLOAT( 0, 1 ); + float flRndSound = RANDOM_FLOAT( 0.0f, 1.0f ); - if( flRndSound <= 0.5 ) + if( flRndSound <= 0.5f ) EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "squeek/sqk_hunt2.wav", 1, ATTN_NORM, 0, 105 ); else EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "squeek/sqk_hunt3.wav", 1, ATTN_NORM, 0, 105 ); @@ -532,8 +532,8 @@ void CSqueak::PrimaryAttack() m_fJustThrown = 1; - m_flNextPrimaryAttack = GetNextAttackDelay( 0.3 ); - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0; + m_flNextPrimaryAttack = GetNextAttackDelay( 0.3f ); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0f; } } } @@ -565,20 +565,20 @@ void CSqueak::WeaponIdle( void ) int iAnim; float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 ); - if( flRand <= 0.75 ) + if( flRand <= 0.75f ) { iAnim = SQUEAK_IDLE1; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 30.0 / 16 * (2); + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 30.0f / 16.0f * 2.0f; } - else if( flRand <= 0.875 ) + else if( flRand <= 0.875f ) { iAnim = SQUEAK_FIDGETFIT; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0 / 16.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0f / 16.0f; } else { iAnim = SQUEAK_FIDGETNIP; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 80.0 / 16.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 80.0f / 16.0f; } SendWeaponAnim( iAnim ); } diff --git a/dlls/subs.cpp b/dlls/subs.cpp index e24a5c08..400e05c8 100644 --- a/dlls/subs.cpp +++ b/dlls/subs.cpp @@ -107,13 +107,6 @@ void CBaseEntity::UpdateOnRemove( void ) if( pev->globalname ) gGlobalState.EntitySetState( pev->globalname, GLOBAL_DEAD ); - - // tell owner ( if any ) that we're dead.This is mostly for MonsterMaker functionality. - //Killtarget didn't do this before, so the counter broke. - Solokiller - if( CBaseEntity* pOwner = pev->owner ? Instance( pev->owner ) : 0 ) - { - pOwner->DeathNotice( pev ); - } } // Convenient way to delay removing oneself @@ -237,7 +230,7 @@ void CBaseDelay::SUB_UseTargets( CBaseEntity *pActivator, USE_TYPE useType, floa // Save the useType pTemp->pev->button = (int)useType; pTemp->m_iszKillTarget = m_iszKillTarget; - pTemp->m_flDelay = 0; // prevent "recursion" + pTemp->m_flDelay = 0.0f; // prevent "recursion" pTemp->pev->target = pev->target; // HACKHACK @@ -407,7 +400,7 @@ void CBaseToggle::LinearMove( Vector vecDest, float flSpeed ) // divide vector length by speed to get time to reach dest float flTravelTime = vecDestDelta.Length() / flSpeed; - if( flTravelTime < 0.05 ) + if( flTravelTime < 0.05f ) { UTIL_SetOrigin( pev, m_vecFinalDest ); LinearMoveDone(); @@ -431,7 +424,7 @@ void CBaseToggle::LinearMoveDone( void ) { Vector delta = m_vecFinalDest - pev->origin; float error = delta.Length(); - if( error > 0.03125 ) + if( error > 0.03125f ) { LinearMove( m_vecFinalDest, 100 ); return; diff --git a/dlls/talkmonster.cpp b/dlls/talkmonster.cpp index 9180f037..581d87a9 100644 --- a/dlls/talkmonster.cpp +++ b/dlls/talkmonster.cpp @@ -64,13 +64,13 @@ const char *CTalkMonster::m_szFriends[TLK_CFRIENDS] = Task_t tlIdleResponse[] = { { TASK_SET_ACTIVITY, (float)ACT_IDLE }, // Stop and listen - { TASK_WAIT, (float)0.5 }, // Wait until sure it's me they are talking to - { TASK_TLK_EYECONTACT, (float)0 }, // Wait until speaker is done - { TASK_TLK_RESPOND, (float)0 }, // Wait and then say my response - { TASK_TLK_IDEALYAW, (float)0 }, // look at who I'm talking to - { TASK_FACE_IDEAL, (float)0 }, + { TASK_WAIT, 0.5f }, // Wait until sure it's me they are talking to + { TASK_TLK_EYECONTACT, 0.0f }, // Wait until speaker is done + { TASK_TLK_RESPOND, 0.0f }, // Wait and then say my response + { TASK_TLK_IDEALYAW, 0.0f }, // look at who I'm talking to + { TASK_FACE_IDEAL, 0.0f }, { TASK_SET_ACTIVITY, (float)ACT_SIGNAL3 }, - { TASK_TLK_EYECONTACT, (float)0 }, // Wait until speaker is done + { TASK_TLK_EYECONTACT, 0.0f }, // Wait until speaker is done }; Schedule_t slIdleResponse[] = @@ -88,12 +88,12 @@ Schedule_t slIdleResponse[] = Task_t tlIdleSpeak[] = { - { TASK_TLK_SPEAK, (float)0 },// question or remark - { TASK_TLK_IDEALYAW, (float)0 },// look at who I'm talking to - { TASK_FACE_IDEAL, (float)0 }, + { TASK_TLK_SPEAK, 0.0f },// question or remark + { TASK_TLK_IDEALYAW, 0.0f },// look at who I'm talking to + { TASK_FACE_IDEAL, 0.0f }, { TASK_SET_ACTIVITY, (float)ACT_SIGNAL3 }, - { TASK_TLK_EYECONTACT, (float)0 }, - { TASK_WAIT_RANDOM, (float)0.5 }, + { TASK_TLK_EYECONTACT, 0.0f }, + { TASK_WAIT_RANDOM, 0.5f }, }; Schedule_t slIdleSpeak[] = @@ -113,9 +113,9 @@ Schedule_t slIdleSpeak[] = Task_t tlIdleSpeakWait[] = { { TASK_SET_ACTIVITY, (float)ACT_SIGNAL3 },// Stop and talk - { TASK_TLK_SPEAK, (float)0 },// question or remark - { TASK_TLK_EYECONTACT, (float)0 },// - { TASK_WAIT, (float)2 },// wait - used when sci is in 'use' mode to keep head turned + { TASK_TLK_SPEAK, 0.0f },// question or remark + { TASK_TLK_EYECONTACT, 0.0f },// + { TASK_WAIT, 2.0f },// wait - used when sci is in 'use' mode to keep head turned }; Schedule_t slIdleSpeakWait[] = @@ -135,18 +135,18 @@ Schedule_t slIdleSpeakWait[] = Task_t tlIdleHello[] = { { TASK_SET_ACTIVITY, (float)ACT_SIGNAL3 },// Stop and talk - { TASK_TLK_HELLO, (float)0 },// Try to say hello to player - { TASK_TLK_EYECONTACT, (float)0 }, - { TASK_WAIT, (float)0.5 },// wait a bit - { TASK_TLK_HELLO, (float)0 },// Try to say hello to player - { TASK_TLK_EYECONTACT, (float)0 }, - { TASK_WAIT, (float)0.5 },// wait a bit - { TASK_TLK_HELLO, (float)0 },// Try to say hello to player - { TASK_TLK_EYECONTACT, (float)0 }, - { TASK_WAIT, (float)0.5 },// wait a bit - { TASK_TLK_HELLO, (float)0 },// Try to say hello to player - { TASK_TLK_EYECONTACT, (float)0 }, - { TASK_WAIT, (float)0.5 },// wait a bit + { TASK_TLK_HELLO, 0.0f },// Try to say hello to player + { TASK_TLK_EYECONTACT, 0.0f }, + { TASK_WAIT, 0.5f },// wait a bit + { TASK_TLK_HELLO, 0.0f },// Try to say hello to player + { TASK_TLK_EYECONTACT, 0.0f }, + { TASK_WAIT, 0.5f },// wait a bit + { TASK_TLK_HELLO, 0.0f },// Try to say hello to player + { TASK_TLK_EYECONTACT, 0.0f }, + { TASK_WAIT, 0.5f },// wait a bit + { TASK_TLK_HELLO, 0.0f },// Try to say hello to player + { TASK_TLK_EYECONTACT, 0.0f }, + { TASK_WAIT, 0.5f },// wait a bit }; Schedule_t slIdleHello[] = @@ -167,8 +167,8 @@ Schedule_t slIdleHello[] = Task_t tlIdleStopShooting[] = { - { TASK_TLK_STOPSHOOTING, (float)0 },// tell player to stop shooting friend - // { TASK_TLK_EYECONTACT, (float)0 },// look at the player + { TASK_TLK_STOPSHOOTING, 0.0f },// tell player to stop shooting friend + // { TASK_TLK_EYECONTACT, 0.0f },// look at the player }; Schedule_t slIdleStopShooting[] = @@ -188,11 +188,11 @@ Schedule_t slIdleStopShooting[] = Task_t tlMoveAway[] = { { TASK_SET_FAIL_SCHEDULE, (float)SCHED_MOVE_AWAY_FAIL }, - { TASK_STORE_LASTPOSITION, (float)0 }, - { TASK_MOVE_AWAY_PATH, (float)100 }, - { TASK_WALK_PATH_FOR_UNITS, (float)100 }, - { TASK_STOP_MOVING, (float)0 }, - { TASK_FACE_PLAYER, (float)0.5 }, + { TASK_STORE_LASTPOSITION, 0.0f }, + { TASK_MOVE_AWAY_PATH, 100.0f }, + { TASK_WALK_PATH_FOR_UNITS, 100.0f }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_FACE_PLAYER, 0.5f }, }; Schedule_t slMoveAway[] = @@ -208,8 +208,8 @@ Schedule_t slMoveAway[] = Task_t tlMoveAwayFail[] = { - { TASK_STOP_MOVING, (float)0 }, - { TASK_FACE_PLAYER, (float)0.5 }, + { TASK_STOP_MOVING, 0.0f }, + { TASK_FACE_PLAYER, 0.5f }, }; Schedule_t slMoveAwayFail[] = @@ -248,19 +248,19 @@ Task_t tlTlkIdleWatchClient[] = { { TASK_STOP_MOVING, 0 }, { TASK_SET_ACTIVITY, (float)ACT_IDLE }, - { TASK_TLK_LOOK_AT_CLIENT, (float)6 }, + { TASK_TLK_LOOK_AT_CLIENT, 6.0f }, }; Task_t tlTlkIdleWatchClientStare[] = { { TASK_STOP_MOVING, 0 }, { TASK_SET_ACTIVITY, (float)ACT_IDLE }, - { TASK_TLK_CLIENT_STARE, (float)6 }, - { TASK_TLK_STARE, (float)0 }, - { TASK_TLK_IDEALYAW, (float)0 },// look at who I'm talking to - { TASK_FACE_IDEAL, (float)0 }, + { TASK_TLK_CLIENT_STARE, 6.0f }, + { TASK_TLK_STARE, 0.0f }, + { TASK_TLK_IDEALYAW, 0.0f },// look at who I'm talking to + { TASK_FACE_IDEAL, 0.0f }, { TASK_SET_ACTIVITY, (float)ACT_SIGNAL3 }, - { TASK_TLK_EYECONTACT, (float)0 }, + { TASK_TLK_EYECONTACT, 0.0f }, }; Schedule_t slTlkIdleWatchClient[] = @@ -310,10 +310,10 @@ Schedule_t slTlkIdleWatchClient[] = Task_t tlTlkIdleEyecontact[] = { - { TASK_TLK_IDEALYAW, (float)0 },// look at who I'm talking to - { TASK_FACE_IDEAL, (float)0 }, + { TASK_TLK_IDEALYAW, 0.0f },// look at who I'm talking to + { TASK_FACE_IDEAL, 0.0f }, { TASK_SET_ACTIVITY, (float)ACT_SIGNAL3 }, - { TASK_TLK_EYECONTACT, (float)0 },// Wait until speaker is done + { TASK_TLK_EYECONTACT, 0.0f },// Wait until speaker is done }; Schedule_t slTlkIdleEyecontact[] = @@ -445,7 +445,7 @@ void CTalkMonster::StartTask( Task_t *pTask ) else if( FindCover( pev->origin, pev->view_ofs, 0, CoverRadius() ) ) { // then try for plain ole cover - m_flMoveWaitFinished = gpGlobals->time + 2; + m_flMoveWaitFinished = gpGlobals->time + 2.0f; TaskComplete(); } else @@ -494,18 +494,21 @@ void CTalkMonster::RunTask( Task_t *pTask ) if( pTask->iTask == TASK_TLK_CLIENT_STARE ) { - // fail out if the player looks away or moves away. - if( ( pPlayer->v.origin - pev->origin ).Length2D() > TLK_STARE_DIST ) + if( pPlayer ) { - // player moved away. - TaskFail(); - } + // fail out if the player looks away or moves away. + if( ( pPlayer->v.origin - pev->origin ).Length2D() > TLK_STARE_DIST ) + { + // player moved away. + TaskFail(); + } - UTIL_MakeVectors( pPlayer->v.angles ); - if( UTIL_DotPoints( pPlayer->v.origin, pev->origin, gpGlobals->v_forward ) < m_flFieldOfView ) - { - // player looked away - TaskFail(); + UTIL_MakeVectors( pPlayer->v.angles ); + if( UTIL_DotPoints( pPlayer->v.origin, pev->origin, gpGlobals->v_forward ) < m_flFieldOfView ) + { + // player looked away + TaskFail(); + } } } @@ -631,9 +634,9 @@ CBaseEntity *CTalkMonster::EnumFriends( CBaseEntity *pPrevious, int listNumber, UTIL_TraceLine( pev->origin, vecCheck, ignore_monsters, ENT( pev ), &tr ); } else - tr.flFraction = 1.0; + tr.flFraction = 1.0f; - if( tr.flFraction == 1.0 ) + if( tr.flFraction == 1.0f ) { return pFriend; } @@ -732,7 +735,7 @@ void CTalkMonster::HandleAnimEvent( MonsterEvent_t *pEvent ) // fall through... case SCRIPT_EVENT_SENTENCE: // Play a named sentence group ShutUpFriends(); - PlaySentence( pEvent->options, RANDOM_FLOAT( 2.8, 3.4 ), VOL_NORM, ATTN_IDLE ); + PlaySentence( pEvent->options, RANDOM_FLOAT( 2.8f, 3.4f ), VOL_NORM, ATTN_IDLE ); //ALERT( at_console, "script event speak\n" ); break; default: @@ -806,7 +809,7 @@ CBaseEntity *CTalkMonster::FindNearestFriend( BOOL fPlayer ) { UTIL_TraceLine( vecStart, vecCheck, ignore_monsters, ENT( pev ), &tr ); - if( tr.flFraction == 1.0 ) + if( tr.flFraction == 1.0f ) { // visible and in range, this is the new nearest scientist if( ( vecStart - vecCheck ).Length() < TALKRANGE_MIN ) @@ -841,7 +844,7 @@ void CTalkMonster::Touch( CBaseEntity *pOther ) // Heuristic for determining if the player is pushing me away float speed = fabs( pOther->pev->velocity.x ) + fabs( pOther->pev->velocity.y ); - if( speed > 50 ) + if( speed > 50.0f ) { SetConditions( bits_COND_CLIENT_PUSH ); MakeIdealYaw( pOther->pev->origin ); @@ -858,7 +861,7 @@ void CTalkMonster::IdleRespond( void ) //int pitch = GetVoicePitch(); // play response - PlaySentence( m_szGrp[TLK_ANSWER], RANDOM_FLOAT( 2.8, 3.2 ), VOL_NORM, ATTN_IDLE ); + PlaySentence( m_szGrp[TLK_ANSWER], RANDOM_FLOAT( 2.8f, 3.2f ), VOL_NORM, ATTN_IDLE ); } int CTalkMonster::FOkToSpeak( void ) @@ -939,9 +942,9 @@ int CTalkMonster::FIdleHello( void ) m_hTalkTarget = pPlayer; if( FBitSet(pev->spawnflags, SF_MONSTER_PREDISASTER ) ) - PlaySentence( m_szGrp[TLK_PHELLO], RANDOM_FLOAT( 3, 3.5 ), VOL_NORM, ATTN_IDLE ); + PlaySentence( m_szGrp[TLK_PHELLO], RANDOM_FLOAT( 3.0f, 3.5f ), VOL_NORM, ATTN_IDLE ); else - PlaySentence( m_szGrp[TLK_HELLO], RANDOM_FLOAT( 3, 3.5 ), VOL_NORM, ATTN_IDLE ); + PlaySentence( m_szGrp[TLK_HELLO], RANDOM_FLOAT( 3.0f, 3.5f ), VOL_NORM, ATTN_IDLE ); SetBits( m_bitsSaid, bit_saidHelloPlayer ); @@ -991,14 +994,14 @@ int CTalkMonster::FIdleSpeak( void ) szIdleGroup = m_szGrp[TLK_PIDLE]; szQuestionGroup = m_szGrp[TLK_PQUESTION]; // set global min delay for next conversation - duration = RANDOM_FLOAT( 4.8, 5.2 ); + duration = RANDOM_FLOAT( 4.8f, 5.2f ); } else { szIdleGroup = m_szGrp[TLK_IDLE]; szQuestionGroup = m_szGrp[TLK_QUESTION]; // set global min delay for next conversation - duration = RANDOM_FLOAT( 2.8, 3.2 ); + duration = RANDOM_FLOAT( 2.8f, 3.2f ); } //pitch = GetVoicePitch(); @@ -1105,7 +1108,7 @@ void CTalkMonster::PlaySentence( const char *pszSentence, float duration, float Talk( duration ); - CTalkMonster::g_talkWaitTime = gpGlobals->time + duration + 2.0; + CTalkMonster::g_talkWaitTime = gpGlobals->time + duration + 2.0f; if( pszSentence[0] == '!' ) EMIT_SOUND_DYN( edict(), CHAN_VOICE, pszSentence, volume, attenuation, 0, GetVoicePitch() ); else @@ -1124,7 +1127,7 @@ void CTalkMonster::Talk( float flDuration ) if( flDuration <= 0 ) { // no duration :( - m_flStopTalkTime = gpGlobals->time + 3; + m_flStopTalkTime = gpGlobals->time + 3.0f; } else { @@ -1186,20 +1189,20 @@ Schedule_t *CTalkMonster::GetScheduleOfType( int Type ) } // sustained light wounds? - if( !FBitSet( m_bitsSaid, bit_saidWoundLight ) && ( pev->health <= ( pev->max_health * 0.75 ) ) ) + if( !FBitSet( m_bitsSaid, bit_saidWoundLight ) && ( pev->health <= ( pev->max_health * 0.75f ) ) ) { //SENTENCEG_PlayRndSz( ENT( pev ), m_szGrp[TLK_WOUND], 1.0, ATTN_IDLE, 0, GetVoicePitch() ); - //CTalkMonster::g_talkWaitTime = gpGlobals->time + RANDOM_FLOAT( 2.8, 3.2 ); - PlaySentence( m_szGrp[TLK_WOUND], RANDOM_FLOAT( 2.8, 3.2 ), VOL_NORM, ATTN_IDLE ); + //CTalkMonster::g_talkWaitTime = gpGlobals->time + RANDOM_FLOAT( 2.8f, 3.2f ); + PlaySentence( m_szGrp[TLK_WOUND], RANDOM_FLOAT( 2.8f, 3.2f ), VOL_NORM, ATTN_IDLE ); SetBits( m_bitsSaid, bit_saidWoundLight ); return slIdleStand; } // sustained heavy wounds? - else if( !FBitSet( m_bitsSaid, bit_saidWoundHeavy ) && ( pev->health <= ( pev->max_health * 0.5 ) ) ) + else if( !FBitSet( m_bitsSaid, bit_saidWoundHeavy ) && ( pev->health <= ( pev->max_health * 0.5f ) ) ) { //SENTENCEG_PlayRndSz( ENT( pev ), m_szGrp[TLK_MORTAL], 1.0, ATTN_IDLE, 0, GetVoicePitch() ); - //CTalkMonster::g_talkWaitTime = gpGlobals->time + RANDOM_FLOAT( 2.8, 3.2 ); - PlaySentence( m_szGrp[TLK_MORTAL], RANDOM_FLOAT( 2.8, 3.2 ), VOL_NORM, ATTN_IDLE ); + //CTalkMonster::g_talkWaitTime = gpGlobals->time + RANDOM_FLOAT( 2.8f, 3.2f ); + PlaySentence( m_szGrp[TLK_MORTAL], RANDOM_FLOAT( 2.8f, 3.2f ), VOL_NORM, ATTN_IDLE ); SetBits( m_bitsSaid, bit_saidWoundHeavy ); return slIdleStand; } @@ -1289,8 +1292,8 @@ void CTalkMonster::TrySmellTalk( void ) // smelled something? if( !FBitSet( m_bitsSaid, bit_saidSmelled ) && HasConditions( bits_COND_SMELL ) ) { - PlaySentence( m_szGrp[TLK_SMELL], RANDOM_FLOAT( 2.8, 3.2 ), VOL_NORM, ATTN_IDLE ); - m_flLastSaidSmelled = gpGlobals->time + 60;// don't talk about the stinky for a while. + PlaySentence( m_szGrp[TLK_SMELL], RANDOM_FLOAT( 2.8f, 3.2f ), VOL_NORM, ATTN_IDLE ); + m_flLastSaidSmelled = gpGlobals->time + 60.0f;// don't talk about the stinky for a while. SetBits( m_bitsSaid, bit_saidSmelled ); } } @@ -1309,7 +1312,7 @@ void CTalkMonster::StopFollowing( BOOL clearSchedule ) { if( !( m_afMemory & bits_MEMORY_PROVOKED ) ) { - PlaySentence( m_szGrp[TLK_UNUSE], RANDOM_FLOAT( 2.8, 3.2 ), VOL_NORM, ATTN_IDLE ); + PlaySentence( m_szGrp[TLK_UNUSE], RANDOM_FLOAT( 2.8f, 3.2f ), VOL_NORM, ATTN_IDLE ); m_hTalkTarget = m_hTargetEnt; } @@ -1332,7 +1335,7 @@ void CTalkMonster::StartFollowing( CBaseEntity *pLeader ) m_IdealMonsterState = MONSTERSTATE_ALERT; m_hTargetEnt = pLeader; - PlaySentence( m_szGrp[TLK_USE], RANDOM_FLOAT( 2.8, 3.2 ), VOL_NORM, ATTN_IDLE ); + PlaySentence( m_szGrp[TLK_USE], RANDOM_FLOAT( 2.8f, 3.2f ), VOL_NORM, ATTN_IDLE ); m_hTalkTarget = m_hTargetEnt; ClearConditions( bits_COND_CLIENT_PUSH ); ClearSchedule(); diff --git a/dlls/talkmonster.h b/dlls/talkmonster.h index 36ac21a6..befa4e4a 100644 --- a/dlls/talkmonster.h +++ b/dlls/talkmonster.h @@ -25,7 +25,7 @@ // Used for scientists and barneys //========================================================= -#define TALKRANGE_MIN 500.0 // don't talk to anyone farther away than this +#define TALKRANGE_MIN 500.0f // don't talk to anyone farther away than this #define TLK_STARE_DIST 128 // anyone closer than this and looking at me is probably staring at me. diff --git a/dlls/teamplay_gamerules.cpp b/dlls/teamplay_gamerules.cpp index 87b695e7..ea733fa4 100644 --- a/dlls/teamplay_gamerules.cpp +++ b/dlls/teamplay_gamerules.cpp @@ -52,14 +52,14 @@ CHalfLifeTeamplay::CHalfLifeTeamplay() if( teamoverride.value ) { const char *pTeamList = STRING( pWorld->v.team ); - if( pTeamList && strlen( pTeamList ) ) + if( pTeamList && pTeamList[0] != '\0' ) { strncpy( m_szTeamList, pTeamList, TEAMPLAY_TEAMLISTLENGTH ); } } } // Has the server set teams - if( strlen( m_szTeamList ) ) + if( m_szTeamList[0] != '\0' ) m_teamLimit = TRUE; else m_teamLimit = FALSE; @@ -357,6 +357,8 @@ void CHalfLifeTeamplay::ClientUserInfoChanged( CBasePlayer *pPlayer, char *infob // recound stuff RecountTeams( TRUE ); + + pPlayer->SetPrefsFromUserinfo( infobuffer ); } extern int gmsgDeathMsg; diff --git a/dlls/tentacle.cpp b/dlls/tentacle.cpp index 44b8b45b..c860fcb3 100644 --- a/dlls/tentacle.cpp +++ b/dlls/tentacle.cpp @@ -261,7 +261,7 @@ void CTentacle::Spawn() SetTouch( &CTentacle::HitTouch ); SetUse( &CTentacle::CommandUse ); - pev->nextthink = gpGlobals->time + 0.2; + pev->nextthink = gpGlobals->time + 0.2f; ResetSequenceInfo(); m_iDir = 1; @@ -323,7 +323,7 @@ void CTentacle::KeyValue( KeyValueData *pkvd ) { if( FStrEq( pkvd->szKeyName, "sweeparc" ) ) { - m_flMaxYaw = atof( pkvd->szValue ) / 2.0; + m_flMaxYaw = atof( pkvd->szValue ) * 0.5f; pkvd->fHandled = TRUE; } else if( FStrEq( pkvd->szKeyName, "sound" ) ) @@ -426,7 +426,7 @@ void CTentacle::Test( void ) pev->sequence = TENTACLE_ANIM_Floor_Strike; pev->framerate = 0; StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } // @@ -435,7 +435,7 @@ void CTentacle::Test( void ) void CTentacle::Cycle( void ) { // ALERT( at_console, "%s %.2f %d %d\n", STRING( pev->targetname ), pev->origin.z, m_MonsterState, m_IdealMonsterState ); - pev->nextthink = gpGlobals-> time + 0.1; + pev->nextthink = gpGlobals-> time + 0.1f; // ALERT( at_console, "%s %d %d %d %f %f\n", STRING( pev->targetname ), pev->sequence, m_iGoalAnim, m_iDir, pev->framerate, pev->health ); @@ -467,7 +467,7 @@ void CTentacle::Cycle( void ) if( pSound ) { Vector vecDir; - if( gpGlobals->time - m_flPrevSoundTime < 0.5 ) + if( gpGlobals->time - m_flPrevSoundTime < 0.5f ) { float dt = gpGlobals->time - m_flPrevSoundTime; vecDir = pSound->m_vecOrigin + ( pSound->m_vecOrigin - m_vecPrevSound ) / dt - pev->origin; @@ -506,7 +506,7 @@ void CTentacle::Cycle( void ) // UTIL_EmitAmbientSound( ENT( pev ), pev->origin + Vector( 0, 0, MyHeight() ), sound, 1.0, ATTN_NORM, 0, 100 ); } #endif - m_flSoundTime = gpGlobals->time + RANDOM_FLOAT( 5.0, 10.0 ); + m_flSoundTime = gpGlobals->time + RANDOM_FLOAT( 5.0f, 10.0f ); } // clip ideal_yaw @@ -644,8 +644,8 @@ void CTentacle::Cycle( void ) } ResetSequenceInfo(); - m_flFramerateAdj = RANDOM_FLOAT( -0.2, 0.2 ); - pev->framerate = m_iDir * 1.0 + m_flFramerateAdj; + m_flFramerateAdj = RANDOM_FLOAT( -0.2f, 0.2f ); + pev->framerate = m_iDir * 1.0f + m_flFramerateAdj; switch( pev->sequence ) { @@ -678,12 +678,12 @@ void CTentacle::Cycle( void ) // ALERT( at_console, "seq %d\n", pev->sequence ); } - if( m_flPrevSoundTime + 2.0 > gpGlobals->time ) + if( m_flPrevSoundTime + 2.0f > gpGlobals->time ) { // 1.5 normal speed if hears sounds - pev->framerate = m_iDir * 1.5 + m_flFramerateAdj; + pev->framerate = m_iDir * 1.5f + m_flFramerateAdj; } - else if( m_flPrevSoundTime + 5.0 > gpGlobals->time ) + else if( m_flPrevSoundTime + 5.0f > gpGlobals->time ) { // slowdown to normal pev->framerate = m_iDir + m_iDir * ( 5 - ( gpGlobals->time - m_flPrevSoundTime ) ) / 2 + m_flFramerateAdj; @@ -719,7 +719,7 @@ void CTentacle::CommandUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_T void CTentacle::DieThink( void ) { - pev->nextthink = gpGlobals-> time + 0.1; + pev->nextthink = gpGlobals-> time + 0.1f; DispatchAnimEvents(); StudioFrameAdvance(); @@ -778,7 +778,7 @@ void CTentacle::DieThink( void ) case TENTACLE_ANIM_Engine_Death1: case TENTACLE_ANIM_Engine_Death2: case TENTACLE_ANIM_Engine_Death3: - pev->framerate = RANDOM_FLOAT( m_iDir - 0.2, m_iDir + 0.2 ); + pev->framerate = RANDOM_FLOAT( m_iDir - 0.2f, m_iDir + 0.2f ); dy = 180; break; default: @@ -841,11 +841,11 @@ void CTentacle::HandleAnimEvent( MonsterEvent_t *pEvent ) case 6: // light tap { - Vector vecSrc = pev->origin + m_flTapRadius * Vector( cos( pev->angles.y * ( M_PI / 180.0 ) ), sin( pev->angles.y * ( M_PI / 180.0 ) ), 0.0 ); + Vector vecSrc = pev->origin + m_flTapRadius * Vector( cos( pev->angles.y * ( M_PI_F / 180.0f ) ), sin( pev->angles.y * ( M_PI_F / 180.0f ) ), 0.0f ); vecSrc.z += MyHeight(); - float flVol = RANDOM_FLOAT( 0.3, 0.5 ); + float flVol = RANDOM_FLOAT( 0.3f, 0.5f ); switch( m_iTapSound ) { @@ -929,7 +929,7 @@ void CTentacle::Start( void ) g_fSquirmSound = TRUE; } - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } void CTentacle::HitTouch( CBaseEntity *pOther ) @@ -961,7 +961,7 @@ void CTentacle::HitTouch( CBaseEntity *pOther ) return; // Huh? } - m_flHitTime = gpGlobals->time + 0.5; + m_flHitTime = gpGlobals->time + 0.5f; // ALERT( at_console, "%s : ", STRING( tr.pHit->v.classname ) ); diff --git a/dlls/triggers.cpp b/dlls/triggers.cpp index 6d8fef04..2c0888c9 100644 --- a/dlls/triggers.cpp +++ b/dlls/triggers.cpp @@ -163,7 +163,7 @@ void CAutoTrigger::Spawn( void ) void CAutoTrigger::Precache( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } void CAutoTrigger::Think( void ) @@ -614,7 +614,7 @@ void CTriggerMonsterJump::Touch( CBaseEntity *pOther ) return; } - pevOther->origin.z += 1; + pevOther->origin.z += 1.0f; if( FBitSet( pevOther->flags, FL_ONGROUND ) ) { @@ -739,7 +739,7 @@ void CTargetCDAudio::Spawn( void ) pev->movetype = MOVETYPE_NONE; if( pev->scale > 0 ) - pev->nextthink = gpGlobals->time + 1.0; + pev->nextthink = gpGlobals->time + 1.0f; } void CTargetCDAudio::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) @@ -759,7 +759,7 @@ void CTargetCDAudio::Think( void ) if( !pClient ) return; - pev->nextthink = gpGlobals->time + 0.5; + pev->nextthink = gpGlobals->time + 0.5f; if( ( pClient->v.origin - pev->origin ).Length() <= pev->scale ) Play(); @@ -825,8 +825,8 @@ void CTriggerHurt::RadiationThink( void ) origin = pev->origin; view_ofs = pev->view_ofs; - pev->origin = ( pev->absmin + pev->absmax ) * 0.5; - pev->view_ofs = pev->view_ofs * 0.0; + pev->origin = ( pev->absmin + pev->absmax ) * 0.5f; + pev->view_ofs = pev->view_ofs * 0.0f; pentPlayer = FIND_CLIENT_IN_PVS( edict() ); @@ -841,8 +841,8 @@ void CTriggerHurt::RadiationThink( void ) pevTarget = VARS( pentPlayer ); // get range to player; - vecSpot1 = ( pev->absmin + pev->absmax ) * 0.5; - vecSpot2 = ( pevTarget->absmin + pevTarget->absmax ) * 0.5; + vecSpot1 = ( pev->absmin + pev->absmax ) * 0.5f; + vecSpot2 = ( pevTarget->absmin + pevTarget->absmax ) * 0.5f; vecRange = vecSpot1 - vecSpot2; flRange = vecRange.Length(); @@ -855,7 +855,7 @@ void CTriggerHurt::RadiationThink( void ) pPlayer->m_flgeigerRange = flRange; } - pev->nextthink = gpGlobals->time + 0.25; + pev->nextthink = gpGlobals->time + 0.25f; } // @@ -952,7 +952,7 @@ void CBaseTrigger::HurtTouch( CBaseEntity *pOther ) // while touching the trigger. Player continues taking damage for a while after // leaving the trigger - fldmg = pev->dmg * 0.5; // 0.5 seconds worth of damage, pev->dmg is damage/second + fldmg = pev->dmg * 0.5f; // 0.5 seconds worth of damage, pev->dmg is damage/second // JAY: Cut this because it wasn't fully realized. Damage is simpler now. #if 0 @@ -992,7 +992,7 @@ void CBaseTrigger::HurtTouch( CBaseEntity *pOther ) pev->pain_finished = gpGlobals->time; // Apply damage every half second - pev->dmgtime = gpGlobals->time + 0.5;// half second delay until this trigger can hurt toucher again + pev->dmgtime = gpGlobals->time + 0.5f;// half second delay until this trigger can hurt toucher again if( pev->target ) { @@ -1038,7 +1038,7 @@ LINK_ENTITY_TO_CLASS( trigger_multiple, CTriggerMultiple ) void CTriggerMultiple::Spawn( void ) { if( m_flWait == 0 ) - m_flWait = 0.2; + m_flWait = 0.2f; InitTrigger(); @@ -1124,7 +1124,7 @@ void CBaseTrigger::ActivateMultiTrigger( CBaseEntity *pActivator ) if( pev->nextthink > gpGlobals->time ) return; // still waiting for reset time - if( !UTIL_IsMasterTriggered( m_sMaster,pActivator ) ) + if( !UTIL_IsMasterTriggered( m_sMaster, pActivator ) ) return; if( FClassnameIs( pev, "trigger_secret" ) ) @@ -1159,7 +1159,7 @@ void CBaseTrigger::ActivateMultiTrigger( CBaseEntity *pActivator ) // we can't just remove (self) here, because this is a touch function // called while C code is looping through area links... SetTouch( NULL ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; SetThink( &CBaseEntity::SUB_Remove ); } } @@ -1191,7 +1191,7 @@ void CBaseTrigger::CounterUse( CBaseEntity *pActivator, CBaseEntity *pCaller, US BOOL fTellActivator = ( m_hActivator != 0 ) && - FClassnameIs( m_hActivator->pev, "player" ) && + m_hActivator->IsPlayer() && !FBitSet( pev->spawnflags, SPAWNFLAG_NOMESSAGE ); if( m_cTriggersLeft != 0 ) { @@ -1499,7 +1499,7 @@ void CChangeLevel::ChangeLevelNow( CBaseEntity *pActivator ) // void CChangeLevel::TouchChangeLevel( CBaseEntity *pOther ) { - if( !FClassnameIs( pOther->pev, "player" ) ) + if( !pOther->IsPlayer() ) return; ChangeLevelNow( pOther ); @@ -1702,7 +1702,7 @@ void NextLevel( void ) if( pChange->pev->nextthink < gpGlobals->time ) { pChange->SetThink( &CChangeLevel::ExecuteChangeLevel ); - pChange->pev->nextthink = gpGlobals->time + 0.1; + pChange->pev->nextthink = gpGlobals->time + 0.1f; } } @@ -2323,8 +2323,8 @@ void CTriggerCamera::FollowTarget() if( !( FBitSet( pev->spawnflags, SF_CAMERA_PLAYER_TAKECONTROL ) ) ) { - pev->velocity = pev->velocity * 0.8; - if( pev->velocity.Length() < 10.0 ) + pev->velocity = pev->velocity * 0.8f; + if( pev->velocity.Length() < 10.0f ) pev->velocity = g_vecZero; } diff --git a/dlls/tripmine.cpp b/dlls/tripmine.cpp index 6e8fc2fc..50ea8c37 100644 --- a/dlls/tripmine.cpp +++ b/dlls/tripmine.cpp @@ -105,22 +105,22 @@ void CTripmineGrenade::Spawn( void ) ResetSequenceInfo(); pev->framerate = 0; - UTIL_SetSize( pev, Vector( -8, -8, -8 ), Vector( 8, 8, 8 ) ); + UTIL_SetSize( pev, Vector( -8.0f, -8.0f, -8.0f ), Vector( 8.0f, 8.0f, 8.0f ) ); UTIL_SetOrigin( pev, pev->origin ); if( pev->spawnflags & 1 ) { // power up quickly - m_flPowerUp = gpGlobals->time + 1.0; + m_flPowerUp = gpGlobals->time + 1.0f; } else { // power up in 2.5 seconds - m_flPowerUp = gpGlobals->time + 2.5; + m_flPowerUp = gpGlobals->time + 2.5f; } SetThink( &CTripmineGrenade::PowerupThink ); - pev->nextthink = gpGlobals->time + 0.2; + pev->nextthink = gpGlobals->time + 0.2f; pev->takedamage = DAMAGE_YES; pev->dmg = gSkillData.plrDmgTripmine; @@ -138,7 +138,7 @@ void CTripmineGrenade::Spawn( void ) UTIL_MakeAimVectors( pev->angles ); m_vecDir = gpGlobals->v_forward; - m_vecEnd = pev->origin + m_vecDir * 2048; + m_vecEnd = pev->origin + m_vecDir * 2048.0f; } void CTripmineGrenade::Precache( void ) @@ -163,7 +163,7 @@ void CTripmineGrenade::WarningThink( void ) // set to power up SetThink( &CTripmineGrenade::PowerupThink ); - pev->nextthink = gpGlobals->time + 1.0; + pev->nextthink = gpGlobals->time + 1.0f; } void CTripmineGrenade::PowerupThink( void ) @@ -175,15 +175,15 @@ void CTripmineGrenade::PowerupThink( void ) // find an owner edict_t *oldowner = pev->owner; pev->owner = NULL; - UTIL_TraceLine( pev->origin + m_vecDir * 8, pev->origin - m_vecDir * 32, dont_ignore_monsters, ENT( pev ), &tr ); + UTIL_TraceLine( pev->origin + m_vecDir * 8.0f, pev->origin - m_vecDir * 32.0f, dont_ignore_monsters, ENT( pev ), &tr ); if( tr.fStartSolid || ( oldowner && tr.pHit == oldowner ) ) { pev->owner = oldowner; - m_flPowerUp += 0.1; - pev->nextthink = gpGlobals->time + 0.1; + m_flPowerUp += 0.1f; + pev->nextthink = gpGlobals->time + 0.1f; return; } - if( tr.flFraction < 1.0 ) + if( tr.flFraction < 1.0f ) { pev->owner = tr.pHit; m_hOwner = CBaseEntity::Instance( pev->owner ); @@ -195,8 +195,8 @@ void CTripmineGrenade::PowerupThink( void ) STOP_SOUND( ENT( pev ), CHAN_VOICE, "weapons/mine_deploy.wav" ); STOP_SOUND( ENT( pev ), CHAN_BODY, "weapons/mine_charge.wav" ); SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + 0.1; - ALERT( at_console, "WARNING:Tripmine at %.0f, %.0f, %.0f removed\n", pev->origin.x, pev->origin.y, pev->origin.z ); + pev->nextthink = gpGlobals->time + 0.1f; + ALERT( at_console, "WARNING:Tripmine at %.0f, %.0f, %.0f removed\n", (double)pev->origin.x, (double)pev->origin.y, (double)pev->origin.z ); KillBeam(); return; } @@ -206,12 +206,12 @@ void CTripmineGrenade::PowerupThink( void ) // disable STOP_SOUND( ENT( pev ), CHAN_VOICE, "weapons/mine_deploy.wav" ); STOP_SOUND( ENT( pev ), CHAN_BODY, "weapons/mine_charge.wav" ); - CBaseEntity *pMine = Create( "weapon_tripmine", pev->origin + m_vecDir * 24, pev->angles ); + CBaseEntity *pMine = Create( "weapon_tripmine", pev->origin + m_vecDir * 24.0f, pev->angles ); pMine->pev->spawnflags |= SF_NORESPAWN; SetThink( &CBaseEntity::SUB_Remove ); KillBeam(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; return; } // ALERT( at_console, "%d %.0f %.0f %0.f\n", pev->owner, m_pOwner->pev->origin.x, m_pOwner->pev->origin.y, m_pOwner->pev->origin.z ); @@ -227,7 +227,7 @@ void CTripmineGrenade::PowerupThink( void ) // play enabled sound EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "weapons/mine_activate.wav", 0.5, ATTN_NORM, 1, 75 ); } - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } void CTripmineGrenade::KillBeam( void ) @@ -251,9 +251,9 @@ void CTripmineGrenade::MakeBeam( void ) // set to follow laser spot SetThink( &CTripmineGrenade::BeamBreakThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; - Vector vecTmpEnd = pev->origin + m_vecDir * 2048 * m_flBeamLength; + Vector vecTmpEnd = pev->origin + m_vecDir * 2048.0f * m_flBeamLength; m_pBeam = CBeam::BeamCreate( g_pModelNameLaser, 10 ); m_pBeam->PointEntInit( vecTmpEnd, entindex() ); @@ -282,7 +282,7 @@ void CTripmineGrenade::BeamBreakThink( void ) m_hOwner = CBaseEntity::Instance( tr.pHit ); // reset owner too } - if( fabs( m_flBeamLength - tr.flFraction ) > 0.001 ) + if( fabs( m_flBeamLength - tr.flFraction ) > 0.001f ) { bBlowup = 1; } @@ -308,7 +308,7 @@ void CTripmineGrenade::BeamBreakThink( void ) return; } - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } int CTripmineGrenade::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType ) @@ -316,9 +316,9 @@ int CTripmineGrenade::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacke if( gpGlobals->time < m_flPowerUp && flDamage < pev->health ) { // disable - // Create( "weapon_tripmine", pev->origin + m_vecDir * 24, pev->angles ); + // Create( "weapon_tripmine", pev->origin + m_vecDir * 24.0f, pev->angles ); SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; KillBeam(); return FALSE; } @@ -336,16 +336,16 @@ void CTripmineGrenade::Killed( entvars_t *pevAttacker, int iGib ) } SetThink( &CTripmineGrenade::DelayDeathThink ); - pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 0.1, 0.3 ); + pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 0.1f, 0.3f ); - EMIT_SOUND( ENT( pev ), CHAN_BODY, "common/null.wav", 0.5, ATTN_NORM ); // shut off chargeup + EMIT_SOUND( ENT( pev ), CHAN_BODY, "common/null.wav", 0.5f, ATTN_NORM ); // shut off chargeup } void CTripmineGrenade::DelayDeathThink( void ) { KillBeam(); TraceResult tr; - UTIL_TraceLine( pev->origin + m_vecDir * 8, pev->origin - m_vecDir * 64, dont_ignore_monsters, ENT( pev ), &tr ); + UTIL_TraceLine( pev->origin + m_vecDir * 8, pev->origin - m_vecDir * 64.0f, dont_ignore_monsters, ENT( pev ), &tr ); Explode( &tr, DMG_BLAST ); } @@ -374,7 +374,7 @@ void CTripmine::Spawn() if( !g_pGameRules->IsDeathmatch() ) #endif { - UTIL_SetSize( pev, Vector( -16, -16, 0 ), Vector( 16, 16, 28 ) ); + UTIL_SetSize( pev, Vector( -16.0f, -16.0f, 0.0f ), Vector( 16.0f, 16.0f, 28.0f ) ); } } @@ -412,7 +412,7 @@ BOOL CTripmine::Deploy() void CTripmine::Holster( int skiplocal /* = 0 */ ) { - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; if( !m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] ) { @@ -422,7 +422,7 @@ void CTripmine::Holster( int skiplocal /* = 0 */ ) } SendWeaponAnim( TRIPMINE_HOLSTER ); - EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "common/null.wav", 1.0, ATTN_NORM ); + EMIT_SOUND( ENT( m_pPlayer->pev ), CHAN_WEAPON, "common/null.wav", 1.0f, ATTN_NORM ); } void CTripmine::PrimaryAttack( void ) @@ -436,7 +436,7 @@ void CTripmine::PrimaryAttack( void ) TraceResult tr; - UTIL_TraceLine( vecSrc, vecSrc + vecAiming * 128, dont_ignore_monsters, ENT( m_pPlayer->pev ), &tr ); + UTIL_TraceLine( vecSrc, vecSrc + vecAiming * 128.0f, dont_ignore_monsters, ENT( m_pPlayer->pev ), &tr ); int flags; #ifdef CLIENT_WEAPONS @@ -444,16 +444,16 @@ void CTripmine::PrimaryAttack( void ) #else flags = 0; #endif - PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usTripFire, 0.0, g_vecZero, g_vecZero, 0.0, 0.0, 0, 0, 0, 0 ); + PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usTripFire, 0.0f, g_vecZero, g_vecZero, 0.0f, 0.0f, 0, 0, 0, 0 ); - if( tr.flFraction < 1.0 ) + if( tr.flFraction < 1.0f ) { CBaseEntity *pEntity = CBaseEntity::Instance( tr.pHit ); if( pEntity && !( pEntity->pev->flags & FL_CONVEYOR ) ) { Vector angles = UTIL_VecToAngles( tr.vecPlaneNormal ); - CBaseEntity::Create( "monster_tripmine", tr.vecEndPos + tr.vecPlaneNormal * 8, angles, m_pPlayer->edict() ); + CBaseEntity::Create( "monster_tripmine", tr.vecEndPos + tr.vecPlaneNormal * 8.0f, angles, m_pPlayer->edict() ); m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--; @@ -498,20 +498,20 @@ void CTripmine::WeaponIdle( void ) int iAnim; float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 ); - if( flRand <= 0.25 ) + if( flRand <= 0.25f ) { iAnim = TRIPMINE_IDLE1; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 90.0 / 30.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 90.0f / 30.0f; } - else if( flRand <= 0.75 ) + else if( flRand <= 0.75f ) { iAnim = TRIPMINE_IDLE2; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 60.0 / 30.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 60.0f / 30.0f; } else { iAnim = TRIPMINE_FIDGET; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 100.0 / 30.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 100.0f / 30.0f; } SendWeaponAnim( iAnim ); diff --git a/dlls/turret.cpp b/dlls/turret.cpp index 093b2032..a5aa6d23 100644 --- a/dlls/turret.cpp +++ b/dlls/turret.cpp @@ -316,7 +316,7 @@ void CTurret::Spawn() m_pEyeGlow->SetAttachment( edict(), 2 ); m_eyeBrightness = 0; - pev->nextthink = gpGlobals->time + 0.3; + pev->nextthink = gpGlobals->time + 0.3f; } void CTurret::Precache() @@ -331,9 +331,9 @@ void CMiniTurret::Spawn() Precache(); SET_MODEL( ENT( pev ), "models/miniturret.mdl" ); pev->health = gSkillData.miniturretHealth; - m_HackedGunPos = Vector( 0, 0, 12.75 ); + m_HackedGunPos = Vector( 0.0f, 0.0f, 12.75f ); m_flMaxSpin = 0; - pev->view_ofs.z = 12.75; + pev->view_ofs.z = 12.75f; CBaseTurret::Spawn(); m_iRetractHeight = 16; @@ -342,7 +342,7 @@ void CMiniTurret::Spawn() UTIL_SetSize( pev, Vector( -16, -16, -m_iRetractHeight ), Vector( 16, 16, m_iRetractHeight ) ); SetThink( &CBaseTurret::Initialize ); - pev->nextthink = gpGlobals->time + 0.3; + pev->nextthink = gpGlobals->time + 0.3f; } void CMiniTurret::Precache() @@ -385,7 +385,7 @@ void CBaseTurret::Initialize( void ) { m_flLastSight = gpGlobals->time + m_flMaxWait; SetThink( &CBaseTurret::AutoSearchThink ); - pev->nextthink = gpGlobals->time + .1; + pev->nextthink = gpGlobals->time + 0.1f; } else SetThink( &CBaseEntity::SUB_DoNothing ); @@ -399,7 +399,7 @@ void CBaseTurret::TurretUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_ if( m_iOn ) { m_hEnemy = NULL; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; m_iAutoStart = FALSE;// switching off a turret disables autostart //!!!! this should spin down first!!BUGBUG @@ -407,7 +407,7 @@ void CBaseTurret::TurretUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_ } else { - pev->nextthink = gpGlobals->time + 0.1; // turn on delay + pev->nextthink = gpGlobals->time + 0.1f; // turn on delay // if the turret is flagged as an autoactivate turret, re-enable it's ability open self. if( pev->spawnflags & SF_MONSTER_TURRET_AUTOACTIVATE ) @@ -465,7 +465,7 @@ void CBaseTurret::ActiveThink( void ) int fAttack = 0; Vector vecDirToEnemy; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; StudioFrameAdvance(); if( ( !m_iOn ) || ( m_hEnemy == 0 ) ) @@ -481,7 +481,7 @@ void CBaseTurret::ActiveThink( void ) { if( !m_flLastSight ) { - m_flLastSight = gpGlobals->time + 0.5; // continue-shooting timeout + m_flLastSight = gpGlobals->time + 0.5f; // continue-shooting timeout } else { @@ -510,7 +510,7 @@ void CBaseTurret::ActiveThink( void ) if( !fEnemyVisible || ( flDistToEnemy > TURRET_RANGE ) ) { if( !m_flLastSight ) - m_flLastSight = gpGlobals->time + 0.5; + m_flLastSight = gpGlobals->time + 0.5f; else { // Should we look for a new target? @@ -529,7 +529,7 @@ void CBaseTurret::ActiveThink( void ) m_vecLastSight = vecMidEnemy; } - UTIL_MakeAimVectors(m_vecCurAngles); + UTIL_MakeAimVectors( m_vecCurAngles ); /* ALERT( at_console, "%.0f %.0f : %.2f %.2f %.2f\n", @@ -541,7 +541,7 @@ void CBaseTurret::ActiveThink( void ) vecLOS = vecLOS.Normalize(); // Is the Gun looking at the target - if( DotProduct( vecLOS, gpGlobals->v_forward ) <= 0.866 ) // 30 degree slop + if( DotProduct( vecLOS, gpGlobals->v_forward ) <= 0.866f ) // 30 degree slop fAttack = FALSE; else fAttack = TRUE; @@ -642,7 +642,7 @@ void CMiniTurret::Shoot( Vector &vecSrc, Vector &vecDirToEnemy ) void CBaseTurret::Deploy( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; StudioFrameAdvance(); if( pev->sequence != TURRET_ANIM_DEPLOY ) @@ -684,7 +684,7 @@ void CBaseTurret::Retire( void ) m_vecGoalAngles.x = 0; m_vecGoalAngles.y = m_flStartYaw; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; StudioFrameAdvance(); @@ -713,7 +713,7 @@ void CBaseTurret::Retire( void ) if( m_iAutoStart ) { SetThink( &CBaseTurret::AutoSearchThink ); - pev->nextthink = gpGlobals->time + .1; + pev->nextthink = gpGlobals->time + 0.1f; } else SetThink( &CBaseEntity::SUB_DoNothing ); @@ -728,7 +728,7 @@ void CBaseTurret::Retire( void ) void CTurret::SpinUpCall( void ) { StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; // Are we already spun up? If not start the two stage process. if( !m_iSpin ) @@ -738,15 +738,15 @@ void CTurret::SpinUpCall( void ) // for the first pass, spin up the the barrel if( !m_iStartSpin ) { - pev->nextthink = gpGlobals->time + 1.0; // spinup delay + pev->nextthink = gpGlobals->time + 1.0f; // spinup delay EMIT_SOUND( ENT( pev ), CHAN_BODY, "turret/tu_spinup.wav", TURRET_MACHINE_VOLUME, ATTN_NORM ); m_iStartSpin = 1; - pev->framerate = 0.1; + pev->framerate = 0.1f; } // after the barrel is spun up, turn on the hum - else if( pev->framerate >= 1.0 ) + else if( pev->framerate >= 1.0f ) { - pev->nextthink = gpGlobals->time + 0.1; // retarget delay + pev->nextthink = gpGlobals->time + 0.1f; // retarget delay EMIT_SOUND( ENT( pev ), CHAN_STATIC, "turret/tu_active2.wav", TURRET_MACHINE_VOLUME, ATTN_NORM ); SetThink( &CBaseTurret::ActiveThink ); m_iStartSpin = 0; @@ -754,7 +754,7 @@ void CTurret::SpinUpCall( void ) } else { - pev->framerate += 0.075; + pev->framerate += 0.075f; } } @@ -769,12 +769,12 @@ void CTurret::SpinDownCall( void ) if( m_iSpin ) { SetTurretAnim( TURRET_ANIM_SPIN ); - if( pev->framerate == 1.0 ) + if( pev->framerate == 1.0f ) { EMIT_SOUND_DYN( ENT( pev ), CHAN_STATIC, "turret/tu_active2.wav", 0, 0, SND_STOP, 100 ); EMIT_SOUND( ENT( pev ), CHAN_ITEM, "turret/tu_spindown.wav", TURRET_MACHINE_VOLUME, ATTN_NORM ); } - pev->framerate -= 0.02; + pev->framerate -= 0.02f; if( pev->framerate <= 0 ) { pev->framerate = 0; @@ -830,7 +830,7 @@ void CBaseTurret::SearchThink( void ) // ensure rethink SetTurretAnim( TURRET_ANIM_SPIN ); StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( m_flSpinUpTime == 0 && m_flMaxSpin ) m_flSpinUpTime = gpGlobals->time + m_flMaxSpin; @@ -875,7 +875,7 @@ void CBaseTurret::SearchThink( void ) } // generic hunt for new victims - m_vecGoalAngles.y = ( m_vecGoalAngles.y + 0.1 * m_fTurnRate ); + m_vecGoalAngles.y = ( m_vecGoalAngles.y + 0.1f * m_fTurnRate ); if( m_vecGoalAngles.y >= 360 ) m_vecGoalAngles.y -= 360; MoveTurret(); @@ -890,7 +890,7 @@ void CBaseTurret::AutoSearchThink( void ) { // ensure rethink StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.3; + pev->nextthink = gpGlobals->time + 0.3f; // If we have a target and we're still healthy if( m_hEnemy != 0 ) @@ -918,7 +918,7 @@ void CBaseTurret::TurretDeath( void ) //BOOL iActive = FALSE; StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( pev->deadflag != DEAD_DEAD ) { @@ -926,9 +926,9 @@ void CBaseTurret::TurretDeath( void ) float flRndSound = RANDOM_FLOAT( 0, 1 ); - if( flRndSound <= 0.33 ) + if( flRndSound <= 0.33f ) EMIT_SOUND( ENT( pev ), CHAN_BODY, "turret/tu_die.wav", 1.0, ATTN_NORM ); - else if( flRndSound <= 0.66 ) + else if( flRndSound <= 0.66f ) EMIT_SOUND( ENT( pev ), CHAN_BODY, "turret/tu_die2.wav", 1.0, ATTN_NORM ); else EMIT_SOUND( ENT( pev ), CHAN_BODY, "turret/tu_die3.wav", 1.0, ATTN_NORM ); @@ -1006,7 +1006,7 @@ int CBaseTurret::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, fl return 0; if( !m_iOn ) - flDamage /= 10.0; + flDamage *= 0.1f; pev->health -= flDamage; if( pev->health <= 0 ) @@ -1020,7 +1020,7 @@ int CBaseTurret::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, fl SetUse( NULL ); SetThink( &CBaseTurret::TurretDeath ); SUB_UseTargets( this, USE_ON, 0 ); // wake up others - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; return 0; } @@ -1046,7 +1046,7 @@ int CBaseTurret::MoveTurret( void ) { float flDir = m_vecGoalAngles.x > m_vecCurAngles.x ? 1 : -1 ; - m_vecCurAngles.x += 0.1 * m_fTurnRate * flDir; + m_vecCurAngles.x += 0.1f * m_fTurnRate * flDir; // if we started below the goal, and now we're past, peg to goal if( flDir == 1 ) @@ -1093,14 +1093,14 @@ int CBaseTurret::MoveTurret( void ) m_fTurnRate += m_iBaseTurnRate; } - m_vecCurAngles.y += 0.1 * m_fTurnRate * flDir; + m_vecCurAngles.y += 0.1f * m_fTurnRate * flDir; if( m_vecCurAngles.y < 0 ) m_vecCurAngles.y += 360; else if( m_vecCurAngles.y >= 360 ) m_vecCurAngles.y -= 360; - if( flDist < ( 0.05 * m_iBaseTurnRate ) ) + if( flDist < ( 0.05f * m_iBaseTurnRate ) ) m_vecCurAngles.y = m_vecGoalAngles.y; //ALERT( at_console, "%.2f -> %.2f\n", m_vecCurAngles.y, y ); @@ -1170,7 +1170,7 @@ void CSentry::Spawn() SetTouch( &CSentry::SentryTouch ); SetThink( &CBaseTurret::Initialize ); - pev->nextthink = gpGlobals->time + 0.3; + pev->nextthink = gpGlobals->time + 0.3f; } void CSentry::Shoot( Vector &vecSrc, Vector &vecDirToEnemy ) @@ -1201,7 +1201,7 @@ int CSentry::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float { SetThink( &CBaseTurret::Deploy ); SetUse( NULL ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } pev->health -= flDamage; @@ -1216,7 +1216,7 @@ int CSentry::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float SetUse( NULL ); SetThink( &CSentry::SentryDeath ); SUB_UseTargets( this, USE_ON, 0 ); // wake up others - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; return 0; } @@ -1237,7 +1237,7 @@ void CSentry::SentryDeath( void ) //BOOL iActive = FALSE; StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( pev->deadflag != DEAD_DEAD ) { @@ -1245,9 +1245,9 @@ void CSentry::SentryDeath( void ) float flRndSound = RANDOM_FLOAT( 0, 1 ); - if( flRndSound <= 0.33 ) + if( flRndSound <= 0.33f ) EMIT_SOUND( ENT( pev ), CHAN_BODY, "turret/tu_die.wav", 1.0, ATTN_NORM ); - else if( flRndSound <= 0.66 ) + else if( flRndSound <= 0.66f ) EMIT_SOUND( ENT( pev ), CHAN_BODY, "turret/tu_die2.wav", 1.0, ATTN_NORM ); else EMIT_SOUND( ENT( pev ), CHAN_BODY, "turret/tu_die3.wav", 1.0, ATTN_NORM ); diff --git a/dlls/util.cpp b/dlls/util.cpp index a5160876..018a2f8e 100644 --- a/dlls/util.cpp +++ b/dlls/util.cpp @@ -34,7 +34,7 @@ float UTIL_WeaponTimeBase( void ) { #if defined( CLIENT_WEAPONS ) - return 0.0; + return 0.0f; #else return gpGlobals->time; #endif @@ -130,7 +130,7 @@ float UTIL_SharedRandomFloat( unsigned int seed, float low, float high ) tensixrand = U_Random() & 65535; - offset = (float)tensixrand / 65536.0; + offset = (float)tensixrand / 65536.0f; return ( low + offset * range ); } @@ -147,8 +147,8 @@ void UTIL_ParametricRocket( entvars_t *pev, Vector vecOrigin, Vector vecAngles, // Now compute how long it will take based on current velocity Vector vecTravel = pev->endpos - pev->startpos; - float travelTime = 0.0; - if( pev->velocity.Length() > 0 ) + float travelTime = 0.0f; + if( pev->velocity.Length() > 0.0f ) { travelTime = vecTravel.Length() / pev->velocity.Length(); } @@ -458,7 +458,7 @@ int UTIL_MonstersInSphere( CBaseEntity **pList, int listMax, const Vector ¢e // Use origin for X & Y since they are centered for all monsters // Now X - delta = center.x - pEdict->v.origin.x;//( pEdict->v.absmin.x + pEdict->v.absmax.x ) * 0.5; + delta = center.x - pEdict->v.origin.x;//( pEdict->v.absmin.x + pEdict->v.absmax.x ) * 0.5f; delta *= delta; if( delta > radiusSquared ) @@ -466,7 +466,7 @@ int UTIL_MonstersInSphere( CBaseEntity **pList, int listMax, const Vector ¢e distance = delta; // Now Y - delta = center.y - pEdict->v.origin.y;//( pEdict->v.absmin.y + pEdict->v.absmax.y )*0.5; + delta = center.y - pEdict->v.origin.y;//( pEdict->v.absmin.y + pEdict->v.absmax.y ) * 0.5f; delta *= delta; distance += delta; @@ -474,7 +474,7 @@ int UTIL_MonstersInSphere( CBaseEntity **pList, int listMax, const Vector ¢e continue; // Now Z - delta = center.z - ( pEdict->v.absmin.z + pEdict->v.absmax.z ) * 0.5; + delta = center.z - ( pEdict->v.absmin.z + pEdict->v.absmax.z ) * 0.5f; delta *= delta; distance += delta; @@ -1184,7 +1184,7 @@ void UTIL_DecalTrace( TraceResult *pTrace, int decalNumber ) if( index < 0 ) return; - if( pTrace->flFraction == 1.0 ) + if( pTrace->flFraction == 1.0f ) return; // Only decal BSP models @@ -1253,7 +1253,7 @@ void UTIL_PlayerDecalTrace( TraceResult *pTrace, int playernum, int decalNumber, else index = decalNumber; - if( pTrace->flFraction == 1.0 ) + if( pTrace->flFraction == 1.0f ) return; MESSAGE_BEGIN( MSG_BROADCAST, SVC_TEMPENTITY ); @@ -1276,7 +1276,7 @@ void UTIL_GunshotDecalTrace( TraceResult *pTrace, int decalNumber ) if( index < 0 ) return; - if( pTrace->flFraction == 1.0 ) + if( pTrace->flFraction == 1.0f ) return; MESSAGE_BEGIN( MSG_PAS, SVC_TEMPENTITY, pTrace->vecEndPos ); @@ -1306,7 +1306,7 @@ void UTIL_Ricochet( const Vector &position, float scale ) WRITE_COORD( position.x ); WRITE_COORD( position.y ); WRITE_COORD( position.z ); - WRITE_BYTE( (int)( scale * 10 ) ); + WRITE_BYTE( (int)( scale * 10.0f ) ); MESSAGE_END(); } @@ -1423,9 +1423,9 @@ float UTIL_WaterLevel( const Vector &position, float minz, float maxz ) return maxz; float diff = maxz - minz; - while( diff > 1.0 ) + while( diff > 1.0f ) { - midUp.z = minz + diff / 2.0; + midUp.z = minz + diff / 2.0f; if( UTIL_PointContents( midUp ) == CONTENTS_WATER ) { minz = midUp.z; @@ -1444,7 +1444,7 @@ extern DLL_GLOBAL short g_sModelIndexBubbles;// holds the index for the bubbles void UTIL_Bubbles( Vector mins, Vector maxs, int count ) { - Vector mid = ( mins + maxs ) * 0.5; + Vector mid = ( mins + maxs ) * 0.5f; float flHeight = UTIL_WaterLevel( mid, mid.z, mid.z + 1024 ); flHeight = flHeight - mins.z; @@ -2196,7 +2196,7 @@ int CRestore::ReadField( void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCou pString++; } pInputData = pString; - if( strlen( (char *)pInputData ) == 0 ) + if( ( (char *)pInputData )[0] == '\0' ) *( (string_t *)pOutputData ) = 0; else { @@ -2291,7 +2291,7 @@ int CRestore::ReadField( void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCou *( (void**)pOutputData ) = *(void **)pInputData; break; case FIELD_FUNCTION: - if( strlen( (char *)pInputData ) == 0 ) + if( ( (char *)pInputData )[0] == '\0' ) *( (void**)pOutputData ) = 0; else *( (void**)pOutputData ) = (void*)FUNCTION_FROM_NAME( (char *)pInputData ); diff --git a/dlls/util.h b/dlls/util.h index 602380ba..2bb8a5d4 100644 --- a/dlls/util.h +++ b/dlls/util.h @@ -108,7 +108,11 @@ typedef int BOOL; // The _declspec forces them to be exported by name so we can do a lookup with GetProcAddress() // The function is used to intialize / allocate the object for the entity +#if defined(CLIENT_DLL) +#define LINK_ENTITY_TO_CLASS(mapClassName,DLLClassName) +#else // CLIENT_DLL #define LINK_ENTITY_TO_CLASS(mapClassName,DLLClassName) extern "C" EXPORT void mapClassName( entvars_t *pev ); void mapClassName( entvars_t *pev ) { GetClassPtr( (DLLClassName *)pev ); } +#endif // CLIENT_DLL // // Conversion among the three types of "entity", including identity-conversions. diff --git a/dlls/weapons.cpp b/dlls/weapons.cpp index 5daf07f6..ec98e0ca 100644 --- a/dlls/weapons.cpp +++ b/dlls/weapons.cpp @@ -441,7 +441,7 @@ void CBasePlayerItem::FallInit( void ) SetTouch( &CBasePlayerItem::DefaultTouch ); SetThink( &CBasePlayerItem::FallThink ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } //========================================================= @@ -453,7 +453,7 @@ void CBasePlayerItem::FallInit( void ) //========================================================= void CBasePlayerItem::FallThink( void ) { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if( pev->flags & FL_ONGROUND ) { @@ -596,7 +596,7 @@ BOOL CanAttack( float attack_time, float curtime, BOOL isPredicted ) } else { - return ( attack_time <= 0.0 ) ? TRUE : FALSE; + return ( attack_time <= 0.0f ) ? TRUE : FALSE; } } @@ -654,19 +654,19 @@ void CBasePlayerWeapon::ItemPostFrame( void ) // no fire buttons down m_fFireOnEmpty = FALSE; - if( !IsUseable() && m_flNextPrimaryAttack < ( UseDecrement() ? 0.0 : gpGlobals->time ) ) + if( !IsUseable() && m_flNextPrimaryAttack < ( UseDecrement() ? 0.0f : gpGlobals->time ) ) { // weapon isn't useable, switch. if( !( iFlags() & ITEM_FLAG_NOAUTOSWITCHEMPTY ) && g_pGameRules->GetNextBestWeapon( m_pPlayer, this ) ) { - m_flNextPrimaryAttack = ( UseDecrement() ? 0.0 : gpGlobals->time ) + 0.3; + m_flNextPrimaryAttack = ( UseDecrement() ? 0.0f : gpGlobals->time ) + 0.3f; return; } } else { // weapon is useable. Reload if empty and weapon has waited as long as it has to after firing - if( m_iClip == 0 && !(iFlags() & ITEM_FLAG_NOAUTORELOAD ) && m_flNextPrimaryAttack < ( UseDecrement() ? 0.0 : gpGlobals->time ) ) + if( m_iClip == 0 && !(iFlags() & ITEM_FLAG_NOAUTORELOAD ) && m_flNextPrimaryAttack < ( UseDecrement() ? 0.0f : gpGlobals->time ) ) { Reload(); return; @@ -706,14 +706,14 @@ void CBasePlayerItem::Drop( void ) { SetTouch( NULL ); SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + .1; + pev->nextthink = gpGlobals->time + 0.1f; } void CBasePlayerItem::Kill( void ) { SetTouch( NULL ); SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + .1; + pev->nextthink = gpGlobals->time + 0.1f; } void CBasePlayerItem::Holster( int skiplocal /* = 0 */ ) @@ -952,8 +952,8 @@ BOOL CBasePlayerWeapon::DefaultDeploy( const char *szViewModel, const char *szWe strcpy( m_pPlayer->m_szAnimExtention, szAnimExt ); SendWeaponAnim( iAnim, skiplocal, body ); - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0f; m_flLastFireTime = 0.0f; return TRUE; @@ -976,7 +976,7 @@ BOOL CBasePlayerWeapon::DefaultReload( int iClipSize, int iAnim, float fDelay, i m_fInReload = TRUE; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0f; return TRUE; } @@ -1071,7 +1071,7 @@ void CBasePlayerAmmo::DefaultTouch( CBaseEntity *pOther ) { SetTouch( NULL ); SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + .1; + pev->nextthink = gpGlobals->time + 0.1f; } } else if( gEvilImpulse101 ) @@ -1079,7 +1079,7 @@ void CBasePlayerAmmo::DefaultTouch( CBaseEntity *pOther ) // evil impulse 101 hack, kill always SetTouch( NULL ); SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + .1; + pev->nextthink = gpGlobals->time + 0.1f; } } @@ -1158,7 +1158,7 @@ void CBasePlayerWeapon::RetireWeapon( void ) //========================================================================= float CBasePlayerWeapon::GetNextAttackDelay( float delay ) { - if( m_flLastFireTime == 0 || m_flNextPrimaryAttack == -1 ) + if( m_flLastFireTime == 0 || m_flNextPrimaryAttack == -1.0f ) { // At this point, we are assuming that the client has stopped firing // and we are going to reset our book keeping variables. @@ -1256,7 +1256,7 @@ void CWeaponBox::Kill( void ) while( pWeapon ) { pWeapon->SetThink( &CBaseEntity::SUB_Remove ); - pWeapon->pev->nextthink = gpGlobals->time + 0.1; + pWeapon->pev->nextthink = gpGlobals->time + 0.1f; pWeapon = pWeapon->m_pNext; } } @@ -1550,8 +1550,8 @@ void CWeaponBox::SetObjectCollisionBox( void ) void CBasePlayerWeapon::PrintState( void ) { - ALERT( at_console, "primary: %f\n", m_flNextPrimaryAttack ); - ALERT( at_console, "idle : %f\n", m_flTimeWeaponIdle ); + ALERT( at_console, "primary: %f\n", (double)m_flNextPrimaryAttack ); + ALERT( at_console, "idle : %f\n", (double)m_flTimeWeaponIdle ); //ALERT( at_console, "nextrl : %f\n", m_flNextReload ); //ALERT( at_console, "nextpum: %f\n", m_flPumpTime ); diff --git a/dlls/world.cpp b/dlls/world.cpp index ae5a41bc..0e0a0288 100644 --- a/dlls/world.cpp +++ b/dlls/world.cpp @@ -159,7 +159,7 @@ void CDecal::TriggerDecal( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TY MESSAGE_END(); SetThink( &CBaseEntity::SUB_Remove ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } void CDecal::StaticDecal( void ) @@ -626,15 +626,15 @@ void CWorld::Precache( void ) pEntity->SetThink( &CBaseEntity::SUB_CallUseToggle ); pEntity->pev->message = pev->netname; pev->netname = 0; - pEntity->pev->nextthink = gpGlobals->time + 0.3; + pEntity->pev->nextthink = gpGlobals->time + 0.3f; pEntity->pev->spawnflags = SF_MESSAGE_ONCE; } } if( pev->spawnflags & SF_WORLD_DARK ) - CVAR_SET_FLOAT( "v_dark", 1.0 ); + CVAR_SET_FLOAT( "v_dark", 1.0f ); else - CVAR_SET_FLOAT( "v_dark", 0.0 ); + CVAR_SET_FLOAT( "v_dark", 0.0f ); pev->spawnflags &= ~SF_WORLD_DARK; // g-cont. don't apply fade after save\restore @@ -647,11 +647,11 @@ void CWorld::Precache( void ) if( pev->spawnflags & SF_WORLD_FORCETEAM ) { - CVAR_SET_FLOAT( "mp_defaultteam", 1 ); + CVAR_SET_FLOAT( "mp_defaultteam", 1.0f ); } else { - CVAR_SET_FLOAT( "mp_defaultteam", 0 ); + CVAR_SET_FLOAT( "mp_defaultteam", 0.0f ); } // g-cont. moved here so cheats will working on restore level @@ -677,7 +677,7 @@ void CWorld::KeyValue( KeyValueData *pkvd ) else if( FStrEq(pkvd->szKeyName, "WaveHeight" ) ) { // Sent over net now. - pev->scale = atof( pkvd->szValue ) * ( 1.0 / 8.0 ); + pev->scale = atof( pkvd->szValue ) * ( 1.0f / 8.0f ); pkvd->fHandled = TRUE; } else if( FStrEq( pkvd->szKeyName, "MaxRange" ) ) diff --git a/dlls/wscript b/dlls/wscript index 05a7d002..24e93e71 100644 --- a/dlls/wscript +++ b/dlls/wscript @@ -4,21 +4,28 @@ from waflib import Utils import os - + def options(opt): # stub return def configure(conf): - # stub - return + if conf.env.COMPILER_CC == 'msvc': + # hl.def removes MSVC function name decoration from GiveFnptrsToDll on Windows. + # Without this, the lookup for this function fails. + hlDefNode = conf.path.find_resource("./hl.def") + + if hlDefNode is not None: + conf.env.append_unique('LINKFLAGS', '/def:%s' % hlDefNode.abspath()) + else: + conf.fatal("Could not find hl.def") def build(bld): defines = [] source = bld.path.parent.ant_glob([ 'pm_shared/*.c', ]) - + source += [ 'agrunt.cpp', 'airtank.cpp', 'aflock.cpp', 'animating.cpp', 'animation.cpp', 'apache.cpp', 'barnacle.cpp', 'barney.cpp', 'bigmomma.cpp', 'bloater.cpp', 'bmodels.cpp', 'bullsquid.cpp', 'buttons.cpp', @@ -42,7 +49,7 @@ def build(bld): 'triggers.cpp', 'tripmine.cpp', 'turret.cpp', 'util.cpp', 'weapons.cpp', 'world.cpp', 'xen.cpp', 'zombie.cpp'] - + if bld.env.VOICEMGR: source += bld.path.parent.ant_glob([ 'game_shared/voice_gamemgr.cpp', @@ -54,19 +61,19 @@ def build(bld): libs = [] - if bld.env.DEST_OS2 not in ['android']: + if bld.env.DEST_OS not in ['android']: install_path = os.path.join(bld.env.GAMEDIR, bld.env.SERVER_DIR) else: install_path = bld.env.PREFIX bld.shlib( source = source, - target = 'server', + target = bld.env.SERVER_NAME + bld.env.POSTFIX, features = 'c cxx', includes = includes, defines = defines, use = libs, install_path = install_path, subsystem = bld.env.MSVC_SUBSYSTEM, - idx = 2 + idx = bld.get_taskgen_count() ) diff --git a/dlls/xen.cpp b/dlls/xen.cpp index 1d86beb3..847f26f7 100644 --- a/dlls/xen.cpp +++ b/dlls/xen.cpp @@ -94,10 +94,10 @@ void CXenPLight::Spawn( void ) UTIL_SetSize( pev, Vector( -80, -80, 0 ), Vector( 80, 80, 32 ) ); SetActivity( ACT_IDLE ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; pev->frame = RANDOM_FLOAT( 0, 255 ); - m_pGlow = CSprite::SpriteCreate( XEN_PLANT_GLOW_SPRITE, pev->origin + Vector(0,0,(pev->mins.z+pev->maxs.z)*0.5), FALSE ); + m_pGlow = CSprite::SpriteCreate( XEN_PLANT_GLOW_SPRITE, pev->origin + Vector( 0, 0, ( pev->mins.z + pev->maxs.z ) * 0.5f ), FALSE ); m_pGlow->SetTransparency( kRenderGlow, (int)pev->rendercolor.x, (int)pev->rendercolor.y, (int)pev->rendercolor.z, (int)pev->renderamt, (int)pev->renderfx ); m_pGlow->SetAttachment( edict(), 1 ); } @@ -111,7 +111,7 @@ void CXenPLight::Precache( void ) void CXenPLight::Think( void ) { StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; switch( GetActivity() ) { @@ -187,19 +187,19 @@ void CXenHair::Spawn( void ) if( !( pev->spawnflags & SF_HAIR_SYNC ) ) { pev->frame = RANDOM_FLOAT( 0, 255 ); - pev->framerate = RANDOM_FLOAT( 0.7, 1.4 ); + pev->framerate = RANDOM_FLOAT( 0.7f, 1.4f ); } ResetSequenceInfo(); pev->solid = SOLID_NOT; pev->movetype = MOVETYPE_NONE; - pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 0.1, 0.4 ); // Load balance these a bit + pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 0.1f, 0.4f ); // Load balance these a bit } void CXenHair::Think( void ) { StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.5; + pev->nextthink = gpGlobals->time + 0.5f; } void CXenHair::Precache( void ) @@ -283,9 +283,9 @@ void CXenTree::Spawn( void ) UTIL_SetSize( pev, Vector( -30, -30, 0 ), Vector( 30, 30, 188 ) ); SetActivity( ACT_IDLE ); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; pev->frame = RANDOM_FLOAT( 0, 255 ); - pev->framerate = RANDOM_FLOAT( 0.7, 1.4 ); + pev->framerate = RANDOM_FLOAT( 0.7f, 1.4f ); Vector triggerPosition; UTIL_MakeVectorsPrivate( pev->angles, triggerPosition, NULL, NULL ); @@ -329,7 +329,7 @@ void CXenTree::Attack( void ) if( GetActivity() == ACT_IDLE ) { SetActivity( ACT_MELEE_ATTACK1 ); - pev->framerate = RANDOM_FLOAT( 1.0, 1.4 ); + pev->framerate = RANDOM_FLOAT( 1.0f, 1.4f ); EMIT_SOUND_ARRAY_DYN( CHAN_WEAPON, pAttackMissSounds ); } } @@ -375,7 +375,7 @@ void CXenTree::HandleAnimEvent( MonsterEvent_t *pEvent ) void CXenTree::Think( void ) { float flInterval = StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; DispatchAnimEvents( flInterval ); switch( GetActivity() ) @@ -384,7 +384,7 @@ void CXenTree::Think( void ) if( m_fSequenceFinished ) { SetActivity( ACT_IDLE ); - pev->framerate = RANDOM_FLOAT( 0.6, 1.4 ); + pev->framerate = RANDOM_FLOAT( 0.6f, 1.4f ); } break; default: @@ -513,9 +513,9 @@ void CXenSpore :: Spawn( void ) //SetActivity( ACT_IDLE ); pev->sequence = 0; pev->frame = RANDOM_FLOAT( 0, 255 ); - pev->framerate = RANDOM_FLOAT( 0.7, 1.4 ); + pev->framerate = RANDOM_FLOAT( 0.7f, 1.4f ); ResetSequenceInfo(); - pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 0.1, 0.4 ); // Load balance these a bit + pev->nextthink = gpGlobals->time + RANDOM_FLOAT( 0.1f, 0.4f ); // Load balance these a bit } const char *CXenSpore::pModelNames[] = @@ -537,7 +537,7 @@ void CXenSpore::Touch( CBaseEntity *pOther ) void CXenSpore::Think( void ) { StudioFrameAdvance(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; #if 0 DispatchAnimEvents( flInterval ); diff --git a/dlls/zombie.cpp b/dlls/zombie.cpp index 96f032e6..7f891a36 100644 --- a/dlls/zombie.cpp +++ b/dlls/zombie.cpp @@ -136,11 +136,11 @@ int CZombie::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float // Take 30% damage from bullets if( bitsDamageType == DMG_BULLET ) { - Vector vecDir = pev->origin - (pevInflictor->absmin + pevInflictor->absmax) * 0.5; + Vector vecDir = pev->origin - ( pevInflictor->absmin + pevInflictor->absmax ) * 0.5f; vecDir = vecDir.Normalize(); float flForce = DamageForce( flDamage ); pev->velocity = pev->velocity + vecDir * flForce; - flDamage *= 0.3; + flDamage *= 0.3f; } // HACK HACK -- until we fix this. diff --git a/pm_shared/pm_debug.c b/pm_shared/pm_debug.c index 3b0879c7..a11e0516 100644 --- a/pm_shared/pm_debug.c +++ b/pm_shared/pm_debug.c @@ -12,8 +12,12 @@ * without written permission from Valve LLC. * ****/ - +#include #include "mathlib.h" +#ifdef HAVE_TGMATH_H +#include +#endif + #include "const.h" #include "usercmd.h" #include "pm_defs.h" @@ -76,7 +80,7 @@ void PM_ShowClipBox( void ) // Show our BBOX in particles. PM_DrawBBox( pmove->player_mins[pmove->usehull], pmove->player_maxs[pmove->usehull], org, pmove->server ? 132 : 0, 0.1 ); - PM_ParticleLine( org, org, pmove->server ? 132 : 0, 0.1, 5.0 ); + PM_ParticleLine( org, org, pmove->server ? 132 : 0, 0.1f, 5.0f ); /* { int i; @@ -179,13 +183,13 @@ void PM_DrawPhysEntBBox(int num, int pcolor, float life) { vec3_t forward, right, up; - AngleVectorsTranspose(pe->angles, forward, right, up); - for (j = 0; j < 8; j++) + AngleVectorsTranspose( pe->angles, forward, right, up); + for( j = 0; j < 8; j++ ) { VectorCopy(p[j], tmp); - p[j][0] = DotProduct ( tmp, forward ); - p[j][1] = DotProduct ( tmp, right ); - p[j][2] = DotProduct ( tmp, up ); + p[j][0] = DotProduct( tmp, forward ); + p[j][1] = DotProduct( tmp, right ); + p[j][2] = DotProduct( tmp, up ); } } @@ -285,7 +289,7 @@ void PM_ViewEntity( void ) int i; pmtrace_t trace; int pcolor = 77; - float fup; + // float fup; #if 0 if ( !pm_showclip.value ) @@ -296,9 +300,9 @@ void PM_ViewEntity( void ) VectorCopy( pmove->origin, origin); - fup = 0.5*( pmove->player_mins[pmove->usehull][2] + pmove->player_maxs[pmove->usehull][2] ); + /*fup = 0.5f * ( pmove->player_mins[pmove->usehull][2] + pmove->player_maxs[pmove->usehull][2] ); fup += pmove->view_ofs[2]; - fup -= 4; + fup -= 4;*/ for (i = 0; i < 3; i++) { diff --git a/pm_shared/pm_math.c b/pm_shared/pm_math.c index 4bb4b93f..87c65d9f 100644 --- a/pm_shared/pm_math.c +++ b/pm_shared/pm_math.c @@ -13,10 +13,12 @@ * ****/ // pm_math.c -- math primitives - -#include "mathlib.h" -#include "const.h" #include +#include "mathlib.h" +#ifdef HAVE_TGMATH_H +#include +#endif +#include "const.h" // up / down #define PITCH 0 @@ -29,12 +31,12 @@ #pragma warning(disable : 4244) #endif -vec3_t vec3_origin = { 0,0,0 }; +vec3_t vec3_origin = { 0, 0, 0 }; int nanmask = 255 << 23; float anglemod( float a ) { - a = ( 360.0 / 65536 ) * ( (int)( a * ( 65536 / 360.0 ) ) & 65535 ); + a = ( 360.0f / 65536.0f ) * ( (int)( a * ( 65536.0f / 360.0f ) ) & 65535 ); return a; } @@ -43,13 +45,13 @@ void AngleVectors( const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up float angle; float sr, sp, sy, cr, cp, cy; - angle = angles[YAW] * ( M_PI * 2 / 360 ); + angle = angles[YAW] * ( M_PI_F * 2.0f / 360.0f ); sy = sin( angle ); cy = cos( angle ); - angle = angles[PITCH] * ( M_PI*2 / 360 ); + angle = angles[PITCH] * ( M_PI_F * 2.0f / 360.0f ); sp = sin( angle ); cp = cos( angle ); - angle = angles[ROLL] * ( M_PI*2 / 360 ); + angle = angles[ROLL] * ( M_PI_F * 2.0f / 360.0f ); sr = sin( angle ); cr = cos( angle ); @@ -78,13 +80,13 @@ void AngleVectorsTranspose( const vec3_t angles, vec3_t forward, vec3_t right, v float angle; float sr, sp, sy, cr, cp, cy; - angle = angles[YAW] * ( M_PI * 2 / 360 ); + angle = angles[YAW] * ( M_PI_F * 2.0f / 360.0f ); sy = sin( angle ); cy = cos( angle ); - angle = angles[PITCH] * ( M_PI * 2 / 360 ); + angle = angles[PITCH] * ( M_PI_F * 2.0f / 360.0f ); sp = sin( angle ); cp = cos( angle ); - angle = angles[ROLL] * ( M_PI * 2 / 360 ); + angle = angles[ROLL] * ( M_PI_F * 2.0f / 360.0f ); sr = sin( angle ); cr = cos( angle ); @@ -113,13 +115,13 @@ void AngleMatrix( const vec3_t angles, float (*matrix)[4] ) float angle; float sr, sp, sy, cr, cp, cy; - angle = angles[YAW] * ( M_PI * 2 / 360 ); + angle = angles[YAW] * ( M_PI_F * 2.0f / 360.0f ); sy = sin( angle ); cy = cos( angle ); - angle = angles[PITCH] * ( M_PI * 2 / 360 ); + angle = angles[PITCH] * ( M_PI_F * 2.0f / 360.0f ); sp = sin( angle ); cp = cos( angle ); - angle = angles[ROLL] * ( M_PI * 2 / 360 ); + angle = angles[ROLL] * ( M_PI_F * 2.0f / 360.0f ); sr = sin( angle ); cr = cos( angle ); @@ -133,9 +135,9 @@ void AngleMatrix( const vec3_t angles, float (*matrix)[4] ) matrix[0][2] = ( cr * sp * cy + -sr * -sy ); matrix[1][2] = ( cr * sp * sy + -sr * cy ); matrix[2][2] = cr * cp; - matrix[0][3] = 0.0; - matrix[1][3] = 0.0; - matrix[2][3] = 0.0; + matrix[0][3] = 0.0f; + matrix[1][3] = 0.0f; + matrix[2][3] = 0.0f; } void AngleIMatrix( const vec3_t angles, float matrix[3][4] ) @@ -143,13 +145,13 @@ void AngleIMatrix( const vec3_t angles, float matrix[3][4] ) float angle; float sr, sp, sy, cr, cp, cy; - angle = angles[YAW] * ( M_PI * 2 / 360 ); + angle = angles[YAW] * ( M_PI_F * 2.0f / 360.0f ); sy = sin( angle ); cy = cos( angle ); - angle = angles[PITCH] * ( M_PI * 2 / 360 ); + angle = angles[PITCH] * ( M_PI_F * 2.0f / 360.0f ); sp = sin( angle ); cp = cos( angle ); - angle = angles[ROLL] * ( M_PI * 2 / 360 ); + angle = angles[ROLL] * ( M_PI_F * 2.0f / 360.0f ); sr = sin( angle ); cr = cos( angle ); @@ -174,13 +176,13 @@ void NormalizeAngles( float *angles ) // Normalize angles for( i = 0; i < 3; i++ ) { - if( angles[i] > 180.0 ) + if( angles[i] > 180.0f ) { - angles[i] -= 360.0; + angles[i] -= 360.0f; } - else if( angles[i] < -180.0 ) + else if( angles[i] < -180.0f ) { - angles[i] += 360.0; + angles[i] += 360.0f; } } } @@ -209,13 +211,13 @@ void InterpolateAngles( float *start, float *end, float *output, float frac ) ang2 = end[i]; d = ang2 - ang1; - if( d > 180 ) + if( d > 180.0f ) { - d -= 360; + d -= 360.0f; } - else if( d < -180 ) + else if( d < -180.0f ) { - d += 360; + d += 360.0f; } output[i] = ang1 + d * frac; @@ -240,7 +242,7 @@ float AngleBetweenVectors( const vec3_t v1, const vec3_t v2 ) return 0.0f; angle = acos( DotProduct( v1, v2 ) / ( l1 * l2 ) ); - angle = ( angle * 180.0f ) / M_PI; + angle = ( angle * 180.0f ) / M_PI_F; return angle; } @@ -303,8 +305,6 @@ void CrossProduct( const vec3_t v1, const vec3_t v2, vec3_t cross ) cross[2] = v1[0] * v2[1] - v1[1] * v2[0]; } -double sqrt( double x ); - float Length( const vec3_t v ) { int i; @@ -333,7 +333,7 @@ float VectorNormalize( vec3_t v ) if( length ) { - ilength = 1 / length; + ilength = 1.0f / length; v[0] *= ilength; v[1] *= ilength; v[2] *= ilength; @@ -368,18 +368,18 @@ void VectorMatrix( vec3_t forward, vec3_t right, vec3_t up ) { vec3_t tmp; - if( forward[0] == 0 && forward[1] == 0 ) + if( forward[0] == 0.0f && forward[1] == 0.0f ) { - right[0] = 1; - right[1] = 0; - right[2] = 0; + right[0] = 1.0f; + right[1] = 0.0f; + right[2] = 0.0f; up[0] = -forward[2]; - up[1] = 0; - up[2] = 0; + up[1] = 0.0f; + up[2] = 0.0f; return; } - tmp[0] = 0; tmp[1] = 0; tmp[2] = 1.0; + tmp[0] = 0.0f; tmp[1] = 0.0f; tmp[2] = 1.0f; CrossProduct( forward, tmp, right ); VectorNormalize( right ); CrossProduct( right, forward, up ); @@ -390,27 +390,27 @@ void VectorAngles( const vec3_t forward, vec3_t angles ) { float tmp, yaw, pitch; - if( forward[1] == 0 && forward[0] == 0 ) + if( forward[1] == 0.0f && forward[0] == 0.0f ) { - yaw = 0; - if( forward[2] > 0 ) - pitch = 90; + yaw = 0.0f; + if( forward[2] > 0.0f ) + pitch = 90.0f; else - pitch = 270; + pitch = 270.0f; } else { - yaw = ( atan2( forward[1], forward[0] ) * 180 / M_PI ); - if( yaw < 0 ) - yaw += 360; + yaw = ( atan2( forward[1], forward[0] ) * 180.0f / M_PI_F ); + if( yaw < 0.0f ) + yaw += 360.0f; tmp = sqrt( forward[0] * forward[0] + forward[1] * forward[1] ); - pitch = ( atan2( forward[2], tmp ) * 180 / M_PI ); - if( pitch < 0 ) - pitch += 360; + pitch = ( atan2( forward[2], tmp ) * 180.0f / M_PI_F ); + if( pitch < 0.0f ) + pitch += 360.0f; } angles[0] = pitch; angles[1] = yaw; - angles[2] = 0; + angles[2] = 0.0f; } diff --git a/pm_shared/pm_shared.c b/pm_shared/pm_shared.c index ace56595..01825777 100644 --- a/pm_shared/pm_shared.c +++ b/pm_shared/pm_shared.c @@ -14,18 +14,22 @@ ****/ #include +//#include // NULL +#include // sqrt +#include // strcpy +#include // atoi +#include // isspace #include "mathlib.h" +#ifdef HAVE_TGMATH_H +#include +#endif + #include "const.h" #include "usercmd.h" #include "pm_defs.h" #include "pm_shared.h" #include "pm_movevars.h" #include "pm_debug.h" -//#include // NULL -#include // sqrt -#include // strcpy -#include // atoi -#include // isspace int g_bhopcap = 1; @@ -45,7 +49,7 @@ static int pm_shared_initialized = 0; playermove_t *pmove = NULL; // Ducking time -#define TIME_TO_DUCK 0.4 +#define TIME_TO_DUCK 0.4f #define VEC_DUCK_HULL_MIN -18 #define VEC_DUCK_HULL_MAX 18 #define VEC_DUCK_VIEW 12 @@ -56,7 +60,7 @@ playermove_t *pmove = NULL; #define VEC_HULL_MIN -36 #define VEC_HULL_MAX 36 #define VEC_VIEW 28 -#define STOP_EPSILON 0.1 +#define STOP_EPSILON 0.1f #define CTEXTURESMAX 512 // max number of textures loaded #define CBTEXTURENAMEMAX 13 // only load first n chars of name @@ -91,7 +95,7 @@ playermove_t *pmove = NULL; #define PLAYER_LONGJUMP_SPEED 350 // how fast we longjump -#define PLAYER_DUCKING_MULTIPLIER 0.333 +#define PLAYER_DUCKING_MULTIPLIER 0.333f // double to float warning #ifdef _MSC_VER @@ -284,7 +288,7 @@ void PM_PlayStepSound( int step, float fvol ) return; VectorCopy( pmove->velocity, hvel ); - hvel[2] = 0.0; + hvel[2] = 0.0f; if( pmove->multiplayer && ( !g_onladder && Length( hvel ) <= 220 ) ) return; @@ -594,7 +598,7 @@ void PM_UpdateStepSound( void ) // If we're on a ladder or on the ground, and we're moving fast enough, // play step sound. Also, if pmove->flTimeStepSound is zero, get the new // sound right away - we just started moving in new level. - if( ( fLadder || ( pmove->onground != -1 ) ) && ( Length( pmove->velocity ) > 0.0 ) && ( speed >= velwalk || !pmove->flTimeStepSound ) ) + if( ( fLadder || ( pmove->onground != -1 ) ) && ( Length( pmove->velocity ) > 0.0f ) && ( speed >= velwalk || !pmove->flTimeStepSound ) ) { fWalking = speed < velrun; @@ -604,26 +608,26 @@ void PM_UpdateStepSound( void ) height = pmove->player_maxs[pmove->usehull][2] - pmove->player_mins[pmove->usehull][2]; - knee[2] = pmove->origin[2] - 0.3 * height; - feet[2] = pmove->origin[2] - 0.5 * height; + knee[2] = pmove->origin[2] - 0.3f * height; + feet[2] = pmove->origin[2] - 0.5f * height; // find out what we're stepping in or on... if( fLadder ) { step = STEP_LADDER; - fvol = 0.35; + fvol = 0.35f; pmove->flTimeStepSound = 350; } else if( pmove->PM_PointContents( knee, NULL ) == CONTENTS_WATER ) { step = STEP_WADE; - fvol = 0.65; + fvol = 0.65f; pmove->flTimeStepSound = 600; } else if( pmove->PM_PointContents( feet, NULL ) == CONTENTS_WATER ) { step = STEP_SLOSH; - fvol = fWalking ? 0.2 : 0.5; + fvol = fWalking ? 0.2f : 0.5f; pmove->flTimeStepSound = fWalking ? 400 : 300; } else @@ -636,31 +640,31 @@ void PM_UpdateStepSound( void ) { default: case CHAR_TEX_CONCRETE: - fvol = fWalking ? 0.2 : 0.5; + fvol = fWalking ? 0.2f : 0.5f; pmove->flTimeStepSound = fWalking ? 400 : 300; break; case CHAR_TEX_METAL: - fvol = fWalking ? 0.2 : 0.5; + fvol = fWalking ? 0.2f : 0.5f; pmove->flTimeStepSound = fWalking ? 400 : 300; break; case CHAR_TEX_DIRT: - fvol = fWalking ? 0.25 : 0.55; + fvol = fWalking ? 0.25f : 0.55f; pmove->flTimeStepSound = fWalking ? 400 : 300; break; case CHAR_TEX_VENT: - fvol = fWalking ? 0.4 : 0.7; + fvol = fWalking ? 0.4f : 0.7f; pmove->flTimeStepSound = fWalking ? 400 : 300; break; case CHAR_TEX_GRATE: - fvol = fWalking ? 0.2 : 0.5; + fvol = fWalking ? 0.2f : 0.5f; pmove->flTimeStepSound = fWalking ? 400 : 300; break; case CHAR_TEX_TILE: - fvol = fWalking ? 0.2 : 0.5; + fvol = fWalking ? 0.2f : 0.5f; pmove->flTimeStepSound = fWalking ? 400 : 300; break; case CHAR_TEX_SLOSH: - fvol = fWalking ? 0.2 : 0.5; + fvol = fWalking ? 0.2f : 0.5f; pmove->flTimeStepSound = fWalking ? 400 : 300; break; } @@ -672,7 +676,7 @@ void PM_UpdateStepSound( void ) // 35% volume if ducking if( pmove->flags & FL_DUCKING ) { - fvol *= 0.35; + fvol *= 0.35f; } PM_PlayStepSound( step, fvol ); @@ -801,11 +805,11 @@ void PM_AddCorrectGravity() if( pmove->gravity ) ent_gravity = pmove->gravity; else - ent_gravity = 1.0; + ent_gravity = 1.0f; // Add gravity so they'll be in the correct position during movement // yes, this 0.5 looks wrong, but it's not. - pmove->velocity[2] -= ( ent_gravity * pmove->movevars->gravity * 0.5 * pmove->frametime ); + pmove->velocity[2] -= ( ent_gravity * pmove->movevars->gravity * 0.5f * pmove->frametime ); pmove->velocity[2] += pmove->basevelocity[2] * pmove->frametime; pmove->basevelocity[2] = 0; @@ -822,10 +826,10 @@ void PM_FixupGravityVelocity() if( pmove->gravity ) ent_gravity = pmove->gravity; else - ent_gravity = 1.0; + ent_gravity = 1.0f; // Get the correct velocity for the end of the dt - pmove->velocity[2] -= ( ent_gravity * pmove->movevars->gravity * pmove->frametime * 0.5 ); + pmove->velocity[2] -= ( ent_gravity * pmove->movevars->gravity * pmove->frametime * 0.5f ); PM_CheckVelocity(); } @@ -911,7 +915,7 @@ int PM_FlyMove( void ) // If the plane we hit has a high z component in the normal, then // it's probably a floor - if( trace.plane.normal[2] > 0.7 ) + if( trace.plane.normal[2] > 0.7f ) { blocked |= 1; // floor } @@ -946,14 +950,14 @@ int PM_FlyMove( void ) { for( i = 0; i < numplanes; i++ ) { - if( planes[i][2] > 0.7 ) + if( planes[i][2] > 0.7f ) { // floor or slope PM_ClipVelocity( original_velocity, planes[i], new_velocity, 1 ); VectorCopy( new_velocity, original_velocity ); } else - PM_ClipVelocity( original_velocity, planes[i], new_velocity, 1.0 + pmove->movevars->bounce * ( 1 - pmove->friction ) ); + PM_ClipVelocity( original_velocity, planes[i], new_velocity, 1.0f + pmove->movevars->bounce * ( 1 - pmove->friction ) ); } VectorCopy( new_velocity, pmove->velocity ); @@ -1202,8 +1206,9 @@ void PM_WalkMove() // If we are not on the ground any more then // use the original movement attempt - if( trace.plane.normal[2] < 0.7 ) + if( trace.plane.normal[2] < 0.7f ) goto usedown; + // If the trace ended up in empty space, copy the end // over to the origin. if( !trace.startsolid && !trace.allsolid ) @@ -1274,7 +1279,7 @@ void PM_Friction( void ) trace = pmove->PM_PlayerTrace( start, stop, PM_NORMAL, -1 ); - if( trace.fraction == 1.0 ) + if( trace.fraction == 1.0f ) friction = pmove->movevars->friction*pmove->movevars->edgefriction; else friction = pmove->movevars->friction; @@ -1388,7 +1393,7 @@ void PM_WaterMove( void ) wishspeed = pmove->maxspeed; } // Slow us down a bit. - wishspeed *= 0.8; + wishspeed *= 0.8f; VectorAdd( pmove->velocity, pmove->basevelocity, pmove->velocity ); @@ -1515,8 +1520,8 @@ qboolean PM_CheckWater() float heightover2; // Pick a spot just above the players feet. - point[0] = pmove->origin[0] + ( pmove->player_mins[pmove->usehull][0] + pmove->player_maxs[pmove->usehull][0] ) * 0.5; - point[1] = pmove->origin[1] + ( pmove->player_mins[pmove->usehull][1] + pmove->player_maxs[pmove->usehull][1] ) * 0.5; + point[0] = pmove->origin[0] + ( pmove->player_mins[pmove->usehull][0] + pmove->player_maxs[pmove->usehull][0] ) * 0.5f; + point[1] = pmove->origin[1] + ( pmove->player_mins[pmove->usehull][1] + pmove->player_maxs[pmove->usehull][1] ) * 0.5f; point[2] = pmove->origin[2] + pmove->player_mins[pmove->usehull][2] + 1; // Assume that we are not in water at all. @@ -1535,7 +1540,7 @@ qboolean PM_CheckWater() pmove->waterlevel = 1; height = ( pmove->player_mins[pmove->usehull][2] + pmove->player_maxs[pmove->usehull][2] ); - heightover2 = height * 0.5; + heightover2 = height * 0.5f; // Now check a point that is at the player hull midpoint. point[2] = pmove->origin[2] + heightover2; @@ -1610,7 +1615,7 @@ void PM_CatagorizePosition( void ) // Try and move down. tr = pmove->PM_PlayerTrace( pmove->origin, point, PM_NORMAL, -1 ); // If we hit a steep plane, we are not on ground - if( tr.plane.normal[2] < 0.7 ) + if( tr.plane.normal[2] < 0.7f ) pmove->onground = -1; // too steep else pmove->onground = tr.ent; // Otherwise, point to index of ent under us. @@ -1666,7 +1671,7 @@ try nudging slightly on all axis to allow for the cut precision of the net coordinates ================= */ -#define PM_CHECKSTUCK_MINTIME 0.05 // Don't check again too quickly. +#define PM_CHECKSTUCK_MINTIME 0.05f // Don't check again too quickly. int PM_CheckStuck( void ) { @@ -1752,8 +1757,8 @@ int PM_CheckStuck( void ) if( pmove->cmd.buttons & ( IN_JUMP | IN_DUCK | IN_ATTACK ) && ( pmove->physents[hitent].player != 0 ) ) { float x, y, z; - float xystep = 8.0; - float zstep = 18.0; + float xystep = 8.0f; + float zstep = 18.0f; float xyminmax = xystep; float zminmax = 4 * zstep; @@ -1826,7 +1831,7 @@ void PM_SpectatorMove( void ) { drop = 0; - friction = pmove->movevars->friction * 1.5; // extra friction + friction = pmove->movevars->friction * 1.5f; // extra friction control = speed < pmove->movevars->stopspeed ? pmove->movevars->stopspeed : speed; drop += control * friction*pmove->frametime; @@ -2043,12 +2048,12 @@ void PM_Duck( void ) pmove->bInDuck = true; } - time = max( 0.0, ( 1.0 - (float)pmove->flDuckTime / 1000.0 ) ); + time = max( 0.0f, ( 1.0f - (float)pmove->flDuckTime / 1000.0f ) ); if( pmove->bInDuck ) { // Finish ducking immediately if duck time is over or not on ground - if( ( (float)pmove->flDuckTime / 1000.0 <= ( 1.0 - TIME_TO_DUCK ) ) || ( pmove->onground == -1 ) ) + if( ( (float)pmove->flDuckTime / 1000.0f <= ( 1.0f - TIME_TO_DUCK ) ) || ( pmove->onground == -1 ) ) { pmove->usehull = 1; pmove->view_ofs[2] = VEC_DUCK_VIEW; @@ -2074,7 +2079,7 @@ void PM_Duck( void ) float fMore = VEC_DUCK_HULL_MIN - VEC_HULL_MIN; // Calc parametric time - duckFraction = PM_SplineFraction( time, (1.0/TIME_TO_DUCK) ); + duckFraction = PM_SplineFraction( time, ( 1.0f / TIME_TO_DUCK ) ); pmove->view_ofs[2] = ( ( VEC_DUCK_VIEW - fMore ) * duckFraction ) + ( VEC_VIEW * ( 1 - duckFraction ) ); } } @@ -2116,7 +2121,7 @@ void PM_LadderMove( physent_t *pLadder ) pmove->gravity = 0; pmove->PM_TraceModel( pLadder, pmove->origin, ladderCenter, &trace ); - if( trace.fraction != 1.0 ) + if( trace.fraction != 1.0f ) { float forward = 0, right = 0; vec3_t vpn, v_right; @@ -2261,7 +2266,7 @@ void PM_AddGravity() if( pmove->gravity ) ent_gravity = pmove->gravity; else - ent_gravity = 1.0; + ent_gravity = 1.0f; // Add gravity incorrectly pmove->velocity[2] -= ( ent_gravity * pmove->movevars->gravity * pmove->frametime ); @@ -2289,7 +2294,7 @@ pmtrace_t PM_PushEntity( vec3_t push ) VectorCopy( trace.endpos, pmove->origin ); // So we can run impact function afterwards. - if( trace.fraction < 1.0 && !trace.allsolid ) + if( trace.fraction < 1.0f && !trace.allsolid ) { PM_AddToTouched( trace, pmove->velocity ); } @@ -2356,16 +2361,16 @@ void PM_Physics_Toss() } if( pmove->movetype == MOVETYPE_BOUNCE ) - backoff = 2.0 - pmove->friction; + backoff = 2.0f - pmove->friction; else if( pmove->movetype == MOVETYPE_BOUNCEMISSILE ) - backoff = 2.0; + backoff = 2.0f; else - backoff = 1; + backoff = 1.0f; PM_ClipVelocity( pmove->velocity, trace.plane.normal, pmove->velocity, backoff ); // stop if on ground - if( trace.plane.normal[2] > 0.7 ) + if( trace.plane.normal[2] > 0.7f ) { float vel; vec3_t base; @@ -2389,7 +2394,7 @@ void PM_Physics_Toss() } else { - VectorScale( pmove->velocity, ( 1.0 - trace.fraction) * pmove->frametime * 0.9, move ); + VectorScale( pmove->velocity, ( 1.0f - trace.fraction) * pmove->frametime * 0.9f, move ); trace = PM_PushEntity( move ); } VectorSubtract( pmove->velocity, base, pmove->velocity ) @@ -2461,7 +2466,7 @@ void PM_PreventMegaBunnyJumping( void ) if( spd <= maxscaledspeed ) return; - fraction = ( maxscaledspeed / spd ) * 0.65; //Returns the modifier for the velocity + fraction = ( maxscaledspeed / spd ) * 0.65f; //Returns the modifier for the velocity VectorScale( pmove->velocity, fraction, pmove->velocity ); //Crop it down!. } @@ -2566,7 +2571,7 @@ void PM_Jump( void ) } else { - PM_PlayStepSound( PM_MapTextureTypeStepType( pmove->chtexturetype ), 1.0 ); + PM_PlayStepSound( PM_MapTextureTypeStepType( pmove->chtexturetype ), 1.0f ); } // See if user can super long jump? @@ -2585,19 +2590,19 @@ void PM_Jump( void ) for( i = 0; i < 2; i++ ) { - pmove->velocity[i] = pmove->forward[i] * PLAYER_LONGJUMP_SPEED * 1.6; + pmove->velocity[i] = pmove->forward[i] * PLAYER_LONGJUMP_SPEED * 1.6f; } - pmove->velocity[2] = sqrt( 2 * 800 * 56.0 ); + pmove->velocity[2] = sqrt( 2.0f * 800.0f * 56.0f ); } else { - pmove->velocity[2] = sqrt( 2 * 800 * 45.0 ); + pmove->velocity[2] = sqrt( 2.0f * 800.0f * 45.0f ); } } else { - pmove->velocity[2] = sqrt( 2 * 800 * 45.0 ); + pmove->velocity[2] = sqrt( 2.0f * 800.0f * 45.0f ); } // Decay it for simulation @@ -2645,7 +2650,7 @@ void PM_CheckWaterJump( void ) VectorNormalize( flatforward ); // Are we backing into water from steps or something? If so, don't pop forward - if( curspeed != 0.0 && ( DotProduct( flatvelocity, flatforward ) < 0.0 ) ) + if( curspeed != 0.0f && ( DotProduct( flatvelocity, flatforward ) < 0.0f ) ) return; VectorCopy( pmove->origin, vecStart ); @@ -2657,14 +2662,14 @@ void PM_CheckWaterJump( void ) savehull = pmove->usehull; pmove->usehull = 2; tr = pmove->PM_PlayerTrace( vecStart, vecEnd, PM_NORMAL, -1 ); - if( tr.fraction < 1.0 && fabs( tr.plane.normal[2] ) < 0.1f ) // Facing a near vertical wall? + if( tr.fraction < 1.0f && fabs( tr.plane.normal[2] ) < 0.1f ) // Facing a near vertical wall? { vecStart[2] += pmove->player_maxs[savehull][2] - WJ_HEIGHT; VectorMA( vecStart, 24, flatforward, vecEnd ); VectorMA( vec3_origin, -50, tr.plane.normal, pmove->movedir ); tr = pmove->PM_PlayerTrace( vecStart, vecEnd, PM_NORMAL, -1 ); - if( tr.fraction == 1.0 ) + if( tr.fraction == 1.0f ) { pmove->waterjumptime = 2000; pmove->velocity[2] = 225; @@ -2681,7 +2686,7 @@ void PM_CheckFalling( void ) { if( pmove->onground != -1 && !pmove->dead && pmove->flFallVelocity >= PLAYER_FALL_PUNCH_THRESHHOLD ) { - float fvol = 0.5; + float fvol = 0.5f; if( pmove->waterlevel > 0 ) { @@ -2699,7 +2704,7 @@ void PM_CheckFalling( void ) pmove->PM_PlaySound( CHAN_VOICE, "player/pl_fallpain3.wav", 1, ATTN_NORM, 0, PITCH_NORM ); // break; //} - fvol = 1.0; + fvol = 1.0f; } else if( pmove->flFallVelocity > PLAYER_MAX_SAFE_FALL_SPEED / 2 ) { @@ -2718,7 +2723,7 @@ void PM_CheckFalling( void ) fvol = 0; } - if( fvol > 0.0 ) + if( fvol > 0.0f ) { // Play landing step right away pmove->flTimeStepSound = 0; @@ -2729,7 +2734,7 @@ void PM_CheckFalling( void ) PM_PlayStepSound( PM_MapTextureTypeStepType( pmove->chtexturetype ), fvol ); // Knock the screen around a little bit, temporary effect - pmove->punchangle[2] = pmove->flFallVelocity * 0.013; // punch z axis + pmove->punchangle[2] = pmove->flFallVelocity * 0.013f; // punch z axis if( pmove->punchangle[0] > 8 ) { @@ -2819,8 +2824,8 @@ void PM_DropPunchAngle( vec3_t punchangle ) float len; len = VectorNormalize( punchangle ); - len -= ( 10.0 + len * 0.5 ) * pmove->frametime; - len = max( len, 0.0 ); + len -= ( 10.0f + len * 0.5f ) * pmove->frametime; + len = max( len, 0.0f ); VectorScale( punchangle, len, punchangle ); } @@ -2841,12 +2846,12 @@ void PM_CheckParamters( void ) spd = sqrt( spd ); maxspeed = pmove->clientmaxspeed; //atof( pmove->PM_Info_ValueForKey( pmove->physinfo, "maxspd" ) ); - if( maxspeed != 0.0 ) + if( maxspeed != 0.0f ) { pmove->maxspeed = min( maxspeed, pmove->maxspeed ); } - if( ( spd != 0.0 ) && ( spd > pmove->maxspeed ) ) + if( ( spd != 0.0f ) && ( spd > pmove->maxspeed ) ) { float fRatio = pmove->maxspeed / spd; pmove->cmd.forwardmove *= fRatio; @@ -2944,7 +2949,7 @@ void PM_PlayerMove( qboolean server ) pmove->numtouch = 0; // # of msec to apply movement - pmove->frametime = pmove->cmd.msec * 0.001; + pmove->frametime = pmove->cmd.msec * 0.001f; PM_ReduceTimers(); @@ -3126,7 +3131,7 @@ void PM_PlayerMove( qboolean server ) // we don't slow when standing still, relative to the conveyor. if( pmove->onground != -1 ) { - pmove->velocity[2] = 0.0; + pmove->velocity[2] = 0.0f; PM_Friction(); } @@ -3190,7 +3195,7 @@ void PM_CreateStuckTable( void ) // Little Moves. x = y = 0; // Z moves - for( z = -0.125; z <= 0.125; z += 0.125 ) + for( z = -0.125f; z <= 0.125f; z += 0.125f ) { rgv3tStuckTable[idx][0] = x; rgv3tStuckTable[idx][1] = y; @@ -3199,7 +3204,7 @@ void PM_CreateStuckTable( void ) } x = z = 0; // Y moves - for( y = -0.125; y <= 0.125; y += 0.125 ) + for( y = -0.125f; y <= 0.125f; y += 0.125f ) { rgv3tStuckTable[idx][0] = x; rgv3tStuckTable[idx][1] = y; @@ -3208,7 +3213,7 @@ void PM_CreateStuckTable( void ) } y = z = 0; // X moves - for( x = -0.125; x <= 0.125; x += 0.125 ) + for( x = -0.125f; x <= 0.125f; x += 0.125f ) { rgv3tStuckTable[idx][0] = x; rgv3tStuckTable[idx][1] = y; @@ -3217,11 +3222,11 @@ void PM_CreateStuckTable( void ) } // Remaining multi axis nudges. - for( x = - 0.125; x <= 0.125; x += 0.250 ) + for( x = - 0.125f; x <= 0.125f; x += 0.250f ) { - for( y = - 0.125; y <= 0.125; y += 0.250 ) + for( y = - 0.125f; y <= 0.125f; y += 0.250f ) { - for( z = - 0.125; z <= 0.125; z += 0.250 ) + for( z = - 0.125f; z <= 0.125f; z += 0.250f ) { rgv3tStuckTable[idx][0] = x; rgv3tStuckTable[idx][1] = y; @@ -3250,7 +3255,7 @@ void PM_CreateStuckTable( void ) x = z = 0; // Y moves - for( y = -2.0f ; y <= 2.0f ; y += 2.0 ) + for( y = -2.0f; y <= 2.0f; y += 2.0f ) { rgv3tStuckTable[idx][0] = x; rgv3tStuckTable[idx][1] = y; @@ -3259,7 +3264,7 @@ void PM_CreateStuckTable( void ) } y = z = 0; // X moves - for( x = -2.0f ; x <= 2.0f ; x += 2.0f ) + for( x = -2.0f; x <= 2.0f; x += 2.0f ) { rgv3tStuckTable[idx][0] = x; rgv3tStuckTable[idx][1] = y; @@ -3274,7 +3279,7 @@ void PM_CreateStuckTable( void ) for( x = -2.0f; x <= 2.0f; x += 2.0f ) { - for( y = -2.0f; y <= 2.0f; y += 2.0 ) + for( y = -2.0f; y <= 2.0f; y += 2.0f ) { rgv3tStuckTable[idx][0] = x; rgv3tStuckTable[idx][1] = y; diff --git a/public/build.h b/public/build.h new file mode 100644 index 00000000..9cb7e25b --- /dev/null +++ b/public/build.h @@ -0,0 +1,219 @@ +/* +build.h - compile-time build information + +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to +*/ +#pragma once +#ifndef BUILD_H +#define BUILD_H + +// All XASH_* macros set by this header are guaranteed to have positive value otherwise not defined + +// Any new define must be undefined at first +// You can generate #undef list below with this oneliner: +// $ cat build.h | sed 's/\t//g' | grep '^#define XASH' | awk '{ print $2 }' | sort | uniq | awk '{ print "#undef " $1 }' +// +// So in various buildscripts you can grep for ^#undef XASH and select only second word +// or in another oneliner: +// $ cat build.h | grep '^#undef XASH' | awk '{ print $2 }' + +#undef XASH_64BIT +#undef XASH_AMD64 +#undef XASH_ANDROID +#undef XASH_APPLE +#undef XASH_ARM +#undef XASH_ARM64 +#undef XASH_ARM_HARDFP +#undef XASH_ARM_SOFTFP +#undef XASH_ARMv4 +#undef XASH_ARMv5 +#undef XASH_ARMv6 +#undef XASH_ARMv7 +#undef XASH_BIG_ENDIAN +#undef XASH_BSD +#undef XASH_E2K +#undef XASH_EMSCRIPTEN +#undef XASH_FREEBSD +#undef XASH_IOS +#undef XASH_JS +#undef XASH_LINUX +#undef XASH_LITTLE_ENDIAN +#undef XASH_MINGW +#undef XASH_MIPS +#undef XASH_MOBILE_PLATFORM +#undef XASH_MSVC +#undef XASH_NETBSD +#undef XASH_OPENBSD +#undef XASH_WIN32 +#undef XASH_WIN64 +#undef XASH_X86 + +//================================================================ +// +// OPERATING SYSTEM DEFINES +// +//================================================================ +#if defined(_WIN32) + #define XASH_WIN32 1 + #if defined(__MINGW32__) + #define XASH_MINGW 1 + #elif defined(_MSC_VER) + #define XASH_MSVC 1 + #endif + + #if defined(_WIN64) + #define XASH_WIN64 1 + #endif +#elif defined(__linux__) + #define XASH_LINUX 1 + #if defined(__ANDROID__) + #define XASH_ANDROID 1 + #endif // defined(__ANDROID__) +#elif defined(__APPLE__) + #include + #define XASH_APPLE 1 + #if TARGET_OS_IOS + #define XASH_IOS 1 + #endif // TARGET_OS_IOS +#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) + #define XASH_BSD 1 + #if defined(__FreeBSD__) + #define XASH_FREEBSD 1 + #elif defined(__NetBSD__) + #define XASH_NETBSD 1 + #elif defined(__OpenBSD__) + #define XASH_OPENBSD 1 + #endif +#elif defined __EMSCRIPTEN__ + #define XASH_EMSCRIPTEN 1 +#else +#error "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug" +#endif + +#if defined XASH_ANDROID || defined XASH_IOS + #define XASH_MOBILE_PLATFORM 1 +#endif + +//================================================================ +// +// ENDIANNESS DEFINES +// +//================================================================ + +#if defined(XASH_LITTLE_ENDIAN) && defined(XASH_BIG_ENDIAN) + #error "Both XASH_LITTLE_ENDIAN and XASH_BIG_ENDIAN are defined" +#endif + +#if !defined(XASH_LITTLE_ENDIAN) || !defined(XASH_BIG_ENDIAN) + #if defined XASH_MSVC || __LITTLE_ENDIAN__ + //!!! Probably all WinNT installations runs in little endian + #define XASH_LITTLE_ENDIAN 1 + #elif __BIG_ENDIAN__ + #define XASH_BIG_ENDIAN 1 + #elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && defined(__ORDER_LITTLE_ENDIAN__) // some compilers define this + #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ + #define XASH_BIG_ENDIAN 1 + #elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + #define XASH_LITTLE_ENDIAN 1 + #else + #error "Unknown endianness!" + #endif + #else + #include + #if __BYTE_ORDER == __BIG_ENDIAN + #define XASH_BIG_ENDIAN 1 + #elif __BYTE_ORDER == __LITTLE_ENDIAN + #define XASH_LITTLE_ENDIAN 1 + #else + #error "Unknown endianness!" + #endif + #endif // !XASH_WIN32 +#endif + +//================================================================ +// +// CPU ARCHITECTURE DEFINES +// +//================================================================ +#if defined(__x86_64__) || defined(_M_X64) + #define XASH_64BIT 1 + #define XASH_AMD64 1 +#elif defined(__i386__) || defined(_X86_) || defined(_M_IX86) + #define XASH_X86 1 +#elif defined __aarch64__ + #define XASH_64BIT 1 + #define XASH_ARM64 1 +#elif defined __arm__ || defined _M_ARM + #if defined _M_ARM + // msvc can only armv7 ? + #define XASH_ARM 7 + #elif __ARM_ARCH == 7 || __ARM_ARCH_7__ + #define XASH_ARM 7 + #elif __ARM_ARCH == 6 || __ARM_ARCH_6__ || __ARM_ARCH_6J__ + #define XASH_ARM 6 + #elif __ARM_ARCH == 5 || __ARM_ARCH_5__ + #define XASH_ARM 5 + #elif __ARM_ARCH == 4 || __ARM_ARCH_4__ + #define XASH_ARM 4 + #else + #error "Unknown ARM" + #endif + + #if defined _M_ARM + #error "No WinMobile port yet! Need to determine which ARM float ABI msvc uses if applicable" + #endif + + #if defined __SOFTFP__ || __ARM_PCS_VFP == 0 + #define XASH_ARM_SOFTFP 1 + #else // __SOFTFP__ + #define XASH_ARM_HARDFP 1 + #endif // __SOFTFP__ +#elif defined __mips__ + #define XASH_MIPS 1 +#elif defined __EMSCRIPTEN__ + #define XASH_JS 1 +#elif defined __e2k__ + #define XASH_64BIT 1 + #define XASH_E2K 1 +#else + #error "Place your architecture name here! If this is a mistake, try to fix conditions above and report a bug" +#endif + +#if defined(XASH_WAF_DETECTED_64BIT) && !defined(XASH_64BIT) + #define XASH_64BIT 1 +#endif + +#if XASH_ARM == 7 + #define XASH_ARMv7 1 +#elif XASH_ARM == 6 + #define XASH_ARMv6 1 +#elif XASH_ARM == 5 + #define XASH_ARMv5 1 +#elif XASH_ARM == 4 + #define XASH_ARMv4 1 +#endif + +#endif // BUILD_H diff --git a/scripts/waifulib/library_naming.py b/scripts/waifulib/library_naming.py new file mode 100644 index 00000000..77dfa6df --- /dev/null +++ b/scripts/waifulib/library_naming.py @@ -0,0 +1,127 @@ +#! /usr/bin/env python +# Copyright 2019 (C) a1batross + +from waflib import Configure, Errors, Utils + +# TODO: make generic +CHECK_SYMBOL_EXISTS_FRAGMENT = ''' +#include "build.h" + +int main(int argc, char** argv) +{ + (void)argv; +#ifndef %s + return ((int*)(&%s))[argc]; +#else + (void)argc; + return 0; +#endif +} +''' + +DEFINES = [ +'XASH_64BIT', +'XASH_AMD64', +'XASH_ANDROID', +'XASH_APPLE', +'XASH_ARM', +'XASH_ARM64', +'XASH_ARM_HARDFP', +'XASH_ARM_SOFTFP', +'XASH_ARMv4', +'XASH_ARMv5', +'XASH_ARMv6', +'XASH_ARMv7', +'XASH_BIG_ENDIAN', +'XASH_BSD', +'XASH_E2K', +'XASH_EMSCRIPTEN', +'XASH_FREEBSD', +'XASH_IOS', +'XASH_JS', +'XASH_LINUX', +'XASH_LITTLE_ENDIAN', +'XASH_MINGW', +'XASH_MIPS', +'XASH_MOBILE_PLATFORM', +'XASH_MSVC', +'XASH_NETBSD', +'XASH_OPENBSD', +'XASH_WIN32', +'XASH_WIN64', +'XASH_X86' +] + +def configure(conf): + conf.env.stash() + conf.start_msg('Determining library postfix') + tests = map(lambda x: { + 'fragment': CHECK_SYMBOL_EXISTS_FRAGMENT % (x, x), + 'includes': [conf.path.find_node('public/').abspath()], + 'define_name': x }, DEFINES ) + + conf.multicheck(*tests, msg = '', mandatory = False, quiet = True) + + # engine/common/build.c + if conf.env.XASH_ANDROID: + buildos = "android" + elif conf.env.XASH_WIN32 or conf.env.XASH_LINUX or conf.env.XASH_APPLE: + buildos = "" # no prefix for default OS + elif conf.env.XASH_FREEBSD: + buildos = "freebsd" + elif conf.env.XASH_NETBSD: + buildos = "netbsd" + elif conf.env.XASH_OPENBSD: + buildos = "openbsd" + elif conf.env.XASH_EMSCRIPTEN: + buildos = "emscripten" + else: + conf.fatal("Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug") + + if conf.env.XASH_AMD64: + buildarch = "amd64" + elif conf.env.XASH_X86: + buildarch = "" + elif conf.env.XASH_ARM64: + buildarch = "arm64" + elif conf.env.XASH_ARM: + buildarch = "armv" + if conf.env.XASH_ARMv7: + buildarch += "7" + elif conf.env.XASH_ARMv6: + buildarch += "6" + elif conf.env.XASH_ARMv5: + buildarch += "5" + elif conf.env.XASH_ARMv4: + buildarch += "4" + else: + raise conf.fatal('Unknown ARM') + + if conf.env.XASH_ARM_HARDFP: + buildarch += "hf" + else: + buildarch += "l" + elif conf.env.XASH_MIPS and conf.env.XASH_BIG_ENDIAN: + buildarch = "mips" + elif conf.env.XASH_MIPS and conf.env.XASH_LITTLE_ENDIAN: + buildarch = "mipsel" + elif conf.env.XASH_JS: + buildarch = "javascript" + elif conf.env.XASH_E2K: + buildarch = "e2k" + else: + raise conf.fatal("Place your architecture name here! If this is a mistake, try to fix conditions above and report a bug") + + conf.env.revert() + + if buildos == 'android': + # force disable for Android, as Android ports aren't distributed in normal way and doesn't follow library naming + conf.env.POSTFIX = '' + elif buildos != '' and buildarch != '': + conf.env.POSTFIX = '_%s_%s' % (buildos,buildarch) + elif buildarch != '': + conf.env.POSTFIX = '_%s' % buildarch + else: + conf.env.POSTFIX = '' + + conf.end_msg(conf.env.POSTFIX) diff --git a/scripts/waifulib/strip_on_install.py b/scripts/waifulib/strip_on_install.py new file mode 100644 index 00000000..6522065d --- /dev/null +++ b/scripts/waifulib/strip_on_install.py @@ -0,0 +1,49 @@ +#! /usr/bin/env python +# Modified: Alibek Omarov +# Originally taken from Thomas Nagy's blogpost + +""" +Strip executables upon installation +""" + +import shutil, os +from waflib import Build, Utils, Context, Errors, Logs + +def options(opt): + grp = opt.option_groups['install/uninstall options'] + grp.add_option('--no-strip', dest='no_strip', action='store_true', default=False, + help='don\'t strip binaries. You must pass this flag to install command(default: False)') + +def configure(conf): + if conf.env.DEST_BINFMT in ['elf', 'mac-o']: + conf.find_program('strip', var='STRIP') + if not conf.env.STRIPFLAGS: + conf.env.STRIPFLAGS = os.environ['STRIPFLAGS'] if 'STRIPFLAGS' in os.environ else [] + +def copy_fun(self, src, tgt): + inst_copy_fun(self, src, tgt) + + if self.generator.bld.options.no_strip: + return + + if self.env.DEST_BINFMT not in ['elf', 'mac-o']: # don't strip unknown formats or PE + return + + if getattr(self.generator, 'link_task', None) and self.generator.link_task.outputs[0] in self.inputs: + cmd = self.env.STRIP + self.env.STRIPFLAGS + [tgt] + try: + self.generator.bld.cmd_and_log(cmd, output=Context.BOTH, quiet=Context.BOTH) + if not self.generator.bld.progress_bar: + c1 = Logs.colors.NORMAL + c2 = Logs.colors.CYAN + + f1 = os.path.getsize(src) + f2 = os.path.getsize(tgt) + + Logs.info('%s+ strip %s%s%s (%d bytes change)', c1, c2, tgt, c1, f2 - f1) + except Errors.WafError as e: + print(e.stdout, e.stderr) + +inst_copy_fun = Build.inst.copy_fun +Build.inst.copy_fun = copy_fun + diff --git a/scripts/waifulib/xcompile.py b/scripts/waifulib/xcompile.py index 3244a95a..2872306f 100644 --- a/scripts/waifulib/xcompile.py +++ b/scripts/waifulib/xcompile.py @@ -13,41 +13,45 @@ try: from fwgslib import get_flags_by_compiler except: from waflib.extras.fwgslib import get_flags_by_compiler -from waflib import Logs +from waflib import Logs, TaskGen +from waflib.Tools import c_config +from collections import OrderedDict import os import sys -# Output: -# CROSSCOMPILING -- set to true, if crosscompiling is enabled -# DEST_OS2 -- as some operating systems is built on top of another, it's better to not change DEST_OS, -# instead of this DEST_OS2 is defined with target value -# For example: android is built on top of linux and have many things in common, -# but it can't be considered as default GNU/Linux. -# Possible values: -# DEST_OS2 DEST_OS -# 'android' 'linux' +ANDROID_NDK_ENVVARS = ['ANDROID_NDK_HOME', 'ANDROID_NDK'] +ANDROID_NDK_SUPPORTED = [10, 19, 20] +ANDROID_NDK_HARDFP_MAX = 11 # latest version that supports hardfp +ANDROID_NDK_GCC_MAX = 17 # latest NDK that ships with GCC +ANDROID_NDK_UNIFIED_SYSROOT_MIN = 15 +ANDROID_NDK_SYSROOT_FLAG_MAX = 19 # latest NDK that need --sysroot flag +ANDROID_NDK_API_MIN = { 10: 3, 19: 16, 20: 16 } # minimal API level ndk revision supports +ANDROID_64BIT_API_MIN = 21 # minimal API level that supports 64-bit targets -# This class does support ONLY r10e and r19c NDK +# This class does support ONLY r10e and r19c/r20 NDK class Android: ctx = None # waf context arch = None toolchain = None api = None - toolchain_path = None ndk_home = None ndk_rev = 0 is_hardfloat = False clang = False - + def __init__(self, ctx, arch, toolchain, api): self.ctx = ctx - for i in ['ANDROID_NDK_HOME', 'ANDROID_NDK']: + self.api = api + self.toolchain = toolchain + self.arch = arch + + for i in ANDROID_NDK_ENVVARS: self.ndk_home = os.getenv(i) if self.ndk_home != None: break - - if not self.ndk_home: - conf.fatal('Set ANDROID_NDK_HOME environment variable pointing to the root of Android NDK!') + else: + ctx.fatal('Set %s environment variable pointing to the root of Android NDK!' % + ' or '.join(ANDROID_NDK_ENVVARS)) # TODO: this were added at some point of NDK development # but I don't know at which version @@ -61,37 +65,35 @@ class Android: if 'Pkg.Revision' in trimed_tokens: self.ndk_rev = int(trimed_tokens[1].split('.')[0]) + + if self.ndk_rev not in ANDROID_NDK_SUPPORTED: + ctx.fatal('Unknown NDK revision: %d' % (self.ndk_rev)) else: - self.ndk_rev = 10 + self.ndk_rev = ANDROID_NDK_SUPPORTED[0] - if self.ndk_rev not in [10, 19]: - ctx.fatal('Unknown NDK revision: {}'.format(self.ndk_rev)) + if 'clang' in self.toolchain or self.ndk_rev > ANDROID_NDK_GCC_MAX: + self.clang = True - self.arch = arch if self.arch == 'armeabi-v7a-hard': - if self.ndk_rev <= 10: + if self.ndk_rev <= ANDROID_NDK_HARDFP_MAX: self.arch = 'armeabi-v7a' # Only armeabi-v7a have hard float ABI self.is_hardfloat = True else: - raise Exception('NDK does not support hardfloat ABI') + ctx.fatal('NDK does not support hardfloat ABI') - self.toolchain = toolchain + if self.api < ANDROID_NDK_API_MIN[self.ndk_rev]: + self.api = ANDROID_NDK_API_MIN[self.ndk_rev] + Logs.warn('API level automatically was set to %d due to NDK support' % self.api) - if self.ndk_rev >= 19 or 'clang' in self.toolchain: - self.clang = True + if self.is_arm64() or self.is_amd64() and self.api < ANDROID_64BIT_API_MIN: + self.api = ANDROID_64BIT_API_MIN + Logs.warn('API level for 64-bit target automatically was set to %d' % self.api) - if self.is_arm64() or self.is_amd64() and self.api < 21: - Logs.warn('API level for 64-bit target automatically was set to 21') - self.api = 21 - elif self.ndk_rev >= 19 and self.api < 16: - Logs.warn('API level automatically was set to 16 due to NDK support') - self.api = 16 - else: self.api = api - self.toolchain_path = self.gen_toolchain_path() - - # TODO: Crystax support? - # TODO: Support for everything else than linux-x86_64? - # TODO: Determine if I actually need to implement listed above + def is_host(self): + ''' + Checks if we using host compiler(implies clang) + ''' + return self.toolchain == 'host' def is_arm(self): ''' @@ -126,90 +128,158 @@ class Android: def is_hardfp(self): return self.is_hardfloat - def gen_toolchain_path(self): - path = 'toolchains' + def ndk_triplet(self, llvm_toolchain = False, toolchain_folder = False): + if self.is_x86(): + if toolchain_folder: + return 'x86' + else: + return 'i686-linux-android' + elif self.is_arm(): + if llvm_toolchain: + return 'armv7a-linux-androideabi' + else: + return 'arm-linux-androideabi' + elif self.is_amd64() and toolchain_folder: + return 'x86_64' + else: + return self.arch + '-linux-android' - if sys.platform.startswith('linux'): - toolchain_host = 'linux' + def apk_arch(self): + if self.is_arm64(): + return 'arm64-v8a' + return self.arch + + def gen_host_toolchain(self): + # With host toolchain we don't care about OS + # so just download NDK for Linux x86_64 + if self.is_host(): + return 'linux-x86_64' + + if sys.platform.startswith('win32') or sys.platform.startswith('cygwin'): + osname = 'windows' elif sys.platform.startswith('darwin'): - toolchain_host = 'darwin' - elif sys.platform.startswith('win32') or sys.platform.startswith('cygwin'): - toolchain_host = 'windows' - else: raise Exception('Unsupported by NDK host platform') + osname = 'darwin' + elif sys.platform.startswith('linux'): + osname = 'linux' + else: + self.ctx.fatal('Unsupported by NDK host platform') - toolchain_host += '-' + if sys.maxsize > 2**32: + arch = 'x86_64' + else: arch = 'x86' - # Assuming we are building on x86 - if sys.maxsize > 2**32: - toolchain_host += 'x86_64' - else: toolchain_host += 'x86' + return '%s-%s' % (osname, arch) + + def gen_gcc_toolchain_path(self): + path = 'toolchains' + toolchain_host = self.gen_host_toolchain() if self.is_clang(): - if self.ndk_rev < 19: - raise Exception('Clang is not supported for this NDK') - toolchain_folder = 'llvm' - - if self.is_x86(): - triplet = 'i686-linux-android{}-'.format(self.api) - elif self.is_arm(): - triplet = 'armv7a-linux-androideabi{}-'.format(self.api) - else: - triplet = self.arch + '-linux-android{}-'.format(self.api) else: - if self.is_x86() or self.is_amd64(): - toolchain_folder = self.arch + '-' + self.toolchain - elif self.is_arm(): - toolchain_folder = 'arm-linux-androideabi-' + self.toolchain + if self.is_host(): + toolchain = '4.9' else: - toolchain_folder = self.arch + '-linux-android-' + self.toolchain + toolchain = self.toolchain - if self.is_x86(): - triplet = 'i686-linux-android-' - elif self.is_arm(): - triplet = 'arm-linux-androideabi-' - else: - triplet = self.arch + '-linux-android-' + toolchain_folder = '%s-%s' % (self.ndk_triplet(toolchain_folder = True), toolchain) - return os.path.join(path, toolchain_folder, 'prebuilt', toolchain_host, 'bin', triplet) + return os.path.abspath(os.path.join(self.ndk_home, path, toolchain_folder, 'prebuilt', toolchain_host)) + + def gen_toolchain_path(self): + if self.is_clang(): + triplet = '%s%d-' % (self.ndk_triplet(llvm_toolchain = True), self.api) + else: + triplet = self.ndk_triplet() + '-' + return os.path.join(self.gen_gcc_toolchain_path(), 'bin', triplet) + + def gen_binutils_path(self): + return os.path.join(self.gen_gcc_toolchain_path(), self.ndk_triplet(), 'bin') def cc(self): - return os.path.abspath(os.path.join(self.ndk_home, self.toolchain_path + ('clang' if self.is_clang() else 'gcc'))) + if self.is_host(): + return 'clang --target=%s%d' % (self.ndk_triplet(), self.api) + return self.gen_toolchain_path() + ('clang' if self.is_clang() else 'gcc') def cxx(self): - return os.path.abspath(os.path.join(self.ndk_home, self.toolchain_path + ('clang++' if self.is_clang() else 'g++'))) + if self.is_host(): + return 'clang++ --target=%s%d' % (self.ndk_triplet(), self.api) + return self.gen_toolchain_path() + ('clang++' if self.is_clang() else 'g++') + + def strip(self): + if self.is_host(): + return 'llvm-strip' + return os.path.join(self.gen_binutils_path(), 'strip') def system_stl(self): # TODO: proper STL support return os.path.abspath(os.path.join(self.ndk_home, 'sources', 'cxx-stl', 'system', 'include')) + def libsysroot(self): + arch = self.arch + if self.is_arm(): + arch = 'arm' + elif self.is_arm64(): + arch = 'arm64' + path = 'platforms/android-%s/arch-%s' % (self.api, arch) + + return os.path.abspath(os.path.join(self.ndk_home, path)) + def sysroot(self): - if self.ndk_rev >= 19: + if self.ndk_rev >= ANDROID_NDK_UNIFIED_SYSROOT_MIN: return os.path.abspath(os.path.join(self.ndk_home, 'sysroot')) else: - arch = self.arch - if self.is_arm(): - arch = 'arm' - elif self.is_arm64(): - arch = 'arm64' - path = 'platforms/android-{}/arch-{}'.format(self.api, arch) + return self.libsysroot() + + def cflags(self, cxx = False): + cflags = [] + + if self.ndk_rev <= ANDROID_NDK_SYSROOT_FLAG_MAX: + cflags += ['--sysroot=%s' % (self.sysroot())] + else: + if self.is_host(): + cflags += [ + '--sysroot=%s/sysroot' % (self.gen_gcc_toolchain_path()), + '-isystem', '%s/usr/include/' % (self.sysroot()) + ] + + cflags += ['-I%s' % (self.system_stl()), '-DANDROID', '-D__ANDROID__'] + + if cxx and not self.is_clang() and self.toolchain not in ['4.8','4.9']: + cflags += ['-fno-sized-deallocation'] + + def fixup_host_clang_with_old_ndk(): + cflags = [] + # Clang builtin redefine w/ different calling convention bug + # NOTE: I did not added complex.h functions here, despite + # that NDK devs forgot to put __NDK_FPABI_MATH__ for complex + # math functions + # I personally don't need complex numbers support, but if you want it + # just run sed to patch header + for f in ['strtod', 'strtof', 'strtold']: + cflags += ['-fno-builtin-%s' % f] + return cflags - return os.path.abspath(os.path.join(self.ndk_home, path)) - def cflags(self): - cflags = ['--sysroot={0}'.format(self.sysroot()), '-DANDROID', '-D__ANDROID__'] - cflags += ['-I{0}'.format(self.system_stl())] if self.is_arm(): if self.arch == 'armeabi-v7a': # ARMv7 support cflags += ['-mthumb', '-mfpu=neon', '-mcpu=cortex-a9', '-DHAVE_EFFICIENT_UNALIGNED_ACCESS', '-DVECTORIZE_SINCOS'] - if not self.is_clang(): + + if not self.is_clang() and not self.is_host(): cflags += [ '-mvectorize-with-neon-quad' ] - if self.is_hardfloat: - cflags += ['-D_NDK_MATH_NO_SOFTFP=1', '-mhard-float', '-mfloat-abi=hard', '-DLOAD_HARDFP', '-DSOFTFP_LINK'] + + if self.is_host() and self.ndk_rev <= ANDROID_NDK_HARDFP_MAX: + cflags += fixup_host_clang_with_old_ndk() + + if self.is_hardfp(): + cflags += ['-D_NDK_MATH_NO_SOFTFP=1', '-mfloat-abi=hard', '-DLOAD_HARDFP', '-DSOFTFP_LINK'] else: cflags += ['-mfloat-abi=softfp'] else: + if self.is_host() and self.ndk_rev <= ANDROID_NDK_HARDFP_MAX: + cflags += fixup_host_clang_with_old_ndk() + # ARMv5 support cflags += ['-march=armv5te', '-mtune=xscale', '-msoft-float'] elif self.is_x86(): @@ -218,15 +288,33 @@ class Android: # they go before object list def linkflags(self): - linkflags = ['--sysroot={0}'.format(self.sysroot())] + linkflags = [] + if self.is_host(): + linkflags += ['--gcc-toolchain=%s' % self.gen_gcc_toolchain_path()] + + if self.ndk_rev <= ANDROID_NDK_SYSROOT_FLAG_MAX: + linkflags += ['--sysroot=%s' % (self.sysroot())] + elif self.is_host(): + linkflags += ['--sysroot=%s/sysroot' % (self.gen_gcc_toolchain_path())] + + if self.is_clang() or self.is_host(): + linkflags += ['-fuse-ld=lld'] + + linkflags += ['-Wl,--hash-style=both','-Wl,--no-undefined'] return linkflags def ldflags(self): ldflags = ['-lgcc', '-no-canonical-prefixes'] + if self.is_clang() or self.is_host(): + ldflags += ['-stdlib=libstdc++'] if self.is_arm(): if self.arch == 'armeabi-v7a': - ldflags += ['-march=armv7-a', '-Wl,--fix-cortex-a8', '-mthumb'] - if self.is_hardfloat: + ldflags += ['-march=armv7-a', '-mthumb'] + + if not self.is_clang() and not self.is_host(): # lld only + ldflags += ['-Wl,--fix-cortex-a8'] + + if self.is_hardfp(): ldflags += ['-Wl,--no-warn-mismatch', '-lm_hard'] else: ldflags += ['-march=armv5te'] @@ -243,17 +331,17 @@ def configure(conf): if len(values) != 3: conf.fatal('Invalid --android paramater value!') - valid_archs = ['x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'armeabi-v7a-hard', 'aarch64', 'mipsel', 'mips64el'] + valid_archs = ['x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'armeabi-v7a-hard', 'aarch64'] if values[0] not in valid_archs: - conf.fatal('Unknown arch: {}. Supported: {}'.format(values[0], ', '.join(valid_archs))) + conf.fatal('Unknown arch: %s. Supported: %r' % (values[0], ', '.join(valid_archs))) - android = Android(conf, values[0], values[1], int(values[2])) - setattr(conf, 'android', android) + conf.android = android = Android(conf, values[0], values[1], int(values[2])) conf.environ['CC'] = android.cc() conf.environ['CXX'] = android.cxx() + conf.environ['STRIP'] = android.strip() conf.env.CFLAGS += android.cflags() - conf.env.CXXFLAGS += android.cflags() + conf.env.CXXFLAGS += android.cflags(True) conf.env.LINKFLAGS += android.linkflags() conf.env.LDFLAGS += android.ldflags() @@ -262,27 +350,38 @@ def configure(conf): conf.env.LIB_M = ['m_hard'] else: conf.env.LIB_M = ['m'] - conf.env.PREFIX = '/lib/{}'.format(android.arch) + conf.env.PREFIX = '/lib/%s' % android.apk_arch() - conf.msg('Selected Android NDK', '{}, version: {}'.format(android.ndk_home, android.ndk_rev)) + conf.msg('Selected Android NDK', '%s, version: %d' % (android.ndk_home, android.ndk_rev)) # no need to print C/C++ compiler, as it would be printed by compiler_c/cxx - conf.msg('... C/C++ flags', ' '.join(android.cflags()).replace(android.ndk_home, '$NDK')) - conf.msg('... link flags', ' '.join(android.linkflags()).replace(android.ndk_home, '$NDK')) - conf.msg('... ld flags', ' '.join(android.ldflags()).replace(android.ndk_home, '$NDK')) + conf.msg('... C/C++ flags', ' '.join(android.cflags()).replace(android.ndk_home, '$NDK/')) + conf.msg('... link flags', ' '.join(android.linkflags()).replace(android.ndk_home, '$NDK/')) + conf.msg('... ld flags', ' '.join(android.ldflags()).replace(android.ndk_home, '$NDK/')) # conf.env.ANDROID_OPTS = android conf.env.DEST_OS2 = 'android' -# else: -# conf.load('compiler_c compiler_cxx') # Use host compiler :) + + MACRO_TO_DESTOS = OrderedDict({ '__ANDROID__' : 'android' }) + for k in c_config.MACRO_TO_DESTOS: + MACRO_TO_DESTOS[k] = c_config.MACRO_TO_DESTOS[k] # ordering is important + c_config.MACRO_TO_DESTOS = MACRO_TO_DESTOS def post_compiler_cxx_configure(conf): + conf.msg('Target OS', conf.env.DEST_OS) + conf.msg('Target CPU', conf.env.DEST_CPU) + conf.msg('Target binfmt', conf.env.DEST_BINFMT) + if conf.options.ANDROID_OPTS: - if conf.android.ndk_rev >= 19: + if conf.android.ndk_rev == 19: conf.env.CXXFLAGS_cxxshlib += ['-static-libstdc++'] conf.env.LDFLAGS_cxxshlib += ['-static-libstdc++'] return def post_compiler_c_configure(conf): + conf.msg('Target OS', conf.env.DEST_OS) + conf.msg('Target CPU', conf.env.DEST_CPU) + conf.msg('Target binfmt', conf.env.DEST_BINFMT) + return from waflib.Tools import compiler_cxx, compiler_c @@ -300,3 +399,20 @@ def patch_compiler_c_configure(conf): setattr(compiler_cxx, 'configure', patch_compiler_cxx_configure) setattr(compiler_c, 'configure', patch_compiler_c_configure) + +@TaskGen.feature('cshlib', 'cxxshlib', 'dshlib', 'fcshlib', 'vnum') +@TaskGen.after_method('apply_link', 'propagate_uselib_vars') +@TaskGen.before_method('apply_vnum') +def apply_android_soname(self): + """ + Enforce SONAME on Android + """ + if self.env.DEST_OS != 'android': + return + + setattr(self, 'vnum', None) # remove vnum, so SONAME would not be overwritten + link = self.link_task + node = link.outputs[0] + libname = node.name + v = self.env.SONAME_ST % libname + self.env.append_value('LINKFLAGS', v.split()) diff --git a/waf b/waf index b35987aa..ee4820ed 100755 --- a/waf +++ b/waf @@ -32,13 +32,13 @@ POSSIBILITY OF SUCH DAMAGE. import os, sys, inspect -VERSION="2.0.17" -REVISION="da8474e646911ac5657990d535080c54" -GIT="31da55afb92d9865019eb5193e874d1ffb86c522" +VERSION="2.0.18" +REVISION="b10d031bad536f1fd766be4ad9ee5a86" +GIT="00501901eb8ea3051ac023e804f9d572ddb61d89" INSTALL='' -C1='#9' -C2='#3' -C3='#*' +C1='#h' +C2='#_' +C3='#/' cwd = os.getcwd() join = os.path.join @@ -140,6 +140,9 @@ def find_lib(): if name.endswith('waf-light'): w = test(base) if w: return w + for dir in sys.path: + if test(dir): + return dir err('waf-light requires waflib -> export WAFDIR=/folder') dirname = '%s-%s-%s' % (WAF, VERSION, REVISION) @@ -160,10 +163,13 @@ wafdir = find_lib() sys.path.insert(0, wafdir) if __name__ == '__main__': + from waflib import Context + Context.WAFNAME='waifu' + Context.WAIFUVERSION='1.1.0' sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), 'scripts', 'waifulib')) from waflib import Scripting Scripting.waf_entry_point(cwd, VERSION, wafdir) #==> -#BZh91AY&SYL79u  8X0EbQ\{*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#3oKmCamvueJwt]Sf:lݶq:}S۹NNݺ7}ۡ{;RR]#9טͬ@aحٽy_>gv|axoyzw#*Ogmoޏl{3w|#*#*#*#*6>=#*N{r#*ݻaݭw+Z57:٦Im݅8F#9CMw#*DT#*"DPTzRJnT׽z>wsK+w*ۮ"jO[ppwcT>Jzz$cg׾ٻ)nmfl&vNkuuE۞R {7ZۮVm=zǽXztn9EQk^E@^G(c:uJKk/y˙zv>-5΃'#* {Ghν{{'$})#994Aq0vf[5vNͶ뾷zd.o}]ә}uCَ=)ƎN8r #*7zu_w}FzKsH(%;5IBklvv6ɗKݹY{ݞzoy(W7Uv#*#*&#*h{{^w}}EOp[;nøşj=ù ٯZP}Po5zSkiTsڽWivo#*V{ wl)NwGk^غ ؅#Y˛X.+7e}zmMWJ[p^tSt^{;{={v^&U!ܓ2#3ntX{8zkN{:>$ۭ;a}c:4#3=#*{tto;s(X;g:w4qoygl#9|ꁧ#*$=ws`x#*#9we5ۀtTP*=.Ֆ1wε=fc=jc:#*$HW&]6tvUf7YƦ6t8Ot7:|xwϞ۵ؚGux2^IٝocO}^Znp^_4#*@#*#*#*FM4i656!#*zF A2hhz6S'=OPyL51#*#*@#*#*#*$"M4$LLFFLO%GJzT#3M[NdH$ګDzV ?Go-[F2V'Ֆx* Xu2F$ý>.bzt^ťbgTCz#9@Eot\W |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PA"P15Q!H+,0B6j{ޤw18c*/Hz@:H 7|GЇ)񖜁 6`ѯI̯ggPQ Fz/zau;"UӡkOd))(j#hfNN("΢`b#/#/ZV!#hH>(e8p@B#_#/A8~I0 CC/!6G=9Z0#hHf7@j(#_q x[&#/F#/!8N/>_x5La϶e#>吣oϥ̔u59˟o5YCvU3=a#_rS,bŠ8Ai/*hAn݈z1 Y:p#_SiO&ڈԸa,| y#vdHتЖPk0nؑW$'Xɀ0BL}aj&׭k-DYQtKQg_-&<_gv/^׃o'!eDJ`!fDK~m!ӦUP[d; |9g0` 4 D#/_Ei2KgTr#_'xka/|s0H>H#/*g93i?U^#_JWԁ޽ϛ=UQOe0xy+R@_#hTF aB#_=#BhJWd!@XDfA& 3i~$=xB:?#h)EL5DQ#_!Q!CQ!_*4PDMlߗ֧}~i90"L@}|OgFҒel{ab:n@. ^BTPjۇc{x#_#_ÿsL?؂/Gufҏe)swTb+؁? s#R1;z/C~`t;@ݑ‚cǷGn󬽐(6ulN;Q.9B=O'B=,|L/m9xT; G9PtDc齥΋'F<|6Խ%p#h1i)[= FJ7&׳ݓgu*IU֕.$ڏRZJqTE3or9SCnttg;h%c(# 6Zv 䈙7J#X1Þ9:7 6@"1 b>T@(Ix4;>謹lɵ^^#_rØSPKJ?`ޝ-J#_#_ >/G*`: wܪlR3OR\>(@?~/473OdɑB`I``݇ǧ_솠Z#_ "(H? #<== diff --git a/wscript b/wscript index ede9efa4..15c4b175 100644 --- a/wscript +++ b/wscript @@ -3,15 +3,22 @@ # a1batross, mittorn, 2018 from __future__ import print_function -from waflib import Logs +from waflib import Logs, Context, Configure import sys import os -sys.path.append(os.path.realpath('scripts/waflib')) VERSION = '2.4' APPNAME = 'hlsdk-xash3d' top = '.' +Context.Context.line_just = 55 # should fit for everything on 80x26 + +@Configure.conf +def get_taskgen_count(self): + try: idx = self.tg_idx_count + except: idx = 0 # don't set tg_idx_count to not increase counter + return idx + def options(opt): grp = opt.add_option_group('Common options') @@ -19,21 +26,30 @@ def options(opt): help = 'build type: debug, release or none(custom flags)') grp.add_option('-8', '--64bits', action = 'store_true', dest = 'ALLOW64', default = False, - help = 'allow targetting 64-bit game dlls') + help = 'allow targetting 64-bit engine(Linux/Windows/OSX x86 only) [default: %default]') grp.add_option('--enable-voicemgr', action = 'store_true', dest = 'VOICEMGR', default = False, - help = 'enable voice manager') + help = 'enable voice manager [default: %default]') grp.add_option('--enable-goldsrc-support', action = 'store_true', dest = 'GOLDSRC', default = False, - help = 'enable GoldSource engine support') + help = 'enable GoldSource engine support [default: %default]') - opt.recurse('cl_dll dlls') + grp.add_option('--enable-lto', action = 'store_true', dest = 'LTO', default = False, + help = 'enable Link Time Optimization [default: %default]') + + grp.add_option('--enable-poly-opt', action = 'store_true', dest = 'POLLY', default = False, + help = 'enable polyhedral optimization if possible [default: %default]') + + grp.add_option('--enable-magx', action = 'store_true', dest = 'MAGX', default = False, + help = 'enable targetting for MotoMAGX phones [default: %default]') + + opt.load('xcompile compiler_cxx compiler_c clang_compilation_database strip_on_install') - opt.load('xcompile compiler_cxx compiler_c') if sys.platform == 'win32': - opt.load('msvc msdev') - opt.load('reconfigure') + opt.load('msvc msdev msvs') + opt.load('reconfigure subproject') + opt.add_subproject(["cl_dll", "dlls"]) def configure(conf): # Configuration @@ -43,20 +59,23 @@ def configure(conf): conf.env.SERVER_NAME = 'hl' conf.env.PREFIX = '' - conf.load('reconfigure') + conf.load('fwgslib reconfigure') + enforce_pic = True # modern defaults + valid_build_types = ['fastnative', 'fast', 'release', 'debug', 'nooptimize', 'sanitize', 'none'] + conf.load('fwgslib reconfigure') conf.start_msg('Build type') if conf.options.BUILD_TYPE == None: conf.end_msg('not set', color='RED') conf.fatal('Please set a build type, for example "-T release"') - elif not conf.options.BUILD_TYPE in ['fast', 'release', 'debug', 'nooptimize', 'sanitize', 'none']: + elif not conf.options.BUILD_TYPE in valid_build_types: conf.end_msg(conf.options.BUILD_TYPE, color='RED') - conf.fatal('Invalid build type. Valid are "debug", "release" or "none"') + conf.fatal('Invalid build type. Valid are: %s' % valid_build_types.join(', ')) conf.end_msg(conf.options.BUILD_TYPE) # -march=native should not be used if conf.options.BUILD_TYPE == 'fast': - Logs.warn('WARNING: \'fast\' build type should not be used in release builds') + Logs.warn('WARNING: \'fast\' build type should not be used in release builds') conf.env.VOICEMGR = conf.options.VOICEMGR conf.env.GOLDSRC = conf.options.GOLDSRC @@ -68,93 +87,186 @@ def configure(conf): conf.env.MSVC_TARGETS = ['x86'] # explicitly request x86 target for MSVC if sys.platform == 'win32': conf.load('msvc msdev') - conf.load('xcompile compiler_c compiler_cxx') + conf.load('xcompile compiler_c compiler_cxx strip_on_install') - if conf.env.DEST_OS2 == 'android': - conf.options.ALLOW64 = True + try: + conf.env.CC_VERSION[0] + except IndexError: + conf.env.CC_VERSION = (0, ) + + if conf.env.DEST_OS == 'android': conf.options.GOLDSRC = False conf.env.SERVER_NAME = 'server' # can't be any other name, until specified - - # print(conf.options.ALLOW64) - - conf.env.BIT32_MANDATORY = not conf.options.ALLOW64 - conf.env.BIT32_ALLOW64 = conf.options.ALLOW64 - conf.load('force_32bit') - - if conf.env.DEST_SIZEOF_VOID_P == 4: - Logs.info('NOTE: will build game dlls for 32-bit target') + + conf.env.MAGX = conf.options.MAGX + if conf.options.MAGX: + enforce_pic = False + + if enforce_pic: + # Every static library must have fPIC + if conf.env.DEST_OS != 'win32' and '-fPIC' in conf.env.CFLAGS_cshlib: + conf.env.append_unique('CFLAGS_cstlib', '-fPIC') + conf.env.append_unique('CXXFLAGS_cxxstlib', '-fPIC') else: - Logs.warn('WARNING: 64-bit game dlls may be unstable') + conf.env.CFLAGS_cshlib.remove('-fPIC') + conf.env.CXXFLAGS_cxxshlib.remove('-fPIC') + conf.env.CFLAGS_MACBUNDLE.remove('-fPIC') + conf.env.CXXFLAGS_MACBUNDLE.remove('-fPIC') + + # We restrict 64-bit builds ONLY for Win/Linux/OSX running on Intel architecture + # Because compatibility with original GoldSrc + if conf.env.DEST_OS in ['win32', 'linux', 'darwin'] and conf.env.DEST_CPU in ['x86_64']: + conf.env.BIT32_ALLOW64 = conf.options.ALLOW64 + if not conf.env.BIT32_ALLOW64: + Logs.info('WARNING: will build engine for 32-bit target') + else: + conf.env.BIT32_ALLOW64 = True + conf.env.BIT32_MANDATORY = not conf.env.BIT32_ALLOW64 + conf.load('force_32bit library_naming') linker_flags = { 'common': { - 'msvc': ['/DEBUG'], # always create PDB, doesn't affect result binaries - 'gcc': ['-Wl,--no-undefined'] + 'msvc': ['/DEBUG'], # always create PDB, doesn't affect result binaries + 'gcc': ['-Wl,--no-undefined'] }, 'sanitize': { - 'gcc': ['-fsanitize=undefined', '-fsanitize=address'], + 'clang': ['-fsanitize=undefined', '-fsanitize=address'], + 'gcc': ['-fsanitize=undefined', '-fsanitize=address'], } } compiler_c_cxx_flags = { 'common': { - 'msvc': ['/D_USING_V110_SDK71_', '/Zi', '/FS'], - 'clang': ['-g', '-gdwarf-2'], - 'gcc': ['-g', '-Werror=implicit-function-declaration', '-fdiagnostics-color=always'] + # disable thread-safe local static initialization for C++11 code, as it cause crashes on Windows XP + 'msvc': ['/D_USING_V110_SDK71_', '/Zi', '/FS', '/Zc:threadSafeInit-', '/MT'], + 'clang': ['-g', '-gdwarf-2', '-fvisibility=hidden'], + 'gcc': ['-g'] }, 'fast': { - 'msvc': ['/O2', '/Oy'], #todo: check /GL /LTCG - 'gcc': ['-Ofast', '-march=native', '-funsafe-math-optimizations', '-funsafe-loop-optimizations', '-fomit-frame-pointer'], + 'msvc': ['/O2', '/Oy'], + 'gcc': { + '3': ['-O3', '-Os', '-funsafe-math-optimizations', '-fomit-frame-pointer'], + 'default': ['-Ofast', '-funsafe-math-optimizations', '-funsafe-loop-optimizations', '-fomit-frame-pointer'] + }, + 'clang': ['-Ofast'], + 'default': ['-O3'] + }, + 'fastnative': { + 'msvc': ['/O2', '/Oy'], + 'gcc': ['-Ofast', '-march=native', '-funsafe-math-optimizations', '-funsafe-loop-optimizations', '-fomit-frame-pointer'], + 'clang': ['-Ofast', '-march=native'], 'default': ['-O3'] }, 'release': { - 'msvc': ['/O2'], + 'msvc': ['/O2'], 'default': ['-O3'] }, 'debug': { - 'msvc': ['/O1'], - 'gcc': ['-Og'], + 'msvc': ['/O1'], + 'gcc': ['-Og'], 'default': ['-O1'] }, 'sanitize': { - 'msvc': ['/Od', '/RTC1'], - 'gcc': ['-Og', '-fsanitize=undefined', '-fsanitize=address'], - 'default': ['-O1'] + 'msvc': ['/Od', '/RTC1'], + 'gcc': ['-Og', '-fsanitize=undefined', '-fsanitize=address'], + 'clang': ['-O0', '-fsanitize=undefined', '-fsanitize=address'], + 'default': ['-O0'] }, 'nooptimize': { - 'msvc': ['/Od'], + 'msvc': ['/Od'], 'default': ['-O0'] } } - conf.env.append_unique('CFLAGS', conf.get_flags_by_type( - compiler_c_cxx_flags, conf.options.BUILD_TYPE, conf.env.COMPILER_CC)) - conf.env.append_unique('CXXFLAGS', conf.get_flags_by_type( - compiler_c_cxx_flags, conf.options.BUILD_TYPE, conf.env.COMPILER_CC)) - conf.env.append_unique('LINKFLAGS', conf.get_flags_by_type( - linker_flags, conf.options.BUILD_TYPE, conf.env.COMPILER_CC)) + compiler_optional_flags = [ + '-fdiagnostics-color=always', + '-Werror=implicit-function-declaration', + '-Werror=int-conversion', + '-Werror=return-type', + '-Werror=parentheses', + '-Werror=vla', + '-Werror=tautological-compare', + '-Werror=duplicated-cond', + '-Werror=bool-compare', + '-Werror=bool-operation', + '-Wstrict-aliasing', + ] + + c_compiler_optional_flags = [ + '-Werror=implicit-int', + '-Werror=declaration-after-statement' + ] + + linkflags = conf.get_flags_by_type(linker_flags, conf.options.BUILD_TYPE, conf.env.COMPILER_CC, conf.env.CC_VERSION[0]) + cflags = conf.get_flags_by_type(compiler_c_cxx_flags, conf.options.BUILD_TYPE, conf.env.COMPILER_CC, conf.env.CC_VERSION[0]) + + # Here we don't differentiate C or C++ flags + if conf.options.LTO: + lto_cflags = { + 'msvc': ['/GL'], + 'gcc': ['-flto'], + 'clang': ['-flto'] + } + + lto_linkflags = { + 'msvc': ['/LTCG'], + 'gcc': ['-flto'], + 'clang': ['-flto'] + } + cflags += conf.get_flags_by_compiler(lto_cflags, conf.env.COMPILER_CC) + linkflags += conf.get_flags_by_compiler(lto_linkflags, conf.env.COMPILER_CC) + + if conf.options.POLLY: + polly_cflags = { + 'gcc': ['-fgraphite-identity'], + 'clang': ['-mllvm', '-polly'] + # msvc sosat :( + } + + cflags += conf.get_flags_by_compiler(polly_cflags, conf.env.COMPILER_CC) + + # And here C++ flags starts to be treated separately + cxxflags = list(cflags) + if conf.env.COMPILER_CC != 'msvc': + conf.check_cc(cflags=cflags, msg= 'Checking for required C flags') + conf.check_cxx(cxxflags=cflags, msg= 'Checking for required C++ flags') + + cflags += conf.filter_cflags(compiler_optional_flags + c_compiler_optional_flags, cflags) + cxxflags += conf.filter_cxxflags(compiler_optional_flags, cflags) + + conf.env.append_unique('CFLAGS', cflags) + conf.env.append_unique('CXXFLAGS', cxxflags) + conf.env.append_unique('LINKFLAGS', linkflags) + + # check if we can use C99 tgmath + if conf.check_cc(header_name='tgmath.h', mandatory=False): + tgmath_usable = conf.check_cc(fragment='''#include + int main(void){ return (int)sin(2.0f); }''', + msg='Checking if tgmath.h is usable', mandatory=False) + conf.define_cond('HAVE_TGMATH_H', tgmath_usable) + else: + conf.undefine('HAVE_TGMATH_H') if conf.env.COMPILER_CC == 'msvc': - conf.env.append_unique('DEFINES', ['_CRT_SECURE_NO_WARNINGS','_CRT_NONSTDC_NO_DEPRECATE']) + conf.define('_CRT_SECURE_NO_WARNINGS', 1) + conf.define('_CRT_NONSTDC_NO_DEPRECATE', 1) else: - conf.env.append_unique('DEFINES', ['stricmp=strcasecmp','strnicmp=strncasecmp','_LINUX','LINUX','_snprintf=snprintf','_vsnprintf=vsnprintf']) - cflags = ['-fvisibility=hidden','-Wno-write-strings'] - conf.env.append_unique('CFLAGS', cflags) - conf.env.append_unique('CXXFLAGS', cflags + ['-Wno-invalid-offsetof', '-fno-rtti', '-fno-exceptions']) + conf.env.append_unique('DEFINES', ['stricmp=strcasecmp', 'strnicmp=strncasecmp', '_snprintf=snprintf', '_vsnprintf=vsnprintf', '_LINUX', 'LINUX']) + conf.env.append_unique('CXXFLAGS', ['-Wno-invalid-offsetof', '-fno-rtti', '-fno-exceptions']) # strip lib from pattern - if conf.env.DEST_OS in ['linux', 'darwin'] and conf.env.DEST_OS2 not in ['android']: + if conf.env.DEST_OS in ['linux', 'darwin']: if conf.env.cshlib_PATTERN.startswith('lib'): conf.env.cshlib_PATTERN = conf.env.cshlib_PATTERN[3:] if conf.env.cxxshlib_PATTERN.startswith('lib'): conf.env.cxxshlib_PATTERN = conf.env.cxxshlib_PATTERN[3:] - conf.env.append_unique('DEFINES', 'CLIENT_WEAPONS') + conf.define('CLIENT_WEAPONS', '1') - conf.recurse('cl_dll dlls') + conf.add_subproject(["cl_dll", "dlls"]) def build(bld): - bld.recurse('cl_dll dlls') - - - + bld.add_subproject(["cl_dll", "dlls"]) + + +