1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-01-04 00:23:25 +08:00

Modified SDK for GCC 4.2

This commit is contained in:
Scott Ehlert 2008-09-15 02:50:57 -05:00
parent 86f3bc8a60
commit 7ff7f366d5
696 changed files with 23423 additions and 22634 deletions

View File

@ -105,6 +105,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vprojtomake", "utils\vprojt
{E1DA8DB8-FB4C-4B14-91A6-98BCED6B9720} = {E1DA8DB8-FB4C-4B14-91A6-98BCED6B9720} {E1DA8DB8-FB4C-4B14-91A6-98BCED6B9720} = {E1DA8DB8-FB4C-4B14-91A6-98BCED6B9720}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "choreoobjects", "choreoobjects\choreoobjects-2005.vcproj", "{E60CA0E5-422B-450A-B185-53DDB734FF6B}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32 Debug|Win32 = Debug|Win32
@ -195,6 +197,10 @@ Global
{EA55446E-BC04-491C-A9F0-605DFCBB213A}.Debug|Win32.Build.0 = Debug|Win32 {EA55446E-BC04-491C-A9F0-605DFCBB213A}.Debug|Win32.Build.0 = Debug|Win32
{EA55446E-BC04-491C-A9F0-605DFCBB213A}.Release|Win32.ActiveCfg = Release|Win32 {EA55446E-BC04-491C-A9F0-605DFCBB213A}.Release|Win32.ActiveCfg = Release|Win32
{EA55446E-BC04-491C-A9F0-605DFCBB213A}.Release|Win32.Build.0 = Release|Win32 {EA55446E-BC04-491C-A9F0-605DFCBB213A}.Release|Win32.Build.0 = Release|Win32
{E60CA0E5-422B-450A-B185-53DDB734FF6B}.Debug|Win32.ActiveCfg = Debug|Win32
{E60CA0E5-422B-450A-B185-53DDB734FF6B}.Debug|Win32.Build.0 = Debug|Win32
{E60CA0E5-422B-450A-B185-53DDB734FF6B}.Release|Win32.ActiveCfg = Release|Win32
{E60CA0E5-422B-450A-B185-53DDB734FF6B}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@ -0,0 +1,262 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="choreoobjects"
ProjectGUID="{E60CA0E5-422B-450A-B185-53DDB734FF6B}"
RootNamespace="choreoobjects"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="4"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine=""
ExcludedFromBuild="false"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
UseUnicodeResponseFiles="false"
Optimization="0"
AdditionalIncludeDirectories="..\public;..\public\tier0;..\public\tier1;..\game\shared;..\utils\common"
PreprocessorDefinitions="WIN32;_WIN32;_DEBUG;DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;CHOREOOBJECTS_STATIC_LIB"
StringPooling="true"
MinimalRebuild="true"
ExceptionHandling="0"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
BufferSecurityCheck="false"
FloatingPointModel="2"
TreatWChar_tAsBuiltInType="true"
ForceConformanceInForLoopScope="true"
RuntimeTypeInfo="true"
OpenMP="false"
UsePrecompiledHeader="0"
ExpandAttributedSource="false"
AssemblerOutput="0"
AssemblerListingLocation="$(IntDir)/"
ObjectFile="$(IntDir)/"
ProgramDataBaseFileName="$(IntDir)/"
GenerateXMLDocumentationFiles="false"
BrowseInformation="0"
BrowseInformationFile="$(IntDir)/"
WarningLevel="4"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
CompileAs="2"
ErrorReporting="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
CommandLine=""
ExcludedFromBuild="false"
/>
<Tool
Name="VCLibrarianTool"
UseUnicodeResponseFiles="false"
OutputFile="..\lib\public\choreoobjects.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
SuppressStartupBanner="true"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile="$(OutDir)/choreoobjects.bsc"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
ExcludedFromBuild="false"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="4"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine=""
ExcludedFromBuild="false"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
UseUnicodeResponseFiles="false"
Optimization="2"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="..\public;..\public\tier0;..\public\tier1;..\game\shared;..\utils\common"
PreprocessorDefinitions="WIN32;_WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;CHOREOOBJECTS_STATIC_LIB"
StringPooling="true"
ExceptionHandling="0"
RuntimeLibrary="0"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
FloatingPointModel="2"
TreatWChar_tAsBuiltInType="true"
ForceConformanceInForLoopScope="true"
RuntimeTypeInfo="true"
OpenMP="false"
UsePrecompiledHeader="0"
ExpandAttributedSource="false"
AssemblerOutput="0"
AssemblerListingLocation="$(IntDir)/"
ObjectFile="$(IntDir)/"
ProgramDataBaseFileName="$(IntDir)/"
GenerateXMLDocumentationFiles="false"
BrowseInformation="0"
BrowseInformationFile="$(IntDir)/"
WarningLevel="4"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="1"
CompileAs="2"
ErrorReporting="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
CommandLine=""
ExcludedFromBuild="false"
/>
<Tool
Name="VCLibrarianTool"
UseUnicodeResponseFiles="false"
OutputFile="..\lib\public\choreoobjects.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
SuppressStartupBanner="true"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile="$(OutDir)/choreoobjects.bsc"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
ExcludedFromBuild="false"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="..\game\shared\choreoactor.cpp"
>
</File>
<File
RelativePath="..\game\shared\choreochannel.cpp"
>
</File>
<File
RelativePath="..\game\shared\choreoevent.cpp"
>
</File>
<File
RelativePath="..\game\shared\choreoscene.cpp"
>
</File>
<File
RelativePath="..\game\shared\sceneimage.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath="..\game\shared\choreoactor.h"
>
</File>
<File
RelativePath="..\game\shared\choreochannel.h"
>
</File>
<File
RelativePath="..\game\shared\choreoevent.h"
>
</File>
<File
RelativePath="..\game\shared\choreoscene.h"
>
</File>
<File
RelativePath="..\game\shared\sceneimage.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -361,7 +361,7 @@ void C_ClientRagdoll::OnRestore( void )
RagdollMoved(); RagdollMoved();
} }
void C_ClientRagdoll::ImpactTrace( trace_t *pTrace, int iDamageType, char *pCustomImpactName ) void C_ClientRagdoll::ImpactTrace( trace_t *pTrace, int iDamageType, const char *pCustomImpactName )
{ {
VPROF( "C_ClientRagdoll::ImpactTrace" ); VPROF( "C_ClientRagdoll::ImpactTrace" );
@ -876,7 +876,7 @@ void C_BaseAnimating::LockStudioHdr()
if ( pStudioHdrContainer && pStudioHdrContainer->GetVirtualModel() ) if ( pStudioHdrContainer && pStudioHdrContainer->GetVirtualModel() )
{ {
MDLHandle_t hVirtualModel = (MDLHandle_t)pStudioHdrContainer->GetRenderHdr()->virtualModel; MDLHandle_t hVirtualModel = (MDLHandle_t)reinterpret_cast<intptr_t>(pStudioHdrContainer->GetRenderHdr()->virtualModel);
mdlcache->LockStudioHdr( hVirtualModel ); mdlcache->LockStudioHdr( hVirtualModel );
} }
m_pStudioHdr = pStudioHdrContainer; // must be last to ensure virtual model correctly set up m_pStudioHdr = pStudioHdrContainer; // must be last to ensure virtual model correctly set up
@ -894,7 +894,7 @@ void C_BaseAnimating::UnlockStudioHdr()
mdlcache->UnlockStudioHdr( m_hStudioHdr ); mdlcache->UnlockStudioHdr( m_hStudioHdr );
if ( m_pStudioHdr->GetVirtualModel() ) if ( m_pStudioHdr->GetVirtualModel() )
{ {
MDLHandle_t hVirtualModel = (MDLHandle_t)m_pStudioHdr->GetRenderHdr()->virtualModel; MDLHandle_t hVirtualModel = (MDLHandle_t)reinterpret_cast<intptr_t>(m_pStudioHdr->GetRenderHdr()->virtualModel);
mdlcache->UnlockStudioHdr( hVirtualModel ); mdlcache->UnlockStudioHdr( hVirtualModel );
} }
} }

View File

@ -597,7 +597,7 @@ public:
virtual void Release( void ); virtual void Release( void );
virtual void SetupWeights( const matrix3x4_t *pBoneToWorld, int nFlexWeightCount, float *pFlexWeights, float *pFlexDelayedWeights ); virtual void SetupWeights( const matrix3x4_t *pBoneToWorld, int nFlexWeightCount, float *pFlexWeights, float *pFlexDelayedWeights );
virtual void ImpactTrace( trace_t *pTrace, int iDamageType, char *pCustomImpactName ); virtual void ImpactTrace( trace_t *pTrace, int iDamageType, const char *pCustomImpactName );
void ClientThink( void ); void ClientThink( void );
void ReleaseRagdoll( void ) { m_bReleaseRagdoll = true; } void ReleaseRagdoll( void ) { m_bReleaseRagdoll = true; }
bool ShouldSavePhysics( void ) { return true; } bool ShouldSavePhysics( void ) { return true; }

View File

@ -813,7 +813,7 @@ public:
virtual char const * DamageDecal( int bitsDamageType, int gameMaterial ); virtual char const * DamageDecal( int bitsDamageType, int gameMaterial );
virtual void DecalTrace( trace_t *pTrace, char const *decalName ); virtual void DecalTrace( trace_t *pTrace, char const *decalName );
virtual void ImpactTrace( trace_t *pTrace, int iDamageType, char *pCustomImpactName ); virtual void ImpactTrace( trace_t *pTrace, int iDamageType, const char *pCustomImpactName );
virtual bool ShouldPredict( void ) { return false; }; virtual bool ShouldPredict( void ) { return false; };
// interface function pointers // interface function pointers
@ -1122,7 +1122,7 @@ public:
#ifdef _DEBUG #ifdef _DEBUG
void FunctionCheck( void *pFunction, const char *name ); void FunctionCheck( void *pFunction, const char *name );
ENTITYFUNCPTR TouchSet( ENTITYFUNCPTR func, char *name ) ENTITYFUNCPTR TouchSet( ENTITYFUNCPTR func, const char *name )
{ {
//COMPILE_TIME_ASSERT( sizeof(func) == 4 ); //COMPILE_TIME_ASSERT( sizeof(func) == 4 );
m_pfnTouch = func; m_pfnTouch = func;

View File

@ -1868,7 +1868,7 @@ void C_BasePlayer::PlayPlayerJingle()
} }
// Stuff for prediction // Stuff for prediction
void C_BasePlayer::SetSuitUpdate(char *name, int fgroup, int iNoRepeat) void C_BasePlayer::SetSuitUpdate(const char *name, int fgroup, int iNoRepeat)
{ {
// FIXME: Do something here? // FIXME: Do something here?
} }

View File

@ -114,7 +114,7 @@ public:
virtual void Weapon_DropPrimary( void ) {} virtual void Weapon_DropPrimary( void ) {}
virtual Vector GetAutoaimVector( float flScale ); virtual Vector GetAutoaimVector( float flScale );
void SetSuitUpdate(char *name, int fgroup, int iNoRepeat); void SetSuitUpdate(const char *name, int fgroup, int iNoRepeat);
// Input handling // Input handling
virtual bool CreateMove( float flInputSampleTime, CUserCmd *pCmd ); virtual bool CreateMove( float flInputSampleTime, CUserCmd *pCmd );

View File

@ -4,6 +4,7 @@
Version="8.00" Version="8.00"
Name="Client (HL2)" Name="Client (HL2)"
ProjectGUID="{F2D9D6B0-DEE5-4217-9336-A4FEBA24C790}" ProjectGUID="{F2D9D6B0-DEE5-4217-9336-A4FEBA24C790}"
RootNamespace="Client (HL2)"
> >
<Platforms> <Platforms>
<Platform <Platform
@ -28,8 +29,8 @@
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Copying to destination folder" Description="Copying to destination folder"
CommandLine="if exist &quot;..\..\game\hl2\bin\client.dll&quot; attrib -r &quot;..\..\game\hl2\bin\client.dll&quot;&#x0D;&#x0A;copy &quot;$(TargetDir)&quot;client.dll &quot;..\..\game\hl2\bin&quot;&#x0D;&#x0A;" CommandLine="if exist ..\..\..\game\hl2\bin\&quot;$(TargetName)&quot;.dll attrib -r ..\..\..\game\hl2\bin\&quot;$(TargetName)&quot;.dll&#x0D;&#x0A;copy &quot;$(TargetPath)&quot; ..\..\..\game\hl2\bin\&quot;$(TargetName)&quot;.dll&#x0D;&#x0A;if exist ..\..\..\game\hl2\bin\&quot;$(TargetName)&quot;.pdb attrib -r ..\..\..\game\hl2\bin\&quot;$(TargetName)&quot;.pdb&#x0D;&#x0A;copy &quot;$(TargetPath)&quot; ..\..\..\game\hl2\bin\&quot;$(TargetName)&quot;.pdb&#x0D;&#x0A;"
Outputs="..\..\game\hl2\bin\client.dll" Outputs="..\..\..\game\hl2\bin\client.dll;..\..\..\game\hl2\bin\client.pdb"
/> />
<Tool <Tool
Name="VCXMLDataGeneratorTool" Name="VCXMLDataGeneratorTool"
@ -87,7 +88,7 @@
UseUnicodeResponseFiles="false" UseUnicodeResponseFiles="false"
AdditionalDependencies="winmm.lib" AdditionalDependencies="winmm.lib"
ShowProgress="0" ShowProgress="0"
OutputFile="$(OutDir)/Client.dll" OutputFile="$(OutDir)/client.dll"
LinkIncremental="2" LinkIncremental="2"
SuppressStartupBanner="true" SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\lib\common;..\..\lib\public" AdditionalLibraryDirectories="..\..\lib\common;..\..\lib\public"
@ -148,8 +149,8 @@
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Copying to destination folder" Description="Copying to destination folder"
CommandLine="if exist &quot;..\..\game\hl2\bin\client.dll&quot; attrib -r &quot;..\..\game\hl2\bin\client.dll&quot;&#x0D;&#x0A;copy &quot;$(TargetDir)&quot;client.dll &quot;..\..\game\hl2\bin&quot;&#x0D;&#x0A;if exist &quot;..\..\game\hl2\bin\client.pdb&quot; attrib -r &quot;..\..\game\hl2\bin\client.pdb&quot;&#x0D;&#x0A;if exist &quot;$(TargetDir)&quot;client.pdb copy &quot;$(TargetDir)&quot;client.pdb &quot;..\..\game\hl2\bin\client.pdb&quot;&#x0D;&#x0A;" CommandLine="if exist ..\..\..\game\hl2\bin\&quot;$(TargetName)&quot;.dll attrib -r ..\..\..\game\hl2\bin\&quot;$(TargetName)&quot;.dll&#x0D;&#x0A;copy &quot;$(TargetPath)&quot; ..\..\..\game\hl2\bin\&quot;$(TargetName)&quot;.dll&#x0D;&#x0A;if exist ..\..\..\game\hl2\bin\&quot;$(TargetName)&quot;.pdb attrib -r ..\..\..\game\hl2\bin\&quot;$(TargetName)&quot;.pdb&#x0D;&#x0A;copy &quot;$(TargetPath)&quot; ..\..\..\game\hl2\bin\&quot;$(TargetName)&quot;.pdb&#x0D;&#x0A;"
Outputs="..\..\game\hl2\bin\client.dll&quot;;&quot;..\..\game\hl2\bin\client.pdb" Outputs="..\..\..\game\hl2\bin\client.dll;..\..\..\game\hl2\bin\client.pdb"
/> />
<Tool <Tool
Name="VCXMLDataGeneratorTool" Name="VCXMLDataGeneratorTool"
@ -209,7 +210,7 @@
UseUnicodeResponseFiles="false" UseUnicodeResponseFiles="false"
AdditionalDependencies="winmm.lib" AdditionalDependencies="winmm.lib"
ShowProgress="0" ShowProgress="0"
OutputFile="$(OutDir)/Client.dll" OutputFile="$(OutDir)/client.dll"
LinkIncremental="1" LinkIncremental="1"
SuppressStartupBanner="true" SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\lib\common;..\..\lib\public" AdditionalLibraryDirectories="..\..\lib\common;..\..\lib\public"
@ -263,6 +264,7 @@
<Files> <Files>
<Filter <Filter
Name="Source Files" Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
> >
<File <File
RelativePath=".\achievement_notification_panel.cpp" RelativePath=".\achievement_notification_panel.cpp"
@ -2755,6 +2757,7 @@
</Filter> </Filter>
<Filter <Filter
Name="Link Libraries" Name="Link Libraries"
Filter="lib"
> >
<File <File
RelativePath="..\..\lib\public\bitmap.lib" RelativePath="..\..\lib\public\bitmap.lib"
@ -2811,6 +2814,7 @@
</Filter> </Filter>
<Filter <Filter
Name="MP3" Name="MP3"
Filter="h;cpp"
> >
<File <File
RelativePath=".\mp3player.cpp" RelativePath=".\mp3player.cpp"
@ -2823,6 +2827,7 @@
</Filter> </Filter>
<Filter <Filter
Name="Tool Framework" Name="Tool Framework"
Filter="h;cpp"
> >
<File <File
RelativePath="..\..\public\tools\bonelist.cpp" RelativePath="..\..\public\tools\bonelist.cpp"
@ -2847,6 +2852,7 @@
</Filter> </Filter>
<Filter <Filter
Name="Header Files" Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
> >
<File <File
RelativePath=".\animationlayer.h" RelativePath=".\animationlayer.h"
@ -3627,6 +3633,7 @@
</Filter> </Filter>
<Filter <Filter
Name="Public Header Files" Name="Public Header Files"
Filter="h"
> >
<File <File
RelativePath="..\..\public\mathlib\amd3dx.h" RelativePath="..\..\public\mathlib\amd3dx.h"
@ -4527,6 +4534,7 @@
</Filter> </Filter>
<Filter <Filter
Name="Game Shared Header Files" Name="Game Shared Header Files"
Filter="h"
> >
<File <File
RelativePath="..\shared\activitylist.h" RelativePath="..\shared\activitylist.h"
@ -4995,6 +5003,7 @@
</Filter> </Filter>
<Filter <Filter
Name="game_controls Header Files" Name="game_controls Header Files"
Filter="h"
> >
<File <File
RelativePath=".\game_controls\baseviewport.h" RelativePath=".\game_controls\baseviewport.h"

View File

@ -4,6 +4,7 @@
Version="8.00" Version="8.00"
Name="Client (HL2MP)" Name="Client (HL2MP)"
ProjectGUID="{5FE91DC8-B6DF-4061-984E-36FD36623E72}" ProjectGUID="{5FE91DC8-B6DF-4061-984E-36FD36623E72}"
RootNamespace="Client (HL2MP)"
> >
<Platforms> <Platforms>
<Platform <Platform
@ -28,8 +29,8 @@
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Copying to destination folder" Description="Copying to destination folder"
CommandLine="if exist &quot;..\..\game\hl2\bin\client.dll&quot; attrib -r &quot;..\..\game\hl2\bin\client.dll&quot;&#x0D;&#x0A;copy &quot;$(TargetDir)&quot;client.dll &quot;..\..\game\hl2\bin&quot;&#x0D;&#x0A;" CommandLine="if exist ..\..\..\game\hl2mp\bin\&quot;$(TargetName)&quot;.dll attrib -r ..\..\..\game\hl2mp\bin\&quot;$(TargetName)&quot;.dll&#x0D;&#x0A;copy &quot;$(TargetPath)&quot; ..\..\..\game\hl2mp\bin\&quot;$(TargetName)&quot;.dll&#x0D;&#x0A;if exist ..\..\..\game\hl2mp\bin\&quot;$(TargetName)&quot;.pdb attrib -r ..\..\..\game\hl2mp\bin\&quot;$(TargetName)&quot;.pdb&#x0D;&#x0A;copy &quot;$(TargetPath)&quot; ..\..\..\game\hl2mp\bin\&quot;$(TargetName)&quot;.pdb&#x0D;&#x0A;"
Outputs="..\..\game\hl2\bin\client.dll" Outputs="..\..\..\game\hl2mp\bin\client.dll;..\..\..\game\hl2mp\bin\client.pdb"
/> />
<Tool <Tool
Name="VCXMLDataGeneratorTool" Name="VCXMLDataGeneratorTool"
@ -87,7 +88,7 @@
UseUnicodeResponseFiles="false" UseUnicodeResponseFiles="false"
AdditionalDependencies="winmm.lib" AdditionalDependencies="winmm.lib"
ShowProgress="0" ShowProgress="0"
OutputFile="$(OutDir)/Client.dll" OutputFile="$(OutDir)/client.dll"
LinkIncremental="2" LinkIncremental="2"
SuppressStartupBanner="true" SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\lib\common;..\..\lib\public" AdditionalLibraryDirectories="..\..\lib\common;..\..\lib\public"
@ -148,8 +149,8 @@
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Copying to destination folder" Description="Copying to destination folder"
CommandLine="if exist &quot;..\..\game\hl2\bin\client.dll&quot; attrib -r &quot;..\..\game\hl2\bin\client.dll&quot;&#x0D;&#x0A;copy &quot;$(TargetDir)&quot;client.dll &quot;..\..\game\hl2\bin&quot;&#x0D;&#x0A;if exist &quot;..\..\game\hl2\bin\client.pdb&quot; attrib -r &quot;..\..\game\hl2\bin\client.pdb&quot;&#x0D;&#x0A;if exist &quot;$(TargetDir)&quot;client.pdb copy &quot;$(TargetDir)&quot;client.pdb &quot;..\..\game\hl2\bin\client.pdb&quot;&#x0D;&#x0A;" CommandLine="if exist ..\..\..\game\hl2mp\bin\&quot;$(TargetName)&quot;.dll attrib -r ..\..\..\game\hl2mp\bin\&quot;$(TargetName)&quot;.dll&#x0D;&#x0A;copy &quot;$(TargetPath)&quot; ..\..\..\game\hl2mp\bin\&quot;$(TargetName)&quot;.dll&#x0D;&#x0A;if exist ..\..\..\game\hl2mp\bin\&quot;$(TargetName)&quot;.pdb attrib -r ..\..\..\game\hl2mp\bin\&quot;$(TargetName)&quot;.pdb&#x0D;&#x0A;copy &quot;$(TargetPath)&quot; ..\..\..\game\hl2mp\bin\&quot;$(TargetName)&quot;.pdb&#x0D;&#x0A;"
Outputs="..\..\game\hl2\bin\client.dll&quot;;&quot;..\..\game\hl2\bin\client.pdb" Outputs="..\..\..\game\hl2mp\bin\client.dll;..\..\..\game\hl2mp\bin\client.pdb"
/> />
<Tool <Tool
Name="VCXMLDataGeneratorTool" Name="VCXMLDataGeneratorTool"
@ -209,7 +210,7 @@
UseUnicodeResponseFiles="false" UseUnicodeResponseFiles="false"
AdditionalDependencies="winmm.lib" AdditionalDependencies="winmm.lib"
ShowProgress="0" ShowProgress="0"
OutputFile="$(OutDir)/Client.dll" OutputFile="$(OutDir)/client.dll"
LinkIncremental="1" LinkIncremental="1"
SuppressStartupBanner="true" SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\lib\common;..\..\lib\public" AdditionalLibraryDirectories="..\..\lib\common;..\..\lib\public"
@ -263,6 +264,7 @@
<Files> <Files>
<Filter <Filter
Name="Source Files" Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
> >
<File <File
RelativePath=".\achievement_notification_panel.cpp" RelativePath=".\achievement_notification_panel.cpp"
@ -1864,6 +1866,10 @@
RelativePath="..\shared\teamplay_gamerules.cpp" RelativePath="..\shared\teamplay_gamerules.cpp"
> >
</File> </File>
<File
RelativePath="..\shared\teamplay_round_timer.cpp"
>
</File>
<File <File
RelativePath="..\shared\teamplayroundbased_gamerules.cpp" RelativePath="..\shared\teamplayroundbased_gamerules.cpp"
> >
@ -2923,6 +2929,7 @@
</Filter> </Filter>
<Filter <Filter
Name="Link Libraries" Name="Link Libraries"
Filter="lib"
> >
<File <File
RelativePath="..\..\lib\public\bitmap.lib" RelativePath="..\..\lib\public\bitmap.lib"
@ -2987,6 +2994,7 @@
</Filter> </Filter>
<Filter <Filter
Name="MP3" Name="MP3"
Filter="h;cpp"
> >
<File <File
RelativePath=".\mp3player.cpp" RelativePath=".\mp3player.cpp"
@ -2999,6 +3007,7 @@
</Filter> </Filter>
<Filter <Filter
Name="Tool Framework" Name="Tool Framework"
Filter="h;cpp"
> >
<File <File
RelativePath="..\..\public\tools\bonelist.cpp" RelativePath="..\..\public\tools\bonelist.cpp"
@ -3023,6 +3032,7 @@
</Filter> </Filter>
<Filter <Filter
Name="Header Files" Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
> >
<File <File
RelativePath=".\animationlayer.h" RelativePath=".\animationlayer.h"
@ -3803,6 +3813,7 @@
</Filter> </Filter>
<Filter <Filter
Name="Public Header Files" Name="Public Header Files"
Filter="h"
> >
<File <File
RelativePath="..\..\public\mathlib\amd3dx.h" RelativePath="..\..\public\mathlib\amd3dx.h"
@ -4703,6 +4714,7 @@
</Filter> </Filter>
<Filter <Filter
Name="Game Shared Header Files" Name="Game Shared Header Files"
Filter="h"
> >
<File <File
RelativePath="..\shared\activitylist.h" RelativePath="..\shared\activitylist.h"
@ -5171,6 +5183,7 @@
</Filter> </Filter>
<Filter <Filter
Name="game_controls Header Files" Name="game_controls Header Files"
Filter="h"
> >
<File <File
RelativePath=".\game_controls\baseviewport.h" RelativePath=".\game_controls\baseviewport.h"

View File

@ -4,6 +4,7 @@
Version="8.00" Version="8.00"
Name="Client (SDK)" Name="Client (SDK)"
ProjectGUID="{09603CC0-928D-4939-83E5-C255291B9466}" ProjectGUID="{09603CC0-928D-4939-83E5-C255291B9466}"
RootNamespace="Client (SDK)"
> >
<Platforms> <Platforms>
<Platform <Platform
@ -28,8 +29,8 @@
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Copying to destination folder" Description="Copying to destination folder"
CommandLine="if exist &quot;..\..\game\hl2\bin\client.dll&quot; attrib -r &quot;..\..\game\hl2\bin\client.dll&quot;&#x0D;&#x0A;copy &quot;$(TargetDir)&quot;client.dll &quot;..\..\game\hl2\bin&quot;&#x0D;&#x0A;" CommandLine="if exist ..\..\..\game\sdk\bin\&quot;$(TargetName)&quot;.dll attrib -r ..\..\..\game\sdk\bin\&quot;$(TargetName)&quot;.dll&#x0D;&#x0A;copy &quot;$(TargetPath)&quot; ..\..\..\game\sdk\bin\&quot;$(TargetName)&quot;.dll&#x0D;&#x0A;if exist ..\..\..\game\sdk\bin\&quot;$(TargetName)&quot;.pdb attrib -r ..\..\..\game\sdk\bin\&quot;$(TargetName)&quot;.pdb&#x0D;&#x0A;copy &quot;$(TargetPath)&quot; ..\..\..\game\sdk\bin\&quot;$(TargetName)&quot;.pdb&#x0D;&#x0A;"
Outputs="..\..\game\hl2\bin\client.dll" Outputs="..\..\..\game\sdk\bin\client.dll;..\..\..\game\sdk\bin\client.pdb"
/> />
<Tool <Tool
Name="VCXMLDataGeneratorTool" Name="VCXMLDataGeneratorTool"
@ -87,7 +88,7 @@
UseUnicodeResponseFiles="false" UseUnicodeResponseFiles="false"
AdditionalDependencies="winmm.lib" AdditionalDependencies="winmm.lib"
ShowProgress="0" ShowProgress="0"
OutputFile="$(OutDir)/Client.dll" OutputFile="$(OutDir)/client.dll"
LinkIncremental="2" LinkIncremental="2"
SuppressStartupBanner="true" SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\lib\common;..\..\lib\public" AdditionalLibraryDirectories="..\..\lib\common;..\..\lib\public"
@ -148,8 +149,8 @@
<Tool <Tool
Name="VCCustomBuildTool" Name="VCCustomBuildTool"
Description="Copying to destination folder" Description="Copying to destination folder"
CommandLine="if exist &quot;..\..\game\hl2\bin\client.dll&quot; attrib -r &quot;..\..\game\hl2\bin\client.dll&quot;&#x0D;&#x0A;copy &quot;$(TargetDir)&quot;client.dll &quot;..\..\game\hl2\bin&quot;&#x0D;&#x0A;if exist &quot;..\..\game\hl2\bin\client.pdb&quot; attrib -r &quot;..\..\game\hl2\bin\client.pdb&quot;&#x0D;&#x0A;if exist &quot;$(TargetDir)&quot;client.pdb copy &quot;$(TargetDir)&quot;client.pdb &quot;..\..\game\hl2\bin\client.pdb&quot;&#x0D;&#x0A;" CommandLine="if exist ..\..\..\game\sdk\bin\&quot;$(TargetName)&quot;.dll attrib -r ..\..\..\game\sdk\bin\&quot;$(TargetName)&quot;.dll&#x0D;&#x0A;copy &quot;$(TargetPath)&quot; ..\..\..\game\sdk\bin\&quot;$(TargetName)&quot;.dll&#x0D;&#x0A;if exist ..\..\..\game\sdk\bin\&quot;$(TargetName)&quot;.pdb attrib -r ..\..\..\game\sdk\bin\&quot;$(TargetName)&quot;.pdb&#x0D;&#x0A;copy &quot;$(TargetPath)&quot; ..\..\..\game\sdk\bin\&quot;$(TargetName)&quot;.pdb&#x0D;&#x0A;"
Outputs="..\..\game\hl2\bin\client.dll&quot;;&quot;..\..\game\hl2\bin\client.pdb" Outputs="..\..\..\game\sdk\bin\client.dll;..\..\..\game\sdk\bin\client.pdb"
/> />
<Tool <Tool
Name="VCXMLDataGeneratorTool" Name="VCXMLDataGeneratorTool"
@ -209,7 +210,7 @@
UseUnicodeResponseFiles="false" UseUnicodeResponseFiles="false"
AdditionalDependencies="winmm.lib" AdditionalDependencies="winmm.lib"
ShowProgress="0" ShowProgress="0"
OutputFile="$(OutDir)/Client.dll" OutputFile="$(OutDir)/client.dll"
LinkIncremental="1" LinkIncremental="1"
SuppressStartupBanner="true" SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\lib\common;..\..\lib\public" AdditionalLibraryDirectories="..\..\lib\common;..\..\lib\public"
@ -263,6 +264,7 @@
<Files> <Files>
<Filter <Filter
Name="Source Files" Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
> >
<File <File
RelativePath=".\achievement_notification_panel.cpp" RelativePath=".\achievement_notification_panel.cpp"
@ -2575,6 +2577,7 @@
</Filter> </Filter>
<Filter <Filter
Name="Link Libraries" Name="Link Libraries"
Filter="lib"
> >
<File <File
RelativePath="..\..\lib\public\bitmap.lib" RelativePath="..\..\lib\public\bitmap.lib"
@ -2631,6 +2634,7 @@
</Filter> </Filter>
<Filter <Filter
Name="MP3" Name="MP3"
Filter="h;cpp"
> >
<File <File
RelativePath=".\mp3player.cpp" RelativePath=".\mp3player.cpp"
@ -2643,6 +2647,7 @@
</Filter> </Filter>
<Filter <Filter
Name="Tool Framework" Name="Tool Framework"
Filter="h;cpp"
> >
<File <File
RelativePath="..\..\public\tools\bonelist.cpp" RelativePath="..\..\public\tools\bonelist.cpp"
@ -2667,6 +2672,7 @@
</Filter> </Filter>
<Filter <Filter
Name="Header Files" Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
> >
<File <File
RelativePath=".\animationlayer.h" RelativePath=".\animationlayer.h"
@ -3447,6 +3453,7 @@
</Filter> </Filter>
<Filter <Filter
Name="Public Header Files" Name="Public Header Files"
Filter="h"
> >
<File <File
RelativePath="..\..\public\mathlib\amd3dx.h" RelativePath="..\..\public\mathlib\amd3dx.h"
@ -4347,6 +4354,7 @@
</Filter> </Filter>
<Filter <Filter
Name="Game Shared Header Files" Name="Game Shared Header Files"
Filter="h"
> >
<File <File
RelativePath="..\shared\activitylist.h" RelativePath="..\shared\activitylist.h"
@ -4803,6 +4811,7 @@
</Filter> </Filter>
<Filter <Filter
Name="game_controls Header Files" Name="game_controls Header Files"
Filter="h"
> >
<File <File
RelativePath=".\game_controls\baseviewport.h" RelativePath=".\game_controls\baseviewport.h"

View File

@ -8,6 +8,7 @@
#include "particles_simple.h" #include "particles_simple.h"
#include "baseparticleentity.h" #include "baseparticleentity.h"
#include "iefx.h" #include "iefx.h"
#include "fx.h"
#include "decals.h" #include "decals.h"
#include "beamdraw.h" #include "beamdraw.h"
#include "hud.h" #include "hud.h"

View File

@ -149,7 +149,7 @@ void C_NPC_Hydra::StandardBlendingRules( Vector pos[], Quaternion q[], float cu
{ {
VPROF( "C_NPC_Hydra::StandardBlendingRules" ); VPROF( "C_NPC_Hydra::StandardBlendingRules" );
studiohdr_t *hdr = GetModelPtr(); const studiohdr_t *hdr = GetModelPtr()->GetRenderHdr();
if ( !hdr ) if ( !hdr )
{ {
return; return;
@ -169,7 +169,7 @@ void C_NPC_Hydra::StandardBlendingRules( Vector pos[], Quaternion q[], float cu
{ {
poseparam[i] = 0; poseparam[i] = 0;
} }
CalcPose( hdr, NULL, pos, q, 0.0f, 0.0f, poseparam, BONE_USED_BY_ANYTHING ); CalcPose( GetModelPtr(), NULL, pos, q, 0.0f, 0.0f, poseparam, BONE_USED_BY_ANYTHING );
// allocate arrays // allocate arrays
if (m_boneLength) if (m_boneLength)

View File

@ -798,7 +798,7 @@ void C_HL2MPRagdoll::Interp_Copy( C_BaseAnimatingOverlay *pSourceEntity )
} }
} }
void C_HL2MPRagdoll::ImpactTrace( trace_t *pTrace, int iDamageType, char *pCustomImpactName ) void C_HL2MPRagdoll::ImpactTrace( trace_t *pTrace, int iDamageType, const char *pCustomImpactName )
{ {
IPhysicsObject *pPhysicsObject = VPhysicsGetObject(); IPhysicsObject *pPhysicsObject = VPhysicsGetObject();

View File

@ -150,7 +150,7 @@ public:
int GetPlayerEntIndex() const; int GetPlayerEntIndex() const;
IRagdoll* GetIRagdoll() const; IRagdoll* GetIRagdoll() const;
void ImpactTrace( trace_t *pTrace, int iDamageType, char *pCustomImpactName ); void ImpactTrace( trace_t *pTrace, int iDamageType, const char *pCustomImpactName );
void UpdateOnRemove( void ); void UpdateOnRemove( void );
virtual void SetupWeights( const matrix3x4_t *pBoneToWorld, int nFlexWeightCount, float *pFlexWeights, float *pFlexDelayedWeights ); virtual void SetupWeights( const matrix3x4_t *pBoneToWorld, int nFlexWeightCount, float *pFlexWeights, float *pFlexDelayedWeights );

View File

@ -534,7 +534,7 @@ void C_PhysPropClientside::Clone( Vector &velocity )
} }
} }
void C_PhysPropClientside::ImpactTrace( trace_t *pTrace, int iDamageType, char *pCustomImpactName ) void C_PhysPropClientside::ImpactTrace( trace_t *pTrace, int iDamageType, const char *pCustomImpactName )
{ {
VPROF( "C_PhysPropClientside::ImpactTrace" ); VPROF( "C_PhysPropClientside::ImpactTrace" );
IPhysicsObject *pPhysicsObject = VPhysicsGetObject(); IPhysicsObject *pPhysicsObject = VPhysicsGetObject();

View File

@ -32,7 +32,7 @@ public:
virtual CollideType_t GetCollideType( void ) { return ENTITY_SHOULD_RESPOND; } virtual CollideType_t GetCollideType( void ) { return ENTITY_SHOULD_RESPOND; }
virtual void StartTouch( C_BaseEntity *pOther ); virtual void StartTouch( C_BaseEntity *pOther );
virtual void HitSurface( C_BaseEntity *pOther ); virtual void HitSurface( C_BaseEntity *pOther );
virtual void ImpactTrace( trace_t *pTrace, int iDamageType, char *pCustomImpactName ); virtual void ImpactTrace( trace_t *pTrace, int iDamageType, const char *pCustomImpactName );
virtual bool IsClientCreated( void ) const { return true; } virtual bool IsClientCreated( void ) const { return true; }
virtual int GetMultiplayerPhysicsMode() { return m_iPhysicsMode; } virtual int GetMultiplayerPhysicsMode() { return m_iPhysicsMode; }
virtual float GetMass(); virtual float GetMass();

View File

@ -88,7 +88,7 @@ public:
int GetPlayerEntIndex() const; int GetPlayerEntIndex() const;
IRagdoll* GetIRagdoll() const; IRagdoll* GetIRagdoll() const;
void ImpactTrace( trace_t *pTrace, int iDamageType, char *pCustomImpactName ); void ImpactTrace( trace_t *pTrace, int iDamageType, const char *pCustomImpactName );
private: private:
@ -151,7 +151,7 @@ void C_SDKRagdoll::Interp_Copy( C_BaseAnimatingOverlay *pSourceEntity )
} }
} }
void C_SDKRagdoll::ImpactTrace( trace_t *pTrace, int iDamageType, char *pCustomImpactName ) void C_SDKRagdoll::ImpactTrace( trace_t *pTrace, int iDamageType, const char *pCustomImpactName )
{ {
IPhysicsObject *pPhysicsObject = VPhysicsGetObject(); IPhysicsObject *pPhysicsObject = VPhysicsGetObject();

View File

@ -1185,7 +1185,7 @@ float CResponseSystem::ScoreCriteriaAgainstRuleCriteria( const AI_CriteriaSet& s
if ( verbose ) if ( verbose )
{ {
DevMsg( "matched, weight %4.2f (s %4.2f x c %4.2f)", DevMsg( "matched, weight %4.2f (s %4.2f x c %4.2f)",
score, w, c->weight ); score, w, c->weight.GetFloat() );
} }
} }
else else
@ -1574,7 +1574,7 @@ void CResponseSystem::DescribeResponseGroup( ResponseGroup *group, int selected,
i == selected ? "-> " : " ", i == selected ? "-> " : " ",
AI_Response::DescribeResponse( r->GetType() ), AI_Response::DescribeResponse( r->GetType() ),
r->value, r->value,
r->weight ); r->weight.GetFloat() );
} }
} }

View File

@ -881,7 +881,7 @@ bool IsListeningToCommentary( void )
void CPointCommentaryNode::Spawn( void ) void CPointCommentaryNode::Spawn( void )
{ {
// No model specified? // No model specified?
char *szModel = (char *)STRING( GetModelName() ); const char *szModel = (char *)STRING( GetModelName() );
if (!szModel || !*szModel) if (!szModel || !*szModel)
{ {
szModel = "models/extras/info_speech.mdl"; szModel = "models/extras/info_speech.mdl";

View File

@ -124,7 +124,7 @@ void CEffectsServer::Smoke( const Vector &origin, int mModel, float flScale, flo
CPVSFilter filter( origin ); CPVSFilter filter( origin );
if ( !SuppressTE( filter ) ) if ( !SuppressTE( filter ) )
{ {
te->Smoke( filter, 0.0, &origin, mModel, flScale * 0.1f, flFramerate ); te->Smoke( filter, 0.0, &origin, mModel, flScale * 0.1f, (int)flFramerate );
} }
} }

View File

@ -309,7 +309,7 @@ void CEntityFlame::FlameThink( void )
if( !m_hEntAttached->IsNPC() && hl2_episodic.GetBool() ) if( !m_hEntAttached->IsNPC() && hl2_episodic.GetBool() )
{ {
const float ENTITYFLAME_MOVE_AWAY_DIST = 24.0f; const int ENTITYFLAME_MOVE_AWAY_DIST = 24;
// Make a sound near my origin, and up a little higher (in case I'm on the ground, so NPC's still hear it) // Make a sound near my origin, and up a little higher (in case I'm on the ground, so NPC's still hear it)
CSoundEnt::InsertSound( SOUND_MOVE_AWAY, GetAbsOrigin(), ENTITYFLAME_MOVE_AWAY_DIST, 0.1f, this, SOUNDENT_CHANNEL_REPEATED_DANGER ); CSoundEnt::InsertSound( SOUND_MOVE_AWAY, GetAbsOrigin(), ENTITYFLAME_MOVE_AWAY_DIST, 0.1f, this, SOUNDENT_CHANNEL_REPEATED_DANGER );
CSoundEnt::InsertSound( SOUND_MOVE_AWAY, GetAbsOrigin() + Vector( 0, 0, 48.0f ), ENTITYFLAME_MOVE_AWAY_DIST, 0.1f, this, SOUNDENT_CHANNEL_REPEATING ); CSoundEnt::InsertSound( SOUND_MOVE_AWAY, GetAbsOrigin() + Vector( 0, 0, 48.0f ), ENTITYFLAME_MOVE_AWAY_DIST, 0.1f, this, SOUNDENT_CHANNEL_REPEATING );

View File

@ -381,7 +381,7 @@ void CEnvBeam::Strike( void )
if ( pStart == NULL || pEnd == NULL ) if ( pStart == NULL || pEnd == NULL )
return; return;
m_speed = clamp( m_speed, 0, MAX_BEAM_SCROLLSPEED ); m_speed = (int)clamp( m_speed, 0, MAX_BEAM_SCROLLSPEED );
int pointStart = IsStaticPointEntity( pStart ); int pointStart = IsStaticPointEntity( pStart );
int pointEnd = IsStaticPointEntity( pEnd ); int pointEnd = IsStaticPointEntity( pEnd );
@ -710,7 +710,7 @@ void CEnvBeam::BeamUpdateVars( void )
m_nNumBeamEnts = 2; m_nNumBeamEnts = 2;
m_speed = clamp( m_speed, 0, MAX_BEAM_SCROLLSPEED ); m_speed = (int)clamp( m_speed, 0, MAX_BEAM_SCROLLSPEED );
// NOTE: If the end entity is the beam itself (and the start entity // NOTE: If the end entity is the beam itself (and the start entity
// isn't *also* the beam itself, we've got problems. This is a problem // isn't *also* the beam itself, we've got problems. This is a problem

View File

@ -62,6 +62,7 @@ END_DATADESC()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// List of maps in HL2 that we must apply our skybox fog fixup hack to // List of maps in HL2 that we must apply our skybox fog fixup hack to
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#ifdef HL2_DLL
static const char *s_pBogusFogMaps[] = static const char *s_pBogusFogMaps[] =
{ {
"d1_canals_01", "d1_canals_01",
@ -85,6 +86,7 @@ static const char *s_pBogusFogMaps[] =
"d3_citadel_01", "d3_citadel_01",
NULL NULL
}; };
#endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Constructor, destructor // Constructor, destructor
@ -135,10 +137,10 @@ void CSkyCamera::Activate( )
{ {
if ( !Q_stricmp( s_pBogusFogMaps[i], STRING(gpGlobals->mapname) ) ) if ( !Q_stricmp( s_pBogusFogMaps[i], STRING(gpGlobals->mapname) ) )
{ {
m_skyboxData.fog.colorPrimary.SetR( ( m_skyboxData.fog.colorPrimary.GetR() + m_skyboxData.fog.colorSecondary.GetR() ) * 0.5f ); m_skyboxData.fog.colorPrimary.SetR( (byte)(( m_skyboxData.fog.colorPrimary.GetR() + m_skyboxData.fog.colorSecondary.GetR() ) * 0.5f) );
m_skyboxData.fog.colorPrimary.SetG( ( m_skyboxData.fog.colorPrimary.GetG() + m_skyboxData.fog.colorSecondary.GetG() ) * 0.5f ); m_skyboxData.fog.colorPrimary.SetG( (byte)(( m_skyboxData.fog.colorPrimary.GetG() + m_skyboxData.fog.colorSecondary.GetG() ) * 0.5f) );
m_skyboxData.fog.colorPrimary.SetB( ( m_skyboxData.fog.colorPrimary.GetB() + m_skyboxData.fog.colorSecondary.GetB() ) * 0.5f ); m_skyboxData.fog.colorPrimary.SetB( (byte)(( m_skyboxData.fog.colorPrimary.GetB() + m_skyboxData.fog.colorSecondary.GetB() ) * 0.5f) );
m_skyboxData.fog.colorPrimary.SetA( ( m_skyboxData.fog.colorPrimary.GetA() + m_skyboxData.fog.colorSecondary.GetA() ) * 0.5f ); m_skyboxData.fog.colorPrimary.SetA( (byte)(( m_skyboxData.fog.colorPrimary.GetA() + m_skyboxData.fog.colorSecondary.GetA() ) * 0.5f) );
m_skyboxData.fog.colorSecondary = m_skyboxData.fog.colorPrimary; m_skyboxData.fog.colorSecondary = m_skyboxData.fog.colorPrimary;
} }
} }

View File

@ -309,7 +309,7 @@ void Templates_StartUniqueInstance( void )
g_iCurrentTemplateInstance++; g_iCurrentTemplateInstance++;
// Make sure there's enough room to fit it into the string // Make sure there's enough room to fit it into the string
int iMax = pow(10.0f, (int)((strlen(ENTITYIO_FIXUP_STRING) - 1))); // -1 for the & int iMax = (int)pow(10.0f, (int)((strlen(ENTITYIO_FIXUP_STRING) - 1))); // -1 for the &
if ( g_iCurrentTemplateInstance >= iMax ) if ( g_iCurrentTemplateInstance >= iMax )
{ {
// We won't hit this. // We won't hit this.

View File

@ -675,6 +675,8 @@ bool CAI_BaseActor::CheckSceneEventCompletion( CSceneEventInfo *info, float curr
} }
} }
} }
default:
break;
} }
return BaseClass::CheckSceneEventCompletion( info, currenttime, scene, event ); return BaseClass::CheckSceneEventCompletion( info, currenttime, scene, event );
@ -1784,6 +1786,8 @@ void CAI_BaseActor::PlayExpressionForState( NPC_STATE state )
SetExpression( STRING(m_iszDeathExpression) ); SetExpression( STRING(m_iszDeathExpression) );
} }
break; break;
default:
break;
} }
} }

View File

@ -81,11 +81,11 @@ public:
m_flBlinktime( 0 ), m_flBlinktime( 0 ),
m_hLookTarget( NULL ), m_hLookTarget( NULL ),
m_iszExpressionScene( NULL_STRING ), m_iszExpressionScene( NULL_STRING ),
m_iszExpressionOverride( NULL_STRING ),
m_iszIdleExpression( NULL_STRING ), m_iszIdleExpression( NULL_STRING ),
m_iszAlertExpression( NULL_STRING ), m_iszAlertExpression( NULL_STRING ),
m_iszCombatExpression( NULL_STRING ), m_iszCombatExpression( NULL_STRING ),
m_iszDeathExpression( NULL_STRING ), m_iszDeathExpression( NULL_STRING )
m_iszExpressionOverride( NULL_STRING )
{ {
memset( m_flextarget, 0, 64 * sizeof( m_flextarget[0] ) ); memset( m_flextarget, 0, 64 * sizeof( m_flextarget[0] ) );
} }

View File

@ -171,8 +171,12 @@ extern ConVar ai_vehicle_avoidance;
#ifdef DEBUG_AI_FRAME_THINK_LIMITS #ifdef DEBUG_AI_FRAME_THINK_LIMITS
#define DbgFrameLimitMsg DevMsg #define DbgFrameLimitMsg DevMsg
#else #else
#if defined __GNUC__ || (defined _MSC_VER && _MSC_VER >= 1400)
#define DbgFrameLimitMsg(...)
#else
#define DbgFrameLimitMsg (void) #define DbgFrameLimitMsg (void)
#endif #endif
#endif
// NPC damage adjusters // NPC damage adjusters
ConVar sk_npc_head( "sk_npc_head","2" ); ConVar sk_npc_head( "sk_npc_head","2" );
@ -311,7 +315,7 @@ CJob *g_pQueuedNavigationQueryJob = NULL;
static void ProcessNavigationQueries( CFunctor **pData, unsigned int nCount ) static void ProcessNavigationQueries( CFunctor **pData, unsigned int nCount )
{ {
// Run all queued navigation on a separate thread // Run all queued navigation on a separate thread
for ( int i = 0; i < nCount; i++ ) for ( unsigned int i = 0; i < nCount; i++ )
{ {
(*pData[i])(); (*pData[i])();
} }
@ -1067,7 +1071,7 @@ void CAI_BaseNPC::DecalTrace( trace_t *pTrace, char const *decalName )
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Purpose: // Purpose:
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void CAI_BaseNPC::ImpactTrace( trace_t *pTrace, int iDamageType, char *pCustomImpactName ) void CAI_BaseNPC::ImpactTrace( trace_t *pTrace, int iDamageType, const char *pCustomImpactName )
{ {
if ( m_fNoDamageDecal ) if ( m_fNoDamageDecal )
{ {
@ -1356,7 +1360,7 @@ class CTriggerTraceEnum : public IEntityEnumerator
{ {
public: public:
CTriggerTraceEnum( Ray_t *pRay, const CTakeDamageInfo &info, const Vector& dir, int contentsMask ) : CTriggerTraceEnum( Ray_t *pRay, const CTakeDamageInfo &info, const Vector& dir, int contentsMask ) :
m_info( info ), m_VecDir(dir), m_ContentsMask(contentsMask), m_pRay(pRay) m_VecDir(dir), m_ContentsMask(contentsMask), m_pRay(pRay), m_info( info )
{ {
} }
@ -1537,12 +1541,12 @@ void CBaseEntity::CreateBubbleTrailTracer( const Vector &vecShotSrc, const Vecto
if ( flLengthSqr > SHOT_UNDERWATER_BUBBLE_DIST * SHOT_UNDERWATER_BUBBLE_DIST ) if ( flLengthSqr > SHOT_UNDERWATER_BUBBLE_DIST * SHOT_UNDERWATER_BUBBLE_DIST )
{ {
VectorMA( vecShotSrc, SHOT_UNDERWATER_BUBBLE_DIST, vecShotDir, vecBubbleEnd ); VectorMA( vecShotSrc, SHOT_UNDERWATER_BUBBLE_DIST, vecShotDir, vecBubbleEnd );
nBubbles = WATER_BULLET_BUBBLES_PER_INCH * SHOT_UNDERWATER_BUBBLE_DIST; nBubbles = static_cast<int>(WATER_BULLET_BUBBLES_PER_INCH * SHOT_UNDERWATER_BUBBLE_DIST);
} }
else else
{ {
float flLength = sqrt(flLengthSqr) - 0.1f; float flLength = sqrt(flLengthSqr) - 0.1f;
nBubbles = WATER_BULLET_BUBBLES_PER_INCH * flLength; nBubbles = static_cast<int>(WATER_BULLET_BUBBLES_PER_INCH * flLength);
VectorMA( vecShotSrc, flLength, vecShotDir, vecBubbleEnd ); VectorMA( vecShotSrc, flLength, vecShotDir, vecBubbleEnd );
} }
@ -2220,7 +2224,7 @@ CBaseGrenade* CAI_BaseNPC::IncomingGrenade(void)
continue; continue;
// Check if it's near me // Check if it's near me
iDist = ( pBG->GetAbsOrigin() - GetAbsOrigin() ).Length(); iDist = (int)(pBG->GetAbsOrigin() - GetAbsOrigin()).Length();
if ( iDist <= NPC_GRENADE_FEAR_DIST ) if ( iDist <= NPC_GRENADE_FEAR_DIST )
return pBG; return pBG;
@ -3320,7 +3324,7 @@ void CAI_BaseNPC::UpdateEfficiency( bool bInPVS )
int iPVSOffset = (bInPVS) ? 0 : NO_PVS_OFFSET; int iPVSOffset = (bInPVS) ? 0 : NO_PVS_OFFSET;
int iMapping = iStateOffset + iPVSOffset + iFacingOffset + range; int iMapping = iStateOffset + iPVSOffset + iFacingOffset + range;
Assert( iMapping < ARRAYSIZE( mappings ) ); Assert( iMapping < (int)ARRAYSIZE( mappings ) );
AI_Efficiency_t efficiency = mappings[iMapping]; AI_Efficiency_t efficiency = mappings[iMapping];
@ -3602,7 +3606,7 @@ void CAI_BaseNPC::RebalanceThinks()
{ {
rebalanceCandidates.Sort( ThinkRebalanceCompare ); rebalanceCandidates.Sort( ThinkRebalanceCompare );
int iMaxThinkersPerTick = ceil( (float)( rebalanceCandidates.Count() + 1 ) / (float)iTicksPer10Hz ); // +1 to account for "this" int iMaxThinkersPerTick = (int)ceil( (float)((rebalanceCandidates.Count() + 1) / iTicksPer10Hz) ); // +1 to account for "this"
int iCurTickDistributing = min( gpGlobals->tickcount, rebalanceCandidates[0].iNextThinkTick ); int iCurTickDistributing = min( gpGlobals->tickcount, rebalanceCandidates[0].iNextThinkTick );
int iRemainingThinksToDistribute = iMaxThinkersPerTick - 1; // Start with one fewer first time because "this" is int iRemainingThinksToDistribute = iMaxThinkersPerTick - 1; // Start with one fewer first time because "this" is
@ -4376,6 +4380,8 @@ void CAI_BaseNPC::SetState( NPC_STATE State )
DevMsg( 2, "Stripped\n" ); DevMsg( 2, "Stripped\n" );
} }
break; break;
default:
break;
} }
bool fNotifyChange = false; bool fNotifyChange = false;
@ -5074,6 +5080,8 @@ NPC_STATE CAI_BaseNPC::SelectIdealState( void )
m_pSquad->SquadNewEnemy( GetEnemy() ); m_pSquad->SquadNewEnemy( GetEnemy() );
} }
break; break;
default:
break;
} }
} }
@ -5118,6 +5126,9 @@ NPC_STATE CAI_BaseNPC::SelectIdealState( void )
case NPC_STATE_DEAD: case NPC_STATE_DEAD:
return NPC_STATE_DEAD; return NPC_STATE_DEAD;
default:
break;
} }
// The best ideal state is the current ideal state. // The best ideal state is the current ideal state.
@ -5144,7 +5155,7 @@ void CAI_BaseNPC::GiveWeapon( string_t iszWeaponName )
// If I have a name, make my weapon match it with "_weapon" appended // If I have a name, make my weapon match it with "_weapon" appended
if ( GetEntityName() != NULL_STRING ) if ( GetEntityName() != NULL_STRING )
{ {
pWeapon->SetName( AllocPooledString(UTIL_VarArgs("%s_weapon", GetEntityName())) ); pWeapon->SetName( AllocPooledString(UTIL_VarArgs("%s_weapon", STRING(GetEntityName()))) );
} }
Weapon_Equip( pWeapon ); Weapon_Equip( pWeapon );
@ -6395,6 +6406,8 @@ bool CAI_BaseNPC::IsActivityMovementPhased( Activity activity )
case ACT_RUN_CROUCH_AIM: case ACT_RUN_CROUCH_AIM:
case ACT_RUN_PROTECTED: case ACT_RUN_PROTECTED:
return true; return true;
default:
break;
} }
return false; return false;
} }
@ -6415,7 +6428,7 @@ void CAI_BaseNPC::OnChangeActivity( Activity eNewActivity )
//========================================================= //=========================================================
// SetSequenceByName // SetSequenceByName
//========================================================= //=========================================================
void CAI_BaseNPC::SetSequenceByName( char *szSequence ) void CAI_BaseNPC::SetSequenceByName( const char *szSequence )
{ {
int iSequence = LookupSequence( szSequence ); int iSequence = LookupSequence( szSequence );
@ -6853,7 +6866,7 @@ void CAI_BaseNPC::NPCInit ( void )
// If I have a name, make my weapon match it with "_weapon" appended // If I have a name, make my weapon match it with "_weapon" appended
if ( GetEntityName() != NULL_STRING ) if ( GetEntityName() != NULL_STRING )
{ {
pWeapon->SetName( AllocPooledString(UTIL_VarArgs("%s_weapon", GetEntityName())) ); pWeapon->SetName( AllocPooledString(UTIL_VarArgs("%s_weapon", STRING(GetEntityName()))) );
} }
if ( GetEffects() & EF_NOSHADOW ) if ( GetEffects() & EF_NOSHADOW )
@ -7776,7 +7789,7 @@ CBaseEntity *CAI_BaseNPC::BestEnemy( void )
DbgEnemyMsg( this, " (%s displaced)\n", pBestEnemy->GetDebugName() ); DbgEnemyMsg( this, " (%s displaced)\n", pBestEnemy->GetDebugName() );
iBestPriority = IRelationPriority ( pEnemy ); iBestPriority = IRelationPriority ( pEnemy );
iBestDistSq = (pEnemy->GetAbsOrigin() - GetAbsOrigin() ).LengthSqr(); iBestDistSq = (int)(pEnemy->GetAbsOrigin() - GetAbsOrigin()).LengthSqr();
pBestEnemy = pEnemy; pBestEnemy = pEnemy;
bBestUnreachable = bUnreachable; bBestUnreachable = bUnreachable;
fBestSeen = TRS_NONE; fBestSeen = TRS_NONE;
@ -7792,7 +7805,7 @@ CBaseEntity *CAI_BaseNPC::BestEnemy( void )
// currently think is the best visible enemy. No need to do // currently think is the best visible enemy. No need to do
// a distance check, just get mad at this one for now. // a distance check, just get mad at this one for now.
iBestPriority = IRelationPriority ( pEnemy ); iBestPriority = IRelationPriority ( pEnemy );
iBestDistSq = ( pEnemy->GetAbsOrigin() - GetAbsOrigin() ).LengthSqr(); iBestDistSq = (int)(pEnemy->GetAbsOrigin() - GetAbsOrigin()).LengthSqr();
pBestEnemy = pEnemy; pBestEnemy = pEnemy;
bBestUnreachable = bUnreachable; bBestUnreachable = bUnreachable;
fBestSeen = TRS_NONE; fBestSeen = TRS_NONE;
@ -7803,7 +7816,7 @@ CBaseEntity *CAI_BaseNPC::BestEnemy( void )
// this entity is disliked just as much as the entity that // this entity is disliked just as much as the entity that
// we currently think is the best visible enemy, so we only // we currently think is the best visible enemy, so we only
// get mad at it if it is closer. // get mad at it if it is closer.
iDistSq = ( pEnemy->GetAbsOrigin() - GetAbsOrigin() ).LengthSqr(); iDistSq = (int)(pEnemy->GetAbsOrigin() - GetAbsOrigin()).LengthSqr();
bool bAcceptCurrent = false; bool bAcceptCurrent = false;
bool bCloser = ( ( iBestDistSq - iDistSq ) > EnemyDistTolerance() ); bool bCloser = ( ( iBestDistSq - iDistSq ) > EnemyDistTolerance() );
@ -7967,6 +7980,8 @@ Activity CAI_BaseNPC::GetReloadActivity( CAI_Hint* pHint )
} }
break; break;
} }
default:
break;
} }
} }
return nReloadActivity; return nReloadActivity;
@ -7998,6 +8013,8 @@ Activity CAI_BaseNPC::GetCoverActivity( CAI_Hint *pHint )
nCoverActivity = ACT_COVER_LOW; nCoverActivity = ACT_COVER_LOW;
break; break;
} }
default:
break;
} }
} }
@ -8014,7 +8031,7 @@ Activity CAI_BaseNPC::GetCoverActivity( CAI_Hint *pHint )
//========================================================= //=========================================================
float CAI_BaseNPC::CalcIdealYaw( const Vector &vecTarget ) float CAI_BaseNPC::CalcIdealYaw( const Vector &vecTarget )
{ {
Vector vecProjection; Vector vecProjection = Vector(0.0f, 0.0f, 0.0f);
// strafing npc needs to face 90 degrees away from its goal // strafing npc needs to face 90 degrees away from its goal
if ( GetNavigator()->GetMovementActivity() == ACT_STRAFE_LEFT ) if ( GetNavigator()->GetMovementActivity() == ACT_STRAFE_LEFT )
@ -8789,9 +8806,9 @@ void CAI_BaseNPC::DrawDebugGeometryOverlays(void)
CBaseCombatCharacter *npcEnemy = (eMemory->hEnemy)->MyCombatCharacterPointer(); CBaseCombatCharacter *npcEnemy = (eMemory->hEnemy)->MyCombatCharacterPointer();
if (npcEnemy) if (npcEnemy)
{ {
float r,g,b; int r,g,b;
char debugText[255]; char debugText[255];
debugText[0] = NULL; debugText[0] = '\0';
if (npcEnemy == GetEnemy()) if (npcEnemy == GetEnemy())
{ {
@ -8983,7 +9000,7 @@ int CAI_BaseNPC::DrawDebugTextOverlays(void)
// Print State // Print State
// -------------- // --------------
static const char *pStateNames[] = { "None", "Idle", "Alert", "Combat", "Scripted", "PlayDead", "Dead" }; static const char *pStateNames[] = { "None", "Idle", "Alert", "Combat", "Scripted", "PlayDead", "Dead" };
if ( (int)m_NPCState < ARRAYSIZE(pStateNames) ) if ( (size_t)m_NPCState < ARRAYSIZE(pStateNames) )
{ {
Q_snprintf(tempstr,sizeof(tempstr),"Stat: %s, ", pStateNames[m_NPCState] ); Q_snprintf(tempstr,sizeof(tempstr),"Stat: %s, ", pStateNames[m_NPCState] );
EntityText(text_offset,tempstr,0); EntityText(text_offset,tempstr,0);
@ -9005,7 +9022,7 @@ int CAI_BaseNPC::DrawDebugTextOverlays(void)
// ----------------- // -----------------
if( GetHintGroup() != NULL_STRING ) if( GetHintGroup() != NULL_STRING )
{ {
Q_snprintf(tempstr,sizeof(tempstr),"Hint Group: %s", GetHintGroup() ); Q_snprintf(tempstr,sizeof(tempstr),"Hint Group: %s", STRING(GetHintGroup()) );
EntityText(text_offset,tempstr,0); EntityText(text_offset,tempstr,0);
text_offset++; text_offset++;
} }
@ -9015,8 +9032,8 @@ int CAI_BaseNPC::DrawDebugTextOverlays(void)
// ----------------- // -----------------
int navTypeIndex = (int)GetNavType() + 1; int navTypeIndex = (int)GetNavType() + 1;
static const char *pMoveNames[] = { "None", "Ground", "Jump", "Fly", "Climb" }; static const char *pMoveNames[] = { "None", "Ground", "Jump", "Fly", "Climb" };
Assert( navTypeIndex >= 0 && navTypeIndex < ARRAYSIZE(pMoveNames) ); Assert( navTypeIndex >= 0 && navTypeIndex < (int)ARRAYSIZE(pMoveNames) );
if ( navTypeIndex < ARRAYSIZE(pMoveNames) ) if ( navTypeIndex < (int)ARRAYSIZE(pMoveNames) )
{ {
Q_snprintf(tempstr,sizeof(tempstr),"Move: %s, ", pMoveNames[navTypeIndex] ); Q_snprintf(tempstr,sizeof(tempstr),"Move: %s, ", pMoveNames[navTypeIndex] );
EntityText(text_offset,tempstr,0); EntityText(text_offset,tempstr,0);
@ -9258,7 +9275,7 @@ void CAI_BaseNPC::ReportAIState( void )
static const char *pStateNames[] = { "None", "Idle", "Alert", "Combat", "Scripted", "PlayDead", "Dead" }; static const char *pStateNames[] = { "None", "Idle", "Alert", "Combat", "Scripted", "PlayDead", "Dead" };
DevMsg( "%s: ", GetClassname() ); DevMsg( "%s: ", GetClassname() );
if ( (int)m_NPCState < ARRAYSIZE(pStateNames) ) if ( (size_t)m_NPCState < ARRAYSIZE(pStateNames) )
DevMsg( "State: %s, ", pStateNames[m_NPCState] ); DevMsg( "State: %s, ", pStateNames[m_NPCState] );
if( m_Activity != ACT_INVALID && m_IdealActivity != ACT_INVALID ) if( m_Activity != ACT_INVALID && m_IdealActivity != ACT_INVALID )
@ -9773,7 +9790,7 @@ Vector CAI_BaseNPC::GetActualShootTrajectory( const Vector &shootOrigin )
return shotDir; return shotDir;
} }
#endif HL2_DLL #endif // HL2_DLL
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -10336,7 +10353,7 @@ void CAI_BaseNPC::PickupWeapon( CBaseCombatWeapon *pWeapon )
//========================================================= //=========================================================
// DropItem - dead npc drops named item // DropItem - dead npc drops named item
//========================================================= //=========================================================
CBaseEntity *CAI_BaseNPC::DropItem ( char *pszItemName, Vector vecPos, QAngle vecAng ) CBaseEntity *CAI_BaseNPC::DropItem ( const char *pszItemName, Vector vecPos, QAngle vecAng )
{ {
if ( !pszItemName ) if ( !pszItemName )
{ {
@ -10419,7 +10436,7 @@ bool CAI_BaseNPC::ShouldPlayIdleSound( void )
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void CAI_BaseNPC::MakeAIFootstepSound( float volume, float duration ) void CAI_BaseNPC::MakeAIFootstepSound( float volume, float duration )
{ {
CSoundEnt::InsertSound( SOUND_COMBAT, EyePosition(), volume, duration, this, SOUNDENT_CHANNEL_NPC_FOOTSTEP ); CSoundEnt::InsertSound( SOUND_COMBAT, EyePosition(), (int)volume, duration, this, SOUNDENT_CHANNEL_NPC_FOOTSTEP );
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -10952,7 +10969,7 @@ int CAI_BaseNPC::Save( ISave &save )
{ {
const char *pszSchedule = m_pSchedule->GetName(); const char *pszSchedule = m_pSchedule->GetName();
Assert( Q_strlen( pszSchedule ) < sizeof( saveHeader.szSchedule ) - 1 ); Assert( Q_strlen( pszSchedule ) < (int)sizeof( saveHeader.szSchedule ) - 1 );
Q_strncpy( saveHeader.szSchedule, pszSchedule, sizeof( saveHeader.szSchedule ) ); Q_strncpy( saveHeader.szSchedule, pszSchedule, sizeof( saveHeader.szSchedule ) );
CRC32_Init( &saveHeader.scheduleCrc ); CRC32_Init( &saveHeader.scheduleCrc );
@ -10973,7 +10990,7 @@ int CAI_BaseNPC::Save( ISave &save )
if ( pIdealSchedule ) if ( pIdealSchedule )
{ {
const char *pszIdealSchedule = pIdealSchedule->GetName(); const char *pszIdealSchedule = pIdealSchedule->GetName();
Assert( Q_strlen( pszIdealSchedule ) < sizeof( saveHeader.szIdealSchedule ) - 1 ); Assert( Q_strlen( pszIdealSchedule ) < (int)sizeof( saveHeader.szIdealSchedule ) - 1 );
Q_strncpy( saveHeader.szIdealSchedule, pszIdealSchedule, sizeof( saveHeader.szIdealSchedule ) ); Q_strncpy( saveHeader.szIdealSchedule, pszIdealSchedule, sizeof( saveHeader.szIdealSchedule ) );
} }
} }
@ -10985,7 +11002,7 @@ int CAI_BaseNPC::Save( ISave &save )
if ( pFailSchedule ) if ( pFailSchedule )
{ {
const char *pszFailSchedule = pFailSchedule->GetName(); const char *pszFailSchedule = pFailSchedule->GetName();
Assert( Q_strlen( pszFailSchedule ) < sizeof( saveHeader.szFailSchedule ) - 1 ); Assert( Q_strlen( pszFailSchedule ) < (int)sizeof( saveHeader.szFailSchedule ) - 1 );
Q_strncpy( saveHeader.szFailSchedule, pszFailSchedule, sizeof( saveHeader.szFailSchedule ) ); Q_strncpy( saveHeader.szFailSchedule, pszFailSchedule, sizeof( saveHeader.szFailSchedule ) );
} }
} }
@ -10995,7 +11012,7 @@ int CAI_BaseNPC::Save( ISave &save )
const char *pszSequenceName = GetSequenceName( GetSequence() ); const char *pszSequenceName = GetSequenceName( GetSequence() );
if ( pszSequenceName && *pszSequenceName ) if ( pszSequenceName && *pszSequenceName )
{ {
Assert( Q_strlen( pszSequenceName ) < sizeof( saveHeader.szSequence ) - 1 ); Assert( Q_strlen( pszSequenceName ) < (int)sizeof( saveHeader.szSequence ) - 1 );
Q_strncpy( saveHeader.szSequence, pszSequenceName, sizeof(saveHeader.szSequence) ); Q_strncpy( saveHeader.szSequence, pszSequenceName, sizeof(saveHeader.szSequence) );
} }
} }
@ -14015,6 +14032,8 @@ bool CAI_BaseNPC::IsCrouchedActivity( Activity activity )
case ACT_COVER_SMG1_LOW: case ACT_COVER_SMG1_LOW:
case ACT_RELOAD_SMG1_LOW: case ACT_RELOAD_SMG1_LOW:
return true; return true;
default:
break;
} }
return false; return false;

View File

@ -931,7 +931,7 @@ public:
Activity GetIdealActivity( void ) { return m_IdealActivity; } Activity GetIdealActivity( void ) { return m_IdealActivity; }
void SetIdealActivity( Activity NewActivity ); void SetIdealActivity( Activity NewActivity );
void ResetIdealActivity( Activity newIdealActivity ); void ResetIdealActivity( Activity newIdealActivity );
void SetSequenceByName( char *szSequence ); void SetSequenceByName( const char *szSequence );
void SetSequenceById( int iSequence ); void SetSequenceById( int iSequence );
Activity GetScriptCustomMoveActivity( void ); Activity GetScriptCustomMoveActivity( void );
int GetScriptCustomMoveSequence( void ); int GetScriptCustomMoveSequence( void );
@ -1748,7 +1748,7 @@ public:
virtual float GetHitgroupDamageMultiplier( int iHitGroup, const CTakeDamageInfo &info ); virtual float GetHitgroupDamageMultiplier( int iHitGroup, const CTakeDamageInfo &info );
void TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr ); void TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr );
void DecalTrace( trace_t *pTrace, char const *decalName ); void DecalTrace( trace_t *pTrace, char const *decalName );
void ImpactTrace( trace_t *pTrace, int iDamageType, char *pCustomImpactName ); void ImpactTrace( trace_t *pTrace, int iDamageType, const char *pCustomImpactName );
virtual bool PlayerInSpread( const Vector &sourcePos, const Vector &targetPos, float flSpread, float maxDistOffCenter, bool ignoreHatedPlayers = true ); virtual bool PlayerInSpread( const Vector &sourcePos, const Vector &targetPos, float flSpread, float maxDistOffCenter, bool ignoreHatedPlayers = true );
CBaseEntity * PlayerInRange( const Vector &vecLocation, float flDist ); CBaseEntity * PlayerInRange( const Vector &vecLocation, float flDist );
bool PointInSpread( CBaseCombatCharacter *pCheckEntity, const Vector &sourcePos, const Vector &targetPos, const Vector &testPoint, float flSpread, float maxDistOffCenter ); bool PointInSpread( CBaseCombatCharacter *pCheckEntity, const Vector &sourcePos, const Vector &targetPos, const Vector &testPoint, float flSpread, float maxDistOffCenter );
@ -1805,7 +1805,7 @@ public:
virtual void PickupWeapon( CBaseCombatWeapon *pWeapon ); virtual void PickupWeapon( CBaseCombatWeapon *pWeapon );
virtual void PickupItem( CBaseEntity *pItem ) { }; virtual void PickupItem( CBaseEntity *pItem ) { };
CBaseEntity* DropItem( char *pszItemName, Vector vecPos, QAngle vecAng );// drop an item. CBaseEntity* DropItem( const char *pszItemName, Vector vecPos, QAngle vecAng );// drop an item.
//--------------------------------- //---------------------------------
@ -2338,7 +2338,7 @@ typedef CHandle<CAI_BaseNPC> AIHANDLE;
#define DEFINE_SCHEDULE( id, text ) \ #define DEFINE_SCHEDULE( id, text ) \
scheduleIds.PushBack( #id, id ); \ scheduleIds.PushBack( #id, id ); \
char * g_psz##id = \ const char * g_psz##id = \
"\n Schedule" \ "\n Schedule" \
"\n " #id \ "\n " #id \
text \ text \

View File

@ -336,8 +336,6 @@ void CAI_BasePhysicsFlyingBot::TranslateNavGoal( CBaseEntity *pTarget, Vector &c
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
IMotionEvent::simresult_e CAI_BasePhysicsFlyingBot::Simulate( IPhysicsMotionController *pController, IPhysicsObject *pObject, float deltaTime, Vector &linear, AngularImpulse &angular ) IMotionEvent::simresult_e CAI_BasePhysicsFlyingBot::Simulate( IPhysicsMotionController *pController, IPhysicsObject *pObject, float deltaTime, Vector &linear, AngularImpulse &angular )
{ {
static int count;
IPhysicsObject *pPhysicsObject = VPhysicsGetObject(); IPhysicsObject *pPhysicsObject = VPhysicsGetObject();
// Assert( pPhysicsObject ); // Assert( pPhysicsObject );
if (!pPhysicsObject) if (!pPhysicsObject)

View File

@ -1254,7 +1254,7 @@ void CAI_BaseNPC::StartTask( const Task_t *pTask )
{ {
if (!GetHintNode()) if (!GetHintNode())
{ {
SetHintNode( CAI_HintManager::FindHint( this, HINT_NONE, pTask->flTaskData, 2000 ) ); SetHintNode( CAI_HintManager::FindHint( this, HINT_NONE, (int)pTask->flTaskData, 2000 ) );
} }
if (GetHintNode()) if (GetHintNode())
{ {
@ -1452,7 +1452,7 @@ void CAI_BaseNPC::StartTask( const Task_t *pTask )
break; break;
case TASK_SET_SCHEDULE: case TASK_SET_SCHEDULE:
if ( !SetSchedule( pTask->flTaskData ) ) if ( !SetSchedule( (int)pTask->flTaskData ) )
TaskFail(FAIL_SCHEDULE_NOT_FOUND); TaskFail(FAIL_SCHEDULE_NOT_FOUND);
break; break;
@ -2713,7 +2713,7 @@ void CAI_BaseNPC::StartTask( const Task_t *pTask )
} }
case TASK_SPEAK_SENTENCE: case TASK_SPEAK_SENTENCE:
{ {
SpeakSentence(pTask->flTaskData); SpeakSentence((int)pTask->flTaskData);
TaskComplete(); TaskComplete();
break; break;
} }
@ -3045,7 +3045,7 @@ void CAI_BaseNPC::StartTask( const Task_t *pTask )
{ {
int iMinDist, iMaxDist, iParameter; int iMinDist, iMaxDist, iParameter;
iParameter = pTask->flTaskData; iParameter = (int)pTask->flTaskData;
iMinDist = iParameter / 10000; iMinDist = iParameter / 10000;
iMaxDist = iParameter - (iMinDist * 10000); iMaxDist = iParameter - (iMinDist * 10000);
@ -3584,6 +3584,7 @@ void CAI_BaseNPC::RunTask( const Task_t *pTask )
{ {
case ACT_WALK_AIM: curActivity = ACT_WALK; break; case ACT_WALK_AIM: curActivity = ACT_WALK; break;
case ACT_RUN_AIM: curActivity = ACT_RUN; break; case ACT_RUN_AIM: curActivity = ACT_RUN; break;
default: break;
} }
if ( curActivity != followActivity ) if ( curActivity != followActivity )

View File

@ -15,11 +15,15 @@
#include "networkvar.h" #include "networkvar.h"
#ifdef DEBUG #ifdef DEBUG
#ifdef _MSC_VER
#pragma warning(push) #pragma warning(push)
#endif
#include <typeinfo> #include <typeinfo>
#ifdef _MSC_VER
#pragma warning(pop) #pragma warning(pop)
#pragma warning(disable:4290) #pragma warning(disable:4290)
#endif #endif
#endif
#if defined( _WIN32 ) #if defined( _WIN32 )
#pragma once #pragma once
@ -274,28 +278,28 @@ public:
{ {
if ( condition >= ID_SPACE_OFFSET && condition < ID_SPACE_OFFSET + 10000 ) // it's local to us if ( condition >= ID_SPACE_OFFSET && condition < ID_SPACE_OFFSET + 10000 ) // it's local to us
condition = GetClassScheduleIdSpace()->ConditionLocalToGlobal( condition ); condition = GetClassScheduleIdSpace()->ConditionLocalToGlobal( condition );
GetOuter()->SetCondition( condition ); CAI_ComponentWithOuter<NPC_CLASS, CAI_BehaviorBase>::GetOuter()->SetCondition( condition );
} }
bool HasCondition( int condition ) bool HasCondition( int condition )
{ {
if ( condition >= ID_SPACE_OFFSET && condition < ID_SPACE_OFFSET + 10000 ) // it's local to us if ( condition >= ID_SPACE_OFFSET && condition < ID_SPACE_OFFSET + 10000 ) // it's local to us
condition = GetClassScheduleIdSpace()->ConditionLocalToGlobal( condition ); condition = GetClassScheduleIdSpace()->ConditionLocalToGlobal( condition );
return GetOuter()->HasCondition( condition ); return CAI_ComponentWithOuter<NPC_CLASS, CAI_BehaviorBase>::GetOuter()->HasCondition( condition );
} }
bool HasInterruptCondition( int condition ) bool HasInterruptCondition( int condition )
{ {
if ( condition >= ID_SPACE_OFFSET && condition < ID_SPACE_OFFSET + 10000 ) // it's local to us if ( condition >= ID_SPACE_OFFSET && condition < ID_SPACE_OFFSET + 10000 ) // it's local to us
condition = GetClassScheduleIdSpace()->ConditionLocalToGlobal( condition ); condition = GetClassScheduleIdSpace()->ConditionLocalToGlobal( condition );
return GetOuter()->HasInterruptCondition( condition ); return CAI_ComponentWithOuter<NPC_CLASS, CAI_BehaviorBase>::GetOuter()->HasInterruptCondition( condition );
} }
void ClearCondition( int condition ) void ClearCondition( int condition )
{ {
if ( condition >= ID_SPACE_OFFSET && condition < ID_SPACE_OFFSET + 10000 ) // it's local to us if ( condition >= ID_SPACE_OFFSET && condition < ID_SPACE_OFFSET + 10000 ) // it's local to us
condition = GetClassScheduleIdSpace()->ConditionLocalToGlobal( condition ); condition = GetClassScheduleIdSpace()->ConditionLocalToGlobal( condition );
GetOuter()->ClearCondition( condition ); CAI_ComponentWithOuter<NPC_CLASS, CAI_BehaviorBase>::GetOuter()->ClearCondition( condition );
} }
protected: protected:
@ -310,7 +314,7 @@ protected:
} }
virtual CAI_ClassScheduleIdSpace *GetClassScheduleIdSpace() virtual CAI_ClassScheduleIdSpace *GetClassScheduleIdSpace()
{ {
return GetOuter()->GetClassScheduleIdSpace(); return CAI_ComponentWithOuter<NPC_CLASS, CAI_BehaviorBase>::GetOuter()->GetClassScheduleIdSpace();
} }
static CAI_ClassScheduleIdSpace &AccessClassScheduleIdSpaceDirect() static CAI_ClassScheduleIdSpace &AccessClassScheduleIdSpaceDirect()
@ -1041,7 +1045,7 @@ inline void CAI_BehaviorHost<BASE_NPC>::ChangeBehaviorTo( CAI_BehaviorBase *pNew
if ( pOldBehavior ) if ( pOldBehavior )
{ {
pOldBehavior->EndScheduleSelection(); pOldBehavior->EndScheduleSelection();
VacateStrategySlot(); this->VacateStrategySlot();
} }
OnChangeRunningBehavior( pOldBehavior, pNewBehavior ); OnChangeRunningBehavior( pOldBehavior, pNewBehavior );

View File

@ -350,7 +350,7 @@ void CAI_AssaultBehavior::ClearAssaultPoint( void )
} }
else else
{ {
DevMsg("**ERROR: Can't find next assault point: %s\n", m_hAssaultPoint->m_NextAssaultPointName ); DevMsg("**ERROR: Can't find next assault point: %s\n", STRING(m_hAssaultPoint->m_NextAssaultPointName) );
// Bomb out of assault behavior. // Bomb out of assault behavior.
m_AssaultCue = CUE_NO_ASSAULT; m_AssaultCue = CUE_NO_ASSAULT;
@ -1112,6 +1112,9 @@ bool CAI_AssaultBehavior::PollAssaultCue( void )
// Player told me to go, so go! // Player told me to go, so go!
return m_ReceivedAssaultCue == CUE_COMMANDER; return m_ReceivedAssaultCue == CUE_COMMANDER;
break; break;
default:
break;
} }
return false; return false;

View File

@ -2542,7 +2542,7 @@ AI_FollowFormation_t *AIGetFormation( AI_Formations_t formation )
{ {
if ( formation < 0 ) if ( formation < 0 )
formation = (AI_Formations_t)0; formation = (AI_Formations_t)0;
else if ( formation >= ARRAYSIZE( g_AI_Formations ) ) else if ( (size_t)formation >= ARRAYSIZE( g_AI_Formations ) )
formation = (AI_Formations_t)(ARRAYSIZE( g_AI_Formations ) - 1 ); formation = (AI_Formations_t)(ARRAYSIZE( g_AI_Formations ) - 1 );
return g_AI_Formations[formation]; return g_AI_Formations[formation];

View File

@ -268,7 +268,7 @@ bool CAI_LeadBehavior::GetClosestPointOnRoute( const Vector &targetPos, Vector *
float flNearestDist = 999999999; float flNearestDist = 999999999;
float flPathDist, flPathDist2D; float flPathDist, flPathDist2D;
Vector vecNearestPoint; Vector vecNearestPoint = Vector(0.0f, 0.0f, 0.0f);
Vector vecPrevPos = GetOuter()->GetAbsOrigin(); Vector vecPrevPos = GetOuter()->GetAbsOrigin();
for ( ; (waypoint != NULL) ; waypoint = waypoint->GetNext() ) for ( ; (waypoint != NULL) ; waypoint = waypoint->GetNext() )
{ {
@ -934,6 +934,7 @@ void CAI_LeadBehavior::RunTask( const Task_t *pTask )
{ {
case ACT_WALK_AIM: curActivity = ACT_WALK; break; case ACT_WALK_AIM: curActivity = ACT_WALK; break;
case ACT_RUN_AIM: curActivity = ACT_RUN; break; case ACT_RUN_AIM: curActivity = ACT_RUN; break;
default: break;
} }
if ( curActivity != followActivity ) if ( curActivity != followActivity )

View File

@ -62,9 +62,9 @@ END_DATADESC();
// Constructor // Constructor
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
CAI_PassengerBehavior::CAI_PassengerBehavior( void ) : CAI_PassengerBehavior::CAI_PassengerBehavior( void ) :
m_bEnabled( false ),
m_hVehicle( NULL ),
m_PassengerState( PASSENGER_STATE_OUTSIDE ), m_PassengerState( PASSENGER_STATE_OUTSIDE ),
m_hVehicle( NULL ),
m_bEnabled( false ),
m_PassengerIntent( PASSENGER_INTENT_NONE ), m_PassengerIntent( PASSENGER_INTENT_NONE ),
m_nTransitionSequence( -1 ) m_nTransitionSequence( -1 )
{ {
@ -231,7 +231,7 @@ void CAI_PassengerBehavior::InitVehicleState( void )
m_vehicleState.m_flNextWarningTime = gpGlobals->curtime; m_vehicleState.m_flNextWarningTime = gpGlobals->curtime;
m_vehicleState.m_vecLastAngles = m_hVehicle->GetAbsAngles(); m_vehicleState.m_vecLastAngles = m_hVehicle->GetAbsAngles();
Vector localVelocity; Vector localVelocity(0.0f, 0.0f, 0.0f);
GetLocalVehicleVelocity( &m_vehicleState.m_vecLastLocalVelocity ); GetLocalVehicleVelocity( &m_vehicleState.m_vecLastLocalVelocity );
m_vehicleState.m_flLastSpeedSqr = localVelocity.LengthSqr(); m_vehicleState.m_flLastSpeedSqr = localVelocity.LengthSqr();

View File

@ -53,14 +53,14 @@ void CRopeAnchor::Spawn()
BaseClass::Spawn(); BaseClass::Spawn();
// Decent enough default in case something happens to our owner! // Decent enough default in case something happens to our owner!
float flDist = 384; float flDist = 384.0f;
if( GetOwnerEntity() ) if( GetOwnerEntity() )
{ {
flDist = fabs( GetOwnerEntity()->GetAbsOrigin().z - GetAbsOrigin().z ); flDist = fabs( GetOwnerEntity()->GetAbsOrigin().z - GetAbsOrigin().z );
} }
m_hRope = CRopeKeyframe::CreateWithSecondPointDetached( this, -1, flDist, RAPPEL_ROPE_WIDTH, "cable/cable.vmt", 5, true ); m_hRope = CRopeKeyframe::CreateWithSecondPointDetached( this, -1, (int)flDist, RAPPEL_ROPE_WIDTH, "cable/cable.vmt", 5, true );
ASSERT( m_hRope != NULL ); ASSERT( m_hRope != NULL );
@ -355,7 +355,7 @@ void CAI_RappelBehavior::BeginRappel()
Vector forward; Vector forward;
GetOuter()->GetVectors( &forward, NULL, NULL ); GetOuter()->GetVectors( &forward, NULL, NULL );
CSoundEnt::InsertSound( SOUND_DANGER, tr.m_pEnt->EarPosition() - forward * 12.0f, 32.0f, 0.2f, GetOuter() ); CSoundEnt::InsertSound( SOUND_DANGER, tr.m_pEnt->EarPosition() - forward * 12.0f, 32, 0.2f, GetOuter() );
} }
} }

View File

@ -1110,7 +1110,7 @@ void CAI_MappedActivityBehavior_Temporary::UpdateTranslateActivityMap()
CBaseCombatWeapon *pWeapon = GetOuter()->GetActiveWeapon(); CBaseCombatWeapon *pWeapon = GetOuter()->GetActiveWeapon();
const char *pszWeaponClass = ( pWeapon ) ? pWeapon->GetClassname() : ""; const char *pszWeaponClass = ( pWeapon ) ? pWeapon->GetClassname() : "";
for ( int i = 0; i < ARRAYSIZE(mappings); i++ ) for ( size_t i = 0; i < ARRAYSIZE(mappings); i++ )
{ {
if ( !mappings[i].pszWeapon || stricmp( mappings[i].pszWeapon, pszWeaponClass ) == 0 ) if ( !mappings[i].pszWeapon || stricmp( mappings[i].pszWeapon, pszWeaponClass ) == 0 )
{ {

View File

@ -974,7 +974,7 @@ int CAI_BlendedMotor::BuildInsertNode( int i, float flTime )
Assert( flTime > 0.0 ); Assert( flTime > 0.0 );
for (i; i < m_scriptTurn.Count() - 1; i++) for (; i < m_scriptTurn.Count() - 1; i++)
{ {
if (m_scriptTurn[i].flTime < flTime) if (m_scriptTurn[i].flTime < flTime)
{ {
@ -1223,6 +1223,8 @@ void CAI_BlendedMotor::BuildVelocityScript( const AILocalMoveGoal_t &move )
script.flMaxVelocity = 0; script.flMaxVelocity = 0;
break; break;
*/ */
default:
break;
} }
} }
else else

View File

@ -214,8 +214,8 @@ class CAI_BlendingHost : public BASE_NPC
{ {
DECLARE_CLASS_NOFRIEND( CAI_BlendingHost, BASE_NPC ); DECLARE_CLASS_NOFRIEND( CAI_BlendingHost, BASE_NPC );
public: public:
const CAI_BlendedMotor *GetBlendedMotor() const { return assert_cast<const CAI_BlendedMotor *>(GetMotor()); } const CAI_BlendedMotor *GetBlendedMotor() const { return assert_cast<const CAI_BlendedMotor *>(this->GetMotor()); }
CAI_BlendedMotor * GetBlendedMotor() { return assert_cast<CAI_BlendedMotor *>(GetMotor()); } CAI_BlendedMotor * GetBlendedMotor() { return assert_cast<CAI_BlendedMotor *>(this->GetMotor()); }
CAI_Motor *CreateMotor() CAI_Motor *CreateMotor()
{ {
@ -232,7 +232,7 @@ public:
float MaxYawSpeed( void ) float MaxYawSpeed( void )
{ {
float override = GetBlendedMotor()->OverrideMaxYawSpeed( GetActivity() ); float override = GetBlendedMotor()->OverrideMaxYawSpeed( this->GetActivity() );
if ( override != -1 ) if ( override != -1 )
return override; return override;
return BaseClass::MaxYawSpeed(); return BaseClass::MaxYawSpeed();

View File

@ -331,6 +331,8 @@ int CAI_BaseNPC::TranslateSchedule( int scheduleType )
return SCHED_ALERT_WALK; return SCHED_ALERT_WALK;
case NPC_STATE_COMBAT: case NPC_STATE_COMBAT:
return SCHED_COMBAT_WALK; return SCHED_COMBAT_WALK;
default:
break;
} }
} }
break; break;

View File

@ -311,7 +311,7 @@ int CAI_HintManager::FindAllHints( CAI_BaseNPC *pNPC, const Vector &position, co
// If we have no hints, bail // If we have no hints, bail
int c = CAI_HintManager::gm_AllHints.Count(); int c = CAI_HintManager::gm_AllHints.Count();
if ( !c ) if ( !c )
return NULL; return 0;
// Remove the nearest flag. It makes now sense with random. // Remove the nearest flag. It makes now sense with random.
bool hadNearest = hintCriteria.HasFlag( bits_HINT_NODE_NEAREST ); bool hadNearest = hintCriteria.HasFlag( bits_HINT_NODE_NEAREST );
@ -684,7 +684,7 @@ int CAI_HintManager::GetFlags( const char *token )
char *lowercase = (char *)_alloca( len + 1 ); char *lowercase = (char *)_alloca( len + 1 );
Q_strncpy( lowercase, token, len+1 ); Q_strncpy( lowercase, token, len+1 );
strlwr( lowercase ); Q_strlower( lowercase );
if ( strstr( "none", lowercase ) ) if ( strstr( "none", lowercase ) )
{ {
@ -1038,6 +1038,8 @@ bool CAI_Hint::IsViewable(void)
case HINT_WORLD_VISUALLY_INTERESTING_DONT_AIM: case HINT_WORLD_VISUALLY_INTERESTING_DONT_AIM:
case HINT_WORLD_VISUALLY_INTERESTING_STEALTH: case HINT_WORLD_VISUALLY_INTERESTING_STEALTH:
return true; return true;
default:
break;
} }
return false; return false;
@ -1625,7 +1627,7 @@ hinttypedescs_t g_pszHintDescriptions[] =
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
const char *GetHintTypeDescription( Hint_e iHintType ) const char *GetHintTypeDescription( Hint_e iHintType )
{ {
for ( int i = 0; i < ARRAYSIZE(g_pszHintDescriptions); i++ ) for ( size_t i = 0; i < ARRAYSIZE(g_pszHintDescriptions); i++ )
{ {
if ( g_pszHintDescriptions[i].iType == iHintType ) if ( g_pszHintDescriptions[i].iType == iHintType )
return g_pszHintDescriptions[i].pszDesc; return g_pszHintDescriptions[i].pszDesc;
@ -1655,7 +1657,7 @@ void CC_ai_drop_hint( const CCommand &args )
{ {
Msg("Invalid hint type specified. Format: ai_drop_hint <hint type>\nValid hint types:\n"); Msg("Invalid hint type specified. Format: ai_drop_hint <hint type>\nValid hint types:\n");
for ( int i = 0; i < ARRAYSIZE(g_pszHintDescriptions); i++ ) for ( size_t i = 0; i < ARRAYSIZE(g_pszHintDescriptions); i++ )
{ {
Msg("%d : %s\n", g_pszHintDescriptions[i].iType, g_pszHintDescriptions[i].pszDesc ); Msg("%d : %s\n", g_pszHintDescriptions[i].iType, g_pszHintDescriptions[i].pszDesc );
} }

View File

@ -201,6 +201,7 @@ public:
CAIHintVector &operator=( const CAIHintVector &src ) CAIHintVector &operator=( const CAIHintVector &src )
{ {
CopyArray( src.Base(), src.Count() ); CopyArray( src.Base(), src.Count() );
return *this;
} }
}; };

View File

@ -11,7 +11,7 @@
struct ai_hull_t struct ai_hull_t
{ {
ai_hull_t( int bit, const char *pName, const Vector &_mins, const Vector &_maxs, const Vector &_smallMins, const Vector &_smallMaxs ) ai_hull_t( int bit, const char *pName, const Vector &_mins, const Vector &_maxs, const Vector &_smallMins, const Vector &_smallMaxs )
: hullBit( bit ), mins( _mins ), maxs( _maxs ), smallMins( _smallMins ), smallMaxs( _smallMaxs ), name( pName ) {} : hullBit( bit ), name( pName ), mins( _mins ), maxs( _maxs ), smallMins( _smallMins ), smallMaxs( _smallMaxs ) {}
int hullBit; int hullBit;
const char* name; const char* name;

View File

@ -34,14 +34,18 @@ void DebugNoteMovementFailure()
} }
// a place to put breakpoints // a place to put breakpoints
#ifdef _MSC_VER
#pragma warning(push) #pragma warning(push)
#pragma warning(disable:4189) #pragma warning(disable:4189)
#endif
AIMoveResult_t DbgResult( AIMoveResult_t result ) AIMoveResult_t DbgResult( AIMoveResult_t result )
{ {
#ifdef _MSC_VER
if ( result < AIMR_OK ) if ( result < AIMR_OK )
{ {
int breakHere = 1; //int breakHere = 1;
} }
#endif
switch ( result ) switch ( result )
{ {
@ -747,10 +751,11 @@ void CAI_Motor::UpdateYaw( int yawSpeed )
GetOuter()->SetUpdatedYaw(); GetOuter()->SetUpdatedYaw();
float yaw = static_cast<float>(yawSpeed);
float ideal, current, newYaw; float ideal, current, newYaw;
if ( yawSpeed == -1 ) if ( yaw == -1.0f )
yawSpeed = GetYawSpeed(); yaw = GetYawSpeed();
// NOTE: GetIdealYaw() will never exactly be reached because UTIL_AngleMod // NOTE: GetIdealYaw() will never exactly be reached because UTIL_AngleMod
// also truncates the angle to 16 bits of resolution. So lets truncate it here. // also truncates the angle to 16 bits of resolution. So lets truncate it here.
@ -760,7 +765,7 @@ void CAI_Motor::UpdateYaw( int yawSpeed )
// FIXME: this needs a proper interval // FIXME: this needs a proper interval
float dt = min( 0.2, gpGlobals->curtime - GetLastThink() ); float dt = min( 0.2, gpGlobals->curtime - GetLastThink() );
newYaw = AI_ClampYaw( (float)yawSpeed * 10.0, current, ideal, dt ); newYaw = AI_ClampYaw( yaw * 10.0f, current, ideal, dt );
if (newYaw != current) if (newYaw != current)
{ {
@ -908,7 +913,7 @@ AIMoveResult_t CAI_Motor::MoveNormalExecute( const AILocalMoveGoal_t &move )
AIMR_BLOCKED_WORLD, // AIM_PARTIAL_HIT_WORLD AIMR_BLOCKED_WORLD, // AIM_PARTIAL_HIT_WORLD
AIMR_BLOCKED_WORLD, // AIM_PARTIAL_HIT_TARGET AIMR_BLOCKED_WORLD, // AIM_PARTIAL_HIT_TARGET
}; };
Assert( ARRAYSIZE( moveResults ) == AIM_NUM_RESULTS && fMotorResult >= 0 && fMotorResult <= ARRAYSIZE( moveResults ) ); Assert( (AIMotorMoveResult_t)ARRAYSIZE( moveResults ) == AIM_NUM_RESULTS && fMotorResult >= 0 && fMotorResult <= (AIMotorMoveResult_t)ARRAYSIZE( moveResults ) );
AIMoveResult_t result = moveResults[fMotorResult]; AIMoveResult_t result = moveResults[fMotorResult];

View File

@ -138,6 +138,8 @@ void CAI_MoveAndShootOverlay::UpdateMoveShootActivity( bool bMoveAimAtEnemy )
case ACT_RUN: case ACT_RUN:
newActivity = ACT_RUN_AIM; newActivity = ACT_RUN_AIM;
break; break;
default:
break;
} }
} }
else else
@ -150,6 +152,8 @@ void CAI_MoveAndShootOverlay::UpdateMoveShootActivity( bool bMoveAimAtEnemy )
case ACT_RUN_AIM: case ACT_RUN_AIM:
newActivity = ACT_RUN; newActivity = ACT_RUN;
break; break;
default:
break;
} }
} }

View File

@ -114,7 +114,7 @@ bool CAI_MoveSolver::Solve( const AI_MoveSuggestion_t *pSuggestions, int nSugges
AI_MoveSuggestion_t *pHighSuggestion; AI_MoveSuggestion_t *pHighSuggestion;
}; };
Solution_t solutions[NUM_SOLUTIONS] = { 0 }; Solution_t solutions[NUM_SOLUTIONS] = { {0.0f, 0.0f, NULL} };
//--------------------------------- //---------------------------------
@ -133,15 +133,15 @@ bool CAI_MoveSolver::Solve( const AI_MoveSuggestion_t *pSuggestions, int nSugges
// Convert arc values to solution indices relative to right post. Right is angle down, left is angle up. // Convert arc values to solution indices relative to right post. Right is angle down, left is angle up.
float halfSpan = current.arc.span * 0.5; float halfSpan = current.arc.span * 0.5;
int center = round( ( halfSpan * NUM_SOLUTIONS ) / 360 ); int center = (int)round( ( halfSpan * NUM_SOLUTIONS ) / 360 );
int left = ( current.arc.span * NUM_SOLUTIONS ) / 360; int left = (int)( (current.arc.span * NUM_SOLUTIONS) / 360 );
float angRight = current.arc.center - halfSpan; float angRight = current.arc.center - halfSpan;
if (angRight < 0.0) if (angRight < 0.0)
angRight += 360; angRight += 360;
int base = ( angRight * NUM_SOLUTIONS ) / 360; int base = (int)( (angRight * NUM_SOLUTIONS) / 360 );
// Sweep from left to right, summing the bias. For positive suggestions, // Sweep from left to right, summing the bias. For positive suggestions,
// the bias is further weighted to favor the center of the arc. // the bias is further weighted to favor the center of the arc.

View File

@ -90,12 +90,12 @@ int CAI_GlobalNamespace::NextGlobalBase() const
// //
CAI_LocalIdSpace::CAI_LocalIdSpace( bool fIsRoot ) CAI_LocalIdSpace::CAI_LocalIdSpace( bool fIsRoot )
: m_pGlobalNamespace( NULL ), : m_globalBase( (fIsRoot) ? 0 : -1 ),
m_pParentIDSpace( NULL ),
m_globalBase( (fIsRoot) ? 0 : -1 ),
m_localBase( (fIsRoot) ? 0 : MAX_STRING_INDEX ), m_localBase( (fIsRoot) ? 0 : MAX_STRING_INDEX ),
m_localTop( -1 ), m_localTop( -1 ),
m_globalTop( -1 ) m_globalTop( -1 ),
m_pParentIDSpace( NULL ),
m_pGlobalNamespace( NULL )
{ {
}; };

View File

@ -1221,7 +1221,6 @@ float CAI_Navigator::GetPathTimeToGoal()
AI_PathNode_t CAI_Navigator::GetNearestNode() AI_PathNode_t CAI_Navigator::GetNearestNode()
{ {
COMPILE_TIME_ASSERT( (int)AIN_NO_NODE == NO_NODE );
return (AI_PathNode_t)( GetPathfinder()->NearestNodeToNPC() ); return (AI_PathNode_t)( GetPathfinder()->NearestNodeToNPC() );
} }
@ -2325,6 +2324,9 @@ bool CAI_Navigator::PreMove()
GetMotor()->MoveJumpStop(); GetMotor()->MoveJumpStop();
break; break;
} }
default:
break;
} }
SetNavType( NAV_GROUND ); SetNavType( NAV_GROUND );
@ -2530,6 +2532,8 @@ bool CAI_Navigator::Move( float flInterval )
case NAV_FLY: case NAV_FLY:
OnMoveBlocked( &moveResult ); OnMoveBlocked( &moveResult );
break; break;
default:
break;
} }
break; break;
} }
@ -3819,6 +3823,9 @@ bool CAI_Navigator::DoFindPath( void )
} }
} }
break; break;
default:
break;
} }
return returnCode; return returnCode;
@ -4131,18 +4138,18 @@ void CAI_Navigator::DrawDebugRouteOverlay(void)
if (waypoint) if (waypoint)
{ {
Vector RGB = GetRouteColor(waypoint->NavType(), waypoint->Flags()); Vector RGB = GetRouteColor(waypoint->NavType(), waypoint->Flags());
NDebugOverlay::Line(GetLocalOrigin(), waypoint->GetPos(), RGB[0],RGB[1],RGB[2], true,0); NDebugOverlay::Line(GetLocalOrigin(), waypoint->GetPos(), (int)RGB[0], (int)RGB[1], (int)RGB[2], true,0);
} }
while (waypoint) while (waypoint)
{ {
Vector RGB = GetWaypointColor(waypoint->NavType()); Vector RGB = GetWaypointColor(waypoint->NavType());
NDebugOverlay::Box(waypoint->GetPos(), Vector(-3,-3,-3),Vector(3,3,3), RGB[0],RGB[1],RGB[2], true,0); NDebugOverlay::Box(waypoint->GetPos(), Vector(-3,-3,-3), Vector(3,3,3), (int)RGB[0], (int)RGB[1], (int)RGB[2], true, 0);
if (waypoint->GetNext()) if (waypoint->GetNext())
{ {
Vector RGB = GetRouteColor(waypoint->GetNext()->NavType(), waypoint->GetNext()->Flags()); Vector RGB = GetRouteColor(waypoint->GetNext()->NavType(), waypoint->GetNext()->Flags());
NDebugOverlay::Line(waypoint->GetPos(), waypoint->GetNext()->GetPos(),RGB[0],RGB[1],RGB[2], true,0); NDebugOverlay::Line(waypoint->GetPos(), waypoint->GetNext()->GetPos(), (int)RGB[0], (int)RGB[1], (int)RGB[2], true, 0);
} }
waypoint = waypoint->GetNext(); waypoint = waypoint->GetNext();
} }

View File

@ -663,12 +663,12 @@ inline AI_NavGoal_t::AI_NavGoal_t( GoalType_t type,
dest(AIN_NO_DEST), dest(AIN_NO_DEST),
destNode(AIN_NO_NODE), destNode(AIN_NO_NODE),
activity(activity), activity(activity),
arrivalActivity( AIN_DEF_ACTIVITY ),
arrivalSequence( ACT_INVALID ),
tolerance(tolerance), tolerance(tolerance),
maxInitialSimplificationDist(-1), maxInitialSimplificationDist(-1),
flags(flags), flags(flags),
pTarget(pTarget), pTarget(pTarget)
arrivalActivity( AIN_DEF_ACTIVITY ),
arrivalSequence( ACT_INVALID )
{ {
} }
@ -681,12 +681,12 @@ inline AI_NavGoal_t::AI_NavGoal_t( const Vector &dest,
dest(dest), dest(dest),
destNode(AIN_NO_NODE), destNode(AIN_NO_NODE),
activity(activity), activity(activity),
arrivalActivity( AIN_DEF_ACTIVITY ),
arrivalSequence( ACT_INVALID ),
tolerance(tolerance), tolerance(tolerance),
maxInitialSimplificationDist(-1), maxInitialSimplificationDist(-1),
flags(flags), flags(flags),
pTarget(pTarget), pTarget(pTarget)
arrivalActivity( AIN_DEF_ACTIVITY ),
arrivalSequence( ACT_INVALID )
{ {
} }
@ -700,12 +700,12 @@ inline AI_NavGoal_t::AI_NavGoal_t( GoalType_t type,
dest(dest), dest(dest),
destNode(AIN_NO_NODE), destNode(AIN_NO_NODE),
activity(activity), activity(activity),
arrivalActivity( AIN_DEF_ACTIVITY ),
arrivalSequence( ACT_INVALID ),
tolerance(tolerance), tolerance(tolerance),
maxInitialSimplificationDist(-1), maxInitialSimplificationDist(-1),
flags(flags), flags(flags),
pTarget(pTarget), pTarget(pTarget)
arrivalActivity( AIN_DEF_ACTIVITY ),
arrivalSequence( ACT_INVALID )
{ {
} }
@ -718,12 +718,12 @@ inline AI_NavGoal_t::AI_NavGoal_t( AI_PathNode_t destNode,
dest(AIN_NO_DEST), dest(AIN_NO_DEST),
destNode(destNode), destNode(destNode),
activity(activity), activity(activity),
arrivalActivity( AIN_DEF_ACTIVITY ),
arrivalSequence( ACT_INVALID ),
tolerance(tolerance), tolerance(tolerance),
maxInitialSimplificationDist(-1), maxInitialSimplificationDist(-1),
flags(flags), flags(flags),
pTarget(pTarget), pTarget(pTarget)
arrivalActivity( AIN_DEF_ACTIVITY ),
arrivalSequence( ACT_INVALID )
{ {
} }
@ -737,12 +737,12 @@ inline AI_NavGoal_t::AI_NavGoal_t( GoalType_t type,
dest(AIN_NO_DEST), dest(AIN_NO_DEST),
destNode(destNode), destNode(destNode),
activity(activity), activity(activity),
arrivalActivity( AIN_DEF_ACTIVITY ),
arrivalSequence( ACT_INVALID ),
tolerance(tolerance), tolerance(tolerance),
maxInitialSimplificationDist(-1), maxInitialSimplificationDist(-1),
flags(flags), flags(flags),
pTarget(pTarget), pTarget(pTarget)
arrivalActivity( AIN_DEF_ACTIVITY ),
arrivalSequence( ACT_INVALID )
{ {
} }

View File

@ -47,13 +47,13 @@ public:
class CNodeFilter : public INodeListFilter class CNodeFilter : public INodeListFilter
{ {
public: public:
CNodeFilter( CAI_BaseNPC *pNPC, const Vector &pos ) : m_pNPC(pNPC), m_pos(pos) CNodeFilter( CAI_BaseNPC *pNPC, const Vector &pos ) : m_pos(pos), m_pNPC(pNPC)
{ {
if ( m_pNPC ) if ( m_pNPC )
m_capabilities = m_pNPC->CapabilitiesGet(); m_capabilities = m_pNPC->CapabilitiesGet();
} }
CNodeFilter( const Vector &pos ) : m_pNPC(NULL), m_pos(pos) CNodeFilter( const Vector &pos ) : m_pos(pos), m_pNPC(NULL)
{ {
} }

View File

@ -2414,7 +2414,7 @@ void CAI_NetworkBuilder::InitClimbNodePosition(CAI_Network *pNetwork, CAI_Node *
{ {
float floorZ = GetFloorZ(origin); // FIXME: don't use this float floorZ = GetFloorZ(origin); // FIXME: don't use this
if (abs(pNode->GetOrigin().z - floorZ) < 36) if (fabs(pNode->GetOrigin().z - floorZ) < 36.0f)
{ {
CAI_Node *new_node = pNetwork->AddNode( pNode->GetOrigin(), pNode->m_flYaw ); CAI_Node *new_node = pNetwork->AddNode( pNode->GetOrigin(), pNode->m_flYaw );
new_node->m_pHint = NULL; new_node->m_pHint = NULL;

View File

@ -1514,7 +1514,7 @@ AI_Waypoint_t *CAI_Pathfinder::BuildRadialRoute( const Vector &vStartPos, const
vNextPos.y += flRadius * sin( flCurAngle ); vNextPos.y += flRadius * sin( flCurAngle );
// Build a route from the last position to the current one // Build a route from the last position to the current one
pNextRoute = BuildLocalRoute( vLastPos, vNextPos, NULL, NULL, NO_NODE, fRouteBits, goalTolerance); pNextRoute = BuildLocalRoute( vLastPos, vNextPos, NULL, 0, NO_NODE, fRouteBits, goalTolerance);
// If we can't find a route, we failed // If we can't find a route, we failed
if ( pNextRoute == NULL ) if ( pNextRoute == NULL )
@ -1547,7 +1547,7 @@ AI_Waypoint_t *CAI_Pathfinder::BuildRadialRoute( const Vector &vStartPos, const
return NULL; return NULL;
// Append a path to the final position // Append a path to the final position
pLastRoute = BuildLocalRoute( vLastPos, vGoalPos, NULL, NULL, NO_NODE, bAirRoute ? bits_BUILD_FLY : bits_BUILD_GROUND, goalTolerance ); pLastRoute = BuildLocalRoute( vLastPos, vGoalPos, NULL, 0, NO_NODE, bAirRoute ? bits_BUILD_FLY : bits_BUILD_GROUND, goalTolerance );
if ( pLastRoute == NULL ) if ( pLastRoute == NULL )
return NULL; return NULL;
@ -1687,7 +1687,7 @@ public:
m_moveTypes( buildFlags & ( bits_BUILD_GROUND | bits_BUILD_FLY | bits_BUILD_JUMP | bits_BUILD_CLIMB ) ), m_moveTypes( buildFlags & ( bits_BUILD_GROUND | bits_BUILD_FLY | bits_BUILD_JUMP | bits_BUILD_CLIMB ) ),
m_pRoute( NULL ) m_pRoute( NULL )
{ {
COMPILE_TIME_ASSERT( bits_BUILD_GROUND == bits_CAP_MOVE_GROUND && bits_BUILD_FLY == bits_CAP_MOVE_FLY && bits_BUILD_JUMP == bits_CAP_MOVE_JUMP && bits_BUILD_CLIMB == bits_CAP_MOVE_CLIMB ); COMPILE_TIME_ASSERT( (int)bits_BUILD_GROUND == (int)bits_CAP_MOVE_GROUND && (int)bits_BUILD_FLY == (int)bits_CAP_MOVE_FLY && (int)bits_BUILD_JUMP == (int)bits_CAP_MOVE_JUMP && (int)bits_BUILD_CLIMB == (int)bits_CAP_MOVE_CLIMB );
} }
bool IsValid( CAI_Node *pNode ) bool IsValid( CAI_Node *pNode )
@ -2098,9 +2098,9 @@ void CAI_Pathfinder::CTriDebugOverlay::FadeTriOverlayLines(void)
{ {
for (int i=0;i<NUM_NPC_DEBUG_OVERLAYS;i++) for (int i=0;i<NUM_NPC_DEBUG_OVERLAYS;i++)
{ {
m_debugTriOverlayLine[i]->r *= 0.5; m_debugTriOverlayLine[i]->r = static_cast<int>(m_debugTriOverlayLine[i]->r * 0.5);
m_debugTriOverlayLine[i]->g *= 0.5; m_debugTriOverlayLine[i]->g = static_cast<int>(m_debugTriOverlayLine[i]->g * 0.5);
m_debugTriOverlayLine[i]->b *= 0.5; m_debugTriOverlayLine[i]->b = static_cast<int>(m_debugTriOverlayLine[i]->b * 0.5);
} }
} }
} }

View File

@ -54,8 +54,8 @@ inline float cube( float f )
CAI_PlaneSolver::CAI_PlaneSolver( CAI_BaseNPC *pNpc ) CAI_PlaneSolver::CAI_PlaneSolver( CAI_BaseNPC *pNpc )
: m_pNpc( pNpc ), : m_pNpc( pNpc ),
m_fSolvedPrev( false ),
m_PrevTarget( FLT_MAX, FLT_MAX, FLT_MAX ), m_PrevTarget( FLT_MAX, FLT_MAX, FLT_MAX ),
m_fSolvedPrev( false ),
m_PrevSolution( 0 ), m_PrevSolution( 0 ),
m_ClosestHaveBeenToCurrent( FLT_MAX ), m_ClosestHaveBeenToCurrent( FLT_MAX ),
m_TimeLastProgress( FLT_MAX ), m_TimeLastProgress( FLT_MAX ),

View File

@ -137,8 +137,8 @@ private:
CircleObstacles_t( const Vector &center, float radius, CBaseEntity *pEntity, AI_MoveSuggType_t type ) CircleObstacles_t( const Vector &center, float radius, CBaseEntity *pEntity, AI_MoveSuggType_t type )
: center(center), : center(center),
radius(radius), radius(radius),
hEntity(pEntity), type(type),
type(type) hEntity(pEntity)
{ {
} }

View File

@ -141,7 +141,7 @@ public:
CConceptInfoMap() : CConceptInfoMap() :
CUtlMap<AIConcept_t, ConceptInfo_t *>( CaselessStringLessThan ) CUtlMap<AIConcept_t, ConceptInfo_t *>( CaselessStringLessThan )
{ {
for ( int i = 0; i < ARRAYSIZE(g_ConceptInfos); i++ ) for ( size_t i = 0; i < ARRAYSIZE(g_ConceptInfos); i++ )
{ {
Insert( g_ConceptInfos[i].concept, &g_ConceptInfos[i] ); Insert( g_ConceptInfos[i].concept, &g_ConceptInfos[i] );
} }
@ -165,7 +165,7 @@ CAI_AllySpeechManager::~CAI_AllySpeechManager()
void CAI_AllySpeechManager::Spawn() void CAI_AllySpeechManager::Spawn()
{ {
Assert( g_ConceptInfoMap.Count() != 0 ); Assert( g_ConceptInfoMap.Count() != 0 );
for ( int i = 0; i < ARRAYSIZE(g_ConceptInfos); i++ ) for ( size_t i = 0; i < ARRAYSIZE(g_ConceptInfos); i++ )
m_ConceptTimers.Insert( AllocPooledString( g_ConceptInfos[i].concept ), CSimpleSimTimer() ); m_ConceptTimers.Insert( AllocPooledString( g_ConceptInfos[i].concept ), CSimpleSimTimer() );
} }
@ -1536,7 +1536,7 @@ bool CAI_PlayerAlly::ShouldSpeakRandom( AIConcept_t concept, int iChance )
if ( flModifier < 0.001 ) if ( flModifier < 0.001 )
return false; return false;
iChance = floor( (float)iChance / flModifier ); iChance = (int)floor( iChance / flModifier );
} }
} }

View File

@ -14,6 +14,7 @@
#include "ai_speechfilter.h" #include "ai_speechfilter.h"
#ifndef _WIN32 #ifndef _WIN32
#undef min #undef min
#undef max
#endif #endif
#include "stdstring.h" #include "stdstring.h"
#ifndef _WIN32 #ifndef _WIN32

View File

@ -239,7 +239,7 @@ bool CAI_SchedulesManager::LoadSchedulesFromBuffer( const char *prefix, char *pS
int taskNum = 0; int taskNum = 0;
pfile = engine->ParseFile(pfile, token, sizeof( token ) ); pfile = engine->ParseFile(pfile, token, sizeof( token ) );
while ((token[0]!=NULL) && (stricmp("Interrupts",token))) while ((token[0] != '\0') && (stricmp("Interrupts", token)))
{ {
// Convert generic ID to sub-class specific enum // Convert generic ID to sub-class specific enum
int taskID = CAI_BaseNPC::GetTaskID(token); int taskID = CAI_BaseNPC::GetTaskID(token);
@ -477,7 +477,7 @@ bool CAI_SchedulesManager::LoadSchedulesFromBuffer( const char *prefix, char *pS
// Now read in the interrupts // Now read in the interrupts
// ========================== // ==========================
pfile = engine->ParseFile(pfile, token, sizeof( token ) ); pfile = engine->ParseFile(pfile, token, sizeof( token ) );
while ((token[0]!=NULL) && (stricmp("Schedule",token))) while ((token[0] != '\0') && (stricmp("Schedule", token)))
{ {
// Convert generic ID to sub-class specific enum // Convert generic ID to sub-class specific enum
int condID = CAI_BaseNPC::GetConditionID(token); int condID = CAI_BaseNPC::GetConditionID(token);

View File

@ -104,9 +104,9 @@ public:
m_flPlayerTargetFOV( 0 ), m_flPlayerTargetFOV( 0 ),
m_fPlayerTargetLOS( TRS_NONE ), m_fPlayerTargetLOS( TRS_NONE ),
m_fPlayerBlockingActor( TRS_NONE ), m_fPlayerBlockingActor( TRS_NONE ),
m_fActorInPVS( TRS_NONE ),
m_flMinTimeout( 0 ), m_flMinTimeout( 0 ),
m_flMaxTimeout( 0 ), m_flMaxTimeout( 0 ),
m_fActorInPVS( TRS_NONE ),
m_fActorInVehicle( TRS_NONE ), m_fActorInVehicle( TRS_NONE ),
m_fPlayerInVehicle( TRS_NONE ) m_fPlayerInVehicle( TRS_NONE )
{ {

View File

@ -41,8 +41,7 @@ CAI_SensedObjectsManager g_AI_SensedObjectsManager;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#pragma pack(push) #pragma pack(push, 1)
#pragma pack(1)
struct AISightIterVal_t struct AISightIterVal_t
{ {
@ -254,7 +253,7 @@ CBaseEntity *CAI_Senses::GetFirstSeenEntity( AISightIter_t *pIter, seentype_t iS
pIterVal->SeenArray = (char)iSeenType; pIterVal->SeenArray = (char)iSeenType;
int iFirstArray = ( iSeenType == SEEN_ALL ) ? 0 : iSeenType; int iFirstArray = ( iSeenType == SEEN_ALL ) ? 0 : iSeenType;
for ( int i = iFirstArray; i < ARRAYSIZE( m_SeenArrays ); i++ ) for ( int i = iFirstArray; i < (int)ARRAYSIZE( m_SeenArrays ); i++ )
{ {
if ( m_SeenArrays[i]->Count() != 0 ) if ( m_SeenArrays[i]->Count() != 0 )
{ {
@ -276,7 +275,7 @@ CBaseEntity *CAI_Senses::GetNextSeenEntity( AISightIter_t *pIter ) const
{ {
AISightIterVal_t *pIterVal = (AISightIterVal_t *)pIter; AISightIterVal_t *pIterVal = (AISightIterVal_t *)pIter;
for ( int i = pIterVal->array; i < ARRAYSIZE( m_SeenArrays ); i++ ) for ( int i = pIterVal->array; i < (int)ARRAYSIZE( m_SeenArrays ); i++ )
{ {
for ( int j = pIterVal->iNext; j < m_SeenArrays[i]->Count(); j++ ) for ( int j = pIterVal->iNext; j < m_SeenArrays[i]->Count(); j++ )
{ {
@ -654,7 +653,7 @@ void CAI_Senses::PerformSensing( void )
// Look // Look
// ----------------- // -----------------
if( !HasSensingFlags(SENSING_FLAGS_DONT_LOOK) ) if( !HasSensingFlags(SENSING_FLAGS_DONT_LOOK) )
Look( m_LookDist ); Look( static_cast<int>(m_LookDist) );
// ------------------ // ------------------
// Listen // Listen

View File

@ -212,12 +212,12 @@ static int g_nExpressers;
#endif #endif
CAI_Expresser::CAI_Expresser( CBaseFlex *pOuter ) CAI_Expresser::CAI_Expresser( CBaseFlex *pOuter )
: m_pOuter( pOuter ), : m_pSink( NULL ),
m_pSink( NULL ),
m_flStopTalkTime( 0 ), m_flStopTalkTime( 0 ),
m_flBlockedTalkTime( 0 ),
m_flStopTalkTimeWithoutDelay( 0 ), m_flStopTalkTimeWithoutDelay( 0 ),
m_voicePitch( 100 ) m_flBlockedTalkTime( 0 ),
m_voicePitch( 100 ),
m_pOuter( pOuter )
{ {
#ifdef DEBUG #ifdef DEBUG
g_nExpressers++; g_nExpressers++;
@ -467,7 +467,7 @@ bool CAI_Expresser::SpeakDispatchResponse( AIConcept_t concept, AI_Response *res
if ( spoke ) if ( spoke )
{ {
m_flLastTimeAcceptedSpeak = gpGlobals->curtime; m_flLastTimeAcceptedSpeak = gpGlobals->curtime;
if ( DebuggingSpeech() && g_pDeveloper->GetInt() > 0 && response && result->GetType() != RESPONSE_PRINT ) if ( DebuggingSpeech() && g_pDeveloper->GetInt() > 0 && response[0] != '\0' && result->GetType() != RESPONSE_PRINT )
{ {
Vector vPrintPos; Vector vPrintPos;
GetOuter()->CollisionProp()->NormalizedToWorldSpace( Vector(0.5,0.5,1.0f), &vPrintPos ); GetOuter()->CollisionProp()->NormalizedToWorldSpace( Vector(0.5,0.5,1.0f), &vPrintPos );
@ -900,7 +900,7 @@ void CAI_ExpresserHost_NPC_DoModifyOrAppendCriteria( CAI_BaseNPC *pSpeaker, AI_C
} }
static const char *pStateNames[] = { "None", "Idle", "Alert", "Combat", "Scripted", "PlayDead", "Dead" }; static const char *pStateNames[] = { "None", "Idle", "Alert", "Combat", "Scripted", "PlayDead", "Dead" };
if ( (int)pSpeaker->m_NPCState < ARRAYSIZE(pStateNames) ) if ( (int)pSpeaker->m_NPCState < (int)ARRAYSIZE(pStateNames) )
{ {
set.AppendCriteria( "npcstate", UTIL_VarArgs( "[NPCState::%s]", pStateNames[pSpeaker->m_NPCState] ) ); set.AppendCriteria( "npcstate", UTIL_VarArgs( "[NPCState::%s]", pStateNames[pSpeaker->m_NPCState] ) );
} }

View File

@ -288,15 +288,15 @@ public:
virtual void PostSpeakDispatchResponse( AIConcept_t concept, AI_Response *response ) { return; } virtual void PostSpeakDispatchResponse( AIConcept_t concept, AI_Response *response ) { return; }
float GetResponseDuration( AI_Response *response ); float GetResponseDuration( AI_Response *response );
float GetTimeSpeechComplete() const { return GetExpresser()->GetTimeSpeechComplete(); } float GetTimeSpeechComplete() const { return this->GetExpresser()->GetTimeSpeechComplete(); }
bool IsSpeaking() { return GetExpresser()->IsSpeaking(); } bool IsSpeaking() { return this->GetExpresser()->IsSpeaking(); }
bool CanSpeak() { return GetExpresser()->CanSpeak(); } bool CanSpeak() { return this->GetExpresser()->CanSpeak(); }
bool CanSpeakAfterMyself() { return GetExpresser()->CanSpeakAfterMyself(); } bool CanSpeakAfterMyself() { return this->GetExpresser()->CanSpeakAfterMyself(); }
void SetSpokeConcept( AIConcept_t concept, AI_Response *response, bool bCallback = true ) { GetExpresser()->SetSpokeConcept( concept, response, bCallback ); } void SetSpokeConcept( AIConcept_t concept, AI_Response *response, bool bCallback = true ) { this->GetExpresser()->SetSpokeConcept( concept, response, bCallback ); }
float GetTimeSpokeConcept( AIConcept_t concept ) { return GetExpresser()->GetTimeSpokeConcept( concept ); } float GetTimeSpokeConcept( AIConcept_t concept ) { return this->GetExpresser()->GetTimeSpokeConcept( concept ); }
bool SpokeConcept( AIConcept_t concept ) { return GetExpresser()->SpokeConcept( concept ); } bool SpokeConcept( AIConcept_t concept ) { return this->GetExpresser()->SpokeConcept( concept ); }
protected: protected:
int PlaySentence( const char *pszSentence, float delay, float volume = VOL_NORM, soundlevel_t soundlevel = SNDLVL_TALKING, CBaseEntity *pListener = NULL ); int PlaySentence( const char *pszSentence, float delay, float volume = VOL_NORM, soundlevel_t soundlevel = SNDLVL_TALKING, CBaseEntity *pListener = NULL );
@ -312,7 +312,7 @@ protected:
template <class BASE_NPC> template <class BASE_NPC>
inline void CAI_ExpresserHost<BASE_NPC>::NoteSpeaking( float duration, float delay ) inline void CAI_ExpresserHost<BASE_NPC>::NoteSpeaking( float duration, float delay )
{ {
GetExpresser()->NoteSpeaking( duration, delay ); this->GetExpresser()->NoteSpeaking( duration, delay );
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -320,8 +320,8 @@ inline void CAI_ExpresserHost<BASE_NPC>::NoteSpeaking( float duration, float del
template <class BASE_NPC> template <class BASE_NPC>
inline bool CAI_ExpresserHost<BASE_NPC>::Speak( AIConcept_t concept, const char *modifiers /*= NULL*/, char *pszOutResponseChosen /*=NULL*/, size_t bufsize /* = 0 */, IRecipientFilter *filter /* = NULL */ ) inline bool CAI_ExpresserHost<BASE_NPC>::Speak( AIConcept_t concept, const char *modifiers /*= NULL*/, char *pszOutResponseChosen /*=NULL*/, size_t bufsize /* = 0 */, IRecipientFilter *filter /* = NULL */ )
{ {
AssertOnce( GetExpresser()->GetOuter() == this ); AssertOnce( this->GetExpresser()->GetOuter() == this );
return GetExpresser()->Speak( concept, modifiers, pszOutResponseChosen, bufsize, filter ); return this->GetExpresser()->Speak( concept, modifiers, pszOutResponseChosen, bufsize, filter );
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -329,7 +329,7 @@ inline bool CAI_ExpresserHost<BASE_NPC>::Speak( AIConcept_t concept, const char
template <class BASE_NPC> template <class BASE_NPC>
inline int CAI_ExpresserHost<BASE_NPC>::PlaySentence( const char *pszSentence, float delay, float volume, soundlevel_t soundlevel, CBaseEntity *pListener ) inline int CAI_ExpresserHost<BASE_NPC>::PlaySentence( const char *pszSentence, float delay, float volume, soundlevel_t soundlevel, CBaseEntity *pListener )
{ {
return GetExpresser()->SpeakRawSentence( pszSentence, delay, volume, soundlevel, pListener ); return this->GetExpresser()->SpeakRawSentence( pszSentence, delay, volume, soundlevel, pListener );
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -341,9 +341,9 @@ inline void CAI_ExpresserHost<BASE_NPC>::ModifyOrAppendCriteria( AI_CriteriaSet&
{ {
BaseClass::ModifyOrAppendCriteria( criteriaSet ); BaseClass::ModifyOrAppendCriteria( criteriaSet );
if ( MyNPCPointer() ) if ( this->MyNPCPointer() )
{ {
CAI_ExpresserHost_NPC_DoModifyOrAppendCriteria( MyNPCPointer(), criteriaSet ); CAI_ExpresserHost_NPC_DoModifyOrAppendCriteria( this->MyNPCPointer(), criteriaSet );
} }
} }
@ -362,7 +362,7 @@ inline IResponseSystem *CAI_ExpresserHost<BASE_NPC>::GetResponseSystem()
template <class BASE_NPC> template <class BASE_NPC>
inline AI_Response *CAI_ExpresserHost<BASE_NPC>::SpeakFindResponse( AIConcept_t concept, const char *modifiers /*= NULL*/ ) inline AI_Response *CAI_ExpresserHost<BASE_NPC>::SpeakFindResponse( AIConcept_t concept, const char *modifiers /*= NULL*/ )
{ {
return GetExpresser()->SpeakFindResponse( concept, modifiers ); return this->GetExpresser()->SpeakFindResponse( concept, modifiers );
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -370,7 +370,7 @@ inline AI_Response *CAI_ExpresserHost<BASE_NPC>::SpeakFindResponse( AIConcept_t
template <class BASE_NPC> template <class BASE_NPC>
inline bool CAI_ExpresserHost<BASE_NPC>::SpeakDispatchResponse( AIConcept_t concept, AI_Response *response ) inline bool CAI_ExpresserHost<BASE_NPC>::SpeakDispatchResponse( AIConcept_t concept, AI_Response *response )
{ {
if ( GetExpresser()->SpeakDispatchResponse( concept, response ) ) if ( this->GetExpresser()->SpeakDispatchResponse( concept, response ) )
{ {
PostSpeakDispatchResponse( concept, response ); PostSpeakDispatchResponse( concept, response );
return true; return true;
@ -384,7 +384,7 @@ inline bool CAI_ExpresserHost<BASE_NPC>::SpeakDispatchResponse( AIConcept_t conc
template <class BASE_NPC> template <class BASE_NPC>
inline float CAI_ExpresserHost<BASE_NPC>::GetResponseDuration( AI_Response *response ) inline float CAI_ExpresserHost<BASE_NPC>::GetResponseDuration( AI_Response *response )
{ {
return GetExpresser()->GetResponseDuration( response ); return this->GetExpresser()->GetResponseDuration( response );
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@ -263,7 +263,7 @@ void CAI_Squad::AddToSquad(CAI_BaseNPC *pNPC)
if (m_SquadMembers.Count() == MAX_SQUAD_MEMBERS) if (m_SquadMembers.Count() == MAX_SQUAD_MEMBERS)
{ {
DevMsg("Error!! Squad %s is too big!!! Replacing last member\n",this->m_Name); DevMsg("Error!! Squad %s is too big!!! Replacing last member\n", STRING(this->m_Name));
m_SquadMembers.Remove(m_SquadMembers.Count()-1); m_SquadMembers.Remove(m_SquadMembers.Count()-1);
} }
m_SquadMembers.AddToTail(pNPC); m_SquadMembers.AddToTail(pNPC);

View File

@ -748,7 +748,7 @@ bool CAI_TacticalServices::FindLateralLos( const Vector &vecThreat, Vector *pRes
int iDelta = COVER_DELTA; int iDelta = COVER_DELTA;
// If we're limited in how far we're allowed to move laterally, don't bother checking past it // If we're limited in how far we're allowed to move laterally, don't bother checking past it
int iMaxLateralDelta = GetOuter()->GetMaxTacticalLateralMovement(); int iMaxLateralDelta = (int)GetOuter()->GetMaxTacticalLateralMovement();
if ( iMaxLateralDelta != MAXTACLAT_IGNORE && iMaxLateralDelta < iDelta ) if ( iMaxLateralDelta != MAXTACLAT_IGNORE && iMaxLateralDelta < iDelta )
{ {
iChecks = 1; iChecks = 1;

View File

@ -805,7 +805,7 @@ CPathTrack *CAI_TrackPather::FindClosestPointOnPath( CPathTrack *pPath,
float flPathDist, flPathDist2D; float flPathDist, flPathDist2D;
// NOTE: Gotta do it this crazy way because paths can be one-way. // NOTE: Gotta do it this crazy way because paths can be one-way.
Vector vecNearestPoint; Vector vecNearestPoint = Vector(0.0f, 0.0f, 0.0f);
Vector vecNearestPathSegment; Vector vecNearestPathSegment;
for ( int i = 0; i < 2; ++i ) for ( int i = 0; i < 2; ++i )
{ {

View File

@ -530,7 +530,7 @@ void CBaseAnimating::SetLightingOriginRelative( string_t strLightingOriginRelati
{ {
if( !pLightingOrigin ) if( !pLightingOrigin )
{ {
DevWarning( "%s: Cannot find Lighting Origin named: %s\n", GetEntityName().ToCStr(), strLightingOriginRelative ); DevWarning( "%s: Cannot find Lighting Origin named: %s\n", GetEntityName().ToCStr(), STRING(strLightingOriginRelative) );
} }
else else
{ {
@ -2527,7 +2527,7 @@ void CBaseAnimating::LockStudioHdr()
if ( pStudioHdrContainer && pStudioHdrContainer->GetVirtualModel() ) if ( pStudioHdrContainer && pStudioHdrContainer->GetVirtualModel() )
{ {
MDLHandle_t hVirtualModel = (MDLHandle_t)pStudioHdrContainer->GetRenderHdr()->virtualModel; MDLHandle_t hVirtualModel = (MDLHandle_t)reinterpret_cast<intptr_t>(pStudioHdrContainer->GetRenderHdr()->virtualModel);
mdlcache->LockStudioHdr( hVirtualModel ); mdlcache->LockStudioHdr( hVirtualModel );
} }
m_pStudioHdr = pStudioHdrContainer; // must be last to ensure virtual model correctly set up m_pStudioHdr = pStudioHdrContainer; // must be last to ensure virtual model correctly set up
@ -2545,7 +2545,7 @@ void CBaseAnimating::UnlockStudioHdr()
mdlcache->UnlockStudioHdr( modelinfo->GetCacheHandle( mdl ) ); mdlcache->UnlockStudioHdr( modelinfo->GetCacheHandle( mdl ) );
if ( m_pStudioHdr->GetVirtualModel() ) if ( m_pStudioHdr->GetVirtualModel() )
{ {
MDLHandle_t hVirtualModel = (MDLHandle_t)m_pStudioHdr->GetRenderHdr()->virtualModel; MDLHandle_t hVirtualModel = (MDLHandle_t)reinterpret_cast<intptr_t>(m_pStudioHdr->GetRenderHdr()->virtualModel);
mdlcache->UnlockStudioHdr( hVirtualModel ); mdlcache->UnlockStudioHdr( hVirtualModel );
} }
} }

View File

@ -20,7 +20,7 @@
#include "ndebugoverlay.h" #include "ndebugoverlay.h"
#include "te_effect_dispatch.h" #include "te_effect_dispatch.h"
#include "rumble_shared.h" #include "rumble_shared.h"
#include "gamestats.h" #include "GameStats.h"
// memdbgon must be the last include file in a .cpp file!!! // memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h" #include "tier0/memdbgon.h"

View File

@ -1522,8 +1522,6 @@ Killed
*/ */
void CBaseCombatCharacter::Event_Killed( const CTakeDamageInfo &info ) void CBaseCombatCharacter::Event_Killed( const CTakeDamageInfo &info )
{ {
extern ConVar npc_vphysics;
// Advance life state to dying // Advance life state to dying
m_lifeState = LIFE_DYING; m_lifeState = LIFE_DYING;
@ -3076,7 +3074,7 @@ void RadiusDamage( const CTakeDamageInfo &info, const Vector &vecSrc, float flRa
// be less than 128 units. // be less than 128 units.
float soundRadius = max( 128.0f, flRadius * 1.5 ); float soundRadius = max( 128.0f, flRadius * 1.5 );
CSoundEnt::InsertSound( SOUND_COMBAT | SOUND_CONTEXT_EXPLOSION, vecSrc, soundRadius, 0.25, info.GetInflictor() ); CSoundEnt::InsertSound( SOUND_COMBAT | SOUND_CONTEXT_EXPLOSION, vecSrc, (int)soundRadius, 0.25, info.GetInflictor() );
} }
} }

View File

@ -228,7 +228,7 @@ class CWeaponLOSFilter : public CTraceFilterSkipTwoEntities
{ {
DECLARE_CLASS( CWeaponLOSFilter, CTraceFilterSkipTwoEntities ); DECLARE_CLASS( CWeaponLOSFilter, CTraceFilterSkipTwoEntities );
public: public:
CWeaponLOSFilter::CWeaponLOSFilter( IHandleEntity *pHandleEntity, IHandleEntity *pHandleEntity2, int collisionGroup ) : CWeaponLOSFilter( IHandleEntity *pHandleEntity, IHandleEntity *pHandleEntity2, int collisionGroup ) :
CTraceFilterSkipTwoEntities( pHandleEntity, pHandleEntity2, collisionGroup ), m_pVehicle( NULL ) CTraceFilterSkipTwoEntities( pHandleEntity, pHandleEntity2, collisionGroup ), m_pVehicle( NULL )
{ {
// If the tracing entity is in a vehicle, then ignore it // If the tracing entity is in a vehicle, then ignore it

View File

@ -563,8 +563,8 @@ void CBaseEntity::AddTimedOverlay( const char *msg, int endTime )
int len = strlen(msg); int len = strlen(msg);
pNewTO->msg = new char[len + 1]; pNewTO->msg = new char[len + 1];
Q_strncpy(pNewTO->msg,msg, len+1); Q_strncpy(pNewTO->msg,msg, len+1);
pNewTO->msgEndTime = gpGlobals->curtime + endTime; pNewTO->msgEndTime = (int)gpGlobals->curtime + endTime;
pNewTO->msgStartTime = gpGlobals->curtime; pNewTO->msgStartTime = (int)gpGlobals->curtime;
pNewTO->pNextTimedOverlay = m_pTimedOverlay; pNewTO->pNextTimedOverlay = m_pTimedOverlay;
m_pTimedOverlay = pNewTO; m_pTimedOverlay = pNewTO;
} }
@ -705,7 +705,7 @@ void CBaseEntity::DrawTimedOverlays(void)
// If messages aren't paused fade out // If messages aren't paused fade out
if (!CBaseEntity::Debug_IsPaused()) if (!CBaseEntity::Debug_IsPaused())
{ {
nAlpha = 255*((gpGlobals->curtime - pTO->msgStartTime)/(pTO->msgEndTime - pTO->msgStartTime)); nAlpha = (int)(255*((gpGlobals->curtime - pTO->msgStartTime)/(pTO->msgEndTime - pTO->msgStartTime)));
} }
int r = 185; int r = 185;
int g = 145; int g = 145;
@ -864,7 +864,7 @@ int CBaseEntity::DrawDebugTextOverlays(void)
if( m_iGlobalname != NULL_STRING ) if( m_iGlobalname != NULL_STRING )
{ {
Q_snprintf( tempstr, sizeof(tempstr), "GLOBALNAME: %s", m_iGlobalname ); Q_snprintf( tempstr, sizeof(tempstr), "GLOBALNAME: %s", STRING(m_iGlobalname) );
EntityText(offset,tempstr, 0); EntityText(offset,tempstr, 0);
offset++; offset++;
} }
@ -3577,7 +3577,7 @@ void CBaseEntity::DrawInputOverlay(const char *szInputName, CBaseEntity *pCaller
{ {
Q_snprintf( bigstring,sizeof(bigstring), "%3.1f (%s) <-- (%s)\n", gpGlobals->curtime, szInputName, pCaller ? pCaller->GetDebugName() : NULL); Q_snprintf( bigstring,sizeof(bigstring), "%3.1f (%s) <-- (%s)\n", gpGlobals->curtime, szInputName, pCaller ? pCaller->GetDebugName() : NULL);
} }
AddTimedOverlay(bigstring, 10.0); AddTimedOverlay(bigstring, 10);
if ( Value.FieldType() == FIELD_INTEGER ) if ( Value.FieldType() == FIELD_INTEGER )
{ {
@ -3608,7 +3608,7 @@ void CBaseEntity::DrawOutputOverlay(CEventAction *ev)
{ {
Q_snprintf( bigstring,sizeof(bigstring), "%3.1f (%s) --> (%s)\n", gpGlobals->curtime, STRING(ev->m_iTargetInput), STRING(ev->m_iTarget)); Q_snprintf( bigstring,sizeof(bigstring), "%3.1f (%s) --> (%s)\n", gpGlobals->curtime, STRING(ev->m_iTargetInput), STRING(ev->m_iTarget));
} }
AddTimedOverlay(bigstring, 10.0); AddTimedOverlay(bigstring, 10);
// Now print to the console // Now print to the console
if ( ev->m_flDelay ) if ( ev->m_flDelay )
@ -4649,7 +4649,7 @@ void CBaseEntity::PrecacheModelComponents( int nModelIndex )
char token[256]; char token[256];
const char *pOptions = pEvent->pszOptions(); const char *pOptions = pEvent->pszOptions();
nexttoken( token, pOptions, ' ' ); nexttoken( token, pOptions, ' ' );
if ( token ) if ( token[0] != '\0' )
{ {
PrecacheParticleSystem( token ); PrecacheParticleSystem( token );
} }
@ -5106,6 +5106,8 @@ void CC_Ent_Dump( const CCommand& args )
} }
} }
break; break;
default:
break;
} }
// don't print out the duplicate keys // don't print out the duplicate keys
@ -6924,8 +6926,8 @@ void CBaseEntity::SUB_PerformFadeOut( void )
dt = 0.1f; dt = 0.1f;
} }
m_nRenderMode = kRenderTransTexture; m_nRenderMode = kRenderTransTexture;
int speed = max(1,256*dt); // fade out over 1 second int speed = (int)max(1,256*dt); // fade out over 1 second
SetRenderColorA( UTIL_Approach( 0, m_clrRender->a, speed ) ); SetRenderColorA( (byte)UTIL_Approach( 0, m_clrRender->a, speed ) );
} }
bool CBaseEntity::SUB_AllowedToFade( void ) bool CBaseEntity::SUB_AllowedToFade( void )

View File

@ -909,7 +909,7 @@ public:
bool IsWorld() { return entindex() == 0; } bool IsWorld() { return entindex() == 0; }
virtual char const *DamageDecal( int bitsDamageType, int gameMaterial ); virtual char const *DamageDecal( int bitsDamageType, int gameMaterial );
virtual void DecalTrace( trace_t *pTrace, char const *decalName ); virtual void DecalTrace( trace_t *pTrace, char const *decalName );
virtual void ImpactTrace( trace_t *pTrace, int iDamageType, char *pCustomImpactName = NULL ); virtual void ImpactTrace( trace_t *pTrace, int iDamageType, const char *pCustomImpactName = NULL );
void AddPoints( int score, bool bAllowNegativeScore ); void AddPoints( int score, bool bAllowNegativeScore );
void AddPointsToTeam( int score, bool bAllowNegativeScore ); void AddPointsToTeam( int score, bool bAllowNegativeScore );
@ -1061,23 +1061,23 @@ public:
#ifdef _DEBUG #ifdef _DEBUG
void FunctionCheck( void *pFunction, const char *name ); void FunctionCheck( void *pFunction, const char *name );
ENTITYFUNCPTR TouchSet( ENTITYFUNCPTR func, char *name ) ENTITYFUNCPTR TouchSet( ENTITYFUNCPTR func, const char *name )
{ {
COMPILE_TIME_ASSERT( sizeof(func) == 4 ); COMPILE_TIME_ASSERT( sizeof(func) == MFP_SIZE );
m_pfnTouch = func; m_pfnTouch = func;
FunctionCheck( *(reinterpret_cast<void **>(&m_pfnTouch)), name ); FunctionCheck( *(reinterpret_cast<void **>(&m_pfnTouch)), name );
return func; return func;
} }
USEPTR UseSet( USEPTR func, char *name ) USEPTR UseSet( USEPTR func, const char *name )
{ {
COMPILE_TIME_ASSERT( sizeof(func) == 4 ); COMPILE_TIME_ASSERT( sizeof(func) == MFP_SIZE );
m_pfnUse = func; m_pfnUse = func;
FunctionCheck( *(reinterpret_cast<void **>(&m_pfnUse)), name ); FunctionCheck( *(reinterpret_cast<void **>(&m_pfnUse)), name );
return func; return func;
} }
ENTITYFUNCPTR BlockedSet( ENTITYFUNCPTR func, char *name ) ENTITYFUNCPTR BlockedSet( ENTITYFUNCPTR func, const char *name )
{ {
COMPILE_TIME_ASSERT( sizeof(func) == 4 ); COMPILE_TIME_ASSERT( sizeof(func) == MFP_SIZE );
m_pfnBlocked = func; m_pfnBlocked = func;
FunctionCheck( *(reinterpret_cast<void **>(&m_pfnBlocked)), name ); FunctionCheck( *(reinterpret_cast<void **>(&m_pfnBlocked)), name );
return func; return func;

View File

@ -62,9 +62,9 @@ IMPLEMENT_SERVERCLASS_ST(CBaseFlex, DT_BaseFlex)
SendPropInt (SENDINFO(m_blinktoggle), 1, SPROP_UNSIGNED ), SendPropInt (SENDINFO(m_blinktoggle), 1, SPROP_UNSIGNED ),
SendPropVector (SENDINFO(m_viewtarget), -1, SPROP_COORD), SendPropVector (SENDINFO(m_viewtarget), -1, SPROP_COORD),
#ifdef HL2_DLL #ifdef HL2_DLL
SendPropFloat ( SENDINFO_VECTORELEM(m_vecViewOffset, 0), 0, SPROP_NOSCALE ), SendPropFloat ( SENDINFO_VECTORELEM2(m_vecViewOffset, 0, x), 0, SPROP_NOSCALE ),
SendPropFloat ( SENDINFO_VECTORELEM(m_vecViewOffset, 1), 0, SPROP_NOSCALE ), SendPropFloat ( SENDINFO_VECTORELEM2(m_vecViewOffset, 1, y), 0, SPROP_NOSCALE ),
SendPropFloat ( SENDINFO_VECTORELEM(m_vecViewOffset, 2), 0, SPROP_NOSCALE ), SendPropFloat ( SENDINFO_VECTORELEM2(m_vecViewOffset, 2, z), 0, SPROP_NOSCALE ),
SendPropVector ( SENDINFO(m_vecLean), -1, SPROP_COORD ), SendPropVector ( SENDINFO(m_vecLean), -1, SPROP_COORD ),
SendPropVector ( SENDINFO(m_vecShift), -1, SPROP_COORD ), SendPropVector ( SENDINFO(m_vecShift), -1, SPROP_COORD ),
@ -383,6 +383,8 @@ bool CBaseFlex::ClearSceneEvent( CSceneEventInfo *info, bool fastKill, bool canc
} }
} }
return true; return true;
default:
break;
} }
return false; return false;
} }
@ -669,7 +671,7 @@ bool CBaseFlex::HandleStartGestureSceneEvent( CSceneEventInfo *info, CChoreoScen
if ( looping ) if ( looping )
{ {
DevMsg( 1, "vcd error, gesture %s of model %s is marked as STUDIO_LOOPING!\n", DevMsg( 1, "vcd error, gesture %s of model %s is marked as STUDIO_LOOPING!\n",
event->GetParameters(), GetModelName() ); event->GetParameters(), STRING(GetModelName()) );
} }
SetLayerLooping( info->m_iLayer, false ); // force to not loop SetLayerLooping( info->m_iLayer, false ); // force to not loop
@ -765,6 +767,9 @@ bool CBaseFlex::StartSceneEvent( CSceneEventInfo *info, CChoreoScene *scene, CCh
case CChoreoEvent::EXPRESSION: // These are handled client-side case CChoreoEvent::EXPRESSION: // These are handled client-side
return true; return true;
default:
break;
} }
return false; return false;

View File

@ -47,7 +47,7 @@ void CBaseGrenadeConcussion::FallThink(void)
Remove( ); Remove( );
return; return;
} }
CSoundEnt::InsertSound ( SOUND_DANGER, GetAbsOrigin() + GetAbsVelocity() * 0.5, GetAbsVelocity().Length( ), 0.2 ); CSoundEnt::InsertSound ( SOUND_DANGER, GetAbsOrigin() + GetAbsVelocity() * 0.5, (int)GetAbsVelocity().Length(), 0.2 );
SetNextThink( gpGlobals->curtime + random->RandomFloat(0.05, 0.1) ); SetNextThink( gpGlobals->curtime + random->RandomFloat(0.05, 0.1) );

View File

@ -804,7 +804,7 @@ void CFuncRotating::RampPitchVol( void )
float fpitch = FANPITCHMIN + (FANPITCHMAX - FANPITCHMIN) * fpct; float fpitch = FANPITCHMIN + (FANPITCHMAX - FANPITCHMIN) * fpct;
int pitch = clamp(fpitch, 0, 255); int pitch = (int)clamp(fpitch, 0, 255);
if (pitch == PITCH_NORM) if (pitch == PITCH_NORM)
{ {
pitch = PITCH_NORM - 1; pitch = PITCH_NORM - 1;

View File

@ -143,19 +143,19 @@ bool CBaseButton::KeyValue( const char *szKeyName, const char *szValue )
{ {
if (FStrEq(szKeyName, "locked_sound")) if (FStrEq(szKeyName, "locked_sound"))
{ {
m_bLockedSound = atof(szValue); m_bLockedSound = atoi(szValue);
} }
else if (FStrEq(szKeyName, "locked_sentence")) else if (FStrEq(szKeyName, "locked_sentence"))
{ {
m_bLockedSentence = atof(szValue); m_bLockedSentence = atoi(szValue);
} }
else if (FStrEq(szKeyName, "unlocked_sound")) else if (FStrEq(szKeyName, "unlocked_sound"))
{ {
m_bUnlockedSound = atof(szValue); m_bUnlockedSound = atoi(szValue);
} }
else if (FStrEq(szKeyName, "unlocked_sentence")) else if (FStrEq(szKeyName, "unlocked_sentence"))
{ {
m_bUnlockedSentence = atof(szValue); m_bUnlockedSentence = atoi(szValue);
} }
else else
{ {
@ -802,7 +802,7 @@ int CBaseButton::DrawDebugTextOverlays()
if (m_debugOverlays & OVERLAY_TEXT_BIT) if (m_debugOverlays & OVERLAY_TEXT_BIT)
{ {
static char *pszStates[] = static const char *pszStates[] =
{ {
"Pressed", "Pressed",
"Unpressed", "Unpressed",

View File

@ -1222,6 +1222,7 @@ void variant_t::SetOther( void *data )
case FIELD_EHANDLE: *((EHANDLE *)data) = eVal; break; case FIELD_EHANDLE: *((EHANDLE *)data) = eVal; break;
case FIELD_CLASSPTR: *((CBaseEntity **)data) = eVal; break; case FIELD_CLASSPTR: *((CBaseEntity **)data) = eVal; break;
default: break;
} }
} }
@ -1274,8 +1275,14 @@ bool variant_t::Convert( fieldtype_t newType )
SetBool( iVal != 0 ); SetBool( iVal != 0 );
return true; return true;
} }
default:
break;
} }
break; break;
default:
break;
} }
case FIELD_FLOAT: case FIELD_FLOAT:
@ -1293,6 +1300,9 @@ bool variant_t::Convert( fieldtype_t newType )
SetBool( flVal != 0 ); SetBool( flVal != 0 );
return true; return true;
} }
default:
break;
} }
break; break;
} }
@ -1380,6 +1390,9 @@ bool variant_t::Convert( fieldtype_t newType )
SetEntity( ent ); SetEntity( ent );
return true; return true;
} }
default:
break;
} }
break; break;
@ -1399,6 +1412,9 @@ bool variant_t::Convert( fieldtype_t newType )
} }
return true; return true;
} }
default:
break;
} }
break; break;
} }
@ -1479,6 +1495,9 @@ const char *variant_t::ToString( void ) const
Q_strncpy( szBuf, pszName, 512 ); Q_strncpy( szBuf, pszName, 512 );
return (szBuf); return (szBuf);
} }
default:
break;
} }
return("No conversion to string"); return("No conversion to string");

View File

@ -912,7 +912,7 @@ void CC_Player_TestDispatchEffect( const CCommand &args )
AngleVectors( vecAngles, &data.m_vNormal ); AngleVectors( vecAngles, &data.m_vNormal );
} }
data.m_nEntIndex = pPlayer->entindex(); data.m_nEntIndex = pPlayer->entindex();
data.m_fFlags = flags; data.m_fFlags = (int)flags;
data.m_flMagnitude = magnitude; data.m_flMagnitude = magnitude;
data.m_flScale = scale; data.m_flScale = scale;
DispatchEffect( (char *)args[1], data ); DispatchEffect( (char *)args[1], data );
@ -1306,6 +1306,7 @@ void CC_HurtMe_f(const CCommand &args)
static ConCommand hurtme("hurtme", CC_HurtMe_f, "Hurts the player.\n\tArguments: <health to lose>", FCVAR_CHEAT); static ConCommand hurtme("hurtme", CC_HurtMe_f, "Hurts the player.\n\tArguments: <health to lose>", FCVAR_CHEAT);
#ifdef _DEBUG
static bool IsInGroundList( CBaseEntity *ent, CBaseEntity *ground ) static bool IsInGroundList( CBaseEntity *ent, CBaseEntity *ground )
{ {
if ( !ground || !ent ) if ( !ground || !ent )
@ -1327,6 +1328,7 @@ static bool IsInGroundList( CBaseEntity *ent, CBaseEntity *ground )
return false; return false;
} }
#endif
static int DescribeGroundList( CBaseEntity *ent ) static int DescribeGroundList( CBaseEntity *ent )
{ {

View File

@ -128,7 +128,7 @@ void CTargetChangeGravity::InputChangeGrav( inputdata_t &inputdata )
// Save the gravity to restore it in InputResetGrav // Save the gravity to restore it in InputResetGrav
if ( m_iOldGrav ) if ( m_iOldGrav )
m_iOldGrav = pl->GetGravity(); m_iOldGrav = (int)pl->GetGravity();
pl->SetGravity(m_iGravity); pl->SetGravity(m_iGravity);
} }

View File

@ -220,11 +220,11 @@ bool CBaseDoor::KeyValue( const char *szKeyName, const char *szValue )
{ {
if (FStrEq(szKeyName, "locked_sentence")) if (FStrEq(szKeyName, "locked_sentence"))
{ {
m_bLockedSentence = atof(szValue); m_bLockedSentence = atoi(szValue);
} }
else if (FStrEq(szKeyName, "unlocked_sentence")) else if (FStrEq(szKeyName, "unlocked_sentence"))
{ {
m_bUnlockedSentence = atof(szValue); m_bUnlockedSentence = atoi(szValue);
} }
else else
return BaseClass::KeyValue( szKeyName, szValue ); return BaseClass::KeyValue( szKeyName, szValue );
@ -484,6 +484,8 @@ void CBaseDoor::Activate( void )
case TS_AT_BOTTOM: case TS_AT_BOTTOM:
UpdateAreaPortals( false ); UpdateAreaPortals( false );
break; break;
default:
break;
} }
#ifdef HL1_DLL #ifdef HL1_DLL

View File

@ -988,7 +988,7 @@ void CTestEffect::Think( void )
for (i = 0; i < m_iBeam; i++) for (i = 0; i < m_iBeam; i++)
{ {
t = (gpGlobals->curtime - m_flBeamTime[i]) / ( 3 + m_flStartTime - m_flBeamTime[i]); t = (gpGlobals->curtime - m_flBeamTime[i]) / ( 3 + m_flStartTime - m_flBeamTime[i]);
m_pBeam[i]->SetBrightness( 255 * t ); m_pBeam[i]->SetBrightness( (int)(255 * t) );
// m_pBeam[i]->SetScrollRate( 20 * t ); // m_pBeam[i]->SetScrollRate( 20 * t );
} }
SetNextThink( gpGlobals->curtime + 0.1f ); SetNextThink( gpGlobals->curtime + 0.1f );
@ -1169,11 +1169,11 @@ void CBlood::InputEmitBlood( inputdata_t &inputdata )
{ {
if ( HasSpawnFlags( SF_BLOOD_STREAM ) ) if ( HasSpawnFlags( SF_BLOOD_STREAM ) )
{ {
UTIL_BloodStream( BloodPosition(inputdata.pActivator), Direction(), Color(), BloodAmount() ); UTIL_BloodStream( BloodPosition(inputdata.pActivator), Direction(), Color(), (int)BloodAmount() );
} }
else else
{ {
UTIL_BloodDrips( BloodPosition(inputdata.pActivator), Direction(), Color(), BloodAmount() ); UTIL_BloodDrips( BloodPosition(inputdata.pActivator), Direction(), Color(), (int)BloodAmount() );
} }
if ( HasSpawnFlags( SF_BLOOD_DECAL ) ) if ( HasSpawnFlags( SF_BLOOD_DECAL ) )
@ -1210,7 +1210,7 @@ void CBlood::InputEmitBlood( inputdata_t &inputdata )
nFlags |= FX_BLOODSPRAY_GORE; nFlags |= FX_BLOODSPRAY_GORE;
} }
UTIL_BloodSpray(GetAbsOrigin(), Direction(), Color(), BloodAmount(), nFlags); UTIL_BloodSpray(GetAbsOrigin(), Direction(), Color(), (int)BloodAmount(), nFlags);
} }
} }
@ -1615,7 +1615,7 @@ void CEnvWind::Spawn( void )
SetSolid( SOLID_NONE ); SetSolid( SOLID_NONE );
AddEffects( EF_NODRAW ); AddEffects( EF_NODRAW );
m_EnvWindShared.Init( entindex(), 0, gpGlobals->frametime, GetLocalAngles().y, 0 ); m_EnvWindShared.Init( entindex(), 0, gpGlobals->frametime, (int)GetLocalAngles().y, 0 );
SetThink( &CEnvWind::WindThink ); SetThink( &CEnvWind::WindThink );
SetNextThink( gpGlobals->curtime ); SetNextThink( gpGlobals->curtime );

View File

@ -6,6 +6,7 @@
//=============================================================================// //=============================================================================//
#include "cbase.h" #include "cbase.h"
#include "entitylist.h" #include "entitylist.h"
#include "utlvector.h" #include "utlvector.h"
#include "igamesystem.h" #include "igamesystem.h"
@ -143,7 +144,7 @@ public:
void Clear() void Clear()
{ {
m_simThinkList.Purge(); m_simThinkList.Purge();
for ( int i = 0; i < ARRAYSIZE(m_entinfoIndex); i++ ) for ( size_t i = 0; i < ARRAYSIZE(m_entinfoIndex); i++ )
{ {
m_entinfoIndex[i] = 0xFFFF; m_entinfoIndex[i] = 0xFFFF;
} }

View File

@ -134,7 +134,7 @@ void CDebugHistory::DumpDebugHistory( int iCategory )
// Find the start of the oldest whole debug line. // Find the start of the oldest whole debug line.
const char *pszLine = m_DebugLineEnd[iCategory] + 1; const char *pszLine = m_DebugLineEnd[iCategory] + 1;
if ( (pszLine - m_DebugLines[iCategory]) >= sizeof(m_DebugLines[iCategory]) ) if ( (size_t)(pszLine - m_DebugLines[iCategory]) >= sizeof(m_DebugLines[iCategory]) )
{ {
pszLine = m_DebugLines[iCategory]; pszLine = m_DebugLines[iCategory];
} }
@ -147,7 +147,7 @@ void CDebugHistory::DumpDebugHistory( int iCategory )
pszLine++; pszLine++;
// Have we looped? // Have we looped?
if ( (pszLine - m_DebugLines[iCategory]) >= sizeof(m_DebugLines[iCategory]) ) if ( (size_t)(pszLine - m_DebugLines[iCategory]) >= sizeof(m_DebugLines[iCategory]) )
{ {
pszLine = m_DebugLines[iCategory]; pszLine = m_DebugLines[iCategory];
} }
@ -187,7 +187,7 @@ void CDebugHistory::DumpDebugHistory( int iCategory )
pszLine++; pszLine++;
// Have we looped? // Have we looped?
if ( (pszLine - m_DebugLines[iCategory]) >= sizeof(m_DebugLines[iCategory]) ) if ( (size_t)(pszLine - m_DebugLines[iCategory]) >= sizeof(m_DebugLines[iCategory]) )
{ {
pszLine = m_DebugLines[iCategory]; pszLine = m_DebugLines[iCategory];
} }

View File

@ -49,6 +49,7 @@ BEGIN_DATADESC( CEnvScreenOverlay )
// DEFINE_ARRAY( m_iszOverlayNames, FIELD_STRING, MAX_SCREEN_OVERLAYS ), // DEFINE_ARRAY( m_iszOverlayNames, FIELD_STRING, MAX_SCREEN_OVERLAYS ),
// DEFINE_ARRAY( m_flOverlayTimes, FIELD_FLOAT, MAX_SCREEN_OVERLAYS ), // DEFINE_ARRAY( m_flOverlayTimes, FIELD_FLOAT, MAX_SCREEN_OVERLAYS ),
/* This causes a cannot apply offsetof when operator[] is overloaded error in GCC 4.2
DEFINE_KEYFIELD( m_iszOverlayNames[0], FIELD_STRING, "OverlayName1" ), DEFINE_KEYFIELD( m_iszOverlayNames[0], FIELD_STRING, "OverlayName1" ),
DEFINE_KEYFIELD( m_iszOverlayNames[1], FIELD_STRING, "OverlayName2" ), DEFINE_KEYFIELD( m_iszOverlayNames[1], FIELD_STRING, "OverlayName2" ),
DEFINE_KEYFIELD( m_iszOverlayNames[2], FIELD_STRING, "OverlayName3" ), DEFINE_KEYFIELD( m_iszOverlayNames[2], FIELD_STRING, "OverlayName3" ),
@ -69,6 +70,28 @@ BEGIN_DATADESC( CEnvScreenOverlay )
DEFINE_KEYFIELD( m_flOverlayTimes[7], FIELD_FLOAT, "OverlayTime8" ), DEFINE_KEYFIELD( m_flOverlayTimes[7], FIELD_FLOAT, "OverlayTime8" ),
DEFINE_KEYFIELD( m_flOverlayTimes[8], FIELD_FLOAT, "OverlayTime9" ), DEFINE_KEYFIELD( m_flOverlayTimes[8], FIELD_FLOAT, "OverlayTime9" ),
DEFINE_KEYFIELD( m_flOverlayTimes[9], FIELD_FLOAT, "OverlayTime10" ), DEFINE_KEYFIELD( m_flOverlayTimes[9], FIELD_FLOAT, "OverlayTime10" ),
*/
DEFINE_KEYFIELD_NETARRAY( m_iszOverlayNames, 0, FIELD_STRING, "OverlayName1" ),
DEFINE_KEYFIELD_NETARRAY( m_iszOverlayNames, 1, FIELD_STRING, "OverlayName2" ),
DEFINE_KEYFIELD_NETARRAY( m_iszOverlayNames, 2, FIELD_STRING, "OverlayName3" ),
DEFINE_KEYFIELD_NETARRAY( m_iszOverlayNames, 3, FIELD_STRING, "OverlayName4" ),
DEFINE_KEYFIELD_NETARRAY( m_iszOverlayNames, 4, FIELD_STRING, "OverlayName5" ),
DEFINE_KEYFIELD_NETARRAY( m_iszOverlayNames, 5, FIELD_STRING, "OverlayName6" ),
DEFINE_KEYFIELD_NETARRAY( m_iszOverlayNames, 6, FIELD_STRING, "OverlayName7" ),
DEFINE_KEYFIELD_NETARRAY( m_iszOverlayNames, 7, FIELD_STRING, "OverlayName8" ),
DEFINE_KEYFIELD_NETARRAY( m_iszOverlayNames, 8, FIELD_STRING, "OverlayName9" ),
DEFINE_KEYFIELD_NETARRAY( m_iszOverlayNames, 9, FIELD_STRING, "OverlayName10" ),
DEFINE_KEYFIELD_NETARRAY( m_flOverlayTimes, 0, FIELD_FLOAT, "OverlayTime1" ),
DEFINE_KEYFIELD_NETARRAY( m_flOverlayTimes, 1, FIELD_FLOAT, "OverlayTime2" ),
DEFINE_KEYFIELD_NETARRAY( m_flOverlayTimes, 2, FIELD_FLOAT, "OverlayTime3" ),
DEFINE_KEYFIELD_NETARRAY( m_flOverlayTimes, 3, FIELD_FLOAT, "OverlayTime4" ),
DEFINE_KEYFIELD_NETARRAY( m_flOverlayTimes, 4, FIELD_FLOAT, "OverlayTime5" ),
DEFINE_KEYFIELD_NETARRAY( m_flOverlayTimes, 5, FIELD_FLOAT, "OverlayTime6" ),
DEFINE_KEYFIELD_NETARRAY( m_flOverlayTimes, 6, FIELD_FLOAT, "OverlayTime7" ),
DEFINE_KEYFIELD_NETARRAY( m_flOverlayTimes, 7, FIELD_FLOAT, "OverlayTime8" ),
DEFINE_KEYFIELD_NETARRAY( m_flOverlayTimes, 8, FIELD_FLOAT, "OverlayTime9" ),
DEFINE_KEYFIELD_NETARRAY( m_flOverlayTimes, 9, FIELD_FLOAT, "OverlayTime10" ),
// Class CEnvScreenOverlay: // Class CEnvScreenOverlay:
DEFINE_FIELD( m_iDesiredOverlay, FIELD_INTEGER ), DEFINE_FIELD( m_iDesiredOverlay, FIELD_INTEGER ),

View File

@ -85,7 +85,7 @@ void CEnvMicrophone::Spawn(void)
{ SF_MICROPHONE_SOUND_EXPLOSION, SOUND_CONTEXT_EXPLOSION }, { SF_MICROPHONE_SOUND_EXPLOSION, SOUND_CONTEXT_EXPLOSION },
}; };
for (int i = 0; i < sizeof(nFlags) / sizeof(nFlags[0]); i++) for (size_t i = 0; i < sizeof(nFlags) / sizeof(nFlags[0]); i++)
{ {
if (m_spawnflags & nFlags[i][0]) if (m_spawnflags & nFlags[i][0])
{ {

View File

@ -90,7 +90,7 @@ void CAI_BehaviorAlyxInjured::PopulateActivityMap( void )
m_ActivityMap.RemoveAll(); m_ActivityMap.RemoveAll();
// Add all translations // Add all translations
for ( int i = 0; i < ARRAYSIZE( map ); i++ ) for ( size_t i = 0; i < ARRAYSIZE( map ); i++ )
{ {
Assert( m_ActivityMap.Find( map[i].activity ) == m_ActivityMap.InvalidIndex() ); Assert( m_ActivityMap.Find( map[i].activity ) == m_ActivityMap.InvalidIndex() );
m_ActivityMap.Insert( map[i].activity, map[i].translation ); m_ActivityMap.Insert( map[i].activity, map[i].translation );

View File

@ -80,13 +80,13 @@ BEGIN_SIMPLE_DATADESC( FailPosition_t )
END_DATADESC(); END_DATADESC();
CAI_PassengerBehaviorCompanion::CAI_PassengerBehaviorCompanion( void ) : CAI_PassengerBehaviorCompanion::CAI_PassengerBehaviorCompanion( void ) :
m_flUnseenDuration( 0.0f ), m_flNextJostleTime( 0.0f ),
m_flNextOverturnWarning( 0.0f ), m_flNextOverturnWarning( 0.0f ),
m_flOverturnedDuration( 0.0f ), m_flOverturnedDuration( 0.0f ),
m_flUnseenDuration( 0.0f ),
m_nExitAttempts( 0 ), m_nExitAttempts( 0 ),
m_flNextEnterAttempt( 0.0f ),
m_flLastLateralLean( 0.0f ), m_flLastLateralLean( 0.0f ),
m_flNextJostleTime( 0.0f ) m_flNextEnterAttempt( 0.0f )
{ {
memset( &m_vehicleState, 0, sizeof( m_vehicleState ) ); memset( &m_vehicleState, 0, sizeof( m_vehicleState ) );
m_VehicleMonitor.ClearMark(); m_VehicleMonitor.ClearMark();
@ -818,8 +818,8 @@ bool CAI_PassengerBehaviorCompanion::CanEnterVehicleImmediately( int *pResultSeq
float flSeatDistSqr; float flSeatDistSqr;
int nNearestSequence = -1; int nNearestSequence = -1;
int nSequence; int nSequence;
Vector vecNearestPos; Vector vecNearestPos(0.0f, 0.0f, 0.0f);
QAngle vecNearestAngles; QAngle vecNearestAngles(0.0f, 0.0f, 0.0f);
// Test each animation (sorted by priority) for the best match // Test each animation (sorted by priority) for the best match
for ( int i = 0; i < pEntryAnims->Count(); i++ ) for ( int i = 0; i < pEntryAnims->Count(); i++ )

View File

@ -73,8 +73,8 @@ impactdamagetable_t gZombiePassengerImpactDamageTable =
// Constructor // Constructor
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
CAI_PassengerBehaviorZombie::CAI_PassengerBehaviorZombie( void ) : CAI_PassengerBehaviorZombie::CAI_PassengerBehaviorZombie( void ) :
m_flLastVerticalLean( 0.0f ),
m_flLastLateralLean( 0.0f ), m_flLastLateralLean( 0.0f ),
m_flLastVerticalLean( 0.0f ),
m_flNextLeapTime( 0.0f ) m_flNextLeapTime( 0.0f )
{ {
} }

View File

@ -8,7 +8,7 @@
#include "cbase.h" #include "cbase.h"
#include "ep1_gamestats.h" #include "ep1_gamestats.h"
#include "tier1/UtlBuffer.h" #include "tier1/utlbuffer.h"
static CEP1GameStats s_CEP1GS_ThisJustSitsInMemory; static CEP1GameStats s_CEP1GS_ThisJustSitsInMemory;
// A bit of a hack to redirect the gamestats API for ep2 (ep3, etc.) // A bit of a hack to redirect the gamestats API for ep2 (ep3, etc.)

View File

@ -10,7 +10,7 @@
#pragma once #pragma once
#endif #endif
#include "gamestats.h" #include "GameStats.h"
class CEP1GameStats : public CBaseGameStats class CEP1GameStats : public CBaseGameStats
{ {

View File

@ -7,11 +7,11 @@
#include "cbase.h" #include "cbase.h"
#endif #endif
#include "ep2_gamestats.h" #include "ep2_gamestats.h"
#include "tier1/UtlBuffer.h" #include "tier1/utlbuffer.h"
#include "vehicle_base.h" #include "vehicle_base.h"
#include "tier1/UtlString.h" #include "tier1/utlstring.h"
#include "filesystem.h" #include "filesystem.h"
#include "ICommandLine.h" #include "icommandline.h"
static CEP2GameStats s_CEP2GameStats_Singleton; static CEP2GameStats s_CEP2GameStats_Singleton;
CBaseGameStats *g_pEP2GameStats = &s_CEP2GameStats_Singleton; CBaseGameStats *g_pEP2GameStats = &s_CEP2GameStats_Singleton;

View File

@ -11,7 +11,7 @@
#endif #endif
#include "ep1_gamestats.h" #include "ep1_gamestats.h"
#include "tier1/UtlString.h" #include "tier1/utlstring.h"
// EP2 Game Stats // EP2 Game Stats
enum Ep2GameStatsVersions_t enum Ep2GameStatsVersions_t
@ -412,8 +412,8 @@ public:
static const unsigned short LumpId = EP2STATS_LUMP_SAVEGAMEINFO; static const unsigned short LumpId = EP2STATS_LUMP_SAVEGAMEINFO;
SaveGameInfo_t() : SaveGameInfo_t() :
m_nCurrentSaveFileTime( 0 ), m_pCurrentRecord( NULL ),
m_pCurrentRecord( NULL ) m_nCurrentSaveFileTime( 0 )
{ {
} }

View File

@ -38,7 +38,7 @@ class CGravityVortexController : public CBaseEntity
public: public:
CGravityVortexController( void ) : m_flEndTime( 0.0f ), m_flRadius( 256 ), m_flStrength( 256 ), m_flMass( 0.0f ) {} CGravityVortexController( void ) : m_flMass( 0.0f ), m_flEndTime( 0.0f ), m_flRadius( 256.0f ), m_flStrength( 256.0f ) {}
float GetConsumedMass( void ) const; float GetConsumedMass( void ) const;
static CGravityVortexController *Create( const Vector &origin, float radius, float strength, float duration ); static CGravityVortexController *Create( const Vector &origin, float radius, float strength, float duration );

View File

@ -11,7 +11,7 @@
#endif #endif
#include "basegrenade_shared.h" #include "basegrenade_shared.h"
#include "sprite.h" #include "Sprite.h"
extern ConVar hopwire_trap; extern ConVar hopwire_trap;

View File

@ -433,8 +433,10 @@ int __cdecl AdvisorStagingComparator(const EHANDLE *pe1, const EHANDLE *pe2)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#ifdef _MSC_VER
#pragma warning(push) #pragma warning(push)
#pragma warning(disable : 4706) #pragma warning(disable : 4706)
#endif
void CNPC_Advisor::Activate() void CNPC_Advisor::Activate()
{ {
@ -468,8 +470,10 @@ void CNPC_Advisor::Activate()
AssertMsg(m_hvStagingPositions.Count() > 0, "You did not specify any staging positions in the advisor's staging_ent_names !"); AssertMsg(m_hvStagingPositions.Count() > 0, "You did not specify any staging positions in the advisor's staging_ent_names !");
#endif #endif
} }
#pragma warning(pop)
#ifdef _MSC_VER
#pragma warning(pop)
#endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -1071,7 +1075,7 @@ void CNPC_Advisor::RunTask( const Task_t *pTask )
#endif #endif
// helper function for testing whether or not an avisor is allowed to grab an object // helper function for testing whether or not an avisor is allowed to grab an object
static bool AdvisorCanPickObject(CBasePlayer *pPlayer, CBaseEntity *pEnt) /*static bool AdvisorCanPickObject(CBasePlayer *pPlayer, CBaseEntity *pEnt)
{ {
Assert( pPlayer != NULL ); Assert( pPlayer != NULL );
@ -1094,7 +1098,7 @@ static bool AdvisorCanPickObject(CBasePlayer *pPlayer, CBaseEntity *pEnt)
} }
return true; return true;
} }*/
#if NPC_ADVISOR_HAS_BEHAVIOR #if NPC_ADVISOR_HAS_BEHAVIOR

View File

@ -466,7 +466,7 @@ void CNPC_Combine_Cannon::UpdateAncillaryBeams( float flConvergencePerc, const V
UTIL_TraceLine( vecOrigin, vecOrigin + ( vecFinal * LINE_LENGTH ), MASK_SHOT, this, COLLISION_GROUP_NONE, &tr ); UTIL_TraceLine( vecOrigin, vecOrigin + ( vecFinal * LINE_LENGTH ), MASK_SHOT, this, COLLISION_GROUP_NONE, &tr );
// Move the beam to that position // Move the beam to that position
m_pAncillaryBeams[i]->SetBrightness( 255.0f * flConvergencePerc ); m_pAncillaryBeams[i]->SetBrightness( static_cast<int>(255.0f * flConvergencePerc) );
m_pAncillaryBeams[i]->SetEndPos( tr.startpos ); m_pAncillaryBeams[i]->SetEndPos( tr.startpos );
m_pAncillaryBeams[i]->SetStartPos( tr.endpos ); m_pAncillaryBeams[i]->SetStartPos( tr.endpos );
} }
@ -523,7 +523,7 @@ void CNPC_Combine_Cannon::PaintTarget( const Vector &vecTarget, float flPaintTim
// Update our beam position // Update our beam position
m_pBeam->SetEndPos( tr.startpos ); m_pBeam->SetEndPos( tr.startpos );
m_pBeam->SetStartPos( tr.endpos ); m_pBeam->SetStartPos( tr.endpos );
m_pBeam->SetBrightness( 255.0f * flPaintPerc ); m_pBeam->SetBrightness( static_cast<int>(255.0f * flPaintPerc) );
m_pBeam->RelinkBeam(); m_pBeam->RelinkBeam();
// Find points around that center point and make our designators converge at that point over time // Find points around that center point and make our designators converge at that point over time
@ -834,13 +834,13 @@ bool CNPC_Combine_Cannon::FireBullet( const Vector &vecTarget, bool bDirectShot
FireBulletsInfo_t info; FireBulletsInfo_t info;
info.m_iShots = 1; info.m_iShots = 1;
info.m_iTracerFreq = 1.0f; info.m_iTracerFreq = 1;
info.m_vecDirShooting = vecDir; info.m_vecDirShooting = vecDir;
info.m_vecSrc = vecBulletOrigin; info.m_vecSrc = vecBulletOrigin;
info.m_flDistance = MAX_TRACE_LENGTH; info.m_flDistance = MAX_TRACE_LENGTH;
info.m_pAttacker = this; info.m_pAttacker = this;
info.m_iAmmoType = m_iAmmoType; info.m_iAmmoType = m_iAmmoType;
info.m_iPlayerDamage = 20.0f; info.m_iPlayerDamage = 20;
info.m_vecSpread = Vector( 0.015f, 0.015f, 0.015f ); // medium cone info.m_vecSpread = Vector( 0.015f, 0.015f, 0.015f ); // medium cone
FireBullets( info ); FireBullets( info );

View File

@ -305,8 +305,8 @@ bool HateThisStriderBuster( CBaseEntity *pTarget )
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
static const char *s_szHunterFlechetteBubbles = "HunterFlechetteBubbles"; static const char *s_szHunterFlechetteBubbles = "HunterFlechetteBubbles";
static const char *s_szHunterFlechetteSeekThink = "HunterFlechetteSeekThink"; static const char *s_szHunterFlechetteSeekThink = "HunterFlechetteSeekThink";
static const char *s_szHunterFlechetteDangerSoundThink = "HunterFlechetteDangerSoundThink"; //static const char *s_szHunterFlechetteDangerSoundThink = "HunterFlechetteDangerSoundThink";
static const char *s_szHunterFlechetteSpriteTrail = "sprites/bluelaser1.vmt"; //static const char *s_szHunterFlechetteSpriteTrail = "sprites/bluelaser1.vmt";
static int s_nHunterFlechetteImpact = -2; static int s_nHunterFlechetteImpact = -2;
static int s_nFlechetteFuseAttach = -1; static int s_nFlechetteFuseAttach = -1;
@ -427,9 +427,10 @@ void CC_Hunter_Shoot_Flechette( const CCommand& args )
DispatchSpawn( entity ); DispatchSpawn( entity );
// Shoot the flechette. // Shoot the flechette.
Vector forward; Vector forward, velocity;
pPlayer->EyeVectors( &forward ); pPlayer->EyeVectors( &forward );
entity->Shoot( forward * 2000.0f, false ); velocity = forward * 2000.0f;
entity->Shoot( velocity, false );
} }
CBaseEntity::SetAllowPrecache( allowPrecache ); CBaseEntity::SetAllowPrecache( allowPrecache );
@ -872,7 +873,7 @@ void CHunterFlechette::DangerSoundThink()
{ {
EmitSound( "NPC_Hunter.FlechettePreExplode" ); EmitSound( "NPC_Hunter.FlechettePreExplode" );
CSoundEnt::InsertSound( SOUND_DANGER|SOUND_CONTEXT_EXCLUDE_COMBINE, GetAbsOrigin(), 150.0f, 0.5, this ); CSoundEnt::InsertSound( SOUND_DANGER|SOUND_CONTEXT_EXCLUDE_COMBINE, GetAbsOrigin(), 150, 0.5, this );
SetThink( &CHunterFlechette::ExplodeThink ); SetThink( &CHunterFlechette::ExplodeThink );
SetNextThink( gpGlobals->curtime + HUNTER_FLECHETTE_WARN_TIME ); SetNextThink( gpGlobals->curtime + HUNTER_FLECHETTE_WARN_TIME );
} }
@ -1022,8 +1023,6 @@ inline void HunterTraceHull_SkipPhysics( const Vector &vecAbsStart, const Vector
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
class CAI_HunterEscortBehavior : public CAI_FollowBehavior class CAI_HunterEscortBehavior : public CAI_FollowBehavior
{ {
typedef CAI_FollowBehavior BaseClass;
DECLARE_CLASS( CAI_HunterEscortBehavior, CAI_FollowBehavior ); DECLARE_CLASS( CAI_HunterEscortBehavior, CAI_FollowBehavior );
public: public:
@ -3123,6 +3122,9 @@ int CNPC_Hunter::SelectSchedule()
{ {
return SelectCombatSchedule(); return SelectCombatSchedule();
} }
default:
break;
} }
} }
@ -4295,25 +4297,29 @@ void CNPC_Hunter::HandleAnimEvent( animevent_t *pEvent )
if ( pEvent->event == AE_HUNTER_MELEE_ATTACK_LEFT ) if ( pEvent->event == AE_HUNTER_MELEE_ATTACK_LEFT )
{ {
Vector right, forward; QAngle viewPunch(25.0f, 30.0f, -20.0f);
Vector right, forward, velocityPunch;
AngleVectors( GetLocalAngles(), &forward, &right, NULL ); AngleVectors( GetLocalAngles(), &forward, &right, NULL );
right = right * -100; right = right * -100;
forward = forward * 600; forward = forward * 600;
velocityPunch = right + forward;
MeleeAttack( HUNTER_MELEE_REACH, sk_hunter_dmg_one_slash.GetFloat(), QAngle( 25, 30, -20 ), right + forward, HUNTER_BLOOD_LEFT_FOOT ); MeleeAttack( HUNTER_MELEE_REACH, sk_hunter_dmg_one_slash.GetInt(), viewPunch, velocityPunch, HUNTER_BLOOD_LEFT_FOOT );
return; return;
} }
if ( pEvent->event == AE_HUNTER_MELEE_ATTACK_RIGHT ) if ( pEvent->event == AE_HUNTER_MELEE_ATTACK_RIGHT )
{ {
Vector right, forward; QAngle viewPunch(25.0f, -30.0f, 20.0f);
Vector right, forward, velocityPunch;
AngleVectors( GetLocalAngles(), &forward, &right, NULL ); AngleVectors( GetLocalAngles(), &forward, &right, NULL );
right = right * 100; right = right * 100;
forward = forward * 600; forward = forward * 600;
velocityPunch = right + forward;
MeleeAttack( HUNTER_MELEE_REACH, sk_hunter_dmg_one_slash.GetFloat(), QAngle( 25, -30, 20 ), right + forward, HUNTER_BLOOD_LEFT_FOOT ); MeleeAttack( HUNTER_MELEE_REACH, sk_hunter_dmg_one_slash.GetInt(), viewPunch, velocityPunch, HUNTER_BLOOD_LEFT_FOOT );
return; return;
} }
@ -4700,7 +4706,7 @@ int CNPC_Hunter::IRelationPriority( CBaseEntity *pTarget )
if ( IsStriderBuster( pTarget ) ) if ( IsStriderBuster( pTarget ) )
{ {
// If we're here, we already know that we hate striderbusters. // If we're here, we already know that we hate striderbusters.
return 1000.0f; return 1000;
} }
return BaseClass::IRelationPriority( pTarget ); return BaseClass::IRelationPriority( pTarget );
@ -6265,7 +6271,7 @@ bool CNPC_Hunter::ShootFlechette( CBaseEntity *pTargetEntity, bool bSingleShot )
{ {
// Make this person afraid and react to ME, not to the flechettes. // Make this person afraid and react to ME, not to the flechettes.
// Otherwise they could be scared into running towards the hunter. // Otherwise they could be scared into running towards the hunter.
CSoundEnt::InsertSound( SOUND_DANGER|SOUND_CONTEXT_REACT_TO_SOURCE|SOUND_CONTEXT_EXCLUDE_COMBINE, pTargetEntity->EyePosition(), 180.0f, 2.0f, this ); CSoundEnt::InsertSound( SOUND_DANGER|SOUND_CONTEXT_REACT_TO_SOURCE|SOUND_CONTEXT_EXCLUDE_COMBINE, pTargetEntity->EyePosition(), 180, 2.0f, this );
} }
return bClamped; return bClamped;
@ -6471,7 +6477,7 @@ const char *CNPC_Hunter::SelectRandomExpressionForState( NPC_STATE state )
if ( !hunter_random_expressions.GetBool() ) if ( !hunter_random_expressions.GetBool() )
return NULL; return NULL;
char *szExpressions[4] = const char *szExpressions[4] =
{ {
"scenes/npc/hunter/hunter_scan.vcd", "scenes/npc/hunter/hunter_scan.vcd",
"scenes/npc/hunter/hunter_eyeclose.vcd", "scenes/npc/hunter/hunter_eyeclose.vcd",

View File

@ -72,7 +72,7 @@ void CNPC_Magnusson::HandleAnimEvent( animevent_t *pEvent )
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
int CNPC_Magnusson::GetSoundInterests ( void ) int CNPC_Magnusson::GetSoundInterests ( void )
{ {
return NULL; return 0;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -81,7 +81,7 @@ int CNPC_Magnusson::GetSoundInterests ( void )
void CNPC_Magnusson::Spawn() void CNPC_Magnusson::Spawn()
{ {
// Allow custom model usage (mostly for monitors) // Allow custom model usage (mostly for monitors)
char *szModel = (char *)STRING( GetModelName() ); const char *szModel = (char *)STRING( GetModelName() );
if (!szModel || !*szModel) if (!szModel || !*szModel)
{ {
szModel = "models/magnusson.mdl"; szModel = "models/magnusson.mdl";

View File

@ -15,7 +15,7 @@
#include "vphysics/friction.h" #include "vphysics/friction.h"
#include "vphysicsupdateai.h" #include "vphysicsupdateai.h"
#include "physics_npc_solver.h" #include "physics_npc_solver.h"
#include "sprite.h" #include "Sprite.h"
#include "weapon_striderbuster.h" #include "weapon_striderbuster.h"
#include "npc_strider.h" #include "npc_strider.h"
#include "vguiscreen.h" #include "vguiscreen.h"
@ -1003,7 +1003,8 @@ void CPropJeepEpisodic::UpdateCargoEntry( void )
// Slerp our quaternions to find where we are this frame // Slerp our quaternions to find where we are this frame
Quaternion qtTarget; Quaternion qtTarget;
AngleQuaternion( pProp->PreferredCarryAngles() + QAngle( 0, 90, 0 ), qtTarget ); // FIXME: Find the real offset to make this sit properly QAngle ang = pProp->PreferredCarryAngles() + QAngle(0.0f, 90.0f, 0.0f);
AngleQuaternion( ang, qtTarget ); // FIXME: Find the real offset to make this sit properly
Quaternion qtCurrent; Quaternion qtCurrent;
AngleQuaternion( pProp->GetLocalAngles(), qtCurrent ); AngleQuaternion( pProp->GetLocalAngles(), qtCurrent );
@ -1039,11 +1040,11 @@ void CPropJeepEpisodic::CreateAvoidanceZone( void )
Vector vecPos; Vector vecPos;
CollisionProp()->NormalizedToWorldSpace( Vector( 0.5f, 0.33f, 0.25f ), &vecPos ); CollisionProp()->NormalizedToWorldSpace( Vector( 0.5f, 0.33f, 0.25f ), &vecPos );
CSoundEnt::InsertSound( SOUND_MOVE_AWAY, vecPos, (flHullRadius*0.4f), VEHICLE_AVOID_BROADCAST_RATE, this ); CSoundEnt::InsertSound( SOUND_MOVE_AWAY, vecPos, (int)(flHullRadius*0.4f), VEHICLE_AVOID_BROADCAST_RATE, this );
// NDebugOverlay::Sphere( vecPos, vec3_angle, flHullRadius*0.4f, 255, 0, 0, 0, true, VEHICLE_AVOID_BROADCAST_RATE ); // NDebugOverlay::Sphere( vecPos, vec3_angle, flHullRadius*0.4f, 255, 0, 0, 0, true, VEHICLE_AVOID_BROADCAST_RATE );
CollisionProp()->NormalizedToWorldSpace( Vector( 0.5f, 0.66f, 0.25f ), &vecPos ); CollisionProp()->NormalizedToWorldSpace( Vector( 0.5f, 0.66f, 0.25f ), &vecPos );
CSoundEnt::InsertSound( SOUND_MOVE_AWAY, vecPos, (flHullRadius*0.4f), VEHICLE_AVOID_BROADCAST_RATE, this ); CSoundEnt::InsertSound( SOUND_MOVE_AWAY, vecPos, (int)(flHullRadius*0.4f), VEHICLE_AVOID_BROADCAST_RATE, this );
// NDebugOverlay::Sphere( vecPos, vec3_angle, flHullRadius*0.4f, 255, 0, 0, 0, true, VEHICLE_AVOID_BROADCAST_RATE ); // NDebugOverlay::Sphere( vecPos, vec3_angle, flHullRadius*0.4f, 255, 0, 0, 0, true, VEHICLE_AVOID_BROADCAST_RATE );
// Don't broadcast again until these are done // Don't broadcast again until these are done
@ -1449,8 +1450,8 @@ void CPropJeepEpisodic::SpawnRadarPanel()
// If we're attached to an entity, spawn control panels on it instead of use // If we're attached to an entity, spawn control panels on it instead of use
CBaseAnimating *pEntityToSpawnOn = this; CBaseAnimating *pEntityToSpawnOn = this;
char *pOrgLL = "controlpanel0_ll"; const char *pOrgLL = "controlpanel0_ll";
char *pOrgUR = "controlpanel0_ur"; const char *pOrgUR = "controlpanel0_ur";
Assert( pEntityToSpawnOn ); Assert( pEntityToSpawnOn );

View File

@ -14,7 +14,7 @@
#include "model_types.h" #include "model_types.h"
#include "ai_utils.h" #include "ai_utils.h"
#include "particle_system.h" #include "particle_system.h"
#include "sprite.h" #include "Sprite.h"
#include "citadel_effects_shared.h" #include "citadel_effects_shared.h"
#include "soundent.h" #include "soundent.h"
#include "SpriteTrail.h" #include "SpriteTrail.h"
@ -24,7 +24,7 @@
#include "npc_hunter.h" #include "npc_hunter.h"
#include "particle_parse.h" #include "particle_parse.h"
#include "gameweaponmanager.h" #include "gameweaponmanager.h"
#include "gamestats.h" #include "GameStats.h"
extern ConVar hunter_hate_held_striderbusters; extern ConVar hunter_hate_held_striderbusters;
extern ConVar hunter_hate_thrown_striderbusters; extern ConVar hunter_hate_thrown_striderbusters;
@ -192,10 +192,10 @@ BEGIN_DATADESC( CWeaponStriderBuster )
END_DATADESC() END_DATADESC()
CWeaponStriderBuster::CWeaponStriderBuster( void ) : CWeaponStriderBuster::CWeaponStriderBuster( void ) :
m_pConstraint( NULL ),
m_flCollisionSpeedSqr( -1.0f ), m_flCollisionSpeedSqr( -1.0f ),
m_hConstrainedEntity( NULL ), m_nAttachedBoneFollowerIndex( -1 ),
m_nAttachedBoneFollowerIndex( -1 ) m_pConstraint( NULL ),
m_hConstrainedEntity( NULL )
{ {
} }
@ -260,7 +260,7 @@ void CWeaponStriderBuster::Spawn( void )
m_hParticleEffect->SetParent( this ); m_hParticleEffect->SetParent( this );
} }
SetHealth( striderbuster_health.GetFloat() ); SetHealth( striderbuster_health.GetInt() );
SetNextThink(gpGlobals->curtime + 0.01f); SetNextThink(gpGlobals->curtime + 0.01f);
} }
@ -946,7 +946,7 @@ void CWeaponStriderBuster::BusterFlyThink()
float magradiusSq = Square( magradius ); float magradiusSq = Square( magradius );
float nearestDistSq = magradiusSq + 1; float nearestDistSq = magradiusSq + 1;
int bestFit = -1; int bestFit = -1;
Vector toTarget; // will be garbage unless something good is found Vector toTarget(0.0f, 0.0f, 0.0f); // will be garbage unless something good is found
CNPC_Strider *pBestStrider = NULL; CNPC_Strider *pBestStrider = NULL;
for ( int ii = 0 ; ii < count ; ++ii ) for ( int ii = 0 ; ii < count ; ++ii )

View File

@ -44,7 +44,7 @@ CBaseEntity *CTempEntTester::Create( const Vector &vecOrigin, const QAngle &vecA
if ( single_te && single_te[0] ) if ( single_te && single_te[0] )
{ {
Q_strncpy( classname, single_te ,sizeof(classname)); Q_strncpy( classname, single_te ,sizeof(classname));
strlwr( classname ); Q_strlower( classname );
} }
else else
{ {
@ -81,7 +81,7 @@ void CTempEntTester::Spawn( void )
{ {
char name[ 128 ]; char name[ 128 ];
Q_strncpy( name, m_pCurrent->GetName() ,sizeof(name)); Q_strncpy( name, m_pCurrent->GetName() ,sizeof(name));
strlwr( name ); Q_strlower( name );
if ( strstr( name, m_szClass ) ) if ( strstr( name, m_szClass ) )
{ {
break; break;

View File

@ -307,7 +307,7 @@ void CEnvExplosion::InputExplode( inputdata_t &inputdata )
} }
//Get the damage override if specified //Get the damage override if specified
int iRadius = ( m_iRadiusOverride > 0 ) ? m_iRadiusOverride : ( m_iMagnitude * 2.5f ); int iRadius = ( m_iRadiusOverride > 0 ) ? m_iRadiusOverride : static_cast<int>(m_iMagnitude * 2.5f);
CPASFilter filter( vecExplodeOrigin ); CPASFilter filter( vecExplodeOrigin );
te->Explosion( filter, 0.0, te->Explosion( filter, 0.0,
@ -388,7 +388,7 @@ void ExplosionCreate( const Vector &center, const QAngle &angles,
CEnvExplosion *pExplosion = (CEnvExplosion*)CBaseEntity::Create( "env_explosion", center, angles, pOwner ); CEnvExplosion *pExplosion = (CEnvExplosion*)CBaseEntity::Create( "env_explosion", center, angles, pOwner );
Q_snprintf( buf,sizeof(buf), "%3d", magnitude ); Q_snprintf( buf,sizeof(buf), "%3d", magnitude );
char *szKeyName = "iMagnitude"; const char *szKeyName = "iMagnitude";
char *szValue = buf; char *szValue = buf;
pExplosion->KeyValue( szKeyName, szValue ); pExplosion->KeyValue( szKeyName, szValue );

Some files were not shown because too many files have changed in this diff Show More