Refactoring and cleanup project.

Removed project bzip2.
CZero: Fix crashing of HostageEscapeState.
This commit is contained in:
s1lentq 2016-02-04 06:18:26 +06:00
parent 4e3e9351fe
commit 25f425801a
267 changed files with 10401 additions and 22768 deletions

View File

@ -1,75 +0,0 @@
import org.doomedsociety.gradlecpp.cfg.ToolchainConfigUtils
import org.doomedsociety.gradlecpp.msvc.MsvcToolchainConfig
import org.doomedsociety.gradlecpp.toolchain.icc.Icc
import org.doomedsociety.gradlecpp.toolchain.icc.IccCompilerPlugin
import org.gradle.nativeplatform.NativeBinarySpec
import org.gradle.nativeplatform.NativeLibrarySpec
import org.gradle.nativeplatform.toolchain.VisualCpp
apply plugin: 'c'
apply plugin: IccCompilerPlugin
void setupToolchain(NativeBinarySpec b) {
def cfg = rootProject.createToolchainConfig(b)
if (cfg instanceof MsvcToolchainConfig) {
cfg.compilerOptions.pchConfig = new MsvcToolchainConfig.PrecompiledHeadersConfig(
enabled: true,
pchHeader: 'bzlib_private.h',
pchSourceSet: 'bz2_pch'
)
}
ToolchainConfigUtils.apply(project, cfg, b)
}
model {
buildTypes {
debug
release
}
platforms {
x86 {
architecture "x86"
}
}
toolChains {
visualCpp(VisualCpp) {
}
icc(Icc) {
}
}
components {
bzip2(NativeLibrarySpec) {
targetPlatform 'x86'
sources {
bz2_main(CSourceSet) {
source {
srcDir "src"
include "**/*.c"
exclude "precompiled.c"
}
exportedHeaders {
srcDir "include"
}
}
bz2_pch(CSourceSet) {
source {
srcDir "src"
include "precompiled.c"
}
exportedHeaders {
srcDir "include"
}
}
}
binaries.all { NativeBinarySpec b -> project.setupToolchain(b) }
}
}
}

View File

@ -1,282 +0,0 @@
/*-------------------------------------------------------------*/
/*--- Public header file for the library. ---*/
/*--- bzlib.h ---*/
/*-------------------------------------------------------------*/
/* ------------------------------------------------------------------
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
This program is released under the terms of the license contained
in the file LICENSE.
------------------------------------------------------------------ */
#ifndef _BZLIB_H
#define _BZLIB_H
#ifdef __cplusplus
extern "C" {
#endif
#define BZ_RUN 0
#define BZ_FLUSH 1
#define BZ_FINISH 2
#define BZ_OK 0
#define BZ_RUN_OK 1
#define BZ_FLUSH_OK 2
#define BZ_FINISH_OK 3
#define BZ_STREAM_END 4
#define BZ_SEQUENCE_ERROR (-1)
#define BZ_PARAM_ERROR (-2)
#define BZ_MEM_ERROR (-3)
#define BZ_DATA_ERROR (-4)
#define BZ_DATA_ERROR_MAGIC (-5)
#define BZ_IO_ERROR (-6)
#define BZ_UNEXPECTED_EOF (-7)
#define BZ_OUTBUFF_FULL (-8)
#define BZ_CONFIG_ERROR (-9)
typedef
struct {
char *next_in;
unsigned int avail_in;
unsigned int total_in_lo32;
unsigned int total_in_hi32;
char *next_out;
unsigned int avail_out;
unsigned int total_out_lo32;
unsigned int total_out_hi32;
void *state;
void *(*bzalloc)(void *,int,int);
void (*bzfree)(void *,void *);
void *opaque;
}
bz_stream;
#ifndef BZ_IMPORT
#define BZ_EXPORT
#endif
#ifndef BZ_NO_STDIO
/* Need a definitition for FILE */
#include <stdio.h>
#endif
#ifdef _WIN32
# include <windows.h>
# ifdef small
/* windows.h define small to char */
# undef small
# endif
# ifdef BZ_EXPORT
# define BZ_API(func) WINAPI func
# define BZ_EXTERN extern
# else
/* import windows dll dynamically */
# define BZ_API(func) (WINAPI * func)
# define BZ_EXTERN
# endif
#else
# define BZ_API(func) func
# define BZ_EXTERN extern
#endif
/*-- Core (low-level) library functions --*/
BZ_EXTERN int BZ_API(BZ2_bzCompressInit) (
bz_stream* strm,
int blockSize100k,
int verbosity,
int workFactor
);
BZ_EXTERN int BZ_API(BZ2_bzCompress) (
bz_stream* strm,
int action
);
BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) (
bz_stream* strm
);
BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) (
bz_stream *strm,
int verbosity,
int small
);
BZ_EXTERN int BZ_API(BZ2_bzDecompress) (
bz_stream* strm
);
BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) (
bz_stream *strm
);
/*-- High(er) level library functions --*/
#ifndef BZ_NO_STDIO
#define BZ_MAX_UNUSED 5000
typedef void BZFILE;
BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) (
int* bzerror,
FILE* f,
int verbosity,
int small,
void* unused,
int nUnused
);
BZ_EXTERN void BZ_API(BZ2_bzReadClose) (
int* bzerror,
BZFILE* b
);
BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) (
int* bzerror,
BZFILE* b,
void** unused,
int* nUnused
);
BZ_EXTERN int BZ_API(BZ2_bzRead) (
int* bzerror,
BZFILE* b,
void* buf,
int len
);
BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) (
int* bzerror,
FILE* f,
int blockSize100k,
int verbosity,
int workFactor
);
BZ_EXTERN void BZ_API(BZ2_bzWrite) (
int* bzerror,
BZFILE* b,
void* buf,
int len
);
BZ_EXTERN void BZ_API(BZ2_bzWriteClose) (
int* bzerror,
BZFILE* b,
int abandon,
unsigned int* nbytes_in,
unsigned int* nbytes_out
);
BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) (
int* bzerror,
BZFILE* b,
int abandon,
unsigned int* nbytes_in_lo32,
unsigned int* nbytes_in_hi32,
unsigned int* nbytes_out_lo32,
unsigned int* nbytes_out_hi32
);
#endif
/*-- Utility functions --*/
BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) (
char* dest,
unsigned int* destLen,
char* source,
unsigned int sourceLen,
int blockSize100k,
int verbosity,
int workFactor
);
BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) (
char* dest,
unsigned int* destLen,
char* source,
unsigned int sourceLen,
int small,
int verbosity
);
/*--
Code contributed by Yoshioka Tsuneo (tsuneo@rr.iij4u.or.jp)
to support better zlib compatibility.
This code is not _officially_ part of libbzip2 (yet);
I haven't tested it, documented it, or considered the
threading-safeness of it.
If this code breaks, please contact both Yoshioka and me.
--*/
BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) (
void
);
#ifndef BZ_NO_STDIO
BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) (
const char *path,
const char *mode
);
BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) (
int fd,
const char *mode
);
BZ_EXTERN int BZ_API(BZ2_bzread) (
BZFILE* b,
void* buf,
int len
);
BZ_EXTERN int BZ_API(BZ2_bzwrite) (
BZFILE* b,
void* buf,
int len
);
BZ_EXTERN int BZ_API(BZ2_bzflush) (
BZFILE* b
);
BZ_EXTERN void BZ_API(BZ2_bzclose) (
BZFILE* b
);
BZ_EXTERN const char * BZ_API(BZ2_bzerror) (
BZFILE *b,
int *errnum
);
#endif
#ifdef __cplusplus
}
#endif
#endif
/*-------------------------------------------------------------*/
/*--- end bzlib.h ---*/
/*-------------------------------------------------------------*/

View File

@ -1,186 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug MP Play|Win32">
<Configuration>Debug MP Play</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug MP|Win32">
<Configuration>Debug MP</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release MP|Win32">
<Configuration>Release MP</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{792DF067-9904-4579-99B9-46C17277ADE3}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>bzip2</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug MP|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release MP|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug MP Play|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug MP|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release MP|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug MP Play|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\include\</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeaderFile>bzlib_private.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug MP|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\include\</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeaderFile>bzlib_private.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release MP|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\include\</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeaderFile>bzlib_private.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug MP Play|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\include\</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeaderFile>bzlib_private.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>Use</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\include\</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeaderFile>bzlib_private.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\blocksort.c" />
<ClCompile Include="..\src\bzlib.c" />
<ClCompile Include="..\src\compress.c" />
<ClCompile Include="..\src\crctable.c" />
<ClCompile Include="..\src\decompress.c" />
<ClCompile Include="..\src\huffman.c" />
<ClCompile Include="..\src\precompiled.c">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug MP|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release MP|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug MP Play|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\src\randtable.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\bzlib_private.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -1,51 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\blocksort.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\bzlib.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\compress.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\crctable.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\decompress.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\huffman.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\randtable.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\precompiled.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\bzlib_private.h">
<Filter>Source Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,509 +0,0 @@
/*-------------------------------------------------------------*/
/*--- Private header file for the library. ---*/
/*--- bzlib_private.h ---*/
/*-------------------------------------------------------------*/
/* ------------------------------------------------------------------
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
This program is released under the terms of the license contained
in the file LICENSE.
------------------------------------------------------------------ */
#ifndef _BZLIB_PRIVATE_H
#define _BZLIB_PRIVATE_H
#include <stdlib.h>
#ifndef BZ_NO_STDIO
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#endif
#include "bzip2/bzlib.h"
/*-- General stuff. --*/
#define BZ_VERSION "1.0.6, 6-Sept-2010"
typedef char Char;
typedef unsigned char Bool;
typedef unsigned char UChar;
typedef int Int32;
typedef unsigned int UInt32;
typedef short Int16;
typedef unsigned short UInt16;
#define True ((Bool)1)
#define False ((Bool)0)
#ifndef __GNUC__
#define __inline__ /* */
#endif
#ifndef BZ_NO_STDIO
extern void BZ2_bz__AssertH__fail ( int errcode );
#define AssertH(cond,errcode) \
{ if (!(cond)) BZ2_bz__AssertH__fail ( errcode ); }
#if BZ_DEBUG
#define AssertD(cond,msg) \
{ if (!(cond)) { \
fprintf ( stderr, \
"\n\nlibbzip2(debug build): internal error\n\t%s\n", msg );\
exit(1); \
}}
#else
#define AssertD(cond,msg) /* */
#endif
#define VPrintf0(zf) \
fprintf(stderr,zf)
#define VPrintf1(zf,za1) \
fprintf(stderr,zf,za1)
#define VPrintf2(zf,za1,za2) \
fprintf(stderr,zf,za1,za2)
#define VPrintf3(zf,za1,za2,za3) \
fprintf(stderr,zf,za1,za2,za3)
#define VPrintf4(zf,za1,za2,za3,za4) \
fprintf(stderr,zf,za1,za2,za3,za4)
#define VPrintf5(zf,za1,za2,za3,za4,za5) \
fprintf(stderr,zf,za1,za2,za3,za4,za5)
#else
extern void bz_internal_error ( int errcode );
#define AssertH(cond,errcode) \
{ if (!(cond)) bz_internal_error ( errcode ); }
#define AssertD(cond,msg) do { } while (0)
#define VPrintf0(zf) do { } while (0)
#define VPrintf1(zf,za1) do { } while (0)
#define VPrintf2(zf,za1,za2) do { } while (0)
#define VPrintf3(zf,za1,za2,za3) do { } while (0)
#define VPrintf4(zf,za1,za2,za3,za4) do { } while (0)
#define VPrintf5(zf,za1,za2,za3,za4,za5) do { } while (0)
#endif
#define BZALLOC(nnn) (strm->bzalloc)(strm->opaque,(nnn),1)
#define BZFREE(ppp) (strm->bzfree)(strm->opaque,(ppp))
/*-- Header bytes. --*/
#define BZ_HDR_B 0x42 /* 'B' */
#define BZ_HDR_Z 0x5a /* 'Z' */
#define BZ_HDR_h 0x68 /* 'h' */
#define BZ_HDR_0 0x30 /* '0' */
/*-- Constants for the back end. --*/
#define BZ_MAX_ALPHA_SIZE 258
#define BZ_MAX_CODE_LEN 23
#define BZ_RUNA 0
#define BZ_RUNB 1
#define BZ_N_GROUPS 6
#define BZ_G_SIZE 50
#define BZ_N_ITERS 4
#define BZ_MAX_SELECTORS (2 + (900000 / BZ_G_SIZE))
/*-- Stuff for randomising repetitive blocks. --*/
extern Int32 BZ2_rNums[512];
#define BZ_RAND_DECLS \
Int32 rNToGo; \
Int32 rTPos \
#define BZ_RAND_INIT_MASK \
s->rNToGo = 0; \
s->rTPos = 0 \
#define BZ_RAND_MASK ((s->rNToGo == 1) ? 1 : 0)
#define BZ_RAND_UPD_MASK \
if (s->rNToGo == 0) { \
s->rNToGo = BZ2_rNums[s->rTPos]; \
s->rTPos++; \
if (s->rTPos == 512) s->rTPos = 0; \
} \
s->rNToGo--;
/*-- Stuff for doing CRCs. --*/
extern UInt32 BZ2_crc32Table[256];
#define BZ_INITIALISE_CRC(crcVar) \
{ \
crcVar = 0xffffffffL; \
}
#define BZ_FINALISE_CRC(crcVar) \
{ \
crcVar = ~(crcVar); \
}
#define BZ_UPDATE_CRC(crcVar,cha) \
{ \
crcVar = (crcVar << 8) ^ \
BZ2_crc32Table[(crcVar >> 24) ^ \
((UChar)cha)]; \
}
/*-- States and modes for compression. --*/
#define BZ_M_IDLE 1
#define BZ_M_RUNNING 2
#define BZ_M_FLUSHING 3
#define BZ_M_FINISHING 4
#define BZ_S_OUTPUT 1
#define BZ_S_INPUT 2
#define BZ_N_RADIX 2
#define BZ_N_QSORT 12
#define BZ_N_SHELL 18
#define BZ_N_OVERSHOOT (BZ_N_RADIX + BZ_N_QSORT + BZ_N_SHELL + 2)
/*-- Structure holding all the compression-side stuff. --*/
typedef
struct {
/* pointer back to the struct bz_stream */
bz_stream* strm;
/* mode this stream is in, and whether inputting */
/* or outputting data */
Int32 mode;
Int32 state;
/* remembers avail_in when flush/finish requested */
UInt32 avail_in_expect;
/* for doing the block sorting */
UInt32* arr1;
UInt32* arr2;
UInt32* ftab;
Int32 origPtr;
/* aliases for arr1 and arr2 */
UInt32* ptr;
UChar* block;
UInt16* mtfv;
UChar* zbits;
/* for deciding when to use the fallback sorting algorithm */
Int32 workFactor;
/* run-length-encoding of the input */
UInt32 state_in_ch;
Int32 state_in_len;
BZ_RAND_DECLS;
/* input and output limits and current posns */
Int32 nblock;
Int32 nblockMAX;
Int32 numZ;
Int32 state_out_pos;
/* map of bytes used in block */
Int32 nInUse;
Bool inUse[256];
UChar unseqToSeq[256];
/* the buffer for bit stream creation */
UInt32 bsBuff;
Int32 bsLive;
/* block and combined CRCs */
UInt32 blockCRC;
UInt32 combinedCRC;
/* misc administratium */
Int32 verbosity;
Int32 blockNo;
Int32 blockSize100k;
/* stuff for coding the MTF values */
Int32 nMTF;
Int32 mtfFreq [BZ_MAX_ALPHA_SIZE];
UChar selector [BZ_MAX_SELECTORS];
UChar selectorMtf[BZ_MAX_SELECTORS];
UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
Int32 code [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
Int32 rfreq [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
/* second dimension: only 3 needed; 4 makes index calculations faster */
UInt32 len_pack[BZ_MAX_ALPHA_SIZE][4];
}
EState;
/*-- externs for compression. --*/
extern void
BZ2_blockSort ( EState* );
extern void
BZ2_compressBlock ( EState*, Bool );
extern void
BZ2_bsInitWrite ( EState* );
extern void
BZ2_hbAssignCodes ( Int32*, UChar*, Int32, Int32, Int32 );
extern void
BZ2_hbMakeCodeLengths ( UChar*, Int32*, Int32, Int32 );
/*-- states for decompression. --*/
#define BZ_X_IDLE 1
#define BZ_X_OUTPUT 2
#define BZ_X_MAGIC_1 10
#define BZ_X_MAGIC_2 11
#define BZ_X_MAGIC_3 12
#define BZ_X_MAGIC_4 13
#define BZ_X_BLKHDR_1 14
#define BZ_X_BLKHDR_2 15
#define BZ_X_BLKHDR_3 16
#define BZ_X_BLKHDR_4 17
#define BZ_X_BLKHDR_5 18
#define BZ_X_BLKHDR_6 19
#define BZ_X_BCRC_1 20
#define BZ_X_BCRC_2 21
#define BZ_X_BCRC_3 22
#define BZ_X_BCRC_4 23
#define BZ_X_RANDBIT 24
#define BZ_X_ORIGPTR_1 25
#define BZ_X_ORIGPTR_2 26
#define BZ_X_ORIGPTR_3 27
#define BZ_X_MAPPING_1 28
#define BZ_X_MAPPING_2 29
#define BZ_X_SELECTOR_1 30
#define BZ_X_SELECTOR_2 31
#define BZ_X_SELECTOR_3 32
#define BZ_X_CODING_1 33
#define BZ_X_CODING_2 34
#define BZ_X_CODING_3 35
#define BZ_X_MTF_1 36
#define BZ_X_MTF_2 37
#define BZ_X_MTF_3 38
#define BZ_X_MTF_4 39
#define BZ_X_MTF_5 40
#define BZ_X_MTF_6 41
#define BZ_X_ENDHDR_2 42
#define BZ_X_ENDHDR_3 43
#define BZ_X_ENDHDR_4 44
#define BZ_X_ENDHDR_5 45
#define BZ_X_ENDHDR_6 46
#define BZ_X_CCRC_1 47
#define BZ_X_CCRC_2 48
#define BZ_X_CCRC_3 49
#define BZ_X_CCRC_4 50
/*-- Constants for the fast MTF decoder. --*/
#define MTFA_SIZE 4096
#define MTFL_SIZE 16
/*-- Structure holding all the decompression-side stuff. --*/
typedef
struct {
/* pointer back to the struct bz_stream */
bz_stream* strm;
/* state indicator for this stream */
Int32 state;
/* for doing the final run-length decoding */
UChar state_out_ch;
Int32 state_out_len;
Bool blockRandomised;
BZ_RAND_DECLS;
/* the buffer for bit stream reading */
UInt32 bsBuff;
Int32 bsLive;
/* misc administratium */
Int32 blockSize100k;
Bool smallDecompress;
Int32 currBlockNo;
Int32 verbosity;
/* for undoing the Burrows-Wheeler transform */
Int32 origPtr;
UInt32 tPos;
Int32 k0;
Int32 unzftab[256];
Int32 nblock_used;
Int32 cftab[257];
Int32 cftabCopy[257];
/* for undoing the Burrows-Wheeler transform (FAST) */
UInt32 *tt;
/* for undoing the Burrows-Wheeler transform (SMALL) */
UInt16 *ll16;
UChar *ll4;
/* stored and calculated CRCs */
UInt32 storedBlockCRC;
UInt32 storedCombinedCRC;
UInt32 calculatedBlockCRC;
UInt32 calculatedCombinedCRC;
/* map of bytes used in block */
Int32 nInUse;
Bool inUse[256];
Bool inUse16[16];
UChar seqToUnseq[256];
/* for decoding the MTF values */
UChar mtfa [MTFA_SIZE];
Int32 mtfbase[256 / MTFL_SIZE];
UChar selector [BZ_MAX_SELECTORS];
UChar selectorMtf[BZ_MAX_SELECTORS];
UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
Int32 limit [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
Int32 base [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
Int32 perm [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
Int32 minLens[BZ_N_GROUPS];
/* save area for scalars in the main decompress code */
Int32 save_i;
Int32 save_j;
Int32 save_t;
Int32 save_alphaSize;
Int32 save_nGroups;
Int32 save_nSelectors;
Int32 save_EOB;
Int32 save_groupNo;
Int32 save_groupPos;
Int32 save_nextSym;
Int32 save_nblockMAX;
Int32 save_nblock;
Int32 save_es;
Int32 save_N;
Int32 save_curr;
Int32 save_zt;
Int32 save_zn;
Int32 save_zvec;
Int32 save_zj;
Int32 save_gSel;
Int32 save_gMinlen;
Int32* save_gLimit;
Int32* save_gBase;
Int32* save_gPerm;
}
DState;
/*-- Macros for decompression. --*/
#define BZ_GET_FAST(cccc) \
/* c_tPos is unsigned, hence test < 0 is pointless. */ \
if (s->tPos >= (UInt32)100000 * (UInt32)s->blockSize100k) return True; \
s->tPos = s->tt[s->tPos]; \
cccc = (UChar)(s->tPos & 0xff); \
s->tPos >>= 8;
#define BZ_GET_FAST_C(cccc) \
/* c_tPos is unsigned, hence test < 0 is pointless. */ \
if (c_tPos >= (UInt32)100000 * (UInt32)ro_blockSize100k) return True; \
c_tPos = c_tt[c_tPos]; \
cccc = (UChar)(c_tPos & 0xff); \
c_tPos >>= 8;
#define SET_LL4(i,n) \
{ if (((i) & 0x1) == 0) \
s->ll4[(i) >> 1] = (s->ll4[(i) >> 1] & 0xf0) | (n); else \
s->ll4[(i) >> 1] = (s->ll4[(i) >> 1] & 0x0f) | ((n) << 4); \
}
#define GET_LL4(i) \
((((UInt32)(s->ll4[(i) >> 1])) >> (((i) << 2) & 0x4)) & 0xF)
#define SET_LL(i,n) \
{ s->ll16[i] = (UInt16)(n & 0x0000ffff); \
SET_LL4(i, n >> 16); \
}
#define GET_LL(i) \
(((UInt32)s->ll16[i]) | (GET_LL4(i) << 16))
#define BZ_GET_SMALL(cccc) \
/* c_tPos is unsigned, hence test < 0 is pointless. */ \
if (s->tPos >= (UInt32)100000 * (UInt32)s->blockSize100k) return True; \
cccc = BZ2_indexIntoF ( s->tPos, s->cftab ); \
s->tPos = GET_LL(s->tPos);
/*-- externs for decompression. --*/
extern Int32
BZ2_indexIntoF ( Int32, Int32* );
extern Int32
BZ2_decompress ( DState* );
extern void
BZ2_hbCreateDecodeTables ( Int32*, Int32*, Int32*, UChar*,
Int32, Int32, Int32 );
#endif
/*-- BZ_NO_STDIO seems to make NULL disappear on some platforms. --*/
#ifdef BZ_NO_STDIO
#ifndef NULL
#define NULL 0
#endif
#endif
/*-------------------------------------------------------------*/
/*--- end bzlib_private.h ---*/
/*-------------------------------------------------------------*/

View File

@ -1,672 +0,0 @@
/*-------------------------------------------------------------*/
/*--- Compression machinery (not incl block sorting) ---*/
/*--- compress.c ---*/
/*-------------------------------------------------------------*/
/* ------------------------------------------------------------------
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
This program is released under the terms of the license contained
in the file LICENSE.
------------------------------------------------------------------ */
/* CHANGES
0.9.0 -- original version.
0.9.0a/b -- no changes in this file.
0.9.0c -- changed setting of nGroups in sendMTFValues()
so as to do a bit better on small files
*/
#include "bzlib_private.h"
/*---------------------------------------------------*/
/*--- Bit stream I/O ---*/
/*---------------------------------------------------*/
/*---------------------------------------------------*/
void BZ2_bsInitWrite ( EState* s )
{
s->bsLive = 0;
s->bsBuff = 0;
}
/*---------------------------------------------------*/
static
void bsFinishWrite ( EState* s )
{
while (s->bsLive > 0) {
s->zbits[s->numZ] = (UChar)(s->bsBuff >> 24);
s->numZ++;
s->bsBuff <<= 8;
s->bsLive -= 8;
}
}
/*---------------------------------------------------*/
#define bsNEEDW(nz) \
{ \
while (s->bsLive >= 8) { \
s->zbits[s->numZ] \
= (UChar)(s->bsBuff >> 24); \
s->numZ++; \
s->bsBuff <<= 8; \
s->bsLive -= 8; \
} \
}
/*---------------------------------------------------*/
static
__inline__
void bsW ( EState* s, Int32 n, UInt32 v )
{
bsNEEDW ( n );
s->bsBuff |= (v << (32 - s->bsLive - n));
s->bsLive += n;
}
/*---------------------------------------------------*/
static
void bsPutUInt32 ( EState* s, UInt32 u )
{
bsW ( s, 8, (u >> 24) & 0xffL );
bsW ( s, 8, (u >> 16) & 0xffL );
bsW ( s, 8, (u >> 8) & 0xffL );
bsW ( s, 8, u & 0xffL );
}
/*---------------------------------------------------*/
static
void bsPutUChar ( EState* s, UChar c )
{
bsW( s, 8, (UInt32)c );
}
/*---------------------------------------------------*/
/*--- The back end proper ---*/
/*---------------------------------------------------*/
/*---------------------------------------------------*/
static
void makeMaps_e ( EState* s )
{
Int32 i;
s->nInUse = 0;
for (i = 0; i < 256; i++)
if (s->inUse[i]) {
s->unseqToSeq[i] = s->nInUse;
s->nInUse++;
}
}
/*---------------------------------------------------*/
static
void generateMTFValues ( EState* s )
{
UChar yy[256];
Int32 i, j;
Int32 zPend;
Int32 wr;
Int32 EOB;
/*
After sorting (eg, here),
s->arr1 [ 0 .. s->nblock-1 ] holds sorted order,
and
((UChar*)s->arr2) [ 0 .. s->nblock-1 ]
holds the original block data.
The first thing to do is generate the MTF values,
and put them in
((UInt16*)s->arr1) [ 0 .. s->nblock-1 ].
Because there are strictly fewer or equal MTF values
than block values, ptr values in this area are overwritten
with MTF values only when they are no longer needed.
The final compressed bitstream is generated into the
area starting at
(UChar*) (&((UChar*)s->arr2)[s->nblock])
These storage aliases are set up in bzCompressInit(),
except for the last one, which is arranged in
compressBlock().
*/
UInt32* ptr = s->ptr;
UChar* block = s->block;
UInt16* mtfv = s->mtfv;
makeMaps_e ( s );
EOB = s->nInUse+1;
for (i = 0; i <= EOB; i++) s->mtfFreq[i] = 0;
wr = 0;
zPend = 0;
for (i = 0; i < s->nInUse; i++) yy[i] = (UChar) i;
for (i = 0; i < s->nblock; i++) {
UChar ll_i;
AssertD ( wr <= i, "generateMTFValues(1)" );
j = ptr[i]-1; if (j < 0) j += s->nblock;
ll_i = s->unseqToSeq[block[j]];
AssertD ( ll_i < s->nInUse, "generateMTFValues(2a)" );
if (yy[0] == ll_i) {
zPend++;
} else {
if (zPend > 0) {
zPend--;
while (True) {
if (zPend & 1) {
mtfv[wr] = BZ_RUNB; wr++;
s->mtfFreq[BZ_RUNB]++;
} else {
mtfv[wr] = BZ_RUNA; wr++;
s->mtfFreq[BZ_RUNA]++;
}
if (zPend < 2) break;
zPend = (zPend - 2) / 2;
};
zPend = 0;
}
{
register UChar rtmp;
register UChar* ryy_j;
register UChar rll_i;
rtmp = yy[1];
yy[1] = yy[0];
ryy_j = &(yy[1]);
rll_i = ll_i;
while ( rll_i != rtmp ) {
register UChar rtmp2;
ryy_j++;
rtmp2 = rtmp;
rtmp = *ryy_j;
*ryy_j = rtmp2;
};
yy[0] = rtmp;
j = ryy_j - &(yy[0]);
mtfv[wr] = j+1; wr++; s->mtfFreq[j+1]++;
}
}
}
if (zPend > 0) {
zPend--;
while (True) {
if (zPend & 1) {
mtfv[wr] = BZ_RUNB; wr++;
s->mtfFreq[BZ_RUNB]++;
} else {
mtfv[wr] = BZ_RUNA; wr++;
s->mtfFreq[BZ_RUNA]++;
}
if (zPend < 2) break;
zPend = (zPend - 2) / 2;
};
zPend = 0;
}
mtfv[wr] = EOB; wr++; s->mtfFreq[EOB]++;
s->nMTF = wr;
}
/*---------------------------------------------------*/
#define BZ_LESSER_ICOST 0
#define BZ_GREATER_ICOST 15
static
void sendMTFValues ( EState* s )
{
Int32 v, t, i, j, gs, ge, totc, bt, bc, iter;
Int32 nSelectors, alphaSize, minLen, maxLen, selCtr;
Int32 nGroups, nBytes;
/*--
UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
is a global since the decoder also needs it.
Int32 code[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
Int32 rfreq[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE];
are also globals only used in this proc.
Made global to keep stack frame size small.
--*/
UInt16 cost[BZ_N_GROUPS];
Int32 fave[BZ_N_GROUPS];
UInt16* mtfv = s->mtfv;
if (s->verbosity >= 3)
VPrintf3( " %d in block, %d after MTF & 1-2 coding, "
"%d+2 syms in use\n",
s->nblock, s->nMTF, s->nInUse );
alphaSize = s->nInUse+2;
for (t = 0; t < BZ_N_GROUPS; t++)
for (v = 0; v < alphaSize; v++)
s->len[t][v] = BZ_GREATER_ICOST;
/*--- Decide how many coding tables to use ---*/
AssertH ( s->nMTF > 0, 3001 );
if (s->nMTF < 200) nGroups = 2; else
if (s->nMTF < 600) nGroups = 3; else
if (s->nMTF < 1200) nGroups = 4; else
if (s->nMTF < 2400) nGroups = 5; else
nGroups = 6;
/*--- Generate an initial set of coding tables ---*/
{
Int32 nPart, remF, tFreq, aFreq;
nPart = nGroups;
remF = s->nMTF;
gs = 0;
while (nPart > 0) {
tFreq = remF / nPart;
ge = gs-1;
aFreq = 0;
while (aFreq < tFreq && ge < alphaSize-1) {
ge++;
aFreq += s->mtfFreq[ge];
}
if (ge > gs
&& nPart != nGroups && nPart != 1
&& ((nGroups-nPart) % 2 == 1)) {
aFreq -= s->mtfFreq[ge];
ge--;
}
if (s->verbosity >= 3)
VPrintf5( " initial group %d, [%d .. %d], "
"has %d syms (%4.1f%%)\n",
nPart, gs, ge, aFreq,
(100.0 * (float)aFreq) / (float)(s->nMTF) );
for (v = 0; v < alphaSize; v++)
if (v >= gs && v <= ge)
s->len[nPart-1][v] = BZ_LESSER_ICOST; else
s->len[nPart-1][v] = BZ_GREATER_ICOST;
nPart--;
gs = ge+1;
remF -= aFreq;
}
}
/*---
Iterate up to BZ_N_ITERS times to improve the tables.
---*/
for (iter = 0; iter < BZ_N_ITERS; iter++) {
for (t = 0; t < nGroups; t++) fave[t] = 0;
for (t = 0; t < nGroups; t++)
for (v = 0; v < alphaSize; v++)
s->rfreq[t][v] = 0;
/*---
Set up an auxiliary length table which is used to fast-track
the common case (nGroups == 6).
---*/
if (nGroups == 6) {
for (v = 0; v < alphaSize; v++) {
s->len_pack[v][0] = (s->len[1][v] << 16) | s->len[0][v];
s->len_pack[v][1] = (s->len[3][v] << 16) | s->len[2][v];
s->len_pack[v][2] = (s->len[5][v] << 16) | s->len[4][v];
}
}
nSelectors = 0;
totc = 0;
gs = 0;
while (True) {
/*--- Set group start & end marks. --*/
if (gs >= s->nMTF) break;
ge = gs + BZ_G_SIZE - 1;
if (ge >= s->nMTF) ge = s->nMTF-1;
/*--
Calculate the cost of this group as coded
by each of the coding tables.
--*/
for (t = 0; t < nGroups; t++) cost[t] = 0;
if (nGroups == 6 && 50 == ge-gs+1) {
/*--- fast track the common case ---*/
register UInt32 cost01, cost23, cost45;
register UInt16 icv;
cost01 = cost23 = cost45 = 0;
# define BZ_ITER(nn) \
icv = mtfv[gs+(nn)]; \
cost01 += s->len_pack[icv][0]; \
cost23 += s->len_pack[icv][1]; \
cost45 += s->len_pack[icv][2]; \
BZ_ITER(0); BZ_ITER(1); BZ_ITER(2); BZ_ITER(3); BZ_ITER(4);
BZ_ITER(5); BZ_ITER(6); BZ_ITER(7); BZ_ITER(8); BZ_ITER(9);
BZ_ITER(10); BZ_ITER(11); BZ_ITER(12); BZ_ITER(13); BZ_ITER(14);
BZ_ITER(15); BZ_ITER(16); BZ_ITER(17); BZ_ITER(18); BZ_ITER(19);
BZ_ITER(20); BZ_ITER(21); BZ_ITER(22); BZ_ITER(23); BZ_ITER(24);
BZ_ITER(25); BZ_ITER(26); BZ_ITER(27); BZ_ITER(28); BZ_ITER(29);
BZ_ITER(30); BZ_ITER(31); BZ_ITER(32); BZ_ITER(33); BZ_ITER(34);
BZ_ITER(35); BZ_ITER(36); BZ_ITER(37); BZ_ITER(38); BZ_ITER(39);
BZ_ITER(40); BZ_ITER(41); BZ_ITER(42); BZ_ITER(43); BZ_ITER(44);
BZ_ITER(45); BZ_ITER(46); BZ_ITER(47); BZ_ITER(48); BZ_ITER(49);
# undef BZ_ITER
cost[0] = cost01 & 0xffff; cost[1] = cost01 >> 16;
cost[2] = cost23 & 0xffff; cost[3] = cost23 >> 16;
cost[4] = cost45 & 0xffff; cost[5] = cost45 >> 16;
} else {
/*--- slow version which correctly handles all situations ---*/
for (i = gs; i <= ge; i++) {
UInt16 icv = mtfv[i];
for (t = 0; t < nGroups; t++) cost[t] += s->len[t][icv];
}
}
/*--
Find the coding table which is best for this group,
and record its identity in the selector table.
--*/
bc = 999999999; bt = -1;
for (t = 0; t < nGroups; t++)
if (cost[t] < bc) { bc = cost[t]; bt = t; };
totc += bc;
fave[bt]++;
s->selector[nSelectors] = bt;
nSelectors++;
/*--
Increment the symbol frequencies for the selected table.
--*/
if (nGroups == 6 && 50 == ge-gs+1) {
/*--- fast track the common case ---*/
# define BZ_ITUR(nn) s->rfreq[bt][ mtfv[gs+(nn)] ]++
BZ_ITUR(0); BZ_ITUR(1); BZ_ITUR(2); BZ_ITUR(3); BZ_ITUR(4);
BZ_ITUR(5); BZ_ITUR(6); BZ_ITUR(7); BZ_ITUR(8); BZ_ITUR(9);
BZ_ITUR(10); BZ_ITUR(11); BZ_ITUR(12); BZ_ITUR(13); BZ_ITUR(14);
BZ_ITUR(15); BZ_ITUR(16); BZ_ITUR(17); BZ_ITUR(18); BZ_ITUR(19);
BZ_ITUR(20); BZ_ITUR(21); BZ_ITUR(22); BZ_ITUR(23); BZ_ITUR(24);
BZ_ITUR(25); BZ_ITUR(26); BZ_ITUR(27); BZ_ITUR(28); BZ_ITUR(29);
BZ_ITUR(30); BZ_ITUR(31); BZ_ITUR(32); BZ_ITUR(33); BZ_ITUR(34);
BZ_ITUR(35); BZ_ITUR(36); BZ_ITUR(37); BZ_ITUR(38); BZ_ITUR(39);
BZ_ITUR(40); BZ_ITUR(41); BZ_ITUR(42); BZ_ITUR(43); BZ_ITUR(44);
BZ_ITUR(45); BZ_ITUR(46); BZ_ITUR(47); BZ_ITUR(48); BZ_ITUR(49);
# undef BZ_ITUR
} else {
/*--- slow version which correctly handles all situations ---*/
for (i = gs; i <= ge; i++)
s->rfreq[bt][ mtfv[i] ]++;
}
gs = ge+1;
}
if (s->verbosity >= 3) {
VPrintf2 ( " pass %d: size is %d, grp uses are ",
iter+1, totc/8 );
for (t = 0; t < nGroups; t++)
VPrintf1 ( "%d ", fave[t] );
VPrintf0 ( "\n" );
}
/*--
Recompute the tables based on the accumulated frequencies.
--*/
/* maxLen was changed from 20 to 17 in bzip2-1.0.3. See
comment in huffman.c for details. */
for (t = 0; t < nGroups; t++)
BZ2_hbMakeCodeLengths ( &(s->len[t][0]), &(s->rfreq[t][0]),
alphaSize, 17 /*20*/ );
}
AssertH( nGroups < 8, 3002 );
AssertH( nSelectors < 32768 &&
nSelectors <= (2 + (900000 / BZ_G_SIZE)),
3003 );
/*--- Compute MTF values for the selectors. ---*/
{
UChar pos[BZ_N_GROUPS], ll_i, tmp2, tmp;
for (i = 0; i < nGroups; i++) pos[i] = i;
for (i = 0; i < nSelectors; i++) {
ll_i = s->selector[i];
j = 0;
tmp = pos[j];
while ( ll_i != tmp ) {
j++;
tmp2 = tmp;
tmp = pos[j];
pos[j] = tmp2;
};
pos[0] = tmp;
s->selectorMtf[i] = j;
}
};
/*--- Assign actual codes for the tables. --*/
for (t = 0; t < nGroups; t++) {
minLen = 32;
maxLen = 0;
for (i = 0; i < alphaSize; i++) {
if (s->len[t][i] > maxLen) maxLen = s->len[t][i];
if (s->len[t][i] < minLen) minLen = s->len[t][i];
}
AssertH ( !(maxLen > 17 /*20*/ ), 3004 );
AssertH ( !(minLen < 1), 3005 );
BZ2_hbAssignCodes ( &(s->code[t][0]), &(s->len[t][0]),
minLen, maxLen, alphaSize );
}
/*--- Transmit the mapping table. ---*/
{
Bool inUse16[16];
for (i = 0; i < 16; i++) {
inUse16[i] = False;
for (j = 0; j < 16; j++)
if (s->inUse[i * 16 + j]) inUse16[i] = True;
}
nBytes = s->numZ;
for (i = 0; i < 16; i++)
if (inUse16[i]) bsW(s,1,1); else bsW(s,1,0);
for (i = 0; i < 16; i++)
if (inUse16[i])
for (j = 0; j < 16; j++) {
if (s->inUse[i * 16 + j]) bsW(s,1,1); else bsW(s,1,0);
}
if (s->verbosity >= 3)
VPrintf1( " bytes: mapping %d, ", s->numZ-nBytes );
}
/*--- Now the selectors. ---*/
nBytes = s->numZ;
bsW ( s, 3, nGroups );
bsW ( s, 15, nSelectors );
for (i = 0; i < nSelectors; i++) {
for (j = 0; j < s->selectorMtf[i]; j++) bsW(s,1,1);
bsW(s,1,0);
}
if (s->verbosity >= 3)
VPrintf1( "selectors %d, ", s->numZ-nBytes );
/*--- Now the coding tables. ---*/
nBytes = s->numZ;
for (t = 0; t < nGroups; t++) {
Int32 curr = s->len[t][0];
bsW ( s, 5, curr );
for (i = 0; i < alphaSize; i++) {
while (curr < s->len[t][i]) { bsW(s,2,2); curr++; /* 10 */ };
while (curr > s->len[t][i]) { bsW(s,2,3); curr--; /* 11 */ };
bsW ( s, 1, 0 );
}
}
if (s->verbosity >= 3)
VPrintf1 ( "code lengths %d, ", s->numZ-nBytes );
/*--- And finally, the block data proper ---*/
nBytes = s->numZ;
selCtr = 0;
gs = 0;
while (True) {
if (gs >= s->nMTF) break;
ge = gs + BZ_G_SIZE - 1;
if (ge >= s->nMTF) ge = s->nMTF-1;
AssertH ( s->selector[selCtr] < nGroups, 3006 );
if (nGroups == 6 && 50 == ge-gs+1) {
/*--- fast track the common case ---*/
UInt16 mtfv_i;
UChar* s_len_sel_selCtr
= &(s->len[s->selector[selCtr]][0]);
Int32* s_code_sel_selCtr
= &(s->code[s->selector[selCtr]][0]);
# define BZ_ITAH(nn) \
mtfv_i = mtfv[gs+(nn)]; \
bsW ( s, \
s_len_sel_selCtr[mtfv_i], \
s_code_sel_selCtr[mtfv_i] )
BZ_ITAH(0); BZ_ITAH(1); BZ_ITAH(2); BZ_ITAH(3); BZ_ITAH(4);
BZ_ITAH(5); BZ_ITAH(6); BZ_ITAH(7); BZ_ITAH(8); BZ_ITAH(9);
BZ_ITAH(10); BZ_ITAH(11); BZ_ITAH(12); BZ_ITAH(13); BZ_ITAH(14);
BZ_ITAH(15); BZ_ITAH(16); BZ_ITAH(17); BZ_ITAH(18); BZ_ITAH(19);
BZ_ITAH(20); BZ_ITAH(21); BZ_ITAH(22); BZ_ITAH(23); BZ_ITAH(24);
BZ_ITAH(25); BZ_ITAH(26); BZ_ITAH(27); BZ_ITAH(28); BZ_ITAH(29);
BZ_ITAH(30); BZ_ITAH(31); BZ_ITAH(32); BZ_ITAH(33); BZ_ITAH(34);
BZ_ITAH(35); BZ_ITAH(36); BZ_ITAH(37); BZ_ITAH(38); BZ_ITAH(39);
BZ_ITAH(40); BZ_ITAH(41); BZ_ITAH(42); BZ_ITAH(43); BZ_ITAH(44);
BZ_ITAH(45); BZ_ITAH(46); BZ_ITAH(47); BZ_ITAH(48); BZ_ITAH(49);
# undef BZ_ITAH
} else {
/*--- slow version which correctly handles all situations ---*/
for (i = gs; i <= ge; i++) {
bsW ( s,
s->len [s->selector[selCtr]] [mtfv[i]],
s->code [s->selector[selCtr]] [mtfv[i]] );
}
}
gs = ge+1;
selCtr++;
}
AssertH( selCtr == nSelectors, 3007 );
if (s->verbosity >= 3)
VPrintf1( "codes %d\n", s->numZ-nBytes );
}
/*---------------------------------------------------*/
void BZ2_compressBlock ( EState* s, Bool is_last_block )
{
if (s->nblock > 0) {
BZ_FINALISE_CRC ( s->blockCRC );
s->combinedCRC = (s->combinedCRC << 1) | (s->combinedCRC >> 31);
s->combinedCRC ^= s->blockCRC;
if (s->blockNo > 1) s->numZ = 0;
if (s->verbosity >= 2)
VPrintf4( " block %d: crc = 0x%08x, "
"combined CRC = 0x%08x, size = %d\n",
s->blockNo, s->blockCRC, s->combinedCRC, s->nblock );
BZ2_blockSort ( s );
}
s->zbits = (UChar*) (&((UChar*)s->arr2)[s->nblock]);
/*-- If this is the first block, create the stream header. --*/
if (s->blockNo == 1) {
BZ2_bsInitWrite ( s );
bsPutUChar ( s, BZ_HDR_B );
bsPutUChar ( s, BZ_HDR_Z );
bsPutUChar ( s, BZ_HDR_h );
bsPutUChar ( s, (UChar)(BZ_HDR_0 + s->blockSize100k) );
}
if (s->nblock > 0) {
bsPutUChar ( s, 0x31 ); bsPutUChar ( s, 0x41 );
bsPutUChar ( s, 0x59 ); bsPutUChar ( s, 0x26 );
bsPutUChar ( s, 0x53 ); bsPutUChar ( s, 0x59 );
/*-- Now the block's CRC, so it is in a known place. --*/
bsPutUInt32 ( s, s->blockCRC );
/*--
Now a single bit indicating (non-)randomisation.
As of version 0.9.5, we use a better sorting algorithm
which makes randomisation unnecessary. So always set
the randomised bit to 'no'. Of course, the decoder
still needs to be able to handle randomised blocks
so as to maintain backwards compatibility with
older versions of bzip2.
--*/
bsW(s,1,0);
bsW ( s, 24, s->origPtr );
generateMTFValues ( s );
sendMTFValues ( s );
}
/*-- If this is the last block, add the stream trailer. --*/
if (is_last_block) {
bsPutUChar ( s, 0x17 ); bsPutUChar ( s, 0x72 );
bsPutUChar ( s, 0x45 ); bsPutUChar ( s, 0x38 );
bsPutUChar ( s, 0x50 ); bsPutUChar ( s, 0x90 );
bsPutUInt32 ( s, s->combinedCRC );
if (s->verbosity >= 2)
VPrintf1( " final combined CRC = 0x%08x\n ", s->combinedCRC );
bsFinishWrite ( s );
}
}
/*-------------------------------------------------------------*/
/*--- end compress.c ---*/
/*-------------------------------------------------------------*/

View File

@ -1,104 +0,0 @@
/*-------------------------------------------------------------*/
/*--- Table for doing CRCs ---*/
/*--- crctable.c ---*/
/*-------------------------------------------------------------*/
/* ------------------------------------------------------------------
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
This program is released under the terms of the license contained
in the file LICENSE.
------------------------------------------------------------------ */
#include "bzlib_private.h"
/*--
I think this is an implementation of the AUTODIN-II,
Ethernet & FDDI 32-bit CRC standard. Vaguely derived
from code by Rob Warnock, in Section 51 of the
comp.compression FAQ.
--*/
UInt32 BZ2_crc32Table[256] = {
/*-- Ugly, innit? --*/
0x00000000L, 0x04c11db7L, 0x09823b6eL, 0x0d4326d9L,
0x130476dcL, 0x17c56b6bL, 0x1a864db2L, 0x1e475005L,
0x2608edb8L, 0x22c9f00fL, 0x2f8ad6d6L, 0x2b4bcb61L,
0x350c9b64L, 0x31cd86d3L, 0x3c8ea00aL, 0x384fbdbdL,
0x4c11db70L, 0x48d0c6c7L, 0x4593e01eL, 0x4152fda9L,
0x5f15adacL, 0x5bd4b01bL, 0x569796c2L, 0x52568b75L,
0x6a1936c8L, 0x6ed82b7fL, 0x639b0da6L, 0x675a1011L,
0x791d4014L, 0x7ddc5da3L, 0x709f7b7aL, 0x745e66cdL,
0x9823b6e0L, 0x9ce2ab57L, 0x91a18d8eL, 0x95609039L,
0x8b27c03cL, 0x8fe6dd8bL, 0x82a5fb52L, 0x8664e6e5L,
0xbe2b5b58L, 0xbaea46efL, 0xb7a96036L, 0xb3687d81L,
0xad2f2d84L, 0xa9ee3033L, 0xa4ad16eaL, 0xa06c0b5dL,
0xd4326d90L, 0xd0f37027L, 0xddb056feL, 0xd9714b49L,
0xc7361b4cL, 0xc3f706fbL, 0xceb42022L, 0xca753d95L,
0xf23a8028L, 0xf6fb9d9fL, 0xfbb8bb46L, 0xff79a6f1L,
0xe13ef6f4L, 0xe5ffeb43L, 0xe8bccd9aL, 0xec7dd02dL,
0x34867077L, 0x30476dc0L, 0x3d044b19L, 0x39c556aeL,
0x278206abL, 0x23431b1cL, 0x2e003dc5L, 0x2ac12072L,
0x128e9dcfL, 0x164f8078L, 0x1b0ca6a1L, 0x1fcdbb16L,
0x018aeb13L, 0x054bf6a4L, 0x0808d07dL, 0x0cc9cdcaL,
0x7897ab07L, 0x7c56b6b0L, 0x71159069L, 0x75d48ddeL,
0x6b93dddbL, 0x6f52c06cL, 0x6211e6b5L, 0x66d0fb02L,
0x5e9f46bfL, 0x5a5e5b08L, 0x571d7dd1L, 0x53dc6066L,
0x4d9b3063L, 0x495a2dd4L, 0x44190b0dL, 0x40d816baL,
0xaca5c697L, 0xa864db20L, 0xa527fdf9L, 0xa1e6e04eL,
0xbfa1b04bL, 0xbb60adfcL, 0xb6238b25L, 0xb2e29692L,
0x8aad2b2fL, 0x8e6c3698L, 0x832f1041L, 0x87ee0df6L,
0x99a95df3L, 0x9d684044L, 0x902b669dL, 0x94ea7b2aL,
0xe0b41de7L, 0xe4750050L, 0xe9362689L, 0xedf73b3eL,
0xf3b06b3bL, 0xf771768cL, 0xfa325055L, 0xfef34de2L,
0xc6bcf05fL, 0xc27dede8L, 0xcf3ecb31L, 0xcbffd686L,
0xd5b88683L, 0xd1799b34L, 0xdc3abdedL, 0xd8fba05aL,
0x690ce0eeL, 0x6dcdfd59L, 0x608edb80L, 0x644fc637L,
0x7a089632L, 0x7ec98b85L, 0x738aad5cL, 0x774bb0ebL,
0x4f040d56L, 0x4bc510e1L, 0x46863638L, 0x42472b8fL,
0x5c007b8aL, 0x58c1663dL, 0x558240e4L, 0x51435d53L,
0x251d3b9eL, 0x21dc2629L, 0x2c9f00f0L, 0x285e1d47L,
0x36194d42L, 0x32d850f5L, 0x3f9b762cL, 0x3b5a6b9bL,
0x0315d626L, 0x07d4cb91L, 0x0a97ed48L, 0x0e56f0ffL,
0x1011a0faL, 0x14d0bd4dL, 0x19939b94L, 0x1d528623L,
0xf12f560eL, 0xf5ee4bb9L, 0xf8ad6d60L, 0xfc6c70d7L,
0xe22b20d2L, 0xe6ea3d65L, 0xeba91bbcL, 0xef68060bL,
0xd727bbb6L, 0xd3e6a601L, 0xdea580d8L, 0xda649d6fL,
0xc423cd6aL, 0xc0e2d0ddL, 0xcda1f604L, 0xc960ebb3L,
0xbd3e8d7eL, 0xb9ff90c9L, 0xb4bcb610L, 0xb07daba7L,
0xae3afba2L, 0xaafbe615L, 0xa7b8c0ccL, 0xa379dd7bL,
0x9b3660c6L, 0x9ff77d71L, 0x92b45ba8L, 0x9675461fL,
0x8832161aL, 0x8cf30badL, 0x81b02d74L, 0x857130c3L,
0x5d8a9099L, 0x594b8d2eL, 0x5408abf7L, 0x50c9b640L,
0x4e8ee645L, 0x4a4ffbf2L, 0x470cdd2bL, 0x43cdc09cL,
0x7b827d21L, 0x7f436096L, 0x7200464fL, 0x76c15bf8L,
0x68860bfdL, 0x6c47164aL, 0x61043093L, 0x65c52d24L,
0x119b4be9L, 0x155a565eL, 0x18197087L, 0x1cd86d30L,
0x029f3d35L, 0x065e2082L, 0x0b1d065bL, 0x0fdc1becL,
0x3793a651L, 0x3352bbe6L, 0x3e119d3fL, 0x3ad08088L,
0x2497d08dL, 0x2056cd3aL, 0x2d15ebe3L, 0x29d4f654L,
0xc5a92679L, 0xc1683bceL, 0xcc2b1d17L, 0xc8ea00a0L,
0xd6ad50a5L, 0xd26c4d12L, 0xdf2f6bcbL, 0xdbee767cL,
0xe3a1cbc1L, 0xe760d676L, 0xea23f0afL, 0xeee2ed18L,
0xf0a5bd1dL, 0xf464a0aaL, 0xf9278673L, 0xfde69bc4L,
0x89b8fd09L, 0x8d79e0beL, 0x803ac667L, 0x84fbdbd0L,
0x9abc8bd5L, 0x9e7d9662L, 0x933eb0bbL, 0x97ffad0cL,
0xafb010b1L, 0xab710d06L, 0xa6322bdfL, 0xa2f33668L,
0xbcb4666dL, 0xb8757bdaL, 0xb5365d03L, 0xb1f740b4L
};
/*-------------------------------------------------------------*/
/*--- end crctable.c ---*/
/*-------------------------------------------------------------*/

View File

@ -1,646 +0,0 @@
/*-------------------------------------------------------------*/
/*--- Decompression machinery ---*/
/*--- decompress.c ---*/
/*-------------------------------------------------------------*/
/* ------------------------------------------------------------------
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
This program is released under the terms of the license contained
in the file LICENSE.
------------------------------------------------------------------ */
#include "bzlib_private.h"
/*---------------------------------------------------*/
static
void makeMaps_d ( DState* s )
{
Int32 i;
s->nInUse = 0;
for (i = 0; i < 256; i++)
if (s->inUse[i]) {
s->seqToUnseq[s->nInUse] = i;
s->nInUse++;
}
}
/*---------------------------------------------------*/
#define RETURN(rrr) \
{ retVal = rrr; goto save_state_and_return; };
#define GET_BITS(lll,vvv,nnn) \
case lll: s->state = lll; \
while (True) { \
if (s->bsLive >= nnn) { \
UInt32 v; \
v = (s->bsBuff >> \
(s->bsLive-nnn)) & ((1 << nnn)-1); \
s->bsLive -= nnn; \
vvv = v; \
break; \
} \
if (s->strm->avail_in == 0) RETURN(BZ_OK); \
s->bsBuff \
= (s->bsBuff << 8) | \
((UInt32) \
(*((UChar*)(s->strm->next_in)))); \
s->bsLive += 8; \
s->strm->next_in++; \
s->strm->avail_in--; \
s->strm->total_in_lo32++; \
if (s->strm->total_in_lo32 == 0) \
s->strm->total_in_hi32++; \
}
#define GET_UCHAR(lll,uuu) \
GET_BITS(lll,uuu,8)
#define GET_BIT(lll,uuu) \
GET_BITS(lll,uuu,1)
/*---------------------------------------------------*/
#define GET_MTF_VAL(label1,label2,lval) \
{ \
if (groupPos == 0) { \
groupNo++; \
if (groupNo >= nSelectors) \
RETURN(BZ_DATA_ERROR); \
groupPos = BZ_G_SIZE; \
gSel = s->selector[groupNo]; \
gMinlen = s->minLens[gSel]; \
gLimit = &(s->limit[gSel][0]); \
gPerm = &(s->perm[gSel][0]); \
gBase = &(s->base[gSel][0]); \
} \
groupPos--; \
zn = gMinlen; \
GET_BITS(label1, zvec, zn); \
while (1) { \
if (zn > 20 /* the longest code */) \
RETURN(BZ_DATA_ERROR); \
if (zvec <= gLimit[zn]) break; \
zn++; \
GET_BIT(label2, zj); \
zvec = (zvec << 1) | zj; \
}; \
if (zvec - gBase[zn] < 0 \
|| zvec - gBase[zn] >= BZ_MAX_ALPHA_SIZE) \
RETURN(BZ_DATA_ERROR); \
lval = gPerm[zvec - gBase[zn]]; \
}
/*---------------------------------------------------*/
Int32 BZ2_decompress ( DState* s )
{
UChar uc;
Int32 retVal;
Int32 minLen, maxLen;
bz_stream* strm = s->strm;
/* stuff that needs to be saved/restored */
Int32 i;
Int32 j;
Int32 t;
Int32 alphaSize;
Int32 nGroups;
Int32 nSelectors;
Int32 EOB;
Int32 groupNo;
Int32 groupPos;
Int32 nextSym;
Int32 nblockMAX;
Int32 nblock;
Int32 es;
Int32 N;
Int32 curr;
Int32 zt;
Int32 zn;
Int32 zvec;
Int32 zj;
Int32 gSel;
Int32 gMinlen;
Int32* gLimit;
Int32* gBase;
Int32* gPerm;
if (s->state == BZ_X_MAGIC_1) {
/*initialise the save area*/
s->save_i = 0;
s->save_j = 0;
s->save_t = 0;
s->save_alphaSize = 0;
s->save_nGroups = 0;
s->save_nSelectors = 0;
s->save_EOB = 0;
s->save_groupNo = 0;
s->save_groupPos = 0;
s->save_nextSym = 0;
s->save_nblockMAX = 0;
s->save_nblock = 0;
s->save_es = 0;
s->save_N = 0;
s->save_curr = 0;
s->save_zt = 0;
s->save_zn = 0;
s->save_zvec = 0;
s->save_zj = 0;
s->save_gSel = 0;
s->save_gMinlen = 0;
s->save_gLimit = NULL;
s->save_gBase = NULL;
s->save_gPerm = NULL;
}
/*restore from the save area*/
i = s->save_i;
j = s->save_j;
t = s->save_t;
alphaSize = s->save_alphaSize;
nGroups = s->save_nGroups;
nSelectors = s->save_nSelectors;
EOB = s->save_EOB;
groupNo = s->save_groupNo;
groupPos = s->save_groupPos;
nextSym = s->save_nextSym;
nblockMAX = s->save_nblockMAX;
nblock = s->save_nblock;
es = s->save_es;
N = s->save_N;
curr = s->save_curr;
zt = s->save_zt;
zn = s->save_zn;
zvec = s->save_zvec;
zj = s->save_zj;
gSel = s->save_gSel;
gMinlen = s->save_gMinlen;
gLimit = s->save_gLimit;
gBase = s->save_gBase;
gPerm = s->save_gPerm;
retVal = BZ_OK;
switch (s->state) {
GET_UCHAR(BZ_X_MAGIC_1, uc);
if (uc != BZ_HDR_B) RETURN(BZ_DATA_ERROR_MAGIC);
GET_UCHAR(BZ_X_MAGIC_2, uc);
if (uc != BZ_HDR_Z) RETURN(BZ_DATA_ERROR_MAGIC);
GET_UCHAR(BZ_X_MAGIC_3, uc)
if (uc != BZ_HDR_h) RETURN(BZ_DATA_ERROR_MAGIC);
GET_BITS(BZ_X_MAGIC_4, s->blockSize100k, 8)
if (s->blockSize100k < (BZ_HDR_0 + 1) ||
s->blockSize100k > (BZ_HDR_0 + 9)) RETURN(BZ_DATA_ERROR_MAGIC);
s->blockSize100k -= BZ_HDR_0;
if (s->smallDecompress) {
s->ll16 = BZALLOC( s->blockSize100k * 100000 * sizeof(UInt16) );
s->ll4 = BZALLOC(
((1 + s->blockSize100k * 100000) >> 1) * sizeof(UChar)
);
if (s->ll16 == NULL || s->ll4 == NULL) RETURN(BZ_MEM_ERROR);
} else {
s->tt = BZALLOC( s->blockSize100k * 100000 * sizeof(Int32) );
if (s->tt == NULL) RETURN(BZ_MEM_ERROR);
}
GET_UCHAR(BZ_X_BLKHDR_1, uc);
if (uc == 0x17) goto endhdr_2;
if (uc != 0x31) RETURN(BZ_DATA_ERROR);
GET_UCHAR(BZ_X_BLKHDR_2, uc);
if (uc != 0x41) RETURN(BZ_DATA_ERROR);
GET_UCHAR(BZ_X_BLKHDR_3, uc);
if (uc != 0x59) RETURN(BZ_DATA_ERROR);
GET_UCHAR(BZ_X_BLKHDR_4, uc);
if (uc != 0x26) RETURN(BZ_DATA_ERROR);
GET_UCHAR(BZ_X_BLKHDR_5, uc);
if (uc != 0x53) RETURN(BZ_DATA_ERROR);
GET_UCHAR(BZ_X_BLKHDR_6, uc);
if (uc != 0x59) RETURN(BZ_DATA_ERROR);
s->currBlockNo++;
if (s->verbosity >= 2)
VPrintf1 ( "\n [%d: huff+mtf ", s->currBlockNo );
s->storedBlockCRC = 0;
GET_UCHAR(BZ_X_BCRC_1, uc);
s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc);
GET_UCHAR(BZ_X_BCRC_2, uc);
s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc);
GET_UCHAR(BZ_X_BCRC_3, uc);
s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc);
GET_UCHAR(BZ_X_BCRC_4, uc);
s->storedBlockCRC = (s->storedBlockCRC << 8) | ((UInt32)uc);
GET_BITS(BZ_X_RANDBIT, s->blockRandomised, 1);
s->origPtr = 0;
GET_UCHAR(BZ_X_ORIGPTR_1, uc);
s->origPtr = (s->origPtr << 8) | ((Int32)uc);
GET_UCHAR(BZ_X_ORIGPTR_2, uc);
s->origPtr = (s->origPtr << 8) | ((Int32)uc);
GET_UCHAR(BZ_X_ORIGPTR_3, uc);
s->origPtr = (s->origPtr << 8) | ((Int32)uc);
if (s->origPtr < 0)
RETURN(BZ_DATA_ERROR);
if (s->origPtr > 10 + 100000*s->blockSize100k)
RETURN(BZ_DATA_ERROR);
/*--- Receive the mapping table ---*/
for (i = 0; i < 16; i++) {
GET_BIT(BZ_X_MAPPING_1, uc);
if (uc == 1)
s->inUse16[i] = True; else
s->inUse16[i] = False;
}
for (i = 0; i < 256; i++) s->inUse[i] = False;
for (i = 0; i < 16; i++)
if (s->inUse16[i])
for (j = 0; j < 16; j++) {
GET_BIT(BZ_X_MAPPING_2, uc);
if (uc == 1) s->inUse[i * 16 + j] = True;
}
makeMaps_d ( s );
if (s->nInUse == 0) RETURN(BZ_DATA_ERROR);
alphaSize = s->nInUse+2;
/*--- Now the selectors ---*/
GET_BITS(BZ_X_SELECTOR_1, nGroups, 3);
if (nGroups < 2 || nGroups > 6) RETURN(BZ_DATA_ERROR);
GET_BITS(BZ_X_SELECTOR_2, nSelectors, 15);
if (nSelectors < 1) RETURN(BZ_DATA_ERROR);
for (i = 0; i < nSelectors; i++) {
j = 0;
while (True) {
GET_BIT(BZ_X_SELECTOR_3, uc);
if (uc == 0) break;
j++;
if (j >= nGroups) RETURN(BZ_DATA_ERROR);
}
s->selectorMtf[i] = j;
}
/*--- Undo the MTF values for the selectors. ---*/
{
UChar pos[BZ_N_GROUPS], tmp, v;
for (v = 0; v < nGroups; v++) pos[v] = v;
for (i = 0; i < nSelectors; i++) {
v = s->selectorMtf[i];
tmp = pos[v];
while (v > 0) { pos[v] = pos[v-1]; v--; }
pos[0] = tmp;
s->selector[i] = tmp;
}
}
/*--- Now the coding tables ---*/
for (t = 0; t < nGroups; t++) {
GET_BITS(BZ_X_CODING_1, curr, 5);
for (i = 0; i < alphaSize; i++) {
while (True) {
if (curr < 1 || curr > 20) RETURN(BZ_DATA_ERROR);
GET_BIT(BZ_X_CODING_2, uc);
if (uc == 0) break;
GET_BIT(BZ_X_CODING_3, uc);
if (uc == 0) curr++; else curr--;
}
s->len[t][i] = curr;
}
}
/*--- Create the Huffman decoding tables ---*/
for (t = 0; t < nGroups; t++) {
minLen = 32;
maxLen = 0;
for (i = 0; i < alphaSize; i++) {
if (s->len[t][i] > maxLen) maxLen = s->len[t][i];
if (s->len[t][i] < minLen) minLen = s->len[t][i];
}
BZ2_hbCreateDecodeTables (
&(s->limit[t][0]),
&(s->base[t][0]),
&(s->perm[t][0]),
&(s->len[t][0]),
minLen, maxLen, alphaSize
);
s->minLens[t] = minLen;
}
/*--- Now the MTF values ---*/
EOB = s->nInUse+1;
nblockMAX = 100000 * s->blockSize100k;
groupNo = -1;
groupPos = 0;
for (i = 0; i <= 255; i++) s->unzftab[i] = 0;
/*-- MTF init --*/
{
Int32 ii, jj, kk;
kk = MTFA_SIZE-1;
for (ii = 256 / MTFL_SIZE - 1; ii >= 0; ii--) {
for (jj = MTFL_SIZE-1; jj >= 0; jj--) {
s->mtfa[kk] = (UChar)(ii * MTFL_SIZE + jj);
kk--;
}
s->mtfbase[ii] = kk + 1;
}
}
/*-- end MTF init --*/
nblock = 0;
GET_MTF_VAL(BZ_X_MTF_1, BZ_X_MTF_2, nextSym);
while (True) {
if (nextSym == EOB) break;
if (nextSym == BZ_RUNA || nextSym == BZ_RUNB) {
es = -1;
N = 1;
do {
/* Check that N doesn't get too big, so that es doesn't
go negative. The maximum value that can be
RUNA/RUNB encoded is equal to the block size (post
the initial RLE), viz, 900k, so bounding N at 2
million should guard against overflow without
rejecting any legitimate inputs. */
if (N >= 2*1024*1024) RETURN(BZ_DATA_ERROR);
if (nextSym == BZ_RUNA) es = es + (0+1) * N; else
if (nextSym == BZ_RUNB) es = es + (1+1) * N;
N = N * 2;
GET_MTF_VAL(BZ_X_MTF_3, BZ_X_MTF_4, nextSym);
}
while (nextSym == BZ_RUNA || nextSym == BZ_RUNB);
es++;
uc = s->seqToUnseq[ s->mtfa[s->mtfbase[0]] ];
s->unzftab[uc] += es;
if (s->smallDecompress)
while (es > 0) {
if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR);
s->ll16[nblock] = (UInt16)uc;
nblock++;
es--;
}
else
while (es > 0) {
if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR);
s->tt[nblock] = (UInt32)uc;
nblock++;
es--;
};
continue;
} else {
if (nblock >= nblockMAX) RETURN(BZ_DATA_ERROR);
/*-- uc = MTF ( nextSym-1 ) --*/
{
Int32 ii, jj, kk, pp, lno, off;
UInt32 nn;
nn = (UInt32)(nextSym - 1);
if (nn < MTFL_SIZE) {
/* avoid general-case expense */
pp = s->mtfbase[0];
uc = s->mtfa[pp+nn];
while (nn > 3) {
Int32 z = pp+nn;
s->mtfa[(z) ] = s->mtfa[(z)-1];
s->mtfa[(z)-1] = s->mtfa[(z)-2];
s->mtfa[(z)-2] = s->mtfa[(z)-3];
s->mtfa[(z)-3] = s->mtfa[(z)-4];
nn -= 4;
}
while (nn > 0) {
s->mtfa[(pp+nn)] = s->mtfa[(pp+nn)-1]; nn--;
};
s->mtfa[pp] = uc;
} else {
/* general case */
lno = nn / MTFL_SIZE;
off = nn % MTFL_SIZE;
pp = s->mtfbase[lno] + off;
uc = s->mtfa[pp];
while (pp > s->mtfbase[lno]) {
s->mtfa[pp] = s->mtfa[pp-1]; pp--;
};
s->mtfbase[lno]++;
while (lno > 0) {
s->mtfbase[lno]--;
s->mtfa[s->mtfbase[lno]]
= s->mtfa[s->mtfbase[lno-1] + MTFL_SIZE - 1];
lno--;
}
s->mtfbase[0]--;
s->mtfa[s->mtfbase[0]] = uc;
if (s->mtfbase[0] == 0) {
kk = MTFA_SIZE-1;
for (ii = 256 / MTFL_SIZE-1; ii >= 0; ii--) {
for (jj = MTFL_SIZE-1; jj >= 0; jj--) {
s->mtfa[kk] = s->mtfa[s->mtfbase[ii] + jj];
kk--;
}
s->mtfbase[ii] = kk + 1;
}
}
}
}
/*-- end uc = MTF ( nextSym-1 ) --*/
s->unzftab[s->seqToUnseq[uc]]++;
if (s->smallDecompress)
s->ll16[nblock] = (UInt16)(s->seqToUnseq[uc]); else
s->tt[nblock] = (UInt32)(s->seqToUnseq[uc]);
nblock++;
GET_MTF_VAL(BZ_X_MTF_5, BZ_X_MTF_6, nextSym);
continue;
}
}
/* Now we know what nblock is, we can do a better sanity
check on s->origPtr.
*/
if (s->origPtr < 0 || s->origPtr >= nblock)
RETURN(BZ_DATA_ERROR);
/*-- Set up cftab to facilitate generation of T^(-1) --*/
/* Check: unzftab entries in range. */
for (i = 0; i <= 255; i++) {
if (s->unzftab[i] < 0 || s->unzftab[i] > nblock)
RETURN(BZ_DATA_ERROR);
}
/* Actually generate cftab. */
s->cftab[0] = 0;
for (i = 1; i <= 256; i++) s->cftab[i] = s->unzftab[i-1];
for (i = 1; i <= 256; i++) s->cftab[i] += s->cftab[i-1];
/* Check: cftab entries in range. */
for (i = 0; i <= 256; i++) {
if (s->cftab[i] < 0 || s->cftab[i] > nblock) {
/* s->cftab[i] can legitimately be == nblock */
RETURN(BZ_DATA_ERROR);
}
}
/* Check: cftab entries non-descending. */
for (i = 1; i <= 256; i++) {
if (s->cftab[i-1] > s->cftab[i]) {
RETURN(BZ_DATA_ERROR);
}
}
s->state_out_len = 0;
s->state_out_ch = 0;
BZ_INITIALISE_CRC ( s->calculatedBlockCRC );
s->state = BZ_X_OUTPUT;
if (s->verbosity >= 2) VPrintf0 ( "rt+rld" );
if (s->smallDecompress) {
/*-- Make a copy of cftab, used in generation of T --*/
for (i = 0; i <= 256; i++) s->cftabCopy[i] = s->cftab[i];
/*-- compute the T vector --*/
for (i = 0; i < nblock; i++) {
uc = (UChar)(s->ll16[i]);
SET_LL(i, s->cftabCopy[uc]);
s->cftabCopy[uc]++;
}
/*-- Compute T^(-1) by pointer reversal on T --*/
i = s->origPtr;
j = GET_LL(i);
do {
Int32 tmp = GET_LL(j);
SET_LL(j, i);
i = j;
j = tmp;
}
while (i != s->origPtr);
s->tPos = s->origPtr;
s->nblock_used = 0;
if (s->blockRandomised) {
BZ_RAND_INIT_MASK;
BZ_GET_SMALL(s->k0); s->nblock_used++;
BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK;
} else {
BZ_GET_SMALL(s->k0); s->nblock_used++;
}
} else {
/*-- compute the T^(-1) vector --*/
for (i = 0; i < nblock; i++) {
uc = (UChar)(s->tt[i] & 0xff);
s->tt[s->cftab[uc]] |= (i << 8);
s->cftab[uc]++;
}
s->tPos = s->tt[s->origPtr] >> 8;
s->nblock_used = 0;
if (s->blockRandomised) {
BZ_RAND_INIT_MASK;
BZ_GET_FAST(s->k0); s->nblock_used++;
BZ_RAND_UPD_MASK; s->k0 ^= BZ_RAND_MASK;
} else {
BZ_GET_FAST(s->k0); s->nblock_used++;
}
}
RETURN(BZ_OK);
endhdr_2:
GET_UCHAR(BZ_X_ENDHDR_2, uc);
if (uc != 0x72) RETURN(BZ_DATA_ERROR);
GET_UCHAR(BZ_X_ENDHDR_3, uc);
if (uc != 0x45) RETURN(BZ_DATA_ERROR);
GET_UCHAR(BZ_X_ENDHDR_4, uc);
if (uc != 0x38) RETURN(BZ_DATA_ERROR);
GET_UCHAR(BZ_X_ENDHDR_5, uc);
if (uc != 0x50) RETURN(BZ_DATA_ERROR);
GET_UCHAR(BZ_X_ENDHDR_6, uc);
if (uc != 0x90) RETURN(BZ_DATA_ERROR);
s->storedCombinedCRC = 0;
GET_UCHAR(BZ_X_CCRC_1, uc);
s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc);
GET_UCHAR(BZ_X_CCRC_2, uc);
s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc);
GET_UCHAR(BZ_X_CCRC_3, uc);
s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc);
GET_UCHAR(BZ_X_CCRC_4, uc);
s->storedCombinedCRC = (s->storedCombinedCRC << 8) | ((UInt32)uc);
s->state = BZ_X_IDLE;
RETURN(BZ_STREAM_END);
default: AssertH ( False, 4001 );
}
AssertH ( False, 4002 );
save_state_and_return:
s->save_i = i;
s->save_j = j;
s->save_t = t;
s->save_alphaSize = alphaSize;
s->save_nGroups = nGroups;
s->save_nSelectors = nSelectors;
s->save_EOB = EOB;
s->save_groupNo = groupNo;
s->save_groupPos = groupPos;
s->save_nextSym = nextSym;
s->save_nblockMAX = nblockMAX;
s->save_nblock = nblock;
s->save_es = es;
s->save_N = N;
s->save_curr = curr;
s->save_zt = zt;
s->save_zn = zn;
s->save_zvec = zvec;
s->save_zj = zj;
s->save_gSel = gSel;
s->save_gMinlen = gMinlen;
s->save_gLimit = gLimit;
s->save_gBase = gBase;
s->save_gPerm = gPerm;
return retVal;
}
/*-------------------------------------------------------------*/
/*--- end decompress.c ---*/
/*-------------------------------------------------------------*/

View File

@ -1,205 +0,0 @@
/*-------------------------------------------------------------*/
/*--- Huffman coding low-level stuff ---*/
/*--- huffman.c ---*/
/*-------------------------------------------------------------*/
/* ------------------------------------------------------------------
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
This program is released under the terms of the license contained
in the file LICENSE.
------------------------------------------------------------------ */
#include "bzlib_private.h"
/*---------------------------------------------------*/
#define WEIGHTOF(zz0) ((zz0) & 0xffffff00)
#define DEPTHOF(zz1) ((zz1) & 0x000000ff)
#define MYMAX(zz2,zz3) ((zz2) > (zz3) ? (zz2) : (zz3))
#define ADDWEIGHTS(zw1,zw2) \
(WEIGHTOF(zw1)+WEIGHTOF(zw2)) | \
(1 + MYMAX(DEPTHOF(zw1),DEPTHOF(zw2)))
#define UPHEAP(z) \
{ \
Int32 zz, tmp; \
zz = z; tmp = heap[zz]; \
while (weight[tmp] < weight[heap[zz >> 1]]) { \
heap[zz] = heap[zz >> 1]; \
zz >>= 1; \
} \
heap[zz] = tmp; \
}
#define DOWNHEAP(z) \
{ \
Int32 zz, yy, tmp; \
zz = z; tmp = heap[zz]; \
while (True) { \
yy = zz << 1; \
if (yy > nHeap) break; \
if (yy < nHeap && \
weight[heap[yy+1]] < weight[heap[yy]]) \
yy++; \
if (weight[tmp] < weight[heap[yy]]) break; \
heap[zz] = heap[yy]; \
zz = yy; \
} \
heap[zz] = tmp; \
}
/*---------------------------------------------------*/
void BZ2_hbMakeCodeLengths ( UChar *len,
Int32 *freq,
Int32 alphaSize,
Int32 maxLen )
{
/*--
Nodes and heap entries run from 1. Entry 0
for both the heap and nodes is a sentinel.
--*/
Int32 nNodes, nHeap, n1, n2, i, j, k;
Bool tooLong;
Int32 heap [ BZ_MAX_ALPHA_SIZE + 2 ];
Int32 weight [ BZ_MAX_ALPHA_SIZE * 2 ];
Int32 parent [ BZ_MAX_ALPHA_SIZE * 2 ];
for (i = 0; i < alphaSize; i++)
weight[i+1] = (freq[i] == 0 ? 1 : freq[i]) << 8;
while (True) {
nNodes = alphaSize;
nHeap = 0;
heap[0] = 0;
weight[0] = 0;
parent[0] = -2;
for (i = 1; i <= alphaSize; i++) {
parent[i] = -1;
nHeap++;
heap[nHeap] = i;
UPHEAP(nHeap);
}
AssertH( nHeap < (BZ_MAX_ALPHA_SIZE+2), 2001 );
while (nHeap > 1) {
n1 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1);
n2 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1);
nNodes++;
parent[n1] = parent[n2] = nNodes;
weight[nNodes] = ADDWEIGHTS(weight[n1], weight[n2]);
parent[nNodes] = -1;
nHeap++;
heap[nHeap] = nNodes;
UPHEAP(nHeap);
}
AssertH( nNodes < (BZ_MAX_ALPHA_SIZE * 2), 2002 );
tooLong = False;
for (i = 1; i <= alphaSize; i++) {
j = 0;
k = i;
while (parent[k] >= 0) { k = parent[k]; j++; }
len[i-1] = j;
if (j > maxLen) tooLong = True;
}
if (! tooLong) break;
/* 17 Oct 04: keep-going condition for the following loop used
to be 'i < alphaSize', which missed the last element,
theoretically leading to the possibility of the compressor
looping. However, this count-scaling step is only needed if
one of the generated Huffman code words is longer than
maxLen, which up to and including version 1.0.2 was 20 bits,
which is extremely unlikely. In version 1.0.3 maxLen was
changed to 17 bits, which has minimal effect on compression
ratio, but does mean this scaling step is used from time to
time, enough to verify that it works.
This means that bzip2-1.0.3 and later will only produce
Huffman codes with a maximum length of 17 bits. However, in
order to preserve backwards compatibility with bitstreams
produced by versions pre-1.0.3, the decompressor must still
handle lengths of up to 20. */
for (i = 1; i <= alphaSize; i++) {
j = weight[i] >> 8;
j = 1 + (j / 2);
weight[i] = j << 8;
}
}
}
/*---------------------------------------------------*/
void BZ2_hbAssignCodes ( Int32 *code,
UChar *length,
Int32 minLen,
Int32 maxLen,
Int32 alphaSize )
{
Int32 n, vec, i;
vec = 0;
for (n = minLen; n <= maxLen; n++) {
for (i = 0; i < alphaSize; i++)
if (length[i] == n) { code[i] = vec; vec++; };
vec <<= 1;
}
}
/*---------------------------------------------------*/
void BZ2_hbCreateDecodeTables ( Int32 *limit,
Int32 *base,
Int32 *perm,
UChar *length,
Int32 minLen,
Int32 maxLen,
Int32 alphaSize )
{
Int32 pp, i, j, vec;
pp = 0;
for (i = minLen; i <= maxLen; i++)
for (j = 0; j < alphaSize; j++)
if (length[j] == i) { perm[pp] = j; pp++; };
for (i = 0; i < BZ_MAX_CODE_LEN; i++) base[i] = 0;
for (i = 0; i < alphaSize; i++) base[length[i]+1]++;
for (i = 1; i < BZ_MAX_CODE_LEN; i++) base[i] += base[i-1];
for (i = 0; i < BZ_MAX_CODE_LEN; i++) limit[i] = 0;
vec = 0;
for (i = minLen; i <= maxLen; i++) {
vec += (base[i+1] - base[i]);
limit[i] = vec-1;
vec <<= 1;
}
for (i = minLen + 1; i <= maxLen; i++)
base[i] = ((limit[i-1] + 1) << 1) - base[i];
}
/*-------------------------------------------------------------*/
/*--- end huffman.c ---*/
/*-------------------------------------------------------------*/

View File

@ -1 +0,0 @@
#include "bzlib_private.h"

View File

@ -1,84 +0,0 @@
/*-------------------------------------------------------------*/
/*--- Table for randomising repetitive blocks ---*/
/*--- randtable.c ---*/
/*-------------------------------------------------------------*/
/* ------------------------------------------------------------------
This file is part of bzip2/libbzip2, a program and library for
lossless, block-sorting data compression.
bzip2/libbzip2 version 1.0.6 of 6 September 2010
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
This program is released under the terms of the license contained
in the file LICENSE.
------------------------------------------------------------------ */
#include "bzlib_private.h"
/*---------------------------------------------*/
Int32 BZ2_rNums[512] = {
619, 720, 127, 481, 931, 816, 813, 233, 566, 247,
985, 724, 205, 454, 863, 491, 741, 242, 949, 214,
733, 859, 335, 708, 621, 574, 73, 654, 730, 472,
419, 436, 278, 496, 867, 210, 399, 680, 480, 51,
878, 465, 811, 169, 869, 675, 611, 697, 867, 561,
862, 687, 507, 283, 482, 129, 807, 591, 733, 623,
150, 238, 59, 379, 684, 877, 625, 169, 643, 105,
170, 607, 520, 932, 727, 476, 693, 425, 174, 647,
73, 122, 335, 530, 442, 853, 695, 249, 445, 515,
909, 545, 703, 919, 874, 474, 882, 500, 594, 612,
641, 801, 220, 162, 819, 984, 589, 513, 495, 799,
161, 604, 958, 533, 221, 400, 386, 867, 600, 782,
382, 596, 414, 171, 516, 375, 682, 485, 911, 276,
98, 553, 163, 354, 666, 933, 424, 341, 533, 870,
227, 730, 475, 186, 263, 647, 537, 686, 600, 224,
469, 68, 770, 919, 190, 373, 294, 822, 808, 206,
184, 943, 795, 384, 383, 461, 404, 758, 839, 887,
715, 67, 618, 276, 204, 918, 873, 777, 604, 560,
951, 160, 578, 722, 79, 804, 96, 409, 713, 940,
652, 934, 970, 447, 318, 353, 859, 672, 112, 785,
645, 863, 803, 350, 139, 93, 354, 99, 820, 908,
609, 772, 154, 274, 580, 184, 79, 626, 630, 742,
653, 282, 762, 623, 680, 81, 927, 626, 789, 125,
411, 521, 938, 300, 821, 78, 343, 175, 128, 250,
170, 774, 972, 275, 999, 639, 495, 78, 352, 126,
857, 956, 358, 619, 580, 124, 737, 594, 701, 612,
669, 112, 134, 694, 363, 992, 809, 743, 168, 974,
944, 375, 748, 52, 600, 747, 642, 182, 862, 81,
344, 805, 988, 739, 511, 655, 814, 334, 249, 515,
897, 955, 664, 981, 649, 113, 974, 459, 893, 228,
433, 837, 553, 268, 926, 240, 102, 654, 459, 51,
686, 754, 806, 760, 493, 403, 415, 394, 687, 700,
946, 670, 656, 610, 738, 392, 760, 799, 887, 653,
978, 321, 576, 617, 626, 502, 894, 679, 243, 440,
680, 879, 194, 572, 640, 724, 926, 56, 204, 700,
707, 151, 457, 449, 797, 195, 791, 558, 945, 679,
297, 59, 87, 824, 713, 663, 412, 693, 342, 606,
134, 108, 571, 364, 631, 212, 174, 643, 304, 329,
343, 97, 430, 751, 497, 314, 983, 374, 822, 928,
140, 206, 73, 263, 980, 736, 876, 478, 430, 305,
170, 514, 364, 692, 829, 82, 855, 953, 676, 246,
369, 970, 294, 750, 807, 827, 150, 790, 288, 923,
804, 378, 215, 828, 592, 281, 565, 555, 710, 82,
896, 831, 547, 261, 524, 462, 293, 465, 502, 56,
661, 821, 976, 991, 658, 869, 905, 758, 745, 193,
768, 550, 608, 933, 378, 286, 215, 979, 792, 961,
61, 688, 793, 644, 986, 403, 106, 366, 905, 644,
372, 567, 466, 434, 645, 210, 389, 550, 919, 135,
780, 773, 635, 389, 707, 100, 626, 958, 165, 504,
920, 176, 193, 713, 857, 265, 203, 50, 668, 108,
645, 990, 626, 197, 510, 357, 358, 850, 858, 364,
936, 638
};
/*-------------------------------------------------------------*/
/*--- end randtable.c ---*/
/*-------------------------------------------------------------*/

View File

@ -13,6 +13,10 @@
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release MP Play|Win32">
<Configuration>Release MP Play</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release MP|Win32">
<Configuration>Release MP</Configuration>
<Platform>Win32</Platform>
@ -62,6 +66,12 @@
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release MP Play|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug MP Play|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
@ -93,6 +103,9 @@
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release MP|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release MP Play|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug MP Play|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
@ -149,6 +162,22 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release MP Play|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_LIB;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalIncludeDirectories>$(ProjectDir)..\include\</AdditionalIncludeDirectories>
<CompileAs>CompileAsCpp</CompileAs>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug MP Play|Win32'">
<ClCompile>
<PrecompiledHeader>

View File

@ -5,14 +5,11 @@ VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReGameDLL", "..\regamedll\msvc\ReGameDLL.vcxproj", "{70A2B904-B7DB-4C48-8DE0-AF567360D572}"
ProjectSection(ProjectDependencies) = postProject
{792DF067-9904-4579-99B9-46C17277ADE3} = {792DF067-9904-4579-99B9-46C17277ADE3}
{CEB94F7C-E459-4673-AABB-36E2074396C0} = {CEB94F7C-E459-4673-AABB-36E2074396C0}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cppunitlite", "..\dep\cppunitlite\msvc\cppunitlite.vcxproj", "{CEB94F7C-E459-4673-AABB-36E2074396C0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bzip2", "..\dep\bzip2\msvc\bzip2.vcxproj", "{792DF067-9904-4579-99B9-46C17277ADE3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gradle", "gradle", "{DB570330-2FEE-4C39-971B-340019B6E661}"
ProjectSection(SolutionItems) = preProject
..\build.gradle = ..\build.gradle
@ -27,6 +24,7 @@ Global
Debug MP|Win32 = Debug MP|Win32
Debug Play|Win32 = Debug Play|Win32
Debug|Win32 = Debug|Win32
Release MP Play|Win32 = Release MP Play|Win32
Release MP|Win32 = Release MP|Win32
Release Play|Win32 = Release Play|Win32
Release|Win32 = Release|Win32
@ -41,6 +39,8 @@ Global
{70A2B904-B7DB-4C48-8DE0-AF567360D572}.Debug Play|Win32.Build.0 = Debug Play|Win32
{70A2B904-B7DB-4C48-8DE0-AF567360D572}.Debug|Win32.ActiveCfg = Debug|Win32
{70A2B904-B7DB-4C48-8DE0-AF567360D572}.Debug|Win32.Build.0 = Debug|Win32
{70A2B904-B7DB-4C48-8DE0-AF567360D572}.Release MP Play|Win32.ActiveCfg = Release MP Play|Win32
{70A2B904-B7DB-4C48-8DE0-AF567360D572}.Release MP Play|Win32.Build.0 = Release MP Play|Win32
{70A2B904-B7DB-4C48-8DE0-AF567360D572}.Release MP|Win32.ActiveCfg = Release MP|Win32
{70A2B904-B7DB-4C48-8DE0-AF567360D572}.Release MP|Win32.Build.0 = Release MP|Win32
{70A2B904-B7DB-4C48-8DE0-AF567360D572}.Release Play|Win32.ActiveCfg = Release Play|Win32
@ -57,6 +57,8 @@ Global
{CEB94F7C-E459-4673-AABB-36E2074396C0}.Debug Play|Win32.Build.0 = Debug|Win32
{CEB94F7C-E459-4673-AABB-36E2074396C0}.Debug|Win32.ActiveCfg = Debug|Win32
{CEB94F7C-E459-4673-AABB-36E2074396C0}.Debug|Win32.Build.0 = Debug|Win32
{CEB94F7C-E459-4673-AABB-36E2074396C0}.Release MP Play|Win32.ActiveCfg = Release MP Play|Win32
{CEB94F7C-E459-4673-AABB-36E2074396C0}.Release MP Play|Win32.Build.0 = Release MP Play|Win32
{CEB94F7C-E459-4673-AABB-36E2074396C0}.Release MP|Win32.ActiveCfg = Release MP|Win32
{CEB94F7C-E459-4673-AABB-36E2074396C0}.Release MP|Win32.Build.0 = Release MP|Win32
{CEB94F7C-E459-4673-AABB-36E2074396C0}.Release Play|Win32.ActiveCfg = Release|Win32
@ -65,22 +67,6 @@ Global
{CEB94F7C-E459-4673-AABB-36E2074396C0}.Release|Win32.Build.0 = Release|Win32
{CEB94F7C-E459-4673-AABB-36E2074396C0}.Tests|Win32.ActiveCfg = Debug|Win32
{CEB94F7C-E459-4673-AABB-36E2074396C0}.Tests|Win32.Build.0 = Debug|Win32
{792DF067-9904-4579-99B9-46C17277ADE3}.Debug MP Play|Win32.ActiveCfg = Debug MP Play|Win32
{792DF067-9904-4579-99B9-46C17277ADE3}.Debug MP Play|Win32.Build.0 = Debug MP Play|Win32
{792DF067-9904-4579-99B9-46C17277ADE3}.Debug MP|Win32.ActiveCfg = Debug MP|Win32
{792DF067-9904-4579-99B9-46C17277ADE3}.Debug MP|Win32.Build.0 = Debug MP|Win32
{792DF067-9904-4579-99B9-46C17277ADE3}.Debug Play|Win32.ActiveCfg = Debug|Win32
{792DF067-9904-4579-99B9-46C17277ADE3}.Debug Play|Win32.Build.0 = Debug|Win32
{792DF067-9904-4579-99B9-46C17277ADE3}.Debug|Win32.ActiveCfg = Debug|Win32
{792DF067-9904-4579-99B9-46C17277ADE3}.Debug|Win32.Build.0 = Debug|Win32
{792DF067-9904-4579-99B9-46C17277ADE3}.Release MP|Win32.ActiveCfg = Release MP|Win32
{792DF067-9904-4579-99B9-46C17277ADE3}.Release MP|Win32.Build.0 = Release MP|Win32
{792DF067-9904-4579-99B9-46C17277ADE3}.Release Play|Win32.ActiveCfg = Release|Win32
{792DF067-9904-4579-99B9-46C17277ADE3}.Release Play|Win32.Build.0 = Release|Win32
{792DF067-9904-4579-99B9-46C17277ADE3}.Release|Win32.ActiveCfg = Release|Win32
{792DF067-9904-4579-99B9-46C17277ADE3}.Release|Win32.Build.0 = Release|Win32
{792DF067-9904-4579-99B9-46C17277ADE3}.Tests|Win32.ActiveCfg = Debug|Win32
{792DF067-9904-4579-99B9-46C17277ADE3}.Tests|Win32.Build.0 = Debug|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -46,7 +46,6 @@ dependencies {
}
project.ext.dep_bzip2 = project(':dep/bzip2')
project.ext.dep_cppunitlite = project(':dep/cppunitlite')
void createIntergrationTestTask(NativeBinarySpec b) {
@ -118,16 +117,13 @@ void setupToolchain(NativeBinarySpec b)
boolean regamedllFixes = b.flavor.name.contains('regamedllFixes')
ToolchainConfig cfg = rootProject.createToolchainConfig(b)
cfg.projectInclude(project, '', '/engine', '/common', '/dlls', '/game_shared', '/pm_shared', '/regamedll', '/testsuite', '/hookers', '/public', '/public/regamedll')
cfg.projectInclude(dep_bzip2, '/include')
if (unitTestExecutable)
{
cfg.projectInclude(dep_cppunitlite, '/include')
b.lib LazyNativeDepSet.create(dep_cppunitlite, 'cppunitlite', b.buildType.name, true)
}
b.lib LazyNativeDepSet.create(dep_bzip2, 'bzip2', b.buildType.name, true)
cfg.singleDefines 'USE_BREAKPAD_HANDLER', 'DEDICATED', 'REGAMEDLL_SELF', 'CLIENT_WEAPONS'
@ -155,7 +151,8 @@ void setupToolchain(NativeBinarySpec b)
cfg.projectLibpath(project, '/lib')
cfg.extraLibs 'steam_api.lib', 'psapi.lib', 'ws2_32.lib', 'kernel32.lib', 'user32.lib', 'advapi32.lib'
}
else if (cfg instanceof GccToolchainConfig) {
else if (cfg instanceof GccToolchainConfig)
{
cfg.compilerOptions.pchConfig = new GccToolchainConfig.PrecompilerHeaderOptions(
enabled: true,
pchSourceSet: 'regamedll_pch'
@ -179,7 +176,8 @@ void setupToolchain(NativeBinarySpec b)
cfg.extraLibs 'dl', 'm', 'stdc++', 'steam_api'
}
if (mpLib && GradleCppUtils.windows && !unitTestExecutable) {
if (mpLib && GradleCppUtils.windows && !unitTestExecutable)
{
cfg.linkerOptions.definitionFile = "${projectDir}\\msvc\\mp.def";
}
@ -221,6 +219,7 @@ class RegamedllSrc {
include "**/*.cpp"
exclude "precompiled.cpp"
exclude "tier0/dbg.cpp", "utlsymbol.cpp", "utlbuffer.cpp"
if (GradleCppUtils.windows) {
exclude "tier0/platform_linux.cpp"
@ -228,16 +227,12 @@ class RegamedllSrc {
exclude "tier0/platform_win32.cpp"
exclude "classes_dummy.cpp"
}
//exclude "interface.cpp"
}
source {
srcDirs "hookers"
include "**/*.cpp"
exclude "6153_hooker.cpp", "hooker.cpp", "main.cpp", "main_mp.cpp"
// if (!GradleCppUtils.windows)
// exclude "regamedll_debug.cpp"
exclude "6153_hooker.cpp", "hooker.cpp", "main.cpp", "main_mp.cpp", "hooker_impl.cpp"
}
}
}
@ -255,7 +250,7 @@ class RegamedllSrc {
h.regamedll_hooker_src(CppSourceSet) {
source {
srcDirs "hookers"
include "6153_hooker.cpp", "hooker.cpp"
include "6153_hooker.cpp", "hooker.cpp", "hooker_impl.cpp"
}
}
}

View File

@ -50,7 +50,7 @@ typedef struct cvar_s
int flags;
float value;
struct cvar_s *next;
} cvar_t;
/* size: 20, cachelines: 1, members: 5 */
#endif // CVARDEF_H

View File

@ -107,8 +107,7 @@ struct entity_state_s
vec3_t vuser2;
vec3_t vuser3;
vec3_t vuser4;
};/* size: 340, cachelines: 6, members: 62 */
};
typedef struct clientdata_s
{
@ -154,6 +153,5 @@ typedef struct clientdata_s
Vector vuser4;
} clientdata_t;
/* size: 476, cachelines: 8, members: 40 */
#endif // ENTITY_STATE_H

View File

@ -55,7 +55,7 @@ typedef vec_t vec3_t[3];
typedef vec_t vec4_t[4];
/* <42bac> ../common/mathlib.h:18 */
typedef int fixed16_t; /* size: 4 */
typedef int fixed16_t;
/* <42bb7> ../common/mathlib.h:60 */
typedef union DLONG_u

View File

@ -36,8 +36,8 @@ typedef struct
{
vec3_t normal;
float dist;
} pmplane_t;
/* size: 16, cachelines: 1, members: 2 */
typedef struct pmtrace_s
{
@ -51,7 +51,7 @@ typedef struct pmtrace_s
vec3_t deltavelocity; // Change in player's velocity caused by impact.
// Only run on server.
int hitgroup;
} pmtrace_t;
/* size: 68, cachelines: 2, members: 10 */
#endif // PMTRACE_H

View File

@ -38,7 +38,7 @@ typedef struct mstudioevent_s
int event;
int type;
char options[64];
} mstudioevent_t;
/* size: 76, cachelines: 2, members: 4 */
#endif // STUDIO_EVENT_H

View File

@ -52,6 +52,5 @@ typedef struct usercmd_s
vec3_t impact_position;
} usercmd_t;
/* size: 52, cachelines: 1, members: 12 */
#endif // USERCMD_H

View File

@ -59,6 +59,5 @@ typedef struct weapon_data_s
float fuser4;
} weapon_data_t;
/* size: 88, cachelines: 2, members: 22 */
#endif // WEAPONINFO_H

View File

@ -146,7 +146,6 @@ typedef struct
char *name;
} activity_map_t;
/* size: 8, cachelines: 1, members: 2 */
extern activity_map_t activity_map[];

View File

@ -10,10 +10,6 @@ TYPEDESCRIPTION CAirtank::m_SaveData[] =
DEFINE_FIELD(CAirtank, m_state, FIELD_INTEGER)
};
#else
TYPEDESCRIPTION IMPL_CLASS(CAirtank, m_SaveData)[1];
#endif // HOOK_GAMEDLL
/* <5329> ../cstrike/dlls/airtank.cpp:41 */
@ -23,7 +19,7 @@ LINK_ENTITY_TO_CLASS(item_airtank, CAirtank);
IMPLEMENT_SAVERESTORE(CAirtank, CGrenade);
/* <50dd> ../cstrike/dlls/airtank.cpp:50 */
void CAirtank::__MAKE_VHOOK(Spawn)(void)
void CAirtank::__MAKE_VHOOK(Spawn)()
{
Precache();
@ -46,7 +42,7 @@ void CAirtank::__MAKE_VHOOK(Spawn)(void)
}
/* <4fef> ../cstrike/dlls/airtank.cpp:71 */
void CAirtank::__MAKE_VHOOK(Precache)(void)
void CAirtank::__MAKE_VHOOK(Precache)()
{
PRECACHE_MODEL("models/w_oxygen.mdl");
PRECACHE_SOUND("doors/aliendoor3.wav");
@ -62,7 +58,7 @@ void CAirtank::__MAKE_VHOOK(Killed)(entvars_t *pevAttacker, int iGib)
}
/* <5016> ../cstrike/dlls/airtank.cpp:88 */
void CAirtank::TankThink(void)
void CAirtank::TankThink()
{
// Fire trigger
m_state = 1;
@ -85,42 +81,13 @@ void CAirtank::TankTouch(CBaseEntity *pOther)
}
// give player 12 more seconds of air
pOther->pev->air_finished = gpGlobals->time + 12;
pOther->pev->air_finished = gpGlobals->time + 12.0f;
// suit recharge sound
EMIT_SOUND(ENT(pev), CHAN_VOICE, "doors/aliendoor3.wav", VOL_NORM, ATTN_NORM);
// recharge airtank in 30 seconds
pev->nextthink = gpGlobals->time + 30;
pev->nextthink = gpGlobals->time + 30.0f;
m_state = 0;
SUB_UseTargets(this, USE_TOGGLE, 1);
}
#ifdef HOOK_GAMEDLL
void CAirtank::Spawn(void)
{
Spawn_();
}
void CAirtank::Precache(void)
{
Precache_();
}
int CAirtank::Save(CSave &save)
{
return Save_(save);
}
int CAirtank::Restore(CRestore &restore)
{
return Restore_(restore);
}
void CAirtank::Killed(entvars_t *pevAttacker, int iGib)
{
Killed_(pevAttacker, iGib);
}
#endif // HOOK_GAMEDLL

View File

@ -37,23 +37,21 @@ class CAirtank: public CGrenade
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual void Killed(entvars_t *pevAttacker, int iGib);
virtual int BloodColor(void)
{
return DONT_BLEED;
}
virtual int BloodColor() { return DONT_BLEED; }
public:
void EXPORT TankThink(void);
void EXPORT TankThink();
void EXPORT TankTouch(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Killed_(entvars_t *pevAttacker, int iGib);
@ -65,14 +63,6 @@ public:
private:
int m_state;
};
#ifdef HOOK_GAMEDLL
// linked objects
C_DLLEXPORT void item_airtank(entvars_t *pev);
#endif // HOOK_GAMEDLL
#endif // AIRTANK_H

View File

@ -1,7 +1,7 @@
#include "precompiled.h"
/* <a6c7> ../cstrike/dlls/ammo.cpp:16 */
void C9MMAmmo::__MAKE_VHOOK(Spawn)(void)
void C9MMAmmo::__MAKE_VHOOK(Spawn)()
{
Precache();
SET_MODEL(ENT(pev), "models/w_9mmclip.mdl");
@ -9,7 +9,7 @@ void C9MMAmmo::__MAKE_VHOOK(Spawn)(void)
}
/* <a3e2> ../cstrike/dlls/ammo.cpp:22 */
void C9MMAmmo::__MAKE_VHOOK(Precache)(void)
void C9MMAmmo::__MAKE_VHOOK(Precache)()
{
PRECACHE_MODEL("models/w_9mmclip.mdl");
PRECACHE_SOUND("items/9mmclip1.wav");
@ -31,7 +31,7 @@ BOOL C9MMAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
LINK_ENTITY_TO_CLASS(ammo_9mm, C9MMAmmo);
/* <a6a0> ../cstrike/dlls/ammo.cpp:42 */
void CBuckShotAmmo::__MAKE_VHOOK(Spawn)(void)
void CBuckShotAmmo::__MAKE_VHOOK(Spawn)()
{
Precache();
SET_MODEL(ENT(pev), "models/w_shotbox.mdl");
@ -39,7 +39,7 @@ void CBuckShotAmmo::__MAKE_VHOOK(Spawn)(void)
}
/* <a409> ../cstrike/dlls/ammo.cpp:48 */
void CBuckShotAmmo::__MAKE_VHOOK(Precache)(void)
void CBuckShotAmmo::__MAKE_VHOOK(Precache)()
{
PRECACHE_MODEL("models/w_shotbox.mdl");
PRECACHE_SOUND("items/9mmclip1.wav");
@ -61,7 +61,7 @@ BOOL CBuckShotAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
LINK_ENTITY_TO_CLASS(ammo_buckshot, CBuckShotAmmo);
/* <a679> ../cstrike/dlls/ammo.cpp:69 */
void C556NatoAmmo::__MAKE_VHOOK(Spawn)(void)
void C556NatoAmmo::__MAKE_VHOOK(Spawn)()
{
Precache();
SET_MODEL(ENT(pev), "models/w_9mmclip.mdl");
@ -69,7 +69,7 @@ void C556NatoAmmo::__MAKE_VHOOK(Spawn)(void)
}
/* <a430> ../cstrike/dlls/ammo.cpp:75 */
void C556NatoAmmo::__MAKE_VHOOK(Precache)(void)
void C556NatoAmmo::__MAKE_VHOOK(Precache)()
{
PRECACHE_MODEL("models/w_9mmclip.mdl");
PRECACHE_SOUND("items/9mmclip1.wav");
@ -91,7 +91,7 @@ BOOL C556NatoAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
LINK_ENTITY_TO_CLASS(ammo_556nato, C556NatoAmmo);
/* <a652> ../cstrike/dlls/ammo.cpp:95 */
void C556NatoBoxAmmo::__MAKE_VHOOK(Spawn)(void)
void C556NatoBoxAmmo::__MAKE_VHOOK(Spawn)()
{
Precache();
SET_MODEL(ENT(pev), "models/w_9mmclip.mdl");
@ -99,7 +99,7 @@ void C556NatoBoxAmmo::__MAKE_VHOOK(Spawn)(void)
}
/* <a457> ../cstrike/dlls/ammo.cpp:101 */
void C556NatoBoxAmmo::__MAKE_VHOOK(Precache)(void)
void C556NatoBoxAmmo::__MAKE_VHOOK(Precache)()
{
PRECACHE_MODEL("models/w_9mmclip.mdl");
PRECACHE_SOUND("items/9mmclip1.wav");
@ -121,7 +121,7 @@ BOOL C556NatoBoxAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
LINK_ENTITY_TO_CLASS(ammo_556natobox, C556NatoBoxAmmo);
/* <a62b> ../cstrike/dlls/ammo.cpp:121 */
void C762NatoAmmo::__MAKE_VHOOK(Spawn)(void)
void C762NatoAmmo::__MAKE_VHOOK(Spawn)()
{
Precache();
SET_MODEL(ENT(pev), "models/w_9mmclip.mdl");
@ -129,7 +129,7 @@ void C762NatoAmmo::__MAKE_VHOOK(Spawn)(void)
}
/* <a47e> ../cstrike/dlls/ammo.cpp:127 */
void C762NatoAmmo::__MAKE_VHOOK(Precache)(void)
void C762NatoAmmo::__MAKE_VHOOK(Precache)()
{
PRECACHE_MODEL("models/w_9mmclip.mdl");
PRECACHE_SOUND("items/9mmclip1.wav");
@ -151,7 +151,7 @@ BOOL C762NatoAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
LINK_ENTITY_TO_CLASS(ammo_762nato, C762NatoAmmo);
/* <a604> ../cstrike/dlls/ammo.cpp:147 */
void C45ACPAmmo::__MAKE_VHOOK(Spawn)(void)
void C45ACPAmmo::__MAKE_VHOOK(Spawn)()
{
Precache();
SET_MODEL(ENT(pev), "models/w_9mmclip.mdl");
@ -159,7 +159,7 @@ void C45ACPAmmo::__MAKE_VHOOK(Spawn)(void)
}
/* <a4a5> ../cstrike/dlls/ammo.cpp:153 */
void C45ACPAmmo::__MAKE_VHOOK(Precache)(void)
void C45ACPAmmo::__MAKE_VHOOK(Precache)()
{
PRECACHE_MODEL("models/w_9mmclip.mdl");
PRECACHE_SOUND("items/9mmclip1.wav");
@ -181,7 +181,7 @@ BOOL C45ACPAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
LINK_ENTITY_TO_CLASS(ammo_45acp, C45ACPAmmo);
/* <a5dd> ../cstrike/dlls/ammo.cpp:173 */
void C50AEAmmo::__MAKE_VHOOK(Spawn)(void)
void C50AEAmmo::__MAKE_VHOOK(Spawn)()
{
Precache();
SET_MODEL(ENT(pev), "models/w_9mmclip.mdl");
@ -189,7 +189,7 @@ void C50AEAmmo::__MAKE_VHOOK(Spawn)(void)
}
/* <a4cc> ../cstrike/dlls/ammo.cpp:179 */
void C50AEAmmo::__MAKE_VHOOK(Precache)(void)
void C50AEAmmo::__MAKE_VHOOK(Precache)()
{
PRECACHE_MODEL("models/w_9mmclip.mdl");
PRECACHE_SOUND("items/9mmclip1.wav");
@ -211,7 +211,7 @@ BOOL C50AEAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
LINK_ENTITY_TO_CLASS(ammo_50ae, C50AEAmmo);
/* <a5b6> ../cstrike/dlls/ammo.cpp:199 */
void C338MagnumAmmo::__MAKE_VHOOK(Spawn)(void)
void C338MagnumAmmo::__MAKE_VHOOK(Spawn)()
{
Precache();
SET_MODEL(ENT(pev), "models/w_9mmclip.mdl");
@ -219,7 +219,7 @@ void C338MagnumAmmo::__MAKE_VHOOK(Spawn)(void)
}
/* <a4f3> ../cstrike/dlls/ammo.cpp:205 */
void C338MagnumAmmo::__MAKE_VHOOK(Precache)(void)
void C338MagnumAmmo::__MAKE_VHOOK(Precache)()
{
PRECACHE_MODEL("models/w_9mmclip.mdl");
PRECACHE_SOUND("items/9mmclip1.wav");
@ -241,7 +241,7 @@ BOOL C338MagnumAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
LINK_ENTITY_TO_CLASS(ammo_338magnum, C338MagnumAmmo);
/* <a58f> ../cstrike/dlls/ammo.cpp:226 */
void C57MMAmmo::__MAKE_VHOOK(Spawn)(void)
void C57MMAmmo::__MAKE_VHOOK(Spawn)()
{
Precache();
SET_MODEL(ENT(pev), "models/w_9mmclip.mdl");
@ -249,7 +249,7 @@ void C57MMAmmo::__MAKE_VHOOK(Spawn)(void)
}
/* <a51a> ../cstrike/dlls/ammo.cpp:232 */
void C57MMAmmo::__MAKE_VHOOK(Precache)(void)
void C57MMAmmo::__MAKE_VHOOK(Precache)()
{
PRECACHE_MODEL("models/w_9mmclip.mdl");
PRECACHE_SOUND("items/9mmclip1.wav");
@ -271,7 +271,7 @@ BOOL C57MMAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
LINK_ENTITY_TO_CLASS(ammo_57mm, C57MMAmmo);
/* <a568> ../cstrike/dlls/ammo.cpp:251 */
void C357SIGAmmo::__MAKE_VHOOK(Spawn)(void)
void C357SIGAmmo::__MAKE_VHOOK(Spawn)()
{
Precache();
SET_MODEL(ENT(pev), "models/w_9mmclip.mdl");
@ -279,7 +279,7 @@ void C357SIGAmmo::__MAKE_VHOOK(Spawn)(void)
}
/* <a541> ../cstrike/dlls/ammo.cpp:257 */
void C357SIGAmmo::__MAKE_VHOOK(Precache)(void)
void C357SIGAmmo::__MAKE_VHOOK(Precache)()
{
PRECACHE_MODEL("models/w_9mmclip.mdl");
PRECACHE_SOUND("items/9mmclip1.wav");
@ -299,157 +299,3 @@ BOOL C357SIGAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
/* <b403> ../cstrike/dlls/ammo.cpp:272 */
LINK_ENTITY_TO_CLASS(ammo_357sig, C357SIGAmmo);
#ifdef HOOK_GAMEDLL
void C9MMAmmo::Spawn(void)
{
Spawn_();
}
void C9MMAmmo::Precache(void)
{
Precache_();
}
BOOL C9MMAmmo::AddAmmo(CBaseEntity *pOther)
{
return AddAmmo_(pOther);
}
void CBuckShotAmmo::Spawn(void)
{
Spawn_();
}
void CBuckShotAmmo::Precache(void)
{
Precache_();
}
BOOL CBuckShotAmmo::AddAmmo(CBaseEntity *pOther)
{
return AddAmmo_(pOther);
}
void C556NatoAmmo::Spawn(void)
{
Spawn_();
}
void C556NatoAmmo::Precache(void)
{
Precache_();
}
BOOL C556NatoAmmo::AddAmmo(CBaseEntity *pOther)
{
return AddAmmo_(pOther);
}
void C556NatoBoxAmmo::Spawn(void)
{
Spawn_();
}
void C556NatoBoxAmmo::Precache(void)
{
Precache_();
}
BOOL C556NatoBoxAmmo::AddAmmo(CBaseEntity *pOther)
{
return AddAmmo_(pOther);
}
void C762NatoAmmo::Spawn(void)
{
Spawn_();
}
void C762NatoAmmo::Precache(void)
{
Precache_();
}
BOOL C762NatoAmmo::AddAmmo(CBaseEntity *pOther)
{
return AddAmmo_(pOther);
}
void C45ACPAmmo::Spawn(void)
{
Spawn_();
}
void C45ACPAmmo::Precache(void)
{
Precache_();
}
BOOL C45ACPAmmo::AddAmmo(CBaseEntity *pOther)
{
return AddAmmo_(pOther);
}
void C50AEAmmo::Spawn(void)
{
Spawn_();
}
void C50AEAmmo::Precache(void)
{
Precache_();
}
BOOL C50AEAmmo::AddAmmo(CBaseEntity *pOther)
{
return AddAmmo_(pOther);
}
void C338MagnumAmmo::Spawn(void)
{
Spawn_();
}
void C338MagnumAmmo::Precache(void)
{
Precache_();
}
BOOL C338MagnumAmmo::AddAmmo(CBaseEntity *pOther)
{
return AddAmmo_(pOther);
}
void C57MMAmmo::Spawn(void)
{
Spawn_();
}
void C57MMAmmo::Precache(void)
{
Precache_();
}
BOOL C57MMAmmo::AddAmmo(CBaseEntity *pOther)
{
return AddAmmo_(pOther);
}
void C357SIGAmmo::Spawn(void)
{
Spawn_();
}
void C357SIGAmmo::Precache(void)
{
Precache_();
}
BOOL C357SIGAmmo::AddAmmo(CBaseEntity *pOther)
{
return AddAmmo_(pOther);
}
#endif // HOOK_GAMEDLL

View File

@ -36,196 +36,180 @@
class C9MMAmmo: public CBasePlayerAmmo
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
BOOL AddAmmo_(CBaseEntity *pOther);
#endif // HOOK_GAMEDLL
};/* size: 152, cachelines: 3, members: 1 */
};
/* <97df> ../cstrike/dlls/ammo.cpp:40 */
class CBuckShotAmmo: public CBasePlayerAmmo
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
BOOL AddAmmo_(CBaseEntity *pOther);
#endif // HOOK_GAMEDLL
};/* size: 152, cachelines: 3, members: 1 */
};
/* <982c> ../cstrike/dlls/ammo.cpp:67 */
class C556NatoAmmo: public CBasePlayerAmmo
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
BOOL AddAmmo_(CBaseEntity *pOther);
#endif // HOOK_GAMEDLL
};/* size: 152, cachelines: 3, members: 1 */
};
/* <9879> ../cstrike/dlls/ammo.cpp:93 */
class C556NatoBoxAmmo: public CBasePlayerAmmo
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
BOOL AddAmmo_(CBaseEntity *pOther);
#endif // HOOK_GAMEDLL
};/* size: 152, cachelines: 3, members: 1 */
};
/* <98c6> ../cstrike/dlls/ammo.cpp:119 */
class C762NatoAmmo: public CBasePlayerAmmo
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
BOOL AddAmmo_(CBaseEntity *pOther);
#endif // HOOK_GAMEDLL
};/* size: 152, cachelines: 3, members: 1 */
};
/* <9913> ../cstrike/dlls/ammo.cpp:145 */
class C45ACPAmmo: public CBasePlayerAmmo
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
BOOL AddAmmo_(CBaseEntity *pOther);
#endif // HOOK_GAMEDLL
};/* size: 152, cachelines: 3, members: 1 */
};
/* <9960> ../cstrike/dlls/ammo.cpp:171 */
class C50AEAmmo: public CBasePlayerAmmo
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
BOOL AddAmmo_(CBaseEntity *pOther);
#endif // HOOK_GAMEDLL
};/* size: 152, cachelines: 3, members: 1 */
};
/* <99ad> ../cstrike/dlls/ammo.cpp:197 */
class C338MagnumAmmo: public CBasePlayerAmmo
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
BOOL AddAmmo_(CBaseEntity *pOther);
#endif // HOOK_GAMEDLL
};/* size: 152, cachelines: 3, members: 1 */
};
/* <99fa> ../cstrike/dlls/ammo.cpp:224 */
class C57MMAmmo: public CBasePlayerAmmo
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
BOOL AddAmmo_(CBaseEntity *pOther);
#endif // HOOK_GAMEDLL
};/* size: 152, cachelines: 3, members: 1 */
};
/* <9a47> ../cstrike/dlls/ammo.cpp:249 */
class C357SIGAmmo: public CBasePlayerAmmo
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
BOOL AddAmmo_(CBaseEntity *pOther);
#endif // HOOK_GAMEDLL
};/* size: 152, cachelines: 3, members: 1 */
#ifdef HOOK_GAMEDLL
// linked objects
C_DLLEXPORT void ammo_9mm(entvars_t *pev);
C_DLLEXPORT void ammo_buckshot(entvars_t *pev);
C_DLLEXPORT void ammo_556nato(entvars_t *pev);
C_DLLEXPORT void ammo_556natobox(entvars_t *pev);
C_DLLEXPORT void ammo_762nato(entvars_t *pev);
C_DLLEXPORT void ammo_45acp(entvars_t *pev);
C_DLLEXPORT void ammo_50ae(entvars_t *pev);
C_DLLEXPORT void ammo_338magnum(entvars_t *pev);
C_DLLEXPORT void ammo_57mm(entvars_t *pev);
C_DLLEXPORT void ammo_357sig(entvars_t *pev);
#endif // HOOK_GAMEDLL
};
#endif // AMMO_H

View File

@ -14,10 +14,6 @@ TYPEDESCRIPTION CBaseAnimating::m_SaveData[] =
DEFINE_FIELD(CBaseMonster, m_fSequenceLoops, FIELD_BOOLEAN),
};
#else
TYPEDESCRIPTION IMPL_CLASS(CBaseAnimating, m_SaveData)[5];
#endif // HOOK_GAMEDLL
/* <10583> ../cstrike/dlls/animating.cpp:38 */
@ -112,7 +108,7 @@ int CBaseAnimating::LookupSequence(const char *label)
}
/* <10711> ../cstrike/dlls/animating.cpp:110 */
void CBaseAnimating::ResetSequenceInfo(void)
void CBaseAnimating::ResetSequenceInfo()
{
void *pmodel = GET_MODEL_PTR(ENT(pev));
@ -126,7 +122,7 @@ void CBaseAnimating::ResetSequenceInfo(void)
}
/* <1077c> ../cstrike/dlls/animating.cpp:126 */
BOOL CBaseAnimating::GetSequenceFlags(void)
BOOL CBaseAnimating::GetSequenceFlags()
{
void *pmodel = GET_MODEL_PTR(ENT(pev));
return ::GetSequenceFlags(pmodel, pev);
@ -141,7 +137,7 @@ float CBaseAnimating::SetBoneController(int iController, float flValue)
}
/* <10893> ../cstrike/dlls/animating.cpp:180 */
void CBaseAnimating::InitBoneControllers(void)
void CBaseAnimating::InitBoneControllers()
{
void *pmodel = GET_MODEL_PTR(ENT(pev));
@ -214,7 +210,7 @@ int CBaseAnimating::ExtractBbox(int sequence, float *mins, float *maxs)
}
/* <10b99> ../cstrike/dlls/animating.cpp:258 */
void CBaseAnimating::SetSequenceBox(void)
void CBaseAnimating::SetSequenceBox()
{
Vector mins, maxs;
@ -280,17 +276,3 @@ void CBaseAnimating::SetSequenceBox(void)
UTIL_SetSize(pev, rmin, rmax);
}
}
#ifdef HOOK_GAMEDLL
int CBaseAnimating::Save(CSave &save)
{
return Save_(save);
}
int CBaseAnimating::Restore(CRestore &restore)
{
return Restore_(restore);
}
#endif // HOOK_GAMEDLL

View File

@ -11,10 +11,6 @@ sv_blending_interface_t svBlending =
SV_StudioSetupBones
};
#else
sv_blending_interface_t svBlending;
#endif // HOOK_GAMEDLL
server_studio_api_t IEngineStudio;
@ -23,12 +19,6 @@ studiohdr_t *g_pstudiohdr;
float (*g_pRotationMatrix)[3][4];
float (*g_pBoneTransform)[128][3][4];
float omega;
float cosom;
float sinom;
float sclp;
float sclq;
/* <1523e> ../cstrike/dlls/animation.cpp:57 */
int ExtractBbox(void *pmodel, int sequence, float *mins, float *maxs)
{
@ -657,7 +647,8 @@ void QuaternionSlerp(vec_t *p, vec_t *q, float t, vec_t *qt)
q[i] = -q[i];
}
cosom = (p[0] * q[0] + p[1] * q[1] + p[2] * q[2] + p[3] * q[3]);
float sclp, sclq;
float cosom = (p[0] * q[0] + p[1] * q[1] + p[2] * q[2] + p[3] * q[3]);
if ((1.0 + cosom) > 0.00000001)
{
@ -665,8 +656,8 @@ void QuaternionSlerp(vec_t *p, vec_t *q, float t, vec_t *qt)
{
float_precision cosomega = acos((float_precision)cosom);
omega = cosomega;
sinom = sin(cosomega);
float omega = cosomega;
float sinom = sin(cosomega);
sclp = sin((1.0 - t) * omega) / sinom;
sclq = sin((float_precision)(omega * t)) / sinom;
@ -1040,8 +1031,8 @@ void SV_StudioSetupBones(model_t *pModel, float frame, int sequence, const vec_t
int chainlength;
vec3_t temp_angles;
static float pos[MAXSTUDIOBONES][3], pos2[MAXSTUDIOBONES][3];
static float q[MAXSTUDIOBONES][4], q2[MAXSTUDIOBONES][4];
/*static */float pos[MAXSTUDIOBONES][3], pos2[MAXSTUDIOBONES][3];
/*static */float q[MAXSTUDIOBONES][4], q2[MAXSTUDIOBONES][4];
g_pstudiohdr = (studiohdr_t *)IEngineStudio.Mod_Extradata(pModel);
@ -1095,8 +1086,8 @@ void SV_StudioSetupBones(model_t *pModel, float frame, int sequence, const vec_t
// This game knows how to do nine way blending
else
{
static float pos3[MAXSTUDIOBONES][3], pos4[MAXSTUDIOBONES][3];
static float q3[MAXSTUDIOBONES][4], q4[MAXSTUDIOBONES][4];
/*static */float pos3[MAXSTUDIOBONES][3], pos4[MAXSTUDIOBONES][3];
/*static */float q3[MAXSTUDIOBONES][4], q4[MAXSTUDIOBONES][4];
float_precision s, t;

View File

@ -69,30 +69,4 @@ void StudioCalcRotations(mstudiobone_t *pbones, int *chain, int chainlength, flo
void ConcatTransforms(float in1[3][4], float in2[3][4], float out[3][4]);
void SV_StudioSetupBones(model_t *pModel, float frame, int sequence, const vec_t *angles, const vec_t *origin, const byte *pcontroller, const byte *pblending, int iBone, const edict_t *pEdict);
#ifdef HOOK_GAMEDLL
#define svBlending (*psvBlending)
#define IEngineStudio (*pIEngineStudio)
#define g_pstudiohdr (*pg_pstudiohdr)
#define g_pRotationMatrix (*pg_pRotationMatrix)
#define g_pBoneTransform (*pg_pBoneTransform)
#define omega (*pomega)
#define cosom (*pcosom)
#define sinom (*psinom)
#define sclp (*psclp)
#define sclq (*psclq)
#endif // HOOK_GAMEDLL
extern struct sv_blending_interface_s svBlending;
extern server_studio_api_t IEngineStudio;
extern studiohdr_t *g_pstudiohdr;
extern float (*g_pRotationMatrix)[3][4];
extern float (*g_pBoneTransform)[128][3][4];
extern float omega;
extern float cosom;
extern float sinom;
extern float sclp;
extern float sclq;
#endif // ANIMATION_H

View File

@ -47,29 +47,23 @@ public:
virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
virtual int TakeHealth(float flHealth, int bitsDamageType);
virtual void Killed(entvars_t *pevAttacker, int iGib);
virtual int BloodColor(void)
{
return m_bloodColor;
}
virtual BOOL IsAlive(void)
{
return (pev->deadflag != DEAD_DEAD);
}
virtual int BloodColor() { return m_bloodColor; }
virtual BOOL IsAlive() { return (pev->deadflag != DEAD_DEAD); }
virtual float ChangeYaw(int speed);
virtual BOOL HasHumanGibs(void);
virtual BOOL HasAlienGibs(void);
virtual void FadeMonster(void);
virtual void GibMonster(void);
NOXREF virtual Activity GetDeathActivity(void);
virtual void BecomeDead(void);
virtual BOOL ShouldFadeOnDeath(void);
virtual BOOL HasHumanGibs();
virtual BOOL HasAlienGibs();
virtual void FadeMonster();
virtual void GibMonster();
NOXREF virtual Activity GetDeathActivity();
virtual void BecomeDead();
virtual BOOL ShouldFadeOnDeath();
virtual int IRelationship(CBaseEntity *pTarget);
virtual void PainSound(void) {}
virtual void ResetMaxSpeed(void) {}
virtual void ReportAIState(void) {}
virtual void MonsterInitDead(void);
virtual void PainSound() {}
virtual void ResetMaxSpeed() {}
virtual void ReportAIState() {}
virtual void MonsterInitDead();
virtual void Look(int iDistance);
virtual CBaseEntity *BestVisibleEnemy(void);
virtual CBaseEntity *BestVisibleEnemy();
virtual BOOL FInViewCone(CBaseEntity *pEntity);
virtual BOOL FInViewCone(const Vector *pOrigin);
@ -81,17 +75,17 @@ public:
int TakeHealth_(float flHealth, int bitsDamageType);
void Killed_(entvars_t *pevAttacker, int iGib);
float ChangeYaw_(int speed);
BOOL HasHumanGibs_(void);
BOOL HasAlienGibs_(void);
void FadeMonster_(void);
void GibMonster_(void);
Activity GetDeathActivity_(void);
void BecomeDead_(void);
BOOL ShouldFadeOnDeath_(void);
BOOL HasHumanGibs_();
BOOL HasAlienGibs_();
void FadeMonster_();
void GibMonster_();
Activity GetDeathActivity_();
void BecomeDead_();
BOOL ShouldFadeOnDeath_();
int IRelationship_(CBaseEntity *pTarget);
void MonsterInitDead_(void);
void MonsterInitDead_();
void Look_(int iDistance);
CBaseEntity *BestVisibleEnemy_(void);
CBaseEntity *BestVisibleEnemy_();
BOOL FInViewCone_(CBaseEntity *pEntity);
BOOL FInViewCone_(const Vector *pOrigin);
@ -99,10 +93,10 @@ public:
public:
void MakeIdealYaw(Vector vecTarget);
NOXREF Activity GetSmallFlinchActivity(void);
NOXREF Activity GetSmallFlinchActivity();
BOOL ShouldGibMonster(int iGib);
void CallGibMonster(void);
BOOL FCheckAITrigger(void);
void CallGibMonster();
BOOL FCheckAITrigger();
int DeadTakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
float DamageForce(float damage);
void RadiusDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int iClassIgnore, int bitsDamageType);
@ -111,65 +105,22 @@ public:
{
::RadiusDamage2(vecSrc, pevInflictor, pevAttacker, flDamage, flDamage * (RANDOM_FLOAT(0.5, 1.5) + 3), iClassIgnore, bitsDamageType);
}
void SetConditions(int iConditions)
{
m_afConditions |= iConditions;
}
void ClearConditions(int iConditions)
{
m_afConditions &= ~iConditions;
}
BOOL HasConditions(int iConditions)
{
if (m_afConditions & iConditions)
{
return TRUE;
}
return FALSE;
}
BOOL HasAllConditions(int iConditions)
{
if ((m_afConditions & iConditions) == iConditions)
{
return TRUE;
}
return FALSE;
}
void Remember(int iMemory)
{
m_afMemory |= iMemory;
}
void Forget(int iMemory)
{
m_afMemory &= ~iMemory;
}
BOOL HasMemory(int iMemory)
{
if (m_afMemory & iMemory)
{
return TRUE;
}
return FALSE;
}
BOOL HasAllMemories(int iMemory)
{
if ((m_afMemory & iMemory) == iMemory)
{
return TRUE;
}
return FALSE;
}
void StopAnimation(void)
{
pev->framerate = 0.0;
}
NOXREF void CorpseFallThink(void);
void SetConditions(int iConditions) { m_afConditions |= iConditions; }
void ClearConditions(int iConditions) { m_afConditions &= ~iConditions; }
BOOL HasConditions(int iConditions) { return (m_afConditions & iConditions) ? TRUE : FALSE; }
BOOL HasAllConditions(int iConditions) { return ((m_afConditions & iConditions) == iConditions) ? TRUE : FALSE; }
void Remember(int iMemory) { m_afMemory |= iMemory; }
void Forget(int iMemory) { m_afMemory &= ~iMemory; }
BOOL HasMemory(int iMemory) { return (m_afMemory & iMemory) ? TRUE : FALSE; }
BOOL HasAllMemories(int iMemory) { return ((m_afMemory & iMemory) == iMemory) ? TRUE : FALSE; }
void StopAnimation() { pev->framerate = 0.0f; }
NOXREF void CorpseFallThink();
NOXREF CBaseEntity *CheckTraceHullAttack(float flDist, int iDamage, int iDmgType);
NOXREF void MakeDamageBloodDecal(int cCount, float flNoise, TraceResult *ptr, Vector &vecDir);
void MonsterUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
m_IdealMonsterState = MONSTERSTATE_ALERT;
}
void MonsterUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { m_IdealMonsterState = MONSTERSTATE_ALERT; }
void BloodSplat(const Vector &vecSrc, const Vector &vecDir, int HitLocation, int iVelocity);
public:
@ -178,10 +129,12 @@ public:
int m_LastHitGroup; // the last body region that took damage
int m_bitsDamageType; // what types of damage has monster (player) taken
BYTE m_rgbTimeBasedDamage[8];
MONSTERSTATE m_MonsterState; // monster's current state
MONSTERSTATE m_IdealMonsterState; // monster should change to this state
int m_afConditions;
int m_afMemory;
float m_flNextAttack; // cannot attack again until this time
EHANDLE m_hEnemy; // the entity that the monster is fighting.
EHANDLE m_hTargetEnt; // the entity that the monster is trying to reach
@ -189,17 +142,6 @@ public:
int m_bloodColor; // color of blood particless
Vector m_HackedGunPos; // HACK until we can query end of gun
Vector m_vecEnemyLKP; // last known position of enemy. (enemy's origin)
};/* size: 404, cachelines: 7, members: 17 */
#ifdef HOOK_GAMEDLL
typedef void (CBaseMonster::*RADIUSDAMAGE_ENTVARS)(entvars_t *, entvars_t *, float, int, int);
typedef void (CBaseMonster::*RADIUSDAMAGE_VECTOR)(Vector, entvars_t *, entvars_t *, float, int, int);
typedef BOOL (CBaseMonster::*FINVIEWCONE_ENTITY)(CBaseEntity *);
typedef BOOL (CBaseMonster::*FINVIEWCONE_VECTOR)(const Vector *);
#endif // HOOK_GAMEDLL
};
#endif // BASEMONSTER_H

View File

@ -26,11 +26,6 @@ TYPEDESCRIPTION CPendulum::m_SaveData[] =
DEFINE_FIELD(CPendulum, m_start, FIELD_VECTOR),
};
#else
TYPEDESCRIPTION IMPL_CLASS(CFuncRotating, m_SaveData)[5];
TYPEDESCRIPTION IMPL_CLASS(CPendulum, m_SaveData)[8];
#endif // HOOK_GAMEDLL
// BModelOrigin - calculates origin of a bmodel from absmin/size because all bmodel origins are 0 0 0
@ -45,7 +40,7 @@ Vector VecBModelOrigin(entvars_t *pevBModel)
LINK_ENTITY_TO_CLASS(func_wall, CFuncWall);
/* <1d193> ../cstrike/dlls/bmodels.cpp:65 */
void CFuncWall::__MAKE_VHOOK(Spawn)(void)
void CFuncWall::__MAKE_VHOOK(Spawn)()
{
pev->angles = g_vecZero;
@ -72,7 +67,7 @@ void CFuncWall::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller,
LINK_ENTITY_TO_CLASS(func_wall_toggle, CFuncWallToggle);
/* <1e28f> ../cstrike/dlls/bmodels.cpp:98 */
void CFuncWallToggle::__MAKE_VHOOK(Spawn)(void)
void CFuncWallToggle::__MAKE_VHOOK(Spawn)()
{
CFuncWall::Spawn();
@ -83,7 +78,7 @@ void CFuncWallToggle::__MAKE_VHOOK(Spawn)(void)
}
/* <1e518> ../cstrike/dlls/bmodels.cpp:106 */
void CFuncWallToggle::TurnOff(void)
void CFuncWallToggle::TurnOff()
{
pev->solid = SOLID_NOT;
pev->effects |= EF_NODRAW;
@ -91,7 +86,7 @@ void CFuncWallToggle::TurnOff(void)
}
/* <1e53a> ../cstrike/dlls/bmodels.cpp:114 */
void CFuncWallToggle::TurnOn(void)
void CFuncWallToggle::TurnOn()
{
pev->solid = SOLID_BSP;
pev->effects &= ~EF_NODRAW;
@ -99,7 +94,7 @@ void CFuncWallToggle::TurnOn(void)
}
/* <1e55c> ../cstrike/dlls/bmodels.cpp:122 */
BOOL CFuncWallToggle::IsOn(void)
BOOL CFuncWallToggle::IsOn()
{
if (pev->solid == SOLID_NOT)
{
@ -127,7 +122,7 @@ void CFuncWallToggle::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pC
LINK_ENTITY_TO_CLASS(func_conveyor, CFuncConveyor);
/* <1e1c3> ../cstrike/dlls/bmodels.cpp:156 */
void CFuncConveyor::__MAKE_VHOOK(Spawn)(void)
void CFuncConveyor::__MAKE_VHOOK(Spawn)()
{
SetMovedir(pev);
CFuncWall::Spawn();
@ -192,7 +187,7 @@ void CFuncIllusionary::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
}
/* <1d1db> ../cstrike/dlls/bmodels.cpp:230 */
void CFuncIllusionary::__MAKE_VHOOK(Spawn)(void)
void CFuncIllusionary::__MAKE_VHOOK(Spawn)()
{
pev->angles = g_vecZero;
pev->movetype = MOVETYPE_NONE;
@ -212,7 +207,7 @@ void CFuncIllusionary::__MAKE_VHOOK(Spawn)(void)
LINK_ENTITY_TO_CLASS(func_monsterclip, CFuncMonsterClip);
/* <1e24f> ../cstrike/dlls/bmodels.cpp:264 */
void CFuncMonsterClip::__MAKE_VHOOK(Spawn)(void)
void CFuncMonsterClip::__MAKE_VHOOK(Spawn)()
{
CFuncWall::Spawn();
@ -282,7 +277,7 @@ void CFuncRotating::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
// REVERSE will cause the it to rotate in the opposite direction.
/* <1d5c4> ../cstrike/dlls/bmodels.cpp:362 */
void CFuncRotating::__MAKE_VHOOK(Spawn)(void)
void CFuncRotating::__MAKE_VHOOK(Spawn)()
{
// set final pitch. Must not be PITCH_NORM, since we
// plan on pitch shifting later.
@ -381,7 +376,7 @@ void CFuncRotating::__MAKE_VHOOK(Spawn)(void)
}
/* <1d28a> ../cstrike/dlls/bmodels.cpp:447 */
void CFuncRotating::__MAKE_VHOOK(Precache)(void)
void CFuncRotating::__MAKE_VHOOK(Precache)()
{
char *szSoundFile = (char *)STRING(pev->message);
@ -513,7 +508,7 @@ void CFuncRotating::RampPitchVol(int fUp)
// SpinUp - accelerates a non-moving func_rotating up to it's speed
/* <1ea74> ../cstrike/dlls/bmodels.cpp:585 */
void CFuncRotating::SpinUp(void)
void CFuncRotating::SpinUp()
{
//rotational velocity
Vector vecAVel;
@ -543,7 +538,7 @@ void CFuncRotating::SpinUp(void)
}
/* <1e9c3> ../cstrike/dlls/bmodels.cpp:615 */
void CFuncRotating::SpinDown(void)
void CFuncRotating::SpinDown()
{
//rotational velocity
Vector vecAVel;
@ -585,7 +580,7 @@ void CFuncRotating::SpinDown(void)
}
/* <1d304> ../cstrike/dlls/bmodels.cpp:653 */
void CFuncRotating::Rotate(void)
void CFuncRotating::Rotate()
{
pev->nextthink = pev->ltime + 10;
}
@ -669,7 +664,7 @@ void CPendulum::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
}
/* <1d9c7> ../cstrike/dlls/bmodels.cpp:782 */
void CPendulum::__MAKE_VHOOK(Spawn)(void)
void CPendulum::__MAKE_VHOOK(Spawn)()
{
// set the axis of rotation
CBaseToggle::AxisDir(pev);
@ -747,7 +742,7 @@ void CPendulum::PendulumUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_T
}
/* <1d381> ../cstrike/dlls/bmodels.cpp:852 */
void CPendulum::Stop(void)
void CPendulum::Stop()
{
pev->angles = m_start;
pev->speed = 0;
@ -762,7 +757,7 @@ void CPendulum::__MAKE_VHOOK(Blocked)(CBaseEntity *pOther)
}
/* <1d533> ../cstrike/dlls/bmodels.cpp:867 */
void CPendulum::Swing(void)
void CPendulum::Swing()
{
float delta, dt;
@ -859,112 +854,3 @@ void CPendulum::RopeTouch(CBaseEntity *pOther)
pevOther->velocity = g_vecZero;
pevOther->movetype = MOVETYPE_NONE;
}
#ifdef HOOK_GAMEDLL
void CFuncWall::Spawn(void)
{
Spawn_();
}
void CFuncWall::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
void CFuncWallToggle::Spawn(void)
{
Spawn_();
}
void CFuncWallToggle::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
void CFuncConveyor::Spawn(void)
{
Spawn_();
}
void CFuncConveyor::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
void CFuncIllusionary::Spawn(void)
{
Spawn_();
}
void CFuncIllusionary::KeyValue(KeyValueData *pkvd)
{
KeyValue_(pkvd);
}
void CFuncMonsterClip::Spawn(void)
{
Spawn_();
}
void CFuncRotating::Spawn(void)
{
Spawn_();
}
void CFuncRotating::Precache(void)
{
Precache_();
}
void CFuncRotating::KeyValue(KeyValueData *pkvd)
{
KeyValue_(pkvd);
}
int CFuncRotating::Save(CSave &save)
{
return Save_(save);
}
int CFuncRotating::Restore(CRestore &restore)
{
return Restore_(restore);
}
void CFuncRotating::Blocked(CBaseEntity *pOther)
{
Blocked_(pOther);
}
void CPendulum::Spawn(void)
{
Spawn_();
}
void CPendulum::KeyValue(KeyValueData *pkvd)
{
KeyValue_(pkvd);
}
int CPendulum::Save(CSave &save)
{
return Save_(save);
}
int CPendulum::Restore(CRestore &restore)
{
return Restore_(restore);
}
void CPendulum::Touch(CBaseEntity *pOther)
{
Touch_(pOther);
}
void CPendulum::Blocked(CBaseEntity *pOther)
{
Blocked_(pOther);
}
#endif // HOOK_GAMEDLL

View File

@ -61,55 +61,52 @@
class CFuncWall: public CBaseEntity
{
public:
virtual void Spawn(void);
virtual void Spawn();
// Bmodels don't go across transitions
virtual int ObjectCaps(void)
{
return CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION;
}
virtual int ObjectCaps() { return CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Spawn_();
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif // HOOK_GAMEDLL
};/* size: 152, cachelines: 3, members: 1 */
};
/* <1c4e1> ../cstrike/dlls/bmodels.cpp:86 */
class CFuncWallToggle: public CFuncWall
{
public:
virtual void Spawn(void);
virtual void Spawn();
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Spawn_();
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif // HOOK_GAMEDLL
public:
void TurnOff(void);
void TurnOn(void);
BOOL IsOn(void);
void TurnOff();
void TurnOn();
BOOL IsOn();
};/* size: 152, cachelines: 3, members: 1 */
};
/* <1c52e> ../cstrike/dlls/bmodels.cpp:147 */
class CFuncConveyor: public CFuncWall
{
public:
virtual void Spawn(void);
virtual void Spawn();
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Spawn_();
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif // HOOK_GAMEDLL
@ -117,7 +114,7 @@ public:
public:
void UpdateSpeed(float speed);
};/* size: 152, cachelines: 3, members: 1 */
};
// A simple entity that looks solid but lets you walk through it.
@ -125,16 +122,13 @@ public:
class CFuncIllusionary: public CBaseToggle
{
public:
virtual void Spawn(void);
virtual void Spawn();
virtual void KeyValue(KeyValueData *pkvd);
virtual int ObjectCaps(void)
{
return CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION;
}
virtual int ObjectCaps() { return CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Spawn_();
void KeyValue_(KeyValueData *pkvd);
#endif // HOOK_GAMEDLL
@ -142,7 +136,7 @@ public:
public:
void EXPORT SloshTouch(CBaseEntity *pOther);
};/* size: 312, cachelines: 5, members: 1 */
};
// Monster only clip brush
//
@ -156,43 +150,37 @@ public:
class CFuncMonsterClip: public CFuncWall
{
public:
virtual void Spawn(void);
virtual void Spawn();
// Clear out func_wall's use function
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
;
}
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) {}
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Spawn_();
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif // HOOK_GAMEDLL
};/* size: 152, cachelines: 3, members: 1 */
};
/* <1c6fa> ../cstrike/dlls/bmodels.cpp:274 */
class CFuncRotating: public CBaseEntity
{
public:
// basic functions
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION;
}
virtual int ObjectCaps() { return CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
virtual void Blocked(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
@ -201,11 +189,11 @@ public:
#endif // HOOK_GAMEDLL
public:
void EXPORT SpinUp(void);
void EXPORT SpinDown(void);
void EXPORT SpinUp();
void EXPORT SpinDown();
void EXPORT HurtTouch(CBaseEntity *pOther);
void EXPORT RotatingUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void EXPORT Rotate(void);
void EXPORT Rotate();
void RampPitchVol(int fUp);
public:
@ -217,27 +205,23 @@ public:
float m_flVolume;
float m_pitch;
int m_sounds;
};/* size: 172, cachelines: 3, members: 7 */
};
/* <1c748> ../cstrike/dlls/bmodels.cpp:720 */
class CPendulum: public CBaseEntity
{
public:
virtual void Spawn(void);
virtual void Spawn();
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION;
}
virtual int ObjectCaps() { return CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
virtual void Touch(CBaseEntity *pOther);
virtual void Blocked(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Spawn_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
@ -247,9 +231,9 @@ public:
#endif // HOOK_GAMEDLL
public:
void EXPORT Swing(void);
void EXPORT Swing();
void EXPORT PendulumUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void EXPORT Stop(void);
void EXPORT Stop();
// this touch func makes the pendulum a rope
void EXPORT RopeTouch(CBaseEntity *pOther);
@ -266,22 +250,8 @@ public:
Vector m_center;
Vector m_start;
};/* size: 200, cachelines: 4, members: 10 */
};
Vector VecBModelOrigin(entvars_t *pevBModel);
#ifdef HOOK_GAMEDLL
// linked objects
C_DLLEXPORT void func_wall(entvars_t *pev);
C_DLLEXPORT void func_wall_toggle(entvars_t *pev);
C_DLLEXPORT void func_conveyor(entvars_t *pev);
C_DLLEXPORT void func_illusionary(entvars_t *pev);
C_DLLEXPORT void func_monsterclip(entvars_t *pev);
C_DLLEXPORT void func_rotating(entvars_t *pev);
C_DLLEXPORT void func_pendulum(entvars_t *pev);
#endif // HOOK_GAMEDLL
#endif // BMODELS_H

View File

@ -29,7 +29,7 @@ int GetBotFollowCount(CBasePlayer *leader)
continue;
CCSBot *bot = dynamic_cast<CCSBot *>(player);
if (bot && bot->GetFollowLeader() == leader)
if (bot != NULL && bot->GetFollowLeader() == leader)
++count;
}
@ -39,7 +39,7 @@ int GetBotFollowCount(CBasePlayer *leader)
// Change movement speed to walking
/* <2e86df> ../cstrike/dlls/bot/cs_bot.cpp:62 */
void CCSBot::__MAKE_VHOOK(Walk)(void)
void CCSBot::__MAKE_VHOOK(Walk)()
{
if (m_mustRunTimer.IsElapsed())
{
@ -96,7 +96,7 @@ int CCSBot::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAtta
float lastAttackedTimestamp = m_attackedTimestamp;
// keep track of our last attacker
m_attacker = reinterpret_cast<CBasePlayer *>(attacker);
m_attacker = static_cast<CBasePlayer *>(attacker);
m_attackedTimestamp = gpGlobals->time;
// no longer safe
@ -297,7 +297,7 @@ void CCSBot::BotTouch(CBaseEntity *other)
}
/* <2e89e3> ../cstrike/dlls/bot/cs_bot.cpp:335 */
bool CCSBot::IsBusy(void) const
bool CCSBot::IsBusy() const
{
if (IsAttacking() ||
IsBuying() ||
@ -313,13 +313,13 @@ bool CCSBot::IsBusy(void) const
}
/* <2e8a0c> ../cstrike/dlls/bot/cs_bot.cpp:351 */
void CCSBot::BotDeathThink(void)
void CCSBot::BotDeathThink()
{
;
}
/* <2e8a34> ../cstrike/dlls/bot/cs_bot.cpp:358 */
CBasePlayer *CCSBot::FindNearbyPlayer(void)
CBasePlayer *CCSBot::FindNearbyPlayer()
{
CBaseEntity *pEntity = NULL;
Vector vecSrc = pev->origin;
@ -356,7 +356,7 @@ void CCSBot::SetEnemy(CBasePlayer *enemy)
// Return false if off mesh.
/* <2e8af6> ../cstrike/dlls/bot/cs_bot.cpp:400 */
bool CCSBot::StayOnNavMesh(void)
bool CCSBot::StayOnNavMesh()
{
if (m_currentArea != NULL)
return true;
@ -466,7 +466,7 @@ void CCSBot::Panic(CBasePlayer *enemy)
}
/* <2e9047> ../cstrike/dlls/bot/cs_bot.cpp:527 */
bool CCSBot::IsDoingScenario(void) const
bool CCSBot::IsDoingScenario() const
{
if (cv_bot_defer_to_human.value <= 0.0f)
return true;
@ -477,7 +477,7 @@ bool CCSBot::IsDoingScenario(void) const
// Return true if we noticed the bomb on the ground or on the radar (for T's only)
/* <2e9070> ../cstrike/dlls/bot/cs_bot.cpp:544 */
bool CCSBot::NoticeLooseBomb(void) const
bool CCSBot::NoticeLooseBomb() const
{
CCSBotManager *ctrl = TheCSBots();
@ -498,7 +498,7 @@ bool CCSBot::NoticeLooseBomb(void) const
// Return true if can see the bomb lying on the ground
/* <2e90d4> ../cstrike/dlls/bot/cs_bot.cpp:566 */
bool CCSBot::CanSeeLooseBomb(void) const
bool CCSBot::CanSeeLooseBomb() const
{
CCSBotManager *ctrl = TheCSBots();
@ -519,7 +519,7 @@ bool CCSBot::CanSeeLooseBomb(void) const
// Return true if can see the planted bomb
/* <2e9140> ../cstrike/dlls/bot/cs_bot.cpp:588 */
bool CCSBot::CanSeePlantedBomb(void) const
bool CCSBot::CanSeePlantedBomb() const
{
CCSBotManager *ctrl = TheCSBots();
@ -540,7 +540,7 @@ bool CCSBot::CanSeePlantedBomb(void) const
// Return last enemy that hurt us
/* <2e918e> ../cstrike/dlls/bot/cs_bot.cpp:610 */
CBasePlayer *CCSBot::GetAttacker(void) const
CBasePlayer *CCSBot::GetAttacker() const
{
if (m_attacker != NULL && m_attacker->IsAlive())
return m_attacker;
@ -551,7 +551,7 @@ CBasePlayer *CCSBot::GetAttacker(void) const
// Immediately jump off of our ladder, if we're on one
/* <2e91b7> ../cstrike/dlls/bot/cs_bot.cpp:622 */
void CCSBot::GetOffLadder(void)
void CCSBot::GetOffLadder()
{
if (IsUsingLadder())
{
@ -618,7 +618,7 @@ void CCSBot::SetHidingSpotCheckTimestamp(HidingSpot *spot)
// Periodic check of hostage count in case we lost some
/* <2e92b8> ../cstrike/dlls/bot/cs_bot.cpp:693 */
void CCSBot::UpdateHostageEscortCount(void)
void CCSBot::UpdateHostageEscortCount()
{
const float updateInterval = 1.0f;
if (m_hostageEscortCount == 0 || gpGlobals->time - m_hostageEscortCountTimestamp < updateInterval)
@ -648,7 +648,7 @@ void CCSBot::UpdateHostageEscortCount(void)
// Return true if we are outnumbered by enemies
/* <2e940d> ../cstrike/dlls/bot/cs_bot.cpp:722 */
bool CCSBot::IsOutnumbered(void) const
bool CCSBot::IsOutnumbered() const
{
return (GetNearbyFriendCount() < GetNearbyEnemyCount() - 1) ? true : false;
}
@ -656,7 +656,7 @@ bool CCSBot::IsOutnumbered(void) const
// Return number of enemies we are outnumbered by
/* <2e94a0> ../cstrike/dlls/bot/cs_bot.cpp:731 */
int CCSBot::OutnumberedCount(void) const
int CCSBot::OutnumberedCount() const
{
if (IsOutnumbered())
{
@ -739,7 +739,7 @@ void CCSBot::SetDisposition(DispositionType disposition)
// Return our current disposition
/* <2e9762> ../cstrike/dlls/bot/cs_bot.cpp:814 */
CCSBot::DispositionType CCSBot::GetDisposition(void) const
CCSBot::DispositionType CCSBot::GetDisposition() const
{
if (!m_ignoreEnemiesTimer.IsElapsed())
return IGNORE_ENEMIES;
@ -758,7 +758,7 @@ void CCSBot::IgnoreEnemies(float duration)
// Increase morale one step
/* <2e97fc> ../cstrike/dlls/bot/cs_bot.cpp:835 */
void CCSBot::IncreaseMorale(void)
void CCSBot::IncreaseMorale()
{
if (m_morale < EXCELLENT)
{
@ -769,7 +769,7 @@ void CCSBot::IncreaseMorale(void)
// Decrease morale one step
/* <2e9824> ../cstrike/dlls/bot/cs_bot.cpp:845 */
void CCSBot::DecreaseMorale(void)
void CCSBot::DecreaseMorale()
{
if (m_morale > TERRIBLE)
{
@ -781,7 +781,7 @@ void CCSBot::DecreaseMorale(void)
// TODO: Account for morale
/* <2e984c> ../cstrike/dlls/bot/cs_bot.cpp:857 */
bool CCSBot::IsRogue(void) const
bool CCSBot::IsRogue() const
{
CCSBotManager *ctrl = TheCSBots();
@ -805,7 +805,7 @@ bool CCSBot::IsRogue(void) const
// Return true if we are in a hurry
/* <2e98f1> ../cstrike/dlls/bot/cs_bot.cpp:882 */
bool CCSBot::IsHurrying(void) const
bool CCSBot::IsHurrying() const
{
if (!m_hurryTimer.IsElapsed())
return true;
@ -828,7 +828,7 @@ bool CCSBot::IsHurrying(void) const
// Return true if it is the early, "safe", part of the round
/* <2e9942> ../cstrike/dlls/bot/cs_bot.cpp:906 */
bool CCSBot::IsSafe(void) const
bool CCSBot::IsSafe() const
{
CCSBotManager *ctrl = TheCSBots();
@ -841,7 +841,7 @@ bool CCSBot::IsSafe(void) const
// Return true if it is well past the early, "safe", part of the round
/* <2e9987> ../cstrike/dlls/bot/cs_bot.cpp:920 */
bool CCSBot::IsWellPastSafe(void) const
bool CCSBot::IsWellPastSafe() const
{
CCSBotManager *ctrl = TheCSBots();
@ -854,7 +854,7 @@ bool CCSBot::IsWellPastSafe(void) const
// Return true if we were in the safe time last update, but not now
/* <2e99d8> ../cstrike/dlls/bot/cs_bot.cpp:934 */
bool CCSBot::IsEndOfSafeTime(void) const
bool CCSBot::IsEndOfSafeTime() const
{
return m_wasSafe && !IsSafe();
}
@ -862,7 +862,7 @@ bool CCSBot::IsEndOfSafeTime(void) const
// Return the amount of "safe time" we have left
/* <2e9a3e> ../cstrike/dlls/bot/cs_bot.cpp:943 */
float CCSBot::GetSafeTimeRemaining(void) const
float CCSBot::GetSafeTimeRemaining() const
{
CCSBotManager *ctrl = TheCSBots();
@ -872,7 +872,7 @@ float CCSBot::GetSafeTimeRemaining(void) const
// Called when enemy seen to adjust safe time for this round
/* <2e9a8f> ../cstrike/dlls/bot/cs_bot.cpp:954 */
void CCSBot::AdjustSafeTime(void)
void CCSBot::AdjustSafeTime()
{
CCSBotManager *ctrl = TheCSBots();
@ -887,7 +887,7 @@ void CCSBot::AdjustSafeTime(void)
// Return true if we haven't seen an enemy for "a long time"
/* <2e9ad0> ../cstrike/dlls/bot/cs_bot.cpp:970 */
bool CCSBot::HasNotSeenEnemyForLongTime(void) const
bool CCSBot::HasNotSeenEnemyForLongTime() const
{
const float longTime = 30.0f;
return (GetTimeSinceLastSawEnemy() > longTime);
@ -940,7 +940,7 @@ const Vector *FindNearbyRetreatSpot(CCSBot *me, float maxRange)
// Return -1 if no hostage is following us.
/* <2eaa1d> ../cstrike/dlls/bot/cs_bot.cpp:1116 */
float CCSBot::GetRangeToFarthestEscortedHostage(void) const
float CCSBot::GetRangeToFarthestEscortedHostage() const
{
FarthestHostage away(this);
@ -948,27 +948,3 @@ float CCSBot::GetRangeToFarthestEscortedHostage(void) const
return away.m_farRange;
}
#ifdef HOOK_GAMEDLL
void CCSBot::Walk(void)
{
Walk_();
}
bool CCSBot::Jump(bool mustJump)
{
return Jump_(mustJump);
}
int CCSBot::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{
return TakeDamage_(pevInflictor, pevAttacker, flDamage, bitsDamageType);
}
void CCSBot::Killed(entvars_t *pevAttacker, int iGib)
{
Killed_(pevAttacker, iGib);
}
#endif // HOOK_GAMEDLL

File diff suppressed because it is too large Load Diff

View File

@ -11,14 +11,6 @@ CBaseEntity *g_pSelectedZombieSpawn = NULL;
CountdownTimer BotChatterInterface::m_encourageTimer;
IntervalTimer BotChatterInterface::m_radioSilenceInterval[ 2 ];
#else // HOOK_GAMEDLL
BotPhraseManager *TheBotPhrases;
CBaseEntity *g_pSelectedZombieSpawn;
CountdownTimer IMPL_CLASS(BotChatterInterface, m_encourageTimer);
IntervalTimer IMPL_CLASS(BotChatterInterface, m_radioSilenceInterval)[ 2 ];
#endif // HOOK_GAMEDLL
/* <303469> ../cstrike/dlls/bot/cs_bot_chatter.cpp:32 */
@ -268,13 +260,13 @@ void BotHostageBeingTakenMeme::__MAKE_VHOOK(Interpret)(CCSBot *sender, CCSBot *r
}
/* <303609> ../cstrike/dlls/bot/cs_bot_chatter.cpp:285 */
BotSpeakable::BotSpeakable(void)
BotSpeakable::BotSpeakable()
{
m_phrase = NULL;
}
/* <303655> ../cstrike/dlls/bot/cs_bot_chatter.cpp:291 */
BotSpeakable::~BotSpeakable(void)
BotSpeakable::~BotSpeakable()
{
if (m_phrase != NULL)
{
@ -299,7 +291,7 @@ BotPhrase::BotPhrase(unsigned int id, bool isPlace)
}
/* <3036c2> ../cstrike/dlls/bot/cs_bot_chatter.cpp:314 */
BotPhrase::~BotPhrase(void)
BotPhrase::~BotPhrase()
{
for (uint32 bank = 0; bank < m_voiceBank.size(); ++bank)
{
@ -387,7 +379,7 @@ char *BotPhrase::GetSpeakable(int bankIndex, float *duration) const
/* <30395a> ../cstrike/dlls/bot/cs_bot_chatter.cpp:395 */
#ifndef HOOK_GAMEDLL
void BotPhrase::Randomize(void)
void BotPhrase::Randomize()
{
for (uint32 i = 0; i < m_voiceBank.size(); ++i)
{
@ -397,7 +389,7 @@ void BotPhrase::Randomize(void)
#endif // HOOK_GAMEDLL
/* <303b3f> ../cstrike/dlls/bot/cs_bot_chatter.cpp:409 */
BotPhraseManager::BotPhraseManager(void)
BotPhraseManager::BotPhraseManager()
{
for (int i = 0; i < MAX_PLACES_PER_MAP; ++i)
m_placeStatementHistory[i].timer.Invalidate();
@ -408,7 +400,7 @@ BotPhraseManager::BotPhraseManager(void)
// Invoked when map changes
/* <303c45> ../cstrike/dlls/bot/cs_bot_chatter.cpp:417 */
void BotPhraseManager::OnMapChange(void)
void BotPhraseManager::OnMapChange()
{
m_placeCount = 0;
}
@ -416,7 +408,7 @@ void BotPhraseManager::OnMapChange(void)
// Invoked when the round resets
/* <303c70> ../cstrike/dlls/bot/cs_bot_chatter.cpp:425 */
void BotPhraseManager::OnRoundRestart(void)
void BotPhraseManager::OnRoundRestart()
{
// effectively reset all interval timers
m_placeCount = 0;
@ -445,7 +437,7 @@ bool BotPhraseManager::Initialize(const char *filename, int bankIndex)
if (phraseDataFile == NULL)
{
if (UTIL_IsGame("czero"))
if (g_bIsCzeroGame)
{
CONSOLE_ECHO("WARNING: Cannot access bot phrase database '%s'\n", filename);
}
@ -685,7 +677,7 @@ bool BotPhraseManager::Initialize(const char *filename, int bankIndex)
}
/* <30409e> ../cstrike/dlls/bot/cs_bot_chatter.cpp:682 */
BotPhraseManager::~BotPhraseManager(void)
BotPhraseManager::~BotPhraseManager()
{
BotPhraseList::iterator iter;
for (iter = m_list.begin(); iter != m_list.end(); ++iter)
@ -856,7 +848,7 @@ BotStatement::BotStatement(BotChatterInterface *chatter, BotStatementType type,
}
/* <3047bd> ../cstrike/dlls/bot/cs_bot_chatter.cpp:855 */
BotStatement::~BotStatement(void)
BotStatement::~BotStatement()
{
if (m_meme != NULL)
{
@ -865,7 +857,7 @@ BotStatement::~BotStatement(void)
}
/* <3047e0> ../cstrike/dlls/bot/cs_bot_chatter.cpp:863 */
CCSBot *BotStatement::GetOwner(void) const
CCSBot *BotStatement::GetOwner() const
{
return m_chatter->GetOwner();
}
@ -890,7 +882,7 @@ void BotStatement::AddCondition(ConditionType condition)
// Return true if this statement is "important" and not personality chatter
/* <30485b> ../cstrike/dlls/bot/cs_bot_chatter.cpp:891 */
bool BotStatement::IsImportant(void) const
bool BotStatement::IsImportant() const
{
// if a statement contains any important phrases, it is important
for (int i = 0; i < m_count; ++i)
@ -909,7 +901,7 @@ bool BotStatement::IsImportant(void) const
// Verify all attached conditions
/* <3048bc> ../cstrike/dlls/bot/cs_bot_chatter.cpp:911 */
bool BotStatement::IsValid(void) const
bool BotStatement::IsValid() const
{
for (int i = 0; i < m_conditionCount; ++i)
{
@ -980,7 +972,7 @@ bool BotStatement::IsRedundant(const BotStatement *say) const
// Return true if this statement is no longer appropriate to say
/* <304977> ../cstrike/dlls/bot/cs_bot_chatter.cpp:990 */
bool BotStatement::IsObsolete(void) const
bool BotStatement::IsObsolete() const
{
// if the round is over, the only things we should say are emotes
if (GetOwner()->GetGameState()->IsRoundOver())
@ -1062,7 +1054,7 @@ void BotStatement::AppendPhrase(ContextType contextPhrase)
// m_index refers to the phrase currently being spoken, or -1 if we havent started yet
/* <304b22> ../cstrike/dlls/bot/cs_bot_chatter.cpp:1065 */
bool BotStatement::Update(void)
bool BotStatement::Update()
{
CCSBot *me = GetOwner();
@ -1259,7 +1251,7 @@ bool BotStatement::Update(void)
// Places can be implicit in the statement, or explicitly defined
/* <2fee36> ../cstrike/dlls/bot/cs_bot_chatter.cpp:1266 */
Place BotStatement::GetPlace(void) const
Place BotStatement::GetPlace() const
{
// return any explicitly set place if we have one
if (m_place != UNDEFINED_PLACE)
@ -1278,7 +1270,7 @@ Place BotStatement::GetPlace(void) const
// Return true if this statement has an associated count
/* <305289> ../cstrike/dlls/bot/cs_bot_chatter.cpp:1283 */
bool BotStatement::HasCount(void) const
bool BotStatement::HasCount() const
{
for (int i = 0; i < m_count; ++i)
{
@ -1317,7 +1309,7 @@ BotChatterInterface::BotChatterInterface(CCSBot *me)
}
/* <305307> ../cstrike/dlls/bot/cs_bot_chatter.cpp:1334 */
BotChatterInterface::~BotChatterInterface(void)
BotChatterInterface::~BotChatterInterface()
{
// free pending statements
BotStatement *next;
@ -1331,7 +1323,7 @@ BotChatterInterface::~BotChatterInterface(void)
// Reset to initial state
/* <305386> ../cstrike/dlls/bot/cs_bot_chatter.cpp:1347 */
void BotChatterInterface::Reset(void)
void BotChatterInterface::Reset()
{
BotStatement *msg, *nextMsg;
@ -1469,7 +1461,7 @@ void BotChatterInterface::RemoveStatement(BotStatement *statement)
// Track nearby enemy count and report enemy activity
/* <3087ee> ../cstrike/dlls/bot/cs_bot_chatter.cpp:1479 */
void BotChatterInterface::ReportEnemies(void)
void BotChatterInterface::ReportEnemies()
{
if (!m_me->IsAlive())
return;
@ -1509,7 +1501,7 @@ void BotChatterInterface::OnEvent(GameEventType event, CBaseEntity *entity, CBas
// Invoked when we die
/* <30579e> ../cstrike/dlls/bot/cs_bot_chatter.cpp:1524 */
void BotChatterInterface::OnDeath(void)
void BotChatterInterface::OnDeath()
{
if (IsTalking())
{
@ -1534,7 +1526,7 @@ void BotChatterInterface::OnDeath(void)
// Process ongoing chatter for this bot
/* <308852> ../cstrike/dlls/bot/cs_bot_chatter.cpp:1549 */
void BotChatterInterface::Update(void)
void BotChatterInterface::Update()
{
// report enemy activity
ReportEnemies();
@ -1615,7 +1607,7 @@ void BotChatterInterface::Update(void)
// Returns the statement that is being spoken, or is next to be spoken if no-one is speaking now
/* <305915> ../cstrike/dlls/bot/cs_bot_chatter.cpp:1635 */
BotStatement *BotChatterInterface::GetActiveStatement(void)
BotStatement *BotChatterInterface::GetActiveStatement()
{
// keep track of statement waiting longest to be spoken - it is next
BotStatement *earliest = NULL;
@ -1674,7 +1666,7 @@ BotStatement *BotChatterInterface::GetActiveStatement(void)
// Return true if we speaking makes sense now
/* <305a35> ../cstrike/dlls/bot/cs_bot_chatter.cpp:1694 */
bool BotChatterInterface::ShouldSpeak(void) const
bool BotChatterInterface::ShouldSpeak() const
{
// don't talk to non-existent friends
if (m_me->GetFriendsRemaining() == 0)
@ -1688,13 +1680,13 @@ bool BotChatterInterface::ShouldSpeak(void) const
}
/* <305a8f> ../cstrike/dlls/bot/cs_bot_chatter.cpp:1708 */
float BotChatterInterface::GetRadioSilenceDuration(void)
float BotChatterInterface::GetRadioSilenceDuration()
{
return IMPL(m_radioSilenceInterval)[ m_me->m_iTeam - 1 ].GetElapsedTime();
}
/* <305b15> ../cstrike/dlls/bot/cs_bot_chatter.cpp:1714 */
void BotChatterInterface::ResetRadioSilenceDuration(void)
void BotChatterInterface::ResetRadioSilenceDuration()
{
IMPL(m_radioSilenceInterval)[m_me->m_iTeam - 1].Reset();
}
@ -1708,7 +1700,7 @@ inline void SayWhere(BotStatement *say, Place place)
// Report enemy sightings
/* <305b50> ../cstrike/dlls/bot/cs_bot_chatter.cpp:1740 */
void BotChatterInterface::EnemySpotted(void)
void BotChatterInterface::EnemySpotted()
{
// NOTE: This could be a few seconds out of date (enemy is in an adjacent place)
Place place = m_me->GetEnemyPlace();
@ -1733,28 +1725,26 @@ NOXREF void BotChatterInterface::Clear(Place place)
SayWhere(say, place);
say->AppendPhrase(TheBotPhrases->GetPhrase("Clear"));
AddStatement(say);
}
// Request enemy activity report
/* <305ffa> ../cstrike/dlls/bot/cs_bot_chatter.cpp:1773 */
void BotChatterInterface::ReportIn(void)
void BotChatterInterface::ReportIn()
{
BotStatement *say = new BotStatement(this, REPORT_REQUEST_INFORMATION, 10.0f);
say->AppendPhrase(TheBotPhrases->GetPhrase("RequestReport"));
say->AddCondition(BotStatement::RADIO_SILENCE);
say->AttachMeme(new BotRequestReportMeme());
AddStatement(say);
}
// Report our situtation
/* <309851> ../cstrike/dlls/bot/cs_bot_chatter.cpp:1788 */
void BotChatterInterface::ReportingIn(void)
void BotChatterInterface::ReportingIn()
{
CCSBotManager *ctrl = TheCSBots();
BotStatement *say = new BotStatement(this, REPORT_INFORMATION, 10.0f);
@ -1852,7 +1842,7 @@ void BotChatterInterface::ReportingIn(void)
}
/* <3084cf> ../cstrike/dlls/bot/cs_bot_chatter.cpp:1896 */
bool BotChatterInterface::NeedBackup(void)
bool BotChatterInterface::NeedBackup()
{
const float minRequestInterval = 10.0f;
if (m_needBackupInterval.IsLessThen(minRequestInterval))
@ -1877,7 +1867,6 @@ bool BotChatterInterface::NeedBackup(void)
say->AppendPhrase(TheBotPhrases->GetPhrase("Help"));
say->AttachMeme(new BotHelpMeme(place));
AddStatement(say);
}
@ -1885,7 +1874,7 @@ bool BotChatterInterface::NeedBackup(void)
}
/* <3061a8> ../cstrike/dlls/bot/cs_bot_chatter.cpp:1929 */
void BotChatterInterface::PinnedDown(void)
void BotChatterInterface::PinnedDown()
{
// this is a form of "need backup"
const float minRequestInterval = 10.0f;
@ -1939,15 +1928,13 @@ void BotChatterInterface::KilledMyEnemy(int victimID)
return;
BotStatement *say = new BotStatement(this, REPORT_ENEMY_ACTION, 3.0f);
say->AppendPhrase(TheBotPhrases->GetPhrase("KilledMyEnemy"));
say->SetSubject(victimID);
AddStatement(say);
}
/* <306853> ../cstrike/dlls/bot/cs_bot_chatter.cpp:1993 */
void BotChatterInterface::EnemiesRemaining(void)
void BotChatterInterface::EnemiesRemaining()
{
// only report if we killed the last enemy in the area
if (m_me->GetNearbyEnemyCount() > 1)
@ -1956,27 +1943,22 @@ void BotChatterInterface::EnemiesRemaining(void)
BotStatement *say = new BotStatement(this, REPORT_ENEMIES_REMAINING, 5.0f);
say->AppendPhrase(BotStatement::REMAINING_ENEMY_COUNT);
say->SetStartTime(gpGlobals->time + RANDOM_FLOAT(2.0f, 4.0f));
AddStatement(say);
}
/* <306974> ../cstrike/dlls/bot/cs_bot_chatter.cpp:2008 */
void BotChatterInterface::Affirmative(void)
void BotChatterInterface::Affirmative()
{
BotStatement *say = new BotStatement(this, REPORT_ACKNOWLEDGE, 3.0f);
say->AppendPhrase(TheBotPhrases->GetPhrase("Affirmative"));
AddStatement(say);
}
/* <306bb2> ../cstrike/dlls/bot/cs_bot_chatter.cpp:2018 */
void BotChatterInterface::Negative(void)
void BotChatterInterface::Negative()
{
BotStatement *say = new BotStatement(this, REPORT_ACKNOWLEDGE, 3.0f);
say->AppendPhrase(TheBotPhrases->GetPhrase("Negative"));
AddStatement(say);
}
@ -1993,11 +1975,9 @@ void BotChatterInterface::GoingToPlantTheBomb(Place place)
m_planInterval.Reset();
BotStatement *say = new BotStatement(this, REPORT_CRITICAL_EVENT, 10.0f);
say->AppendPhrase(TheBotPhrases->GetPhrase("GoingToPlantBomb"));
say->SetPlace(place);
say->AttachMeme(new BotFollowMeme());
AddStatement(say);
}
@ -2008,17 +1988,14 @@ void BotChatterInterface::PlantingTheBomb(Place place)
return;
BotStatement *say = new BotStatement(this, REPORT_CRITICAL_EVENT, 10.0f);
say->AppendPhrase(TheBotPhrases->GetPhrase("PlantingBomb"));
say->SetPlace(place);
say->AttachMeme(new BotDefendHereMeme(m_me->pev->origin));
AddStatement(say);
}
/* <3070c8> ../cstrike/dlls/bot/cs_bot_chatter.cpp:2066 */
void BotChatterInterface::TheyPickedUpTheBomb(void)
void BotChatterInterface::TheyPickedUpTheBomb()
{
if (TheCSBots()->IsRoundOver())
return;
@ -2032,10 +2009,8 @@ void BotChatterInterface::TheyPickedUpTheBomb(void)
// tell our teammates
BotStatement *say = new BotStatement(this, REPORT_INFORMATION, 10.0f);
say->AppendPhrase(TheBotPhrases->GetPhrase("TheyPickedUpTheBomb"));
say->AttachMeme(new BotBombStatusMeme(CSGameState::MOVING, m_me->pev->origin));
AddStatement(say);
}
@ -2066,7 +2041,6 @@ void BotChatterInterface::SpottedBomber(CBasePlayer *bomber)
//say->AttachMeme(new BotHelpMeme(place));
say->AttachMeme(new BotBombStatusMeme(CSGameState::MOVING, bomber->pev->origin));
AddStatement(say);
}
@ -2137,7 +2111,7 @@ NOXREF void BotChatterInterface::GuardingLooseBomb(CBaseEntity *bomb)
}
/* <307c56> ../cstrike/dlls/bot/cs_bot_chatter.cpp:2186 */
void BotChatterInterface::RequestBombLocation(void)
void BotChatterInterface::RequestBombLocation()
{
// only ask once per round
if (m_requestedBombLocation)
@ -2147,11 +2121,8 @@ void BotChatterInterface::RequestBombLocation(void)
// tell our teammates
BotStatement *say = new BotStatement(this, REPORT_REQUEST_INFORMATION, 10.0f);
say->AppendPhrase(TheBotPhrases->GetPhrase("WhereIsTheBomb"));
say->AttachMeme(new BotWhereBombMeme());
AddStatement(say);
}
@ -2166,9 +2137,7 @@ void BotChatterInterface::BombsiteClear(int zoneIndex)
SayWhere(say, TheNavAreaGrid.GetPlace(&zone->m_center));
say->AppendPhrase(TheBotPhrases->GetPhrase("BombsiteClear"));
say->AttachMeme(new BotBombsiteStatusMeme(zoneIndex, BotBombsiteStatusMeme::CLEAR));
AddStatement(say);
}
@ -2180,17 +2149,14 @@ void BotChatterInterface::FoundPlantedBomb(int zoneIndex)
return;
BotStatement *say = new BotStatement(this, REPORT_INFORMATION, 3.0f);
say->AppendPhrase(TheBotPhrases->GetPhrase("PlantedBombPlace"));
say->SetPlace(TheNavAreaGrid.GetPlace(&zone->m_center));
say->AttachMeme(new BotBombsiteStatusMeme(zoneIndex, BotBombsiteStatusMeme::PLANTED));
AddStatement(say);
}
/* <308308> ../cstrike/dlls/bot/cs_bot_chatter.cpp:2242 */
void BotChatterInterface::Scared(void)
void BotChatterInterface::Scared()
{
const float minInterval = 10.0f;
if (m_scaredInterval.IsLessThen(minInterval))
@ -2199,15 +2165,13 @@ void BotChatterInterface::Scared(void)
m_scaredInterval.Reset();
BotStatement *say = new BotStatement(this, REPORT_EMOTE, 1.0f);
say->AppendPhrase(TheBotPhrases->GetPhrase("ScaredEmote"));
say->AddCondition(BotStatement::IS_IN_COMBAT);
AddStatement(say);
}
/* <308b60> ../cstrike/dlls/bot/cs_bot_chatter.cpp:2259 */
void BotChatterInterface::CelebrateWin(void)
void BotChatterInterface::CelebrateWin()
{
BotStatement *say = new BotStatement(this, REPORT_EMOTE, 15.0f);
@ -2249,13 +2213,11 @@ void BotChatterInterface::AnnouncePlan(const char *phraseName, Place place)
return;
BotStatement *say = new BotStatement(this, REPORT_MY_PLAN, 10.0f);
say->AppendPhrase(TheBotPhrases->GetPhrase(phraseName));
say->SetPlace(place);
// wait at least a short time after round start
say->SetStartTime(ctrl->GetRoundStartTime() + RANDOM_FLOAT(2.0, 3.0f));
AddStatement(say);
}
@ -2300,40 +2262,36 @@ void BotChatterInterface::GuardingHostageEscapeZone(bool isPlan)
}
/* <3093a9> ../cstrike/dlls/bot/cs_bot_chatter.cpp:2346 */
void BotChatterInterface::HostagesBeingTaken(void)
void BotChatterInterface::HostagesBeingTaken()
{
if (TheCSBots()->IsRoundOver())
return;
BotStatement *say = new BotStatement(this, REPORT_INFORMATION, 3.0f);
say->AppendPhrase(TheBotPhrases->GetPhrase("HostagesBeingTaken"));
say->AttachMeme(new BotHostageBeingTakenMeme());
AddStatement(say);
}
/* <309542> ../cstrike/dlls/bot/cs_bot_chatter.cpp:2361 */
void BotChatterInterface::HostagesTaken(void)
void BotChatterInterface::HostagesTaken()
{
if (TheCSBots()->IsRoundOver())
return;
BotStatement *say = new BotStatement(this, REPORT_INFORMATION, 3.0f);
say->AppendPhrase(TheBotPhrases->GetPhrase("HostagesTaken"));
AddStatement(say);
}
/* <309691> ../cstrike/dlls/bot/cs_bot_chatter.cpp:2375 */
void BotChatterInterface::TalkingToHostages(void)
void BotChatterInterface::TalkingToHostages()
{
;
}
/* <3096bc> ../cstrike/dlls/bot/cs_bot_chatter.cpp:2380 */
void BotChatterInterface::EscortingHostages(void)
void BotChatterInterface::EscortingHostages()
{
if (TheCSBots()->IsRoundOver())
return;
@ -2344,23 +2302,19 @@ void BotChatterInterface::EscortingHostages(void)
m_escortingHostageTimer.Start(10.0f);
BotStatement *say = new BotStatement(this, REPORT_MY_PLAN, 5.0f);
say->AppendPhrase(TheBotPhrases->GetPhrase("EscortingHostages"));
AddStatement(say);
}
}
/* <30a5b9> ../cstrike/dlls/bot/cs_bot_chatter.cpp:2400 */
NOXREF void BotChatterInterface::HostageDown(void)
NOXREF void BotChatterInterface::HostageDown()
{
if (TheCSBots()->IsRoundOver())
return;
BotStatement *say = new BotStatement(this, REPORT_INFORMATION, 3.0f);
say->AppendPhrase(TheBotPhrases->GetPhrase("HostageDown"));
AddStatement(say);
}
@ -2375,84 +2329,23 @@ void BotChatterInterface::Encourage(const char *phraseName, float repeatInterval
}
/* <30a905> ../cstrike/dlls/bot/cs_bot_chatter.cpp:2427 */
void BotChatterInterface::KilledFriend(void)
void BotChatterInterface::KilledFriend()
{
BotStatement *say = new BotStatement(this, REPORT_KILLED_FRIEND, 2.0f);
say->AppendPhrase(TheBotPhrases->GetPhrase("KilledFriend"));
// give them time to react
say->SetStartTime(gpGlobals->time + RANDOM_FLOAT(0.5f, 1.0f));
AddStatement(say);
}
/* <30aa67> ../cstrike/dlls/bot/cs_bot_chatter.cpp:2440 */
void BotChatterInterface::FriendlyFire(void)
void BotChatterInterface::FriendlyFire()
{
BotStatement *say = new BotStatement(this, REPORT_FRIENDLY_FIRE, 1.0f);
say->AppendPhrase(TheBotPhrases->GetPhrase("FriendlyFire"));
// give them time to react
say->SetStartTime(gpGlobals->time + RANDOM_FLOAT(0.3f, 0.5f));
AddStatement(say);
}
#ifdef HOOK_GAMEDLL
void (*pBotPhrase__Randomize)(void);
void __declspec(naked) BotPhrase::Randomize(void)
{
// you can not hook this function, because it uses the rand() function
// which does not allow us to carry out tests because different results at the output.
__asm { jmp pBotPhrase__Randomize }
}
void BotAllHostagesGoneMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
{
Interpret_(sender, receiver);
}
void BotHostageBeingTakenMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
{
Interpret_(sender, receiver);
}
void BotHelpMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
{
Interpret_(sender, receiver);
}
void BotBombsiteStatusMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
{
Interpret_(sender, receiver);
}
void BotBombStatusMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
{
Interpret_(sender, receiver);
}
void BotFollowMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
{
Interpret_(sender, receiver);
}
void BotDefendHereMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
{
Interpret_(sender, receiver);
}
void BotWhereBombMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
{
Interpret_(sender, receiver);
}
void BotRequestReportMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
{
Interpret_(sender, receiver);
}
#endif // HOOK_GAMEDLL

View File

@ -52,8 +52,7 @@ class BotMeme
public:
void Transmit(CCSBot *sender) const; // transmit meme to other bots
virtual void Interpret(CCSBot *sender, CCSBot *receiver) const = 0; // cause the given bot to act on this meme
};/* size: 4, cachelines: 1, members: 1 */
};
class BotAllHostagesGoneMeme: public BotMeme
{
@ -64,9 +63,9 @@ public:
void Interpret_(CCSBot *sender, CCSBot *receiver) const;
#endif //HOOK_GAMEDLL
#endif // HOOK_GAMEDLL
};/* size: 4, cachelines: 1, members: 1 */
};
class BotHostageBeingTakenMeme: public BotMeme
{
@ -77,9 +76,9 @@ public:
void Interpret_(CCSBot *sender, CCSBot *receiver) const;
#endif //HOOK_GAMEDLL
#endif // HOOK_GAMEDLL
};/* size: 4, cachelines: 1, members: 1 */
};
/* <2ff7ef> ../cstrike/dlls/bot/cs_bot_chatter.h:53 */
class BotHelpMeme: public BotMeme
@ -95,12 +94,11 @@ public:
void Interpret_(CCSBot *sender, CCSBot *receiver) const;
#endif //HOOK_GAMEDLL
#endif // HOOK_GAMEDLL
private:
Place m_place;
};/* size: 8, cachelines: 1, members: 2 */
};
/* <2ff65e> ../cstrike/dlls/bot/cs_bot_chatter.h:70 */
class BotBombsiteStatusMeme: public BotMeme
@ -119,13 +117,12 @@ public:
void Interpret_(CCSBot *sender, CCSBot *receiver) const;
#endif //HOOK_GAMEDLL
#endif // HOOK_GAMEDLL
private:
int m_zoneIndex; // the bombsite
StatusType m_status; // whether it is cleared or the bomb is there (planted)
};/* size: 12, cachelines: 1, members: 3 */
};
/* <2ff6de> ../cstrike/dlls/bot/cs_bot_chatter.h:87 */
class BotBombStatusMeme: public BotMeme
@ -144,13 +141,12 @@ public:
void Interpret_(CCSBot *sender, CCSBot *receiver) const;
#endif //HOOK_GAMEDLL
#endif // HOOK_GAMEDLL
private:
CSGameState::BombState m_state;
Vector m_pos;
};/* size: 20, cachelines: 1, members: 3 */
};
/* <2ff75d> ../cstrike/dlls/bot/cs_bot_chatter.h:101 */
class BotFollowMeme: public BotMeme
@ -162,9 +158,8 @@ public:
void Interpret_(CCSBot *sender, CCSBot *receiver) const;
#endif //HOOK_GAMEDLL
};/* size: 4, cachelines: 1, members: 1 */
#endif // HOOK_GAMEDLL
};
/* <2ff731> ../cstrike/dlls/bot/cs_bot_chatter.h:111 */
class BotDefendHereMeme: public BotMeme
@ -180,12 +175,11 @@ public:
void Interpret_(CCSBot *sender, CCSBot *receiver) const;
#endif //HOOK_GAMEDLL
#endif // HOOK_GAMEDLL
private:
Vector m_pos;
};/* size: 16, cachelines: 1, members: 2 */
};
/* <2ff696> ../cstrike/dlls/bot/cs_bot_chatter.h:123 */
class BotWhereBombMeme: public BotMeme
@ -197,9 +191,8 @@ public:
void Interpret_(CCSBot *sender, CCSBot *receiver) const;
#endif //HOOK_GAMEDLL
};/* size: 4, cachelines: 1, members: 1 */
#endif // HOOK_GAMEDLL
};
/* <2ff81b> ../cstrike/dlls/bot/cs_bot_chatter.h:130 */
class BotRequestReportMeme: public BotMeme
@ -211,9 +204,9 @@ public:
void Interpret_(CCSBot *sender, CCSBot *receiver) const;
#endif //HOOK_GAMEDLL
#endif // HOOK_GAMEDLL
};/* size: 4, cachelines: 1, members: 1 */
};
enum BotStatementType
{
@ -242,15 +235,14 @@ enum BotStatementType
class BotSpeakable
{
public:
BotSpeakable(void);
~BotSpeakable(void);
BotSpeakable();
~BotSpeakable();
char *m_phrase;
float m_duration;
PlaceCriteria m_place;
CountCriteria m_count;
};/* size: 16, cachelines: 1, members: 4 */
};
typedef std::STD_VECTOR<BotSpeakable *> BotSpeakableVector;
typedef std::STD_VECTOR<BotSpeakableVector *> BotVoiceBankVector;
@ -262,17 +254,17 @@ public:
char *GetSpeakable(int bankIndex, float *duration = NULL) const; // return a random speakable and its duration in seconds that meets the current criteria
// NOTE: Criteria must be set just before the GetSpeakable() call, since they are shared among all bots
void ClearCriteria(void) const;
void ClearCriteria() const;
void SetPlaceCriteria(PlaceCriteria place) const; // all returned phrases must have this place criteria
void SetCountCriteria(CountCriteria count) const; // all returned phrases must have this count criteria
const char *GetName(void) const { return m_name; }
Place GetID(void) const { return m_id; }
GameEventType GetRadioEquivalent(void) const { return m_radioEvent; }
bool IsImportant(void) const { return m_isImportant; } // return true if this phrase is part of an important statement
const char *GetName() const { return m_name; }
Place GetID() const { return m_id; }
GameEventType GetRadioEquivalent() const { return m_radioEvent; }
bool IsImportant() const { return m_isImportant; } // return true if this phrase is part of an important statement
bool IsPlace(void) const { return m_isPlace; }
void Randomize(void); // randomly shuffle the speakable order
bool IsPlace() const { return m_isPlace; }
void Randomize(); // randomly shuffle the speakable order
#ifndef HOOK_GAMEDLL
private:
@ -280,7 +272,7 @@ private:
friend class BotPhraseManager;
BotPhrase(unsigned int id, bool isPlace);
~BotPhrase(void);
~BotPhrase();
char *m_name;
Place m_id;
@ -296,13 +288,12 @@ private:
mutable PlaceCriteria m_placeCriteria;
mutable CountCriteria m_countCriteria;
};/* size: 68, cachelines: 2, members: 11 */
};
typedef std::STD_LIST<BotPhrase *> BotPhraseList;
/* <2fea0e> ../cstrike/dlls/bot/cs_bot_chatter.h:239 */
inline void BotPhrase::ClearCriteria(void) const
inline void BotPhrase::ClearCriteria() const
{
m_placeCriteria = ANY_PLACE;
m_countCriteria = UNDEFINED_COUNT;
@ -324,17 +315,17 @@ inline void BotPhrase::SetCountCriteria(CountCriteria count) const
class BotPhraseManager
{
public:
BotPhraseManager(void);
~BotPhraseManager(void);
BotPhraseManager();
~BotPhraseManager();
// initialize phrase system from database file for a specific voice bank (0 is the default voice bank)
bool Initialize(const char *filename, int bankIndex);
// invoked when round resets
void OnRoundRestart(void);
void OnRoundRestart();
// invoked when map changes
void OnMapChange(void);
void OnMapChange();
Place NameToID(const char *name) const;
const char *IDToName(Place id) const;
@ -347,7 +338,7 @@ public:
// given an id, return the associated Place phrase collection
const BotPhrase *GetPlace(PlaceCriteria place) const;
const BotPhraseList *GetPlaceList(void) const { return &m_placeList; }
const BotPhraseList *GetPlaceList() const { return &m_placeList; }
// return time last statement of given type was emitted by a teammate for the given place
float GetPlaceStatementInterval(Place place) const;
@ -375,8 +366,7 @@ private:
mutable PlaceTimeInfo m_placeStatementHistory[ MAX_PLACES_PER_MAP ];
mutable int m_placeCount;
};/* size: 532, cachelines: 9, members: 4 */
};
/* <2fea95> ../cstrike/dlls/bot/cs_bot_chatter.h:298 */
inline int BotPhraseManager::FindPlaceIndex(Place where) const
@ -430,33 +420,33 @@ class BotStatement
{
public:
BotStatement(BotChatterInterface *chatter, BotStatementType type, float expireDuration);
~BotStatement(void);
~BotStatement();
public:
BotChatterInterface *GetChatter(void) const { return m_chatter; }
CCSBot *GetOwner(void) const;
BotChatterInterface *GetChatter() const { return m_chatter; }
CCSBot *GetOwner() const;
BotStatementType GetType(void) const { return m_type; } // return the type of statement this is
bool IsImportant(void) const; // return true if this statement is "important" and not personality chatter
BotStatementType GetType() const { return m_type; } // return the type of statement this is
bool IsImportant() const; // return true if this statement is "important" and not personality chatter
bool HasSubject(void) const { return (m_subject != UNDEFINED_SUBJECT); }
bool HasSubject() const { return (m_subject != UNDEFINED_SUBJECT); }
void SetSubject(int playerID) { m_subject = playerID; } // who this statement is about
int GetSubject(void) const { return m_subject; } // who this statement is about
int GetSubject() const { return m_subject; } // who this statement is about
bool HasPlace(void) const { return (GetPlace()) ? true : false; }
Place GetPlace(void) const; // if this statement refers to a specific place, return that place
bool HasPlace() const { return (GetPlace()) ? true : false; }
Place GetPlace() const; // if this statement refers to a specific place, return that place
void SetPlace(Place where) { m_place = where; } // explicitly set place
bool HasCount(void) const; // return true if this statement has an associated count
bool HasCount() const; // return true if this statement has an associated count
bool IsRedundant(const BotStatement *say) const; // return true if this statement is the same as the given one
bool IsObsolete(void) const; // return true if this statement is no longer appropriate to say
bool IsObsolete() const; // return true if this statement is no longer appropriate to say
void Convert(const BotStatement *say); // possibly change what were going to say base on what teammate is saying
void AppendPhrase(const BotPhrase *phrase);
void SetStartTime(float timestamp) { m_startTime = timestamp; } // define the earliest time this statement can be spoken
float GetStartTime(void) const { return m_startTime; }
float GetStartTime() const { return m_startTime; }
enum ConditionType
{
@ -467,7 +457,7 @@ public:
};
void AddCondition(ConditionType condition); // conditions must be true for the statement to be spoken
bool IsValid(void) const; // verify all attached conditions
bool IsValid() const; // verify all attached conditions
enum ContextType
{
@ -479,9 +469,9 @@ public:
};
void AppendPhrase(ContextType contextPhrase); // special phrases that depend on the context
bool Update(void); // emit statement over time, return false if statement is done
bool IsSpeaking(void) const { return m_isSpeaking; } // return true if this statement is currently being spoken
float GetTimestamp(void) const { return m_timestamp; } // get time statement was created (but not necessarily started talking)
bool Update(); // emit statement over time, return false if statement is done
bool IsSpeaking() const { return m_isSpeaking; } // return true if this statement is currently being spoken
float GetTimestamp() const { return m_timestamp; } // get time statement was created (but not necessarily started talking)
void AttachMeme(BotMeme *meme); // attach a meme to this statement, to be transmitted to other friendly bots when spoken
@ -524,23 +514,22 @@ public:
int m_index; // m_index refers to the phrase currently being spoken, or -1 if we havent started yet
int m_count;
};/* size: 112, cachelines: 2, members: 18 */
};
// This class defines the interface to the bot radio chatter system
class BotChatterInterface
{
public:
BotChatterInterface(void) {};
BotChatterInterface() {};
BotChatterInterface(CCSBot *me);
~BotChatterInterface();
void Reset(void); // reset to initial state
void Update(void); // process ongoing chatter
void Reset(); // reset to initial state
void Update(); // process ongoing chatter
void OnEvent(GameEventType event, CBaseEntity *entity, CBaseEntity *other); // invoked when event occurs in the game (some events have NULL entities)
void OnDeath(void); // invoked when we die
void OnDeath(); // invoked when we die
enum VerbosityType
{
@ -549,44 +538,44 @@ public:
RADIO, // use the standard radio instead
OFF // no chatter at all
};
VerbosityType GetVerbosity(void) const; // return our current level of verbosity
VerbosityType GetVerbosity() const; // return our current level of verbosity
CCSBot *GetOwner(void) const { return m_me; }
bool IsTalking(void) const; // return true if we are currently talking
float GetRadioSilenceDuration(void); // return time since any teammate said anything
void ResetRadioSilenceDuration(void);
CCSBot *GetOwner() const { return m_me; }
bool IsTalking() const; // return true if we are currently talking
float GetRadioSilenceDuration(); // return time since any teammate said anything
void ResetRadioSilenceDuration();
enum { MUST_ADD = 1 };
void AddStatement(BotStatement *statement, bool mustAdd = false); // register a statement for speaking
void RemoveStatement(BotStatement *statement); // remove a statement
BotStatement *GetActiveStatement(void); // returns the statement that is being spoken, or is next to be spoken if no-one is speaking now
BotStatement *GetStatement(void) const; // returns our current statement, or NULL if we aren't speaking
BotStatement *GetActiveStatement(); // returns the statement that is being spoken, or is next to be spoken if no-one is speaking now
BotStatement *GetStatement() const; // returns our current statement, or NULL if we aren't speaking
int GetPitch(void) const { return m_pitch; }
int GetPitch() const { return m_pitch; }
// things the bots can say
void Say(const char *phraseName, float lifetime = 3.0f, float delay = 0.0f);
void AnnouncePlan(const char *phraseName, Place place);
void Affirmative(void);
void Negative(void);
void Affirmative();
void Negative();
void EnemySpotted(void); // report enemy sightings
void EnemySpotted(); // report enemy sightings
void KilledMyEnemy(int victimID);
void EnemiesRemaining(void);
void EnemiesRemaining();
NOXREF void Clear(Place place);
void ReportIn(void); // ask for current situation
void ReportingIn(void); // report current situation
void ReportIn(); // ask for current situation
void ReportingIn(); // report current situation
bool NeedBackup(void);
void PinnedDown(void);
void Scared(void);
bool NeedBackup();
void PinnedDown();
void Scared();
void HeardNoise(const Vector *pos);
void TheyPickedUpTheBomb(void);
void TheyPickedUpTheBomb();
void GoingToPlantTheBomb(Place place);
void BombsiteClear(int zoneIndex);
void FoundPlantedBomb(int zoneIndex);
@ -594,33 +583,33 @@ public:
void SpottedBomber(CBasePlayer *bomber);
void SpottedLooseBomb(CBaseEntity *bomb);
NOXREF void GuardingLooseBomb(CBaseEntity *bomb);
void RequestBombLocation(void);
void RequestBombLocation();
#define IS_PLAN true
void GuardingHostages(Place place, bool isPlan = false);
void GuardingHostageEscapeZone(bool isPlan = false);
void HostagesBeingTaken(void);
void HostagesTaken(void);
void TalkingToHostages(void);
void EscortingHostages(void);
NOXREF void HostageDown(void);
void HostagesBeingTaken();
void HostagesTaken();
void TalkingToHostages();
void EscortingHostages();
NOXREF void HostageDown();
void CelebrateWin(void);
void CelebrateWin();
void Encourage(const char *phraseName, float repeatInterval = 10.0f, float lifetime = 3.0f); // "encourage" the player to do the scenario
void KilledFriend(void);
void FriendlyFire(void);
void KilledFriend();
void FriendlyFire();
bool SeesAtLeastOneEnemy(void) const { return m_seeAtLeastOneEnemy; }
bool SeesAtLeastOneEnemy() const { return m_seeAtLeastOneEnemy; }
#ifndef HOOK_GAMEDLL
private:
#endif // HOOK_GAMEDLL
BotStatement *m_statementList; // list of all active/pending messages for this bot
void ReportEnemies(void); // track nearby enemy count and generate enemy activity statements
bool ShouldSpeak(void) const; // return true if we speaking makes sense now
void ReportEnemies(); // track nearby enemy count and generate enemy activity statements
bool ShouldSpeak() const; // return true if we speaking makes sense now
CCSBot *m_me; // the bot this chatter is for
@ -641,11 +630,10 @@ private:
CountdownTimer m_heardNoiseTimer;
CountdownTimer m_escortingHostageTimer;
static CountdownTimer IMPL(m_encourageTimer); // timer to know when we can "encourage" the human player again - shared by all bots
};/* size: 64, cachelines: 1, members: 16 */
};
/* <2fec2d> ../cstrike/dlls/bot/cs_bot_chatter.h:572 */
inline BotChatterInterface::VerbosityType BotChatterInterface::GetVerbosity(void) const
inline BotChatterInterface::VerbosityType BotChatterInterface::GetVerbosity() const
{
const char *string = cv_bot_chatter.string;
@ -665,7 +653,7 @@ inline BotChatterInterface::VerbosityType BotChatterInterface::GetVerbosity(void
}
/* <2fec4a> ../cstrike/dlls/bot/cs_bot_chatter.h:590 */
inline bool BotChatterInterface::IsTalking(void) const
inline bool BotChatterInterface::IsTalking() const
{
if (m_statementList != NULL)
{
@ -676,18 +664,11 @@ inline bool BotChatterInterface::IsTalking(void) const
}
/* <3f2bad> ../cstrike/dlls/bot/cs_bot_chatter.h:596 */
inline BotStatement *BotChatterInterface::GetStatement(void) const
inline BotStatement *BotChatterInterface::GetStatement() const
{
return m_statementList;
}
#ifdef HOOK_GAMEDLL
#define TheBotPhrases (*pTheBotPhrases)
#define g_pSelectedZombieSpawn (*pg_pSelectedZombieSpawn)
#endif // HOOK_GAMEDLL
extern BotPhraseManager *TheBotPhrases;
extern CBaseEntity *g_pSelectedZombieSpawn;
@ -706,17 +687,4 @@ inline void BotChatterInterface::Say(const char *phraseName, float lifetime, flo
const Vector *GetRandomSpotAtPlace(Place place);
#ifdef HOOK_GAMEDLL
typedef void (BotStatement::*APPEND_PHRASE_CONTEXT)(BotStatement::ContextType);
typedef void (BotStatement::*APPEND_PHRASE_BOTPHRASE)(const BotPhrase *);
typedef const BotPhrase *(BotPhraseManager::*GET_PLACE_NAME)(const char *name) const;
typedef const BotPhrase *(BotPhraseManager::*GET_PLACE_PLACE)(PlaceCriteria place) const;
// refs
extern void (*pBotPhrase__Randomize)(void);
#endif // HOOK_GAMEDLL
#endif // CS_BOT_CHATTER_H

View File

@ -382,12 +382,3 @@ void CCSBot::__MAKE_VHOOK(OnEvent)(GameEventType event, CBaseEntity *entity, CBa
m_noiseTimestamp = gpGlobals->time;
}
}
#ifdef HOOK_GAMEDLL
void CCSBot::OnEvent(GameEventType event, CBaseEntity *entity, CBaseEntity *other)
{
OnEvent_(event, entity, other);
}
#endif // HOOK_GAMEDLL

View File

@ -35,42 +35,10 @@ cvar_t cv_bot_defer_to_human = { "bot_defer_to_human", "0", FCVAR_SERVER, 0.0f,
cvar_t cv_bot_chatter = { "bot_chatter", "normal", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_profile_db = { "bot_profile_db", "BotProfile.db", FCVAR_SERVER, 0.0f, NULL };
#else // HOOK_GAMEDLL
cvar_t cv_bot_traceview;
cvar_t cv_bot_stop;
cvar_t cv_bot_show_nav;
cvar_t cv_bot_show_danger;
cvar_t cv_bot_nav_edit;
cvar_t cv_bot_nav_zdraw;
cvar_t cv_bot_walk;
cvar_t cv_bot_difficulty;
cvar_t cv_bot_debug;
cvar_t cv_bot_quicksave;
cvar_t cv_bot_quota;
cvar_t cv_bot_quota_match;
cvar_t cv_bot_prefix;
cvar_t cv_bot_allow_rogues;
cvar_t cv_bot_allow_pistols;
cvar_t cv_bot_allow_shotguns;
cvar_t cv_bot_allow_sub_machine_guns;
cvar_t cv_bot_allow_rifles;
cvar_t cv_bot_allow_machine_guns;
cvar_t cv_bot_allow_grenades;
cvar_t cv_bot_allow_snipers;
cvar_t cv_bot_allow_shield;
cvar_t cv_bot_join_team;
cvar_t cv_bot_join_after_player;
cvar_t cv_bot_auto_vacate;
cvar_t cv_bot_zombie;
cvar_t cv_bot_defer_to_human;
cvar_t cv_bot_chatter;
cvar_t cv_bot_profile_db;
#endif // HOOK_GAMEDLL
/* <333bca> ../cstrike/dlls/bot/cs_bot_init.cpp:57 */
void InstallBotControl(void)
void InstallBotControl()
{
if (TheBots != NULL)
{
@ -83,7 +51,7 @@ void InstallBotControl(void)
// Engine callback for custom server commands
/* <333cb3> ../cstrike/dlls/bot/cs_bot_init.cpp:68 */
void Bot_ServerCommand(void)
void Bot_ServerCommand()
{
if (TheBots != NULL)
{
@ -93,10 +61,11 @@ void Bot_ServerCommand(void)
}
/* <333cec> ../cstrike/dlls/bot/cs_bot_init.cpp:81 */
void Bot_RegisterCvars(void)
void Bot_RegisterCvars()
{
if (UTIL_IsGame("czero"))
{
if (!g_bIsCzeroGame)
return;
CVAR_REGISTER(&cv_bot_traceview);
CVAR_REGISTER(&cv_bot_stop);
CVAR_REGISTER(&cv_bot_show_nav);
@ -126,13 +95,12 @@ void Bot_RegisterCvars(void)
CVAR_REGISTER(&cv_bot_defer_to_human);
CVAR_REGISTER(&cv_bot_chatter);
CVAR_REGISTER(&cv_bot_profile_db);
}
}
// Constructor
/* <333d1e> ../cstrike/dlls/bot/cs_bot_init.cpp:129 */
CCSBot::CCSBot(void) : m_chatter(this), m_gameState(this)
CCSBot::CCSBot() : m_chatter(this), m_gameState(this)
{
;
}
@ -157,7 +125,7 @@ bool CCSBot::__MAKE_VHOOK(Initialize)(const BotProfile *profile)
// set initial safe time guess for this map
m_safeTime = 15.0f + 5.0f * GetProfile()->GetAggression();
m_name[0] = '\000';
m_name[0] = '\0';
ResetValues();
StartNormalProcess();
@ -168,7 +136,7 @@ bool CCSBot::__MAKE_VHOOK(Initialize)(const BotProfile *profile)
// Reset internal data to initial state
/* <3341dc> ../cstrike/dlls/bot/cs_bot_init.cpp:167 */
void CCSBot::ResetValues(void)
void CCSBot::ResetValues()
{
m_chatter.Reset();
m_gameState.Reset();
@ -325,7 +293,7 @@ void CCSBot::ResetValues(void)
// NOTE: For some reason, this can be called twice when a bot is added.
/* <3342e4> ../cstrike/dlls/bot/cs_bot_init.cpp:336 */
void CCSBot::__MAKE_VHOOK(SpawnBot)(void)
void CCSBot::__MAKE_VHOOK(SpawnBot)()
{
CCSBotManager *ctrl = TheCSBots();
@ -345,7 +313,7 @@ void CCSBot::__MAKE_VHOOK(SpawnBot)(void)
}
/* <3338f7> ../cstrike/dlls/bot/cs_bot_init.cpp:366 */
void CCSBot::__MAKE_VHOOK(RoundRespawn)(void)
void CCSBot::__MAKE_VHOOK(RoundRespawn)()
{
// do the normal player spawn process
CBasePlayer::RoundRespawn();
@ -353,7 +321,7 @@ void CCSBot::__MAKE_VHOOK(RoundRespawn)(void)
}
/* <334332> ../cstrike/dlls/bot/cs_bot_init.cpp:378 */
void CCSBot::Disconnect(void)
void CCSBot::Disconnect()
{
EndVoiceFeedback();
@ -362,22 +330,3 @@ void CCSBot::Disconnect(void)
hideProgressMeter();
}
}
#ifdef HOOK_GAMEDLL
bool CCSBot::Initialize(const BotProfile *profile)
{
return Initialize_(profile);
}
void CCSBot::SpawnBot(void)
{
SpawnBot_();
}
void CCSBot::RoundRespawn(void)
{
RoundRespawn_();
}
#endif // HOOK_GAMEDLL

View File

@ -139,7 +139,7 @@ void startProgressMeter(const char *title)
}
/* <3435a8> ../cstrike/dlls/bot/cs_bot_learn.cpp:167 */
void hideProgressMeter(void)
void hideProgressMeter()
{
MESSAGE_BEGIN(MSG_ALL, gmsgBotProgress);
WRITE_BYTE(FLAG_PROGRESS_HIDE);
@ -147,7 +147,7 @@ void hideProgressMeter(void)
}
/* <343b63> ../cstrike/dlls/bot/cs_bot_learn.cpp:182 */
void CCSBot::StartLearnProcess(void)
void CCSBot::StartLearnProcess()
{
startProgressMeter("#CZero_LearningMap");
drawProgressMeter(0, "#CZero_LearningMap");
@ -178,7 +178,7 @@ void CCSBot::StartLearnProcess(void)
// Returns true if sampling needs to continue, or false if done.
/* <343d37> ../cstrike/dlls/bot/cs_bot_learn.cpp:217 */
bool CCSBot::LearnStep(void)
bool CCSBot::LearnStep()
{
// take a step
while (true)
@ -356,7 +356,7 @@ bool CCSBot::LearnStep(void)
}
/* <34489e> ../cstrike/dlls/bot/cs_bot_learn.cpp:392 */
void CCSBot::UpdateLearnProcess(void)
void CCSBot::UpdateLearnProcess()
{
float startTime = g_engfuncs.pfnTime();
while (g_engfuncs.pfnTime() - startTime < updateTimesliceDuration)
@ -370,7 +370,7 @@ void CCSBot::UpdateLearnProcess(void)
}
/* <344750> ../cstrike/dlls/bot/cs_bot_learn.cpp:409 */
void CCSBot::StartAnalyzeAlphaProcess(void)
void CCSBot::StartAnalyzeAlphaProcess()
{
m_processMode = PROCESS_ANALYZE_ALPHA;
m_analyzeIter = TheNavAreaList.begin();
@ -386,7 +386,7 @@ void CCSBot::StartAnalyzeAlphaProcess(void)
}
/* <34396c> ../cstrike/dlls/bot/cs_bot_learn.cpp:427 */
bool CCSBot::AnalyzeAlphaStep(void)
bool CCSBot::AnalyzeAlphaStep()
{
++_currentIndex;
if (m_analyzeIter == TheNavAreaList.end())
@ -401,7 +401,7 @@ bool CCSBot::AnalyzeAlphaStep(void)
}
/* <3448de> ../cstrike/dlls/bot/cs_bot_learn.cpp:443 */
void CCSBot::UpdateAnalyzeAlphaProcess(void)
void CCSBot::UpdateAnalyzeAlphaProcess()
{
float startTime = g_engfuncs.pfnTime();
while (g_engfuncs.pfnTime() - startTime < updateTimesliceDuration)
@ -420,7 +420,7 @@ void CCSBot::UpdateAnalyzeAlphaProcess(void)
}
/* <344aed> ../cstrike/dlls/bot/cs_bot_learn.cpp:467 */
void CCSBot::StartAnalyzeBetaProcess(void)
void CCSBot::StartAnalyzeBetaProcess()
{
m_processMode = PROCESS_ANALYZE_BETA;
m_analyzeIter = TheNavAreaList.begin();
@ -430,7 +430,7 @@ void CCSBot::StartAnalyzeBetaProcess(void)
}
/* <3437c8> ../cstrike/dlls/bot/cs_bot_learn.cpp:479 */
bool CCSBot::AnalyzeBetaStep(void)
bool CCSBot::AnalyzeBetaStep()
{
++_currentIndex;
if (m_analyzeIter == TheNavAreaList.end())
@ -445,7 +445,7 @@ bool CCSBot::AnalyzeBetaStep(void)
}
/* <344b8d> ../cstrike/dlls/bot/cs_bot_learn.cpp:495 */
void CCSBot::UpdateAnalyzeBetaProcess(void)
void CCSBot::UpdateAnalyzeBetaProcess()
{
float startTime = g_engfuncs.pfnTime();
while (g_engfuncs.pfnTime() - startTime < updateTimesliceDuration)
@ -463,13 +463,13 @@ void CCSBot::UpdateAnalyzeBetaProcess(void)
}
/* <344d1f> ../cstrike/dlls/bot/cs_bot_learn.cpp:517 */
void CCSBot::StartSaveProcess(void)
void CCSBot::StartSaveProcess()
{
m_processMode = PROCESS_SAVE;
}
/* <344d41> ../cstrike/dlls/bot/cs_bot_learn.cpp:527 */
void CCSBot::UpdateSaveProcess(void)
void CCSBot::UpdateSaveProcess()
{
char filename[256];
char msg[256];
@ -494,7 +494,7 @@ void CCSBot::UpdateSaveProcess(void)
}
/* <344e24> ../cstrike/dlls/bot/cs_bot_learn.cpp:554 */
void CCSBot::StartNormalProcess(void)
void CCSBot::StartNormalProcess()
{
m_processMode = PROCESS_NORMAL;
}

View File

@ -110,7 +110,7 @@ bool CCSBot::CanHearNearbyEnemyGunfire(float range) const
// NOTE: Dont use IsVisible(), because smoke shouldnt cause us to not look toward noises
/* <354e7b> ../cstrike/dlls/bot/cs_bot_listen.cpp:141 */
bool CCSBot::CanSeeNoisePosition(void) const
bool CCSBot::CanSeeNoisePosition() const
{
TraceResult result;
UTIL_TraceLine(GetEyePosition(), m_noisePosition + Vector(0, 0, HalfHumanHeight), ignore_monsters, ignore_glass, ENT(pev), &result);
@ -128,7 +128,7 @@ bool CCSBot::CanSeeNoisePosition(void) const
// Assumes m_noisePosition is valid.
/* <354f48> ../cstrike/dlls/bot/cs_bot_listen.cpp:160 */
bool CCSBot::UpdateLookAtNoise(void)
bool CCSBot::UpdateLookAtNoise()
{
// make sure a noise exists
if (!IsNoiseHeard() || gpGlobals->time - m_noiseTimestamp > 0.5f)

View File

@ -13,16 +13,6 @@ bool CCSBotManager::m_isLearningMap = false;
bool CCSBotManager::m_isAnalysisRequested = false;
NavEditCmdType CCSBotManager::m_editCmd = EDIT_NONE;
#else // HOOK_GAMEDLL
CBotManager *TheBots;
float IMPL_CLASS(CCSBotManager, m_flNextCVarCheck);
bool IMPL_CLASS(CCSBotManager, m_isMapDataLoaded);
bool IMPL_CLASS(CCSBotManager, m_isLearningMap);
bool IMPL_CLASS(CCSBotManager, m_isAnalysisRequested);
NavEditCmdType IMPL_CLASS(CCSBotManager, m_editCmd);
#endif // HOOK_GAMEDLL
// Determine whether bots can be used or not
@ -40,7 +30,7 @@ inline bool AreBotsAllowed()
}
/* <36b3b4> ../cstrike/dlls/bot/cs_bot_manager.cpp:45 */
CCSBotManager::CCSBotManager(void)
CCSBotManager::CCSBotManager()
{
IMPL(m_flNextCVarCheck) = 0.0f;
@ -114,7 +104,7 @@ CCSBotManager::CCSBotManager(void)
// Invoked when a new round begins
/* <36b22a> ../cstrike/dlls/bot/cs_bot_manager.cpp:111 */
void CCSBotManager::__MAKE_VHOOK(RestartRound)(void)
void CCSBotManager::__MAKE_VHOOK(RestartRound)()
{
// extend
CBotManager::RestartRound();
@ -198,7 +188,7 @@ void UTIL_DrawBox(Extent *extent, int lifetime, int red, int green, int blue)
// Called each frame
/* <36b13d> ../cstrike/dlls/bot/cs_bot_manager.cpp:195 */
void CCSBotManager::__MAKE_VHOOK(StartFrame)(void)
void CCSBotManager::__MAKE_VHOOK(StartFrame)()
{
// EXTEND
CBotManager::StartFrame();
@ -280,7 +270,7 @@ bool CCSBotManager::IsOnOffense(CBasePlayer *player) const
// Invoked when a map has just been loaded
/* <36a3b6> ../cstrike/dlls/bot/cs_bot_manager.cpp:331 */
void CCSBotManager::__MAKE_VHOOK(ServerActivate)(void)
void CCSBotManager::__MAKE_VHOOK(ServerActivate)()
{
DestroyNavigationMap();
IMPL(m_isMapDataLoaded) = false;
@ -311,7 +301,7 @@ void CCSBotManager::__MAKE_VHOOK(AddServerCommand)(const char *cmd)
}
/* <36b0e0> ../cstrike/dlls/bot/cs_bot_manager.cpp:375 */
void CCSBotManager::__MAKE_VHOOK(AddServerCommands)(void)
void CCSBotManager::__MAKE_VHOOK(AddServerCommands)()
{
static bool fFirstTime = true;
@ -320,7 +310,7 @@ void CCSBotManager::__MAKE_VHOOK(AddServerCommands)(void)
fFirstTime = false;
if (UTIL_IsGame("czero"))
if (g_bIsCzeroGame)
{
AddServerCommand("bot_about");
AddServerCommand("bot_add");
@ -367,7 +357,7 @@ void CCSBotManager::__MAKE_VHOOK(AddServerCommands)(void)
}
/* <36b2ac> ../cstrike/dlls/bot/cs_bot_manager.cpp:413 */
void CCSBotManager::__MAKE_VHOOK(ServerDeactivate)(void)
void CCSBotManager::__MAKE_VHOOK(ServerDeactivate)()
{
m_bServerActive = false;
}
@ -399,7 +389,7 @@ void CCSBotManager::__MAKE_VHOOK(ClientDisconnect)(CBasePlayer *pPlayer)
}
/* <36b714> ../cstrike/dlls/bot/cs_bot_manager.cpp:464 */
void PrintAllEntities(void)
void PrintAllEntities()
{
for (int i = 1; i < gpGlobals->maxEntities; ++i)
{
@ -415,7 +405,7 @@ void PrintAllEntities(void)
/* <36ace2> ../cstrike/dlls/bot/cs_bot_manager.cpp:484 */
void CCSBotManager::__MAKE_VHOOK(ServerCommand)(const char *pcmd)
{
if (!m_bServerActive || !UTIL_IsGame("czero"))
if (!m_bServerActive || !g_bIsCzeroGame)
return;
char buffer[400];
@ -897,7 +887,7 @@ bool CCSBotManager::BotAddCommand(BotProfileTeamType team, bool isFromConsole)
// Keep a minimum quota of bots in the game
/* <36d10f> ../cstrike/dlls/bot/cs_bot_manager.cpp:979 */
void CCSBotManager::MaintainBotQuota(void)
void CCSBotManager::MaintainBotQuota()
{
if (IMPL(m_isLearningMap))
return;
@ -1009,7 +999,7 @@ void CCSBotManager::MaintainBotQuota(void)
}
/* <36d1dd> ../cstrike/dlls/bot/cs_bot_manager.cpp:1086 */
void CCSBotManager::MonitorBotCVars(void)
void CCSBotManager::MonitorBotCVars()
{
if (cv_bot_nav_edit.value != 0.0f)
{
@ -1062,9 +1052,9 @@ private:
// Search the map entities to determine the game scenario and define important zones.
/* <36b780> ../cstrike/dlls/bot/cs_bot_manager.cpp:1109 */
void CCSBotManager::ValidateMapData(void)
void CCSBotManager::ValidateMapData()
{
if (IMPL(m_isMapDataLoaded) || !UTIL_IsGame("czero"))
if (IMPL(m_isMapDataLoaded) || !g_bIsCzeroGame)
return;
IMPL(m_isMapDataLoaded) = true;
@ -1206,7 +1196,7 @@ void CCSBotManager::ValidateMapData(void)
#ifndef HOOK_GAMEDLL
bool CCSBotManager::AddBot(const BotProfile *profile, BotProfileTeamType team)
{
if (!UTIL_IsGame("czero"))
if (!g_bIsCzeroGame)
return false;
CHalfLifeMultiplay *mp = g_pGameRules;
@ -1416,7 +1406,7 @@ void CCSBotManager::__MAKE_VHOOK(OnEvent)(GameEventType event, CBaseEntity *enti
// Get the time remaining before the planted bomb explodes
/* <36bdb3> ../cstrike/dlls/bot/cs_bot_manager.cpp:1541 */
float CCSBotManager::GetBombTimeLeft(void) const
float CCSBotManager::GetBombTimeLeft() const
{
return (g_pGameRules->m_iC4Timer - (gpGlobals->time - m_bombPlantTimestamp));
}
@ -1562,84 +1552,13 @@ void CCSBotManager::SetRadioMessageTimestamp(GameEventType event, int teamID)
// Reset all radio message timestamps
/* <36bf06> ../cstrike/dlls/bot/cs_bot_manager.cpp:1690 */
void CCSBotManager::ResetRadioMessageTimestamps(void)
void CCSBotManager::ResetRadioMessageTimestamps()
{
for (int t = 0; t < ARRAYSIZE(m_radioMsgTimestamp[0]); t++)
for (int t = 0; t < ARRAYSIZE(m_radioMsgTimestamp[0]); ++t)
{
for (int m = 0; m < ARRAYSIZE(m_radioMsgTimestamp); m++)
for (int m = 0; m < ARRAYSIZE(m_radioMsgTimestamp); ++m)
{
m_radioMsgTimestamp[m][t] = 0.0f;
}
}
}
#ifdef HOOK_GAMEDLL
void (*pCCSBotManager__AddBot)(void);
bool __declspec(naked) CCSBotManager::AddBot(const BotProfile *profile, BotProfileTeamType team)
{
__asm { jmp pCCSBotManager__AddBot }
}
void CCSBotManager::ClientDisconnect(CBasePlayer *pPlayer)
{
ClientDisconnect_(pPlayer);
}
BOOL CCSBotManager::ClientCommand(CBasePlayer *pPlayer, const char *pcmd)
{
return ClientCommand_(pPlayer, pcmd);
}
void CCSBotManager::ServerActivate(void)
{
ServerActivate_();
}
void CCSBotManager::ServerDeactivate(void)
{
ServerDeactivate_();
}
void CCSBotManager::ServerCommand(const char *pcmd)
{
ServerCommand_(pcmd);
}
void CCSBotManager::AddServerCommand(const char *cmd)
{
AddServerCommand_(cmd);
}
void CCSBotManager::AddServerCommands(void)
{
AddServerCommands_();
}
void CCSBotManager::RestartRound(void)
{
RestartRound_();
}
void CCSBotManager::StartFrame(void)
{
StartFrame_();
}
void CCSBotManager::OnEvent(GameEventType event, CBaseEntity *entity, CBaseEntity *other)
{
OnEvent_(event, entity, other);
}
unsigned int CCSBotManager::GetPlayerPriority(CBasePlayer *player) const
{
return GetPlayerPriority_(player);
}
bool CCSBotManager::IsImportantPlayer(CBasePlayer *player) const
{
return IsImportantPlayer_(player);
}
#endif // HOOK_GAMEDLL

View File

@ -32,12 +32,6 @@
#pragma once
#endif
#ifdef HOOK_GAMEDLL
#define TheBots (*pTheBots)
#endif // HOOK_GAMEDLL
extern CBotManager *TheBots;
// The manager for Counter-Strike specific bots
@ -49,15 +43,15 @@ public:
virtual void ClientDisconnect(CBasePlayer *pPlayer);
virtual BOOL ClientCommand(CBasePlayer *pPlayer, const char *pcmd);
virtual void ServerActivate(void);
virtual void ServerDeactivate(void);
virtual void ServerActivate();
virtual void ServerDeactivate();
virtual void ServerCommand(const char *pcmd);
virtual void AddServerCommand(const char *cmd);
virtual void AddServerCommands(void);
virtual void AddServerCommands();
virtual void RestartRound(void); // (EXTEND) invoked when a new round begins
virtual void StartFrame(void); // (EXTEND) called each frame
virtual void RestartRound(); // (EXTEND) invoked when a new round begins
virtual void StartFrame(); // (EXTEND) called each frame
virtual void OnEvent(GameEventType event, CBaseEntity *entity = NULL, CBaseEntity *other = NULL);
virtual unsigned int GetPlayerPriority(CBasePlayer *player) const; // return priority of player (0 = max pri)
@ -67,13 +61,13 @@ public:
void ClientDisconnect_(CBasePlayer *pPlayer);
BOOL ClientCommand_(CBasePlayer *pPlayer, const char *pcmd);
void ServerActivate_(void);
void ServerDeactivate_(void);
void ServerActivate_();
void ServerDeactivate_();
void ServerCommand_(const char *pcmd);
void AddServerCommand_(const char *cmd);
void AddServerCommands_(void);
void RestartRound_(void);
void StartFrame_(void);
void AddServerCommands_();
void RestartRound_();
void StartFrame_();
void OnEvent_(GameEventType event, CBaseEntity *entity, CBaseEntity *other);
unsigned int GetPlayerPriority_(CBasePlayer *player) const;
bool IsImportantPlayer_(CBasePlayer *player) const;
@ -81,15 +75,15 @@ public:
#endif // HOOK_GAMEDLL
public:
void ValidateMapData(void);
bool IsLearningMap(void) const { return IMPL(m_isLearningMap); }
void SetLearningMapFlag(void) { IMPL(m_isLearningMap) = true;}
bool IsAnalysisRequested(void) const { return IMPL(m_isAnalysisRequested); }
void RequestAnalysis(void) { IMPL(m_isAnalysisRequested) = true; }
void AckAnalysisRequest(void) { IMPL(m_isAnalysisRequested) = false; }
void ValidateMapData();
bool IsLearningMap() const { return IMPL(m_isLearningMap); }
void SetLearningMapFlag() { IMPL(m_isLearningMap) = true;}
bool IsAnalysisRequested() const { return IMPL(m_isAnalysisRequested); }
void RequestAnalysis() { IMPL(m_isAnalysisRequested) = true; }
void AckAnalysisRequest() { IMPL(m_isAnalysisRequested) = false; }
// difficulty levels
static BotDifficultyType GetDifficultyLevel(void)
static BotDifficultyType GetDifficultyLevel()
{
if (cv_bot_difficulty.value < 0.9f)
return BOT_EASY;
@ -111,7 +105,7 @@ public:
SCENARIO_RESCUE_HOSTAGES,
SCENARIO_ESCORT_VIP
};
GameScenarioType GetScenario(void) const { return m_gameScenario; }
GameScenarioType GetScenario() const { return m_gameScenario; }
// "zones"
// depending on the game mode, these are bomb zones, rescue zones, etc.
@ -132,7 +126,7 @@ public:
const Zone *GetZone(const Vector *pos) const; // return the zone that contains the given position
const Zone *GetClosestZone(const Vector *pos) const; // return the closest zone to the given position
const Zone *GetClosestZone(const CBaseEntity *entity) const { return GetClosestZone(&entity->pev->origin); } // return the closest zone to the given entity
int GetZoneCount(void) const { return m_zoneCount; }
int GetZoneCount() const { return m_zoneCount; }
const Vector *GetRandomPositionInZone(const Zone *zone) const;
CNavArea *GetRandomAreaInZone(const Zone *zone) const;
@ -169,7 +163,7 @@ public:
}
// pick a zone at random and return it
const Zone *GetRandomZone(void) const
const Zone *GetRandomZone() const
{
if (!m_zoneCount)
return NULL;
@ -177,53 +171,53 @@ public:
return &m_zone[ RANDOM_LONG(0, m_zoneCount - 1) ];
}
bool IsBombPlanted(void) const { return m_isBombPlanted; } // returns true if bomb has been planted
float GetBombPlantTimestamp(void) const { return m_bombPlantTimestamp; } // return time bomb was planted
bool IsTimeToPlantBomb(void) const { return (gpGlobals->time >= m_earliestBombPlantTimestamp); } // return true if it's ok to try to plant bomb
CBasePlayer *GetBombDefuser(void) const { return m_bombDefuser; } // return the player currently defusing the bomb, or NULL
float GetBombTimeLeft(void) const; // get the time remaining before the planted bomb explodes
CBaseEntity *GetLooseBomb(void) { return m_looseBomb; } // return the bomb if it is loose on the ground
CNavArea *GetLooseBombArea(void) const { return m_looseBombArea; } // return area that bomb is in/near
bool IsBombPlanted() const { return m_isBombPlanted; } // returns true if bomb has been planted
float GetBombPlantTimestamp() const { return m_bombPlantTimestamp; } // return time bomb was planted
bool IsTimeToPlantBomb() const { return (gpGlobals->time >= m_earliestBombPlantTimestamp); } // return true if it's ok to try to plant bomb
CBasePlayer *GetBombDefuser() const { return m_bombDefuser; } // return the player currently defusing the bomb, or NULL
float GetBombTimeLeft() const; // get the time remaining before the planted bomb explodes
CBaseEntity *GetLooseBomb() { return m_looseBomb; } // return the bomb if it is loose on the ground
CNavArea *GetLooseBombArea() const { return m_looseBombArea; } // return area that bomb is in/near
void SetLooseBomb(CBaseEntity *bomb);
float GetRadioMessageTimestamp(GameEventType event, int teamID) const; // return the last time the given radio message was sent for given team
float GetRadioMessageInterval(GameEventType event, int teamID) const; // return the interval since the last time this message was sent
void SetRadioMessageTimestamp(GameEventType event, int teamID);
void ResetRadioMessageTimestamps(void);
void ResetRadioMessageTimestamps();
float GetLastSeenEnemyTimestamp(void) const { return m_lastSeenEnemyTimestamp; } // return the last time anyone has seen an enemy
void SetLastSeenEnemyTimestamp(void) { m_lastSeenEnemyTimestamp = gpGlobals->time; }
float GetLastSeenEnemyTimestamp() const { return m_lastSeenEnemyTimestamp; } // return the last time anyone has seen an enemy
void SetLastSeenEnemyTimestamp() { m_lastSeenEnemyTimestamp = gpGlobals->time; }
float GetRoundStartTime(void) const { return m_roundStartTimestamp; }
float GetElapsedRoundTime(void) const { return gpGlobals->time - m_roundStartTimestamp; } // return the elapsed time since the current round began
float GetRoundStartTime() const { return m_roundStartTimestamp; }
float GetElapsedRoundTime() const { return gpGlobals->time - m_roundStartTimestamp; } // return the elapsed time since the current round began
bool AllowRogues(void) const { return cv_bot_allow_rogues.value != 0.0f; }
bool AllowPistols(void) const { return cv_bot_allow_pistols.value != 0.0f; }
bool AllowShotguns(void) const { return cv_bot_allow_shotguns.value != 0.0f; }
bool AllowSubMachineGuns(void) const { return cv_bot_allow_sub_machine_guns.value != 0.0f; }
bool AllowRifles(void) const { return cv_bot_allow_rifles.value != 0.0f; }
bool AllowMachineGuns(void) const { return cv_bot_allow_machine_guns.value != 0.0f; }
bool AllowGrenades(void) const { return cv_bot_allow_grenades.value != 0.0f; }
bool AllowSnipers(void) const { return cv_bot_allow_snipers.value != 0.0f; }
bool AllowTacticalShield(void) const { return cv_bot_allow_shield.value != 0.0f; }
bool AllowFriendlyFireDamage(void) const { return friendlyfire.value != 0.0f; }
bool AllowRogues() const { return cv_bot_allow_rogues.value != 0.0f; }
bool AllowPistols() const { return cv_bot_allow_pistols.value != 0.0f; }
bool AllowShotguns() const { return cv_bot_allow_shotguns.value != 0.0f; }
bool AllowSubMachineGuns() const { return cv_bot_allow_sub_machine_guns.value != 0.0f; }
bool AllowRifles() const { return cv_bot_allow_rifles.value != 0.0f; }
bool AllowMachineGuns() const { return cv_bot_allow_machine_guns.value != 0.0f; }
bool AllowGrenades() const { return cv_bot_allow_grenades.value != 0.0f; }
bool AllowSnipers() const { return cv_bot_allow_snipers.value != 0.0f; }
bool AllowTacticalShield() const { return cv_bot_allow_shield.value != 0.0f; }
bool AllowFriendlyFireDamage() const { return friendlyfire.value != 0.0f; }
bool IsWeaponUseable(CBasePlayerItem *item) const; // return true if the bot can use this weapon
bool IsDefenseRushing(void) const { return m_isDefenseRushing; } // returns true if defense team has "decided" to rush this round
bool IsDefenseRushing() const { return m_isDefenseRushing; } // returns true if defense team has "decided" to rush this round
bool IsOnDefense(CBasePlayer *player) const; // return true if this player is on "defense"
bool IsOnOffense(CBasePlayer *player) const; // return true if this player is on "offense"
bool IsRoundOver(void) const { return m_isRoundOver; } // return true if the round has ended
bool IsRoundOver() const { return m_isRoundOver; } // return true if the round has ended
unsigned int GetNavPlace(void) const { return m_navPlace; }
unsigned int GetNavPlace() const { return m_navPlace; }
void SetNavPlace(unsigned int place) { m_navPlace = place; }
enum SkillType { LOW, AVERAGE, HIGH, RANDOM };
NOXREF const char *GetRandomBotName(SkillType skill);
static void MonitorBotCVars(void);
static void MaintainBotQuota(void);
static void MonitorBotCVars();
static void MaintainBotQuota();
static bool AddBot(const BotProfile *profile, BotProfileTeamType team);
#define FROM_CONSOLE true
@ -264,8 +258,7 @@ private:
bool m_isRespawnStarted;
bool m_canRespawn;
bool m_bServerActive;
};/* size: 736, cachelines: 12, members: 25 */
};
/* <2e81a8> ../cstrike/dlls/bot/cs_bot_manager.h:24 */
NOXREF inline int OtherTeam(int team)
@ -274,25 +267,12 @@ NOXREF inline int OtherTeam(int team)
}
/* <111bd2> ../cstrike/dlls/bot/cs_bot_manager.h:266 */
inline CCSBotManager *TheCSBots(void)
inline CCSBotManager *TheCSBots()
{
return reinterpret_cast<CCSBotManager *>(TheBots);
}
void PrintAllEntities(void);
void PrintAllEntities();
void UTIL_DrawBox(Extent *extent, int lifetime, int red, int green, int blue);
#ifdef HOOK_GAMEDLL
typedef const CCSBotManager::Zone *(CCSBotManager::*GET_ZONE_INT)(int) const;
typedef const CCSBotManager::Zone *(CCSBotManager::*GET_ZONE_VECTOR)(const Vector *pos) const;
typedef const CCSBotManager::Zone *(CCSBotManager::*GET_CLOSEST_ZONE_ENT)(const CBaseEntity *entity) const;
typedef const CCSBotManager::Zone *(CCSBotManager::*GET_CLOSEST_ZONE_VECTOR)(const Vector *pos) const;
#endif // HOOK_GAMEDLL
// refs
extern void (*pCCSBotManager__AddBot)(void);
#endif // CS_BOT_MANAGER_H

View File

@ -3,7 +3,7 @@
// Reset the stuck-checker.
/* <37c284> ../cstrike/dlls/bot/cs_bot_nav.cpp:16 */
void CCSBot::ResetStuckMonitor(void)
void CCSBot::ResetStuckMonitor()
{
if (m_isStuck)
{
@ -26,7 +26,7 @@ void CCSBot::ResetStuckMonitor(void)
// Test if we have become stuck
/* <37c2a6> ../cstrike/dlls/bot/cs_bot_nav.cpp:37 */
void CCSBot::StuckCheck(void)
void CCSBot::StuckCheck()
{
if (m_isStuck)
{
@ -160,7 +160,7 @@ bool CCSBot::GetSimpleGroundHeightWithFloor(const Vector *pos, float *height, Ve
}
/* <37c4b8> ../cstrike/dlls/bot/cs_bot_nav.cpp:172 */
Place CCSBot::GetPlace(void) const
Place CCSBot::GetPlace() const
{
if (m_lastKnownArea != NULL)
return m_lastKnownArea->GetPlace();
@ -319,7 +319,7 @@ void CCSBot::StrafeAwayFromPosition(const Vector *pos)
// For getting un-stuck
/* <37cc52> ../cstrike/dlls/bot/cs_bot_nav.cpp:338 */
void CCSBot::Wiggle(void)
void CCSBot::Wiggle()
{
if (IsCrouching())
{
@ -363,7 +363,7 @@ void CCSBot::Wiggle(void)
// Determine approach points from eye position and approach areas of current area
/* <37cc94> ../cstrike/dlls/bot/cs_bot_nav.cpp:383 */
void CCSBot::ComputeApproachPoints(void)
void CCSBot::ComputeApproachPoints()
{
m_approachPointCount = 0;
@ -408,7 +408,7 @@ void CCSBot::ComputeApproachPoints(void)
}
/* <37cd67> ../cstrike/dlls/bot/cs_bot_nav.cpp:422 */
void CCSBot::DrawApproachPoints(void)
void CCSBot::DrawApproachPoints()
{
for (int i = 0; i < m_approachPointCount; ++i)
{

View File

@ -3,7 +3,7 @@
// Determine actual path positions bot will move between along the path
/* <38db02> ../cstrike/dlls/bot/cs_bot_pathfind.cpp:30 */
bool CCSBot::ComputePathPositions(void)
bool CCSBot::ComputePathPositions()
{
if (m_pathLength == 0)
return false;
@ -127,7 +127,7 @@ bool CCSBot::ComputePathPositions(void)
// If next step of path uses a ladder, prepare to traverse it
/* <38d424> ../cstrike/dlls/bot/cs_bot_pathfind.cpp:155 */
void CCSBot::SetupLadderMovement(void)
void CCSBot::SetupLadderMovement()
{
if (m_pathIndex < 1 || m_pathLength == 0)
return;
@ -223,7 +223,7 @@ void CCSBot::ComputeLadderEndpoint(bool isAscending)
// TODO: Need Push() and Pop() for run/walk context to keep ladder speed contained.
/* <38de76> ../cstrike/dlls/bot/cs_bot_pathfind.cpp:248 */
bool CCSBot::UpdateLadderMovement(void)
bool CCSBot::UpdateLadderMovement()
{
if (m_pathLadder == NULL)
return false;
@ -1047,7 +1047,7 @@ void CCSBot::SetPathIndex(int newIndex)
// Return true if nearing a jump in the path
/* <38cafc> ../cstrike/dlls/bot/cs_bot_pathfind.cpp:1077 */
bool CCSBot::IsNearJump(void) const
bool CCSBot::IsNearJump() const
{
if (m_pathIndex == 0 || m_pathIndex >= m_pathLength)
return false;
@ -1733,7 +1733,7 @@ bool CCSBot::ComputePath(CNavArea *goalArea, const Vector *goal, RouteType route
// Return estimated distance left to travel along path
/* <390ef6> ../cstrike/dlls/bot/cs_bot_pathfind.cpp:1798 */
float CCSBot::GetPathDistanceRemaining(void) const
float CCSBot::GetPathDistanceRemaining() const
{
if (!HasPath())
return -1.0f;
@ -1755,7 +1755,7 @@ float CCSBot::GetPathDistanceRemaining(void) const
// Draw a portion of our current path for debugging.
/* <390fb1> ../cstrike/dlls/bot/cs_bot_pathfind.cpp:1821 */
void CCSBot::DrawPath(void)
void CCSBot::DrawPath()
{
if (!HasPath())
return;

View File

@ -20,7 +20,7 @@ bool CCSBot::IsRadioCommand(GameEventType event) const
// Respond to radio commands from HUMAN players
/* <3a36e0> ../cstrike/dlls/bot/cs_bot_radio.cpp:37 */
void CCSBot::RespondToRadioCommands(void)
void CCSBot::RespondToRadioCommands()
{
// bots use the chatter system to respond to each other
if (m_radioSubject != NULL && m_radioSubject->IsPlayer())
@ -309,7 +309,7 @@ void CCSBot::SendRadioMessage(GameEventType event)
m_lastRadioSentTimestamp = gpGlobals->time;
char slot[2];
slot[1] = '\000';
slot[1] = '\0';
if (event > EVENT_START_RADIO_1 && event < EVENT_START_RADIO_2)
{

View File

@ -21,14 +21,14 @@ void CCSBot::SetState(BotState *state)
}
/* <3b3ab4> ../cstrike/dlls/bot/cs_bot_statemachine.cpp:34 */
void CCSBot::Idle(void)
void CCSBot::Idle()
{
SetTask(SEEK_AND_DESTROY);
SetState(&m_idleState);
}
/* <3b3afa> ../cstrike/dlls/bot/cs_bot_statemachine.cpp:41 */
void CCSBot::EscapeFromBomb(void)
void CCSBot::EscapeFromBomb()
{
SetTask(ESCAPE_FROM_BOMB);
SetState(&m_escapeFromBombState);
@ -55,7 +55,7 @@ void CCSBot::Follow(CBasePlayer *player)
// Continue following our leader after finishing what we were doing
/* <3b3bd1> ../cstrike/dlls/bot/cs_bot_statemachine.cpp:69 */
void CCSBot::ContinueFollowing(void)
void CCSBot::ContinueFollowing()
{
SetTask(FOLLOW);
m_followState.SetLeader(m_leader);
@ -65,7 +65,7 @@ void CCSBot::ContinueFollowing(void)
// Stop following
/* <3b3c57> ../cstrike/dlls/bot/cs_bot_statemachine.cpp:83 */
void CCSBot::StopFollowing(void)
void CCSBot::StopFollowing()
{
m_isFollowing = false;
m_leader = NULL;
@ -75,7 +75,7 @@ void CCSBot::StopFollowing(void)
// Begin process of rescuing hostages
/* <3b3c7e> ../cstrike/dlls/bot/cs_bot_statemachine.cpp:94 */
void CCSBot::RescueHostages(void)
void CCSBot::RescueHostages()
{
SetTask(RESCUE_HOSTAGES);
}
@ -237,7 +237,7 @@ bool CCSBot::TryToHide(CNavArea *searchFromArea, float duration, float hideRange
// Retreat to a nearby hiding spot, away from enemies
/* <3b40ed> ../cstrike/dlls/bot/cs_bot_statemachine.cpp:256 */
bool CCSBot::TryToRetreat(void)
bool CCSBot::TryToRetreat()
{
const float maxRange = 1000.0f;
const Vector *spot = FindNearbyRetreatSpot(this, maxRange);
@ -262,7 +262,7 @@ bool CCSBot::TryToRetreat(void)
}
/* <3b426a> ../cstrike/dlls/bot/cs_bot_statemachine.cpp:280 */
void CCSBot::Hunt(void)
void CCSBot::Hunt()
{
SetState(&m_huntState);
}
@ -332,7 +332,7 @@ void CCSBot::Attack(CBasePlayer *victim)
// Exit the Attack state
/* <3b4416> ../cstrike/dlls/bot/cs_bot_statemachine.cpp:366 */
void CCSBot::StopAttacking(void)
void CCSBot::StopAttacking()
{
PrintIfWatched("ATTACK END\n");
m_attackState.OnExit(this);
@ -346,7 +346,7 @@ void CCSBot::StopAttacking(void)
}
/* <3b447d> ../cstrike/dlls/bot/cs_bot_statemachine.cpp:378 */
bool CCSBot::IsAttacking(void) const
bool CCSBot::IsAttacking() const
{
return m_isAttacking;
}
@ -354,7 +354,7 @@ bool CCSBot::IsAttacking(void) const
// Return true if we are escaping from the bomb
/* <3b449f> ../cstrike/dlls/bot/cs_bot_statemachine.cpp:387 */
bool CCSBot::IsEscapingFromBomb(void) const
bool CCSBot::IsEscapingFromBomb() const
{
if (m_state == static_cast<const BotState *>(&m_escapeFromBombState))
return true;
@ -365,7 +365,7 @@ bool CCSBot::IsEscapingFromBomb(void) const
// Return true if we are defusing the bomb
/* <3b44c6> ../cstrike/dlls/bot/cs_bot_statemachine.cpp:399 */
bool CCSBot::IsDefusingBomb(void) const
bool CCSBot::IsDefusingBomb() const
{
if (m_state == static_cast<const BotState *>(&m_defuseBombState))
return true;
@ -376,7 +376,7 @@ bool CCSBot::IsDefusingBomb(void) const
// Return true if we are hiding
/* <3b44ed> ../cstrike/dlls/bot/cs_bot_statemachine.cpp:411 */
bool CCSBot::IsHiding(void) const
bool CCSBot::IsHiding() const
{
if (m_state == static_cast<const BotState *>(&m_hideState))
return true;
@ -387,7 +387,7 @@ bool CCSBot::IsHiding(void) const
// Return true if we are hiding and at our hiding spot
/* <3b450f> ../cstrike/dlls/bot/cs_bot_statemachine.cpp:423 */
bool CCSBot::IsAtHidingSpot(void) const
bool CCSBot::IsAtHidingSpot() const
{
if (!IsHiding())
return false;
@ -398,7 +398,7 @@ bool CCSBot::IsAtHidingSpot(void) const
// Return true if we are huting
/* <3b454a> ../cstrike/dlls/bot/cs_bot_statemachine.cpp:435 */
bool CCSBot::IsHunting(void) const
bool CCSBot::IsHunting() const
{
if (m_state == static_cast<const BotState *>(&m_huntState))
return true;
@ -409,7 +409,7 @@ bool CCSBot::IsHunting(void) const
// Return true if we are in the MoveTo state
/* <3b4571> ../cstrike/dlls/bot/cs_bot_statemachine.cpp:447 */
bool CCSBot::IsMovingTo(void) const
bool CCSBot::IsMovingTo() const
{
if (m_state == static_cast<const BotState *>(&m_moveToState))
return true;
@ -420,7 +420,7 @@ bool CCSBot::IsMovingTo(void) const
// Return true if we are buying
/* <3b4598> ../cstrike/dlls/bot/cs_bot_statemachine.cpp:460 */
bool CCSBot::IsBuying(void) const
bool CCSBot::IsBuying() const
{
if (m_state == static_cast<const BotState *>(&m_buyState))
return true;
@ -439,7 +439,7 @@ void CCSBot::MoveTo(const Vector *pos, RouteType route)
}
/* <3b463c> ../cstrike/dlls/bot/cs_bot_statemachine.cpp:480 */
void CCSBot::PlantBomb(void)
void CCSBot::PlantBomb()
{
SetState(&m_plantBombState);
}
@ -447,13 +447,13 @@ void CCSBot::PlantBomb(void)
// Bomb has been dropped - go get it
/* <3b4663> ../cstrike/dlls/bot/cs_bot_statemachine.cpp:489 */
void CCSBot::FetchBomb(void)
void CCSBot::FetchBomb()
{
SetState(&m_fetchBombState);
}
/* <3b468a> ../cstrike/dlls/bot/cs_bot_statemachine.cpp:495 */
void CCSBot::DefuseBomb(void)
void CCSBot::DefuseBomb()
{
SetState(&m_defuseBombState);
}
@ -461,7 +461,7 @@ void CCSBot::DefuseBomb(void)
// Investigate recent enemy noise
/* <3b46b1> ../cstrike/dlls/bot/cs_bot_statemachine.cpp:504 */
void CCSBot::InvestigateNoise(void)
void CCSBot::InvestigateNoise()
{
SetState(&m_investigateNoiseState);
}

View File

@ -3,7 +3,7 @@
// Lightweight maintenance, invoked frequently
/* <3c635f> ../cstrike/dlls/bot/cs_bot_update.cpp:26 */
void CCSBot::__MAKE_VHOOK(Upkeep)(void)
void CCSBot::__MAKE_VHOOK(Upkeep)()
{
CCSBotManager *ctrl = TheCSBots();
@ -153,7 +153,7 @@ void CCSBot::__MAKE_VHOOK(Upkeep)(void)
// Heavyweight processing, invoked less often
/* <3c6e1e> ../cstrike/dlls/bot/cs_bot_update.cpp:208 */
void CCSBot::__MAKE_VHOOK(Update)(void)
void CCSBot::__MAKE_VHOOK(Update)()
{
CCSBotManager *ctrl = TheCSBots();
@ -745,17 +745,3 @@ void CCSBot::__MAKE_VHOOK(Update)(void)
// remember our prior safe time status
m_wasSafe = IsSafe();
}
#ifdef HOOK_GAMEDLL
void CCSBot::Upkeep(void)
{
Upkeep_();
}
void CCSBot::Update(void)
{
Update_();
}
#endif // HOOK_GAMEDLL

View File

@ -31,7 +31,7 @@ float StayOnLadderLine(CCSBot *me, const CNavLadder *ladder)
/* <3d882c> ../cstrike/dlls/bot/cs_bot_vision.cpp:48 */
#ifndef HOOK_GAMEDLL
void CCSBot::UpdateLookAngles(void)
void CCSBot::UpdateLookAngles()
{
const float deltaT = g_flBotCommandInterval;
float maxAccel;
@ -293,7 +293,7 @@ bool CCSBot::__MAKE_VHOOK(IsEnemyPartVisible)(VisiblePartType part) const
}
/* <3d8f0d> ../cstrike/dlls/bot/cs_bot_vision.cpp:331 */
void CCSBot::UpdateLookAt(void)
void CCSBot::UpdateLookAt()
{
Vector to = m_lookAtSpot - EyePosition();
Vector idealAngle = UTIL_VecToAngles(to);
@ -348,7 +348,7 @@ void CCSBot::InhibitLookAround(float duration)
// Update enounter spot timestamps, etc
/* <3d90d3> ../cstrike/dlls/bot/cs_bot_vision.cpp:392 */
void CCSBot::UpdatePeripheralVision(void)
void CCSBot::UpdatePeripheralVision()
{
// if we update at 10Hz, this ensures we test once every three
const float peripheralUpdateInterval = 0.29f;
@ -653,7 +653,7 @@ bool CCSBot::BendLineOfSight(const Vector *eye, const Vector *point, Vector *ben
}
/* <3d99e8> ../cstrike/dlls/bot/cs_bot_vision.cpp:707 */
CBasePlayer *CCSBot::FindMostDangerousThreat(void)
CBasePlayer *CCSBot::FindMostDangerousThreat()
{
// maximum number of simulataneously attendable threats
enum { MAX_THREATS = 16 };
@ -909,7 +909,7 @@ CBasePlayer *CCSBot::FindMostDangerousThreat(void)
// Update our reaction time queue
/* <3d9f7d> ../cstrike/dlls/bot/cs_bot_vision.cpp:960 */
void CCSBot::UpdateReactionQueue(void)
void CCSBot::UpdateReactionQueue()
{
// zombies dont see any threats
if (cv_bot_zombie.value > 0.0f)
@ -961,7 +961,7 @@ void CCSBot::UpdateReactionQueue(void)
// Return the most dangerous threat we are "conscious" of
/* <3da052> ../cstrike/dlls/bot/cs_bot_vision.cpp:1013 */
CBasePlayer *CCSBot::GetRecognizedEnemy(void)
CBasePlayer *CCSBot::GetRecognizedEnemy()
{
if (m_enemyQueueAttendIndex >= m_enemyQueueCount)
return NULL;
@ -972,7 +972,7 @@ CBasePlayer *CCSBot::GetRecognizedEnemy(void)
// Return true if the enemy we are "conscious" of is reloading
/* <3da075> ../cstrike/dlls/bot/cs_bot_vision.cpp:1025 */
bool CCSBot::IsRecognizedEnemyReloading(void)
bool CCSBot::IsRecognizedEnemyReloading()
{
if (m_enemyQueueAttendIndex >= m_enemyQueueCount)
return false;
@ -983,7 +983,7 @@ bool CCSBot::IsRecognizedEnemyReloading(void)
// Return true if the enemy we are "conscious" of is hiding behind a shield
/* <3da09d> ../cstrike/dlls/bot/cs_bot_vision.cpp:1037 */
bool CCSBot::IsRecognizedEnemyProtectedByShield(void)
bool CCSBot::IsRecognizedEnemyProtectedByShield()
{
if (m_enemyQueueAttendIndex >= m_enemyQueueCount)
return false;
@ -994,7 +994,7 @@ bool CCSBot::IsRecognizedEnemyProtectedByShield(void)
// Return distance to closest enemy we are "conscious" of
/* <3da0c5> ../cstrike/dlls/bot/cs_bot_vision.cpp:1049 */
float CCSBot::GetRangeToNearestRecognizedEnemy(void)
float CCSBot::GetRangeToNearestRecognizedEnemy()
{
const CBasePlayer *enemy = GetRecognizedEnemy();
@ -1030,33 +1030,3 @@ void CCSBot::__MAKE_VHOOK(Blind)(float duration, float holdTime, float fadeTime,
// no longer safe
AdjustSafeTime();
}
#ifdef HOOK_GAMEDLL
void (*pCCSBot__UpdateLookAngles)(void);
void __declspec(naked) CCSBot::UpdateLookAngles(void)
{
__asm { jmp pCCSBot__UpdateLookAngles }
}
void CCSBot::Blind(float duration, float holdTime, float fadeTime, int alpha)
{
Blind_(duration, holdTime, fadeTime, alpha);
}
bool CCSBot::IsVisible(const Vector *pos, bool testFOV) const
{
return IsVisible_(pos, testFOV);
}
bool CCSBot::IsVisible(CBasePlayer *player, bool testFOV, unsigned char *visParts) const
{
return IsVisible_(player, testFOV, visParts);
}
bool CCSBot::IsEnemyPartVisible(VisiblePartType part) const
{
return IsEnemyPartVisible_(part);
}
#endif // HOOK_GAMEDLL

View File

@ -4,7 +4,7 @@
// NOTE: Aiming our weapon is handled in RunBotUpkeep()
/* <3eb434> ../cstrike/dlls/bot/cs_bot_weapon.cpp:17 */
void CCSBot::FireWeaponAtEnemy(void)
void CCSBot::FireWeaponAtEnemy()
{
CBasePlayer *enemy = GetEnemy();
if (enemy == NULL)
@ -195,7 +195,7 @@ void CCSBot::SetAimOffset(float accuracy)
// Wiggle aim error based on GetProfile()->GetSkill()
/* <3ea224> ../cstrike/dlls/bot/cs_bot_weapon.cpp:252 */
void CCSBot::UpdateAimOffset(void)
void CCSBot::UpdateAimOffset()
{
if (gpGlobals->time >= m_aimOffsetTimestamp)
{
@ -287,7 +287,7 @@ bool isSniperRifle(CBasePlayerItem *item)
}
/* <3ea3ab> ../cstrike/dlls/bot/cs_bot_weapon.cpp:342 */
bool CCSBot::IsUsingAWP(void) const
bool CCSBot::IsUsingAWP() const
{
CBasePlayerWeapon *weapon = GetActiveWeapon();
@ -300,7 +300,7 @@ bool CCSBot::IsUsingAWP(void) const
// Returns true if we are using a weapon with a removable silencer
/* <3ea3ce> ../cstrike/dlls/bot/cs_bot_weapon.cpp:357 */
bool CCSBot::DoesActiveWeaponHaveSilencer(void) const
bool CCSBot::DoesActiveWeaponHaveSilencer() const
{
CBasePlayerWeapon *weapon = GetActiveWeapon();
@ -316,7 +316,7 @@ bool CCSBot::DoesActiveWeaponHaveSilencer(void) const
// Return true if we are using a sniper rifle
/* <3ea3f1> ../cstrike/dlls/bot/cs_bot_weapon.cpp:375 */
bool CCSBot::IsUsingSniperRifle(void) const
bool CCSBot::IsUsingSniperRifle() const
{
CBasePlayerWeapon *weapon = GetActiveWeapon();
@ -329,7 +329,7 @@ bool CCSBot::IsUsingSniperRifle(void) const
// Return true if we have a sniper rifle in our inventory
/* <3ea462> ../cstrike/dlls/bot/cs_bot_weapon.cpp:387 */
bool CCSBot::IsSniper(void) const
bool CCSBot::IsSniper() const
{
for (int i = 0; i < MAX_ITEM_TYPES; ++i)
{
@ -350,7 +350,7 @@ bool CCSBot::IsSniper(void) const
// Return true if we are actively sniping (moving to sniper spot or settled in)
/* <3ea4c1> ../cstrike/dlls/bot/cs_bot_weapon.cpp:405 */
bool CCSBot::IsSniping(void) const
bool CCSBot::IsSniping() const
{
if (GetTask() == MOVE_TO_SNIPER_SPOT || GetTask() == SNIPING)
return true;
@ -361,7 +361,7 @@ bool CCSBot::IsSniping(void) const
// Return true if we are using a shotgun
/* <3ea4e8> ../cstrike/dlls/bot/cs_bot_weapon.cpp:417 */
bool CCSBot::IsUsingShotgun(void) const
bool CCSBot::IsUsingShotgun() const
{
CBasePlayerWeapon *weapon = GetActiveWeapon();
@ -377,7 +377,7 @@ bool CCSBot::IsUsingShotgun(void) const
// Returns true if using the big 'ol machinegun
/* <3ea50f> ../cstrike/dlls/bot/cs_bot_weapon.cpp:437 */
bool CCSBot::IsUsingMachinegun(void) const
bool CCSBot::IsUsingMachinegun() const
{
CBasePlayerWeapon *weapon = GetActiveWeapon();
@ -390,7 +390,7 @@ bool CCSBot::IsUsingMachinegun(void) const
// Return true if primary weapon doesn't exist or is totally out of ammo
/* <3ea532> ../cstrike/dlls/bot/cs_bot_weapon.cpp:449 */
bool CCSBot::IsPrimaryWeaponEmpty(void) const
bool CCSBot::IsPrimaryWeaponEmpty() const
{
CBasePlayerWeapon *weapon = static_cast<CBasePlayerWeapon *>(m_rgpPlayerItems[ PRIMARY_WEAPON_SLOT ]);
@ -407,7 +407,7 @@ bool CCSBot::IsPrimaryWeaponEmpty(void) const
// Return true if pistol doesn't exist or is totally out of ammo
/* <3ea578> ../cstrike/dlls/bot/cs_bot_weapon.cpp:467 */
bool CCSBot::IsPistolEmpty(void) const
bool CCSBot::IsPistolEmpty() const
{
CBasePlayerWeapon *weapon = static_cast<CBasePlayerWeapon *>(m_rgpPlayerItems[ PISTOL_SLOT ]);
@ -490,7 +490,7 @@ void CCSBot::EquipBestWeapon(bool mustEquip)
// Equip our pistol
/* <3ea7fe> ../cstrike/dlls/bot/cs_bot_weapon.cpp:557 */
void CCSBot::EquipPistol(void)
void CCSBot::EquipPistol()
{
// throttle how often equipping is allowed
if (m_equipTimer.GetElapsedTime() < minEquipInterval)
@ -506,7 +506,7 @@ void CCSBot::EquipPistol(void)
// Equip the knife
/* <3ea91a> ../cstrike/dlls/bot/cs_bot_weapon.cpp:575 */
void CCSBot::EquipKnife(void)
void CCSBot::EquipKnife()
{
if (!IsUsingKnife())
{
@ -521,7 +521,7 @@ void CCSBot::EquipKnife(void)
// Return true if we have a grenade in our inventory
/* <3ea98b> ../cstrike/dlls/bot/cs_bot_weapon.cpp:589 */
bool CCSBot::HasGrenade(void) const
bool CCSBot::HasGrenade() const
{
CBasePlayerWeapon *grenade = static_cast<CBasePlayerWeapon *>(m_rgpPlayerItems[ GRENADE_SLOT ]);
return grenade != NULL;
@ -559,7 +559,7 @@ bool CCSBot::EquipGrenade(bool noSmoke)
// Returns true if we have knife equipped
/* <3eaa8c> ../cstrike/dlls/bot/cs_bot_weapon.cpp:624 */
bool CCSBot::IsUsingKnife(void) const
bool CCSBot::IsUsingKnife() const
{
CBasePlayerWeapon *weapon = GetActiveWeapon();
@ -572,7 +572,7 @@ bool CCSBot::IsUsingKnife(void) const
// Returns true if we have pistol equipped
/* <3eaac2> ../cstrike/dlls/bot/cs_bot_weapon.cpp:638 */
bool CCSBot::IsUsingPistol(void) const
bool CCSBot::IsUsingPistol() const
{
CBasePlayerWeapon *weapon = GetActiveWeapon();
@ -585,7 +585,7 @@ bool CCSBot::IsUsingPistol(void) const
// Returns true if we have a grenade equipped
/* <3eab09> ../cstrike/dlls/bot/cs_bot_weapon.cpp:652 */
bool CCSBot::IsUsingGrenade(void) const
bool CCSBot::IsUsingGrenade() const
{
CBasePlayerWeapon *weapon = GetActiveWeapon();
@ -601,7 +601,7 @@ bool CCSBot::IsUsingGrenade(void) const
}
/* <3eab3f> ../cstrike/dlls/bot/cs_bot_weapon.cpp:672 */
bool CCSBot::IsUsingHEGrenade(void) const
bool CCSBot::IsUsingHEGrenade() const
{
CBasePlayerWeapon *weapon = GetActiveWeapon();
@ -730,7 +730,7 @@ bool CCSBot::FindGrenadeTossPathTarget(Vector *pos)
// Reload our weapon if we must
/* <3eaf22> ../cstrike/dlls/bot/cs_bot_weapon.cpp:810 */
void CCSBot::ReloadCheck(void)
void CCSBot::ReloadCheck()
{
const float safeReloadWaitTime = 3.0f;
const float reloadAmmoRatio = 0.6f;
@ -804,7 +804,7 @@ void CCSBot::ReloadCheck(void)
// Silence/unsilence our weapon if we must
/* <3eb0ac> ../cstrike/dlls/bot/cs_bot_weapon.cpp:885 */
void CCSBot::SilencerCheck(void)
void CCSBot::SilencerCheck()
{
// longer than reload check because reloading should take precedence
const float safeSilencerWaitTime = 3.5f;
@ -898,7 +898,7 @@ void CCSBot::__MAKE_VHOOK(OnTouchingWeapon)(CWeaponBox *box)
// TODO: Check more rays for safety.
/* <3eb277> ../cstrike/dlls/bot/cs_bot_weapon.cpp:977 */
bool CCSBot::IsFriendInLineOfFire(void)
bool CCSBot::IsFriendInLineOfFire()
{
UTIL_MakeVectors(pev->punchangle + pev->v_angle);
@ -930,7 +930,7 @@ bool CCSBot::IsFriendInLineOfFire(void)
// TODO: Re-use this computation with IsFriendInLineOfFire()
/* <3eb84d> ../cstrike/dlls/bot/cs_bot_weapon.cpp:1009 */
float CCSBot::ComputeWeaponSightRange(void)
float CCSBot::ComputeWeaponSightRange()
{
UTIL_MakeVectors(pev->punchangle + pev->v_angle);
@ -944,12 +944,3 @@ float CCSBot::ComputeWeaponSightRange(void)
return (GetGunPosition() - result.vecEndPos).Length();
}
#ifdef HOOK_GAMEDLL
void CCSBot::OnTouchingWeapon(CWeaponBox *box)
{
OnTouchingWeapon_(box);
}
#endif // HOOK_GAMEDLL

View File

@ -31,7 +31,7 @@ CSGameState::CSGameState(CCSBot *owner)
// Reset at round start
/* <3fd4f4> ../cstrike/dlls/bot/cs_gamestate.cpp:55 */
void CSGameState::Reset(void)
void CSGameState::Reset()
{
int i;
CCSBotManager *ctrl = TheCSBots();
@ -105,7 +105,7 @@ void CSGameState::OnEvent(GameEventType event, CBaseEntity *entity, CBaseEntity
// True if round has been won or lost (but not yet reset)
/* <3fcf9c> ../cstrike/dlls/bot/cs_gamestate.cpp:144 */
bool CSGameState::IsRoundOver(void) const
bool CSGameState::IsRoundOver() const
{
return m_isRoundOver;
}
@ -131,13 +131,13 @@ void CSGameState::UpdateLooseBomb(const Vector *pos)
}
/* <3fd06e> ../cstrike/dlls/bot/cs_gamestate.cpp:170 */
float CSGameState::TimeSinceLastSawLooseBomb(void) const
float CSGameState::TimeSinceLastSawLooseBomb() const
{
return m_lastSawLooseBomb.GetElapsedTime();
}
/* <3fd0f4> ../cstrike/dlls/bot/cs_gamestate.cpp:176 */
bool CSGameState::IsLooseBombLocationKnown(void) const
bool CSGameState::IsLooseBombLocationKnown() const
{
if (m_bombState != LOOSE)
return false;
@ -156,13 +156,13 @@ void CSGameState::UpdateBomber(const Vector *pos)
}
/* <3fd1b1> ../cstrike/dlls/bot/cs_gamestate.cpp:195 */
float CSGameState::TimeSinceLastSawBomber(void) const
float CSGameState::TimeSinceLastSawBomber() const
{
return m_lastSawBomber.GetElapsedTime();
}
/* <3fd237> ../cstrike/dlls/bot/cs_gamestate.cpp:201 */
bool CSGameState::IsPlantedBombLocationKnown(void) const
bool CSGameState::IsPlantedBombLocationKnown() const
{
if (m_bombState != PLANTED)
return false;
@ -173,7 +173,7 @@ bool CSGameState::IsPlantedBombLocationKnown(void) const
// Return the zone index of the planted bombsite, or UNKNOWN
/* <3fd25a> ../cstrike/dlls/bot/cs_gamestate.cpp:213 */
int CSGameState::GetPlantedBombsite(void) const
int CSGameState::GetPlantedBombsite() const
{
if (m_bombState != PLANTED)
return UNKNOWN;
@ -184,7 +184,7 @@ int CSGameState::GetPlantedBombsite(void) const
// Return true if we are currently in the bombsite where the bomb is planted
/* <3fd284> ../cstrike/dlls/bot/cs_gamestate.cpp:225 */
bool CSGameState::IsAtPlantedBombsite(void) const
bool CSGameState::IsAtPlantedBombsite() const
{
if (m_bombState != PLANTED)
return false;
@ -203,7 +203,7 @@ bool CSGameState::IsAtPlantedBombsite(void) const
// Return the zone index of the next bombsite to search
/* <3fd2d2> ../cstrike/dlls/bot/cs_gamestate.cpp:246 */
int CSGameState::GetNextBombsiteToSearch(void)
int CSGameState::GetNextBombsiteToSearch()
{
if (m_bombsiteCount <= 0)
return 0;
@ -234,7 +234,7 @@ int CSGameState::GetNextBombsiteToSearch(void)
// or NULL if we don't know where the bomb is
/* <3fd32c> ../cstrike/dlls/bot/cs_gamestate.cpp:277 */
const Vector *CSGameState::GetBombPosition(void) const
const Vector *CSGameState::GetBombPosition() const
{
switch (m_bombState)
{
@ -315,7 +315,7 @@ bool CSGameState::IsBombsiteClear(int zoneIndex) const
}
/* <3fd4b0> ../cstrike/dlls/bot/cs_gamestate.cpp:367 */
void CSGameState::InitializeHostageInfo(void)
void CSGameState::InitializeHostageInfo()
{
m_hostageCount = 0;
m_allHostagesRescued = 0;
@ -414,7 +414,7 @@ CHostage *CSGameState::GetNearestFreeHostage(Vector *knowPos) const
// Return the location of a "free" hostage, or NULL if we dont know of any
/* <3fdbd3> ../cstrike/dlls/bot/cs_gamestate.cpp:461 */
const Vector *CSGameState::GetRandomFreeHostagePosition(void)
const Vector *CSGameState::GetRandomFreeHostagePosition()
{
// TODO: use static?
const Vector *freePos[MAX_HOSTAGES];
@ -462,7 +462,7 @@ const Vector *CSGameState::GetRandomFreeHostagePosition(void)
// Return status of any changes (a hostage died or was moved)
/* <3fdcd2> ../cstrike/dlls/bot/cs_gamestate.cpp:509 */
CSGameState::ValidateStatusType CSGameState::ValidateHostagePositions(void)
CSGameState::ValidateStatusType CSGameState::ValidateHostagePositions()
{
// limit how often we validate
if (!m_validateInterval.IsElapsed())
@ -580,7 +580,7 @@ CSGameState::ValidateStatusType CSGameState::ValidateHostagePositions(void)
// Since we can actually see any hostage we return, we know its actual position
/* <3fdef7> ../cstrike/dlls/bot/cs_gamestate.cpp:626 */
CHostage *CSGameState::GetNearestVisibleFreeHostage(void) const
CHostage *CSGameState::GetNearestVisibleFreeHostage() const
{
CHostage *close = NULL;
float closeRangeSq = 999999999.9f;
@ -623,7 +623,7 @@ CHostage *CSGameState::GetNearestVisibleFreeHostage(void) const
// Return true if there are no free hostages
/* <3fe064> ../cstrike/dlls/bot/cs_gamestate.cpp:668 */
bool CSGameState::AreAllHostagesBeingRescued(void) const
bool CSGameState::AreAllHostagesBeingRescued() const
{
// if the hostages have all been rescued, they are not being rescued any longer
if (m_allHostagesRescued)
@ -666,7 +666,7 @@ bool CSGameState::AreAllHostagesBeingRescued(void) const
// All hostages have been rescued or are dead
/* <3fe148> ../cstrike/dlls/bot/cs_gamestate.cpp:712 */
bool CSGameState::AreAllHostagesGone(void) const
bool CSGameState::AreAllHostagesGone() const
{
if (m_allHostagesRescued)
return true;
@ -695,7 +695,7 @@ bool CSGameState::AreAllHostagesGone(void) const
// Someone told us all the hostages are gone
/* <3fe1a2> ../cstrike/dlls/bot/cs_gamestate.cpp:742 */
void CSGameState::AllHostagesGone(void)
void CSGameState::AllHostagesGone()
{
for (int i = 0; i < m_hostageCount; ++i)
m_hostage[i].isValid = false;

View File

@ -41,9 +41,9 @@ public:
CSGameState() {};
CSGameState(CCSBot *owner);
void Reset(void);
void Reset();
void OnEvent(GameEventType event, CBaseEntity *entity, CBaseEntity *other); // Event handling
bool IsRoundOver(void) const; // true if round has been won or lost (but not yet reset)
bool IsRoundOver() const; // true if round has been won or lost (but not yet reset)
// bomb defuse scenario
enum BombState
@ -55,43 +55,43 @@ public:
EXPLODED, // the bomb has exploded
};
bool IsBombMoving(void) const { return (m_bombState == MOVING); }
bool IsBombLoose(void) const { return (m_bombState == LOOSE); }
bool IsBombPlanted(void) const { return (m_bombState == PLANTED); }
bool IsBombDefused(void) const { return (m_bombState == DEFUSED); }
bool IsBombExploded(void) const { return (m_bombState == EXPLODED); }
bool IsBombMoving() const { return (m_bombState == MOVING); }
bool IsBombLoose() const { return (m_bombState == LOOSE); }
bool IsBombPlanted() const { return (m_bombState == PLANTED); }
bool IsBombDefused() const { return (m_bombState == DEFUSED); }
bool IsBombExploded() const { return (m_bombState == EXPLODED); }
void UpdateLooseBomb(const Vector *pos); // we see the loose bomb
float TimeSinceLastSawLooseBomb(void) const; // how long has is been since we saw the loose bomb
bool IsLooseBombLocationKnown(void) const; // do we know where the loose bomb is
float TimeSinceLastSawLooseBomb() const; // how long has is been since we saw the loose bomb
bool IsLooseBombLocationKnown() const; // do we know where the loose bomb is
void UpdateBomber(const Vector *pos); // we see the bomber
float TimeSinceLastSawBomber(void) const; // how long has is been since we saw the bomber
float TimeSinceLastSawBomber() const; // how long has is been since we saw the bomber
void UpdatePlantedBomb(const Vector *pos); // we see the planted bomb
bool IsPlantedBombLocationKnown(void) const; // do we know where the bomb was planted
bool IsPlantedBombLocationKnown() const; // do we know where the bomb was planted
void MarkBombsiteAsPlanted(int zoneIndex); // mark bombsite as the location of the planted bomb
enum { UNKNOWN = -1 };
int GetPlantedBombsite(void) const; // return the zone index of the planted bombsite, or UNKNOWN
bool IsAtPlantedBombsite(void) const; // return true if we are currently in the bombsite where the bomb is planted
int GetPlantedBombsite() const; // return the zone index of the planted bombsite, or UNKNOWN
bool IsAtPlantedBombsite() const; // return true if we are currently in the bombsite where the bomb is planted
int GetNextBombsiteToSearch(void); // return the zone index of the next bombsite to search
int GetNextBombsiteToSearch(); // return the zone index of the next bombsite to search
bool IsBombsiteClear(int zoneIndex) const; // return true if given bombsite has been cleared
void ClearBombsite(int zoneIndex); // mark bombsite as clear
const Vector *GetBombPosition(void) const; // return where we think the bomb is, or NULL if we don't know
const Vector *GetBombPosition() const; // return where we think the bomb is, or NULL if we don't know
// hostage rescue scenario
CHostage *GetNearestFreeHostage(Vector *knowPos = NULL) const; // return the closest free hostage, and where we think it is (knowPos)
const Vector *GetRandomFreeHostagePosition(void);
bool AreAllHostagesBeingRescued(void) const; // return true if there are no free hostages
bool AreAllHostagesGone(void) const; // all hostages have been rescued or are dead
void AllHostagesGone(void); // someone told us all the hostages are gone
bool HaveSomeHostagesBeenTaken(void) const { return m_haveSomeHostagesBeenTaken; } // return true if one or more hostages have been moved by the CT's
void HostageWasTaken(void) { m_haveSomeHostagesBeenTaken = true; } // someone told us a CT is talking to a hostage
const Vector *GetRandomFreeHostagePosition();
bool AreAllHostagesBeingRescued() const; // return true if there are no free hostages
bool AreAllHostagesGone() const; // all hostages have been rescued or are dead
void AllHostagesGone(); // someone told us all the hostages are gone
bool HaveSomeHostagesBeenTaken() const { return m_haveSomeHostagesBeenTaken; } // return true if one or more hostages have been moved by the CT's
void HostageWasTaken() { m_haveSomeHostagesBeenTaken = true; } // someone told us a CT is talking to a hostage
CHostage *GetNearestVisibleFreeHostage(void) const;
CHostage *GetNearestVisibleFreeHostage() const;
// hostage rescue scenario
enum ValidateStatusType:uint8
@ -101,7 +101,7 @@ public:
HOSTAGE_GONE = 0x02,
HOSTAGES_ALL_GONE = 0x04
};
ValidateStatusType ValidateHostagePositions(void); // update our knowledge with what we currently see - returns bitflag events
ValidateStatusType ValidateHostagePositions(); // update our knowledge with what we currently see - returns bitflag events
#ifndef HOOK_GAMEDLL
private:
@ -112,7 +112,7 @@ private:
// bomb defuse scenario
void SetBombState(BombState state);
BombState GetBombState(void) { return m_bombState; }
BombState GetBombState() { return m_bombState; }
BombState m_bombState; // what we think the bomb is doing
@ -144,12 +144,11 @@ private:
m_hostage[ MAX_HOSTAGES ];
int m_hostageCount; // number of hostages left in map
CountdownTimer m_validateInterval;
NOXREF CBaseEntity *GetNearestHostage(void) const; // return the closest live hostage
void InitializeHostageInfo(void); // initialize our knowledge of the number and location of hostages
NOXREF CBaseEntity *GetNearestHostage() const; // return the closest live hostage
void InitializeHostageInfo(); // initialize our knowledge of the number and location of hostages
bool m_allHostagesRescued; // if true, so every hostages been is rescued
bool m_haveSomeHostagesBeenTaken; // true if a hostage has been moved by a CT (and we've seen it)
};/* size: 348, cachelines: 6, members: 19 */
};
#endif // CS_GAMESTATE_H

View File

@ -562,22 +562,3 @@ void AttackState::__MAKE_VHOOK(OnExit)(CCSBot *me)
me->StopRapidFire();
me->ClearSurpriseDelay();
}
#ifdef HOOK_GAMEDLL
void AttackState::OnEnter(CCSBot *me)
{
OnEnter_(me);
}
void AttackState::OnUpdate(CCSBot *me)
{
OnUpdate_(me);
}
void AttackState::OnExit(CCSBot *me)
{
OnExit_(me);
}
#endif // HOOK_GAMEDLL

View File

@ -521,22 +521,3 @@ void BuyState::__MAKE_VHOOK(OnExit)(CCSBot *me)
me->ResetStuckMonitor();
me->EquipBestWeapon();
}
#ifdef HOOK_GAMEDLL
void BuyState::OnEnter(CCSBot *me)
{
OnEnter_(me);
}
void BuyState::OnUpdate(CCSBot *me)
{
OnUpdate_(me);
}
void BuyState::OnExit(CCSBot *me)
{
OnExit_(me);
}
#endif // HOOK_GAMEDLL

View File

@ -66,22 +66,3 @@ void DefuseBombState::__MAKE_VHOOK(OnExit)(CCSBot *me)
me->SetDisposition(CCSBot::ENGAGE_AND_INVESTIGATE);
me->ClearLookAt();
}
#ifdef HOOK_GAMEDLL
void DefuseBombState::OnEnter(CCSBot *me)
{
OnEnter_(me);
}
void DefuseBombState::OnUpdate(CCSBot *me)
{
OnUpdate_(me);
}
void DefuseBombState::OnExit(CCSBot *me)
{
OnExit_(me);
}
#endif // HOOK_GAMEDLL

View File

@ -45,22 +45,3 @@ void EscapeFromBombState::__MAKE_VHOOK(OnExit)(CCSBot *me)
{
me->EquipBestWeapon();
}
#ifdef HOOK_GAMEDLL
void EscapeFromBombState::OnEnter(CCSBot *me)
{
OnEnter_(me);
}
void EscapeFromBombState::OnUpdate(CCSBot *me)
{
OnUpdate_(me);
}
void EscapeFromBombState::OnExit(CCSBot *me)
{
OnExit_(me);
}
#endif // HOOK_GAMEDLL

View File

@ -50,17 +50,3 @@ void FetchBombState::__MAKE_VHOOK(OnUpdate)(CCSBot *me)
if (me->UpdatePathMovement() != CCSBot::PROGRESSING)
me->Idle();
}
#ifdef HOOK_GAMEDLL
void FetchBombState::OnEnter(CCSBot *me)
{
OnEnter_(me);
}
void FetchBombState::OnUpdate(CCSBot *me)
{
OnUpdate_(me);
}
#endif // HOOK_GAMEDLL

View File

@ -265,22 +265,3 @@ void FollowState::__MAKE_VHOOK(OnExit)(CCSBot *me)
{
;
}
#ifdef HOOK_GAMEDLL
void FollowState::OnEnter(CCSBot *me)
{
OnEnter_(me);
}
void FollowState::OnUpdate(CCSBot *me)
{
OnUpdate_(me);
}
void FollowState::OnExit(CCSBot *me)
{
OnExit_(me);
}
#endif // HOOK_GAMEDLL

View File

@ -435,22 +435,3 @@ void HideState::__MAKE_VHOOK(OnExit)(CCSBot *me)
if (me->HasShield() && me->IsProtectedByShield())
me->SecondaryAttack();
}
#ifdef HOOK_GAMEDLL
void HideState::OnEnter(CCSBot *me)
{
OnEnter_(me);
}
void HideState::OnUpdate(CCSBot *me)
{
OnUpdate_(me);
}
void HideState::OnExit(CCSBot *me)
{
OnExit_(me);
}
#endif // HOOK_GAMEDLL

View File

@ -200,22 +200,3 @@ void HuntState::__MAKE_VHOOK(OnExit)(CCSBot *me)
{
;
}
#ifdef HOOK_GAMEDLL
void HuntState::OnEnter(CCSBot *me)
{
OnEnter_(me);
}
void HuntState::OnUpdate(CCSBot *me)
{
OnUpdate_(me);
}
void HuntState::OnExit(CCSBot *me)
{
OnExit_(me);
}
#endif // HOOK_GAMEDLL

View File

@ -754,17 +754,3 @@ void IdleState::__MAKE_VHOOK(OnUpdate)(CCSBot *me)
// if we have nothing special to do, go hunting for enemies
me->Hunt();
}
#ifdef HOOK_GAMEDLL
void IdleState::OnEnter(CCSBot *me)
{
OnEnter_(me);
}
void IdleState::OnUpdate(CCSBot *me)
{
OnUpdate_(me);
}
#endif // HOOK_GAMEDLL

View File

@ -115,22 +115,3 @@ void InvestigateNoiseState::__MAKE_VHOOK(OnExit)(CCSBot *me)
// reset to run mode in case we were sneaking about
me->Run();
}
#ifdef HOOK_GAMEDLL
void InvestigateNoiseState::OnEnter(CCSBot *me)
{
OnEnter_(me);
}
void InvestigateNoiseState::OnUpdate(CCSBot *me)
{
OnUpdate_(me);
}
void InvestigateNoiseState::OnExit(CCSBot *me)
{
OnExit_(me);
}
#endif // HOOK_GAMEDLL

View File

@ -300,22 +300,3 @@ void MoveToState::__MAKE_VHOOK(OnExit)(CCSBot *me)
me->SetDisposition(CCSBot::ENGAGE_AND_INVESTIGATE);
//me->StopAiming();
}
#ifdef HOOK_GAMEDLL
void MoveToState::OnEnter(CCSBot *me)
{
OnEnter_(me);
}
void MoveToState::OnUpdate(CCSBot *me)
{
OnUpdate_(me);
}
void MoveToState::OnExit(CCSBot *me)
{
OnExit_(me);
}
#endif // HOOK_GAMEDLL

View File

@ -58,22 +58,3 @@ void PlantBombState::__MAKE_VHOOK(OnExit)(CCSBot *me)
me->SetDisposition(CCSBot::ENGAGE_AND_INVESTIGATE);
me->ClearLookAt();
}
#ifdef HOOK_GAMEDLL
void PlantBombState::OnEnter(CCSBot *me)
{
OnEnter_(me);
}
void PlantBombState::OnUpdate(CCSBot *me)
{
OnUpdate_(me);
}
void PlantBombState::OnExit(CCSBot *me)
{
OnExit_(me);
}
#endif // HOOK_GAMEDLL

View File

@ -47,22 +47,3 @@ void UseEntityState::__MAKE_VHOOK(OnExit)(CCSBot *me)
me->ClearLookAt();
me->ResetStuckMonitor();
}
#ifdef HOOK_GAMEDLL
void UseEntityState::OnEnter(CCSBot *me)
{
OnEnter_(me);
}
void UseEntityState::OnUpdate(CCSBot *me)
{
OnUpdate_(me);
}
void UseEntityState::OnExit(CCSBot *me)
{
OnExit_(me);
}
#endif // HOOK_GAMEDLL

View File

@ -14,7 +14,7 @@ TYPEDESCRIPTION CEnvGlobal::m_SaveData[] =
TYPEDESCRIPTION CMultiSource::m_SaveData[] =
{
//!!!BUGBUG FIX
// BUGBUG FIX
DEFINE_ARRAY(CMultiSource, m_rgEntities, FIELD_EHANDLE, MS_MAX_TARGETS),
DEFINE_ARRAY(CMultiSource, m_rgTriggered, FIELD_INTEGER, MS_MAX_TARGETS),
DEFINE_FIELD(CMultiSource, m_iTotal, FIELD_INTEGER),
@ -50,14 +50,6 @@ TYPEDESCRIPTION CEnvSpark::m_SaveData[] =
DEFINE_FIELD(CEnvSpark, m_flDelay, FIELD_FLOAT),
};
#else
TYPEDESCRIPTION IMPL_CLASS(CEnvGlobal, m_SaveData)[3];
TYPEDESCRIPTION IMPL_CLASS(CMultiSource, m_SaveData)[4];
TYPEDESCRIPTION IMPL_CLASS(CBaseButton, m_SaveData)[8];
TYPEDESCRIPTION IMPL_CLASS(CMomentaryRotButton, m_SaveData)[6];
TYPEDESCRIPTION IMPL_CLASS(CEnvSpark, m_SaveData)[1];
#endif // HOOK_GAMEDLL
/* <260d6> ../cstrike/dlls/buttons.cpp:62 */
@ -89,7 +81,7 @@ void CEnvGlobal::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
}
/* <26486> ../cstrike/dlls/buttons.cpp:80 */
void CEnvGlobal::__MAKE_VHOOK(Spawn)(void)
void CEnvGlobal::__MAKE_VHOOK(Spawn)()
{
if (!m_globalstate)
{
@ -177,7 +169,7 @@ void CMultiSource::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
}
/* <256e2> ../cstrike/dlls/buttons.cpp:168 */
void CMultiSource::__MAKE_VHOOK(Spawn)(void)
void CMultiSource::__MAKE_VHOOK(Spawn)()
{
// set up think for later registration
pev->solid = SOLID_NOT;
@ -256,7 +248,7 @@ BOOL CMultiSource::__MAKE_VHOOK(IsTriggered)(CBaseEntity *)
}
/* <25d5a> ../cstrike/dlls/buttons.cpp:236 */
void CMultiSource::Register(void)
void CMultiSource::Register()
{
edict_t *pentTarget = NULL;
@ -300,7 +292,7 @@ void CMultiSource::Register(void)
IMPLEMENT_SAVERESTORE(CBaseButton, CBaseToggle);
/* <25709> ../cstrike/dlls/buttons.cpp:289 */
void CBaseButton::__MAKE_VHOOK(Precache)(void)
void CBaseButton::__MAKE_VHOOK(Precache)()
{
char *pszSound;
@ -459,7 +451,7 @@ int CBaseButton::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pe
LINK_ENTITY_TO_CLASS(func_button, CBaseButton);
/* <25c2c> ../cstrike/dlls/buttons.cpp:442 */
void CBaseButton::__MAKE_VHOOK(Spawn)(void)
void CBaseButton::__MAKE_VHOOK(Spawn)()
{
char *pszSound;
@ -596,7 +588,7 @@ void DoSpark(entvars_t *pev, const Vector &location)
}
/* <277fa> ../cstrike/dlls/buttons.cpp:568 */
void CBaseButton::ButtonSpark(void)
void CBaseButton::ButtonSpark()
{
SetThink(&CBaseButton::ButtonSpark);
@ -631,7 +623,7 @@ void CBaseButton::ButtonUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_T
}
/* <27821> ../cstrike/dlls/buttons.cpp:603 */
CBaseButton::BUTTON_CODE CBaseButton::ButtonResponseToTouch(void)
CBaseButton::BUTTON_CODE CBaseButton::ButtonResponseToTouch()
{
// Ignore touches if button is moving, or pushed-in and waiting to auto-come-out.
if (m_toggle_state == TS_GOING_UP || m_toggle_state == TS_GOING_DOWN || (m_toggle_state == TS_AT_TOP && !m_fStayPushed && !(pev->spawnflags & SF_BUTTON_TOGGLE)))
@ -693,7 +685,7 @@ void CBaseButton::ButtonTouch(CBaseEntity *pOther)
// Starts the button moving "in/up".
/* <27843> ../cstrike/dlls/buttons.cpp:664 */
void CBaseButton::ButtonActivate(void)
void CBaseButton::ButtonActivate()
{
EMIT_SOUND(ENT(pev), CHAN_VOICE, (char *)STRING(pev->noise), VOL_NORM, ATTN_NORM);
@ -726,7 +718,7 @@ void CBaseButton::ButtonActivate(void)
// Button has reached the "in/up" position. Activate its "targets", and pause before "popping out".
/* <263dd> ../cstrike/dlls/buttons.cpp:693 */
void CBaseButton::TriggerAndWait(void)
void CBaseButton::TriggerAndWait()
{
assert(m_toggle_state == TS_GOING_UP);
@ -762,7 +754,7 @@ void CBaseButton::TriggerAndWait(void)
// Starts the button moving "out/down".
/* <25bb7> ../cstrike/dlls/buttons.cpp:730 */
void CBaseButton::ButtonReturn(void)
void CBaseButton::ButtonReturn()
{
assert(m_toggle_state == TS_AT_TOP);
m_toggle_state = TS_GOING_DOWN;
@ -784,7 +776,7 @@ void CBaseButton::ButtonReturn(void)
// Button has returned to start state. Quiesce it.
/* <26658> ../cstrike/dlls/buttons.cpp:748 */
void CBaseButton::ButtonBackHome(void)
void CBaseButton::ButtonBackHome()
{
assert(m_toggle_state == TS_GOING_DOWN);
m_toggle_state = TS_AT_BOTTOM;
@ -842,7 +834,7 @@ void CBaseButton::ButtonBackHome(void)
LINK_ENTITY_TO_CLASS(func_rot_button, CRotButton);
/* <25a06> ../cstrike/dlls/buttons.cpp:808 */
void CRotButton::__MAKE_VHOOK(Spawn)(void)
void CRotButton::__MAKE_VHOOK(Spawn)()
{
char *pszSound;
@ -913,7 +905,7 @@ IMPLEMENT_SAVERESTORE(CMomentaryRotButton, CBaseToggle);
LINK_ENTITY_TO_CLASS(momentary_rot_button, CMomentaryRotButton);
/* <25acc> ../cstrike/dlls/buttons.cpp:922 */
void CMomentaryRotButton::__MAKE_VHOOK(Spawn)(void)
void CMomentaryRotButton::__MAKE_VHOOK(Spawn)()
{
CBaseToggle::AxisDir(pev);
@ -971,7 +963,7 @@ void CMomentaryRotButton::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
}
/* <27a57> ../cstrike/dlls/buttons.cpp:974 */
void CMomentaryRotButton::PlaySound(void)
void CMomentaryRotButton::PlaySound()
{
EMIT_SOUND(ENT(pev), CHAN_VOICE, (char *)STRING(pev->noise), VOL_NORM, ATTN_NORM);
}
@ -1091,7 +1083,7 @@ void CMomentaryRotButton::UpdateTarget(float value)
}
/* <25f88> ../cstrike/dlls/buttons.cpp:1072 */
void CMomentaryRotButton::Off(void)
void CMomentaryRotButton::Off()
{
pev->avelocity = g_vecZero;
m_lastUsed = 0;
@ -1107,7 +1099,7 @@ void CMomentaryRotButton::Off(void)
}
/* <27d60> ../cstrike/dlls/buttons.cpp:1086 */
void CMomentaryRotButton::Return(void)
void CMomentaryRotButton::Return()
{
float value = CBaseToggle::AxisDelta(pev->spawnflags, pev->angles, m_start) / m_flMoveDistance;
@ -1147,7 +1139,7 @@ LINK_ENTITY_TO_CLASS(env_spark, CEnvSpark);
LINK_ENTITY_TO_CLASS(env_debris, CEnvSpark);
/* <257b7> ../cstrike/dlls/buttons.cpp:1146 */
void CEnvSpark::__MAKE_VHOOK(Spawn)(void)
void CEnvSpark::__MAKE_VHOOK(Spawn)()
{
SetThink(NULL);
SetUse(NULL);
@ -1181,7 +1173,7 @@ void CEnvSpark::__MAKE_VHOOK(Spawn)(void)
}
/* <257de> ../cstrike/dlls/buttons.cpp:1173 */
void CEnvSpark::__MAKE_VHOOK(Precache)(void)
void CEnvSpark::__MAKE_VHOOK(Precache)()
{
PRECACHE_SOUND("buttons/spark1.wav");
PRECACHE_SOUND("buttons/spark2.wav");
@ -1211,7 +1203,7 @@ void CEnvSpark::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
}
/* <277d3> ../cstrike/dlls/buttons.cpp:1201 */
void CEnvSpark::SparkThink(void)
void CEnvSpark::SparkThink()
{
pev->nextthink = gpGlobals->time + 0.1 + RANDOM_FLOAT(0, m_flDelay);
DoSpark(pev, pev->origin);
@ -1236,7 +1228,7 @@ void CEnvSpark::SparkStop(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP
LINK_ENTITY_TO_CLASS(button_target, CButtonTarget);
/* <258ca> ../cstrike/dlls/buttons.cpp:1235 */
void CButtonTarget::__MAKE_VHOOK(Spawn)(void)
void CButtonTarget::__MAKE_VHOOK(Spawn)()
{
pev->movetype = MOVETYPE_PUSH;
pev->solid = SOLID_BSP;
@ -1267,7 +1259,7 @@ void CButtonTarget::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCal
}
/* <258f1> ../cstrike/dlls/buttons.cpp:1258 */
int CButtonTarget::__MAKE_VHOOK(ObjectCaps)(void)
int CButtonTarget::__MAKE_VHOOK(ObjectCaps)()
{
int caps = CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION;
@ -1281,170 +1273,5 @@ int CButtonTarget::__MAKE_VHOOK(ObjectCaps)(void)
int CButtonTarget::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{
Use(Instance(pevAttacker), this, USE_TOGGLE, 0);
return 1;
}
#ifdef HOOK_GAMEDLL
void CBaseButton::Spawn(void)
{
Spawn_();
}
void CBaseButton::Precache(void)
{
Precache_();
}
void CBaseButton::KeyValue(KeyValueData *pkvd)
{
KeyValue_(pkvd);
}
int CBaseButton::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{
return TakeDamage_(pevInflictor, pevAttacker, flDamage, bitsDamageType);
}
int CBaseButton::Save(CSave &save)
{
return Save_(save);
}
int CBaseButton::Restore(CRestore &restore)
{
return Restore_(restore);
}
void CEnvGlobal::Spawn(void)
{
Spawn_();
}
void CEnvGlobal::KeyValue(KeyValueData *pkvd)
{
KeyValue_(pkvd);
}
int CEnvGlobal::Save(CSave &save)
{
return Save_(save);
}
int CEnvGlobal::Restore(CRestore &restore)
{
return Restore_(restore);
}
void CEnvGlobal::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
void CMultiSource::Spawn(void)
{
Spawn_();
}
void CMultiSource::KeyValue(KeyValueData *pkvd)
{
KeyValue_(pkvd);
}
void CMultiSource::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
BOOL CMultiSource::IsTriggered(CBaseEntity *pActivator)
{
return IsTriggered_(pActivator);
}
int CMultiSource::Save(CSave &save)
{
return Save_(save);
}
int CMultiSource::Restore(CRestore &restore)
{
return Restore_(restore);
}
void CRotButton::Spawn(void)
{
Spawn_();
}
void CMomentaryRotButton::Spawn(void)
{
Spawn_();
}
void CMomentaryRotButton::KeyValue(KeyValueData *pkvd)
{
KeyValue_(pkvd);
}
int CMomentaryRotButton::Save(CSave &save)
{
return Save_(save);
}
int CMomentaryRotButton::Restore(CRestore &restore)
{
return Restore_(restore);
}
void CMomentaryRotButton::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
void CEnvSpark::Spawn(void)
{
Spawn_();
}
void CEnvSpark::Precache(void)
{
Precache_();
}
void CEnvSpark::KeyValue(KeyValueData *pkvd)
{
KeyValue_(pkvd);
}
int CEnvSpark::Save(CSave &save)
{
return Save_(save);
}
int CEnvSpark::Restore(CRestore &restore)
{
return Restore_(restore);
}
void CButtonTarget::Spawn(void)
{
Spawn_();
}
int CButtonTarget::ObjectCaps(void)
{
return ObjectCaps_();
}
int CButtonTarget::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{
return TakeDamage_(pevInflictor, pevAttacker, flDamage, bitsDamageType);
}
void CButtonTarget::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
#endif // HOOK_GAMEDLL

View File

@ -58,7 +58,7 @@
class CEnvGlobal: public CPointEntity
{
public:
virtual void Spawn(void);
virtual void Spawn();
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
@ -66,7 +66,7 @@ public:
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Spawn_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
@ -81,32 +81,31 @@ public:
string_t m_globalstate;
int m_triggermode;
int m_initialstate;
};/* size: 164, cachelines: 3, members: 5 */
};
/* <24b67> ../cstrike/dlls/buttons.cpp:800 */
class CRotButton: public CBaseButton
{
public:
virtual void Spawn(void);
virtual void Spawn();
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Spawn_();
#endif // HOOK_GAMEDLL
};/* size: 368, cachelines: 6, members: 1 */
};
/* <24bba> ../cstrike/dlls/buttons.cpp:873 */
class CMomentaryRotButton: public CBaseToggle
{
public:
virtual void Spawn(void);
virtual void Spawn();
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
virtual int ObjectCaps()
{
int flags = CBaseToggle::ObjectCaps() & (~FCAP_ACROSS_TRANSITION);
@ -121,7 +120,7 @@ public:
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Spawn_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
@ -130,46 +129,42 @@ public:
#endif // HOOK_GAMEDLL
public:
void EXPORT Off(void);
void EXPORT Return(void);
void EXPORT Off();
void EXPORT Return();
void UpdateSelf(float value);
void UpdateSelfReturn(float value);
void UpdateAllButtons(float value, int start);
void PlaySound(void);
void PlaySound();
void UpdateTarget(float value);
public:
static CMomentaryRotButton *Instance(edict_t *pent)
{
return (CMomentaryRotButton *)GET_PRIVATE(pent);
}
static CMomentaryRotButton *Instance(edict_t *pent) { return (CMomentaryRotButton *)GET_PRIVATE(pent); }
public:
static TYPEDESCRIPTION IMPL(m_SaveData)[6];
public:
int m_lastUsed;
int m_direction;
float m_returnSpeed;
Vector m_start;
Vector m_end;
int m_sounds;
};/* size: 352, cachelines: 6, members: 8 */
};
/* <24c08> ../cstrike/dlls/buttons.cpp:1117 */
class CEnvSpark: public CBaseEntity
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
@ -177,53 +172,37 @@ public:
#endif // HOOK_GAMEDLL
public:
void EXPORT SparkThink(void);
void EXPORT SparkThink();
void EXPORT SparkStart(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void EXPORT SparkStop(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
public:
static TYPEDESCRIPTION IMPL(m_SaveData)[1];
public:
float m_flDelay;
};/* size: 156, cachelines: 3, members: 3 */
};
/* <24c24> ../cstrike/dlls/buttons.cpp:1223 */
class CButtonTarget: public CBaseEntity
{
public:
virtual void Spawn(void);
virtual int ObjectCaps(void);
virtual void Spawn();
virtual int ObjectCaps();
virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
int ObjectCaps_(void);
void Spawn_();
int ObjectCaps_();
int TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif // HOOK_GAMEDLL
};/* size: 152, cachelines: 3, members: 1 */
};
char *ButtonSound(int sound);
void DoSpark(entvars_t *pev, const Vector &location);
#ifdef HOOK_GAMEDLL
// linked objects
C_DLLEXPORT void env_global(entvars_t *pev);
C_DLLEXPORT void multisource(entvars_t *pev);
C_DLLEXPORT void func_button(entvars_t *pev);
C_DLLEXPORT void func_rot_button(entvars_t *pev);
C_DLLEXPORT void momentary_rot_button(entvars_t *pev);
C_DLLEXPORT void env_spark(entvars_t *pev);
C_DLLEXPORT void env_debris(entvars_t *pev);
C_DLLEXPORT void button_target(entvars_t *pev);
#endif // HOOK_GAMEDLL
#endif // BUTTON_H

View File

@ -32,11 +32,6 @@ const TaskInfo taskInfo[] =
{ NULL, EVENT_INVALID, &CCareerTask::NewTask }
};
#else
CCareerTaskManager *TheCareerTasks;
const TaskInfo taskInfo[21];
#endif // HOOK_GAMEDLL
/* <1ef647> ../cstrike/dlls/career_tasks.cpp:133 */
@ -60,7 +55,7 @@ CPreventDefuseTask::CPreventDefuseTask(const char *taskName, GameEventType event
}
/* <1ef296> ../cstrike/dlls/career_tasks.cpp:147 */
void CPreventDefuseTask::__MAKE_VHOOK(Reset)(void)
void CPreventDefuseTask::__MAKE_VHOOK(Reset)()
{
m_bombPlantedThisRound = false;
m_defuseStartedThisRound = false;
@ -135,7 +130,7 @@ CCareerTask::CCareerTask(const char *taskName, GameEventType event, const char *
}
/* <1ef211> ../cstrike/dlls/career_tasks.cpp:240 */
void CCareerTask::__MAKE_VHOOK(Reset)(void)
void CCareerTask::__MAKE_VHOOK(Reset)()
{
m_eventsSeen = 0;
m_isComplete = false;
@ -153,7 +148,7 @@ void CCareerTask::__MAKE_VHOOK(Reset)(void)
}
/* <1ef74c> ../cstrike/dlls/career_tasks.cpp:256 */
void CCareerTask::SendPartialNotification(void)
void CCareerTask::SendPartialNotification()
{
MESSAGE_BEGIN(MSG_ALL, gmsgCZCareer);
WRITE_STRING("TASKPART");
@ -422,7 +417,7 @@ void CCareerTask::__MAKE_VHOOK(OnEvent)(GameEventType event, CBasePlayer *pVicti
}
/* <1efeed> ../cstrike/dlls/career_tasks.cpp:623 */
void CCareerTaskManager::Create(void)
void CCareerTaskManager::Create()
{
if (TheCareerTasks != NULL)
{
@ -434,7 +429,7 @@ void CCareerTaskManager::Create(void)
}
/* <1eff77> ../cstrike/dlls/career_tasks.cpp:636 */
CCareerTaskManager::CCareerTaskManager(void)
CCareerTaskManager::CCareerTaskManager()
{
m_taskTime = 0;
Reset();
@ -613,7 +608,7 @@ void CCareerTaskManager::HandleDeath(int team, CBasePlayer *pAttacker)
}
/* <1f0a5d> ../cstrike/dlls/career_tasks.cpp:805 */
bool CCareerTaskManager::AreAllTasksComplete(void)
bool CCareerTaskManager::AreAllTasksComplete()
{
for (CareerTaskListIt it = m_tasks.begin(); it != m_tasks.end(); ++it)
{
@ -625,7 +620,7 @@ bool CCareerTaskManager::AreAllTasksComplete(void)
}
/* <1f0abc> ../cstrike/dlls/career_tasks.cpp:818 */
int CCareerTaskManager::GetNumRemainingTasks(void)
int CCareerTaskManager::GetNumRemainingTasks()
{
int ret = 0;
for (CareerTaskListIt it = m_tasks.begin(); it != m_tasks.end(); ++it)
@ -638,44 +633,20 @@ int CCareerTaskManager::GetNumRemainingTasks(void)
}
/* <1f0b33> ../cstrike/dlls/career_tasks.cpp:832 */
float CCareerTaskManager::GetRoundElapsedTime(void)
float CCareerTaskManager::GetRoundElapsedTime()
{
return (gpGlobals->time - m_roundStartTime);
}
/* <1f0b56> ../cstrike/dlls/career_tasks.cpp:838 */
void CCareerTaskManager::LatchRoundEndMessage(void)
void CCareerTaskManager::LatchRoundEndMessage()
{
m_shouldLatchRoundEndMessage = true;
}
/* <1f0b81> ../cstrike/dlls/career_tasks.cpp:844 */
void CCareerTaskManager::UnlatchRoundEndMessage(void)
void CCareerTaskManager::UnlatchRoundEndMessage()
{
m_shouldLatchRoundEndMessage = false;
HandleEvent(m_roundEndMessage);
}
#ifdef HOOK_GAMEDLL
void CCareerTask::OnEvent(GameEventType event, CBasePlayer *pAttacker, CBasePlayer *pVictim)
{
OnEvent_(event, pAttacker, pVictim);
}
void CCareerTask::Reset(void)
{
Reset_();
}
void CPreventDefuseTask::OnEvent(GameEventType event, CBasePlayer *pAttacker, CBasePlayer *pVictim)
{
OnEvent_(event, pAttacker, pVictim);
}
void CPreventDefuseTask::Reset(void)
{
Reset_();
}
#endif // HOOK_GAMEDLL

View File

@ -38,17 +38,17 @@
class CCareerTask
{
public:
CCareerTask(void) {};
CCareerTask() {};
CCareerTask(const char *taskName, GameEventType event, const char *weaponName, int n, bool mustLive, bool crossRounds, int id, bool isComplete);
public:
virtual void OnEvent(GameEventType event, CBasePlayer *pAttacker, CBasePlayer *pVictim);
virtual void Reset(void);
virtual bool IsTaskCompletableThisRound(void) { return true; }
virtual void Reset();
virtual bool IsTaskCompletableThisRound() { return true; }
#ifdef HOOK_GAMEDLL
void OnEvent_(GameEventType event, CBasePlayer *pAttacker, CBasePlayer *pVictim);
void Reset_(void);
void Reset_();
#endif // HOOK_GAMEDLL
@ -58,17 +58,16 @@ public:
void OnWeaponKill(int weaponId, int weaponClassId, bool headshot, bool killerHasShield, CBasePlayer *pAttacker, CBasePlayer *pVictim);
void OnWeaponInjury(int weaponId, int weaponClassId, bool attackerHasShield, CBasePlayer *pAttacker);
bool IsComplete(void) { return m_isComplete;}
const char *GetTaskName(void) { return m_name; }
bool IsComplete() { return m_isComplete;}
const char *GetTaskName() { return m_name; }
int GetWeaponId(void) { return m_weaponId; }
int GetWeaponClassId(void) { return m_weaponClassId; }
int GetWeaponId() { return m_weaponId; }
int GetWeaponClassId() { return m_weaponClassId; }
bool IsValidFor(CBasePlayer *pPlayer) { return true; }
void SendPartialNotification(void);
void SendPartialNotification();
private:
bool m_isComplete;
const char *m_name;
int m_id;
@ -83,8 +82,7 @@ private:
bool m_rescuer;
bool m_defuser;
bool m_vip;
};/* size: 44, cachelines: 1, members: 15 */
};
typedef std::STD_LIST<CCareerTask *> CareerTaskList;
typedef CareerTaskList::iterator CareerTaskListIt;
@ -98,13 +96,13 @@ public:
CPreventDefuseTask(const char *taskName, GameEventType event, const char *weaponName, int n, bool mustLive, bool crossRounds, int id, bool isComplete);
public:
virtual void OnEvent(GameEventType event, CBasePlayer *pAttacker, CBasePlayer *pVictim);
virtual void Reset(void);
virtual bool IsTaskCompletableThisRound(void) { return m_bombPlantedThisRound && !m_defuseStartedThisRound; }
virtual void Reset();
virtual bool IsTaskCompletableThisRound() { return m_bombPlantedThisRound && !m_defuseStartedThisRound; }
#ifdef HOOK_GAMEDLL
void OnEvent_(GameEventType event, CBasePlayer *pAttacker, CBasePlayer *pVictim);
void Reset_(void);
void Reset_();
#endif // HOOK_GAMEDLL
@ -114,17 +112,16 @@ public:
protected:
bool m_bombPlantedThisRound;
bool m_defuseStartedThisRound;
};/* size: 48, cachelines: 1, members: 3 */
};
/* <1efed1> ../cstrike/dlls/career_tasks.cpp:636 */
class CCareerTaskManager
{
public:
CCareerTaskManager(void);
CCareerTaskManager();
public:
static void Create(void);
static void Create();
void Reset(bool deleteTasks = true);
void AddTask(const char *taskName, const char *weaponName, int eventCount, bool mustLive, bool crossRounds, bool isComplete);
@ -136,16 +133,16 @@ public:
void HandleWeaponInjury(int weaponId, int weaponClassId, bool attackerHasShield, CBasePlayer *pAttacker);
void HandleEnemyInjury(const char *weaponName, bool attackerHasShield, CBasePlayer *pAttacker);
bool AreAllTasksComplete(void);
int GetNumRemainingTasks(void);
float GetRoundElapsedTime(void);
int GetTaskTime(void) { return m_taskTime; }
bool AreAllTasksComplete();
int GetNumRemainingTasks();
float GetRoundElapsedTime();
int GetTaskTime() { return m_taskTime; }
void SetFinishedTaskTime(int val);
int GetFinishedTaskTime(void) { return m_finishedTaskTime; }
int GetFinishedTaskRound(void) { return m_finishedTaskRound; }
CareerTaskList *GetTasks(void) { return &m_tasks; }
void LatchRoundEndMessage(void);
void UnlatchRoundEndMessage(void);
int GetFinishedTaskTime() { return m_finishedTaskTime; }
int GetFinishedTaskRound() { return m_finishedTaskRound; }
CareerTaskList *GetTasks() { return &m_tasks; }
void LatchRoundEndMessage();
void UnlatchRoundEndMessage();
private:
CareerTaskList m_tasks;
@ -158,25 +155,15 @@ private:
int m_finishedTaskRound;
GameEventType m_roundEndMessage;
bool m_shouldLatchRoundEndMessage;
};/* size: 36, cachelines: 1, members: 8 */
};
struct TaskInfo
{
const char *taskName;
GameEventType event;
TaskFactoryFunction factory;
};/* size: 12, cachelines: 1, members: 3 */
#ifdef HOOK_GAMEDLL
#define TheCareerTasks (*pTheCareerTasks)
#define taskInfo (*ptaskInfo)
#endif // HOOK_GAMEDLL
};
extern CCareerTaskManager *TheCareerTasks;
extern const TaskInfo taskInfo[21];
#endif // CAREER_TASK_H

View File

@ -70,7 +70,7 @@ static NEW_DLL_FUNCTIONS gNewDLLFunctions
TYPEDESCRIPTION CBaseEntity::m_SaveData[] =
{
DEFINE_FIELD(CBaseEntity, m_pGoalEnt, FIELD_CLASSPTR),
DEFINE_FIELD(CBaseEntity, m_pfnThink, FIELD_FUNCTION), // UNDONE: Build table of these!!!
DEFINE_FIELD(CBaseEntity, m_pfnThink, FIELD_FUNCTION), // UNDONE: Build table of these!
DEFINE_FIELD(CBaseEntity, m_pfnTouch, FIELD_FUNCTION),
DEFINE_FIELD(CBaseEntity, m_pfnUse, FIELD_FUNCTION),
DEFINE_FIELD(CBaseEntity, m_pfnBlocked, FIELD_FUNCTION),
@ -79,15 +79,6 @@ TYPEDESCRIPTION CBaseEntity::m_SaveData[] =
CMemoryPool hashItemMemPool(sizeof(hash_item_t), 64);
BOOL gTouchDisabled = FALSE;
#else // HOOK_GAMEDLL
DLL_FUNCTIONS gFunctionTable;
NEW_DLL_FUNCTIONS gNewDLLFunctions;
TYPEDESCRIPTION IMPL_CLASS(CBaseEntity, m_SaveData)[5];
CMemoryPool hashItemMemPool;
BOOL gTouchDisabled;
#endif // HOOK_GAMEDLL
/* <30850> ../cstrike/dlls/cbase.cpp:117 */
@ -112,7 +103,7 @@ int CaseInsensitiveHash(const char *string, int iBounds)
}
/* <30d81> ../cstrike/dlls/cbase.cpp:136 */
void EmptyEntityHashTable(void)
void EmptyEntityHashTable()
{
int i;
hash_item_t *item, *temp, *free;
@ -279,7 +270,7 @@ void RemoveEntityHashValue(entvars_t *pev, const char *value, hash_types_e field
}
/* <31125> ../cstrike/dlls/cbase.cpp:337 */
void printEntities(void)
void printEntities()
{
for (int i = 0; i < stringsHashTable.Count(); ++i)
{
@ -332,7 +323,7 @@ void CONSOLE_ECHO_(char *pszMsg, ...)
}
/* <31273> ../cstrike/dlls/cbase.cpp:386 */
void loopPerformance(void)
void loopPerformance()
{
CPerformanceCounter loopCounter;
loopCounter.InitializePerformanceCounter();
@ -770,7 +761,7 @@ void EXT_FUNC SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void
}
/* <31a74> ../cstrike/dlls/cbase.cpp:802 */
edict_t *EHANDLE::Get(void)
edict_t *EHANDLE::Get()
{
if (!m_pent || m_pent->serialnumber != m_serialnumber)
return NULL;
@ -789,7 +780,7 @@ edict_t *EHANDLE::Set(edict_t *pent)
}
/* <31ace> ../cstrike/dlls/cbase.cpp:823 */
EHANDLE::operator CBaseEntity *(void)
EHANDLE::operator CBaseEntity *()
{
return (CBaseEntity *)GET_PRIVATE(Get());
}
@ -813,13 +804,13 @@ CBaseEntity *EHANDLE::operator=(CBaseEntity *pEntity)
}
/* <31b69> ../cstrike/dlls/cbase.cpp:845 */
EHANDLE::operator int(void)
EHANDLE::operator int()
{
return Get() != NULL;
}
/* <31bac> ../cstrike/dlls/cbase.cpp:850 */
CBaseEntity *EHANDLE::operator->(void)
CBaseEntity *EHANDLE::operator->()
{
return (CBaseEntity *)GET_PRIVATE(Get());
}
@ -902,7 +893,7 @@ void CBaseEntity::__MAKE_VHOOK(Killed)(entvars_t *pevAttacker, int iGib)
}
/* <2fc1c> ../cstrike/dlls/cbase.cpp:935 */
CBaseEntity *CBaseEntity::__MAKE_VHOOK(GetNextTarget)(void)
CBaseEntity *CBaseEntity::__MAKE_VHOOK(GetNextTarget)()
{
if (FStringNull(pev->target))
return NULL;
@ -1004,7 +995,7 @@ void SetObjectCollisionBox(entvars_t *pev)
}
/* <2fe2a> ../cstrike/dlls/cbase.cpp:1030 */
void CBaseEntity::__MAKE_VHOOK(SetObjectCollisionBox)(void)
void CBaseEntity::__MAKE_VHOOK(SetObjectCollisionBox)()
{
::SetObjectCollisionBox(pev);
}
@ -1023,7 +1014,7 @@ int CBaseEntity::Intersects(CBaseEntity *pOther)
}
/* <31c43> ../cstrike/dlls/cbase.cpp:1048 */
void CBaseEntity::MakeDormant(void)
void CBaseEntity::MakeDormant()
{
pev->flags |= FL_DORMANT;
@ -1044,13 +1035,13 @@ void CBaseEntity::MakeDormant(void)
}
/* <31c66> ../cstrike/dlls/cbase.cpp:1064 */
int CBaseEntity::IsDormant(void)
int CBaseEntity::IsDormant()
{
return (pev->flags & FL_DORMANT) == FL_DORMANT;
}
/* <30221> ../cstrike/dlls/cbase.cpp:1069 */
BOOL CBaseEntity::__MAKE_VHOOK(IsInWorld)(void)
BOOL CBaseEntity::__MAKE_VHOOK(IsInWorld)()
{
// position
if (pev->origin.x >= 4096.0 || pev->origin.y >= 4096.0 || pev->origin.z >= 4096.0)
@ -1136,72 +1127,3 @@ void OnFreeEntPrivateData(edict_t *pEnt)
pEntity->UpdateOnRemove();
RemoveEntityHashValue(pEntity->pev, STRING(pEntity->pev->classname), CLASSNAME);
}
#ifdef HOOK_GAMEDLL
int CBaseEntity::Save(CSave &save)
{
return Save_(save);
}
int CBaseEntity::Restore(CRestore &restore)
{
return Restore_(restore);
}
void CBaseEntity::SetObjectCollisionBox(void)
{
SetObjectCollisionBox_();
}
void CBaseEntity::TraceAttack(entvars_t *pevAttacker,float flDamage,Vector vecDir,TraceResult *ptr,int bitsDamageType)
{
TraceAttack_(pevAttacker,flDamage,vecDir,ptr,bitsDamageType);
}
int CBaseEntity::TakeDamage(entvars_t *pevInflictor,entvars_t *pevAttacker,float flDamage,int bitsDamageType)
{
return TakeDamage_(pevInflictor,pevAttacker,flDamage,bitsDamageType);
}
int CBaseEntity::TakeHealth(float flHealth,int bitsDamageType)
{
return TakeHealth_(flHealth, bitsDamageType);
}
void CBaseEntity::Killed(entvars_t *pevAttacker,int iGib)
{
Killed_(pevAttacker,iGib);
}
void CBaseEntity::TraceBleed(float flDamage,Vector vecDir,TraceResult *ptr,int bitsDamageType)
{
TraceBleed_(flDamage,vecDir,ptr,bitsDamageType);
}
int CBaseEntity::DamageDecal(int bitsDamageType)
{
return DamageDecal_(bitsDamageType);
}
BOOL CBaseEntity::IsInWorld(void)
{
return IsInWorld_();
}
CBaseEntity *CBaseEntity::GetNextTarget(void)
{
return GetNextTarget_();
}
BOOL CBaseEntity::FVisible(CBaseEntity *pEntity)
{
return FVisible_(pEntity);
}
BOOL CBaseEntity::FVisible(const Vector &vecOrigin)
{
return FVisible_(vecOrigin);
}
#endif // HOOK_GAMEDLL

View File

@ -52,7 +52,7 @@
#define FCAP_FORCE_TRANSITION 0x00000080
#define SetThink(a)\
m_pfnThink = static_cast<void (CBaseEntity::*)(void)>(a)
m_pfnThink = static_cast<void (CBaseEntity::*)()>(a)
#define SetTouch(a)\
m_pfnTouch = static_cast<void (CBaseEntity::*)(CBaseEntity *)>(a)
#define SetUse(a)\
@ -61,7 +61,7 @@
m_pfnBlocked = static_cast<void (CBaseEntity::*)(CBaseEntity *)>(a)
#define SetMoveDone(a)\
m_pfnCallWhenMoveDone = static_cast<void (CBaseToggle::*)(void)>(a)
m_pfnCallWhenMoveDone = static_cast<void (CBaseToggle::*)()>(a)
#define CLASS_NONE 0
#define CLASS_MACHINE 1
@ -177,7 +177,7 @@
#define MS_MAX_TARGETS 32
#ifdef _WIN32
#define EXPORT _declspec(dllexport)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT /**/
#endif // _WIN32
@ -195,7 +195,6 @@ typedef struct hash_item_s
int pevIndex;
} hash_item_t;
/* size: 16, cachelines: 1, members: 4 */
typedef struct locksounds
{
@ -211,7 +210,6 @@ typedef struct locksounds
BYTE bEOFUnlocked;
} locksound_t;
/* size: 36, cachelines: 1, members: 10 */
typedef enum
{
@ -240,44 +238,15 @@ class CSquadMonster;
class CCineMonster;
class CSound;
#ifdef HOOK_GAMEDLL
#define stringsHashTable (*pstringsHashTable)
#define hashItemMemPool (*phashItemMemPool)
#define gTouchDisabled (*pgTouchDisabled)
#define gFunctionTable (*pgFunctionTable)
#define gNewDLLFunctions (*pgNewDLLFunctions)
#define grgszTextureName (*pgrgszTextureName)
#define grgchTextureType (*pgrgchTextureType)
#define fTextureTypeInit (*pfTextureTypeInit)
#define gcTextures (*pgcTextures)
#endif // HOOK_GAMEDLL
extern CMemoryPool hashItemMemPool;
extern BOOL gTouchDisabled;
extern DLL_FUNCTIONS gFunctionTable;
extern NEW_DLL_FUNCTIONS gNewDLLFunctions;
extern char grgszTextureName[ CTEXTURESMAX ][ CBTEXTURENAMEMAX ];
extern char grgchTextureType[ CTEXTURESMAX ];
extern int fTextureTypeInit;
extern int gcTextures;
extern CUtlVector< hash_item_t > stringsHashTable;
class EHANDLE
{
public:
edict_t *Get(void);
edict_t *Get();
edict_t *Set(edict_t *pent);
operator int();
operator CBaseEntity*();
operator CBasePlayer*() { return static_cast<CBasePlayer *>(GET_PRIVATE(Get())); } // custom
operator CBasePlayer*() { return static_cast<CBasePlayer *>(GET_PRIVATE(Get())); }
CBaseEntity *operator=(CBaseEntity *pEntity);
CBaseEntity *operator->();
@ -285,124 +254,57 @@ public:
private:
edict_t *m_pent;
int m_serialnumber;
};/* size: 8, cachelines: 1, members: 2 */
};
/* <48e9c1> ../cstrike/dlls/cbase.h:166 */
class CBaseEntity
{
public:
virtual void Spawn(void) {}
virtual void Precache(void) {}
virtual void Restart(void) {}
virtual void KeyValue(KeyValueData *pkvd)
{
pkvd->fHandled = FALSE;
}
virtual void Spawn() {}
virtual void Precache() {}
virtual void Restart() {}
virtual void KeyValue(KeyValueData *pkvd) { pkvd->fHandled = FALSE; }
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return FCAP_ACROSS_TRANSITION;
}
virtual void Activate(void) {}
virtual void SetObjectCollisionBox(void);
virtual int Classify(void)
{
return CLASS_NONE;
}
virtual int ObjectCaps() { return FCAP_ACROSS_TRANSITION; }
virtual void Activate() {}
virtual void SetObjectCollisionBox();
virtual int Classify() { return CLASS_NONE; }
virtual void DeathNotice(entvars_t *pevChild) {}
virtual void TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType);
virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
virtual int TakeHealth(float flHealth, int bitsDamageType);
virtual void Killed(entvars_t *pevAttacker, int iGib);
virtual int BloodColor(void)
{
return DONT_BLEED;
}
virtual int BloodColor() { return DONT_BLEED; }
virtual void TraceBleed(float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType);
virtual BOOL IsTriggered(CBaseEntity *pActivator)
{
return TRUE;
}
virtual CBaseMonster *MyMonsterPointer(void)
{
return NULL;
}
virtual CSquadMonster *MySquadMonsterPointer(void)
{
return NULL;
}
virtual int GetToggleState(void)
{
return TS_AT_TOP;
}
virtual BOOL IsTriggered(CBaseEntity *pActivator) { return TRUE; }
virtual CBaseMonster *MyMonsterPointer() { return NULL; }
virtual CSquadMonster *MySquadMonsterPointer() { return NULL; }
virtual int GetToggleState() { return TS_AT_TOP; }
virtual void AddPoints(int score, BOOL bAllowNegativeScore) {}
virtual void AddPointsToTeam(int score, BOOL bAllowNegativeScore) {}
virtual BOOL AddPlayerItem(CBasePlayerItem *pItem)
{
return FALSE;
}
virtual BOOL RemovePlayerItem(CBasePlayerItem *pItem)
{
return FALSE;
}
virtual int GiveAmmo(int iAmount, char *szName, int iMax)
{
return -1;
}
virtual float GetDelay(void)
{
return 0.0f;
}
virtual int IsMoving(void)
{
return (pev->velocity != g_vecZero);
}
virtual void OverrideReset(void) {}
virtual BOOL AddPlayerItem(CBasePlayerItem *pItem) { return FALSE; }
virtual BOOL RemovePlayerItem(CBasePlayerItem *pItem) { return FALSE; }
virtual int GiveAmmo(int iAmount, char *szName, int iMax) { return -1; }
virtual float GetDelay() { return 0.0f; }
virtual int IsMoving() { return (pev->velocity != g_vecZero); }
virtual void OverrideReset() {}
virtual int DamageDecal(int bitsDamageType);
virtual void SetToggleState(int state) {}
virtual void StartSneaking(void) {}
virtual void StopSneaking(void) {}
virtual BOOL OnControls(entvars_t *onpev)
{
return FALSE;
}
virtual BOOL IsSneaking(void)
{
return FALSE;
}
virtual BOOL IsAlive(void)
{
return (pev->deadflag == DEAD_NO && pev->health > 0.0f);
}
virtual BOOL IsBSPModel(void)
{
return (pev->solid == SOLID_BSP || pev->movetype == MOVETYPE_PUSHSTEP);
}
virtual BOOL ReflectGauss(void)
{
return (IsBSPModel() && pev->takedamage == DAMAGE_NO);
}
virtual BOOL HasTarget(string_t targetname)
{
return FStrEq(STRING(targetname),STRING(pev->targetname));
}
virtual BOOL IsInWorld(void);
virtual BOOL IsPlayer(void)
{
return FALSE;
}
virtual BOOL IsNetClient(void)
{
return FALSE;
}
virtual const char *TeamID(void)
{
return "";
}
virtual CBaseEntity *GetNextTarget(void);
virtual void Think(void)
virtual void StartSneaking() {}
virtual void StopSneaking() {}
virtual BOOL OnControls(entvars_t *onpev) { return FALSE; }
virtual BOOL IsSneaking() { return FALSE; }
virtual BOOL IsAlive() { return (pev->deadflag == DEAD_NO && pev->health > 0.0f); }
virtual BOOL IsBSPModel() { return (pev->solid == SOLID_BSP || pev->movetype == MOVETYPE_PUSHSTEP); }
virtual BOOL ReflectGauss() { return (IsBSPModel() && pev->takedamage == DAMAGE_NO); }
virtual BOOL HasTarget(string_t targetname) { return FStrEq(STRING(targetname),STRING(pev->targetname)); }
virtual BOOL IsInWorld();
virtual BOOL IsPlayer() { return FALSE; }
virtual BOOL IsNetClient() { return FALSE; }
virtual const char *TeamID() { return ""; }
virtual CBaseEntity *GetNextTarget();
virtual void Think()
{
if (m_pfnThink)
{
@ -430,35 +332,14 @@ public:
(this->*m_pfnBlocked)(pOther);
}
}
virtual CBaseEntity *Respawn(void)
{
return NULL;
}
virtual void UpdateOwner(void) {}
virtual BOOL FBecomeProne(void)
{
return FALSE;
}
virtual Vector Center(void)
{
return (pev->absmax + pev->absmin) * 0.5f;
}
virtual Vector EyePosition(void)
{
return (pev->origin + pev->view_ofs);
}
virtual Vector EarPosition(void)
{
return (pev->origin + pev->view_ofs);
}
virtual Vector BodyTarget(const Vector &posSrc)
{
return Center();
}
virtual int Illumination(void)
{
return GETENTITYILLUM(ENT(pev));
}
virtual CBaseEntity *Respawn() { return NULL; }
virtual void UpdateOwner() {}
virtual BOOL FBecomeProne() { return FALSE; }
virtual Vector Center() { return (pev->absmax + pev->absmin) * 0.5f; }
virtual Vector EyePosition() { return (pev->origin + pev->view_ofs); }
virtual Vector EarPosition() { return (pev->origin + pev->view_ofs); }
virtual Vector BodyTarget(const Vector &posSrc) { return Center(); }
virtual int Illumination() { return GETENTITYILLUM(ENT(pev)); }
virtual BOOL FVisible(CBaseEntity *pEntity);
virtual BOOL FVisible(const Vector &vecOrigin);
@ -467,62 +348,43 @@ public:
int Save_(CSave &save);
int Restore_(CRestore &restore);
void SetObjectCollisionBox_(void);
void SetObjectCollisionBox_();
void TraceAttack_(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType);
int TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
int TakeHealth_(float flHealth, int bitsDamageType);
void Killed_(entvars_t *pevAttacker, int iGib);
void TraceBleed_(float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType);
int DamageDecal_(int bitsDamageType);
BOOL IsInWorld_(void);
CBaseEntity *GetNextTarget_(void);
BOOL IsInWorld_();
CBaseEntity *GetNextTarget_();
BOOL FVisible_(CBaseEntity *pEntity);
BOOL FVisible_(const Vector &vecOrigin);
#endif // HOOK_GAMEDLL
public:
void *operator new(size_t stAllocateBlock, entvars_t *pevnew)
{
return ALLOC_PRIVATE(ENT(pevnew), stAllocateBlock);
}
void operator delete(void *pMem, entvars_t *pev)
{
pev->flags |= FL_KILLME;
}
void UpdateOnRemove(void);
void EXPORT SUB_Remove(void);
void EXPORT SUB_DoNothing(void);
void EXPORT SUB_StartFadeOut(void);
void EXPORT SUB_FadeOut(void);
void EXPORT SUB_CallUseToggle(void)
{
Use(this, this, USE_TOGGLE, 0);
}
void *operator new(size_t stAllocateBlock, entvars_t *pevnew) { return ALLOC_PRIVATE(ENT(pevnew), stAllocateBlock); }
void operator delete(void *pMem, entvars_t *pev) { pev->flags |= FL_KILLME; }
void UpdateOnRemove();
void EXPORT SUB_Remove();
void EXPORT SUB_DoNothing();
void EXPORT SUB_StartFadeOut();
void EXPORT SUB_FadeOut();
void EXPORT SUB_CallUseToggle() { Use(this, this, USE_TOGGLE, 0); }
int ShouldToggle(USE_TYPE useType, BOOL currentState);
void FireBullets(ULONG cShots, Vector vecSrc, Vector vecDirShooting, Vector vecSpread, float flDistance, int iBulletType, int iTracerFreq = 4, int iDamage = 0, entvars_t *pevAttacker = NULL);
Vector FireBullets3(Vector vecSrc, Vector vecDirShooting, float vecSpread, float flDistance, int iPenetration, int iBulletType, int iDamage, float flRangeModifier, entvars_t *pevAttacker, bool bPistol, int shared_rand = 0);
void SUB_UseTargets(CBaseEntity *pActivator, USE_TYPE useType, float value);
int Intersects(CBaseEntity *pOther);
void MakeDormant(void);
int IsDormant(void);
BOOL IsLockedByMaster(void)
{
return FALSE;
}
void MakeDormant();
int IsDormant();
BOOL IsLockedByMaster() { return FALSE; }
public:
static CBaseEntity *Instance(edict_t *pent)
{
return (CBaseEntity *)GET_PRIVATE(pent ? pent : ENT(0));
}
static CBaseEntity *Instance(entvars_t *pev)
{
return Instance(ENT(pev));
}
static CBaseEntity *Instance(int offset)
{
return Instance(ENT(offset));
}
static CBaseEntity *Instance(edict_t *pent) { return (CBaseEntity *)GET_PRIVATE(pent ? pent : ENT(0)); }
static CBaseEntity *Instance(entvars_t *pev) { return Instance(ENT(pev)); }
static CBaseEntity *Instance(int offset) { return Instance(ENT(offset)); }
CBaseMonster *GetMonsterPointer(entvars_t *pevMonster)
{
CBaseEntity *pEntity = Instance(pevMonster);
@ -539,19 +401,12 @@ public:
return pEntity->MyMonsterPointer();
return NULL;
}
static CBaseEntity *Create(char *szName, const Vector &vecOrigin, const Vector &vecAngles, edict_t *pentOwner = NULL);
edict_t *edict(void)
{
return ENT(pev);
}
EOFFSET eoffset(void)
{
return OFFSET(pev);
}
int entindex(void)
{
return ENTINDEX(edict());
}
edict_t *edict() { return ENT(pev); }
EOFFSET eoffset() { return OFFSET(pev); }
int entindex() { return ENTINDEX(edict()); }
public:
entvars_t *pev;
CBaseEntity *m_pGoalEnt;
@ -559,17 +414,10 @@ public:
static TYPEDESCRIPTION IMPL(m_SaveData)[5];
void (CBaseEntity::*m_pfnThink)(void);
//int m_pfnThink_Flag;
void (CBaseEntity::*m_pfnThink)();
void (CBaseEntity::*m_pfnTouch)(CBaseEntity *pOther);
//int m_pfnTouch_Flag;
void (CBaseEntity::*m_pfnUse)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
//int m_pfnUse_Flag;
void (CBaseEntity::*m_pfnBlocked)(CBaseEntity *pOther);
//int m_pfnBlocked_Flag;
int *current_ammo;
float currentammo;
@ -597,8 +445,7 @@ public:
float m_flReleaseThrow;
int m_iSwing;
bool has_disconnected;
};/* size: 152, cachelines: 3, members: 35 */
};
/* <48d2a5> ../cstrike/dlls/cbase.h:273 */
inline int FNullEnt(CBaseEntity *ent)
@ -616,38 +463,32 @@ inline int FNullEnt(EHANDLE hent)
class CPointEntity: public CBaseEntity
{
public:
virtual void Spawn(void);
virtual int ObjectCaps(void)
{
return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION);
}
virtual void Spawn();
virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); }
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Spawn_();
#endif // HOOK_GAMEDLL
};/* size: 152, cachelines: 3, members: 1 */
};
/* <249f0> ../cstrike/dlls/cbase.h:484 */
class CMultiSource: public CPointEntity
{
public:
virtual void Spawn(void);
virtual void Spawn();
virtual void KeyValue(KeyValueData *pkvd);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual int ObjectCaps(void)
{
return (CPointEntity::ObjectCaps() | FCAP_MASTER);
}
virtual int ObjectCaps() { return (CPointEntity::ObjectCaps() | FCAP_MASTER); }
virtual BOOL IsTriggered(CBaseEntity *pActivator);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Spawn_();
void KeyValue_(KeyValueData *pkvd);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
BOOL IsTriggered_(CBaseEntity *pActivator);
@ -657,7 +498,7 @@ public:
#endif // HOOK_GAMEDLL
public:
void EXPORT Register(void);
void EXPORT Register();
public:
static TYPEDESCRIPTION IMPL(m_SaveData)[4];
@ -666,8 +507,7 @@ public:
int m_rgTriggered[MS_MAX_TARGETS];
int m_iTotal;
string_t m_globalstate;
};/* size: 544, cachelines: 9, members: 6 */
};
/* <48ea00> ../cstrike/dlls/cbase.h:509 */
class CBaseDelay: public CBaseEntity
@ -687,14 +527,13 @@ public:
public:
void SUB_UseTargets(CBaseEntity *pActivator, USE_TYPE useType, float value);
void EXPORT DelayThink(void);
void EXPORT DelayThink();
public:
static TYPEDESCRIPTION IMPL(m_SaveData)[2];
float m_flDelay;
int m_iszKillTarget;
};/* size: 160, cachelines: 3, members: 4 */
};
/* <48ea6f> ../cstrike/dlls/cbase.h:526 */
class CBaseAnimating: public CBaseDelay
@ -713,14 +552,14 @@ public:
public:
float StudioFrameAdvance(float flInterval = 0.0f);
BOOL GetSequenceFlags(void);
BOOL GetSequenceFlags();
int LookupActivity(int activity);
int LookupActivityHeaviest(int activity);
int LookupSequence(const char *label);
void ResetSequenceInfo(void);
void ResetSequenceInfo();
void DispatchAnimEvents(float flFutureInterval = 0.1f);
float SetBoneController(int iController, float flValue = 0.0f);
void InitBoneControllers(void);
void InitBoneControllers();
NOXREF float SetBlending(int iBlender, float flValue);
NOXREF void GetBonePosition(int iBone, Vector &origin, Vector &angles);
@ -731,7 +570,7 @@ public:
NOXREF int GetBodygroup(int iGroup);
int ExtractBbox(int sequence, float *mins, float *maxs);
void SetSequenceBox(void);
void SetSequenceBox();
public:
static TYPEDESCRIPTION IMPL(m_SaveData)[5];
@ -740,8 +579,7 @@ public:
float m_flLastEventCheck;
BOOL m_fSequenceFinished;
BOOL m_fSequenceLoops;
};/* size: 180, cachelines: 3, members: 7 */
};
/* <48eb06> ../cstrike/dlls/cbase.h:569 */
class CBaseToggle: public CBaseAnimating
@ -750,14 +588,9 @@ public:
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int GetToggleState(void)
{
return m_toggle_state;
}
virtual float GetDelay(void)
{
return m_flWait;
}
virtual int GetToggleState() { return m_toggle_state; }
virtual float GetDelay() { return m_flWait; }
#ifdef HOOK_GAMEDLL
void KeyValue_(KeyValueData *pkvd);
@ -768,10 +601,10 @@ public:
public:
void LinearMove(Vector vecDest, float flSpeed);
void EXPORT LinearMoveDone(void);
void EXPORT LinearMoveDone();
void AngularMove(Vector vecDestAngle, float flSpeed);
void EXPORT AngularMoveDone(void);
NOXREF BOOL IsLockedByMaster(void);
void EXPORT AngularMoveDone();
NOXREF BOOL IsLockedByMaster();
public:
static float AxisValue(int flags, const Vector &angles);
@ -795,13 +628,12 @@ public:
int m_cTriggersLeft;
float m_flHeight;
EHANDLE m_hActivator;
void (CBaseToggle::*m_pfnCallWhenMoveDone)(void);
void (CBaseToggle::*m_pfnCallWhenMoveDone)();
Vector m_vecFinalDest;
Vector m_vecFinalAngle;
int m_bitsDamageInflict;
string_t m_sMaster;
};/* size: 312, cachelines: 5, members: 21 */
};
#include "basemonster.h"
@ -818,13 +650,13 @@ class CBaseButton: public CBaseToggle
};
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);
virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
virtual int ObjectCaps()
{
if (pev->takedamage == DAMAGE_NO)
{
@ -836,8 +668,8 @@ public:
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
int TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
int Save_(CSave &save);
@ -846,19 +678,19 @@ public:
#endif // HOOK_GAMEDLL
public:
NOXREF void RotSpawn(void);
void ButtonActivate(void);
NOXREF void SparkSoundCache(void);
NOXREF void RotSpawn();
void ButtonActivate();
NOXREF void SparkSoundCache();
NOXREF void EXPORT ButtonShot(void);
NOXREF void EXPORT ButtonShot();
void EXPORT ButtonTouch(CBaseEntity *pOther);
void EXPORT ButtonSpark(void);
void EXPORT TriggerAndWait(void);
void EXPORT ButtonReturn(void);
void EXPORT ButtonBackHome(void);
void EXPORT ButtonSpark();
void EXPORT TriggerAndWait();
void EXPORT ButtonReturn();
void EXPORT ButtonBackHome();
void EXPORT ButtonUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
BUTTON_CODE ButtonResponseToTouch(void);
BUTTON_CODE ButtonResponseToTouch();
public:
static TYPEDESCRIPTION IMPL(m_SaveData)[8];
@ -872,60 +704,25 @@ public:
BYTE m_bUnlockedSound;
BYTE m_bUnlockedSentence;
int m_sounds;
};/* size: 368, cachelines: 6, members: 11 */
};
/* <1da023> ../cstrike/dlls/cbase.h:861 */
class CWorld: public CBaseEntity
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
#endif // HOOK_GAMEDLL
};/* size: 152, cachelines: 3, members: 1 */
/* <1d9f84> ../cstrike/dlls/world.cpp:111 */
class CDecal: public CBaseEntity
{
public:
virtual void Spawn(void);
virtual void KeyValue(KeyValueData *);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void KeyValue_(KeyValueData *);
#endif // HOOK_GAMEDLL
public:
void EXPORT StaticDecal(void);
void EXPORT TriggerDecal(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
};/* size: 152, cachelines: 3, members: 1 */
// Body queue class here.... It's really just CBaseEntity
/* <1d9fd1> ../cstrike/dlls/world.cpp:207 */
class CCorpse: public CBaseEntity
{
public:
/* <1dabe0> ../cstrike/dlls/world.cpp:209 */
virtual int ObjectCaps(void)
{
return FCAP_DONT_SAVE;
}
};/* size: 152, cachelines: 3, members: 1 */
};
template <class T>
T *GetClassPtr(T *a)
@ -944,18 +741,21 @@ T *GetClassPtr(T *a)
#endif // _WIN32 && HOOK_GAMEDLL
}
return a;
}
extern CUtlVector<hash_item_t> stringsHashTable;
int CaseInsensitiveHash(const char *string, int iBounds);
void EmptyEntityHashTable(void);
void EmptyEntityHashTable();
void AddEntityHashValue(entvars_t *pev, const char *value, hash_types_e fieldType);
void RemoveEntityHashValue(entvars_t *pev, const char *value, hash_types_e fieldType);
void printEntities(void);
void printEntities();
edict_t *CREATE_NAMED_ENTITY(string_t iClass);
void REMOVE_ENTITY(edict_t *e);
void CONSOLE_ECHO_(char *pszMsg, ...);
void loopPerformance(void);
void loopPerformance();
C_DLLEXPORT int GetEntityAPI(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion);
NOXREF int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion);
@ -976,18 +776,4 @@ void SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseDa
void SetObjectCollisionBox(entvars_t *pev);
void OnFreeEntPrivateData(edict_t *pEnt);
#ifdef HOOK_GAMEDLL
typedef BOOL (CBaseEntity::*FVISIBLE_ENTITY)(CBaseEntity *);
typedef BOOL (CBaseEntity::*FVISIBLE_VECTOR)(const Vector &);
typedef void (CGrenade::*EXPLODE_VECTOR)(Vector, Vector);
typedef void (CGrenade::*EXPLODE_TRACERESULT)(TraceResult *, int);
typedef CBaseEntity *(CBaseEntity::*CBASE_ISTANCE_EDICT)(edict_t *);
typedef CBaseEntity *(CBaseEntity::*CBASE_ISTANCE_ENTVARS)(entvars_t *);
typedef CBaseEntity *(CBaseEntity::*CBASE_ISTANCE_INT)(int);
#endif // HOOK_GAMEDLL
#endif // CBASE_H

View File

@ -59,20 +59,6 @@ static entity_field_alias_t custom_entity_field_alias[] =
static int g_serveractive = 0;
#else
float g_flTimeLimit;
float g_flResetTime;
bool g_bClientPrintEnable;
char *sPlayerModelFiles[12];
bool g_skipCareerInitialSpawn;
entity_field_alias_t entity_field_alias[6];
entity_field_alias_t player_field_alias[3];
entity_field_alias_t custom_entity_field_alias[9];
int g_serveractive;
#endif // HOOK_GAMEDLL
PLAYERPVSSTATUS g_PVSStatus[MAX_CLIENTS];
@ -80,7 +66,7 @@ unsigned short m_usResetDecals;
unsigned short g_iShadowSprite;
/* <47b45> ../cstrike/dlls/client.cpp:76 */
int CMD_ARGC_(void)
int CMD_ARGC_()
{
if (!UseBotArgs)
return CMD_ARGC();
@ -162,7 +148,7 @@ BOOL EXT_FUNC ClientConnect(edict_t *pEntity, const char *pszName, const char *p
/* <47f5b> ../cstrike/dlls/client.cpp:255 */
void EXT_FUNC ClientDisconnect(edict_t *pEntity)
{
CBasePlayer *pPlayer = (CBasePlayer *)CBaseEntity::Instance(pEntity);
CBasePlayer *pPlayer = dynamic_cast<CBasePlayer *>(CBaseEntity::Instance(pEntity));
if (!g_fGameOver)
{
@ -176,14 +162,14 @@ void EXT_FUNC ClientDisconnect(edict_t *pEntity)
pEntity->v.solid = SOLID_NOT;
pEntity->v.flags = FL_DORMANT;
if (pPlayer)
if (pPlayer != NULL)
pPlayer->SetThink(NULL);
UTIL_SetOrigin(&pEntity->v, pEntity->v.origin);
g_pGameRules->ClientDisconnected(pEntity);
}
if (TheBots != NULL && pPlayer && pPlayer->IsBot())
if (TheBots != NULL && pPlayer != NULL && pPlayer->IsBot())
{
TheBots->ClientDisconnect(pPlayer);
}
@ -276,7 +262,7 @@ void ShowVGUIMenu(CBasePlayer *pPlayer, int MenuType, int BitMask, char *szOldMe
}
/* <4c3c5> ../cstrike/dlls/client.cpp:414 */
NOXREF int CountTeams(void)
NOXREF int CountTeams()
{
int iNumCT = 0, iNumTerrorist = 0;
CBaseEntity *pPlayer = NULL;
@ -426,7 +412,7 @@ void ProcessKickVote(CBasePlayer *pVotingPlayer, CBasePlayer *pKickPlayer)
}
/* <48298> ../cstrike/dlls/client.cpp:580 */
TeamName SelectDefaultTeam(void)
TeamName SelectDefaultTeam()
{
TeamName team = UNASSIGNED;
CHalfLifeMultiplay *mp = g_pGameRules;
@ -485,7 +471,7 @@ TeamName SelectDefaultTeam(void)
}
/* <473a3> ../cstrike/dlls/client.cpp:638 */
void CheckStartMoney(void)
void CheckStartMoney()
{
int money = (int)startmoney.value;
@ -713,7 +699,7 @@ void Host_Say(edict_t *pEntity, int teamonly)
// team only
if (teamonly)
{
if (UTIL_IsGame("czero") && (player->m_iTeam == CT || player->m_iTeam == TERRORIST))
if (g_bIsCzeroGame && (player->m_iTeam == CT || player->m_iTeam == TERRORIST))
{
// search the place name where is located the player
Place playerPlace = TheNavAreaGrid.GetPlace(&player->pev->origin);
@ -1808,7 +1794,7 @@ void BuyItem(CBasePlayer *pPlayer, int iSlot)
void HandleMenu_ChooseAppearance(CBasePlayer *player, int slot)
{
CHalfLifeMultiplay *mp = g_pGameRules;
int numSkins = UTIL_IsGame("czero") ? CZ_NUM_SKIN : CS_NUM_SKIN;
int numSkins = g_bIsCzeroGame ? CZ_NUM_SKIN : CS_NUM_SKIN;
struct
{
@ -1846,7 +1832,7 @@ void HandleMenu_ChooseAppearance(CBasePlayer *player, int slot)
appearance.model_name = "guerilla";
break;
case 5:
if (UTIL_IsGame("czero"))
if (g_bIsCzeroGame)
{
appearance.model_id = MODEL_MILITIA;
appearance.model_name = "militia";
@ -1895,7 +1881,7 @@ void HandleMenu_ChooseAppearance(CBasePlayer *player, int slot)
appearance.model_name = "gign";
break;
case 5:
if (UTIL_IsGame("czero"))
if (g_bIsCzeroGame)
{
appearance.model_id = MODEL_SPETSNAZ;
appearance.model_name = "spetsnaz";
@ -2247,19 +2233,17 @@ BOOL HandleMenu_ChooseTeam(CBasePlayer *player, int slot)
if (!g_pGameRules->IsCareer())
{
bool isCZero = UTIL_IsGame("czero");
switch (team)
{
case CT:
if (isCZero)
if (g_bIsCzeroGame)
ShowVGUIMenu(player, VGUI_Menu_Class_CT, (MENU_KEY_1 | MENU_KEY_2 | MENU_KEY_3 | MENU_KEY_4 | MENU_KEY_5 | MENU_KEY_6), "#CT_Select");
else
ShowVGUIMenu(player, VGUI_Menu_Class_CT, (MENU_KEY_1 | MENU_KEY_2 | MENU_KEY_3 | MENU_KEY_4 | MENU_KEY_5), "#CT_Select");
break;
case TERRORIST:
if (isCZero)
if (g_bIsCzeroGame)
ShowVGUIMenu(player, VGUI_Menu_Class_T, (MENU_KEY_1 | MENU_KEY_2 | MENU_KEY_3 | MENU_KEY_4 | MENU_KEY_5 | MENU_KEY_6), "#Terrorist_Select");
else
ShowVGUIMenu(player, VGUI_Menu_Class_T, (MENU_KEY_1 | MENU_KEY_2 | MENU_KEY_3 | MENU_KEY_4 | MENU_KEY_5), "#Terrorist_Select");
@ -2628,7 +2612,7 @@ CBaseEntity *EntityFromUserID(int userID)
}
/* <4baa5> ../cstrike/dlls/client.cpp:2958 */
NOXREF int CountPlayersInServer(void)
NOXREF int CountPlayersInServer()
{
int count = 0;
CBaseEntity *pTempEntity = NULL;
@ -3639,7 +3623,7 @@ void EXT_FUNC ClientCommand(edict_t *pEntity)
for (int i = 1; i <= gpGlobals->maxClients; ++i)
{
CBasePlayer *pObserver = reinterpret_cast<CBasePlayer *>(UTIL_PlayerByIndex(i));
CBasePlayer *pObserver = static_cast<CBasePlayer *>(UTIL_PlayerByIndex(i));
if (pObserver && pObserver->IsObservingPlayer(player))
{
@ -3665,7 +3649,7 @@ void EXT_FUNC ClientCommand(edict_t *pEntity)
for (int i = 1; i <= gpGlobals->maxClients; ++i)
{
CBasePlayer *pObserver = reinterpret_cast<CBasePlayer *>(UTIL_PlayerByIndex(i));
CBasePlayer *pObserver = static_cast<CBasePlayer *>(UTIL_PlayerByIndex(i));
if (pObserver && pObserver->IsObservingPlayer(player))
{
@ -3936,7 +3920,7 @@ void EXT_FUNC ClientUserInfoChanged(edict_t *pEntity, char *infobuffer)
}
/* <4a378> ../cstrike/dlls/client.cpp:4362 */
void EXT_FUNC ServerDeactivate(void)
void EXT_FUNC ServerDeactivate()
{
// It's possible that the engine will call this function more times than is necessary
// Therefore, only run it one time for each call to ServerActivate
@ -4041,13 +4025,13 @@ void EXT_FUNC PlayerPostThink(edict_t *pEntity)
}
/* <4a4f4> ../cstrike/dlls/client.cpp:4486 */
void EXT_FUNC ParmsNewLevel(void)
void EXT_FUNC ParmsNewLevel()
{
;
}
/* <4a50d> ../cstrike/dlls/client.cpp:4491 */
void EXT_FUNC ParmsChangeLevel(void)
void EXT_FUNC ParmsChangeLevel()
{
// retrieve the pointer to the save data
SAVERESTOREDATA *pSaveData = (SAVERESTOREDATA *)gpGlobals->pSaveData;
@ -4059,7 +4043,7 @@ void EXT_FUNC ParmsChangeLevel(void)
}
/* <4a548> ../cstrike/dlls/client.cpp:4504 */
void EXT_FUNC StartFrame(void)
void EXT_FUNC StartFrame()
{
if (g_pGameRules != NULL)
{
@ -4099,10 +4083,9 @@ void EXT_FUNC StartFrame(void)
}
/* <4a581> ../cstrike/dlls/client.cpp:4534 */
void ClientPrecache(void)
void ClientPrecache()
{
int i;
bool isCZero = UTIL_IsGame("czero");
PRECACHE_SOUND("weapons/dryfire_pistol.wav");
PRECACHE_SOUND("weapons/dryfire_rifle.wav");
@ -4217,7 +4200,7 @@ void ClientPrecache(void)
PRECACHE_SOUND("player/pl_pain7.wav");
int numPlayerModels;
if (isCZero)
if (g_bIsCzeroGame)
numPlayerModels = ARRAYSIZE(sPlayerModelFiles);
else
numPlayerModels = ARRAYSIZE(sPlayerModelFiles) - 2;
@ -4225,7 +4208,7 @@ void ClientPrecache(void)
for (i = 0; i < numPlayerModels; ++i)
PRECACHE_MODEL(sPlayerModelFiles[i]);
if (isCZero)
if (g_bIsCzeroGame)
{
for (i = FirstCustomSkin; i <= LastCustomSkin; ++i)
{
@ -4290,7 +4273,7 @@ void ClientPrecache(void)
for (i = 0; i < numPlayerModels; ++i)
ENGINE_FORCE_UNMODIFIED(force_model_specifybounds, (float *)&vMin, (float *)&vMax, sPlayerModelFiles[i]);
if (isCZero)
if (g_bIsCzeroGame)
{
for (i = FirstCustomSkin; i <= LastCustomSkin; ++i)
{
@ -4315,7 +4298,7 @@ void ClientPrecache(void)
ENGINE_FORCE_UNMODIFIED(force_exactfile, (float *)&temp, (float *)&temp, "sprites/scope_arc_ne.tga");
ENGINE_FORCE_UNMODIFIED(force_exactfile, (float *)&temp, (float *)&temp, "sprites/scope_arc_sw.tga");
if (isCZero)
if (g_bIsCzeroGame)
{
vMin = Vector(-13, -6, -22);
vMax = Vector(13, 6, 22);
@ -4333,7 +4316,7 @@ void ClientPrecache(void)
ENGINE_FORCE_UNMODIFIED(force_model_specifybounds, (float *)&vMin, (float *)&vMax, "models/p_fiveseven.mdl");
ENGINE_FORCE_UNMODIFIED(force_model_specifybounds, (float *)&vMin, (float *)&vMax, "models/p_glock18.mdl");
if (isCZero)
if (g_bIsCzeroGame)
{
vMin = Vector(-26, -19, -21);
vMax = Vector(26, 23, 21);
@ -4347,7 +4330,7 @@ void ClientPrecache(void)
ENGINE_FORCE_UNMODIFIED(force_model_specifybounds, (float *)&vMin, (float *)&vMax, "models/p_xm1014.mdl");
ENGINE_FORCE_UNMODIFIED(force_model_specifybounds, (float *)&vMin, (float *)&vMax, "models/p_m3.mdl");
if (isCZero)
if (g_bIsCzeroGame)
{
vMin = Vector(-23, -9, -20);
vMax = Vector(23, 17, 20);
@ -4364,7 +4347,7 @@ void ClientPrecache(void)
ENGINE_FORCE_UNMODIFIED(force_model_specifybounds, (float *)&vMin, (float *)&vMax, "models/p_tmp.mdl");
ENGINE_FORCE_UNMODIFIED(force_model_specifybounds, (float *)&vMin, (float *)&vMax, "models/p_p90.mdl");
if (isCZero)
if (g_bIsCzeroGame)
{
vMin = Vector(-38, -33, -22);
vMax = Vector(38, 15, 35);
@ -4386,7 +4369,7 @@ void ClientPrecache(void)
ENGINE_FORCE_UNMODIFIED(force_model_specifybounds, (float *)&vMin, (float *)&vMax, "models/p_famas.mdl");
ENGINE_FORCE_UNMODIFIED(force_model_specifybounds, (float *)&vMin, (float *)&vMax, "models/p_galil.mdl");
if (isCZero)
if (g_bIsCzeroGame)
{
vMin = Vector(-30, -10, -20);
vMax = Vector(30, 11, 20);
@ -4407,7 +4390,7 @@ void ClientPrecache(void)
vMin = Vector(-4, -8, -3);
vMax = Vector(3, 7, 3);
if (isCZero)
if (g_bIsCzeroGame)
{
vMin = Vector(-17, -8, -3);
vMax = Vector(17, 7, 3);
@ -4420,7 +4403,7 @@ void ClientPrecache(void)
ENGINE_FORCE_UNMODIFIED(force_model_specifybounds, (float *)&vMin, (float *)&vMax, "models/w_c4.mdl");
if (isCZero)
if (g_bIsCzeroGame)
{
vMin = Vector(-7, -3, -18);
vMax = Vector(7, 2, 18);
@ -4435,7 +4418,7 @@ void ClientPrecache(void)
ENGINE_FORCE_UNMODIFIED(force_model_specifybounds, (float *)&vMin, (float *)&vMax, "models/p_hegrenade.mdl");
ENGINE_FORCE_UNMODIFIED(force_model_specifybounds, (float *)&vMin, (float *)&vMax, "models/p_smokegrenade.mdl");
if (isCZero)
if (g_bIsCzeroGame)
vMin = Vector(-5, -5, -7);
else
vMin = Vector(-5, -5, -5);
@ -4451,7 +4434,7 @@ void ClientPrecache(void)
ENGINE_FORCE_UNMODIFIED(force_model_specifybounds, (float *)&vMin, (float *)&vMax, "models/p_knife.mdl");
if (isCZero)
if (g_bIsCzeroGame)
{
vMin = Vector(-21, -25, -54);
vMax = Vector(21, 23, 24);
@ -4526,9 +4509,9 @@ void ClientPrecache(void)
}
/* <4a6e5> ../cstrike/dlls/client.cpp:4996 */
const char *EXT_FUNC GetGameDescription(void)
const char *EXT_FUNC GetGameDescription()
{
if (UTIL_IsGame("czero"))
if (g_bIsCzeroGame)
return "Condition Zero";
return "Counter-Strike";
@ -4623,9 +4606,9 @@ void EXT_FUNC SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned c
return;
}
CBasePlayer *pPlayer = reinterpret_cast<CBasePlayer *>(CBasePlayer::Instance(pClient));
CBasePlayer *pPlayer = dynamic_cast<CBasePlayer *>(CBasePlayer::Instance(pClient));
if (pPlayer->pev->iuser2 && pPlayer->m_hObserverTarget)
if (pPlayer != NULL && pPlayer->pev->iuser2 && pPlayer->m_hObserverTarget)
{
if (pPlayer->m_afPhysicsFlags & PFLAG_OBSERVER)
{
@ -5066,7 +5049,7 @@ void Custom_Encode(struct delta_s *pFields, const unsigned char *from, const uns
}
/* <4b08a> ../cstrike/dlls/client.cpp:5811 */
void EXT_FUNC RegisterEncoders(void)
void EXT_FUNC RegisterEncoders()
{
DELTA_ADDENCODER("Entity_Encode", Entity_Encode);
DELTA_ADDENCODER("Custom_Encode", Custom_Encode);
@ -5077,7 +5060,7 @@ void EXT_FUNC RegisterEncoders(void)
int EXT_FUNC GetWeaponData(edict_s *player, struct weapon_data_s *info)
{
entvars_t *pev = &player->v;
CBasePlayer *pl = reinterpret_cast<CBasePlayer *>(CBasePlayer::Instance(pev));
CBasePlayer *pl = dynamic_cast<CBasePlayer *>(CBasePlayer::Instance(pev));
Q_memset(info, 0, sizeof(weapon_data_t) * MAX_WEAPONS);
@ -5092,9 +5075,9 @@ int EXT_FUNC GetWeaponData(edict_s *player, struct weapon_data_s *info)
while (pPlayerItem != NULL)
{
CBasePlayerWeapon *gun = reinterpret_cast<CBasePlayerWeapon *>(pPlayerItem->GetWeaponPtr());
CBasePlayerWeapon *gun = dynamic_cast<CBasePlayerWeapon *>(pPlayerItem->GetWeaponPtr());
if (gun && gun->UseDecrement())
if (gun != NULL && gun->UseDecrement())
{
ItemInfo II;
Q_memset(&II, 0, sizeof(II));
@ -5137,14 +5120,14 @@ void EXT_FUNC UpdateClientData(const struct edict_s *ent, int sendweapons, struc
}
entvars_t *pevOrg = NULL;
entvars_t *pev = (entvars_t *)&ent->v;
CBasePlayer *pl = reinterpret_cast<CBasePlayer *>(CBasePlayer::Instance(pev));
entvars_t *pev = const_cast<entvars_t *>(&ent->v);
CBasePlayer *pl = dynamic_cast<CBasePlayer *>(CBasePlayer::Instance(pev));
if (pl->pev->iuser1 == OBS_IN_EYE && pl->m_hObserverTarget)
if (pl != NULL && pl->pev->iuser1 == OBS_IN_EYE && pl->m_hObserverTarget)
{
pevOrg = pev;
pev = pl->m_hObserverTarget->pev;
pl = reinterpret_cast<CBasePlayer *>(CBasePlayer::Instance(pev));
pl = dynamic_cast<CBasePlayer *>(CBasePlayer::Instance(pev));
}
cd->flags = pev->flags;
@ -5228,7 +5211,7 @@ void EXT_FUNC UpdateClientData(const struct edict_s *ent, int sendweapons, struc
ItemInfo II;
Q_memset(&II, 0, sizeof(II));
CBasePlayerWeapon *gun = reinterpret_cast<CBasePlayerWeapon *>(pl->m_pActiveItem->GetWeaponPtr());
CBasePlayerWeapon *gun = dynamic_cast<CBasePlayerWeapon *>(pl->m_pActiveItem->GetWeaponPtr());
if (gun != NULL && gun->UseDecrement() && gun->GetItemInfo(&II))
{
@ -5252,36 +5235,34 @@ void EXT_FUNC UpdateClientData(const struct edict_s *ent, int sendweapons, struc
/* <4b3ee> ../cstrike/dlls/client.cpp:6050 */
void EXT_FUNC CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed)
{
entvars_t *pev = (entvars_t *)&player->v;
CBasePlayer *pl = reinterpret_cast<CBasePlayer *>(CBasePlayer::Instance(pev));
entvars_t *pev = const_cast<entvars_t *>(&player->v);
CBasePlayer *pl = dynamic_cast<CBasePlayer *>(CBasePlayer::Instance(pev));
if (!pl)
if (pl != NULL)
{
return;
}
if (pl->pev->groupinfo)
{
UTIL_SetGroupTrace(pl->pev->groupinfo, GROUP_OP_AND);
}
pl->random_seed = random_seed;
}
}
/* <4b4eb> ../cstrike/dlls/client.cpp:6074 */
void EXT_FUNC CmdEnd(const edict_t *player)
{
entvars_t *pev = (entvars_t *)&player->v;
CBasePlayer *pl = reinterpret_cast<CBasePlayer *>(CBasePlayer::Instance(pev));
if (!pl)
return;
entvars_t *pev = const_cast<entvars_t *>(&player->v);
CBasePlayer *pl = dynamic_cast<CBasePlayer *>(CBasePlayer::Instance(pev));
if (pl != NULL)
{
if (pl->pev->groupinfo)
UTIL_UnsetGroupTrace();
if (pev->flags & FL_DUCKING)
UTIL_SetSize(pev, VEC_DUCK_HULL_MIN, VEC_DUCK_HULL_MAX);
}
}
/* <4b644> ../cstrike/dlls/client.cpp:6101 */
@ -5309,7 +5290,7 @@ int EXT_FUNC GetHullBounds(int hullnumber, float *mins, float *maxs)
// to be created during play ( e.g., grenades, ammo packs, projectiles, corpses, etc. )
/* <4b733> ../cstrike/dlls/client.cpp:6156 */
void EXT_FUNC CreateInstancedBaselines(void)
void EXT_FUNC CreateInstancedBaselines()
{
int iret = 0;
entity_state_t state;
@ -5344,7 +5325,7 @@ int EXT_FUNC InconsistentFile(const edict_t *player, const char *filename, char
// if you want.
/* <4b7cf> ../cstrike/dlls/client.cpp:6204 */
int EXT_FUNC AllowLagCompensation(void)
int EXT_FUNC AllowLagCompensation()
{
return 1;
}

View File

@ -86,62 +86,29 @@ typedef struct
float m_fTimeEnteredPVS;
} ENTITYPVSSTATUS;
/* size: 4, cachelines: 1, members: 1 */
typedef struct
struct PLAYERPVSSTATUS
{
ENTITYPVSSTATUS m_Status[1380];
int headnode;
int num_leafs;
short int leafnums[ MAX_ENT_LEAFS ];
};
} PLAYERPVSSTATUS;
/* size: 5624, cachelines: 88, members: 4 */
typedef struct
struct entity_field_alias_t
{
char name[32];
int field;
};
} entity_field_alias_t;
/* size: 36, cachelines: 1, members: 2 */
#ifdef HOOK_GAMEDLL
#define g_flTimeLimit (*pg_flTimeLimit)
#define g_flResetTime (*pg_flResetTime)
#define g_bClientPrintEnable (*pg_bClientPrintEnable)
#define g_PVSStatus (*pg_PVSStatus)
#define m_usResetDecals (*pm_usResetDecals)
#define g_iShadowSprite (*pg_iShadowSprite)
#define sPlayerModelFiles (*psPlayerModelFiles)
#define g_skipCareerInitialSpawn (*pg_skipCareerInitialSpawn)
#define entity_field_alias (*pentity_field_alias)
#define player_field_alias (*pplayer_field_alias)
#define custom_entity_field_alias (*pcustom_entity_field_alias)
#define g_serveractive (*pg_serveractive)
#endif // HOOK_GAMEDLL
extern PLAYERPVSSTATUS g_PVSStatus[32];
extern float g_flTimeLimit;// exported
extern float g_flTimeLimit;
extern float g_flResetTime;
extern bool g_bClientPrintEnable;
extern bool g_skipCareerInitialSpawn;
extern char *sPlayerModelFiles[12];
extern bool g_skipCareerInitialSpawn;
extern entity_field_alias_t entity_field_alias[6];
extern entity_field_alias_t player_field_alias[3];
extern entity_field_alias_t custom_entity_field_alias[9];
extern int g_serveractive;
extern unsigned short m_usResetDecals;
extern unsigned short g_iShadowSprite;
int CMD_ARGC_(void);
int CMD_ARGC_();
const char *CMD_ARGV_(int i);
NOXREF void set_suicide_frame(entvars_t *pev);
void TeamChangeUpdate(CBasePlayer *player, int team_id);
@ -152,12 +119,12 @@ void respawn(entvars_t *pev, BOOL fCopyCorpse = FALSE);
void ClientKill(edict_t *pEntity);
void ShowMenu(CBasePlayer *pPlayer, int bitsValidSlots, int nDisplayTime, BOOL fNeedMore, char *pszText);
void ShowVGUIMenu(CBasePlayer *pPlayer, int MenuType, int BitMask, char *szOldMenu);
NOXREF C_DLLEXPORT int CountTeams(void);
NOXREF C_DLLEXPORT int CountTeams();
void ListPlayers(CBasePlayer *current);
C_DLLEXPORT int CountTeamPlayers(int iTeam);
void ProcessKickVote(CBasePlayer *pVotingPlayer, CBasePlayer *pKickPlayer);
TeamName SelectDefaultTeam(void);
void CheckStartMoney(void);
TeamName SelectDefaultTeam();
void CheckStartMoney();
void ClientPutInServer(edict_t *pEntity);
int Q_strlen_(const char *str);
void Host_Say(edict_t *pEntity, int teamonly);
@ -179,20 +146,20 @@ void Radio3(CBasePlayer *player, int slot);
bool BuyGunAmmo(CBasePlayer *player, CBasePlayerItem *weapon, bool bBlinkMoney);
bool BuyAmmo(CBasePlayer *player, int nSlot, bool bBlinkMoney);
CBaseEntity *EntityFromUserID(int userID);
NOXREF int CountPlayersInServer(void);
NOXREF int CountPlayersInServer();
BOOL HandleBuyAliasCommands(CBasePlayer *pPlayer, const char *pszCommand);
BOOL HandleRadioAliasCommands(CBasePlayer *pPlayer, const char *pszCommand);
void ClientCommand(edict_t *pEntity);
void ClientUserInfoChanged(edict_t *pEntity, char *infobuffer);
void ServerDeactivate(void);
void ServerDeactivate();
void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax);
void PlayerPreThink(edict_t *pEntity);
void PlayerPostThink(edict_t *pEntity);
void ParmsNewLevel(void);
void ParmsChangeLevel(void);
void StartFrame(void);
void ClientPrecache(void);
const char *GetGameDescription(void);
void ParmsNewLevel();
void ParmsChangeLevel();
void StartFrame();
void ClientPrecache();
const char *GetGameDescription();
void Sys_Error(const char *error_string);
void PlayerCustomization(edict_t *pEntity, customization_t *pCust);
void SpectatorConnect(edict_t *pEntity);
@ -211,15 +178,15 @@ void Player_FieldInit(struct delta_s *pFields);
void Player_Encode(struct delta_s *pFields, const unsigned char *from, const unsigned char *to);
void Custom_Entity_FieldInit(delta_s *pFields);
void Custom_Encode(struct delta_s *pFields, const unsigned char *from, const unsigned char *to);
void RegisterEncoders(void);
void RegisterEncoders();
int GetWeaponData(edict_s *player, struct weapon_data_s *info);
void UpdateClientData(const edict_s *ent, int sendweapons, struct clientdata_s *cd);
void CmdStart(const edict_t *player, const struct usercmd_s *cmd, unsigned int random_seed);
void CmdEnd(const edict_t *player);
int ConnectionlessPacket(const struct netadr_s *net_from, const char *args, char *response_buffer, int *response_buffer_size);
int GetHullBounds(int hullnumber, float *mins, float *maxs);
void CreateInstancedBaselines(void);
void CreateInstancedBaselines();
int InconsistentFile(const edict_t *player, const char *filename, char *disconnect_message);
int AllowLagCompensation(void);
int AllowLagCompensation();
#endif // CLIENT_H

View File

@ -1,7 +1,7 @@
#include "precompiled.h"
/* <5f4cb> ../cstrike/dlls/combat.cpp:52 */
void CGib::LimitVelocity(void)
void CGib::LimitVelocity()
{
float length = pev->velocity.Length();
@ -208,7 +208,7 @@ void CGib::SpawnRandomGibs(entvars_t *pevVictim, int cGibs, int human)
}
/* <5f58a> ../cstrike/dlls/combat.cpp:263 */
BOOL CBaseMonster::__MAKE_VHOOK(HasHumanGibs)(void)
BOOL CBaseMonster::__MAKE_VHOOK(HasHumanGibs)()
{
int myClass = Classify();
@ -222,7 +222,7 @@ BOOL CBaseMonster::__MAKE_VHOOK(HasHumanGibs)(void)
}
/* <5f5ca> ../cstrike/dlls/combat.cpp:278 */
BOOL CBaseMonster::__MAKE_VHOOK(HasAlienGibs)(void)
BOOL CBaseMonster::__MAKE_VHOOK(HasAlienGibs)()
{
int myClass = Classify();
if (myClass == CLASS_ALIEN_MILITARY
@ -237,7 +237,7 @@ BOOL CBaseMonster::__MAKE_VHOOK(HasAlienGibs)(void)
}
/* <5f60a> ../cstrike/dlls/combat.cpp:295 */
void CBaseMonster::__MAKE_VHOOK(FadeMonster)(void)
void CBaseMonster::__MAKE_VHOOK(FadeMonster)()
{
StopAnimation();
@ -251,14 +251,14 @@ void CBaseMonster::__MAKE_VHOOK(FadeMonster)(void)
}
/* <60a59> ../cstrike/dlls/combat.cpp:310 */
void CBaseMonster::__MAKE_VHOOK(GibMonster)(void)
void CBaseMonster::__MAKE_VHOOK(GibMonster)()
{
TraceResult tr;
BOOL gibbed = FALSE;
EMIT_SOUND(ENT(pev), CHAN_WEAPON, "common/bodysplat.wav", VOL_NORM, ATTN_NORM);
// only humans throw skulls !!!UNDONE - eventually monsters will have their own sets of gibs
// only humans throw skulls UNDONE - eventually monsters will have their own sets of gibs
if (HasHumanGibs())
{
// Only the player will ever get here
@ -299,7 +299,7 @@ void CBaseMonster::__MAKE_VHOOK(GibMonster)(void)
// anim to play.
/* <5f65e> ../cstrike/dlls/combat.cpp:355 */
Activity CBaseMonster::__MAKE_VHOOK(GetDeathActivity)(void)
Activity CBaseMonster::__MAKE_VHOOK(GetDeathActivity)()
{
Activity deathActivity;
BOOL fTriedDirection;
@ -419,7 +419,7 @@ Activity CBaseMonster::__MAKE_VHOOK(GetDeathActivity)(void)
// anim to play.
/* <5f848> ../cstrike/dlls/combat.cpp:476 */
NOXREF Activity CBaseMonster::GetSmallFlinchActivity(void)
NOXREF Activity CBaseMonster::GetSmallFlinchActivity()
{
Activity flinchActivity;
BOOL fTriedDirection;
@ -467,7 +467,7 @@ NOXREF Activity CBaseMonster::GetSmallFlinchActivity(void)
}
/* <5f8a6> ../cstrike/dlls/combat.cpp:525 */
void CBaseMonster::__MAKE_VHOOK(BecomeDead)(void)
void CBaseMonster::__MAKE_VHOOK(BecomeDead)()
{
// don't let autoaim aim at corpses.
pev->takedamage = DAMAGE_YES;
@ -494,7 +494,7 @@ BOOL CBaseMonster::ShouldGibMonster(int iGib)
}
/* <5f8f8> ../cstrike/dlls/combat.cpp:551 */
void CBaseMonster::CallGibMonster(void)
void CBaseMonster::CallGibMonster()
{
BOOL fade = FALSE;
@ -587,7 +587,7 @@ void CBaseMonster::__MAKE_VHOOK(Killed)(entvars_t *pevAttacker, int iGib)
}
/* <5e84e> ../cstrike/dlls/combat.cpp:652 */
void CBaseEntity::SUB_StartFadeOut(void)
void CBaseEntity::SUB_StartFadeOut()
{
if (pev->rendermode == kRenderNormal)
{
@ -603,7 +603,7 @@ void CBaseEntity::SUB_StartFadeOut(void)
}
/* <5ea72> ../cstrike/dlls/combat.cpp:667 */
void CBaseEntity::SUB_FadeOut(void)
void CBaseEntity::SUB_FadeOut()
{
if (pev->renderamt > 7)
{
@ -619,7 +619,7 @@ void CBaseEntity::SUB_FadeOut(void)
}
/* <5eab1> ../cstrike/dlls/combat.cpp:688 */
void CGib::WaitTillLand(void)
void CGib::WaitTillLand()
{
if (!IsInWorld())
{
@ -779,7 +779,7 @@ int CBaseMonster::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *p
PainSound();
}
//!!!LATER - make armor consideration here!
// LATER: make armor consideration here!
flTake = flDamage;
// set damage type sustained
@ -1049,7 +1049,7 @@ void RadiusFlash(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker,
for (int i = 1; i <= gpGlobals->maxClients; ++i)
{
CBasePlayer *pObserver = reinterpret_cast<CBasePlayer *>(UTIL_PlayerByIndex(i));
CBasePlayer *pObserver = static_cast<CBasePlayer *>(UTIL_PlayerByIndex(i));
if (!pObserver || !pObserver->IsObservingPlayer(pPlayer))
continue;
@ -1179,7 +1179,7 @@ void RadiusDamage(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker
bool useLOS = false;
float damageRatio = 1.0f;
if ((bitsDamageType & DMG_EXPLOSION) && UTIL_IsGame("czero"))
if ((bitsDamageType & DMG_EXPLOSION) && g_bIsCzeroGame)
{
useLOS = true;
damageRatio = GetAmountOfPlayerVisible(vecSrc, pEntity);
@ -1996,102 +1996,3 @@ void CBaseMonster::BloodSplat(const Vector &vecSrc, const Vector &vecDir, int Hi
WRITE_BYTE(iVelocity + RANDOM_LONG(0, 100));
MESSAGE_END();
}
#ifdef HOOK_GAMEDLL
void CBaseMonster::KeyValue(KeyValueData *pkvd)
{
KeyValue_(pkvd);
}
void CBaseMonster::TraceAttack(entvars_t *pevAttacker,float flDamage,Vector vecDir,TraceResult *ptr,int bitsDamageType)
{
TraceAttack_(pevAttacker, flDamage, vecDir, ptr, bitsDamageType);
}
int CBaseMonster::TakeDamage(entvars_t *pevInflictor,entvars_t *pevAttacker,float flDamage,int bitsDamageType)
{
return TakeDamage_(pevInflictor, pevAttacker, flDamage, bitsDamageType);
}
int CBaseMonster::TakeHealth(float flHealth,int bitsDamageType)
{
return TakeHealth_(flHealth, bitsDamageType);
}
void CBaseMonster::Killed(entvars_t *pevAttacker,int iGib)
{
Killed_(pevAttacker, iGib);
}
float CBaseMonster::ChangeYaw(int speed)
{
return ChangeYaw_(speed);
}
BOOL CBaseMonster::HasHumanGibs(void)
{
return HasHumanGibs_();
}
BOOL CBaseMonster::HasAlienGibs(void)
{
return HasHumanGibs_();
}
void CBaseMonster::FadeMonster(void)
{
FadeMonster_();
}
void CBaseMonster::GibMonster(void)
{
GibMonster_();
}
Activity CBaseMonster::GetDeathActivity(void)
{
return GetDeathActivity_();
}
void CBaseMonster::BecomeDead(void)
{
BecomeDead_();
}
BOOL CBaseMonster::ShouldFadeOnDeath(void)
{
return ShouldFadeOnDeath_();
}
int CBaseMonster::IRelationship(CBaseEntity *pTarget)
{
return IRelationship_(pTarget);
}
void CBaseMonster::MonsterInitDead(void)
{
MonsterInitDead_();
}
void CBaseMonster::Look(int iDistance)
{
Look_(iDistance);
}
CBaseEntity *CBaseMonster::BestVisibleEnemy(void)
{
return BestVisibleEnemy_();
}
BOOL CBaseMonster::FInViewCone(CBaseEntity *pEntity)
{
return FInViewCone_(pEntity);
}
BOOL CBaseMonster::FInViewCone(const Vector *pOrigin)
{
return FInViewCone_(pOrigin);
}
#endif // HOOK_GAMEDLL

View File

@ -18,16 +18,10 @@ DebugOutputLevel outputLevel[ NUM_LEVELS ] =
unsigned int theDebugOutputTypes;
static char theDebugBuffer[ DebugBufferSize ];
#else // HOOK_GAMEDLL
DebugOutputLevel outputLevel[ NUM_LEVELS ];
unsigned int theDebugOutputTypes;
char theDebugBuffer[ DebugBufferSize ];
#endif // HOOK_GAMEDLL
/* <22fe8b> ../cstrike/dlls/debug.cpp:39 */
bool IsDeveloper(void)
bool IsDeveloper()
{
return (CVAR_GET_FLOAT("developer") > 0.0);
}
@ -64,7 +58,7 @@ void UTIL_DPrintf(char *pszMsg, ...)
}
/* <22fe97> ../cstrike/dlls/debug.cpp:78 */
void PrintDebugFlags(void)
void PrintDebugFlags()
{
char *tmp;
int remainder = DebugBufferSize;

View File

@ -38,11 +38,11 @@ const int DebugBufferSize = 1024;
typedef enum
{
DEBUG_NONE = 0,
DEBUG_BOT = (1<<0),
DEBUG_CAREER = (1<<1),
DEBUG_TUTOR = (1<<2),
DEBUG_STATS = (1<<3),
DEBUG_HOSTAGE = (1<<4),
DEBUG_BOT = (1 << 0),
DEBUG_CAREER = (1 << 1),
DEBUG_TUTOR = (1 << 2),
DEBUG_STATS = (1 << 3),
DEBUG_HOSTAGE = (1 << 4),
DEBUG_ALL = 0xFFFFFFFF,
} DebugOutputType;
@ -51,25 +51,12 @@ struct DebugOutputLevel
{
const char *name;
DebugOutputType value;
};
};/* size: 8, cachelines: 1, members: 2 */
#ifdef HOOK_GAMEDLL
#define outputLevel (*poutputLevel)
#define theDebugOutputTypes (*ptheDebugOutputTypes)
#define theDebugBuffer (*ptheDebugBuffer)
#endif // HOOK_GAMEDLL
extern DebugOutputLevel outputLevel[ NUM_LEVELS ];
extern unsigned int theDebugOutputTypes;
extern char theDebugBuffer[ DebugBufferSize ];
bool IsDeveloper(void);
bool IsDeveloper();
NOXREF void UTIL_DPrintf(DebugOutputType outputType, char *pszMsg, ...);
void UTIL_DPrintf(char *pszMsg, ...);
void PrintDebugFlags(void);
void PrintDebugFlags();
void SetDebugFlag(const char *flagStr, bool state);
void PrintDebugFlag(const char *flagStr);
@ -81,11 +68,4 @@ NOXREF void UTIL_TutorDPrintf(char *pszMsg, ...);
NOXREF void UTIL_StatsDPrintf(char *pszMsg, ...);
NOXREF void UTIL_HostageDPrintf(char *pszMsg, ...);
#ifdef HOOK_GAMEDLL
typedef void (*DPrintf_Flag)(DebugOutputType outputType, char *pszMsg, ...);
typedef void (*DPrintf_MSG)(char *pszMsg, ...);
#endif // HOOK_GAMEDLL
#endif // DEBUG_H

View File

@ -84,13 +84,6 @@ typedef struct
int index;
} DLL_DECALLIST;
/* size: 8, cachelines: 1, members: 2 */
#ifdef HOOK_GAMEDLL
#define gDecals (*pgDecals)
#endif //HOOK_GAMEDLL
extern DLL_DECALLIST gDecals[42];

View File

@ -21,11 +21,6 @@ TYPEDESCRIPTION CMomentaryDoor::m_SaveData[] =
DEFINE_FIELD(CMomentaryDoor, m_bMoveSnd, FIELD_CHARACTER),
};
#else
TYPEDESCRIPTION IMPL_CLASS(CBaseDoor, m_SaveData)[7];
TYPEDESCRIPTION IMPL_CLASS(CMomentaryDoor, m_SaveData)[1];
#endif // HOOK_GAMEDLL
/* <693c0> ../cstrike/dlls/doors.cpp:98 */
@ -58,9 +53,9 @@ void PlayLockSounds(entvars_t *pev, locksound_t *pls, int flocked, int fbutton)
float fvol;
if (fplaysound && fplaysentence)
fvol = 0.25;
fvol = 0.25f;
else
fvol = 1.0;
fvol = 1.0f;
// if there is a locked sound, and we've debounced, play sound
if (fplaysound)
@ -94,9 +89,9 @@ void PlayLockSounds(entvars_t *pev, locksound_t *pls, int flocked, int fbutton)
// if playing both sentence and sound, lower sound volume so we hear sentence
if (fplaysound && fplaysentence)
fvol = 0.25;
fvol = 0.25f;
else
fvol = 1.0;
fvol = 1.0f;
// play 'door unlocked' sound if set
if (fplaysound)
@ -207,7 +202,7 @@ LINK_ENTITY_TO_CLASS(func_door, CBaseDoor);
LINK_ENTITY_TO_CLASS(func_water, CBaseDoor);
/* <690bc> ../cstrike/dlls/doors.cpp:285 */
void CBaseDoor::__MAKE_VHOOK(Spawn)(void)
void CBaseDoor::__MAKE_VHOOK(Spawn)()
{
Precache();
SetMovedir(pev);
@ -267,7 +262,7 @@ void CBaseDoor::__MAKE_VHOOK(Spawn)(void)
}
/* <69949> ../cstrike/dlls/doors.cpp:334 */
void CBaseDoor::__MAKE_VHOOK(Restart)(void)
void CBaseDoor::__MAKE_VHOOK(Restart)()
{
SetMovedir(pev);
m_toggle_state = TS_AT_BOTTOM;
@ -292,7 +287,7 @@ void CBaseDoor::__MAKE_VHOOK(SetToggleState)(int state)
#define noiseArrived noise2
/* <6924c> ../cstrike/dlls/doors.cpp:359 */
void CBaseDoor::__MAKE_VHOOK(Precache)(void)
void CBaseDoor::__MAKE_VHOOK(Precache)()
{
char *pszSound;
@ -488,7 +483,7 @@ void CBaseDoor::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller,
// Causes the door to "do its thing", i.e. start moving, and cascade activation.
/* <6a319> ../cstrike/dlls/doors.cpp:554 */
int CBaseDoor::DoorActivate(void)
int CBaseDoor::DoorActivate()
{
if (!UTIL_IsMasterTriggered(m_sMaster, m_hActivator))
return 0;
@ -519,7 +514,7 @@ int CBaseDoor::DoorActivate(void)
// Starts the door going to its "up" position (simply ToggleData->vecPosition2).
/* <6a125> ../cstrike/dlls/doors.cpp:588 */
void CBaseDoor::DoorGoUp(void)
void CBaseDoor::DoorGoUp()
{
entvars_t *pevActivator;
bool isReversing = (m_toggle_state == TS_GOING_DOWN);
@ -549,7 +544,7 @@ void CBaseDoor::DoorGoUp(void)
SetMoveDone(&CBaseDoor::DoorHitTop);
// !!! BUGBUG Triggered doors don't work with this yet
// BUGBUG: Triggered doors don't work with this yet
if (FClassnameIs(pev, "func_door_rotating"))
{
float sign = 1.0;
@ -634,7 +629,7 @@ void CBaseDoor::DoorGoUp(void)
// The door has reached the "up" position. Either go back down, or wait for another activation.
/* <6940c> ../cstrike/dlls/doors.cpp:721 */
void CBaseDoor::DoorHitTop(void)
void CBaseDoor::DoorHitTop()
{
if (!(pev->spawnflags & SF_DOOR_SILENT))
{
@ -679,7 +674,7 @@ void CBaseDoor::DoorHitTop(void)
// Starts the door going to its "down" position (simply ToggleData->vecPosition1).
/* <697ad> ../cstrike/dlls/doors.cpp:762 */
void CBaseDoor::DoorGoDown(void)
void CBaseDoor::DoorGoDown()
{
bool isReversing = (m_toggle_state == TS_GOING_UP);
@ -719,7 +714,7 @@ void CBaseDoor::DoorGoDown(void)
// The door has reached the "down" position. Back to quiescence.
/* <694a5> ../cstrike/dlls/doors.cpp:791 */
void CBaseDoor::DoorHitBottom(void)
void CBaseDoor::DoorHitBottom()
{
if (!(pev->spawnflags & SF_DOOR_SILENT))
{
@ -879,7 +874,7 @@ void CBaseDoor::__MAKE_VHOOK(Blocked)(CBaseEntity *pOther)
LINK_ENTITY_TO_CLASS(func_door_rotating, CRotDoor);
/* <698be> ../cstrike/dlls/doors.cpp:946 */
void CRotDoor::__MAKE_VHOOK(Restart)(void)
void CRotDoor::__MAKE_VHOOK(Restart)()
{
CBaseToggle::AxisDir(pev);
@ -907,7 +902,7 @@ void CRotDoor::__MAKE_VHOOK(Restart)(void)
}
/* <69177> ../cstrike/dlls/doors.cpp:978 */
void CRotDoor::__MAKE_VHOOK(Spawn)(void)
void CRotDoor::__MAKE_VHOOK(Spawn)()
{
Precache();
@ -984,7 +979,7 @@ LINK_ENTITY_TO_CLASS(momentary_door, CMomentaryDoor);
IMPLEMENT_SAVERESTORE(CMomentaryDoor, CBaseToggle);
/* <69001> ../cstrike/dlls/doors.cpp:1065 */
void CMomentaryDoor::__MAKE_VHOOK(Spawn)(void)
void CMomentaryDoor::__MAKE_VHOOK(Spawn)()
{
SetMovedir(pev);
@ -1020,7 +1015,7 @@ void CMomentaryDoor::__MAKE_VHOOK(Spawn)(void)
}
/* <68fa5> ../cstrike/dlls/doors.cpp:1096 */
void CMomentaryDoor::__MAKE_VHOOK(Precache)(void)
void CMomentaryDoor::__MAKE_VHOOK(Precache)()
{
// set the door's "in-motion" sound
switch (m_bMoveSnd)
@ -1097,8 +1092,8 @@ void CMomentaryDoor::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCa
return;
}
if (value > 1.0)
value = 1.0;
if (value > 1.0f)
value = 1.0f;
Vector move = m_vecPosition1 + (value * (m_vecPosition2 - m_vecPosition1));
Vector delta = move - pev->origin;
@ -1106,7 +1101,7 @@ void CMomentaryDoor::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCa
//float speed = delta.Length() * 10;
// move there in 0.1 sec
float speed = delta.Length() / 0.1;
float speed = delta.Length() / 0.1f;
if (speed == 0)
return;
@ -1129,97 +1124,3 @@ void CMomentaryDoor::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCa
LinearMove(move, speed);
}
#ifdef HOOK_GAMEDLL
void CBaseDoor::Spawn(void)
{
Spawn_();
}
void CBaseDoor::Precache(void)
{
Precache_();
}
void CBaseDoor::Restart(void)
{
Restart_();
}
void CBaseDoor::KeyValue(KeyValueData *pkvd)
{
KeyValue_(pkvd);
}
int CBaseDoor::Save(CSave &save)
{
return Save_(save);
}
int CBaseDoor::Restore(CRestore &restore)
{
return Restore_(restore);
}
void CBaseDoor::SetToggleState(int state)
{
SetToggleState_(state);
}
void CBaseDoor::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
void CBaseDoor::Blocked(CBaseEntity *pOther)
{
Blocked_(pOther);
}
void CRotDoor::Spawn(void)
{
Spawn_();
}
void CRotDoor::Restart(void)
{
Restart_();
}
void CRotDoor::SetToggleState(int state)
{
SetToggleState_(state);
}
void CMomentaryDoor::Spawn(void)
{
Spawn_();
}
void CMomentaryDoor::Precache(void)
{
Precache_();
}
void CMomentaryDoor::KeyValue(KeyValueData *pkvd)
{
KeyValue_(pkvd);
}
int CMomentaryDoor::Save(CSave &save)
{
return Save_(save);
}
int CMomentaryDoor::Restore(CRestore &restore)
{
return Restore_(restore);
}
void CMomentaryDoor::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
#endif // HOOK_GAMEDLL

View File

@ -52,13 +52,13 @@
class CBaseDoor: public CBaseToggle
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Restart(void);
virtual void Spawn();
virtual void Precache();
virtual void Restart();
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
virtual int ObjectCaps()
{
if (pev->spawnflags & SF_ITEM_USE_ONLY)
return (CBaseToggle::ObjectCaps() & ~FCAP_ACROSS_TRANSITION) | FCAP_IMPULSE_USE;
@ -71,9 +71,9 @@ public:
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Restart_(void);
void Spawn_();
void Precache_();
void Restart_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
@ -86,14 +86,13 @@ public:
public:
static TYPEDESCRIPTION IMPL(m_SaveData)[7];
public:
// used to selectivly override defaults
void EXPORT DoorTouch(CBaseEntity *pOther);
int DoorActivate(void);
void EXPORT DoorGoUp(void);
void EXPORT DoorGoDown(void);
void EXPORT DoorHitTop(void);
void EXPORT DoorHitBottom(void);
int DoorActivate();
void EXPORT DoorGoUp();
void EXPORT DoorGoDown();
void EXPORT DoorHitTop();
void EXPORT DoorHitBottom();
public:
BYTE m_bHealthValue; // some doors are medi-kit doors, they give players health
@ -109,46 +108,42 @@ public:
BYTE m_bUnlockedSentence;
float m_lastBlockedTimestamp;
};/* size: 360, cachelines: 6, members: 11 */
};
/* <684c0> ../cstrike/dlls/doors.cpp:935 */
class CRotDoor: public CBaseDoor
{
public:
virtual void Spawn(void);
virtual void Restart(void);
virtual void Spawn();
virtual void Restart();
virtual void SetToggleState(int state);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Restart_(void);
void Spawn_();
void Restart_();
void SetToggleState_(int state);
#endif // HOOK_GAMEDLL
};/* size: 360, cachelines: 6, members: 1 */
};
/* <68513> ../cstrike/dlls/doors.cpp:1039 */
class CMomentaryDoor: public CBaseToggle
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return CBaseToggle::ObjectCaps() & ~FCAP_ACROSS_TRANSITION;
}
virtual int ObjectCaps() { return (CBaseToggle::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); }
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
@ -159,21 +154,9 @@ public:
public:
static TYPEDESCRIPTION IMPL(m_SaveData)[1];
public:
BYTE m_bMoveSnd; // sound a door makes while moving
};/* size: 316, cachelines: 5, members: 3 */
};
void PlayLockSounds(entvars_t *pev, locksound_t *pls, int flocked, int fbutton);
#ifdef HOOK_GAMEDLL
// linked objects
C_DLLEXPORT void func_door(entvars_t *pev);
C_DLLEXPORT void func_water(entvars_t *pev);
C_DLLEXPORT void func_door_rotating(entvars_t *pev);
C_DLLEXPORT void momentary_door(entvars_t *pev);
#endif // HOOK_GAMEDLL
#endif // DOORS_H

View File

@ -59,15 +59,6 @@ TYPEDESCRIPTION CGibShooter::m_SaveData[] =
DEFINE_FIELD(CGibShooter, m_flGibLife, FIELD_FLOAT),
};
#else
TYPEDESCRIPTION IMPL_CLASS(CBubbling, m_SaveData)[3];
TYPEDESCRIPTION IMPL_CLASS(CLightning, m_SaveData)[13];
TYPEDESCRIPTION IMPL_CLASS(CLaser, m_SaveData)[3];
TYPEDESCRIPTION IMPL_CLASS(CGlow, m_SaveData)[2];
TYPEDESCRIPTION IMPL_CLASS(CSprite, m_SaveData)[2];
TYPEDESCRIPTION IMPL_CLASS(CGibShooter, m_SaveData)[7];
#endif // HOOK_GAMEDLL
/* <76042> ../cstrike/dlls/effects.cpp:33 */
@ -80,7 +71,7 @@ LINK_ENTITY_TO_CLASS(env_bubbles, CBubbling);
IMPLEMENT_SAVERESTORE(CBubbling, CBaseEntity);
/* <7344d> ../cstrike/dlls/effects.cpp:73 */
void CBubbling::__MAKE_VHOOK(Spawn)(void)
void CBubbling::__MAKE_VHOOK(Spawn)()
{
Precache();
SET_MODEL(ENT(pev), STRING(pev->model)); // Set size
@ -94,7 +85,7 @@ void CBubbling::__MAKE_VHOOK(Spawn)(void)
int speed = (pev->speed > 0) ? pev->speed : -pev->speed;
// HACKHACK!!! - Speed in rendercolor
// HACKHACK: Speed in rendercolor
pev->rendercolor.x = (speed >> 8);
pev->rendercolor.y = (speed & 255);
pev->rendercolor.z = (pev->speed < 0) ? 1 : 0;
@ -103,7 +94,7 @@ void CBubbling::__MAKE_VHOOK(Spawn)(void)
{
SetThink(&CBubbling::FizzThink);
pev->nextthink = gpGlobals->time + 2.0;
pev->nextthink = gpGlobals->time + 2.0f;
m_state = 1;
}
else
@ -111,7 +102,7 @@ void CBubbling::__MAKE_VHOOK(Spawn)(void)
}
/* <73489> ../cstrike/dlls/effects.cpp:99 */
void CBubbling::__MAKE_VHOOK(Precache)(void)
void CBubbling::__MAKE_VHOOK(Precache)()
{
// Precache bubble sprite
m_bubbleModel = PRECACHE_MODEL("sprites/bubble.spr");
@ -126,7 +117,7 @@ void CBubbling::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller,
if (m_state)
{
SetThink(&CBubbling::FizzThink);
pev->nextthink = gpGlobals->time + 0.1;
pev->nextthink = gpGlobals->time + 0.1f;
}
else
{
@ -158,7 +149,7 @@ void CBubbling::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
}
/* <73d03> ../cstrike/dlls/effects.cpp:145 */
void CBubbling::FizzThink(void)
void CBubbling::FizzThink()
{
MESSAGE_BEGIN(MSG_PAS, SVC_TEMPENTITY, VecBModelOrigin(pev));
WRITE_BYTE(TE_FIZZ);
@ -168,16 +159,16 @@ void CBubbling::FizzThink(void)
MESSAGE_END();
if (m_frequency > 19)
pev->nextthink = gpGlobals->time + 0.5;
pev->nextthink = gpGlobals->time + 0.5f;
else
pev->nextthink = gpGlobals->time + 2.5 - (0.1 * m_frequency);
pev->nextthink = gpGlobals->time + 2.5f - (0.1f * m_frequency);
}
/* <7620c> ../cstrike/dlls/effects.cpp:166 */
LINK_ENTITY_TO_CLASS(beam, CBeam);
/* <734b0> ../cstrike/dlls/effects.cpp:168 */
void CBeam::__MAKE_VHOOK(Spawn)(void)
void CBeam::__MAKE_VHOOK(Spawn)()
{
// Remove model & collisions
pev->solid = SOLID_NOT;
@ -185,7 +176,7 @@ void CBeam::__MAKE_VHOOK(Spawn)(void)
}
/* <734d6> ../cstrike/dlls/effects.cpp:174 */
void CBeam::__MAKE_VHOOK(Precache)(void)
void CBeam::__MAKE_VHOOK(Precache)()
{
if (pev->owner)
{
@ -212,7 +203,7 @@ void CBeam::SetEndEntity(int entityIndex)
}
/* <7632e> ../cstrike/dlls/effects.cpp:196 */
const Vector &CBeam::GetStartPos(void)
const Vector &CBeam::GetStartPos()
{
if (GetType() == BEAM_ENTS)
{
@ -224,7 +215,7 @@ const Vector &CBeam::GetStartPos(void)
}
/* <7639a> ../cstrike/dlls/effects.cpp:207 */
const Vector &CBeam::GetEndPos(void)
const Vector &CBeam::GetEndPos()
{
int type = GetType();
if (type == BEAM_POINTS || type == BEAM_HOSE)
@ -233,7 +224,7 @@ const Vector &CBeam::GetEndPos(void)
}
edict_t *pent = INDEXENT(GetEndEntity());
if (pent)
if (pent != NULL)
{
return pent->v.origin;
}
@ -322,7 +313,7 @@ void CBeam::EntsInit(int startIndex, int endIndex)
}
/* <7663a> ../cstrike/dlls/effects.cpp:294 */
void CBeam::RelinkBeam(void)
void CBeam::RelinkBeam()
{
const Vector &startPos = GetStartPos();
const Vector &endPos = GetEndPos();
@ -401,7 +392,7 @@ LINK_ENTITY_TO_CLASS(env_beam, CLightning);
IMPLEMENT_SAVERESTORE(CLightning, CBeam);
/* <744b2> ../cstrike/dlls/effects.cpp:444 */
void CLightning::__MAKE_VHOOK(Spawn)(void)
void CLightning::__MAKE_VHOOK(Spawn)()
{
if (FStringNull(m_iszSpriteName))
{
@ -453,14 +444,14 @@ void CLightning::__MAKE_VHOOK(Spawn)(void)
}
/* <7357f> ../cstrike/dlls/effects.cpp:493 */
void CLightning::__MAKE_VHOOK(Precache)(void)
void CLightning::__MAKE_VHOOK(Precache)()
{
m_spriteTexture = PRECACHE_MODEL((char *)STRING(m_iszSpriteName));
CBeam::Precache();
}
/* <786a1> ../cstrike/dlls/effects.cpp:500 */
void CLightning::__MAKE_VHOOK(Activate)(void)
void CLightning::__MAKE_VHOOK(Activate)()
{
if (ServerSide())
BeamUpdateVars();
@ -585,11 +576,12 @@ int IsPointEntity(CBaseEntity *pEnt)
{
return 1;
}
return 0;
}
/* <77f64> ../cstrike/dlls/effects.cpp:625 */
void CLightning::StrikeThink(void)
void CLightning::StrikeThink()
{
if (m_life != 0.0f)
{
@ -598,6 +590,7 @@ void CLightning::StrikeThink(void)
else
pev->nextthink = gpGlobals->time + m_life + m_restrike;
}
m_active = 1;
if (FStringNull(m_iszEndEntity))
@ -729,9 +722,9 @@ void CBeam::BeamDamage(TraceResult *ptr)
}
/* <777dd> ../cstrike/dlls/effects.cpp:753 */
void CLightning::DamageThink(void)
void CLightning::DamageThink()
{
pev->nextthink = gpGlobals->time + 0.1;
pev->nextthink = gpGlobals->time + 0.1f;
TraceResult tr;
UTIL_TraceLine(GetStartPos(), GetEndPos(), dont_ignore_monsters, NULL, &tr);
@ -766,7 +759,7 @@ void CLightning::Zap(const Vector &vecSrc, const Vector &vecDest)
}
/* <77b45> ../cstrike/dlls/effects.cpp:789 */
void CLightning::RandomArea(void)
void CLightning::RandomArea()
{
for (int iLoops = 0; iLoops < 10; iLoops++)
{
@ -811,9 +804,7 @@ void CLightning::RandomArea(void)
/* <77de8> ../cstrike/dlls/effects.cpp:831 */
void CLightning::RandomPoint(Vector &vecSrc)
{
int iLoops = 0;
for (iLoops = 0; iLoops < 10; iLoops++)
for (int iLoops = 0; iLoops < 10; iLoops++)
{
Vector vecDir1 = Vector(RANDOM_FLOAT(-1, 1), RANDOM_FLOAT(-1, 1), RANDOM_FLOAT(-1, 1));
vecDir1 = vecDir1.Normalize();
@ -833,7 +824,7 @@ void CLightning::RandomPoint(Vector &vecSrc)
}
/* <78313> ../cstrike/dlls/effects.cpp:855 */
void CLightning::BeamUpdateVars(void)
void CLightning::BeamUpdateVars()
{
int beamType;
int pointStart, pointEnd;
@ -913,7 +904,7 @@ LINK_ENTITY_TO_CLASS(env_laser, CLaser);
IMPLEMENT_SAVERESTORE(CLaser, CBeam);
/* <76b3f> ../cstrike/dlls/effects.cpp:931 */
void CLaser::__MAKE_VHOOK(Spawn)(void)
void CLaser::__MAKE_VHOOK(Spawn)()
{
if (FStringNull(pev->model))
{
@ -945,7 +936,7 @@ void CLaser::__MAKE_VHOOK(Spawn)(void)
}
/* <73d82> ../cstrike/dlls/effects.cpp:960 */
void CLaser::__MAKE_VHOOK(Precache)(void)
void CLaser::__MAKE_VHOOK(Precache)()
{
pev->modelindex = PRECACHE_MODEL((char *)STRING(pev->model));
@ -1003,7 +994,7 @@ void CLaser::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
}
/* <787a8> ../cstrike/dlls/effects.cpp:1015 */
int CLaser::IsOn(void)
int CLaser::IsOn()
{
if (pev->effects & EF_NODRAW)
return 0;
@ -1012,7 +1003,7 @@ int CLaser::IsOn(void)
}
/* <787c9> ../cstrike/dlls/effects.cpp:1023 */
void CLaser::TurnOff(void)
void CLaser::TurnOff()
{
pev->effects |= EF_NODRAW;
pev->nextthink = 0;
@ -1024,7 +1015,7 @@ void CLaser::TurnOff(void)
}
/* <78804> ../cstrike/dlls/effects.cpp:1032 */
void CLaser::TurnOn(void)
void CLaser::TurnOn()
{
pev->effects &= ~EF_NODRAW;
@ -1064,7 +1055,7 @@ void CLaser::FireAtPoint(TraceResult &tr)
}
/* <778f6> ../cstrike/dlls/effects.cpp:1069 */
void CLaser::StrikeThink(void)
void CLaser::StrikeThink()
{
CBaseEntity *pEnd = RandomTargetname(STRING(pev->message));
@ -1084,7 +1075,7 @@ LINK_ENTITY_TO_CLASS(env_glow, CGlow);
IMPLEMENT_SAVERESTORE(CGlow, CPointEntity);
/* <735a6> ../cstrike/dlls/effects.cpp:1109 */
void CGlow::__MAKE_VHOOK(Spawn)(void)
void CGlow::__MAKE_VHOOK(Spawn)()
{
pev->solid = SOLID_NOT;
pev->movetype = MOVETYPE_NONE;
@ -1105,7 +1096,7 @@ void CGlow::__MAKE_VHOOK(Spawn)(void)
}
/* <74606> ../cstrike/dlls/effects.cpp:1127 */
void CGlow::__MAKE_VHOOK(Think)(void)
void CGlow::__MAKE_VHOOK(Think)()
{
Animate(pev->framerate * (gpGlobals->time - m_lastTime));
@ -1124,7 +1115,7 @@ void CGlow::Animate(float frames)
LINK_ENTITY_TO_CLASS(env_bombglow, CBombGlow);
/* <735cd> ../cstrike/dlls/effects.cpp:1161 */
void CBombGlow::__MAKE_VHOOK(Spawn)(void)
void CBombGlow::__MAKE_VHOOK(Spawn)()
{
#ifdef REGAMEDLL_FIXES
PRECACHE_MODEL("sprites/flare1.spr");
@ -1134,7 +1125,7 @@ void CBombGlow::__MAKE_VHOOK(Spawn)(void)
pev->movetype = MOVETYPE_NONE;
pev->effects = 0;
pev->frame = 0;
pev->nextthink = gpGlobals->time + 0.05;
pev->nextthink = gpGlobals->time + 0.05f;
pev->rendermode = kRenderGlow;
pev->rendercolor.x = 255;
pev->rendercolor.y = 15;
@ -1148,7 +1139,7 @@ void CBombGlow::__MAKE_VHOOK(Spawn)(void)
}
/* <73a40> ../cstrike/dlls/effects.cpp:1184 */
void CBombGlow::__MAKE_VHOOK(Think)(void)
void CBombGlow::__MAKE_VHOOK(Think)()
{
if (!m_bSetModel)
{
@ -1182,7 +1173,7 @@ LINK_ENTITY_TO_CLASS(env_sprite, CSprite);
IMPLEMENT_SAVERESTORE(CSprite, CPointEntity);
/* <75dc8> ../cstrike/dlls/effects.cpp:1236 */
void CSprite::__MAKE_VHOOK(Spawn)(void)
void CSprite::__MAKE_VHOOK(Spawn)()
{
pev->solid = SOLID_NOT;
pev->movetype = MOVETYPE_NONE;
@ -1207,7 +1198,7 @@ void CSprite::__MAKE_VHOOK(Spawn)(void)
}
/* <75d55> ../cstrike/dlls/effects.cpp:1260 */
void CSprite::__MAKE_VHOOK(Restart)(void)
void CSprite::__MAKE_VHOOK(Restart)()
{
pev->solid = SOLID_NOT;
pev->movetype = MOVETYPE_NONE;
@ -1221,7 +1212,7 @@ void CSprite::__MAKE_VHOOK(Restart)(void)
}
/* <74436> ../cstrike/dlls/effects.cpp:1273 */
void CSprite::__MAKE_VHOOK(Precache)(void)
void CSprite::__MAKE_VHOOK(Precache)()
{
PRECACHE_MODEL((char *)STRING(pev->model));
@ -1268,15 +1259,15 @@ CSprite *CSprite::SpriteCreate(const char *pSpriteName, const Vector &origin, BO
}
/* <75679> ../cstrike/dlls/effects.cpp:1310 */
void CSprite::AnimateThink(void)
void CSprite::AnimateThink()
{
Animate(pev->framerate * (gpGlobals->time - m_lastTime));
pev->nextthink = gpGlobals->time + 0.1;
pev->nextthink = gpGlobals->time + 0.1f;
m_lastTime = gpGlobals->time;
}
/* <78d6b> ../cstrike/dlls/effects.cpp:1318 */
void CSprite::AnimateUntilDead(void)
void CSprite::AnimateUntilDead()
{
if (gpGlobals->time > pev->dmgtime)
{
@ -1301,7 +1292,7 @@ NOXREF void CSprite::Expand(float scaleSpeed, float fadeSpeed)
}
/* <73e2e> ../cstrike/dlls/effects.cpp:1340 */
void CSprite::ExpandThink(void)
void CSprite::ExpandThink()
{
float frametime = gpGlobals->time - m_lastTime;
@ -1336,14 +1327,14 @@ void CSprite::Animate(float frames)
}
/* <78e73> ../cstrike/dlls/effects.cpp:1376 */
void CSprite::TurnOff(void)
void CSprite::TurnOff()
{
pev->effects = EF_NODRAW;
pev->nextthink = 0;
}
/* <78e94> ../cstrike/dlls/effects.cpp:1383 */
void CSprite::TurnOn(void)
void CSprite::TurnOn()
{
pev->effects = 0;
@ -1378,7 +1369,7 @@ IMPLEMENT_SAVERESTORE(CGibShooter, CBaseDelay);
LINK_ENTITY_TO_CLASS(gibshooter, CGibShooter);
/* <73dbb> ../cstrike/dlls/effects.cpp:1452 */
void CGibShooter::__MAKE_VHOOK(Precache)(void)
void CGibShooter::__MAKE_VHOOK(Precache)()
{
if (g_Language == LANGUAGE_GERMAN)
{
@ -1425,7 +1416,7 @@ void CGibShooter::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCalle
}
/* <73cb5> ../cstrike/dlls/effects.cpp:1499 */
void CGibShooter::__MAKE_VHOOK(Spawn)(void)
void CGibShooter::__MAKE_VHOOK(Spawn)()
{
Precache();
@ -1439,7 +1430,7 @@ void CGibShooter::__MAKE_VHOOK(Spawn)(void)
if (m_flGibLife == 0.0f)
{
m_flGibLife = 25;
m_flGibLife = 25.0f;
}
SetMovedir(pev);
@ -1447,7 +1438,7 @@ void CGibShooter::__MAKE_VHOOK(Spawn)(void)
}
/* <744ff> ../cstrike/dlls/effects.cpp:1521 */
CGib *CGibShooter::__MAKE_VHOOK(CreateGib)(void)
CGib *CGibShooter::__MAKE_VHOOK(CreateGib)()
{
if (CVAR_GET_FLOAT("violence_hgibs") == 0)
return NULL;
@ -1469,7 +1460,7 @@ CGib *CGibShooter::__MAKE_VHOOK(CreateGib)(void)
}
/* <75751> ../cstrike/dlls/effects.cpp:1541 */
void CGibShooter::ShootThink(void)
void CGibShooter::ShootThink()
{
pev->nextthink = m_flDelay + gpGlobals->time;
@ -1566,7 +1557,6 @@ void CEnvShooter::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
case 4:
m_iGibMaterial = matRocks;
break;
default:
case -1:
m_iGibMaterial = matNone;
@ -1578,14 +1568,14 @@ void CEnvShooter::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
}
/* <73cdc> ../cstrike/dlls/effects.cpp:1644 */
void CEnvShooter::__MAKE_VHOOK(Precache)(void)
void CEnvShooter::__MAKE_VHOOK(Precache)()
{
m_iGibModelIndex = PRECACHE_MODEL((char *)STRING(pev->model));
CBreakable::MaterialSoundPrecache((Materials)m_iGibMaterial);
}
/* <7464b> ../cstrike/dlls/effects.cpp:1651 */
CGib *CEnvShooter::__MAKE_VHOOK(CreateGib)(void)
CGib *CEnvShooter::__MAKE_VHOOK(CreateGib)()
{
CGib *pGib = GetClassPtr((CGib *)NULL);
@ -1614,19 +1604,19 @@ CGib *CEnvShooter::__MAKE_VHOOK(CreateGib)(void)
LINK_ENTITY_TO_CLASS(test_effect, CTestEffect);
/* <73656> ../cstrike/dlls/effects.cpp:1698 */
void CTestEffect::__MAKE_VHOOK(Spawn)(void)
void CTestEffect::__MAKE_VHOOK(Spawn)()
{
Precache();
}
/* <7367c> ../cstrike/dlls/effects.cpp:1703 */
void CTestEffect::__MAKE_VHOOK(Precache)(void)
void CTestEffect::__MAKE_VHOOK(Precache)()
{
PRECACHE_MODEL("sprites/lgtning.spr");
}
/* <76e39> ../cstrike/dlls/effects.cpp:1708 */
void CTestEffect::TestThink(void)
void CTestEffect::TestThink()
{
int i;
float t = (gpGlobals->time - m_flStartTime);
@ -1688,7 +1678,7 @@ void CTestEffect::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCalle
LINK_ENTITY_TO_CLASS(env_blood, CBlood);
/* <73c8f> ../cstrike/dlls/effects.cpp:1797 */
void CBlood::__MAKE_VHOOK(Spawn)(void)
void CBlood::__MAKE_VHOOK(Spawn)()
{
pev->solid = SOLID_NOT;
pev->movetype = MOVETYPE_NONE;
@ -1726,7 +1716,7 @@ void CBlood::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
}
/* <791f7> ../cstrike/dlls/effects.cpp:1834 */
Vector CBlood::Direction(void)
Vector CBlood::Direction()
{
if (pev->spawnflags & SF_BLOOD_RANDOM)
return UTIL_RandomBloodVector();
@ -1746,7 +1736,7 @@ Vector CBlood::BloodPosition(CBaseEntity *pActivator)
else
pPlayer = INDEXENT(1);
if (pPlayer)
if (pPlayer != NULL)
{
return (pPlayer->v.origin + pPlayer->v.view_ofs) + Vector(RANDOM_FLOAT(-10, 10), RANDOM_FLOAT(-10, 10), RANDOM_FLOAT(-10, 10));
}
@ -1782,7 +1772,7 @@ void CBlood::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, US
LINK_ENTITY_TO_CLASS(env_shake, CShake);
/* <73705> ../cstrike/dlls/effects.cpp:1919 */
void CShake::__MAKE_VHOOK(Spawn)(void)
void CShake::__MAKE_VHOOK(Spawn)()
{
pev->solid = SOLID_NOT;
pev->movetype = MOVETYPE_NONE;
@ -1830,7 +1820,7 @@ void CShake::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, US
LINK_ENTITY_TO_CLASS(env_fade, CFade);
/* <7372b> ../cstrike/dlls/effects.cpp:1987 */
void CFade::__MAKE_VHOOK(Spawn)(void)
void CFade::__MAKE_VHOOK(Spawn)()
{
pev->solid = SOLID_NOT;
pev->movetype = MOVETYPE_NONE;
@ -1883,7 +1873,7 @@ void CFade::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE
LINK_ENTITY_TO_CLASS(env_message, CMessage);
/* <73751> ../cstrike/dlls/effects.cpp:2051 */
void CMessage::__MAKE_VHOOK(Spawn)(void)
void CMessage::__MAKE_VHOOK(Spawn)()
{
Precache();
@ -1913,11 +1903,11 @@ void CMessage::__MAKE_VHOOK(Spawn)(void)
// No volume, use normal
if (pev->scale <= 0.0f)
pev->scale = 1.0;
pev->scale = 1.0f;
}
/* <73df7> ../cstrike/dlls/effects.cpp:2085 */
void CMessage::__MAKE_VHOOK(Precache)(void)
void CMessage::__MAKE_VHOOK(Precache)()
{
if (pev->noise)
{
@ -1935,7 +1925,7 @@ void CMessage::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
}
else if (FStrEq(pkvd->szKeyName, "messagevolume"))
{
pev->scale = Q_atof(pkvd->szValue) * 0.1;
pev->scale = Q_atof(pkvd->szValue) * 0.1f;
pkvd->fHandled = TRUE;
}
else if (FStrEq(pkvd->szKeyName, "messageattenuation"))
@ -1963,9 +1953,10 @@ void CMessage::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller,
pPlayer = CBaseEntity::Instance(INDEXENT(1));
}
if (pPlayer)
if (pPlayer != NULL)
UTIL_ShowMessage(STRING(pev->message), pPlayer);
}
if (pev->noise)
{
EMIT_SOUND(edict(), CHAN_BODY, STRING(pev->noise), pev->scale, pev->speed);
@ -1980,7 +1971,7 @@ void CMessage::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller,
LINK_ENTITY_TO_CLASS(env_funnel, CEnvFunnel);
/* <73778> ../cstrike/dlls/effects.cpp:2155 */
void CEnvFunnel::__MAKE_VHOOK(Precache)(void)
void CEnvFunnel::__MAKE_VHOOK(Precache)()
{
m_iSprite = PRECACHE_MODEL("sprites/flare6.spr");
}
@ -2013,7 +2004,7 @@ void CEnvFunnel::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller
}
/* <7382b> ../cstrike/dlls/effects.cpp:2187 */
void CEnvFunnel::__MAKE_VHOOK(Spawn)(void)
void CEnvFunnel::__MAKE_VHOOK(Spawn)()
{
Precache();
pev->solid = SOLID_NOT;
@ -2021,7 +2012,7 @@ void CEnvFunnel::__MAKE_VHOOK(Spawn)(void)
}
/* <73852> ../cstrike/dlls/effects.cpp:2207 */
void CEnvBeverage::__MAKE_VHOOK(Precache)(void)
void CEnvBeverage::__MAKE_VHOOK(Precache)()
{
PRECACHE_MODEL("models/can.mdl");
PRECACHE_SOUND("weapons/g_bounce3.wav");
@ -2054,7 +2045,7 @@ void CEnvBeverage::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCall
}
/* <73879> ../cstrike/dlls/effects.cpp:2242 */
void CEnvBeverage::__MAKE_VHOOK(Spawn)(void)
void CEnvBeverage::__MAKE_VHOOK(Spawn)()
{
Precache();
pev->solid = SOLID_NOT;
@ -2063,12 +2054,12 @@ void CEnvBeverage::__MAKE_VHOOK(Spawn)(void)
if (pev->health == 0.0f)
{
pev->health = 10;
pev->health = 10.0f;
}
}
/* <738a0> ../cstrike/dlls/effects.cpp:2267 */
void CItemSoda::__MAKE_VHOOK(Precache)(void)
void CItemSoda::__MAKE_VHOOK(Precache)()
{
;
}
@ -2077,7 +2068,7 @@ void CItemSoda::__MAKE_VHOOK(Precache)(void)
LINK_ENTITY_TO_CLASS(item_sodacan, CItemSoda);
/* <738c6> ../cstrike/dlls/effects.cpp:2273 */
void CItemSoda::__MAKE_VHOOK(Spawn)(void)
void CItemSoda::__MAKE_VHOOK(Spawn)()
{
Precache();
pev->solid = SOLID_NOT;
@ -2091,7 +2082,7 @@ void CItemSoda::__MAKE_VHOOK(Spawn)(void)
}
/* <73961> ../cstrike/dlls/effects.cpp:2286 */
void CItemSoda::CanThink(void)
void CItemSoda::CanThink()
{
EMIT_SOUND(ENT(pev), CHAN_WEAPON, "weapons/g_bounce3.wav", VOL_NORM, ATTN_NORM);
@ -2127,337 +2118,3 @@ void CItemSoda::CanTouch(CBaseEntity *pOther)
SetThink(&CItemSoda::SUB_Remove);
pev->nextthink = gpGlobals->time;
}
#ifdef HOOK_GAMEDLL
void CBombGlow::Spawn(void)
{
Spawn_();
}
void CBombGlow::Think(void)
{
Think_();
}
void CSprite::Spawn(void)
{
Spawn_();
}
void CSprite::Precache(void)
{
Precache_();
}
void CSprite::Restart(void)
{
Restart_();
}
int CSprite::Save(CSave &save)
{
return Save_(save);
}
int CSprite::Restore(CRestore &restore)
{
return Restore_(restore);
}
void CSprite::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
void CBeam::Spawn(void)
{
Spawn_();
}
void CBeam::Precache(void)
{
Precache_();
}
void CLaser::Spawn(void)
{
Spawn_();
}
void CLaser::Precache(void)
{
Precache_();
}
void CLaser::KeyValue(KeyValueData *pkvd)
{
KeyValue_(pkvd);
}
int CLaser::Save(CSave &save)
{
return Save_(save);
}
int CLaser::Restore(CRestore &restore)
{
return Restore_(restore);
}
void CLaser::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
void CBubbling::Spawn(void)
{
Spawn_();
}
void CBubbling::Precache(void)
{
Precache_();
}
void CBubbling::KeyValue(KeyValueData *pkvd)
{
KeyValue_(pkvd);
}
int CBubbling::Save(CSave &save)
{
return Save_(save);
}
int CBubbling::Restore(CRestore &restore)
{
return Restore_(restore);
}
void CBubbling::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
void CLightning::Spawn(void)
{
Spawn_();
}
void CLightning::Precache(void)
{
Precache_();
}
void CLightning::KeyValue(KeyValueData *pkvd)
{
KeyValue_(pkvd);
}
int CLightning::Save(CSave &save)
{
return Save_(save);
}
int CLightning::Restore(CRestore &restore)
{
return Restore_(restore);
}
void CLightning::Activate(void)
{
Activate_();
}
void CGlow::Spawn(void)
{
Spawn_();
}
int CGlow::Save(CSave &save)
{
return Save_(save);
}
int CGlow::Restore(CRestore &restore)
{
return Restore_(restore);
}
void CGlow::Think(void)
{
Think_();
}
void CGibShooter::Spawn(void)
{
Spawn_();
}
void CGibShooter::Precache(void)
{
Precache_();
}
void CGibShooter::KeyValue(KeyValueData *pkvd)
{
KeyValue_(pkvd);
}
int CGibShooter::Save(CSave &save)
{
return Save_(save);
}
int CGibShooter::Restore(CRestore &restore)
{
return Restore_(restore);
}
void CGibShooter::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
CGib *CGibShooter::CreateGib(void)
{
return CreateGib_();
}
void CEnvShooter::Precache(void)
{
Precache_();
}
void CEnvShooter::KeyValue(KeyValueData *pkvd)
{
KeyValue_(pkvd);
}
CGib *CEnvShooter::CreateGib(void)
{
return CreateGib_();
}
void CTestEffect::Spawn(void)
{
Spawn_();
}
void CTestEffect::Precache(void)
{
Precache_();
}
void CTestEffect::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
void CBlood::Spawn(void)
{
Spawn_();
}
void CBlood::KeyValue(KeyValueData *pkvd)
{
KeyValue_(pkvd);
}
void CBlood::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
void CShake::Spawn(void)
{
Spawn_();
}
void CShake::KeyValue(KeyValueData *pkvd)
{
KeyValue_(pkvd);
}
void CShake::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
void CFade::Spawn(void)
{
Spawn_();
}
void CFade::KeyValue(KeyValueData *pkvd)
{
KeyValue_(pkvd);
}
void CFade::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
void CMessage::Spawn(void)
{
Spawn_();
}
void CMessage::Precache(void)
{
Precache_();
}
void CMessage::KeyValue(KeyValueData *pkvd)
{
KeyValue_(pkvd);
}
void CMessage::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
void CEnvFunnel::Spawn(void)
{
Spawn_();
}
void CEnvFunnel::Precache(void)
{
Precache_();
}
void CEnvFunnel::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
void CEnvBeverage::Spawn(void)
{
Spawn_();
}
void CEnvBeverage::Precache(void)
{
Precache_();
}
void CEnvBeverage::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
void CItemSoda::Spawn(void)
{
Spawn_();
}
void CItemSoda::Precache(void)
{
Precache_();
}
#endif // HOOK_GAMEDLL

View File

@ -72,12 +72,12 @@
class CSprite: public CPointEntity
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Restart(void);
virtual void Spawn();
virtual void Precache();
virtual void Restart();
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
virtual int ObjectCaps()
{
int flags = 0;
if (pev->spawnflags & SF_SPRITE_TEMPORARY)
@ -89,9 +89,9 @@ public:
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Restart_(void);
void Spawn_();
void Precache_();
void Restart_();
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
@ -99,8 +99,8 @@ public:
#endif // HOOK_GAMEDLL
public:
void EXPORT AnimateThink(void);
void EXPORT ExpandThink(void);
void EXPORT AnimateThink();
void EXPORT ExpandThink();
void Animate(float frames);
NOXREF void Expand(float scaleSpeed, float fadeSpeed);
@ -108,7 +108,7 @@ public:
void SetAttachment(edict_t *pEntity, int attachment)
{
if (pEntity)
if (pEntity != NULL)
{
pev->skin = ENTINDEX(pEntity);
pev->body = attachment;
@ -116,12 +116,11 @@ public:
pev->movetype = MOVETYPE_FOLLOW;
}
}
void TurnOff(void);
void TurnOn(void);
float Frames(void)
{
return m_maxFrame;
}
void TurnOff();
void TurnOn();
float Frames() const { return m_maxFrame; }
void SetTransparency(int rendermode, int r, int g, int b, int a, int fx)
{
pev->rendermode = rendermode;
@ -131,24 +130,12 @@ public:
pev->renderamt = a;
pev->renderfx = fx;
}
void SetTexture(int spriteIndex)
{
pev->modelindex = spriteIndex;
}
void SetScale(float scale)
{
pev->scale = scale;
}
void SetColor(int r, int g, int b)
{
pev->rendercolor.x = r;
pev->rendercolor.y = g;
pev->rendercolor.z = b;
}
void SetBrightness(int brightness)
{
pev->renderamt = brightness;
}
void SetTexture(int spriteIndex) { pev->modelindex = spriteIndex; }
void SetScale(float scale) { pev->scale = scale; }
void SetColor(int r, int g, int b) { pev->rendercolor.x = r; pev->rendercolor.y = g; pev->rendercolor.z = b; }
void SetBrightness(int brightness) { pev->renderamt = brightness; }
void AnimateAndDie(float_precision framerate)
{
SetThink(&CSprite::AnimateUntilDead);
@ -157,25 +144,23 @@ public:
pev->nextthink = gpGlobals->time;
}
void EXPORT AnimateUntilDead(void);
void EXPORT AnimateUntilDead();
static CSprite *SpriteCreate(const char *pSpriteName, const Vector &origin, BOOL animate);
static TYPEDESCRIPTION IMPL(m_SaveData)[2];
private:
float m_lastTime;
float m_maxFrame;
};/* size: 160, cachelines: 3, members: 4 */
};
/* <723cb> ../cstrike/dlls/effects.h:105 */
class CBeam: public CBaseEntity
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual int ObjectCaps(void)
virtual void Spawn();
virtual void Precache();
virtual int ObjectCaps()
{
int flags = 0;
if (pev->spawnflags & SF_BEAM_TEMPORARY)
@ -183,123 +168,51 @@ public:
return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION) | flags;
}
virtual Vector Center(void)
{
return (GetStartPos() + GetEndPos()) * 0.5;
}
virtual Vector Center() { return (GetStartPos() + GetEndPos()) * 0.5f; }
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
#endif // HOOK_GAMEDLL
public:
void EXPORT TriggerTouch(CBaseEntity *pOther);
void SetType(int type)
{
pev->rendermode = (pev->rendermode & 0xF0) | (type & 0x0F);
}
void SetFlags(int flags)
{
pev->rendermode = (pev->rendermode & 0x0F) | (flags & 0xF0);
}
void SetStartPos(const Vector &pos)
{
pev->origin = pos;
}
void SetEndPos(const Vector &pos)
{
pev->angles = pos;
}
void SetType(int type) { pev->rendermode = (pev->rendermode & 0xF0) | (type & 0x0F); }
void SetFlags(int flags) { pev->rendermode = (pev->rendermode & 0x0F) | (flags & 0xF0); }
void SetStartPos(const Vector &pos) { pev->origin = pos; }
void SetEndPos(const Vector &pos) { pev->angles = pos; }
void SetStartEntity(int entityIndex);
void SetEndEntity(int entityIndex);
void SetStartAttachment(int attachment)
{
pev->sequence = (pev->sequence & 0x0FFF) | ((attachment & 0xF) << 12);
}
void SetEndAttachment(int attachment)
{
pev->skin = (pev->skin & 0x0FFF) | ((attachment & 0xF) << 12);
}
void SetTexture(int spriteIndex)
{
pev->modelindex = spriteIndex;
}
void SetWidth(int width)
{
pev->scale = width;
}
void SetNoise(int amplitude)
{
pev->body = amplitude;
}
void SetColor(int r, int g, int b)
{
pev->rendercolor.x = r;
pev->rendercolor.y = g;
pev->rendercolor.z = b;
}
void SetBrightness(int brightness)
{
pev->renderamt = brightness;
}
void SetFrame(float frame)
{
pev->frame = frame;
}
void SetScrollRate(int speed)
{
pev->animtime = speed;
}
int GetType(void)
{
return pev->rendermode & 0x0F;
}
int GetFlags(void)
{
return pev->rendermode & 0xF0;
}
int GetStartEntity(void)
{
return pev->sequence & 0xFFF;
}
int GetEndEntity(void)
{
return pev->skin & 0xFFF;
}
const Vector &GetStartPos(void);
const Vector &GetEndPos(void);
void SetStartAttachment(int attachment) { pev->sequence = (pev->sequence & 0x0FFF) | ((attachment & 0xF) << 12); }
void SetEndAttachment(int attachment) { pev->skin = (pev->skin & 0x0FFF) | ((attachment & 0xF) << 12); }
void SetTexture(int spriteIndex) { pev->modelindex = spriteIndex; }
void SetWidth(int width) { pev->scale = width; }
void SetNoise(int amplitude) { pev->body = amplitude; }
void SetColor(int r, int g, int b) { pev->rendercolor.x = r; pev->rendercolor.y = g; pev->rendercolor.z = b; }
void SetBrightness(int brightness) { pev->renderamt = brightness;}
void SetFrame(float frame) { pev->frame = frame; }
void SetScrollRate(int speed) { pev->animtime = speed; }
int GetType() const { return pev->rendermode & 0x0F; }
int GetFlags() const { return pev->rendermode & 0xF0; }
int GetStartEntity() const { return pev->sequence & 0xFFF; }
int GetEndEntity() const { return pev->skin & 0xFFF; }
int GetTexture(void)
{
return pev->modelindex;
}
int GetWidth(void)
{
return pev->scale;
}
int GetNoise(void)
{
return pev->body;
}
int GetBrightness(void)
{
return pev->renderamt;
}
int GetFrame(void)
{
return pev->frame;
}
int GetScrollRate(void)
{
return pev->animtime;
}
const Vector &GetStartPos();
const Vector &GetEndPos();
void RelinkBeam(void);
int GetTexture() const { return pev->modelindex; }
int GetWidth() const { return pev->scale; }
int GetNoise() const { return pev->body; }
int GetBrightness() const { return pev->renderamt; }
int GetFrame() const { return pev->frame; }
int GetScrollRate() const { return pev->animtime; }
void RelinkBeam();
void DoSparks(const Vector &start, const Vector &end);
CBaseEntity *RandomTargetname(const char *szName);
void BeamDamage(TraceResult *ptr);
@ -322,15 +235,14 @@ public:
pev->dmgtime = gpGlobals->time - 1;
BeamDamage(ptr);
}
};/* size: 152, cachelines: 3, members: 1 */
};
/* <72402> ../cstrike/dlls/effects.h:188 */
class CLaser: public CBeam
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
@ -338,8 +250,8 @@ public:
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
@ -348,42 +260,37 @@ public:
#endif // HOOK_GAMEDLL
public:
void TurnOn(void);
void TurnOff(void);
int IsOn(void);
void TurnOn();
void TurnOff();
int IsOn();
void FireAtPoint(TraceResult &point);
void EXPORT StrikeThink(void);
void EXPORT StrikeThink();
public:
static TYPEDESCRIPTION IMPL(m_SaveData)[3];
public:
CSprite *m_pSprite;
int m_iszSpriteName;
Vector m_firePosition;
};/* size: 172, cachelines: 3, members: 5 */
};
/* <7237e> ../cstrike/dlls/effects.cpp:36 */
class CBubbling: public CBaseEntity
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION);
}
virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); }
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
@ -392,64 +299,60 @@ public:
#endif // HOOK_GAMEDLL
public:
void EXPORT FizzThink(void);
void EXPORT FizzThink();
public:
static TYPEDESCRIPTION IMPL(m_SaveData)[3];
public:
int m_density;
int m_frequency;
int m_bubbleModel;
int m_state;
}; /* size: 168, cachelines: 3, members: 6 */
};
/* <723e6> ../cstrike/dlls/effects.cpp:357 */
class CLightning: public CBeam
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual void Activate(void);
virtual void Activate();
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Activate_(void);
void Activate_();
#endif // HOOK_GAMEDLL
public:
void EXPORT StrikeThink(void);
void EXPORT DamageThink(void);
void RandomArea(void);
void EXPORT StrikeThink();
void EXPORT DamageThink();
void RandomArea();
void RandomPoint(Vector &vecSrc);
void Zap(const Vector &vecSrc, const Vector &vecDest);
void EXPORT StrikeUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void EXPORT ToggleUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
/* <71e17> ../cstrike/dlls/effects.cpp:373 */
inline BOOL ServerSide(void)
inline BOOL ServerSide() const
{
if (!m_life && !(pev->spawnflags & SF_BEAM_RING))
return TRUE;
return FALSE;
}
void BeamUpdateVars(void);
void BeamUpdateVars();
public:
static TYPEDESCRIPTION IMPL(m_SaveData)[13];
public:
int m_active;
int m_iszStartEntity;
int m_iszEndEntity;
@ -463,48 +366,46 @@ public:
int m_iszSpriteName;
int m_frameStart;
float m_radius;
}; /* size: 204, cachelines: 4, members: 15 */
};
/* <7244f> ../cstrike/dlls/effects.cpp:1085 */
class CGlow: public CPointEntity
{
public:
virtual void Spawn(void);
virtual void Spawn();
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual void Think(void);
virtual void Think();
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Spawn_();
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Think_(void);
void Think_();
#endif // HOOK_GAMEDLL
void Animate(float frames);
public:
static TYPEDESCRIPTION IMPL(m_SaveData)[2];
public:
float m_lastTime;
float m_maxFrame;
};/* size: 160, cachelines: 3, members: 4 */
};
/* <724b8> ../cstrike/dlls/effects.cpp:1146 */
class CBombGlow: public CSprite
{
public:
virtual void Spawn(void);
virtual void Think(void);
virtual void Spawn();
virtual void Think();
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Think_(void);
void Spawn_();
void Think_();
#endif // HOOK_GAMEDLL
@ -512,39 +413,38 @@ public:
float m_lastTime;
float m_tmBeepPeriod;
bool m_bSetModel;
};/* size: 172, cachelines: 3, members: 4 */
};
/* <72581> ../cstrike/dlls/effects.cpp:1413 */
class CGibShooter: public CBaseDelay
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual CGib *CreateGib(void);
virtual CGib *CreateGib();
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
CGib *CreateGib_(void);
CGib *CreateGib_();
#endif // HOOK_GAMEDLL
public:
void EXPORT ShootThink(void);
void EXPORT ShootThink();
public:
static TYPEDESCRIPTION IMPL(m_SaveData)[7];
public:
int m_iGibs;
int m_iGibCapacity;
int m_iGibMaterial;
@ -553,26 +453,25 @@ public:
float m_flGibVelocity;
float m_flVariance;
float m_flGibLife;
};/* size: 188, cachelines: 3, members: 9 */
};
/* <725ef> ../cstrike/dlls/effects.cpp:1592 */
class CEnvShooter: public CGibShooter
{
public:
virtual void Precache(void);
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);
virtual CGib *CreateGib(void);
virtual CGib *CreateGib();
#ifdef HOOK_GAMEDLL
void Precache_(void);
void Precache_();
void KeyValue_(KeyValueData *pkvd);
CGib *CreateGib_(void);
CGib *CreateGib_();
#endif // HOOK_GAMEDLL
};/* size: 188, cachelines: 3, members: 1 */
};
#define MAX_BEAM 24
@ -580,20 +479,20 @@ public:
class CTestEffect: public CBaseDelay
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif // HOOK_GAMEDLL
public:
void EXPORT TestThink(void);
void EXPORT TestThink();
public:
int m_iLoop;
@ -603,257 +502,165 @@ public:
float m_flBeamTime[ MAX_BEAM ];
float m_flStartTime;
};/* size: 364, cachelines: 6, members: 6 */
};
/* <72690> ../cstrike/dlls/effects.cpp:1769 */
class CBlood: public CPointEntity
{
public:
virtual void Spawn(void);
virtual void Spawn();
virtual void KeyValue(KeyValueData *pkvd);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Spawn_();
void KeyValue_(KeyValueData *pkvd);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif // HOOK_GAMEDLL
public:
/* <7205b> ../cstrike/dlls/effects.cpp:1776 */
int Color(void)
{
return pev->impulse;
}
/* <72079> ../cstrike/dlls/effects.cpp:1777 */
float BloodAmount(void)
{
return pev->dmg;
}
/* <72092> ../cstrike/dlls/effects.cpp:1779 */
void SetColor(int color)
{
pev->impulse = color;
}
/* <720b7> ../cstrike/dlls/effects.cpp:1780 */
void SetBloodAmount(float amount)
{
pev->dmg = amount;
}
int Color() const { return pev->impulse; }
float BloodAmount() const { return pev->dmg; }
void SetColor(int color) { pev->impulse = color; }
void SetBloodAmount(float amount) { pev->dmg = amount; }
public:
Vector Direction(void);
Vector Direction();
Vector BloodPosition(CBaseEntity *pActivator);
};/* size: 152, cachelines: 3, members: 1 */
};
/* <726de> ../cstrike/dlls/effects.cpp:1886 */
class CShake: public CPointEntity
{
public:
virtual void Spawn(void);
virtual void Spawn();
virtual void KeyValue(KeyValueData *pkvd);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Spawn_();
void KeyValue_(KeyValueData *pkvd);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif // HOOK_GAMEDLL
public:
/* <7210f> ../cstrike/dlls/effects.cpp:1893 */
float Amplitude(void)
{
return pev->scale;
}
/* <7212d> ../cstrike/dlls/effects.cpp:1894 */
float Frequency(void)
{
return pev->dmg_save;
}
/* <72146> ../cstrike/dlls/effects.cpp:1895 */
float Duration(void)
{
return pev->dmg_take;
}
/* <7215f> ../cstrike/dlls/effects.cpp:1896 */
float Radius(void)
{
return pev->dmg;
}
/* <72178> ../cstrike/dlls/effects.cpp:1898 */
void SetAmplitude(float amplitude)
{
pev->scale = amplitude;
}
/* <7219d> ../cstrike/dlls/effects.cpp:1899 */
void SetFrequency(float frequency)
{
pev->dmg_save = frequency;
}
/* <721c2> ../cstrike/dlls/effects.cpp:1900 */
void SetDuration(float duration)
{
pev->dmg_take = duration;
}
/* <721e7> ../cstrike/dlls/effects.cpp:1901 */
void SetRadius(float radius)
{
pev->dmg = radius;
}
float Amplitude() const { return pev->scale; }
float Frequency() const { return pev->dmg_save; }
float Duration() const { return pev->dmg_take; }
float Radius() const { return pev->dmg; }
};/* size: 152, cachelines: 3, members: 1 */
void SetAmplitude(float amplitude) { pev->scale = amplitude; }
void SetFrequency(float frequency) { pev->dmg_save = frequency; }
void SetDuration(float duration) { pev->dmg_take = duration; }
void SetRadius(float radius) { pev->dmg = radius; }
};
/* <7272c> ../cstrike/dlls/effects.cpp:1964 */
class CFade: public CPointEntity
{
public:
virtual void Spawn(void);
virtual void Spawn();
virtual void KeyValue(KeyValueData *pkvd);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Spawn_();
void KeyValue_(KeyValueData *pkvd);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif // HOOK_GAMEDLL
public:
/* <72231> ../cstrike/dlls/effects.cpp:1971 */
float Duration(void)
{
return pev->dmg_take;
}
/* <7224f> ../cstrike/dlls/effects.cpp:1972 */
float HoldTime(void)
{
return pev->dmg_save;
}
/* <72268> ../cstrike/dlls/effects.cpp:1974 */
void SetDuration(float duration)
{
pev->dmg_take = duration;
}
/* <7228d> ../cstrike/dlls/effects.cpp:1975 */
void SetHoldTime(float hold)
{
pev->dmg_save = hold;
}
float Duration() const { return pev->dmg_take; }
float HoldTime() const { return pev->dmg_save; }
};/* size: 152, cachelines: 3, members: 1 */
void SetDuration(float duration) { pev->dmg_take = duration; }
void SetHoldTime(float hold) { pev->dmg_save = hold; }
};
/* <7277a> ../cstrike/dlls/effects.cpp:2038 */
class CMessage: public CPointEntity
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif // HOOK_GAMEDLL
};/* size: 152, cachelines: 3, members: 1 */
};
/* <727c8> ../cstrike/dlls/effects.cpp:2145 */
class CEnvFunnel: public CBaseDelay
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif // HOOK_GAMEDLL
public:
int m_iSprite;
};/* size: 164, cachelines: 3, members: 2 */
};
/* <7281b> ../cstrike/dlls/effects.cpp:2199 */
class CEnvBeverage: public CBaseDelay
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif // HOOK_GAMEDLL
};/* size: 160, cachelines: 3, members: 1 */
};
/* <72869> ../cstrike/dlls/effects.cpp:2258 */
class CItemSoda: public CBaseEntity
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
#endif // HOOK_GAMEDLL
public:
void EXPORT CanThink(void);
void EXPORT CanThink();
void EXPORT CanTouch(CBaseEntity *pOther);
};/* size: 152, cachelines: 3, members: 1 */
};
int IsPointEntity(CBaseEntity *pEnt);
#ifdef HOOK_GAMEDLL
// linked objects
C_DLLEXPORT void info_target(entvars_t *pev);
C_DLLEXPORT void env_bubbles(entvars_t *pev);
C_DLLEXPORT void beam(entvars_t *pev);
C_DLLEXPORT void env_lightning(entvars_t *pev);
C_DLLEXPORT void env_beam(entvars_t *pev);
C_DLLEXPORT void env_laser(entvars_t *pev);
C_DLLEXPORT void env_glow(entvars_t *pev);
C_DLLEXPORT void env_bombglow(entvars_t *pev);
C_DLLEXPORT void env_sprite(entvars_t *pev);
C_DLLEXPORT void gibshooter(entvars_t *pev);
C_DLLEXPORT void env_shooter(entvars_t *pev);
C_DLLEXPORT void test_effect(entvars_t *pev);
C_DLLEXPORT void env_blood(entvars_t *pev);
C_DLLEXPORT void env_shake(entvars_t *pev);
C_DLLEXPORT void env_fade(entvars_t *pev);
C_DLLEXPORT void env_message(entvars_t *pev);
C_DLLEXPORT void env_funnel(entvars_t *pev);
C_DLLEXPORT void env_beverage(entvars_t *pev);
C_DLLEXPORT void item_sodacan(entvars_t *pev);
#endif // HOOK_GAMEDLL
#endif // EFFECTS_H

View File

@ -11,17 +11,13 @@ TYPEDESCRIPTION CEnvExplosion::m_SaveData[] =
DEFINE_FIELD(CEnvExplosion, m_spriteScale, FIELD_INTEGER),
};
#else // HOOK_GAMEDLL
TYPEDESCRIPTION IMPL_CLASS(CEnvExplosion, m_SaveData)[2];
#endif // HOOK_GAMEDLL
/* <7f660> ../cstrike/dlls/explode.cpp:37 */
LINK_ENTITY_TO_CLASS(spark_shower, CShower);
/* <7f49c> ../cstrike/dlls/explode.cpp:39 */
void CShower::__MAKE_VHOOK(Spawn)(void)
void CShower::__MAKE_VHOOK(Spawn)()
{
pev->velocity = RANDOM_FLOAT(200, 300) * pev->angles;
pev->velocity.x += RANDOM_FLOAT(-100, 100);
@ -47,7 +43,7 @@ void CShower::__MAKE_VHOOK(Spawn)(void)
}
/* <7f475> ../cstrike/dlls/explode.cpp:61 */
void CShower::__MAKE_VHOOK(Think)(void)
void CShower::__MAKE_VHOOK(Think)()
{
UTIL_Sparks(pev->origin);
@ -94,7 +90,7 @@ void CEnvExplosion::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
}
/* <7f1a5> ../cstrike/dlls/explode.cpp:120 */
void CEnvExplosion::__MAKE_VHOOK(Spawn)(void)
void CEnvExplosion::__MAKE_VHOOK(Spawn)()
{
pev->solid = SOLID_NOT;
pev->effects = EF_NODRAW;
@ -197,7 +193,7 @@ void CEnvExplosion::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCal
}
/* <7f1e1> ../cstrike/dlls/explode.cpp:235 */
void CEnvExplosion::Smoke(void)
void CEnvExplosion::Smoke()
{
if (!(pev->spawnflags & SF_ENVEXPLOSION_NOSMOKE))
{
@ -243,47 +239,3 @@ void ExplosionCreate(const Vector &center, Vector &angles, edict_t *pOwner, int
pExplosion->Spawn();
pExplosion->Use(NULL, NULL, USE_TOGGLE, 0);
}
#ifdef HOOK_GAMEDLL
void CShower::Spawn(void)
{
Spawn_();
}
void CShower::Think(void)
{
Think_();
}
void CShower::Touch(CBaseEntity *pOther)
{
Touch_(pOther);
}
void CEnvExplosion::Spawn(void)
{
Spawn_();
}
void CEnvExplosion::KeyValue(KeyValueData *pkvd)
{
KeyValue_(pkvd);
}
int CEnvExplosion::Save(CSave &save)
{
return Save_(save);
}
int CEnvExplosion::Restore(CRestore &restore)
{
return Restore_(restore);
}
void CEnvExplosion::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
#endif // HOOK_GAMEDLL

View File

@ -43,29 +43,26 @@
class CShower: public CBaseEntity
{
public:
virtual void Spawn(void);
virtual int ObjectCaps(void)
{
return FCAP_DONT_SAVE;
}
virtual void Think(void);
virtual void Spawn();
virtual int ObjectCaps() { return FCAP_DONT_SAVE; }
virtual void Think();
virtual void Touch(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Think_(void);
void Spawn_();
void Think_();
void Touch_(CBaseEntity *pOther);
#endif // HOOK_GAMEDLL
};/* size: 152, cachelines: 3, members: 1 */
};
/* <7e66b> ../cstrike/dlls/explode.cpp:84 */
class CEnvExplosion: public CBaseMonster
{
public:
virtual void Spawn(void);
virtual void Spawn();
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
@ -73,7 +70,7 @@ public:
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Spawn_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
@ -82,25 +79,15 @@ public:
#endif // HOOK_GAMEDLL
public:
void EXPORT Smoke(void);
void EXPORT Smoke();
public:
static TYPEDESCRIPTION IMPL(m_SaveData)[2];
public:
int m_iMagnitude;
int m_spriteScale;
};/* size: 412, cachelines: 7, members: 4 */
};
void ExplosionCreate(const Vector &center, Vector &angles, edict_t *pOwner, int magnitude, BOOL doDamage);
#ifdef HOOK_GAMEDLL
// linked objects
C_DLLEXPORT void spark_shower(entvars_t *pev);
C_DLLEXPORT void env_explosion(entvars_t *pev);
#endif // HOOK_GAMEDLL
#endif // EXPLODE_H

View File

@ -48,7 +48,7 @@ const char *CBreakable::pSoundsWood[] =
{
"debris/wood1.wav",
"debris/wood2.wav",
"debris/wood3.wav",
"debris/wood3.wav"
};
const char *CBreakable::pSoundsFlesh[] =
@ -58,28 +58,28 @@ const char *CBreakable::pSoundsFlesh[] =
"debris/flesh3.wav",
"debris/flesh5.wav",
"debris/flesh6.wav",
"debris/flesh7.wav",
"debris/flesh7.wav"
};
const char *CBreakable::pSoundsMetal[] =
{
"debris/metal1.wav",
"debris/metal2.wav",
"debris/metal3.wav",
"debris/metal3.wav"
};
const char *CBreakable::pSoundsConcrete[] =
{
"debris/concrete1.wav",
"debris/concrete2.wav",
"debris/concrete3.wav",
"debris/concrete3.wav"
};
const char *CBreakable::pSoundsGlass[] =
{
"debris/glass1.wav",
"debris/glass2.wav",
"debris/glass3.wav",
"debris/glass3.wav"
};
char *CPushable::m_soundNames[] =
@ -104,21 +104,6 @@ TYPEDESCRIPTION CPushable::m_SaveData[] =
DEFINE_FIELD(CPushable, m_soundTime, FIELD_TIME),
};
#else // HOOK_GAMEDLL
const char *(*CBreakable::ppSpawnObjects)[32];
const char *(*CBreakable::ppSoundsWood)[3];
const char *(*CBreakable::ppSoundsFlesh)[6];
const char *(*CBreakable::ppSoundsMetal)[3];
const char *(*CBreakable::ppSoundsConcrete)[3];
const char *(*CBreakable::ppSoundsGlass)[3];
char *(*CPushable::pm_soundNames)[3];
TYPEDESCRIPTION IMPL_CLASS(CBreakable, m_SaveData)[5];
TYPEDESCRIPTION IMPL_CLASS(CPushable, m_SaveData)[2];
#endif // HOOK_GAMEDLL
/* <85bf3> ../cstrike/dlls/func_break.cpp:76 */
@ -192,7 +177,7 @@ LINK_ENTITY_TO_CLASS(func_breakable, CBreakable);
IMPLEMENT_SAVERESTORE(CBreakable, CBaseEntity);
/* <85663> ../cstrike/dlls/func_break.cpp:157 */
void CBreakable::__MAKE_VHOOK(Spawn)(void)
void CBreakable::__MAKE_VHOOK(Spawn)()
{
Precache();
@ -233,7 +218,7 @@ void CBreakable::__MAKE_VHOOK(Spawn)(void)
}
/* <8568a> ../cstrike/dlls/func_break.cpp:191 */
void CBreakable::__MAKE_VHOOK(Restart)(void)
void CBreakable::__MAKE_VHOOK(Restart)()
{
pev->solid = SOLID_BSP;
pev->movetype = MOVETYPE_PUSH;
@ -340,7 +325,7 @@ void CBreakable::MaterialSoundRandom(edict_t *pEdict, Materials soundMaterial, f
}
/* <8634b> ../cstrike/dlls/func_break.cpp:328 */
void CBreakable::__MAKE_VHOOK(Precache)(void)
void CBreakable::__MAKE_VHOOK(Precache)()
{
const char *pGibName = NULL;
@ -418,7 +403,7 @@ void CBreakable::__MAKE_VHOOK(Precache)(void)
}
/* <86676> ../cstrike/dlls/func_break.cpp:401 */
void CBreakable::DamageSound(void)
void CBreakable::DamageSound()
{
int pitch;
float fvol;
@ -507,18 +492,20 @@ void CBreakable::BreakTouch(CBaseEntity *pOther)
UTIL_MakeVectors(pev->angles);
g_vecAttackDir = gpGlobals->v_forward;
#ifndef REGAMEDLL_FIXES
pev->takedamage = DAMAGE_NO;
pev->deadflag = DEAD_DEAD;
pev->effects = EF_NODRAW;
#endif // REGAMEDLL_FIXES
Die();
}
// can be broken when run into
if (pev->spawnflags & SF_BREAK_TOUCH)
{
flDamage = pevToucher->velocity.Length() * 0.01;
flDamage = pevToucher->velocity.Length() * 0.01f;
if (flDamage >= pev->health)
{
@ -539,10 +526,10 @@ void CBreakable::BreakTouch(CBaseEntity *pOther)
SetThink(&CBreakable::Die);
SetTouch(NULL);
// !!!BUGBUG - why doesn't zero delay work?
if (m_flDelay == 0)
// BUGBUG: why doesn't zero delay work?
if (m_flDelay == 0.0f)
{
m_flDelay = 0.1;
m_flDelay = 0.1f;
}
pev->nextthink = pev->ltime + m_flDelay;
@ -560,11 +547,13 @@ void CBreakable::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller
pev->angles.y = m_angle;
UTIL_MakeVectors(pev->angles);
g_vecAttackDir = gpGlobals->v_forward;
#ifndef REGAMEDLL_FIXES
pev->takedamage = DAMAGE_NO;
pev->deadflag = DEAD_DEAD;
pev->effects = EF_NODRAW;
#endif // REGAMEDLL_FIXES
Die();
}
}
@ -616,7 +605,7 @@ int CBreakable::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pev
// (that is, no actual entity projectile was involved in the attack so use the shooter's origin).
if (pevAttacker == pevInflictor)
{
vecTemp = pevInflictor->origin - (pev->absmin + (pev->size * 0.5));
vecTemp = pevInflictor->origin - (pev->absmin + (pev->size * 0.5f));
// if a client hit the breakable with a crowbar, and breakable is crowbar-sensitive, break it now.
if ((pevAttacker->flags & FL_CLIENT) && (pev->spawnflags & SF_BREAK_CROWBAR) && (bitsDamageType & DMG_CLUB))
@ -627,7 +616,7 @@ int CBreakable::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pev
else
{
// an actual missile was involved.
vecTemp = pevInflictor->origin - (pev->absmin + (pev->size * 0.5));
vecTemp = pevInflictor->origin - (pev->absmin + (pev->size * 0.5f));
}
if (!IsBreakable())
@ -636,13 +625,13 @@ int CBreakable::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pev
// Breakables take double damage from the crowbar
if (bitsDamageType & DMG_CLUB)
{
flDamage *= 2;
flDamage *= 2.0f;
}
// Boxes / glass / etc. don't take much poison damage, just the impact of the dart - consider that 10%
if (bitsDamageType & DMG_POISON)
{
flDamage *= 0.1;
flDamage *= 0.1f;
}
// this global is still used for glass and other non-monster killables, along with decals.
@ -660,9 +649,9 @@ int CBreakable::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pev
#endif // REGAMEDLL_FIXES
Die();
if (m_flDelay == 0)
if (m_flDelay == 0.0f)
{
m_flDelay = 0.1;
m_flDelay = 0.1f;
}
pev->nextthink = pev->ltime + m_flDelay;
@ -672,12 +661,11 @@ int CBreakable::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pev
// Make a shard noise each time func breakable is hit.
// Don't play shard noise if cbreakable actually died.
DamageSound();
return 1;
}
/* <856fe> ../cstrike/dlls/func_break.cpp:653 */
void CBreakable::Die(void)
void CBreakable::Die()
{
Vector vecSpot; // shard origin
Vector vecVelocity; // shard velocity
@ -699,10 +687,10 @@ void CBreakable::Die(void)
// The more negative pev->health, the louder
// the sound should be.
fvol = RANDOM_FLOAT(0.85, 1.0) + (abs((int)pev->health) / 100.0);
fvol = RANDOM_FLOAT(0.85, 1.0) + (abs((int)pev->health) / 100.0f);
if (fvol > 1.0)
fvol = 1.0;
if (fvol > 1.0f)
fvol = 1.0f;
switch (m_Material)
{
@ -794,7 +782,7 @@ void CBreakable::Die(void)
if (m_Explosion == expDirected)
{
vecVelocity = g_vecAttackDir * 200;
vecVelocity = g_vecAttackDir * 200.0f;
}
else
{
@ -852,7 +840,7 @@ void CBreakable::Die(void)
SUB_UseTargets(NULL, USE_TOGGLE, 0);
SetThink(NULL);
pev->nextthink = pev->ltime + 0.1;
pev->nextthink = pev->ltime + 0.1f;
if (m_iszSpawnObject)
{
@ -866,7 +854,7 @@ void CBreakable::Die(void)
}
/* <86992> ../cstrike/dlls/func_break.cpp:833 */
BOOL CBreakable::IsBreakable(void)
BOOL CBreakable::IsBreakable()
{
return m_Material != matUnbreakableGlass;
}
@ -890,7 +878,7 @@ LINK_ENTITY_TO_CLASS(func_pushable, CPushable);
IMPLEMENT_SAVERESTORE(CPushable, CBreakable);
/* <856d7> ../cstrike/dlls/func_break.cpp:893 */
void CPushable::__MAKE_VHOOK(Spawn)(void)
void CPushable::__MAKE_VHOOK(Spawn)()
{
if (pev->spawnflags & SF_PUSH_BREAKABLE)
CBreakable::Spawn();
@ -922,7 +910,7 @@ void CPushable::__MAKE_VHOOK(Spawn)(void)
}
/* <863eb> ../cstrike/dlls/func_break.cpp:920 */
void CPushable::__MAKE_VHOOK(Precache)(void)
void CPushable::__MAKE_VHOOK(Precache)()
{
for (int i = 0; i < 3; ++i)
{
@ -949,7 +937,7 @@ void CPushable::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
UTIL_SetSize(pev, Vector(-8, -8, -8), Vector(8, 8, 8));
break;
case 2: // Big Hull!?!? !!!BUGBUG Figure out what this hull really is
case 2: // TODO: Big Hull? BUGBUG: Figure out what this hull really is
UTIL_SetSize(pev, VEC_DUCK_HULL_MIN * 2, VEC_DUCK_HULL_MAX * 2);
break;
@ -1015,7 +1003,7 @@ void CPushable::Move(CBaseEntity *pOther, int push)
// Only push if floating
if (pev->waterlevel > 0)
{
pev->velocity.z += pevToucher->velocity.z * 0.1;
pev->velocity.z += pevToucher->velocity.z * 0.1f;
}
return;
@ -1042,13 +1030,13 @@ void CPushable::Move(CBaseEntity *pOther, int push)
if (pev->waterlevel < 1)
return;
else
factor = 0.1;
factor = 0.1f;
}
else
factor = 1;
factor = 1.0f;
}
else
factor = 0.25;
factor = 0.25f;
pev->velocity.x += pevToucher->velocity.x * factor;
pev->velocity.y += pevToucher->velocity.y * factor;
@ -1066,7 +1054,7 @@ void CPushable::Move(CBaseEntity *pOther, int push)
pevToucher->velocity.x = pev->velocity.x;
pevToucher->velocity.y = pev->velocity.y;
if ((gpGlobals->time - m_soundTime) > 0.7)
if ((gpGlobals->time - m_soundTime) > 0.7f)
{
m_soundTime = gpGlobals->time;
@ -1094,97 +1082,3 @@ int CPushable::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevA
return 1;
}
#ifdef HOOK_GAMEDLL
void CBreakable::Spawn(void)
{
Spawn_();
}
void CBreakable::Precache(void)
{
Precache_();
}
void CBreakable::Restart(void)
{
Restart_();
}
void CBreakable::KeyValue(KeyValueData *pkvd)
{
KeyValue_(pkvd);
}
int CBreakable::Save(CSave &save)
{
return Save_(save);
}
int CBreakable::Restore(CRestore &restore)
{
return Restore_(restore);
}
void CBreakable::TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType)
{
TraceAttack_(pevAttacker, flDamage, vecDir, ptr, bitsDamageType);
}
int CBreakable::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{
return TakeDamage_(pevInflictor, pevAttacker, flDamage, bitsDamageType);
}
int CBreakable::DamageDecal(int bitsDamageType)
{
return DamageDecal_(bitsDamageType);
}
void CBreakable::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
void CPushable::Spawn(void)
{
Spawn_();
}
void CPushable::Precache(void)
{
Precache_();
}
void CPushable::KeyValue(KeyValueData *pkvd)
{
KeyValue_(pkvd);
}
int CPushable::Save(CSave &save)
{
return Save_(save);
}
int CPushable::Restore(CRestore &restore)
{
return Restore_(restore);
}
int CPushable::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{
return TakeDamage_(pevInflictor, pevAttacker, flDamage, bitsDamageType);
}
void CPushable::Touch(CBaseEntity *pOther)
{
Touch_(pOther);
}
void CPushable::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
#endif // HOOK_GAMEDLL

View File

@ -67,33 +67,18 @@ typedef enum
} Materials;
#ifdef HOOK_GAMEDLL
#define pSoundsWood (*ppSoundsWood)
#define pSoundsFlesh (*ppSoundsFlesh)
#define pSoundsGlass (*ppSoundsGlass)
#define pSoundsMetal (*ppSoundsMetal)
#define pSoundsConcrete (*ppSoundsConcrete)
#define pSpawnObjects (*ppSpawnObjects)
#define m_soundNames (*pm_soundNames)
#endif // HOOK_GAMEDLL
/* <84d53> ../cstrike/dlls/func_break.h:23 */
class CBreakable: public CBaseDelay
{
public:
// basic functions
virtual void Spawn(void);
virtual void Precache(void);
virtual void Restart(void);
virtual void Spawn();
virtual void Precache();
virtual void Restart();
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION);
}
virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); }
// To spark when hit
virtual void TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType);
@ -106,9 +91,9 @@ public:
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Restart_(void);
void Spawn_();
void Precache_();
void Restart_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
@ -121,25 +106,17 @@ public:
public:
void EXPORT BreakTouch(CBaseEntity *pOther);
void DamageSound(void);
void DamageSound();
BOOL IsBreakable(void);
NOXREF BOOL SparkWhenHit(void);
BOOL IsBreakable();
NOXREF BOOL SparkWhenHit();
void EXPORT Die(void);
void EXPORT Die();
BOOL Explodable(void)
{
return ExplosionMagnitude() > 0;
}
int ExplosionMagnitude(void)
{
return pev->impulse;
}
void ExplosionSetMagnitude(int magnitude)
{
pev->impulse = magnitude;
}
BOOL Explodable() const { return ExplosionMagnitude() > 0; }
int ExplosionMagnitude() const { return pev->impulse; }
void ExplosionSetMagnitude(int magnitude) { pev->impulse = magnitude; }
static void MaterialSoundPrecache(Materials precacheMaterial);
static void MaterialSoundRandom(edict_t *pEdict, Materials soundMaterial, float volume);
@ -162,30 +139,26 @@ public:
int m_iszGibModel;
int m_iszSpawnObject;
float m_flHealth;
};/* size: 188, cachelines: 3, members: 15 */
};
/* <84da0> ../cstrike/dlls/func_break.cpp:851 */
class CPushable: public CBreakable
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION) | FCAP_CONTINUOUS_USE;
}
virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION) | FCAP_CONTINUOUS_USE; }
virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
virtual void Touch(CBaseEntity *pOther);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
@ -197,7 +170,7 @@ public:
public:
void Move(CBaseEntity *pMover, int push);
void EXPORT StopSound(void)
void EXPORT StopSound()
{
#if 0
Vector dist = pev->oldorigin - pev->origin;
@ -207,29 +180,15 @@ public:
}
#endif
}
float MaxSpeed(void)
{
return m_maxSpeed;
}
float MaxSpeed() const { return m_maxSpeed; }
public:
static TYPEDESCRIPTION IMPL(m_SaveData)[2];
public:
static char *m_soundNames[3];
int m_lastSound;
float m_maxSpeed;
float m_soundTime;
};/* size: 200, cachelines: 4, members: 6 */
#ifdef HOOK_GAMEDLL
// linked objects
C_DLLEXPORT void func_breakable(entvars_t *pev);
C_DLLEXPORT void func_pushable(entvars_t *pev);
#endif // HOOK_GAMEDLL
};
#endif // FUNC_BREAK_H

View File

@ -46,7 +46,7 @@ TYPEDESCRIPTION CFuncTankControls::m_SaveData[] =
DEFINE_FIELD(CFuncTankControls, m_pTank, FIELD_CLASSPTR),
};
static Vector gTankSpread[] =
Vector gTankSpread[] =
{
Vector(0, 0, 0), // perfect
Vector(0.025, 0.025, 0.025), // small cone
@ -55,13 +55,6 @@ static Vector gTankSpread[] =
Vector(0.25, 0.25, 0.25), // extra-large cone
};
#else
TYPEDESCRIPTION IMPL_CLASS(CFuncTank, m_SaveData)[26];
TYPEDESCRIPTION IMPL_CLASS(CFuncTankLaser, m_SaveData)[2];
TYPEDESCRIPTION IMPL_CLASS(CFuncTankControls, m_SaveData)[1];
Vector gTankSpread[5];
#endif // HOOK_GAMEDLL
#define MAX_FIRING_SPREADS ARRAYSIZE(gTankSpread)
@ -70,7 +63,7 @@ Vector gTankSpread[5];
IMPLEMENT_SAVERESTORE(CFuncTank, CBaseEntity);
/* <8ea25> ../cstrike/dlls/func_tank.cpp:177 */
void CFuncTank::__MAKE_VHOOK(Spawn)(void)
void CFuncTank::__MAKE_VHOOK(Spawn)()
{
Precache();
@ -84,14 +77,14 @@ void CFuncTank::__MAKE_VHOOK(Spawn)(void)
if (IsActive())
{
pev->nextthink = pev->ltime + 1.0;
pev->nextthink = pev->ltime + 1.0f;
}
// Point at the end of the barrel
m_sightOrigin = BarrelPosition();
if (m_fireRate <= 0)
m_fireRate = 1;
if (m_fireRate <= 0.0f)
m_fireRate = 1.0f;
if (m_spread > MAX_FIRING_SPREADS)
m_spread = 0;
@ -100,7 +93,7 @@ void CFuncTank::__MAKE_VHOOK(Spawn)(void)
}
/* <8d64d> ../cstrike/dlls/func_tank.cpp:202 */
void CFuncTank::__MAKE_VHOOK(Precache)(void)
void CFuncTank::__MAKE_VHOOK(Precache)()
{
if (m_iszSpriteSmoke)
{
@ -238,7 +231,7 @@ BOOL CFuncTank::__MAKE_VHOOK(OnControls)(entvars_t *pevTest)
Vector offset = pevTest->origin - pev->origin;
if ((m_vecControllerUsePos - pevTest->origin).Length() < 30)
if ((m_vecControllerUsePos - pevTest->origin).Length() < 30.0f)
{
return TRUE;
}
@ -278,13 +271,13 @@ BOOL CFuncTank::StartControl(CBasePlayer *pController)
m_pController->m_iHideHUD |= HIDEHUD_WEAPONS;
m_vecControllerUsePos = m_pController->pev->origin;
pev->nextthink = pev->ltime + 0.1;
pev->nextthink = pev->ltime + 0.1f;
return TRUE;
}
/* <8ebde> ../cstrike/dlls/func_tank.cpp:372 */
void CFuncTank::StopControl(void)
void CFuncTank::StopControl()
{
// TODO: bring back the controllers current weapon
if (!m_pController)
@ -309,12 +302,12 @@ void CFuncTank::StopControl(void)
if (IsActive())
{
pev->nextthink = pev->ltime + 1.0;
pev->nextthink = pev->ltime + 1.0f;
}
}
/* <8ec15> ../cstrike/dlls/func_tank.cpp:398 */
void CFuncTank::ControllerPostFrame(void)
void CFuncTank::ControllerPostFrame()
{
assert(m_pController != NULL);
@ -326,7 +319,7 @@ void CFuncTank::ControllerPostFrame(void)
Vector vecForward;
UTIL_MakeVectorsPrivate(pev->angles, vecForward, NULL, NULL);
m_fireLast = gpGlobals->time - (1 / m_fireRate) - 0.01;
m_fireLast = gpGlobals->time - (1.0f / m_fireRate) - 0.01f;
Fire(BarrelPosition(), vecForward, m_pController->pev);
if (m_pController && m_pController->IsPlayer())
@ -334,7 +327,7 @@ void CFuncTank::ControllerPostFrame(void)
m_pController->m_iWeaponVolume = LOUD_GUN_VOLUME;
}
m_flNextAttack = gpGlobals->time + (1 / m_fireRate);
m_flNextAttack = gpGlobals->time + (1.0f / m_fireRate);
}
}
@ -392,7 +385,7 @@ BOOL CFuncTank::InRange(float range)
}
/* <8f717> ../cstrike/dlls/func_tank.cpp:477 */
void CFuncTank::__MAKE_VHOOK(Think)(void)
void CFuncTank::__MAKE_VHOOK(Think)()
{
pev->avelocity = g_vecZero;
TrackTarget();
@ -404,7 +397,7 @@ void CFuncTank::__MAKE_VHOOK(Think)(void)
}
/* <8efe4> ../cstrike/dlls/func_tank.cpp:488 */
void CFuncTank::TrackTarget(void)
void CFuncTank::TrackTarget()
{
TraceResult tr;
edict_t *pPlayer = FIND_CLIENT_IN_PVS(edict());
@ -418,12 +411,12 @@ void CFuncTank::TrackTarget(void)
// Tanks attempt to mirror the player's angles
angles = m_pController->pev->v_angle;
angles.x = 0 - angles.x;
pev->nextthink = pev->ltime + 0.05;
pev->nextthink = pev->ltime + 0.05f;
}
else
{
if (IsActive())
pev->nextthink = pev->ltime + 0.1;
pev->nextthink = pev->ltime + 0.1f;
else
return;
@ -432,7 +425,7 @@ void CFuncTank::TrackTarget(void)
if (IsActive())
{
// Wait 2 secs
pev->nextthink = pev->ltime + 2;
pev->nextthink = pev->ltime + 2.0f;
}
return;
@ -469,7 +462,7 @@ void CFuncTank::TrackTarget(void)
}
// Track sight origin
// !!! I'm not sure what i changed
// TODO: I'm not sure what i changed
direction = m_sightOrigin - pev->origin;
//direction = m_sightOrigin - barrelEnd;
angles = UTIL_VecToAngles(direction);
@ -507,7 +500,7 @@ void CFuncTank::TrackTarget(void)
// Move toward target at rate or less
float_precision distY = UTIL_AngleDistance(angles.y, pev->angles.y);
pev->avelocity.y = distY * 10;
pev->avelocity.y = distY * 10.0f;
if (pev->avelocity.y > m_yawRate)
{
@ -530,7 +523,7 @@ void CFuncTank::TrackTarget(void)
// Move toward target at rate or less
float_precision distX = UTIL_AngleDistance(angles.x, pev->angles.x);
pev->avelocity.x = distX * 10;
pev->avelocity.x = distX * 10.0f;
if (pev->avelocity.x > m_pitchRate)
{
@ -583,7 +576,7 @@ void CFuncTank::AdjustAnglesForBarrel(Vector &angles, float distance)
{
float_precision r2, d2;
if (m_barrelPos.y != 0 || m_barrelPos.z != 0)
if (m_barrelPos.y != 0.0f || m_barrelPos.z != 0.0f)
{
distance -= m_barrelPos.z;
d2 = distance * distance;
@ -591,13 +584,13 @@ void CFuncTank::AdjustAnglesForBarrel(Vector &angles, float distance)
if (m_barrelPos.y)
{
r2 = m_barrelPos.y * m_barrelPos.y;
angles.y += (180.0 / M_PI) * atan2(m_barrelPos.y, sqrt(d2 - r2));
angles.y += (180.0f / M_PI) * atan2(m_barrelPos.y, sqrt(d2 - r2));
}
if (m_barrelPos.z)
{
r2 = m_barrelPos.z * m_barrelPos.z;
angles.x += (180.0 / M_PI) * atan2(-m_barrelPos.z, sqrt(d2 - r2));
angles.x += (180.0f / M_PI) * atan2(-m_barrelPos.z, sqrt(d2 - r2));
}
}
}
@ -607,7 +600,7 @@ void CFuncTank::AdjustAnglesForBarrel(Vector &angles, float distance)
/* <8d4ad> ../cstrike/dlls/func_tank.cpp:656 */
void CFuncTank::__MAKE_VHOOK(Fire)(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker)
{
if (m_fireLast != 0)
if (m_fireLast != 0.0f)
{
if (m_iszSpriteSmoke)
{
@ -655,12 +648,12 @@ void CFuncTank::TankTrace(const Vector &vecStart, const Vector &vecForward, cons
Vector vecDir = vecForward + x * vecSpread.x * gpGlobals->v_right + y * vecSpread.y * gpGlobals->v_up;
Vector vecEnd;
vecEnd = vecStart + vecDir * 4096;
vecEnd = vecStart + vecDir * 4096.0f;
UTIL_TraceLine(vecStart, vecEnd, dont_ignore_monsters, edict(), &tr);
}
/* <8f9c0> ../cstrike/dlls/func_tank.cpp:703 */
void CFuncTank::StartRotSound(void)
void CFuncTank::StartRotSound()
{
if (!pev->noise || (pev->spawnflags & SF_TANK_SOUNDON))
{
@ -672,7 +665,7 @@ void CFuncTank::StartRotSound(void)
}
/* <8fa1b> ../cstrike/dlls/func_tank.cpp:712 */
void CFuncTank::StopRotSound(void)
void CFuncTank::StopRotSound()
{
if (pev->spawnflags & SF_TANK_SOUNDON)
{
@ -688,9 +681,7 @@ LINK_ENTITY_TO_CLASS(func_tank, CFuncTankGun);
/* <8c3d5> ../cstrike/dlls/func_tank.cpp:726 */
void CFuncTankGun::__MAKE_VHOOK(Fire)(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker)
{
int i;
if (m_fireLast != 0)
if (m_fireLast != 0.0f)
{
// FireBullets needs gpGlobals->v_up, etc.
UTIL_MakeAimVectors(pev->angles);
@ -699,7 +690,7 @@ void CFuncTankGun::__MAKE_VHOOK(Fire)(const Vector &barrelEnd, const Vector &for
if (bulletCount > 0)
{
for (i = 0; i < bulletCount; ++i)
for (int i = 0; i < bulletCount; ++i)
{
switch (m_bulletType)
{
@ -732,7 +723,7 @@ LINK_ENTITY_TO_CLASS(func_tanklaser, CFuncTankLaser);
IMPLEMENT_SAVERESTORE(CFuncTankLaser, CFuncTank);
/* <8deed> ../cstrike/dlls/func_tank.cpp:795 */
void CFuncTankLaser::__MAKE_VHOOK(Activate)(void)
void CFuncTankLaser::__MAKE_VHOOK(Activate)()
{
if (!GetLaser())
{
@ -758,16 +749,14 @@ void CFuncTankLaser::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
}
/* <8dd79> ../cstrike/dlls/func_tank.cpp:821 */
CLaser *CFuncTankLaser::GetLaser(void)
CLaser *CFuncTankLaser::GetLaser()
{
if (m_pLaser != NULL)
{
return m_pLaser;
}
edict_t *pentLaser;
pentLaser = FIND_ENTITY_BY_TARGETNAME(NULL, STRING(pev->message));
edict_t *pentLaser = FIND_ENTITY_BY_TARGETNAME(NULL, STRING(pev->message));
while (!FNullEnt(pentLaser))
{
@ -785,7 +774,7 @@ CLaser *CFuncTankLaser::GetLaser(void)
}
/* <8f809> ../cstrike/dlls/func_tank.cpp:845 */
void CFuncTankLaser::__MAKE_VHOOK(Think)(void)
void CFuncTankLaser::__MAKE_VHOOK(Think)()
{
if (m_pLaser != NULL && gpGlobals->time > m_laserTime)
{
@ -801,13 +790,12 @@ void CFuncTankLaser::__MAKE_VHOOK(Fire)(const Vector &barrelEnd, const Vector &f
int i;
TraceResult tr;
if (m_fireLast != 0 && GetLaser())
if (m_fireLast != 0.0f && GetLaser())
{
// TankTrace needs gpGlobals->v_up, etc.
UTIL_MakeAimVectors(pev->angles);
int bulletCount = (int)((gpGlobals->time - m_fireLast) * m_fireRate);
if (bulletCount)
{
for (i = 0; i < bulletCount; ++i)
@ -835,7 +823,7 @@ void CFuncTankLaser::__MAKE_VHOOK(Fire)(const Vector &barrelEnd, const Vector &f
LINK_ENTITY_TO_CLASS(func_tankrocket, CFuncTankRocket);
/* <8e736> ../cstrike/dlls/func_tank.cpp:895 */
void CFuncTankRocket::__MAKE_VHOOK(Precache)(void)
void CFuncTankRocket::__MAKE_VHOOK(Precache)()
{
UTIL_PrecacheOther("rpg_rocket");
CFuncTank::Precache();
@ -846,10 +834,9 @@ void CFuncTankRocket::__MAKE_VHOOK(Fire)(const Vector &barrelEnd, const Vector &
{
int i;
if (m_fireLast != 0)
if (m_fireLast != 0.0f)
{
int bulletCount = (int)((gpGlobals->time - m_fireLast) * m_fireRate);
if (bulletCount > 0)
{
for (i = 0; i < bulletCount; ++i)
@ -882,7 +869,7 @@ void CFuncTankMortar::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
/* <8dbfa> ../cstrike/dlls/func_tank.cpp:945 */
void CFuncTankMortar::__MAKE_VHOOK(Fire)(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker)
{
if (m_fireLast != 0)
if (m_fireLast != 0.0f)
{
int bulletCount = (int)((gpGlobals->time - m_fireLast) * m_fireRate);
@ -925,7 +912,7 @@ void CFuncTankControls::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *
}
/* <8d39a> ../cstrike/dlls/func_tank.cpp:1012 */
void CFuncTankControls::__MAKE_VHOOK(Think)(void)
void CFuncTankControls::__MAKE_VHOOK(Think)()
{
edict_t *pTarget = NULL;
@ -941,11 +928,11 @@ void CFuncTankControls::__MAKE_VHOOK(Think)(void)
return;
}
m_pTank = reinterpret_cast<CFuncTank *>(Instance(pTarget));
m_pTank = static_cast<CFuncTank *>(Instance(pTarget));
}
/* <8d373> ../cstrike/dlls/func_tank.cpp:1030 */
void CFuncTankControls::__MAKE_VHOOK(Spawn)(void)
void CFuncTankControls::__MAKE_VHOOK(Spawn)()
{
pev->solid = SOLID_TRIGGER;
pev->movetype = MOVETYPE_NONE;
@ -957,136 +944,7 @@ void CFuncTankControls::__MAKE_VHOOK(Spawn)(void)
UTIL_SetOrigin(pev, pev->origin);
// After all the func_tank's have spawned
pev->nextthink = gpGlobals->time + 0.3;
pev->nextthink = gpGlobals->time + 0.3f;
CBaseEntity::Spawn();
}
#ifdef HOOK_GAMEDLL
void CFuncTank::Spawn(void)
{
Spawn_();
}
void CFuncTank::Precache(void)
{
Precache_();
}
void CFuncTank::KeyValue(KeyValueData *pkvd)
{
KeyValue_(pkvd);
}
int CFuncTank::Save(CSave &save)
{
return Save_(save);
}
int CFuncTank::Restore(CRestore &restore)
{
return Restore_(restore);
}
BOOL CFuncTank::OnControls(entvars_t *pevTest)
{
OnControls_(pevTest);
}
void CFuncTank::Think(void)
{
Think_();
}
void CFuncTank::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
void CFuncTank::Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker)
{
Fire_(barrelEnd, forward, pevAttacker);
}
void CFuncTankGun::Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker)
{
Fire_(barrelEnd, forward, pevAttacker);
}
void CFuncTankLaser::KeyValue(KeyValueData *pkvd)
{
KeyValue_(pkvd);
}
int CFuncTankLaser::Save(CSave &save)
{
return Save_(save);
}
int CFuncTankLaser::Restore(CRestore &restore)
{
return Restore_(restore);
}
void CFuncTankLaser::Activate(void)
{
Activate_();
}
void CFuncTankLaser::Think(void)
{
Think_();
}
void CFuncTankLaser::Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker)
{
Fire_(barrelEnd, forward, pevAttacker);
}
void CFuncTankRocket::Precache(void)
{
Precache_();
}
void CFuncTankRocket::Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker)
{
Fire_(barrelEnd, forward, pevAttacker);
}
void CFuncTankMortar::KeyValue(KeyValueData *pkvd)
{
KeyValue_(pkvd);
}
void CFuncTankMortar::Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker)
{
Fire_(barrelEnd, forward, pevAttacker);
}
void CFuncTankControls::Spawn(void)
{
Spawn_();
}
int CFuncTankControls::Save(CSave &save)
{
return Save_(save);
}
int CFuncTankControls::Restore(CRestore &restore)
{
return Restore_(restore);
}
void CFuncTankControls::Think(void)
{
Think_();
}
void CFuncTankControls::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
#endif // HOOK_GAMEDLL

View File

@ -52,73 +52,61 @@ enum TANKBULLET
class CFuncTank: public CBaseEntity
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
// Bmodels don't go across transitions
virtual int ObjectCaps(void)
{
return CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION;
}
virtual int ObjectCaps() { return CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
virtual BOOL OnControls(entvars_t *pevTest);
virtual void Think(void);
virtual void Think();
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
virtual Vector UpdateTargetPosition(CBaseEntity *pTarget)
{
return pTarget->BodyTarget(pev->origin);
}
virtual Vector UpdateTargetPosition(CBaseEntity *pTarget) { return pTarget->BodyTarget(pev->origin); }
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
BOOL OnControls_(entvars_t *pevTest);
void Think_(void);
void Think_();
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void Fire_(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
#endif // HOOK_GAMEDLL
public:
void TrackTarget(void);
void StartRotSound(void);
void StopRotSound(void);
void TrackTarget();
void StartRotSound();
void StopRotSound();
BOOL IsActive(void)
{
return (pev->spawnflags & SF_TANK_ACTIVE) == SF_TANK_ACTIVE;
}
void TankActivate(void)
BOOL IsActive() const { return (pev->spawnflags & SF_TANK_ACTIVE) == SF_TANK_ACTIVE; }
void TankActivate()
{
pev->spawnflags |= SF_TANK_ACTIVE;
pev->nextthink = pev->ltime + 0.1f;
m_fireLast = 0.0f;
}
void TankDeactivate(void)
void TankDeactivate()
{
pev->spawnflags &= ~SF_TANK_ACTIVE;
m_fireLast = 0.0f;
StopRotSound();
}
BOOL CanFire(void)
{
return (gpGlobals->time - m_lastSightTime) < m_persist;
}
BOOL CanFire() const { return (gpGlobals->time - m_lastSightTime) < m_persist; }
BOOL InRange(float range);
// Acquire a target. pPlayer is a player in the PVS
edict_t *FindTarget(edict_t *pPlayer);
void TankTrace(const Vector &vecStart, const Vector &vecForward, const Vector &vecSpread, TraceResult &tr);
Vector BarrelPosition(void)
Vector BarrelPosition()
{
Vector forward, right, up;
UTIL_MakeVectorsPrivate(pev->angles, forward, right, up);
@ -127,8 +115,8 @@ public:
void AdjustAnglesForBarrel(Vector &angles, float distance);
BOOL StartControl(CBasePlayer *pController);
void StopControl(void);
void ControllerPostFrame(void);
void StopControl();
void ControllerPostFrame();
public:
static TYPEDESCRIPTION IMPL(m_SaveData)[26];
@ -167,8 +155,7 @@ protected:
Vector m_sightOrigin; // Last sight of target
int m_spread; // firing spread
int m_iszMaster; // Master entity (game_team_master or multisource)
};/* size: 280, cachelines: 5, members: 28 */
};
/* <8c79a> ../cstrike/dlls/func_tank.cpp:719 */
class CFuncTankGun: public CFuncTank
@ -182,7 +169,7 @@ public:
#endif // HOOK_GAMEDLL
};/* size: 280, cachelines: 5, members: 1 */
};
/* <8c7e8> ../cstrike/dlls/func_tank.cpp:768 */
class CFuncTankLaser: public CFuncTank
@ -191,8 +178,8 @@ public:
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual void Activate(void);
virtual void Think(void);
virtual void Activate();
virtual void Think();
virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
#ifdef HOOK_GAMEDLL
@ -200,13 +187,13 @@ public:
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Activate_(void);
void Think_(void);
void Activate_();
void Think_();
void Fire_(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
#endif // HOOK_GAMEDLL
CLaser *GetLaser(void);
CLaser *GetLaser();
public:
static TYPEDESCRIPTION IMPL(m_SaveData)[2];
@ -214,24 +201,23 @@ public:
private:
CLaser *m_pLaser;
float m_laserTime;
};/* size: 288, cachelines: 5, members: 4 */
};
/* <8c836> ../cstrike/dlls/func_tank.cpp:887 */
class CFuncTankRocket: public CFuncTank
{
public:
virtual void Precache(void);
virtual void Precache();
virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
#ifdef HOOK_GAMEDLL
void Precache_(void);
void Precache_();
void Fire_(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
#endif // HOOK_GAMEDLL
};/* size: 280, cachelines: 5, members: 1 */
};
/* <8c884> ../cstrike/dlls/func_tank.cpp:924 */
class CFuncTankMortar: public CFuncTank
@ -247,28 +233,25 @@ public:
#endif // HOOK_GAMEDLL
};/* size: 280, cachelines: 5, members: 1 */
};
/* <8c8d2> ../cstrike/dlls/func_tank.cpp:974 */
class CFuncTankControls: public CBaseEntity
{
public:
virtual void Spawn(void);
virtual void Spawn();
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION) | FCAP_IMPULSE_USE;
}
virtual void Think(void);
virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION) | FCAP_IMPULSE_USE; }
virtual void Think();
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Spawn_();
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Think_(void);
void Think_();
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif // HOOK_GAMEDLL
@ -276,27 +259,7 @@ public:
public:
static TYPEDESCRIPTION IMPL(m_SaveData)[1];
public:
CFuncTank *m_pTank;
};/* size: 156, cachelines: 3, members: 3 */
#ifdef HOOK_GAMEDLL
#define gTankSpread (*pgTankSpread)
extern Vector gTankSpread[5];
#endif // HOOK_GAMEDLL
#ifdef HOOK_GAMEDLL
// linked objects
C_DLLEXPORT void func_tank(entvars_t *pev);
C_DLLEXPORT void func_tanklaser(entvars_t *pev);
C_DLLEXPORT void func_tankrocket(entvars_t *pev);
C_DLLEXPORT void func_tankmortar(entvars_t *pev);
C_DLLEXPORT void func_tankcontrols(entvars_t *pev);
#endif // HOOK_GAMEDLL
};
#endif // FUNC_TANK_H

View File

@ -91,316 +91,6 @@ cvar_t sk_scientist_heal1 = { "sk_scientist_heal1", "0", 0, 0.0f, NULL };
cvar_t sk_scientist_heal2 = { "sk_scientist_heal2", "0", 0, 0.0f, NULL };
cvar_t sk_scientist_heal3 = { "sk_scientist_heal3", "0", 0, 0.0f, NULL };
#else // HOOK_GAMEDLL
cvar_t *g_psv_gravity;
cvar_t *g_psv_aim;
cvar_t *g_footsteps;
cvar_t *g_psv_accelerate;
cvar_t *g_psv_friction;
cvar_t *g_psv_stopspeed;
cvar_t displaysoundlist;
cvar_t timelimit;
cvar_t flashlight;
cvar_t decalfrequency;
cvar_t fadetoblack;
cvar_t fragsleft;
cvar_t timeleft;
cvar_t friendlyfire;
cvar_t allowmonsters;
cvar_t roundtime;
cvar_t buytime;
cvar_t freezetime;
cvar_t c4timer;
cvar_t ghostfrequency;
cvar_t autokick;
cvar_t autokick_timeout;
cvar_t restartround;
cvar_t sv_restart;
cvar_t limitteams;
cvar_t autoteambalance;
cvar_t tkpunish;
cvar_t hostagepenalty;
cvar_t mirrordamage;
cvar_t logmessages;
cvar_t forcecamera;
cvar_t forcechasecam;
cvar_t mapvoteratio;
cvar_t logdetail;
cvar_t startmoney;
cvar_t maxrounds;
cvar_t winlimit;
cvar_t windifference;
cvar_t playerid;
cvar_t allow_spectators;
cvar_t mp_chattime;
cvar_t kick_percent;
cvar_t humans_join_team;
// NOXREF
//cvar_t sk_agrunt_health1;
//cvar_t sk_agrunt_health2;
//cvar_t sk_agrunt_health3;
//cvar_t sk_agrunt_dmg_punch1;
//cvar_t sk_agrunt_dmg_punch2;
//cvar_t sk_agrunt_dmg_punch3;
//cvar_t sk_apache_health1;
//cvar_t sk_apache_health2;
//cvar_t sk_apache_health3;
//cvar_t sk_barney_health1;
//cvar_t sk_barney_health2;
//cvar_t sk_barney_health3;
//cvar_t sk_bullsquid_health1;
//cvar_t sk_bullsquid_health2;
//cvar_t sk_bullsquid_health3;
//cvar_t sk_bullsquid_dmg_bite1;
//cvar_t sk_bullsquid_dmg_bite2;
//cvar_t sk_bullsquid_dmg_bite3;
//cvar_t sk_bullsquid_dmg_whip1;
//cvar_t sk_bullsquid_dmg_whip2;
//cvar_t sk_bullsquid_dmg_whip3;
//cvar_t sk_bullsquid_dmg_spit1;
//cvar_t sk_bullsquid_dmg_spit2;
//cvar_t sk_bullsquid_dmg_spit3;
//cvar_t sk_bigmomma_health_factor1;
//cvar_t sk_bigmomma_health_factor2;
//cvar_t sk_bigmomma_health_factor3;
//cvar_t sk_bigmomma_dmg_slash1;
//cvar_t sk_bigmomma_dmg_slash2;
//cvar_t sk_bigmomma_dmg_slash3;
//cvar_t sk_bigmomma_dmg_blast1;
//cvar_t sk_bigmomma_dmg_blast2;
//cvar_t sk_bigmomma_dmg_blast3;
//cvar_t sk_bigmomma_radius_blast1;
//cvar_t sk_bigmomma_radius_blast2;
//cvar_t sk_bigmomma_radius_blast3;
//cvar_t sk_gargantua_health1;
//cvar_t sk_gargantua_health2;
//cvar_t sk_gargantua_health3;
//cvar_t sk_gargantua_dmg_slash1;
//cvar_t sk_gargantua_dmg_slash2;
//cvar_t sk_gargantua_dmg_slash3;
//cvar_t sk_gargantua_dmg_fire1;
//cvar_t sk_gargantua_dmg_fire2;
//cvar_t sk_gargantua_dmg_fire3;
//cvar_t sk_gargantua_dmg_stomp1;
//cvar_t sk_gargantua_dmg_stomp2;
//cvar_t sk_gargantua_dmg_stomp3;
//cvar_t sk_hassassin_health1;
//cvar_t sk_hassassin_health2;
//cvar_t sk_hassassin_health3;
//cvar_t sk_headcrab_health1;
//cvar_t sk_headcrab_health2;
//cvar_t sk_headcrab_health3;
//cvar_t sk_headcrab_dmg_bite1;
//cvar_t sk_headcrab_dmg_bite2;
//cvar_t sk_headcrab_dmg_bite3;
//cvar_t sk_hgrunt_health1;
//cvar_t sk_hgrunt_health2;
//cvar_t sk_hgrunt_health3;
//cvar_t sk_hgrunt_kick1;
//cvar_t sk_hgrunt_kick2;
//cvar_t sk_hgrunt_kick3;
//cvar_t sk_hgrunt_pellets1;
//cvar_t sk_hgrunt_pellets2;
//cvar_t sk_hgrunt_pellets3;
//cvar_t sk_hgrunt_gspeed1;
//cvar_t sk_hgrunt_gspeed2;
//cvar_t sk_hgrunt_gspeed3;
//cvar_t sk_houndeye_health1;
//cvar_t sk_houndeye_health2;
//cvar_t sk_houndeye_health3;
//cvar_t sk_houndeye_dmg_blast1;
//cvar_t sk_houndeye_dmg_blast2;
//cvar_t sk_houndeye_dmg_blast3;
//cvar_t sk_islave_health1;
//cvar_t sk_islave_health2;
//cvar_t sk_islave_health3;
//cvar_t sk_islave_dmg_claw1;
//cvar_t sk_islave_dmg_claw2;
//cvar_t sk_islave_dmg_claw3;
//cvar_t sk_islave_dmg_clawrake1;
//cvar_t sk_islave_dmg_clawrake2;
//cvar_t sk_islave_dmg_clawrake3;
//cvar_t sk_islave_dmg_zap1;
//cvar_t sk_islave_dmg_zap2;
//cvar_t sk_islave_dmg_zap3;
//cvar_t sk_ichthyosaur_health1;
//cvar_t sk_ichthyosaur_health2;
//cvar_t sk_ichthyosaur_health3;
//cvar_t sk_ichthyosaur_shake1;
//cvar_t sk_ichthyosaur_shake2;
//cvar_t sk_ichthyosaur_shake3;
//cvar_t sk_leech_health1;
//cvar_t sk_leech_health2;
//cvar_t sk_leech_health3;
//cvar_t sk_leech_dmg_bite1;
//cvar_t sk_leech_dmg_bite2;
//cvar_t sk_leech_dmg_bite3;
//cvar_t sk_controller_health1;
//cvar_t sk_controller_health2;
//cvar_t sk_controller_health3;
//cvar_t sk_controller_dmgzap1;
//cvar_t sk_controller_dmgzap2;
//cvar_t sk_controller_dmgzap3;
//cvar_t sk_controller_speedball1;
//cvar_t sk_controller_speedball2;
//cvar_t sk_controller_speedball3;
//cvar_t sk_controller_dmgball1;
//cvar_t sk_controller_dmgball2;
//cvar_t sk_controller_dmgball3;
//cvar_t sk_nihilanth_health1;
//cvar_t sk_nihilanth_health2;
//cvar_t sk_nihilanth_health3;
//cvar_t sk_nihilanth_zap1;
//cvar_t sk_nihilanth_zap2;
//cvar_t sk_nihilanth_zap3;
//cvar_t sk_scientist_health1;
//cvar_t sk_scientist_health2;
//cvar_t sk_scientist_health3;
//cvar_t sk_snark_health1;
//cvar_t sk_snark_health2;
//cvar_t sk_snark_health3;
//cvar_t sk_snark_dmg_bite1;
//cvar_t sk_snark_dmg_bite2;
//cvar_t sk_snark_dmg_bite3;
//cvar_t sk_snark_dmg_pop1;
//cvar_t sk_snark_dmg_pop2;
//cvar_t sk_snark_dmg_pop3;
//cvar_t sk_zombie_health1;
//cvar_t sk_zombie_health2;
//cvar_t sk_zombie_health3;
//cvar_t sk_zombie_dmg_one_slash1;
//cvar_t sk_zombie_dmg_one_slash2;
//cvar_t sk_zombie_dmg_one_slash3;
//cvar_t sk_zombie_dmg_both_slash1;
//cvar_t sk_zombie_dmg_both_slash2;
//cvar_t sk_zombie_dmg_both_slash3;
//cvar_t sk_turret_health1;
//cvar_t sk_turret_health2;
//cvar_t sk_turret_health3;
//cvar_t sk_miniturret_health1;
//cvar_t sk_miniturret_health2;
//cvar_t sk_miniturret_health3;
//cvar_t sk_sentry_health1;
//cvar_t sk_sentry_health2;
//cvar_t sk_sentry_health3;
//cvar_t sk_plr_crowbar1;
//cvar_t sk_plr_crowbar2;
//cvar_t sk_plr_crowbar3;
cvar_t sk_plr_9mm_bullet1;
cvar_t sk_plr_9mm_bullet2;
cvar_t sk_plr_9mm_bullet3;
cvar_t sk_plr_357_bullet1;
cvar_t sk_plr_357_bullet2;
cvar_t sk_plr_357_bullet3;
cvar_t sk_plr_9mmAR_bullet1;
cvar_t sk_plr_9mmAR_bullet2;
cvar_t sk_plr_9mmAR_bullet3;
cvar_t sk_plr_9mmAR_grenade1;
cvar_t sk_plr_9mmAR_grenade2;
cvar_t sk_plr_9mmAR_grenade3;
cvar_t sk_plr_buckshot1;
cvar_t sk_plr_buckshot2;
cvar_t sk_plr_buckshot3;
// NOXREF
//cvar_t sk_plr_xbow_bolt_client1;
//cvar_t sk_plr_xbow_bolt_client2;
//cvar_t sk_plr_xbow_bolt_client3;
//cvar_t sk_plr_xbow_bolt_monster1;
//cvar_t sk_plr_xbow_bolt_monster2;
//cvar_t sk_plr_xbow_bolt_monster3;
cvar_t sk_plr_rpg1;
cvar_t sk_plr_rpg2;
cvar_t sk_plr_rpg3;
// NOXREF
//cvar_t sk_plr_gauss1;
//cvar_t sk_plr_gauss2;
//cvar_t sk_plr_gauss3;
//cvar_t sk_plr_egon_narrow1;
//cvar_t sk_plr_egon_narrow2;
//cvar_t sk_plr_egon_narrow3;
//cvar_t sk_plr_egon_wide1;
//cvar_t sk_plr_egon_wide2;
//cvar_t sk_plr_egon_wide3;
//cvar_t sk_plr_hand_grenade1;
//cvar_t sk_plr_hand_grenade2;
//cvar_t sk_plr_hand_grenade3;
//cvar_t sk_plr_satchel1;
//cvar_t sk_plr_satchel2;
//cvar_t sk_plr_satchel3;
//cvar_t sk_plr_tripmine1;
//cvar_t sk_plr_tripmine2;
//cvar_t sk_plr_tripmine3;
cvar_t sk_12mm_bullet1;
cvar_t sk_12mm_bullet2;
cvar_t sk_12mm_bullet3;
cvar_t sk_9mmAR_bullet1;
cvar_t sk_9mmAR_bullet2;
cvar_t sk_9mmAR_bullet3;
cvar_t sk_9mm_bullet1;
cvar_t sk_9mm_bullet2;
cvar_t sk_9mm_bullet3;
// NOXREF
//cvar_t sk_hornet_dmg1;
//cvar_t sk_hornet_dmg2;
//cvar_t sk_hornet_dmg3;
cvar_t sk_suitcharger1;
cvar_t sk_suitcharger2;
cvar_t sk_suitcharger3;
cvar_t sk_battery1;
cvar_t sk_battery2;
cvar_t sk_battery3;
cvar_t sk_healthcharger1;
cvar_t sk_healthcharger2;
cvar_t sk_healthcharger3;
cvar_t sk_healthkit1;
cvar_t sk_healthkit2;
cvar_t sk_healthkit3;
cvar_t sk_scientist_heal1;
cvar_t sk_scientist_heal2;
cvar_t sk_scientist_heal3;
// NOXREF
//cvar_t sk_monster_head1;
//cvar_t sk_monster_head2;
//cvar_t sk_monster_head3;
//cvar_t sk_monster_chest1;
//cvar_t sk_monster_chest2;
//cvar_t sk_monster_chest3;
//cvar_t sk_monster_stomach1;
//cvar_t sk_monster_stomach2;
//cvar_t sk_monster_stomach3;
//cvar_t sk_monster_arm1;
//cvar_t sk_monster_arm2;
//cvar_t sk_monster_arm3;
//cvar_t sk_monster_leg1;
//cvar_t sk_monster_leg2;
//cvar_t sk_monster_leg3;
//cvar_t sk_player_head1;
//cvar_t sk_player_head2;
//cvar_t sk_player_head3;
//cvar_t sk_player_chest1;
//cvar_t sk_player_chest2;
//cvar_t sk_player_chest3;
//cvar_t sk_player_stomach1;
//cvar_t sk_player_stomach2;
//cvar_t sk_player_stomach3;
//cvar_t sk_player_arm1;
//cvar_t sk_player_arm2;
//cvar_t sk_player_arm3;
//cvar_t sk_player_leg1;
//cvar_t sk_player_leg2;
//cvar_t sk_player_leg3;
#endif // HOOK_GAMEDLL
#ifdef REGAMEDLL_ADD
@ -411,7 +101,7 @@ cvar_t round_infinite = { "mp_round_infinite", "0", FCVAR_SERVER, 0.0f, NULL };
#endif // REGAMEDLL_ADD
void GameDLL_Version_f(void)
void GameDLL_Version_f()
{
if (Q_stricmp(CMD_ARGV(1), "version") != 0)
return;
@ -422,8 +112,10 @@ void GameDLL_Version_f(void)
}
/* <9c900> ../cstrike/dlls/game.cpp:500 */
void EXT_FUNC GameDLLInit(void)
void EXT_FUNC GameDLLInit()
{
g_bIsCzeroGame = UTIL_IsGame("czero");
g_psv_gravity = CVAR_GET_POINTER("sv_gravity");
g_psv_aim = CVAR_GET_POINTER("sv_aim");
g_footsteps = CVAR_GET_POINTER("mp_footsteps");
@ -468,6 +160,9 @@ void EXT_FUNC GameDLLInit(void)
CVAR_REGISTER(&fragsleft);
CVAR_REGISTER(&timeleft);
CVAR_REGISTER(&humans_join_team);
// Remove unused cvars
#ifndef REGAMEDLL_FIXES
CVAR_REGISTER(&sk_plr_9mm_bullet1);
CVAR_REGISTER(&sk_plr_9mm_bullet2);
CVAR_REGISTER(&sk_plr_9mm_bullet3);
@ -510,6 +205,7 @@ void EXT_FUNC GameDLLInit(void)
CVAR_REGISTER(&sk_scientist_heal1);
CVAR_REGISTER(&sk_scientist_heal2);
CVAR_REGISTER(&sk_scientist_heal3);
#endif // REGAMEDLL_FIXES
#ifdef REGAMEDLL_ADD

View File

@ -44,96 +44,6 @@
#define PLAYERID_TEAMONLY 1
#define PLAYERID_OFF 2
#ifdef HOOK_GAMEDLL
#define g_psv_gravity (*pg_psv_gravity)
#define g_psv_aim (*pg_psv_aim)
#define g_footsteps (*pg_footsteps)
#define g_psv_accelerate (*pg_psv_accelerate)
#define g_psv_friction (*pg_psv_friction)
#define g_psv_stopspeed (*pg_psv_stopspeed)
#define displaysoundlist (*pdisplaysoundlist)
#define timelimit (*ptimelimit)
#define flashlight (*pflashlight)
#define decalfrequency (*pdecalfrequency)
#define fadetoblack (*pfadetoblack)
#define fragsleft (*pfragsleft)
#define timeleft (*ptimeleft)
#define friendlyfire (*pfriendlyfire)
#define allowmonsters (*pallowmonsters)
#define roundtime (*proundtime)
#define buytime (*pbuytime)
#define freezetime (*pfreezetime)
#define c4timer (*pc4timer)
#define ghostfrequency (*pghostfrequency)
#define autokick (*pautokick)
#define autokick_timeout (*pautokick_timeout)
#define restartround (*prestartround)
#define sv_restart (*psv_restart)
#define limitteams (*plimitteams)
#define autoteambalance (*pautoteambalance)
#define tkpunish (*ptkpunish)
#define hostagepenalty (*phostagepenalty)
#define mirrordamage (*pmirrordamage)
#define logmessages (*plogmessages)
#define forcecamera (*pforcecamera)
#define forcechasecam (*pforcechasecam)
#define mapvoteratio (*pmapvoteratio)
#define logdetail (*plogdetail)
#define startmoney (*pstartmoney)
#define maxrounds (*pmaxrounds)
#define winlimit (*pwinlimit)
#define windifference (*pwindifference)
#define playerid (*pplayerid)
#define allow_spectators (*pallow_spectators)
#define mp_chattime (*pmp_chattime)
#define kick_percent (*pkick_percent)
#define humans_join_team (*phumans_join_team)
#define sk_plr_9mm_bullet1 (*psk_plr_9mm_bullet1)
#define sk_plr_9mm_bullet2 (*psk_plr_9mm_bullet2)
#define sk_plr_9mm_bullet3 (*psk_plr_9mm_bullet3)
#define sk_plr_357_bullet1 (*psk_plr_357_bullet1)
#define sk_plr_357_bullet2 (*psk_plr_357_bullet2)
#define sk_plr_357_bullet3 (*psk_plr_357_bullet3)
#define sk_plr_9mmAR_bullet1 (*psk_plr_9mmAR_bullet1)
#define sk_plr_9mmAR_bullet2 (*psk_plr_9mmAR_bullet2)
#define sk_plr_9mmAR_bullet3 (*psk_plr_9mmAR_bullet3)
#define sk_plr_9mmAR_grenade1 (*psk_plr_9mmAR_grenade1)
#define sk_plr_9mmAR_grenade2 (*psk_plr_9mmAR_grenade2)
#define sk_plr_9mmAR_grenade3 (*psk_plr_9mmAR_grenade3)
#define sk_plr_buckshot1 (*psk_plr_buckshot1)
#define sk_plr_buckshot2 (*psk_plr_buckshot2)
#define sk_plr_buckshot3 (*psk_plr_buckshot3)
#define sk_plr_rpg1 (*psk_plr_rpg1)
#define sk_plr_rpg2 (*psk_plr_rpg2)
#define sk_plr_rpg3 (*psk_plr_rpg3)
#define sk_12mm_bullet1 (*psk_12mm_bullet1)
#define sk_12mm_bullet2 (*psk_12mm_bullet2)
#define sk_12mm_bullet3 (*psk_12mm_bullet3)
#define sk_9mmAR_bullet1 (*psk_9mmAR_bullet1)
#define sk_9mmAR_bullet2 (*psk_9mmAR_bullet2)
#define sk_9mmAR_bullet3 (*psk_9mmAR_bullet3)
#define sk_9mm_bullet1 (*psk_9mm_bullet1)
#define sk_9mm_bullet2 (*psk_9mm_bullet2)
#define sk_9mm_bullet3 (*psk_9mm_bullet3)
#define sk_suitcharger1 (*psk_suitcharger1)
#define sk_suitcharger2 (*psk_suitcharger2)
#define sk_suitcharger3 (*psk_suitcharger3)
#define sk_battery1 (*psk_battery1)
#define sk_battery2 (*psk_battery2)
#define sk_battery3 (*psk_battery3)
#define sk_healthcharger1 (*psk_healthcharger1)
#define sk_healthcharger2 (*psk_healthcharger2)
#define sk_healthcharger3 (*psk_healthcharger3)
#define sk_healthkit1 (*psk_healthkit1)
#define sk_healthkit2 (*psk_healthkit2)
#define sk_healthkit3 (*psk_healthkit3)
#define sk_scientist_heal1 (*psk_scientist_heal1)
#define sk_scientist_heal2 (*psk_scientist_heal2)
#define sk_scientist_heal3 (*psk_scientist_heal3)
#endif // HOOK_GAMEDLL
extern cvar_t *g_psv_gravity;
extern cvar_t *g_psv_aim;
extern cvar_t *g_footsteps;
@ -228,6 +138,6 @@ extern cvar_t round_infinite;
#endif // REGAMEDLL_ADD
void GameDLLInit(void);
void GameDLLInit();
#endif // GAME_H

View File

@ -7,10 +7,6 @@
CHalfLifeMultiplay *g_pGameRules = NULL;
#else //HOOK_GAMEDLL
CHalfLifeMultiplay *g_pGameRules;
#endif //HOOK_GAMEDLL
/* <ad93d> ../cstrike/dlls/gamerules.cpp:36 */
@ -101,7 +97,7 @@ BOOL CGameRules::__MAKE_VHOOK(CanHavePlayerItem)(CBasePlayer *pPlayer, CBasePlay
}
/* <ad85d> ../cstrike/dlls/gamerules.cpp:119 */
void CGameRules::__MAKE_VHOOK(RefreshSkillData)(void)
void CGameRules::__MAKE_VHOOK(RefreshSkillData)()
{
int iSkill = (int)CVAR_GET_FLOAT("skill");
@ -124,7 +120,7 @@ void CGameRules::__MAKE_VHOOK(RefreshSkillData)(void)
}
/* <ada23> ../cstrike/dlls/gamerules.cpp:157 */
CGameRules *InstallGameRules(void)
CGameRules *InstallGameRules()
{
SERVER_COMMAND("exec game.cfg\n");
SERVER_EXECUTE();
@ -134,27 +130,3 @@ CGameRules *InstallGameRules(void)
return new CHalfLifeMultiplay;
}
#ifdef HOOK_GAMEDLL
void CGameRules::RefreshSkillData(void)
{
RefreshSkillData_();
}
edict_t *CGameRules::GetPlayerSpawnSpot(CBasePlayer *pPlayer)
{
return GetPlayerSpawnSpot_(pPlayer);
}
BOOL CGameRules::CanHavePlayerItem(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon)
{
return CanHavePlayerItem_(pPlayer, pWeapon);
}
BOOL CGameRules::CanHaveAmmo(CBasePlayer *pPlayer, const char *pszAmmoName, int iMaxCarry)
{
return CanHaveAmmo_(pPlayer, pszAmmoName, iMaxCarry);
}
#endif // HOOK_GAMEDLL

View File

@ -265,11 +265,9 @@ public:
#endif // HOOK_GAMEDLL
public:
//int **_vptr.CGameRules;
BOOL m_bFreezePeriod;
BOOL m_bBombDropped;
};/* size: 12, cachelines: 1, members: 3 */
};
class CHalfLifeRules: public CGameRules
{
@ -361,8 +359,7 @@ public:
BOOL FAllowMonsters_();
#endif // HOOK_GAMEDLL
};/* size: 12, cachelines: 1, members: 1 */
};
class CHalfLifeMultiplay: public CGameRules
{
@ -654,9 +651,8 @@ protected:
int m_iCareerMatchWins;
int m_iRoundWinDifference;
float m_fCareerMatchMenuTime;
bool m_bSkipSpawn;//712
};/* size: 708, cachelines: 12, members: 76 */
bool m_bSkipSpawn;
};
typedef struct mapcycle_item_s
{
@ -667,7 +663,6 @@ typedef struct mapcycle_item_s
char rulebuffer[MAX_RULE_BUFFER];
} mapcycle_item_t;
/* size: 1068, cachelines: 17, members: 5 */
typedef struct mapcycle_s
{
@ -675,7 +670,6 @@ typedef struct mapcycle_s
struct mapcycle_item_s *next_item;
} mapcycle_t;
/* size: 8, cachelines: 1, members: 2 */
/* <11192b> ../cstrike/dlls/multiplay_gamerules.cpp:257 */
class CMapInfo: public CPointEntity
@ -694,8 +688,7 @@ public:
public:
int m_iBuyingStatus;
float m_flBombRadius;
};/* size: 160, cachelines: 3, members: 3 */
};
/* <111732> ../cstrike/dlls/multiplay_gamerules.cpp:292 */
class CCStrikeGameMgrHelper: public IVoiceGameMgrHelper
@ -709,30 +702,12 @@ public:
#endif // HOOK_GAMEDLL
};/* size: 4, cachelines: 1, members: 1 */
#ifdef HOOK_GAMEDLL
#define g_pGameRules (*pg_pGameRules)
#define g_GameMgrHelper (*pg_GameMgrHelper)
#define sv_clienttrace (*psv_clienttrace)
#define g_pMPGameRules (*pg_pMPGameRules)
#define mp_com_token (*pmp_com_token)
#endif // HOOK_GAMEDLL
};
extern CHalfLifeMultiplay *g_pGameRules;
extern CCStrikeGameMgrHelper g_GameMgrHelper;
extern cvar_t *sv_clienttrace;
extern CHalfLifeMultiplay *g_pMPGameRules;
extern char mp_com_token[ COM_TOKEN_LEN ];
CGameRules *InstallGameRules();
/*
* Multiplay gamerules
*/
bool IsBotSpeaking();
void SV_Continue_f();
void SV_Tutor_Toggle_f();
@ -755,11 +730,4 @@ int CountPlayers();
void ExtractCommandString(char *s, char *szCommand);
int GetMapCount();
#ifdef HOOK_GAMEDLL
// linked objects
C_DLLEXPORT void info_map_parameters(entvars_t *pev);
#endif // HOOK_GAMEDLL
#endif // GAMERULES_H

View File

@ -24,10 +24,6 @@ TYPEDESCRIPTION CGrenade::m_SaveData[] =
DEFINE_FIELD(CGrenade, m_usEvent, FIELD_INTEGER),
};
#else // HOOK_GAMEDLL
TYPEDESCRIPTION IMPL_CLASS(CGrenade, m_SaveData)[15];
#endif // HOOK_GAMEDLL
/* <b8dad> ../cstrike/dlls/ggrenade.cpp:52 */
@ -55,7 +51,7 @@ void CGrenade::Explode(TraceResult *pTrace, int bitsDamageType)
// Pull out of the wall a bit
if (pTrace->flFraction != 1.0f)
{
pev->origin = pTrace->vecEndPos + (pTrace->vecPlaneNormal * (pev->dmg - 24) * 0.6);
pev->origin = pTrace->vecEndPos + (pTrace->vecPlaneNormal * (pev->dmg - 24.0f) * 0.6f);
}
int iContents = UTIL_PointContents(pev->origin);
@ -77,7 +73,7 @@ void CGrenade::Explode(TraceResult *pTrace, int bitsDamageType)
RadiusFlash(pev->origin, pev, pevOwner, 4, CLASS_NONE, bitsDamageType);
if (RANDOM_FLOAT(0, 1) < 0.5)
if (RANDOM_FLOAT(0, 1) < 0.5f)
UTIL_DecalTrace(pTrace, DECAL_SCORCH1);
else
UTIL_DecalTrace(pTrace, DECAL_SCORCH2);
@ -94,7 +90,7 @@ void CGrenade::Explode(TraceResult *pTrace, int bitsDamageType)
pev->effects |= EF_NODRAW;
SetThink(&CGrenade::Smoke);
pev->velocity = g_vecZero;
pev->nextthink = gpGlobals->time + 0.3;
pev->nextthink = gpGlobals->time + 0.3f;
if (iContents != CONTENTS_WATER)
{
@ -133,7 +129,7 @@ void CGrenade::Explode2(TraceResult *pTrace, int bitsDamageType)
// Pull out of the wall a bit
if (pTrace->flFraction != 1.0f)
{
pev->origin = pTrace->vecEndPos + (pTrace->vecPlaneNormal * (pev->dmg - 24) * 0.6);
pev->origin = pTrace->vecEndPos + (pTrace->vecPlaneNormal * (pev->dmg - 24.0f) * 0.6f);
}
int iContents = UTIL_PointContents(pev->origin);
@ -142,9 +138,9 @@ void CGrenade::Explode2(TraceResult *pTrace, int bitsDamageType)
WRITE_BYTE(TE_SPRITE);
WRITE_COORD(pev->origin.x);
WRITE_COORD(pev->origin.y);
WRITE_COORD(pev->origin.z - 10);
WRITE_COORD(pev->origin.z - 10.0f);
WRITE_SHORT(g_sModelIndexFireball3);
WRITE_BYTE((pev->dmg - 275) * 0.6);
WRITE_BYTE((pev->dmg - 275.0f) * 0.6f);
WRITE_BYTE(150);
MESSAGE_END();
@ -154,7 +150,7 @@ void CGrenade::Explode2(TraceResult *pTrace, int bitsDamageType)
WRITE_COORD(pev->origin.y + RANDOM_FLOAT(-512, 512));
WRITE_COORD(pev->origin.z + RANDOM_FLOAT(-10, 10));
WRITE_SHORT(g_sModelIndexFireball2);
WRITE_BYTE((pev->dmg - 275) * 0.6);
WRITE_BYTE((pev->dmg - 275.0f) * 0.6f);
WRITE_BYTE(150);
MESSAGE_END();
@ -164,7 +160,7 @@ void CGrenade::Explode2(TraceResult *pTrace, int bitsDamageType)
WRITE_COORD(pev->origin.y + RANDOM_FLOAT(-512, 512));
WRITE_COORD(pev->origin.z + RANDOM_FLOAT(-10, 10));
WRITE_SHORT(g_sModelIndexFireball3);
WRITE_BYTE((pev->dmg - 275) * 0.6);
WRITE_BYTE((pev->dmg - 275.0f) * 0.6f);
WRITE_BYTE(150);
MESSAGE_END();
@ -174,7 +170,7 @@ void CGrenade::Explode2(TraceResult *pTrace, int bitsDamageType)
WRITE_COORD(pev->origin.y + RANDOM_FLOAT(-512, 512));
WRITE_COORD(pev->origin.z + RANDOM_FLOAT(-10, 10));
WRITE_SHORT(g_sModelIndexFireball);
WRITE_BYTE((pev->dmg - 275) * 0.6);
WRITE_BYTE((pev->dmg - 275.0f) * 0.6f);
WRITE_BYTE(17);
MESSAGE_END();
@ -210,7 +206,7 @@ void CGrenade::Explode2(TraceResult *pTrace, int bitsDamageType)
MESSAGE_END();
// Decal!
if (RANDOM_FLOAT(0, 1) < 0.5)
if (RANDOM_FLOAT(0, 1) < 0.5f)
UTIL_DecalTrace(pTrace, DECAL_SCORCH1);
else
UTIL_DecalTrace(pTrace, DECAL_SCORCH2);
@ -228,7 +224,7 @@ void CGrenade::Explode2(TraceResult *pTrace, int bitsDamageType)
pev->effects |= EF_NODRAW;
SetThink(&CGrenade::Smoke2);
pev->velocity = g_vecZero;
pev->nextthink = gpGlobals->time + 0.85;
pev->nextthink = gpGlobals->time + 0.85f;
if (iContents != CONTENTS_WATER)
{
@ -251,14 +247,14 @@ void CGrenade::Explode3(TraceResult *pTrace, int bitsDamageType)
if (pTrace->flFraction != 1.0f)
{
pev->origin = pTrace->vecEndPos + (pTrace->vecPlaneNormal * (pev->dmg - 24) * 0.6);
pev->origin = pTrace->vecEndPos + (pTrace->vecPlaneNormal * (pev->dmg - 24.0f) * 0.6f);
}
MESSAGE_BEGIN(MSG_PAS, SVC_TEMPENTITY, pev->origin);
WRITE_BYTE(TE_EXPLOSION); // This makes a dynamic light and the explosion sprites/sound
WRITE_COORD(pev->origin.x); // Send to PAS because of the sound
WRITE_COORD(pev->origin.y);
WRITE_COORD(pev->origin.z + 20);
WRITE_COORD(pev->origin.z + 20.0f);
WRITE_SHORT(g_sModelIndexFireball3);
WRITE_BYTE(25); // scale * 10
WRITE_BYTE(30); // framerate
@ -292,7 +288,7 @@ void CGrenade::Explode3(TraceResult *pTrace, int bitsDamageType)
pev->owner = NULL;
RadiusDamage(pev, pevOwner, pev->dmg, CLASS_NONE, bitsDamageType);
if (RANDOM_FLOAT(0, 1) < 0.5)
if (RANDOM_FLOAT(0, 1) < 0.5f)
UTIL_DecalTrace(pTrace, DECAL_SCORCH1);
else
UTIL_DecalTrace(pTrace, DECAL_SCORCH2);
@ -310,7 +306,7 @@ void CGrenade::Explode3(TraceResult *pTrace, int bitsDamageType)
pev->effects |= EF_NODRAW;
SetThink(&CGrenade::Smoke3_C);
pev->velocity = g_vecZero;
pev->nextthink = gpGlobals->time + 0.55;
pev->nextthink = gpGlobals->time + 0.55f;
int sparkCount = RANDOM_LONG(0, 3);
for (int i = 0; i < sparkCount; ++i)
@ -330,7 +326,7 @@ NOXREF void CGrenade::SG_Explode(TraceResult *pTrace, int bitsDamageType)
if (pTrace->flFraction != 1.0f)
{
pev->origin = pTrace->vecEndPos + (pTrace->vecPlaneNormal * (pev->dmg - 24) * 0.6);
pev->origin = pTrace->vecEndPos + (pTrace->vecPlaneNormal * (pev->dmg - 24.0f) * 0.6f);
}
int iContents = UTIL_PointContents(pev->origin);
@ -339,7 +335,7 @@ NOXREF void CGrenade::SG_Explode(TraceResult *pTrace, int bitsDamageType)
// can't traceline attack owner if this is set
pev->owner = NULL;
if (RANDOM_FLOAT(0, 1) < 0.5)
if (RANDOM_FLOAT(0, 1) < 0.5f)
UTIL_DecalTrace(pTrace, DECAL_SCORCH1);
else
UTIL_DecalTrace(pTrace, DECAL_SCORCH2);
@ -356,7 +352,7 @@ NOXREF void CGrenade::SG_Explode(TraceResult *pTrace, int bitsDamageType)
pev->effects |= EF_NODRAW;
SetThink(&CGrenade::Smoke);
pev->velocity = g_vecZero;
pev->nextthink = gpGlobals->time + 0.1;
pev->nextthink = gpGlobals->time + 0.1f;
if (iContents != CONTENTS_WATER)
{
@ -368,7 +364,7 @@ NOXREF void CGrenade::SG_Explode(TraceResult *pTrace, int bitsDamageType)
}
/* <b6c26> ../cstrike/dlls/ggrenade.cpp:475 */
void CGrenade::Smoke3_C(void)
void CGrenade::Smoke3_C()
{
if (UTIL_PointContents(pev->origin) == CONTENTS_WATER)
{
@ -380,7 +376,7 @@ void CGrenade::Smoke3_C(void)
WRITE_BYTE(TE_SMOKE);
WRITE_COORD(pev->origin.x);
WRITE_COORD(pev->origin.y);
WRITE_COORD(pev->origin.z - 5);
WRITE_COORD(pev->origin.z - 5.0f);
WRITE_SHORT(g_sModelIndexSmoke);
WRITE_BYTE(35 + RANDOM_FLOAT(0, 10)); // scale * 10
WRITE_BYTE(5); // framerate
@ -391,7 +387,7 @@ void CGrenade::Smoke3_C(void)
}
/* <b995d> ../cstrike/dlls/ggrenade.cpp:497 */
void CGrenade::Smoke3_B(void)
void CGrenade::Smoke3_B()
{
if (UTIL_PointContents(pev->origin) == CONTENTS_WATER)
{
@ -415,7 +411,7 @@ void CGrenade::Smoke3_B(void)
}
/* <b6b2a> ../cstrike/dlls/ggrenade.cpp:520 */
void CGrenade::Smoke3_A(void)
void CGrenade::Smoke3_A()
{
if (UTIL_PointContents(pev->origin) == CONTENTS_WATER)
{
@ -436,7 +432,7 @@ void CGrenade::Smoke3_A(void)
}
/* <b6a2e> ../cstrike/dlls/ggrenade.cpp:544 */
void CGrenade::Smoke2(void)
void CGrenade::Smoke2()
{
if (UTIL_PointContents(pev->origin) == CONTENTS_WATER)
{
@ -459,7 +455,7 @@ void CGrenade::Smoke2(void)
}
/* <b6932> ../cstrike/dlls/ggrenade.cpp:567 */
void CGrenade::Smoke(void)
void CGrenade::Smoke()
{
if (UTIL_PointContents(pev->origin) == CONTENTS_WATER)
{
@ -482,7 +478,7 @@ void CGrenade::Smoke(void)
}
/* <b6d22> ../cstrike/dlls/ggrenade.cpp:591 */
void CGrenade::SG_Smoke(void)
void CGrenade::SG_Smoke()
{
int iMaxSmokePuffs = 100;
float flSmokeInterval;
@ -517,7 +513,7 @@ void CGrenade::SG_Smoke(void)
if (m_SGSmoke <= 20)
{
pev->nextthink = gpGlobals->time + 1.0;
pev->nextthink = gpGlobals->time + 1.0f;
SetThink(&CGrenade::SG_Smoke);
++m_SGSmoke;
}
@ -549,16 +545,16 @@ void CGrenade::DetonateUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TY
}
/* <b9abf> ../cstrike/dlls/ggrenade.cpp:677 */
void CGrenade::PreDetonate(void)
void CGrenade::PreDetonate()
{
CSoundEnt::InsertSound(bits_SOUND_DANGER, pev->origin, 400, 0.3);
SetThink(&CGrenade::Detonate);
pev->nextthink = gpGlobals->time + 1;
pev->nextthink = gpGlobals->time + 1.0f;
}
/* <b789e> ../cstrike/dlls/ggrenade.cpp:686 */
void CGrenade::Detonate(void)
void CGrenade::Detonate()
{
TraceResult tr;
Vector vecSpot; // trace starts here!
@ -569,7 +565,7 @@ void CGrenade::Detonate(void)
}
/* <b7355> ../cstrike/dlls/ggrenade.cpp:698 */
void CGrenade::SG_Detonate(void)
void CGrenade::SG_Detonate()
{
TraceResult tr;
Vector vecSpot;
@ -617,12 +613,12 @@ void CGrenade::SG_Detonate(void)
pev->velocity.y = RANDOM_FLOAT(-175, 175);
pev->velocity.z = RANDOM_FLOAT(250, 350);
pev->nextthink = gpGlobals->time + 0.1;
pev->nextthink = gpGlobals->time + 0.1f;
SetThink(&CGrenade::SG_Smoke);
}
/* <b8009> ../cstrike/dlls/ggrenade.cpp:752 */
void CGrenade::Detonate2(void)
void CGrenade::Detonate2()
{
TraceResult tr;
Vector vecSpot;// trace starts here!
@ -634,7 +630,7 @@ void CGrenade::Detonate2(void)
}
/* <b7c81> ../cstrike/dlls/ggrenade.cpp:764 */
void CGrenade::Detonate3(void)
void CGrenade::Detonate3()
{
TraceResult tr;
Vector vecSpot;// trace starts here!
@ -654,13 +650,13 @@ void CGrenade::ExplodeTouch(CBaseEntity *pOther)
pev->enemy = pOther->edict();
vecSpot = pev->origin - pev->velocity.Normalize() * 32;
vecSpot = pev->origin - pev->velocity.Normalize() * 32.0f;
UTIL_TraceLine(vecSpot, vecSpot + pev->velocity.Normalize() * 64, ignore_monsters, ENT(pev), &tr);
Explode(&tr, DMG_BLAST);
}
/* <b7101> ../cstrike/dlls/ggrenade.cpp:794 */
void CGrenade::DangerSoundThink(void)
void CGrenade::DangerSoundThink()
{
if (!IsInWorld())
{
@ -669,11 +665,11 @@ void CGrenade::DangerSoundThink(void)
}
CSoundEnt::InsertSound(bits_SOUND_DANGER, pev->origin + pev->velocity * 0.5, pev->velocity.Length(), 0.2);
pev->nextthink = gpGlobals->time + 0.2;
pev->nextthink = gpGlobals->time + 0.2f;
if (pev->waterlevel != 0)
{
pev->velocity = pev->velocity * 0.5;
pev->velocity = pev->velocity * 0.5f;
}
}
@ -686,7 +682,7 @@ void CGrenade::BounceTouch(CBaseEntity *pOther)
if (FClassnameIs(pOther->pev, "func_breakable") && pOther->pev->rendermode != kRenderNormal)
{
pev->velocity = pev->velocity * -2;
pev->velocity = pev->velocity * -2.0f;
return;
}
@ -696,22 +692,22 @@ void CGrenade::BounceTouch(CBaseEntity *pOther)
// or thrown very far tend to slow down too quickly for me to always catch just by testing velocity.
// trimming the Z velocity a bit seems to help quite a bit.
vecTestVelocity = pev->velocity;
vecTestVelocity.z *= 0.7;
vecTestVelocity.z *= 0.7f;
if (!m_fRegisteredSound && vecTestVelocity.Length() <= 60)
if (!m_fRegisteredSound && vecTestVelocity.Length() <= 60.0f)
{
// grenade is moving really slow. It's probably very close to where it will ultimately stop moving.
// go ahead and emit the danger sound.
// register a radius louder than the explosion, so we make sure everyone gets out of the way
CSoundEnt::InsertSound(bits_SOUND_DANGER, pev->origin, pev->dmg / 0.4, 0.3);
CSoundEnt::InsertSound(bits_SOUND_DANGER, pev->origin, pev->dmg / 0.4f, 0.3);
m_fRegisteredSound = TRUE;
}
if (pev->flags & FL_ONGROUND)
{
// add a bit of static friction
pev->velocity = pev->velocity * 0.8;
pev->velocity = pev->velocity * 0.8f;
pev->sequence = RANDOM_LONG(1, 1); // TODO: what?
}
else
@ -732,15 +728,15 @@ void CGrenade::BounceTouch(CBaseEntity *pOther)
++m_iBounceCount;
}
pev->framerate = pev->velocity.Length() / 200;
pev->framerate = pev->velocity.Length() / 200.0f;
if (pev->framerate > 1)
{
pev->framerate = 1;
pev->framerate = 1.0f;
}
else if (pev->framerate < 0.5)
else if (pev->framerate < 0.5f)
{
pev->framerate = 0;
pev->framerate = 0.0f;
}
}
@ -754,7 +750,7 @@ void CGrenade::SlideTouch(CBaseEntity *pOther)
if (pev->flags & FL_ONGROUND)
{
// add a bit of static friction
pev->velocity = pev->velocity * 0.95;
pev->velocity = pev->velocity * 0.95f;
}
else
{
@ -763,9 +759,9 @@ void CGrenade::SlideTouch(CBaseEntity *pOther)
}
/* <b7b20> ../cstrike/dlls/ggrenade.cpp:904 */
void CGrenade::__MAKE_VHOOK(BounceSound)(void)
void CGrenade::__MAKE_VHOOK(BounceSound)()
{
if (pev->dmg > 50)
if (pev->dmg > 50.0f)
{
EMIT_SOUND(ENT(pev), CHAN_VOICE, "weapons/he_bounce-1.wav", 0.25, ATTN_NORM);
return;
@ -780,7 +776,7 @@ void CGrenade::__MAKE_VHOOK(BounceSound)(void)
}
/* <b6f28> ../cstrike/dlls/ggrenade.cpp:919 */
void CGrenade::TumbleThink(void)
void CGrenade::TumbleThink()
{
if (!IsInWorld())
{
@ -789,7 +785,7 @@ void CGrenade::TumbleThink(void)
}
StudioFrameAdvance();
pev->nextthink = gpGlobals->time + 0.1;
pev->nextthink = gpGlobals->time + 0.1f;
if (pev->dmgtime - 1 < gpGlobals->time)
{
@ -798,7 +794,7 @@ void CGrenade::TumbleThink(void)
if (pev->dmgtime <= gpGlobals->time)
{
if (pev->dmg <= 40)
if (pev->dmg <= 40.0f)
{
SetThink(&CGrenade::Detonate);
}
@ -808,13 +804,13 @@ void CGrenade::TumbleThink(void)
if (pev->waterlevel != 0)
{
pev->velocity = pev->velocity * 0.5;
pev->framerate = 0.2;
pev->velocity = pev->velocity * 0.5f;
pev->framerate = 0.2f;
}
}
/* <b67e7> ../cstrike/dlls/ggrenade.cpp:949 */
void CGrenade::SG_TumbleThink(void)
void CGrenade::SG_TumbleThink()
{
if (!IsInWorld())
{
@ -824,11 +820,11 @@ void CGrenade::SG_TumbleThink(void)
if (pev->flags & FL_ONGROUND)
{
pev->velocity = pev->velocity * 0.95;
pev->velocity = pev->velocity * 0.95f;
}
StudioFrameAdvance();
pev->nextthink = gpGlobals->time + 0.1;
pev->nextthink = gpGlobals->time + 0.1f;
if (pev->dmgtime - 1 < gpGlobals->time)
{
@ -845,13 +841,13 @@ void CGrenade::SG_TumbleThink(void)
if (pev->waterlevel != 0)
{
pev->velocity = pev->velocity * 0.5;
pev->framerate = 0.2;
pev->velocity = pev->velocity * 0.5f;
pev->framerate = 0.2f;
}
}
/* <b7010> ../cstrike/dlls/ggrenade.cpp:985 */
void CGrenade::__MAKE_VHOOK(Spawn)(void)
void CGrenade::__MAKE_VHOOK(Spawn)()
{
m_iBounceCount = 0;
pev->movetype = MOVETYPE_BOUNCE;
@ -870,7 +866,7 @@ void CGrenade::__MAKE_VHOOK(Spawn)(void)
SET_MODEL(ENT(pev), "models/grenade.mdl");
UTIL_SetSize(pev, Vector(0, 0, 0), Vector(0, 0, 0));
pev->dmg = 30;
pev->dmg = 30.0f;
m_fRegisteredSound = FALSE;
}
@ -881,7 +877,7 @@ NOXREF CGrenade *CGrenade::ShootContact(entvars_t *pevOwner, Vector vecStart, Ve
pGrenade->Spawn();
// contact grenades arc lower
pGrenade->pev->gravity = 0.5; // lower gravity since grenade is aerodynamic and engine doesn't know it.
pGrenade->pev->gravity = 0.5f; // lower gravity since grenade is aerodynamic and engine doesn't know it.
UTIL_SetOrigin(pGrenade->pev, vecStart);
pGrenade->pev->velocity = vecVelocity;
@ -920,20 +916,20 @@ CGrenade *CGrenade::ShootTimed2(entvars_t *pevOwner, Vector vecStart, Vector vec
pGrenade->pev->dmgtime = gpGlobals->time + time;
pGrenade->SetThink(&CGrenade::TumbleThink);
pGrenade->pev->nextthink = gpGlobals->time + 0.1;
pGrenade->pev->nextthink = gpGlobals->time + 0.1f;
pGrenade->pev->sequence = RANDOM_LONG(3, 6);
pGrenade->pev->framerate = 1.0;
pGrenade->pev->framerate = 1.0f;
pGrenade->m_bJustBlew = true;
pGrenade->pev->gravity = 0.55;
pGrenade->pev->friction = 0.7;
pGrenade->pev->gravity = 0.55f;
pGrenade->pev->friction = 0.7f;
pGrenade->m_iTeam = iTeam;
SET_MODEL(ENT(pGrenade->pev), "models/w_hegrenade.mdl");
pGrenade->pev->dmg = 100;
pGrenade->pev->dmg = 100.0f;
return pGrenade;
}
@ -958,24 +954,24 @@ CGrenade *CGrenade::ShootTimed(entvars_t *pevOwner, Vector vecStart, Vector vecV
pGrenade->pev->dmgtime = gpGlobals->time + time;
pGrenade->SetThink(&CGrenade::TumbleThink);
pGrenade->pev->nextthink = gpGlobals->time + 0.1;
pGrenade->pev->nextthink = gpGlobals->time + 0.1f;
if (time < 0.1)
if (time < 0.1f)
{
pGrenade->pev->nextthink = gpGlobals->time;
pGrenade->pev->velocity = Vector(0, 0, 0);
}
pGrenade->pev->sequence = RANDOM_LONG(3, 6);
pGrenade->pev->framerate = 1.0;
pGrenade->pev->framerate = 1.0f;
pGrenade->m_bJustBlew = true;
pGrenade->pev->gravity = 0.5;
pGrenade->pev->friction = 0.8;
pGrenade->pev->gravity = 0.5f;
pGrenade->pev->friction = 0.8f;
SET_MODEL(ENT(pGrenade->pev), "models/w_flashbang.mdl");
pGrenade->pev->dmg = 35;
pGrenade->pev->dmg = 35.0f;
return pGrenade;
}
@ -1030,8 +1026,8 @@ void CGrenade::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller,
player->m_bIsDefusing = true;
m_pBombDefuser = pActivator;
m_bStartDefuse = true;
m_flDefuseCountDown = gpGlobals->time + 5;
m_fNextDefuse = gpGlobals->time + 0.5;
m_flDefuseCountDown = gpGlobals->time + 5.0f;
m_fNextDefuse = gpGlobals->time + 0.5f;
// start the progress bar
player->SetProgressBarTime(5);
@ -1050,8 +1046,8 @@ void CGrenade::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller,
player->m_bIsDefusing = true;
m_pBombDefuser = pActivator;
m_bStartDefuse = true;
m_flDefuseCountDown = gpGlobals->time + 10;
m_fNextDefuse = gpGlobals->time + 0.5;
m_flDefuseCountDown = gpGlobals->time + 10.0f;
m_fNextDefuse = gpGlobals->time + 0.5f;
// start the progress bar
player->SetProgressBarTime(10);
@ -1077,7 +1073,7 @@ CGrenade *CGrenade::ShootSatchelCharge(entvars_t *pevOwner, Vector vecStart, Vec
UTIL_SetSize(pGrenade->pev, Vector(-3, -6, 0), Vector(3, 6, 8));
pGrenade->pev->dmg = 100;
pGrenade->pev->dmg = 100.0f;
UTIL_SetOrigin(pGrenade->pev, vecStart);
pGrenade->pev->velocity = g_vecZero;
pGrenade->pev->angles = vecAngles;
@ -1088,7 +1084,7 @@ CGrenade *CGrenade::ShootSatchelCharge(entvars_t *pevOwner, Vector vecStart, Vec
pGrenade->SetTouch(&CGrenade::C4Touch);
pGrenade->pev->spawnflags = SF_DETONATE;
pGrenade->pev->nextthink = gpGlobals->time + 0.1;
pGrenade->pev->nextthink = gpGlobals->time + 0.1f;
pGrenade->m_flC4Blow = gpGlobals->time + g_pGameRules->m_iC4Timer;
pGrenade->m_flNextFreqInterval = (g_pGameRules->m_iC4Timer / 4);
pGrenade->m_flNextFreq = gpGlobals->time;
@ -1096,18 +1092,18 @@ CGrenade *CGrenade::ShootSatchelCharge(entvars_t *pevOwner, Vector vecStart, Vec
pGrenade->m_iCurWave = 0;
pGrenade->m_fAttenu = 0;
pGrenade->m_sBeepName = NULL;
pGrenade->m_flNextBeep = gpGlobals->time + 0.5;
pGrenade->m_flNextBeep = gpGlobals->time + 0.5f;
pGrenade->m_bIsC4 = true;
pGrenade->m_fNextDefuse = 0;
pGrenade->m_bStartDefuse = false;
pGrenade->m_flNextBlink = gpGlobals->time + 2;
pGrenade->m_flNextBlink = gpGlobals->time + 2.0f;
pGrenade->pev->friction = 0.9;
pGrenade->pev->friction = 0.9f;
pGrenade->m_bJustBlew = false;
CBasePlayer *owner = reinterpret_cast<CBasePlayer *>(CBasePlayer::Instance(pevOwner));
CBasePlayer *owner = dynamic_cast<CBasePlayer *>(CBasePlayer::Instance(pevOwner));
if (owner && owner->IsPlayer())
if (owner != NULL && owner->IsPlayer())
{
pGrenade->m_pentCurBombTarget = owner->m_pentCurBombTarget;
}
@ -1133,7 +1129,7 @@ CGrenade *CGrenade::ShootSmokeGrenade(entvars_t *pevOwner, Vector vecStart, Vect
pGrenade->SetTouch(&CGrenade::BounceTouch);
pGrenade->pev->dmgtime = gpGlobals->time + time;
pGrenade->SetThink(&CGrenade::SG_TumbleThink);
pGrenade->pev->nextthink = gpGlobals->time + 0.1;
pGrenade->pev->nextthink = gpGlobals->time + 0.1f;
if (time < 0.1)
{
@ -1142,14 +1138,14 @@ CGrenade *CGrenade::ShootSmokeGrenade(entvars_t *pevOwner, Vector vecStart, Vect
}
pGrenade->pev->sequence = RANDOM_LONG(3, 6);
pGrenade->pev->framerate = 1;
pGrenade->pev->framerate = 1.0f;
pGrenade->m_bJustBlew = true;
pGrenade->pev->gravity = 0.5;
pGrenade->pev->friction = 0.8;
pGrenade->pev->gravity = 0.5f;
pGrenade->pev->friction = 0.8f;
pGrenade->m_SGSmoke = 0;
SET_MODEL(ENT(pGrenade->pev), "models/w_smokegrenade.mdl");
pGrenade->pev->dmg = 35;
pGrenade->pev->dmg = 35.0f;
return pGrenade;
}
@ -1157,7 +1153,7 @@ CGrenade *CGrenade::ShootSmokeGrenade(entvars_t *pevOwner, Vector vecStart, Vect
/* <b5701> ../cstrike/dlls/ggrenade.cpp:1284 */
void AnnounceFlashInterval(float interval, float offset)
{
if (!UTIL_IsGame("czero"))
if (!g_bIsCzeroGame)
return;
MESSAGE_BEGIN(MSG_ALL, gmsgScenarioIcon);
@ -1170,7 +1166,7 @@ void AnnounceFlashInterval(float interval, float offset)
}
/* <b855a> ../cstrike/dlls/ggrenade.cpp:1300 */
void CGrenade::C4Think(void)
void CGrenade::C4Think()
{
if (!IsInWorld())
{
@ -1178,42 +1174,42 @@ void CGrenade::C4Think(void)
return;
}
pev->nextthink = gpGlobals->time + 0.12;
pev->nextthink = gpGlobals->time + 0.12f;
if (gpGlobals->time >= m_flNextFreq)
{
m_flNextFreq = gpGlobals->time + m_flNextFreqInterval;
m_flNextFreqInterval *= 0.9;
m_flNextFreqInterval *= 0.9f;
switch (m_iCurWave)
{
case 0:
m_sBeepName = "weapons/c4_beep1.wav";
m_fAttenu = 1.5;
m_fAttenu = 1.5f;
AnnounceFlashInterval(139);
break;
case 1:
m_sBeepName = "weapons/c4_beep2.wav";
m_fAttenu = 1.0;
m_fAttenu = 1.0f;
AnnounceFlashInterval(69, 10);
break;
case 2:
m_sBeepName = "weapons/c4_beep3.wav";
m_fAttenu = 0.8;
m_fAttenu = 0.8f;
AnnounceFlashInterval(40);
break;
case 3:
m_sBeepName = "weapons/c4_beep4.wav";
m_fAttenu = 0.5;
m_fAttenu = 0.5f;
AnnounceFlashInterval(30);
break;
case 4:
m_sBeepName = "weapons/c4_beep5.wav";
m_fAttenu = 0.2;
m_fAttenu = 0.2f;
AnnounceFlashInterval(20);
break;
@ -1237,13 +1233,13 @@ void CGrenade::C4Think(void)
if (gpGlobals->time >= m_flNextBlink)
{
m_flNextBlink = gpGlobals->time + 2;
m_flNextBlink = gpGlobals->time + 2.0f;
MESSAGE_BEGIN(MSG_PVS, SVC_TEMPENTITY, pev->origin);
WRITE_BYTE(TE_GLOWSPRITE);
WRITE_COORD(pev->origin.x);
WRITE_COORD(pev->origin.y);
WRITE_COORD(pev->origin.z + 5);
WRITE_COORD(pev->origin.z + 5.0f);
WRITE_SHORT(g_sModelIndexC4Glow);
WRITE_BYTE(1);
WRITE_BYTE(3);
@ -1273,10 +1269,10 @@ void CGrenade::C4Think(void)
}
}
CBasePlayer *pBombOwner = (CBasePlayer *)CBaseEntity::Instance(pev->owner);
CBasePlayer *pBombOwner = dynamic_cast<CBasePlayer *>(CBaseEntity::Instance(pev->owner));
if (pBombOwner != NULL)
{
pBombOwner->pev->frags += 3;
pBombOwner->pev->frags += 3.0f;
}
MESSAGE_BEGIN(MSG_ALL, gmsgBombPickup);
@ -1374,7 +1370,7 @@ void CGrenade::C4Think(void)
g_pGameRules->CheckWinConditions();
// give the defuser credit for defusing the bomb
m_pBombDefuser->pev->frags += 3;
m_pBombDefuser->pev->frags += 3.0f;
MESSAGE_BEGIN(MSG_ALL, gmsgBombPickup);
MESSAGE_END();
@ -1445,37 +1441,3 @@ NOXREF void CGrenade::UseSatchelCharges(entvars_t *pevOwner, SATCHELCODE code)
/* <b6ed7> ../cstrike/dlls/ggrenade.cpp:1579 */
IMPLEMENT_SAVERESTORE(CGrenade, CBaseMonster);
#ifdef HOOK_GAMEDLL
void CGrenade::Spawn(void)
{
Spawn_();
}
int CGrenade::Save(CSave &save)
{
Save_(save);
}
int CGrenade::Restore(CRestore &restore)
{
Restore_(restore);
}
void CGrenade::Killed(entvars_t *pevAttacker, int iGib)
{
Killed_(pevAttacker, iGib);
}
void CGrenade::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
void CGrenade::BounceSound(void)
{
BounceSound_();
}
#endif // HOOK_GAMEDLL

View File

@ -8,11 +8,6 @@
const Vector g_vecZero = Vector(0, 0, 0);
u_long g_ulFrameCount = 0;
#else // HOOK_GAMEDLL
const Vector g_vecZero;
u_long g_ulFrameCount;
#endif // HOOK_GAMEDLL
int g_Language;
@ -22,3 +17,4 @@ Vector g_vecAttackDir;
int g_iSkillLevel;
int gDisplayTitle;
BOOL g_fGameOver;
bool g_bIsCzeroGame = false;

View File

@ -32,21 +32,6 @@
#pragma once
#endif
#ifdef HOOK_GAMEDLL
#define g_vecZero (*pg_vecZero)
#define g_Language (*pg_Language)
#define g_ulFrameCount (*pg_ulFrameCount)
#define g_ulModelIndexEyes (*pg_ulModelIndexEyes)
#define g_vecAttackDir (*pg_vecAttackDir)
#define g_iSkillLevel (*pg_iSkillLevel)
#define gDisplayTitle (*pgDisplayTitle)
#define g_fGameOver (*pg_fGameOver)
#endif // HOOK_GAMEDLL
extern const Vector g_vecZero;
extern int g_Language;
@ -57,5 +42,6 @@ extern Vector g_vecAttackDir;
extern int g_iSkillLevel;
extern int gDisplayTitle;
extern BOOL g_fGameOver;
extern bool g_bIsCzeroGame;
#endif // GLOBALS_H

View File

@ -1,18 +1,7 @@
#include "precompiled.h"
/*
* Globals initialization
*/
#ifndef HOOK_GAMEDLL
BOOL g_fDrawLines = FALSE;
#else
BOOL g_fDrawLines;
#endif // HOOK_GAMEDLL
/* <c08f4> ../cstrike/dlls/h_ai.cpp:47 */
NOXREF BOOL FBoxVisible(entvars_t *pevLooker, entvars_t *pevTarget, Vector &vecTargetOrigin, float flSize)
{

View File

@ -14,10 +14,6 @@ TYPEDESCRIPTION CRecharge::m_SaveData[] =
DEFINE_FIELD(CRecharge, m_flSoundTime, FIELD_TIME),
};
#else
TYPEDESCRIPTION IMPL_CLASS(CRecharge, m_SaveData)[5];
#endif // HOOK_GAMEDLL
/* <c61e2> ../cstrike/dlls/h_battery.cpp:61 */
@ -47,7 +43,7 @@ void CRecharge::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
}
/* <c616f> ../cstrike/dlls/h_battery.cpp:85 */
void CRecharge::__MAKE_VHOOK(Spawn)(void)
void CRecharge::__MAKE_VHOOK(Spawn)()
{
Precache();
@ -64,7 +60,7 @@ void CRecharge::__MAKE_VHOOK(Spawn)(void)
}
/* <c6122> ../cstrike/dlls/h_battery.cpp:99 */
void CRecharge::__MAKE_VHOOK(Precache)(void)
void CRecharge::__MAKE_VHOOK(Precache)()
{
PRECACHE_SOUND("items/suitcharge1.wav");
PRECACHE_SOUND("items/suitchargeno1.wav");
@ -81,7 +77,7 @@ void CRecharge::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller,
// if there is no juice left, turn it off
if (m_iJuice <= 0)
{
pev->frame = 1;
pev->frame = 1.0f;
Off();
}
@ -90,14 +86,14 @@ void CRecharge::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller,
{
if (m_flSoundTime <= gpGlobals->time)
{
m_flSoundTime = gpGlobals->time + 0.62;
m_flSoundTime = gpGlobals->time + 0.62f;
EMIT_SOUND(ENT(pev), CHAN_ITEM, "items/suitchargeno1.wav", 0.85, ATTN_NORM);
}
return;
}
pev->nextthink = pev->ltime + 0.25;
pev->nextthink = pev->ltime + 0.25f;
SetThink(&CRecharge::Off);
// Time to recharge yet?
@ -119,7 +115,7 @@ void CRecharge::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller,
{
m_iOn++;
EMIT_SOUND(ENT(pev), CHAN_ITEM, "items/suitchargeok1.wav", 0.85, ATTN_NORM);
m_flSoundTime = gpGlobals->time + 0.56;
m_flSoundTime = gpGlobals->time + 0.56f;
}
if (m_iOn == 1 && m_flSoundTime <= gpGlobals->time)
@ -132,18 +128,18 @@ void CRecharge::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller,
if (m_hActivator->pev->armorvalue < 100)
{
m_iJuice--;
m_hActivator->pev->armorvalue += 1;
m_hActivator->pev->armorvalue += 1.0f;
if (m_hActivator->pev->armorvalue > 100)
m_hActivator->pev->armorvalue = 100;
}
// govern the rate of charge
m_flNextCharge = gpGlobals->time + 0.1;
m_flNextCharge = gpGlobals->time + 0.1f;
}
/* <c6149> ../cstrike/dlls/h_battery.cpp:178 */
void CRecharge::Recharge(void)
void CRecharge::Recharge()
{
m_iJuice = gSkillData.suitchargerCapacity;
pev->frame = 0;
@ -151,7 +147,7 @@ void CRecharge::Recharge(void)
}
/* <c622e> ../cstrike/dlls/h_battery.cpp:185 */
void CRecharge::Off(void)
void CRecharge::Off()
{
// Stop looping sound.
if (m_iOn > 1)
@ -167,37 +163,3 @@ void CRecharge::Off(void)
else
SetThink(&CRecharge::SUB_DoNothing);
}
#ifdef HOOK_GAMEDLL
void CRecharge::Spawn(void)
{
Spawn_();
}
void CRecharge::Precache(void)
{
Precache_();
}
void CRecharge::KeyValue(KeyValueData *pkvd)
{
KeyValue_(pkvd);
}
int CRecharge::Save(CSave &save)
{
return Save_(save);
}
int CRecharge::Restore(CRestore &restore)
{
return Restore_(restore);
}
void CRecharge::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
#endif // HOOK_GAMEDLL

View File

@ -35,21 +35,18 @@
class CRecharge: public CBaseToggle
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return ((CBaseToggle::ObjectCaps() | FCAP_CONTINUOUS_USE) & ~FCAP_ACROSS_TRANSITION);
}
virtual int ObjectCaps() { return ((CBaseToggle::ObjectCaps() | FCAP_CONTINUOUS_USE) & ~FCAP_ACROSS_TRANSITION); }
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
@ -58,8 +55,8 @@ public:
#endif // HOOK_GAMEDLL
public:
void EXPORT Off(void);
void EXPORT Recharge(void);
void EXPORT Off();
void EXPORT Recharge();
public:
static TYPEDESCRIPTION IMPL(m_SaveData)[5];
@ -69,7 +66,6 @@ public:
int m_iJuice;
int m_iOn;
float m_flSoundTime;
};/* size: 332, cachelines: 6, members: 7 */
};
#endif // H_BATTERY_H

View File

@ -22,19 +22,13 @@ TYPEDESCRIPTION CWreckage::m_SaveData[] =
DEFINE_FIELD(CWreckage, m_flStartTime, FIELD_TIME),
};
#else
TYPEDESCRIPTION IMPL_CLASS(CCycler, m_SaveData)[1];
TYPEDESCRIPTION IMPL_CLASS(CCyclerSprite, m_SaveData)[3];
TYPEDESCRIPTION IMPL_CLASS(CWreckage, m_SaveData)[1];
#endif // HOOK_GAMEDLL
/* <cce5f> ../cstrike/dlls/h_cycler.cpp:61 */
IMPLEMENT_SAVERESTORE(CCycler, CBaseToggle);
/* <cd01f> ../cstrike/dlls/h_cycler.cpp:70 */
void CGenericCycler::__MAKE_VHOOK(Spawn)(void)
void CGenericCycler::__MAKE_VHOOK(Spawn)()
{
GenericCyclerSpawn((char *)STRING(pev->model), Vector(-16, -16, 0), Vector(16, 16, 72));
}
@ -46,7 +40,7 @@ LINK_ENTITY_TO_CLASS(cycler, CGenericCycler);
LINK_ENTITY_TO_CLASS(cycler_prdroid, CCyclerProbe);
/* <cd16d> ../cstrike/dlls/h_cycler.cpp:86 */
void CCyclerProbe::__MAKE_VHOOK(Spawn)(void)
void CCyclerProbe::__MAKE_VHOOK(Spawn)()
{
pev->origin = pev->origin + Vector(0, 0, 16);
GenericCyclerSpawn("models/prdroid.mdl", Vector(-16, -16, -16), Vector(16, 16, 16));
@ -57,7 +51,7 @@ void CCyclerProbe::__MAKE_VHOOK(Spawn)(void)
/* <cd466> ../cstrike/dlls/h_cycler.cpp:96 */
void CCycler::GenericCyclerSpawn(char *szModel, Vector vecMin, Vector vecMax)
{
if (!szModel || !*szModel)
if (!szModel || !szModel[0])
{
ALERT(at_error, "cycler at %.0f %.0f %0.f missing modelname", pev->origin.x, pev->origin.y, pev->origin.z);
REMOVE_ENTITY(ENT(pev));
@ -81,7 +75,7 @@ void CCycler::GenericCyclerSpawn(char *szModel, Vector vecMin, Vector vecMax)
}
/* <ccc91> ../cstrike/dlls/h_cycler.cpp:115 */
void CCycler::__MAKE_VHOOK(Spawn)(void)
void CCycler::__MAKE_VHOOK(Spawn)()
{
InitBoneControllers();
@ -100,11 +94,11 @@ void CCycler::__MAKE_VHOOK(Spawn)(void)
m_flFrameRate = 75;
m_flGroundSpeed = 0;
pev->nextthink += 1.0;
pev->nextthink += 1.0f;
ResetSequenceInfo();
if (pev->sequence != 0 || pev->frame != 0)
if (pev->sequence != 0 || pev->frame != 0.0f)
{
m_animate = 0;
pev->framerate = 0;
@ -118,7 +112,7 @@ void CCycler::__MAKE_VHOOK(Spawn)(void)
// cycler think
/* <ccd3e> ../cstrike/dlls/h_cycler.cpp:151 */
void CCycler::__MAKE_VHOOK(Think)(void)
void CCycler::__MAKE_VHOOK(Think)()
{
pev->nextthink = gpGlobals->time + 0.1f;
@ -132,7 +126,7 @@ void CCycler::__MAKE_VHOOK(Think)(void)
// ResetSequenceInfo();
// hack to avoid reloading model every frame
pev->animtime = gpGlobals->time;
pev->framerate = 1.0;
pev->framerate = 1.0f;
m_fSequenceFinished = FALSE;
m_flLastEventCheck = gpGlobals->time;
pev->frame = 0;
@ -140,7 +134,7 @@ void CCycler::__MAKE_VHOOK(Think)(void)
if (!m_animate)
{
// FIX: don't reset framerate
pev->framerate = 0.0;
pev->framerate = 0.0f;
}
}
}
@ -153,9 +147,9 @@ void CCycler::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, U
m_animate = !m_animate;
if (m_animate)
pev->framerate = 1.0;
pev->framerate = 1.0f;
else
pev->framerate = 0.0;
pev->framerate = 0.0f;
}
// CyclerPain , changes sequences when shot
@ -195,7 +189,7 @@ LINK_ENTITY_TO_CLASS(cycler_sprite, CCyclerSprite);
IMPLEMENT_SAVERESTORE(CCyclerSprite, CBaseEntity);
/* <cc943> ../cstrike/dlls/h_cycler.cpp:258 */
void CCyclerSprite::__MAKE_VHOOK(Spawn)(void)
void CCyclerSprite::__MAKE_VHOOK(Spawn)()
{
pev->solid = SOLID_SLIDEBOX;
pev->movetype = MOVETYPE_NONE;
@ -223,7 +217,7 @@ void CCyclerSprite::__MAKE_VHOOK(Spawn)(void)
}
/* <cc982> ../cstrike/dlls/h_cycler.cpp:284 */
void CCyclerSprite::__MAKE_VHOOK(Restart)(void)
void CCyclerSprite::__MAKE_VHOOK(Restart)()
{
pev->solid = SOLID_SLIDEBOX;
pev->movetype = MOVETYPE_NONE;
@ -246,7 +240,7 @@ void CCyclerSprite::__MAKE_VHOOK(Restart)(void)
}
/* <cd0ef> ../cstrike/dlls/h_cycler.cpp:305 */
void CCyclerSprite::__MAKE_VHOOK(Think)(void)
void CCyclerSprite::__MAKE_VHOOK(Think)()
{
if (ShouldAnimate())
{
@ -290,7 +284,7 @@ void CCyclerSprite::Animate(float frames)
LINK_ENTITY_TO_CLASS(cycler_weapon, CWeaponCycler);
/* <ccbf6> ../cstrike/dlls/h_cycler.cpp:361 */
void CWeaponCycler::__MAKE_VHOOK(Spawn)(void)
void CWeaponCycler::__MAKE_VHOOK(Spawn)()
{
pev->solid = SOLID_SLIDEBOX;
pev->movetype = MOVETYPE_NONE;
@ -307,10 +301,10 @@ void CWeaponCycler::__MAKE_VHOOK(Spawn)(void)
}
/* <cca7c> ../cstrike/dlls/h_cycler.cpp:378 */
BOOL CWeaponCycler::__MAKE_VHOOK(Deploy)(void)
BOOL CWeaponCycler::__MAKE_VHOOK(Deploy)()
{
m_pPlayer->pev->viewmodel = m_iszModel;
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0;
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0f;
SendWeaponAnim(0);
m_iClip = 0;
@ -321,18 +315,18 @@ BOOL CWeaponCycler::__MAKE_VHOOK(Deploy)(void)
/* <ccaa3> ../cstrike/dlls/h_cycler.cpp:388 */
void CWeaponCycler::__MAKE_VHOOK(Holster)(int skiplocal)
{
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5;
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f;
}
/* <ccad8> ../cstrike/dlls/h_cycler.cpp:394 */
void CWeaponCycler::__MAKE_VHOOK(PrimaryAttack)(void)
void CWeaponCycler::__MAKE_VHOOK(PrimaryAttack)()
{
SendWeaponAnim(pev->sequence);
m_flNextPrimaryAttack = gpGlobals->time + 0.3;
m_flNextPrimaryAttack = gpGlobals->time + 0.3f;
}
/* <ccb97> ../cstrike/dlls/h_cycler.cpp:403 */
void CWeaponCycler::__MAKE_VHOOK(SecondaryAttack)(void)
void CWeaponCycler::__MAKE_VHOOK(SecondaryAttack)()
{
float flFrameRate, flGroundSpeed;
@ -349,7 +343,7 @@ void CWeaponCycler::__MAKE_VHOOK(SecondaryAttack)(void)
}
SendWeaponAnim(pev->sequence);
m_flNextSecondaryAttack = gpGlobals->time + 0.3;
m_flNextSecondaryAttack = gpGlobals->time + 0.3f;
}
/* <cce12> ../cstrike/dlls/h_cycler.cpp:443 */
@ -359,7 +353,7 @@ IMPLEMENT_SAVERESTORE(CWreckage, CBaseToggle);
LINK_ENTITY_TO_CLASS(cycler_wreckage, CWreckage);
/* <ccaff> ../cstrike/dlls/h_cycler.cpp:448 */
void CWreckage::__MAKE_VHOOK(Spawn)(void)
void CWreckage::__MAKE_VHOOK(Spawn)()
{
pev->solid = SOLID_NOT;
pev->movetype = MOVETYPE_NONE;
@ -380,7 +374,7 @@ void CWreckage::__MAKE_VHOOK(Spawn)(void)
}
/* <ccd07> ../cstrike/dlls/h_cycler.cpp:468 */
void CWreckage::__MAKE_VHOOK(Precache)(void)
void CWreckage::__MAKE_VHOOK(Precache)()
{
if (!FStringNull(pev->model))
{
@ -389,10 +383,10 @@ void CWreckage::__MAKE_VHOOK(Precache)(void)
}
/* <ccb26> ../cstrike/dlls/h_cycler.cpp:474 */
void CWreckage::__MAKE_VHOOK(Think)(void)
void CWreckage::__MAKE_VHOOK(Think)()
{
StudioFrameAdvance();
pev->nextthink = gpGlobals->time + 0.2;
pev->nextthink = gpGlobals->time + 0.2f;
if (pev->dmgtime)
{
@ -423,132 +417,3 @@ void CWreckage::__MAKE_VHOOK(Think)(void)
WRITE_BYTE(RANDOM_LONG(0, 3) + 8); // framerate
MESSAGE_END();
}
#ifdef HOOK_GAMEDLL
void CWreckage::Spawn(void)
{
Spawn_();
}
void CWreckage::Precache(void)
{
Precache_();
}
int CWreckage::Save(CSave &save)
{
return Save_(save);
}
int CWreckage::Restore(CRestore &restore)
{
return Restore_(restore);
}
void CWreckage::Think(void)
{
Think_();
}
void CWeaponCycler::Spawn(void)
{
Spawn_();
}
BOOL CWeaponCycler::Deploy(void)
{
return Deploy_();
}
void CWeaponCycler::Holster(int skiplocal)
{
Holster_(skiplocal);
}
void CWeaponCycler::PrimaryAttack(void)
{
PrimaryAttack_();
}
void CWeaponCycler::SecondaryAttack(void)
{
SecondaryAttack_();
}
void CCyclerSprite::Spawn(void)
{
Spawn_();
}
void CCyclerSprite::Restart(void)
{
Restart_();
}
int CCyclerSprite::Save(CSave &save)
{
return Save_(save);
}
int CCyclerSprite::Restore(CRestore &restore)
{
return Restore_(restore);
}
int CCyclerSprite::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{
return TakeDamage_(pevInflictor,pevAttacker,flDamage,bitsDamageType);
}
void CCyclerSprite::Think(void)
{
Think_();
}
void CCyclerSprite::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator,pCaller,useType,value);
}
void CCycler::Spawn(void)
{
Spawn_();
}
int CCycler::Save(CSave &save)
{
return Save_(save);
}
int CCycler::Restore(CRestore &restore)
{
return Restore_(restore);
}
int CCycler::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{
return TakeDamage_(pevInflictor,pevAttacker,flDamage,bitsDamageType);
}
void CCycler::Think(void)
{
Think_();
}
void CCycler::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator,pCaller,useType,value);
}
void CGenericCycler::Spawn(void)
{
Spawn_();
}
void CCyclerProbe::Spawn(void)
{
Spawn_();
}
#endif // HOOK_GAMEDLL

View File

@ -36,30 +36,24 @@
class CCycler: public CBaseMonster
{
public:
virtual void Spawn(void);
virtual void Spawn();
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return (CBaseEntity::ObjectCaps() | FCAP_IMPULSE_USE);
}
virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() | FCAP_IMPULSE_USE); }
virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
// Don't treat as a live target
virtual BOOL IsAlive(void)
{
return FALSE;
}
virtual void Think(void);
virtual BOOL IsAlive() { return FALSE; }
virtual void Think();
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Spawn_();
int Save_(CSave &save);
int Restore_(CRestore &restore);
int TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
void Think_(void);
void Think_();
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif // HOOK_GAMEDLL
@ -71,8 +65,7 @@ public:
static TYPEDESCRIPTION IMPL(m_SaveData)[1];
int m_animate;
};/* size: 408, cachelines: 7, members: 3 */
};
// we should get rid of all the other cyclers and replace them with this.
@ -80,15 +73,15 @@ public:
class CGenericCycler: public CCycler
{
public:
virtual void Spawn(void);
virtual void Spawn();
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Spawn_();
#endif // HOOK_GAMEDLL
};/* size: 408, cachelines: 7, members: 1 */
};
// Probe droid imported for tech demo compatibility
@ -96,50 +89,44 @@ public:
class CCyclerProbe: public CCycler
{
public:
virtual void Spawn(void);
virtual void Spawn();
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Spawn_();
#endif // HOOK_GAMEDLL
};/* size: 408, cachelines: 7, members: 1 */
};
/* <cba56> ../cstrike/dlls/h_cycler.cpp:218 */
class CCyclerSprite: public CBaseEntity
{
public:
virtual void Spawn(void);
virtual void Restart(void);
virtual void Spawn();
virtual void Restart();
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return (CBaseEntity::ObjectCaps() | FCAP_DONT_SAVE | FCAP_IMPULSE_USE);
}
virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() | FCAP_DONT_SAVE | FCAP_IMPULSE_USE); }
virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
virtual void Think(void);
virtual void Think();
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Restart_(void);
void Spawn_();
void Restart_();
int Save_(CSave &save);
int Restore_(CRestore &restore);
int TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
void Think_(void);
void Think_();
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif // HOOK_GAMEDLL
public:
void Animate(float frames);
inline int ShouldAnimate(void)
{
return (m_animate && m_maxFrame > 1.0);
}
inline int ShouldAnimate() { return (m_animate && m_maxFrame > 1.0f); }
public:
static TYPEDESCRIPTION IMPL(m_SaveData)[3];
@ -151,43 +138,34 @@ public:
int m_rendermode;
float m_renderamt;
vec3_t m_rendercolor;
};/* size: 188, cachelines: 3, members: 9 */
};
/* <cbbc0> ../cstrike/dlls/h_cycler.cpp:344 */
class CWeaponCycler: public CBasePlayerWeapon
{
public:
virtual void Spawn(void);
virtual int GetItemInfo(ItemInfo *p)
{
return 0;
}
virtual BOOL Deploy(void);
virtual void Spawn();
virtual int GetItemInfo(ItemInfo *p) { return 0; }
virtual BOOL Deploy();
virtual void Holster(int skiplocal = 0);
virtual int iItemSlot(void)
{
return 1;
}
virtual void PrimaryAttack(void);
virtual void SecondaryAttack(void);
virtual int iItemSlot() { return 1; }
virtual void PrimaryAttack();
virtual void SecondaryAttack();
#ifdef HOOK_GAMEDLL
void Spawn_(void);
BOOL Deploy_(void);
void Spawn_();
BOOL Deploy_();
void Holster_(int skiplocal = 0);
void PrimaryAttack_(void);
void SecondaryAttack_(void);
void PrimaryAttack_();
void SecondaryAttack_();
#endif // HOOK_GAMEDLL
public:
int m_iszModel;
int m_iModel;
};/* size: 344, cachelines: 6, members: 3 */
};
// Flaming Wreakage
@ -195,19 +173,19 @@ public:
class CWreckage: public CBaseMonster
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Spawn();
virtual void Precache();
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual void Think(void);
virtual void Think();
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Spawn_();
void Precache_();
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Think_(void);
void Think_();
#endif // HOOK_GAMEDLL
@ -215,18 +193,6 @@ public:
static TYPEDESCRIPTION IMPL(m_SaveData)[1];
int m_flStartTime;
};/* size: 408, cachelines: 7, members: 3 */
#ifdef HOOK_GAMEDLL
// linked objects
C_DLLEXPORT void cycler(entvars_t *pev);
C_DLLEXPORT void cycler_prdroid(entvars_t *pev);
C_DLLEXPORT void cycler_sprite(entvars_t *pev);
C_DLLEXPORT void cycler_weapon(entvars_t *pev);
C_DLLEXPORT void cycler_wreckage(entvars_t *pev);
#endif // HOOK_GAMEDLL
};
#endif // H_CYCLER_H

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