From 25f425801a9e1b89dd4e29935ca19323d19fa495 Mon Sep 17 00:00:00 2001 From: s1lentq Date: Thu, 4 Feb 2016 06:18:26 +0600 Subject: [PATCH] Refactoring and cleanup project. Removed project bzip2. CZero: Fix crashing of HostageEscapeState. --- .../gradlecpp/CppUnitTestExtension.groovy | 20 +- dep/bzip2/build.gradle | 75 - dep/bzip2/include/bzip2/bzlib.h | 282 --- dep/bzip2/msvc/bzip2.vcxproj | 186 -- dep/bzip2/msvc/bzip2.vcxproj.filters | 51 - dep/bzip2/src/blocksort.c | 1094 -------- dep/bzip2/src/bzlib.c | 1580 ------------ dep/bzip2/src/bzlib_private.h | 509 ---- dep/bzip2/src/compress.c | 672 ----- dep/bzip2/src/crctable.c | 104 - dep/bzip2/src/decompress.c | 646 ----- dep/bzip2/src/huffman.c | 205 -- dep/bzip2/src/precompiled.c | 1 - dep/bzip2/src/randtable.c | 84 - dep/cppunitlite/msvc/cppunitlite.vcxproj | 29 + msvc/ReGameDLL.sln | 24 +- regamedll/build.gradle | 19 +- regamedll/common/cvardef.h | 2 +- regamedll/common/entity_state.h | 4 +- regamedll/common/mathlib.h | 2 +- regamedll/common/pmtrace.h | 4 +- regamedll/common/studio_event.h | 2 +- regamedll/common/usercmd.h | 1 - regamedll/common/weaponinfo.h | 1 - regamedll/dlls/activity.h | 201 +- regamedll/dlls/airtank.cpp | 43 +- regamedll/dlls/airtank.h | 24 +- regamedll/dlls/ammo.cpp | 194 +- regamedll/dlls/ammo.h | 116 +- regamedll/dlls/animating.cpp | 26 +- regamedll/dlls/animation.cpp | 27 +- regamedll/dlls/animation.h | 26 - regamedll/dlls/basemonster.h | 144 +- regamedll/dlls/bmodels.cpp | 146 +- regamedll/dlls/bmodels.h | 102 +- regamedll/dlls/bot/cs_bot.cpp | 80 +- regamedll/dlls/bot/cs_bot.h | 640 +++-- regamedll/dlls/bot/cs_bot_chatter.cpp | 203 +- regamedll/dlls/bot/cs_bot_chatter.h | 246 +- regamedll/dlls/bot/cs_bot_event.cpp | 97 +- regamedll/dlls/bot/cs_bot_init.cpp | 135 +- regamedll/dlls/bot/cs_bot_learn.cpp | 376 +-- regamedll/dlls/bot/cs_bot_listen.cpp | 6 +- regamedll/dlls/bot/cs_bot_manager.cpp | 121 +- regamedll/dlls/bot/cs_bot_manager.h | 122 +- regamedll/dlls/bot/cs_bot_nav.cpp | 12 +- regamedll/dlls/bot/cs_bot_pathfind.cpp | 16 +- regamedll/dlls/bot/cs_bot_radio.cpp | 6 +- regamedll/dlls/bot/cs_bot_statemachine.cpp | 42 +- regamedll/dlls/bot/cs_bot_update.cpp | 28 +- regamedll/dlls/bot/cs_bot_vision.cpp | 48 +- regamedll/dlls/bot/cs_bot_weapon.cpp | 61 +- regamedll/dlls/bot/cs_gamestate.cpp | 42 +- regamedll/dlls/bot/cs_gamestate.h | 55 +- regamedll/dlls/bot/states/cs_bot_attack.cpp | 827 +++---- regamedll/dlls/bot/states/cs_bot_buy.cpp | 27 +- .../dlls/bot/states/cs_bot_defuse_bomb.cpp | 19 - .../bot/states/cs_bot_escape_from_bomb.cpp | 19 - .../dlls/bot/states/cs_bot_fetch_bomb.cpp | 14 - regamedll/dlls/bot/states/cs_bot_follow.cpp | 19 - regamedll/dlls/bot/states/cs_bot_hide.cpp | 23 +- regamedll/dlls/bot/states/cs_bot_hunt.cpp | 19 - regamedll/dlls/bot/states/cs_bot_idle.cpp | 14 - .../bot/states/cs_bot_investigate_noise.cpp | 21 +- regamedll/dlls/bot/states/cs_bot_move_to.cpp | 19 - .../dlls/bot/states/cs_bot_plant_bomb.cpp | 19 - .../dlls/bot/states/cs_bot_use_entity.cpp | 19 - regamedll/dlls/buttons.cpp | 217 +- regamedll/dlls/buttons.h | 73 +- regamedll/dlls/career_tasks.cpp | 51 +- regamedll/dlls/career_tasks.h | 67 +- regamedll/dlls/cbase.cpp | 104 +- regamedll/dlls/cbase.h | 460 +--- regamedll/dlls/client.cpp | 149 +- regamedll/dlls/client.h | 71 +- regamedll/dlls/combat.cpp | 131 +- regamedll/dlls/debug.cpp | 10 +- regamedll/dlls/debug.h | 36 +- regamedll/dlls/decals.h | 7 - regamedll/dlls/doors.cpp | 139 +- regamedll/dlls/doors.h | 65 +- regamedll/dlls/effects.cpp | 491 +--- regamedll/dlls/effects.h | 523 ++-- regamedll/dlls/explode.cpp | 56 +- regamedll/dlls/explode.h | 33 +- regamedll/dlls/func_break.cpp | 182 +- regamedll/dlls/func_break.h | 89 +- regamedll/dlls/func_tank.cpp | 226 +- regamedll/dlls/func_tank.h | 109 +- regamedll/dlls/game.cpp | 320 +-- regamedll/dlls/game.h | 92 +- regamedll/dlls/gamerules.cpp | 32 +- regamedll/dlls/gamerules.h | 44 +- regamedll/dlls/ggrenade.cpp | 244 +- regamedll/dlls/globals.cpp | 6 +- regamedll/dlls/globals.h | 16 +- regamedll/dlls/h_ai.cpp | 11 - regamedll/dlls/h_battery.cpp | 62 +- regamedll/dlls/h_battery.h | 20 +- regamedll/dlls/h_cycler.cpp | 187 +- regamedll/dlls/h_cycler.h | 114 +- regamedll/dlls/h_export.h | 16 - regamedll/dlls/healthkit.cpp | 65 +- regamedll/dlls/healthkit.h | 31 +- regamedll/dlls/hintmessage.cpp | 4 +- regamedll/dlls/hintmessage.h | 23 +- regamedll/dlls/hostage/hostage.cpp | 110 +- regamedll/dlls/hostage/hostage.h | 136 +- regamedll/dlls/hostage/hostage_improv.cpp | 275 +- regamedll/dlls/hostage/hostage_improv.h | 229 +- regamedll/dlls/hostage/hostage_localnav.cpp | 28 +- regamedll/dlls/hostage/hostage_localnav.h | 35 +- regamedll/dlls/hostage/hostage_states.h | 100 +- .../dlls/hostage/states/hostage_animate.cpp | 23 +- .../dlls/hostage/states/hostage_escape.cpp | 71 +- .../dlls/hostage/states/hostage_follow.cpp | 24 - .../dlls/hostage/states/hostage_idle.cpp | 24 - .../dlls/hostage/states/hostage_retreat.cpp | 19 - regamedll/dlls/items.cpp | 186 +- regamedll/dlls/items.h | 105 +- regamedll/dlls/lights.cpp | 54 +- regamedll/dlls/lights.h | 17 +- regamedll/dlls/maprules.cpp | 181 +- regamedll/dlls/maprules.h | 222 +- regamedll/dlls/monsters.h | 32 +- regamedll/dlls/mortar.cpp | 375 ++- regamedll/dlls/mortar.h | 37 +- regamedll/dlls/mpstubb.cpp | 18 +- regamedll/dlls/multiplay_gamerules.cpp | 428 +--- regamedll/dlls/nodes.h | 22 +- regamedll/dlls/observer.cpp | 17 +- regamedll/dlls/pathcorner.cpp | 772 +++--- regamedll/dlls/pathcorner.h | 20 +- regamedll/dlls/plane.cpp | 2 +- regamedll/dlls/plane.h | 5 +- regamedll/dlls/plats.cpp | 429 +--- regamedll/dlls/plats.h | 242 +- regamedll/dlls/player.cpp | 584 +---- regamedll/dlls/player.h | 440 ++-- regamedll/dlls/revert_saved.h | 49 +- regamedll/dlls/saverestore.h | 84 +- regamedll/dlls/schedule.h | 4 +- regamedll/dlls/scriptevent.h | 22 +- regamedll/dlls/singleplay_gamerules.cpp | 219 +- regamedll/dlls/skill.h | 9 +- regamedll/dlls/sound.cpp | 172 +- regamedll/dlls/sound.h | 88 +- regamedll/dlls/soundent.cpp | 43 +- regamedll/dlls/soundent.h | 56 +- regamedll/dlls/spectator.cpp | 19 +- regamedll/dlls/spectator.h | 16 +- regamedll/dlls/subs.cpp | 77 +- regamedll/dlls/subs.h | 22 +- regamedll/dlls/training_gamerules.cpp | 125 +- regamedll/dlls/training_gamerules.h | 55 +- regamedll/dlls/trains.h | 120 +- regamedll/dlls/triggers.cpp | 499 +--- regamedll/dlls/triggers.h | 359 +-- regamedll/dlls/tutor.cpp | 22 +- regamedll/dlls/tutor.h | 25 +- regamedll/dlls/tutor_base_states.cpp | 18 +- regamedll/dlls/tutor_base_states.h | 22 +- regamedll/dlls/tutor_base_tutor.cpp | 51 +- regamedll/dlls/tutor_base_tutor.h | 34 +- regamedll/dlls/tutor_cs_states.cpp | 96 +- regamedll/dlls/tutor_cs_states.h | 53 +- regamedll/dlls/tutor_cs_tutor.cpp | 96 +- regamedll/dlls/tutor_cs_tutor.h | 74 +- regamedll/dlls/unisignals.h | 23 +- regamedll/dlls/util.cpp | 46 +- regamedll/dlls/util.h | 70 +- regamedll/dlls/vector.h | 40 +- regamedll/dlls/vehicle.cpp | 102 +- regamedll/dlls/vehicle.h | 22 +- regamedll/dlls/weapons.cpp | 298 +-- regamedll/dlls/weapons.h | 1716 +++++-------- regamedll/dlls/weapontype.cpp | 10 +- regamedll/dlls/weapontype.h | 20 +- regamedll/dlls/world.cpp | 91 +- regamedll/dlls/world.h | 24 +- regamedll/dlls/wpn_shared.h | 92 +- regamedll/dlls/wpn_shared/wpn_ak47.cpp | 81 +- regamedll/dlls/wpn_shared/wpn_aug.cpp | 81 +- regamedll/dlls/wpn_shared/wpn_awp.cpp | 84 +- regamedll/dlls/wpn_shared/wpn_c4.cpp | 72 +- regamedll/dlls/wpn_shared/wpn_deagle.cpp | 87 +- regamedll/dlls/wpn_shared/wpn_elite.cpp | 91 +- regamedll/dlls/wpn_shared/wpn_famas.cpp | 88 +- regamedll/dlls/wpn_shared/wpn_fiveseven.cpp | 92 +- regamedll/dlls/wpn_shared/wpn_flashbang.cpp | 94 +- regamedll/dlls/wpn_shared/wpn_g3sg1.cpp | 93 +- regamedll/dlls/wpn_shared/wpn_galil.cpp | 79 +- regamedll/dlls/wpn_shared/wpn_glock18.cpp | 105 +- regamedll/dlls/wpn_shared/wpn_hegrenade.cpp | 94 +- regamedll/dlls/wpn_shared/wpn_knife.cpp | 89 +- regamedll/dlls/wpn_shared/wpn_m249.cpp | 74 +- regamedll/dlls/wpn_shared/wpn_m3.cpp | 82 +- regamedll/dlls/wpn_shared/wpn_m4a1.cpp | 86 +- regamedll/dlls/wpn_shared/wpn_mac10.cpp | 72 +- regamedll/dlls/wpn_shared/wpn_mp5navy.cpp | 72 +- regamedll/dlls/wpn_shared/wpn_p228.cpp | 89 +- regamedll/dlls/wpn_shared/wpn_p90.cpp | 78 +- regamedll/dlls/wpn_shared/wpn_scout.cpp | 85 +- regamedll/dlls/wpn_shared/wpn_sg550.cpp | 84 +- regamedll/dlls/wpn_shared/wpn_sg552.cpp | 91 +- .../dlls/wpn_shared/wpn_smokegrenade.cpp | 91 +- regamedll/dlls/wpn_shared/wpn_tmp.cpp | 74 +- regamedll/dlls/wpn_shared/wpn_ump45.cpp | 74 +- regamedll/dlls/wpn_shared/wpn_usp.cpp | 90 +- regamedll/dlls/wpn_shared/wpn_xm1014.cpp | 80 +- regamedll/engine/common.h | 26 - regamedll/engine/studio.h | 15 +- regamedll/game_shared/GameEvent.h | 6 - regamedll/game_shared/bitvec.h | 19 +- regamedll/game_shared/bot/bot.cpp | 162 +- regamedll/game_shared/bot/bot.h | 183 +- regamedll/game_shared/bot/bot_constants.h | 8 - regamedll/game_shared/bot/bot_manager.cpp | 36 +- regamedll/game_shared/bot/bot_manager.h | 77 +- regamedll/game_shared/bot/bot_profile.cpp | 27 +- regamedll/game_shared/bot/bot_profile.h | 58 +- regamedll/game_shared/bot/bot_util.cpp | 22 +- regamedll/game_shared/bot/bot_util.h | 160 +- regamedll/game_shared/bot/improv.h | 84 +- regamedll/game_shared/bot/nav.h | 17 +- regamedll/game_shared/bot/nav_area.cpp | 135 +- regamedll/game_shared/bot/nav_area.h | 324 +-- regamedll/game_shared/bot/nav_file.cpp | 19 +- regamedll/game_shared/bot/nav_file.h | 6 +- regamedll/game_shared/bot/nav_node.cpp | 11 +- regamedll/game_shared/bot/nav_node.h | 89 +- regamedll/game_shared/bot/nav_path.cpp | 16 +- regamedll/game_shared/bot/nav_path.h | 141 +- .../game_shared/bot/simple_state_machine.h | 17 +- regamedll/game_shared/perf_counter.h | 15 +- regamedll/game_shared/shared_util.cpp | 13 +- regamedll/game_shared/shared_util.h | 12 +- regamedll/game_shared/steam_util.h | 15 +- regamedll/game_shared/voice_gamemgr.cpp | 13 +- regamedll/game_shared/voice_gamemgr.h | 36 +- regamedll/hookers/6153_hooker.cpp | 81 +- regamedll/hookers/hooker.h | 2 +- regamedll/hookers/hooker_impl.cpp | 2201 +++++++++++++++++ regamedll/hookers/hooker_impl.h | 912 +++++++ regamedll/hookers/main.cpp | 4 +- regamedll/hookers/main_mp.cpp | 5 +- regamedll/hookers/regamedll_debug.cpp | 10 +- regamedll/hookers/regamedll_debug.h | 4 +- regamedll/msvc/ReGameDLL.vcxproj | 200 +- regamedll/msvc/ReGameDLL.vcxproj.filters | 6 + regamedll/pm_shared/pm_debug.cpp | 6 +- regamedll/pm_shared/pm_debug.h | 4 +- regamedll/pm_shared/pm_defs.h | 4 +- regamedll/pm_shared/pm_math.cpp | 15 +- regamedll/pm_shared/pm_math.h | 7 - regamedll/pm_shared/pm_shared.cpp | 102 +- regamedll/pm_shared/pm_shared.h | 92 +- regamedll/public/MemPool.cpp | 14 +- regamedll/public/MemPool.h | 20 +- regamedll/public/utlsymbol.cpp | 148 +- regamedll/public/utlsymbol.h | 60 +- regamedll/public/utlvector.h | 5 +- .../regamedll/RegameDLLRuntimeConfig.cpp | 2 +- regamedll/regamedll/RegameDLLRuntimeConfig.h | 2 +- regamedll/regamedll/classes_dummy.cpp | 76 +- regamedll/regamedll/dlls.h | 5 + regamedll/regamedll/precompiled.h | 6 - 267 files changed, 10401 insertions(+), 22768 deletions(-) delete mode 100644 dep/bzip2/build.gradle delete mode 100644 dep/bzip2/include/bzip2/bzlib.h delete mode 100644 dep/bzip2/msvc/bzip2.vcxproj delete mode 100644 dep/bzip2/msvc/bzip2.vcxproj.filters delete mode 100644 dep/bzip2/src/blocksort.c delete mode 100644 dep/bzip2/src/bzlib.c delete mode 100644 dep/bzip2/src/bzlib_private.h delete mode 100644 dep/bzip2/src/compress.c delete mode 100644 dep/bzip2/src/crctable.c delete mode 100644 dep/bzip2/src/decompress.c delete mode 100644 dep/bzip2/src/huffman.c delete mode 100644 dep/bzip2/src/precompiled.c delete mode 100644 dep/bzip2/src/randtable.c create mode 100644 regamedll/hookers/hooker_impl.cpp create mode 100644 regamedll/hookers/hooker_impl.h diff --git a/buildSrc/src/main/groovy/gradlecpp/CppUnitTestExtension.groovy b/buildSrc/src/main/groovy/gradlecpp/CppUnitTestExtension.groovy index fe94d875..ef9147cc 100644 --- a/buildSrc/src/main/groovy/gradlecpp/CppUnitTestExtension.groovy +++ b/buildSrc/src/main/groovy/gradlecpp/CppUnitTestExtension.groovy @@ -4,16 +4,16 @@ import org.gradle.api.Project import org.gradle.nativeplatform.NativeBinarySpec class CppUnitTestExtension { - Project _project + Project _project - CppUnitTestExtension(Project p) { - _project = p - } + CppUnitTestExtension(Project p) { + _project = p + } - void eachTestExecutable(Closure action) { - _project.binaries.each { NativeBinarySpec bin -> - if (!bin.hasProperty('cppUnitTestsExecutable')) return - action(bin) - } - } + void eachTestExecutable(Closure action) { + _project.binaries.each { NativeBinarySpec bin -> + if (!bin.hasProperty('cppUnitTestsExecutable')) return + action(bin) + } + } } diff --git a/dep/bzip2/build.gradle b/dep/bzip2/build.gradle deleted file mode 100644 index 649ea6d3..00000000 --- a/dep/bzip2/build.gradle +++ /dev/null @@ -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) } - } - } -} diff --git a/dep/bzip2/include/bzip2/bzlib.h b/dep/bzip2/include/bzip2/bzlib.h deleted file mode 100644 index 9bf05d09..00000000 --- a/dep/bzip2/include/bzip2/bzlib.h +++ /dev/null @@ -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 - - 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 -#endif - -#ifdef _WIN32 -# include -# 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 ---*/ -/*-------------------------------------------------------------*/ diff --git a/dep/bzip2/msvc/bzip2.vcxproj b/dep/bzip2/msvc/bzip2.vcxproj deleted file mode 100644 index fe2829f3..00000000 --- a/dep/bzip2/msvc/bzip2.vcxproj +++ /dev/null @@ -1,186 +0,0 @@ - - - - - Debug MP Play - Win32 - - - Debug MP - Win32 - - - Debug - Win32 - - - Release MP - Win32 - - - Release - Win32 - - - - {792DF067-9904-4579-99B9-46C17277ADE3} - Win32Proj - bzip2 - - - - StaticLibrary - true - v120 - Unicode - - - StaticLibrary - true - v120 - Unicode - - - StaticLibrary - true - v120 - Unicode - - - StaticLibrary - true - v120 - Unicode - - - StaticLibrary - false - v120 - true - Unicode - - - - - - - - - - - - - - - - - - - - - - - - Use - Level3 - Disabled - _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - $(ProjectDir)..\include\ - MultiThreadedDebug - bzlib_private.h - - - Windows - true - - - - - Use - Level3 - Disabled - _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - $(ProjectDir)..\include\ - MultiThreadedDebug - bzlib_private.h - - - Windows - true - - - - - Use - Level3 - Disabled - _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - $(ProjectDir)..\include\ - MultiThreadedDebug - bzlib_private.h - - - Windows - true - - - - - Use - Level3 - Disabled - _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - $(ProjectDir)..\include\ - MultiThreadedDebug - bzlib_private.h - - - Windows - true - - - - - Level3 - Use - MaxSpeed - true - true - _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - $(ProjectDir)..\include\ - MultiThreaded - bzlib_private.h - - - Windows - true - true - true - - - - - - - - - - - - - - Create - Create - Create - Create - Create - - - - - - - - - - \ No newline at end of file diff --git a/dep/bzip2/msvc/bzip2.vcxproj.filters b/dep/bzip2/msvc/bzip2.vcxproj.filters deleted file mode 100644 index d395a6bd..00000000 --- a/dep/bzip2/msvc/bzip2.vcxproj.filters +++ /dev/null @@ -1,51 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Source Files - - - \ No newline at end of file diff --git a/dep/bzip2/src/blocksort.c b/dep/bzip2/src/blocksort.c deleted file mode 100644 index 72d4a31f..00000000 --- a/dep/bzip2/src/blocksort.c +++ /dev/null @@ -1,1094 +0,0 @@ - -/*-------------------------------------------------------------*/ -/*--- Block sorting machinery ---*/ -/*--- blocksort.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 - - 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" - -/*---------------------------------------------*/ -/*--- Fallback O(N log(N)^2) sorting ---*/ -/*--- algorithm, for repetitive blocks ---*/ -/*---------------------------------------------*/ - -/*---------------------------------------------*/ -static -__inline__ -void fallbackSimpleSort ( UInt32* fmap, - UInt32* eclass, - Int32 lo, - Int32 hi ) -{ - Int32 i, j, tmp; - UInt32 ec_tmp; - - if (lo == hi) return; - - if (hi - lo > 3) { - for ( i = hi-4; i >= lo; i-- ) { - tmp = fmap[i]; - ec_tmp = eclass[tmp]; - for ( j = i+4; j <= hi && ec_tmp > eclass[fmap[j]]; j += 4 ) - fmap[j-4] = fmap[j]; - fmap[j-4] = tmp; - } - } - - for ( i = hi-1; i >= lo; i-- ) { - tmp = fmap[i]; - ec_tmp = eclass[tmp]; - for ( j = i+1; j <= hi && ec_tmp > eclass[fmap[j]]; j++ ) - fmap[j-1] = fmap[j]; - fmap[j-1] = tmp; - } -} - - -/*---------------------------------------------*/ -#define fswap(zz1, zz2) \ - { Int32 zztmp = zz1; zz1 = zz2; zz2 = zztmp; } - -#define fvswap(zzp1, zzp2, zzn) \ -{ \ - Int32 yyp1 = (zzp1); \ - Int32 yyp2 = (zzp2); \ - Int32 yyn = (zzn); \ - while (yyn > 0) { \ - fswap(fmap[yyp1], fmap[yyp2]); \ - yyp1++; yyp2++; yyn--; \ - } \ -} - - -#define fmin(a,b) ((a) < (b)) ? (a) : (b) - -#define fpush(lz,hz) { stackLo[sp] = lz; \ - stackHi[sp] = hz; \ - sp++; } - -#define fpop(lz,hz) { sp--; \ - lz = stackLo[sp]; \ - hz = stackHi[sp]; } - -#define FALLBACK_QSORT_SMALL_THRESH 10 -#define FALLBACK_QSORT_STACK_SIZE 100 - - -static -void fallbackQSort3 ( UInt32* fmap, - UInt32* eclass, - Int32 loSt, - Int32 hiSt ) -{ - Int32 unLo, unHi, ltLo, gtHi, n, m; - Int32 sp, lo, hi; - UInt32 med, r, r3; - Int32 stackLo[FALLBACK_QSORT_STACK_SIZE]; - Int32 stackHi[FALLBACK_QSORT_STACK_SIZE]; - - r = 0; - - sp = 0; - fpush ( loSt, hiSt ); - - while (sp > 0) { - - AssertH ( sp < FALLBACK_QSORT_STACK_SIZE - 1, 1004 ); - - fpop ( lo, hi ); - if (hi - lo < FALLBACK_QSORT_SMALL_THRESH) { - fallbackSimpleSort ( fmap, eclass, lo, hi ); - continue; - } - - /* Random partitioning. Median of 3 sometimes fails to - avoid bad cases. Median of 9 seems to help but - looks rather expensive. This too seems to work but - is cheaper. Guidance for the magic constants - 7621 and 32768 is taken from Sedgewick's algorithms - book, chapter 35. - */ - r = ((r * 7621) + 1) % 32768; - r3 = r % 3; - if (r3 == 0) med = eclass[fmap[lo]]; else - if (r3 == 1) med = eclass[fmap[(lo+hi)>>1]]; else - med = eclass[fmap[hi]]; - - unLo = ltLo = lo; - unHi = gtHi = hi; - - while (1) { - while (1) { - if (unLo > unHi) break; - n = (Int32)eclass[fmap[unLo]] - (Int32)med; - if (n == 0) { - fswap(fmap[unLo], fmap[ltLo]); - ltLo++; unLo++; - continue; - }; - if (n > 0) break; - unLo++; - } - while (1) { - if (unLo > unHi) break; - n = (Int32)eclass[fmap[unHi]] - (Int32)med; - if (n == 0) { - fswap(fmap[unHi], fmap[gtHi]); - gtHi--; unHi--; - continue; - }; - if (n < 0) break; - unHi--; - } - if (unLo > unHi) break; - fswap(fmap[unLo], fmap[unHi]); unLo++; unHi--; - } - - AssertD ( unHi == unLo-1, "fallbackQSort3(2)" ); - - if (gtHi < ltLo) continue; - - n = fmin(ltLo-lo, unLo-ltLo); fvswap(lo, unLo-n, n); - m = fmin(hi-gtHi, gtHi-unHi); fvswap(unLo, hi-m+1, m); - - n = lo + unLo - ltLo - 1; - m = hi - (gtHi - unHi) + 1; - - if (n - lo > hi - m) { - fpush ( lo, n ); - fpush ( m, hi ); - } else { - fpush ( m, hi ); - fpush ( lo, n ); - } - } -} - -#undef fmin -#undef fpush -#undef fpop -#undef fswap -#undef fvswap -#undef FALLBACK_QSORT_SMALL_THRESH -#undef FALLBACK_QSORT_STACK_SIZE - - -/*---------------------------------------------*/ -/* Pre: - nblock > 0 - eclass exists for [0 .. nblock-1] - ((UChar*)eclass) [0 .. nblock-1] holds block - ptr exists for [0 .. nblock-1] - - Post: - ((UChar*)eclass) [0 .. nblock-1] holds block - All other areas of eclass destroyed - fmap [0 .. nblock-1] holds sorted order - bhtab [ 0 .. 2+(nblock/32) ] destroyed -*/ - -#define SET_BH(zz) bhtab[(zz) >> 5] |= (1 << ((zz) & 31)) -#define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~(1 << ((zz) & 31)) -#define ISSET_BH(zz) (bhtab[(zz) >> 5] & (1 << ((zz) & 31))) -#define WORD_BH(zz) bhtab[(zz) >> 5] -#define UNALIGNED_BH(zz) ((zz) & 0x01f) - -static -void fallbackSort ( UInt32* fmap, - UInt32* eclass, - UInt32* bhtab, - Int32 nblock, - Int32 verb ) -{ - Int32 ftab[257]; - Int32 ftabCopy[256]; - Int32 H, i, j, k, l, r, cc, cc1; - Int32 nNotDone; - Int32 nBhtab; - UChar* eclass8 = (UChar*)eclass; - - /*-- - Initial 1-char radix sort to generate - initial fmap and initial BH bits. - --*/ - if (verb >= 4) - VPrintf0 ( " bucket sorting ...\n" ); - for (i = 0; i < 257; i++) ftab[i] = 0; - for (i = 0; i < nblock; i++) ftab[eclass8[i]]++; - for (i = 0; i < 256; i++) ftabCopy[i] = ftab[i]; - for (i = 1; i < 257; i++) ftab[i] += ftab[i-1]; - - for (i = 0; i < nblock; i++) { - j = eclass8[i]; - k = ftab[j] - 1; - ftab[j] = k; - fmap[k] = i; - } - - nBhtab = 2 + (nblock / 32); - for (i = 0; i < nBhtab; i++) bhtab[i] = 0; - for (i = 0; i < 256; i++) SET_BH(ftab[i]); - - /*-- - Inductively refine the buckets. Kind-of an - "exponential radix sort" (!), inspired by the - Manber-Myers suffix array construction algorithm. - --*/ - - /*-- set sentinel bits for block-end detection --*/ - for (i = 0; i < 32; i++) { - SET_BH(nblock + 2*i); - CLEAR_BH(nblock + 2*i + 1); - } - - /*-- the log(N) loop --*/ - H = 1; - while (1) { - - if (verb >= 4) - VPrintf1 ( " depth %6d has ", H ); - - j = 0; - for (i = 0; i < nblock; i++) { - if (ISSET_BH(i)) j = i; - k = fmap[i] - H; if (k < 0) k += nblock; - eclass[k] = j; - } - - nNotDone = 0; - r = -1; - while (1) { - - /*-- find the next non-singleton bucket --*/ - k = r + 1; - while (ISSET_BH(k) && UNALIGNED_BH(k)) k++; - if (ISSET_BH(k)) { - while (WORD_BH(k) == 0xffffffff) k += 32; - while (ISSET_BH(k)) k++; - } - l = k - 1; - if (l >= nblock) break; - while (!ISSET_BH(k) && UNALIGNED_BH(k)) k++; - if (!ISSET_BH(k)) { - while (WORD_BH(k) == 0x00000000) k += 32; - while (!ISSET_BH(k)) k++; - } - r = k - 1; - if (r >= nblock) break; - - /*-- now [l, r] bracket current bucket --*/ - if (r > l) { - nNotDone += (r - l + 1); - fallbackQSort3 ( fmap, eclass, l, r ); - - /*-- scan bucket and generate header bits-- */ - cc = -1; - for (i = l; i <= r; i++) { - cc1 = eclass[fmap[i]]; - if (cc != cc1) { SET_BH(i); cc = cc1; }; - } - } - } - - if (verb >= 4) - VPrintf1 ( "%6d unresolved strings\n", nNotDone ); - - H *= 2; - if (H > nblock || nNotDone == 0) break; - } - - /*-- - Reconstruct the original block in - eclass8 [0 .. nblock-1], since the - previous phase destroyed it. - --*/ - if (verb >= 4) - VPrintf0 ( " reconstructing block ...\n" ); - j = 0; - for (i = 0; i < nblock; i++) { - while (ftabCopy[j] == 0) j++; - ftabCopy[j]--; - eclass8[fmap[i]] = (UChar)j; - } - AssertH ( j < 256, 1005 ); -} - -#undef SET_BH -#undef CLEAR_BH -#undef ISSET_BH -#undef WORD_BH -#undef UNALIGNED_BH - - -/*---------------------------------------------*/ -/*--- The main, O(N^2 log(N)) sorting ---*/ -/*--- algorithm. Faster for "normal" ---*/ -/*--- non-repetitive blocks. ---*/ -/*---------------------------------------------*/ - -/*---------------------------------------------*/ -static -__inline__ -Bool mainGtU ( UInt32 i1, - UInt32 i2, - UChar* block, - UInt16* quadrant, - UInt32 nblock, - Int32* budget ) -{ - Int32 k; - UChar c1, c2; - UInt16 s1, s2; - - AssertD ( i1 != i2, "mainGtU" ); - /* 1 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - i1++; i2++; - /* 2 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - i1++; i2++; - /* 3 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - i1++; i2++; - /* 4 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - i1++; i2++; - /* 5 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - i1++; i2++; - /* 6 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - i1++; i2++; - /* 7 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - i1++; i2++; - /* 8 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - i1++; i2++; - /* 9 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - i1++; i2++; - /* 10 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - i1++; i2++; - /* 11 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - i1++; i2++; - /* 12 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - i1++; i2++; - - k = nblock + 8; - - do { - /* 1 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - s1 = quadrant[i1]; s2 = quadrant[i2]; - if (s1 != s2) return (s1 > s2); - i1++; i2++; - /* 2 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - s1 = quadrant[i1]; s2 = quadrant[i2]; - if (s1 != s2) return (s1 > s2); - i1++; i2++; - /* 3 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - s1 = quadrant[i1]; s2 = quadrant[i2]; - if (s1 != s2) return (s1 > s2); - i1++; i2++; - /* 4 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - s1 = quadrant[i1]; s2 = quadrant[i2]; - if (s1 != s2) return (s1 > s2); - i1++; i2++; - /* 5 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - s1 = quadrant[i1]; s2 = quadrant[i2]; - if (s1 != s2) return (s1 > s2); - i1++; i2++; - /* 6 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - s1 = quadrant[i1]; s2 = quadrant[i2]; - if (s1 != s2) return (s1 > s2); - i1++; i2++; - /* 7 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - s1 = quadrant[i1]; s2 = quadrant[i2]; - if (s1 != s2) return (s1 > s2); - i1++; i2++; - /* 8 */ - c1 = block[i1]; c2 = block[i2]; - if (c1 != c2) return (c1 > c2); - s1 = quadrant[i1]; s2 = quadrant[i2]; - if (s1 != s2) return (s1 > s2); - i1++; i2++; - - if (i1 >= nblock) i1 -= nblock; - if (i2 >= nblock) i2 -= nblock; - - k -= 8; - (*budget)--; - } - while (k >= 0); - - return False; -} - - -/*---------------------------------------------*/ -/*-- - Knuth's increments seem to work better - than Incerpi-Sedgewick here. Possibly - because the number of elems to sort is - usually small, typically <= 20. ---*/ -static -Int32 incs[14] = { 1, 4, 13, 40, 121, 364, 1093, 3280, - 9841, 29524, 88573, 265720, - 797161, 2391484 }; - -static -void mainSimpleSort ( UInt32* ptr, - UChar* block, - UInt16* quadrant, - Int32 nblock, - Int32 lo, - Int32 hi, - Int32 d, - Int32* budget ) -{ - Int32 i, j, h, bigN, hp; - UInt32 v; - - bigN = hi - lo + 1; - if (bigN < 2) return; - - hp = 0; - while (incs[hp] < bigN) hp++; - hp--; - - for (; hp >= 0; hp--) { - h = incs[hp]; - - i = lo + h; - while (True) { - - /*-- copy 1 --*/ - if (i > hi) break; - v = ptr[i]; - j = i; - while ( mainGtU ( - ptr[j-h]+d, v+d, block, quadrant, nblock, budget - ) ) { - ptr[j] = ptr[j-h]; - j = j - h; - if (j <= (lo + h - 1)) break; - } - ptr[j] = v; - i++; - - /*-- copy 2 --*/ - if (i > hi) break; - v = ptr[i]; - j = i; - while ( mainGtU ( - ptr[j-h]+d, v+d, block, quadrant, nblock, budget - ) ) { - ptr[j] = ptr[j-h]; - j = j - h; - if (j <= (lo + h - 1)) break; - } - ptr[j] = v; - i++; - - /*-- copy 3 --*/ - if (i > hi) break; - v = ptr[i]; - j = i; - while ( mainGtU ( - ptr[j-h]+d, v+d, block, quadrant, nblock, budget - ) ) { - ptr[j] = ptr[j-h]; - j = j - h; - if (j <= (lo + h - 1)) break; - } - ptr[j] = v; - i++; - - if (*budget < 0) return; - } - } -} - - -/*---------------------------------------------*/ -/*-- - The following is an implementation of - an elegant 3-way quicksort for strings, - described in a paper "Fast Algorithms for - Sorting and Searching Strings", by Robert - Sedgewick and Jon L. Bentley. ---*/ - -#define mswap(zz1, zz2) \ - { Int32 zztmp = zz1; zz1 = zz2; zz2 = zztmp; } - -#define mvswap(zzp1, zzp2, zzn) \ -{ \ - Int32 yyp1 = (zzp1); \ - Int32 yyp2 = (zzp2); \ - Int32 yyn = (zzn); \ - while (yyn > 0) { \ - mswap(ptr[yyp1], ptr[yyp2]); \ - yyp1++; yyp2++; yyn--; \ - } \ -} - -static -__inline__ -UChar mmed3 ( UChar a, UChar b, UChar c ) -{ - UChar t; - if (a > b) { t = a; a = b; b = t; }; - if (b > c) { - b = c; - if (a > b) b = a; - } - return b; -} - -#define mmin(a,b) ((a) < (b)) ? (a) : (b) - -#define mpush(lz,hz,dz) { stackLo[sp] = lz; \ - stackHi[sp] = hz; \ - stackD [sp] = dz; \ - sp++; } - -#define mpop(lz,hz,dz) { sp--; \ - lz = stackLo[sp]; \ - hz = stackHi[sp]; \ - dz = stackD [sp]; } - - -#define mnextsize(az) (nextHi[az]-nextLo[az]) - -#define mnextswap(az,bz) \ - { Int32 tz; \ - tz = nextLo[az]; nextLo[az] = nextLo[bz]; nextLo[bz] = tz; \ - tz = nextHi[az]; nextHi[az] = nextHi[bz]; nextHi[bz] = tz; \ - tz = nextD [az]; nextD [az] = nextD [bz]; nextD [bz] = tz; } - - -#define MAIN_QSORT_SMALL_THRESH 20 -#define MAIN_QSORT_DEPTH_THRESH (BZ_N_RADIX + BZ_N_QSORT) -#define MAIN_QSORT_STACK_SIZE 100 - -static -void mainQSort3 ( UInt32* ptr, - UChar* block, - UInt16* quadrant, - Int32 nblock, - Int32 loSt, - Int32 hiSt, - Int32 dSt, - Int32* budget ) -{ - Int32 unLo, unHi, ltLo, gtHi, n, m, med; - Int32 sp, lo, hi, d; - - Int32 stackLo[MAIN_QSORT_STACK_SIZE]; - Int32 stackHi[MAIN_QSORT_STACK_SIZE]; - Int32 stackD [MAIN_QSORT_STACK_SIZE]; - - Int32 nextLo[3]; - Int32 nextHi[3]; - Int32 nextD [3]; - - sp = 0; - mpush ( loSt, hiSt, dSt ); - - while (sp > 0) { - - AssertH ( sp < MAIN_QSORT_STACK_SIZE - 2, 1001 ); - - mpop ( lo, hi, d ); - if (hi - lo < MAIN_QSORT_SMALL_THRESH || - d > MAIN_QSORT_DEPTH_THRESH) { - mainSimpleSort ( ptr, block, quadrant, nblock, lo, hi, d, budget ); - if (*budget < 0) return; - continue; - } - - med = (Int32) - mmed3 ( block[ptr[ lo ]+d], - block[ptr[ hi ]+d], - block[ptr[ (lo+hi)>>1 ]+d] ); - - unLo = ltLo = lo; - unHi = gtHi = hi; - - while (True) { - while (True) { - if (unLo > unHi) break; - n = ((Int32)block[ptr[unLo]+d]) - med; - if (n == 0) { - mswap(ptr[unLo], ptr[ltLo]); - ltLo++; unLo++; continue; - }; - if (n > 0) break; - unLo++; - } - while (True) { - if (unLo > unHi) break; - n = ((Int32)block[ptr[unHi]+d]) - med; - if (n == 0) { - mswap(ptr[unHi], ptr[gtHi]); - gtHi--; unHi--; continue; - }; - if (n < 0) break; - unHi--; - } - if (unLo > unHi) break; - mswap(ptr[unLo], ptr[unHi]); unLo++; unHi--; - } - - AssertD ( unHi == unLo-1, "mainQSort3(2)" ); - - if (gtHi < ltLo) { - mpush(lo, hi, d+1 ); - continue; - } - - n = mmin(ltLo-lo, unLo-ltLo); mvswap(lo, unLo-n, n); - m = mmin(hi-gtHi, gtHi-unHi); mvswap(unLo, hi-m+1, m); - - n = lo + unLo - ltLo - 1; - m = hi - (gtHi - unHi) + 1; - - nextLo[0] = lo; nextHi[0] = n; nextD[0] = d; - nextLo[1] = m; nextHi[1] = hi; nextD[1] = d; - nextLo[2] = n+1; nextHi[2] = m-1; nextD[2] = d+1; - - if (mnextsize(0) < mnextsize(1)) mnextswap(0,1); - if (mnextsize(1) < mnextsize(2)) mnextswap(1,2); - if (mnextsize(0) < mnextsize(1)) mnextswap(0,1); - - AssertD (mnextsize(0) >= mnextsize(1), "mainQSort3(8)" ); - AssertD (mnextsize(1) >= mnextsize(2), "mainQSort3(9)" ); - - mpush (nextLo[0], nextHi[0], nextD[0]); - mpush (nextLo[1], nextHi[1], nextD[1]); - mpush (nextLo[2], nextHi[2], nextD[2]); - } -} - -#undef mswap -#undef mvswap -#undef mpush -#undef mpop -#undef mmin -#undef mnextsize -#undef mnextswap -#undef MAIN_QSORT_SMALL_THRESH -#undef MAIN_QSORT_DEPTH_THRESH -#undef MAIN_QSORT_STACK_SIZE - - -/*---------------------------------------------*/ -/* Pre: - nblock > N_OVERSHOOT - block32 exists for [0 .. nblock-1 +N_OVERSHOOT] - ((UChar*)block32) [0 .. nblock-1] holds block - ptr exists for [0 .. nblock-1] - - Post: - ((UChar*)block32) [0 .. nblock-1] holds block - All other areas of block32 destroyed - ftab [0 .. 65536 ] destroyed - ptr [0 .. nblock-1] holds sorted order - if (*budget < 0), sorting was abandoned -*/ - -#define BIGFREQ(b) (ftab[((b)+1) << 8] - ftab[(b) << 8]) -#define SETMASK (1 << 21) -#define CLEARMASK (~(SETMASK)) - -static -void mainSort ( UInt32* ptr, - UChar* block, - UInt16* quadrant, - UInt32* ftab, - Int32 nblock, - Int32 verb, - Int32* budget ) -{ - Int32 i, j, k, ss, sb; - Int32 runningOrder[256]; - Bool bigDone[256]; - Int32 copyStart[256]; - Int32 copyEnd [256]; - UChar c1; - Int32 numQSorted; - UInt16 s; - if (verb >= 4) VPrintf0 ( " main sort initialise ...\n" ); - - /*-- set up the 2-byte frequency table --*/ - for (i = 65536; i >= 0; i--) ftab[i] = 0; - - j = block[0] << 8; - i = nblock-1; - for (; i >= 3; i -= 4) { - quadrant[i] = 0; - j = (j >> 8) | ( ((UInt16)block[i]) << 8); - ftab[j]++; - quadrant[i-1] = 0; - j = (j >> 8) | ( ((UInt16)block[i-1]) << 8); - ftab[j]++; - quadrant[i-2] = 0; - j = (j >> 8) | ( ((UInt16)block[i-2]) << 8); - ftab[j]++; - quadrant[i-3] = 0; - j = (j >> 8) | ( ((UInt16)block[i-3]) << 8); - ftab[j]++; - } - for (; i >= 0; i--) { - quadrant[i] = 0; - j = (j >> 8) | ( ((UInt16)block[i]) << 8); - ftab[j]++; - } - - /*-- (emphasises close relationship of block & quadrant) --*/ - for (i = 0; i < BZ_N_OVERSHOOT; i++) { - block [nblock+i] = block[i]; - quadrant[nblock+i] = 0; - } - - if (verb >= 4) VPrintf0 ( " bucket sorting ...\n" ); - - /*-- Complete the initial radix sort --*/ - for (i = 1; i <= 65536; i++) ftab[i] += ftab[i-1]; - - s = block[0] << 8; - i = nblock-1; - for (; i >= 3; i -= 4) { - s = (s >> 8) | (block[i] << 8); - j = ftab[s] -1; - ftab[s] = j; - ptr[j] = i; - s = (s >> 8) | (block[i-1] << 8); - j = ftab[s] -1; - ftab[s] = j; - ptr[j] = i-1; - s = (s >> 8) | (block[i-2] << 8); - j = ftab[s] -1; - ftab[s] = j; - ptr[j] = i-2; - s = (s >> 8) | (block[i-3] << 8); - j = ftab[s] -1; - ftab[s] = j; - ptr[j] = i-3; - } - for (; i >= 0; i--) { - s = (s >> 8) | (block[i] << 8); - j = ftab[s] -1; - ftab[s] = j; - ptr[j] = i; - } - - /*-- - Now ftab contains the first loc of every small bucket. - Calculate the running order, from smallest to largest - big bucket. - --*/ - for (i = 0; i <= 255; i++) { - bigDone [i] = False; - runningOrder[i] = i; - } - - { - Int32 vv; - Int32 h = 1; - do h = 3 * h + 1; while (h <= 256); - do { - h = h / 3; - for (i = h; i <= 255; i++) { - vv = runningOrder[i]; - j = i; - while ( BIGFREQ(runningOrder[j-h]) > BIGFREQ(vv) ) { - runningOrder[j] = runningOrder[j-h]; - j = j - h; - if (j <= (h - 1)) goto zero; - } - zero: - runningOrder[j] = vv; - } - } while (h != 1); - } - - /*-- - The main sorting loop. - --*/ - - numQSorted = 0; - - for (i = 0; i <= 255; i++) { - - /*-- - Process big buckets, starting with the least full. - Basically this is a 3-step process in which we call - mainQSort3 to sort the small buckets [ss, j], but - also make a big effort to avoid the calls if we can. - --*/ - ss = runningOrder[i]; - - /*-- - Step 1: - Complete the big bucket [ss] by quicksorting - any unsorted small buckets [ss, j], for j != ss. - Hopefully previous pointer-scanning phases have already - completed many of the small buckets [ss, j], so - we don't have to sort them at all. - --*/ - for (j = 0; j <= 255; j++) { - if (j != ss) { - sb = (ss << 8) + j; - if ( ! (ftab[sb] & SETMASK) ) { - Int32 lo = ftab[sb] & CLEARMASK; - Int32 hi = (ftab[sb+1] & CLEARMASK) - 1; - if (hi > lo) { - if (verb >= 4) - VPrintf4 ( " qsort [0x%x, 0x%x] " - "done %d this %d\n", - ss, j, numQSorted, hi - lo + 1 ); - mainQSort3 ( - ptr, block, quadrant, nblock, - lo, hi, BZ_N_RADIX, budget - ); - numQSorted += (hi - lo + 1); - if (*budget < 0) return; - } - } - ftab[sb] |= SETMASK; - } - } - - AssertH ( !bigDone[ss], 1006 ); - - /*-- - Step 2: - Now scan this big bucket [ss] so as to synthesise the - sorted order for small buckets [t, ss] for all t, - including, magically, the bucket [ss,ss] too. - This will avoid doing Real Work in subsequent Step 1's. - --*/ - { - for (j = 0; j <= 255; j++) { - copyStart[j] = ftab[(j << 8) + ss] & CLEARMASK; - copyEnd [j] = (ftab[(j << 8) + ss + 1] & CLEARMASK) - 1; - } - for (j = ftab[ss << 8] & CLEARMASK; j < copyStart[ss]; j++) { - k = ptr[j]-1; if (k < 0) k += nblock; - c1 = block[k]; - if (!bigDone[c1]) - ptr[ copyStart[c1]++ ] = k; - } - for (j = (ftab[(ss+1) << 8] & CLEARMASK) - 1; j > copyEnd[ss]; j--) { - k = ptr[j]-1; if (k < 0) k += nblock; - c1 = block[k]; - if (!bigDone[c1]) - ptr[ copyEnd[c1]-- ] = k; - } - } - - AssertH ( (copyStart[ss]-1 == copyEnd[ss]) - || - /* Extremely rare case missing in bzip2-1.0.0 and 1.0.1. - Necessity for this case is demonstrated by compressing - a sequence of approximately 48.5 million of character - 251; 1.0.0/1.0.1 will then die here. */ - (copyStart[ss] == 0 && copyEnd[ss] == nblock-1), - 1007 ) - - for (j = 0; j <= 255; j++) ftab[(j << 8) + ss] |= SETMASK; - - /*-- - Step 3: - The [ss] big bucket is now done. Record this fact, - and update the quadrant descriptors. Remember to - update quadrants in the overshoot area too, if - necessary. The "if (i < 255)" test merely skips - this updating for the last bucket processed, since - updating for the last bucket is pointless. - - The quadrant array provides a way to incrementally - cache sort orderings, as they appear, so as to - make subsequent comparisons in fullGtU() complete - faster. For repetitive blocks this makes a big - difference (but not big enough to be able to avoid - the fallback sorting mechanism, exponential radix sort). - - The precise meaning is: at all times: - - for 0 <= i < nblock and 0 <= j <= nblock - - if block[i] != block[j], - - then the relative values of quadrant[i] and - quadrant[j] are meaningless. - - else { - if quadrant[i] < quadrant[j] - then the string starting at i lexicographically - precedes the string starting at j - - else if quadrant[i] > quadrant[j] - then the string starting at j lexicographically - precedes the string starting at i - - else - the relative ordering of the strings starting - at i and j has not yet been determined. - } - --*/ - bigDone[ss] = True; - - if (i < 255) { - Int32 bbStart = ftab[ss << 8] & CLEARMASK; - Int32 bbSize = (ftab[(ss+1) << 8] & CLEARMASK) - bbStart; - Int32 shifts = 0; - - while ((bbSize >> shifts) > 65534) shifts++; - - for (j = bbSize-1; j >= 0; j--) { - Int32 a2update = ptr[bbStart + j]; - UInt16 qVal = (UInt16)(j >> shifts); - quadrant[a2update] = qVal; - if (a2update < BZ_N_OVERSHOOT) - quadrant[a2update + nblock] = qVal; - } - AssertH ( ((bbSize-1) >> shifts) <= 65535, 1002 ); - } - - } - - if (verb >= 4) - VPrintf3 ( " %d pointers, %d sorted, %d scanned\n", - nblock, numQSorted, nblock - numQSorted ); -} - -#undef BIGFREQ -#undef SETMASK -#undef CLEARMASK - - -/*---------------------------------------------*/ -/* Pre: - nblock > 0 - arr2 exists for [0 .. nblock-1 +N_OVERSHOOT] - ((UChar*)arr2) [0 .. nblock-1] holds block - arr1 exists for [0 .. nblock-1] - - Post: - ((UChar*)arr2) [0 .. nblock-1] holds block - All other areas of block destroyed - ftab [ 0 .. 65536 ] destroyed - arr1 [0 .. nblock-1] holds sorted order -*/ -void BZ2_blockSort ( EState* s ) -{ - UInt32* ptr = s->ptr; - UChar* block = s->block; - UInt32* ftab = s->ftab; - Int32 nblock = s->nblock; - Int32 verb = s->verbosity; - Int32 wfact = s->workFactor; - UInt16* quadrant; - Int32 budget; - Int32 budgetInit; - Int32 i; - - if (nblock < 10000) { - fallbackSort ( s->arr1, s->arr2, ftab, nblock, verb ); - } else { - /* Calculate the location for quadrant, remembering to get - the alignment right. Assumes that &(block[0]) is at least - 2-byte aligned -- this should be ok since block is really - the first section of arr2. - */ - i = nblock+BZ_N_OVERSHOOT; - if (i & 1) i++; - quadrant = (UInt16*)(&(block[i])); - - /* (wfact-1) / 3 puts the default-factor-30 - transition point at very roughly the same place as - with v0.1 and v0.9.0. - Not that it particularly matters any more, since the - resulting compressed stream is now the same regardless - of whether or not we use the main sort or fallback sort. - */ - if (wfact < 1 ) wfact = 1; - if (wfact > 100) wfact = 100; - budgetInit = nblock * ((wfact-1) / 3); - budget = budgetInit; - - mainSort ( ptr, block, quadrant, ftab, nblock, verb, &budget ); - if (verb >= 3) - VPrintf3 ( " %d work, %d block, ratio %5.2f\n", - budgetInit - budget, - nblock, - (float)(budgetInit - budget) / - (float)(nblock==0 ? 1 : nblock) ); - if (budget < 0) { - if (verb >= 2) - VPrintf0 ( " too repetitive; using fallback" - " sorting algorithm\n" ); - fallbackSort ( s->arr1, s->arr2, ftab, nblock, verb ); - } - } - - s->origPtr = -1; - for (i = 0; i < s->nblock; i++) - if (ptr[i] == 0) - { s->origPtr = i; break; }; - - AssertH( s->origPtr != -1, 1003 ); -} - - -/*-------------------------------------------------------------*/ -/*--- end blocksort.c ---*/ -/*-------------------------------------------------------------*/ diff --git a/dep/bzip2/src/bzlib.c b/dep/bzip2/src/bzlib.c deleted file mode 100644 index 6d28d13d..00000000 --- a/dep/bzip2/src/bzlib.c +++ /dev/null @@ -1,1580 +0,0 @@ - -/*-------------------------------------------------------------*/ -/*--- Library top-level functions. ---*/ -/*--- bzlib.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 - - 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 -- made zero-length BZ_FLUSH work correctly in bzCompress(). - fixed bzWrite/bzRead to ignore zero-length requests. - fixed bzread to correctly handle read requests after EOF. - wrong parameter order in call to bzDecompressInit in - bzBuffToBuffDecompress. Fixed. -*/ - -#include "bzlib_private.h" - - -/*---------------------------------------------------*/ -/*--- Compression stuff ---*/ -/*---------------------------------------------------*/ - - -/*---------------------------------------------------*/ -#ifndef BZ_NO_STDIO -void BZ2_bz__AssertH__fail ( int errcode ) -{ - fprintf(stderr, - "\n\nbzip2/libbzip2: internal error number %d.\n" - "This is a bug in bzip2/libbzip2, %s.\n" - "Please report it to me at: jseward@bzip.org. If this happened\n" - "when you were using some program which uses libbzip2 as a\n" - "component, you should also report this bug to the author(s)\n" - "of that program. Please make an effort to report this bug;\n" - "timely and accurate bug reports eventually lead to higher\n" - "quality software. Thanks. Julian Seward, 10 December 2007.\n\n", - errcode, - BZ2_bzlibVersion() - ); - - if (errcode == 1007) { - fprintf(stderr, - "\n*** A special note about internal error number 1007 ***\n" - "\n" - "Experience suggests that a common cause of i.e. 1007\n" - "is unreliable memory or other hardware. The 1007 assertion\n" - "just happens to cross-check the results of huge numbers of\n" - "memory reads/writes, and so acts (unintendedly) as a stress\n" - "test of your memory system.\n" - "\n" - "I suggest the following: try compressing the file again,\n" - "possibly monitoring progress in detail with the -vv flag.\n" - "\n" - "* If the error cannot be reproduced, and/or happens at different\n" - " points in compression, you may have a flaky memory system.\n" - " Try a memory-test program. I have used Memtest86\n" - " (www.memtest86.com). At the time of writing it is free (GPLd).\n" - " Memtest86 tests memory much more thorougly than your BIOSs\n" - " power-on test, and may find failures that the BIOS doesn't.\n" - "\n" - "* If the error can be repeatably reproduced, this is a bug in\n" - " bzip2, and I would very much like to hear about it. Please\n" - " let me know, and, ideally, save a copy of the file causing the\n" - " problem -- without which I will be unable to investigate it.\n" - "\n" - ); - } - - exit(3); -} -#endif - - -/*---------------------------------------------------*/ -static -int bz_config_ok ( void ) -{ - if (sizeof(int) != 4) return 0; - if (sizeof(short) != 2) return 0; - if (sizeof(char) != 1) return 0; - return 1; -} - - -/*---------------------------------------------------*/ -static -void* default_bzalloc ( void* opaque, Int32 items, Int32 size ) -{ - void* v = malloc ( items * size ); - return v; -} - -static -void default_bzfree ( void* opaque, void* addr ) -{ - if (addr != NULL) free ( addr ); -} - - -/*---------------------------------------------------*/ -static -void prepare_new_block ( EState* s ) -{ - Int32 i; - s->nblock = 0; - s->numZ = 0; - s->state_out_pos = 0; - BZ_INITIALISE_CRC ( s->blockCRC ); - for (i = 0; i < 256; i++) s->inUse[i] = False; - s->blockNo++; -} - - -/*---------------------------------------------------*/ -static -void init_RL ( EState* s ) -{ - s->state_in_ch = 256; - s->state_in_len = 0; -} - - -static -Bool isempty_RL ( EState* s ) -{ - if (s->state_in_ch < 256 && s->state_in_len > 0) - return False; else - return True; -} - - -/*---------------------------------------------------*/ -int BZ_API(BZ2_bzCompressInit) - ( bz_stream* strm, - int blockSize100k, - int verbosity, - int workFactor ) -{ - Int32 n; - EState* s; - - if (!bz_config_ok()) return BZ_CONFIG_ERROR; - - if (strm == NULL || - blockSize100k < 1 || blockSize100k > 9 || - workFactor < 0 || workFactor > 250) - return BZ_PARAM_ERROR; - - if (workFactor == 0) workFactor = 30; - if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc; - if (strm->bzfree == NULL) strm->bzfree = default_bzfree; - - s = BZALLOC( sizeof(EState) ); - if (s == NULL) return BZ_MEM_ERROR; - s->strm = strm; - - s->arr1 = NULL; - s->arr2 = NULL; - s->ftab = NULL; - - n = 100000 * blockSize100k; - s->arr1 = BZALLOC( n * sizeof(UInt32) ); - s->arr2 = BZALLOC( (n+BZ_N_OVERSHOOT) * sizeof(UInt32) ); - s->ftab = BZALLOC( 65537 * sizeof(UInt32) ); - - if (s->arr1 == NULL || s->arr2 == NULL || s->ftab == NULL) { - if (s->arr1 != NULL) BZFREE(s->arr1); - if (s->arr2 != NULL) BZFREE(s->arr2); - if (s->ftab != NULL) BZFREE(s->ftab); - if (s != NULL) BZFREE(s); - return BZ_MEM_ERROR; - } - - s->blockNo = 0; - s->state = BZ_S_INPUT; - s->mode = BZ_M_RUNNING; - s->combinedCRC = 0; - s->blockSize100k = blockSize100k; - s->nblockMAX = 100000 * blockSize100k - 19; - s->verbosity = verbosity; - s->workFactor = workFactor; - - s->block = (UChar*)s->arr2; - s->mtfv = (UInt16*)s->arr1; - s->zbits = NULL; - s->ptr = (UInt32*)s->arr1; - - strm->state = s; - strm->total_in_lo32 = 0; - strm->total_in_hi32 = 0; - strm->total_out_lo32 = 0; - strm->total_out_hi32 = 0; - init_RL ( s ); - prepare_new_block ( s ); - return BZ_OK; -} - - -/*---------------------------------------------------*/ -static -void add_pair_to_block ( EState* s ) -{ - Int32 i; - UChar ch = (UChar)(s->state_in_ch); - for (i = 0; i < s->state_in_len; i++) { - BZ_UPDATE_CRC( s->blockCRC, ch ); - } - s->inUse[s->state_in_ch] = True; - switch (s->state_in_len) { - case 1: - s->block[s->nblock] = (UChar)ch; s->nblock++; - break; - case 2: - s->block[s->nblock] = (UChar)ch; s->nblock++; - s->block[s->nblock] = (UChar)ch; s->nblock++; - break; - case 3: - s->block[s->nblock] = (UChar)ch; s->nblock++; - s->block[s->nblock] = (UChar)ch; s->nblock++; - s->block[s->nblock] = (UChar)ch; s->nblock++; - break; - default: - s->inUse[s->state_in_len-4] = True; - s->block[s->nblock] = (UChar)ch; s->nblock++; - s->block[s->nblock] = (UChar)ch; s->nblock++; - s->block[s->nblock] = (UChar)ch; s->nblock++; - s->block[s->nblock] = (UChar)ch; s->nblock++; - s->block[s->nblock] = ((UChar)(s->state_in_len-4)); - s->nblock++; - break; - } -} - - -/*---------------------------------------------------*/ -static -void flush_RL ( EState* s ) -{ - if (s->state_in_ch < 256) add_pair_to_block ( s ); - init_RL ( s ); -} - - -/*---------------------------------------------------*/ -#define ADD_CHAR_TO_BLOCK(zs,zchh0) \ -{ \ - UInt32 zchh = (UInt32)(zchh0); \ - /*-- fast track the common case --*/ \ - if (zchh != zs->state_in_ch && \ - zs->state_in_len == 1) { \ - UChar ch = (UChar)(zs->state_in_ch); \ - BZ_UPDATE_CRC( zs->blockCRC, ch ); \ - zs->inUse[zs->state_in_ch] = True; \ - zs->block[zs->nblock] = (UChar)ch; \ - zs->nblock++; \ - zs->state_in_ch = zchh; \ - } \ - else \ - /*-- general, uncommon cases --*/ \ - if (zchh != zs->state_in_ch || \ - zs->state_in_len == 255) { \ - if (zs->state_in_ch < 256) \ - add_pair_to_block ( zs ); \ - zs->state_in_ch = zchh; \ - zs->state_in_len = 1; \ - } else { \ - zs->state_in_len++; \ - } \ -} - - -/*---------------------------------------------------*/ -static -Bool copy_input_until_stop ( EState* s ) -{ - Bool progress_in = False; - - if (s->mode == BZ_M_RUNNING) { - - /*-- fast track the common case --*/ - while (True) { - /*-- block full? --*/ - if (s->nblock >= s->nblockMAX) break; - /*-- no input? --*/ - if (s->strm->avail_in == 0) break; - progress_in = True; - ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) ); - 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++; - } - - } else { - - /*-- general, uncommon case --*/ - while (True) { - /*-- block full? --*/ - if (s->nblock >= s->nblockMAX) break; - /*-- no input? --*/ - if (s->strm->avail_in == 0) break; - /*-- flush/finish end? --*/ - if (s->avail_in_expect == 0) break; - progress_in = True; - ADD_CHAR_TO_BLOCK ( s, (UInt32)(*((UChar*)(s->strm->next_in))) ); - 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++; - s->avail_in_expect--; - } - } - return progress_in; -} - - -/*---------------------------------------------------*/ -static -Bool copy_output_until_stop ( EState* s ) -{ - Bool progress_out = False; - - while (True) { - - /*-- no output space? --*/ - if (s->strm->avail_out == 0) break; - - /*-- block done? --*/ - if (s->state_out_pos >= s->numZ) break; - - progress_out = True; - *(s->strm->next_out) = s->zbits[s->state_out_pos]; - s->state_out_pos++; - s->strm->avail_out--; - s->strm->next_out++; - s->strm->total_out_lo32++; - if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; - } - - return progress_out; -} - - -/*---------------------------------------------------*/ -static -Bool handle_compress ( bz_stream* strm ) -{ - Bool progress_in = False; - Bool progress_out = False; - EState* s = strm->state; - - while (True) { - - if (s->state == BZ_S_OUTPUT) { - progress_out |= copy_output_until_stop ( s ); - if (s->state_out_pos < s->numZ) break; - if (s->mode == BZ_M_FINISHING && - s->avail_in_expect == 0 && - isempty_RL(s)) break; - prepare_new_block ( s ); - s->state = BZ_S_INPUT; - if (s->mode == BZ_M_FLUSHING && - s->avail_in_expect == 0 && - isempty_RL(s)) break; - } - - if (s->state == BZ_S_INPUT) { - progress_in |= copy_input_until_stop ( s ); - if (s->mode != BZ_M_RUNNING && s->avail_in_expect == 0) { - flush_RL ( s ); - BZ2_compressBlock ( s, (Bool)(s->mode == BZ_M_FINISHING) ); - s->state = BZ_S_OUTPUT; - } - else - if (s->nblock >= s->nblockMAX) { - BZ2_compressBlock ( s, False ); - s->state = BZ_S_OUTPUT; - } - else - if (s->strm->avail_in == 0) { - break; - } - } - - } - - return progress_in || progress_out; -} - - -/*---------------------------------------------------*/ -int BZ_API(BZ2_bzCompress) ( bz_stream *strm, int action ) -{ - Bool progress; - EState* s; - if (strm == NULL) return BZ_PARAM_ERROR; - s = strm->state; - if (s == NULL) return BZ_PARAM_ERROR; - if (s->strm != strm) return BZ_PARAM_ERROR; - - preswitch: - switch (s->mode) { - - case BZ_M_IDLE: - return BZ_SEQUENCE_ERROR; - - case BZ_M_RUNNING: - if (action == BZ_RUN) { - progress = handle_compress ( strm ); - return progress ? BZ_RUN_OK : BZ_PARAM_ERROR; - } - else - if (action == BZ_FLUSH) { - s->avail_in_expect = strm->avail_in; - s->mode = BZ_M_FLUSHING; - goto preswitch; - } - else - if (action == BZ_FINISH) { - s->avail_in_expect = strm->avail_in; - s->mode = BZ_M_FINISHING; - goto preswitch; - } - else - return BZ_PARAM_ERROR; - - case BZ_M_FLUSHING: - if (action != BZ_FLUSH) return BZ_SEQUENCE_ERROR; - if (s->avail_in_expect != s->strm->avail_in) - return BZ_SEQUENCE_ERROR; - progress = handle_compress ( strm ); - if (s->avail_in_expect > 0 || !isempty_RL(s) || - s->state_out_pos < s->numZ) return BZ_FLUSH_OK; - s->mode = BZ_M_RUNNING; - return BZ_RUN_OK; - - case BZ_M_FINISHING: - if (action != BZ_FINISH) return BZ_SEQUENCE_ERROR; - if (s->avail_in_expect != s->strm->avail_in) - return BZ_SEQUENCE_ERROR; - progress = handle_compress ( strm ); - if (!progress) return BZ_SEQUENCE_ERROR; - if (s->avail_in_expect > 0 || !isempty_RL(s) || - s->state_out_pos < s->numZ) return BZ_FINISH_OK; - s->mode = BZ_M_IDLE; - return BZ_STREAM_END; - } - return BZ_OK; /*--not reached--*/ -} - - -/*---------------------------------------------------*/ -int BZ_API(BZ2_bzCompressEnd) ( bz_stream *strm ) -{ - EState* s; - if (strm == NULL) return BZ_PARAM_ERROR; - s = strm->state; - if (s == NULL) return BZ_PARAM_ERROR; - if (s->strm != strm) return BZ_PARAM_ERROR; - - if (s->arr1 != NULL) BZFREE(s->arr1); - if (s->arr2 != NULL) BZFREE(s->arr2); - if (s->ftab != NULL) BZFREE(s->ftab); - BZFREE(strm->state); - - strm->state = NULL; - - return BZ_OK; -} - - -/*---------------------------------------------------*/ -/*--- Decompression stuff ---*/ -/*---------------------------------------------------*/ - -/*---------------------------------------------------*/ -int BZ_API(BZ2_bzDecompressInit) - ( bz_stream* strm, - int verbosity, - int small ) -{ - DState* s; - - if (!bz_config_ok()) return BZ_CONFIG_ERROR; - - if (strm == NULL) return BZ_PARAM_ERROR; - if (small != 0 && small != 1) return BZ_PARAM_ERROR; - if (verbosity < 0 || verbosity > 4) return BZ_PARAM_ERROR; - - if (strm->bzalloc == NULL) strm->bzalloc = default_bzalloc; - if (strm->bzfree == NULL) strm->bzfree = default_bzfree; - - s = BZALLOC( sizeof(DState) ); - if (s == NULL) return BZ_MEM_ERROR; - s->strm = strm; - strm->state = s; - s->state = BZ_X_MAGIC_1; - s->bsLive = 0; - s->bsBuff = 0; - s->calculatedCombinedCRC = 0; - strm->total_in_lo32 = 0; - strm->total_in_hi32 = 0; - strm->total_out_lo32 = 0; - strm->total_out_hi32 = 0; - s->smallDecompress = (Bool)small; - s->ll4 = NULL; - s->ll16 = NULL; - s->tt = NULL; - s->currBlockNo = 0; - s->verbosity = verbosity; - - return BZ_OK; -} - - -/*---------------------------------------------------*/ -/* Return True iff data corruption is discovered. - Returns False if there is no problem. -*/ -static -Bool unRLE_obuf_to_output_FAST ( DState* s ) -{ - UChar k1; - - if (s->blockRandomised) { - - while (True) { - /* try to finish existing run */ - while (True) { - if (s->strm->avail_out == 0) return False; - if (s->state_out_len == 0) break; - *( (UChar*)(s->strm->next_out) ) = s->state_out_ch; - BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch ); - s->state_out_len--; - s->strm->next_out++; - s->strm->avail_out--; - s->strm->total_out_lo32++; - if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; - } - - /* can a new run be started? */ - if (s->nblock_used == s->save_nblock+1) return False; - - /* Only caused by corrupt data stream? */ - if (s->nblock_used > s->save_nblock+1) - return True; - - s->state_out_len = 1; - s->state_out_ch = s->k0; - BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; - k1 ^= BZ_RAND_MASK; s->nblock_used++; - if (s->nblock_used == s->save_nblock+1) continue; - if (k1 != s->k0) { s->k0 = k1; continue; }; - - s->state_out_len = 2; - BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; - k1 ^= BZ_RAND_MASK; s->nblock_used++; - if (s->nblock_used == s->save_nblock+1) continue; - if (k1 != s->k0) { s->k0 = k1; continue; }; - - s->state_out_len = 3; - BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; - k1 ^= BZ_RAND_MASK; s->nblock_used++; - if (s->nblock_used == s->save_nblock+1) continue; - if (k1 != s->k0) { s->k0 = k1; continue; }; - - BZ_GET_FAST(k1); BZ_RAND_UPD_MASK; - k1 ^= BZ_RAND_MASK; s->nblock_used++; - s->state_out_len = ((Int32)k1) + 4; - BZ_GET_FAST(s->k0); BZ_RAND_UPD_MASK; - s->k0 ^= BZ_RAND_MASK; s->nblock_used++; - } - - } else { - - /* restore */ - UInt32 c_calculatedBlockCRC = s->calculatedBlockCRC; - UChar c_state_out_ch = s->state_out_ch; - Int32 c_state_out_len = s->state_out_len; - Int32 c_nblock_used = s->nblock_used; - Int32 c_k0 = s->k0; - UInt32* c_tt = s->tt; - UInt32 c_tPos = s->tPos; - char* cs_next_out = s->strm->next_out; - unsigned int cs_avail_out = s->strm->avail_out; - Int32 ro_blockSize100k = s->blockSize100k; - /* end restore */ - - UInt32 avail_out_INIT = cs_avail_out; - Int32 s_save_nblockPP = s->save_nblock+1; - unsigned int total_out_lo32_old; - - while (True) { - - /* try to finish existing run */ - if (c_state_out_len > 0) { - while (True) { - if (cs_avail_out == 0) goto return_notr; - if (c_state_out_len == 1) break; - *( (UChar*)(cs_next_out) ) = c_state_out_ch; - BZ_UPDATE_CRC ( c_calculatedBlockCRC, c_state_out_ch ); - c_state_out_len--; - cs_next_out++; - cs_avail_out--; - } - s_state_out_len_eq_one: - { - if (cs_avail_out == 0) { - c_state_out_len = 1; goto return_notr; - }; - *( (UChar*)(cs_next_out) ) = c_state_out_ch; - BZ_UPDATE_CRC ( c_calculatedBlockCRC, c_state_out_ch ); - cs_next_out++; - cs_avail_out--; - } - } - /* Only caused by corrupt data stream? */ - if (c_nblock_used > s_save_nblockPP) - return True; - - /* can a new run be started? */ - if (c_nblock_used == s_save_nblockPP) { - c_state_out_len = 0; goto return_notr; - }; - c_state_out_ch = c_k0; - BZ_GET_FAST_C(k1); c_nblock_used++; - if (k1 != c_k0) { - c_k0 = k1; goto s_state_out_len_eq_one; - }; - if (c_nblock_used == s_save_nblockPP) - goto s_state_out_len_eq_one; - - c_state_out_len = 2; - BZ_GET_FAST_C(k1); c_nblock_used++; - if (c_nblock_used == s_save_nblockPP) continue; - if (k1 != c_k0) { c_k0 = k1; continue; }; - - c_state_out_len = 3; - BZ_GET_FAST_C(k1); c_nblock_used++; - if (c_nblock_used == s_save_nblockPP) continue; - if (k1 != c_k0) { c_k0 = k1; continue; }; - - BZ_GET_FAST_C(k1); c_nblock_used++; - c_state_out_len = ((Int32)k1) + 4; - BZ_GET_FAST_C(c_k0); c_nblock_used++; - } - - return_notr: - total_out_lo32_old = s->strm->total_out_lo32; - s->strm->total_out_lo32 += (avail_out_INIT - cs_avail_out); - if (s->strm->total_out_lo32 < total_out_lo32_old) - s->strm->total_out_hi32++; - - /* save */ - s->calculatedBlockCRC = c_calculatedBlockCRC; - s->state_out_ch = c_state_out_ch; - s->state_out_len = c_state_out_len; - s->nblock_used = c_nblock_used; - s->k0 = c_k0; - s->tt = c_tt; - s->tPos = c_tPos; - s->strm->next_out = cs_next_out; - s->strm->avail_out = cs_avail_out; - /* end save */ - } - return False; -} - - - -/*---------------------------------------------------*/ -__inline__ Int32 BZ2_indexIntoF ( Int32 indx, Int32 *cftab ) -{ - Int32 nb, na, mid; - nb = 0; - na = 256; - do { - mid = (nb + na) >> 1; - if (indx >= cftab[mid]) nb = mid; else na = mid; - } - while (na - nb != 1); - return nb; -} - - -/*---------------------------------------------------*/ -/* Return True iff data corruption is discovered. - Returns False if there is no problem. -*/ -static -Bool unRLE_obuf_to_output_SMALL ( DState* s ) -{ - UChar k1; - - if (s->blockRandomised) { - - while (True) { - /* try to finish existing run */ - while (True) { - if (s->strm->avail_out == 0) return False; - if (s->state_out_len == 0) break; - *( (UChar*)(s->strm->next_out) ) = s->state_out_ch; - BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch ); - s->state_out_len--; - s->strm->next_out++; - s->strm->avail_out--; - s->strm->total_out_lo32++; - if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; - } - - /* can a new run be started? */ - if (s->nblock_used == s->save_nblock+1) return False; - - /* Only caused by corrupt data stream? */ - if (s->nblock_used > s->save_nblock+1) - return True; - - s->state_out_len = 1; - s->state_out_ch = s->k0; - BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; - k1 ^= BZ_RAND_MASK; s->nblock_used++; - if (s->nblock_used == s->save_nblock+1) continue; - if (k1 != s->k0) { s->k0 = k1; continue; }; - - s->state_out_len = 2; - BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; - k1 ^= BZ_RAND_MASK; s->nblock_used++; - if (s->nblock_used == s->save_nblock+1) continue; - if (k1 != s->k0) { s->k0 = k1; continue; }; - - s->state_out_len = 3; - BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; - k1 ^= BZ_RAND_MASK; s->nblock_used++; - if (s->nblock_used == s->save_nblock+1) continue; - if (k1 != s->k0) { s->k0 = k1; continue; }; - - BZ_GET_SMALL(k1); BZ_RAND_UPD_MASK; - k1 ^= BZ_RAND_MASK; s->nblock_used++; - s->state_out_len = ((Int32)k1) + 4; - BZ_GET_SMALL(s->k0); BZ_RAND_UPD_MASK; - s->k0 ^= BZ_RAND_MASK; s->nblock_used++; - } - - } else { - - while (True) { - /* try to finish existing run */ - while (True) { - if (s->strm->avail_out == 0) return False; - if (s->state_out_len == 0) break; - *( (UChar*)(s->strm->next_out) ) = s->state_out_ch; - BZ_UPDATE_CRC ( s->calculatedBlockCRC, s->state_out_ch ); - s->state_out_len--; - s->strm->next_out++; - s->strm->avail_out--; - s->strm->total_out_lo32++; - if (s->strm->total_out_lo32 == 0) s->strm->total_out_hi32++; - } - - /* can a new run be started? */ - if (s->nblock_used == s->save_nblock+1) return False; - - /* Only caused by corrupt data stream? */ - if (s->nblock_used > s->save_nblock+1) - return True; - - s->state_out_len = 1; - s->state_out_ch = s->k0; - BZ_GET_SMALL(k1); s->nblock_used++; - if (s->nblock_used == s->save_nblock+1) continue; - if (k1 != s->k0) { s->k0 = k1; continue; }; - - s->state_out_len = 2; - BZ_GET_SMALL(k1); s->nblock_used++; - if (s->nblock_used == s->save_nblock+1) continue; - if (k1 != s->k0) { s->k0 = k1; continue; }; - - s->state_out_len = 3; - BZ_GET_SMALL(k1); s->nblock_used++; - if (s->nblock_used == s->save_nblock+1) continue; - if (k1 != s->k0) { s->k0 = k1; continue; }; - - BZ_GET_SMALL(k1); s->nblock_used++; - s->state_out_len = ((Int32)k1) + 4; - BZ_GET_SMALL(s->k0); s->nblock_used++; - } - - } -} - - -/*---------------------------------------------------*/ -int BZ_API(BZ2_bzDecompress) ( bz_stream *strm ) -{ - Bool corrupt; - DState* s; - if (strm == NULL) return BZ_PARAM_ERROR; - s = strm->state; - if (s == NULL) return BZ_PARAM_ERROR; - if (s->strm != strm) return BZ_PARAM_ERROR; - - while (True) { - if (s->state == BZ_X_IDLE) return BZ_SEQUENCE_ERROR; - if (s->state == BZ_X_OUTPUT) { - if (s->smallDecompress) - corrupt = unRLE_obuf_to_output_SMALL ( s ); else - corrupt = unRLE_obuf_to_output_FAST ( s ); - if (corrupt) return BZ_DATA_ERROR; - if (s->nblock_used == s->save_nblock+1 && s->state_out_len == 0) { - BZ_FINALISE_CRC ( s->calculatedBlockCRC ); - if (s->verbosity >= 3) - VPrintf2 ( " {0x%08x, 0x%08x}", s->storedBlockCRC, - s->calculatedBlockCRC ); - if (s->verbosity >= 2) VPrintf0 ( "]" ); - if (s->calculatedBlockCRC != s->storedBlockCRC) - return BZ_DATA_ERROR; - s->calculatedCombinedCRC - = (s->calculatedCombinedCRC << 1) | - (s->calculatedCombinedCRC >> 31); - s->calculatedCombinedCRC ^= s->calculatedBlockCRC; - s->state = BZ_X_BLKHDR_1; - } else { - return BZ_OK; - } - } - if (s->state >= BZ_X_MAGIC_1) { - Int32 r = BZ2_decompress ( s ); - if (r == BZ_STREAM_END) { - if (s->verbosity >= 3) - VPrintf2 ( "\n combined CRCs: stored = 0x%08x, computed = 0x%08x", - s->storedCombinedCRC, s->calculatedCombinedCRC ); - if (s->calculatedCombinedCRC != s->storedCombinedCRC) - return BZ_DATA_ERROR; - return r; - } - if (s->state != BZ_X_OUTPUT) return r; - } - } - - AssertH ( 0, 6001 ); - - return 0; /*NOTREACHED*/ -} - - -/*---------------------------------------------------*/ -int BZ_API(BZ2_bzDecompressEnd) ( bz_stream *strm ) -{ - DState* s; - if (strm == NULL) return BZ_PARAM_ERROR; - s = strm->state; - if (s == NULL) return BZ_PARAM_ERROR; - if (s->strm != strm) return BZ_PARAM_ERROR; - - if (s->tt != NULL) BZFREE(s->tt); - if (s->ll16 != NULL) BZFREE(s->ll16); - if (s->ll4 != NULL) BZFREE(s->ll4); - - BZFREE(strm->state); - strm->state = NULL; - - return BZ_OK; -} - - -#ifndef BZ_NO_STDIO -/*---------------------------------------------------*/ -/*--- File I/O stuff ---*/ -/*---------------------------------------------------*/ - -#define BZ_SETERR(eee) \ -{ \ - if (bzerror != NULL) *bzerror = eee; \ - if (bzf != NULL) bzf->lastErr = eee; \ -} - -typedef - struct { - FILE* handle; - Char buf[BZ_MAX_UNUSED]; - Int32 bufN; - Bool writing; - bz_stream strm; - Int32 lastErr; - Bool initialisedOk; - } - bzFile; - - -/*---------------------------------------------*/ -static Bool myfeof ( FILE* f ) -{ - Int32 c = fgetc ( f ); - if (c == EOF) return True; - ungetc ( c, f ); - return False; -} - - -/*---------------------------------------------------*/ -BZFILE* BZ_API(BZ2_bzWriteOpen) - ( int* bzerror, - FILE* f, - int blockSize100k, - int verbosity, - int workFactor ) -{ - Int32 ret; - bzFile* bzf = NULL; - - BZ_SETERR(BZ_OK); - - if (f == NULL || - (blockSize100k < 1 || blockSize100k > 9) || - (workFactor < 0 || workFactor > 250) || - (verbosity < 0 || verbosity > 4)) - { BZ_SETERR(BZ_PARAM_ERROR); return NULL; }; - - if (ferror(f)) - { BZ_SETERR(BZ_IO_ERROR); return NULL; }; - - bzf = malloc ( sizeof(bzFile) ); - if (bzf == NULL) - { BZ_SETERR(BZ_MEM_ERROR); return NULL; }; - - BZ_SETERR(BZ_OK); - bzf->initialisedOk = False; - bzf->bufN = 0; - bzf->handle = f; - bzf->writing = True; - bzf->strm.bzalloc = NULL; - bzf->strm.bzfree = NULL; - bzf->strm.opaque = NULL; - - if (workFactor == 0) workFactor = 30; - ret = BZ2_bzCompressInit ( &(bzf->strm), blockSize100k, - verbosity, workFactor ); - if (ret != BZ_OK) - { BZ_SETERR(ret); free(bzf); return NULL; }; - - bzf->strm.avail_in = 0; - bzf->initialisedOk = True; - return bzf; -} - - - -/*---------------------------------------------------*/ -void BZ_API(BZ2_bzWrite) - ( int* bzerror, - BZFILE* b, - void* buf, - int len ) -{ - Int32 n, n2, ret; - bzFile* bzf = (bzFile*)b; - - BZ_SETERR(BZ_OK); - if (bzf == NULL || buf == NULL || len < 0) - { BZ_SETERR(BZ_PARAM_ERROR); return; }; - if (!(bzf->writing)) - { BZ_SETERR(BZ_SEQUENCE_ERROR); return; }; - if (ferror(bzf->handle)) - { BZ_SETERR(BZ_IO_ERROR); return; }; - - if (len == 0) - { BZ_SETERR(BZ_OK); return; }; - - bzf->strm.avail_in = len; - bzf->strm.next_in = buf; - - while (True) { - bzf->strm.avail_out = BZ_MAX_UNUSED; - bzf->strm.next_out = bzf->buf; - ret = BZ2_bzCompress ( &(bzf->strm), BZ_RUN ); - if (ret != BZ_RUN_OK) - { BZ_SETERR(ret); return; }; - - if (bzf->strm.avail_out < BZ_MAX_UNUSED) { - n = BZ_MAX_UNUSED - bzf->strm.avail_out; - n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), - n, bzf->handle ); - if (n != n2 || ferror(bzf->handle)) - { BZ_SETERR(BZ_IO_ERROR); return; }; - } - - if (bzf->strm.avail_in == 0) - { BZ_SETERR(BZ_OK); return; }; - } -} - - -/*---------------------------------------------------*/ -void BZ_API(BZ2_bzWriteClose) - ( int* bzerror, - BZFILE* b, - int abandon, - unsigned int* nbytes_in, - unsigned int* nbytes_out ) -{ - BZ2_bzWriteClose64 ( bzerror, b, abandon, - nbytes_in, NULL, nbytes_out, NULL ); -} - - -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 ) -{ - Int32 n, n2, ret; - bzFile* bzf = (bzFile*)b; - - if (bzf == NULL) - { BZ_SETERR(BZ_OK); return; }; - if (!(bzf->writing)) - { BZ_SETERR(BZ_SEQUENCE_ERROR); return; }; - if (ferror(bzf->handle)) - { BZ_SETERR(BZ_IO_ERROR); return; }; - - if (nbytes_in_lo32 != NULL) *nbytes_in_lo32 = 0; - if (nbytes_in_hi32 != NULL) *nbytes_in_hi32 = 0; - if (nbytes_out_lo32 != NULL) *nbytes_out_lo32 = 0; - if (nbytes_out_hi32 != NULL) *nbytes_out_hi32 = 0; - - if ((!abandon) && bzf->lastErr == BZ_OK) { - while (True) { - bzf->strm.avail_out = BZ_MAX_UNUSED; - bzf->strm.next_out = bzf->buf; - ret = BZ2_bzCompress ( &(bzf->strm), BZ_FINISH ); - if (ret != BZ_FINISH_OK && ret != BZ_STREAM_END) - { BZ_SETERR(ret); return; }; - - if (bzf->strm.avail_out < BZ_MAX_UNUSED) { - n = BZ_MAX_UNUSED - bzf->strm.avail_out; - n2 = fwrite ( (void*)(bzf->buf), sizeof(UChar), - n, bzf->handle ); - if (n != n2 || ferror(bzf->handle)) - { BZ_SETERR(BZ_IO_ERROR); return; }; - } - - if (ret == BZ_STREAM_END) break; - } - } - - if ( !abandon && !ferror ( bzf->handle ) ) { - fflush ( bzf->handle ); - if (ferror(bzf->handle)) - { BZ_SETERR(BZ_IO_ERROR); return; }; - } - - if (nbytes_in_lo32 != NULL) - *nbytes_in_lo32 = bzf->strm.total_in_lo32; - if (nbytes_in_hi32 != NULL) - *nbytes_in_hi32 = bzf->strm.total_in_hi32; - if (nbytes_out_lo32 != NULL) - *nbytes_out_lo32 = bzf->strm.total_out_lo32; - if (nbytes_out_hi32 != NULL) - *nbytes_out_hi32 = bzf->strm.total_out_hi32; - - BZ_SETERR(BZ_OK); - BZ2_bzCompressEnd ( &(bzf->strm) ); - free ( bzf ); -} - - -/*---------------------------------------------------*/ -BZFILE* BZ_API(BZ2_bzReadOpen) - ( int* bzerror, - FILE* f, - int verbosity, - int small, - void* unused, - int nUnused ) -{ - bzFile* bzf = NULL; - int ret; - - BZ_SETERR(BZ_OK); - - if (f == NULL || - (small != 0 && small != 1) || - (verbosity < 0 || verbosity > 4) || - (unused == NULL && nUnused != 0) || - (unused != NULL && (nUnused < 0 || nUnused > BZ_MAX_UNUSED))) - { BZ_SETERR(BZ_PARAM_ERROR); return NULL; }; - - if (ferror(f)) - { BZ_SETERR(BZ_IO_ERROR); return NULL; }; - - bzf = malloc ( sizeof(bzFile) ); - if (bzf == NULL) - { BZ_SETERR(BZ_MEM_ERROR); return NULL; }; - - BZ_SETERR(BZ_OK); - - bzf->initialisedOk = False; - bzf->handle = f; - bzf->bufN = 0; - bzf->writing = False; - bzf->strm.bzalloc = NULL; - bzf->strm.bzfree = NULL; - bzf->strm.opaque = NULL; - - while (nUnused > 0) { - bzf->buf[bzf->bufN] = *((UChar*)(unused)); bzf->bufN++; - unused = ((void*)( 1 + ((UChar*)(unused)) )); - nUnused--; - } - - ret = BZ2_bzDecompressInit ( &(bzf->strm), verbosity, small ); - if (ret != BZ_OK) - { BZ_SETERR(ret); free(bzf); return NULL; }; - - bzf->strm.avail_in = bzf->bufN; - bzf->strm.next_in = bzf->buf; - - bzf->initialisedOk = True; - return bzf; -} - - -/*---------------------------------------------------*/ -void BZ_API(BZ2_bzReadClose) ( int *bzerror, BZFILE *b ) -{ - bzFile* bzf = (bzFile*)b; - - BZ_SETERR(BZ_OK); - if (bzf == NULL) - { BZ_SETERR(BZ_OK); return; }; - - if (bzf->writing) - { BZ_SETERR(BZ_SEQUENCE_ERROR); return; }; - - if (bzf->initialisedOk) - (void)BZ2_bzDecompressEnd ( &(bzf->strm) ); - free ( bzf ); -} - - -/*---------------------------------------------------*/ -int BZ_API(BZ2_bzRead) - ( int* bzerror, - BZFILE* b, - void* buf, - int len ) -{ - Int32 n, ret; - bzFile* bzf = (bzFile*)b; - - BZ_SETERR(BZ_OK); - - if (bzf == NULL || buf == NULL || len < 0) - { BZ_SETERR(BZ_PARAM_ERROR); return 0; }; - - if (bzf->writing) - { BZ_SETERR(BZ_SEQUENCE_ERROR); return 0; }; - - if (len == 0) - { BZ_SETERR(BZ_OK); return 0; }; - - bzf->strm.avail_out = len; - bzf->strm.next_out = buf; - - while (True) { - - if (ferror(bzf->handle)) - { BZ_SETERR(BZ_IO_ERROR); return 0; }; - - if (bzf->strm.avail_in == 0 && !myfeof(bzf->handle)) { - n = fread ( bzf->buf, sizeof(UChar), - BZ_MAX_UNUSED, bzf->handle ); - if (ferror(bzf->handle)) - { BZ_SETERR(BZ_IO_ERROR); return 0; }; - bzf->bufN = n; - bzf->strm.avail_in = bzf->bufN; - bzf->strm.next_in = bzf->buf; - } - - ret = BZ2_bzDecompress ( &(bzf->strm) ); - - if (ret != BZ_OK && ret != BZ_STREAM_END) - { BZ_SETERR(ret); return 0; }; - - if (ret == BZ_OK && myfeof(bzf->handle) && - bzf->strm.avail_in == 0 && bzf->strm.avail_out > 0) - { BZ_SETERR(BZ_UNEXPECTED_EOF); return 0; }; - - if (ret == BZ_STREAM_END) - { BZ_SETERR(BZ_STREAM_END); - return len - bzf->strm.avail_out; }; - if (bzf->strm.avail_out == 0) - { BZ_SETERR(BZ_OK); return len; }; - - } - - return 0; /*not reached*/ -} - - -/*---------------------------------------------------*/ -void BZ_API(BZ2_bzReadGetUnused) - ( int* bzerror, - BZFILE* b, - void** unused, - int* nUnused ) -{ - bzFile* bzf = (bzFile*)b; - if (bzf == NULL) - { BZ_SETERR(BZ_PARAM_ERROR); return; }; - if (bzf->lastErr != BZ_STREAM_END) - { BZ_SETERR(BZ_SEQUENCE_ERROR); return; }; - if (unused == NULL || nUnused == NULL) - { BZ_SETERR(BZ_PARAM_ERROR); return; }; - - BZ_SETERR(BZ_OK); - *nUnused = bzf->strm.avail_in; - *unused = bzf->strm.next_in; -} -#endif - - -/*---------------------------------------------------*/ -/*--- Misc convenience stuff ---*/ -/*---------------------------------------------------*/ - -/*---------------------------------------------------*/ -int BZ_API(BZ2_bzBuffToBuffCompress) - ( char* dest, - unsigned int* destLen, - char* source, - unsigned int sourceLen, - int blockSize100k, - int verbosity, - int workFactor ) -{ - bz_stream strm; - int ret; - - if (dest == NULL || destLen == NULL || - source == NULL || - blockSize100k < 1 || blockSize100k > 9 || - verbosity < 0 || verbosity > 4 || - workFactor < 0 || workFactor > 250) - return BZ_PARAM_ERROR; - - if (workFactor == 0) workFactor = 30; - strm.bzalloc = NULL; - strm.bzfree = NULL; - strm.opaque = NULL; - ret = BZ2_bzCompressInit ( &strm, blockSize100k, - verbosity, workFactor ); - if (ret != BZ_OK) return ret; - - strm.next_in = source; - strm.next_out = dest; - strm.avail_in = sourceLen; - strm.avail_out = *destLen; - - ret = BZ2_bzCompress ( &strm, BZ_FINISH ); - if (ret == BZ_FINISH_OK) goto output_overflow; - if (ret != BZ_STREAM_END) goto errhandler; - - /* normal termination */ - *destLen -= strm.avail_out; - BZ2_bzCompressEnd ( &strm ); - return BZ_OK; - - output_overflow: - BZ2_bzCompressEnd ( &strm ); - return BZ_OUTBUFF_FULL; - - errhandler: - BZ2_bzCompressEnd ( &strm ); - return ret; -} - - -/*---------------------------------------------------*/ -int BZ_API(BZ2_bzBuffToBuffDecompress) - ( char* dest, - unsigned int* destLen, - char* source, - unsigned int sourceLen, - int small, - int verbosity ) -{ - bz_stream strm; - int ret; - - if (dest == NULL || destLen == NULL || - source == NULL || - (small != 0 && small != 1) || - verbosity < 0 || verbosity > 4) - return BZ_PARAM_ERROR; - - strm.bzalloc = NULL; - strm.bzfree = NULL; - strm.opaque = NULL; - ret = BZ2_bzDecompressInit ( &strm, verbosity, small ); - if (ret != BZ_OK) return ret; - - strm.next_in = source; - strm.next_out = dest; - strm.avail_in = sourceLen; - strm.avail_out = *destLen; - - ret = BZ2_bzDecompress ( &strm ); - if (ret == BZ_OK) goto output_overflow_or_eof; - if (ret != BZ_STREAM_END) goto errhandler; - - /* normal termination */ - *destLen -= strm.avail_out; - BZ2_bzDecompressEnd ( &strm ); - return BZ_OK; - - output_overflow_or_eof: - if (strm.avail_out > 0) { - BZ2_bzDecompressEnd ( &strm ); - return BZ_UNEXPECTED_EOF; - } else { - BZ2_bzDecompressEnd ( &strm ); - return BZ_OUTBUFF_FULL; - }; - - errhandler: - BZ2_bzDecompressEnd ( &strm ); - return ret; -} - - -/*---------------------------------------------------*/ -/*-- - 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. ---*/ -/*---------------------------------------------------*/ - -/*---------------------------------------------------*/ -/*-- - return version like "0.9.5d, 4-Sept-1999". ---*/ -const char * BZ_API(BZ2_bzlibVersion)(void) -{ - return BZ_VERSION; -} - - -#ifndef BZ_NO_STDIO -/*---------------------------------------------------*/ - -#if defined(_WIN32) || defined(OS2) || defined(MSDOS) -# include -# include -# if defined(_MSC_VER) -# define SET_BINARY_MODE(file) _setmode(_fileno(file),O_BINARY) -# else -# define SET_BINARY_MODE(file) setmode(fileno(file),O_BINARY) -# endif -#else -# define SET_BINARY_MODE(file) -#endif -static -BZFILE * bzopen_or_bzdopen - ( const char *path, /* no use when bzdopen */ - int fd, /* no use when bzdopen */ - const char *mode, - int open_mode) /* bzopen: 0, bzdopen:1 */ -{ - int bzerr; - char unused[BZ_MAX_UNUSED]; - int blockSize100k = 9; - int writing = 0; - char mode2[10] = ""; - FILE *fp = NULL; - BZFILE *bzfp = NULL; - int verbosity = 0; - int workFactor = 30; - int smallMode = 0; - int nUnused = 0; - - if (mode == NULL) return NULL; - while (*mode) { - switch (*mode) { - case 'r': - writing = 0; break; - case 'w': - writing = 1; break; - case 's': - smallMode = 1; break; - default: - if (isdigit((int)(*mode))) { - blockSize100k = *mode-BZ_HDR_0; - } - } - mode++; - } - strcat(mode2, writing ? "w" : "r" ); - strcat(mode2,"b"); /* binary mode */ - - if (open_mode==0) { - if (path==NULL || strcmp(path,"")==0) { - fp = (writing ? stdout : stdin); - SET_BINARY_MODE(fp); - } else { - fp = fopen(path,mode2); - } - } else { -#ifdef BZ_STRICT_ANSI - fp = NULL; -#else -# if defined(_MSC_VER) - fp = _fdopen(fd,mode2); -# else - fp = fdopen(fd,mode2); -# endif -#endif - } - if (fp == NULL) return NULL; - - if (writing) { - /* Guard against total chaos and anarchy -- JRS */ - if (blockSize100k < 1) blockSize100k = 1; - if (blockSize100k > 9) blockSize100k = 9; - bzfp = BZ2_bzWriteOpen(&bzerr,fp,blockSize100k, - verbosity,workFactor); - } else { - bzfp = BZ2_bzReadOpen(&bzerr,fp,verbosity,smallMode, - unused,nUnused); - } - if (bzfp == NULL) { - if (fp != stdin && fp != stdout) fclose(fp); - return NULL; - } - return bzfp; -} - - -/*---------------------------------------------------*/ -/*-- - open file for read or write. - ex) bzopen("file","w9") - case path="" or NULL => use stdin or stdout. ---*/ -BZFILE * BZ_API(BZ2_bzopen) - ( const char *path, - const char *mode ) -{ - return bzopen_or_bzdopen(path,-1,mode,/*bzopen*/0); -} - - -/*---------------------------------------------------*/ -BZFILE * BZ_API(BZ2_bzdopen) - ( int fd, - const char *mode ) -{ - return bzopen_or_bzdopen(NULL,fd,mode,/*bzdopen*/1); -} - - -/*---------------------------------------------------*/ -int BZ_API(BZ2_bzread) (BZFILE* b, void* buf, int len ) -{ - int bzerr, nread; - if (((bzFile*)b)->lastErr == BZ_STREAM_END) return 0; - nread = BZ2_bzRead(&bzerr,b,buf,len); - if (bzerr == BZ_OK || bzerr == BZ_STREAM_END) { - return nread; - } else { - return -1; - } -} - - -/*---------------------------------------------------*/ -int BZ_API(BZ2_bzwrite) (BZFILE* b, void* buf, int len ) -{ - int bzerr; - - BZ2_bzWrite(&bzerr,b,buf,len); - if(bzerr == BZ_OK){ - return len; - }else{ - return -1; - } -} - - -/*---------------------------------------------------*/ -int BZ_API(BZ2_bzflush) (BZFILE *b) -{ - /* do nothing now... */ - return 0; -} - - -/*---------------------------------------------------*/ -void BZ_API(BZ2_bzclose) (BZFILE* b) -{ - int bzerr; - FILE *fp; - - if (b==NULL) {return;} - fp = ((bzFile *)b)->handle; - if(((bzFile*)b)->writing){ - BZ2_bzWriteClose(&bzerr,b,0,NULL,NULL); - if(bzerr != BZ_OK){ - BZ2_bzWriteClose(NULL,b,1,NULL,NULL); - } - }else{ - BZ2_bzReadClose(&bzerr,b); - } - if(fp!=stdin && fp!=stdout){ - fclose(fp); - } -} - - -/*---------------------------------------------------*/ -/*-- - return last error code ---*/ -static const char *bzerrorstrings[] = { - "OK" - ,"SEQUENCE_ERROR" - ,"PARAM_ERROR" - ,"MEM_ERROR" - ,"DATA_ERROR" - ,"DATA_ERROR_MAGIC" - ,"IO_ERROR" - ,"UNEXPECTED_EOF" - ,"OUTBUFF_FULL" - ,"CONFIG_ERROR" - ,"???" /* for future */ - ,"???" /* for future */ - ,"???" /* for future */ - ,"???" /* for future */ - ,"???" /* for future */ - ,"???" /* for future */ -}; - - -const char * BZ_API(BZ2_bzerror) (BZFILE *b, int *errnum) -{ - int err = ((bzFile *)b)->lastErr; - - if(err>0) err = 0; - *errnum = err; - return bzerrorstrings[err*-1]; -} -#endif - - -/*-------------------------------------------------------------*/ -/*--- end bzlib.c ---*/ -/*-------------------------------------------------------------*/ diff --git a/dep/bzip2/src/bzlib_private.h b/dep/bzip2/src/bzlib_private.h deleted file mode 100644 index e20ac7a6..00000000 --- a/dep/bzip2/src/bzlib_private.h +++ /dev/null @@ -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 - - 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 - -#ifndef BZ_NO_STDIO -#include -#include -#include -#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 ---*/ -/*-------------------------------------------------------------*/ diff --git a/dep/bzip2/src/compress.c b/dep/bzip2/src/compress.c deleted file mode 100644 index 01873240..00000000 --- a/dep/bzip2/src/compress.c +++ /dev/null @@ -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 - - 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 ---*/ -/*-------------------------------------------------------------*/ diff --git a/dep/bzip2/src/crctable.c b/dep/bzip2/src/crctable.c deleted file mode 100644 index 00a2a9b9..00000000 --- a/dep/bzip2/src/crctable.c +++ /dev/null @@ -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 - - 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 ---*/ -/*-------------------------------------------------------------*/ diff --git a/dep/bzip2/src/decompress.c b/dep/bzip2/src/decompress.c deleted file mode 100644 index fd17c396..00000000 --- a/dep/bzip2/src/decompress.c +++ /dev/null @@ -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 - - 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 ---*/ -/*-------------------------------------------------------------*/ diff --git a/dep/bzip2/src/huffman.c b/dep/bzip2/src/huffman.c deleted file mode 100644 index 5371d1cb..00000000 --- a/dep/bzip2/src/huffman.c +++ /dev/null @@ -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 - - 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 ---*/ -/*-------------------------------------------------------------*/ diff --git a/dep/bzip2/src/precompiled.c b/dep/bzip2/src/precompiled.c deleted file mode 100644 index b5c4ec19..00000000 --- a/dep/bzip2/src/precompiled.c +++ /dev/null @@ -1 +0,0 @@ -#include "bzlib_private.h" diff --git a/dep/bzip2/src/randtable.c b/dep/bzip2/src/randtable.c deleted file mode 100644 index a739c6e9..00000000 --- a/dep/bzip2/src/randtable.c +++ /dev/null @@ -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 - - 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 ---*/ -/*-------------------------------------------------------------*/ diff --git a/dep/cppunitlite/msvc/cppunitlite.vcxproj b/dep/cppunitlite/msvc/cppunitlite.vcxproj index 2de76ed6..e64acd13 100644 --- a/dep/cppunitlite/msvc/cppunitlite.vcxproj +++ b/dep/cppunitlite/msvc/cppunitlite.vcxproj @@ -13,6 +13,10 @@ Debug Win32 + + Release MP Play + Win32 + Release MP Win32 @@ -62,6 +66,12 @@ v120 MultiByte + + StaticLibrary + true + v120 + MultiByte + StaticLibrary true @@ -93,6 +103,9 @@ + + + @@ -149,6 +162,22 @@ true + + + + + Level3 + Disabled + WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_LIB;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) + MultiThreadedDebug + $(ProjectDir)..\include\ + CompileAsCpp + + + Windows + true + + diff --git a/msvc/ReGameDLL.sln b/msvc/ReGameDLL.sln index ab7dff5a..f0416c2e 100644 --- a/msvc/ReGameDLL.sln +++ b/msvc/ReGameDLL.sln @@ -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 diff --git a/regamedll/build.gradle b/regamedll/build.gradle index 04bddde1..a25fd924 100644 --- a/regamedll/build.gradle +++ b/regamedll/build.gradle @@ -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" } } } diff --git a/regamedll/common/cvardef.h b/regamedll/common/cvardef.h index 11fdbbe1..95624118 100644 --- a/regamedll/common/cvardef.h +++ b/regamedll/common/cvardef.h @@ -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 diff --git a/regamedll/common/entity_state.h b/regamedll/common/entity_state.h index e659671e..18c0fba6 100644 --- a/regamedll/common/entity_state.h +++ b/regamedll/common/entity_state.h @@ -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 diff --git a/regamedll/common/mathlib.h b/regamedll/common/mathlib.h index 4c2250b3..090e7866 100644 --- a/regamedll/common/mathlib.h +++ b/regamedll/common/mathlib.h @@ -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 diff --git a/regamedll/common/pmtrace.h b/regamedll/common/pmtrace.h index 830c3f8e..83bbec74 100644 --- a/regamedll/common/pmtrace.h +++ b/regamedll/common/pmtrace.h @@ -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 diff --git a/regamedll/common/studio_event.h b/regamedll/common/studio_event.h index c65cc9f0..a4626674 100644 --- a/regamedll/common/studio_event.h +++ b/regamedll/common/studio_event.h @@ -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 diff --git a/regamedll/common/usercmd.h b/regamedll/common/usercmd.h index 41ce85f2..6a939a66 100644 --- a/regamedll/common/usercmd.h +++ b/regamedll/common/usercmd.h @@ -52,6 +52,5 @@ typedef struct usercmd_s vec3_t impact_position; } usercmd_t; -/* size: 52, cachelines: 1, members: 12 */ #endif // USERCMD_H diff --git a/regamedll/common/weaponinfo.h b/regamedll/common/weaponinfo.h index 40b7513d..39387cc8 100644 --- a/regamedll/common/weaponinfo.h +++ b/regamedll/common/weaponinfo.h @@ -59,6 +59,5 @@ typedef struct weapon_data_s float fuser4; } weapon_data_t; -/* size: 88, cachelines: 2, members: 22 */ #endif // WEAPONINFO_H diff --git a/regamedll/dlls/activity.h b/regamedll/dlls/activity.h index e5df9293..379299a4 100644 --- a/regamedll/dlls/activity.h +++ b/regamedll/dlls/activity.h @@ -36,106 +36,106 @@ typedef enum { ACT_INVALID = -1, - ACT_RESET = 0, // Set m_Activity to this invalid value to force a reset to m_IdealActivity - ACT_IDLE, - ACT_GUARD, - ACT_WALK, - ACT_RUN, - ACT_FLY, - ACT_SWIM, - ACT_HOP, - ACT_LEAP, - ACT_FALL, - ACT_LAND, - ACT_STRAFE_LEFT, - ACT_STRAFE_RIGHT, - ACT_ROLL_LEFT, - ACT_ROLL_RIGHT, - ACT_TURN_LEFT, - ACT_TURN_RIGHT, - ACT_CROUCH, - ACT_CROUCHIDLE, - ACT_STAND, - ACT_USE, - ACT_SIGNAL1, - ACT_SIGNAL2, - ACT_SIGNAL3, - ACT_TWITCH, - ACT_COWER, - ACT_SMALL_FLINCH, - ACT_BIG_FLINCH, - ACT_RANGE_ATTACK1, - ACT_RANGE_ATTACK2, - ACT_MELEE_ATTACK1, - ACT_MELEE_ATTACK2, - ACT_RELOAD, - ACT_ARM, - ACT_DISARM, - ACT_EAT, - ACT_DIESIMPLE, - ACT_DIEBACKWARD, - ACT_DIEFORWARD, - ACT_DIEVIOLENT, - ACT_BARNACLE_HIT, - ACT_BARNACLE_PULL, - ACT_BARNACLE_CHOMP, - ACT_BARNACLE_CHEW, - ACT_SLEEP, - ACT_INSPECT_FLOOR, - ACT_INSPECT_WALL, - ACT_IDLE_ANGRY, - ACT_WALK_HURT, - ACT_RUN_HURT, - ACT_HOVER, - ACT_GLIDE, - ACT_FLY_LEFT, - ACT_FLY_RIGHT, - ACT_DETECT_SCENT, - ACT_SNIFF, - ACT_BITE, - ACT_THREAT_DISPLAY, - ACT_FEAR_DISPLAY, - ACT_EXCITED, - ACT_SPECIAL_ATTACK1, - ACT_SPECIAL_ATTACK2, - ACT_COMBAT_IDLE, - ACT_WALK_SCARED, - ACT_RUN_SCARED, - ACT_VICTORY_DANCE, - ACT_DIE_HEADSHOT, - ACT_DIE_CHESTSHOT, - ACT_DIE_GUTSHOT, - ACT_DIE_BACKSHOT, - ACT_FLINCH_HEAD, - ACT_FLINCH_CHEST, - ACT_FLINCH_STOMACH, - ACT_FLINCH_LEFTARM, - ACT_FLINCH_RIGHTARM, - ACT_FLINCH_LEFTLEG, - ACT_FLINCH_RIGHTLEG, - ACT_FLINCH, - ACT_LARGE_FLINCH, - ACT_HOLDBOMB, - ACT_IDLE_FIDGET, - ACT_IDLE_SCARED, - ACT_IDLE_SCARED_FIDGET, - ACT_FOLLOW_IDLE, - ACT_FOLLOW_IDLE_FIDGET, - ACT_FOLLOW_IDLE_SCARED, - ACT_FOLLOW_IDLE_SCARED_FIDGET, - ACT_CROUCH_IDLE, - ACT_CROUCH_IDLE_FIDGET, - ACT_CROUCH_IDLE_SCARED, - ACT_CROUCH_IDLE_SCARED_FIDGET, - ACT_CROUCH_WALK, - ACT_CROUCH_WALK_SCARED, - ACT_CROUCH_DIE, - ACT_WALK_BACK, - ACT_IDLE_SNEAKY, - ACT_IDLE_SNEAKY_FIDGET, - ACT_WALK_SNEAKY, - ACT_WAVE, - ACT_YES, + ACT_RESET = 0, // Set m_Activity to this invalid value to force a reset to m_IdealActivity + ACT_IDLE, + ACT_GUARD, + ACT_WALK, + ACT_RUN, + ACT_FLY, + ACT_SWIM, + ACT_HOP, + ACT_LEAP, + ACT_FALL, + ACT_LAND, + ACT_STRAFE_LEFT, + ACT_STRAFE_RIGHT, + ACT_ROLL_LEFT, + ACT_ROLL_RIGHT, + ACT_TURN_LEFT, + ACT_TURN_RIGHT, + ACT_CROUCH, + ACT_CROUCHIDLE, + ACT_STAND, + ACT_USE, + ACT_SIGNAL1, + ACT_SIGNAL2, + ACT_SIGNAL3, + ACT_TWITCH, + ACT_COWER, + ACT_SMALL_FLINCH, + ACT_BIG_FLINCH, + ACT_RANGE_ATTACK1, + ACT_RANGE_ATTACK2, + ACT_MELEE_ATTACK1, + ACT_MELEE_ATTACK2, + ACT_RELOAD, + ACT_ARM, + ACT_DISARM, + ACT_EAT, + ACT_DIESIMPLE, + ACT_DIEBACKWARD, + ACT_DIEFORWARD, + ACT_DIEVIOLENT, + ACT_BARNACLE_HIT, + ACT_BARNACLE_PULL, + ACT_BARNACLE_CHOMP, + ACT_BARNACLE_CHEW, + ACT_SLEEP, + ACT_INSPECT_FLOOR, + ACT_INSPECT_WALL, + ACT_IDLE_ANGRY, + ACT_WALK_HURT, + ACT_RUN_HURT, + ACT_HOVER, + ACT_GLIDE, + ACT_FLY_LEFT, + ACT_FLY_RIGHT, + ACT_DETECT_SCENT, + ACT_SNIFF, + ACT_BITE, + ACT_THREAT_DISPLAY, + ACT_FEAR_DISPLAY, + ACT_EXCITED, + ACT_SPECIAL_ATTACK1, + ACT_SPECIAL_ATTACK2, + ACT_COMBAT_IDLE, + ACT_WALK_SCARED, + ACT_RUN_SCARED, + ACT_VICTORY_DANCE, + ACT_DIE_HEADSHOT, + ACT_DIE_CHESTSHOT, + ACT_DIE_GUTSHOT, + ACT_DIE_BACKSHOT, + ACT_FLINCH_HEAD, + ACT_FLINCH_CHEST, + ACT_FLINCH_STOMACH, + ACT_FLINCH_LEFTARM, + ACT_FLINCH_RIGHTARM, + ACT_FLINCH_LEFTLEG, + ACT_FLINCH_RIGHTLEG, + ACT_FLINCH, + ACT_LARGE_FLINCH, + ACT_HOLDBOMB, + ACT_IDLE_FIDGET, + ACT_IDLE_SCARED, + ACT_IDLE_SCARED_FIDGET, + ACT_FOLLOW_IDLE, + ACT_FOLLOW_IDLE_FIDGET, + ACT_FOLLOW_IDLE_SCARED, + ACT_FOLLOW_IDLE_SCARED_FIDGET, + ACT_CROUCH_IDLE, + ACT_CROUCH_IDLE_FIDGET, + ACT_CROUCH_IDLE_SCARED, + ACT_CROUCH_IDLE_SCARED_FIDGET, + ACT_CROUCH_WALK, + ACT_CROUCH_WALK_SCARED, + ACT_CROUCH_DIE, + ACT_WALK_BACK, + ACT_IDLE_SNEAKY, + ACT_IDLE_SNEAKY_FIDGET, + ACT_WALK_SNEAKY, + ACT_WAVE, + ACT_YES, ACT_NO, } Activity; @@ -146,7 +146,6 @@ typedef struct char *name; } activity_map_t; -/* size: 8, cachelines: 1, members: 2 */ extern activity_map_t activity_map[]; diff --git a/regamedll/dlls/airtank.cpp b/regamedll/dlls/airtank.cpp index 24baab42..d1e2f732 100644 --- a/regamedll/dlls/airtank.cpp +++ b/regamedll/dlls/airtank.cpp @@ -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 diff --git a/regamedll/dlls/airtank.h b/regamedll/dlls/airtank.h index cd182dce..1e7294ae 100644 --- a/regamedll/dlls/airtank.h +++ b/regamedll/dlls/airtank.h @@ -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 diff --git a/regamedll/dlls/ammo.cpp b/regamedll/dlls/ammo.cpp index 62052272..93882af1 100644 --- a/regamedll/dlls/ammo.cpp +++ b/regamedll/dlls/ammo.cpp @@ -1,7 +1,7 @@ #include "precompiled.h" /* ../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) } /* ../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); /* ../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) } /* ../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); /* ../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) } /* ../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); /* ../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) } /* ../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); /* ../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) } /* ../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); /* ../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) } /* ../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); /* ../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) } /* ../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); /* ../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) } /* ../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); /* ../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) } /* ../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); /* ../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) } /* ../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) /* ../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 diff --git a/regamedll/dlls/ammo.h b/regamedll/dlls/ammo.h index 39409ba5..60f1b316 100644 --- a/regamedll/dlls/ammo.h +++ b/regamedll/dlls/ammo.h @@ -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 diff --git a/regamedll/dlls/animating.cpp b/regamedll/dlls/animating.cpp index 0c6878f0..66872348 100644 --- a/regamedll/dlls/animating.cpp +++ b/regamedll/dlls/animating.cpp @@ -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 diff --git a/regamedll/dlls/animation.cpp b/regamedll/dlls/animation.cpp index 432af5fc..5599975c 100644 --- a/regamedll/dlls/animation.cpp +++ b/regamedll/dlls/animation.cpp @@ -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); @@ -1074,7 +1065,7 @@ void SV_StudioSetupBones(model_t *pModel, float frame, int sequence, const vec_t f = StudioEstimateFrame(frame, pseqdesc); subframe = (int)f; f -= subframe; - + StudioCalcBoneAdj(0, adj, pcontroller, pcontroller, 0); StudioCalcRotations(pbones, chain, chainlength, adj, pos, q, pseqdesc, panim, subframe, f); @@ -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; diff --git a/regamedll/dlls/animation.h b/regamedll/dlls/animation.h index 4da17dfe..9134f889 100644 --- a/regamedll/dlls/animation.h +++ b/regamedll/dlls/animation.h @@ -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 diff --git a/regamedll/dlls/basemonster.h b/regamedll/dlls/basemonster.h index fb5580c2..8b9085b1 100644 --- a/regamedll/dlls/basemonster.h +++ b/regamedll/dlls/basemonster.h @@ -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 diff --git a/regamedll/dlls/bmodels.cpp b/regamedll/dlls/bmodels.cpp index de4ce242..ba4ec4aa 100644 --- a/regamedll/dlls/bmodels.cpp +++ b/regamedll/dlls/bmodels.cpp @@ -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 diff --git a/regamedll/dlls/bmodels.h b/regamedll/dlls/bmodels.h index 3126cf06..212ac600 100644 --- a/regamedll/dlls/bmodels.h +++ b/regamedll/dlls/bmodels.h @@ -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 diff --git a/regamedll/dlls/bot/cs_bot.cpp b/regamedll/dlls/bot/cs_bot.cpp index 1015f97f..0006ee3d 100644 --- a/regamedll/dlls/bot/cs_bot.cpp +++ b/regamedll/dlls/bot/cs_bot.cpp @@ -29,7 +29,7 @@ int GetBotFollowCount(CBasePlayer *leader) continue; CCSBot *bot = dynamic_cast(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(attacker); + m_attacker = static_cast(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 diff --git a/regamedll/dlls/bot/cs_bot.h b/regamedll/dlls/bot/cs_bot.h index 07a4dd92..0aac498b 100644 --- a/regamedll/dlls/bot/cs_bot.h +++ b/regamedll/dlls/bot/cs_bot.h @@ -53,19 +53,6 @@ #define HI_Z 0x10 #define LO_Z 0x20 -#ifdef HOOK_GAMEDLL - -#define _navAreaCount (*pnavAreaCount) -#define _currentIndex (*pcurrentIndex) - -#define primaryWeaponBuyInfoCT (*pprimaryWeaponBuyInfoCT) -#define secondaryWeaponBuyInfoCT (*psecondaryWeaponBuyInfoCT) - -#define primaryWeaponBuyInfoT (*pprimaryWeaponBuyInfoT) -#define secondaryWeaponBuyInfoT (*psecondaryWeaponBuyInfoT) - -#endif // HOOK_GAMEDLL - extern int _navAreaCount; extern int _currentIndex; @@ -85,9 +72,8 @@ public: virtual void OnEnter(CCSBot *me) {} virtual void OnUpdate(CCSBot *me) {} virtual void OnExit(CCSBot *me) {} - virtual const char *GetName(void) const = 0; - -};/* size: 4, cachelines: 1, members: 1 */ + virtual const char *GetName() const = 0; +}; /* <3328b8> ../cstrike/dlls/bot/cs_bot.h:53 */ class IdleState: public BotState @@ -95,7 +81,7 @@ class IdleState: public BotState public: virtual void OnEnter(CCSBot *me); virtual void OnUpdate(CCSBot *me); - virtual const char *GetName(void) const { return "Idle"; } + virtual const char *GetName() const { return "Idle"; } #ifdef HOOK_GAMEDLL @@ -103,8 +89,7 @@ public: void OnUpdate_(CCSBot *me); #endif // HOOK_GAMEDLL - -};/* size: 4, cachelines: 1, members: 1 */ +}; /* <3328d9> ../cstrike/dlls/bot/cs_bot.h:61 */ class HuntState: public BotState @@ -113,7 +98,7 @@ public: virtual void OnEnter(CCSBot *me); virtual void OnUpdate(CCSBot *me); virtual void OnExit(CCSBot *me); - virtual const char *GetName(void) const { return "Hunt"; } + virtual const char *GetName() const { return "Hunt"; } #ifdef HOOK_GAMEDLL @@ -123,11 +108,10 @@ public: #endif // HOOK_GAMEDLL - void ClearHuntArea(void) { m_huntArea = NULL; } + void ClearHuntArea() { m_huntArea = NULL; } private: CNavArea *m_huntArea; - -};/* size: 8, cachelines: 1, members: 2 */ +}; /* <3328fb> ../cstrike/dlls/bot/cs_bot.h:75 */ class AttackState: public BotState @@ -136,7 +120,7 @@ public: virtual void OnEnter(CCSBot *me); virtual void OnUpdate(CCSBot *me); virtual void OnExit(CCSBot *me); - virtual const char *GetName(void) const { return "Attack"; } + virtual const char *GetName() const { return "Attack"; } #ifdef HOOK_GAMEDLL @@ -174,8 +158,7 @@ protected: bool m_firstDodge; bool m_isCoward; CountdownTimer m_retreatTimer; - -};/* size: 60, cachelines: 1, members: 17 */ +}; /* <332922> ../cstrike/dlls/bot/cs_bot.h:120 */ class InvestigateNoiseState: public BotState @@ -184,7 +167,7 @@ public: virtual void OnEnter(CCSBot *me); virtual void OnUpdate(CCSBot *me); virtual void OnExit(CCSBot *me); - virtual const char *GetName(void) const { return "InvestigateNoise"; } + virtual const char *GetName() const { return "InvestigateNoise"; } #ifdef HOOK_GAMEDLL @@ -197,8 +180,7 @@ public: private: void AttendCurrentNoise(CCSBot *me); Vector m_checkNoisePosition; - -};/* size: 16, cachelines: 1, members: 2 */ +}; /* <332949> ../cstrike/dlls/bot/cs_bot.h:133 */ class BuyState: public BotState @@ -207,7 +189,7 @@ public: virtual void OnEnter(CCSBot *me); virtual void OnUpdate(CCSBot *me); virtual void OnExit(CCSBot *me); - virtual const char *GetName(void) const { return "Buy"; } + virtual const char *GetName() const { return "Buy"; } #ifdef HOOK_GAMEDLL @@ -227,8 +209,7 @@ private: bool m_buyGrenade; bool m_buyShield; bool m_buyPistol; - -};/* size: 28, cachelines: 1, members: 10 */ +}; /* <332970> ../cstrike/dlls/bot/cs_bot.h:154 */ class MoveToState: public BotState @@ -237,7 +218,7 @@ public: virtual void OnEnter(CCSBot *me); virtual void OnUpdate(CCSBot *me); virtual void OnExit(CCSBot *me); - virtual const char *GetName(void) const { return "MoveTo"; } + virtual const char *GetName() const { return "MoveTo"; } #ifdef HOOK_GAMEDLL @@ -255,8 +236,7 @@ private: RouteType m_routeType; bool m_radioedPlan; bool m_askedForCover; - -};/* size: 24, cachelines: 1, members: 5 */ +}; /* <332997> ../cstrike/dlls/bot/cs_bot.h:171 */ class FetchBombState: public BotState @@ -264,7 +244,7 @@ class FetchBombState: public BotState public: virtual void OnEnter(CCSBot *me); virtual void OnUpdate(CCSBot *me); - virtual const char *GetName(void) const { return "FetchBomb"; } + virtual const char *GetName() const { return "FetchBomb"; } #ifdef HOOK_GAMEDLL @@ -273,7 +253,7 @@ public: #endif // HOOK_GAMEDLL -};/* size: 4, cachelines: 1, members: 1 */ +}; /* <3329be> ../cstrike/dlls/bot/cs_bot.h:179 */ class PlantBombState: public BotState @@ -282,7 +262,7 @@ public: virtual void OnEnter(CCSBot *me); virtual void OnUpdate(CCSBot *me); virtual void OnExit(CCSBot *me); - virtual const char *GetName(void) const { return "PlantBomb"; } + virtual const char *GetName() const { return "PlantBomb"; } #ifdef HOOK_GAMEDLL @@ -292,7 +272,7 @@ public: #endif // HOOK_GAMEDLL -};/* size: 4, cachelines: 1, members: 1 */ +}; /* <3329e5> ../cstrike/dlls/bot/cs_bot.h:188 */ class DefuseBombState: public BotState @@ -301,7 +281,7 @@ public: virtual void OnEnter(CCSBot *me); virtual void OnUpdate(CCSBot *me); virtual void OnExit(CCSBot *me); - virtual const char *GetName(void) const { return "DefuseBomb"; } + virtual const char *GetName() const { return "DefuseBomb"; } #ifdef HOOK_GAMEDLL @@ -310,8 +290,7 @@ public: void OnExit_(CCSBot *me); #endif // HOOK_GAMEDLL - -};/* size: 4, cachelines: 1, members: 1 */ +}; /* <332a0c> ../cstrike/dlls/bot/cs_bot.h:197 */ class HideState: public BotState @@ -320,7 +299,7 @@ public: virtual void OnEnter(CCSBot *me); virtual void OnUpdate(CCSBot *me); virtual void OnExit(CCSBot *me); - virtual const char *GetName(void) const { return "Hide"; } + virtual const char *GetName() const { return "Hide"; } #ifdef HOOK_GAMEDLL @@ -332,15 +311,15 @@ public: public: void SetHidingSpot(const Vector &pos) { m_hidingSpot = pos; } - const Vector &GetHidingSpot(void) const { return m_hidingSpot; } + const Vector &GetHidingSpot() const { return m_hidingSpot; } - void SetSearchArea(CNavArea *area) { m_searchFromArea = area; } - void SetSearchRange(float range) { m_range = range; } + void SetSearchArea(CNavArea *area) { m_searchFromArea = area; } + void SetSearchRange(float range) { m_range = range; } - void SetDuration(float time) { m_duration = time; } - void SetHoldPosition(bool hold) { m_isHoldingPosition = hold; } + void SetDuration(float time) { m_duration = time; } + void SetHoldPosition(bool hold) { m_isHoldingPosition = hold; } - bool IsAtSpot(void) const { return m_isAtSpot; } + bool IsAtSpot() const { return m_isAtSpot; } private: CNavArea *m_searchFromArea; @@ -356,8 +335,7 @@ private: float m_firstHeardEnemyTime; int m_retry; Vector m_leaderAnchorPos; - -};/* size: 64, cachelines: 1, members: 12 */ +}; /* <332a33> ../cstrike/dlls/bot/cs_bot.h:234 */ class EscapeFromBombState: public BotState @@ -366,7 +344,7 @@ public: virtual void OnEnter(CCSBot *me); virtual void OnUpdate(CCSBot *me); virtual void OnExit(CCSBot *me); - virtual const char *GetName(void) const { return "EscapeFromBomb"; } + virtual const char *GetName() const { return "EscapeFromBomb"; } #ifdef HOOK_GAMEDLL @@ -376,7 +354,7 @@ public: #endif // HOOK_GAMEDLL -};/* size: 4, cachelines: 1, members: 1 */ +}; /* <332a5a> ../cstrike/dlls/bot/cs_bot.h:243 */ class FollowState: public BotState @@ -385,7 +363,7 @@ public: virtual void OnEnter(CCSBot *me); virtual void OnUpdate(CCSBot *me); virtual void OnExit(CCSBot *me); - virtual const char *GetName(void) const { return "Follow"; } + virtual const char *GetName() const { return "Follow"; } #ifdef HOOK_GAMEDLL @@ -425,8 +403,7 @@ private: float m_waitTime; CountdownTimer m_idleTimer; - -};/* size: 76, cachelines: 2, members: 14 */ +}; /* <332a81> ../cstrike/dlls/bot/cs_bot.h:282 */ class UseEntityState: public BotState @@ -435,7 +412,7 @@ public: virtual void OnEnter(CCSBot *me); virtual void OnUpdate(CCSBot *me); virtual void OnExit(CCSBot *me); - virtual const char *GetName(void) const { return "UseEntity"; } + virtual const char *GetName() const { return "UseEntity"; } #ifdef HOOK_GAMEDLL @@ -449,8 +426,7 @@ public: private: EHANDLE m_entity; - -};/* size: 12, cachelines: 1, members: 2 */ +}; // The Counter-strike Bot @@ -458,22 +434,22 @@ private: class CCSBot: public CBot { public: - CCSBot(void); // constructor initializes all values to zero + CCSBot(); // constructor initializes all values to zero public: virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType); // invoked when injured by something (EXTEND) - returns the amount of damage inflicted virtual void Killed(entvars_t *pevAttacker, int iGib); // invoked when killed (EXTEND) - virtual void RoundRespawn(void); + virtual void RoundRespawn(); virtual void Blind(float duration, float holdTime, float fadeTime, int alpha = 255); // player blinded by a flashbang virtual void OnTouchingWeapon(CWeaponBox *box); // invoked when in contact with a CWeaponBox virtual bool Initialize(const BotProfile *profile); // (EXTEND) prepare bot for action - virtual void SpawnBot(void); // (EXTEND) spawn the bot into the game + virtual void SpawnBot(); // (EXTEND) spawn the bot into the game - virtual void Upkeep(void); // lightweight maintenance, invoked frequently - virtual void Update(void); // heavyweight algorithms, invoked less often + virtual void Upkeep(); // lightweight maintenance, invoked frequently + virtual void Update(); // heavyweight algorithms, invoked less often - virtual void Walk(void); + virtual void Walk(); virtual bool Jump(bool mustJump = false); // returns true if jump was started virtual void OnEvent(GameEventType event, CBaseEntity *entity = NULL, CBaseEntity *other = NULL); // invoked when event occurs in the game (some events have NULL entity) @@ -487,10 +463,10 @@ public: #ifdef HOOK_GAMEDLL bool Initialize_(const BotProfile *profile); - void SpawnBot_(void); - void Upkeep_(void); - void Update_(void); - void Walk_(void); + void SpawnBot_(); + void Upkeep_(); + void Update_(); + void Walk_(); bool Jump_(bool mustJump); void Blind_(float duration, float holdTime, float fadeTime, int alpha); int TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType); @@ -500,98 +476,98 @@ public: bool IsVisible_(const Vector *pos, bool testFOV) const; bool IsVisible_(CBasePlayer *player, bool testFOV, unsigned char *visParts) const; bool IsEnemyPartVisible_(VisiblePartType part) const; - void RoundRespawn_(void); + void RoundRespawn_(); #endif // HOOK_GAMEDLL public: - void Disconnect(void); + void Disconnect(); // behavior properties - float GetCombatRange(void) const; - bool IsRogue(void) const; // return true if we dont listen to teammates or pursue scenario goals + float GetCombatRange() const; + bool IsRogue() const; // return true if we dont listen to teammates or pursue scenario goals void SetRogue(bool rogue); - bool IsHurrying(void) const; // return true if we are in a hurry + bool IsHurrying() const; // return true if we are in a hurry void Hurry(float duration); // force bot to hurry - bool IsSafe(void) const; // return true if we are in a safe region - bool IsWellPastSafe(void) const; // return true if it is well past the early, "safe", part of the round - bool IsEndOfSafeTime(void) const; // return true if we were in the safe time last update, but not now - float GetSafeTimeRemaining(void) const; // return the amount of "safe time" we have left - float GetSafeTime(void) const; // return what we think the total "safe time" for this map is - NOXREF bool IsUnhealthy(void) const; // returns true if bot is low on health + bool IsSafe() const; // return true if we are in a safe region + bool IsWellPastSafe() const; // return true if it is well past the early, "safe", part of the round + bool IsEndOfSafeTime() const; // return true if we were in the safe time last update, but not now + float GetSafeTimeRemaining() const; // return the amount of "safe time" we have left + float GetSafeTime() const; // return what we think the total "safe time" for this map is + NOXREF bool IsUnhealthy() const; // returns true if bot is low on health // behaviors - void Idle(void); + void Idle(); void Hide(CNavArea *searchFromArea = NULL, float duration = -1.0f, float hideRange = 750.0f, bool holdPosition = false); // DEPRECATED: Use TryToHide() instead #define USE_NEAREST true bool TryToHide(CNavArea *searchFromArea = NULL, float duration = -1.0f, float hideRange = 750.0f, bool holdPosition = false, bool useNearest = false); // try to hide nearby, return false if cannot void Hide(const Vector *hidingSpot, float duration = -1.0f, bool holdPosition = false); // move to the given hiding place - bool IsHiding(void) const; // returns true if bot is currently hiding - bool IsAtHidingSpot(void) const; // return true if we are hiding and at our hiding spot - bool TryToRetreat(void); // retreat to a nearby hiding spot, away from enemies + bool IsHiding() const; // returns true if bot is currently hiding + bool IsAtHidingSpot() const; // return true if we are hiding and at our hiding spot + bool TryToRetreat(); // retreat to a nearby hiding spot, away from enemies - void Hunt(void); - bool IsHunting(void) const; // returns true if bot is currently hunting + void Hunt(); + bool IsHunting() const; // returns true if bot is currently hunting void Attack(CBasePlayer *victim); - void FireWeaponAtEnemy(void); // fire our active weapon towards our current enemy - void StopAttacking(void); - bool IsAttacking(void) const; // returns true if bot is currently engaging a target + void FireWeaponAtEnemy(); // fire our active weapon towards our current enemy + void StopAttacking(); + bool IsAttacking() const; // returns true if bot is currently engaging a target void MoveTo(const Vector *pos, RouteType route = SAFEST_ROUTE); // move to potentially distant position - bool IsMovingTo(void) const; // return true if we are in the MoveTo state + bool IsMovingTo() const; // return true if we are in the MoveTo state - void PlantBomb(void); + void PlantBomb(); - void FetchBomb(void); // bomb has been dropped - go get it - bool NoticeLooseBomb(void) const; // return true if we noticed the bomb on the ground or on radar - bool CanSeeLooseBomb(void) const; // return true if we directly see the loose bomb - bool IsCarryingBomb(void) const; + void FetchBomb(); // bomb has been dropped - go get it + bool NoticeLooseBomb() const; // return true if we noticed the bomb on the ground or on radar + bool CanSeeLooseBomb() const; // return true if we directly see the loose bomb + bool IsCarryingBomb() const; - void DefuseBomb(void); - bool IsDefusingBomb(void) const; // returns true if bot is currently defusing the bomb - bool CanSeePlantedBomb(void) const; // return true if we directly see the planted bomb + void DefuseBomb(); + bool IsDefusingBomb() const; // returns true if bot is currently defusing the bomb + bool CanSeePlantedBomb() const; // return true if we directly see the planted bomb - void EscapeFromBomb(void); - bool IsEscapingFromBomb(void) const; // return true if we are escaping from the bomb + void EscapeFromBomb(); + bool IsEscapingFromBomb() const; // return true if we are escaping from the bomb - void RescueHostages(void); + void RescueHostages(); void UseEntity(CBaseEntity *entity); // use the entity - bool IsBuying(void) const; + bool IsBuying() const; void Panic(CBasePlayer *enemy); // look around in panic void Follow(CBasePlayer *player); // begin following given Player - void ContinueFollowing(void); // continue following our leader after finishing what we were doing - void StopFollowing(void); // stop following - bool IsFollowing(void) const; // return true if we are following someone (not necessarily in the follow state) - CBasePlayer *GetFollowLeader(void); // return the leader we are following - float GetFollowDuration(void) const; // return how long we've been following our leader - bool CanAutoFollow(void) const; // return true if we can auto-follow + void ContinueFollowing(); // continue following our leader after finishing what we were doing + void StopFollowing(); // stop following + bool IsFollowing() const; // return true if we are following someone (not necessarily in the follow state) + CBasePlayer *GetFollowLeader(); // return the leader we are following + float GetFollowDuration() const; // return how long we've been following our leader + bool CanAutoFollow() const; // return true if we can auto-follow - bool IsNotMoving(void) const; // return true if we are currently standing still + bool IsNotMoving() const; // return true if we are currently standing still - void AimAtEnemy(void); // point our weapon towards our enemy - void StopAiming(void); // stop aiming at enemy - bool IsAimingAtEnemy(void) const; // returns true if we are trying to aim at an enemy + void AimAtEnemy(); // point our weapon towards our enemy + void StopAiming(); // stop aiming at enemy + bool IsAimingAtEnemy() const; // returns true if we are trying to aim at an enemy - bool IsSurprised(void) const; // return true if we are "surprised" - float GetSurpriseDelay(void) const; - void ClearSurpriseDelay(void); + bool IsSurprised() const; // return true if we are "surprised" + float GetSurpriseDelay() const; + void ClearSurpriseDelay(); - float GetStateTimestamp(void) const; // get time current state was entered + float GetStateTimestamp() const; // get time current state was entered - bool IsDoingScenario(void) const; // return true if we will do scenario-related tasks + bool IsDoingScenario() const; // return true if we will do scenario-related tasks // scenario / gamestate - CSGameState *GetGameState(void); // return an interface to this bot's gamestate - const CSGameState *GetGameState(void) const; // return an interface to this bot's gamestate + CSGameState *GetGameState(); // return an interface to this bot's gamestate + const CSGameState *GetGameState() const; // return an interface to this bot's gamestate - bool IsAtBombsite(void); // return true if we are in a bomb planting zone + bool IsAtBombsite(); // return true if we are in a bomb planting zone bool GuardRandomZone(float range = 500.0f); // pick a random zone and hide near it - bool IsBusy(void) const; // return true if we are busy doing something important + bool IsBusy() const; // return true if we are busy doing something important // high-level tasks enum TaskType @@ -621,8 +597,8 @@ public: }; void SetTask(TaskType task, CBaseEntity *entity = NULL); // set our current "task" - TaskType GetTask(void) const; - CBaseEntity *GetTaskEntity(void); + TaskType GetTask() const; + CBaseEntity *GetTaskEntity(); // behavior modifiers enum DispositionType @@ -636,7 +612,7 @@ public: }; void SetDisposition(DispositionType disposition); // define how we react to enemies - DispositionType GetDisposition(void) const; // return enum describing current disposition + DispositionType GetDisposition() const; // return enum describing current disposition void IgnoreEnemies(float duration); // ignore enemies for a short duration @@ -651,75 +627,75 @@ public: EXCELLENT = 3, }; - MoraleType GetMorale(void) const; // return enum describing current morale - void IncreaseMorale(void); - void DecreaseMorale(void); + MoraleType GetMorale() const; // return enum describing current morale + void IncreaseMorale(); + void DecreaseMorale(); // listening for noises - bool IsNoiseHeard(void) const; // return true if we have heard a noise + bool IsNoiseHeard() const; // return true if we have heard a noise bool ShouldInvestigateNoise(float *retNoiseDist = NULL); - void InvestigateNoise(void); // investigate recent enemy noise - const Vector *GetNoisePosition(void) const; // return position of last heard noise, or NULL if none heard - CNavArea *GetNoiseArea(void) const; // return area where noise was heard - void ForgetNoise(void); // clear the last heard noise - bool CanSeeNoisePosition(void) const; // return true if we directly see where we think the noise came from - NOXREF float GetNoiseRange(void) const; // return approximate distance to last noise heard + void InvestigateNoise(); // investigate recent enemy noise + const Vector *GetNoisePosition() const; // return position of last heard noise, or NULL if none heard + CNavArea *GetNoiseArea() const; // return area where noise was heard + void ForgetNoise(); // clear the last heard noise + bool CanSeeNoisePosition() const; // return true if we directly see where we think the noise came from + NOXREF float GetNoiseRange() const; // return approximate distance to last noise heard bool CanHearNearbyEnemyGunfire(float range = -1.0f) const; // return true if we hear nearby threatening enemy gunfire within given range (-1 == infinite) - PriorityType GetNoisePriority(void) const; // return priority of last heard noise + PriorityType GetNoisePriority() const; // return priority of last heard noise // radio and chatter - void SendRadioMessage(GameEventType event); // send voice chatter - BotChatterInterface *GetChatter(void); // return an interface to this bot's chatter system - bool RespondToHelpRequest(CBasePlayer *them, Place place, float maxRange = -1.0f); // decide if we should move to help the player, return true if we will + void SendRadioMessage(GameEventType event); // send voice chatter + BotChatterInterface *GetChatter(); // return an interface to this bot's chatter system + bool RespondToHelpRequest(CBasePlayer *them, Place place, float maxRange = -1.0f); // decide if we should move to help the player, return true if we will void StartVoiceFeedback(float duration); - bool IsUsingVoice(void) const; // new-style "voice" chatter gets voice feedback + bool IsUsingVoice() const; // new-style "voice" chatter gets voice feedback // enemies // BOTPORT: GetEnemy() collides with GetEnemy() in CBaseEntity - need to use different nomenclature void SetEnemy(CBasePlayer *enemy); // set given player as our current enemy - CBasePlayer *GetEnemy(void); - int GetNearbyEnemyCount(void) const; // return max number of nearby enemies we've seen recently - unsigned int GetEnemyPlace(void) const; // return location where we see the majority of our enemies - bool CanSeeBomber(void) const; // return true if we can see the bomb carrier - CBasePlayer *GetBomber(void) const; + CBasePlayer *GetEnemy(); + int GetNearbyEnemyCount() const; // return max number of nearby enemies we've seen recently + unsigned int GetEnemyPlace() const; // return location where we see the majority of our enemies + bool CanSeeBomber() const; // return true if we can see the bomb carrier + CBasePlayer *GetBomber() const; - int GetNearbyFriendCount(void) const; // return number of nearby teammates - CBasePlayer *GetClosestVisibleFriend(void) const; // return the closest friend that we can see - CBasePlayer *GetClosestVisibleHumanFriend(void) const; // return the closest human friend that we can see + int GetNearbyFriendCount() const; // return number of nearby teammates + CBasePlayer *GetClosestVisibleFriend() const; // return the closest friend that we can see + CBasePlayer *GetClosestVisibleHumanFriend() const; // return the closest human friend that we can see - bool IsOutnumbered(void) const; // return true if we are outnumbered by enemies - int OutnumberedCount(void) const; // return number of enemies we are outnumbered by + bool IsOutnumbered() const; // return true if we are outnumbered by enemies + int OutnumberedCount() const; // return number of enemies we are outnumbered by #define ONLY_VISIBLE_ENEMIES true CBasePlayer *GetImportantEnemy(bool checkVisibility = false) const; // return the closest "important" enemy for the given scenario (bomb carrier, VIP, hostage escorter) - void UpdateReactionQueue(void); // update our reaction time queue - CBasePlayer *GetRecognizedEnemy(void); // return the most dangerous threat we are "conscious" of - bool IsRecognizedEnemyReloading(void); // return true if the enemy we are "conscious" of is reloading - bool IsRecognizedEnemyProtectedByShield(void); // return true if the enemy we are "conscious" of is hiding behind a shield - float GetRangeToNearestRecognizedEnemy(void); // return distance to closest enemy we are "conscious" of + void UpdateReactionQueue(); // update our reaction time queue + CBasePlayer *GetRecognizedEnemy(); // return the most dangerous threat we are "conscious" of + bool IsRecognizedEnemyReloading(); // return true if the enemy we are "conscious" of is reloading + bool IsRecognizedEnemyProtectedByShield(); // return true if the enemy we are "conscious" of is hiding behind a shield + float GetRangeToNearestRecognizedEnemy(); // return distance to closest enemy we are "conscious" of - CBasePlayer *GetAttacker(void) const; // return last enemy that hurt us - float GetTimeSinceAttacked(void) const; // return duration since we were last injured by an attacker - float GetFirstSawEnemyTimestamp(void) const; // time since we saw any enemies - float GetLastSawEnemyTimestamp(void) const; - float GetTimeSinceLastSawEnemy(void) const; - float GetTimeSinceAcquiredCurrentEnemy(void) const; - bool HasNotSeenEnemyForLongTime(void) const; // return true if we haven't seen an enemy for "a long time" - const Vector &GetLastKnownEnemyPosition(void) const; - bool IsEnemyVisible(void) const; // is our current enemy visible - float GetEnemyDeathTimestamp(void) const; - bool IsFriendInLineOfFire(void); // return true if a friend is in our weapon's way - bool IsAwareOfEnemyDeath(void) const; // return true if we *noticed* that our enemy died - int GetLastVictimID(void) const; // return the ID (entindex) of the last victim we killed, or zero + CBasePlayer *GetAttacker() const; // return last enemy that hurt us + float GetTimeSinceAttacked() const; // return duration since we were last injured by an attacker + float GetFirstSawEnemyTimestamp() const; // time since we saw any enemies + float GetLastSawEnemyTimestamp() const; + float GetTimeSinceLastSawEnemy() const; + float GetTimeSinceAcquiredCurrentEnemy() const; + bool HasNotSeenEnemyForLongTime() const; // return true if we haven't seen an enemy for "a long time" + const Vector &GetLastKnownEnemyPosition() const; + bool IsEnemyVisible() const; // is our current enemy visible + float GetEnemyDeathTimestamp() const; + bool IsFriendInLineOfFire(); // return true if a friend is in our weapon's way + bool IsAwareOfEnemyDeath() const; // return true if we *noticed* that our enemy died + int GetLastVictimID() const; // return the ID (entindex) of the last victim we killed, or zero // navigation - bool HasPath(void) const; - void DestroyPath(void); + bool HasPath() const; + void DestroyPath(); - float GetFeetZ(void) const; // return Z of bottom of feet + float GetFeetZ() const; // return Z of bottom of feet enum PathResult { @@ -732,35 +708,35 @@ public: NOXREF bool AStarSearch(CNavArea *startArea, CNavArea *goalArea); // find shortest path from startArea to goalArea - don't actually buid the path bool ComputePath(CNavArea *goalArea, const Vector *goal, RouteType route); // compute path to goal position - bool StayOnNavMesh(void); - CNavArea *GetLastKnownArea(void) const; // return the last area we know we were inside of - const Vector &GetPathEndpoint(void) const; // return final position of our current path - float GetPathDistanceRemaining(void) const; // eturn estimated distance left to travel along path - void ResetStuckMonitor(void); + bool StayOnNavMesh(); + CNavArea *GetLastKnownArea() const; // return the last area we know we were inside of + const Vector &GetPathEndpoint() const; // return final position of our current path + float GetPathDistanceRemaining() const; // eturn estimated distance left to travel along path + void ResetStuckMonitor(); NOXREF bool IsAreaVisible(CNavArea *area) const; // is any portion of the area visible to this bot const Vector &GetPathPosition(int numpath) const; bool GetSimpleGroundHeightWithFloor(const Vector *pos, float *height, Vector *normal = NULL); // find "simple" ground height, treating current nav area as part of the floor - Place GetPlace(void) const; // get our current radio chatter place + Place GetPlace() const; // get our current radio chatter place - bool IsUsingLadder(void) const; // returns true if we are in the process of negotiating a ladder - void GetOffLadder(void); + bool IsUsingLadder() const; // returns true if we are in the process of negotiating a ladder + void GetOffLadder(); void SetGoalEntity(CBaseEntity *entity); - CBaseEntity *GetGoalEntity(void); + CBaseEntity *GetGoalEntity(); - bool IsNearJump(void) const; // return true if nearing a jump in the path + bool IsNearJump() const; // return true if nearing a jump in the path float GetApproximateFallDamage(float height) const; // return how much damage will will take from the given fall height void ForceRun(float duration); // force the bot to run if it moves for the given duration - void Wiggle(void); // random movement, for getting un-stuck + void Wiggle(); // random movement, for getting un-stuck bool IsFriendInTheWay(const Vector *goalPos) const; // return true if a friend is between us and the given position void FeelerReflexAdjustment(Vector *goalPosition); // do reflex avoidance movements if our "feelers" are touched // looking around void SetLookAngles(float yaw, float pitch); // set our desired look angles - void UpdateLookAngles(void); // move actual view angles towards desired ones + void UpdateLookAngles(); // move actual view angles towards desired ones void UpdateLookAround(bool updateNow = false); // update "looking around" mechanism void InhibitLookAround(float duration); // block all "look at" and "looking around" behavior for given duration - just look ahead @@ -770,70 +746,70 @@ public: // look at the given point in space for the given duration (-1 means forever) void SetLookAt(const char *desc, const Vector *pos, PriorityType pri, float duration = -1.0f, bool clearIfClose = false, float angleTolerance = 5.0f); - void ClearLookAt(void); // stop looking at a point in space and just look ahead + void ClearLookAt(); // stop looking at a point in space and just look ahead bool IsLookingAtSpot(PriorityType pri = PRIORITY_LOW) const; // return true if we are looking at spot with equal or higher priority bool IsViewMoving(float angleVelThreshold = 1.0f) const; // returns true if bot's view angles are rotating (not still) - const Vector &GetEyePosition(void) const + const Vector &GetEyePosition() const { m_eyePos = pev->origin + pev->view_ofs; return m_eyePos; } - float ComputeWeaponSightRange(void); // return line-of-sight distance to obstacle along weapon fire ray + float ComputeWeaponSightRange(); // return line-of-sight distance to obstacle along weapon fire ray // approach points - void ComputeApproachPoints(void); // determine the set of "approach points" representing where the enemy can enter this region - NOXREF void UpdateApproachPoints(void); // recompute the approach point set if we have moved far enough to invalidate the current ones - void ClearApproachPoints(void); - void DrawApproachPoints(void); // for debugging + void ComputeApproachPoints(); // determine the set of "approach points" representing where the enemy can enter this region + NOXREF void UpdateApproachPoints(); // recompute the approach point set if we have moved far enough to invalidate the current ones + void ClearApproachPoints(); + void DrawApproachPoints(); // for debugging float GetHidingSpotCheckTimestamp(HidingSpot *spot) const; // return time when given spot was last checked void SetHidingSpotCheckTimestamp(HidingSpot *spot); // set the timestamp of the given spot to now // weapon query and equip #define MUST_EQUIP true void EquipBestWeapon(bool mustEquip = false); // equip the best weapon we are carrying that has ammo - void EquipPistol(void); // equip our pistol - void EquipKnife(void); // equip our knife + void EquipPistol(); // equip our pistol + void EquipKnife(); // equip our knife #define DONT_USE_SMOKE_GRENADE true bool EquipGrenade(bool noSmoke = false); // equip a grenade, return false if we cant - bool IsUsingKnife(void) const; // returns true if we have knife equipped - bool IsUsingPistol(void) const; // returns true if we have pistol equipped - bool IsUsingGrenade(void) const; // returns true if we have grenade equipped - bool IsUsingSniperRifle(void) const; // returns true if using a "sniper" rifle - bool IsUsingAWP(void) const; // returns true if we have AWP equipped + bool IsUsingKnife() const; // returns true if we have knife equipped + bool IsUsingPistol() const; // returns true if we have pistol equipped + bool IsUsingGrenade() const; // returns true if we have grenade equipped + bool IsUsingSniperRifle() const; // returns true if using a "sniper" rifle + bool IsUsingAWP() const; // returns true if we have AWP equipped - bool IsSniper(void) const; // return true if we have a sniper rifle in our inventory - bool IsSniping(void) const; // return true if we are actively sniping (moving to sniper spot or settled in) - bool IsUsingShotgun(void) const; // returns true if using a shotgun - bool IsUsingMachinegun(void) const; // returns true if using the big 'ol machinegun + bool IsSniper() const; // return true if we have a sniper rifle in our inventory + bool IsSniping() const; // return true if we are actively sniping (moving to sniper spot or settled in) + bool IsUsingShotgun() const; // returns true if using a shotgun + bool IsUsingMachinegun() const; // returns true if using the big 'ol machinegun void ThrowGrenade(const Vector *target); // begin the process of throwing the grenade - bool IsThrowingGrenade(void) const; // return true if we are in the process of throwing a grenade - bool HasGrenade(void) const; // return true if we have a grenade in our inventory + bool IsThrowingGrenade() const; // return true if we are in the process of throwing a grenade + bool HasGrenade() const; // return true if we have a grenade in our inventory - bool DoesActiveWeaponHaveSilencer(void) const; - bool IsUsingHEGrenade(void) const; - void StartRapidFire(void); - void StopRapidFire(void); - bool IsRapidFiring(void) const; + bool DoesActiveWeaponHaveSilencer() const; + bool IsUsingHEGrenade() const; + void StartRapidFire(); + void StopRapidFire(); + bool IsRapidFiring() const; enum ZoomType { NO_ZOOM, LOW_ZOOM, HIGH_ZOOM }; - ZoomType GetZoomLevel(void) const; // return the current zoom level of our weapon + ZoomType GetZoomLevel() const; // return the current zoom level of our weapon bool AdjustZoom(float range); // change our zoom level to be appropriate for the given range - bool IsPrimaryWeaponEmpty(void) const; // return true if primary weapon doesn't exist or is totally out of ammo - bool IsPistolEmpty(void) const; // return true if secondary weapon doesn't exist or is totally out of ammo + bool IsPrimaryWeaponEmpty() const; // return true if primary weapon doesn't exist or is totally out of ammo + bool IsPistolEmpty() const; // return true if secondary weapon doesn't exist or is totally out of ammo - int GetHostageEscortCount(void) const; - void IncreaseHostageEscortCount(void); - float GetRangeToFarthestEscortedHostage(void) const; - void ResetWaitForHostagePatience(void); - void ResetValues(void); // reset internal data to initial state - void BotDeathThink(void); - CBasePlayer *FindNearbyPlayer(void); - void AdjustSafeTime(void); // called when enemy seen to adjust safe time for this round + int GetHostageEscortCount() const; + void IncreaseHostageEscortCount(); + float GetRangeToFarthestEscortedHostage() const; + void ResetWaitForHostagePatience(); + void ResetValues(); // reset internal data to initial state + void BotDeathThink(); + CBasePlayer *FindNearbyPlayer(); + void AdjustSafeTime(); // called when enemy seen to adjust safe time for this round void EXPORT BotTouch(CBaseEntity *other); bool HasAnyAmmo(CBasePlayerWeapon *weapon) const; @@ -900,7 +876,7 @@ private: void MoveTowardsPosition(const Vector *pos); // move towards position, independant of view angle NOXREF void MoveAwayFromPosition(const Vector *pos); // move away from position, independant of view angle void StrafeAwayFromPosition(const Vector *pos); // strafe (sidestep) away from position, independant of view angle - void StuckCheck(void); // check if we have become stuck + void StuckCheck(); // check if we have become stuck CNavArea *m_currentArea; // the nav area we are standing on CNavArea *m_lastKnownArea; // the last area we were in @@ -928,10 +904,10 @@ private: CountdownTimer m_repathTimer; // must have elapsed before bot can pathfind again - bool ComputePathPositions(void); // determine actual path positions bot will move between along the path - void SetupLadderMovement(void); + bool ComputePathPositions(); // determine actual path positions bot will move between along the path + void SetupLadderMovement(); void SetPathIndex(int newIndex); // set the current index along the path - void DrawPath(void); + void DrawPath(); int FindOurPositionOnPath(Vector *close, bool local = false) const; // compute the closest point to our current position on our path int FindPathPoint(float aheadRange, Vector *point, int *prevIndex = NULL); // compute a point a fixed distance ahead along our path. bool FindClosestPointOnPath(const Vector *worldPos, int startIndex, int endIndex, Vector *close) const; // compute closest point on path to given point @@ -962,7 +938,7 @@ private: m_pathLadderState; bool m_pathLadderFaceIn; // if true, face towards ladder, otherwise face away const CNavLadder *m_pathLadder; // the ladder we need to use to reach the next area - bool UpdateLadderMovement(void); // called by UpdatePathMovement() + bool UpdateLadderMovement(); // called by UpdatePathMovement() NavRelativeDirType m_pathLadderDismountDir; // which way to dismount float m_pathLadderDismountTimestamp; // time when dismount started float m_pathLadderEnd; // if ascending, z of top, if descending z of bottom @@ -976,7 +952,7 @@ private: // hostages mechanism byte m_hostageEscortCount; - void UpdateHostageEscortCount(void); + void UpdateHostageEscortCount(); float m_hostageEscortCountTimestamp; bool m_isWaitingForHostage; CountdownTimer m_inhibitWaitingForHostageTimer; @@ -988,7 +964,7 @@ private: CNavArea *m_noiseArea; // the nav area containing the noise float m_noiseCheckTimestamp; PriorityType m_noisePriority; // priority of currently heard noise - bool UpdateLookAtNoise(void); // return true if we decided to look towards the most recent noise source + bool UpdateLookAtNoise(); // return true if we decided to look towards the most recent noise source bool m_isNoiseTravelRangeChecked; // "looking around" mechanism @@ -1012,8 +988,8 @@ private: float m_lookAtSpotAngleTolerance; // how exactly we must look at the spot bool m_lookAtSpotClearIfClose; // if true, the look at spot is cleared if it gets close to us const char *m_lookAtDesc; // for debugging - void UpdateLookAt(void); - void UpdatePeripheralVision(void); // update enounter spot timestamps, etc + void UpdateLookAt(); + void UpdatePeripheralVision(); // update enounter spot timestamps, etc float m_peripheralTimestamp; enum { MAX_APPROACH_POINTS = 16 }; @@ -1053,7 +1029,7 @@ private: float m_aimOffsetTimestamp; // time of next offset adjustment float m_aimSpreadTimestamp; // time used to determine max spread as it begins to tighten up void SetAimOffset(float accuracy); // set the current aim offset - void UpdateAimOffset(void); // wiggle aim error based on m_accuracy + void UpdateAimOffset(); // wiggle aim error based on m_accuracy Vector m_aimSpot; // the spot we are currently aiming to fire at // attack state data @@ -1092,8 +1068,8 @@ private: IntervalTimer m_equipTimer; // how long have we had our current weapon equipped bool DoEquip(CBasePlayerWeapon *gun); // equip the given item - void ReloadCheck(void); // reload our weapon if we must - void SilencerCheck(void); // use silencer + void ReloadCheck(); // reload our weapon if we must + void SilencerCheck(); // use silencer float m_fireWeaponTimestamp; @@ -1112,7 +1088,7 @@ private: byte m_enemyQueueCount; byte m_enemyQueueAttendIndex; // index of the timeframe we are "conscious" of - CBasePlayer *FindMostDangerousThreat(void); // return most dangerous threat in my field of view (feeds into reaction time queue) + CBasePlayer *FindMostDangerousThreat(); // return most dangerous threat in my field of view (feeds into reaction time queue) // stuck detection bool m_isStuck; @@ -1130,7 +1106,7 @@ private: // chatter mechanism GameEventType m_lastRadioCommand; // last radio command we recieved - void RespondToRadioCommands(void); + void RespondToRadioCommands(); bool IsRadioCommand(GameEventType event) const; // returns true if the radio message is an order to do something #define NO_FORCE false @@ -1163,25 +1139,24 @@ private: CountdownTimer m_relocateTimer; CNavNode *AddNode(const Vector *destPos, const Vector *normal, NavDirType dir, CNavNode *source); - void StartLearnProcess(void); - void UpdateLearnProcess(void); - bool LearnStep(void); - void StartAnalyzeAlphaProcess(void); - void UpdateAnalyzeAlphaProcess(void); - bool AnalyzeAlphaStep(void); - void StartAnalyzeBetaProcess(void); - void UpdateAnalyzeBetaProcess(void); - bool AnalyzeBetaStep(void); - void StartSaveProcess(void); - void UpdateSaveProcess(void); - void StartNormalProcess(void); - -};/* size: 11424, cachelines: 179, members: 161 */ + void StartLearnProcess(); + void UpdateLearnProcess(); + bool LearnStep(); + void StartAnalyzeAlphaProcess(); + void UpdateAnalyzeAlphaProcess(); + bool AnalyzeAlphaStep(); + void StartAnalyzeBetaProcess(); + void UpdateAnalyzeBetaProcess(); + bool AnalyzeBetaStep(); + void StartSaveProcess(); + void UpdateSaveProcess(); + void StartNormalProcess(); +}; // Inlines /* <51934c> ../cstrike/dlls/bot/cs_bot.h:316 */ -inline float CCSBot::GetCombatRange(void) const +inline float CCSBot::GetCombatRange() const { return m_combatRange; } @@ -1199,110 +1174,110 @@ inline void CCSBot::Hurry(float duration) } /* <5a0773> ../cstrike/dlls/bot/cs_bot.h:326 */ -inline float CCSBot::GetSafeTime(void) const +inline float CCSBot::GetSafeTime() const { return m_safeTime; } /* <5c4b10> ../cstrike/dlls/bot/cs_bot.h:355 */ -inline bool CCSBot::IsCarryingBomb(void) const +inline bool CCSBot::IsCarryingBomb() const { return m_bHasC4; } /* <5a07aa> ../cstrike/dlls/bot/cs_bot.h:369 */ -inline bool CCSBot::IsFollowing(void) const +inline bool CCSBot::IsFollowing() const { return m_isFollowing; } /* <57bf57> ../cstrike/dlls/bot/cs_bot.h:370 */ -inline CBasePlayer *CCSBot::GetFollowLeader(void) +inline CBasePlayer *CCSBot::GetFollowLeader() { return m_leader; } /* <3c5a20> ../cstrike/dlls/bot/cs_bot.h:375 */ -inline float CCSBot::GetFollowDuration(void) const +inline float CCSBot::GetFollowDuration() const { return gpGlobals->time - m_followTimestamp; } /* <3c5a39> ../cstrike/dlls/bot/cs_bot.h:376 */ -inline bool CCSBot::CanAutoFollow(void) const +inline bool CCSBot::CanAutoFollow() const { return (gpGlobals->time > m_allowAutoFollowTime); } /* <3c5a52> ../cstrike/dlls/bot/cs_bot.h:381 */ -inline void CCSBot::AimAtEnemy(void) +inline void CCSBot::AimAtEnemy() { m_isAimingAtEnemy = true; } /* <3c5a70> ../cstrike/dlls/bot/cs_bot.h:382 */ -inline void CCSBot::StopAiming(void) +inline void CCSBot::StopAiming() { m_isAimingAtEnemy = false; } /* <3c5a89> ../cstrike/dlls/bot/cs_bot.h:383 */ -inline bool CCSBot::IsAimingAtEnemy(void) const +inline bool CCSBot::IsAimingAtEnemy() const { return m_isAimingAtEnemy; } /* <3e9c5e> ../cstrike/dlls/bot/cs_bot.h:385 */ -inline bool CCSBot::IsSurprised(void) const +inline bool CCSBot::IsSurprised() const { return gpGlobals->time - m_surpriseTimestamp < 5.0f; } /* <3ea00d> ../cstrike/dlls/bot/cs_bot.h:386 */ -inline float CCSBot::GetSurpriseDelay(void) const +inline float CCSBot::GetSurpriseDelay() const { return gpGlobals->time - IsSurprised() ? m_surpriseDelay : 0.0f; } /* <51938e> ../cstrike/dlls/bot/cs_bot.h:387 */ -inline void CCSBot::ClearSurpriseDelay(void) +inline void CCSBot::ClearSurpriseDelay() { m_surpriseDelay = 0.0f; m_surpriseTimestamp = 0.0f; } /* <5e2f12> ../cstrike/dlls/bot/cs_bot.h:389 */ -inline float CCSBot::GetStateTimestamp(void) const +inline float CCSBot::GetStateTimestamp() const { return m_stateTimestamp; } /* <5c4c60> ../cstrike/dlls/bot/cs_bot.h:394 */ -inline CSGameState *CCSBot::GetGameState(void) +inline CSGameState *CCSBot::GetGameState() { return &m_gameState; } /* <2e7d45> ../cstrike/dlls/bot/cs_bot.h:395 */ -inline const CSGameState *CCSBot::GetGameState(void) const +inline const CSGameState *CCSBot::GetGameState() const { return &m_gameState; } /* <5c4ce8> ../cstrike/dlls/bot/cs_bot.h:397 */ -inline bool CCSBot::IsAtBombsite(void) +inline bool CCSBot::IsAtBombsite() { return (m_signals.GetState() & SIGNAL_BOMB) == SIGNAL_BOMB; } /* <5a07c3> ../cstrike/dlls/bot/cs_bot.h:453 */ -inline CCSBot::MoraleType CCSBot::GetMorale(void) const +inline CCSBot::MoraleType CCSBot::GetMorale() const { return m_morale; } /* <5b2dba> ../cstrike/dlls/bot/cs_bot.h:459 */ -inline bool CCSBot::IsNoiseHeard(void) const +inline bool CCSBot::IsNoiseHeard() const { if (m_noiseTimestamp <= 0.0f) return false; @@ -1322,170 +1297,170 @@ inline void CCSBot::SetTask(TaskType task, CBaseEntity *entity) } /* <5e2f30> ../cstrike/dlls/bot/cs_bot.h:427 */ -inline CCSBot::TaskType CCSBot::GetTask(void) const +inline CCSBot::TaskType CCSBot::GetTask() const { return m_task; } /* <5c4c42> ../cstrike/dlls/bot/cs_bot.h:428 */ -inline CBaseEntity *CCSBot::GetTaskEntity(void) +inline CBaseEntity *CCSBot::GetTaskEntity() { return m_taskEntity; } /* <5b2d33> ../cstrike/dlls/bot/cs_bot.h:474 */ -inline CNavArea *CCSBot::GetNoiseArea(void) const +inline CNavArea *CCSBot::GetNoiseArea() const { return m_noiseArea; } /* <5b2d51> ../cstrike/dlls/bot/cs_bot.h:475 */ -inline void CCSBot::ForgetNoise(void) +inline void CCSBot::ForgetNoise() { m_noiseTimestamp = 0.0f; } /* <5b2d6f> ../cstrike/dlls/bot/cs_bot.h:487 */ -inline PriorityType CCSBot::GetNoisePriority(void) const +inline PriorityType CCSBot::GetNoisePriority() const { return m_noisePriority; } /* <5c4ccf> ../cstrike/dlls/bot/cs_bot.h:491 */ -inline BotChatterInterface *CCSBot::GetChatter(void) +inline BotChatterInterface *CCSBot::GetChatter() { return &m_chatter; } /* <111238> ../cstrike/dlls/bot/cs_bot.h:508 */ -inline bool CCSBot::IsUsingVoice(void) const +inline bool CCSBot::IsUsingVoice() const { return (m_voiceFeedbackEndTimestamp != 0.0f); } /* <519493> ../cstrike/dlls/bot/cs_bot.h:513 */ -inline CBasePlayer *CCSBot::GetEnemy(void) +inline CBasePlayer *CCSBot::GetEnemy() { return m_enemy; } /* <57bfbd> ../cstrike/dlls/bot/cs_bot.h:514 */ -inline int CCSBot::GetNearbyEnemyCount(void) const +inline int CCSBot::GetNearbyEnemyCount() const { return Q_min(GetEnemiesRemaining(), m_nearbyEnemyCount); } /* <2fecad> ../cstrike/dlls/bot/cs_bot.h:515 */ -inline unsigned int CCSBot::GetEnemyPlace(void) const +inline unsigned int CCSBot::GetEnemyPlace() const { return m_enemyPlace; } /* <2eff13> ../cstrike/dlls/bot/cs_bot.h:516 */ -inline bool CCSBot::CanSeeBomber(void) const +inline bool CCSBot::CanSeeBomber() const { return (m_bomber == NULL) ? false : true; } /* <3c6110> ../cstrike/dlls/bot/cs_bot.h:517 */ -inline CBasePlayer *CCSBot::GetBomber(void) const +inline CBasePlayer *CCSBot::GetBomber() const { return m_bomber; } /* <2fecc8> ../cstrike/dlls/bot/cs_bot.h:519 */ -inline int CCSBot::GetNearbyFriendCount(void) const +inline int CCSBot::GetNearbyFriendCount() const { return Q_min(GetFriendsRemaining(), m_nearbyFriendCount); } /* <3a138c> ../cstrike/dlls/bot/cs_bot.h:521 */ -inline CBasePlayer *CCSBot::GetClosestVisibleFriend(void) const +inline CBasePlayer *CCSBot::GetClosestVisibleFriend() const { return m_closestVisibleFriend; } /* <3c615b> ../cstrike/dlls/bot/cs_bot.h:521 */ -inline CBasePlayer *CCSBot::GetClosestVisibleHumanFriend(void) const +inline CBasePlayer *CCSBot::GetClosestVisibleHumanFriend() const { return m_closestVisibleHumanFriend; } /* <57bfd6> ../cstrike/dlls/bot/cs_bot.h:536 */ -inline float CCSBot::GetTimeSinceAttacked(void) const +inline float CCSBot::GetTimeSinceAttacked() const { return gpGlobals->time - m_attackedTimestamp; } /* <56ae2c> ../cstrike/dlls/bot/cs_bot.h:537 */ -inline float CCSBot::GetFirstSawEnemyTimestamp(void) const +inline float CCSBot::GetFirstSawEnemyTimestamp() const { return m_firstSawEnemyTimestamp; } /* <58df07> ../cstrike/dlls/bot/cs_bot.h:538 */ -inline float CCSBot::GetLastSawEnemyTimestamp(void) const +inline float CCSBot::GetLastSawEnemyTimestamp() const { return m_lastSawEnemyTimestamp; } /* <3e9ccc> ../cstrike/dlls/bot/cs_bot.h:539 */ -inline float CCSBot::GetTimeSinceLastSawEnemy(void) const +inline float CCSBot::GetTimeSinceLastSawEnemy() const { return gpGlobals->time - m_lastSawEnemyTimestamp; } /* <3e9ce5> ../cstrike/dlls/bot/cs_bot.h:540 */ -inline float CCSBot::GetTimeSinceAcquiredCurrentEnemy(void) const +inline float CCSBot::GetTimeSinceAcquiredCurrentEnemy() const { return gpGlobals->time - m_currentEnemyAcquireTimestamp; } /* <5196d7> ../cstrike/dlls/bot/cs_bot.h:542 */ -inline const Vector &CCSBot::GetLastKnownEnemyPosition(void) const +inline const Vector &CCSBot::GetLastKnownEnemyPosition() const { return m_lastEnemyPosition; } /* <5e2f49> ../cstrike/dlls/bot/cs_bot.h:543 */ -inline bool CCSBot::IsEnemyVisible(void) const +inline bool CCSBot::IsEnemyVisible() const { return m_isEnemyVisible; } /* <519429> ../cstrike/dlls/bot/cs_bot.h:544 */ -inline float CCSBot::GetEnemyDeathTimestamp(void) const +inline float CCSBot::GetEnemyDeathTimestamp() const { return m_enemyDeathTimestamp; } /* <519442> ../cstrike/dlls/bot/cs_bot.h:547 */ -inline int CCSBot::GetLastVictimID(void) const +inline int CCSBot::GetLastVictimID() const { return m_lastVictimID; } /* <5b2da1> ../cstrike/dlls/bot/cs_bot.h:550 */ -inline bool CCSBot::HasPath(void) const +inline bool CCSBot::HasPath() const { return m_pathLength != 0; } /* <5a07f5> ../cstrike/dlls/bot/cs_bot.h:551 */ -inline void CCSBot::DestroyPath(void) +inline void CCSBot::DestroyPath() { m_pathLength = 0; m_pathLadder = NULL; } /* <5a0813> ../cstrike/dlls/bot/cs_bot.h:567 */ -inline CNavArea *CCSBot::GetLastKnownArea(void) const +inline CNavArea *CCSBot::GetLastKnownArea() const { return m_lastKnownArea; } /* <51963c> ../cstrike/dlls/bot/cs_bot.h:568 */ -inline const Vector &CCSBot::GetPathEndpoint(void) const +inline const Vector &CCSBot::GetPathEndpoint() const { return m_path[ m_pathLength - 1 ].pos; } @@ -1497,7 +1472,7 @@ inline const Vector &CCSBot::GetPathPosition(int numpath) const } /* <5c4b79> ../cstrike/dlls/bot/cs_bot.h:577 */ -inline bool CCSBot::IsUsingLadder(void) const +inline bool CCSBot::IsUsingLadder() const { return m_pathLadder != NULL; } @@ -1509,7 +1484,7 @@ inline void CCSBot::SetGoalEntity(CBaseEntity *entity) } /* <5c4d01> ../cstrike/dlls/bot/cs_bot.h:581 */ -inline CBaseEntity *CCSBot::GetGoalEntity(void) +inline CBaseEntity *CCSBot::GetGoalEntity() { return m_goalEntity; } @@ -1540,7 +1515,7 @@ inline void CCSBot::SetLookAheadAngle(float angle) } /* <5e2f62> ../cstrike/dlls/bot/cs_bot.h:612 */ -inline void CCSBot::ClearLookAt(void) +inline void CCSBot::ClearLookAt() { //PrintIfWatched("ClearLookAt()\n"); m_lookAtSpotState = NOT_LOOKING_AT_SPOT; @@ -1568,31 +1543,31 @@ inline bool CCSBot::IsViewMoving(float angleVelThreshold) const } /* <57c047> ../cstrike/dlls/bot/cs_bot.h:651 */ -inline void CCSBot::ClearApproachPoints(void) +inline void CCSBot::ClearApproachPoints() { m_approachPointCount = 0; } /* <3e9d7e> ../cstrike/dlls/bot/cs_bot.h:674 */ -inline bool CCSBot::IsThrowingGrenade(void) const +inline bool CCSBot::IsThrowingGrenade() const { return m_isWaitingToTossGrenade; } /* <3e9d97> ../cstrike/dlls/bot/cs_bot.h:679 */ -inline void CCSBot::StartRapidFire(void) +inline void CCSBot::StartRapidFire() { m_isRapidFiring = true; } /* <3e9db0> ../cstrike/dlls/bot/cs_bot.h:680 */ -inline void CCSBot::StopRapidFire(void) +inline void CCSBot::StopRapidFire() { m_isRapidFiring = false; } /* <51954d> ../cstrike/dlls/bot/cs_bot.h:684 */ -inline CCSBot::ZoomType CCSBot::GetZoomLevel(void) const +inline CCSBot::ZoomType CCSBot::GetZoomLevel() const { if (m_iFOV > 60.0f) return NO_ZOOM; @@ -1604,26 +1579,26 @@ inline CCSBot::ZoomType CCSBot::GetZoomLevel(void) const } /* <5c4b92> ../cstrike/dlls/bot/cs_bot.h:698 */ -inline int CCSBot::GetHostageEscortCount(void) const +inline int CCSBot::GetHostageEscortCount() const { return m_hostageEscortCount; } /* <5e2f80> ../cstrike/dlls/bot/cs_bot.h:699 */ -inline void CCSBot::IncreaseHostageEscortCount(void) +inline void CCSBot::IncreaseHostageEscortCount() { ++m_hostageEscortCount; } /* <5a0c4d> ../cstrike/dlls/bot/cs_bot.h:701 */ -inline void CCSBot::ResetWaitForHostagePatience(void) +inline void CCSBot::ResetWaitForHostagePatience() { m_isWaitingForHostage = false; m_inhibitWaitingForHostageTimer.Invalidate(); } /* <5d402a> ../cstrike/dlls/bot/cs_bot.h:1055 */ -inline float CCSBot::GetFeetZ(void) const +inline float CCSBot::GetFeetZ() const { if (IsCrouching()) { @@ -1638,7 +1613,7 @@ inline float CCSBot::GetFeetZ(void) const } /* <5b2dd3> ../cstrike/dlls/bot/cs_bot.h:1063 */ -inline const Vector *CCSBot::GetNoisePosition(void) const +inline const Vector *CCSBot::GetNoisePosition() const { if (m_noiseTimestamp > 0.0f) return &m_noisePosition; @@ -1647,7 +1622,7 @@ inline const Vector *CCSBot::GetNoisePosition(void) const } /* <519655> ../cstrike/dlls/bot/cs_bot.h:1071 */ -inline bool CCSBot::IsAwareOfEnemyDeath(void) const +inline bool CCSBot::IsAwareOfEnemyDeath() const { if (GetEnemyDeathTimestamp() == 0.0f) return false; @@ -1662,7 +1637,7 @@ inline bool CCSBot::IsAwareOfEnemyDeath(void) const } /* <568b12> ../cstrike/dlls/bot/cs_bot.h:1085 */ -inline bool CCSBot::IsNotMoving(void) const +inline bool CCSBot::IsNotMoving() const { const float stillSpeed = 10.0f; return pev->velocity.IsLengthLessThan(stillSpeed); @@ -1737,8 +1712,7 @@ public: const Vector *m_spot[ MAX_SPOTS ]; int m_count; - -};/* size: 1036, cachelines: 17, members: 4 */ +}; /* <2e7f9f> ../cstrike/dlls/bot/cs_bot.cpp:1088 */ class FarthestHostage @@ -1786,8 +1760,7 @@ public: const CCSBot *m_me; float m_farRange; - -};/* size: 8, cachelines: 1, members: 2 */ +}; // Functor used with NavAreaBuildPath() @@ -1932,8 +1905,7 @@ public: private: CCSBot *m_bot; RouteType m_route; - -};/* size: 8, cachelines: 1, members: 2 */ +}; /* <568fae> ../cstrike/dlls/bot/states/cs_bot_follow.cpp:95 */ class FollowTargetCollector @@ -2003,47 +1975,17 @@ public: Vector2D m_cutoff; CNavArea *m_targetArea[ MAX_TARGET_AREAS ]; int m_targetAreaCount; +}; -};/* size: 536, cachelines: 9, members: 5 */ - -#ifdef HOOK_GAMEDLL - -typedef bool (CCSBot::*CS_IS_VISIBLE_VECTOR)(const Vector *, bool) const; -typedef bool (CCSBot::*CS_IS_VISIBLE_CBASEPLAYER)(CBasePlayer *, bool, unsigned char *) const; - -typedef const Vector *(FIND_SPOT_CSSBOT)(CCSBot *, float); -typedef void (CCSBot::*HIDE_NAV_AREA)(CNavArea *, float, float, bool); -typedef void (CCSBot::*HIDE_VECTOR)(const Vector *, float, bool); - -typedef const CSGameState *(CCSBot::*GETGAMESTATE_CONST)(void) const; -typedef CSGameState *(CCSBot::*GETGAMESTATE_NOTCONST)(void); - -// NavAreaBuildPath hook -inline bool NavAreaBuildPath__PathCost__wrapper(CNavArea *startArea, CNavArea *goalArea, const Vector *goalPos, PathCost &costFunc, CNavArea **closestArea) -{ - return NavAreaBuildPath(startArea, goalArea, goalPos, costFunc, closestArea); -} - -// NavAreaTravelDistance hook -inline float_precision NavAreaTravelDistance__PathCost__wrapper(CNavArea *startArea, CNavArea *endArea, PathCost &costFunc) -{ - return NavAreaTravelDistance(startArea, endArea, costFunc); -} - -// refs -extern void (*pCCSBot__UpdateLookAngles)(void); - -#endif // HOOK_GAMEDLL - -void InstallBotControl(void); -void Bot_ServerCommand(void); -void Bot_RegisterCvars(void); +void InstallBotControl(); +void Bot_ServerCommand(); +void Bot_RegisterCvars(); int GetBotFollowCount(CBasePlayer *leader); const Vector *FindNearbyRetreatSpot(CCSBot *me, float maxRange); void drawProgressMeter(float progress, char *title); void startProgressMeter(const char *title); -void hideProgressMeter(void); +void hideProgressMeter(); bool isSniperRifle(CBasePlayerItem *item); float StayOnLadderLine(CCSBot *me, const CNavLadder *ladder); diff --git a/regamedll/dlls/bot/cs_bot_chatter.cpp b/regamedll/dlls/bot/cs_bot_chatter.cpp index 2a56dcca..8b3e6dda 100644 --- a/regamedll/dlls/bot/cs_bot_chatter.cpp +++ b/regamedll/dlls/bot/cs_bot_chatter.cpp @@ -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); } @@ -652,7 +644,7 @@ bool BotPhraseManager::Initialize(const char *filename, int bankIndex) Q_snprintf(compositeFilename, RadioPathLen, "sound\\%s", speak->m_phrase); speak->m_duration = (double)GET_APPROX_WAVE_PLAY_LEN(compositeFilename) / 1000.0f; - + if (speak->m_duration <= 0.0f) { CONSOLE_ECHO("Warning: Couldn't get duration of phrase '%s'\n", compositeFilename); @@ -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) @@ -707,7 +699,7 @@ BotPhraseManager::~BotPhraseManager(void) delete phrase; } } - + m_list.clear(); m_placeList.clear(); } @@ -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; @@ -1343,7 +1335,7 @@ void BotChatterInterface::Reset(void) if (msg->GetType() != REPORT_ROUND_END) RemoveStatement(msg); } - + m_seeAtLeastOneEnemy = false; m_timeWhenSawFirstEnemy = 0.0f; m_reportedEnemies = false; @@ -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 diff --git a/regamedll/dlls/bot/cs_bot_chatter.h b/regamedll/dlls/bot/cs_bot_chatter.h index 9695d801..2fef3a8f 100644 --- a/regamedll/dlls/bot/cs_bot_chatter.h +++ b/regamedll/dlls/bot/cs_bot_chatter.h @@ -43,17 +43,16 @@ class BotChatterInterface; typedef unsigned int PlaceCriteria; typedef unsigned int CountCriteria; -// A meme is a unit information that bots use to +// A meme is a unit information that bots use to // transmit information to each other via the radio /* <2fe97b> ../cstrike/dlls/bot/cs_bot_chatter.h:42 */ class BotMeme { public: - void Transmit(CCSBot *sender) const; // transmit meme to other bots + 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 { @@ -61,12 +60,12 @@ public: virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme #ifdef HOOK_GAMEDLL - + void Interpret_(CCSBot *sender, CCSBot *receiver) const; -#endif //HOOK_GAMEDLL +#endif // HOOK_GAMEDLL -};/* size: 4, cachelines: 1, members: 1 */ +}; class BotHostageBeingTakenMeme: public BotMeme { @@ -74,12 +73,12 @@ public: virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme #ifdef HOOK_GAMEDLL - + 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 @@ -92,15 +91,14 @@ public: virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme #ifdef HOOK_GAMEDLL - + 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 @@ -116,16 +114,15 @@ public: virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme #ifdef HOOK_GAMEDLL - + 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 @@ -141,16 +138,15 @@ public: virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme #ifdef HOOK_GAMEDLL - + 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 @@ -159,12 +155,11 @@ public: virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme #ifdef HOOK_GAMEDLL - + 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 @@ -177,15 +172,14 @@ public: virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme #ifdef HOOK_GAMEDLL - + 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 @@ -194,12 +188,11 @@ public: virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme #ifdef HOOK_GAMEDLL - + 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 @@ -208,12 +201,12 @@ public: virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme #ifdef HOOK_GAMEDLL - + 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 BotSpeakableVector; typedef std::STD_VECTOR 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 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 { @@ -477,13 +467,13 @@ public: LONG_DELAY, ACCUMULATE_ENEMIES_DELAY, }; - void AppendPhrase(ContextType contextPhrase); // special phrases that depend on the context + 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 + void AttachMeme(BotMeme *meme); // attach a meme to this statement, to be transmitted to other friendly bots when spoken public: friend class BotChatterInterface; @@ -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 OnEvent(GameEventType event, CBaseEntity *entity, CBaseEntity *other); // invoked when event occurs in the game (some events have NULL entities) + 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 diff --git a/regamedll/dlls/bot/cs_bot_event.cpp b/regamedll/dlls/bot/cs_bot_event.cpp index 33a0411b..fd9baf17 100644 --- a/regamedll/dlls/bot/cs_bot_event.cpp +++ b/regamedll/dlls/bot/cs_bot_event.cpp @@ -3,56 +3,56 @@ /* <31d087> ../cstrike/dlls/bot/cs_bot_event.cpp:22 */ void CCSBot::__MAKE_VHOOK(OnEvent)(GameEventType event, CBaseEntity *entity, CBaseEntity *other) { - GetGameState()->OnEvent(event, entity, other); + GetGameState()->OnEvent(event, entity, other); GetChatter()->OnEvent(event, entity, other); - // Morale adjustments happen even for dead players - switch (event) - { - case EVENT_TERRORISTS_WIN: - if (m_iTeam == CT) - { - DecreaseMorale(); - } - else - { - IncreaseMorale(); - } - break; - case EVENT_CTS_WIN: - if (m_iTeam == CT) - { - IncreaseMorale(); - } - else - { - DecreaseMorale(); - } - break; + // Morale adjustments happen even for dead players + switch (event) + { + case EVENT_TERRORISTS_WIN: + if (m_iTeam == CT) + { + DecreaseMorale(); + } + else + { + IncreaseMorale(); + } + break; + case EVENT_CTS_WIN: + if (m_iTeam == CT) + { + IncreaseMorale(); + } + else + { + DecreaseMorale(); + } + break; } if (!IsAlive()) return; - CBasePlayer *player = static_cast(entity); - + CBasePlayer *player = static_cast(entity); + // If we just saw a nearby friend die, and we haven't yet acquired an enemy - // automatically acquire our dead friend's killer - if (!IsAttacking() && (GetDisposition() == ENGAGE_AND_INVESTIGATE || GetDisposition() == OPPORTUNITY_FIRE)) - { - if (event == EVENT_PLAYER_DIED) - { - if (player->m_iTeam == m_iTeam) - { - CBasePlayer *killer = static_cast(other); - - // check that attacker is an enemy (for friendly fire, etc) - if (killer && killer->IsPlayer()) - { + // automatically acquire our dead friend's killer + if (!IsAttacking() && (GetDisposition() == ENGAGE_AND_INVESTIGATE || GetDisposition() == OPPORTUNITY_FIRE)) + { + if (event == EVENT_PLAYER_DIED) + { + if (player->m_iTeam == m_iTeam) + { + CBasePlayer *killer = static_cast(other); + + // check that attacker is an enemy (for friendly fire, etc) + if (killer && killer->IsPlayer()) + { // check if we saw our friend die - dont check FOV - assume we're aware of our surroundings in combat // snipers stay put if (!IsSniper() && IsVisible(&player->pev->origin)) - { + { // people are dying - we should hurry Hurry(RANDOM_FLOAT(10.0f, 15.0f)); @@ -63,11 +63,11 @@ void CCSBot::__MAKE_VHOOK(OnEvent)(GameEventType event, CBaseEntity *entity, CBa PrintIfWatched("Attacking our friend's killer!\n"); Attack(killer); return; - } - } - } - } - } + } + } + } + } + } } switch (event) @@ -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 diff --git a/regamedll/dlls/bot/cs_bot_init.cpp b/regamedll/dlls/bot/cs_bot_init.cpp index fd0e225f..979a4aa6 100644 --- a/regamedll/dlls/bot/cs_bot_init.cpp +++ b/regamedll/dlls/bot/cs_bot_init.cpp @@ -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,46 +61,46 @@ void Bot_ServerCommand(void) } /* <333cec> ../cstrike/dlls/bot/cs_bot_init.cpp:81 */ -void Bot_RegisterCvars(void) +void Bot_RegisterCvars() { - if (UTIL_IsGame("czero")) - { - CVAR_REGISTER(&cv_bot_traceview); - CVAR_REGISTER(&cv_bot_stop); - CVAR_REGISTER(&cv_bot_show_nav); - CVAR_REGISTER(&cv_bot_show_danger); - CVAR_REGISTER(&cv_bot_nav_edit); - CVAR_REGISTER(&cv_bot_nav_zdraw); - CVAR_REGISTER(&cv_bot_walk); - CVAR_REGISTER(&cv_bot_difficulty); - CVAR_REGISTER(&cv_bot_debug); - CVAR_REGISTER(&cv_bot_quicksave); - CVAR_REGISTER(&cv_bot_quota); - CVAR_REGISTER(&cv_bot_quota_match); - CVAR_REGISTER(&cv_bot_prefix); - CVAR_REGISTER(&cv_bot_allow_rogues); - CVAR_REGISTER(&cv_bot_allow_pistols); - CVAR_REGISTER(&cv_bot_allow_shotguns); - CVAR_REGISTER(&cv_bot_allow_sub_machine_guns); - CVAR_REGISTER(&cv_bot_allow_rifles); - CVAR_REGISTER(&cv_bot_allow_machine_guns); - CVAR_REGISTER(&cv_bot_allow_grenades); - CVAR_REGISTER(&cv_bot_allow_snipers); - CVAR_REGISTER(&cv_bot_allow_shield); - CVAR_REGISTER(&cv_bot_join_team); - CVAR_REGISTER(&cv_bot_join_after_player); - CVAR_REGISTER(&cv_bot_auto_vacate); - CVAR_REGISTER(&cv_bot_zombie); - CVAR_REGISTER(&cv_bot_defer_to_human); - CVAR_REGISTER(&cv_bot_chatter); - CVAR_REGISTER(&cv_bot_profile_db); - } + if (!g_bIsCzeroGame) + return; + + CVAR_REGISTER(&cv_bot_traceview); + CVAR_REGISTER(&cv_bot_stop); + CVAR_REGISTER(&cv_bot_show_nav); + CVAR_REGISTER(&cv_bot_show_danger); + CVAR_REGISTER(&cv_bot_nav_edit); + CVAR_REGISTER(&cv_bot_nav_zdraw); + CVAR_REGISTER(&cv_bot_walk); + CVAR_REGISTER(&cv_bot_difficulty); + CVAR_REGISTER(&cv_bot_debug); + CVAR_REGISTER(&cv_bot_quicksave); + CVAR_REGISTER(&cv_bot_quota); + CVAR_REGISTER(&cv_bot_quota_match); + CVAR_REGISTER(&cv_bot_prefix); + CVAR_REGISTER(&cv_bot_allow_rogues); + CVAR_REGISTER(&cv_bot_allow_pistols); + CVAR_REGISTER(&cv_bot_allow_shotguns); + CVAR_REGISTER(&cv_bot_allow_sub_machine_guns); + CVAR_REGISTER(&cv_bot_allow_rifles); + CVAR_REGISTER(&cv_bot_allow_machine_guns); + CVAR_REGISTER(&cv_bot_allow_grenades); + CVAR_REGISTER(&cv_bot_allow_snipers); + CVAR_REGISTER(&cv_bot_allow_shield); + CVAR_REGISTER(&cv_bot_join_team); + CVAR_REGISTER(&cv_bot_join_after_player); + CVAR_REGISTER(&cv_bot_auto_vacate); + CVAR_REGISTER(&cv_bot_zombie); + 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) { ; } @@ -148,7 +116,7 @@ bool CCSBot::__MAKE_VHOOK(Initialize)(const BotProfile *profile) // CS bot initialization m_diedLastRound = false; m_morale = POSITIVE; // starting a new round makes everyone a little happy - + m_combatRange = RANDOM_FLOAT(325, 425); m_navNodeList = NULL; @@ -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 diff --git a/regamedll/dlls/bot/cs_bot_learn.cpp b/regamedll/dlls/bot/cs_bot_learn.cpp index 35fc581e..679885eb 100644 --- a/regamedll/dlls/bot/cs_bot_learn.cpp +++ b/regamedll/dlls/bot/cs_bot_learn.cpp @@ -98,7 +98,7 @@ CNavNode *CCSBot::AddNode(const Vector *destPos, const Vector *normal, NavDirTyp { floor = *destPos + Vector(x, y, 5.0f); ceiling = *destPos + Vector(x, y, 72.0f - epsilon); - + UTIL_TraceLine(floor, ceiling, ignore_monsters, dont_ignore_glass, ENT(pev), &result); if (result.flFraction != 1.0f) @@ -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"); @@ -155,7 +155,7 @@ void CCSBot::StartLearnProcess(void) Vector normal; Vector pos = pev->origin; - + SnapToGrid(&pos.x); SnapToGrid(&pos.y); @@ -178,185 +178,185 @@ 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) -{ - // take a step - while (true) - { - if (m_currentNode == NULL) - { - // search is exhausted - continue search from ends of ladders - NavLadderList::iterator iter; - for (iter = TheNavLadderList.begin(); iter != TheNavLadderList.end(); ++iter) - { - CNavLadder *ladder = (*iter); - - // check ladder bottom - if ((m_currentNode = LadderEndSearch(ladder->m_entity, &ladder->m_bottom, ladder->m_dir)) != 0) - break; - - // check ladder top - if ((m_currentNode = LadderEndSearch(ladder->m_entity, &ladder->m_top, ladder->m_dir)) != 0) - break; - } - - if (m_currentNode == NULL) - { - // all seeds exhausted, sampling complete - GenerateNavigationAreaMesh(); - return false; - } - } - - // Take a step from this node - for (int dir = NORTH; dir < NUM_DIRECTIONS; dir++) - { - if (!m_currentNode->HasVisited((NavDirType)dir)) - { - float feetOffset = pev->origin.z - GetFeetZ(); - - // start at current node position - Vector pos = *m_currentNode->GetPosition(); - - // snap to grid - int cx = SnapToGrid(pos.x); - int cy = SnapToGrid(pos.y); - - // attempt to move to adjacent node - switch (dir) - { - case NORTH: cy -= GenerationStepSize; break; - case SOUTH: cy += GenerationStepSize; break; - case EAST: cx += GenerationStepSize; break; - case WEST: cx -= GenerationStepSize; break; - } - - pos.x = cx; - pos.y = cy; - - m_generationDir = (NavDirType)dir; - - // mark direction as visited - m_currentNode->MarkAsVisited(m_generationDir); - - // test if we can move to new position - TraceResult result; - Vector from, to; - - // modify position to account for change in ground level during step - to.x = pos.x; - to.y = pos.y; - Vector toNormal; - if (GetGroundHeight(&pos, &to.z, &toNormal) == false) - { - return true; - } - - from = *m_currentNode->GetPosition(); - - Vector fromOrigin = from + Vector(0, 0, feetOffset); - Vector toOrigin = to + Vector(0, 0, feetOffset); - - UTIL_SetOrigin(pev, toOrigin); - UTIL_TraceLine(fromOrigin, toOrigin, ignore_monsters, dont_ignore_glass, ENT(pev), &result); - - bool walkable; - - if (result.flFraction == 1.0f && !result.fStartSolid) - { - // the trace didnt hit anything - clear - float toGround = to.z; - float fromGround = from.z; - - float epsilon = 0.1f; - - // check if ledge is too high to reach or will cause us to fall to our death - if (toGround - fromGround > JumpCrouchHeight + epsilon || fromGround - toGround > DeathDrop) - { - walkable = false; - } - else - { - // check surface normals along this step to see if we would cross any impassable slopes - Vector delta = to - from; - const float inc = 2.0f; - float along = inc; - bool done = false; - float ground; - Vector normal; - - walkable = true; - - while (!done) - { - Vector p; - - // need to guarantee that we test the exact edges - if (along >= GenerationStepSize) - { - p = to; - done = true; - } - else - { - p = from + delta * (along / GenerationStepSize); - } - - if (GetGroundHeight(&p, &ground, &normal) == false) - { - walkable = false; - break; - } - - // check for maximum allowed slope - if (normal.z < 0.7f) - { - walkable = false; - break; - } - - along += inc; - } - } - } - // TraceLine hit something... - else - { - if (IsEntityWalkable(VARS(result.pHit), WALK_THRU_EVERYTHING)) - { - walkable = true; - } - else - { - walkable = false; - } - } -#ifdef REGAMEDLL_FIXES - // if we're incrementally generating, don't overlap existing nav areas - CNavArea *overlap = TheNavAreaGrid.GetNavArea(&to, HumanHeight); - if (overlap != NULL) - { - walkable = false; - } -#endif // REGAMEDLL_FIXES - if (walkable) - { - // we can move here - // create a new navigation node, and update current node pointer - CNavNode *newNode = AddNode(&to, &toNormal, m_generationDir, m_currentNode); - } - - return true; - } - } - - // all directions have been searched from this node - pop back to its parent and continue - m_currentNode = m_currentNode->GetParent(); +bool CCSBot::LearnStep() +{ + // take a step + while (true) + { + if (m_currentNode == NULL) + { + // search is exhausted - continue search from ends of ladders + NavLadderList::iterator iter; + for (iter = TheNavLadderList.begin(); iter != TheNavLadderList.end(); ++iter) + { + CNavLadder *ladder = (*iter); + + // check ladder bottom + if ((m_currentNode = LadderEndSearch(ladder->m_entity, &ladder->m_bottom, ladder->m_dir)) != 0) + break; + + // check ladder top + if ((m_currentNode = LadderEndSearch(ladder->m_entity, &ladder->m_top, ladder->m_dir)) != 0) + break; + } + + if (m_currentNode == NULL) + { + // all seeds exhausted, sampling complete + GenerateNavigationAreaMesh(); + return false; + } + } + + // Take a step from this node + for (int dir = NORTH; dir < NUM_DIRECTIONS; dir++) + { + if (!m_currentNode->HasVisited((NavDirType)dir)) + { + float feetOffset = pev->origin.z - GetFeetZ(); + + // start at current node position + Vector pos = *m_currentNode->GetPosition(); + + // snap to grid + int cx = SnapToGrid(pos.x); + int cy = SnapToGrid(pos.y); + + // attempt to move to adjacent node + switch (dir) + { + case NORTH: cy -= GenerationStepSize; break; + case SOUTH: cy += GenerationStepSize; break; + case EAST: cx += GenerationStepSize; break; + case WEST: cx -= GenerationStepSize; break; + } + + pos.x = cx; + pos.y = cy; + + m_generationDir = (NavDirType)dir; + + // mark direction as visited + m_currentNode->MarkAsVisited(m_generationDir); + + // test if we can move to new position + TraceResult result; + Vector from, to; + + // modify position to account for change in ground level during step + to.x = pos.x; + to.y = pos.y; + Vector toNormal; + if (GetGroundHeight(&pos, &to.z, &toNormal) == false) + { + return true; + } + + from = *m_currentNode->GetPosition(); + + Vector fromOrigin = from + Vector(0, 0, feetOffset); + Vector toOrigin = to + Vector(0, 0, feetOffset); + + UTIL_SetOrigin(pev, toOrigin); + UTIL_TraceLine(fromOrigin, toOrigin, ignore_monsters, dont_ignore_glass, ENT(pev), &result); + + bool walkable; + + if (result.flFraction == 1.0f && !result.fStartSolid) + { + // the trace didnt hit anything - clear + float toGround = to.z; + float fromGround = from.z; + + float epsilon = 0.1f; + + // check if ledge is too high to reach or will cause us to fall to our death + if (toGround - fromGround > JumpCrouchHeight + epsilon || fromGround - toGround > DeathDrop) + { + walkable = false; + } + else + { + // check surface normals along this step to see if we would cross any impassable slopes + Vector delta = to - from; + const float inc = 2.0f; + float along = inc; + bool done = false; + float ground; + Vector normal; + + walkable = true; + + while (!done) + { + Vector p; + + // need to guarantee that we test the exact edges + if (along >= GenerationStepSize) + { + p = to; + done = true; + } + else + { + p = from + delta * (along / GenerationStepSize); + } + + if (GetGroundHeight(&p, &ground, &normal) == false) + { + walkable = false; + break; + } + + // check for maximum allowed slope + if (normal.z < 0.7f) + { + walkable = false; + break; + } + + along += inc; + } + } + } + // TraceLine hit something... + else + { + if (IsEntityWalkable(VARS(result.pHit), WALK_THRU_EVERYTHING)) + { + walkable = true; + } + else + { + walkable = false; + } + } +#ifdef REGAMEDLL_FIXES + // if we're incrementally generating, don't overlap existing nav areas + CNavArea *overlap = TheNavAreaGrid.GetNavArea(&to, HumanHeight); + if (overlap != NULL) + { + walkable = false; + } +#endif // REGAMEDLL_FIXES + if (walkable) + { + // we can move here + // create a new navigation node, and update current node pointer + CNavNode *newNode = AddNode(&to, &toNormal, m_generationDir, m_currentNode); + } + + return true; + } + } + + // all directions have been searched from this node - pop back to its parent and continue + m_currentNode = m_currentNode->GetParent(); } } /* <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; } diff --git a/regamedll/dlls/bot/cs_bot_listen.cpp b/regamedll/dlls/bot/cs_bot_listen.cpp index db359425..94171af2 100644 --- a/regamedll/dlls/bot/cs_bot_listen.cpp +++ b/regamedll/dlls/bot/cs_bot_listen.cpp @@ -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) @@ -162,7 +162,7 @@ bool CCSBot::UpdateLookAtNoise(void) int nearIdx = -1; float nearRangeSq = 9.9999998e10f; - + for (int i = 0; i < m_approachPointCount; ++i) { float distanceSq = (m_approachPoint[i] - m_noisePosition).LengthSquared(); diff --git a/regamedll/dlls/bot/cs_bot_manager.cpp b/regamedll/dlls/bot/cs_bot_manager.cpp index 0aadb903..6d9d2149 100644 --- a/regamedll/dlls/bot/cs_bot_manager.cpp +++ b/regamedll/dlls/bot/cs_bot_manager.cpp @@ -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; @@ -49,7 +39,7 @@ CCSBotManager::CCSBotManager(void) m_isBombPlanted = false; m_bombDefuser = NULL; - + IMPL(m_isLearningMap) = false; IMPL(m_isAnalysisRequested) = false; IMPL(m_editCmd) = EDIT_NONE; @@ -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,13 +1196,13 @@ 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; int nTeamSlot = UNASSIGNED; - + if (team == BOT_TEAM_ANY) { // if team not specified, check cv_bot_join_team cvar for preference @@ -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 diff --git a/regamedll/dlls/bot/cs_bot_manager.h b/regamedll/dlls/bot/cs_bot_manager.h index 11cd9f4f..5e796117 100644 --- a/regamedll/dlls/bot/cs_bot_manager.h +++ b/regamedll/dlls/bot/cs_bot_manager.h @@ -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,61 +163,61 @@ public: } // pick a zone at random and return it - const Zone *GetRandomZone(void) const + const Zone *GetRandomZone() const { if (!m_zoneCount) return NULL; 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(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 diff --git a/regamedll/dlls/bot/cs_bot_nav.cpp b/regamedll/dlls/bot/cs_bot_nav.cpp index 7a1b0b25..26171ac9 100644 --- a/regamedll/dlls/bot/cs_bot_nav.cpp +++ b/regamedll/dlls/bot/cs_bot_nav.cpp @@ -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) { diff --git a/regamedll/dlls/bot/cs_bot_pathfind.cpp b/regamedll/dlls/bot/cs_bot_pathfind.cpp index e57ec79a..10f2ba37 100644 --- a/regamedll/dlls/bot/cs_bot_pathfind.cpp +++ b/regamedll/dlls/bot/cs_bot_pathfind.cpp @@ -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; @@ -149,7 +149,7 @@ void CCSBot::SetupLadderMovement(void) m_pathLadderFaceIn = true; PrintIfWatched("APPROACH_ASCENDING_LADDER\n"); m_goalPosition = m_pathLadder->m_bottom; - + AddDirectionVector(&m_goalPosition, m_pathLadder->m_dir, HalfHumanWidth * 2.0f); m_lookAheadAngle = DirectionToAngle(OppositeDirection(m_pathLadder->m_dir)); } @@ -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; @@ -1614,7 +1614,7 @@ bool CCSBot::ComputePath(CNavArea *goalArea, const Vector *goal, RouteType route m_repathTimer.Start(RANDOM_FLOAT(0.4f, 0.6f)); DestroyPath(); - + CNavArea *startArea = m_lastKnownArea; if (startArea == NULL) 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; diff --git a/regamedll/dlls/bot/cs_bot_radio.cpp b/regamedll/dlls/bot/cs_bot_radio.cpp index fd231086..2abe8b27 100644 --- a/regamedll/dlls/bot/cs_bot_radio.cpp +++ b/regamedll/dlls/bot/cs_bot_radio.cpp @@ -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) { @@ -329,7 +329,7 @@ void CCSBot::SendRadioMessage(GameEventType event) ClientCommand("radio3"); //Radio3(this, event - EVENT_START_RADIO_3); } - + ClientCommand("menuselect", slot); ClientCommand("menuselect", "10"); } diff --git a/regamedll/dlls/bot/cs_bot_statemachine.cpp b/regamedll/dlls/bot/cs_bot_statemachine.cpp index c5784533..3db5f5ed 100644 --- a/regamedll/dlls/bot/cs_bot_statemachine.cpp +++ b/regamedll/dlls/bot/cs_bot_statemachine.cpp @@ -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); } @@ -316,7 +316,7 @@ void CCSBot::Attack(CBasePlayer *victim) if (deltaYaw < 0.0f) deltaYaw = -deltaYaw; - + // immediately aim at enemy - accuracy penalty depending on how far we must turn to aim // accuracy is halved if we have to turn 180 degrees float turn = deltaYaw / 180.0f; @@ -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(&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(&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(&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(&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(&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(&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); } diff --git a/regamedll/dlls/bot/cs_bot_update.cpp b/regamedll/dlls/bot/cs_bot_update.cpp index cc9a4e02..e3462d47 100644 --- a/regamedll/dlls/bot/cs_bot_update.cpp +++ b/regamedll/dlls/bot/cs_bot_update.cpp @@ -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(); @@ -175,7 +175,7 @@ void CCSBot::__MAKE_VHOOK(Update)(void) // need to allow bots to finish their chatter even if they are dead GetChatter()->Update(); - if (m_voiceFeedbackEndTimestamp != 0.0f + if (m_voiceFeedbackEndTimestamp != 0.0f && (m_voiceFeedbackEndTimestamp <= gpGlobals->time || gpGlobals->time < m_voiceFeedbackStartTimestamp)) { EndVoiceFeedback(NO_FORCE); @@ -268,10 +268,10 @@ void CCSBot::__MAKE_VHOOK(Update)(void) { switch (m_blindMoveDir) { - case FORWARD: MoveForward(); break; - case RIGHT: StrafeRight(); break; - case BACKWARD: MoveBackward(); break; - case LEFT: StrafeLeft(); break; + case FORWARD: MoveForward(); break; + case RIGHT: StrafeRight(); break; + case BACKWARD: MoveBackward(); break; + case LEFT: StrafeLeft(); break; default: Crouch(); break; } } @@ -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 diff --git a/regamedll/dlls/bot/cs_bot_vision.cpp b/regamedll/dlls/bot/cs_bot_vision.cpp index 205921b7..aa70052d 100644 --- a/regamedll/dlls/bot/cs_bot_vision.cpp +++ b/regamedll/dlls/bot/cs_bot_vision.cpp @@ -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 diff --git a/regamedll/dlls/bot/cs_bot_weapon.cpp b/regamedll/dlls/bot/cs_bot_weapon.cpp index 0e37e0ba..581ff721 100644 --- a/regamedll/dlls/bot/cs_bot_weapon.cpp +++ b/regamedll/dlls/bot/cs_bot_weapon.cpp @@ -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(m_rgpPlayerItems[ PRIMARY_WEAPON_SLOT ]); @@ -407,13 +407,13 @@ 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(m_rgpPlayerItems[ PISTOL_SLOT ]); if (weapon == NULL) return true; - + // check if gun has any ammo left if (HasAnyAmmo(weapon)) { @@ -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(m_rgpPlayerItems[ GRENADE_SLOT ]); return grenade != NULL; @@ -546,7 +546,7 @@ bool CCSBot::EquipGrenade(bool noSmoke) if (grenade != NULL) { if (noSmoke && grenade->m_iId == WEAPON_SMOKEGRENADE) - return false; + return false; SelectItem(STRING(grenade->pev->classname)); return true; @@ -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(); @@ -674,7 +674,7 @@ bool CCSBot::FindGrenadeTossPathTarget(Vector *pos) // check +X check = visibleSpot + Vector(999.9f, 0, 0); UTIL_TraceLine(visibleSpot, check, dont_ignore_monsters, ignore_glass, ENT(pev), &result); - + if (result.flFraction < 1.0f) { float range = result.vecEndPos.x - visibleSpot.x; @@ -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; @@ -838,7 +838,7 @@ void CCSBot::SilencerCheck(void) return; // equip silencer if we want to and we don't have a shield. - if (isSilencerOn != (GetProfile()->PrefersSilencer() || GetProfile()->GetSkill() > 0.7f) && !HasShield()) + if (isSilencerOn != (GetProfile()->PrefersSilencer() || GetProfile()->GetSkill() > 0.7f) && !HasShield()) #endif // REGAMEDLL_FIXES { PrintIfWatched("%s silencer!\n", (isSilencerOn) ? "Unequipping" : "Equipping"); @@ -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 diff --git a/regamedll/dlls/bot/cs_gamestate.cpp b/regamedll/dlls/bot/cs_gamestate.cpp index 1940cbe7..09e3c02d 100644 --- a/regamedll/dlls/bot/cs_gamestate.cpp +++ b/regamedll/dlls/bot/cs_gamestate.cpp @@ -19,7 +19,7 @@ CSGameState::CSGameState(CCSBot *owner) for (int i = 0; i < MAX_HOSTAGES; ++i) { HostageInfo *info = &m_hostage[i]; - + info->hostage = NULL; info->knownPos = Vector(0, 0, 0); info->isValid = false; @@ -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; @@ -340,7 +340,7 @@ void CSGameState::InitializeHostageInfo(void) } // Return the closest free and live hostage -// If we are a CT this information is perfect. +// If we are a CT this information is perfect. // Otherwise, this is based on our individual memory of the game state. // If NULL is returned, we don't think there are any hostages left, or we dont know where they are. // NOTE: a T can remember a hostage who has died. knowPos will be filled in, but NULL will be @@ -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,12 +462,12 @@ 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()) return NO_CHANGE; - + const float validateInterval = 0.5f; m_validateInterval.Start(validateInterval); @@ -580,14 +580,14 @@ 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; float rangeSq; Vector pos; - + for (int i = 0; i < m_hostageCount; ++i) { const HostageInfo *info = &m_hostage[i]; @@ -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; diff --git a/regamedll/dlls/bot/cs_gamestate.h b/regamedll/dlls/bot/cs_gamestate.h index 45529041..5bbb8755 100644 --- a/regamedll/dlls/bot/cs_gamestate.h +++ b/regamedll/dlls/bot/cs_gamestate.h @@ -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 diff --git a/regamedll/dlls/bot/states/cs_bot_attack.cpp b/regamedll/dlls/bot/states/cs_bot_attack.cpp index d1e031c1..81e061b2 100644 --- a/regamedll/dlls/bot/states/cs_bot_attack.cpp +++ b/regamedll/dlls/bot/states/cs_bot_attack.cpp @@ -132,410 +132,410 @@ void AttackState::StopAttacking(CCSBot *me) /* <51997e> ../cstrike/dlls/bot/states/cs_bot_attack.cpp:152 */ void AttackState::__MAKE_VHOOK(OnUpdate)(CCSBot *me) { - // can't be stuck while attacking - me->ResetStuckMonitor(); - me->StopRapidFire(); - - CBasePlayerWeapon *weapon = me->GetActiveWeapon(); - if (weapon != NULL) - { - if (weapon->m_iId == WEAPON_C4 || - weapon->m_iId == WEAPON_HEGRENADE || - weapon->m_iId == WEAPON_FLASHBANG || - weapon->m_iId == WEAPON_SMOKEGRENADE) - { - me->EquipBestWeapon(); - } - } - - CBasePlayer *enemy = me->GetEnemy(); - if (enemy == NULL) - { - StopAttacking(me); - return; - } - - // keep track of whether we have seen our enemy at least once yet - if (!m_haveSeenEnemy) - m_haveSeenEnemy = me->IsEnemyVisible(); - - // Retreat check - // Do not retreat if the enemy is too close - if (m_retreatTimer.IsElapsed()) - { - // If we've been fighting this battle for awhile, we're "pinned down" and - // need to do something else. - // If we are outnumbered, retreat. - bool isPinnedDown = (gpGlobals->time > m_pinnedDownTimestamp); - - if (isPinnedDown || - (me->IsOutnumbered() && m_isCoward) || - (me->OutnumberedCount() >= 2 && me->GetProfile()->GetAggression() < 1.0f)) - { - // tell our teammates our plight - if (isPinnedDown) - me->GetChatter()->PinnedDown(); - else - me->GetChatter()->Scared(); - - m_retreatTimer.Start(RANDOM_FLOAT(3.0f, 15.0f)); - - // try to retreat - if (me->TryToRetreat()) - { - // if we are a sniper, equip our pistol so we can fire while retreating - if (me->IsUsingSniperRifle()) - { - me->EquipPistol(); - } - } - else - { - me->PrintIfWatched("I want to retreat, but no safe spots nearby!\n"); - } - } - } - - // Knife fighting - // We need to pathfind right to the enemy to cut him - if (me->IsUsingKnife()) - { - // can't crouch and hold with a knife - m_crouchAndHold = false; - me->StandUp(); - - // if we are using a knife and our prey is looking towards us, run at him - if (me->IsPlayerFacingMe(enemy)) - { - me->ForceRun(5.0f); - me->Hurry(10.0f); - } - else - { - me->Walk(); - } - - // slash our victim - me->FireWeaponAtEnemy(); - - // if our victim has moved, repath - bool repath = false; - if (me->HasPath()) - { - const float repathRange = 100.0f; - if ((me->GetPathEndpoint() - enemy->pev->origin).IsLengthGreaterThan(repathRange)) - { - repath = true; - } - } - else - { - repath = true; - } - - if (repath && m_repathTimer.IsElapsed()) - { - me->ComputePath(TheNavAreaGrid.GetNearestNavArea(&enemy->pev->origin), &enemy->pev->origin, FASTEST_ROUTE); - - const float repathInterval = 0.5f; - m_repathTimer.Start(repathInterval); - } - - // move towards victim - if (me->UpdatePathMovement(NO_SPEED_CHANGE) != CCSBot::PROGRESSING) - { - me->DestroyPath(); - } - - return; - } - - // Simple shield usage - if (me->HasShield()) - { - if (me->IsEnemyVisible() && !m_shieldForceOpen) - { - if (!me->IsRecognizedEnemyReloading() && !me->IsReloading() && me->IsPlayerLookingAtMe(enemy)) - { - // close up - enemy is pointing his gun at us - if (!me->IsProtectedByShield()) - me->SecondaryAttack(); - } - else - { - // enemy looking away or reloading his weapon - open up and shoot him - if (me->IsProtectedByShield()) - me->SecondaryAttack(); - } - } - else - { - // can't see enemy, open up - if (me->IsProtectedByShield()) - me->SecondaryAttack(); - } - - if (gpGlobals->time > m_shieldToggleTimestamp) - { - m_shieldToggleTimestamp = gpGlobals->time + RANDOM_FLOAT(0.5, 2.0f); - - // toggle shield force open - m_shieldForceOpen = !m_shieldForceOpen; - } - } - - // check if our weapon range is bad and we should switch to pistol - if (me->IsUsingSniperRifle()) - { - // if we have a sniper rifle and our enemy is too close, switch to pistol - // NOTE: Must be larger than NO_ZOOM range in AdjustZoom() - const float sniperMinRange = 310.0f; - if ((enemy->pev->origin - me->pev->origin).IsLengthLessThan(sniperMinRange)) - me->EquipPistol(); - } - else if (me->IsUsingShotgun()) - { - // if we have a shotgun equipped and enemy is too far away, switch to pistol - const float shotgunMaxRange = 1000.0f; - if ((enemy->pev->origin - me->pev->origin).IsLengthGreaterThan(shotgunMaxRange)) - me->EquipPistol(); - } - - // if we're sniping, look through the scope - need to do this here in case a reload resets our scope - if (me->IsUsingSniperRifle()) - { - // for Scouts and AWPs, we need to wait for zoom to resume - if (me->m_bResumeZoom) - { - m_scopeTimestamp = gpGlobals->time; - return; - } - - Vector toAimSpot3D = me->m_aimSpot - me->pev->origin; - float targetRange = toAimSpot3D.Length(); - - // dont adjust zoom level if we're already zoomed in - just fire - if (me->GetZoomLevel() == CCSBot::NO_ZOOM && me->AdjustZoom(targetRange)) - m_scopeTimestamp = gpGlobals->time; - - const float waitScopeTime = 0.2f + me->GetProfile()->GetReactionTime(); - if (gpGlobals->time - m_scopeTimestamp < waitScopeTime) - { - // force us to wait until zoomed in before firing - return; - } - } - - // see if we "notice" that our prey is dead - if (me->IsAwareOfEnemyDeath()) - { - // let team know if we killed the last enemy - if (me->GetLastVictimID() == enemy->entindex() && me->GetNearbyEnemyCount() <= 1) - { - me->GetChatter()->KilledMyEnemy(enemy->entindex()); - } - - StopAttacking(me); - return; - } - - float notSeenEnemyTime = gpGlobals->time - me->GetLastSawEnemyTimestamp(); - - // if we haven't seen our enemy for a moment, continue on if we dont want to fight, or decide to ambush if we do - if (!me->IsEnemyVisible()) - { - // attend to nearby enemy gunfire - if (notSeenEnemyTime > 0.5f && me->CanHearNearbyEnemyGunfire()) - { - // give up the attack, since we didn't want it in the first place - StopAttacking(me); - - me->SetLookAt("Nearby enemy gunfire", me->GetNoisePosition(), PRIORITY_HIGH, 0.0f); - me->PrintIfWatched("Checking nearby threatening enemy gunfire!\n"); - return; - } - - // check if we have lost track of our enemy during combat - if (notSeenEnemyTime > 0.25f) - { - m_isEnemyHidden = true; - } - - if (notSeenEnemyTime > 0.1f) - { - if (me->GetDisposition() == CCSBot::ENGAGE_AND_INVESTIGATE) - { - // decide whether we should hide and "ambush" our enemy - if (m_haveSeenEnemy && !m_didAmbushCheck) - { - const float hideChance = 33.3f; - - if (RANDOM_FLOAT(0.0, 100.0f) < hideChance) - { - float ambushTime = RANDOM_FLOAT(3.0f, 15.0f); - - // hide in ambush nearby - // TODO: look towards where we know enemy is - const Vector *spot = FindNearbyRetreatSpot(me, 200.0f); - if (spot != NULL) - { - me->IgnoreEnemies(1.0f); - me->Run(); - me->StandUp(); - me->Hide(spot, ambushTime, true); - return; - } - } - - // don't check again - m_didAmbushCheck = true; - } - } - else - { - // give up the attack, since we didn't want it in the first place - StopAttacking(me); - return; - } - } - } - else - { - // we can see the enemy again - reset our ambush check - m_didAmbushCheck = false; - - // if the enemy is coming out of hiding, we need time to react - if (m_isEnemyHidden) - { - m_reacquireTimestamp = gpGlobals->time + me->GetProfile()->GetReactionTime(); - m_isEnemyHidden = false; - } - } - - // if we haven't seen our enemy for a long time, chase after them - float chaseTime = 2.0f + 2.0f * (1.0f - me->GetProfile()->GetAggression()); - - // if we are sniping, be very patient - if (me->IsUsingSniperRifle()) - chaseTime += 3.0f; - // if we are crouching, be a little patient - else if (me->IsCrouching()) - chaseTime += 1.0f; - - // if we can't see the enemy, and have either seen him but currently lost sight of him, - // or haven't yet seen him, chase after him (unless we are a sniper) - if (!me->IsEnemyVisible() && (notSeenEnemyTime > chaseTime || !m_haveSeenEnemy)) - { - // snipers don't chase their prey - they wait for their prey to come to them - if (me->GetTask() == CCSBot::SNIPING) - { - StopAttacking(me); - return; - } - else - { - // move to last known position of enemy - me->SetTask(CCSBot::MOVE_TO_LAST_KNOWN_ENEMY_POSITION, enemy); - me->MoveTo(&me->GetLastKnownEnemyPosition()); - return; - } - } - - // if we can't see our enemy at the moment, and were shot by - // a different visible enemy, engage them instead - const float hurtRecentlyTime = 3.0f; - if (!me->IsEnemyVisible() && - me->GetTimeSinceAttacked() < hurtRecentlyTime && - me->GetAttacker() != NULL && - me->GetAttacker() != me->GetEnemy()) - { - // if we can see them, attack, otherwise panic - if (me->IsVisible(me->GetAttacker(), CHECK_FOV)) - { - me->Attack(me->GetAttacker()); - me->PrintIfWatched("Switching targets to retaliate against new attacker!\n"); - } - return; - } - - if (gpGlobals->time > m_reacquireTimestamp) - me->FireWeaponAtEnemy(); - - - // do dodge behavior - // If sniping or crouching, stand still. - if (m_dodge && !me->IsUsingSniperRifle() && !m_crouchAndHold) - { - Vector toEnemy = enemy->pev->origin - me->pev->origin; - float range = toEnemy.Length2D(); - - const float hysterisRange = 125.0f; // (+/-) m_combatRange - - float minRange = me->GetCombatRange() - hysterisRange; - float maxRange = me->GetCombatRange() + hysterisRange; - - // move towards (or away from) enemy if we are using a knife, behind a corner, or we aren't very skilled - if (me->GetProfile()->GetSkill() < 0.66f || !me->IsEnemyVisible()) - { - if (range > maxRange) - me->MoveForward(); - else if (range < minRange) - me->MoveBackward(); - } - - // don't dodge if enemy is facing away - const float dodgeRange = 2000.0f; - if (range > dodgeRange || !me->IsPlayerFacingMe(enemy)) - { - m_dodgeState = STEADY_ON; - m_nextDodgeStateTimestamp = 0.0f; - } - else if (gpGlobals->time >= m_nextDodgeStateTimestamp) - { - int next; - - // select next dodge state that is different that our current one - do - { - // high-skill bots may jump when first engaging the enemy (if they are moving) - const float jumpChance = 33.3f; - if (m_firstDodge && me->GetProfile()->GetSkill() > 0.5f && RANDOM_FLOAT(0, 100) < jumpChance && !me->IsNotMoving()) - next = RANDOM_LONG(0, NUM_ATTACK_STATES - 1); - else - next = RANDOM_LONG(0, NUM_ATTACK_STATES - 2); - } - while (!m_firstDodge && next == m_dodgeState); - - m_dodgeState = (DodgeStateType)next; - m_nextDodgeStateTimestamp = gpGlobals->time + RANDOM_FLOAT(0.3f, 1.0f); - m_firstDodge = false; - } - - switch (m_dodgeState) - { - case STEADY_ON: - { - break; - } - case SLIDE_LEFT: - { - me->StrafeLeft(); - break; - } - case SLIDE_RIGHT: - { - me->StrafeRight(); - break; - } - case JUMP: - { - if (me->m_isEnemyVisible) - { - me->Jump(); - } - break; - } - } + // can't be stuck while attacking + me->ResetStuckMonitor(); + me->StopRapidFire(); + + CBasePlayerWeapon *weapon = me->GetActiveWeapon(); + if (weapon != NULL) + { + if (weapon->m_iId == WEAPON_C4 || + weapon->m_iId == WEAPON_HEGRENADE || + weapon->m_iId == WEAPON_FLASHBANG || + weapon->m_iId == WEAPON_SMOKEGRENADE) + { + me->EquipBestWeapon(); + } + } + + CBasePlayer *enemy = me->GetEnemy(); + if (enemy == NULL) + { + StopAttacking(me); + return; + } + + // keep track of whether we have seen our enemy at least once yet + if (!m_haveSeenEnemy) + m_haveSeenEnemy = me->IsEnemyVisible(); + + // Retreat check + // Do not retreat if the enemy is too close + if (m_retreatTimer.IsElapsed()) + { + // If we've been fighting this battle for awhile, we're "pinned down" and + // need to do something else. + // If we are outnumbered, retreat. + bool isPinnedDown = (gpGlobals->time > m_pinnedDownTimestamp); + + if (isPinnedDown || + (me->IsOutnumbered() && m_isCoward) || + (me->OutnumberedCount() >= 2 && me->GetProfile()->GetAggression() < 1.0f)) + { + // tell our teammates our plight + if (isPinnedDown) + me->GetChatter()->PinnedDown(); + else + me->GetChatter()->Scared(); + + m_retreatTimer.Start(RANDOM_FLOAT(3.0f, 15.0f)); + + // try to retreat + if (me->TryToRetreat()) + { + // if we are a sniper, equip our pistol so we can fire while retreating + if (me->IsUsingSniperRifle()) + { + me->EquipPistol(); + } + } + else + { + me->PrintIfWatched("I want to retreat, but no safe spots nearby!\n"); + } + } + } + + // Knife fighting + // We need to pathfind right to the enemy to cut him + if (me->IsUsingKnife()) + { + // can't crouch and hold with a knife + m_crouchAndHold = false; + me->StandUp(); + + // if we are using a knife and our prey is looking towards us, run at him + if (me->IsPlayerFacingMe(enemy)) + { + me->ForceRun(5.0f); + me->Hurry(10.0f); + } + else + { + me->Walk(); + } + + // slash our victim + me->FireWeaponAtEnemy(); + + // if our victim has moved, repath + bool repath = false; + if (me->HasPath()) + { + const float repathRange = 100.0f; + if ((me->GetPathEndpoint() - enemy->pev->origin).IsLengthGreaterThan(repathRange)) + { + repath = true; + } + } + else + { + repath = true; + } + + if (repath && m_repathTimer.IsElapsed()) + { + me->ComputePath(TheNavAreaGrid.GetNearestNavArea(&enemy->pev->origin), &enemy->pev->origin, FASTEST_ROUTE); + + const float repathInterval = 0.5f; + m_repathTimer.Start(repathInterval); + } + + // move towards victim + if (me->UpdatePathMovement(NO_SPEED_CHANGE) != CCSBot::PROGRESSING) + { + me->DestroyPath(); + } + + return; + } + + // Simple shield usage + if (me->HasShield()) + { + if (me->IsEnemyVisible() && !m_shieldForceOpen) + { + if (!me->IsRecognizedEnemyReloading() && !me->IsReloading() && me->IsPlayerLookingAtMe(enemy)) + { + // close up - enemy is pointing his gun at us + if (!me->IsProtectedByShield()) + me->SecondaryAttack(); + } + else + { + // enemy looking away or reloading his weapon - open up and shoot him + if (me->IsProtectedByShield()) + me->SecondaryAttack(); + } + } + else + { + // can't see enemy, open up + if (me->IsProtectedByShield()) + me->SecondaryAttack(); + } + + if (gpGlobals->time > m_shieldToggleTimestamp) + { + m_shieldToggleTimestamp = gpGlobals->time + RANDOM_FLOAT(0.5, 2.0f); + + // toggle shield force open + m_shieldForceOpen = !m_shieldForceOpen; + } + } + + // check if our weapon range is bad and we should switch to pistol + if (me->IsUsingSniperRifle()) + { + // if we have a sniper rifle and our enemy is too close, switch to pistol + // NOTE: Must be larger than NO_ZOOM range in AdjustZoom() + const float sniperMinRange = 310.0f; + if ((enemy->pev->origin - me->pev->origin).IsLengthLessThan(sniperMinRange)) + me->EquipPistol(); + } + else if (me->IsUsingShotgun()) + { + // if we have a shotgun equipped and enemy is too far away, switch to pistol + const float shotgunMaxRange = 1000.0f; + if ((enemy->pev->origin - me->pev->origin).IsLengthGreaterThan(shotgunMaxRange)) + me->EquipPistol(); + } + + // if we're sniping, look through the scope - need to do this here in case a reload resets our scope + if (me->IsUsingSniperRifle()) + { + // for Scouts and AWPs, we need to wait for zoom to resume + if (me->m_bResumeZoom) + { + m_scopeTimestamp = gpGlobals->time; + return; + } + + Vector toAimSpot3D = me->m_aimSpot - me->pev->origin; + float targetRange = toAimSpot3D.Length(); + + // dont adjust zoom level if we're already zoomed in - just fire + if (me->GetZoomLevel() == CCSBot::NO_ZOOM && me->AdjustZoom(targetRange)) + m_scopeTimestamp = gpGlobals->time; + + const float waitScopeTime = 0.2f + me->GetProfile()->GetReactionTime(); + if (gpGlobals->time - m_scopeTimestamp < waitScopeTime) + { + // force us to wait until zoomed in before firing + return; + } + } + + // see if we "notice" that our prey is dead + if (me->IsAwareOfEnemyDeath()) + { + // let team know if we killed the last enemy + if (me->GetLastVictimID() == enemy->entindex() && me->GetNearbyEnemyCount() <= 1) + { + me->GetChatter()->KilledMyEnemy(enemy->entindex()); + } + + StopAttacking(me); + return; + } + + float notSeenEnemyTime = gpGlobals->time - me->GetLastSawEnemyTimestamp(); + + // if we haven't seen our enemy for a moment, continue on if we dont want to fight, or decide to ambush if we do + if (!me->IsEnemyVisible()) + { + // attend to nearby enemy gunfire + if (notSeenEnemyTime > 0.5f && me->CanHearNearbyEnemyGunfire()) + { + // give up the attack, since we didn't want it in the first place + StopAttacking(me); + + me->SetLookAt("Nearby enemy gunfire", me->GetNoisePosition(), PRIORITY_HIGH, 0.0f); + me->PrintIfWatched("Checking nearby threatening enemy gunfire!\n"); + return; + } + + // check if we have lost track of our enemy during combat + if (notSeenEnemyTime > 0.25f) + { + m_isEnemyHidden = true; + } + + if (notSeenEnemyTime > 0.1f) + { + if (me->GetDisposition() == CCSBot::ENGAGE_AND_INVESTIGATE) + { + // decide whether we should hide and "ambush" our enemy + if (m_haveSeenEnemy && !m_didAmbushCheck) + { + const float hideChance = 33.3f; + + if (RANDOM_FLOAT(0.0, 100.0f) < hideChance) + { + float ambushTime = RANDOM_FLOAT(3.0f, 15.0f); + + // hide in ambush nearby + // TODO: look towards where we know enemy is + const Vector *spot = FindNearbyRetreatSpot(me, 200.0f); + if (spot != NULL) + { + me->IgnoreEnemies(1.0f); + me->Run(); + me->StandUp(); + me->Hide(spot, ambushTime, true); + return; + } + } + + // don't check again + m_didAmbushCheck = true; + } + } + else + { + // give up the attack, since we didn't want it in the first place + StopAttacking(me); + return; + } + } + } + else + { + // we can see the enemy again - reset our ambush check + m_didAmbushCheck = false; + + // if the enemy is coming out of hiding, we need time to react + if (m_isEnemyHidden) + { + m_reacquireTimestamp = gpGlobals->time + me->GetProfile()->GetReactionTime(); + m_isEnemyHidden = false; + } + } + + // if we haven't seen our enemy for a long time, chase after them + float chaseTime = 2.0f + 2.0f * (1.0f - me->GetProfile()->GetAggression()); + + // if we are sniping, be very patient + if (me->IsUsingSniperRifle()) + chaseTime += 3.0f; + // if we are crouching, be a little patient + else if (me->IsCrouching()) + chaseTime += 1.0f; + + // if we can't see the enemy, and have either seen him but currently lost sight of him, + // or haven't yet seen him, chase after him (unless we are a sniper) + if (!me->IsEnemyVisible() && (notSeenEnemyTime > chaseTime || !m_haveSeenEnemy)) + { + // snipers don't chase their prey - they wait for their prey to come to them + if (me->GetTask() == CCSBot::SNIPING) + { + StopAttacking(me); + return; + } + else + { + // move to last known position of enemy + me->SetTask(CCSBot::MOVE_TO_LAST_KNOWN_ENEMY_POSITION, enemy); + me->MoveTo(&me->GetLastKnownEnemyPosition()); + return; + } + } + + // if we can't see our enemy at the moment, and were shot by + // a different visible enemy, engage them instead + const float hurtRecentlyTime = 3.0f; + if (!me->IsEnemyVisible() && + me->GetTimeSinceAttacked() < hurtRecentlyTime && + me->GetAttacker() != NULL && + me->GetAttacker() != me->GetEnemy()) + { + // if we can see them, attack, otherwise panic + if (me->IsVisible(me->GetAttacker(), CHECK_FOV)) + { + me->Attack(me->GetAttacker()); + me->PrintIfWatched("Switching targets to retaliate against new attacker!\n"); + } + return; + } + + if (gpGlobals->time > m_reacquireTimestamp) + me->FireWeaponAtEnemy(); + + + // do dodge behavior + // If sniping or crouching, stand still. + if (m_dodge && !me->IsUsingSniperRifle() && !m_crouchAndHold) + { + Vector toEnemy = enemy->pev->origin - me->pev->origin; + float range = toEnemy.Length2D(); + + const float hysterisRange = 125.0f; // (+/-) m_combatRange + + float minRange = me->GetCombatRange() - hysterisRange; + float maxRange = me->GetCombatRange() + hysterisRange; + + // move towards (or away from) enemy if we are using a knife, behind a corner, or we aren't very skilled + if (me->GetProfile()->GetSkill() < 0.66f || !me->IsEnemyVisible()) + { + if (range > maxRange) + me->MoveForward(); + else if (range < minRange) + me->MoveBackward(); + } + + // don't dodge if enemy is facing away + const float dodgeRange = 2000.0f; + if (range > dodgeRange || !me->IsPlayerFacingMe(enemy)) + { + m_dodgeState = STEADY_ON; + m_nextDodgeStateTimestamp = 0.0f; + } + else if (gpGlobals->time >= m_nextDodgeStateTimestamp) + { + int next; + + // select next dodge state that is different that our current one + do + { + // high-skill bots may jump when first engaging the enemy (if they are moving) + const float jumpChance = 33.3f; + if (m_firstDodge && me->GetProfile()->GetSkill() > 0.5f && RANDOM_FLOAT(0, 100) < jumpChance && !me->IsNotMoving()) + next = RANDOM_LONG(0, NUM_ATTACK_STATES - 1); + else + next = RANDOM_LONG(0, NUM_ATTACK_STATES - 2); + } + while (!m_firstDodge && next == m_dodgeState); + + m_dodgeState = (DodgeStateType)next; + m_nextDodgeStateTimestamp = gpGlobals->time + RANDOM_FLOAT(0.3f, 1.0f); + m_firstDodge = false; + } + + switch (m_dodgeState) + { + case STEADY_ON: + { + break; + } + case SLIDE_LEFT: + { + me->StrafeLeft(); + break; + } + case SLIDE_RIGHT: + { + me->StrafeRight(); + break; + } + case JUMP: + { + if (me->m_isEnemyVisible) + { + me->Jump(); + } + break; + } + } } } @@ -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 \ No newline at end of file diff --git a/regamedll/dlls/bot/states/cs_bot_buy.cpp b/regamedll/dlls/bot/states/cs_bot_buy.cpp index 9dcec715..5d024273 100644 --- a/regamedll/dlls/bot/states/cs_bot_buy.cpp +++ b/regamedll/dlls/bot/states/cs_bot_buy.cpp @@ -4,7 +4,7 @@ bool HasDefaultPistol(CCSBot *me) { CBasePlayerWeapon *pistol = static_cast(me->m_rgpPlayerItems[ PISTOL_SLOT ]); - + if (pistol == NULL) return false; @@ -283,7 +283,7 @@ void BuyState::__MAKE_VHOOK(OnUpdate)(CCSBot *me) ++m_prefIndex; m_prefRetries = 0; return; - } + } int weaponPreference = me->GetProfile()->GetWeaponPreference(m_prefIndex); @@ -357,9 +357,9 @@ void BuyState::__MAKE_VHOOK(OnUpdate)(CCSBot *me) // bail out so we dont waste money on other equipment // unless everything we prefer has been disallowed, then buy at random if (isPreferredAllDisallowed == false) - return; + return; } - + // if we have no preferred primary weapon (or everything we want is disallowed), buy at random if (!me->m_bHasPrimary && (isPreferredAllDisallowed || !me->GetProfile()->HasPrimaryPreference())) { @@ -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 diff --git a/regamedll/dlls/bot/states/cs_bot_defuse_bomb.cpp b/regamedll/dlls/bot/states/cs_bot_defuse_bomb.cpp index 413e6cd3..ff74d0b3 100644 --- a/regamedll/dlls/bot/states/cs_bot_defuse_bomb.cpp +++ b/regamedll/dlls/bot/states/cs_bot_defuse_bomb.cpp @@ -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 diff --git a/regamedll/dlls/bot/states/cs_bot_escape_from_bomb.cpp b/regamedll/dlls/bot/states/cs_bot_escape_from_bomb.cpp index 9e42dcf8..ca4e84f9 100644 --- a/regamedll/dlls/bot/states/cs_bot_escape_from_bomb.cpp +++ b/regamedll/dlls/bot/states/cs_bot_escape_from_bomb.cpp @@ -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 diff --git a/regamedll/dlls/bot/states/cs_bot_fetch_bomb.cpp b/regamedll/dlls/bot/states/cs_bot_fetch_bomb.cpp index dea1ef03..3b69a86a 100644 --- a/regamedll/dlls/bot/states/cs_bot_fetch_bomb.cpp +++ b/regamedll/dlls/bot/states/cs_bot_fetch_bomb.cpp @@ -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 diff --git a/regamedll/dlls/bot/states/cs_bot_follow.cpp b/regamedll/dlls/bot/states/cs_bot_follow.cpp index bdfb1b89..6f66cb6e 100644 --- a/regamedll/dlls/bot/states/cs_bot_follow.cpp +++ b/regamedll/dlls/bot/states/cs_bot_follow.cpp @@ -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 diff --git a/regamedll/dlls/bot/states/cs_bot_hide.cpp b/regamedll/dlls/bot/states/cs_bot_hide.cpp index 14a3e892..2a04cb44 100644 --- a/regamedll/dlls/bot/states/cs_bot_hide.cpp +++ b/regamedll/dlls/bot/states/cs_bot_hide.cpp @@ -346,11 +346,11 @@ void HideState::__MAKE_VHOOK(OnUpdate)(CCSBot *me) toSpot.y = m_hidingSpot.y - me->pev->origin.y; toSpot.z = m_hidingSpot.z - me->GetFeetZ(); // use feet location float dist = toSpot.Length(); - + const float crouchDist = 200.0f; if (dist < crouchDist) me->Crouch(); - + const float atDist = 20.0f; if (dist < atDist) { @@ -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 diff --git a/regamedll/dlls/bot/states/cs_bot_hunt.cpp b/regamedll/dlls/bot/states/cs_bot_hunt.cpp index 82dba24f..d505e1d6 100644 --- a/regamedll/dlls/bot/states/cs_bot_hunt.cpp +++ b/regamedll/dlls/bot/states/cs_bot_hunt.cpp @@ -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 \ No newline at end of file diff --git a/regamedll/dlls/bot/states/cs_bot_idle.cpp b/regamedll/dlls/bot/states/cs_bot_idle.cpp index 682d286c..00eca4ad 100644 --- a/regamedll/dlls/bot/states/cs_bot_idle.cpp +++ b/regamedll/dlls/bot/states/cs_bot_idle.cpp @@ -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 diff --git a/regamedll/dlls/bot/states/cs_bot_investigate_noise.cpp b/regamedll/dlls/bot/states/cs_bot_investigate_noise.cpp index 7781c402..41ff8ec9 100644 --- a/regamedll/dlls/bot/states/cs_bot_investigate_noise.cpp +++ b/regamedll/dlls/bot/states/cs_bot_investigate_noise.cpp @@ -15,7 +15,7 @@ void InvestigateNoiseState::AttendCurrentNoise(CCSBot *me) if (me->IsWellPastSafe() && me->HasNotSeenEnemyForLongTime() && me->GetNoisePriority() != PRIORITY_HIGH) me->GetChatter()->HeardNoise(me->GetNoisePosition()); - // figure out how to get to the noise + // figure out how to get to the noise me->PrintIfWatched("Attending to noise...\n"); me->ComputePath(me->GetNoiseArea(), &m_checkNoisePosition, SAFEST_ROUTE); @@ -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 diff --git a/regamedll/dlls/bot/states/cs_bot_move_to.cpp b/regamedll/dlls/bot/states/cs_bot_move_to.cpp index f840b8d3..0f582e44 100644 --- a/regamedll/dlls/bot/states/cs_bot_move_to.cpp +++ b/regamedll/dlls/bot/states/cs_bot_move_to.cpp @@ -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 diff --git a/regamedll/dlls/bot/states/cs_bot_plant_bomb.cpp b/regamedll/dlls/bot/states/cs_bot_plant_bomb.cpp index 45e122dd..e9ed472c 100644 --- a/regamedll/dlls/bot/states/cs_bot_plant_bomb.cpp +++ b/regamedll/dlls/bot/states/cs_bot_plant_bomb.cpp @@ -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 diff --git a/regamedll/dlls/bot/states/cs_bot_use_entity.cpp b/regamedll/dlls/bot/states/cs_bot_use_entity.cpp index d63c953b..f0b396b4 100644 --- a/regamedll/dlls/bot/states/cs_bot_use_entity.cpp +++ b/regamedll/dlls/bot/states/cs_bot_use_entity.cpp @@ -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 \ No newline at end of file diff --git a/regamedll/dlls/buttons.cpp b/regamedll/dlls/buttons.cpp index eb9b06c4..2132f4b5 100644 --- a/regamedll/dlls/buttons.cpp +++ b/regamedll/dlls/buttons.cpp @@ -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 diff --git a/regamedll/dlls/buttons.h b/regamedll/dlls/buttons.h index 488a9adf..2eb68945 100644 --- a/regamedll/dlls/buttons.h +++ b/regamedll/dlls/buttons.h @@ -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 diff --git a/regamedll/dlls/career_tasks.cpp b/regamedll/dlls/career_tasks.cpp index 08aa04ee..1ce7c539 100644 --- a/regamedll/dlls/career_tasks.cpp +++ b/regamedll/dlls/career_tasks.cpp @@ -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"); @@ -188,7 +183,7 @@ void CCareerTask::OnWeaponKill(int weaponId, int weaponClassId, bool headshot, b continue; CHostage *hostage = static_cast(hostageEntity); - + if (!hostage->IsFollowingSomeone()) continue; @@ -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 diff --git a/regamedll/dlls/career_tasks.h b/regamedll/dlls/career_tasks.h index 671ca0bc..b7dadf11 100644 --- a/regamedll/dlls/career_tasks.h +++ b/regamedll/dlls/career_tasks.h @@ -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 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 diff --git a/regamedll/dlls/cbase.cpp b/regamedll/dlls/cbase.cpp index 5518501a..92f028af 100644 --- a/regamedll/dlls/cbase.cpp +++ b/regamedll/dlls/cbase.cpp @@ -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 diff --git a/regamedll/dlls/cbase.h b/regamedll/dlls/cbase.h index 66d8d5fd..5dead5c9 100644 --- a/regamedll/dlls/cbase.h +++ b/regamedll/dlls/cbase.h @@ -52,7 +52,7 @@ #define FCAP_FORCE_TRANSITION 0x00000080 #define SetThink(a)\ - m_pfnThink = static_cast(a) + m_pfnThink = static_cast(a) #define SetTouch(a)\ m_pfnTouch = static_cast(a) #define SetUse(a)\ @@ -61,7 +61,7 @@ m_pfnBlocked = static_cast(a) #define SetMoveDone(a)\ - m_pfnCallWhenMoveDone = static_cast(a) + m_pfnCallWhenMoveDone = static_cast(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(GET_PRIVATE(Get())); } // custom + operator CBasePlayer*() { return static_cast(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 T *GetClassPtr(T *a) @@ -944,18 +741,21 @@ T *GetClassPtr(T *a) #endif // _WIN32 && HOOK_GAMEDLL } + return a; } +extern CUtlVector 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 diff --git a/regamedll/dlls/client.cpp b/regamedll/dlls/client.cpp index 5ce1c1c0..d9ab7db9 100644 --- a/regamedll/dlls/client.cpp +++ b/regamedll/dlls/client.cpp @@ -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(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(UTIL_PlayerByIndex(i)); + CBasePlayer *pObserver = static_cast(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(UTIL_PlayerByIndex(i)); + CBasePlayer *pObserver = static_cast(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::Instance(pClient)); + CBasePlayer *pPlayer = dynamic_cast(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::Instance(pev)); + CBasePlayer *pl = dynamic_cast(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(pPlayerItem->GetWeaponPtr()); + CBasePlayerWeapon *gun = dynamic_cast(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::Instance(pev)); + entvars_t *pev = const_cast(&ent->v); + CBasePlayer *pl = dynamic_cast(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::Instance(pev)); + pl = dynamic_cast(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(pl->m_pActiveItem->GetWeaponPtr()); + CBasePlayerWeapon *gun = dynamic_cast(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::Instance(pev)); + entvars_t *pev = const_cast(&player->v); + CBasePlayer *pl = dynamic_cast(CBasePlayer::Instance(pev)); - if (!pl) + if (pl != NULL) { - return; - } + if (pl->pev->groupinfo) + { + UTIL_SetGroupTrace(pl->pev->groupinfo, GROUP_OP_AND); + } - if (pl->pev->groupinfo) - { - UTIL_SetGroupTrace(pl->pev->groupinfo, GROUP_OP_AND); + pl->random_seed = random_seed; } - - 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::Instance(pev)); + entvars_t *pev = const_cast(&player->v); + CBasePlayer *pl = dynamic_cast(CBasePlayer::Instance(pev)); - if (!pl) - return; + if (pl != NULL) + { + if (pl->pev->groupinfo) + UTIL_UnsetGroupTrace(); - if (pl->pev->groupinfo) - UTIL_UnsetGroupTrace(); - - if (pev->flags & FL_DUCKING) - UTIL_SetSize(pev, VEC_DUCK_HULL_MIN, VEC_DUCK_HULL_MAX); + 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; } diff --git a/regamedll/dlls/client.h b/regamedll/dlls/client.h index f148a87c..394e2fba 100644 --- a/regamedll/dlls/client.h +++ b/regamedll/dlls/client.h @@ -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 diff --git a/regamedll/dlls/combat.cpp b/regamedll/dlls/combat.cpp index 82ff0902..08cc6712 100644 --- a/regamedll/dlls/combat.cpp +++ b/regamedll/dlls/combat.cpp @@ -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(UTIL_PlayerByIndex(i)); + CBasePlayer *pObserver = static_cast(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 diff --git a/regamedll/dlls/debug.cpp b/regamedll/dlls/debug.cpp index 9fa44465..f6be1dbd 100644 --- a/regamedll/dlls/debug.cpp +++ b/regamedll/dlls/debug.cpp @@ -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; diff --git a/regamedll/dlls/debug.h b/regamedll/dlls/debug.h index 0e271921..f747609c 100644 --- a/regamedll/dlls/debug.h +++ b/regamedll/dlls/debug.h @@ -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 diff --git a/regamedll/dlls/decals.h b/regamedll/dlls/decals.h index 39f893f2..a00587e8 100644 --- a/regamedll/dlls/decals.h +++ b/regamedll/dlls/decals.h @@ -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]; diff --git a/regamedll/dlls/doors.cpp b/regamedll/dlls/doors.cpp index 26a9a4ea..b2dc8c92 100644 --- a/regamedll/dlls/doors.cpp +++ b/regamedll/dlls/doors.cpp @@ -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 diff --git a/regamedll/dlls/doors.h b/regamedll/dlls/doors.h index 91b65d8c..9611edc5 100644 --- a/regamedll/dlls/doors.h +++ b/regamedll/dlls/doors.h @@ -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 diff --git a/regamedll/dlls/effects.cpp b/regamedll/dlls/effects.cpp index 13682c59..38c60515 100644 --- a/regamedll/dlls/effects.cpp +++ b/regamedll/dlls/effects.cpp @@ -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 diff --git a/regamedll/dlls/effects.h b/regamedll/dlls/effects.h index 74860a8a..20295bef 100644 --- a/regamedll/dlls/effects.h +++ b/regamedll/dlls/effects.h @@ -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 diff --git a/regamedll/dlls/explode.cpp b/regamedll/dlls/explode.cpp index 1a163157..4f9f9fbc 100644 --- a/regamedll/dlls/explode.cpp +++ b/regamedll/dlls/explode.cpp @@ -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 ¢er, 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 diff --git a/regamedll/dlls/explode.h b/regamedll/dlls/explode.h index 0cc84255..68ace26d 100644 --- a/regamedll/dlls/explode.h +++ b/regamedll/dlls/explode.h @@ -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 ¢er, 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 diff --git a/regamedll/dlls/func_break.cpp b/regamedll/dlls/func_break.cpp index 7975869e..6ff621a9 100644 --- a/regamedll/dlls/func_break.cpp +++ b/regamedll/dlls/func_break.cpp @@ -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 diff --git a/regamedll/dlls/func_break.h b/regamedll/dlls/func_break.h index 2ecb6ec6..8d524505 100644 --- a/regamedll/dlls/func_break.h +++ b/regamedll/dlls/func_break.h @@ -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 diff --git a/regamedll/dlls/func_tank.cpp b/regamedll/dlls/func_tank.cpp index 1e3b96ed..9168456c 100644 --- a/regamedll/dlls/func_tank.cpp +++ b/regamedll/dlls/func_tank.cpp @@ -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(Instance(pTarget)); + m_pTank = static_cast(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 diff --git a/regamedll/dlls/func_tank.h b/regamedll/dlls/func_tank.h index 8c7f4ce9..044a0311 100644 --- a/regamedll/dlls/func_tank.h +++ b/regamedll/dlls/func_tank.h @@ -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 diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index e40c6198..076d120b 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -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 diff --git a/regamedll/dlls/game.h b/regamedll/dlls/game.h index 37e22f89..4935e5d3 100644 --- a/regamedll/dlls/game.h +++ b/regamedll/dlls/game.h @@ -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 diff --git a/regamedll/dlls/gamerules.cpp b/regamedll/dlls/gamerules.cpp index 3f9e3753..f9e4c642 100644 --- a/regamedll/dlls/gamerules.cpp +++ b/regamedll/dlls/gamerules.cpp @@ -7,10 +7,6 @@ CHalfLifeMultiplay *g_pGameRules = NULL; -#else //HOOK_GAMEDLL - -CHalfLifeMultiplay *g_pGameRules; - #endif //HOOK_GAMEDLL /* ../cstrike/dlls/gamerules.cpp:36 */ @@ -101,7 +97,7 @@ BOOL CGameRules::__MAKE_VHOOK(CanHavePlayerItem)(CBasePlayer *pPlayer, CBasePlay } /* ../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) } /* ../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 diff --git a/regamedll/dlls/gamerules.h b/regamedll/dlls/gamerules.h index 2b5446d1..6b55c1c3 100644 --- a/regamedll/dlls/gamerules.h +++ b/regamedll/dlls/gamerules.h @@ -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 diff --git a/regamedll/dlls/ggrenade.cpp b/regamedll/dlls/ggrenade.cpp index 57460d7b..38850f7a 100644 --- a/regamedll/dlls/ggrenade.cpp +++ b/regamedll/dlls/ggrenade.cpp @@ -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 /* ../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) } /* ../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) } /* ../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) } /* ../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) } /* ../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) } /* ../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) } /* ../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 } /* ../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; } /* ../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) } /* ../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); } /* ../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) } /* ../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); } /* ../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) } /* ../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) } /* ../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; } } /* ../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; } } /* ../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::Instance(pevOwner)); + CBasePlayer *owner = dynamic_cast(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 /* ../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) } /* ../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(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) /* ../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 diff --git a/regamedll/dlls/globals.cpp b/regamedll/dlls/globals.cpp index 114198c3..95e57c55 100644 --- a/regamedll/dlls/globals.cpp +++ b/regamedll/dlls/globals.cpp @@ -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; diff --git a/regamedll/dlls/globals.h b/regamedll/dlls/globals.h index bdaedc8e..15889dad 100644 --- a/regamedll/dlls/globals.h +++ b/regamedll/dlls/globals.h @@ -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 diff --git a/regamedll/dlls/h_ai.cpp b/regamedll/dlls/h_ai.cpp index f13d03e5..d2f00bf5 100644 --- a/regamedll/dlls/h_ai.cpp +++ b/regamedll/dlls/h_ai.cpp @@ -1,18 +1,7 @@ #include "precompiled.h" -/* -* Globals initialization -*/ -#ifndef HOOK_GAMEDLL - BOOL g_fDrawLines = FALSE; -#else - -BOOL g_fDrawLines; - -#endif // HOOK_GAMEDLL - /* ../cstrike/dlls/h_ai.cpp:47 */ NOXREF BOOL FBoxVisible(entvars_t *pevLooker, entvars_t *pevTarget, Vector &vecTargetOrigin, float flSize) { diff --git a/regamedll/dlls/h_battery.cpp b/regamedll/dlls/h_battery.cpp index 2efe12c7..1addde74 100644 --- a/regamedll/dlls/h_battery.cpp +++ b/regamedll/dlls/h_battery.cpp @@ -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 /* ../cstrike/dlls/h_battery.cpp:61 */ @@ -47,7 +43,7 @@ void CRecharge::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) } /* ../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) } /* ../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,26 +128,26 @@ 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; } /* ../cstrike/dlls/h_battery.cpp:178 */ -void CRecharge::Recharge(void) +void CRecharge::Recharge() { m_iJuice = gSkillData.suitchargerCapacity; - pev->frame = 0; + pev->frame = 0; SetThink(&CRecharge::SUB_DoNothing); } /* ../cstrike/dlls/h_battery.cpp:185 */ -void CRecharge::Off(void) +void CRecharge::Off() { // Stop looping sound. if (m_iOn > 1) @@ -159,7 +155,7 @@ void CRecharge::Off(void) m_iOn = 0; - if (!m_iJuice && (m_iReactivate = g_pGameRules->FlHEVChargerRechargeTime()) > 0) + if (!m_iJuice && (m_iReactivate = g_pGameRules->FlHEVChargerRechargeTime()) > 0) { pev->nextthink = pev->ltime + m_iReactivate; SetThink(&CRecharge::Recharge); @@ -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 diff --git a/regamedll/dlls/h_battery.h b/regamedll/dlls/h_battery.h index f9ae441d..e6f6074b 100644 --- a/regamedll/dlls/h_battery.h +++ b/regamedll/dlls/h_battery.h @@ -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 diff --git a/regamedll/dlls/h_cycler.cpp b/regamedll/dlls/h_cycler.cpp index 0792fc87..ba3feb5e 100644 --- a/regamedll/dlls/h_cycler.cpp +++ b/regamedll/dlls/h_cycler.cpp @@ -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 /* ../cstrike/dlls/h_cycler.cpp:61 */ IMPLEMENT_SAVERESTORE(CCycler, CBaseToggle); /* ../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); /* ../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) /* ../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) } /* ../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 /* ../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); /* ../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) } /* ../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) } /* ../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); /* ../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) } /* ../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) /* ../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; } /* ../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; } /* ../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; } /* ../cstrike/dlls/h_cycler.cpp:443 */ @@ -359,7 +353,7 @@ IMPLEMENT_SAVERESTORE(CWreckage, CBaseToggle); LINK_ENTITY_TO_CLASS(cycler_wreckage, CWreckage); /* ../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) } /* ../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) } /* ../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 diff --git a/regamedll/dlls/h_cycler.h b/regamedll/dlls/h_cycler.h index 1fd138fd..d4c6c840 100644 --- a/regamedll/dlls/h_cycler.h +++ b/regamedll/dlls/h_cycler.h @@ -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 */ +}; /* ../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 */ - +}; /* ../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 diff --git a/regamedll/dlls/h_export.h b/regamedll/dlls/h_export.h index 97c30101..6f843ffc 100644 --- a/regamedll/dlls/h_export.h +++ b/regamedll/dlls/h_export.h @@ -32,20 +32,4 @@ #pragma once #endif -#ifdef HOOK_GAMEDLL - -#define g_engfuncs (*pg_engfuncs) -#define gpGlobals (*pgpGlobals) - -#endif // HOOK_GAMEDLL - -extern enginefuncs_t g_engfuncs; -extern globalvars_t *gpGlobals; - -#ifdef HOOK_GAMEDLL - -C_DLLEXPORT void WINAPI GiveFnptrsToDll(enginefuncs_t *pEnginefuncsTable, globalvars_t *pGlobals); - -#endif // HOOK_GAMEDLL - #endif // H_EXPORT_H diff --git a/regamedll/dlls/healthkit.cpp b/regamedll/dlls/healthkit.cpp index 4764ddb1..6eec3a67 100644 --- a/regamedll/dlls/healthkit.cpp +++ b/regamedll/dlls/healthkit.cpp @@ -14,17 +14,13 @@ TYPEDESCRIPTION CWallHealth::m_SaveData[] = DEFINE_FIELD(CWallHealth, m_flSoundTime, FIELD_TIME), }; -#else - -TYPEDESCRIPTION IMPL_CLASS(CWallHealth, m_SaveData)[5]; - #endif // HOOK_GAMEDLL /* ../cstrike/dlls/healthkit.cpp:43 */ LINK_ENTITY_TO_CLASS(item_healthkit, CHealthKit); /* ../cstrike/dlls/healthkit.cpp:55 */ -void CHealthKit::__MAKE_VHOOK(Spawn)(void) +void CHealthKit::__MAKE_VHOOK(Spawn)() { Precache(); SET_MODEL(ENT(pev), "models/w_medkit.mdl"); @@ -33,7 +29,7 @@ void CHealthKit::__MAKE_VHOOK(Spawn)(void) } /* ../cstrike/dlls/healthkit.cpp:63 */ -void CHealthKit::__MAKE_VHOOK(Precache)(void) +void CHealthKit::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/w_medkit.mdl"); PRECACHE_SOUND("items/smallmedkit1.wav"); @@ -84,7 +80,7 @@ void CWallHealth::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) } /* ../cstrike/dlls/healthkit.cpp:154 */ -void CWallHealth::__MAKE_VHOOK(Spawn)(void) +void CWallHealth::__MAKE_VHOOK(Spawn)() { Precache(); @@ -102,7 +98,7 @@ void CWallHealth::__MAKE_VHOOK(Spawn)(void) } /* ../cstrike/dlls/healthkit.cpp:169 */ -void CWallHealth::__MAKE_VHOOK(Precache)(void) +void CWallHealth::__MAKE_VHOOK(Precache)() { PRECACHE_SOUND("items/medshot4.wav"); PRECACHE_SOUND("items/medshotno1.wav"); @@ -168,7 +164,7 @@ void CWallHealth::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCalle } /* ../cstrike/dlls/healthkit.cpp:236 */ -void CWallHealth::Recharge(void) +void CWallHealth::Recharge() { EMIT_SOUND(ENT(pev), CHAN_ITEM, "items/medshot4.wav", VOL_NORM, ATTN_NORM); m_iJuice = gSkillData.healthchargerCapacity; @@ -177,7 +173,7 @@ void CWallHealth::Recharge(void) } /* ../cstrike/dlls/healthkit.cpp:244 */ -void CWallHealth::Off(void) +void CWallHealth::Off() { // Stop looping sound. if (m_iOn > 1) @@ -193,52 +189,3 @@ void CWallHealth::Off(void) else SetThink(&CWallHealth::SUB_DoNothing); } - -#ifdef HOOK_GAMEDLL - -void CHealthKit::Spawn(void) -{ - Spawn_(); -} - -void CHealthKit::Precache(void) -{ - Precache_(); -} - -BOOL CHealthKit::MyTouch(CBasePlayer *pPlayer) -{ - return MyTouch_(pPlayer); -} - -void CWallHealth::Spawn(void) -{ - Spawn_(); -} - -void CWallHealth::Precache(void) -{ - Precache_(); -} - -void CWallHealth::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -int CWallHealth::Save(CSave &save) -{ - return Save_(save); -} - -int CWallHealth::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -void CWallHealth::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/healthkit.h b/regamedll/dlls/healthkit.h index e92d94d1..3ebbf5cb 100644 --- a/regamedll/dlls/healthkit.h +++ b/regamedll/dlls/healthkit.h @@ -36,39 +36,36 @@ class CHealthKit: public CItem { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual BOOL MyTouch(CBasePlayer *pPlayer); #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); BOOL MyTouch_(CBasePlayer *pPlayer); #endif // HOOK_GAMEDLL -};/* size: 152, cachelines: 3, members: 1 */ +}; /* ../cstrike/dlls/healthkit.cpp:99 */ class CWallHealth: 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); @@ -77,18 +74,16 @@ public: #endif // HOOK_GAMEDLL public: - void EXPORT Off(void); - void EXPORT Recharge(void); + void EXPORT Off(); + void EXPORT Recharge(); static TYPEDESCRIPTION IMPL(m_SaveData)[5]; -public: float m_flNextCharge; int m_iReactivate; int m_iJuice; int m_iOn; float m_flSoundTime; - -};/* size: 332, cachelines: 6, members: 7 */ +}; #endif // HEALTKIT_H diff --git a/regamedll/dlls/hintmessage.cpp b/regamedll/dlls/hintmessage.cpp index 6f69d0b7..df8e13cc 100644 --- a/regamedll/dlls/hintmessage.cpp +++ b/regamedll/dlls/hintmessage.cpp @@ -15,7 +15,7 @@ CHintMessage::CHintMessage(const char *hintString, bool isHint, CUtlVector ../cstrike/dlls/hintmessage.cpp:27 */ -CHintMessage::~CHintMessage(void) +CHintMessage::~CHintMessage() { for (int i = 0; i < m_args.Count(); ++i) delete [] m_args[i]; @@ -30,7 +30,7 @@ void CHintMessage::Send(CBaseEntity *client) } /* ../cstrike/dlls/hintmessage.cpp:43 */ -void CHintMessageQueue::Reset(void) +void CHintMessageQueue::Reset() { m_tmMessageEnd = 0; diff --git a/regamedll/dlls/hintmessage.h b/regamedll/dlls/hintmessage.h index 19d5f98e..4a46221b 100644 --- a/regamedll/dlls/hintmessage.h +++ b/regamedll/dlls/hintmessage.h @@ -60,37 +60,30 @@ class CHintMessage { public: CHintMessage(const char *hintString, bool isHint, CUtlVector *args, float duration); - ~CHintMessage(void); + ~CHintMessage(); public: - float GetDuration(void) const - { - return m_duration; - } + float GetDuration() const { return m_duration; } void Send(CBaseEntity *client); -private: +private: const char *m_hintString; bool m_isHint; CUtlVector m_args; float m_duration; - -};/* size: 32, cachelines: 1, members: 4 */ +}; class CHintMessageQueue { public: - void Reset(void); + void Reset(); void Update(CBaseEntity *client); bool AddMessage(const char *message, float duration, bool isHint, CUtlVector *args); - bool IsEmpty(void) - { - return m_messages.Count() == 0; - } + bool IsEmpty() const { return m_messages.Count() == 0; } + private: float m_tmMessageEnd; CUtlVector m_messages; - -};/* size: 24, cachelines: 1, members: 2 */ +}; #endif // HINTMESSAGE_H diff --git a/regamedll/dlls/hostage/hostage.cpp b/regamedll/dlls/hostage/hostage.cpp index 526a98cc..d253a905 100644 --- a/regamedll/dlls/hostage/hostage.cpp +++ b/regamedll/dlls/hostage/hostage.cpp @@ -11,16 +11,6 @@ cvar_t cv_hostage_stop = { "hostage_stop", "0", FCVAR_SERVER, 0.0f, NULL }; CHostageManager *g_pHostages = NULL; int g_iHostageNumber = 0; -#else - -cvar_t cv_hostage_debug; -cvar_t cv_hostage_stop; - -CHostageManager *g_pHostages; -int g_iHostageNumber; - -void (CBaseEntity::*pCHostage__IdleThink)(void); - #endif // HOOK_GAMEDLL /* <45c3fa> ../cstrike/dlls/hostage/hostage.cpp:47 */ @@ -30,7 +20,7 @@ LINK_ENTITY_TO_CLASS(hostage_entity, CHostage); LINK_ENTITY_TO_CLASS(monster_scientist, CHostage); /* <45c228> ../cstrike/dlls/hostage/hostage.cpp:54 */ -void CHostage::__MAKE_VHOOK(Spawn)(void) +void CHostage::__MAKE_VHOOK(Spawn)() { if (!g_pHostages) { @@ -116,11 +106,11 @@ void CHostage::__MAKE_VHOOK(Spawn)(void) } /* <45bf91> ../cstrike/dlls/hostage/hostage.cpp:137 */ -void CHostage::__MAKE_VHOOK(Precache)(void) +void CHostage::__MAKE_VHOOK(Precache)() { static int which = 0; - if (UTIL_IsGame("czero")) + if (g_bIsCzeroGame) { switch (which) { @@ -189,7 +179,7 @@ void CHostage::SetActivity(int act) } /* <45f194> ../cstrike/dlls/hostage/hostage.cpp:204 */ -void CHostage::IdleThink(void) +void CHostage::IdleThink() { float flInterval; const float upkeepRate = 0.03f; @@ -384,7 +374,7 @@ void CHostage::IdleThink(void) } /* <45c041> ../cstrike/dlls/hostage/hostage.cpp:413 */ -void CHostage::Remove(void) +void CHostage::Remove() { pev->movetype = MOVETYPE_NONE; pev->solid = SOLID_NOT; @@ -396,7 +386,7 @@ void CHostage::Remove(void) } /* <45c624> ../cstrike/dlls/hostage/hostage.cpp:426 */ -void CHostage::RePosition(void) +void CHostage::RePosition() { pev->health = pev->max_health; pev->movetype = MOVETYPE_STEP; @@ -564,7 +554,7 @@ float CHostage::GetModifiedDamage(float flDamage, int nHitGroup) } /* <45c7d3> ../cstrike/dlls/hostage/hostage.cpp:597 */ -void CHostage::PlayPainSound(void) +void CHostage::PlayPainSound() { if (m_LastHitGroup != HITGROUP_HEAD) return; @@ -577,7 +567,7 @@ void CHostage::PlayPainSound(void) } /* <45c8c4> ../cstrike/dlls/hostage/hostage.cpp:612 */ -void CHostage::SetFlinchActivity(void) +void CHostage::SetFlinchActivity() { Activity activity = ACT_SMALL_FLINCH; @@ -591,7 +581,7 @@ void CHostage::SetFlinchActivity(void) } /* <45c960> ../cstrike/dlls/hostage/hostage.cpp:642 */ -void CHostage::SetDeathActivity(void) +void CHostage::SetDeathActivity() { if (m_improv != NULL && m_improv->IsCrouching()) { @@ -599,7 +589,7 @@ void CHostage::SetDeathActivity(void) return; } - if (UTIL_IsGame("czero")) + if (g_bIsCzeroGame) { switch (m_LastHitGroup) { @@ -778,7 +768,7 @@ void CHostage::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, } /* <45cdba> ../cstrike/dlls/hostage/hostage.cpp:833 */ -void CHostage::PlayFollowRescueSound(void) +void CHostage::PlayFollowRescueSound() { switch (RANDOM_LONG(0, 4)) { @@ -804,7 +794,7 @@ void CHostage::GiveCTTouchBonus(CBasePlayer *pPlayer) } /* <45bf69> ../cstrike/dlls/hostage/hostage.cpp:869 */ -int CHostage::__MAKE_VHOOK(ObjectCaps)(void) +int CHostage::__MAKE_VHOOK(ObjectCaps)() { return (CBaseMonster::ObjectCaps() | FCAP_MUST_SPAWN | FCAP_ONOFF_USE); } @@ -848,7 +838,7 @@ void CHostage::__MAKE_VHOOK(Touch)(CBaseEntity *pOther) } /* <45dd66> ../cstrike/dlls/hostage/hostage.cpp:910 */ -void CHostage::DoFollow(void) +void CHostage::DoFollow() { CBaseEntity *pFollowing; Vector vecDest; @@ -1009,13 +999,13 @@ void CHostage::MoveToward(const Vector &vecLoc) } /* <45d704> ../cstrike/dlls/hostage/hostage.cpp:1102 */ -BOOL CHostage::IsOnLadder(void) +BOOL CHostage::IsOnLadder() { return pev->movetype == MOVETYPE_FLY; } /* <45d727> ../cstrike/dlls/hostage/hostage.cpp:1106 */ -void CHostage::NavReady(void) +void CHostage::NavReady() { CBaseEntity *pFollowing; Vector vecDest; @@ -1071,7 +1061,7 @@ void CHostage::NavReady(void) } /* <45edaa> ../cstrike/dlls/hostage/hostage.cpp:1159 */ -void CHostage::SendHostagePositionMsg(void) +void CHostage::SendHostagePositionMsg() { CBaseEntity *pEntity = NULL; @@ -1102,7 +1092,7 @@ void CHostage::SendHostagePositionMsg(void) } /* <45ecd5> ../cstrike/dlls/hostage/hostage.cpp:1189 */ -void CHostage::SendHostageEventMsg(void) +void CHostage::SendHostageEventMsg() { CBaseEntity *pEntity = NULL; @@ -1132,7 +1122,7 @@ void CHostage::SendHostageEventMsg(void) } /* <45d8a6> ../cstrike/dlls/hostage/hostage.cpp:1292 */ -void CHostage::Wiggle(void) +void CHostage::Wiggle() { TraceResult tr; Vector vec = Vector(0, 0, 0); @@ -1171,7 +1161,7 @@ void CHostage::Wiggle(void) } /* <45e00c> ../cstrike/dlls/hostage/hostage.cpp:1346 */ -void CHostage::PreThink(void) +void CHostage::PreThink() { Vector vecSrc; Vector vecDest; @@ -1244,14 +1234,20 @@ void CHostage::PreThink(void) } /* <45e24e> ../cstrike/dlls/hostage/hostage.cpp:1421 */ -void Hostage_RegisterCVars(void) +void Hostage_RegisterCVars() { +// These cvars are only used in czero +#ifdef REGAMEDLL_FIXES + if (!g_bIsCzeroGame) + return; +#endif // REGAMEDLL_FIXES + CVAR_REGISTER(&cv_hostage_debug); CVAR_REGISTER(&cv_hostage_stop); } /* <45e2a6> ../cstrike/dlls/hostage/hostage.cpp:1430 */ -void InstallHostageManager(void) +void InstallHostageManager() { if (g_pHostages != NULL) { @@ -1263,14 +1259,14 @@ void InstallHostageManager(void) } /* <45e375> ../cstrike/dlls/hostage/hostage.cpp:1443 */ -CHostageManager::CHostageManager(void) +CHostageManager::CHostageManager() { Q_memset(&m_chatter, 0, sizeof(m_chatter)); m_hostageCount = 0; } /* <45e39b> ../cstrike/dlls/hostage/hostage.cpp:1456 */ -void CHostageManager::ServerActivate(void) +void CHostageManager::ServerActivate() { m_hostageCount = 0; @@ -1280,7 +1276,7 @@ void CHostageManager::ServerActivate(void) AddHostage((CHostage *)pEntity); } - if (UTIL_IsGame("czero")) + if (g_bIsCzeroGame) { m_chatter.AddSound(HOSTAGE_CHATTER_START_FOLLOW, "hostage/huse/getouttahere.wav"); m_chatter.AddSound(HOSTAGE_CHATTER_START_FOLLOW, "hostage/huse/illfollow.wav"); @@ -1416,13 +1412,13 @@ void CHostageManager::ServerActivate(void) } /* <45e3a2> ../cstrike/dlls/hostage/hostage.cpp:1624 */ -void CHostageManager::ServerDeactivate(void) +void CHostageManager::ServerDeactivate() { ; } /* <45e3f7> ../cstrike/dlls/hostage/hostage.cpp:1631 */ -void CHostageManager::RestartRound(void) +void CHostageManager::RestartRound() { for (int i = 0; i < m_hostageCount; ++i) { @@ -1490,7 +1486,7 @@ bool CHostageManager::IsNearbyHostageJumping(CHostageImprov *improv) if (!other->IsAlive() || other == improv) continue; - + const float closeRange = 500.0f; if (!(improv->GetCentroid() - other->GetCentroid()).IsLengthGreaterThan(closeRange) && other->IsJumping()) { @@ -1516,7 +1512,7 @@ void CHostageManager::OnEvent(GameEventType event, CBaseEntity *entity, CBaseEnt } /* <45e6b8> ../cstrike/dlls/hostage/hostage.cpp:1726 */ -SimpleChatter::SimpleChatter(void) +SimpleChatter::SimpleChatter() { for (int i = 0; i < ARRAYSIZE(m_chatter); ++i) { @@ -1527,7 +1523,7 @@ SimpleChatter::SimpleChatter(void) } /* <45e6f0> ../cstrike/dlls/hostage/hostage.cpp:1737 */ -SimpleChatter::~SimpleChatter(void) +SimpleChatter::~SimpleChatter() { for (int i = 0; i < ARRAYSIZE(m_chatter); ++i) { @@ -1614,7 +1610,7 @@ float SimpleChatter::PlaySound(CBaseEntity *entity, HostageChatterType type) int attenuation = 1; sound = GetSound(type, &duration); - hostage = reinterpret_cast(entity); + hostage = static_cast(entity); if (sound == NULL) { @@ -1650,37 +1646,3 @@ float SimpleChatter::PlaySound(CBaseEntity *entity, HostageChatterType type) return duration; } - -#ifdef HOOK_GAMEDLL - -void CHostage::Spawn(void) -{ - Spawn_(); -} - -void CHostage::Precache(void) -{ - Precache_(); -} - -int CHostage::ObjectCaps(void) -{ - return ObjectCaps_(); -} - -int CHostage::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) -{ - return TakeDamage_(pevInflictor, pevAttacker, flDamage, bitsDamageType); -} - -void CHostage::Touch(CBaseEntity *pOther) -{ - Touch_(pOther); -} - -void CHostage::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/hostage/hostage.h b/regamedll/dlls/hostage/hostage.h index dcf80add..641445a5 100644 --- a/regamedll/dlls/hostage/hostage.h +++ b/regamedll/dlls/hostage/hostage.h @@ -79,16 +79,6 @@ enum HostageChatterType NUM_HOSTAGE_CHATTER_TYPES, }; -#ifdef HOOK_GAMEDLL - -#define g_pHostages (*pg_pHostages) -#define g_iHostageNumber (*pg_iHostageNumber) - -#define cv_hostage_debug (*pcv_hostage_debug) -#define cv_hostage_stop (*pcv_hostage_stop) - -#endif // HOOK_GAMEDLL - extern CHostageManager *g_pHostages; extern int g_iHostageNumber; @@ -101,26 +91,20 @@ extern cvar_t cv_hostage_stop; class CHostage: public CBaseMonster { public: - virtual void Spawn(void); - virtual void Precache(void); - virtual int ObjectCaps(void); // make hostage "useable" - virtual int Classify(void) - { - return CLASS_HUMAN_PASSIVE; - } + virtual void Spawn(); + virtual void Precache(); + virtual int ObjectCaps(); // make hostage "useable" + virtual int Classify() { return CLASS_HUMAN_PASSIVE; } virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType); - virtual int BloodColor(void) - { - return BLOOD_COLOR_RED; - } + virtual int BloodColor() { return BLOOD_COLOR_RED; } 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); - int ObjectCaps_(void); + void Spawn_(); + void Precache_(); + int ObjectCaps_(); int TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType); void Touch_(CBaseEntity *pOther); void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); @@ -128,38 +112,32 @@ public: #endif // HOOK_GAMEDLL public: - void EXPORT IdleThink(void); - void EXPORT Remove(void); - void RePosition(void); + void EXPORT IdleThink(); + void EXPORT Remove(); + void RePosition(); void SetActivity(int act); - int GetActivity(void) - { - return m_Activity; - } + int GetActivity() { return m_Activity; } float GetModifiedDamage(float flDamage, int nHitGroup); - void SetFlinchActivity(void); - void SetDeathActivity(void); - void PlayPainSound(void); - void PlayFollowRescueSound(void); + void SetFlinchActivity(); + void SetDeathActivity(); + void PlayPainSound(); + void PlayFollowRescueSound(); void AnnounceDeath(CBasePlayer *pAttacker); void ApplyHostagePenalty(CBasePlayer *pAttacker); void GiveCTTouchBonus(CBasePlayer *pPlayer); - void SendHostagePositionMsg(void); - void SendHostageEventMsg(void); - void DoFollow(void); - BOOL IsOnLadder(void); + void SendHostagePositionMsg(); + void SendHostageEventMsg(); + void DoFollow(); + BOOL IsOnLadder(); void PointAt(const Vector &vecLoc); void MoveToward(const Vector &vecLoc); - void NavReady(void); - void Wiggle(void); - void PreThink(void); + void NavReady(); + void Wiggle(); + void PreThink(); // queries - bool IsFollowingSomeone(void) - { - return IsFollowing(); - } - CBaseEntity *GetLeader(void) // return our leader, or NULL + bool IsFollowingSomeone() { return IsFollowing(); } + CBaseEntity *GetLeader() // return our leader, or NULL { if (m_improv != NULL) { @@ -183,22 +161,10 @@ public: return true; } - bool IsValid(void) - { - return (pev->takedamage == DAMAGE_YES); - } - bool IsDead(void) - { - return (pev->deadflag == DEAD_DEAD); - } - bool IsAtHome(void) - { - return (pev->origin - m_vStart).IsLengthGreaterThan(20) != true; - } - const Vector *GetHomePosition(void) - { - return &m_vStart; - } + bool IsValid() { return (pev->takedamage == DAMAGE_YES); } + bool IsDead() { return (pev->deadflag == DEAD_DEAD); } + bool IsAtHome() { return (pev->origin - m_vStart).IsLengthGreaterThan(20) != true; } + const Vector *GetHomePosition() { return &m_vStart; } public: int m_Activity; @@ -235,21 +201,19 @@ public: enum ModelType { REGULAR_GUY, OLD_GUY, BLACK_GUY, GOOFY_GUY } m_whichModel; - -};/* size: 1988, cachelines: 32, members: 32 */ +}; class SimpleChatter { public: - SimpleChatter(void); - ~SimpleChatter(void); + SimpleChatter(); + ~SimpleChatter(); struct SoundFile { char *filename; float duration; - - };/* size: 8, cachelines: 1, members: 2 */ + }; struct ChatterSet { @@ -257,8 +221,7 @@ public: int count; int index; bool needsShuffle; - - };/* size: 268, cachelines: 5, members: 4 */ + }; void AddSound(HostageChatterType type, char *filename); @@ -272,21 +235,20 @@ public: private: ChatterSet m_chatter[21]; - -};/* size: 5628, cachelines: 88, members: 1 */ +}; /* <45b018> ../cstrike/dlls/hostage/hostage.h:247 */ class CHostageManager { public: - CHostageManager(void); + CHostageManager(); - void ServerActivate(void); - void ServerDeactivate(void); + void ServerActivate(); + void ServerDeactivate(); - void RestartRound(void); + void RestartRound(); void AddHostage(CHostage *hostage); - SimpleChatter *GetChatter(void) + SimpleChatter *GetChatter() { return &m_chatter; } @@ -339,21 +301,9 @@ private: CHostage *m_hostage[ MAX_HOSTAGES ]; int m_hostageCount; SimpleChatter m_chatter; +}; -};/* size: 5680, cachelines: 89, members: 3 */ - -#ifdef HOOK_GAMEDLL - -// linked object -C_DLLEXPORT void hostage_entity(entvars_t *pev); -C_DLLEXPORT void monster_scientist(entvars_t *pev); - -// refs -extern void (CBaseEntity::*pCHostage__IdleThink)(void); - -#endif // HOOK_GAMEDLL - -void Hostage_RegisterCVars(void); -void InstallHostageManager(void); +void Hostage_RegisterCVars(); +void InstallHostageManager(); #endif // HOSTAGE_H diff --git a/regamedll/dlls/hostage/hostage_improv.cpp b/regamedll/dlls/hostage/hostage_improv.cpp index bcd469f5..ca11120b 100644 --- a/regamedll/dlls/hostage/hostage_improv.cpp +++ b/regamedll/dlls/hostage/hostage_improv.cpp @@ -16,12 +16,12 @@ inline void DrawAxes(const Vector &origin, int red, int green, int blue) /* <47353e> ../cstrike/dlls/hostage/hostage_improv.cpp:41 */ CHostageImprov::CHostageImprov(CBaseEntity *entity) { - m_hostage = reinterpret_cast(entity); + m_hostage = static_cast(entity); OnReset(); } /* <470d33> ../cstrike/dlls/hostage/hostage_improv.cpp:52 */ -bool CHostageImprov::__MAKE_VHOOK(IsAlive)(void) const +bool CHostageImprov::__MAKE_VHOOK(IsAlive)() const { return m_hostage->pev->deadflag != DEAD_DEAD; } @@ -89,7 +89,7 @@ void CHostageImprov::__MAKE_VHOOK(LookAt)(const Vector &target) } /* <470d97> ../cstrike/dlls/hostage/hostage_improv.cpp:126 */ -void CHostageImprov::__MAKE_VHOOK(ClearLookAt)(void) +void CHostageImprov::__MAKE_VHOOK(ClearLookAt)() { m_isLookingAt = false; } @@ -102,7 +102,7 @@ void CHostageImprov::__MAKE_VHOOK(FaceTo)(const Vector &goal) } /* <470dfb> ../cstrike/dlls/hostage/hostage_improv.cpp:145 */ -void CHostageImprov::__MAKE_VHOOK(ClearFaceTo)(void) +void CHostageImprov::__MAKE_VHOOK(ClearFaceTo)() { m_isFacingTo = false; } @@ -235,7 +235,7 @@ bool CHostageImprov::FaceTowards(const Vector &target, float deltaT) Vector2D lat(BotCOS(moveAngle), BotSIN(moveAngle)); Vector2D dir(-lat.y, lat.x); - + float_precision dot = DotProduct(to, dir); if (DotProduct(to, lat) < 0.0f) @@ -247,7 +247,7 @@ bool CHostageImprov::FaceTowards(const Vector &target, float deltaT) error = 1; } - + const float maxTurnRate = 0.05f; if (error || fabs(dot) >= maxTurnRate) @@ -268,7 +268,7 @@ bool CHostageImprov::FaceTowards(const Vector &target, float deltaT) } /* <47402b> ../cstrike/dlls/hostage/hostage_improv.cpp:308 */ -void CHostageImprov::FaceOutwards(void) +void CHostageImprov::FaceOutwards() { TraceResult result; Vector to; @@ -311,7 +311,7 @@ bool CHostageImprov::__MAKE_VHOOK(IsAtMoveGoal)(float error) const } /* <470eab> ../cstrike/dlls/hostage/hostage_improv.cpp:353 */ -bool CHostageImprov::__MAKE_VHOOK(IsAtFaceGoal)(void) const +bool CHostageImprov::__MAKE_VHOOK(IsAtFaceGoal)() const { return false; } @@ -378,14 +378,14 @@ bool CHostageImprov::__MAKE_VHOOK(IsFriendInTheWay)(CBaseEntity *myFriend, const Vector moveDir = goalPos - GetFeet(); Vector friendFeet = myFriend->pev->origin; - // make it a unit vector + // make it a unit vector float length = moveDir.NormalizeInPlace(); - + if (myFriend->IsPlayer()) friendFeet.z = myFriend->pev->absmin.z; Vector toFriend = friendFeet - GetFeet(); - + // check if friend is in our "personal space" const float personalSpace = 100.0f; if (toFriend.IsLengthGreaterThan(personalSpace)) @@ -421,7 +421,7 @@ bool CHostageImprov::__MAKE_VHOOK(IsFriendInTheWay)(CBaseEntity *myFriend, const } /* <474309> ../cstrike/dlls/hostage/hostage_improv.cpp:557 */ -bool CHostageImprov::IsFriendInTheWay(void) const +bool CHostageImprov::IsFriendInTheWay() const { CheckAhead check(this); g_pHostages->ForEachHostage(check); @@ -431,13 +431,13 @@ bool CHostageImprov::IsFriendInTheWay(void) const } /* <474631> ../cstrike/dlls/hostage/hostage_improv.cpp:568 */ -float CHostageImprov::GetSpeed(void) +float CHostageImprov::GetSpeed() { return -1.0f; } /* <46f249> ../cstrike/dlls/hostage/hostage_improv.cpp:592 */ -bool CHostageImprov::__MAKE_VHOOK(Jump)(void) +bool CHostageImprov::__MAKE_VHOOK(Jump)() { if (IsCrouching() || g_pHostages->IsNearbyHostageJumping(this)) return false; @@ -449,13 +449,13 @@ bool CHostageImprov::__MAKE_VHOOK(Jump)(void) m_hasJumped = false; m_moveFlags |= IN_JUMP; - + if (m_hostage->pev->velocity.LengthSquared() < epsilon) { const float fudge = 2.0f; m_hostage->pev->origin.z += fudge; } - + const float minJumpInterval = 3.0f; m_jumpTimer.Start(minJumpInterval); @@ -467,19 +467,19 @@ bool CHostageImprov::__MAKE_VHOOK(Jump)(void) } /* <470ed3> ../cstrike/dlls/hostage/hostage_improv.cpp:632 */ -void CHostageImprov::__MAKE_VHOOK(Run)(void) +void CHostageImprov::__MAKE_VHOOK(Run)() { m_moveType = m_moveLimit; } /* <470efb> ../cstrike/dlls/hostage/hostage_improv.cpp:638 */ -void CHostageImprov::__MAKE_VHOOK(Walk)(void) +void CHostageImprov::__MAKE_VHOOK(Walk)() { m_moveType = (m_moveLimit > Walking) ? Walking : m_moveLimit; } /* <470f23> ../cstrike/dlls/hostage/hostage_improv.cpp:644 */ -void CHostageImprov::__MAKE_VHOOK(Stop)(void) +void CHostageImprov::__MAKE_VHOOK(Stop)() { MoveTo(GetFeet()); m_hostage->pev->velocity = Vector(0, 0, 0); @@ -491,33 +491,33 @@ void CHostageImprov::__MAKE_VHOOK(Stop)(void) } /* <470f4c> ../cstrike/dlls/hostage/hostage_improv.cpp:655 */ -const Vector &CHostageImprov::__MAKE_VHOOK(GetFeet)(void) const +const Vector &CHostageImprov::__MAKE_VHOOK(GetFeet)() const { return m_hostage->pev->origin; } /* <470f74> ../cstrike/dlls/hostage/hostage_improv.cpp:661 */ -const Vector &CHostageImprov::__MAKE_VHOOK(GetCentroid)(void) const +const Vector &CHostageImprov::__MAKE_VHOOK(GetCentroid)() const { m_centroid = m_hostage->pev->origin + Vector(0, 0, 36); return m_centroid; } /* <470f9c> ../cstrike/dlls/hostage/hostage_improv.cpp:671 */ -const Vector &CHostageImprov::__MAKE_VHOOK(GetEyes)(void) const +const Vector &CHostageImprov::__MAKE_VHOOK(GetEyes)() const { m_eye = m_hostage->pev->origin + Vector(0, 0, 72) - Vector(0, 0, 7); return m_eye; } /* <470fc4> ../cstrike/dlls/hostage/hostage_improv.cpp:681 */ -bool CHostageImprov::__MAKE_VHOOK(IsOnGround)(void) const +bool CHostageImprov::__MAKE_VHOOK(IsOnGround)() const { return (m_hostage->pev->flags & FL_ONGROUND) != 0; } /* <470fec> ../cstrike/dlls/hostage/hostage_improv.cpp:687 */ -bool CHostageImprov::__MAKE_VHOOK(IsMoving)(void) const +bool CHostageImprov::__MAKE_VHOOK(IsMoving)() const { float const epsilon = 10.0f; return m_actualVel.IsLengthGreaterThan(epsilon); @@ -615,7 +615,7 @@ CBasePlayer *CHostageImprov::__MAKE_VHOOK(GetClosestPlayerByTravelDistance)(int } /* <47166d> ../cstrike/dlls/hostage/hostage_improv.cpp:822 */ -void CHostageImprov::__MAKE_VHOOK(OnReset)(void) +void CHostageImprov::__MAKE_VHOOK(OnReset)() { m_moveFlags = 0; m_moveType = Stopped; @@ -672,7 +672,7 @@ void CHostageImprov::__MAKE_VHOOK(OnReset)(void) } /* <474659> ../cstrike/dlls/hostage/hostage_improv.cpp:886 */ -void CHostageImprov::UpdateVision(void) +void CHostageImprov::UpdateVision() { if (!m_visionTimer.IsElapsed()) return; @@ -740,7 +740,7 @@ void CHostageImprov::SetKnownGoodPosition(const Vector &pos) } /* <47486d> ../cstrike/dlls/hostage/hostage_improv.cpp:1038 */ -void CHostageImprov::ResetToKnownGoodPosition(void) +void CHostageImprov::ResetToKnownGoodPosition() { const float tolerance = 10.0f; @@ -935,7 +935,7 @@ void CHostageImprov::UpdatePosition(float deltaT) while (yaw < -180.0f) yaw += 360.0f; - + while (pitch > 180.0f) pitch -= 360.0f; @@ -1030,7 +1030,7 @@ void CHostageImprov::__MAKE_VHOOK(OnUpkeep)(float deltaT) } /* <4749f9> ../cstrike/dlls/hostage/hostage_improv.cpp:1396 */ -bool CHostageImprov::IsTerroristNearby(void) +bool CHostageImprov::IsTerroristNearby() { if (m_nearbyTerroristTimer.IsElapsed()) { @@ -1042,11 +1042,11 @@ bool CHostageImprov::IsTerroristNearby(void) } /* <474ae7> ../cstrike/dlls/hostage/hostage_improv.cpp:1412 */ -void CHostageImprov::CheckForNearbyTerrorists(void) +void CHostageImprov::CheckForNearbyTerrorists() { if (!m_checkNearbyTerroristTimer.IsElapsed()) return; - + const float checkInterval = 2.0f; m_checkNearbyTerroristTimer.Start(checkInterval); m_isTerroristNearby = false; @@ -1064,7 +1064,7 @@ void CHostageImprov::CheckForNearbyTerrorists(void) } /* <4753ba> ../cstrike/dlls/hostage/hostage_improv.cpp:1440 */ -void CHostageImprov::UpdateGrenadeReactions(void) +void CHostageImprov::UpdateGrenadeReactions() { if (m_coughTimer.IsElapsed()) { @@ -1507,13 +1507,13 @@ void CHostageImprov::ApplyForce(Vector force) } /* <474bd5> ../cstrike/dlls/hostage/hostage_improv.cpp:2016 */ -bool CHostageImprov::IsAtHome(void) const +bool CHostageImprov::IsAtHome() const { return m_hostage->IsAtHome(); } /* <474c76> ../cstrike/dlls/hostage/hostage_improv.cpp:2025 */ -bool CHostageImprov::CanSeeRescueZone(void) const +bool CHostageImprov::CanSeeRescueZone() const { CCSBotManager *ctrl = TheCSBots(); @@ -1571,19 +1571,19 @@ float CHostageImprov::GetTimeSinceLastSawPlayer(int team) } /* <474f2c> ../cstrike/dlls/hostage/hostage_improv.cpp:2098 */ -float CHostageImprov::GetTimeSinceLastInjury(void) +float CHostageImprov::GetTimeSinceLastInjury() { return m_lastInjuryTimer.GetElapsedTime(); } /* <474fb3> ../cstrike/dlls/hostage/hostage_improv.cpp:2107 */ -float CHostageImprov::GetTimeSinceLastNoise(void) +float CHostageImprov::GetTimeSinceLastNoise() { return m_lastNoiseTimer.GetElapsedTime(); } /* <47503a> ../cstrike/dlls/hostage/hostage_improv.cpp:2117 */ -bool CHostageImprov::IsScared(void) const +bool CHostageImprov::IsScared() const { if (m_scaredTimer.IsElapsed()) { @@ -1622,7 +1622,7 @@ void CHostageImprov::Frighten(ScareType scare) } /* <475200> ../cstrike/dlls/hostage/hostage_improv.cpp:2165 */ -void CHostageImprov::Afraid(void) +void CHostageImprov::Afraid() { char animInto[32]; char animLoop[32]; @@ -1707,7 +1707,7 @@ void CHostageImprov::DelayedChatter(float delayTime, HostageChatterType sayType, } /* <475bd4> ../cstrike/dlls/hostage/hostage_improv.cpp:2268 */ -void CHostageImprov::UpdateDelayedChatter(void) +void CHostageImprov::UpdateDelayedChatter() { if (!m_isDelayedChatterPending) return; @@ -1753,21 +1753,21 @@ void CHostageImprov::Flinch(Activity activity) } /* <4762fe> ../cstrike/dlls/hostage/hostage_improv.cpp:2329 */ -void CHostageImprov::CrouchDie(void) +void CHostageImprov::CrouchDie() { m_animateState.Reset(); m_animateState.AddSequence(this, ACT_CROUCH_DIE); } /* <476327> ../cstrike/dlls/hostage/hostage_improv.cpp:2339 */ -void CHostageImprov::Agree(void) +void CHostageImprov::Agree() { m_animateState.Reset(); m_animateState.AddSequence(this, ACT_YES); } /* <476350> ../cstrike/dlls/hostage/hostage_improv.cpp:2349 */ -void CHostageImprov::Disagree(void) +void CHostageImprov::Disagree() { if (m_animateState.GetPerformance() != HostageAnimateState::Disagreeing) { @@ -1777,7 +1777,7 @@ void CHostageImprov::Disagree(void) } /* <476395> ../cstrike/dlls/hostage/hostage_improv.cpp:2363 */ -void CHostageImprov::Wave(void) +void CHostageImprov::Wave() { m_animateState.Reset(); m_animateState.SetPerformance(HostageAnimateState::Waving); @@ -1798,7 +1798,7 @@ void CHostageImprov::__MAKE_VHOOK(OnMoveToFailure)(const Vector &goal, MoveToFai } /* <4763d7> ../cstrike/dlls/hostage/hostage_improv.cpp:2391 */ -void CHostageImprov::Wiggle(void) +void CHostageImprov::Wiggle() { // for wiggling if (m_wiggleTimer.IsElapsed()) @@ -1840,7 +1840,7 @@ void CHostageImprov::Wiggle(void) } /* <4766cc> ../cstrike/dlls/hostage/hostage_improv.cpp:2438 */ -void CHostageImprov::ClearPath(void) +void CHostageImprov::ClearPath() { Vector start; Vector end; @@ -1888,7 +1888,7 @@ void CHostageImprov::ClearPath(void) } /* <471b3f> ../cstrike/dlls/hostage/hostage_improv.cpp:2497 */ -void CHostageImprov::__MAKE_VHOOK(Crouch)(void) +void CHostageImprov::__MAKE_VHOOK(Crouch)() { const float minCrouchTime = 1.0f; @@ -1901,7 +1901,7 @@ void CHostageImprov::__MAKE_VHOOK(Crouch)(void) } /* <47195c> ../cstrike/dlls/hostage/hostage_improv.cpp:2516 */ -void CHostageImprov::__MAKE_VHOOK(StandUp)(void) +void CHostageImprov::__MAKE_VHOOK(StandUp)() { if (!IsCrouching() || !m_minCrouchTimer.IsElapsed()) { @@ -1930,186 +1930,7 @@ void CHostageImprov::__MAKE_VHOOK(StandUp)(void) } /* <477114> ../cstrike/dlls/hostage/hostage_improv.cpp:2558 */ -void CHostageImprov::UpdateStationaryAnimation(void) +void CHostageImprov::UpdateStationaryAnimation() { m_behavior.UpdateStationaryAnimation(this); } - -#ifdef HOOK_GAMEDLL - -void CHostageImprov::OnMoveToFailure(const Vector &goal, MoveToFailureType reason) -{ - OnMoveToFailure_(goal, reason); -} - -bool CHostageImprov::IsAlive(void) const -{ - return IsAlive_(); -} - -void CHostageImprov::MoveTo(const Vector &goal) -{ - MoveTo_(goal); -} - -void CHostageImprov::LookAt(const Vector &target) -{ - LookAt_(target); -} - -void CHostageImprov::ClearLookAt(void) -{ - ClearLookAt_(); -} - -void CHostageImprov::FaceTo(const Vector &goal) -{ - FaceTo_(goal); -} - -void CHostageImprov::ClearFaceTo(void) -{ - ClearFaceTo_(); -} - -bool CHostageImprov::IsAtMoveGoal(float error) const -{ - return IsAtMoveGoal_(error); -} - -bool CHostageImprov::IsAtFaceGoal(void) const -{ - return IsAtFaceGoal_(); -} - -bool CHostageImprov::IsFriendInTheWay(const Vector &goalPos) const -{ - return IsFriendInTheWay_(goalPos); -} - -bool CHostageImprov::IsFriendInTheWay(CBaseEntity *myFriend, const Vector &goalPos) const -{ - return IsFriendInTheWay_(myFriend, goalPos); -} - -bool CHostageImprov::Jump(void) -{ - return Jump_(); -} - -void CHostageImprov::Crouch(void) -{ - Crouch_(); -} - -void CHostageImprov::StandUp(void) -{ - StandUp_(); -} - -void CHostageImprov::TrackPath(const Vector &pathGoal, float deltaT) -{ - TrackPath_(pathGoal, deltaT); -} - -void CHostageImprov::StartLadder(const CNavLadder *ladder, NavTraverseType how, const Vector *approachPos, const Vector *departPos) -{ - StartLadder_(ladder, how, approachPos, departPos); -} - -bool CHostageImprov::TraverseLadder(const CNavLadder *ladder, NavTraverseType how, const Vector *approachPos, const Vector *departPos, float deltaT) -{ - return TraverseLadder_(ladder, how, approachPos, departPos, deltaT); -} - -bool CHostageImprov::GetSimpleGroundHeightWithFloor(const Vector *pos, float *height, Vector *normal) -{ - return GetSimpleGroundHeightWithFloor_(pos, height, normal); -} - -void CHostageImprov::Run(void) -{ - Run_(); -} - -void CHostageImprov::Walk(void) -{ - Walk_(); -} - -void CHostageImprov::Stop(void) -{ - Stop_(); -} - -const Vector &CHostageImprov::GetFeet(void) const -{ - return GetFeet_(); -} - -const Vector &CHostageImprov::GetCentroid(void) const -{ - return GetCentroid_(); -} - -const Vector &CHostageImprov::GetEyes(void) const -{ - return GetEyes_(); -} - -bool CHostageImprov::IsOnGround(void) const -{ - return IsOnGround_(); -} - -bool CHostageImprov::IsMoving(void) const -{ - return IsMoving_(); -} - -bool CHostageImprov::IsVisible(const Vector &pos, bool testFOV) const -{ - return IsVisible_(pos, testFOV); -} - -bool CHostageImprov::IsPlayerLookingAtMe(CBasePlayer *other, float cosTolerance) const -{ - return IsPlayerLookingAtMe_(other, cosTolerance); -} - -CBasePlayer *CHostageImprov::IsAnyPlayerLookingAtMe(int team, float cosTolerance) const -{ - return IsAnyPlayerLookingAtMe_(team, cosTolerance); -} - -CBasePlayer *CHostageImprov::GetClosestPlayerByTravelDistance(int team, float *range) const -{ - return GetClosestPlayerByTravelDistance_(team, range); -} - -void CHostageImprov::OnUpdate(float deltaT) -{ - OnUpdate_(deltaT); -} - -void CHostageImprov::OnUpkeep(float deltaT) -{ - OnUpkeep_(deltaT); -} - -void CHostageImprov::OnReset(void) -{ - OnReset_(); -} - -void CHostageImprov::OnGameEvent(GameEventType event, CBaseEntity *entity, CBaseEntity *other) -{ - OnGameEvent_(event, entity, other); -} - -void CHostageImprov::OnTouch(CBaseEntity *other) -{ - OnTouch_(other); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/hostage/hostage_improv.h b/regamedll/dlls/hostage/hostage_improv.h index cae4cf28..4617c0b9 100644 --- a/regamedll/dlls/hostage/hostage_improv.h +++ b/regamedll/dlls/hostage/hostage_improv.h @@ -43,7 +43,7 @@ class CHostageImprov: public CImprov { public: CHostageImprov(CBaseEntity *entity); - ~CHostageImprov(void) {}; + ~CHostageImprov() {}; // invoked when an improv reaches its MoveTo goal virtual void OnMoveToSuccess(const Vector &goal) { m_behavior.OnMoveToSuccess(goal); } @@ -56,97 +56,97 @@ public: m_lastInjuryTimer.Start(); Frighten(TERRIFIED); } - virtual bool IsAlive(void) const; + virtual bool IsAlive() const; virtual void MoveTo(const Vector &goal); virtual void LookAt(const Vector &target); - virtual void ClearLookAt(void); + virtual void ClearLookAt(); virtual void FaceTo(const Vector &goal); - virtual void ClearFaceTo(void); + virtual void ClearFaceTo(); virtual bool IsAtMoveGoal(float error = 20.0f) const; - virtual bool HasLookAt(void) const { return m_isLookingAt; } - virtual bool HasFaceTo(void) const { return m_isFacingTo; } - virtual bool IsAtFaceGoal(void) const; + virtual bool HasLookAt() const { return m_isLookingAt; } + virtual bool HasFaceTo() const { return m_isFacingTo; } + virtual bool IsAtFaceGoal() const; virtual bool IsFriendInTheWay(const Vector &goalPos) const; virtual bool IsFriendInTheWay(CBaseEntity *myFriend, const Vector &goalPos) const; - virtual void MoveForward(void) { m_moveFlags |= IN_FORWARD; } - virtual void MoveBackward(void) { m_moveFlags |= IN_BACK; } - virtual void StrafeLeft(void) { m_moveFlags |= IN_MOVELEFT; } - virtual void StrafeRight(void) { m_moveFlags |= IN_MOVERIGHT; } + virtual void MoveForward() { m_moveFlags |= IN_FORWARD; } + virtual void MoveBackward() { m_moveFlags |= IN_BACK; } + virtual void StrafeLeft() { m_moveFlags |= IN_MOVELEFT; } + virtual void StrafeRight() { m_moveFlags |= IN_MOVERIGHT; } #define HOSTAGE_MUST_JUMP true - virtual bool Jump(void); + virtual bool Jump(); - virtual void Crouch(void); - virtual void StandUp(void); + virtual void Crouch(); + virtual void StandUp(); virtual void TrackPath(const Vector &pathGoal, float deltaT); // move along path by following "pathGoal" virtual void StartLadder(const CNavLadder *ladder, NavTraverseType how, const Vector *approachPos, const Vector *departPos); virtual bool TraverseLadder(const CNavLadder *ladder, NavTraverseType how, const Vector *approachPos, const Vector *departPos, float deltaT); virtual bool GetSimpleGroundHeightWithFloor(const Vector *pos, float *height, Vector *normal = NULL); - virtual void Run(void); - virtual void Walk(void); - virtual void Stop(void); - virtual float GetMoveAngle(void) const { return m_moveAngle; } - virtual float GetFaceAngle(void) const { return m_moveAngle; } - virtual const Vector &GetFeet(void) const; - virtual const Vector &GetCentroid(void) const; - virtual const Vector &GetEyes(void) const; - virtual bool IsRunning(void) const { return (m_moveType == Running); } - virtual bool IsWalking(void) const { return (m_moveType == Walking); } - virtual bool IsStopped(void) const { return (m_moveType == Stopped); } - virtual bool IsCrouching(void) const { return m_isCrouching; } - virtual bool IsJumping(void) const { return (m_jumpTimer.IsElapsed() == false); } - virtual bool IsUsingLadder(void) const { return false; } - virtual bool IsOnGround(void) const; - virtual bool IsMoving(void) const; - virtual bool CanRun(void) const { return true; } - virtual bool CanCrouch(void) const { return true; } - virtual bool CanJump(void) const { return true; } + virtual void Run(); + virtual void Walk(); + virtual void Stop(); + virtual float GetMoveAngle() const { return m_moveAngle; } + virtual float GetFaceAngle() const { return m_moveAngle; } + virtual const Vector &GetFeet() const; + virtual const Vector &GetCentroid() const; + virtual const Vector &GetEyes() const; + virtual bool IsRunning() const { return (m_moveType == Running); } + virtual bool IsWalking() const { return (m_moveType == Walking); } + virtual bool IsStopped() const { return (m_moveType == Stopped); } + virtual bool IsCrouching() const { return m_isCrouching; } + virtual bool IsJumping() const { return (m_jumpTimer.IsElapsed() == false); } + virtual bool IsUsingLadder() const { return false; } + virtual bool IsOnGround() const; + virtual bool IsMoving() const; + virtual bool CanRun() const { return true; } + virtual bool CanCrouch() const { return true; } + virtual bool CanJump() const { return true; } virtual bool IsVisible(const Vector &pos, bool testFOV = false) const; // return true if hostage can see position virtual bool IsPlayerLookingAtMe(CBasePlayer *other, float cosTolerance = 0.95f) const; virtual CBasePlayer *IsAnyPlayerLookingAtMe(int team = 0, float cosTolerance = 0.95f) const; virtual CBasePlayer *GetClosestPlayerByTravelDistance(int team = 0, float *range = NULL) const; - virtual CNavArea *GetLastKnownArea(void) const { return m_lastKnownArea; } + virtual CNavArea *GetLastKnownArea() const { return m_lastKnownArea; } virtual void OnUpdate(float deltaT); virtual void OnUpkeep(float deltaT); - virtual void OnReset(void); + virtual void OnReset(); virtual void OnGameEvent(GameEventType event, CBaseEntity *entity = NULL, CBaseEntity *other = NULL); virtual void OnTouch(CBaseEntity *other); // in contact with "other" #ifdef HOOK_GAMEDLL void OnMoveToFailure_(const Vector &goal, MoveToFailureType reason); - bool IsAlive_(void) const; + bool IsAlive_() const; void MoveTo_(const Vector &goal); void LookAt_(const Vector &target); - void ClearLookAt_(void); + void ClearLookAt_(); void FaceTo_(const Vector &goal); - void ClearFaceTo_(void); + void ClearFaceTo_(); bool IsAtMoveGoal_(float error = 20.0f) const; - bool IsAtFaceGoal_(void) const; + bool IsAtFaceGoal_() const; bool IsFriendInTheWay_(const Vector &goalPos) const; bool IsFriendInTheWay_(CBaseEntity *myFriend, const Vector &goalPos) const; - bool Jump_(void); - void Crouch_(void); - void StandUp_(void); + bool Jump_(); + void Crouch_(); + void StandUp_(); void TrackPath_(const Vector &pathGoal, float deltaT); void StartLadder_(const CNavLadder *ladder, NavTraverseType how, const Vector *approachPos, const Vector *departPos); bool TraverseLadder_(const CNavLadder *ladder, NavTraverseType how, const Vector *approachPos, const Vector *departPos, float deltaT); bool GetSimpleGroundHeightWithFloor_(const Vector *pos, float *height, Vector *normal = NULL); - void Run_(void); - void Walk_(void); - void Stop_(void); - const Vector &GetFeet_(void) const; - const Vector &GetCentroid_(void) const; - const Vector &GetEyes_(void) const; - bool IsOnGround_(void) const; - bool IsMoving_(void) const; + void Run_(); + void Walk_(); + void Stop_(); + const Vector &GetFeet_() const; + const Vector &GetCentroid_() const; + const Vector &GetEyes_() const; + bool IsOnGround_() const; + bool IsMoving_() const; bool IsVisible_(const Vector &pos, bool testFOV = false) const; bool IsPlayerLookingAtMe_(CBasePlayer *other, float cosTolerance = 0.95f) const; CBasePlayer *IsAnyPlayerLookingAtMe_(int team = 0, float cosTolerance = 0.95f) const; CBasePlayer *GetClosestPlayerByTravelDistance_(int team = 0, float *range = NULL) const; void OnUpdate_(float deltaT); void OnUpkeep_(float deltaT); - void OnReset_(void); + void OnReset_(); void OnGameEvent_(GameEventType event, CBaseEntity *entity = NULL, CBaseEntity *other = NULL); void OnTouch_(CBaseEntity *other); @@ -156,12 +156,12 @@ public: enum MoveType { Stopped, Walking, Running }; enum ScareType { NERVOUS, SCARED, TERRIFIED }; - void FaceOutwards(void); - bool IsFriendInTheWay(void) const; + void FaceOutwards(); + bool IsFriendInTheWay() const; void SetKnownGoodPosition(const Vector &pos); - const Vector &GetKnownGoodPosition(void) const { return m_knownGoodPos; } - void ResetToKnownGoodPosition(void); - void ResetJump(void) + const Vector &GetKnownGoodPosition() const { return m_knownGoodPos; } + void ResetToKnownGoodPosition(); + void ResetJump() { if (m_hasJumpedIntoAir) { @@ -183,68 +183,68 @@ public: m_vel.y += y; } #endif // PLAY_GAMEDLL - const Vector GetActualVelocity(void) const { return m_actualVel; } + const Vector GetActualVelocity() const { return m_actualVel; } void SetMoveLimit(MoveType limit) { m_moveLimit = limit; } - MoveType GetMoveLimit(void) const { return m_moveLimit; } - CNavPath *GetPath(void) { return &m_path; } - CNavPathFollower *GetPathFollower(void); + MoveType GetMoveLimit() const { return m_moveLimit; } + CNavPath *GetPath() { return &m_path; } + CNavPathFollower *GetPathFollower(); // hostage states // stand idle - void Idle(void) { m_behavior.SetState(&m_idleState); } - bool IsIdle(void) const { return m_behavior.IsState(&m_idleState); } + void Idle() { m_behavior.SetState(&m_idleState); } + bool IsIdle() const { return m_behavior.IsState(&m_idleState); } // begin following "leader" void Follow(CBasePlayer *leader) { m_followState.SetLeader(leader); m_behavior.SetState(&m_followState); } bool IsFollowing(const CBaseEntity *leader = NULL) const { return m_behavior.IsState(&m_followState); } // Escape - void Escape(void) { m_behavior.SetState(&m_escapeState); } - bool IsEscaping(void) const { return m_behavior.IsState(&m_escapeState); } + void Escape() { m_behavior.SetState(&m_escapeState); } + bool IsEscaping() const { return m_behavior.IsState(&m_escapeState); } // Retreat - void Retreat(void) { m_behavior.SetState(&m_retreatState); } - bool IsRetreating(void) const { return m_behavior.IsState(&m_retreatState); } + void Retreat() { m_behavior.SetState(&m_retreatState); } + bool IsRetreating() const { return m_behavior.IsState(&m_retreatState); } - bool IsAtHome(void) const; - bool CanSeeRescueZone(void) const; - CBaseEntity *GetFollowLeader(void) const { return m_followState.GetLeader(); } + bool IsAtHome() const; + bool CanSeeRescueZone() const; + CBaseEntity *GetFollowLeader() const { return m_followState.GetLeader(); } CBasePlayer *GetClosestVisiblePlayer(int team); float GetTimeSinceLastSawPlayer(int team); - float GetTimeSinceLastInjury(void); - float GetTimeSinceLastNoise(void); - bool IsTerroristNearby(void); + float GetTimeSinceLastInjury(); + float GetTimeSinceLastNoise(); + bool IsTerroristNearby(); void Frighten(ScareType scare); - bool IsScared(void) const; - ScareType GetScareIntensity(void) const { return m_scareIntensity; } - bool IsIgnoringTerrorists(void) const { m_ignoreTerroristTimer.IsElapsed(); } - float GetAggression(void) const { return m_aggression; } + bool IsScared() const; + ScareType GetScareIntensity() const { return m_scareIntensity; } + bool IsIgnoringTerrorists() const { m_ignoreTerroristTimer.IsElapsed(); } + float GetAggression() const { return m_aggression; } void Chatter(HostageChatterType sayType, bool mustSpeak = true); void DelayedChatter(float delayTime, HostageChatterType sayType, bool mustSpeak = false); - NOXREF void UpdateDelayedChatter(void); - bool IsTalking(void) const { return m_talkingTimer.IsElapsed(); } - void UpdateGrenadeReactions(void); - void Afraid(void); - void Wave(void); - void Agree(void); - void Disagree(void); - void CrouchDie(void); + NOXREF void UpdateDelayedChatter(); + bool IsTalking() const { return m_talkingTimer.IsElapsed(); } + void UpdateGrenadeReactions(); + void Afraid(); + void Wave(); + void Agree(); + void Disagree(); + void CrouchDie(); void Flinch(Activity activity); void UpdateIdleActivity(Activity activity, Activity fidget); - void UpdateStationaryAnimation(void); - CHostage *GetEntity(void) const { return m_hostage; } - void CheckForNearbyTerrorists(void); + void UpdateStationaryAnimation(); + CHostage *GetEntity() const { return m_hostage; } + void CheckForNearbyTerrorists(); void UpdatePosition(float); void MoveTowards(const Vector &pos, float deltaT); bool FaceTowards(const Vector &target, float deltaT); // rotate body to face towards "target" - float GetSpeed(void); + float GetSpeed(); void SetMoveAngle(float angle) { m_moveAngle = angle; } - void Wiggle(void); // attempt to wiggle-out of begin stuck - void ClearPath(void); + void Wiggle(); // attempt to wiggle-out of begin stuck + void ClearPath(); #define HOSTAGE_ONLY_JUMP_DOWN true bool DiscontinuityJump(float ground, bool onlyJumpDown = false, bool mustJump = false); - void UpdateVision(void); + void UpdateVision(); public: CountdownTimer m_coughTimer; @@ -320,8 +320,7 @@ private: EHANDLE m_visiblePlayer[ MAX_CLIENTS ]; int m_visiblePlayerCount; CountdownTimer m_visionTimer; - -};/* size: 7308, cachelines: 115, members: 70 */ +}; /* <46fac7> ../cstrike/dlls/hostage/hostage_improv.cpp:363 */ class CheckWayFunctor @@ -333,7 +332,6 @@ public: m_goalPos = goalPos; m_blocker = NULL; } - /* <46fa9c> ../cstrike/dlls/hostage/hostage_improv.cpp:370 */ bool operator()(CHostage *them) { if (((CBaseMonster *)them)->IsAlive() && m_me->IsFriendInTheWay((CBaseEntity *)them, m_goalPos)) @@ -348,8 +346,7 @@ public: const CHostageImprov *m_me; Vector m_goalPos; CHostage *m_blocker; - -}; /* size: 20, cachelines: 1, members: 3 */ +}; // Functor used with NavAreaBuildPath() for building Hostage paths. // Once we hook up crouching and ladders, this can be removed and ShortestPathCost() can be used instead. @@ -379,7 +376,7 @@ public: { dist = (*area->GetCenter() - *fromArea->GetCenter()).Length(); } - + float cost = dist + fromArea->GetCostSoFar(); // if this is a "crouch" area, add penalty @@ -405,20 +402,18 @@ public: class KeepPersonalSpace { public: - /* <4700b6> ../cstrike/dlls/hostage/hostage_improv.cpp:931 */ KeepPersonalSpace(CHostageImprov *improv) { m_improv = improv; m_velDir = improv->GetActualVelocity(); m_speed = m_velDir.NormalizeInPlace(); } - /* <46f9d7> ../cstrike/dlls/hostage/hostage_improv.cpp:939 */ bool operator()(CBaseEntity *entity) { const float space = 1.0f; Vector to; float range; - + if (entity == reinterpret_cast(m_improv->GetEntity())) return true; @@ -465,21 +460,18 @@ private: CHostageImprov *m_improv; Vector m_velDir; float m_speed; - -}; /* size: 20, cachelines: 1, members: 3 */ +}; /* <46fbb8> ../cstrike/dlls/hostage/hostage_improv.cpp:518 */ class CheckAhead { public: - /* <46fbb8> ../cstrike/dlls/hostage/hostage_improv.cpp:518 */ CheckAhead(const CHostageImprov *me) { m_me = me; m_dir = Vector(BotCOS(me->GetMoveAngle()), BotSIN(me->GetMoveAngle()), 0.0f); m_isBlocked = false; } - /* <47046f> ../cstrike/dlls/hostage/hostage_improv.cpp:525 */ bool operator()(CBaseEntity *entity) { Vector to; @@ -498,37 +490,12 @@ public: return true; } - /* <46f597> ../cstrike/dlls/hostage/hostage_improv.cpp:546 */ - bool IsBlocked(void) const - { - return m_isBlocked; - } + bool IsBlocked() const { return m_isBlocked; } private: const CHostageImprov *m_me; Vector m_dir; bool m_isBlocked; - -};/* size: 20, cachelines: 1, members: 3 */ - -#ifdef HOOK_GAMEDLL - -// NavAreaBuildPath hook -inline bool NavAreaBuildPath__HostagePathCost__wrapper(CNavArea *startArea, CNavArea *goalArea, const Vector *goalPos, class HostagePathCost &costFunc, CNavArea **closestArea) -{ - return NavAreaBuildPath(startArea, goalArea, goalPos, costFunc, closestArea); -} - -// NavAreaBuildPath hook -inline bool NavAreaBuildPath__ShortestPathCost__wrapper(CNavArea *startArea, CNavArea *goalArea, const Vector *goalPos, class ShortestPathCost &costFunc, CNavArea **closestArea) -{ - return NavAreaBuildPath(startArea, goalArea, goalPos, costFunc, closestArea); -} - -typedef bool (CHostageImprov::*IS_FRIEND_IN_THE_WAY_VECTOR)(const Vector &) const; -typedef bool (CHostageImprov::*IS_FRIEND_IN_THE_WAY_CBASE)(CBaseEntity *, const Vector &) const; -typedef bool (CHostageImprov::*IS_FRIEND_IN_THE_WAY)(void) const; - -#endif // HOOK_GAMEDLL +}; #endif // HOSTAGE_IMPROV_H diff --git a/regamedll/dlls/hostage/hostage_localnav.cpp b/regamedll/dlls/hostage/hostage_localnav.cpp index 7050745b..d58949f4 100644 --- a/regamedll/dlls/hostage/hostage_localnav.cpp +++ b/regamedll/dlls/hostage/hostage_localnav.cpp @@ -15,18 +15,6 @@ float CLocalNav::flLastThinkTime; EHANDLE CLocalNav::hostages[MAX_HOSTAGES_NAV]; int CLocalNav::tot_hostages; -#else - -float (*CLocalNav::ps_flStepSize); -int (*CLocalNav::pqptr); -EHANDLE (*CLocalNav::pqueue)[MAX_HOSTAGES_NAV]; -int (*CLocalNav::ptot_inqueue); -float (*CLocalNav::pnodeval); -float (*CLocalNav::pflNextCvarCheck); -float (*CLocalNav::pflLastThinkTime); -EHANDLE (*CLocalNav::phostages)[MAX_HOSTAGES_NAV]; -int (*CLocalNav::ptot_hostages); - #endif // HOOK_GAMEDLL /* <485b67> ../cstrike/dlls/hostage/hostage_localnav.cpp:45 */ @@ -45,7 +33,7 @@ CLocalNav::CLocalNav(CHostage *pOwner) } /* <485b09> ../cstrike/dlls/hostage/hostage_localnav.cpp:68 */ -CLocalNav::~CLocalNav(void) +CLocalNav::~CLocalNav() { delete m_nodeArr; } @@ -254,7 +242,7 @@ node_index_t CLocalNav::GetBestNode(Vector &vecOrigin, Vector &vecDest) } } - nindexCurrent++; + ++nindexCurrent; } return nindexBest; @@ -287,7 +275,7 @@ int CLocalNav::GetFurthestTraversableNode(Vector &vecStartingLoc, Vector *vecNod if (PathTraversable(vecStartingLoc, vecNodes[nCount], fNoMonsters) != PATH_TRAVERSABLE_EMPTY) return nCount; - nCount++; + ++nCount; } return -1; @@ -775,7 +763,7 @@ BOOL CLocalNav::LadderHit(Vector &vecSource, Vector &vecDest, TraceResult &tr) } /* <487eeb> ../cstrike/dlls/hostage/hostage_localnav.cpp:851 */ -void CLocalNav::Think(void) +void CLocalNav::Think() { EHANDLE hCallback; static cvar_t *sv_stepsize = NULL; @@ -872,11 +860,11 @@ void CLocalNav::RequestNav(CHostage *pCaller) } _queue[curr] = pCaller; - tot_inqueue++; + ++tot_inqueue; } /* <487e03> ../cstrike/dlls/hostage/hostage_localnav.cpp:964 */ -void CLocalNav::Reset(void) +void CLocalNav::Reset() { flNextCvarCheck = 0; flLastThinkTime = 0; @@ -887,9 +875,9 @@ void CLocalNav::Reset(void) } /* <487e14> ../cstrike/dlls/hostage/hostage_localnav.cpp:976 */ -void CLocalNav::HostagePrethink(void) +void CLocalNav::HostagePrethink() { - for (int iCount = 0; iCount < tot_hostages; iCount++) + for (int iCount = 0; iCount < tot_hostages; ++iCount) { if (hostages[ iCount ] != NULL) { diff --git a/regamedll/dlls/hostage/hostage_localnav.h b/regamedll/dlls/hostage/hostage_localnav.h index 3d182de9..4824f128 100644 --- a/regamedll/dlls/hostage/hostage_localnav.h +++ b/regamedll/dlls/hostage/hostage_localnav.h @@ -52,23 +52,8 @@ typedef struct localnode_s node_index_t nindexParent; } localnode_t; -/* size: 32, cachelines: 1, members: 6 */ -#ifdef HOOK_GAMEDLL - -#define s_flStepSize_LocalNav (*m_LocalNav->ps_flStepSize) - -#define flNextCvarCheck (*pflNextCvarCheck) -#define s_flStepSize (*ps_flStepSize) -#define flLastThinkTime (*pflLastThinkTime) -#define nodeval (*pnodeval) -#define tot_hostages (*ptot_hostages) -#define tot_inqueue (*ptot_inqueue) -#define qptr (*pqptr) -#define _queue (*pqueue) -#define hostages (*phostages) - -#else +#ifndef HOOK_GAMEDLL #define s_flStepSize_LocalNav m_LocalNav->s_flStepSize @@ -79,7 +64,7 @@ class CLocalNav { public: CLocalNav(CHostage *pOwner); - virtual ~CLocalNav(void); + virtual ~CLocalNav(); void SetTargetEnt(CBaseEntity *pTarget) { @@ -112,10 +97,10 @@ public: node_index_t FindDirectPath(Vector &vecStart, Vector &vecDest, float flTargetRadius, int fNoMonsters); BOOL LadderHit(Vector &vecSource, Vector &vecDest, TraceResult &tr); - static void Think(void); + static void Think(); static void RequestNav(CHostage *pCaller); - static void Reset(void); - static void HostagePrethink(void); + static void Reset(); + static void HostagePrethink(); static float s_flStepSize; #ifndef HOOK_GAMEDLL @@ -141,14 +126,6 @@ private: localnode_t *m_nodeArr; node_index_t m_nindexAvailableNode; Vector m_vecStartingLoc; - -};/* size: 36, cachelines: 1, members: 16 */ - -#ifdef HOOK_GAMEDLL - -typedef BOOL (CLocalNav::*PATH_CLEAR_TRACE_RESULT)(Vector &, Vector &, int, TraceResult &); -typedef BOOL (CLocalNav::*PATH_CLEAR_DEFAULT)(Vector &, Vector &, int); - -#endif // HOOK_GAMEDLL +}; #endif // HOSTAGE_LOCALNAV_H diff --git a/regamedll/dlls/hostage/hostage_states.h b/regamedll/dlls/hostage/hostage_states.h index 73a0673d..ae388482 100644 --- a/regamedll/dlls/hostage/hostage_states.h +++ b/regamedll/dlls/hostage/hostage_states.h @@ -38,10 +38,9 @@ class CHostageImprov; class HostageState: public SimpleState, public IImprovEvent { public: - virtual ~HostageState(void) {}; + virtual ~HostageState() {}; virtual void UpdateStationaryAnimation(CHostageImprov *improv) {}; - -};/* size: 12, cachelines: 1, members: 2 */ +}; /* <46f922> ../cstrike/dlls/hostage/hostage_states.h:26 */ class HostageStateMachine: public SimpleStateMachine, public IImprovEvent @@ -67,19 +66,18 @@ public: if (m_state) m_state->UpdateStationaryAnimation(improv); } - -};/* size: 16, cachelines: 1, members: 2 */ +}; /* <46fccf> ../cstrike/dlls/hostage/hostage_states.h:38 */ class HostageIdleState: public HostageState { public: - virtual ~HostageIdleState(void) {}; + virtual ~HostageIdleState() {}; virtual void OnEnter(CHostageImprov *improv); virtual void OnUpdate(CHostageImprov *improv); virtual void OnExit(CHostageImprov *improv); - virtual const char *GetName(void) const { return "Idle"; } + virtual const char *GetName() const { return "Idle"; } virtual void UpdateStationaryAnimation(CHostageImprov *improv); virtual void OnMoveToSuccess(const Vector &goal) { m_moveState = MoveDone; } virtual void OnMoveToFailure(const Vector &goal, MoveToFailureType reason) { m_moveState = MoveFailed; } @@ -112,19 +110,18 @@ private: } m_moveState; bool m_mustFlee; - -};/* size: 72, cachelines: 2, members: 10 */ +}; /* <46f8ec> ../cstrike/dlls/hostage/hostage_states.h:71 */ class HostageEscapeToCoverState: public HostageState { public: - virtual ~HostageEscapeToCoverState(void) {}; + virtual ~HostageEscapeToCoverState() {}; virtual void OnEnter(CHostageImprov *improv); virtual void OnUpdate(CHostageImprov *improv); virtual void OnExit(CHostageImprov *improv); - virtual const char *GetName(void) const { return "Escape:ToCover"; } + virtual const char *GetName() const { return "Escape:ToCover"; } virtual void OnMoveToFailure(const Vector &goal, MoveToFailureType reason); #ifdef HOOK_GAMEDLL @@ -143,19 +140,18 @@ private: Vector m_rescueGoal; Vector m_spot; bool m_canEscape; - -};/* size: 40, cachelines: 1, members: 4 */ +}; /* <46f907> ../cstrike/dlls/hostage/hostage_states.h:92 */ class HostageEscapeLookAroundState: public HostageState { public: - virtual ~HostageEscapeLookAroundState(void) {}; + virtual ~HostageEscapeLookAroundState() {}; virtual void OnEnter(CHostageImprov *improv); virtual void OnUpdate(CHostageImprov *improv); virtual void OnExit(CHostageImprov *improv); - virtual const char *GetName(void) const { return "Escape:LookAround"; } + virtual const char *GetName() const { return "Escape:LookAround"; } #ifdef HOOK_GAMEDLL @@ -167,19 +163,23 @@ public: private: CountdownTimer m_timer; - -};/* size: 20, cachelines: 1, members: 2 */ +}; /* <46fcea> ../cstrike/dlls/hostage/hostage_states.h:109 */ class HostageEscapeState: public HostageState { public: - virtual ~HostageEscapeState(void) {}; + HostageEscapeState() + { + m_toCoverState.SetParent(this); + m_lookAroundState.SetParent(this); + } + virtual ~HostageEscapeState() {}; virtual void OnEnter(CHostageImprov *improv); virtual void OnUpdate(CHostageImprov *improv); virtual void OnExit(CHostageImprov *improv); - virtual const char *GetName(void) const { return "Escape"; } + virtual const char *GetName() const { return "Escape"; } virtual void OnMoveToFailure(const Vector &goal, MoveToFailureType reason) { m_behavior.OnMoveToFailure(goal, reason); } #ifdef HOOK_GAMEDLL @@ -191,8 +191,8 @@ public: #endif // HOOK_GAMEDLL public: - void ToCover(void) { m_behavior.SetState(&m_toCoverState); } - void LookAround(void) { m_behavior.SetState(&m_lookAroundState); } + void ToCover() { m_behavior.SetState(&m_toCoverState); } + void LookAround() { m_behavior.SetState(&m_lookAroundState); } private: HostageEscapeToCoverState m_toCoverState; @@ -200,19 +200,18 @@ private: HostageStateMachine m_behavior; bool m_canEscape; CountdownTimer m_runTimer; - -};/* size: 100, cachelines: 2, members: 6 */ +}; /* <46fd03> ../cstrike/dlls/hostage/hostage_states.h:138 */ class HostageRetreatState: public HostageState { public: - virtual ~HostageRetreatState(void) {}; + virtual ~HostageRetreatState() {}; virtual void OnEnter(CHostageImprov *improv); virtual void OnUpdate(CHostageImprov *improv); virtual void OnExit(CHostageImprov *improv); - virtual const char *GetName(void) const { return "Retreat"; } + virtual const char *GetName() const { return "Retreat"; } #ifdef HOOK_GAMEDLL @@ -222,18 +221,18 @@ public: #endif // HOOK_GAMEDLL -};/* size: 12, cachelines: 1, members: 1 */ +}; /* <46fd1e> ../cstrike/dlls/hostage/hostage_states.h:149 */ class HostageFollowState: public HostageState { public: - virtual ~HostageFollowState(void) {}; + virtual ~HostageFollowState() {}; virtual void OnEnter(CHostageImprov *improv); virtual void OnUpdate(CHostageImprov *improv); virtual void OnExit(CHostageImprov *improv); - virtual const char *GetName(void) const { return "Follow"; } + virtual const char *GetName() const { return "Follow"; } virtual void UpdateStationaryAnimation(CHostageImprov *improv); #ifdef HOOK_GAMEDLL @@ -247,7 +246,7 @@ public: public: void SetLeader(CBaseEntity *leader) { m_leader = leader; } - CBaseEntity *GetLeader(void) const { return m_leader; } + CBaseEntity *GetLeader() const { return m_leader; } private: mutable EHANDLE m_leader; @@ -259,19 +258,18 @@ private: CountdownTimer m_repathTimer; bool m_isWaitingForFriend; CountdownTimer m_waitForFriendTimer; - -};/* size: 76, cachelines: 2, members: 10 */ +}; /* <46fd39> ../cstrike/dlls/hostage/hostage_states.h:186 */ class HostageAnimateState: public HostageState { public: - virtual ~HostageAnimateState(void) {} + virtual ~HostageAnimateState() {} virtual void OnEnter(CHostageImprov *improv); virtual void OnUpdate(CHostageImprov *improv); virtual void OnExit(CHostageImprov *improv); - virtual const char *GetName(void) const { return "Animate"; } + virtual const char *GetName() const { return "Animate"; } #ifdef HOOK_GAMEDLL @@ -309,30 +307,18 @@ public: Flinching, }; - void Reset(void); + void Reset(); void AddSequence(CHostageImprov *improv, const char *seqName, float holdTime = -1.0f, float rate = 1.0f); void AddSequence(CHostageImprov *improv, int activity, float holdTime = -1.0f, float rate = 1.0f); - bool IsBusy(void) const - { - return (m_sequenceCount > 0); - } + bool IsBusy() const { return (m_sequenceCount > 0); } NOXREF bool IsPlaying(CHostageImprov *improv, const char *seqName) const; - int GetCurrentSequenceID(void) - { - return m_currentSequence; - } - PerformanceType GetPerformance(void) const - { - return m_performance; - } - void SetPerformance(PerformanceType performance) - { - m_performance = performance; - } + int GetCurrentSequenceID() { return m_currentSequence; } + PerformanceType GetPerformance() const { return m_performance; } + void SetPerformance(PerformanceType performance) { m_performance = performance; } void StartSequence(CHostageImprov *improv, const SeqInfo *seqInfo); - bool IsDoneHolding(void); - + bool IsDoneHolding(); + private: enum { MAX_SEQUENCES = 8 }; struct SeqInfo m_sequence[ MAX_SEQUENCES ]; @@ -341,14 +327,6 @@ private: enum PerformanceType m_performance; bool m_isHolding; CountdownTimer m_holdTimer; - -};/* size: 132, cachelines: 3, members: 7 */ - -#ifdef HOOK_GAMEDLL - -typedef void (HostageAnimateState::*ADD_SEQUENCE_NAME)(CHostageImprov *, const char *, float, float); -typedef void (HostageAnimateState::*ADD_SEQUENCE_NUMBER)(CHostageImprov *, int, float, float); - -#endif // HOOK_GAMEDLL +}; #endif // HOSTAGE_STATES_H diff --git a/regamedll/dlls/hostage/states/hostage_animate.cpp b/regamedll/dlls/hostage/states/hostage_animate.cpp index 708742c7..40886d4d 100644 --- a/regamedll/dlls/hostage/states/hostage_animate.cpp +++ b/regamedll/dlls/hostage/states/hostage_animate.cpp @@ -1,7 +1,7 @@ #include "precompiled.h" /* <4110a1> ../cstrike/dlls/hostage/states/hostage_animate.cpp:13 */ -void HostageAnimateState::Reset(void) +void HostageAnimateState::Reset() { m_sequenceCount = 0; m_performance = None; @@ -68,7 +68,7 @@ void HostageAnimateState::AddSequence(CHostageImprov *improv, int activity, floa } /* <41127f> ../cstrike/dlls/hostage/states/hostage_animate.cpp:81 */ -bool HostageAnimateState::IsDoneHolding(void) +bool HostageAnimateState::IsDoneHolding() { if (m_sequence[m_currentSequence].holdTime < 0) return true; @@ -133,22 +133,3 @@ NOXREF bool HostageAnimateState::IsPlaying(CHostageImprov *improv, const char *s return LookupSequence(hostage, seqName) == id; } - -#ifdef HOOK_GAMEDLL - -void HostageAnimateState::OnEnter(CHostageImprov *improv) -{ - OnEnter_(improv); -} - -void HostageAnimateState::OnUpdate(CHostageImprov *improv) -{ - OnUpdate_(improv); -} - -void HostageAnimateState::OnExit(CHostageImprov *improv) -{ - OnExit_(improv); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/hostage/states/hostage_escape.cpp b/regamedll/dlls/hostage/states/hostage_escape.cpp index b409fe44..ac052af3 100644 --- a/regamedll/dlls/hostage/states/hostage_escape.cpp +++ b/regamedll/dlls/hostage/states/hostage_escape.cpp @@ -52,7 +52,7 @@ void HostageEscapeToCoverState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv) if (spot == NULL) { - HostageEscapeState *escape = (HostageEscapeState *)GetParent(); + HostageEscapeState *escape = static_cast(GetParent()); escape->LookAround(); return; } @@ -63,7 +63,7 @@ void HostageEscapeToCoverState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv) if (improv->IsAtMoveGoal()) { - HostageEscapeState *escape = (HostageEscapeState *)GetParent(); + HostageEscapeState *escape = static_cast(GetParent()); escape->LookAround(); return; } @@ -76,18 +76,13 @@ void HostageEscapeToCoverState::__MAKE_VHOOK(OnExit)(CHostageImprov *improv) } /* <41faaf> ../cstrike/dlls/hostage/states/hostage_escape.cpp:100 */ +#ifndef HOOK_GAMEDLL void HostageEscapeToCoverState::__MAKE_VHOOK(OnMoveToFailure)(const Vector &goal, MoveToFailureType reason) { -#ifndef HOOK_GAMEDLL - HostageEscapeState *escape = (HostageEscapeState *)GetParent(); -#else - // TODO: why this - 1? Hacks? - // need investigation - HostageEscapeState *escape = (HostageEscapeState *)*((int *)this - 1); -#endif // HOOK_GAMEDLL - + HostageEscapeState *escape = static_cast(GetParent()); escape->LookAround(); } +#endif // HOOK_GAMEDLL /* <41fa2f> ../cstrike/dlls/hostage/states/hostage_escape.cpp:110 */ void HostageEscapeLookAroundState::__MAKE_VHOOK(OnEnter)(CHostageImprov *improv) @@ -105,7 +100,7 @@ void HostageEscapeLookAroundState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv if (m_timer.IsElapsed()) { - HostageEscapeState *escape = (HostageEscapeState *)GetParent(); + HostageEscapeState *escape = static_cast(GetParent()); escape->ToCover(); } } @@ -186,57 +181,3 @@ void HostageEscapeState::__MAKE_VHOOK(OnExit)(CHostageImprov *improv) { improv->Run(); } - -#ifdef HOOK_GAMEDLL - -void HostageEscapeToCoverState::OnEnter(CHostageImprov *improv) -{ - OnEnter_(improv); -} - -void HostageEscapeToCoverState::OnUpdate(CHostageImprov *improv) -{ - OnUpdate_(improv); -} - -void HostageEscapeToCoverState::OnExit(CHostageImprov *improv) -{ - OnExit_(improv); -} - -void HostageEscapeToCoverState::OnMoveToFailure(const Vector &goal, MoveToFailureType reason) -{ - OnMoveToFailure_(goal, reason); -} - -void HostageEscapeLookAroundState::OnEnter(CHostageImprov *improv) -{ - OnEnter_(improv); -} - -void HostageEscapeLookAroundState::OnUpdate(CHostageImprov *improv) -{ - OnUpdate_(improv); -} - -void HostageEscapeLookAroundState::OnExit(CHostageImprov *improv) -{ - OnExit_(improv); -} - -void HostageEscapeState::OnEnter(CHostageImprov *improv) -{ - OnEnter_(improv); -} - -void HostageEscapeState::OnUpdate(CHostageImprov *improv) -{ - OnUpdate_(improv); -} - -void HostageEscapeState::OnExit(CHostageImprov *improv) -{ - OnExit_(improv); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/hostage/states/hostage_follow.cpp b/regamedll/dlls/hostage/states/hostage_follow.cpp index 02d849e2..b34a83a1 100644 --- a/regamedll/dlls/hostage/states/hostage_follow.cpp +++ b/regamedll/dlls/hostage/states/hostage_follow.cpp @@ -208,27 +208,3 @@ void HostageFollowState::__MAKE_VHOOK(UpdateStationaryAnimation)(CHostageImprov else improv->UpdateIdleActivity(ACT_FOLLOW_IDLE, ACT_FOLLOW_IDLE_FIDGET); } - -#ifdef HOOK_GAMEDLL - -void HostageFollowState::OnEnter(CHostageImprov *improv) -{ - OnEnter_(improv); -} - -void HostageFollowState::OnUpdate(CHostageImprov *improv) -{ - OnUpdate_(improv); -} - -void HostageFollowState::OnExit(CHostageImprov *improv) -{ - OnExit_(improv); -} - -void HostageFollowState::UpdateStationaryAnimation(CHostageImprov *improv) -{ - UpdateStationaryAnimation_(improv); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/hostage/states/hostage_idle.cpp b/regamedll/dlls/hostage/states/hostage_idle.cpp index 0b9a41bc..a5bf40ef 100644 --- a/regamedll/dlls/hostage/states/hostage_idle.cpp +++ b/regamedll/dlls/hostage/states/hostage_idle.cpp @@ -255,27 +255,3 @@ void HostageIdleState::__MAKE_VHOOK(UpdateStationaryAnimation)(CHostageImprov *i else improv->UpdateIdleActivity(ACT_IDLE_SNEAKY, ACT_IDLE_SNEAKY_FIDGET); } - -#ifdef HOOK_GAMEDLL - -void HostageIdleState::OnEnter(CHostageImprov *improv) -{ - OnEnter_(improv); -} - -void HostageIdleState::OnUpdate(CHostageImprov *improv) -{ - OnUpdate_(improv); -} - -void HostageIdleState::OnExit(CHostageImprov *improv) -{ - OnExit_(improv); -} - -void HostageIdleState::UpdateStationaryAnimation(CHostageImprov *improv) -{ - UpdateStationaryAnimation_(improv); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/hostage/states/hostage_retreat.cpp b/regamedll/dlls/hostage/states/hostage_retreat.cpp index 7b92f980..787815d6 100644 --- a/regamedll/dlls/hostage/states/hostage_retreat.cpp +++ b/regamedll/dlls/hostage/states/hostage_retreat.cpp @@ -44,22 +44,3 @@ void HostageRetreatState::__MAKE_VHOOK(OnExit)(CHostageImprov *improv) { ; } - -#ifdef HOOK_GAMEDLL - -void HostageRetreatState::OnEnter(CHostageImprov *improv) -{ - OnEnter_(improv); -} - -void HostageRetreatState::OnUpdate(CHostageImprov *improv) -{ - OnUpdate_(improv); -} - -void HostageRetreatState::OnExit(CHostageImprov *improv) -{ - OnExit_(improv); -} - -#endif // HOOK_GAMEDLL \ No newline at end of file diff --git a/regamedll/dlls/items.cpp b/regamedll/dlls/items.cpp index 7bb54fdd..bcdfe6be 100644 --- a/regamedll/dlls/items.cpp +++ b/regamedll/dlls/items.cpp @@ -16,7 +16,7 @@ void CWorldItem::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) } /* ../cstrike/dlls/items.cpp:59 */ -void CWorldItem::__MAKE_VHOOK(Spawn)(void) +void CWorldItem::__MAKE_VHOOK(Spawn)() { CBaseEntity *pEntity = NULL; @@ -49,7 +49,7 @@ void CWorldItem::__MAKE_VHOOK(Spawn)(void) } /* ../cstrike/dlls/items.cpp:94 */ -void CItem::__MAKE_VHOOK(Spawn)(void) +void CItem::__MAKE_VHOOK(Spawn)() { pev->movetype = MOVETYPE_TOSS; pev->solid = SOLID_TRIGGER; @@ -93,7 +93,7 @@ void CItem::ItemTouch(CBaseEntity *pOther) } /* ../cstrike/dlls/items.cpp:154 */ -CBaseEntity *CItem::__MAKE_VHOOK(Respawn)(void) +CBaseEntity *CItem::__MAKE_VHOOK(Respawn)() { SetTouch(NULL); @@ -109,7 +109,7 @@ CBaseEntity *CItem::__MAKE_VHOOK(Respawn)(void) } /* ../cstrike/dlls/items.cpp:166 */ -void CItem::Materialize(void) +void CItem::Materialize() { if (pev->effects & EF_NODRAW) { @@ -124,7 +124,7 @@ void CItem::Materialize(void) } /* ../cstrike/dlls/items.cpp:190 */ -void CItemSuit::__MAKE_VHOOK(Spawn)(void) +void CItemSuit::__MAKE_VHOOK(Spawn)() { Precache(); SET_MODEL(ENT(pev), "models/w_kevlar.mdl"); @@ -132,7 +132,7 @@ void CItemSuit::__MAKE_VHOOK(Spawn)(void) } /* ../cstrike/dlls/items.cpp:196 */ -void CItemSuit::__MAKE_VHOOK(Precache)(void) +void CItemSuit::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/w_kevlar.mdl"); PRECACHE_SOUND("items/tr_kevlar.wav"); @@ -156,7 +156,7 @@ BOOL CItemSuit::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer) LINK_ENTITY_TO_CLASS(item_suit, CItemSuit); /* ../cstrike/dlls/items.cpp:221 */ -void CItemBattery::__MAKE_VHOOK(Spawn)(void) +void CItemBattery::__MAKE_VHOOK(Spawn)() { Precache(); SET_MODEL(ENT(pev), "models/w_battery.mdl"); @@ -164,7 +164,7 @@ void CItemBattery::__MAKE_VHOOK(Spawn)(void) } /* ../cstrike/dlls/items.cpp:227 */ -void CItemBattery::__MAKE_VHOOK(Precache)(void) +void CItemBattery::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/w_battery.mdl"); PRECACHE_SOUND("items/gunpickup2.wav"); @@ -189,7 +189,7 @@ BOOL CItemBattery::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer) // Suit reports new power level // For some reason this wasn't working in release build -- round it. - pct = (int)((float)(pPlayer->pev->armorvalue * 100.0) * (1.0 / MAX_NORMAL_BATTERY) + 0.5); + pct = (int)((float)(pPlayer->pev->armorvalue * 100.0f) * (1.0f / MAX_NORMAL_BATTERY) + 0.5f); pct = (pct / 5); if (pct > 0) @@ -207,7 +207,7 @@ BOOL CItemBattery::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer) LINK_ENTITY_TO_CLASS(item_battery, CItemBattery); /* ../cstrike/dlls/items.cpp:271 */ -void CItemAntidote::__MAKE_VHOOK(Spawn)(void) +void CItemAntidote::__MAKE_VHOOK(Spawn)() { Precache(); SET_MODEL(ENT(pev), "models/w_antidote.mdl"); @@ -215,7 +215,7 @@ void CItemAntidote::__MAKE_VHOOK(Spawn)(void) } /* ../cstrike/dlls/items.cpp:277 */ -void CItemAntidote::__MAKE_VHOOK(Precache)(void) +void CItemAntidote::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/w_antidote.mdl"); } @@ -233,7 +233,7 @@ BOOL CItemAntidote::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer) LINK_ENTITY_TO_CLASS(item_antidote, CItemAntidote); /* ../cstrike/dlls/items.cpp:295 */ -void CItemSecurity::__MAKE_VHOOK(Spawn)(void) +void CItemSecurity::__MAKE_VHOOK(Spawn)() { Precache(); SET_MODEL(ENT(pev), "models/w_security.mdl"); @@ -241,7 +241,7 @@ void CItemSecurity::__MAKE_VHOOK(Spawn)(void) } /* ../cstrike/dlls/items.cpp:301 */ -void CItemSecurity::__MAKE_VHOOK(Precache)(void) +void CItemSecurity::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/w_security.mdl"); } @@ -257,7 +257,7 @@ BOOL CItemSecurity::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer) LINK_ENTITY_TO_CLASS(item_security, CItemSecurity); /* ../cstrike/dlls/items.cpp:316 */ -void CItemLongJump::__MAKE_VHOOK(Spawn)(void) +void CItemLongJump::__MAKE_VHOOK(Spawn)() { Precache(); SET_MODEL(ENT(pev), "models/w_longjump.mdl"); @@ -265,7 +265,7 @@ void CItemLongJump::__MAKE_VHOOK(Spawn)(void) } /* ../cstrike/dlls/items.cpp:322 */ -void CItemLongJump::__MAKE_VHOOK(Precache)(void) +void CItemLongJump::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/w_longjump.mdl"); } @@ -298,7 +298,7 @@ BOOL CItemLongJump::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer) LINK_ENTITY_TO_CLASS(item_longjump, CItemLongJump); /* ../cstrike/dlls/items.cpp:354 */ -void CItemKevlar::__MAKE_VHOOK(Spawn)(void) +void CItemKevlar::__MAKE_VHOOK(Spawn)() { Precache(); SET_MODEL(ENT(pev), "models/w_kevlar.mdl"); @@ -306,7 +306,7 @@ void CItemKevlar::__MAKE_VHOOK(Spawn)(void) } /* ../cstrike/dlls/items.cpp:360 */ -void CItemKevlar::__MAKE_VHOOK(Precache)(void) +void CItemKevlar::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/w_kevlar.mdl"); } @@ -340,7 +340,7 @@ BOOL CItemKevlar::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer) LINK_ENTITY_TO_CLASS(item_kevlar, CItemKevlar); /* ../cstrike/dlls/items.cpp:395 */ -void CItemAssaultSuit::__MAKE_VHOOK(Spawn)(void) +void CItemAssaultSuit::__MAKE_VHOOK(Spawn)() { Precache(); SET_MODEL(ENT(pev), "models/w_assault.mdl"); @@ -348,7 +348,7 @@ void CItemAssaultSuit::__MAKE_VHOOK(Spawn)(void) } /* ../cstrike/dlls/items.cpp:401 */ -void CItemAssaultSuit::__MAKE_VHOOK(Precache)(void) +void CItemAssaultSuit::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/w_assault.mdl"); } @@ -381,7 +381,7 @@ BOOL CItemAssaultSuit::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer) LINK_ENTITY_TO_CLASS(item_assaultsuit, CItemAssaultSuit); /* ../cstrike/dlls/items.cpp:434 */ -void CItemThighPack::__MAKE_VHOOK(Spawn)(void) +void CItemThighPack::__MAKE_VHOOK(Spawn)() { Precache(); SET_MODEL(ENT(pev), "models/w_thighpack.mdl"); @@ -389,7 +389,7 @@ void CItemThighPack::__MAKE_VHOOK(Spawn)(void) } /* ../cstrike/dlls/items.cpp:440 */ -void CItemThighPack::__MAKE_VHOOK(Precache)(void) +void CItemThighPack::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/w_thighpack.mdl"); } @@ -426,147 +426,3 @@ BOOL CItemThighPack::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer) /* ../cstrike/dlls/items.cpp:474 */ LINK_ENTITY_TO_CLASS(item_thighpack, CItemThighPack); - -#ifdef HOOK_GAMEDLL - -void CItem::Spawn(void) -{ - Spawn_(); -} - -CBaseEntity *CItem::Respawn(void) -{ - return Respawn_(); -} - -void CWorldItem::Spawn(void) -{ - Spawn_(); -} - -void CWorldItem::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -void CItemSuit::Spawn(void) -{ - Spawn_(); -} - -void CItemSuit::Precache(void) -{ - Precache_(); -} - -BOOL CItemSuit::MyTouch(CBasePlayer *pPlayer) -{ - return MyTouch_(pPlayer); -} - -void CItemBattery::Spawn(void) -{ - Spawn_(); -} - -void CItemBattery::Precache(void) -{ - Precache_(); -} - -BOOL CItemBattery::MyTouch(CBasePlayer *pPlayer) -{ - return MyTouch_(pPlayer); -} - -void CItemAntidote::Spawn(void) -{ - Spawn_(); -} - -void CItemAntidote::Precache(void) -{ - Precache_(); -} - -BOOL CItemAntidote::MyTouch(CBasePlayer *pPlayer) -{ - return MyTouch_(pPlayer); -} - -void CItemSecurity::Spawn(void) -{ - Spawn_(); -} - -void CItemSecurity::Precache(void) -{ - Precache_(); -} - -BOOL CItemSecurity::MyTouch(CBasePlayer *pPlayer) -{ - return MyTouch_(pPlayer); -} - -void CItemLongJump::Spawn(void) -{ - Spawn_(); -} - -void CItemLongJump::Precache(void) -{ - Precache_(); -} - -BOOL CItemLongJump::MyTouch(CBasePlayer *pPlayer) -{ - return MyTouch_(pPlayer); -} - -void CItemKevlar::Spawn(void) -{ - Spawn_(); -} - -void CItemKevlar::Precache(void) -{ - Precache_(); -} - -BOOL CItemKevlar::MyTouch(CBasePlayer *pPlayer) -{ - return MyTouch_(pPlayer); -} - -void CItemAssaultSuit::Spawn(void) -{ - Spawn_(); -} - -void CItemAssaultSuit::Precache(void) -{ - Precache_(); -} - -BOOL CItemAssaultSuit::MyTouch(CBasePlayer *pPlayer) -{ - return MyTouch_(pPlayer); -} - -void CItemThighPack::Spawn(void) -{ - Spawn_(); -} - -void CItemThighPack::Precache(void) -{ - Precache_(); -} - -BOOL CItemThighPack::MyTouch(CBasePlayer *pPlayer) -{ - return MyTouch_(pPlayer); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/items.h b/regamedll/dlls/items.h index a2def420..3ca049f3 100644 --- a/regamedll/dlls/items.h +++ b/regamedll/dlls/items.h @@ -43,187 +43,182 @@ class CItem: public CBaseEntity { public: - virtual void Spawn(void); - virtual CBaseEntity *Respawn(void); - virtual BOOL MyTouch(CBasePlayer *pPlayer) - { - return FALSE; - } + virtual void Spawn(); + virtual CBaseEntity *Respawn(); + virtual BOOL MyTouch(CBasePlayer *pPlayer) { return FALSE;} #ifdef HOOK_GAMEDLL - void Spawn_(void); - CBaseEntity *Respawn_(void); + void Spawn_(); + CBaseEntity *Respawn_(); #endif // HOOK_GAMEDLL public: void EXPORT ItemTouch(CBaseEntity *pOther); - void EXPORT Materialize(void); - -};/* size: 152, cachelines: 3, members: 1 */ + void EXPORT Materialize(); +}; /* ../cstrike/dlls/items.cpp:38 */ class CWorldItem: public CBaseEntity { public: - virtual void Spawn(void); + virtual void Spawn(); virtual void KeyValue(KeyValueData *pkvd); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); void KeyValue_(KeyValueData *pkvd); #endif // HOOK_GAMEDLL public: int m_iType; - -};/* size: 156, cachelines: 3, members: 2 */ +}; /* ../cstrike/dlls/items.cpp:188 */ class CItemSuit: public CItem { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual BOOL MyTouch(CBasePlayer *pPlayer); #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); BOOL MyTouch_(CBasePlayer *pPlayer); #endif // HOOK_GAMEDLL -};/* size: 152, cachelines: 3, members: 1 */ +}; /* ../cstrike/dlls/items.cpp:219 */ class CItemBattery: public CItem { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual BOOL MyTouch(CBasePlayer *pPlayer); #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); BOOL MyTouch_(CBasePlayer *pPlayer); #endif // HOOK_GAMEDLL -};/* size: 152, cachelines: 3, members: 1 */ +}; /* ../cstrike/dlls/items.cpp:269 */ class CItemAntidote: public CItem { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual BOOL MyTouch(CBasePlayer *pPlayer); #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); BOOL MyTouch_(CBasePlayer *pPlayer); #endif // HOOK_GAMEDLL -};/* size: 152, cachelines: 3, members: 1 */ +}; /* ../cstrike/dlls/items.cpp:293 */ class CItemSecurity: public CItem { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual BOOL MyTouch(CBasePlayer *pPlayer); #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); BOOL MyTouch_(CBasePlayer *pPlayer); #endif // HOOK_GAMEDLL -};/* size: 152, cachelines: 3, members: 1 */ +}; /* ../cstrike/dlls/items.cpp:314 */ class CItemLongJump: public CItem { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual BOOL MyTouch(CBasePlayer *pPlayer); #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); BOOL MyTouch_(CBasePlayer *pPlayer); #endif // HOOK_GAMEDLL -};/* size: 152, cachelines: 3, members: 1 */ +}; /* ../cstrike/dlls/items.cpp:352 */ class CItemKevlar: public CItem { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual BOOL MyTouch(CBasePlayer *pPlayer); #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); BOOL MyTouch_(CBasePlayer *pPlayer); #endif // HOOK_GAMEDLL -};/* size: 152, cachelines: 3, members: 1 */ +}; /* ../cstrike/dlls/items.cpp:393 */ class CItemAssaultSuit: public CItem { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual BOOL MyTouch(CBasePlayer *pPlayer); #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); BOOL MyTouch_(CBasePlayer *pPlayer); #endif // HOOK_GAMEDLL -};/* size: 152, cachelines: 3, members: 1 */ +}; /* ../cstrike/dlls/items.cpp:432 */ class CItemThighPack: public CItem { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual BOOL MyTouch(CBasePlayer *pPlayer); #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); BOOL MyTouch_(CBasePlayer *pPlayer); #endif // HOOK_GAMEDLL -};/* size: 152, cachelines: 3, members: 1 */ +}; #endif // ITEMS_H diff --git a/regamedll/dlls/lights.cpp b/regamedll/dlls/lights.cpp index 46b7dab1..432a056a 100644 --- a/regamedll/dlls/lights.cpp +++ b/regamedll/dlls/lights.cpp @@ -11,10 +11,6 @@ TYPEDESCRIPTION CLight::m_SaveData[] = DEFINE_FIELD(CLight, m_iszPattern, FIELD_STRING), }; -#else - -TYPEDESCRIPTION IMPL_CLASS(CLight, m_SaveData)[2]; - #endif // HOOK_GAMEDLL /* ../cstrike/dlls/lights.cpp:48 */ @@ -48,7 +44,7 @@ void CLight::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) } /* ../cstrike/dlls/lights.cpp:92 */ -void CLight::__MAKE_VHOOK(Spawn)(void) +void CLight::__MAKE_VHOOK(Spawn)() { // inert light if (FStringNull(pev->targetname)) @@ -72,7 +68,7 @@ void CLight::__MAKE_VHOOK(Spawn)(void) } /* ../cstrike/dlls/lights.cpp:117 */ -void CLight::__MAKE_VHOOK(Restart)(void) +void CLight::__MAKE_VHOOK(Restart)() { if (m_iStyle >= 32) { @@ -162,7 +158,7 @@ void CEnvLight::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) } /* ../cstrike/dlls/lights.cpp:215 */ -void CEnvLight::__MAKE_VHOOK(Spawn)(void) +void CEnvLight::__MAKE_VHOOK(Spawn)() { #if defined(HOOK_GAMEDLL) // NOTE: fix negative the values for function sprintf from STD C++: @@ -188,47 +184,3 @@ void CEnvLight::__MAKE_VHOOK(Spawn)(void) CLight::Spawn(); } - -#ifdef HOOK_GAMEDLL - -void CLight::Spawn(void) -{ - Spawn_(); -} - -void CLight::Restart(void) -{ - Restart_(); -} - -int CLight::Save(CSave &save) -{ - return Save_(save); -} - -int CLight::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -void CLight::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -void CLight::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -void CEnvLight::Spawn(void) -{ - Spawn_(); -} - -void CEnvLight::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/lights.h b/regamedll/dlls/lights.h index ab8eafb5..75a90fa0 100644 --- a/regamedll/dlls/lights.h +++ b/regamedll/dlls/lights.h @@ -38,8 +38,8 @@ class CLight: public CPointEntity { 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 void KeyValue(KeyValueData *pkvd); @@ -47,8 +47,8 @@ public: #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Restart_(void); + void Spawn_(); + void Restart_(); int Save_(CSave &save); int Restore_(CRestore &restore); void KeyValue_(KeyValueData *pkvd); @@ -62,23 +62,22 @@ private: int m_iStyle; int m_iszPattern; BOOL m_iStartedOff; - -};/* size: 164, cachelines: 3, members: 5 */ +}; /* ../cstrike/dlls/lights.cpp:168 */ class CEnvLight: public CLight { public: - virtual void Spawn(void); + virtual void Spawn(); virtual void KeyValue(KeyValueData *pkvd); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); void KeyValue_(KeyValueData *pkvd); #endif // HOOK_GAMEDLL -};/* size: 164, cachelines: 3, members: 1 */ +}; #endif // LIGHT_H diff --git a/regamedll/dlls/maprules.cpp b/regamedll/dlls/maprules.cpp index 00825682..7c130379 100644 --- a/regamedll/dlls/maprules.cpp +++ b/regamedll/dlls/maprules.cpp @@ -25,19 +25,13 @@ TYPEDESCRIPTION CGamePlayerZone::m_SaveData[] = DEFINE_FIELD(CGamePlayerZone, m_iszOutCount, FIELD_STRING), }; -#else - -TYPEDESCRIPTION IMPL_CLASS(CRuleEntity, m_SaveData)[1]; -TYPEDESCRIPTION IMPL_CLASS(CGameText, m_SaveData)[1]; -TYPEDESCRIPTION IMPL_CLASS(CGamePlayerZone, m_SaveData)[4]; - #endif // HOOK_GAMEDLL /* ../cstrike/dlls/maprules.cpp:57 */ IMPLEMENT_SAVERESTORE(CRuleEntity, CBaseEntity); /* ../cstrike/dlls/maprules.cpp:60 */ -void CRuleEntity::__MAKE_VHOOK(Spawn)(void) +void CRuleEntity::__MAKE_VHOOK(Spawn)() { pev->solid = SOLID_NOT; pev->movetype = MOVETYPE_NONE; @@ -71,7 +65,7 @@ BOOL CRuleEntity::CanFireForActivator(CBaseEntity *pActivator) } /* ../cstrike/dlls/maprules.cpp:101 */ -void CRulePointEntity::__MAKE_VHOOK(Spawn)(void) +void CRulePointEntity::__MAKE_VHOOK(Spawn)() { CRuleEntity::Spawn(); pev->frame = 0; @@ -79,7 +73,7 @@ void CRulePointEntity::__MAKE_VHOOK(Spawn)(void) } /* ../cstrike/dlls/maprules.cpp:120 */ -void CRuleBrushEntity::__MAKE_VHOOK(Spawn)(void) +void CRuleBrushEntity::__MAKE_VHOOK(Spawn)() { SET_MODEL(edict(), STRING(pev->model)); CRuleEntity::Spawn(); @@ -89,7 +83,7 @@ void CRuleBrushEntity::__MAKE_VHOOK(Spawn)(void) LINK_ENTITY_TO_CLASS(game_score, CGameScore); /* ../cstrike/dlls/maprules.cpp:154 */ -void CGameScore::__MAKE_VHOOK(Spawn)(void) +void CGameScore::__MAKE_VHOOK(Spawn)() { CRulePointEntity::Spawn(); } @@ -306,7 +300,7 @@ BOOL CGameTeamMaster::__MAKE_VHOOK(IsTriggered)(CBaseEntity *pActivator) } /* ../cstrike/dlls/maprules.cpp:435 */ -const char *CGameTeamMaster::__MAKE_VHOOK(TeamID)(void) +const char *CGameTeamMaster::__MAKE_VHOOK(TeamID)() { // Currently set to "no team" if (m_teamIndex < 0) @@ -475,7 +469,7 @@ void CGamePlayerHurt::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pC LINK_ENTITY_TO_CLASS(game_counter, CGameCounter); /* ../cstrike/dlls/maprules.cpp:686 */ -void CGameCounter::__MAKE_VHOOK(Spawn)(void) +void CGameCounter::__MAKE_VHOOK(Spawn)() { // Save off the initial count SetInitialValue(CountValue()); @@ -584,7 +578,7 @@ void CGamePlayerEquip::EquipPlayer(CBaseEntity *pEntity) if (pEntity->IsPlayer()) { - pPlayer = reinterpret_cast(pEntity); + pPlayer = static_cast(pEntity); } if (!pPlayer) @@ -637,7 +631,7 @@ void CGamePlayerTeam::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pC if (pszTargetTeam != NULL) { - CBasePlayer *pPlayer = reinterpret_cast(pActivator); + CBasePlayer *pPlayer = static_cast(pActivator); g_pGameRules->ChangePlayerTeam(pPlayer, pszTargetTeam, ShouldKillPlayer(), ShouldGibPlayer()); } } @@ -647,162 +641,3 @@ void CGamePlayerTeam::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pC UTIL_Remove(this); } } - -#ifdef HOOK_GAMEDLL - -void CRuleEntity::Spawn(void) -{ - Spawn_(); -} - -void CRuleEntity::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -int CRuleEntity::Save(CSave &save) -{ - return Save_(save); -} - -int CRuleEntity::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -void CRulePointEntity::Spawn(void) -{ - Spawn_(); -} - -void CRuleBrushEntity::Spawn(void) -{ - Spawn_(); -} - -void CGameScore::Spawn(void) -{ - Spawn_(); -} - -void CGameScore::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -void CGameScore::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -void CGameEnd::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -void CGameText::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -int CGameText::Save(CSave &save) -{ - return Save_(save); -} - -int CGameText::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -void CGameText::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -void CGameTeamMaster::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -BOOL CGameTeamMaster::IsTriggered(CBaseEntity *pActivator) -{ - return IsTriggered_(pActivator); -} - -const char *CGameTeamMaster::TeamID(void) -{ - return TeamID_(); -} - -void CGameTeamMaster::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -void CGameTeamSet::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -void CGamePlayerZone::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -int CGamePlayerZone::Save(CSave &save) -{ - return Save_(save); -} - -int CGamePlayerZone::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -void CGamePlayerZone::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -void CGamePlayerHurt::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -void CGameCounter::Spawn(void) -{ - Spawn_(); -} - -void CGameCounter::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -void CGameCounterSet::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -void CGamePlayerEquip::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -void CGamePlayerEquip::Touch(CBaseEntity *pOther) -{ - Touch_(pOther); -} - -void CGamePlayerEquip::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -void CGamePlayerTeam::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/maprules.h b/regamedll/dlls/maprules.h index 7b135c83..a7e337f0 100644 --- a/regamedll/dlls/maprules.h +++ b/regamedll/dlls/maprules.h @@ -61,14 +61,14 @@ class CRuleEntity: 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); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); void KeyValue_(KeyValueData *pkvd); int Save_(CSave &save); int Restore_(CRestore &restore); @@ -87,8 +87,7 @@ protected: private: string_t m_iszMaster; - -};/* size: 156, cachelines: 3, members: 3 */ +}; // CRulePointEntity -- base class for all rule "point" entities (not brushes) @@ -96,15 +95,15 @@ private: class CRulePointEntity: public CRuleEntity { public: - virtual void Spawn(void); + virtual void Spawn(); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); #endif // HOOK_GAMEDLL -};/* size: 156, cachelines: 3, members: 1 */ +}; // CRuleBrushEntity -- base class for all rule "brush" entities (not brushes) // Default behavior is to set up like a trigger, invisible, but keep the model for volume testing @@ -113,15 +112,15 @@ public: class CRuleBrushEntity: public CRuleEntity { public: - virtual void Spawn(void); + virtual void Spawn(); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); #endif // HOOK_GAMEDLL -};/* size: 156, cachelines: 3, members: 1 */ +}; // CGameScore / game_score -- award points to player / team // Points +/- total @@ -132,37 +131,25 @@ public: class CGameScore: public CRulePointEntity { 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: - int Points(void) - { - return (int)(pev->frags); - } - BOOL AllowNegativeScore(void) - { - return pev->spawnflags & SF_SCORE_NEGATIVE; - } - BOOL AwardToTeam(void) - { - return pev->spawnflags & SF_SCORE_TEAM; - } - void SetPoints(int points) - { - pev->frags = points; - } + int Points() const { return (int)(pev->frags); } + BOOL AllowNegativeScore() { return pev->spawnflags & SF_SCORE_NEGATIVE; } + BOOL AwardToTeam() const { return pev->spawnflags & SF_SCORE_TEAM; } -};/* size: 156, cachelines: 3, members: 1 */ + void SetPoints(int points) { pev->frags = points; } +}; // CGameEnd / game_end -- Ends the game in MP @@ -178,7 +165,7 @@ public: #endif // HOOK_GAMEDLL -};/* size: 156, cachelines: 3, members: 1 */ +}; // CGameText / game_text -- NON-Localized HUD Message (use env_message to display a titles.txt message) // Flag: All players SF_ENVTEXT_ALLPLAYERS @@ -202,26 +189,16 @@ public: #endif // HOOK_GAMEDLL public: - BOOL MessageToAll(void) - { - return (pev->spawnflags & SF_ENVTEXT_ALLPLAYERS) == SF_ENVTEXT_ALLPLAYERS; - } - void MessageSet(const char *pMessage) - { - pev->message = ALLOC_STRING(pMessage); - } - const char *MessageGet(void) - { - return STRING(pev->message); - } + BOOL MessageToAll() const { return (pev->spawnflags & SF_ENVTEXT_ALLPLAYERS) == SF_ENVTEXT_ALLPLAYERS; } + void MessageSet(const char *pMessage) { pev->message = ALLOC_STRING(pMessage); } + const char *MessageGet() const { return STRING(pev->message); } public: static TYPEDESCRIPTION IMPL(m_SaveData)[1]; private: hudtextparms_t m_textParms; - -};/* size: 196, cachelines: 4, members: 3 */ +}; // CGameTeamMaster / game_team_master -- "Masters" like multisource, but based on the team of the activator // Only allows mastered entity to fire if the team matches my team @@ -235,32 +212,23 @@ class CGameTeamMaster: public CRulePointEntity { public: virtual void KeyValue(KeyValueData *pkvd); - virtual int ObjectCaps(void) - { - return (CRulePointEntity::ObjectCaps() | FCAP_MASTER); - } + virtual int ObjectCaps() { return (CRulePointEntity::ObjectCaps() | FCAP_MASTER); } virtual BOOL IsTriggered(CBaseEntity *pActivator); - virtual const char *TeamID(void); + virtual const char *TeamID(); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); #ifdef HOOK_GAMEDLL void KeyValue_(KeyValueData *pkvd); BOOL IsTriggered_(CBaseEntity *pActivator); - const char *TeamID_(void); + const char *TeamID_(); void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); #endif // HOOK_GAMEDLL public: - BOOL RemoveOnFire(void) - { - return (pev->spawnflags & SF_TEAMMASTER_FIREONCE) == SF_TEAMMASTER_FIREONCE; - } - BOOL AnyTeam(void) - { - return (pev->spawnflags & SF_TEAMMASTER_ANYTEAM) == SF_TEAMMASTER_ANYTEAM; - } + BOOL RemoveOnFire() const { return (pev->spawnflags & SF_TEAMMASTER_FIREONCE) == SF_TEAMMASTER_FIREONCE; } + BOOL AnyTeam() const { return (pev->spawnflags & SF_TEAMMASTER_ANYTEAM) == SF_TEAMMASTER_ANYTEAM; } private: BOOL TeamMatch(CBaseEntity *pActivator); @@ -268,8 +236,7 @@ private: public: int m_teamIndex; USE_TYPE triggerType; - -};/* size: 164, cachelines: 3, members: 3 */ +}; // CGameTeamSet / game_team_set -- Changes the team of the entity it targets to the activator's team // Flag: Fire once @@ -288,16 +255,9 @@ public: #endif // HOOK_GAMEDLL public: - BOOL RemoveOnFire(void) - { - return (pev->spawnflags & SF_TEAMSET_FIREONCE) == SF_TEAMSET_FIREONCE; - } - BOOL ShouldClearTeam(void) - { - return (pev->spawnflags & SF_TEAMSET_CLEARTEAM) == SF_TEAMSET_CLEARTEAM; - } - -};/* size: 156, cachelines: 3, members: 1 */ + BOOL RemoveOnFire() const { return (pev->spawnflags & SF_TEAMSET_FIREONCE) == SF_TEAMSET_FIREONCE; } + BOOL ShouldClearTeam() const { return (pev->spawnflags & SF_TEAMSET_CLEARTEAM) == SF_TEAMSET_CLEARTEAM; } +}; // CGamePlayerZone / game_player_zone -- players in the zone fire my target when I'm fired // Needs master? @@ -328,8 +288,7 @@ private: string_t m_iszOutTarget; string_t m_iszInCount; string_t m_iszOutCount; - -};/* size: 172, cachelines: 3, members: 6 */ +}; // CGamePlayerHurt / game_player_hurt -- Damages the player who fires it // Flag: Fire once @@ -347,12 +306,8 @@ public: #endif // HOOK_GAMEDLL public: - BOOL RemoveOnFire(void) - { - return (pev->spawnflags & SF_PKILL_FIREONCE) == SF_PKILL_FIREONCE; - } - -};/* size: 156, cachelines: 3, members: 1 */ + BOOL RemoveOnFire() const { return (pev->spawnflags & SF_PKILL_FIREONCE) == SF_PKILL_FIREONCE; } +}; // CGameCounter / game_counter -- Counts events and fires target // Flag: Fire once @@ -362,61 +317,32 @@ public: class CGameCounter: public CRulePointEntity { 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: - BOOL RemoveOnFire(void) - { - return (pev->spawnflags & SF_GAMECOUNT_FIREONCE) == SF_GAMECOUNT_FIREONCE; - } - BOOL ResetOnFire(void) - { - return (pev->spawnflags & SF_GAMECOUNT_RESET) == SF_GAMECOUNT_RESET; - } - void CountUp(void) - { - pev->frags++; - } - void CountDown(void) - { - pev->frags--; - } - void ResetCount(void) - { - pev->frags = pev->dmg; - } - int CountValue(void) - { - return (int)(pev->frags); - } - int LimitValue(void) - { - return (int)(pev->health); - } - BOOL HitLimit(void) - { - return CountValue() == LimitValue(); - } + BOOL RemoveOnFire() const { return (pev->spawnflags & SF_GAMECOUNT_FIREONCE) == SF_GAMECOUNT_FIREONCE; } + BOOL ResetOnFire() const { return (pev->spawnflags & SF_GAMECOUNT_RESET) == SF_GAMECOUNT_RESET; } + + void CountUp() { pev->frags++; } + void CountDown() { pev->frags--; } + void ResetCount() { pev->frags = pev->dmg; } + + int CountValue() const { return (int)(pev->frags); } + int LimitValue() const { return (int)(pev->health); } + BOOL HitLimit() const { return CountValue() == LimitValue(); } private: - void SetCountValue(int value) - { - pev->frags = value; - } - void SetInitialValue(int value) - { - pev->dmg = value; - } - -};/* size: 156, cachelines: 3, members: 1 */ + void SetCountValue(int value) { pev->frags = value; } + void SetInitialValue(int value) { pev->dmg = value; } +}; // CGameCounterSet / game_counter_set -- Sets the counter's value // Flag: Fire once @@ -434,12 +360,8 @@ public: #endif // HOOK_GAMEDLL public: - BOOL RemoveOnFire(void) - { - return (pev->spawnflags & SF_GAMECOUNTSET_FIREONCE) == SF_GAMECOUNTSET_FIREONCE; - } - -};/* size: 156, cachelines: 3, members: 1 */ + BOOL RemoveOnFire() const { return (pev->spawnflags & SF_GAMECOUNTSET_FIREONCE) == SF_GAMECOUNTSET_FIREONCE; } +}; // CGamePlayerEquip / game_playerequip -- Sets the default player equipment // Flag: USE Only @@ -461,10 +383,7 @@ public: #endif // HOOK_GAMEDLL public: - BOOL UseOnly(void) - { - return (pev->spawnflags & SF_PLAYEREQUIP_USEONLY) == SF_PLAYEREQUIP_USEONLY; - } + BOOL UseOnly() const { return (pev->spawnflags & SF_PLAYEREQUIP_USEONLY) == SF_PLAYEREQUIP_USEONLY; } private: void EquipPlayer(CBaseEntity *pPlayer); @@ -472,8 +391,7 @@ private: public: string_t m_weaponNames[ MAX_EQUIP ]; int m_weaponCount[ MAX_EQUIP ]; - -};/* size: 412, cachelines: 7, members: 3 */ +}; // CGamePlayerTeam / game_player_team -- Changes the team of the player who fired it // Flag: Fire once @@ -493,37 +411,11 @@ public: #endif // HOOK_GAMEDLL private: - BOOL RemoveOnFire(void) - { - return (pev->spawnflags & SF_PTEAM_FIREONCE) == SF_PTEAM_FIREONCE; - } - BOOL ShouldKillPlayer(void) - { - return (pev->spawnflags & SF_PTEAM_KILL) == SF_PTEAM_KILL; - } - BOOL ShouldGibPlayer(void) - { - return (pev->spawnflags & SF_PTEAM_GIB) == SF_PTEAM_GIB; - } + BOOL RemoveOnFire() const { return (pev->spawnflags & SF_PTEAM_FIREONCE) == SF_PTEAM_FIREONCE; } + BOOL ShouldKillPlayer() const { return (pev->spawnflags & SF_PTEAM_KILL) == SF_PTEAM_KILL; } + BOOL ShouldGibPlayer() const { return (pev->spawnflags & SF_PTEAM_GIB) == SF_PTEAM_GIB; } + const char *TargetTeamName(const char *pszTargetName); - -};/* size: 156, cachelines: 3, members: 1 */ - -#ifdef HOOK_GAMEDLL - -// linked objects -C_DLLEXPORT void game_score(entvars_t *pev); -C_DLLEXPORT void game_end(entvars_t *pev); -C_DLLEXPORT void game_text(entvars_t *pev); -C_DLLEXPORT void game_team_master(entvars_t *pev); -C_DLLEXPORT void game_team_set(entvars_t *pev); -C_DLLEXPORT void game_zone_player(entvars_t *pev); -C_DLLEXPORT void game_player_hurt(entvars_t *pev); -C_DLLEXPORT void game_counter(entvars_t *pev); -C_DLLEXPORT void game_counter_set(entvars_t *pev); -C_DLLEXPORT void game_player_equip(entvars_t *pev); -C_DLLEXPORT void game_player_team(entvars_t *pev); - -#endif // HOOK_GAMEDLL +}; #endif // MAPRULES_H diff --git a/regamedll/dlls/monsters.h b/regamedll/dlls/monsters.h index 6f2e4caf..65dbe9c5 100644 --- a/regamedll/dlls/monsters.h +++ b/regamedll/dlls/monsters.h @@ -114,43 +114,41 @@ enum HitBoxGroup class CGib: public CBaseEntity { public: - virtual int ObjectCaps(void) - { - return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION) | FCAP_DONT_SAVE; - } + virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION) | FCAP_DONT_SAVE; } public: void Spawn(const char *szGibModel); void EXPORT BounceGibTouch(CBaseEntity *pOther); void EXPORT StickyGibTouch(CBaseEntity *pOther); - void EXPORT WaitTillLand(void); - void LimitVelocity(void); + void EXPORT WaitTillLand(); + void LimitVelocity(); + public: static void SpawnHeadGib(entvars_t *pevVictim); static void SpawnRandomGibs(entvars_t *pevVictim, int cGibs, int human); NOXREF static void SpawnStickyGibs(entvars_t *pevVictim, Vector vecOrigin, int cGibs); + public: int m_bloodColor; int m_cBloodDecals; int m_material; float m_lifeTime; - -};/* size: 168, cachelines: 3, members: 5 */ +}; #define CUSTOM_SCHEDULES\ - virtual Schedule_t *ScheduleFromName(const char *pName);\ - static Schedule_t *m_scheduleList[]; + virtual Schedule_t *ScheduleFromName(const char *pName);\ + static Schedule_t *m_scheduleList[]; #define DEFINE_CUSTOM_SCHEDULES(derivedClass)\ Schedule_t *derivedClass::m_scheduleList[] = #define IMPLEMENT_CUSTOM_SCHEDULES(derivedClass, baseClass)\ - Schedule_t *derivedClass::ScheduleFromName(const char *pName)\ - {\ - Schedule_t *pSchedule = ScheduleInList(pName, m_scheduleList, ARRAYSIZE(m_scheduleList));\ - if (!pSchedule)\ - return baseClass::ScheduleFromName(pName);\ - return pSchedule;\ - } + Schedule_t *derivedClass::ScheduleFromName(const char *pName)\ + {\ + Schedule_t *pSchedule = ScheduleInList(pName, m_scheduleList, ARRAYSIZE(m_scheduleList));\ + if (!pSchedule)\ + return baseClass::ScheduleFromName(pName);\ + return pSchedule;\ + } #endif // MONSTERS_H diff --git a/regamedll/dlls/mortar.cpp b/regamedll/dlls/mortar.cpp index 92f1769d..941781f2 100644 --- a/regamedll/dlls/mortar.cpp +++ b/regamedll/dlls/mortar.cpp @@ -15,244 +15,201 @@ TYPEDESCRIPTION CFuncMortarField::m_SaveData[] = DEFINE_FIELD(CFuncMortarField, m_fControl, FIELD_INTEGER), }; -#else - -TYPEDESCRIPTION IMPL_CLASS(CFuncMortarField, m_SaveData)[6]; - #endif // HOOK_GAMEDLL -/* ../cstrike/dlls/mortar.cpp:56 */ +/* ../cstrike/dlls/mortar.cpp:56 */ LINK_ENTITY_TO_CLASS(func_mortar_field, CFuncMortarField); -/* ../cstrike/dlls/mortar.cpp:68 */ +/* ../cstrike/dlls/mortar.cpp:68 */ IMPLEMENT_SAVERESTORE(CFuncMortarField, CBaseToggle); -/* ../cstrike/dlls/mortar.cpp:71 */ -void CFuncMortarField::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) -{ - if (FStrEq(pkvd->szKeyName, "m_iszXController")) - { - m_iszXController = ALLOC_STRING(pkvd->szValue); - pkvd->fHandled = TRUE; - } - else if (FStrEq(pkvd->szKeyName, "m_iszYController")) - { - m_iszYController = ALLOC_STRING(pkvd->szValue); - pkvd->fHandled = TRUE; - } - else if (FStrEq(pkvd->szKeyName, "m_flSpread")) - { - m_flSpread = Q_atof(pkvd->szValue); - pkvd->fHandled = TRUE; - } - else if (FStrEq(pkvd->szKeyName, "m_fControl")) - { - m_fControl = Q_atoi(pkvd->szValue); - pkvd->fHandled = TRUE; - } - else if (FStrEq(pkvd->szKeyName, "m_iCount")) - { - m_iCount = Q_atoi(pkvd->szValue); - pkvd->fHandled = TRUE; - } +/* ../cstrike/dlls/mortar.cpp:71 */ +void CFuncMortarField::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) +{ + if (FStrEq(pkvd->szKeyName, "m_iszXController")) + { + m_iszXController = ALLOC_STRING(pkvd->szValue); + pkvd->fHandled = TRUE; + } + else if (FStrEq(pkvd->szKeyName, "m_iszYController")) + { + m_iszYController = ALLOC_STRING(pkvd->szValue); + pkvd->fHandled = TRUE; + } + else if (FStrEq(pkvd->szKeyName, "m_flSpread")) + { + m_flSpread = Q_atof(pkvd->szValue); + pkvd->fHandled = TRUE; + } + else if (FStrEq(pkvd->szKeyName, "m_fControl")) + { + m_fControl = Q_atoi(pkvd->szValue); + pkvd->fHandled = TRUE; + } + else if (FStrEq(pkvd->szKeyName, "m_iCount")) + { + m_iCount = Q_atoi(pkvd->szValue); + pkvd->fHandled = TRUE; + } } // Drop bombs from above -/* ../cstrike/dlls/mortar.cpp:102 */ -void CFuncMortarField::__MAKE_VHOOK(Spawn)(void) -{ - pev->solid = SOLID_NOT; - - // set size and link into world - SET_MODEL(ENT(pev), STRING(pev->model)); - pev->movetype = MOVETYPE_NONE; - pev->effects |= EF_NODRAW; - - SetUse(&CFuncMortarField::FieldUse); - Precache(); +/* ../cstrike/dlls/mortar.cpp:102 */ +void CFuncMortarField::__MAKE_VHOOK(Spawn)() +{ + pev->solid = SOLID_NOT; + + // set size and link into world + SET_MODEL(ENT(pev), STRING(pev->model)); + pev->movetype = MOVETYPE_NONE; + pev->effects |= EF_NODRAW; + + SetUse(&CFuncMortarField::FieldUse); + Precache(); } -/* ../cstrike/dlls/mortar.cpp:113 */ -void CFuncMortarField::__MAKE_VHOOK(Precache)(void) -{ - PRECACHE_SOUND("weapons/mortar.wav"); - PRECACHE_SOUND("weapons/mortarhit.wav"); - PRECACHE_MODEL("sprites/lgtning.spr"); +/* ../cstrike/dlls/mortar.cpp:113 */ +void CFuncMortarField::__MAKE_VHOOK(Precache)() +{ + PRECACHE_SOUND("weapons/mortar.wav"); + PRECACHE_SOUND("weapons/mortarhit.wav"); + PRECACHE_MODEL("sprites/lgtning.spr"); } // If connected to a table, then use the table controllers, else hit where the trigger is. -/* ../cstrike/dlls/mortar.cpp:122 */ -void CFuncMortarField::FieldUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) +/* ../cstrike/dlls/mortar.cpp:122 */ +void CFuncMortarField::FieldUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { - Vector vecStart; - - vecStart.x = RANDOM_FLOAT(pev->mins.x, pev->maxs.x); - vecStart.y = RANDOM_FLOAT(pev->mins.y, pev->maxs.y); - vecStart.z = pev->maxs.z; - - switch (m_fControl) - { - // random - case 0: - break; - // Trigger Activator - case 1: - { - if (pActivator != NULL) - { - vecStart.x = pActivator->pev->origin.x; - vecStart.y = pActivator->pev->origin.y; - } - break; - } - // table - case 2: - { - CBaseEntity *pController; - - if (!FStringNull(m_iszXController)) - { - pController = UTIL_FindEntityByTargetname(NULL, STRING(m_iszXController)); - - if (pController != NULL) - { - vecStart.x = pev->mins.x + pController->pev->ideal_yaw * pev->size.x; - } - } - if (!FStringNull(m_iszYController)) - { - pController = UTIL_FindEntityByTargetname(NULL, STRING(m_iszYController)); - - if (pController != NULL) - { - vecStart.y = pev->mins.y + pController->pev->ideal_yaw * pev->size.y; - } - } - break; - } - } - - int pitch = RANDOM_LONG(95, 124); - - EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "weapons/mortar.wav", VOL_NORM, ATTN_NONE, 0, pitch); - - float t = 2.5; - for (int i = 0; i < m_iCount; ++i) - { - Vector vecSpot = vecStart; - vecSpot.x += RANDOM_FLOAT(-m_flSpread, m_flSpread); - vecSpot.y += RANDOM_FLOAT(-m_flSpread, m_flSpread); - - TraceResult tr; - UTIL_TraceLine(vecSpot, vecSpot + Vector(0, 0, -1) * 4096, ignore_monsters, ENT(pev), &tr); - - edict_t *pentOwner = NULL; - if (pActivator) - { - pentOwner = pActivator->edict(); - } - - CBaseEntity *pMortar = Create("monster_mortar", tr.vecEndPos, Vector(0, 0, 0), pentOwner); - pMortar->pev->nextthink = gpGlobals->time + t; - t += RANDOM_FLOAT(0.2, 0.5); - - if (i == 0) - { - CSoundEnt::InsertSound(bits_SOUND_DANGER, tr.vecEndPos, 400, 0.3); + Vector vecStart; + + vecStart.x = RANDOM_FLOAT(pev->mins.x, pev->maxs.x); + vecStart.y = RANDOM_FLOAT(pev->mins.y, pev->maxs.y); + vecStart.z = pev->maxs.z; + + switch (m_fControl) + { + // random + case 0: + break; + // Trigger Activator + case 1: + { + if (pActivator != NULL) + { + vecStart.x = pActivator->pev->origin.x; + vecStart.y = pActivator->pev->origin.y; + } + break; + } + // table + case 2: + { + CBaseEntity *pController; + + if (!FStringNull(m_iszXController)) + { + pController = UTIL_FindEntityByTargetname(NULL, STRING(m_iszXController)); + + if (pController != NULL) + { + vecStart.x = pev->mins.x + pController->pev->ideal_yaw * pev->size.x; + } + } + if (!FStringNull(m_iszYController)) + { + pController = UTIL_FindEntityByTargetname(NULL, STRING(m_iszYController)); + + if (pController != NULL) + { + vecStart.y = pev->mins.y + pController->pev->ideal_yaw * pev->size.y; + } + } + break; + } + } + + int pitch = RANDOM_LONG(95, 124); + + EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "weapons/mortar.wav", VOL_NORM, ATTN_NONE, 0, pitch); + + float t = 2.5; + for (int i = 0; i < m_iCount; ++i) + { + Vector vecSpot = vecStart; + vecSpot.x += RANDOM_FLOAT(-m_flSpread, m_flSpread); + vecSpot.y += RANDOM_FLOAT(-m_flSpread, m_flSpread); + + TraceResult tr; + UTIL_TraceLine(vecSpot, vecSpot + Vector(0, 0, -1) * 4096, ignore_monsters, ENT(pev), &tr); + + edict_t *pentOwner = NULL; + if (pActivator) + { + pentOwner = pActivator->edict(); + } + + CBaseEntity *pMortar = Create("monster_mortar", tr.vecEndPos, Vector(0, 0, 0), pentOwner); + pMortar->pev->nextthink = gpGlobals->time + t; + t += RANDOM_FLOAT(0.2, 0.5); + + if (i == 0) + { + CSoundEnt::InsertSound(bits_SOUND_DANGER, tr.vecEndPos, 400, 0.3); } } } -/* ../cstrike/dlls/mortar.cpp:203 */ -LINK_ENTITY_TO_CLASS(monster_mortar, CMortar); +/* ../cstrike/dlls/mortar.cpp:203 */ +LINK_ENTITY_TO_CLASS(monster_mortar, CMortar); -/* ../cstrike/dlls/mortar.cpp:205 */ -void CMortar::__MAKE_VHOOK(Spawn)(void) -{ - pev->movetype = MOVETYPE_NONE; - pev->solid = SOLID_NOT; - pev->dmg = 200; - - SetThink(&CMortar::MortarExplode); - pev->nextthink = 0; - Precache(); -} - -/* ../cstrike/dlls/mortar.cpp:221 */ -void CMortar::__MAKE_VHOOK(Precache)(void) -{ - m_spriteTexture = PRECACHE_MODEL("sprites/lgtning.spr"); -} - -/* ../cstrike/dlls/mortar.cpp:226 */ -void CMortar::MortarExplode(void) -{ - // mortar beam - MESSAGE_BEGIN(MSG_BROADCAST, SVC_TEMPENTITY); - WRITE_BYTE(TE_BEAMPOINTS); - WRITE_COORD(pev->origin.x); - WRITE_COORD(pev->origin.y); - WRITE_COORD(pev->origin.z); - WRITE_COORD(pev->origin.x); - WRITE_COORD(pev->origin.y); - WRITE_COORD(pev->origin.z + 1024); - WRITE_SHORT(m_spriteTexture); - WRITE_BYTE(0); // framerate - WRITE_BYTE(0); // framerate - WRITE_BYTE(1); // life - WRITE_BYTE(40); // width - WRITE_BYTE(0); // noise - WRITE_BYTE(255); // r, g, b - WRITE_BYTE(160); // r, g, b - WRITE_BYTE(100); // r, g, b - WRITE_BYTE(128); // brightness - WRITE_BYTE(0); // speed - MESSAGE_END(); - - TraceResult tr; - UTIL_TraceLine(pev->origin + Vector(0, 0, 1024), pev->origin - Vector(0, 0, 1024), dont_ignore_monsters, ENT(pev), &tr); - - Explode(&tr, (DMG_BLAST | DMG_MORTAR)); - UTIL_ScreenShake(tr.vecEndPos, 25.0, 150.0, 1.0, 750); -} - -#ifdef HOOK_GAMEDLL - -void CFuncMortarField::Spawn(void) +/* ../cstrike/dlls/mortar.cpp:205 */ +void CMortar::__MAKE_VHOOK(Spawn)() { - Spawn_(); + pev->movetype = MOVETYPE_NONE; + pev->solid = SOLID_NOT; + pev->dmg = 200; + + SetThink(&CMortar::MortarExplode); + pev->nextthink = 0; + Precache(); } -void CFuncMortarField::Precache(void) +/* ../cstrike/dlls/mortar.cpp:221 */ +void CMortar::__MAKE_VHOOK(Precache)() { - Precache_(); + m_spriteTexture = PRECACHE_MODEL("sprites/lgtning.spr"); } -void CFuncMortarField::KeyValue(KeyValueData *pkvd) +/* ../cstrike/dlls/mortar.cpp:226 */ +void CMortar::MortarExplode() { - KeyValue_(pkvd); -} + // mortar beam + MESSAGE_BEGIN(MSG_BROADCAST, SVC_TEMPENTITY); + WRITE_BYTE(TE_BEAMPOINTS); + WRITE_COORD(pev->origin.x); + WRITE_COORD(pev->origin.y); + WRITE_COORD(pev->origin.z); + WRITE_COORD(pev->origin.x); + WRITE_COORD(pev->origin.y); + WRITE_COORD(pev->origin.z + 1024); + WRITE_SHORT(m_spriteTexture); + WRITE_BYTE(0); // framerate + WRITE_BYTE(0); // framerate + WRITE_BYTE(1); // life + WRITE_BYTE(40); // width + WRITE_BYTE(0); // noise + WRITE_BYTE(255); // r, g, b + WRITE_BYTE(160); // r, g, b + WRITE_BYTE(100); // r, g, b + WRITE_BYTE(128); // brightness + WRITE_BYTE(0); // speed + MESSAGE_END(); -int CFuncMortarField::Save(CSave &save) -{ - return Save_(save); -} + TraceResult tr; + UTIL_TraceLine(pev->origin + Vector(0, 0, 1024), pev->origin - Vector(0, 0, 1024), dont_ignore_monsters, ENT(pev), &tr); -int CFuncMortarField::Restore(CRestore &restore) -{ - return Restore_(restore); + Explode(&tr, (DMG_BLAST | DMG_MORTAR)); + UTIL_ScreenShake(tr.vecEndPos, 25.0, 150.0, 1.0, 750); } - -void CMortar::Spawn(void) -{ - Spawn_(); -} - -void CMortar::Precache(void) -{ - Precache_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/mortar.h b/regamedll/dlls/mortar.h index e5bb50af..d634ec71 100644 --- a/regamedll/dlls/mortar.h +++ b/regamedll/dlls/mortar.h @@ -36,22 +36,19 @@ class CFuncMortarField: 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); // Bmodels don't go across transitions - virtual int ObjectCaps(void) - { - return CBaseToggle::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; - } + virtual int ObjectCaps() { return CBaseToggle::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; } #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); @@ -71,36 +68,26 @@ public: float m_flDelay; int m_iCount; int m_fControl; - -};/* size: 336, cachelines: 6, members: 8 */ +}; /* ../cstrike/dlls/mortar.cpp:192 */ class CMortar: public CGrenade { 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 - void EXPORT MortarExplode(void); + void EXPORT MortarExplode(); public: int m_spriteTexture; - -};/* size: 504, cachelines: 8, members: 2 */ - -#if HOOK_GAMEDLL - -// linked objects -C_DLLEXPORT void func_mortar_field(entvars_t *pev); -C_DLLEXPORT void monster_mortar(entvars_t *pev); - -#endif // HOOK_GAMEDLL +}; #endif // MORTAR_H diff --git a/regamedll/dlls/mpstubb.cpp b/regamedll/dlls/mpstubb.cpp index c8cc9844..46f14789 100644 --- a/regamedll/dlls/mpstubb.cpp +++ b/regamedll/dlls/mpstubb.cpp @@ -3,7 +3,7 @@ CGraph WorldGraph; /* ../cstrike/dlls/mpstubb.cpp:32 */ -void CGraph::InitGraph(void) +void CGraph::InitGraph() { ; } @@ -15,7 +15,7 @@ int CGraph::FLoadGraph(char *szMapName) } /* ../cstrike/dlls/mpstubb.cpp:34 */ -int CGraph::AllocNodes(void) +int CGraph::AllocNodes() { return 0; } @@ -27,7 +27,7 @@ int CGraph::CheckNODFile(char *szMapName) } /* ../cstrike/dlls/mpstubb.cpp:36 */ -int CGraph::FSetGraphPointers(void) +int CGraph::FSetGraphPointers() { return 0; } @@ -63,7 +63,7 @@ void CBaseMonster::MakeIdealYaw(Vector vecTarget) } /* ../cstrike/dlls/mpstubb.cpp:49 */ -NOXREF void CBaseMonster::CorpseFallThink(void) +NOXREF void CBaseMonster::CorpseFallThink() { if (pev->flags & FL_ONGROUND) { @@ -78,7 +78,7 @@ NOXREF void CBaseMonster::CorpseFallThink(void) } /* ../cstrike/dlls/mpstubb.cpp:62 */ -void CBaseMonster::__MAKE_VHOOK(MonsterInitDead)(void) +void CBaseMonster::__MAKE_VHOOK(MonsterInitDead)() { InitBoneControllers(); @@ -101,13 +101,13 @@ void CBaseMonster::__MAKE_VHOOK(MonsterInitDead)(void) } /* ../cstrike/dlls/mpstubb.cpp:89 */ -BOOL CBaseMonster::__MAKE_VHOOK(ShouldFadeOnDeath)(void) +BOOL CBaseMonster::__MAKE_VHOOK(ShouldFadeOnDeath)() { return FALSE; } /* ../cstrike/dlls/mpstubb.cpp:94 */ -BOOL CBaseMonster::FCheckAITrigger(void) +BOOL CBaseMonster::FCheckAITrigger() { return FALSE; } @@ -229,11 +229,11 @@ void CBaseMonster::__MAKE_VHOOK(Look)(int iDistance) // a pointer to the enemy entity in that list that is nearest the // caller. // -// !!!UNDONE - currently, this only returns the closest enemy. +// UNDONE: currently, this only returns the closest enemy. // we'll want to consider distance, relationship, attack types, back turned, etc. /* ../cstrike/dlls/mpstubb.cpp:220 */ -CBaseEntity *CBaseMonster::__MAKE_VHOOK(BestVisibleEnemy)(void) +CBaseEntity *CBaseMonster::__MAKE_VHOOK(BestVisibleEnemy)() { CBaseEntity *pReturn; CBaseEntity *pNextEnt; diff --git a/regamedll/dlls/multiplay_gamerules.cpp b/regamedll/dlls/multiplay_gamerules.cpp index 9899427e..7f69bbf8 100644 --- a/regamedll/dlls/multiplay_gamerules.cpp +++ b/regamedll/dlls/multiplay_gamerules.cpp @@ -8,11 +8,6 @@ static char mp_com_token[ COM_TOKEN_LEN ]; cvar_t *sv_clienttrace = NULL; -#else - -char mp_com_token[ COM_TOKEN_LEN ]; -cvar_t *sv_clienttrace; - #endif // HOOK_GAMEDLL CCStrikeGameMgrHelper g_GameMgrHelper; @@ -565,7 +560,7 @@ CHalfLifeMultiplay::CHalfLifeMultiplay() if (!installedCommands) { - if (UTIL_IsGame("czero")) + if (g_bIsCzeroGame) { #if defined(HOOK_GAMEDLL) && !defined(REGAMEDLL_UNIT_TESTS) ADD_SERVER_COMMAND("career_continue", (xcommand_t)GetOriginalFuncAddrOrDefault("_Z13SV_Continue_fv", (void *)SV_Continue_f)); @@ -760,7 +755,7 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(CleanUpMap)() { UTIL_Remove(toremove); toremove = UTIL_FindEntityByClassname(toremove, "grenade"); - icount++; + ++icount; } // Remove defuse kit @@ -784,7 +779,7 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(GiveC4)() int humansPresent = 0; iTeamCount = m_iNumTerrorist; - m_iC4Guy++; + ++m_iC4Guy; bool giveToHumans = (cv_bot_defer_to_human.value > 0.0); @@ -801,7 +796,7 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(GiveC4)() continue; if (!player->IsBot()) - humansPresent++; + ++humansPresent; } if (humansPresent) @@ -834,8 +829,7 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(GiveC4)() if (player->pev->deadflag != DEAD_NO || player->m_iTeam != TERRORIST || (giveToHumans && player->IsBot())) continue; - iTemp++; - if (iTemp == m_iC4Guy) + if (++iTemp == m_iC4Guy) { player->m_bHasC4 = true; player->GiveNamedItem("weapon_c4"); @@ -919,7 +913,7 @@ void CHalfLifeMultiplay::QueueCareerRoundEndMenu(float tmDelay, int iWinStatus) while ((hostage = UTIL_FindEntityByClassname(hostage, "hostage_entity")) != NULL) { - numHostagesInMap++; + ++numHostagesInMap; CHostage *pHostage = static_cast(hostage); @@ -935,7 +929,7 @@ void CHalfLifeMultiplay::QueueCareerRoundEndMenu(float tmDelay, int iWinStatus) if (pLeader == NULL) { - numHostagesAlive++; + ++numHostagesAlive; } else { @@ -1089,41 +1083,41 @@ void CHalfLifeMultiplay::InitializePlayerCounts(int &NumAliveTerrorist, int &Num { case CT: { - m_iNumCT++; + ++m_iNumCT; if (player->m_iMenu != Menu_ChooseAppearance) { - m_iNumSpawnableCT++; + ++m_iNumSpawnableCT; //player->IsBot(); } //player->IsBot(); if (player->pev->deadflag != DEAD_NO) - NumDeadCT++; + ++NumDeadCT; else - NumAliveCT++; + ++NumAliveCT; break; } case TERRORIST: { - m_iNumTerrorist++; + ++m_iNumTerrorist; if (player->m_iMenu != Menu_ChooseAppearance) { - m_iNumSpawnableTerrorist++; + ++m_iNumSpawnableTerrorist; //player->IsBot(); } //player->IsBot(); if (player->pev->deadflag != DEAD_NO) - NumDeadTerrorist++; + ++NumDeadTerrorist; else - NumAliveTerrorist++; + ++NumAliveTerrorist; // Check to see if this guy escaped. if (player->m_bEscaped) - m_iHaveEscaped++; + ++m_iHaveEscaped; break; } @@ -1190,7 +1184,7 @@ bool CHalfLifeMultiplay::VIPRoundEndCheck(bool bNeededPlayers) if (!bNeededPlayers) { - m_iNumCTWins++; + ++m_iNumCTWins; // Update the clients team score UpdateTeamScores(); } @@ -1227,7 +1221,7 @@ bool CHalfLifeMultiplay::VIPRoundEndCheck(bool bNeededPlayers) if (!bNeededPlayers) { - m_iNumTerroristWins++; + ++m_iNumTerroristWins; // Update the clients team score UpdateTeamScores(); } @@ -1267,7 +1261,7 @@ bool CHalfLifeMultiplay::PrisonRoundEndCheck(int NumAliveTerrorist, int NumAlive if (!bNeededPlayers) { - m_iNumTerroristWins++; + ++m_iNumTerroristWins; // Update the clients team score UpdateTeamScores(); } @@ -1291,7 +1285,7 @@ bool CHalfLifeMultiplay::PrisonRoundEndCheck(int NumAliveTerrorist, int NumAlive if (!bNeededPlayers) { - m_iNumCTWins++; + ++m_iNumCTWins; // Update the clients team score UpdateTeamScores(); } @@ -1315,7 +1309,7 @@ bool CHalfLifeMultiplay::PrisonRoundEndCheck(int NumAliveTerrorist, int NumAlive if (!bNeededPlayers) { - m_iNumCTWins++; + ++m_iNumCTWins; // Update the clients team score UpdateTeamScores(); } @@ -1346,7 +1340,7 @@ bool CHalfLifeMultiplay::BombRoundEndCheck(bool bNeededPlayers) if (!bNeededPlayers) { - m_iNumTerroristWins++; + ++m_iNumTerroristWins; // Update the clients team score UpdateTeamScores(); } @@ -1369,7 +1363,7 @@ bool CHalfLifeMultiplay::BombRoundEndCheck(bool bNeededPlayers) if (!bNeededPlayers) { - m_iNumCTWins++; + ++m_iNumCTWins; // Update the clients team score UpdateTeamScores(); } @@ -1417,7 +1411,7 @@ bool CHalfLifeMultiplay::TeamExterminationCheck(int NumAliveTerrorist, int NumAl if (!bNeededPlayers) { - m_iNumCTWins++; + ++m_iNumCTWins; // Update the clients team score UpdateTeamScores(); } @@ -1442,7 +1436,7 @@ bool CHalfLifeMultiplay::TeamExterminationCheck(int NumAliveTerrorist, int NumAl if (!bNeededPlayers) { - m_iNumTerroristWins++; + ++m_iNumTerroristWins; // Update the clients team score UpdateTeamScores(); } @@ -1481,7 +1475,7 @@ bool CHalfLifeMultiplay::HostageRescueRoundEndCheck(bool bNeededPlayers) while ((hostage = UTIL_FindEntityByClassname(hostage, "hostage_entity")) != NULL) { - iHostages++; + ++iHostages; // We've found a live hostage. don't end the round if (hostage->pev->takedamage == DAMAGE_YES) @@ -1500,7 +1494,7 @@ bool CHalfLifeMultiplay::HostageRescueRoundEndCheck(bool bNeededPlayers) if (!bNeededPlayers) { - m_iNumCTWins++; + ++m_iNumCTWins; // Update the clients team score UpdateTeamScores(); } @@ -1704,7 +1698,7 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(RestartRound)() g_pHostages->RestartRound(); } - m_iTotalRoundsPlayed++; + ++m_iTotalRoundsPlayed; ClearBodyQue(); // Hardlock the player accelaration to 5.0 @@ -1747,7 +1741,7 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(RestartRound)() if ((m_iNumCT - m_iNumTerrorist) >= 2 || (m_iNumTerrorist - m_iNumCT) >= 2) { - m_iUnBalancedRounds++; + ++m_iUnBalancedRounds; } else m_iUnBalancedRounds = 0; @@ -1883,13 +1877,13 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(RestartRound)() } // Increment the number of rounds played... After 8 rounds, the players will do a whole sale switch.. - m_iNumEscapeRounds++; + ++m_iNumEscapeRounds; } if (m_iMapHasVIPSafetyZone == MAP_HAVE_VIP_SAFETYZONE_YES) { PickNextVIP(); - m_iConsecutiveVIP++; + ++m_iConsecutiveVIP; } int acct_tmp = 0; @@ -2022,7 +2016,7 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(RestartRound)() else if (player->m_iTeam == TERRORIST) { // Add another potential escaper to the mix! - m_iNumEscapers++; + ++m_iNumEscapers; if (!player->m_bReceivesNoMoneyNextRound) { @@ -2221,7 +2215,7 @@ bool CHalfLifeMultiplay::AddToVIPQueue(CBasePlayer *toAdd) { CBasePlayer *toCheck = VIPQueue[i]; - if (toCheck && toCheck->m_iTeam != CT) + if (toCheck != NULL && toCheck->m_iTeam != CT) { VIPQueue[i] = NULL; } @@ -2232,17 +2226,16 @@ bool CHalfLifeMultiplay::AddToVIPQueue(CBasePlayer *toAdd) if (toAdd->m_iTeam == CT) { int j; - for (j = 0; j < MAX_VIP_QUEUES; j++) + for (j = 0; j < MAX_VIP_QUEUES; ++j) { if (VIPQueue[j] == toAdd) { ClientPrint(toAdd->pev, HUD_PRINTCENTER, "#Game_in_position", UTIL_dtos1(j + 1)); - return FALSE; } } - for (j = 0; j < MAX_VIP_QUEUES; j++) + for (j = 0; j < MAX_VIP_QUEUES; ++j) { if (!VIPQueue[j]) { @@ -2250,7 +2243,6 @@ bool CHalfLifeMultiplay::AddToVIPQueue(CBasePlayer *toAdd) StackVIPQueue(); ClientPrint(toAdd->pev, HUD_PRINTCENTER, "#Game_added_position", UTIL_dtos1(j + 1)); - return TRUE; } } @@ -2265,7 +2257,7 @@ bool CHalfLifeMultiplay::AddToVIPQueue(CBasePlayer *toAdd) void CHalfLifeMultiplay::ResetCurrentVIP() { char *infobuffer = GET_INFO_BUFFER(m_pVIP->edict()); - int numSkins = UTIL_IsGame("czero") ? CZ_NUM_SKIN : CS_NUM_SKIN; + int numSkins = g_bIsCzeroGame ? CZ_NUM_SKIN : CS_NUM_SKIN; switch (RANDOM_LONG(0, numSkins)) { @@ -2282,7 +2274,7 @@ void CHalfLifeMultiplay::ResetCurrentVIP() SET_CLIENT_KEY_VALUE(m_pVIP->entindex(), infobuffer, "model", "gign"); break; case 4: - if (UTIL_IsGame("czero")) + if (g_bIsCzeroGame) { m_pVIP->m_iModelName = MODEL_SPETSNAZ; SET_CLIENT_KEY_VALUE(m_pVIP->entindex(), infobuffer, "model", "spetsnaz"); @@ -2326,7 +2318,7 @@ void CHalfLifeMultiplay::PickNextVIP() // If it's been the same VIP for 3 rounds already.. then randomly pick a new one else if (m_iConsecutiveVIP >= 3) { - m_iLastPick++; + ++m_iLastPick; if (m_iLastPick > m_iNumCT) m_iLastPick = 1; @@ -2362,7 +2354,7 @@ void CHalfLifeMultiplay::PickNextVIP() return; } else if (player->m_iTeam == CT) - iCount++; + ++iCount; if (player->m_iTeam != SPECTATOR) pLastPlayer = player; @@ -2922,10 +2914,10 @@ void CHalfLifeMultiplay::CheckLevelInitialized() m_iSpawnPointCount_CT = 0; while ((ent = UTIL_FindEntityByClassname(ent, "info_player_deathmatch")) != NULL) - m_iSpawnPointCount_Terrorist++; + ++m_iSpawnPointCount_Terrorist; while ((ent = UTIL_FindEntityByClassname(ent, "info_player_start")) != NULL) - m_iSpawnPointCount_CT++; + ++m_iSpawnPointCount_CT; m_bLevelInitialized = true; } @@ -3365,7 +3357,7 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(ClientDisconnected)(edict_t *pClient) if (pPlayer->m_iMapVote) { - m_iMapVotes[ pPlayer->m_iMapVote ]--; + --m_iMapVotes[ pPlayer->m_iMapVote ]; if (m_iMapVotes[ pPlayer->m_iMapVote ] < 0) { @@ -3784,9 +3776,9 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(DeathNotice)(CBasePlayer *pVictim, entvars if (pevInflictor == pKiller) { // If the inflictor is the killer, then it must be their current weapon doing the damage - CBasePlayer *pPlayer = static_cast(CBaseEntity::Instance(pKiller)); + CBasePlayer *pPlayer = dynamic_cast(CBaseEntity::Instance(pKiller)); - if (pPlayer && pPlayer->m_pActiveItem != NULL) + if (pPlayer != NULL && pPlayer->m_pActiveItem != NULL) { killer_weapon_name = pPlayer->m_pActiveItem->pszName(); } @@ -3843,10 +3835,10 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(DeathNotice)(CBasePlayer *pVictim, entvars } else if (pKiller->flags & FL_CLIENT) { - CBasePlayer *pPlayer = static_cast(CBaseEntity::Instance(pKiller)); + CBasePlayer *pPlayer = dynamic_cast(CBaseEntity::Instance(pKiller)); - char *VictimTeam = GetTeam(pVictim->m_iTeam); - char *KillerTeam = GetTeam(pPlayer->m_iTeam); + const char *VictimTeam = GetTeam(pVictim->m_iTeam); + const char *KillerTeam = (pPlayer != NULL) ? GetTeam(pPlayer->m_iTeam) : ""; UTIL_LogPrintf("\"%s<%i><%s><%s>\" killed \"%s<%i><%s><%s>\" with \"%s\"\n", STRING(pKiller->netname), GETPLAYERUSERID(ENT(pKiller)), GETPLAYERAUTHID(ENT(pKiller)), KillerTeam, STRING(pVictim->pev->netname), GETPLAYERUSERID(pVictim->edict()), GETPLAYERAUTHID(pVictim->edict()), VictimTeam, killer_weapon_name); @@ -4205,7 +4197,7 @@ skipwhite: if (!data[0]) return NULL; - data++; + ++data; } c = *data; @@ -4214,7 +4206,7 @@ skipwhite: if (c == '/' && data[1] == '/') { while (*data && *data != '\n') - data++; + ++data; goto skipwhite; // start over new line } @@ -4222,7 +4214,7 @@ skipwhite: // handle quoted strings specially: copy till the end or another quote if (c == '\"') { - data++; // skip starting quote + ++data; // skip starting quote while (true) { @@ -4252,7 +4244,7 @@ skipwhite: do { mp_com_token[ len++ ] = c; - data++; + ++data; c = *data; if (c == '{' || c == '}'|| c == ')'|| c == '(' || c == '\'' || c == ',') @@ -4275,7 +4267,7 @@ int MP_COM_TokenWaiting(char *buffer) if (!isspace(*p) || isalnum(*p)) return 1; - p++; + ++p; } return 0; @@ -4434,7 +4426,7 @@ void ExtractCommandString(char *s, char *szCommand) char *o; if (*s == '\\') - s++; + ++s; while (true) { @@ -4450,7 +4442,7 @@ void ExtractCommandString(char *s, char *szCommand) } *o = '\0'; - s++; + ++s; o = value; @@ -4479,7 +4471,7 @@ void ExtractCommandString(char *s, char *szCommand) return; } - s++; + ++s; } } @@ -4501,7 +4493,7 @@ void CHalfLifeMultiplay::ResetAllMapVotes() } } - for (int j = 0; j < MAX_VOTE_MAPS; j++) + for (int j = 0; j < MAX_VOTE_MAPS; ++j) m_iMapVotes[j] = 0; } @@ -4600,10 +4592,10 @@ void CHalfLifeMultiplay::ProcessMapVote(CBasePlayer *player, int iVote) if (pTempPlayer->m_iTeam != UNASSIGNED) { - iNumPlayers++; + ++iNumPlayers; if (pTempPlayer->m_iMapVote = iVote) - iValidVotes++; + ++iValidVotes; } } @@ -4822,307 +4814,3 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(ClientUserInfoChanged)(CBasePlayer *pPlaye pPlayer->SetPlayerModel(pPlayer->m_bHasC4); pPlayer->SetPrefsFromUserinfo(infobuffer); } - -#ifdef HOOK_GAMEDLL - -void CMapInfo::Spawn() -{ - Spawn_(); -} - -void CMapInfo::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -bool CCStrikeGameMgrHelper::CanPlayerHearPlayer(CBasePlayer *pListener, CBasePlayer *pSender) -{ - return CanPlayerHearPlayer_(pListener, pSender); -} - -void CHalfLifeMultiplay::RefreshSkillData() -{ - RefreshSkillData_(); -} - -void CHalfLifeMultiplay::Think() -{ - Think_(); -} - -BOOL CHalfLifeMultiplay::IsAllowedToSpawn(CBaseEntity *pEntity) -{ - return IsAllowedToSpawn_(pEntity); -} - -BOOL CHalfLifeMultiplay::FAllowFlashlight() -{ - return FAllowFlashlight_(); -} - -BOOL CHalfLifeMultiplay::FShouldSwitchWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon) -{ - return FShouldSwitchWeapon_(pPlayer, pWeapon); -} - -BOOL CHalfLifeMultiplay::GetNextBestWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeapon) -{ - return GetNextBestWeapon_(pPlayer, pCurrentWeapon); -} - -BOOL CHalfLifeMultiplay::IsMultiplayer() -{ - return IsMultiplayer_(); -} - -BOOL CHalfLifeMultiplay::IsDeathmatch() -{ - return IsDeathmatch_(); -} - -BOOL CHalfLifeMultiplay::IsCoOp() -{ - return IsCoOp_(); -} - -BOOL CHalfLifeMultiplay::ClientConnected(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[128]) -{ - return ClientConnected_(pEntity, pszName, pszAddress, szRejectReason); -} - -void CHalfLifeMultiplay::InitHUD(CBasePlayer *pl) -{ - InitHUD_(pl); -} - -void CHalfLifeMultiplay::ClientDisconnected(edict_t *pClient) -{ - ClientDisconnected_(pClient); -} - -void CHalfLifeMultiplay::UpdateGameMode(CBasePlayer *pPlayer) -{ - UpdateGameMode_(pPlayer); -} - -float CHalfLifeMultiplay::FlPlayerFallDamage(CBasePlayer *pPlayer) -{ - return FlPlayerFallDamage_(pPlayer); -} - -BOOL CHalfLifeMultiplay::FPlayerCanTakeDamage(CBasePlayer *pPlayer, CBaseEntity *pAttacker) -{ - return FPlayerCanTakeDamage_(pPlayer, pAttacker); -} - -void CHalfLifeMultiplay::PlayerSpawn(CBasePlayer *pPlayer) -{ - PlayerSpawn_(pPlayer); -} - -void CHalfLifeMultiplay::PlayerThink(CBasePlayer *pPlayer) -{ - PlayerThink_(pPlayer); -} - -BOOL CHalfLifeMultiplay::FPlayerCanRespawn(CBasePlayer *pPlayer) -{ - return FPlayerCanRespawn_(pPlayer); -} - -float CHalfLifeMultiplay::FlPlayerSpawnTime(CBasePlayer *pPlayer) -{ - return FlPlayerSpawnTime_(pPlayer); -} - -edict_t *CHalfLifeMultiplay::GetPlayerSpawnSpot(CBasePlayer *pPlayer) -{ - return GetPlayerSpawnSpot_(pPlayer); -} - -BOOL CHalfLifeMultiplay::AllowAutoTargetCrosshair() -{ - return AllowAutoTargetCrosshair_(); -} - -BOOL CHalfLifeMultiplay::ClientCommand_DeadOrAlive(CBasePlayer *pPlayer, const char *pcmd) -{ - return ClientCommand_DeadOrAlive_(pPlayer, pcmd); -} - -BOOL CHalfLifeMultiplay::ClientCommand(CBasePlayer *pPlayer, const char *pcmd) -{ - return ClientCommand_(pPlayer, pcmd); -} - -void CHalfLifeMultiplay::ClientUserInfoChanged(CBasePlayer *pPlayer, char *infobuffer) -{ - ClientUserInfoChanged_(pPlayer, infobuffer); -} - -int CHalfLifeMultiplay::IPointsForKill(CBasePlayer *pAttacker, CBasePlayer *pKilled) -{ - return IPointsForKill_(pAttacker, pKilled); -} - -void CHalfLifeMultiplay::PlayerKilled(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor) -{ - PlayerKilled_(pVictim, pKiller, pInflictor); -} - -void CHalfLifeMultiplay::DeathNotice(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor) -{ - DeathNotice_(pVictim, pKiller, pInflictor); -} - -BOOL CHalfLifeMultiplay::CanHavePlayerItem(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon) -{ - return CanHavePlayerItem_(pPlayer, pWeapon); -} - -void CHalfLifeMultiplay::PlayerGotWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon) -{ - PlayerGotWeapon_(pPlayer, pWeapon); -} - -int CHalfLifeMultiplay::WeaponShouldRespawn(CBasePlayerItem *pWeapon) -{ - return WeaponShouldRespawn_(pWeapon); -} - -float CHalfLifeMultiplay::FlWeaponRespawnTime(CBasePlayerItem *pWeapon) -{ - return FlWeaponRespawnTime_(pWeapon); -} - -float CHalfLifeMultiplay::FlWeaponTryRespawn(CBasePlayerItem *pWeapon) -{ - return FlWeaponTryRespawn_(pWeapon); -} - -Vector CHalfLifeMultiplay::VecWeaponRespawnSpot(CBasePlayerItem *pWeapon) -{ - return VecWeaponRespawnSpot_(pWeapon); -} - -BOOL CHalfLifeMultiplay::CanHaveItem(CBasePlayer *pPlayer, CItem *pItem) -{ - return CanHaveItem_(pPlayer, pItem); -} - -void CHalfLifeMultiplay::PlayerGotItem(CBasePlayer *pPlayer, CItem *pItem) -{ - PlayerGotItem_(pPlayer, pItem); -} - -int CHalfLifeMultiplay::ItemShouldRespawn(CItem *pItem) -{ - return ItemShouldRespawn_(pItem); -} - -float CHalfLifeMultiplay::FlItemRespawnTime(CItem *pItem) -{ - return FlItemRespawnTime_(pItem); -} - -Vector CHalfLifeMultiplay::VecItemRespawnSpot(CItem *pItem) -{ - return VecItemRespawnSpot_(pItem); -} - -void CHalfLifeMultiplay::PlayerGotAmmo(CBasePlayer *pPlayer, char *szName, int iCount) -{ - PlayerGotAmmo_(pPlayer, szName, iCount); -} - -int CHalfLifeMultiplay::AmmoShouldRespawn(CBasePlayerAmmo *pAmmo) -{ - return AmmoShouldRespawn_(pAmmo); -} - -float CHalfLifeMultiplay::FlAmmoRespawnTime(CBasePlayerAmmo *pAmmo) -{ - return FlAmmoRespawnTime_(pAmmo); -} - -Vector CHalfLifeMultiplay::VecAmmoRespawnSpot(CBasePlayerAmmo *pAmmo) -{ - return VecAmmoRespawnSpot_(pAmmo); -} - -float CHalfLifeMultiplay::FlHealthChargerRechargeTime() -{ - return FlHealthChargerRechargeTime_(); -} - -float CHalfLifeMultiplay::FlHEVChargerRechargeTime() -{ - return FlHEVChargerRechargeTime_(); -} - -int CHalfLifeMultiplay::DeadPlayerWeapons(CBasePlayer *pPlayer) -{ - return DeadPlayerWeapons_(pPlayer); -} - -int CHalfLifeMultiplay::DeadPlayerAmmo(CBasePlayer *pPlayer) -{ - return DeadPlayerAmmo_(pPlayer); -} - -int CHalfLifeMultiplay::PlayerRelationship(CBasePlayer *pPlayer, CBaseEntity *pTarget) -{ - return PlayerRelationship_(pPlayer, pTarget); -} - -BOOL CHalfLifeMultiplay::FAllowMonsters() -{ - return FAllowMonsters_(); -} - -void CHalfLifeMultiplay::ServerDeactivate() -{ - ServerDeactivate_(); -} - -void CHalfLifeMultiplay::CheckMapConditions() -{ - CheckMapConditions_(); -} - -void CHalfLifeMultiplay::CleanUpMap() -{ - CleanUpMap_(); -} - -void CHalfLifeMultiplay::RestartRound() -{ - RestartRound_(); -} - -void CHalfLifeMultiplay::CheckWinConditions() -{ - CheckWinConditions_(); -} - -void CHalfLifeMultiplay::RemoveGuns() -{ - RemoveGuns_(); -} - -void CHalfLifeMultiplay::GiveC4() -{ - GiveC4_(); -} - -void CHalfLifeMultiplay::ChangeLevel() -{ - ChangeLevel_(); -} - -void CHalfLifeMultiplay::GoToIntermission() -{ - GoToIntermission_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/nodes.h b/regamedll/dlls/nodes.h index 61d29d16..f33b590d 100644 --- a/regamedll/dlls/nodes.h +++ b/regamedll/dlls/nodes.h @@ -43,36 +43,26 @@ class CLink { public: entvars_t *m_pLinkEnt; - -};/* size: 4, cachelines: 1, members: 1 */ +}; class CGraph { public: - void InitGraph(void); - int AllocNodes(void); + void InitGraph(); + int AllocNodes(); int CheckNODFile(char *szMapName); int FLoadGraph(char *szMapName); - int FSetGraphPointers(void); + int FSetGraphPointers(); void ShowNodeConnections(int iNode); int FindNearestNode(const Vector &vecOrigin, CBaseEntity *pEntity); int FindNearestNode(const Vector &vecOrigin, int afNodeTypes); + public: BOOL m_fGraphPresent; BOOL m_fGraphPointersSet; int m_cLinks; CLink *m_pLinkPool; - -};/* size: 16, cachelines: 1, members: 4 */ - -#ifdef HOOK_GAMEDLL - -#define WorldGraph (*pWorldGraph) - -typedef int (CGraph::*FIND_NEAREST_NODE_ENTITY)(const Vector &, CBaseEntity *); -typedef int (CGraph::*FIND_NEAREST_NODE_INT)(const Vector &, int); - -#endif //HOOK_GAMEDLL +}; extern CGraph WorldGraph; diff --git a/regamedll/dlls/observer.cpp b/regamedll/dlls/observer.cpp index 142a8330..3a932ebf 100644 --- a/regamedll/dlls/observer.cpp +++ b/regamedll/dlls/observer.cpp @@ -38,8 +38,7 @@ CBaseEntity *CBasePlayer::Observer_IsValidTarget(int iPlayerIndex, bool bSameTea if (iPlayerIndex > gpGlobals->maxClients || iPlayerIndex < 1) return NULL; - CBasePlayer *pEnt = (CBasePlayer *)UTIL_PlayerByIndex(iPlayerIndex); - + CBasePlayer *pEnt = static_cast(UTIL_PlayerByIndex(iPlayerIndex)); return g_ReGameHookchains.m_Observer_IsValidTarget.callChain(Observer_IsValidTarget_api, this, pEnt, iPlayerIndex, bSameTeam); } @@ -59,7 +58,7 @@ void UpdateClientEffects(CBasePlayer *pObserver, int oldMode) if (pObserver->m_hObserverTarget->IsPlayer()) { - CBasePlayer *pPlayer = reinterpret_cast(UTIL_PlayerByIndex(ENTINDEX(pObserver->m_hObserverTarget->edict()))); + CBasePlayer *pPlayer = static_cast(UTIL_PlayerByIndex(pObserver->m_hObserverTarget->entindex())); if (pPlayer) { @@ -177,7 +176,7 @@ void CBasePlayer::Observer_FindNextPlayer(bool bReverse, const char *name) if (!name) break; - pPlayer = reinterpret_cast(UTIL_PlayerByIndex(ENTINDEX(m_hObserverTarget->edict()))); + pPlayer = static_cast(UTIL_PlayerByIndex(m_hObserverTarget->entindex())); if (!Q_strcmp(name, STRING(pPlayer->pev->netname))) break; @@ -210,7 +209,7 @@ void CBasePlayer::Observer_FindNextPlayer(bool bReverse, const char *name) // Handle buttons in observer mode /* <11c9ac> ../cstrike/dlls/observer.cpp:254 */ -void CBasePlayer::Observer_HandleButtons(void) +void CBasePlayer::Observer_HandleButtons() { // Slow down mouse clicks if (m_flNextObserverInput > gpGlobals->time) @@ -260,7 +259,7 @@ void CBasePlayer::Observer_HandleButtons(void) } /* <11c9d3> ../cstrike/dlls/observer.cpp:304 */ -void CBasePlayer::Observer_CheckTarget(void) +void CBasePlayer::Observer_CheckTarget() { if (pev->iuser1 == OBS_ROAMING && !m_bWasFollowing) return; @@ -283,7 +282,7 @@ void CBasePlayer::Observer_CheckTarget(void) if (m_hObserverTarget) { int iPlayerIndex = ENTINDEX(m_hObserverTarget->edict()); - CBasePlayer *target = reinterpret_cast(UTIL_PlayerByIndex(iPlayerIndex)); + CBasePlayer *target = static_cast(UTIL_PlayerByIndex(iPlayerIndex)); // check taget if (!target || target->pev->deadflag == DEAD_RESPAWNABLE || (target->pev->effects & EF_NODRAW)) @@ -315,12 +314,12 @@ void CBasePlayer::Observer_CheckTarget(void) } /* <11cb26> ../cstrike/dlls/observer.cpp:380 */ -void CBasePlayer::Observer_CheckProperties(void) +void CBasePlayer::Observer_CheckProperties() { // try to find a traget if we have no current one if (pev->iuser1 == OBS_IN_EYE && m_hObserverTarget != NULL) { - CBasePlayer *target = reinterpret_cast(UTIL_PlayerByIndex(ENTINDEX(m_hObserverTarget->edict()))); + CBasePlayer *target = static_cast(UTIL_PlayerByIndex(m_hObserverTarget->entindex())); if (!target) return; diff --git a/regamedll/dlls/pathcorner.cpp b/regamedll/dlls/pathcorner.cpp index e9a6c3dd..0a16d761 100644 --- a/regamedll/dlls/pathcorner.cpp +++ b/regamedll/dlls/pathcorner.cpp @@ -4,12 +4,12 @@ * Globals initialization */ #ifndef HOOK_GAMEDLL - + TYPEDESCRIPTION CPathCorner::m_SaveData[] = { DEFINE_FIELD(CPathCorner, m_flWait, FIELD_FLOAT), -}; - +}; + TYPEDESCRIPTION CPathTrack::m_SaveData[] = { DEFINE_FIELD(CPathTrack, m_length, FIELD_FLOAT), @@ -17,418 +17,358 @@ TYPEDESCRIPTION CPathTrack::m_SaveData[] = DEFINE_FIELD(CPathTrack, m_paltpath, FIELD_CLASSPTR), DEFINE_FIELD(CPathTrack, m_pprevious, FIELD_CLASSPTR), DEFINE_FIELD(CPathTrack, m_altName, FIELD_STRING), -}; - -#else - -TYPEDESCRIPTION IMPL_CLASS(CPathCorner, m_SaveData)[1]; -TYPEDESCRIPTION IMPL_CLASS(CPathTrack, m_SaveData)[5]; - -#endif // HOOK_GAMEDLL - -/* <122843> ../cstrike/dlls/pathcorner.cpp:41 */ -LINK_ENTITY_TO_CLASS(path_corner, CPathCorner); - -/* <1225b6> ../cstrike/dlls/pathcorner.cpp:49 */ -IMPLEMENT_SAVERESTORE(CPathCorner, CPointEntity); - -/* <122697> ../cstrike/dlls/pathcorner.cpp:54 */ -void CPathCorner::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) -{ - if (FStrEq(pkvd->szKeyName, "wait")) - { - m_flWait = Q_atof(pkvd->szValue); - pkvd->fHandled = TRUE; - } - else - CPointEntity::KeyValue(pkvd); -} - -/* <122325> ../cstrike/dlls/pathcorner.cpp:66 */ -void CPathCorner::__MAKE_VHOOK(Spawn)(void) -{ - assert(("path_corner without a targetname", !FStringNull(pev->targetname))); -} - -/* <12256a> ../cstrike/dlls/pathcorner.cpp:80 */ -IMPLEMENT_SAVERESTORE(CPathTrack, CBaseEntity); - -/* <12290d> ../cstrike/dlls/pathcorner.cpp:81 */ -LINK_ENTITY_TO_CLASS(path_track, CPathTrack); - -/* <122602> ../cstrike/dlls/pathcorner.cpp:86 */ -void CPathTrack::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) -{ - if (FStrEq(pkvd->szKeyName, "altpath")) - { - m_altName = ALLOC_STRING(pkvd->szValue); - pkvd->fHandled = TRUE; - } - else - CPointEntity::KeyValue(pkvd); -} - -/* <122433> ../cstrike/dlls/pathcorner.cpp:97 */ -void CPathTrack::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - int on; - - // Use toggles between two paths - if (m_paltpath) - { - on = !(pev->spawnflags & SF_PATH_ALTERNATE); - - if (ShouldToggle(useType, on)) - { - if (on) - pev->spawnflags |= SF_PATH_ALTERNATE; - else - pev->spawnflags &= ~SF_PATH_ALTERNATE; - } - } - else // Use toggles between enabled/disabled - { - on = !(pev->spawnflags & SF_PATH_DISABLED); - - if (ShouldToggle(useType, on)) - { - if (on) - pev->spawnflags |= SF_PATH_DISABLED; - else - pev->spawnflags &= ~SF_PATH_DISABLED; - } - } -} - -/* <122a12> ../cstrike/dlls/pathcorner.cpp:128 */ -void CPathTrack::Link(void) -{ - edict_t *pentTarget; - - if (!FStringNull(pev->target)) - { - pentTarget = FIND_ENTITY_BY_TARGETNAME(NULL, STRING(pev->target)); - if (!FNullEnt(pentTarget)) - { - m_pnext = CPathTrack::Instance(pentTarget); - - // If no next pointer, this is the end of a path - if (m_pnext != NULL) - { - m_pnext->SetPrevious(this); - } - } - else - ALERT(at_console, "Dead end link %s\n", STRING(pev->target)); - } - - // Find "alternate" path - if (!FStringNull(m_altName)) - { - pentTarget = FIND_ENTITY_BY_TARGETNAME(NULL, STRING(m_altName)); - if (!FNullEnt(pentTarget)) - { - m_paltpath = CPathTrack::Instance(pentTarget); - - // If no next pointer, this is the end of a path - if (m_paltpath != NULL) - { - m_paltpath->SetPrevious(this); - } - } - } -} - -/* <12239a> ../cstrike/dlls/pathcorner.cpp:165 */ -void CPathTrack::__MAKE_VHOOK(Spawn)(void) -{ - pev->solid = SOLID_TRIGGER; - UTIL_SetSize(pev, Vector(-8, -8, -8), Vector(8, 8, 8)); - - m_pnext = NULL; - m_pprevious = NULL; -} - -/* <122c76> ../cstrike/dlls/pathcorner.cpp:180 */ -void CPathTrack::__MAKE_VHOOK(Activate)(void) -{ - // Link to next, and back-link - if (!FStringNull(pev->targetname)) - { - Link(); - } -} - -/* <122c9c> ../cstrike/dlls/pathcorner.cpp:186 */ -CPathTrack *CPathTrack::ValidPath(CPathTrack *ppath, int testFlag) -{ - if (!ppath) - return NULL; - - if (testFlag && (ppath->pev->spawnflags & SF_PATH_DISABLED)) - return NULL; - - return ppath; -} - -/* <122745> ../cstrike/dlls/pathcorner.cpp:198 */ -void CPathTrack::Project(CPathTrack *pstart, CPathTrack *pend, Vector *origin, float dist) -{ - if (pstart && pend) - { - Vector dir = (pend->pev->origin - pstart->pev->origin); - dir = dir.Normalize(); - - *origin = pend->pev->origin + dir * dist; - } -} - -/* <122d0f> ../cstrike/dlls/pathcorner.cpp:208 */ -CPathTrack *CPathTrack::GetNext(void) -{ - if (m_paltpath && (pev->spawnflags & SF_PATH_ALTERNATE) && !(pev->spawnflags & SF_PATH_ALTREVERSE)) - { - return m_paltpath; - } - - return m_pnext; -} - -/* <122d30> ../cstrike/dlls/pathcorner.cpp:218 */ -CPathTrack *CPathTrack::GetPrevious(void) -{ - if (m_paltpath && (pev->spawnflags & SF_PATH_ALTERNATE) && (pev->spawnflags & SF_PATH_ALTREVERSE)) - { - return m_paltpath; - } - - return m_pprevious; -} - -/* <122d51> ../cstrike/dlls/pathcorner.cpp:228 */ -void CPathTrack::SetPrevious(CPathTrack *pprev) -{ - // Only set previous if this isn't my alternate path - if (pprev && !FStrEq(STRING(pprev->pev->targetname), STRING(m_altName))) - { - m_pprevious = pprev; - } -} - -// Assumes this is ALWAYS enabled - -/* <122d95> ../cstrike/dlls/pathcorner.cpp:237 */ -CPathTrack *CPathTrack::LookAhead(Vector *origin, float dist, int move) -{ - CPathTrack *pcurrent; - float originalDist = dist; - - pcurrent = this; - Vector currentPos = *origin; - - // Travelling backwards through path - if (dist < 0) - { - dist = -dist; - while (dist > 0) - { - Vector dir = pcurrent->pev->origin - currentPos; - float_precision length = dir.Length(); - - if (!length) - { - // If there is no previous node, or it's disabled, return now. - if (!ValidPath(pcurrent->GetPrevious(), move)) - { - if (!move) - { - Project(pcurrent->GetNext(), pcurrent, origin, dist); - } - - return NULL; - } - - pcurrent = pcurrent->GetPrevious(); - } - // enough left in this path to move - else if (length > dist) - { - *origin = currentPos + (dir * ((float)(dist / length))); - return pcurrent; - } - else - { - dist -= length; - currentPos = pcurrent->pev->origin; - *origin = currentPos; - - // If there is no previous node, or it's disabled, return now. - if (!ValidPath(pcurrent->GetPrevious(), move)) - { - return NULL; - } - - pcurrent = pcurrent->GetPrevious(); - } - } - - *origin = currentPos; - return pcurrent; - } - else - { - // #96 line - while (dist > 0) - { - // If there is no next node, or it's disabled, return now. - if (!ValidPath(pcurrent->GetNext(), move)) - { - if (!move) - { - Project(pcurrent->GetPrevious(), pcurrent, origin, dist); - } - - return NULL; - } - - Vector dir = pcurrent->GetNext()->pev->origin - currentPos; - float_precision length = dir.Length(); - - if (!length && !ValidPath(pcurrent->GetNext()->GetNext(), move)) - { - // HACK -- up against a dead end - if (dist == originalDist) - return NULL; - - return pcurrent; - } - - // enough left in this path to move - if (length > dist) - { - *origin = currentPos + (dir * ((float)(dist / length))); - return pcurrent; - } - else - { - dist -= length; - currentPos = pcurrent->GetNext()->pev->origin; - pcurrent = pcurrent->GetNext(); - - *origin = currentPos; - } - } - - *origin = currentPos; - } - - return pcurrent; -} - -// Assumes this is ALWAYS enabled - -/* <123220> ../cstrike/dlls/pathcorner.cpp:320 */ -CPathTrack *CPathTrack::Nearest(Vector origin) -{ - int deadCount; - float minDist, dist; - Vector delta; - CPathTrack *ppath, *pnearest; - - delta = origin - pev->origin; - delta.z = 0; - minDist = delta.Length(); - pnearest = this; - ppath = GetNext(); - - // Hey, I could use the old 2 racing pointers solution to this, but I'm lazy :) - deadCount = 0; - while (ppath != NULL && ppath != this) - { - deadCount++; - if (deadCount > 9999) - { - ALERT(at_error, "Bad sequence of path_tracks from %s", STRING(pev->targetname)); - return NULL; - } - - delta = origin - ppath->pev->origin; - delta.z = 0; - dist = delta.Length(); - - if (dist < minDist) - { - minDist = dist; - pnearest = ppath; - } - - ppath = ppath->GetNext(); - } - - return pnearest; -} - -/* <123375> ../cstrike/dlls/pathcorner.cpp:358 */ -CPathTrack *CPathTrack::Instance(edict_t *pent) -{ - if (FClassnameIs(pent, "path_track")) - { - return (CPathTrack *)GET_PRIVATE(pent); - } - - return NULL; -} - -#ifdef HOOK_GAMEDLL - -void CPathCorner::Spawn(void) -{ - Spawn_(); -} - -void CPathCorner::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -int CPathCorner::Save(CSave &save) -{ - return Save_(save); -} - -int CPathCorner::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -void CPathTrack::Spawn(void) -{ - Spawn_(); -} - -void CPathTrack::KeyValue(KeyValueData* pkvd) -{ - KeyValue_(pkvd); -} - -int CPathTrack::Save(CSave &save) -{ - return Save_(save); -} - -int CPathTrack::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -void CPathTrack::Activate(void) -{ - Activate_(); -} - -void CPathTrack::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} +}; #endif // HOOK_GAMEDLL + +/* <122843> ../cstrike/dlls/pathcorner.cpp:41 */ +LINK_ENTITY_TO_CLASS(path_corner, CPathCorner); + +/* <1225b6> ../cstrike/dlls/pathcorner.cpp:49 */ +IMPLEMENT_SAVERESTORE(CPathCorner, CPointEntity); + +/* <122697> ../cstrike/dlls/pathcorner.cpp:54 */ +void CPathCorner::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) +{ + if (FStrEq(pkvd->szKeyName, "wait")) + { + m_flWait = Q_atof(pkvd->szValue); + pkvd->fHandled = TRUE; + } + else + CPointEntity::KeyValue(pkvd); +} + +/* <122325> ../cstrike/dlls/pathcorner.cpp:66 */ +void CPathCorner::__MAKE_VHOOK(Spawn)() +{ + assert(("path_corner without a targetname", !FStringNull(pev->targetname))); +} + +/* <12256a> ../cstrike/dlls/pathcorner.cpp:80 */ +IMPLEMENT_SAVERESTORE(CPathTrack, CBaseEntity); + +/* <12290d> ../cstrike/dlls/pathcorner.cpp:81 */ +LINK_ENTITY_TO_CLASS(path_track, CPathTrack); + +/* <122602> ../cstrike/dlls/pathcorner.cpp:86 */ +void CPathTrack::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) +{ + if (FStrEq(pkvd->szKeyName, "altpath")) + { + m_altName = ALLOC_STRING(pkvd->szValue); + pkvd->fHandled = TRUE; + } + else + CPointEntity::KeyValue(pkvd); +} + +/* <122433> ../cstrike/dlls/pathcorner.cpp:97 */ +void CPathTrack::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) +{ + int on; + + // Use toggles between two paths + if (m_paltpath) + { + on = !(pev->spawnflags & SF_PATH_ALTERNATE); + + if (ShouldToggle(useType, on)) + { + if (on) + pev->spawnflags |= SF_PATH_ALTERNATE; + else + pev->spawnflags &= ~SF_PATH_ALTERNATE; + } + } + else // Use toggles between enabled/disabled + { + on = !(pev->spawnflags & SF_PATH_DISABLED); + + if (ShouldToggle(useType, on)) + { + if (on) + pev->spawnflags |= SF_PATH_DISABLED; + else + pev->spawnflags &= ~SF_PATH_DISABLED; + } + } +} + +/* <122a12> ../cstrike/dlls/pathcorner.cpp:128 */ +void CPathTrack::Link() +{ + edict_t *pentTarget; + + if (!FStringNull(pev->target)) + { + pentTarget = FIND_ENTITY_BY_TARGETNAME(NULL, STRING(pev->target)); + if (!FNullEnt(pentTarget)) + { + m_pnext = CPathTrack::Instance(pentTarget); + + // If no next pointer, this is the end of a path + if (m_pnext != NULL) + { + m_pnext->SetPrevious(this); + } + } + else + ALERT(at_console, "Dead end link %s\n", STRING(pev->target)); + } + + // Find "alternate" path + if (!FStringNull(m_altName)) + { + pentTarget = FIND_ENTITY_BY_TARGETNAME(NULL, STRING(m_altName)); + if (!FNullEnt(pentTarget)) + { + m_paltpath = CPathTrack::Instance(pentTarget); + + // If no next pointer, this is the end of a path + if (m_paltpath != NULL) + { + m_paltpath->SetPrevious(this); + } + } + } +} + +/* <12239a> ../cstrike/dlls/pathcorner.cpp:165 */ +void CPathTrack::__MAKE_VHOOK(Spawn)() +{ + pev->solid = SOLID_TRIGGER; + UTIL_SetSize(pev, Vector(-8, -8, -8), Vector(8, 8, 8)); + + m_pnext = NULL; + m_pprevious = NULL; +} + +/* <122c76> ../cstrike/dlls/pathcorner.cpp:180 */ +void CPathTrack::__MAKE_VHOOK(Activate)() +{ + // Link to next, and back-link + if (!FStringNull(pev->targetname)) + { + Link(); + } +} + +/* <122c9c> ../cstrike/dlls/pathcorner.cpp:186 */ +CPathTrack *CPathTrack::ValidPath(CPathTrack *ppath, int testFlag) +{ + if (!ppath) + return NULL; + + if (testFlag && (ppath->pev->spawnflags & SF_PATH_DISABLED)) + return NULL; + + return ppath; +} + +/* <122745> ../cstrike/dlls/pathcorner.cpp:198 */ +void CPathTrack::Project(CPathTrack *pstart, CPathTrack *pend, Vector *origin, float dist) +{ + if (pstart && pend) + { + Vector dir = (pend->pev->origin - pstart->pev->origin); + dir = dir.Normalize(); + + *origin = pend->pev->origin + dir * dist; + } +} + +/* <122d0f> ../cstrike/dlls/pathcorner.cpp:208 */ +CPathTrack *CPathTrack::GetNext() +{ + if (m_paltpath && (pev->spawnflags & SF_PATH_ALTERNATE) && !(pev->spawnflags & SF_PATH_ALTREVERSE)) + { + return m_paltpath; + } + + return m_pnext; +} + +/* <122d30> ../cstrike/dlls/pathcorner.cpp:218 */ +CPathTrack *CPathTrack::GetPrevious() +{ + if (m_paltpath && (pev->spawnflags & SF_PATH_ALTERNATE) && (pev->spawnflags & SF_PATH_ALTREVERSE)) + { + return m_paltpath; + } + + return m_pprevious; +} + +/* <122d51> ../cstrike/dlls/pathcorner.cpp:228 */ +void CPathTrack::SetPrevious(CPathTrack *pprev) +{ + // Only set previous if this isn't my alternate path + if (pprev && !FStrEq(STRING(pprev->pev->targetname), STRING(m_altName))) + { + m_pprevious = pprev; + } +} + +// Assumes this is ALWAYS enabled + +/* <122d95> ../cstrike/dlls/pathcorner.cpp:237 */ +CPathTrack *CPathTrack::LookAhead(Vector *origin, float dist, int move) +{ + CPathTrack *pcurrent; + float originalDist = dist; + + pcurrent = this; + Vector currentPos = *origin; + + // Travelling backwards through path + if (dist < 0) + { + dist = -dist; + while (dist > 0) + { + Vector dir = pcurrent->pev->origin - currentPos; + float_precision length = dir.Length(); + + if (!length) + { + // If there is no previous node, or it's disabled, return now. + if (!ValidPath(pcurrent->GetPrevious(), move)) + { + if (!move) + { + Project(pcurrent->GetNext(), pcurrent, origin, dist); + } + + return NULL; + } + + pcurrent = pcurrent->GetPrevious(); + } + // enough left in this path to move + else if (length > dist) + { + *origin = currentPos + (dir * ((float)(dist / length))); + return pcurrent; + } + else + { + dist -= length; + currentPos = pcurrent->pev->origin; + *origin = currentPos; + + // If there is no previous node, or it's disabled, return now. + if (!ValidPath(pcurrent->GetPrevious(), move)) + { + return NULL; + } + + pcurrent = pcurrent->GetPrevious(); + } + } + + *origin = currentPos; + return pcurrent; + } + else + { + // #96 line + while (dist > 0) + { + // If there is no next node, or it's disabled, return now. + if (!ValidPath(pcurrent->GetNext(), move)) + { + if (!move) + { + Project(pcurrent->GetPrevious(), pcurrent, origin, dist); + } + + return NULL; + } + + Vector dir = pcurrent->GetNext()->pev->origin - currentPos; + float_precision length = dir.Length(); + + if (!length && !ValidPath(pcurrent->GetNext()->GetNext(), move)) + { + // HACK -- up against a dead end + if (dist == originalDist) + return NULL; + + return pcurrent; + } + + // enough left in this path to move + if (length > dist) + { + *origin = currentPos + (dir * ((float)(dist / length))); + return pcurrent; + } + else + { + dist -= length; + currentPos = pcurrent->GetNext()->pev->origin; + pcurrent = pcurrent->GetNext(); + + *origin = currentPos; + } + } + + *origin = currentPos; + } + + return pcurrent; +} + +// Assumes this is ALWAYS enabled + +/* <123220> ../cstrike/dlls/pathcorner.cpp:320 */ +CPathTrack *CPathTrack::Nearest(Vector origin) +{ + int deadCount; + float minDist, dist; + Vector delta; + CPathTrack *ppath, *pnearest; + + delta = origin - pev->origin; + delta.z = 0; + minDist = delta.Length(); + pnearest = this; + ppath = GetNext(); + + // Hey, I could use the old 2 racing pointers solution to this, but I'm lazy :) + deadCount = 0; + while (ppath != NULL && ppath != this) + { + if (++deadCount > 9999) + { + ALERT(at_error, "Bad sequence of path_tracks from %s", STRING(pev->targetname)); + return NULL; + } + + delta = origin - ppath->pev->origin; + delta.z = 0; + dist = delta.Length(); + + if (dist < minDist) + { + minDist = dist; + pnearest = ppath; + } + + ppath = ppath->GetNext(); + } + + return pnearest; +} + +/* <123375> ../cstrike/dlls/pathcorner.cpp:358 */ +CPathTrack *CPathTrack::Instance(edict_t *pent) +{ + if (FClassnameIs(pent, "path_track")) + { + return (CPathTrack *)GET_PRIVATE(pent); + } + + return NULL; +} diff --git a/regamedll/dlls/pathcorner.h b/regamedll/dlls/pathcorner.h index 7370236e..9f8232c0 100644 --- a/regamedll/dlls/pathcorner.h +++ b/regamedll/dlls/pathcorner.h @@ -36,37 +36,27 @@ class CPathCorner: 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); - float GetDelay(void) - { - return m_flWait; - } #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); void KeyValue_(KeyValueData *pkvd); int Save_(CSave &save); int Restore_(CRestore &restore); #endif // HOOK_GAMEDLL + float GetDelay() const { return m_flWait; } + public: static TYPEDESCRIPTION IMPL(m_SaveData)[1]; private: float m_flWait; - -};/* size: 156, cachelines: 3, members: 3 */ - -#ifdef HOOK_GAMEDLL - -// linked objects -C_DLLEXPORT void path_corner(entvars_t *pev); - -#endif // HOOK_GAMEDLL +}; #endif // PATHCORNER_H diff --git a/regamedll/dlls/plane.cpp b/regamedll/dlls/plane.cpp index 0cdff259..e9ec1174 100644 --- a/regamedll/dlls/plane.cpp +++ b/regamedll/dlls/plane.cpp @@ -1,7 +1,7 @@ #include "precompiled.h" /* <1262b3> ../cstrike/dlls/plane.cpp:24 */ -CPlane::CPlane(void) +CPlane::CPlane() { m_fInitialized = FALSE; } diff --git a/regamedll/dlls/plane.h b/regamedll/dlls/plane.h index 1050e1e7..d158ae07 100644 --- a/regamedll/dlls/plane.h +++ b/regamedll/dlls/plane.h @@ -36,7 +36,7 @@ class CPlane { public: - CPlane(void); + CPlane(); NOXREF void InitializePlane(const Vector &vecNormal, const Vector &vecPoint); NOXREF BOOL PointInFront(const Vector &vecPoint); @@ -45,7 +45,6 @@ private: Vector m_vecNormal; float m_flDist; BOOL m_fInitialized; - -};/* size: 20, cachelines: 1, members: 3 */ +}; #endif // PLANE_H diff --git a/regamedll/dlls/plats.cpp b/regamedll/dlls/plats.cpp index b943ed6e..ff2c58cd 100644 --- a/regamedll/dlls/plats.cpp +++ b/regamedll/dlls/plats.cpp @@ -59,15 +59,6 @@ TYPEDESCRIPTION CGunTarget::m_SaveData[] = DEFINE_FIELD(CGunTarget, m_on, FIELD_BOOLEAN), }; -#else - -TYPEDESCRIPTION IMPL_CLASS(CBasePlatTrain, m_SaveData)[3]; -TYPEDESCRIPTION IMPL_CLASS(CFuncPlatRot, m_SaveData)[2]; -TYPEDESCRIPTION IMPL_CLASS(CFuncTrain, m_SaveData)[3]; -TYPEDESCRIPTION IMPL_CLASS(CFuncTrackTrain, m_SaveData)[12]; -TYPEDESCRIPTION IMPL_CLASS(CFuncTrackChange, m_SaveData)[9]; -TYPEDESCRIPTION IMPL_CLASS(CGunTarget, m_SaveData)[1]; - #endif // HOOK_GAMEDLL /* <12e11a> ../cstrike/dlls/plats.cpp:59 */ @@ -119,7 +110,7 @@ void CBasePlatTrain::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) #define noiseArrived noise1 /* <12d675> ../cstrike/dlls/plats.cpp:105 */ -void CBasePlatTrain::__MAKE_VHOOK(Precache)(void) +void CBasePlatTrain::__MAKE_VHOOK(Precache)() { // set the plat's "in-motion" sound switch (m_bMoveSnd) @@ -230,19 +221,19 @@ void CBasePlatTrain::__MAKE_VHOOK(Precache)(void) } /* <12d69c> ../cstrike/dlls/plats.cpp:235 */ -void CFuncPlat::CallGoDown(void) +void CFuncPlat::CallGoDown() { GoDown(); } /* <12d6c2> ../cstrike/dlls/plats.cpp:236 */ -void CFuncPlat::CallHitTop(void) +void CFuncPlat::CallHitTop() { HitTop(); } /* <12d6e8> ../cstrike/dlls/plats.cpp:237 */ -void CFuncPlat::CallHitBottom(void) +void CFuncPlat::CallHitBottom() { HitBottom(); } @@ -269,7 +260,7 @@ LINK_ENTITY_TO_CLASS(func_plat, CFuncPlat); // 2) chain slow /* <130730> ../cstrike/dlls/plats.cpp:275 */ -void CFuncPlat::Setup(void) +void CFuncPlat::Setup() { if (m_flTLength == 0) m_flTLength = 80; @@ -311,7 +302,7 @@ void CFuncPlat::Setup(void) } /* <13088e> ../cstrike/dlls/plats.cpp:309 */ -void CFuncPlat::__MAKE_VHOOK(Precache)(void) +void CFuncPlat::__MAKE_VHOOK(Precache)() { CBasePlatTrain::Precache(); @@ -323,7 +314,7 @@ void CFuncPlat::__MAKE_VHOOK(Precache)(void) } /* <130757> ../cstrike/dlls/plats.cpp:319 */ -void CFuncPlat::__MAKE_VHOOK(Spawn)(void) +void CFuncPlat::__MAKE_VHOOK(Spawn)() { Setup(); Precache(); @@ -446,7 +437,7 @@ void CFuncPlat::PlatUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE // Platform is at top, now starts moving down. /* <12e49b> ../cstrike/dlls/plats.cpp:431 */ -void CFuncPlat::__MAKE_VHOOK(GoDown)(void) +void CFuncPlat::__MAKE_VHOOK(GoDown)() { if (pev->noiseMovement) { @@ -463,7 +454,7 @@ void CFuncPlat::__MAKE_VHOOK(GoDown)(void) // Platform has hit bottom. Stops and waits forever. /* <12f381> ../cstrike/dlls/plats.cpp:446 */ -void CFuncPlat::__MAKE_VHOOK(HitBottom)(void) +void CFuncPlat::__MAKE_VHOOK(HitBottom)() { if (pev->noiseMovement) { @@ -483,7 +474,7 @@ void CFuncPlat::__MAKE_VHOOK(HitBottom)(void) // Platform is at bottom, now starts moving up /* <12e52d> ../cstrike/dlls/plats.cpp:462 */ -void CFuncPlat::__MAKE_VHOOK(GoUp)(void) +void CFuncPlat::__MAKE_VHOOK(GoUp)() { if (pev->noiseMovement) { @@ -500,7 +491,7 @@ void CFuncPlat::__MAKE_VHOOK(GoUp)(void) // Platform has hit top. Pauses, then starts back down again. /* <12f452> ../cstrike/dlls/plats.cpp:477 */ -void CFuncPlat::__MAKE_VHOOK(HitTop)(void) +void CFuncPlat::__MAKE_VHOOK(HitTop)() { if (pev->noiseMovement) { @@ -557,7 +548,7 @@ LINK_ENTITY_TO_CLASS(func_platrot, CFuncPlatRot); IMPLEMENT_SAVERESTORE(CFuncPlatRot, CFuncPlat); /* <130b48> ../cstrike/dlls/plats.cpp:543 */ -void CFuncPlatRot::SetupRotation(void) +void CFuncPlatRot::SetupRotation() { // This plat rotates too! if (m_vecFinalAngle.x != 0) @@ -580,14 +571,14 @@ void CFuncPlatRot::SetupRotation(void) } /* <130bc4> ../cstrike/dlls/plats.cpp:563 */ -void CFuncPlatRot::__MAKE_VHOOK(Spawn)(void) +void CFuncPlatRot::__MAKE_VHOOK(Spawn)() { CFuncPlat::Spawn(); SetupRotation(); } /* <12fe63> ../cstrike/dlls/plats.cpp:569 */ -void CFuncPlatRot::__MAKE_VHOOK(GoDown)(void) +void CFuncPlatRot::__MAKE_VHOOK(GoDown)() { CFuncPlat::GoDown(); RotMove(m_start, pev->nextthink - pev->ltime); @@ -596,7 +587,7 @@ void CFuncPlatRot::__MAKE_VHOOK(GoDown)(void) // Platform has hit bottom. Stops and waits forever. /* <12f430> ../cstrike/dlls/plats.cpp:579 */ -void CFuncPlatRot::__MAKE_VHOOK(HitBottom)(void) +void CFuncPlatRot::__MAKE_VHOOK(HitBottom)() { CFuncPlat::HitBottom(); pev->avelocity = g_vecZero; @@ -606,7 +597,7 @@ void CFuncPlatRot::__MAKE_VHOOK(HitBottom)(void) // Platform is at bottom, now starts moving up /* <12fdad> ../cstrike/dlls/plats.cpp:590 */ -void CFuncPlatRot::__MAKE_VHOOK(GoUp)(void) +void CFuncPlatRot::__MAKE_VHOOK(GoUp)() { CFuncPlat::GoUp(); RotMove(m_end, pev->nextthink - pev->ltime); @@ -615,7 +606,7 @@ void CFuncPlatRot::__MAKE_VHOOK(GoUp)(void) // Platform has hit top. Pauses, then starts back down again. /* <12f502> ../cstrike/dlls/plats.cpp:600 */ -void CFuncPlatRot::__MAKE_VHOOK(HitTop)(void) +void CFuncPlatRot::__MAKE_VHOOK(HitTop)() { CFuncPlat::HitTop(); pev->avelocity = g_vecZero; @@ -697,7 +688,7 @@ void CFuncTrain::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller } /* <12f914> ../cstrike/dlls/plats.cpp:713 */ -void CFuncTrain::Wait(void) +void CFuncTrain::Wait() { if (m_pevCurrentTarget != NULL) { @@ -755,7 +746,7 @@ void CFuncTrain::Wait(void) // Train next - path corner needs to change to next target /* <12f6a8> ../cstrike/dlls/plats.cpp:760 */ -void CFuncTrain::Next(void) +void CFuncTrain::Next() { CBaseEntity *pTarg; @@ -829,7 +820,7 @@ void CFuncTrain::Next(void) } /* <12e1fd> ../cstrike/dlls/plats.cpp:818 */ -void CFuncTrain::__MAKE_VHOOK(Activate)(void) +void CFuncTrain::__MAKE_VHOOK(Activate)() { // Not yet active, so teleport to first target if (!m_activated) @@ -866,7 +857,7 @@ void CFuncTrain::__MAKE_VHOOK(Activate)(void) // 1) ratchet metal /* <12dcad> ../cstrike/dlls/plats.cpp:852 */ -void CFuncTrain::__MAKE_VHOOK(Spawn)(void) +void CFuncTrain::__MAKE_VHOOK(Spawn)() { Precache(); @@ -902,7 +893,7 @@ void CFuncTrain::__MAKE_VHOOK(Spawn)(void) } /* <12dab7> ../cstrike/dlls/plats.cpp:886 */ -void CFuncTrain::__MAKE_VHOOK(Restart)(void) +void CFuncTrain::__MAKE_VHOOK(Restart)() { if (pev->speed == 0) pev->speed = 100; @@ -922,13 +913,13 @@ void CFuncTrain::__MAKE_VHOOK(Restart)(void) } /* <12d734> ../cstrike/dlls/plats.cpp:907 */ -void CFuncTrain::__MAKE_VHOOK(Precache)(void) +void CFuncTrain::__MAKE_VHOOK(Precache)() { CBasePlatTrain::Precache(); } /* <12e166> ../cstrike/dlls/plats.cpp:913 */ -void CFuncTrain::__MAKE_VHOOK(OverrideReset)(void) +void CFuncTrain::__MAKE_VHOOK(OverrideReset)() { CBaseEntity *pTarg; @@ -1113,7 +1104,7 @@ void FixupAngles(Vector &v) } /* <130eb3> ../cstrike/dlls/plats.cpp:1104 */ -void CFuncTrackTrain::StopSound(void) +void CFuncTrackTrain::StopSound() { // if sound playing, stop it if (m_soundPlaying && pev->noise) @@ -1131,7 +1122,7 @@ void CFuncTrackTrain::StopSound(void) } /* <12e31d> ../cstrike/dlls/plats.cpp:1130 */ -void CFuncTrackTrain::UpdateSound(void) +void CFuncTrackTrain::UpdateSound() { float flpitch; @@ -1169,7 +1160,7 @@ void CFuncTrackTrain::UpdateSound(void) } /* <130f1c> ../cstrike/dlls/plats.cpp:1171 */ -void CFuncTrackTrain::Next(void) +void CFuncTrackTrain::Next() { float time = 0.5; @@ -1222,7 +1213,7 @@ void CFuncTrackTrain::Next(void) // The train actually points west angles.y += fixAngleY; - // !!! All of this crap has to be done to make the angles not wrap around, revisit this. + // TODO: All of this crap has to be done to make the angles not wrap around, revisit this. #ifndef PLAY_GAMEDLL FixupAngles(angles); FixupAngles(pev->angles); @@ -1336,7 +1327,7 @@ void CFuncTrackTrain::Next(void) } /* <12de16> ../cstrike/dlls/plats.cpp:1308 */ -void CFuncTrackTrain::DeadEnd(void) +void CFuncTrackTrain::DeadEnd() { // Fire the dead-end target if there is one CPathTrack *pTrack, *pNext; @@ -1427,7 +1418,7 @@ BOOL CFuncTrackTrain::__MAKE_VHOOK(OnControls)(entvars_t *pevTest) } /* <12e636> ../cstrike/dlls/plats.cpp:1385 */ -void CFuncTrackTrain::Find(void) +void CFuncTrackTrain::Find() { m_ppath = CPathTrack::Instance(FIND_ENTITY_BY_TARGETNAME(NULL, STRING(pev->target))); @@ -1471,7 +1462,7 @@ void CFuncTrackTrain::Find(void) } /* <12ecdd> ../cstrike/dlls/plats.cpp:1422 */ -void CFuncTrackTrain::NearestPath(void) +void CFuncTrackTrain::NearestPath() { CBaseEntity *pTrack = NULL; CBaseEntity *pNearest = NULL; @@ -1515,7 +1506,7 @@ void CFuncTrackTrain::NearestPath(void) } } - m_ppath = reinterpret_cast(pNearest); + m_ppath = static_cast(pNearest); if (pev->speed != 0) { @@ -1525,7 +1516,7 @@ void CFuncTrackTrain::NearestPath(void) } /* <12d75a> ../cstrike/dlls/plats.cpp:1470 */ -void CFuncTrackTrain::__MAKE_VHOOK(OverrideReset)(void) +void CFuncTrackTrain::__MAKE_VHOOK(OverrideReset)() { NextThink(pev->ltime + 0.1, FALSE); SetThink(&CFuncTrackTrain::NearestPath); @@ -1543,7 +1534,7 @@ CFuncTrackTrain *CFuncTrackTrain::Instance(edict_t *pent) } /* <12dcd4> ../cstrike/dlls/plats.cpp:1495 */ -void CFuncTrackTrain::__MAKE_VHOOK(Spawn)(void) +void CFuncTrackTrain::__MAKE_VHOOK(Spawn)() { if (pev->speed == 0) m_speed = 165; @@ -1590,7 +1581,7 @@ void CFuncTrackTrain::__MAKE_VHOOK(Spawn)(void) } /* <12dbdf> ../cstrike/dlls/plats.cpp:1539 */ -void CFuncTrackTrain::__MAKE_VHOOK(Restart)(void) +void CFuncTrackTrain::__MAKE_VHOOK(Restart)() { ALERT(at_console, "M_speed = %f\n", m_speed); @@ -1611,7 +1602,7 @@ void CFuncTrackTrain::__MAKE_VHOOK(Restart)(void) } /* <12d7a5> ../cstrike/dlls/plats.cpp:1562 */ -void CFuncTrackTrain::__MAKE_VHOOK(Precache)(void) +void CFuncTrackTrain::__MAKE_VHOOK(Precache)() { if (m_flVolume == 0.0) m_flVolume = 1.0; @@ -1640,7 +1631,7 @@ void CFuncTrackTrain::__MAKE_VHOOK(Precache)(void) LINK_ENTITY_TO_CLASS(func_traincontrols, CFuncTrainControls); /* <12fb10> ../cstrike/dlls/plats.cpp:1598 */ -void CFuncTrainControls::Find(void) +void CFuncTrainControls::Find() { edict_t *pTarget = NULL; @@ -1662,7 +1653,7 @@ void CFuncTrainControls::Find(void) } /* <12dc86> ../cstrike/dlls/plats.cpp:1619 */ -void CFuncTrainControls::__MAKE_VHOOK(Spawn)(void) +void CFuncTrainControls::__MAKE_VHOOK(Spawn)() { pev->solid = SOLID_NOT; pev->movetype = MOVETYPE_NONE; @@ -1676,7 +1667,7 @@ void CFuncTrainControls::__MAKE_VHOOK(Spawn)(void) } /* <12d7f2> ../cstrike/dlls/plats.cpp:1673 */ -BOOL CFuncTrackChange::__MAKE_VHOOK(IsTogglePlat)(void) +BOOL CFuncTrackChange::__MAKE_VHOOK(IsTogglePlat)() { return TRUE; } @@ -1688,7 +1679,7 @@ LINK_ENTITY_TO_CLASS(func_trackchange, CFuncTrackChange); IMPLEMENT_SAVERESTORE(CFuncTrackChange, CFuncPlatRot); /* <130c1d> ../cstrike/dlls/plats.cpp:1715 */ -void CFuncTrackChange::__MAKE_VHOOK(Spawn)(void) +void CFuncTrackChange::__MAKE_VHOOK(Spawn)() { Setup(); if (pev->spawnflags & SF_TRACK_DONT_MOVE) @@ -1720,7 +1711,7 @@ void CFuncTrackChange::__MAKE_VHOOK(Spawn)(void) } /* <130a3b> ../cstrike/dlls/plats.cpp:1744 */ -void CFuncTrackChange::__MAKE_VHOOK(Precache)(void) +void CFuncTrackChange::__MAKE_VHOOK(Precache)() { // Can't trigger sound PRECACHE_SOUND("buttons/button11.wav"); @@ -1765,14 +1756,14 @@ void CFuncTrackChange::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) } /* <12d84d> ../cstrike/dlls/plats.cpp:1782 */ -void CFuncTrackChange::__MAKE_VHOOK(OverrideReset)(void) +void CFuncTrackChange::__MAKE_VHOOK(OverrideReset)() { pev->nextthink = pev->ltime + 1.0; SetThink(&CFuncTrackChange::Find); } /* <12ff19> ../cstrike/dlls/plats.cpp:1788 */ -void CFuncTrackChange::Find(void) +void CFuncTrackChange::Find() { // Find track entities edict_t *target; @@ -1877,7 +1868,7 @@ void CFuncTrackChange::UpdateTrain(Vector &dest) } /* <131ade> ../cstrike/dlls/plats.cpp:1883 */ -void CFuncTrackChange::__MAKE_VHOOK(GoDown)(void) +void CFuncTrackChange::__MAKE_VHOOK(GoDown)() { if (m_code == TRAIN_BLOCKING) return; @@ -1912,7 +1903,7 @@ void CFuncTrackChange::__MAKE_VHOOK(GoDown)(void) // Platform is at bottom, now starts moving up /* <1319f9> ../cstrike/dlls/plats.cpp:1919 */ -void CFuncTrackChange::__MAKE_VHOOK(GoUp)(void) +void CFuncTrackChange::__MAKE_VHOOK(GoUp)() { if (m_code == TRAIN_BLOCKING) return; @@ -2005,7 +1996,7 @@ void CFuncTrackChange::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *p // Platform has hit bottom. Stops and waits forever. /* <12f618> ../cstrike/dlls/plats.cpp:2005 */ -void CFuncTrackChange::__MAKE_VHOOK(HitBottom)(void) +void CFuncTrackChange::__MAKE_VHOOK(HitBottom)() { CFuncPlatRot::HitBottom(); if (m_code == TRAIN_FOLLOWING) @@ -2023,7 +2014,7 @@ void CFuncTrackChange::__MAKE_VHOOK(HitBottom)(void) // Platform has hit bottom. Stops and waits forever. /* <12f588> ../cstrike/dlls/plats.cpp:2025 */ -void CFuncTrackChange::__MAKE_VHOOK(HitTop)(void) +void CFuncTrackChange::__MAKE_VHOOK(HitTop)() { CFuncPlatRot::HitTop(); if (m_code == TRAIN_FOLLOWING) @@ -2142,7 +2133,7 @@ LINK_ENTITY_TO_CLASS(func_guntarget, CGunTarget); IMPLEMENT_SAVERESTORE(CGunTarget, CBaseMonster); /* <12dbb8> ../cstrike/dlls/plats.cpp:2173 */ -void CGunTarget::__MAKE_VHOOK(Spawn)(void) +void CGunTarget::__MAKE_VHOOK(Spawn)() { pev->solid = SOLID_BSP; pev->movetype = MOVETYPE_PUSH; @@ -2170,7 +2161,7 @@ void CGunTarget::__MAKE_VHOOK(Spawn)(void) } /* <12dade> ../cstrike/dlls/plats.cpp:2199 */ -void CGunTarget::__MAKE_VHOOK(Activate)(void) +void CGunTarget::__MAKE_VHOOK(Activate)() { CBaseEntity *pTarg; @@ -2185,13 +2176,13 @@ void CGunTarget::__MAKE_VHOOK(Activate)(void) } /* <12d947> ../cstrike/dlls/plats.cpp:2213 */ -void CGunTarget::Start(void) +void CGunTarget::Start() { Use(this, this, USE_ON, 0); } /* <12d96e> ../cstrike/dlls/plats.cpp:2219 */ -void CGunTarget::Next(void) +void CGunTarget::Next() { SetThink(NULL); @@ -2209,7 +2200,7 @@ void CGunTarget::Next(void) } /* <12da61> ../cstrike/dlls/plats.cpp:2236 */ -void CGunTarget::Wait(void) +void CGunTarget::Wait() { CBaseEntity *pTarget = m_hTargetEnt; @@ -2247,7 +2238,7 @@ void CGunTarget::Wait(void) } /* <131d5d> ../cstrike/dlls/plats.cpp:2269 */ -void CGunTarget::Stop(void) +void CGunTarget::Stop() { pev->velocity = g_vecZero; pev->nextthink = 0; @@ -2297,317 +2288,3 @@ void CGunTarget::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller Next(); } } - -#ifdef HOOK_GAMEDLL - -void CBasePlatTrain::Precache(void) -{ - Precache_(); -} - -void CBasePlatTrain::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -int CBasePlatTrain::Save(CSave &save) -{ - return Save_(save); -} - -int CBasePlatTrain::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -void CFuncPlat::Spawn(void) -{ - Spawn_(); -} - -void CFuncPlat::Precache(void) -{ - Precache_(); -} - -void CFuncPlat::Blocked(CBaseEntity *pOther) -{ - Blocked_(pOther); -} - -void CFuncPlat::GoUp(void) -{ - GoUp_(); -} - -void CFuncPlat::GoDown(void) -{ - GoDown_(); -} - -void CFuncPlat::HitTop(void) -{ - HitTop_(); -} - -void CFuncPlat::HitBottom(void) -{ - HitBottom_(); -} - -void CPlatTrigger::Touch(CBaseEntity *pOther) -{ - Touch_(pOther); -} - -void CFuncPlatRot::Spawn(void) -{ - Spawn_(); -} - -int CFuncPlatRot::Save(CSave &save) -{ - return Save_(save); -} - -int CFuncPlatRot::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -void CFuncPlatRot::GoUp(void) -{ - GoUp_(); -} - -void CFuncPlatRot::GoDown(void) -{ - GoDown_(); -} - -void CFuncPlatRot::HitTop(void) -{ - HitTop_(); -} - -void CFuncPlatRot::HitBottom(void) -{ - HitBottom_(); -} - -void CFuncTrain::Spawn(void) -{ - Spawn_(); -} - -void CFuncTrain::Precache(void) -{ - Precache_(); -} - -void CFuncTrain::Restart(void) -{ - Restart_(); -} - -void CFuncTrain::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -int CFuncTrain::Save(CSave &save) -{ - return Save_(save); -} - -int CFuncTrain::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -void CFuncTrain::Activate(void) -{ - Activate_(); -} - -void CFuncTrain::OverrideReset(void) -{ - OverrideReset_(); -} - -void CFuncTrain::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -void CFuncTrain::Blocked(CBaseEntity *pOther) -{ - Blocked_(pOther); -} - -void CFuncTrackTrain::Spawn(void) -{ - Spawn_(); -} - -void CFuncTrackTrain::Precache(void) -{ - Precache_(); -} - -void CFuncTrackTrain::Restart(void) -{ - Restart_(); -} - -void CFuncTrackTrain::KeyValue(KeyValueData* pkvd) -{ - KeyValue_(pkvd); -} - -int CFuncTrackTrain::Save(CSave &save) -{ - return Save_(save); -} - -int CFuncTrackTrain::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -void CFuncTrackTrain::OverrideReset(void) -{ - OverrideReset_(); -} - -BOOL CFuncTrackTrain::OnControls(entvars_t *pev) -{ - return OnControls_(pev); -} - -void CFuncTrackTrain::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -void CFuncTrackTrain::Blocked(CBaseEntity *pOther) -{ - Blocked_(pOther); -} - -void CFuncTrainControls::Spawn(void) -{ - Spawn_(); -} - -void CFuncTrackChange::Spawn(void) -{ - Spawn_(); -} - -void CFuncTrackChange::Precache(void) -{ - Precache_(); -} - -void CFuncTrackChange::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -int CFuncTrackChange::Save(CSave &save) -{ - return Save_(save); -} - -int CFuncTrackChange::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -void CFuncTrackChange::OverrideReset(void) -{ - OverrideReset_(); -} - -void CFuncTrackChange::Touch(CBaseEntity *pOther) -{ - Touch_(pOther); -} - -void CFuncTrackChange::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -BOOL CFuncTrackChange::IsTogglePlat(void) -{ - return IsTogglePlat_(); -} - -void CFuncTrackChange::GoUp(void) -{ - GoUp_(); -} - -void CFuncTrackChange::GoDown(void) -{ - GoDown_(); -} - -void CFuncTrackChange::HitBottom(void) -{ - HitBottom_(); -} - -void CFuncTrackChange::HitTop(void) -{ - HitTop_(); -} - -void CFuncTrackChange::UpdateAutoTargets(int toggleState) -{ - UpdateAutoTargets_(toggleState); -} - -void CFuncTrackAuto::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -void CFuncTrackAuto::UpdateAutoTargets(int toggleState) -{ - UpdateAutoTargets_(toggleState); -} - -void CGunTarget::Spawn(void) -{ - Spawn_(); -} - -int CGunTarget::Save(CSave &save) -{ - return Save_(save); -} - -int CGunTarget::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -void CGunTarget::Activate(void) -{ - Activate_(); -} - -int CGunTarget::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) -{ - return TakeDamage_(pevInflictor, pevAttacker, flDamage, bitsDamageType); -} - -void CGunTarget::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/plats.h b/regamedll/dlls/plats.h index a50e01fa..3d8379dd 100644 --- a/regamedll/dlls/plats.h +++ b/regamedll/dlls/plats.h @@ -50,24 +50,18 @@ class CBasePlatTrain: public CBaseToggle { public: - virtual void Precache(void); + 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; } // This is done to fix spawn flag collisions between this class and a derived class - virtual BOOL IsTogglePlat(void) - { - return (pev->spawnflags & SF_PLAT_TOGGLE) != 0; - } + virtual BOOL IsTogglePlat() { return (pev->spawnflags & SF_PLAT_TOGGLE) != 0; } #ifdef HOOK_GAMEDLL - void Precache_(void); + void Precache_(); void KeyValue_(KeyValueData *pkvd); int Save_(CSave &save); int Restore_(CRestore &restore); @@ -77,54 +71,48 @@ public: public: static TYPEDESCRIPTION IMPL(m_SaveData)[3]; -public: BYTE m_bMoveSnd; BYTE m_bStopSnd; float m_volume; - -};/* size: 320, cachelines: 5, members: 5 */ +}; /* <12c853> ../cstrike/dlls/plats.cpp:223 */ class CFuncPlat: public CBasePlatTrain { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual void Blocked(CBaseEntity *pOther); - virtual void GoUp(void); - virtual void GoDown(void); - virtual void HitTop(void); - virtual void HitBottom(void); + virtual void GoUp(); + virtual void GoDown(); + virtual void HitTop(); + virtual void HitBottom(); #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); void Blocked_(CBaseEntity *pOther); - void GoUp_(void); - void GoDown_(void); - void HitTop_(void); - void HitBottom_(void); + void GoUp_(); + void GoDown_(); + void HitTop_(); + void HitBottom_(); #endif // HOOK_GAMEDLL public: - void Setup(void); + void Setup(); void EXPORT PlatUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); - void EXPORT CallGoDown(void); - void EXPORT CallHitTop(void); - void EXPORT CallHitBottom(void); - -};/* size: 320, cachelines: 5, members: 1 */ + void EXPORT CallGoDown(); + void EXPORT CallHitTop(); + void EXPORT CallHitBottom(); +}; /* <12c86e> ../cstrike/dlls/plats.cpp:248 */ class CPlatTrigger: public CBaseEntity { public: - virtual int ObjectCaps(void) - { - return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION) | FCAP_DONT_SAVE; - } + virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION) | FCAP_DONT_SAVE; } virtual void Touch(CBaseEntity *pOther); #ifdef HOOK_GAMEDLL @@ -136,181 +124,159 @@ public: public: void SpawnInsideTrigger(CFuncPlat *pPlatform); -public: CFuncPlat *m_pPlatform; - -};/* size: 156, cachelines: 3, members: 2 */ +}; /* <12c8ee> ../cstrike/dlls/plats.cpp:515 */ class CFuncPlatRot: public CFuncPlat { public: - virtual void Spawn(void); + virtual void Spawn(); virtual int Save(CSave &save); virtual int Restore(CRestore &restore); - virtual void GoUp(void); - virtual void GoDown(void); - virtual void HitTop(void); - virtual void HitBottom(void); + virtual void GoUp(); + virtual void GoDown(); + virtual void HitTop(); + virtual void HitBottom(); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); int Save_(CSave &save); int Restore_(CRestore &restore); - void GoUp_(void); - void GoDown_(void); - void HitTop_(void); - void HitBottom_(void); + void GoUp_(); + void GoDown_(); + void HitTop_(); + void HitBottom_(); #endif // HOOK_GAMEDLL public: - void SetupRotation(void); + void SetupRotation(); void RotMove(Vector &destAngle, float time); public: static TYPEDESCRIPTION IMPL(m_SaveData)[2]; -public: Vector m_end; Vector m_start; - -};/* size: 344, cachelines: 6, members: 4 */ +}; /* <12c93c> ../cstrike/dlls/plats.cpp:628 */ class CFuncTrain: public CBasePlatTrain { 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 void Activate(void); - virtual void OverrideReset(void); + virtual void Activate(); + virtual void OverrideReset(); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Blocked(CBaseEntity *pOther); #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); - void Activate_(void); - void OverrideReset_(void); + void Activate_(); + void OverrideReset_(); void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); void Blocked_(CBaseEntity *pOther); #endif // HOOK_GAMEDLL public: - void EXPORT Wait(void); - void EXPORT Next(void); + void EXPORT Wait(); + void EXPORT Next(); public: static TYPEDESCRIPTION IMPL(m_SaveData)[3]; -public: Vector m_vStartPosition; entvars_t *m_pevFirstTarget; entvars_t *m_pevCurrentTarget; int m_sounds; BOOL m_activated; - -};/* size: 348, cachelines: 6, members: 7 */ +}; /* <12c9d7> ../cstrike/dlls/plats.cpp:1588 */ class CFuncTrainControls: 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 public: - void EXPORT Find(void); - -};/* size: 152, cachelines: 3, members: 1 */ + void EXPORT Find(); +}; /* <12ca2a> ../cstrike/dlls/plats.cpp:1654 */ class CFuncTrackChange: public CFuncPlatRot { 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 OverrideReset(void); + virtual void OverrideReset(); virtual void Touch(CBaseEntity *pOther); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); - virtual BOOL IsTogglePlat(void); + virtual BOOL IsTogglePlat(); - virtual void EXPORT GoUp(void); - virtual void EXPORT GoDown(void); + virtual void EXPORT GoUp(); + virtual void EXPORT GoDown(); - virtual void HitBottom(void); - virtual void HitTop(void); + virtual void HitBottom(); + virtual void HitTop(); virtual void UpdateAutoTargets(int toggleState); #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 OverrideReset_(void); + void OverrideReset_(); void Touch_(CBaseEntity *pOther); void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); - BOOL IsTogglePlat_(void); - void GoUp_(void); - void GoDown_(void); - void HitBottom_(void); - void HitTop_(void); + BOOL IsTogglePlat_(); + void GoUp_(); + void GoDown_(); + void HitBottom_(); + void HitTop_(); void UpdateAutoTargets_(int toggleState); #endif // HOOK_GAMEDLL public: - void EXPORT Find(void); + void EXPORT Find(); TRAIN_CODE EvaluateTrain(CPathTrack *pcurrent); void UpdateTrain(Vector &dest); - /* <12c515> ../cstrike/dlls/plats.cpp:1675 */ - void DisableUse(void) - { - m_use = 0; - } - /* <12c52e> ../cstrike/dlls/plats.cpp:1676 */ - void EnableUse(void) - { - m_use = 1; - } - /* <12c547> ../cstrike/dlls/plats.cpp:1677 */ - int UseEnabled(void) - { - return m_use; - } + void DisableUse() { m_use = 0; } + void EnableUse() { m_use = 1; } + + int UseEnabled() const { return m_use; } public: static TYPEDESCRIPTION IMPL(m_SaveData)[9]; -public: CPathTrack *m_trackTop; CPathTrack *m_trackBottom; CFuncTrackTrain *m_train; @@ -322,8 +288,7 @@ public: TRAIN_CODE m_code; int m_targetState; int m_use; - -};/* size: 380, cachelines: 6, members: 11 */ +}; /* <12ca78> ../cstrike/dlls/plats.cpp:2043 */ class CFuncTrackAuto: public CFuncTrackChange @@ -339,76 +304,49 @@ public: #endif // HOOK_GAMEDLL -};/* size: 380, cachelines: 6, members: 1 */ +}; /* <12caec> ../cstrike/dlls/plats.cpp:2136 */ class CGunTarget: 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_ACROSS_TRANSITION); - } - virtual void Activate(void); - virtual int Classify(void) - { - return CLASS_MACHINE; - } + virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION);} + virtual void Activate(); + virtual int Classify() { return CLASS_MACHINE; } virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType); - virtual int BloodColor(void) - { - return DONT_BLEED; - } + virtual int BloodColor() { return DONT_BLEED; } virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); - virtual Vector BodyTarget(const Vector &posSrc) - { - return pev->origin; - } + virtual Vector BodyTarget(const Vector &posSrc) { return pev->origin; } #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); int Save_(CSave &save); int Restore_(CRestore &restore); - void Activate_(void); + void Activate_(); 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 public: - void EXPORT Next(void); - void EXPORT Start(void); - void EXPORT Wait(void); - void Stop(void); + void EXPORT Next(); + void EXPORT Start(); + void EXPORT Wait(); + void Stop(); public: static TYPEDESCRIPTION IMPL(m_SaveData)[1]; private: BOOL m_on; - -};/* size: 408, cachelines: 7, members: 3 */ +}; void PlatSpawnInsideTrigger(entvars_t *pevPlatform); //float Fix(float angle); void FixupAngles(Vector &v); -#ifdef HOOK_GAMEDLL - -// linked objects -C_DLLEXPORT void func_plat(entvars_t *pev); -C_DLLEXPORT void func_platrot(entvars_t *pev); -C_DLLEXPORT void func_train(entvars_t *pev); -C_DLLEXPORT void func_tracktrain(entvars_t *pev); -C_DLLEXPORT void func_traincontrols(entvars_t *pev); -C_DLLEXPORT void func_trackchange(entvars_t *pev); -C_DLLEXPORT void func_trackautochange(entvars_t *pev); -C_DLLEXPORT void func_guntarget(entvars_t *pev); - -#endif // HOOK_GAMEDLL - #endif // PLATS_H diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index ccc022c5..9a0afb4f 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -188,98 +188,6 @@ char *CDeadHEV::m_szPoses[] = "deadtable" }; -#else // HOOK_GAMEDLL - -int giPrecacheGrunt; -int gmsgWeapPickup; -int gmsgHudText; -int gmsgHudTextArgs; -int gmsgShake; -int gmsgFade; -int gmsgFlashlight; -int gmsgFlashBattery; -int gmsgResetHUD; -int gmsgInitHUD; -int gmsgViewMode; -int gmsgShowGameTitle; -int gmsgCurWeapon; -int gmsgHealth; -int gmsgDamage; -int gmsgBattery; -int gmsgTrain; -int gmsgLogo; -int gmsgWeaponList; -int gmsgAmmoX; -int gmsgDeathMsg; -int gmsgScoreAttrib; -int gmsgScoreInfo; -int gmsgTeamInfo; -int gmsgTeamScore; -int gmsgGameMode; -int gmsgMOTD; -int gmsgServerName; -int gmsgAmmoPickup; -int gmsgItemPickup; -int gmsgHideWeapon; -int gmsgSayText; -int gmsgTextMsg; -int gmsgSetFOV; -int gmsgShowMenu; -int gmsgSendAudio; -int gmsgRoundTime; -int gmsgMoney; -int gmsgBlinkAcct; -int gmsgArmorType; -int gmsgStatusValue; -int gmsgStatusText; -int gmsgStatusIcon; -int gmsgBarTime; -int gmsgReloadSound; -int gmsgCrosshair; -int gmsgNVGToggle; -int gmsgRadar; -int gmsgSpectator; -int gmsgVGUIMenu; -int gmsgCZCareer; -int gmsgCZCareerHUD; -int gmsgTaskTime; -int gmsgTutorText; -int gmsgTutorLine; -int gmsgShadowIdx; -int gmsgTutorState; -int gmsgTutorClose; -int gmsgAllowSpec; -int gmsgBombDrop; -int gmsgBombPickup; -int gmsgHostagePos; -int gmsgHostageK; -int gmsgGeigerRange; -int gmsgSendCorpse; -int gmsgHLTV; -int gmsgSpecHealth; -int gmsgForceCam; -int gmsgADStop; -int gmsgReceiveW; -int gmsgScenarioIcon; -int gmsgBotVoice; -int gmsgBuyClose; -int gmsgItemStatus; -int gmsgLocation; -int gmsgSpecHealth2; -int gmsgBarTime2; -int gmsgBotProgress; -int gmsgBrass; -int gmsgFog; -int gmsgShowTimer; - -BOOL gInitHUD; -cvar_t *sv_aim; - -TYPEDESCRIPTION IMPL_CLASS(CRevertSaved, m_SaveData)[2]; -TYPEDESCRIPTION IMPL_CLASS(CBasePlayer, m_playerSaveData)[40]; -WeaponStruct g_weaponStruct[ MAX_WEAPONS ]; -char *(*CDeadHEV::pm_szPoses)[4]; - #endif //HOOK_GAMEDLL //int giPrecacheGrunt; @@ -296,14 +204,13 @@ struct ZombieSpawn { CBaseEntity *entity; CountdownTimer useableTimer; - -};/* size: 12, cachelines: 1, members: 2 */ +}; ZombieSpawn zombieSpawn[256]; int zombieSpawnCount; /* <15353b> ../cstrike/dlls/player.cpp:282 */ -void LinkUserMessages(void) +void LinkUserMessages() { if (gmsgCurWeapon) return; @@ -391,7 +298,7 @@ void LinkUserMessages(void) } /* <1535a5> ../cstrike/dlls/player.cpp:380 */ -void WriteSigonMessages(void) +void WriteSigonMessages() { for (int i = 0; i < MAX_WEAPONS; ++i) { @@ -507,7 +414,7 @@ void CBasePlayer::SetPlayerModel(BOOL HasC4) model = "vip"; break; case MODEL_SPETSNAZ: - if (UTIL_IsGame("czero")) + if (g_bIsCzeroGame) { model = "spetsnaz"; break; @@ -544,7 +451,7 @@ void CBasePlayer::SetPlayerModel(BOOL HasC4) model = "guerilla"; break; case MODEL_MILITIA: - if (UTIL_IsGame("czero")) + if (g_bIsCzeroGame) { model = "militia"; break; @@ -727,7 +634,7 @@ void CBasePlayer::Radio(const char *msg_id, const char *msg_verbose, short pitch } /* <1537f3> ../cstrike/dlls/player.cpp:812 */ -void CBasePlayer::SmartRadio(void) +void CBasePlayer::SmartRadio() { ; } @@ -812,7 +719,7 @@ int TrainSpeed(int iSpeed, int iMax) } /* <153c8e> ../cstrike/dlls/player.cpp:902 */ -void CBasePlayer::DeathSound(void) +void CBasePlayer::DeathSound() { // temporarily using pain sounds for death sounds switch (RANDOM_LONG(1, 4)) @@ -834,7 +741,7 @@ int CBasePlayer::__MAKE_VHOOK(TakeHealth)(float flHealth, int bitsDamageType) } /* <150f1c> ../cstrike/dlls/player.cpp:943 */ -Vector CBasePlayer::__MAKE_VHOOK(GetGunPosition)(void) +Vector CBasePlayer::__MAKE_VHOOK(GetGunPosition)() { return pev->origin + pev->view_ofs; } @@ -842,7 +749,7 @@ Vector CBasePlayer::__MAKE_VHOOK(GetGunPosition)(void) /* <15412b> ../cstrike/dlls/player.cpp:953 */ bool CBasePlayer::IsHittingShield(Vector &vecDirection, TraceResult *ptr) { - if ((m_pActiveItem && m_pActiveItem->m_iId == WEAPON_C4) || !HasShield()) + if ((m_pActiveItem != NULL && m_pActiveItem->m_iId == WEAPON_C4) || !HasShield()) return false; if (ptr->iHitgroup == HITGROUP_SHIELD) @@ -861,13 +768,10 @@ void CBasePlayer::__MAKE_VHOOK(TraceAttack)(entvars_t *pevAttacker, float flDama bool bShouldSpark = false; bool bHitShield = IsHittingShield(vecDir, ptr); - CBasePlayer *pAttacker = (CBasePlayer *)CBaseEntity::Instance(pevAttacker); + CBasePlayer *pAttacker = dynamic_cast(CBaseEntity::Instance(pevAttacker)); - if (pAttacker->IsPlayer()) // REGAMEDLL_FIXES - { - if (m_iTeam == pAttacker->m_iTeam && CVAR_GET_FLOAT("mp_friendlyfire") == 0) - bShouldBleed = false; - } + if (pAttacker != NULL && m_iTeam == pAttacker->m_iTeam && CVAR_GET_FLOAT("mp_friendlyfire") == 0) + bShouldBleed = false; if (pev->takedamage == DAMAGE_NO) return; @@ -1014,17 +918,14 @@ const char *GetWeaponName(entvars_t *pevInflictor, entvars_t *pKiller) if (pKiller->flags & FL_CLIENT) { - //int killer_index = ENTINDEX(ENT(pKiller)); unused! - if (pevInflictor) { if (pevInflictor == pKiller) { - CBasePlayer *pAttacker = (CBasePlayer *)CBaseEntity::Instance(pKiller); - - if (pAttacker) + CBasePlayer *pAttacker = dynamic_cast(CBaseEntity::Instance(pKiller)); + if (pAttacker != NULL) { - if (pAttacker->m_pActiveItem) + if (pAttacker->m_pActiveItem != NULL) killer_weapon_name = pAttacker->m_pActiveItem->pszName(); } } @@ -1091,14 +992,12 @@ int CBasePlayer::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pe int fTookDamage; float flRatio = ARMOR_RATIO; float flBonus = ARMOR_BONUS; - //float flHealthPrev = pev->health; int iGunType = 0; float flShieldRatio = 0; int teamAttack = FALSE; int armorHit = 0; CBasePlayer *pAttack = NULL; CBaseEntity *pAttacker = NULL; - //CBaseEntity *attacker = NULL; // unused if (bitsDamageType & (DMG_EXPLOSION | DMG_BLAST | DMG_FALL)) m_LastHitGroup = HITGROUP_GENERIC; @@ -1135,7 +1034,7 @@ int CBasePlayer::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pe if (friendlyfire.string[0] == '2') teamAttack = FALSE; #endif // REGAMEDLL_ADD - pAttack = static_cast(CBasePlayer::Instance(pevAttacker)); + pAttack = dynamic_cast(CBasePlayer::Instance(pevAttacker)); } else if (pGrenade->m_iTeam == m_iTeam && (&edict()->v != pevAttacker)) { @@ -1302,7 +1201,7 @@ int CBasePlayer::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pe if (pAttack != this && pAttack->m_iTeam == m_iTeam && !bAttackFFA) { #ifndef REGAMEDLL_FIXES - // TODO: this->m_flDisplayHistory!! + // TODO: this->m_flDisplayHistory! if (!(m_flDisplayHistory & DHF_FRIEND_INJURED)) { m_flDisplayHistory |= DHF_FRIEND_INJURED; @@ -1549,7 +1448,7 @@ void packPlayerItem(CBasePlayer *pPlayer, CBasePlayerItem *pItem, bool packAmmo) } /* <15f739> ../cstrike/dlls/player.cpp:1756 */ -void CBasePlayer::PackDeadPlayerItems(void) +void CBasePlayer::PackDeadPlayerItems() { bool bPackGun = (g_pGameRules->DeadPlayerWeapons(this) != GR_PLR_DROP_GUN_NO); bool bPackAmmo = (g_pGameRules->DeadPlayerAmmo(this) != GR_PLR_DROP_AMMO_NO); @@ -1584,7 +1483,8 @@ void CBasePlayer::PackDeadPlayerItems(void) } } } - else if (pPlayerItem->iItemSlot() == GRENADE_SLOT && UTIL_IsGame("czero")) + // drop a grenade after death + else if (pPlayerItem->iItemSlot() == GRENADE_SLOT && g_bIsCzeroGame) packPlayerItem(this, pPlayerItem, true); pPlayerItem = pPlayerItem->m_pNext; @@ -1596,7 +1496,7 @@ void CBasePlayer::PackDeadPlayerItems(void) } /* <15f710> ../cstrike/dlls/player.cpp:1829 */ -void CBasePlayer::GiveDefaultItems(void) +void CBasePlayer::GiveDefaultItems() { RemoveAllItems(FALSE); m_bHasPrimary = false; @@ -2315,7 +2215,7 @@ void CBasePlayer::__MAKE_VHOOK(Killed)(entvars_t *pevAttacker, int iGib) } /* <154478> ../cstrike/dlls/player.cpp:2625 */ -BOOL CBasePlayer::IsBombGuy(void) +BOOL CBasePlayer::IsBombGuy() { if (!g_pGameRules->IsMultiplayer()) return FALSE; @@ -2894,7 +2794,7 @@ void CBasePlayer::SetAnimation(PLAYER_ANIM playerAnim) } /* <1544f4> ../cstrike/dlls/player.cpp:3264 */ -void CBasePlayer::WaterMove(void) +void CBasePlayer::WaterMove() { int air; @@ -3008,7 +2908,7 @@ void CBasePlayer::WaterMove(void) } /* <15493f> ../cstrike/dlls/player.cpp:3380 */ -BOOL CBasePlayer::IsOnLadder(void) +BOOL CBasePlayer::IsOnLadder() { return pev->movetype == MOVETYPE_FLY; } @@ -3037,7 +2937,7 @@ NOXREF void CBasePlayer::ThrowWeapon(char *pszItemName) LINK_ENTITY_TO_CLASS(weapon_shield, CWShield); /* <151962> ../cstrike/dlls/player.cpp:3426 */ -void CWShield::__MAKE_VHOOK(Spawn)(void) +void CWShield::__MAKE_VHOOK(Spawn)() { pev->movetype = MOVETYPE_TOSS; pev->solid = SOLID_TRIGGER; @@ -3112,7 +3012,7 @@ void CBasePlayer::GiveShield(bool bDeploy) } /* <154a70> ../cstrike/dlls/player.cpp:3504 */ -void CBasePlayer::RemoveShield(void) +void CBasePlayer::RemoveShield() { if (HasShield()) { @@ -3187,13 +3087,13 @@ void CBasePlayer::DropShield(bool bDeploy) } /* <154b15> ../cstrike/dlls/player.cpp:3588 */ -bool CBasePlayer::HasShield(void) +bool CBasePlayer::HasShield() { return m_bOwnsShield; } /* <1615d2> ../cstrike/dlls/player.cpp:3593 */ -NOXREF void CBasePlayer::ThrowPrimary(void) +NOXREF void CBasePlayer::ThrowPrimary() { ThrowWeapon("weapon_m249"); ThrowWeapon("weapon_g3sg1"); @@ -3244,7 +3144,7 @@ void CBasePlayer::AddAccount(int amount, bool bTrackChange) } /* <154bf8> ../cstrike/dlls/player.cpp:3640 */ -void CBasePlayer::ResetMenu(void) +void CBasePlayer::ResetMenu() { MESSAGE_BEGIN(MSG_ONE, gmsgShowMenu, NULL, pev); WRITE_SHORT(0); @@ -3260,7 +3160,7 @@ void CBasePlayer::ResetMenu(void) } /* <154c50> ../cstrike/dlls/player.cpp:3651 */ -void CBasePlayer::SyncRoundTimer(void) +void CBasePlayer::SyncRoundTimer() { float tmRemaining; CHalfLifeMultiplay *mp = g_pGameRules; @@ -3331,7 +3231,7 @@ void CBasePlayer::SyncRoundTimer(void) } /* <154db6> ../cstrike/dlls/player.cpp:3711 */ -void CBasePlayer::RemoveLevelText(void) +void CBasePlayer::RemoveLevelText() { ResetMenu(); } @@ -3375,7 +3275,7 @@ void CBasePlayer::MenuPrint(const char *msg) } /* <154f3d> ../cstrike/dlls/player.cpp:3753 */ -void CBasePlayer::MakeVIP(void) +void CBasePlayer::MakeVIP() { pev->body = 0; m_iModelName = MODEL_VIP; @@ -3392,7 +3292,7 @@ void CBasePlayer::MakeVIP(void) } /* <154fe5> ../cstrike/dlls/player.cpp:3785 */ -void CBasePlayer::JoiningThink(void) +void CBasePlayer::JoiningThink() { switch (m_iJoiningState) { @@ -3567,7 +3467,7 @@ void CBasePlayer::JoiningThink(void) } /* <16076f> ../cstrike/dlls/player.cpp:3952 */ -void CBasePlayer::Disappear(void) +void CBasePlayer::Disappear() { if (m_pTank != NULL) { @@ -3637,12 +3537,12 @@ void CBasePlayer::Disappear(void) } /* <15f83d> ../cstrike/dlls/player.cpp:4039 */ -void CBasePlayer::PlayerDeathThink(void) +void CBasePlayer::PlayerDeathThink() { if (m_iJoiningState != JOINED) return; - // If the anim is done playing, go to the next state (waiting for a keypress to + // If the anim is done playing, go to the next state (waiting for a keypress to // either respawn the guy or put him into observer mode). if (pev->flags & FL_ONGROUND) { @@ -3728,7 +3628,7 @@ void CBasePlayer::PlayerDeathThink(void) } /* <153042> ../cstrike/dlls/player.cpp:4134 */ -void CBasePlayer::__MAKE_VHOOK(RoundRespawn)(void) +void CBasePlayer::__MAKE_VHOOK(RoundRespawn)() { m_canSwitchObserverModes = true; @@ -3770,7 +3670,7 @@ void CBasePlayer::__MAKE_VHOOK(RoundRespawn)(void) // player off into observer mode /* <155577> ../cstrike/dlls/player.cpp:4172 */ -void CBasePlayer::StartDeathCam(void) +void CBasePlayer::StartDeathCam() { if (pev->view_ofs == g_vecZero) { @@ -3901,7 +3801,7 @@ bool CanSeeUseable(CBasePlayer *me, CBaseEntity *entity) } /* <155815> ../cstrike/dlls/player.cpp:4307 */ -void CBasePlayer::PlayerUse(void) +void CBasePlayer::PlayerUse() { // Was use pressed or released? if (!((pev->button | m_afButtonPressed | m_afButtonReleased) & IN_USE)) @@ -4010,7 +3910,7 @@ void CBasePlayer::PlayerUse(void) { if (pObject->ObjectCaps() & (FCAP_IMPULSE_USE | FCAP_CONTINUOUS_USE | FCAP_ONOFF_USE)) { - // !!!PERFORMANCE- should this check be done on a per case basis AFTER we've determined that + // TODO: PERFORMANCE- should this check be done on a per case basis AFTER we've determined that // this object is actually usable? This dot is being done for every object within PLAYER_SEARCH_RADIUS // when player hits the use key. How many objects can be in that area, anyway? (sjb) vecLOS = (VecBModelOrigin(pObject->pev) - (pev->origin + pev->view_ofs)); @@ -4035,7 +3935,7 @@ void CBasePlayer::PlayerUse(void) { if (!useNewHostages || CanSeeUseable(this, pObject)) { - //!!!UNDONE: traceline here to prevent +USEing buttons through walls + // TODO: traceline here to prevent +USEing buttons through walls int caps = pObject->ObjectCaps(); if (m_afButtonPressed & IN_USE) @@ -4065,7 +3965,7 @@ void CBasePlayer::PlayerUse(void) } /* <155f41> ../cstrike/dlls/player.cpp:4486 */ -void CBasePlayer::HostageUsed(void) +void CBasePlayer::HostageUsed() { if (m_flDisplayHistory & DHF_HOSTAGE_USED) return; @@ -4080,7 +3980,7 @@ void CBasePlayer::HostageUsed(void) } /* <153f69> ../cstrike/dlls/player.cpp:4507 */ -void CBasePlayer::__MAKE_VHOOK(Jump)(void) +void CBasePlayer::__MAKE_VHOOK(Jump)() { if (pev->flags & FL_WATERJUMP) return; @@ -4153,7 +4053,7 @@ NOXREF void FixPlayerCrouchStuck(edict_t *pPlayer) } /* <153ef5> ../cstrike/dlls/player.cpp:4580 */ -void CBasePlayer::__MAKE_VHOOK(Duck)(void) +void CBasePlayer::__MAKE_VHOOK(Duck)() { if (pev->button & IN_DUCK) SetAnimation(PLAYER_WALK); @@ -4162,7 +4062,7 @@ void CBasePlayer::__MAKE_VHOOK(Duck)(void) // ID's player as such. /* <150f8f> ../cstrike/dlls/player.cpp:4591 */ -int CBasePlayer::__MAKE_VHOOK(Classify)(void) +int CBasePlayer::__MAKE_VHOOK(Classify)() { return CLASS_PLAYER; } @@ -4288,7 +4188,7 @@ bool CBasePlayer::CanPlayerBuy(bool display) } /* <15f9ac> ../cstrike/dlls/player.cpp:4717 */ -void CBasePlayer::__MAKE_VHOOK(PreThink)(void) +void CBasePlayer::__MAKE_VHOOK(PreThink)() { // These buttons have changed this frame int buttonsChanged = (m_afButtonLast ^ pev->button); @@ -4526,7 +4426,7 @@ void CBasePlayer::__MAKE_VHOOK(PreThink)(void) m_flFallVelocity = -pev->velocity.z; } - //!!!HACKHACK!!! Can't be hit by traceline when not animating? + // TODO: (HACKHACK) Can't be hit by traceline when not animating? //StudioFrameAdvance(); // Clear out ladder pointer @@ -4556,7 +4456,7 @@ void CBasePlayer::__MAKE_VHOOK(PreThink)(void) // and init the appropriate counter. Only processes damage every second. /* <156096> ../cstrike/dlls/player.cpp:5146 */ -void CBasePlayer::CheckTimeBasedDamage(void) +void CBasePlayer::CheckTimeBasedDamage() { int i; BYTE bDuration = 0; @@ -4652,7 +4552,7 @@ void CBasePlayer::CheckTimeBasedDamage(void) } /* <156112> ../cstrike/dlls/player.cpp:5312 */ -void CBasePlayer::UpdateGeigerCounter(void) +void CBasePlayer::UpdateGeigerCounter() { BYTE range; @@ -4682,7 +4582,7 @@ void CBasePlayer::UpdateGeigerCounter(void) } /* <156189> ../cstrike/dlls/player.cpp:5352 */ -void CBasePlayer::CheckSuitUpdate(void) +void CBasePlayer::CheckSuitUpdate() { int i; int isentence = 0; @@ -4772,7 +4672,7 @@ void CBasePlayer::SetNewPlayerModel(const char *modelName) // reserved sound slot in the sound list. /* <1562a4> ../cstrike/dlls/player.cpp:5543 */ -void CBasePlayer::UpdatePlayerSound(void) +void CBasePlayer::UpdatePlayerSound() { int iBodyVolume; int iVolume; @@ -4881,7 +4781,7 @@ void CBasePlayer::UpdatePlayerSound(void) } /* <15a182> ../cstrike/dlls/player.cpp:5667 */ -void CBasePlayer::__MAKE_VHOOK(PostThink)(void) +void CBasePlayer::__MAKE_VHOOK(PostThink)() { // intermission or finale if (g_fGameOver) @@ -5038,7 +4938,7 @@ BOOL IsSpawnPointValid(CBaseEntity *pPlayer, CBaseEntity *pSpot) } /* <1563a8> ../cstrike/dlls/player.cpp:5879 */ -NOXREF void InitZombieSpawns(void) +NOXREF void InitZombieSpawns() { CBaseEntity *spot = NULL; @@ -5228,7 +5128,7 @@ void SetScoreAttrib(CBasePlayer *dest, CBasePlayer *src) } /* <15fdba> ../cstrike/dlls/player.cpp:6264 */ -void CBasePlayer::__MAKE_VHOOK(Spawn)(void) +void CBasePlayer::__MAKE_VHOOK(Spawn)() { int i; @@ -5576,12 +5476,12 @@ void CBasePlayer::__MAKE_VHOOK(Spawn)(void) } /* <153555> ../cstrike/dlls/player.cpp:6620 */ -void CBasePlayer::__MAKE_VHOOK(Precache)(void) +void CBasePlayer::__MAKE_VHOOK(Precache)() { // in the event that the player JUST spawned, and the level node graph // was loaded, fix all of the node graph pointers before the game starts. - // !!!BUGBUG - now that we have multiplayer, this needs to be moved! + // TODO: (BUGBUG) now that we have multiplayer, this needs to be moved! if (WorldGraph.m_fGraphPresent && !WorldGraph.m_fGraphPointersSet) { if (!WorldGraph.FSetGraphPointers()) @@ -5647,7 +5547,7 @@ void CBasePlayer::SetScoreboardAttributes(CBasePlayer *destination) // Marks everything as new so the player will resend this to the hud. /* <156e88> ../cstrike/dlls/player.cpp:6712 */ -NOXREF void CBasePlayer::RenewItems(void) +NOXREF void CBasePlayer::RenewItems() { ; } @@ -5696,7 +5596,7 @@ int CBasePlayer::__MAKE_VHOOK(Restore)(CRestore &restore) } /* <156eab> ../cstrike/dlls/player.cpp:6771 */ -void CBasePlayer::Reset(void) +void CBasePlayer::Reset() { pev->frags = 0; m_iDeaths = 0; @@ -5842,7 +5742,7 @@ void CBasePlayer::SelectItem(const char *pstr) } /* <157268> ../cstrike/dlls/player.cpp:6909 */ -void CBasePlayer::SelectLastItem(void) +void CBasePlayer::SelectLastItem() { if (m_pActiveItem && !m_pActiveItem->CanHolster()) return; @@ -5894,7 +5794,7 @@ void CBasePlayer::SelectLastItem(void) // HasWeapons - do I have any weapons at all? /* <15733a> ../cstrike/dlls/player.cpp:6967 */ -BOOL CBasePlayer::HasWeapons(void) +BOOL CBasePlayer::HasWeapons() { for (int i = 0; i < MAX_ITEM_TYPES; ++i) { @@ -5912,7 +5812,7 @@ NOXREF void CBasePlayer::SelectPrevItem(int iItem) } /* <15106c> ../cstrike/dlls/player.cpp:6987 */ -const char *CBasePlayer::__MAKE_VHOOK(TeamID)(void) +const char *CBasePlayer::__MAKE_VHOOK(TeamID)() { // Not fully connected yet if (pev == NULL) @@ -5935,7 +5835,7 @@ void CSprayCan::Spawn(entvars_t *pevOwner) } /* <151815> ../cstrike/dlls/player.cpp:7021 */ -void CSprayCan::__MAKE_VHOOK(Think)(void) +void CSprayCan::__MAKE_VHOOK(Think)() { TraceResult tr; int playernum; @@ -5984,7 +5884,7 @@ void CBloodSplat::Spawn(entvars_t *pevOwner) } /* <151758> ../cstrike/dlls/player.cpp:7074 */ -void CBloodSplat::Spray(void) +void CBloodSplat::Spray() { TraceResult tr; if (g_Language != LANGUAGE_GERMAN) @@ -6035,13 +5935,13 @@ CBaseEntity *FindEntityForward(CBaseEntity *pMe) } /* <15777b> ../cstrike/dlls/player.cpp:7129 */ -BOOL CBasePlayer::FlashlightIsOn(void) +BOOL CBasePlayer::FlashlightIsOn() { return pev->effects & EF_DIMLIGHT; } /* <15779e> ../cstrike/dlls/player.cpp:7135 */ -void CBasePlayer::FlashlightTurnOn(void) +void CBasePlayer::FlashlightTurnOn() { if (!g_pGameRules->FAllowFlashlight()) return; @@ -6062,7 +5962,7 @@ void CBasePlayer::FlashlightTurnOn(void) } /* <157816> ../cstrike/dlls/player.cpp:7157 */ -void CBasePlayer::FlashlightTurnOff(void) +void CBasePlayer::FlashlightTurnOff() { EMIT_SOUND(ENT(pev), CHAN_ITEM, SOUND_FLASHLIGHT_OFF, VOL_NORM, ATTN_NORM); @@ -6076,7 +5976,7 @@ void CBasePlayer::FlashlightTurnOff(void) } /* <158ae7> ../cstrike/dlls/player.cpp:7179 */ -void CBasePlayer::ForceClientDllUpdate(void) +void CBasePlayer::ForceClientDllUpdate() { m_iClientHealth = -1; m_iClientBattery = -1; @@ -6089,7 +5989,7 @@ void CBasePlayer::ForceClientDllUpdate(void) } /* <157f8d> ../cstrike/dlls/player.cpp:7202 */ -void CBasePlayer::__MAKE_VHOOK(ImpulseCommands)(void) +void CBasePlayer::__MAKE_VHOOK(ImpulseCommands)() { TraceResult tr; @@ -6386,7 +6286,7 @@ void OLD_CheckRescueZone(CBasePlayer *player) } /* <1582e9> ../cstrike/dlls/player.cpp:7553 */ -void CBasePlayer::HandleSignals(void) +void CBasePlayer::HandleSignals() { CHalfLifeMultiplay *mp = g_pGameRules; @@ -6592,7 +6492,7 @@ int CBasePlayer::__MAKE_VHOOK(GiveAmmo)(int iCount, char *szName, int iMax) // Called every frame by the player PreThink /* <158b10> ../cstrike/dlls/player.cpp:7784 */ -void CBasePlayer::ItemPreFrame(void) +void CBasePlayer::ItemPreFrame() { #ifdef CLIENT_WEAPONS if (m_flNextAttack > 0) @@ -6611,7 +6511,7 @@ void CBasePlayer::ItemPreFrame(void) // Called every frame by the player PostThink /* <158b33> ../cstrike/dlls/player.cpp:7805 */ -void CBasePlayer::ItemPostFrame(void) +void CBasePlayer::ItemPostFrame() { static int fInSelect = FALSE; @@ -6668,7 +6568,7 @@ int CBasePlayer::GetAmmoIndex(const char *psz) } /* <158bf7> ../cstrike/dlls/player.cpp:7865 */ -void CBasePlayer::SendAmmoUpdate(void) +void CBasePlayer::SendAmmoUpdate() { for (int i = 0; i < MAX_AMMO_SLOTS; ++i) { @@ -6686,7 +6586,7 @@ void CBasePlayer::SendAmmoUpdate(void) } /* <158d4b> ../cstrike/dlls/player.cpp:7885 */ -void CBasePlayer::SendHostagePos(void) +void CBasePlayer::SendHostagePos() { CBaseEntity *pHostage = NULL; @@ -6705,13 +6605,13 @@ void CBasePlayer::SendHostagePos(void) } /* <158c66> ../cstrike/dlls/player.cpp:7908 */ -void CBasePlayer::SendHostageIcons(void) +void CBasePlayer::SendHostageIcons() { CBaseEntity *pHostage = NULL; int numHostages = 0; char buf[16]; - if (!UTIL_IsGame("czero")) + if (!g_bIsCzeroGame) return; while ((pHostage = UTIL_FindEntityByClassname(pHostage, "hostage_entity")) != NULL) @@ -6742,7 +6642,7 @@ void CBasePlayer::SendHostageIcons(void) } /* <158dc6> ../cstrike/dlls/player.cpp:7949 */ -void CBasePlayer::SendWeatherInfo(void) +void CBasePlayer::SendWeatherInfo() { CBaseEntity *pPoint = UTIL_FindEntityByClassname(NULL, "env_rain"); CBaseEntity *pPoint2 = UTIL_FindEntityByClassname(NULL, "func_rain"); @@ -6774,7 +6674,7 @@ void CBasePlayer::SendWeatherInfo(void) // reflecting all of the HUD state info. /* <159d3c> ../cstrike/dlls/player.cpp:7963 */ -void CBasePlayer::__MAKE_VHOOK(UpdateClientData)(void) +void CBasePlayer::__MAKE_VHOOK(UpdateClientData)() { if (m_fInitHUD) { @@ -7107,7 +7007,7 @@ void CBasePlayer::__MAKE_VHOOK(UpdateClientData)(void) } /* <1510bc> ../cstrike/dlls/player.cpp:8330 */ -BOOL CBasePlayer::__MAKE_VHOOK(FBecomeProne)(void) +BOOL CBasePlayer::__MAKE_VHOOK(FBecomeProne)() { m_afPhysicsFlags |= PFLAG_ONBARNACLE; return TRUE; @@ -7120,7 +7020,7 @@ NOXREF void CBasePlayer::BarnacleVictimBitten(entvars_t *pevBarnacle) } /* <158ec3> ../cstrike/dlls/player.cpp:8350 */ -NOXREF void CBasePlayer::BarnacleVictimReleased(void) +NOXREF void CBasePlayer::BarnacleVictimReleased() { m_afPhysicsFlags &= ~PFLAG_ONBARNACLE; } @@ -7128,7 +7028,7 @@ NOXREF void CBasePlayer::BarnacleVictimReleased(void) // return player light level plus virtual muzzle flash /* <1510e4> ../cstrike/dlls/player.cpp:8360 */ -int CBasePlayer::__MAKE_VHOOK(Illumination)(void) +int CBasePlayer::__MAKE_VHOOK(Illumination)() { int iIllum = CBaseEntity::Illumination(); @@ -7150,7 +7050,7 @@ void CBasePlayer::EnableControl(BOOL fControl) } /* <151142> ../cstrike/dlls/player.cpp:8387 */ -void CBasePlayer::__MAKE_VHOOK(ResetMaxSpeed)(void) +void CBasePlayer::__MAKE_VHOOK(ResetMaxSpeed)() { float speed; @@ -7269,7 +7169,7 @@ Vector CBasePlayer::AutoaimDeflection(Vector &vecSrc, float flDist, float flDelt } /* <158fc1> ../cstrike/dlls/player.cpp:8686 */ -void CBasePlayer::ResetAutoaim(void) +void CBasePlayer::ResetAutoaim() { if (m_vecAutoAim.x != 0.0f || m_vecAutoAim.y != 0.0f) { @@ -7294,7 +7194,7 @@ void CBasePlayer::SetCustomDecalFrames(int nFrames) // Returns the # of custom frames this player's custom clan logo contains. /* <15902e> ../cstrike/dlls/player.cpp:8720 */ -int CBasePlayer::GetCustomDecalFrames(void) +int CBasePlayer::GetCustomDecalFrames() { return m_nCustomSprayFrames; } @@ -7311,14 +7211,14 @@ void CBasePlayer::__MAKE_VHOOK(Blind)(float duration, float holdTime, float fade } /* <159051> ../cstrike/dlls/player.cpp:8741 */ -void CBasePlayer::InitStatusBar(void) +void CBasePlayer::InitStatusBar() { m_flStatusBarDisappearDelay = 0.0f; m_SbarString0[0] = '\0'; } /* <159079> ../cstrike/dlls/player.cpp:8749 */ -void CBasePlayer::UpdateStatusBar(void) +void CBasePlayer::UpdateStatusBar() { int newSBarState[ SBAR_END ]; char sbuf0[ SBAR_STRING_SIZE ]; @@ -7634,7 +7534,7 @@ BOOL CBasePlayer::HasNamedPlayerItem(const char *pszItemName) } /* <1619fd> ../cstrike/dlls/player.cpp:9137 */ -void CBasePlayer::SwitchTeam(void) +void CBasePlayer::SwitchTeam() { int oldTeam; char *szOldTeam; @@ -7662,7 +7562,7 @@ void CBasePlayer::SwitchTeam(void) SET_CLIENT_KEY_VALUE(entindex(), GET_INFO_BUFFER(edict()), "model", "arctic"); break; case MODEL_SPETSNAZ: - if (UTIL_IsGame("czero")) + if (g_bIsCzeroGame) { m_iModelName = MODEL_MILITIA; SET_CLIENT_KEY_VALUE(entindex(), GET_INFO_BUFFER(edict()), "model", "militia"); @@ -7699,7 +7599,7 @@ void CBasePlayer::SwitchTeam(void) break; case MODEL_MILITIA: - if (UTIL_IsGame("czero")) + if (g_bIsCzeroGame) { m_iModelName = MODEL_SPETSNAZ; SET_CLIENT_KEY_VALUE(entindex(), GET_INFO_BUFFER(edict()), "model", "spetsnaz"); @@ -7863,7 +7763,7 @@ BOOL CBasePlayer::SwitchWeapon(CBasePlayerItem *pWeapon) } /* <1595ed> ../cstrike/dlls/player.cpp:9342 */ -void CBasePlayer::TabulateAmmo(void) +void CBasePlayer::TabulateAmmo() { ammo_buckshot = AmmoInventory(GetAmmoIndex("buckshot")); ammo_9mm = AmmoInventory(GetAmmoIndex("9mm")); @@ -7878,7 +7778,7 @@ void CBasePlayer::TabulateAmmo(void) } /* <1511eb> ../cstrike/dlls/player.cpp:9365 */ -int CDeadHEV::__MAKE_VHOOK(Classify)(void) +int CDeadHEV::__MAKE_VHOOK(Classify)() { return CLASS_HUMAN_MILITARY; } @@ -7899,7 +7799,7 @@ void CDeadHEV::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) LINK_ENTITY_TO_CLASS(monster_hevsuit_dead, CDeadHEV); /* <1513ce> ../cstrike/dlls/player.cpp:9391 */ -void CDeadHEV::__MAKE_VHOOK(Spawn)(void) +void CDeadHEV::__MAKE_VHOOK(Spawn)() { PRECACHE_MODEL("models/player.mdl"); SET_MODEL(ENT(pev), "models/player.mdl"); @@ -7989,7 +7889,7 @@ void CRevertSaved::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCall } /* <152a96> ../cstrike/dlls/player.cpp:9517 */ -void CRevertSaved::MessageThink(void) +void CRevertSaved::MessageThink() { float nextThink = LoadTime() - MessageTime(); UTIL_ShowMessageAll(STRING(pev->message)); @@ -8004,14 +7904,14 @@ void CRevertSaved::MessageThink(void) } /* <15198b> ../cstrike/dlls/player.cpp:9531 */ -void CRevertSaved::LoadThink(void) +void CRevertSaved::LoadThink() { if (!gpGlobals->deathmatch) SERVER_COMMAND("reload\n"); } /* <15133c> ../cstrike/dlls/player.cpp:9549 */ -void CInfoIntermission::__MAKE_VHOOK(Spawn)(void) +void CInfoIntermission::__MAKE_VHOOK(Spawn)() { UTIL_SetOrigin(pev, pev->origin); @@ -8022,7 +7922,7 @@ void CInfoIntermission::__MAKE_VHOOK(Spawn)(void) } /* <1530e6> ../cstrike/dlls/player.cpp:9560 */ -void CInfoIntermission::__MAKE_VHOOK(Think)(void) +void CInfoIntermission::__MAKE_VHOOK(Think)() { edict_t *pTarget = FIND_ENTITY_BY_TARGETNAME(NULL, STRING(pev->target)); @@ -8037,7 +7937,7 @@ void CInfoIntermission::__MAKE_VHOOK(Think)(void) LINK_ENTITY_TO_CLASS(info_intermission, CInfoIntermission); /* <159df8> ../cstrike/dlls/player.cpp:9586 */ -void CBasePlayer::StudioEstimateGait(void) +void CBasePlayer::StudioEstimateGait() { float_precision dt; Vector est_velocity; @@ -8145,7 +8045,7 @@ void CBasePlayer::StudioPlayerBlend(int *pBlend, float *pPitch) } /* <159f81> ../cstrike/dlls/player.cpp:9709 */ -void CBasePlayer::CalculatePitchBlend(void) +void CBasePlayer::CalculatePitchBlend() { int iBlend; float temp = pev->angles.x; @@ -8157,7 +8057,7 @@ void CBasePlayer::CalculatePitchBlend(void) } /* <15a007> ../cstrike/dlls/player.cpp:9720 */ -void CBasePlayer::CalculateYawBlend(void) +void CBasePlayer::CalculateYawBlend() { float dt; float maxyaw = 255.0f; @@ -8215,7 +8115,7 @@ void CBasePlayer::CalculateYawBlend(void) } /* <15a07b> ../cstrike/dlls/player.cpp:9776 */ -void CBasePlayer::StudioProcessGait(void) +void CBasePlayer::StudioProcessGait() { mstudioseqdesc_t *pseqdesc; float_precision dt = gpGlobals->frametime; @@ -8252,7 +8152,7 @@ void CBasePlayer::StudioProcessGait(void) } /* <15a444> ../cstrike/dlls/player.cpp:9821 */ -void CBasePlayer::ResetStamina(void) +void CBasePlayer::ResetStamina() { pev->fuser1 = 0; pev->fuser3 = 0; @@ -8262,8 +8162,8 @@ void CBasePlayer::ResetStamina(void) /* <15a467> ../cstrike/dlls/player.cpp:9829 */ float_precision GetPlayerPitch(const edict_t *pEdict) { - entvars_t *pev = VARS((edict_t *)pEdict); - CBasePlayer *pPlayer = static_cast(CBasePlayer::Instance(pev)); + entvars_t *pev = VARS(const_cast(pEdict)); + CBasePlayer *pPlayer = dynamic_cast(CBasePlayer::Instance(pev)); if (!pPlayer) return 0.0f; @@ -8274,8 +8174,8 @@ float_precision GetPlayerPitch(const edict_t *pEdict) /* <15a530> ../cstrike/dlls/player.cpp:9846 */ float_precision GetPlayerYaw(const edict_t *pEdict) { - entvars_t *pev = VARS((edict_t *)pEdict); - CBasePlayer *pPlayer = static_cast(CBasePlayer::Instance(pev)); + entvars_t *pev = VARS(const_cast(pEdict)); + CBasePlayer *pPlayer = dynamic_cast(CBasePlayer::Instance(pev)); if (!pPlayer) return 0.0f; @@ -8286,8 +8186,8 @@ float_precision GetPlayerYaw(const edict_t *pEdict) /* <15a5f9> ../cstrike/dlls/player.cpp:9863 */ int GetPlayerGaitsequence(const edict_t *pEdict) { - entvars_t *pev = VARS((edict_t *)pEdict); - CBasePlayer *pPlayer = static_cast(CBasePlayer::Instance(pev)); + entvars_t *pev = VARS(const_cast(pEdict)); + CBasePlayer *pPlayer = dynamic_cast(CBasePlayer::Instance(pev)); if (!pPlayer) return 1; @@ -8296,7 +8196,7 @@ int GetPlayerGaitsequence(const edict_t *pEdict) } /* <15a6c2> ../cstrike/dlls/player.cpp:9880 */ -void CBasePlayer::SpawnClientSideCorpse(void) +void CBasePlayer::SpawnClientSideCorpse() { char *infobuffer = GET_INFO_BUFFER(edict()); char *pModel = GET_KEY_VALUE(infobuffer, "model"); @@ -8423,7 +8323,7 @@ bool CBasePlayer::IsLookingAtPosition(Vector *pos, float angleTolerance) } /* <15aa7b> ../cstrike/dlls/player.cpp:10083 */ -bool CBasePlayer::CanAffordPrimary(void) +bool CBasePlayer::CanAffordPrimary() { int account = m_iAccount; @@ -8454,7 +8354,7 @@ bool CBasePlayer::CanAffordPrimary(void) } /* <15ab2c> ../cstrike/dlls/player.cpp:10139 */ -bool CBasePlayer::CanAffordPrimaryAmmo(void) +bool CBasePlayer::CanAffordPrimaryAmmo() { CBasePlayerWeapon *primary = (CBasePlayerWeapon *)&m_rgpPlayerItems[ PRIMARY_WEAPON_SLOT ]; @@ -8470,7 +8370,7 @@ bool CBasePlayer::CanAffordPrimaryAmmo(void) } /* <15aba0> ../cstrike/dlls/player.cpp:10169 */ -bool CBasePlayer::CanAffordSecondaryAmmo(void) +bool CBasePlayer::CanAffordSecondaryAmmo() { CBasePlayerWeapon *secondary = (CBasePlayerWeapon *)&m_rgpPlayerItems[ PISTOL_SLOT ]; @@ -8486,7 +8386,7 @@ bool CBasePlayer::CanAffordSecondaryAmmo(void) } /* <15ac14> ../cstrike/dlls/player.cpp:10199 */ -bool CBasePlayer::CanAffordArmor(void) +bool CBasePlayer::CanAffordArmor() { if (m_iKevlar == ARMOR_TYPE_KEVLAR && pev->armorvalue == 100.0f && m_iAccount >= HELMET_PRICE) return true; @@ -8495,19 +8395,19 @@ bool CBasePlayer::CanAffordArmor(void) } /* <15ac3c> ../cstrike/dlls/player.cpp:10217 */ -bool CBasePlayer::CanAffordDefuseKit(void) +bool CBasePlayer::CanAffordDefuseKit() { return (m_iAccount >= DEFUSEKIT_PRICE); } /* <15ac64> ../cstrike/dlls/player.cpp:10227 */ -bool CBasePlayer::CanAffordGrenade(void) +bool CBasePlayer::CanAffordGrenade() { return (m_iAccount >= FLASHBANG_PRICE); } /* <15ac8c> ../cstrike/dlls/player.cpp:10247 */ -bool CBasePlayer::NeedsPrimaryAmmo(void) +bool CBasePlayer::NeedsPrimaryAmmo() { CBasePlayerWeapon *primary = (CBasePlayerWeapon *)&m_rgpPlayerItems[ PRIMARY_WEAPON_SLOT ]; @@ -8518,7 +8418,7 @@ bool CBasePlayer::NeedsPrimaryAmmo(void) } /* <15ace1> ../cstrike/dlls/player.cpp:10268 */ -bool CBasePlayer::NeedsSecondaryAmmo(void) +bool CBasePlayer::NeedsSecondaryAmmo() { CBasePlayerWeapon *secondary = (CBasePlayerWeapon *)&m_rgpPlayerItems[ PISTOL_SLOT ]; @@ -8529,7 +8429,7 @@ bool CBasePlayer::NeedsSecondaryAmmo(void) } /* <15ad36> ../cstrike/dlls/player.cpp:10285 */ -bool CBasePlayer::NeedsArmor(void) +bool CBasePlayer::NeedsArmor() { if (m_iKevlar == ARMOR_TYPE_EMPTY) return true; @@ -8538,7 +8438,7 @@ bool CBasePlayer::NeedsArmor(void) } /* <15ad5e> ../cstrike/dlls/player.cpp:10300 */ -bool CBasePlayer::NeedsDefuseKit(void) +bool CBasePlayer::NeedsDefuseKit() { CHalfLifeMultiplay *mpRules = g_pGameRules; @@ -8549,7 +8449,7 @@ bool CBasePlayer::NeedsDefuseKit(void) } /* <15ad9a> ../cstrike/dlls/player.cpp:10325 */ -bool CBasePlayer::NeedsGrenade(void) +bool CBasePlayer::NeedsGrenade() { int iAmmoIndex = GetAmmoIndex("HEGrenade"); @@ -8607,7 +8507,7 @@ const char *GetBuyStringForWeaponClass(int weaponClass) } /* <15aee9> ../cstrike/dlls/player.cpp:10454 */ -void CBasePlayer::ClearAutoBuyData(void) +void CBasePlayer::ClearAutoBuyData() { m_autoBuyString[0] = '\0'; } @@ -8646,7 +8546,7 @@ void CBasePlayer::InitRebuyData(const char *str) } /* <15be4f> ../cstrike/dlls/player.cpp:10500 */ -void CBasePlayer::AutoBuy(void) +void CBasePlayer::AutoBuy() { const char *c = NULL; bool boughtPrimary = false; @@ -8771,7 +8671,7 @@ bool CurrentWeaponSatisfies(CBasePlayerWeapon *pWeapon, int id, int classId) } /* <15b1eb> ../cstrike/dlls/player.cpp:10623 */ -const char *CBasePlayer::PickPrimaryCareerTaskWeapon(void) +const char *CBasePlayer::PickPrimaryCareerTaskWeapon() { const int BufLen = 256; static char buf[BufLen]; @@ -8853,7 +8753,7 @@ const char *CBasePlayer::PickPrimaryCareerTaskWeapon(void) } /* <15b5d7> ../cstrike/dlls/player.cpp:10690 */ -const char *CBasePlayer::PickSecondaryCareerTaskWeapon(void) +const char *CBasePlayer::PickSecondaryCareerTaskWeapon() { const int BufLen = 256; static char buf[BufLen]; @@ -8936,7 +8836,7 @@ const char *CBasePlayer::PickSecondaryCareerTaskWeapon(void) } /* <15b9ea> ../cstrike/dlls/player.cpp:10759 */ -const char *CBasePlayer::PickFlashKillWeaponString(void) +const char *CBasePlayer::PickFlashKillWeaponString() { if (TheCareerTasks == NULL) return NULL; @@ -8961,7 +8861,7 @@ const char *CBasePlayer::PickFlashKillWeaponString(void) } /* <15baa1> ../cstrike/dlls/player.cpp:10787 */ -const char *CBasePlayer::PickGrenadeKillWeaponString(void) +const char *CBasePlayer::PickGrenadeKillWeaponString() { if (TheCareerTasks == NULL) return NULL; @@ -9200,7 +9100,7 @@ void CBasePlayer::PostAutoBuyCommandProcessing(AutoBuyInfoStruct *commandInfo, b } /* <15c0b4> ../cstrike/dlls/player.cpp:11027 */ -void CBasePlayer::BuildRebuyStruct(void) +void CBasePlayer::BuildRebuyStruct() { if (m_bIsInRebuy) { @@ -9274,7 +9174,7 @@ void CBasePlayer::BuildRebuyStruct(void) } /* <15c37d> ../cstrike/dlls/player.cpp:11134 */ -void CBasePlayer::Rebuy(void) +void CBasePlayer::Rebuy() { char *fileData = m_rebuyString; char *token; @@ -9322,7 +9222,7 @@ void CBasePlayer::Rebuy(void) } /* <15c96a> ../cstrike/dlls/player.cpp:11200 */ -void CBasePlayer::RebuyPrimaryWeapon(void) +void CBasePlayer::RebuyPrimaryWeapon() { if (!m_rgpPlayerItems[ PRIMARY_WEAPON_SLOT ]) { @@ -9337,7 +9237,7 @@ void CBasePlayer::RebuyPrimaryWeapon(void) } /* <15c9e4> ../cstrike/dlls/player.cpp:11217 */ -void CBasePlayer::RebuyPrimaryAmmo(void) +void CBasePlayer::RebuyPrimaryAmmo() { CBasePlayerWeapon *primary = (CBasePlayerWeapon *)m_rgpPlayerItems[ PRIMARY_WEAPON_SLOT ]; @@ -9350,7 +9250,7 @@ void CBasePlayer::RebuyPrimaryAmmo(void) } /* <15ca68> ../cstrike/dlls/player.cpp:11233 */ -void CBasePlayer::RebuySecondaryWeapon(void) +void CBasePlayer::RebuySecondaryWeapon() { if (m_rebuyStruct.m_secondaryWeapon) { @@ -9362,7 +9262,7 @@ void CBasePlayer::RebuySecondaryWeapon(void) } /* <15cae2> ../cstrike/dlls/player.cpp:11245 */ -void CBasePlayer::RebuySecondaryAmmo(void) +void CBasePlayer::RebuySecondaryAmmo() { CBasePlayerWeapon *secondary = (CBasePlayerWeapon *)m_rgpPlayerItems[ PISTOL_SLOT ]; @@ -9374,7 +9274,7 @@ void CBasePlayer::RebuySecondaryAmmo(void) } /* <15cb66> ../cstrike/dlls/player.cpp:11259 */ -void CBasePlayer::RebuyHEGrenade(void) +void CBasePlayer::RebuyHEGrenade() { int iAmmoIndex = GetAmmoIndex("HEGrenade"); @@ -9388,7 +9288,7 @@ void CBasePlayer::RebuyHEGrenade(void) } /* <15cc3f> ../cstrike/dlls/player.cpp:11279 */ -void CBasePlayer::RebuyFlashbang(void) +void CBasePlayer::RebuyFlashbang() { int iAmmoIndex = GetAmmoIndex("Flashbang"); @@ -9402,7 +9302,7 @@ void CBasePlayer::RebuyFlashbang(void) } /* <15cd18> ../cstrike/dlls/player.cpp:11299 */ -void CBasePlayer::RebuySmokeGrenade(void) +void CBasePlayer::RebuySmokeGrenade() { int iAmmoIndex = GetAmmoIndex("SmokeGrenade"); @@ -9416,7 +9316,7 @@ void CBasePlayer::RebuySmokeGrenade(void) } /* <15cdf1> ../cstrike/dlls/player.cpp:11319 */ -void CBasePlayer::RebuyDefuser(void) +void CBasePlayer::RebuyDefuser() { // If we don't have a defuser, and we want one, buy it! if (m_rebuyStruct.m_defuser && !m_bHasDefuser) @@ -9426,7 +9326,7 @@ void CBasePlayer::RebuyDefuser(void) } /* <15ce59> ../cstrike/dlls/player.cpp:11330 */ -void CBasePlayer::RebuyNightVision(void) +void CBasePlayer::RebuyNightVision() { // If we don't have night vision and we want one, buy it! if (m_rebuyStruct.m_nightVision && !m_bHasNightVision) @@ -9436,7 +9336,7 @@ void CBasePlayer::RebuyNightVision(void) } /* <15cec1> ../cstrike/dlls/player.cpp:11341 */ -void CBasePlayer::RebuyArmor(void) +void CBasePlayer::RebuyArmor() { if (m_rebuyStruct.m_armor) { @@ -9470,7 +9370,7 @@ void CBasePlayer::UpdateLocation(bool forceUpdate) const char *placeName = ""; - if (pev->deadflag == DEAD_NO && UTIL_IsGame("czero")) + if (pev->deadflag == DEAD_NO && g_bIsCzeroGame) { // search the place name where is located the player Place playerPlace = TheNavAreaGrid.GetPlace(&pev->origin); @@ -9517,213 +9417,3 @@ void CBasePlayer::UpdateLocation(bool forceUpdate) } } } - -#ifdef HOOK_GAMEDLL - -void CBasePlayer::Spawn(void) -{ - Spawn_(); -} - -void CBasePlayer::Precache(void) -{ - Precache_(); -} - -int CBasePlayer::Save(CSave &save) -{ - return Save_(save); -} - -int CBasePlayer::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -int CBasePlayer::Classify(void) -{ - return Classify_(); -} - -void CBasePlayer::TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType) -{ - TraceAttack_(pevAttacker, flDamage, vecDir, ptr, bitsDamageType); -} - -int CBasePlayer::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) -{ - return TakeDamage_(pevInflictor, pevAttacker, flDamage, bitsDamageType); -} - -int CBasePlayer::TakeHealth(float flHealth, int bitsDamageType) -{ - return TakeHealth_(flHealth, bitsDamageType); -} - -void CBasePlayer::Killed(entvars_t *pevAttacker, int iGib) -{ - Killed_(pevAttacker, iGib); -} - -void CBasePlayer::AddPoints(int score, BOOL bAllowNegativeScore) -{ - AddPoints_(score, bAllowNegativeScore); -} - -void CBasePlayer::AddPointsToTeam(int score, BOOL bAllowNegativeScore) -{ - AddPointsToTeam_(score, bAllowNegativeScore); -} - -BOOL CBasePlayer::AddPlayerItem(CBasePlayerItem *pItem) -{ - return AddPlayerItem_(pItem); -} - -BOOL CBasePlayer::RemovePlayerItem(CBasePlayerItem *pItem) -{ - return RemovePlayerItem_(pItem); -} - -int CBasePlayer::GiveAmmo(int iAmount, char *szName, int iMax) -{ - return GiveAmmo_(iAmount, szName, iMax); -} - -const char *CBasePlayer::TeamID(void) -{ - return TeamID_(); -} - -BOOL CBasePlayer::FBecomeProne(void) -{ - return FBecomeProne_(); -} - -int CBasePlayer::Illumination(void) -{ - return Illumination_(); -} - -void CBasePlayer::ResetMaxSpeed(void) -{ - ResetMaxSpeed_(); -} - -void CBasePlayer::Jump(void) -{ - Jump_(); -} - -void CBasePlayer::Duck(void) -{ - Duck_(); -} - -void CBasePlayer::PreThink(void) -{ - PreThink_(); -} - -void CBasePlayer::PostThink(void) -{ - PostThink_(); -} - -Vector CBasePlayer::GetGunPosition(void) -{ - return GetGunPosition_(); -} - -void CBasePlayer::UpdateClientData(void) -{ - UpdateClientData_(); -} - -void CBasePlayer::ImpulseCommands(void) -{ - ImpulseCommands_(); -} - -void CBasePlayer::RoundRespawn(void) -{ - RoundRespawn_(); -} - -Vector CBasePlayer::GetAutoaimVector(float flDelta) -{ - return GetAutoaimVector_(flDelta); -} - -void CBasePlayer::Blind(float flUntilTime, float flHoldTime, float flFadeTime, int iAlpha) -{ - Blind_(flUntilTime, flHoldTime, flFadeTime, iAlpha); -} - -void CStripWeapons::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -void CRevertSaved::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -int CRevertSaved::Save(CSave &save) -{ - return Save_(save); -} - -int CRevertSaved::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -void CRevertSaved::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -void CDeadHEV::Spawn(void) -{ - Spawn_(); -} - -void CDeadHEV::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -int CDeadHEV::Classify(void) -{ - return Classify_(); -} - -void CSprayCan::Think(void) -{ - Think_(); -} - -void CInfoIntermission::Spawn(void) -{ - Spawn_(); -} - -void CInfoIntermission::Think(void) -{ - Think_(); -} - -void CWShield::Spawn(void) -{ - Spawn_(); -} - -void CWShield::Touch(CBaseEntity *pOther) -{ - Touch_(pOther); - -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/player.h b/regamedll/dlls/player.h index 7bcb89a2..53def6fc 100644 --- a/regamedll/dlls/player.h +++ b/regamedll/dlls/player.h @@ -269,110 +269,7 @@ struct WeaponStruct int m_side; int m_slot; int m_ammoPrice; - -};/* size: 20, cachelines: 1, members: 5 */ - -#define DEFINE_WEAPON(m_wpnid, m_cost, m_slotnum, m_acost)\ - { m_wpnid, m_cost, 3, m_slotnum, m_acost } - -#ifdef HOOK_GAMEDLL - -#define m_szPoses (*pm_szPoses) -#define g_weaponStruct (*pg_weaponStruct) -#define gEvilImpulse101 (*pgEvilImpulse101) -#define g_szMapBriefingText (*pg_szMapBriefingText) -#define g_pevLastInflictor (*pg_pevLastInflictor) -#define g_pLastSpawn (*pg_pLastSpawn) -#define g_pLastCTSpawn (*pg_pLastCTSpawn) -#define g_pLastTerroristSpawn (*pg_pLastTerroristSpawn) -#define gInitHUD (*pgInitHUD) -#define sv_aim (*psv_aim) -#define zombieSpawnCount (*pzombieSpawnCount) -#define zombieSpawn (*pzombieSpawn) -#define g_pSelectedZombieSpawn (*pg_pSelectedZombieSpawn) -#define giPrecacheGrunt (*pgiPrecacheGrunt) -#define gmsgWeapPickup (*pgmsgWeapPickup) -#define gmsgHudText (*pgmsgHudText) -#define gmsgHudTextArgs (*pgmsgHudTextArgs) -#define gmsgShake (*pgmsgShake) -#define gmsgFade (*pgmsgFade) -#define gmsgFlashlight (*pgmsgFlashlight) -#define gmsgFlashBattery (*pgmsgFlashBattery) -#define gmsgResetHUD (*pgmsgResetHUD) -#define gmsgInitHUD (*pgmsgInitHUD) -#define gmsgViewMode (*pgmsgViewMode) -#define gmsgShowGameTitle (*pgmsgShowGameTitle) -#define gmsgCurWeapon (*pgmsgCurWeapon) -#define gmsgHealth (*pgmsgHealth) -#define gmsgDamage (*pgmsgDamage) -#define gmsgBattery (*pgmsgBattery) -#define gmsgTrain (*pgmsgTrain) -#define gmsgLogo (*pgmsgLogo) -#define gmsgWeaponList (*pgmsgWeaponList) -#define gmsgAmmoX (*pgmsgAmmoX) -#define gmsgDeathMsg (*pgmsgDeathMsg) -#define gmsgScoreAttrib (*pgmsgScoreAttrib) -#define gmsgScoreInfo (*pgmsgScoreInfo) -#define gmsgTeamInfo (*pgmsgTeamInfo) -#define gmsgTeamScore (*pgmsgTeamScore) -#define gmsgGameMode (*pgmsgGameMode) -#define gmsgMOTD (*pgmsgMOTD) -#define gmsgServerName (*pgmsgServerName) -#define gmsgAmmoPickup (*pgmsgAmmoPickup) -#define gmsgItemPickup (*pgmsgItemPickup) -#define gmsgHideWeapon (*pgmsgHideWeapon) -#define gmsgSayText (*pgmsgSayText) -#define gmsgTextMsg (*pgmsgTextMsg) -#define gmsgSetFOV (*pgmsgSetFOV) -#define gmsgShowMenu (*pgmsgShowMenu) -#define gmsgSendAudio (*pgmsgSendAudio) -#define gmsgRoundTime (*pgmsgRoundTime) -#define gmsgMoney (*pgmsgMoney) -#define gmsgBlinkAcct (*pgmsgBlinkAcct) -#define gmsgArmorType (*pgmsgArmorType) -#define gmsgStatusValue (*pgmsgStatusValue) -#define gmsgStatusText (*pgmsgStatusText) -#define gmsgStatusIcon (*pgmsgStatusIcon) -#define gmsgBarTime (*pgmsgBarTime) -#define gmsgReloadSound (*pgmsgReloadSound) -#define gmsgCrosshair (*pgmsgCrosshair) -#define gmsgNVGToggle (*pgmsgNVGToggle) -#define gmsgRadar (*pgmsgRadar) -#define gmsgSpectator (*pgmsgSpectator) -#define gmsgVGUIMenu (*pgmsgVGUIMenu) -#define gmsgCZCareer (*pgmsgCZCareer) -#define gmsgCZCareerHUD (*pgmsgCZCareerHUD) -#define gmsgTaskTime (*pgmsgTaskTime) -#define gmsgTutorText (*pgmsgTutorText) -#define gmsgTutorLine (*pgmsgTutorLine) -#define gmsgShadowIdx (*pgmsgShadowIdx) -#define gmsgTutorState (*pgmsgTutorState) -#define gmsgTutorClose (*pgmsgTutorClose) -#define gmsgAllowSpec (*pgmsgAllowSpec) -#define gmsgBombDrop (*pgmsgBombDrop) -#define gmsgBombPickup (*pgmsgBombPickup) -#define gmsgHostagePos (*pgmsgHostagePos) -#define gmsgHostageK (*pgmsgHostageK) -#define gmsgGeigerRange (*pgmsgGeigerRange) -#define gmsgSendCorpse (*pgmsgSendCorpse) -#define gmsgHLTV (*pgmsgHLTV) -#define gmsgSpecHealth (*pgmsgSpecHealth) -#define gmsgForceCam (*pgmsgForceCam) -#define gmsgADStop (*pgmsgADStop) -#define gmsgReceiveW (*pgmsgReceiveW) -#define gmsgScenarioIcon (*pgmsgScenarioIcon) -#define gmsgBotVoice (*pgmsgBotVoice) -#define gmsgBuyClose (*pgmsgBuyClose) -#define gmsgItemStatus (*pgmsgItemStatus) -#define gmsgLocation (*pgmsgLocation) -#define gmsgSpecHealth2 (*pgmsgSpecHealth2) -#define gmsgBarTime2 (*pgmsgBarTime2) -#define gmsgBotProgress (*pgmsgBotProgress) -#define gmsgBrass (*pgmsgBrass) -#define gmsgFog (*pgmsgFog) -#define gmsgShowTimer (*pgmsgShowTimer) - -#endif // HOOK_GAMEDLL +}; /* <14efbf> ../cstrike/dlls/player.cpp:9418 */ class CStripWeapons: public CPointEntity @@ -386,87 +283,83 @@ public: #endif // HOOK_GAMEDLL -};/* size: 152, cachelines: 3, members: 1 */ +}; /* <14f06c> ../cstrike/dlls/player.cpp:9543 */ class CInfoIntermission: public CPointEntity { 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 -};/* size: 152, cachelines: 3, members: 1 */ +}; /* <14ef4d> ../cstrike/dlls/player.cpp:9361 */ class CDeadHEV: public CBaseMonster { public: - virtual void Spawn(void); + virtual void Spawn(); virtual void KeyValue(KeyValueData *pkvd); - virtual int Classify(void); + virtual int Classify(); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); void KeyValue_(KeyValueData *pkvd); - int Classify_(void); + int Classify_(); #endif // HOOK_GAMEDLL public: - int m_iPose; static char *m_szPoses[4]; - -};/* size: 408, cachelines: 7, members: 3 */ +}; /* <14ee80> ../cstrike/dlls/player.cpp:7001 */ class CSprayCan: public CBaseEntity { public: - virtual void Think(void); - virtual int ObjectCaps(void) + virtual void Think(); + virtual int ObjectCaps() { return FCAP_DONT_SAVE; } #ifdef HOOK_GAMEDLL - void Think_(void); + void Think_(); #endif // HOOK_GAMEDLL public: void Spawn(entvars_t *pevOwner); - -};/* size: 152, cachelines: 3, members: 1 */ +}; /* <14eea3> ../cstrike/dlls/player.cpp:7057 */ class CBloodSplat: public CBaseEntity { public: void Spawn(entvars_t *pevOwner); - void Spray(void); - -};/* size: 152, cachelines: 3, members: 1 */ + void Spray(); +}; /* <48ed5e> ../cstrike/dlls/player.h:250 */ class CBasePlayer: 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 int ObjectCaps(void) { return (CBaseMonster::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); } - virtual int Classify(void); + virtual int ObjectCaps() { return (CBaseMonster::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); } + virtual int Classify(); 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); @@ -476,38 +369,38 @@ public: virtual BOOL AddPlayerItem(CBasePlayerItem *pItem); virtual BOOL RemovePlayerItem(CBasePlayerItem *pItem); virtual int GiveAmmo(int iAmount, char *szName, int iMax); - virtual void StartSneaking(void) { m_tSneaking = gpGlobals->time - 1; } - virtual void StopSneaking(void) { m_tSneaking = gpGlobals->time + 30; } - virtual BOOL IsSneaking(void) { return m_tSneaking <= gpGlobals->time; } - virtual BOOL IsAlive(void) { return (pev->deadflag == DEAD_NO && pev->health > 0.0f); } - virtual BOOL IsPlayer(void) { return (pev->flags & FL_SPECTATOR) != FL_SPECTATOR; } - virtual BOOL IsNetClient(void) { return TRUE; } - virtual const char *TeamID(void); - virtual BOOL FBecomeProne(void); + virtual void StartSneaking() { m_tSneaking = gpGlobals->time - 1; } + virtual void StopSneaking() { m_tSneaking = gpGlobals->time + 30; } + virtual BOOL IsSneaking() { return m_tSneaking <= gpGlobals->time; } + virtual BOOL IsAlive() { return (pev->deadflag == DEAD_NO && pev->health > 0.0f); } + virtual BOOL IsPlayer() { return (pev->flags & FL_SPECTATOR) != FL_SPECTATOR; } + virtual BOOL IsNetClient() { return TRUE; } + virtual const char *TeamID(); + virtual BOOL FBecomeProne(); virtual Vector BodyTarget(const Vector &posSrc) { return Center() + pev->view_ofs * RANDOM_FLOAT(0.5, 1.1); } - virtual int Illumination(void); - virtual BOOL ShouldFadeOnDeath(void) { return FALSE; } - virtual void ResetMaxSpeed(void); - virtual void Jump(void); - virtual void Duck(void); - virtual void PreThink(void); - virtual void PostThink(void); - virtual Vector GetGunPosition(void); - virtual BOOL IsBot(void) { return FALSE; } - virtual void UpdateClientData(void); - virtual void ImpulseCommands(void); - virtual void RoundRespawn(void); + virtual int Illumination(); + virtual BOOL ShouldFadeOnDeath() { return FALSE; } + virtual void ResetMaxSpeed(); + virtual void Jump(); + virtual void Duck(); + virtual void PreThink(); + virtual void PostThink(); + virtual Vector GetGunPosition(); + virtual BOOL IsBot() { return FALSE; } + virtual void UpdateClientData(); + virtual void ImpulseCommands(); + virtual void RoundRespawn(); virtual Vector GetAutoaimVector(float flDelta); virtual void Blind(float flUntilTime, float flHoldTime, float flFadeTime, int iAlpha); virtual void OnTouchingWeapon(CWeaponBox *pWeapon) { } #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int Save_(CSave &save); int Restore_(CRestore &restore); - int Classify_(void); + int Classify_(); 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); @@ -517,52 +410,52 @@ public: BOOL AddPlayerItem_(CBasePlayerItem *pItem); BOOL RemovePlayerItem_(CBasePlayerItem *pItem); int GiveAmmo_(int iAmount,char *szName,int iMax); - const char *TeamID_(void); - BOOL FBecomeProne_(void); - int Illumination_(void); - void ResetMaxSpeed_(void); - void Jump_(void); - void Duck_(void); - void PreThink_(void); - void PostThink_(void); - Vector GetGunPosition_(void); - void UpdateClientData_(void); - void ImpulseCommands_(void); - void RoundRespawn_(void); + const char *TeamID_(); + BOOL FBecomeProne_(); + int Illumination_(); + void ResetMaxSpeed_(); + void Jump_(); + void Duck_(); + void PreThink_(); + void PostThink_(); + Vector GetGunPosition_(); + void UpdateClientData_(); + void ImpulseCommands_(); + void RoundRespawn_(); Vector GetAutoaimVector_(float flDelta); void Blind_(float flUntilTime, float flHoldTime, float flFadeTime, int iAlpha); #endif // HOOK_GAMEDLL public: - void SpawnClientSideCorpse(void); + void SpawnClientSideCorpse(); void Observer_FindNextPlayer(bool bReverse, const char *name = NULL); CBaseEntity *Observer_IsValidTarget(int iPlayerIndex, bool bSameTeam); - void Observer_HandleButtons(void); + void Observer_HandleButtons(); void Observer_SetMode(int iMode); - void Observer_CheckTarget(void); - void Observer_CheckProperties(void); - int IsObserver(void) { return pev->iuser1; } - NOXREF void PlantC4(void); + void Observer_CheckTarget(); + void Observer_CheckProperties(); + int IsObserver() { return pev->iuser1; } + NOXREF void PlantC4(); void Radio(const char *msg_id, const char *msg_verbose = NULL, short pitch = 100, bool showIcon = true); CBasePlayer *GetNextRadioRecipient(CBasePlayer *pStartPlayer); - void SmartRadio(void); + void SmartRadio(); NOXREF void ThrowWeapon(char *pszItemName); - NOXREF void ThrowPrimary(void); + NOXREF void ThrowPrimary(); void AddAccount(int amount, bool bTrackChange = true); - void Disappear(void); - void MakeVIP(void); + void Disappear(); + void MakeVIP(); bool CanPlayerBuy(bool display = false); - void SwitchTeam(void); - void TabulateAmmo(void); + void SwitchTeam(); + void TabulateAmmo(); void Pain(int m_LastHitGroup, bool HasArmour); - BOOL IsBombGuy(void); + BOOL IsBombGuy(); bool IsLookingAtPosition(Vector *pos, float angleTolerance = 20.0f); void Reset(); void SetScoreboardAttributes(CBasePlayer *destination = NULL); - NOXREF void RenewItems(void); - void PackDeadPlayerItems(void); - void GiveDefaultItems(void); + NOXREF void RenewItems(); + void PackDeadPlayerItems(); + void GiveDefaultItems(); void RemoveAllItems(BOOL removeSuit); void SetBombIcon(BOOL bFlash = FALSE); void SetProgressBarTime(int time); @@ -571,90 +464,90 @@ public: void SetNewPlayerModel(const char *modelName); BOOL SwitchWeapon(CBasePlayerItem *pWeapon); void CheckPowerups(entvars_t *pev); - bool CanAffordPrimary(void); - bool CanAffordPrimaryAmmo(void); - bool CanAffordSecondaryAmmo(void); - bool CanAffordArmor(void); - bool CanAffordDefuseKit(void); - bool CanAffordGrenade(void); - bool NeedsPrimaryAmmo(void); - bool NeedsSecondaryAmmo(void); - bool NeedsArmor(void); - bool NeedsDefuseKit(void); - bool NeedsGrenade(void); - BOOL IsOnLadder(void); - BOOL FlashlightIsOn(void); - void FlashlightTurnOn(void); - void FlashlightTurnOff(void); - void UpdatePlayerSound(void); - void DeathSound(void); + bool CanAffordPrimary(); + bool CanAffordPrimaryAmmo(); + bool CanAffordSecondaryAmmo(); + bool CanAffordArmor(); + bool CanAffordDefuseKit(); + bool CanAffordGrenade(); + bool NeedsPrimaryAmmo(); + bool NeedsSecondaryAmmo(); + bool NeedsArmor(); + bool NeedsDefuseKit(); + bool NeedsGrenade(); + BOOL IsOnLadder(); + BOOL FlashlightIsOn(); + void FlashlightTurnOn(); + void FlashlightTurnOff(); + void UpdatePlayerSound(); + void DeathSound(); void SetAnimation(PLAYER_ANIM playerAnim); NOXREF void SetWeaponAnimType(const char *szExtention) { Q_strcpy(m_szAnimExtention, szExtention); } void CheatImpulseCommands(int iImpulse); - void StartDeathCam(void); + void StartDeathCam(); void StartObserver(Vector vecPosition, Vector vecViewAngle); - void HandleSignals(void); + void HandleSignals(); void DropPlayerItem(const char *pszItemName); BOOL HasPlayerItem(CBasePlayerItem *pCheckItem); BOOL HasNamedPlayerItem(const char *pszItemName); - BOOL HasWeapons(void); + BOOL HasWeapons(); NOXREF void SelectPrevItem(int iItem); NOXREF void SelectNextItem(int iItem); - void SelectLastItem(void); + void SelectLastItem(); void SelectItem(const char *pstr); - void ItemPreFrame(void); - void ItemPostFrame(void); + void ItemPreFrame(); + void ItemPostFrame(); void GiveNamedItem(const char *pszName); void EnableControl(BOOL fControl); bool HintMessage(const char *pMessage, BOOL bDisplayIfPlayerDead = FALSE, BOOL bOverride = FALSE); - void SendAmmoUpdate(void); + void SendAmmoUpdate(); void SendFOV(int fov); - void WaterMove(void); - void EXPORT PlayerDeathThink(void); - void PlayerUse(void); - void HostageUsed(void); - void JoiningThink(void); - void RemoveLevelText(void); + void WaterMove(); + void EXPORT PlayerDeathThink(); + void PlayerUse(); + void HostageUsed(); + void JoiningThink(); + void RemoveLevelText(); void MenuPrint(const char *msg); - void ResetMenu(void); - void SyncRoundTimer(void); - void CheckSuitUpdate(void); + void ResetMenu(); + void SyncRoundTimer(); + void CheckSuitUpdate(); void SetSuitUpdate(char *name = NULL, int fgroup = 0, int iNoRepeatTime = 0); - void UpdateGeigerCounter(void); - void CheckTimeBasedDamage(void); + void UpdateGeigerCounter(); + void CheckTimeBasedDamage(); NOXREF void BarnacleVictimBitten(entvars_t *pevBarnacle); - NOXREF void BarnacleVictimReleased(void); + NOXREF void BarnacleVictimReleased(); static int GetAmmoIndex(const char *psz); int AmmoInventory(int iAmmoIndex); - void ResetAutoaim(void); + void ResetAutoaim(); Vector AutoaimDeflection(Vector &vecSrc, float flDist, float flDelta); - void ForceClientDllUpdate(void); + void ForceClientDllUpdate(); void DeathMessage(entvars_t *pevAttacker) {}; void SetCustomDecalFrames(int nFrames); - int GetCustomDecalFrames(void); - void InitStatusBar(void); - void UpdateStatusBar(void); - void StudioEstimateGait(void); + int GetCustomDecalFrames(); + void InitStatusBar(); + void UpdateStatusBar(); + void StudioEstimateGait(); void StudioPlayerBlend(int *pBlend, float *pPitch); - void CalculatePitchBlend(void); - void CalculateYawBlend(void); - void StudioProcessGait(void); - void SendHostagePos(void); - void SendHostageIcons(void); - void ResetStamina(void); + void CalculatePitchBlend(); + void CalculateYawBlend(); + void StudioProcessGait(); + void SendHostagePos(); + void SendHostageIcons(); + void ResetStamina(); BOOL IsArmored(int nHitGroup); BOOL ShouldDoLargeFlinch(int nHitGroup, int nGunType); void SetPrefsFromUserinfo(char *infobuffer); - void SendWeatherInfo(void); + void SendWeatherInfo(); void UpdateShieldCrosshair(bool draw); - bool HasShield(void); - bool IsProtectedByShield(void) { return HasShield() && m_bShieldDrawn; } - void RemoveShield(void); + bool HasShield(); + bool IsProtectedByShield() { return HasShield() && m_bShieldDrawn; } + void RemoveShield(); void DropShield(bool bDeploy = true); void GiveShield(bool bDeploy = true); bool IsHittingShield(Vector &vecDirection, TraceResult *ptr); bool SelectSpawnSpot(const char *pEntClassName, CBaseEntity* &pSpot); - bool IsReloading(void) + bool IsReloading() { CBasePlayerWeapon *weapon = static_cast(m_pActiveItem); @@ -663,41 +556,41 @@ public: return false; } - bool IsBlind(void) const { return (m_blindUntilTime > gpGlobals->time); } - bool IsAutoFollowAllowed(void) const { return (gpGlobals->time > m_allowAutoFollowTime); } + bool IsBlind() const { return (m_blindUntilTime > gpGlobals->time); } + bool IsAutoFollowAllowed() const { return (gpGlobals->time > m_allowAutoFollowTime); } void InhibitAutoFollow(float duration) { m_allowAutoFollowTime = gpGlobals->time + duration; } - void AllowAutoFollow(void) { m_allowAutoFollowTime = 0; } - void ClearAutoBuyData(void); + void AllowAutoFollow() { m_allowAutoFollowTime = 0; } + void ClearAutoBuyData(); void AddAutoBuyData(const char *str); - void AutoBuy(void); + void AutoBuy(); void ClientCommand(const char *cmd, const char *arg1 = NULL, const char *arg2 = NULL, const char *arg3 = NULL); void PrioritizeAutoBuyString(char *autobuyString, const char *priorityString); - const char *PickPrimaryCareerTaskWeapon(void); - const char *PickSecondaryCareerTaskWeapon(void); - const char *PickFlashKillWeaponString(void); - const char *PickGrenadeKillWeaponString(void); + const char *PickPrimaryCareerTaskWeapon(); + const char *PickSecondaryCareerTaskWeapon(); + const char *PickFlashKillWeaponString(); + const char *PickGrenadeKillWeaponString(); bool ShouldExecuteAutoBuyCommand(AutoBuyInfoStruct *commandInfo, bool boughtPrimary, bool boughtSecondary); void PostAutoBuyCommandProcessing(AutoBuyInfoStruct *commandInfo, bool &boughtPrimary, bool &boughtSecondary); void ParseAutoBuyString(const char *string, bool &boughtPrimary, bool &boughtSecondary); AutoBuyInfoStruct *GetAutoBuyCommandInfo(const char *command); void InitRebuyData(const char *str); - void BuildRebuyStruct(void); - void Rebuy(void); - void RebuyPrimaryWeapon(void); - void RebuyPrimaryAmmo(void); - void RebuySecondaryWeapon(void); - void RebuySecondaryAmmo(void); - void RebuyHEGrenade(void); - void RebuyFlashbang(void); - void RebuySmokeGrenade(void); - void RebuyDefuser(void); - void RebuyNightVision(void); - void RebuyArmor(void); + void BuildRebuyStruct(); + void Rebuy(); + void RebuyPrimaryWeapon(); + void RebuyPrimaryAmmo(); + void RebuySecondaryWeapon(); + void RebuySecondaryAmmo(); + void RebuyHEGrenade(); + void RebuyFlashbang(); + void RebuySmokeGrenade(); + void RebuyDefuser(); + void RebuyNightVision(); + void RebuyArmor(); void UpdateLocation(bool forceUpdate = false); void SetObserverAutoDirector(bool val) { m_bObserverAutoDirector = val; } bool IsObservingPlayer(CBasePlayer *pPlayer); - bool CanSwitchObserverModes(void) const { return m_canSwitchObserverModes; } - NOXREF void Intense(void) + bool CanSwitchObserverModes() const { return m_canSwitchObserverModes; } + NOXREF void Intense() { //m_musicState = INTENSE; //m_intenseTimestamp = gpGlobals->time; @@ -898,25 +791,23 @@ public: float m_silentTimestamp; MusicState m_musicState; float m_flLastCommandTime[8]; - -};/* size: 2500, cachelines: 40, members: 190 */ +}; /* <14ed87> ../cstrike/dlls/player.cpp:3407 */ class CWShield: public CBaseEntity { public: - virtual void Spawn(void); + virtual void Spawn(); virtual void EXPORT Touch(CBaseEntity *pOther); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); void Touch_(CBaseEntity *pOther); #endif // HOOK_GAMEDLL public: - /* <14e77d> ../cstrike/dlls/player.cpp:3410 */ void SetCantBePickedUpByUser(CBaseEntity *pEntity, float time) { m_hEntToIgnoreTouchesFrom = pEntity; @@ -926,11 +817,7 @@ public: public: EHANDLE m_hEntToIgnoreTouchesFrom; float m_flTimeToIgnoreTouches; - -};/* size: 164, cachelines: 3, members: 3 */ - -extern char *m_szPoses[4]; -extern WeaponStruct g_weaponStruct[MAX_WEAPONS]; +}; extern int gEvilImpulse101; extern char g_szMapBriefingText[512]; @@ -940,9 +827,6 @@ extern CBaseEntity *g_pLastCTSpawn; extern CBaseEntity *g_pLastTerroristSpawn; extern BOOL gInitHUD; extern cvar_t *sv_aim; -extern int zombieSpawnCount; -extern struct ZombieSpawn zombieSpawn[256]; -extern CBaseEntity *g_pSelectedZombieSpawn; extern int giPrecacheGrunt; extern int gmsgWeapPickup; @@ -1026,18 +910,6 @@ extern int gmsgBrass; extern int gmsgFog; extern int gmsgShowTimer; -#ifdef HOOK_GAMEDLL - -// linked objects -C_DLLEXPORT void player(entvars_t *pev); -C_DLLEXPORT void weapon_shield(entvars_t *pev); -C_DLLEXPORT void info_intermission(entvars_t *pev); -C_DLLEXPORT void player_loadsaved(entvars_t *pev); -C_DLLEXPORT void player_weaponstrip(entvars_t *pev); -C_DLLEXPORT void monster_hevsuit_dead(entvars_t *pev); - -#endif // HOOK_GAMEDLL - void OLD_CheckBuyZone(CBasePlayer *player); void OLD_CheckBombTarget(CBasePlayer *player); void OLD_CheckRescueZone(CBasePlayer *player); @@ -1055,8 +927,8 @@ void EscapeZoneIcon_Clear(CBasePlayer *player); void VIP_SafetyZoneIcon_Set(CBasePlayer *player); void VIP_SafetyZoneIcon_Clear(CBasePlayer *player); -void LinkUserMessages(void); -void WriteSigonMessages(void); +void LinkUserMessages(); +void WriteSigonMessages(); void SendItemStatus(CBasePlayer *pPlayer); const char *GetCSModelName(int item_id); Vector VecVelocityForDamage(float flDamage); @@ -1067,7 +939,7 @@ void packPlayerItem(CBasePlayer *pPlayer, CBasePlayerItem *pItem, bool packAmmo) bool CanSeeUseable(CBasePlayer *me, CBaseEntity *entity); NOXREF void FixPlayerCrouchStuck(edict_t *pPlayer); BOOL IsSpawnPointValid(CBaseEntity *pPlayer, CBaseEntity *pSpot); -NOXREF void InitZombieSpawns(void); +NOXREF void InitZombieSpawns(); NOXREF CBaseEntity *FindZombieSpawn(CBaseEntity *player, bool forceSpawn); edict_t *EntSelectSpawnPoint(CBaseEntity *pPlayer); void SetScoreAttrib(CBasePlayer *dest, CBasePlayer *src); diff --git a/regamedll/dlls/revert_saved.h b/regamedll/dlls/revert_saved.h index fca0fc49..c06e41fc 100644 --- a/regamedll/dlls/revert_saved.h +++ b/regamedll/dlls/revert_saved.h @@ -51,50 +51,25 @@ public: #endif // HOOK_GAMEDLL public: - void EXPORT MessageThink(void); - void EXPORT LoadThink(void); + void EXPORT MessageThink(); + void EXPORT LoadThink(); public: - float Duration(void) - { - return pev->dmg_take; - } - float HoldTime(void) - { - return pev->dmg_save; - } - float MessageTime(void) - { - return m_messageTime; - } - float LoadTime(void) - { - return m_loadTime; - } - void SetDuration(float duration) - { - pev->dmg_take = duration; - } - void SetHoldTime(float hold) - { - pev->dmg_save = hold; - } - void SetMessageTime(float time) - { - m_messageTime = time; - } - void SetLoadTime(float time) - { - m_loadTime = time; - } + float Duration() const { return pev->dmg_take; } + float HoldTime() const { return pev->dmg_save; } + float MessageTime() const { return m_messageTime; } + float LoadTime() const { return m_loadTime; } + + void SetDuration(float duration) { pev->dmg_take = duration; } + void SetHoldTime(float hold) { pev->dmg_save = hold; } + void SetMessageTime(float time) { m_messageTime = time; } + void SetLoadTime(float time) { m_loadTime = time; } public: static TYPEDESCRIPTION IMPL(m_SaveData)[2]; -public: float m_messageTime; float m_loadTime; - -};/* size: 160, cachelines: 3, members: 4 */ +}; #endif // REVERT_SAVED_H diff --git a/regamedll/dlls/saverestore.h b/regamedll/dlls/saverestore.h index 6cebc2ba..5bdd53fb 100644 --- a/regamedll/dlls/saverestore.h +++ b/regamedll/dlls/saverestore.h @@ -36,24 +36,12 @@ #ifndef HOOK_GAMEDLL -#define IMPL IMPLEMENT_ARRAY -#define IMPLEMENT_ARRAY(var)\ +#define IMPL(var)\ var -#define IMPL_CLASS IMPLEMENT_ARRAY_CLASS -#define IMPLEMENT_ARRAY_CLASS(baseClass,var)\ +#define IMPL_CLASS(baseClass,var)\ baseClass::var -#else // HOOK_GAMEDLL - -#define IMPL IMPLEMENT_ARRAY -#define IMPLEMENT_ARRAY(var)\ - (*p##var) - -#define IMPL_CLASS IMPLEMENT_ARRAY_CLASS -#define IMPLEMENT_ARRAY_CLASS(baseClass,var)\ - (*baseClass::p##var) - #endif // HOOK_GAMEDLL #define IMPLEMENT_SAVERESTORE(derivedClass, baseClass)\ @@ -61,13 +49,13 @@ {\ if (!baseClass::Save(save))\ return 0;\ - return save.WriteFields(#derivedClass, this, IMPLEMENT_ARRAY(m_SaveData), ARRAYSIZE(IMPLEMENT_ARRAY(m_SaveData)));\ + return save.WriteFields(#derivedClass, this, IMPL(m_SaveData), ARRAYSIZE(IMPL(m_SaveData)));\ }\ int derivedClass::__MAKE_VHOOK(Restore)(CRestore &restore)\ {\ if (!baseClass::Restore(restore))\ return 0;\ - return restore.ReadFields(#derivedClass, this, IMPLEMENT_ARRAY(m_SaveData), ARRAYSIZE(IMPLEMENT_ARRAY(m_SaveData)));\ + return restore.ReadFields(#derivedClass, this, IMPL(m_SaveData), ARRAYSIZE(IMPL(m_SaveData)));\ } typedef enum @@ -86,7 +74,6 @@ typedef struct globalentity_s struct globalentity_s *pNext; } globalentity_t; -/* size: 104, cachelines: 2, members: 4 */ typedef struct { @@ -95,7 +82,6 @@ typedef struct char *pData; } HEADER; -/* size: 8, cachelines: 1, members: 3 */ class CBaseEntity; @@ -103,29 +89,24 @@ class CBaseEntity; class CSaveRestoreBuffer { public: - CSaveRestoreBuffer(void); + CSaveRestoreBuffer(); CSaveRestoreBuffer(SAVERESTOREDATA *pdata); - ~CSaveRestoreBuffer(void); + ~CSaveRestoreBuffer(); int EntityIndex(entvars_t *pevLookup); int EntityIndex(edict_t *pentLookup); int EntityIndex(EOFFSET eoLookup); int EntityIndex(CBaseEntity *pEntity); - int EntityFlags(int entityIndex, int flags = 0) - { - return EntityFlagsSet(entityIndex, flags); - } + int EntityFlags(int entityIndex, int flags = 0) { return EntityFlagsSet(entityIndex, flags); } int EntityFlagsSet(int entityIndex, int flags); edict_t *EntityFromIndex(int entityIndex); unsigned short TokenHash(const char *pszToken); protected: - SAVERESTOREDATA *m_pdata; void BufferRewind(int size); unsigned int HashString(const char *pszToken); - -};/* size: 4, cachelines: 1, members: 1 */ +}; /* <19e94e> ../cstrike/dlls/saverestore.h:50 */ class CSave: public CSaveRestoreBuffer @@ -158,8 +139,7 @@ public: void BufferString(char *pdata, int len); void BufferData(const char *pdata, int size); void BufferHeader(const char *pname, int size); - -};/* size: 4, cachelines: 1, members: 1 */ +}; /* <1d9f06> ../cstrike/dlls/saverestore.h:82 */ class CRestore: public CSaveRestoreBuffer @@ -173,66 +153,54 @@ public: int ReadEntVars(const char *pname, entvars_t *pev); int ReadFields(const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); int ReadField(void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount, int startField, int size, char *pName, void *pData); - int ReadInt(void); - short ReadShort(void); + int ReadInt(); + short ReadShort(); int ReadNamedInt(const char *pName); char *ReadNamedString(const char *pName); - int Empty(void) - { - return (m_pdata == NULL || ((m_pdata->pCurrentData - m_pdata->pBaseData) >= m_pdata->bufferSize)); - } - void SetGlobalMode(int global) - { - m_global = global; - } - void PrecacheMode(BOOL mode) - { - m_precache = mode; - } + + int Empty() const { return (m_pdata == NULL || ((m_pdata->pCurrentData - m_pdata->pBaseData) >= m_pdata->bufferSize)); } + void SetGlobalMode(int global) { m_global = global; } + void PrecacheMode(BOOL mode) { m_precache = mode; } private: - char *BufferPointer(void); + char *BufferPointer(); void BufferReadBytes(char *pOutput, int size); void BufferSkipBytes(int bytes); - int BufferSkipZString(void); + int BufferSkipZString(); int BufferCheckZString(const char *string); void BufferReadHeader(HEADER *pheader); private: int m_global; BOOL m_precache; - -};/* size: 12, cachelines: 1, members: 3 */ +}; /* <245f6> ../cstrike/dlls/saverestore.h:153 */ class CGlobalState { public: - CGlobalState(void); + CGlobalState(); - void Reset(void); - void ClearStates(void); + void Reset(); + void ClearStates(); void EntityAdd(string_t globalname, string_t mapName, GLOBALESTATE state); void EntitySetState(string_t globalname, GLOBALESTATE state); void EntityUpdate(string_t globalname, string_t mapname); const globalentity_t *EntityFromTable(string_t globalname); GLOBALESTATE EntityGetState(string_t globalname); - int EntityInTable(string_t globalname) - { - return (Find(globalname) != NULL) ? TRUE : FALSE; - } + + int EntityInTable(string_t globalname) { return (Find(globalname) != NULL) ? TRUE : FALSE; } int Save(CSave &save); int Restore(CRestore &restore); - void DumpGlobals(void); + void DumpGlobals(); - static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1]; + static TYPEDESCRIPTION IMPL(m_SaveData)[1]; private: globalentity_t *Find(string_t globalname); globalentity_t *m_pList; int m_listCount; - -};/* size: 8, cachelines: 1, members: 3 */ +}; #endif // SAVERESTORE_H diff --git a/regamedll/dlls/schedule.h b/regamedll/dlls/schedule.h index 217c293e..4dc735e5 100644 --- a/regamedll/dlls/schedule.h +++ b/regamedll/dlls/schedule.h @@ -240,7 +240,7 @@ typedef enum TASK_REMEMBER, TASK_FORGET, TASK_WAIT_FOR_MOVEMENT, // wait until MovementIsComplete() - LAST_COMMON_TASK, // LEAVE THIS AT THE BOTTOM!! (sjb) + LAST_COMMON_TASK, // LEAVE THIS AT THE BOTTOM (sjb) } SHARED_TASKS; @@ -286,7 +286,7 @@ struct Schedule_t }; // an array of waypoints makes up the monster's route. -// !!!LATER- this declaration doesn't belong in this file. +// LATER - this declaration doesn't belong in this file. struct WayPoint_t { Vector vecLocation; diff --git a/regamedll/dlls/scriptevent.h b/regamedll/dlls/scriptevent.h index 7e937e4b..5fb778c7 100644 --- a/regamedll/dlls/scriptevent.h +++ b/regamedll/dlls/scriptevent.h @@ -32,16 +32,16 @@ #pragma once #endif -#define SCRIPT_EVENT_DEAD 1000 // character is now dead -#define SCRIPT_EVENT_NOINTERRUPT 1001 // does not allow interrupt -#define SCRIPT_EVENT_CANINTERRUPT 1002 // will allow interrupt -#define SCRIPT_EVENT_FIREEVENT 1003 // event now fires -#define SCRIPT_EVENT_SOUND 1004 // Play named wave file (on CHAN_BODY) -#define SCRIPT_EVENT_SENTENCE 1005 // Play named sentence -#define SCRIPT_EVENT_INAIR 1006 // Leave the character in air at the end of the sequence (don't find the floor) -#define SCRIPT_EVENT_ENDANIMATION 1007 // Set the animation by name after the sequence completes -#define SCRIPT_EVENT_SOUND_VOICE 1008 // Play named wave file (on CHAN_VOICE) -#define SCRIPT_EVENT_SENTENCE_RND1 1009 // Play sentence group 25% of the time -#define SCRIPT_EVENT_NOT_DEAD 1010 // Bring back to life (for life/death sequences) +#define SCRIPT_EVENT_DEAD 1000 // character is now dead +#define SCRIPT_EVENT_NOINTERRUPT 1001 // does not allow interrupt +#define SCRIPT_EVENT_CANINTERRUPT 1002 // will allow interrupt +#define SCRIPT_EVENT_FIREEVENT 1003 // event now fires +#define SCRIPT_EVENT_SOUND 1004 // Play named wave file (on CHAN_BODY) +#define SCRIPT_EVENT_SENTENCE 1005 // Play named sentence +#define SCRIPT_EVENT_INAIR 1006 // Leave the character in air at the end of the sequence (don't find the floor) +#define SCRIPT_EVENT_ENDANIMATION 1007 // Set the animation by name after the sequence completes +#define SCRIPT_EVENT_SOUND_VOICE 1008 // Play named wave file (on CHAN_VOICE) +#define SCRIPT_EVENT_SENTENCE_RND1 1009 // Play sentence group 25% of the time +#define SCRIPT_EVENT_NOT_DEAD 1010 // Bring back to life (for life/death sequences) #endif // SCRIPTEVENT_H diff --git a/regamedll/dlls/singleplay_gamerules.cpp b/regamedll/dlls/singleplay_gamerules.cpp index 2e88bfe2..5ddba2dc 100644 --- a/regamedll/dlls/singleplay_gamerules.cpp +++ b/regamedll/dlls/singleplay_gamerules.cpp @@ -1,32 +1,32 @@ #include "precompiled.h" /* <1676c5> ../cstrike/dlls/singleplay_gamerules.cpp:32 */ -CHalfLifeRules::CHalfLifeRules(void) +CHalfLifeRules::CHalfLifeRules() { m_bFreezePeriod = FALSE; RefreshSkillData(); } /* <166d5d> ../cstrike/dlls/singleplay_gamerules.cpp:40 */ -void CHalfLifeRules::__MAKE_VHOOK(Think)(void) +void CHalfLifeRules::__MAKE_VHOOK(Think)() { ; } /* <166d83> ../cstrike/dlls/singleplay_gamerules.cpp:46 */ -BOOL CHalfLifeRules::__MAKE_VHOOK(IsMultiplayer)(void) +BOOL CHalfLifeRules::__MAKE_VHOOK(IsMultiplayer)() { return FALSE; } /* <166da9> ../cstrike/dlls/singleplay_gamerules.cpp:53 */ -BOOL CHalfLifeRules::__MAKE_VHOOK(IsDeathmatch)(void) +BOOL CHalfLifeRules::__MAKE_VHOOK(IsDeathmatch)() { return FALSE; } /* <166dcf> ../cstrike/dlls/singleplay_gamerules.cpp:60 */ -BOOL CHalfLifeRules::__MAKE_VHOOK(IsCoOp)(void) +BOOL CHalfLifeRules::__MAKE_VHOOK(IsCoOp)() { return FALSE; } @@ -96,7 +96,7 @@ void CHalfLifeRules::__MAKE_VHOOK(PlayerSpawn)(CBasePlayer *pPlayer) } /* <166f73> ../cstrike/dlls/singleplay_gamerules.cpp:135 */ -BOOL CHalfLifeRules::__MAKE_VHOOK(AllowAutoTargetCrosshair)(void) +BOOL CHalfLifeRules::__MAKE_VHOOK(AllowAutoTargetCrosshair)() { return (g_iSkillLevel == SKILL_EASY); } @@ -178,7 +178,7 @@ edict_t *CHalfLifeRules::__MAKE_VHOOK(GetPlayerSpawnSpot)(CBasePlayer *pPlayer) pPlayer->pev->angles = pSpot->pev->angles; pPlayer->pev->punchangle = g_vecZero; pPlayer->pev->fixangle = 1; - + return pSpot->edict(); } @@ -249,7 +249,7 @@ Vector CHalfLifeRules::__MAKE_VHOOK(VecAmmoRespawnSpot)(CBasePlayerAmmo *pAmmo) } /* <1674ec> ../cstrike/dlls/singleplay_gamerules.cpp:322 */ -float CHalfLifeRules::__MAKE_VHOOK(FlHealthChargerRechargeTime)(void) +float CHalfLifeRules::__MAKE_VHOOK(FlHealthChargerRechargeTime)() { return 0; } @@ -269,211 +269,12 @@ int CHalfLifeRules::__MAKE_VHOOK(DeadPlayerAmmo)(CBasePlayer *pPlayer) /* <16757c> ../cstrike/dlls/singleplay_gamerules.cpp:343 */ int CHalfLifeRules::__MAKE_VHOOK(PlayerRelationship)(CBasePlayer *pPlayer, CBaseEntity *pTarget) { - // why would a single player in half life need this? + // why would a single player in half life need this? return GR_NOTTEAMMATE; } /* <1675c0> ../cstrike/dlls/singleplay_gamerules.cpp:351 */ -BOOL CHalfLifeRules::__MAKE_VHOOK(FAllowMonsters)(void) +BOOL CHalfLifeRules::__MAKE_VHOOK(FAllowMonsters)() { return TRUE; } - -#ifdef HOOK_GAMEDLL - -void CHalfLifeRules::Think(void) -{ - Think_(); -} - -BOOL CHalfLifeRules::IsAllowedToSpawn(CBaseEntity *pEntity) -{ - return IsAllowedToSpawn_(pEntity); -} - -BOOL CHalfLifeRules::FShouldSwitchWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon) -{ - return FShouldSwitchWeapon_(pPlayer, pWeapon); -} - -BOOL CHalfLifeRules::GetNextBestWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeapon) -{ - return GetNextBestWeapon_(pPlayer, pCurrentWeapon); -} - -BOOL CHalfLifeRules::IsMultiplayer(void) -{ - return IsMultiplayer_(); -} - -BOOL CHalfLifeRules::IsDeathmatch(void) -{ - return IsDeathmatch_(); -} - -BOOL CHalfLifeRules::IsCoOp(void) -{ - return IsCoOp_(); -} - -BOOL CHalfLifeRules::ClientConnected(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[128]) -{ - return ClientConnected_(pEntity, pszName, pszAddress, szRejectReason); -} - -void CHalfLifeRules::InitHUD(CBasePlayer *pl) -{ - InitHUD_(pl); -} - -void CHalfLifeRules::ClientDisconnected(edict_t *pClient) -{ - ClientDisconnected_(pClient); -} - -float CHalfLifeRules::FlPlayerFallDamage(CBasePlayer *pPlayer) -{ - return FlPlayerFallDamage_(pPlayer); -} - -void CHalfLifeRules::PlayerSpawn(CBasePlayer *pPlayer) -{ - PlayerSpawn_(pPlayer); -} - -void CHalfLifeRules::PlayerThink(CBasePlayer *pPlayer) -{ - PlayerThink_(pPlayer); -} - -BOOL CHalfLifeRules::FPlayerCanRespawn(CBasePlayer *pPlayer) -{ - return FPlayerCanRespawn_(pPlayer); -} - -float CHalfLifeRules::FlPlayerSpawnTime(CBasePlayer *pPlayer) -{ - return FlPlayerSpawnTime_(pPlayer); -} - -edict_t *CHalfLifeRules::GetPlayerSpawnSpot(CBasePlayer *pPlayer) -{ - return GetPlayerSpawnSpot_(pPlayer); -} - -BOOL CHalfLifeRules::AllowAutoTargetCrosshair(void) -{ - return AllowAutoTargetCrosshair_(); -} - -int CHalfLifeRules::IPointsForKill(CBasePlayer *pAttacker, CBasePlayer *pKilled) -{ - return IPointsForKill_(pAttacker, pKilled); -} - -void CHalfLifeRules::PlayerKilled(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor) -{ - PlayerKilled_(pVictim, pKiller, pInflictor); -} - -void CHalfLifeRules::DeathNotice(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor) -{ - DeathNotice_(pVictim, pKiller, pInflictor); -} - -void CHalfLifeRules::PlayerGotWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon) -{ - PlayerGotWeapon_(pPlayer, pWeapon); -} - -int CHalfLifeRules::WeaponShouldRespawn(CBasePlayerItem *pWeapon) -{ - return WeaponShouldRespawn_(pWeapon); -} - -float CHalfLifeRules::FlWeaponRespawnTime(CBasePlayerItem *pWeapon) -{ - return FlWeaponRespawnTime_(pWeapon); -} - -float CHalfLifeRules::FlWeaponTryRespawn(CBasePlayerItem *pWeapon) -{ - return FlWeaponTryRespawn_(pWeapon); -} - -Vector CHalfLifeRules::VecWeaponRespawnSpot(CBasePlayerItem *pWeapon) -{ - return VecWeaponRespawnSpot_(pWeapon); -} - -BOOL CHalfLifeRules::CanHaveItem(CBasePlayer *pPlayer, CItem *pItem) -{ - return CanHaveItem_(pPlayer, pItem); -} - -void CHalfLifeRules::PlayerGotItem(CBasePlayer *pPlayer, CItem *pItem) -{ - PlayerGotItem_(pPlayer, pItem); -} - -int CHalfLifeRules::ItemShouldRespawn(CItem *pItem) -{ - return ItemShouldRespawn_(pItem); -} - -float CHalfLifeRules::FlItemRespawnTime(CItem *pItem) -{ - return FlItemRespawnTime_(pItem); -} - -Vector CHalfLifeRules::VecItemRespawnSpot(CItem *pItem) -{ - return VecItemRespawnSpot_(pItem); -} - -void CHalfLifeRules::PlayerGotAmmo(CBasePlayer *pPlayer, char *szName, int iCount) -{ - PlayerGotAmmo_(pPlayer, szName, iCount); -} - -int CHalfLifeRules::AmmoShouldRespawn(CBasePlayerAmmo *pAmmo) -{ - return AmmoShouldRespawn_(pAmmo); -} - -float CHalfLifeRules::FlAmmoRespawnTime(CBasePlayerAmmo *pAmmo) -{ - return FlAmmoRespawnTime_(pAmmo); -} - -Vector CHalfLifeRules::VecAmmoRespawnSpot(CBasePlayerAmmo *pAmmo) -{ - return VecAmmoRespawnSpot_(pAmmo); -} - -float CHalfLifeRules::FlHealthChargerRechargeTime(void) -{ - return FlHealthChargerRechargeTime_(); -} - -int CHalfLifeRules::DeadPlayerWeapons(CBasePlayer *pPlayer) -{ - return DeadPlayerWeapons_(pPlayer); -} - -int CHalfLifeRules::DeadPlayerAmmo(CBasePlayer *pPlayer) -{ - return DeadPlayerAmmo_(pPlayer); -} - -int CHalfLifeRules::PlayerRelationship(CBasePlayer *pPlayer, CBaseEntity *pTarget) -{ - return PlayerRelationship_(pPlayer, pTarget); -} - -BOOL CHalfLifeRules::FAllowMonsters(void) -{ - return FAllowMonsters_(); -} - -#endif // HOOK_GAMEDLL \ No newline at end of file diff --git a/regamedll/dlls/skill.h b/regamedll/dlls/skill.h index 25a44385..feab2056 100644 --- a/regamedll/dlls/skill.h +++ b/regamedll/dlls/skill.h @@ -53,14 +53,7 @@ struct skilldata_t float batteryCapacity; float healthchargerCapacity; float healthkitCapacity; - -};/* size: 60, cachelines: 1, members: 15 */ - -#ifdef HOOK_GAMEDLL - -#define gSkillData (*pgSkillData) - -#endif // HOOK_GAMEDLL +}; extern skilldata_t gSkillData; diff --git a/regamedll/dlls/sound.cpp b/regamedll/dlls/sound.cpp index 804714fe..330f04a4 100644 --- a/regamedll/dlls/sound.cpp +++ b/regamedll/dlls/sound.cpp @@ -63,16 +63,6 @@ TYPEDESCRIPTION CSpeaker::m_SaveData[] = DEFINE_FIELD(CSpeaker, m_preset, FIELD_INTEGER), }; -#else - -dynpitchvol_t rgdpvpreset[CDPVPRESETMAX]; -int fSentencesInit; -int gcallsentences; - -TYPEDESCRIPTION IMPL_CLASS(CAmbientGeneric, m_SaveData)[4]; -TYPEDESCRIPTION IMPL_CLASS(CEnvSound, m_SaveData)[2]; -TYPEDESCRIPTION IMPL_CLASS(CSpeaker, m_SaveData)[1]; - #endif // HOOK_GAMEDLL // time delay until it's ok to speak: used so that two NPCs don't talk at once @@ -99,7 +89,7 @@ IMPLEMENT_SAVERESTORE(CAmbientGeneric, CBaseEntity); // 80 : "Large Radius" /* <1718ea> ../cstrike/dlls/sound.cpp:160 */ -void CAmbientGeneric::__MAKE_VHOOK(Spawn)(void) +void CAmbientGeneric::__MAKE_VHOOK(Spawn)() { if (pev->spawnflags & AMBIENT_SOUND_EVERYWHERE) { @@ -157,7 +147,7 @@ void CAmbientGeneric::__MAKE_VHOOK(Spawn)(void) } /* <1724f8> ../cstrike/dlls/sound.cpp:223 */ -void CAmbientGeneric::__MAKE_VHOOK(Restart)(void) +void CAmbientGeneric::__MAKE_VHOOK(Restart)() { if (pev->spawnflags & AMBIENT_SOUND_EVERYWHERE) { @@ -207,7 +197,7 @@ void CAmbientGeneric::__MAKE_VHOOK(Restart)(void) UTIL_EmitAmbientSound(ENT(pev), pev->origin, szSoundFile, 0, 0, SND_STOP, 0); InitModulationParms(); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; if (!(pev->spawnflags & AMBIENT_SOUND_NOT_LOOPING)) { @@ -219,12 +209,12 @@ void CAmbientGeneric::__MAKE_VHOOK(Restart)(void) if (m_fActive) { - UTIL_EmitAmbientSound(ENT(pev), pev->origin, szSoundFile, (m_dpv.vol * 0.01), m_flAttenuation, 0, m_dpv.pitch); + UTIL_EmitAmbientSound(ENT(pev), pev->origin, szSoundFile, (m_dpv.vol * 0.01f), m_flAttenuation, 0, m_dpv.pitch); } } /* <1724bb> ../cstrike/dlls/sound.cpp:296 */ -void CAmbientGeneric::__MAKE_VHOOK(Precache)(void) +void CAmbientGeneric::__MAKE_VHOOK(Precache)() { char *szSoundFile = (char *)STRING(pev->message); @@ -261,7 +251,7 @@ void CAmbientGeneric::__MAKE_VHOOK(Precache)(void) // with lfo if active. /* <171973> ../cstrike/dlls/sound.cpp:328 */ -void CAmbientGeneric::RampThink(void) +void CAmbientGeneric::RampThink() { char *szSoundFile = (char *)STRING(pev->message); int pitch = m_dpv.pitch; @@ -467,7 +457,7 @@ void CAmbientGeneric::RampThink(void) } // update ramps at 5hz - pev->nextthink = gpGlobals->time + 0.2; + pev->nextthink = gpGlobals->time + 0.2f; return; } @@ -475,7 +465,7 @@ void CAmbientGeneric::RampThink(void) // play a new sound /* <1723db> ../cstrike/dlls/sound.cpp:521 */ -void CAmbientGeneric::InitModulationParms(void) +void CAmbientGeneric::InitModulationParms() { int pitchinc; @@ -594,11 +584,11 @@ void CAmbientGeneric::ToggleUse(CBaseEntity *pActivator, CBaseEntity *pCaller, U { fraction = value; - if (fraction > 1.0) - fraction = 1.0; + if (fraction > 1.0f) + fraction = 1.0f; - if (fraction < 0.0) - fraction = 0.01; + if (fraction < 0.0f) + fraction = 0.01f; m_dpv.pitch = fraction * 255; UTIL_EmitAmbientSound(ENT(pev), pev->origin, szSoundFile, 0, 0, SND_CHANGE_PITCH, m_dpv.pitch); @@ -630,7 +620,7 @@ void CAmbientGeneric::ToggleUse(CBaseEntity *pActivator, CBaseEntity *pCaller, U { m_dpv.pitchrun = 255; } - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } } else @@ -647,7 +637,7 @@ void CAmbientGeneric::ToggleUse(CBaseEntity *pActivator, CBaseEntity *pCaller, U m_dpv.fadeout = m_dpv.fadeoutsav; m_dpv.fadein = 0; - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } else UTIL_EmitAmbientSound(ENT(pev), pev->origin, szSoundFile, 0, 0, SND_STOP, 0); @@ -942,7 +932,7 @@ BOOL FEnvSoundInRange(entvars_t *pev, entvars_t *pevTarget, float *pflRange) // CONSIDER: if player in water state, autoset roomtype to 14,15 or 16. /* <17428e> ../cstrike/dlls/sound.cpp:960 */ -void CEnvSound::__MAKE_VHOOK(Think)(void) +void CEnvSound::__MAKE_VHOOK(Think)() { // get pointer to client if visible; FIND_CLIENT_IN_PVS will // cycle through visible clients on consecutive calls. @@ -1026,11 +1016,11 @@ void CEnvSound::__MAKE_VHOOK(Think)(void) // not in range. do nothing, fall through to think_fast... env_sound_Think_fast: - pev->nextthink = gpGlobals->time + 0.25; + pev->nextthink = gpGlobals->time + 0.25f; return; env_sound_Think_slow: - pev->nextthink = gpGlobals->time + 0.75; + pev->nextthink = gpGlobals->time + 0.75f; return; } @@ -1038,7 +1028,7 @@ env_sound_Think_slow: // when player moves in range and sight. /* <171926> ../cstrike/dlls/sound.cpp:1053 */ -void CEnvSound::__MAKE_VHOOK(Spawn)(void) +void CEnvSound::__MAKE_VHOOK(Spawn)() { // spread think times pev->nextthink = gpGlobals->time + RANDOM_FLOAT(0.0, 0.5); @@ -1214,7 +1204,7 @@ int SENTENCEG_PlayRndI(edict_t *entity, int isentenceg, float volume, float atte if (!fSentencesInit) return -1; - name[0] = 0; + name[0] = '\0'; ipick = USENTENCEG_Pick(isentenceg, name); if (ipick > 0 && name) @@ -1309,7 +1299,7 @@ NOXREF void SENTENCEG_Stop(edict_t *entity, int isentenceg, int ipick) // first call and is ignored subsequently. /* <1734e4> ../cstrike/dlls/sound.cpp:1334 */ -void SENTENCEG_Init(void) +void SENTENCEG_Init() { char buffer[512]; char szgroup[64]; @@ -1487,7 +1477,7 @@ void EMIT_SOUND_SUIT(edict_t *entity, const char *sample) if (RANDOM_LONG(0, 1)) pitch = RANDOM_LONG(0, 6) + 98; - if (fvol > 0.05) + if (fvol > 0.05f) EMIT_SOUND_DYN(entity, CHAN_STATIC, sample, fvol, ATTN_NORM, 0, pitch); } @@ -1503,7 +1493,7 @@ void EMIT_GROUPID_SUIT(edict_t *entity, int isentenceg) if (RANDOM_LONG(0, 1)) pitch = RANDOM_LONG(0, 6) + 98; - if (fvol > 0.05) + if (fvol > 0.05f) { SENTENCEG_PlayRndI(entity, isentenceg, fvol, ATTN_NORM, 0, pitch); } @@ -1522,7 +1512,7 @@ NOXREF void EMIT_GROUPNAME_SUIT(edict_t *entity, const char *groupname) if (RANDOM_LONG(0, 1)) pitch = RANDOM_LONG(0, 6) + 98; - if (fvol > 0.05) + if (fvol > 0.05f) { SENTENCEG_PlayRndSz(entity, groupname, fvol, ATTN_NORM, 0, pitch); } @@ -1577,7 +1567,7 @@ char *memfgets(byte *pMemFile, int fileSize, int &filePos, char *pBuffer, int bu } /* <173cc2> ../cstrike/dlls/sound.cpp:1610 */ -void TEXTURETYPE_Init(void) +void TEXTURETYPE_Init() { char buffer[512]; int i, j; @@ -1721,7 +1711,7 @@ float TEXTURETYPE_PlaySound(TraceResult *ptr, Vector vecSrc, Vector vecEnd, int // '}}' Q_strcpy(szbuffer, pTextureName); - szbuffer[CBTEXTURENAMEMAX - 1] = 0; + szbuffer[CBTEXTURENAMEMAX - 1] = '\0'; // get texture type chTextureType = TEXTURETYPE_Find(szbuffer); @@ -1845,7 +1835,7 @@ float TEXTURETYPE_PlaySound(TraceResult *ptr, Vector vecSrc, Vector vecEnd, int else if (chTextureType == CHAR_TEX_COMPUTER) { // play random spark if computer - if (ptr->flFraction != 1.0 && RANDOM_LONG(0, 1)) + if (ptr->flFraction != 1.0f && RANDOM_LONG(0, 1)) { UTIL_Sparks(ptr->vecEndPos); @@ -1879,14 +1869,14 @@ IMPLEMENT_SAVERESTORE(CSpeaker, CBaseEntity); // ambient_generic - general-purpose user-defined static sound /* <171c6b> ../cstrike/dlls/sound.cpp:1896 */ -void CSpeaker::__MAKE_VHOOK(Spawn)(void) +void CSpeaker::__MAKE_VHOOK(Spawn)() { char *szSoundFile = (char *)STRING(pev->message); if (!m_preset && (FStringNull(pev->message) || Q_strlen(szSoundFile) < 1)) { ALERT(at_error, "SPEAKER with no Level/Sentence! at: %f, %f, %f\n", pev->origin.x, pev->origin.y, pev->origin.z); - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; SetThink(&CSpeaker::SUB_Remove); return; } @@ -1895,7 +1885,7 @@ void CSpeaker::__MAKE_VHOOK(Spawn)(void) pev->movetype = MOVETYPE_NONE; SetThink(&CSpeaker::SpeakerThink); - pev->nextthink = 0.0; + pev->nextthink = 0.0f; // allow on/off switching via 'use' function. SetUse(&CSpeaker::ToggleUse); @@ -1904,7 +1894,7 @@ void CSpeaker::__MAKE_VHOOK(Spawn)(void) } /* <171a16> ../cstrike/dlls/sound.cpp:1924 */ -void CSpeaker::__MAKE_VHOOK(Precache)(void) +void CSpeaker::__MAKE_VHOOK(Precache)() { if (!(pev->spawnflags & SPEAKER_START_SILENT)) { @@ -1914,11 +1904,11 @@ void CSpeaker::__MAKE_VHOOK(Precache)(void) } /* <172b7a> ../cstrike/dlls/sound.cpp:1930 */ -void CSpeaker::SpeakerThink(void) +void CSpeaker::SpeakerThink() { char *szSoundFile = NULL; - float flvolume = pev->health * 0.1; - float flattenuation = 0.3; + float flvolume = pev->health * 0.1f; + float flattenuation = 0.3f; int flags = 0; int pitch = 100; @@ -1965,7 +1955,7 @@ void CSpeaker::SpeakerThink(void) UTIL_EmitAmbientSound(ENT(pev), pev->origin, szSoundFile, flvolume, flattenuation, flags, pitch); // shut off and reset - pev->nextthink = 0.0; + pev->nextthink = 0.0f; } else { @@ -1977,10 +1967,10 @@ void CSpeaker::SpeakerThink(void) } // set next announcement time for random 5 to 10 minute delay - pev->nextthink = gpGlobals->time + RANDOM_FLOAT(ANNOUNCE_MINUTES_MIN * 60.0, ANNOUNCE_MINUTES_MAX * 60.0); + pev->nextthink = gpGlobals->time + RANDOM_FLOAT(ANNOUNCE_MINUTES_MIN * 60.0f, ANNOUNCE_MINUTES_MAX * 60.0f); // time delay until it's ok to speak: used so that two NPCs don't talk at once - CTalkMonster::g_talkWaitTime = gpGlobals->time + 5; + CTalkMonster::g_talkWaitTime = gpGlobals->time + 5.0f; } return; @@ -1991,7 +1981,7 @@ void CSpeaker::SpeakerThink(void) /* <171a4e> ../cstrike/dlls/sound.cpp:1997 */ void CSpeaker::ToggleUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { - int fActive = (pev->nextthink > 0.0); + int fActive = (pev->nextthink > 0.0f); // fActive is TRUE only if an announcement is pending if (useType != USE_TOGGLE) @@ -2007,7 +1997,7 @@ void CSpeaker::ToggleUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE if (useType == USE_ON) { // turn on announcements - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; return; } @@ -2028,7 +2018,7 @@ void CSpeaker::ToggleUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE else { // turn on announcements - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } } @@ -2047,87 +2037,3 @@ void CSpeaker::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) else CBaseEntity::KeyValue(pkvd); } - -#ifdef HOOK_GAMEDLL - -void CAmbientGeneric::Spawn(void) -{ - Spawn_(); -} - -void CAmbientGeneric::Precache(void) -{ - Precache_(); -} - -void CAmbientGeneric::Restart(void) -{ - Restart_(); -} - -void CAmbientGeneric::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -int CAmbientGeneric::Save(CSave &save) -{ - Save_(save); -} - -int CAmbientGeneric::Restore(CRestore &restore) -{ - Restore_(restore); -} - -void CEnvSound::Spawn(void) -{ - Spawn_(); -} - -void CEnvSound::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -int CEnvSound::Save(CSave &save) -{ - return Save_(save); -} - -int CEnvSound::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -void CEnvSound::Think(void) -{ - Think_(); -} - -void CSpeaker::Spawn(void) -{ - Spawn_(); -} - -void CSpeaker::Precache(void) -{ - Precache_(); -} - -void CSpeaker::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -int CSpeaker::Save(CSave &save) -{ - return Save_(save); -} - -int CSpeaker::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/sound.h b/regamedll/dlls/sound.h index e8e0a581..a38737bf 100644 --- a/regamedll/dlls/sound.h +++ b/regamedll/dlls/sound.h @@ -55,14 +55,12 @@ #define LFO_RANDOM 3 // random // group of related sentences -typedef struct +struct sentenceg { char szgroupname[16]; int count; unsigned char rgblru[ CSENTENCE_LRU_MAX ]; - -} sentenceg; -/* size: 52, cachelines: 1, members: 3 */ +}; // runtime pitch shift and volume fadein/out structure @@ -106,28 +104,24 @@ typedef struct dynpitchvol int lfomult; } dynpitchvol_t; -/* size: 100, cachelines: 2, members: 25 */ /* <170b59> ../cstrike/dlls/sound.cpp:117 */ class CAmbientGeneric: public CBaseEntity { 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) - { - return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); - } + virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); } #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); @@ -136,8 +130,8 @@ public: public: void EXPORT ToggleUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); - void EXPORT RampThink(void); - void InitModulationParms(void); + void EXPORT RampThink(); + void InitModulationParms(); public: static TYPEDESCRIPTION IMPL(m_SaveData)[4]; @@ -146,26 +140,25 @@ public: dynpitchvol_t m_dpv; BOOL m_fActive; // only TRUE when the entity is playing a looping sound BOOL m_fLooping; // TRUE when the sound played will loop - -};/* size: 264, cachelines: 5, members: 6 */ +}; /* <170bc2> ../cstrike/dlls/sound.cpp:875 */ class CEnvSound: 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); - virtual void Think(void); + virtual void Think(); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); void KeyValue_(KeyValueData *pkvd); int Save_(CSave &save); int Restore_(CRestore &restore); - void Think_(void); + void Think_(); #endif // HOOK_GAMEDLL @@ -174,27 +167,23 @@ public: float m_flRadius; float m_flRoomtype; - -};/* size: 160, cachelines: 3, members: 4 */ +}; /* <170ced> ../cstrike/dlls/sound.cpp:1867 */ class CSpeaker: 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); } #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); @@ -203,13 +192,12 @@ public: public: void EXPORT ToggleUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); - void EXPORT SpeakerThink(void); + void EXPORT SpeakerThink(); public: static TYPEDESCRIPTION IMPL(m_SaveData)[1]; int m_preset; // preset number - -};/* size: 156, cachelines: 3, members: 3 */ +}; BOOL FEnvSoundInRange(entvars_t *pev, entvars_t *pevTarget, float *pflRange); void USENTENCEG_InitLRU(unsigned char *plru, int count); @@ -220,40 +208,18 @@ int SENTENCEG_PlayRndI(edict_t *entity, int isentenceg, float volume, float atte int SENTENCEG_PlayRndSz(edict_t *entity, const char *szgroupname, float volume, float attenuation, int flags, int pitch); int SENTENCEG_PlaySequentialSz(edict_t *entity, const char *szgroupname, float volume, float attenuation, int flags, int pitch, int ipick, int freset); NOXREF void SENTENCEG_Stop(edict_t *entity, int isentenceg, int ipick); -void SENTENCEG_Init(void); +void SENTENCEG_Init(); int SENTENCEG_Lookup(const char *sample, char *sentencenum); void EMIT_SOUND_DYN(edict_t *entity, int channel, const char *sample, float volume, float attenuation, int flags, int pitch); void EMIT_SOUND_SUIT(edict_t *entity, const char *sample); void EMIT_GROUPID_SUIT(edict_t *entity, int isentenceg); NOXREF void EMIT_GROUPNAME_SUIT(edict_t *entity, const char *groupname); char *memfgets(byte *pMemFile, int fileSize, int &filePos, char *pBuffer, int bufferSize); -void TEXTURETYPE_Init(void); +void TEXTURETYPE_Init(); char TEXTURETYPE_Find(char *name); float TEXTURETYPE_PlaySound(TraceResult *ptr, Vector vecSrc, Vector vecEnd, int iBulletType); -#ifdef HOOK_GAMEDLL - -#define gszallsentencenames (*pgszallsentencenames) -#define rgsentenceg (*prgsentenceg) -#define fSentencesInit (*pfSentencesInit) -#define gcallsentences (*pgcallsentences) -#define rgdpvpreset (*prgdpvpreset) - -#endif // HOOK_GAMEDLL - extern char gszallsentencenames[ CVOXFILESENTENCEMAX ][ CBSENTENCENAME_MAX ]; -extern sentenceg rgsentenceg[ CSENTENCEG_MAX ]; -extern int fSentencesInit; -extern int gcallsentences; -extern dynpitchvol_t rgdpvpreset[CDPVPRESETMAX]; - -#ifdef HOOK_GAMEDLL - -// linked objects -C_DLLEXPORT void ambient_generic(entvars_t *pev); -C_DLLEXPORT void env_sound(entvars_t *pev); -C_DLLEXPORT void speaker(entvars_t *pev); - -#endif // HOOK_GAMEDLL +extern int gcTextures; #endif // SOUND_H diff --git a/regamedll/dlls/soundent.cpp b/regamedll/dlls/soundent.cpp index 2a4e8e81..f93db423 100644 --- a/regamedll/dlls/soundent.cpp +++ b/regamedll/dlls/soundent.cpp @@ -8,7 +8,7 @@ LINK_ENTITY_TO_CLASS(soundent, CSoundEnt); // CSound - Clear - zeros all fields for a sound /* <178d6e> ../cstrike/dlls/soundent.cpp:29 */ -void CSound::Clear(void) +void CSound::Clear() { m_vecOrigin = g_vecZero; m_iType = 0; @@ -22,7 +22,7 @@ void CSound::Clear(void) // but doesn't expire or unlink it. /* <178d8f> ../cstrike/dlls/soundent.cpp:43 */ -void CSound::Reset(void) +void CSound::Reset() { m_vecOrigin = g_vecZero; m_iNext = SOUNDLIST_EMPTY; @@ -33,7 +33,7 @@ void CSound::Reset(void) // FIsSound - returns TRUE if the sound is an Audible sound /* <178db7> ../cstrike/dlls/soundent.cpp:54 */ -NOXREF BOOL CSound::FIsSound(void) +NOXREF BOOL CSound::FIsSound() { if (m_iType & (bits_SOUND_COMBAT | bits_SOUND_WORLD | bits_SOUND_PLAYER | bits_SOUND_DANGER)) { @@ -46,7 +46,7 @@ NOXREF BOOL CSound::FIsSound(void) // FIsScent - returns TRUE if the sound is actually a scent /* <178ddf> ../cstrike/dlls/soundent.cpp:67 */ -NOXREF BOOL CSound::FIsScent(void) +NOXREF BOOL CSound::FIsScent() { if (m_iType & (bits_SOUND_CARCASS | bits_SOUND_MEAT | bits_SOUND_GARBAGE)) { @@ -57,7 +57,7 @@ NOXREF BOOL CSound::FIsScent(void) } /* <17900a> ../cstrike/dlls/soundent.cpp:80 */ -void CSoundEnt::__MAKE_VHOOK(Spawn)(void) +void CSoundEnt::__MAKE_VHOOK(Spawn)() { pev->solid = SOLID_NOT; Initialize(); @@ -70,7 +70,7 @@ void CSoundEnt::__MAKE_VHOOK(Spawn)(void) // to the current world time, and these sounds are deallocated. /* <178b0c> ../cstrike/dlls/soundent.cpp:93 */ -void CSoundEnt::__MAKE_VHOOK(Think)(void) +void CSoundEnt::__MAKE_VHOOK(Think)() { int iSound; int iPreviousSound; @@ -109,14 +109,14 @@ void CSoundEnt::__MAKE_VHOOK(Think)(void) // Precache - dummy function /* <178a76> ../cstrike/dlls/soundent.cpp:132 */ -void CSoundEnt::__MAKE_VHOOK(Precache)(void) +void CSoundEnt::__MAKE_VHOOK(Precache)() { ; } // FreeSound - clears the passed active sound and moves it // to the top of the free list. TAKE CARE to only call this -// function for sounds in the Active list!! +// function for sounds in the Active list /* <178e07> ../cstrike/dlls/soundent.cpp:141 */ void CSoundEnt::FreeSound(int iSound, int iPrevious) @@ -149,7 +149,7 @@ void CSoundEnt::FreeSound(int iSound, int iPrevious) // Active list returns the index of the alloc'd sound /* <178e2d> ../cstrike/dlls/soundent.cpp:171 */ -int CSoundEnt::IAllocSound(void) +int CSoundEnt::IAllocSound() { int iNewSound; @@ -210,7 +210,7 @@ void CSoundEnt::InsertSound(int iType, const Vector &vecOrigin, int iVolume, flo // free sound list. /* <178f4e> ../cstrike/dlls/soundent.cpp:228 */ -void CSoundEnt::Initialize(void) +void CSoundEnt::Initialize() { int i; int iSound; @@ -294,7 +294,7 @@ int CSoundEnt::ISoundsInList(int iListType) // ActiveList - returns the head of the active sound list /* <179073> ../cstrike/dlls/soundent.cpp:312 */ -NOXREF int CSoundEnt::ActiveList(void) +NOXREF int CSoundEnt::ActiveList() { if (!pSoundEnt) { @@ -307,7 +307,7 @@ NOXREF int CSoundEnt::ActiveList(void) // FreeList - returns the head of the free sound list /* <179083> ../cstrike/dlls/soundent.cpp:325 */ -NOXREF int CSoundEnt::FreeList(void) +NOXREF int CSoundEnt::FreeList() { if (!pSoundEnt) { @@ -364,22 +364,3 @@ int CSoundEnt::ClientSoundIndex(edict_t *pClient) return iReturn; } - -#ifdef HOOK_GAMEDLL - -void CSoundEnt::Spawn(void) -{ - Spawn_(); -} - -void CSoundEnt::Precache(void) -{ - Precache_(); -} - -void CSoundEnt::Think(void) -{ - Think_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/soundent.h b/regamedll/dlls/soundent.h index c1107ea2..e0fc1a7c 100644 --- a/regamedll/dlls/soundent.h +++ b/regamedll/dlls/soundent.h @@ -60,11 +60,11 @@ class CSound { public: - void Clear(void); - void Reset(void); + void Clear(); + void Reset(); - NOXREF BOOL FIsSound(void); - NOXREF BOOL FIsScent(void); + NOXREF BOOL FIsSound(); + NOXREF BOOL FIsScent(); public: Vector m_vecOrigin; // sound's location in space @@ -73,8 +73,7 @@ public: float m_flExpireTime; // when the sound should be purged from the list int m_iNext; // index of next sound in this list ( Active or Free ) int m_iNextAudible; // temporary link that monsters use to build a list of audible sounds - -}; /* size: 32, cachelines: 1, members: 6 */ +}; // CSoundEnt - a single instance of this entity spawns when // the world spawns. The SoundEnt's job is to update the @@ -85,46 +84,39 @@ class CSoundEnt: public CBaseEntity { public: - virtual void Spawn(void); - virtual void Precache(void); - virtual int ObjectCaps(void) - { - return FCAP_DONT_SAVE; - } - virtual void Think(void); + virtual void Spawn(); + virtual void Precache(); + virtual int ObjectCaps() { return FCAP_DONT_SAVE; } + virtual void Think(); #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); - void Think_(void); + void Spawn_(); + void Precache_(); + void Think_(); #endif // HOOK_GAMEDLL public: - - void Initialize(void); + void Initialize(); static void InsertSound(int iType, const Vector &vecOrigin, int iVolume, float flDuration); static void FreeSound(int iSound, int iPrevious); // return the head of the active list - NOXREF static int ActiveList(void); + NOXREF static int ActiveList(); // return the head of the free list - NOXREF static int FreeList(void); + NOXREF static int FreeList(); // return a pointer for this index in the sound list static CSound *SoundPointerForIndex(int iIndex); static int ClientSoundIndex(edict_t *pClient); - BOOL IsEmpty(void) - { - return m_iActiveSound == SOUNDLIST_EMPTY; - } + BOOL IsEmpty() const { return m_iActiveSound == SOUNDLIST_EMPTY; } int ISoundsInList(int iListType); - int IAllocSound(void); + int IAllocSound(); public: int m_iFreeSound; // index of the first sound in the free sound list @@ -134,20 +126,8 @@ public: private: CSound m_SoundPool[ MAX_WORLD_SOUNDS ]; - -};/* size: 2216, cachelines: 35, members: 6 */ - -#ifdef HOOK_GAMEDLL -#define pSoundEnt (*ppSoundEnt) -#endif // HOOK_GAMEDLL +}; extern CSoundEnt *pSoundEnt; -#ifdef HOOK_GAMEDLL - -// linked objects -C_DLLEXPORT void soundent(entvars_t *pev); - -#endif // HOOK_GAMEDLL - #endif // SOUNDENT_H diff --git a/regamedll/dlls/spectator.cpp b/regamedll/dlls/spectator.cpp index fc2c2df7..becf98c9 100644 --- a/regamedll/dlls/spectator.cpp +++ b/regamedll/dlls/spectator.cpp @@ -1,6 +1,6 @@ #include "precompiled.h" -void CBaseSpectator::SpectatorConnect(void) +void CBaseSpectator::SpectatorConnect() { pev->flags = FL_SPECTATOR; pev->solid = SOLID_NOT; @@ -9,13 +9,13 @@ void CBaseSpectator::SpectatorConnect(void) m_pGoalEnt = NULL; } -void CBaseSpectator::SpectatorDisconnect(void) +void CBaseSpectator::SpectatorDisconnect() { ; } /* <17d35d> ../cstrike/dlls/spectator.cpp:61 */ -void CBaseSpectator::SpectatorImpulseCommand(void) +void CBaseSpectator::SpectatorImpulseCommand() { static edict_t *pGoal = NULL; @@ -74,7 +74,7 @@ void CBaseSpectator::SpectatorImpulseCommand(void) pev->impulse = 0; } -void CBaseSpectator::SpectatorThink(void) +void CBaseSpectator::SpectatorThink() { if (!(pev->flags & FL_SPECTATOR)) { @@ -91,7 +91,7 @@ void CBaseSpectator::SpectatorThink(void) } /* <17d297> ../cstrike/dlls/spectator.cpp:142 */ -void CBaseSpectator::__MAKE_VHOOK(Spawn)(void) +void CBaseSpectator::__MAKE_VHOOK(Spawn)() { pev->flags = FL_SPECTATOR; pev->solid = SOLID_NOT; @@ -99,12 +99,3 @@ void CBaseSpectator::__MAKE_VHOOK(Spawn)(void) m_pGoalEnt = NULL; } - -#ifdef HOOK_GAMEDLL - -void CBaseSpectator::Spawn(void) -{ - Spawn_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/spectator.h b/regamedll/dlls/spectator.h index eb750df0..e57aa419 100644 --- a/regamedll/dlls/spectator.h +++ b/regamedll/dlls/spectator.h @@ -35,21 +35,21 @@ class CBaseSpectator: public CBaseEntity { public: - virtual void Spawn(void); + virtual void Spawn(); + public: - void SpectatorConnect(void); - void SpectatorDisconnect(void); - void SpectatorThink(void); + void SpectatorConnect(); + void SpectatorDisconnect(); + void SpectatorThink(); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); #endif // HOOK_GAMEDLL private: - void SpectatorImpulseCommand(void); - -};/* size: 152, cachelines: 3, members: 1 */ + void SpectatorImpulseCommand(); +}; #endif // SPECTATOR_H diff --git a/regamedll/dlls/subs.cpp b/regamedll/dlls/subs.cpp index cb8e11d6..cb94906a 100644 --- a/regamedll/dlls/subs.cpp +++ b/regamedll/dlls/subs.cpp @@ -36,17 +36,12 @@ TYPEDESCRIPTION CBaseToggle::m_SaveData[] = DEFINE_FIELD(CBaseToggle, m_bitsDamageInflict, FIELD_INTEGER), // damage type inflicted }; -#else // HOOK_GAMEDLL - -TYPEDESCRIPTION IMPL_CLASS(CBaseDelay, m_SaveData)[2]; -TYPEDESCRIPTION IMPL_CLASS(CBaseToggle, m_SaveData)[19]; - #endif // HOOK_GAMEDLL // Landmark class /* <1832bc> ../cstrike/dlls/subs.cpp:38 */ -void CPointEntity::__MAKE_VHOOK(Spawn)(void) +void CPointEntity::__MAKE_VHOOK(Spawn)() { pev->solid = SOLID_NOT; } @@ -54,7 +49,7 @@ void CPointEntity::__MAKE_VHOOK(Spawn)(void) // Null Entity, remove on startup /* <183417> ../cstrike/dlls/subs.cpp:53 */ -void CNullEntity::__MAKE_VHOOK(Spawn)(void) +void CNullEntity::__MAKE_VHOOK(Spawn)() { REMOVE_ENTITY(ENT(pev)); } @@ -105,7 +100,7 @@ BOOL CBaseDMStart::__MAKE_VHOOK(IsTriggered)(CBaseEntity *pEntity) // This updates global tables that need to know about entities being removed /* <183f03> ../cstrike/dlls/subs.cpp:98 */ -void CBaseEntity::UpdateOnRemove(void) +void CBaseEntity::UpdateOnRemove() { int i; @@ -132,7 +127,7 @@ void CBaseEntity::UpdateOnRemove(void) // Convenient way to delay removing oneself /* <183f38> ../cstrike/dlls/subs.cpp:120 */ -void CBaseEntity::SUB_Remove(void) +void CBaseEntity::SUB_Remove() { UpdateOnRemove(); if (pev->health > 0) @@ -148,7 +143,7 @@ void CBaseEntity::SUB_Remove(void) // Convenient way to explicitly do nothing (passed to functions that require a method) /* <183f8a> ../cstrike/dlls/subs.cpp:135 */ -void CBaseEntity::SUB_DoNothing(void) +void CBaseEntity::SUB_DoNothing() { ; } @@ -317,7 +312,7 @@ void SetMovedir(entvars_t *pev) } /* <184158> ../cstrike/dlls/subs.cpp:357 */ -void CBaseDelay::DelayThink(void) +void CBaseDelay::DelayThink() { CBaseEntity *pActivator = NULL; @@ -397,7 +392,7 @@ void CBaseToggle::LinearMove(Vector vecDest, float flSpeed) // After moving, set origin to exact final destination, call "move done" function /* <18337e> ../cstrike/dlls/subs.cpp:465 */ -void CBaseToggle::LinearMoveDone(void) +void CBaseToggle::LinearMoveDone() { UTIL_SetOrigin(pev, m_vecFinalDest); pev->velocity = g_vecZero; @@ -410,7 +405,7 @@ void CBaseToggle::LinearMoveDone(void) } /* <184855> ../cstrike/dlls/subs.cpp:474 */ -NOXREF BOOL CBaseToggle::IsLockedByMaster(void) +NOXREF BOOL CBaseToggle::IsLockedByMaster() { if (!FStringNull(m_sMaster) && !UTIL_IsMasterTriggered(m_sMaster, m_hActivator)) return TRUE; @@ -454,7 +449,7 @@ void CBaseToggle::AngularMove(Vector vecDestAngle, float flSpeed) // After rotating, set angle to exact final angle, call "move done" function /* <1832fb> ../cstrike/dlls/subs.cpp:525 */ -void CBaseToggle::AngularMoveDone(void) +void CBaseToggle::AngularMoveDone() { pev->angles = m_vecFinalAngle; pev->avelocity = g_vecZero; @@ -534,57 +529,3 @@ NOXREF BOOL FEntIsVisible(entvars_t *pev, entvars_t *pevTarget) return FALSE; } - -#ifdef HOOK_GAMEDLL - -void CNullEntity::Spawn(void) -{ - Spawn_(); -} - -void CPointEntity::Spawn(void) -{ - Spawn_(); -} - -void CBaseDelay::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -int CBaseDelay::Save(CSave &save) -{ - return Save_(save); -} - -int CBaseDelay::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -void CBaseToggle::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -int CBaseToggle::Save(CSave &save) -{ - return Save_(save); -} - -int CBaseToggle::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -void CBaseDMStart::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -BOOL CBaseDMStart::IsTriggered(CBaseEntity *pEntity) -{ - return IsTriggered_(pEntity); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/subs.h b/regamedll/dlls/subs.h index fa562b86..7d2ddbd6 100644 --- a/regamedll/dlls/subs.h +++ b/regamedll/dlls/subs.h @@ -36,15 +36,15 @@ class CNullEntity: public CBaseEntity { public: - virtual void Spawn(void); + virtual void Spawn(); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); #endif // HOOK_GAMEDLL -};/* size: 152, cachelines: 3, members: 1 */ +}; /* <1827de> ../cstrike/dlls/subs.cpp:59 */ class CBaseDMStart: public CPointEntity @@ -60,24 +60,10 @@ public: #endif // HOOK_GAMEDLL -};/* size: 152, cachelines: 3, members: 1 */ +}; void FireTargets(const char *targetName, CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); void SetMovedir(entvars_t *pev); NOXREF BOOL FEntIsVisible(entvars_t *pev, entvars_t *pevTarget); -#ifdef HOOK_GAMEDLL - -// linked objects -C_DLLEXPORT void info_null(entvars_t *pev); -C_DLLEXPORT void info_player_deathmatch(entvars_t *pev); -C_DLLEXPORT void info_player_start(entvars_t *pev); -C_DLLEXPORT void info_vip_start(entvars_t *pev); -C_DLLEXPORT void info_landmark(entvars_t *pev); -C_DLLEXPORT void info_hostage_rescue(entvars_t *pev); -C_DLLEXPORT void info_bomb_target(entvars_t *pev); -C_DLLEXPORT void DelayedUse(entvars_t *pev); - -#endif // HOOK_GAMEDLL - #endif // SUBS_H diff --git a/regamedll/dlls/training_gamerules.cpp b/regamedll/dlls/training_gamerules.cpp index 2af97b9d..6d17817b 100644 --- a/regamedll/dlls/training_gamerules.cpp +++ b/regamedll/dlls/training_gamerules.cpp @@ -24,21 +24,16 @@ TYPEDESCRIPTION CBaseGrenCatch::m_SaveData[] = DEFINE_FIELD(CBaseGrenCatch, sDisableOnGrenade, FIELD_STRING), }; -#else - -TYPEDESCRIPTION IMPL_CLASS(CFuncWeaponCheck, m_SaveData)[6]; -TYPEDESCRIPTION IMPL_CLASS(CBaseGrenCatch, m_SaveData)[5]; - #endif // HOOK_GAMEDLL /* <18bcc4> ../cstrike/dlls/training_gamerules.cpp:23 */ -CHalfLifeTraining::CHalfLifeTraining(void) +CHalfLifeTraining::CHalfLifeTraining() { PRECACHE_MODEL("models/w_weaponbox.mdl"); } /* <18ae1b> ../cstrike/dlls/training_gamerules.cpp:27 */ -BOOL CHalfLifeTraining::__MAKE_VHOOK(IsDeathmatch)(void) +BOOL CHalfLifeTraining::__MAKE_VHOOK(IsDeathmatch)() { return FALSE; } @@ -50,9 +45,9 @@ void CHalfLifeTraining::__MAKE_VHOOK(InitHUD)(CBasePlayer *pl) } /* <18bcff> ../cstrike/dlls/training_gamerules.cpp:29 */ -void CHalfLifeTraining::HostageDied(void) +void CHalfLifeTraining::HostageDied() { - CBasePlayer *pPlayer = reinterpret_cast(UTIL_PlayerByIndex(1)); + CBasePlayer *pPlayer = static_cast(UTIL_PlayerByIndex(1)); if (pPlayer != NULL) { @@ -268,7 +263,7 @@ void CHalfLifeTraining::__MAKE_VHOOK(PlayerKilled)(CBasePlayer *pVictim, entvars } /* <18b0fb> ../cstrike/dlls/training_gamerules.cpp:202 */ -void CHalfLifeTraining::__MAKE_VHOOK(CheckWinConditions)(void) +void CHalfLifeTraining::__MAKE_VHOOK(CheckWinConditions)() { CBaseEntity *pHostage = NULL; @@ -352,7 +347,7 @@ IMPLEMENT_SAVERESTORE(CBaseGrenCatch, CBaseEntity); LINK_ENTITY_TO_CLASS(func_grencatch, CBaseGrenCatch); /* <18af02> ../cstrike/dlls/training_gamerules.cpp:284 */ -void CBaseGrenCatch::__MAKE_VHOOK(Spawn)(void) +void CBaseGrenCatch::__MAKE_VHOOK(Spawn)() { pev->solid = SOLID_TRIGGER; pev->flags |= FL_WORLDBRUSH; @@ -377,7 +372,7 @@ void CBaseGrenCatch::__MAKE_VHOOK(Touch)(CBaseEntity *pOther) } /* <18b835> ../cstrike/dlls/training_gamerules.cpp:300 */ -void CBaseGrenCatch::__MAKE_VHOOK(Think)(void) +void CBaseGrenCatch::__MAKE_VHOOK(Think)() { CGrenade *pGrenade; bool m_fSmokeTouchingLastFrame; @@ -472,7 +467,7 @@ void CBaseGrenCatch::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) } /* <18af29> ../cstrike/dlls/training_gamerules.cpp:400 */ -void CFuncWeaponCheck::__MAKE_VHOOK(Spawn)(void) +void CFuncWeaponCheck::__MAKE_VHOOK(Spawn)() { pev->dmgtime = 0; pev->solid = SOLID_TRIGGER; @@ -575,107 +570,3 @@ void CFuncWeaponCheck::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) else CBaseEntity::KeyValue(pkvd); } - -#ifdef HOOK_GAMEDLL - -void CBaseGrenCatch::Spawn(void) -{ - Spawn_(); -} - -void CBaseGrenCatch::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -int CBaseGrenCatch::Save(CSave &save) -{ - return Save_(save); -} - -int CBaseGrenCatch::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -void CBaseGrenCatch::Think(void) -{ - Think_(); -} - -void CBaseGrenCatch::Touch(CBaseEntity *pOther) -{ - Touch_(pOther); -} - -void CFuncWeaponCheck::Spawn(void) -{ - Spawn_(); -} - -void CFuncWeaponCheck::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -int CFuncWeaponCheck::Save(CSave &save) -{ - return Save_(save); -} - -int CFuncWeaponCheck::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -void CFuncWeaponCheck::Touch(CBaseEntity *pOther) -{ - Touch_(pOther); -} - -BOOL CHalfLifeTraining::IsDeathmatch(void) -{ - return IsDeathmatch_(); -} - -void CHalfLifeTraining::InitHUD(CBasePlayer *pl) -{ - InitHUD_(pl); -} - -void CHalfLifeTraining::PlayerSpawn(CBasePlayer *pPlayer) -{ - PlayerSpawn_(pPlayer); -} - -void CHalfLifeTraining::PlayerThink(CBasePlayer *pPlayer) -{ - PlayerThink_(pPlayer); -} - -BOOL CHalfLifeTraining::FPlayerCanRespawn(CBasePlayer *pPlayer) -{ - return FPlayerCanRespawn_(pPlayer); -} - -edict_t *CHalfLifeTraining::GetPlayerSpawnSpot(CBasePlayer *pPlayer) -{ - return GetPlayerSpawnSpot_(pPlayer); -} - -void CHalfLifeTraining::PlayerKilled(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor) -{ - PlayerKilled_(pVictim, pKiller, pInflictor); -} - -int CHalfLifeTraining::ItemShouldRespawn(CItem *pItem) -{ - return ItemShouldRespawn_(pItem); -} - -void CHalfLifeTraining::CheckWinConditions(void) -{ - CheckWinConditions_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/training_gamerules.h b/regamedll/dlls/training_gamerules.h index 2e6b3bf7..70eb353d 100644 --- a/regamedll/dlls/training_gamerules.h +++ b/regamedll/dlls/training_gamerules.h @@ -36,13 +36,10 @@ class CHalfLifeTraining: public CHalfLifeMultiplay { public: - CHalfLifeTraining(void); -public: - virtual BOOL IsMultiplayer(void) - { - return FALSE; - } - virtual BOOL IsDeathmatch(void); + CHalfLifeTraining(); + + virtual BOOL IsMultiplayer() { return FALSE; } + virtual BOOL IsDeathmatch(); virtual void InitHUD(CBasePlayer *pl); virtual void PlayerSpawn(CBasePlayer *pPlayer); virtual void PlayerThink(CBasePlayer *pPlayer); @@ -50,12 +47,12 @@ public: virtual edict_t *GetPlayerSpawnSpot(CBasePlayer *pPlayer); virtual void PlayerKilled(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor); virtual int ItemShouldRespawn(CItem *pItem); - virtual void CheckMapConditions(void) {}; - virtual void CheckWinConditions(void); + virtual void CheckMapConditions() {}; + virtual void CheckWinConditions(); #ifdef HOOK_GAMEDLL - BOOL IsDeathmatch_(void); + BOOL IsDeathmatch_(); void InitHUD_(CBasePlayer *pl); void PlayerSpawn_(CBasePlayer *pPlayer); void PlayerThink_(CBasePlayer *pPlayer); @@ -63,12 +60,12 @@ public: edict_t *GetPlayerSpawnSpot_(CBasePlayer *pPlayer); void PlayerKilled_(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor); int ItemShouldRespawn_(CItem *pItem); - void CheckWinConditions_(void); + void CheckWinConditions_(); #endif // HOOK_GAMEDLL public: - static void HostageDied(void); + static void HostageDied(); static bool PlayerCanBuy(CBasePlayer *pPlayer); float FillAccountTime; @@ -76,31 +73,27 @@ public: BOOL fInBuyArea; BOOL fVisitedBuyArea; bool fVGUIMenus; - -};/* size: 728, cachelines: 12, members: 6 */ +}; /* <18a1d5> ../cstrike/dlls/training_gamerules.cpp:252 */ class CBaseGrenCatch: 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 void Think(void); + virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); } + virtual void Think(); virtual void Touch(CBaseEntity *pOther); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); void KeyValue_(KeyValueData *pkvd); int Save_(CSave &save); int Restore_(CRestore &restore); - void Think_(void); + void Think_(); void Touch_(CBaseEntity *pOther); #endif // HOOK_GAMEDLL @@ -113,14 +106,13 @@ public: string_t sDisableOnGrenade; bool m_fSmokeTouching; bool m_fFlashTouched; - -};/* size: 168, cachelines: 3, members: 7 */ +}; /* <18a222> ../cstrike/dlls/training_gamerules.cpp:385 */ class CFuncWeaponCheck: 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); @@ -128,7 +120,7 @@ public: #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); void KeyValue_(KeyValueData *pkvd); int Save_(CSave &save); int Restore_(CRestore &restore); @@ -146,15 +138,6 @@ private: unsigned int sItemName[32]; int iItemCount; int iAnyWeapon; - -};/* size: 300, cachelines: 5, members: 8 */ - -#ifdef HOOK_GAMEDLL - -// linked objects -C_DLLEXPORT void func_grencatch(entvars_t *pev); -C_DLLEXPORT void func_weaponcheck(entvars_t *pev); - -#endif // HOOK_GAMEDLL +}; #endif // TRAINING_GAMERULES_H diff --git a/regamedll/dlls/trains.h b/regamedll/dlls/trains.h index c77fd2c5..7f70445e 100644 --- a/regamedll/dlls/trains.h +++ b/regamedll/dlls/trains.h @@ -54,26 +54,26 @@ class CPathTrack: 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); - virtual void Activate(void); + virtual void Activate(); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); void KeyValue_(KeyValueData* pkvd); int Save_(CSave &save); int Restore_(CRestore &restore); - void Activate_(void); + void Activate_(); void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); #endif // HOOK_GAMEDLL void SetPrevious(CPathTrack *pprevious); - void Link(void); + void Link(); // Returns ppath if enabled, NULL otherwise CPathTrack *ValidPath(CPathTrack *ppath, int testFlag); @@ -84,8 +84,8 @@ public: CPathTrack *LookAhead(Vector *origin, float dist, int move); CPathTrack *Nearest(Vector origin); - CPathTrack *GetNext(void); - CPathTrack *GetPrevious(void); + CPathTrack *GetNext(); + CPathTrack *GetPrevious(); public: static TYPEDESCRIPTION IMPL(m_SaveData)[5]; @@ -95,37 +95,33 @@ public: CPathTrack *m_pnext; CPathTrack *m_pprevious; CPathTrack *m_paltpath; - -};/* size: 172, cachelines: 3, members: 7 */ +}; /* <12c98a> ../cstrike/dlls/trains.h:75 */ class CFuncTrackTrain: public CBaseEntity { 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) - { - return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION) | FCAP_DIRECTIONAL_USE; - } - virtual void OverrideReset(void); + virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION) | FCAP_DIRECTIONAL_USE; } + virtual void OverrideReset(); virtual BOOL OnControls(entvars_t *pev); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Blocked(CBaseEntity *pOther); #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); - void OverrideReset_(void); + void OverrideReset_(); BOOL OnControls_(entvars_t *pev); void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); void Blocked_(CBaseEntity *pOther); @@ -133,23 +129,18 @@ public: #endif // HOOK_GAMEDLL public: - void EXPORT Next(void); - void EXPORT Find(void); - void EXPORT NearestPath(void); - void EXPORT DeadEnd(void); + void EXPORT Next(); + void EXPORT Find(); + void EXPORT NearestPath(); + void EXPORT DeadEnd(); void NextThink(float thinkTime, BOOL alwaysThink); - void SetTrack(CPathTrack *track) - { - m_ppath = track->Nearest(pev->origin); - } + void SetTrack(CPathTrack *track) { m_ppath = track->Nearest(pev->origin); } void SetControls(entvars_t *pevControls); - void StopSound(void); - void UpdateSound(void); + void StopSound(); + void UpdateSound(); static CFuncTrackTrain *Instance(edict_t *pent); - -public: static TYPEDESCRIPTION IMPL(m_SaveData)[12]; CPathTrack *m_ppath; @@ -171,39 +162,35 @@ public: private: unsigned short m_usAdjustPitch; - -};/* size: 236, cachelines: 4, members: 19 */ +}; /* <1ba5f9> ../cstrike/dlls/trains.h:134 */ class CFuncVehicle: public CBaseEntity { 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) - { - return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION) | FCAP_DIRECTIONAL_USE; - } - virtual int Classify(void); - virtual void OverrideReset(void); + virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION) | FCAP_DIRECTIONAL_USE; } + virtual int Classify(); + virtual void OverrideReset(); virtual BOOL OnControls(entvars_t *pev); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Blocked(CBaseEntity *pOther); #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); - int Classify_(void); - void OverrideReset_(void); + int Classify_(); + void OverrideReset_(); BOOL OnControls_(entvars_t *pev); void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); void Blocked_(CBaseEntity *pOther); @@ -211,29 +198,24 @@ public: #endif // HOOK_GAMEDLL public: - void EXPORT Next(void); - void EXPORT Find(void); - void EXPORT NearestPath(void); - void EXPORT DeadEnd(void); + void EXPORT Next(); + void EXPORT Find(); + void EXPORT NearestPath(); + void EXPORT DeadEnd(); void NextThink(float thinkTime, BOOL alwaysThink); - void CollisionDetection(void); - void TerrainFollowing(void); - void CheckTurning(void); + void CollisionDetection(); + void TerrainFollowing(); + void CheckTurning(); - void SetTrack(CPathTrack *track) - { - m_ppath = track->Nearest(pev->origin); - } + void SetTrack(CPathTrack *track) { m_ppath = track->Nearest(pev->origin); } void SetControls(entvars_t *pevControls); - void StopSound(void); - void UpdateSound(void); + void StopSound(); + void UpdateSound(); public: static CFuncVehicle *Instance(edict_t *pent); - -public: static TYPEDESCRIPTION IMPL(m_SaveData)[12]; CPathTrack *m_ppath; @@ -271,14 +253,6 @@ public: private: unsigned short m_usAdjustPitch; - -};/* size: 364, cachelines: 6, members: 35 */ - -#ifdef HOOK_GAMEDLL - -// linked objects -C_DLLEXPORT void path_track(entvars_t *pev); - -#endif // HOOK_GAMEDLL +}; #endif // TRAINS_H diff --git a/regamedll/dlls/triggers.cpp b/regamedll/dlls/triggers.cpp index 50cb14a7..b3af6dfc 100644 --- a/regamedll/dlls/triggers.cpp +++ b/regamedll/dlls/triggers.cpp @@ -63,24 +63,11 @@ TYPEDESCRIPTION CTriggerCamera::m_SaveData[] = DEFINE_FIELD(CTriggerCamera, m_state, FIELD_INTEGER), }; -FILE_GLOBAL char st_szNextMap[cchMapNameMost]; -FILE_GLOBAL char st_szNextSpot[cchMapNameMost]; - -#else - -TYPEDESCRIPTION IMPL_CLASS(CFrictionModifier, m_SaveData)[1]; -TYPEDESCRIPTION IMPL_CLASS(CAutoTrigger, m_SaveData)[2]; -TYPEDESCRIPTION IMPL_CLASS(CTriggerRelay, m_SaveData)[1]; -TYPEDESCRIPTION IMPL_CLASS(CMultiManager, m_SaveData)[5]; -TYPEDESCRIPTION IMPL_CLASS(CChangeLevel, m_SaveData)[4]; -TYPEDESCRIPTION IMPL_CLASS(CTriggerChangeTarget, m_SaveData)[1]; -TYPEDESCRIPTION IMPL_CLASS(CTriggerCamera, m_SaveData)[13]; +#endif // HOOK_GAMEDLL char st_szNextMap[cchMapNameMost]; char st_szNextSpot[cchMapNameMost]; -#endif // HOOK_GAMEDLL - /* <1a257e> ../cstrike/dlls/triggers.cpp:60 */ LINK_ENTITY_TO_CLASS(func_friction, CFrictionModifier); @@ -88,7 +75,7 @@ LINK_ENTITY_TO_CLASS(func_friction, CFrictionModifier); IMPLEMENT_SAVERESTORE(CFrictionModifier, CBaseEntity); /* <19fa7d> ../cstrike/dlls/triggers.cpp:72 */ -void CFrictionModifier::__MAKE_VHOOK(Spawn)(void) +void CFrictionModifier::__MAKE_VHOOK(Spawn)() { pev->solid = SOLID_TRIGGER; @@ -160,19 +147,19 @@ void CAutoTrigger::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) } /* <19fb05> ../cstrike/dlls/triggers.cpp:165 */ -void CAutoTrigger::__MAKE_VHOOK(Spawn)(void) +void CAutoTrigger::__MAKE_VHOOK(Spawn)() { Precache(); } /* <19fb2d> ../cstrike/dlls/triggers.cpp:171 */ -void CAutoTrigger::__MAKE_VHOOK(Precache)(void) +void CAutoTrigger::__MAKE_VHOOK(Precache)() { - pev->nextthink = gpGlobals->time + 0.1; + pev->nextthink = gpGlobals->time + 0.1f; } /* <19d48c> ../cstrike/dlls/triggers.cpp:177 */ -void CAutoTrigger::__MAKE_VHOOK(Think)(void) +void CAutoTrigger::__MAKE_VHOOK(Think)() { if (!m_globalstate || gGlobalState.EntityGetState(m_globalstate) == GLOBAL_ON) { @@ -216,7 +203,7 @@ void CTriggerRelay::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) } /* <19fb7e> ../cstrike/dlls/triggers.cpp:240 */ -void CTriggerRelay::__MAKE_VHOOK(Spawn)(void) +void CTriggerRelay::__MAKE_VHOOK(Spawn)() { ; } @@ -263,7 +250,7 @@ void CMultiManager::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) } /* <19fbce> ../cstrike/dlls/triggers.cpp:347 */ -void CMultiManager::__MAKE_VHOOK(Spawn)(void) +void CMultiManager::__MAKE_VHOOK(Spawn)() { pev->solid = SOLID_NOT; SetUse(&CMultiManager::ManagerUse); @@ -295,7 +282,7 @@ void CMultiManager::__MAKE_VHOOK(Spawn)(void) } /* <1a03e5> ../cstrike/dlls/triggers.cpp:377 */ -void CMultiManager::__MAKE_VHOOK(Restart)(void) +void CMultiManager::__MAKE_VHOOK(Restart)() { edict_t *pentTarget = NULL; @@ -349,7 +336,7 @@ BOOL CMultiManager::__MAKE_VHOOK(HasTarget)(string_t targetname) // so I changed it to use the standard target fire code, made it a little simpler. /* <1a0393> ../cstrike/dlls/triggers.cpp:432 */ -void CMultiManager::ManagerThink(void) +void CMultiManager::ManagerThink() { float time; @@ -378,7 +365,7 @@ void CMultiManager::ManagerThink(void) } /* <1a291b> ../cstrike/dlls/triggers.cpp:457 */ -CMultiManager *CMultiManager::Clone(void) +CMultiManager *CMultiManager::Clone() { CMultiManager *pMulti = GetClassPtr((CMultiManager *)NULL); @@ -424,7 +411,7 @@ void CMultiManager::ManagerUse(CBaseEntity *pActivator, CBaseEntity *pCaller, US LINK_ENTITY_TO_CLASS(env_render, CRenderFxManager); /* <19fc52> ../cstrike/dlls/triggers.cpp:535 */ -void CRenderFxManager::__MAKE_VHOOK(Spawn)(void) +void CRenderFxManager::__MAKE_VHOOK(Spawn)() { pev->solid = SOLID_NOT; } @@ -463,7 +450,7 @@ void CRenderFxManager::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *p LINK_ENTITY_TO_CLASS(trigger, CBaseTrigger); /* <1a2c92> ../cstrike/dlls/triggers.cpp:590 */ -void CBaseTrigger::InitTrigger(void) +void CBaseTrigger::InitTrigger() { // trigger angles are used for one-way touches. An angle of 0 is assumed // to mean no restrictions, so use a yaw of 360 instead. @@ -515,7 +502,7 @@ LINK_ENTITY_TO_CLASS(trigger_hurt, CTriggerHurt); LINK_ENTITY_TO_CLASS(trigger_monsterjump, CTriggerMonsterJump); /* <1a2fdc> ../cstrike/dlls/triggers.cpp:652 */ -void CTriggerMonsterJump::__MAKE_VHOOK(Spawn)(void) +void CTriggerMonsterJump::__MAKE_VHOOK(Spawn)() { SetMovedir(pev); @@ -537,9 +524,9 @@ void CTriggerMonsterJump::__MAKE_VHOOK(Spawn)(void) } /* <1a00e4> ../cstrike/dlls/triggers.cpp:671 */ -void CTriggerMonsterJump::__MAKE_VHOOK(Think)(void) +void CTriggerMonsterJump::__MAKE_VHOOK(Think)() { - // kill the trigger for now !!!UNDONE + // kill the trigger for now UNDONE pev->solid = SOLID_NOT; // Unlink from trigger list @@ -576,7 +563,7 @@ void CTriggerMonsterJump::__MAKE_VHOOK(Touch)(CBaseEntity *pOther) LINK_ENTITY_TO_CLASS(trigger_cdaudio, CTriggerCDAudio); // Changes tracks or stops CD when player touches -// !!!HACK - overloaded HEALTH to avoid adding new field +// HACK: overloaded HEALTH to avoid adding new field /* <1a2382> ../cstrike/dlls/triggers.cpp:721 */ void CTriggerCDAudio::__MAKE_VHOOK(Touch)(CBaseEntity *pOther) @@ -591,7 +578,7 @@ void CTriggerCDAudio::__MAKE_VHOOK(Touch)(CBaseEntity *pOther) } /* <1a2fb4> ../cstrike/dlls/triggers.cpp:731 */ -void CTriggerCDAudio::__MAKE_VHOOK(Spawn)(void) +void CTriggerCDAudio::__MAKE_VHOOK(Spawn)() { InitTrigger(); } @@ -636,7 +623,7 @@ void PlayCDTrack(int iTrack) // only plays for ONE client, so only use in single play! /* <1a3372> ../cstrike/dlls/triggers.cpp:773 */ -void CTriggerCDAudio::PlayTrack(void) +void CTriggerCDAudio::PlayTrack() { PlayCDTrack((int)pev->health); @@ -660,7 +647,7 @@ void CTargetCDAudio::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) } /* <1a066a> ../cstrike/dlls/triggers.cpp:807 */ -void CTargetCDAudio::__MAKE_VHOOK(Spawn)(void) +void CTargetCDAudio::__MAKE_VHOOK(Spawn)() { pev->solid = SOLID_NOT; pev->movetype = MOVETYPE_NONE; @@ -680,7 +667,7 @@ void CTargetCDAudio::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCa // only plays for ONE client, so only use in single play! /* <1a2465> ../cstrike/dlls/triggers.cpp:822 */ -void CTargetCDAudio::__MAKE_VHOOK(Think)(void) +void CTargetCDAudio::__MAKE_VHOOK(Think)() { edict_t *pClient; @@ -700,14 +687,14 @@ void CTargetCDAudio::__MAKE_VHOOK(Think)(void) } /* <1a34e8> ../cstrike/dlls/triggers.cpp:840 */ -void CTargetCDAudio::Play(void) +void CTargetCDAudio::Play() { PlayCDTrack((int)pev->health); UTIL_Remove(this); } /* <1a2f8b> ../cstrike/dlls/triggers.cpp:853 */ -void CTriggerHurt::__MAKE_VHOOK(Spawn)(void) +void CTriggerHurt::__MAKE_VHOOK(Spawn)() { InitTrigger(); SetTouch(&CTriggerHurt::HurtTouch); @@ -742,7 +729,7 @@ void CTriggerHurt::__MAKE_VHOOK(Spawn)(void) // according to distance from center of trigger /* <1a5df2> ../cstrike/dlls/triggers.cpp:883 */ -void CTriggerHurt::RadiationThink(void) +void CTriggerHurt::RadiationThink() { edict_t *pentPlayer; CBasePlayer *pPlayer = NULL; @@ -939,7 +926,7 @@ void CBaseTrigger::HurtTouch(CBaseEntity *pOther) LINK_ENTITY_TO_CLASS(trigger_multiple, CTriggerMultiple); /* <1a2f67> ../cstrike/dlls/triggers.cpp:1089 */ -void CTriggerMultiple::__MAKE_VHOOK(Spawn)(void) +void CTriggerMultiple::__MAKE_VHOOK(Spawn)() { if (m_flWait == 0) m_flWait = 0.2; @@ -975,7 +962,7 @@ void CTriggerMultiple::__MAKE_VHOOK(Spawn)(void) LINK_ENTITY_TO_CLASS(trigger_once, CTriggerOnce); /* <1a301c> ../cstrike/dlls/triggers.cpp:1136 */ -void CTriggerOnce::__MAKE_VHOOK(Spawn)(void) +void CTriggerOnce::__MAKE_VHOOK(Spawn)() { m_flWait = -1; CTriggerMultiple::Spawn(); @@ -1056,7 +1043,7 @@ void CBaseTrigger::ActivateMultiTrigger(CBaseEntity *pActivator) // the wait time has passed, so set back up for another activation /* <19fd1a> ../cstrike/dlls/triggers.cpp:1214 */ -void CBaseTrigger::MultiWaitOver(void) +void CBaseTrigger::MultiWaitOver() { SetThink(NULL); } @@ -1091,7 +1078,7 @@ void CBaseTrigger::CounterUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE return; } - // !!!UNDONE: I don't think we want these Quakesque messages + // UNDONE: I don't think we want these Quakesque messages if (fTellActivator) { ALERT(at_console, "Sequence completed!"); @@ -1104,7 +1091,7 @@ void CBaseTrigger::CounterUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE LINK_ENTITY_TO_CLASS(trigger_counter, CTriggerCounter); /* <19fd42> ../cstrike/dlls/triggers.cpp:1280 */ -void CTriggerCounter::__MAKE_VHOOK(Spawn)(void) +void CTriggerCounter::__MAKE_VHOOK(Spawn)() { // By making the flWait be -1, this counter-trigger will disappear after it's activated // (but of course it needs cTriggersLeft "uses" before that happens). @@ -1124,7 +1111,7 @@ LINK_ENTITY_TO_CLASS(trigger_transition, CTriggerVolume); // Define space that travels across a level transition /* <19fd6a> ../cstrike/dlls/triggers.cpp:1302 */ -void CTriggerVolume::__MAKE_VHOOK(Spawn)(void) +void CTriggerVolume::__MAKE_VHOOK(Spawn)() { pev->solid = SOLID_NOT; pev->movetype = MOVETYPE_NONE; @@ -1140,7 +1127,7 @@ void CTriggerVolume::__MAKE_VHOOK(Spawn)(void) LINK_ENTITY_TO_CLASS(fireanddie, CFireAndDie); /* <1a0618> ../cstrike/dlls/triggers.cpp:1323 */ -void CFireAndDie::__MAKE_VHOOK(Spawn)(void) +void CFireAndDie::__MAKE_VHOOK(Spawn)() { if (pev->classname) { @@ -1153,13 +1140,13 @@ void CFireAndDie::__MAKE_VHOOK(Spawn)(void) } /* <19fdbb> ../cstrike/dlls/triggers.cpp:1330 */ -void CFireAndDie::__MAKE_VHOOK(Precache)(void) +void CFireAndDie::__MAKE_VHOOK(Precache)() { pev->nextthink = gpGlobals->time + m_flDelay; } /* <1a01ae> ../cstrike/dlls/triggers.cpp:1337 */ -void CFireAndDie::__MAKE_VHOOK(Think)(void) +void CFireAndDie::__MAKE_VHOOK(Think)() { SUB_UseTargets(this, USE_TOGGLE, 0); UTIL_Remove(this); @@ -1211,7 +1198,7 @@ void CChangeLevel::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) } /* <1a2f25> ../cstrike/dlls/triggers.cpp:1423 */ -void CChangeLevel::__MAKE_VHOOK(Spawn)(void) +void CChangeLevel::__MAKE_VHOOK(Spawn)() { if (FStrEq(m_szMapName, "")) { @@ -1236,7 +1223,7 @@ void CChangeLevel::__MAKE_VHOOK(Spawn)(void) } /* <19fde3> ../cstrike/dlls/triggers.cpp:1441 */ -void CChangeLevel::ExecuteChangeLevel(void) +void CChangeLevel::ExecuteChangeLevel() { MESSAGE_BEGIN(MSG_ALL, SVC_CDTRACK); WRITE_BYTE(3); @@ -1463,7 +1450,7 @@ int CChangeLevel::ChangeList(LEVELLIST *pLevelList, int maxList) { count++; - // FULL!! + // FULL! if (count >= maxList) break; } @@ -1542,7 +1529,7 @@ int CChangeLevel::ChangeList(LEVELLIST *pLevelList, int maxList) // only called if a time or frag limit has expired /* <1a44fc> ../cstrike/dlls/triggers.cpp:1722 */ -NOXREF void NextLevel(void) +NOXREF void NextLevel() { edict_t *pent; CChangeLevel *pChange; @@ -1582,7 +1569,7 @@ void CLadder::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) // func_ladder - makes an area vertically negotiable /* <19fe6c> ../cstrike/dlls/triggers.cpp:1772 */ -void CLadder::__MAKE_VHOOK(Precache)(void) +void CLadder::__MAKE_VHOOK(Precache)() { // Do all of this in here because we need to 'convert' old saved games pev->solid = SOLID_NOT; @@ -1598,7 +1585,7 @@ void CLadder::__MAKE_VHOOK(Precache)(void) } /* <19fe95> ../cstrike/dlls/triggers.cpp:1786 */ -void CLadder::__MAKE_VHOOK(Spawn)(void) +void CLadder::__MAKE_VHOOK(Spawn)() { Precache(); @@ -1617,7 +1604,7 @@ void CTriggerPush::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) } /* <1a2eda> ../cstrike/dlls/triggers.cpp:1817 */ -void CTriggerPush::__MAKE_VHOOK(Spawn)(void) +void CTriggerPush::__MAKE_VHOOK(Spawn)() { if (pev->angles == g_vecZero) { @@ -1757,7 +1744,7 @@ void CBaseTrigger::TeleportTouch(CBaseEntity *pOther) LINK_ENTITY_TO_CLASS(trigger_teleport, CTriggerTeleport); /* <1a2eb1> ../cstrike/dlls/triggers.cpp:1942 */ -void CTriggerTeleport::__MAKE_VHOOK(Spawn)(void) +void CTriggerTeleport::__MAKE_VHOOK(Spawn)() { InitTrigger(); SetTouch(&CTriggerTeleport::TeleportTouch); @@ -1770,7 +1757,7 @@ LINK_ENTITY_TO_CLASS(info_teleport_destination, CPointEntity); LINK_ENTITY_TO_CLASS(func_buyzone, CBuyZone); /* <1a2e71> ../cstrike/dlls/triggers.cpp:1973 */ -void CBuyZone::__MAKE_VHOOK(Spawn)(void) +void CBuyZone::__MAKE_VHOOK(Spawn)() { InitTrigger(); SetTouch(&CBuyZone::BuyTouch); @@ -1800,7 +1787,7 @@ void CBuyZone::BuyTouch(CBaseEntity *pOther) LINK_ENTITY_TO_CLASS(func_bomb_target, CBombTarget); /* <1a2e48> ../cstrike/dlls/triggers.cpp:2019 */ -void CBombTarget::__MAKE_VHOOK(Spawn)(void) +void CBombTarget::__MAKE_VHOOK(Spawn)() { InitTrigger(); @@ -1833,7 +1820,7 @@ void CBombTarget::BombTargetUse(CBaseEntity *pActivator, CBaseEntity *pCaller, U LINK_ENTITY_TO_CLASS(func_hostage_rescue, CHostageRescue); /* <1a2e1f> ../cstrike/dlls/triggers.cpp:2067 */ -void CHostageRescue::__MAKE_VHOOK(Spawn)(void) +void CHostageRescue::__MAKE_VHOOK(Spawn)() { InitTrigger(); SetTouch(&CHostageRescue::HostageRescueTouch); @@ -1857,7 +1844,7 @@ void CHostageRescue::HostageRescueTouch(CBaseEntity *pOther) LINK_ENTITY_TO_CLASS(func_escapezone, CEscapeZone); /* <1a2df6> ../cstrike/dlls/triggers.cpp:2108 */ -void CEscapeZone::__MAKE_VHOOK(Spawn)(void) +void CEscapeZone::__MAKE_VHOOK(Spawn)() { InitTrigger(); SetTouch(&CEscapeZone::EscapeTouch); @@ -1911,7 +1898,7 @@ void CEscapeZone::EscapeTouch(CBaseEntity *pOther) LINK_ENTITY_TO_CLASS(func_vip_safetyzone, CVIP_SafetyZone); /* <1a2dcd> ../cstrike/dlls/triggers.cpp:2166 */ -void CVIP_SafetyZone::__MAKE_VHOOK(Spawn)(void) +void CVIP_SafetyZone::__MAKE_VHOOK(Spawn)() { InitTrigger(); SetTouch(&CVIP_SafetyZone::VIP_SafetyTouch); @@ -1947,7 +1934,7 @@ void CVIP_SafetyZone::VIP_SafetyTouch(CBaseEntity *pOther) LINK_ENTITY_TO_CLASS(trigger_autosave, CTriggerSave); /* <1a2d8e> ../cstrike/dlls/triggers.cpp:2206 */ -void CTriggerSave::__MAKE_VHOOK(Spawn)(void) +void CTriggerSave::__MAKE_VHOOK(Spawn)() { if (g_pGameRules->IsDeathmatch()) { @@ -1994,7 +1981,7 @@ void CTriggerEndSection::EndSectionUse(CBaseEntity *pActivator, CBaseEntity *pCa } /* <1a2d4f> ../cstrike/dlls/triggers.cpp:2260 */ -void CTriggerEndSection::__MAKE_VHOOK(Spawn)(void) +void CTriggerEndSection::__MAKE_VHOOK(Spawn)() { if (g_pGameRules->IsDeathmatch()) { @@ -2045,7 +2032,7 @@ void CTriggerEndSection::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) LINK_ENTITY_TO_CLASS(trigger_gravity, CTriggerGravity); /* <1a2d26> ../cstrike/dlls/triggers.cpp:2313 */ -void CTriggerGravity::__MAKE_VHOOK(Spawn)(void) +void CTriggerGravity::__MAKE_VHOOK(Spawn)() { InitTrigger(); SetTouch(&CTriggerGravity::GravityTouch); @@ -2080,7 +2067,7 @@ void CTriggerChangeTarget::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) } /* <19ff1f> ../cstrike/dlls/triggers.cpp:2371 */ -void CTriggerChangeTarget::__MAKE_VHOOK(Spawn)(void) +void CTriggerChangeTarget::__MAKE_VHOOK(Spawn)() { ; } @@ -2110,7 +2097,7 @@ LINK_ENTITY_TO_CLASS(trigger_camera, CTriggerCamera); IMPLEMENT_SAVERESTORE(CTriggerCamera, CBaseDelay); /* <19ff6f> ../cstrike/dlls/triggers.cpp:2447 */ -void CTriggerCamera::__MAKE_VHOOK(Spawn)(void) +void CTriggerCamera::__MAKE_VHOOK(Spawn)() { pev->movetype = MOVETYPE_NOCLIP; @@ -2261,7 +2248,7 @@ void CTriggerCamera::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCa } /* <1a5494> ../cstrike/dlls/triggers.cpp:2587 */ -void CTriggerCamera::FollowTarget(void) +void CTriggerCamera::FollowTarget() { if (m_hPlayer == NULL) return; @@ -2321,7 +2308,7 @@ void CTriggerCamera::FollowTarget(void) } /* <1a5311> ../cstrike/dlls/triggers.cpp:2644 */ -void CTriggerCamera::Move(void) +void CTriggerCamera::Move() { // Not moving on a path, return if (!m_pentPath) @@ -2392,7 +2379,7 @@ LINK_ENTITY_TO_CLASS(env_rain, CWeather); LINK_ENTITY_TO_CLASS(func_rain, CWeather); /* <1a2cfe> ../cstrike/dlls/triggers.cpp:2704 */ -void CWeather::__MAKE_VHOOK(Spawn)(void) +void CWeather::__MAKE_VHOOK(Spawn)() { InitTrigger(); } @@ -2427,7 +2414,7 @@ void CClientFog::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) } /* <19ff97> ../cstrike/dlls/triggers.cpp:2735 */ -void CClientFog::__MAKE_VHOOK(Spawn)(void) +void CClientFog::__MAKE_VHOOK(Spawn)() { pev->movetype = MOVETYPE_NOCLIP; pev->solid = SOLID_NOT; // Remove model & collisions @@ -2437,379 +2424,3 @@ void CClientFog::__MAKE_VHOOK(Spawn)(void) /* <1a5ba9> ../cstrike/dlls/triggers.cpp:2744 */ LINK_ENTITY_TO_CLASS(env_fog, CClientFog); - -#ifdef HOOK_GAMEDLL - -void CFrictionModifier::Spawn(void) -{ - Spawn_(); -} - -void CFrictionModifier::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -int CFrictionModifier::Save(CSave &save) -{ - return Save_(save); -} - -int CFrictionModifier::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -void CAutoTrigger::Spawn(void) -{ - Spawn_(); -} - -void CAutoTrigger::Precache(void) -{ - Precache_(); -} - -void CAutoTrigger::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -int CAutoTrigger::Save(CSave &save) -{ - return Save_(save); -} - -int CAutoTrigger::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -void CAutoTrigger::Think(void) -{ - Think_(); -} - -void CTriggerRelay::Spawn(void) -{ - Spawn_(); -} - -void CTriggerRelay::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -int CTriggerRelay::Save(CSave &save) -{ - return Save_(save); -} - -int CTriggerRelay::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -void CTriggerRelay::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -void CMultiManager::Spawn(void) -{ - Spawn_(); -} - -void CMultiManager::Restart(void) -{ - Restart_(); -} - -void CMultiManager::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -int CMultiManager::Save(CSave &save) -{ - return Save_(save); -} - -int CMultiManager::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -BOOL CMultiManager::HasTarget(string_t targetname) -{ - return HasTarget_(targetname); -} - -void CRenderFxManager::Spawn(void) -{ - Spawn_(); -} - -void CRenderFxManager::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -void CBaseTrigger::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -void CTriggerHurt::Spawn(void) -{ - Spawn_(); -} - -void CTriggerMonsterJump::Spawn(void) -{ - Spawn_(); -} - -void CTriggerMonsterJump::Think(void) -{ - Think_(); -} - -void CTriggerMonsterJump::Touch(CBaseEntity *pOther) -{ - Touch_(pOther); -} - -void CTriggerCDAudio::Spawn(void) -{ - Spawn_(); -} - -void CTriggerCDAudio::Touch(CBaseEntity *pOther) -{ - Touch_(pOther); -} - -void CTriggerCDAudio::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -void CTargetCDAudio::Spawn(void) -{ - Spawn_(); -} - -void CTargetCDAudio::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -void CTargetCDAudio::Think(void) -{ - Think_(); -} - -void CTargetCDAudio::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -void CTriggerMultiple::Spawn(void) -{ - Spawn_(); -} - -void CTriggerOnce::Spawn(void) -{ - Spawn_(); -} - -void CTriggerCounter::Spawn(void) -{ - Spawn_(); -} - -void CTriggerVolume::Spawn(void) -{ - Spawn_(); -} - -void CFireAndDie::Spawn(void) -{ - Spawn_(); -} - -void CFireAndDie::Precache(void) -{ - Precache_(); -} - -void CFireAndDie::Think(void) -{ - Think_(); -} - -void CChangeLevel::Spawn(void) -{ - Spawn_(); -} - -void CChangeLevel::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -int CChangeLevel::Save(CSave &save) -{ - return Save_(save); -} - -int CChangeLevel::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -void CLadder::Spawn(void) -{ - Spawn_(); -} - -void CLadder::Precache(void) -{ - Precache_(); -} - -void CLadder::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -void CTriggerPush::Spawn(void) -{ - Spawn_(); -} - -void CTriggerPush::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -void CTriggerPush::Touch(CBaseEntity *pOther) -{ - Touch_(pOther); -} - -void CTriggerTeleport::Spawn(void) -{ - Spawn_(); -} - -void CBuyZone::Spawn(void) -{ - Spawn_(); -} - -void CBombTarget::Spawn(void) -{ - Spawn_(); -} - -void CHostageRescue::Spawn(void) -{ - Spawn_(); -} - -void CEscapeZone::Spawn(void) -{ - Spawn_(); -} - -void CVIP_SafetyZone::Spawn(void) -{ - Spawn_(); -} - -void CTriggerSave::Spawn(void) -{ - Spawn_(); -} - -void CTriggerEndSection::Spawn(void) -{ - Spawn_(); -} - -void CTriggerEndSection::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -void CTriggerGravity::Spawn(void) -{ - Spawn_(); -} - -void CTriggerChangeTarget::Spawn(void) -{ - Spawn_(); -} -void CTriggerChangeTarget::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -int CTriggerChangeTarget::Save(CSave &save) -{ - return Save_(save); -} - -int CTriggerChangeTarget::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -void CTriggerChangeTarget::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -void CTriggerCamera::Spawn(void) -{ - Spawn_(); -} -void CTriggerCamera::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -int CTriggerCamera::Save(CSave &save) -{ - return Save_(save); -} - -int CTriggerCamera::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -void CTriggerCamera::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -void CClientFog::Spawn(void) -{ - Spawn_(); -} -void CClientFog::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -void CWeather::Spawn(void) -{ - Spawn_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/triggers.h b/regamedll/dlls/triggers.h index 700d9d1f..b2dd8a41 100644 --- a/regamedll/dlls/triggers.h +++ b/regamedll/dlls/triggers.h @@ -71,18 +71,15 @@ class CFrictionModifier: 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); } #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); void KeyValue_(KeyValueData *pkvd); int Save_(CSave &save); int Restore_(CRestore &restore); @@ -91,13 +88,10 @@ public: public: void EXPORT ChangeFriction(CBaseEntity *pOther); - -public: static TYPEDESCRIPTION IMPL(m_SaveData)[1]; float m_frictionFraction; - -};/* size: 156, cachelines: 3, members: 3 */ +}; // This trigger will fire when the level spawns (or respawns if not fire once) // It will check a global state before firing. It supports delay and killtargets @@ -106,25 +100,22 @@ public: class CAutoTrigger: 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 int ObjectCaps(void) - { - return (CBaseDelay::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); - } - virtual void Think(void); + virtual int ObjectCaps() { return (CBaseDelay::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); } + virtual void Think(); #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 Think_(void); + void Think_(); #endif // HOOK_GAMEDLL @@ -133,26 +124,22 @@ public: int m_globalstate; USE_TYPE triggerType; - -};/* size: 168, cachelines: 3, members: 4 */ +}; /* <19e3ed> ../cstrike/dlls/triggers.cpp:191 */ class CTriggerRelay: public CBaseDelay { 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 (CBaseDelay::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); - } + virtual int ObjectCaps() { return (CBaseDelay::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 KeyValue_(KeyValueData *pkvd); int Save_(CSave &save); int Restore_(CRestore &restore); @@ -164,8 +151,7 @@ public: static TYPEDESCRIPTION IMPL(m_SaveData)[1]; USE_TYPE triggerType; - -};/* size: 164, cachelines: 3, members: 3 */ +}; // The Multimanager Entity - when fired, will fire up to 16 targets // at specified times. @@ -176,21 +162,18 @@ public: class CMultiManager: public CBaseToggle { public: - virtual void Spawn(void); - virtual void Restart(void); + virtual void Spawn(); + virtual void Restart(); 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 BOOL HasTarget(string_t targetname); #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Restart_(void); + void Spawn_(); + void Restart_(); void KeyValue_(KeyValueData *pkvd); int Save_(CSave &save); int Restore_(CRestore &restore); @@ -199,12 +182,12 @@ public: #endif // HOOK_GAMEDLL public: - void EXPORT ManagerThink(void); + void EXPORT ManagerThink(); void EXPORT ManagerUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); private: /* <19dfe1> ../cstrike/dlls/triggers.cpp:293 */ - BOOL IsClone(void) + BOOL IsClone() { if (pev->spawnflags & SF_MULTIMAN_CLONE) { @@ -214,7 +197,7 @@ private: return FALSE; } /* <19e4f3> ../cstrike/dlls/triggers.cpp:294 */ - BOOL ShouldClone(void) + BOOL ShouldClone() { if (IsClone()) { @@ -228,19 +211,17 @@ private: return FALSE; } - CMultiManager *Clone(void); + CMultiManager *Clone(); public: static TYPEDESCRIPTION IMPL(m_SaveData)[5]; - int m_cTargets;//312 + int m_cTargets; int m_index; float m_startTime; int m_iTargetName[ MAX_MULTI_TARGETS ]; float m_flTargetDelay[ MAX_MULTI_TARGETS ]; - -};/* size: 452, cachelines: 8, members: 7 */ -/* Linux - 452 | Windows - 432 */ +}; // Render parameters trigger // @@ -251,27 +232,24 @@ public: class CRenderFxManager: public CBaseEntity { 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 -};/* size: 152, cachelines: 3, members: 1 */ +}; /* <19e55f> ../cstrike/dlls/triggers.cpp:566 */ class CBaseTrigger: public CBaseToggle { public: virtual void KeyValue(KeyValueData *pkvd); - virtual int ObjectCaps(void) - { - return (CBaseToggle::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); - } + virtual int ObjectCaps() { return (CBaseToggle::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); } #ifdef HOOK_GAMEDLL @@ -285,12 +263,11 @@ public: void EXPORT HurtTouch(CBaseEntity *pOther); NOXREF void EXPORT CDAudioTouch(CBaseEntity *pOther); void ActivateMultiTrigger(CBaseEntity *pActivator); - void EXPORT MultiWaitOver(void); + void EXPORT MultiWaitOver(); void EXPORT CounterUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); void EXPORT ToggleUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); - void InitTrigger(void); - -};/* size: 312, cachelines: 5, members: 1 */ + void InitTrigger(); +}; // trigger_hurt - hurts anything that touches it. if the trigger has a targetname, firing it will toggle state // int gfToggleState = 0; // used to determine when all radiation trigger hurts have called 'RadiationThink' @@ -299,35 +276,34 @@ public: class CTriggerHurt: public CBaseTrigger { public: - virtual void Spawn(void); + virtual void Spawn(); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); #endif // HOOK_GAMEDLL - void EXPORT RadiationThink(void); - -};/* size: 312, cachelines: 5, members: 1 */ + void EXPORT RadiationThink(); +}; /* <19e60a> ../cstrike/dlls/triggers.cpp:641 */ class CTriggerMonsterJump: public CBaseTrigger { public: - virtual void Spawn(void); - virtual void Think(void); + virtual void Spawn(); + 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: 312, cachelines: 5, members: 1 */ +}; // trigger_cdaudio - starts/stops cd audio tracks @@ -335,22 +311,21 @@ public: class CTriggerCDAudio: public CBaseTrigger { public: - virtual void Spawn(void); + virtual void Spawn(); virtual void Touch(CBaseEntity *pOther); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); void Touch_(CBaseEntity *pOther); void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); #endif // HOOK_GAMEDLL public: - virtual void PlayTrack(void); - -};/* size: 312, cachelines: 5, members: 1 */ + void PlayTrack(); +}; // This plays a CD track when fired or when the player enters it's radius @@ -358,24 +333,23 @@ public: class CTargetCDAudio: public CPointEntity { public: - virtual void Spawn(void); + virtual void Spawn(); virtual void KeyValue(KeyValueData *pkvd); - 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 Spawn_(); void KeyValue_(KeyValueData *pkvd); - void Think_(void); + void Think_(); void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); #endif // HOOK_GAMEDLL public: - void Play(void); - -};/* size: 152, cachelines: 3, members: 1 */ + void Play(); +}; // QUAKED trigger_multiple (.5 .5 .5) ? notouch // Variable sized repeatable trigger. Must be targeted at one or more entities. @@ -396,15 +370,15 @@ public: class CTriggerMultiple: public CBaseTrigger { public: - virtual void Spawn(void); + virtual void Spawn(); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); #endif // HOOK_GAMEDLL -};/* size: 312, cachelines: 5, members: 1 */ +}; // QUAKED trigger_once (.5 .5 .5) ? notouch // Variable sized trigger. Triggers once, then removes itself. You must set the key "target" to the name of another object in the level that has a matching @@ -422,15 +396,15 @@ public: class CTriggerOnce: public CTriggerMultiple { public: - virtual void Spawn(void); + virtual void Spawn(); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); #endif // HOOK_GAMEDLL -};/* size: 312, cachelines: 5, members: 1 */ +}; // QUAKED trigger_counter (.5 .5 .5) ? nomessage // Acts as an intermediary for an action that takes multiple inputs. @@ -442,15 +416,15 @@ public: class CTriggerCounter: public CBaseTrigger { public: - virtual void Spawn(void); + virtual void Spawn(); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); #endif // HOOK_GAMEDLL -};/* size: 312, cachelines: 5, members: 1 */ +}; // Derive from point entity so this doesn't move across levels @@ -458,15 +432,15 @@ public: class CTriggerVolume: public CPointEntity { public: - virtual void Spawn(void); + virtual void Spawn(); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); #endif // HOOK_GAMEDLL -};/* size: 152, cachelines: 3, members: 1 */ +}; // Fires a target after level transition and then dies @@ -474,23 +448,20 @@ public: class CFireAndDie: public CBaseDelay { public: - virtual void Spawn(void); - virtual void Precache(void); - virtual int ObjectCaps(void) // Always go across transitions - { - return (CBaseDelay::ObjectCaps() | FCAP_FORCE_TRANSITION); - } - virtual void Think(void); + virtual void Spawn(); + virtual void Precache(); + virtual int ObjectCaps() { return (CBaseDelay::ObjectCaps() | FCAP_FORCE_TRANSITION); } // Always go across transitions + virtual void Think(); #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); - void Think_(void); + void Spawn_(); + void Precache_(); + void Think_(); #endif // HOOK_GAMEDLL -};/* size: 160, cachelines: 3, members: 1 */ +}; // QUAKED trigger_changelevel (0.5 0.5 0.5) ? NO_INTERMISSION // When the player touches this, he gets sent to the map listed in the "map" variable. Unless the NO_INTERMISSION flag is set, the view will go to the info_intermission spot and display stats. @@ -499,14 +470,14 @@ public: class CChangeLevel: public CBaseTrigger { public: - virtual void Spawn(void); + virtual void Spawn(); virtual void KeyValue(KeyValueData *pkvd); virtual int Save(CSave &save); virtual int Restore(CRestore &restore); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); void KeyValue_(KeyValueData *pkvd); int Save_(CSave &save); int Restore_(CRestore &restore); @@ -515,8 +486,8 @@ public: public: void EXPORT UseChangeLevel(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); - NOXREF void EXPORT TriggerChangeLevel(void); - void EXPORT ExecuteChangeLevel(void); + NOXREF void EXPORT TriggerChangeLevel(); + void EXPORT ExecuteChangeLevel(); void EXPORT TouchChangeLevel(CBaseEntity *pOther); void ChangeLevelNow(CBaseEntity *pActivator); @@ -532,168 +503,161 @@ public: char m_szLandmarkName[ cchMapNameMost ]; // trigger_changelevel only: landmark on next map int m_changeTarget; float m_changeTargetDelay; - -};/* size: 384, cachelines: 6, members: 6 */ +}; /* <19e99d> ../cstrike/dlls/triggers.cpp:1753 */ class CLadder: public CBaseTrigger { 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: 312, cachelines: 5, members: 1 */ +}; /* <19e9f5> ../cstrike/dlls/triggers.cpp:1797 */ class CTriggerPush: public CBaseTrigger { public: - virtual void Spawn(void); + virtual void Spawn(); virtual void KeyValue(KeyValueData *pkvd); virtual void Touch(CBaseEntity *pOther); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); void KeyValue_(KeyValueData *pkvd); void Touch_(CBaseEntity *pOther); #endif // HOOK_GAMEDLL -};/* size: 312, cachelines: 5, members: 1 */ +}; /* <19ea4d> ../cstrike/dlls/triggers.cpp:1935 */ class CTriggerTeleport: public CBaseTrigger { public: - virtual void Spawn(void); + virtual void Spawn(); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); #endif // HOOK_GAMEDLL -};/* size: 312, cachelines: 5, members: 1 */ +}; /* <19eadb> ../cstrike/dlls/triggers.cpp:1962 */ class CBuyZone: public CBaseTrigger { public: - virtual void Spawn(void); + virtual void Spawn(); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); #endif // HOOK_GAMEDLL void EXPORT BuyTouch(CBaseEntity *pOther); - -};/* size: 312, cachelines: 5, members: 1 */ +}; /* <19eb2e> ../cstrike/dlls/triggers.cpp:2007 */ class CBombTarget: public CBaseTrigger { public: - virtual void Spawn(void); + virtual void Spawn(); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); #endif // HOOK_GAMEDLL public: void EXPORT BombTargetTouch(CBaseEntity *pOther); void EXPORT BombTargetUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); - -};/* size: 312, cachelines: 5, members: 1 */ +}; /* <19eb81> ../cstrike/dlls/triggers.cpp:2056 */ class CHostageRescue: public CBaseTrigger { public: - virtual void Spawn(void); + virtual void Spawn(); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); #endif // HOOK_GAMEDLL public: void EXPORT HostageRescueTouch(CBaseEntity *pOther); - -};/* size: 312, cachelines: 5, members: 1 */ +}; /* <19ebd9> ../cstrike/dlls/triggers.cpp:2098 */ class CEscapeZone: public CBaseTrigger { public: - virtual void Spawn(void); + virtual void Spawn(); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); #endif // HOOK_GAMEDLL void EXPORT EscapeTouch(CBaseEntity *pOther); - -};/* size: 312, cachelines: 5, members: 1 */ +}; /* <19ec2c> ../cstrike/dlls/triggers.cpp:2155 */ class CVIP_SafetyZone: public CBaseTrigger { public: - virtual void Spawn(void); + virtual void Spawn(); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); #endif // HOOK_GAMEDLL void EXPORT VIP_SafetyTouch(CBaseEntity *pOther); - -};/* size: 312, cachelines: 5, members: 1 */ +}; /* <19ec7f> ../cstrike/dlls/triggers.cpp:2198 */ class CTriggerSave: public CBaseTrigger { public: - virtual void Spawn(void); + virtual void Spawn(); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); #endif // HOOK_GAMEDLL void EXPORT SaveTouch(CBaseEntity *pOther); - -};/* size: 312, cachelines: 5, members: 1 */ +}; /* <19ecd2> ../cstrike/dlls/triggers.cpp:2234 */ class CTriggerEndSection: public CBaseTrigger { public: - virtual void Spawn(void); + virtual void Spawn(); virtual void KeyValue(KeyValueData *pkvd); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); void KeyValue_(KeyValueData *pkvd); #endif // HOOK_GAMEDLL @@ -701,24 +665,22 @@ public: public: void EXPORT EndSectionTouch(CBaseEntity *pOther); void EXPORT EndSectionUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); - -};/* size: 312, cachelines: 5, members: 1 */ +}; /* <19ed25> ../cstrike/dlls/triggers.cpp:2305 */ class CTriggerGravity: public CBaseTrigger { public: - virtual void Spawn(void); + virtual void Spawn(); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); #endif // HOOK_GAMEDLL void EXPORT GravityTouch(CBaseEntity *pOther); - -};/* size: 312, cachelines: 5, members: 1 */ +}; // this is a really bad idea. @@ -726,19 +688,16 @@ public: class CTriggerChangeTarget: public CBaseDelay { 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 Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); void KeyValue_(KeyValueData *pkvd); int Save_(CSave &save); int Restore_(CRestore &restore); @@ -751,26 +710,22 @@ public: private: int m_iszNewTarget; - -};/* size: 164, cachelines: 3, members: 3 */ +}; /* <19edd0> ../cstrike/dlls/triggers.cpp:2391 */ class CTriggerCamera: public CBaseDelay { 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 Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); void KeyValue_(KeyValueData *pkvd); int Save_(CSave &save); int Restore_(CRestore &restore); @@ -779,10 +734,9 @@ public: #endif // HOOK_GAMEDLL public: - void EXPORT FollowTarget(void); - void Move(void); + void EXPORT FollowTarget(); + void Move(); -public: static TYPEDESCRIPTION IMPL(m_SaveData)[13]; EHANDLE m_hPlayer; @@ -798,33 +752,32 @@ public: float m_acceleration; float m_deceleration; int m_state; - -};/* size: 220, cachelines: 4, members: 15 */ +}; /* <19ee23> ../cstrike/dlls/triggers.cpp:2693 */ class CWeather: public CBaseTrigger { public: - virtual void Spawn(void); + virtual void Spawn(); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); #endif // HOOK_GAMEDLL -};/* size: 312, cachelines: 5, members: 1 */ +}; /* <1a5b85> ../cstrike/dlls/triggers.cpp:2710 */ class CClientFog: public CBaseEntity { public: - virtual void Spawn(void); + virtual void Spawn(); virtual void KeyValue(KeyValueData *pkvd); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); void KeyValue_(KeyValueData *pkvd); #endif // HOOK_GAMEDLL @@ -833,62 +786,10 @@ public: int m_iStartDist; int m_iEndDist; float m_fDensity; - -};/* size: 164, cachelines: 3, members: 4 */ - -#ifdef HOOK_GAMEDLL - -#define st_szNextMap (*pst_szNextMap) -#define st_szNextSpot (*pst_szNextSpot) - -#endif // HOOK_GAMEDLL - -extern char st_szNextMap[cchMapNameMost]; -extern char st_szNextSpot[cchMapNameMost]; +}; void PlayCDTrack(int iTrack); int BuildChangeList(LEVELLIST * pLevelList, int maxList); -NOXREF void NextLevel(void); - -#ifdef HOOK_GAMEDLL - -// linked objects -C_DLLEXPORT void func_friction(entvars_t *pev); -C_DLLEXPORT void trigger_auto(entvars_t *pev); -C_DLLEXPORT void trigger_relay(entvars_t *pev); -C_DLLEXPORT void multi_manager(entvars_t *pev); -C_DLLEXPORT void env_render(entvars_t *pev); -C_DLLEXPORT void trigger(entvars_t *pev); -C_DLLEXPORT void trigger_hurt(entvars_t *pev); -C_DLLEXPORT void trigger_monsterjump(entvars_t *pev); -C_DLLEXPORT void trigger_cdaudio(entvars_t *pev); -C_DLLEXPORT void target_cdaudio(entvars_t *pev); -C_DLLEXPORT void trigger_multiple(entvars_t *pev); -C_DLLEXPORT void trigger_once(entvars_t *pev); -C_DLLEXPORT void trigger_counter(entvars_t *pev); -C_DLLEXPORT void trigger_transition(entvars_t *pev); -C_DLLEXPORT void fireanddie(entvars_t *pev); -C_DLLEXPORT void trigger_changelevel(entvars_t *pev); -C_DLLEXPORT void func_ladder(entvars_t *pev); -C_DLLEXPORT void trigger_push(entvars_t *pev); -C_DLLEXPORT void trigger_teleport(entvars_t *pev); -C_DLLEXPORT void info_teleport_destination(entvars_t *pev); -C_DLLEXPORT void func_buyzone(entvars_t *pev); -C_DLLEXPORT void func_bomb_target(entvars_t *pev); -C_DLLEXPORT void func_hostage_rescue(entvars_t *pev); -C_DLLEXPORT void func_escapezone(entvars_t *pev); -C_DLLEXPORT void func_vip_safetyzone(entvars_t *pev); -C_DLLEXPORT void trigger_autosave(entvars_t *pev); -C_DLLEXPORT void trigger_endsection(entvars_t *pev); -C_DLLEXPORT void trigger_gravity(entvars_t *pev); -C_DLLEXPORT void trigger_changetarget(entvars_t *pev); -C_DLLEXPORT void trigger_camera(entvars_t *pev); -C_DLLEXPORT void env_snow(entvars_t *pev); -C_DLLEXPORT void func_snow(entvars_t *pev); -C_DLLEXPORT void env_rain(entvars_t *pev); -C_DLLEXPORT void func_rain(entvars_t *pev); -C_DLLEXPORT void env_fog(entvars_t *pev); - -#endif // HOOK_GAMEDLL +NOXREF void NextLevel(); #endif // TRIGGERS_H diff --git a/regamedll/dlls/tutor.cpp b/regamedll/dlls/tutor.cpp index 408017ee..71cfe882 100644 --- a/regamedll/dlls/tutor.cpp +++ b/regamedll/dlls/tutor.cpp @@ -16,19 +16,6 @@ cvar_t cv_tutor_message_minimum_display_time = { "_tutor_message_minimum_display cvar_t cv_tutor_message_character_display_time_coefficient = { "_tutor_message_character_display_time_coefficient", "0.07", FCVAR_SERVER, 0.0f, NULL }; cvar_t cv_tutor_hint_interval_time = { "_tutor_hint_interval_time", "10.0", FCVAR_SERVER, 0.0f, NULL }; -#else - -cvar_t cv_tutor_message_repeats; -cvar_t cv_tutor_debug_level; -cvar_t cv_tutor_view_distance; -cvar_t cv_tutor_viewable_check_interval; -cvar_t cv_tutor_look_distance; -cvar_t cv_tutor_look_angle; -cvar_t cv_tutor_examine_time; -cvar_t cv_tutor_message_minimum_display_time; -cvar_t cv_tutor_message_character_display_time_coefficient; -cvar_t cv_tutor_hint_interval_time; - #endif // HOOK_GAMEDLL bool s_tutorDisabledThisGame; @@ -53,8 +40,13 @@ void InstallTutor(bool start) } /* <1dfde7> ../cstrike/dlls/tutor.cpp:51 */ -void Tutor_RegisterCVars(void) +void Tutor_RegisterCVars() { +#ifdef REGAMEDLL_FIXES + if (!g_bIsCzeroGame) + return; +#endif // REGAMEDLL_FIXES + CVAR_REGISTER(&cv_tutor_message_repeats); CVAR_REGISTER(&cv_tutor_debug_level); CVAR_REGISTER(&cv_tutor_view_distance); @@ -68,7 +60,7 @@ void Tutor_RegisterCVars(void) } /* <1dfdff> ../cstrike/dlls/tutor.cpp:66 */ -void MonitorTutorStatus(void) +void MonitorTutorStatus() { static cvar_t *tutor_enable = NULL; static bool tutor_enableCvarExists = true; diff --git a/regamedll/dlls/tutor.h b/regamedll/dlls/tutor.h index b6d90f6c..aa04aadd 100644 --- a/regamedll/dlls/tutor.h +++ b/regamedll/dlls/tutor.h @@ -32,27 +32,6 @@ #pragma once #endif -#ifdef HOOK_GAMEDLL - -#define s_tutorDisabledThisGame (*ps_tutorDisabledThisGame) -#define s_nextCvarCheckTime (*ps_nextCvarCheckTime) - -#define cv_tutor_message_repeats (*pcv_tutor_message_repeats) -#define cv_tutor_debug_level (*pcv_tutor_debug_level) -#define cv_tutor_view_distance (*pcv_tutor_view_distance) -#define cv_tutor_viewable_check_interval (*pcv_tutor_viewable_check_interval) -#define cv_tutor_look_distance (*pcv_tutor_look_distance) -#define cv_tutor_look_angle (*pcv_tutor_look_angle) -#define cv_tutor_examine_time (*pcv_tutor_examine_time) -#define cv_tutor_message_minimum_display_time (*pcv_tutor_message_minimum_display_time) -#define cv_tutor_message_character_display_time_coefficient (*pcv_tutor_message_character_display_time_coefficient) -#define cv_tutor_hint_interval_time (*pcv_tutor_hint_interval_time) - -#endif // HOOK_GAMEDLL - -extern bool s_tutorDisabledThisGame; -extern float s_nextCvarCheckTime; - extern cvar_t cv_tutor_message_repeats; extern cvar_t cv_tutor_debug_level; extern cvar_t cv_tutor_view_distance; @@ -65,7 +44,7 @@ extern cvar_t cv_tutor_message_character_display_time_coefficient; extern cvar_t cv_tutor_hint_interval_time; void InstallTutor(bool start); -void Tutor_RegisterCVars(void); -void MonitorTutorStatus(void); +void Tutor_RegisterCVars(); +void MonitorTutorStatus(); #endif // TUTOR_H diff --git a/regamedll/dlls/tutor_base_states.cpp b/regamedll/dlls/tutor_base_states.cpp index f499bf3a..94193e4a 100644 --- a/regamedll/dlls/tutor_base_states.cpp +++ b/regamedll/dlls/tutor_base_states.cpp @@ -1,19 +1,19 @@ #include "precompiled.h" -/* <21bf94> ../cstrike/dlls/tutor_base_states.cpp:6 */ -CBaseTutorStateSystem::CBaseTutorStateSystem(void) -{ - ; +/* <21bf94> ../cstrike/dlls/tutor_base_states.cpp:6 */ +CBaseTutorStateSystem::CBaseTutorStateSystem() +{ + ; } /* <21bec7> ../cstrike/dlls/tutor_base_states.cpp:10 */ -CBaseTutorStateSystem::~CBaseTutorStateSystem(void) +CBaseTutorStateSystem::~CBaseTutorStateSystem() { ; } /* <21bfb5> ../cstrike/dlls/tutor_base_states.cpp:14 */ -int CBaseTutorStateSystem::GetCurrentStateType(void) +int CBaseTutorStateSystem::GetCurrentStateType() const { if (m_currentState != NULL) { @@ -24,19 +24,19 @@ int CBaseTutorStateSystem::GetCurrentStateType(void) } /* <21c00d> ../cstrike/dlls/tutor_base_states.cpp:28 */ -CBaseTutorState::CBaseTutorState(void) +CBaseTutorState::CBaseTutorState() { ; } /* <21bcc6> ../cstrike/dlls/tutor_base_states.cpp:32 */ -CBaseTutorState::~CBaseTutorState(void) +CBaseTutorState::~CBaseTutorState() { ; } /* <21c02e> ../cstrike/dlls/tutor_base_states.cpp:36 */ -int CBaseTutorState::GetType(void) +int CBaseTutorState::GetType() const { return m_type; } diff --git a/regamedll/dlls/tutor_base_states.h b/regamedll/dlls/tutor_base_states.h index a8c8d248..ab56e6d0 100644 --- a/regamedll/dlls/tutor_base_states.h +++ b/regamedll/dlls/tutor_base_states.h @@ -35,36 +35,34 @@ class CBaseTutorState { public: - CBaseTutorState(void); + CBaseTutorState(); - virtual ~CBaseTutorState(void); + virtual ~CBaseTutorState(); virtual int CheckForStateTransition(GameEventType event, CBaseEntity *entity, CBaseEntity *other) = 0; - virtual char *GetStateString(void) = 0; + virtual char *GetStateString() = 0; public: - int GetType(void); + int GetType() const; protected: int m_type; - -};/* size: 8, cachelines: 1, members: 2 */ +}; class CBaseTutorStateSystem { public: - CBaseTutorStateSystem(void); + CBaseTutorStateSystem(); - virtual ~CBaseTutorStateSystem(void); + virtual ~CBaseTutorStateSystem(); virtual bool UpdateState(GameEventType event, CBaseEntity *entity, CBaseEntity *other) = 0; - virtual char *GetCurrentStateString(void) = 0; + virtual char *GetCurrentStateString() = 0; virtual CBaseTutorState *ConstructNewState(int stateType) = 0; public: - int GetCurrentStateType(void); + int GetCurrentStateType() const; protected: CBaseTutorState *m_currentState; - -};/* size: 8, cachelines: 1, members: 2 */ +}; #endif // TUTOR_BASE_STATES_H diff --git a/regamedll/dlls/tutor_base_tutor.cpp b/regamedll/dlls/tutor_base_tutor.cpp index 2c95f705..5e6fc4bf 100644 --- a/regamedll/dlls/tutor_base_tutor.cpp +++ b/regamedll/dlls/tutor_base_tutor.cpp @@ -17,7 +17,7 @@ TutorMessageEvent::TutorMessageEvent(int mid, int duplicateID, float time, float } /* <1f4d07> ../cstrike/dlls/tutor_base_tutor.cpp:34 */ -TutorMessageEvent::~TutorMessageEvent(void) +TutorMessageEvent::~TutorMessageEvent() { ; } @@ -29,7 +29,7 @@ bool TutorMessageEvent::IsActive(float time) } /* <1f54da> ../cstrike/dlls/tutor_base_tutor.cpp:48 */ -int TutorMessageEvent::GetPriority(void) +int TutorMessageEvent::GetPriority() { return m_priority; } @@ -47,13 +47,13 @@ void TutorMessageEvent::SetActivationTime(float time) } /* <1f5568> ../cstrike/dlls/tutor_base_tutor.cpp:63 */ -int TutorMessageEvent::GetID(void) +int TutorMessageEvent::GetID() { return m_messageID; } /* <1f5589> ../cstrike/dlls/tutor_base_tutor.cpp:68 */ -int TutorMessageEvent::GetDuplicateID(void) +int TutorMessageEvent::GetDuplicateID() { return m_duplicateID; } @@ -65,7 +65,7 @@ void TutorMessageEvent::SetNext(TutorMessageEvent *next) } /* <1f55e3> ../cstrike/dlls/tutor_base_tutor.cpp:78 */ -TutorMessageEvent *TutorMessageEvent::GetNext(void) +TutorMessageEvent *TutorMessageEvent::GetNext() { return m_next; } @@ -127,13 +127,13 @@ char *TutorMessageEvent::GetNextParameter(char *buf, int buflen) } /* <1f569e> ../cstrike/dlls/tutor_base_tutor.cpp:136 */ -int TutorMessageEvent::GetNumParameters(void) +int TutorMessageEvent::GetNumParameters() { return m_numParameters; } /* <1f56d8> ../cstrike/dlls/tutor_base_tutor.cpp:144 */ -CBaseTutor::CBaseTutor(void) +CBaseTutor::CBaseTutor() { m_eventList = NULL; m_deadAirStartTime = 0; @@ -141,7 +141,7 @@ CBaseTutor::CBaseTutor(void) } /* <1f4d28> ../cstrike/dlls/tutor_base_tutor.cpp:152 */ -CBaseTutor::~CBaseTutor(void) +CBaseTutor::~CBaseTutor() { TutorMessageEvent *event = m_eventList; @@ -196,7 +196,7 @@ void CBaseTutor::DisplayMessageToPlayer(CBasePlayer *player, int id, const char WRITE_STRING(szMessage); WRITE_BYTE(numArgs); - for (int arg = 0; arg < numArgs; arg++) + for (int arg = 0; arg < numArgs; ++arg) { char *str = event->GetNextParameter(param, sizeof(param)); @@ -252,7 +252,7 @@ NOXREF void CBaseTutor::DrawLineToEntity(CBasePlayer *player, int entindex, int } /* <1f5b4f> ../cstrike/dlls/tutor_base_tutor.cpp:275 */ -void CBaseTutor::DisplayNewStateDescriptionToPlayer(void) +void CBaseTutor::DisplayNewStateDescriptionToPlayer() { CBasePlayer *localPlayer = UTIL_GetLocalPlayer(); @@ -272,7 +272,7 @@ void CBaseTutor::DisplayNewStateDescriptionToPlayer(void) } /* <1f5bb4> ../cstrike/dlls/tutor_base_tutor.cpp:293 */ -void CBaseTutor::CloseCurrentWindow(void) +void CBaseTutor::CloseCurrentWindow() { CBasePlayer *localPlayer = (CBasePlayer *)UTIL_GetLocalPlayer(); @@ -449,32 +449,3 @@ bool CBaseTutor::DoMessagesHaveSameID(int id1, int id2) return false; } - -#ifdef HOOK_GAMEDLL - -bool CBaseTutor::IsEntityInViewOfPlayer(CBaseEntity *entity, CBasePlayer *player) -{ - return IsEntityInViewOfPlayer_(entity, player); -} - -bool CBaseTutor::IsBombsiteInViewOfPlayer(CBaseEntity *entity, CBasePlayer *player) -{ - return IsBombsiteInViewOfPlayer_(entity, player); -} - -bool CBaseTutor::IsEntityInBombsite(CBaseEntity *bombsite, CBaseEntity *entity) -{ - return IsEntityInBombsite_(bombsite, entity); -} - -bool CBaseTutor::IsPlayerLookingAtPosition(Vector *origin, CBasePlayer *player) -{ - return IsPlayerLookingAtPosition_(origin, player); -} - -bool CBaseTutor::IsPlayerLookingAtEntity(CBaseEntity *entity, CBasePlayer *player) -{ - return IsPlayerLookingAtEntity_(entity, player); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/tutor_base_tutor.h b/regamedll/dlls/tutor_base_tutor.h index 6ee8c1d6..20ac3865 100644 --- a/regamedll/dlls/tutor_base_tutor.h +++ b/regamedll/dlls/tutor_base_tutor.h @@ -36,19 +36,19 @@ class TutorMessageEvent { public: TutorMessageEvent(int mid, int duplicateID, float time, float lifetime, int priority); - virtual ~TutorMessageEvent(void); + virtual ~TutorMessageEvent(); bool IsActive(float time); - int GetPriority(void); + int GetPriority(); float GetTimeActive(float time); void SetActivationTime(float time); - int GetID(void); - int GetDuplicateID(void); + int GetID(); + int GetDuplicateID(); void AddParameter(char *str); char *GetNextParameter(char *buf, int buflen); - int GetNumParameters(void); + int GetNumParameters(); void SetNext(TutorMessageEvent *next); - TutorMessageEvent *GetNext(void); + TutorMessageEvent *GetNext(); private: int m_messageID; @@ -59,17 +59,16 @@ private: int m_numParameters; struct TutorMessageEventParam *m_paramList; TutorMessageEvent *m_next; - -};/* size: 36, cachelines: 1, members: 9 */ +}; class CBaseTutor { public: - CBaseTutor(void); - virtual ~CBaseTutor(void); + CBaseTutor(); + virtual ~CBaseTutor(); virtual void TutorThink(float time) = 0; - virtual void PurgeMessages(void) = 0; + virtual void PurgeMessages() = 0; virtual void CallEventHandler(GameEventType event, CBaseEntity *entity, CBaseEntity *other) = 0; virtual void ShowTutorMessage(TutorMessageEvent *event) = 0; @@ -99,8 +98,8 @@ public: void ShotFired(Vector source, Vector target); void DisplayMessageToPlayer(CBasePlayer *player, int id, const char *szMessage, TutorMessageEvent *event); NOXREF void DrawLineToEntity(CBasePlayer *player, int entindex, int id); - void DisplayNewStateDescriptionToPlayer(void); - void CloseCurrentWindow(void); + void DisplayNewStateDescriptionToPlayer(); + void CloseCurrentWindow(); void CheckForStateTransition(GameEventType event, CBaseEntity *entity, CBaseEntity *other); void CalculatePathForObjective(CBaseEntity *player); bool DoMessagesHaveSameID(int id1, int id2); @@ -110,14 +109,7 @@ protected: TutorMessageEvent *m_eventList; float m_deadAirStartTime; float m_roundStartTime; - -};/* size: 20, cachelines: 1, members: 5 */ - -#ifdef HOOK_GAMEDLL - -#define TheTutor (*pTheTutor) - -#endif // HOOK_GAMEDLL +}; extern CBaseTutor *TheTutor; diff --git a/regamedll/dlls/tutor_cs_states.cpp b/regamedll/dlls/tutor_cs_states.cpp index aa0f7774..88ee6dfe 100644 --- a/regamedll/dlls/tutor_cs_states.cpp +++ b/regamedll/dlls/tutor_cs_states.cpp @@ -28,20 +28,17 @@ char *const g_TutorStateStrings[20] = "#Cstrike_TutorState_Buy_Time", "#Cstrike_TutorState_Waiting_For_Start" }; -#else - -char *const g_TutorStateStrings[20]; #endif // HOOK_GAMEDLL /* <22bf8e> ../cstrike/dlls/tutor_cs_states.cpp:53 */ -CCSTutorStateSystem::CCSTutorStateSystem(void) +CCSTutorStateSystem::CCSTutorStateSystem() { m_currentState = new CCSTutorUndefinedState; } /* <22bd56> ../cstrike/dlls/tutor_cs_states.cpp:58 */ -CCSTutorStateSystem::~CCSTutorStateSystem(void) +CCSTutorStateSystem::~CCSTutorStateSystem() { if (m_currentState != NULL) { @@ -80,7 +77,7 @@ bool CCSTutorStateSystem::__MAKE_VHOOK(UpdateState)(GameEventType event, CBaseEn } /* <22b96f> ../cstrike/dlls/tutor_cs_states.cpp:108 */ -char *CCSTutorStateSystem::__MAKE_VHOOK(GetCurrentStateString)(void) +char *CCSTutorStateSystem::__MAKE_VHOOK(GetCurrentStateString)() { if (m_currentState != NULL) { @@ -115,13 +112,13 @@ CBaseTutorState *CCSTutorStateSystem::__MAKE_VHOOK(ConstructNewState)(int stateT } /* <22bfcb> ../cstrike/dlls/tutor_cs_states.cpp:141 */ -CCSTutorUndefinedState::CCSTutorUndefinedState(void) +CCSTutorUndefinedState::CCSTutorUndefinedState() { m_type = 0; } /* <22bb33> ../cstrike/dlls/tutor_cs_states.cpp:146 */ -CCSTutorUndefinedState::~CCSTutorUndefinedState(void) +CCSTutorUndefinedState::~CCSTutorUndefinedState() { ; } @@ -129,14 +126,12 @@ CCSTutorUndefinedState::~CCSTutorUndefinedState(void) /* <22bdd8> ../cstrike/dlls/tutor_cs_states.cpp:150 */ int CCSTutorUndefinedState::__MAKE_VHOOK(CheckForStateTransition)(GameEventType event, CBaseEntity *entity, CBaseEntity *other) { - int ret = 0; - if (event == EVENT_PLAYER_SPAWNED) { - ret = HandlePlayerSpawned(entity, other); + return HandlePlayerSpawned(entity, other); } - return ret; + return 0; } /* <22bfed> ../cstrike/dlls/tutor_cs_states.cpp:163 */ @@ -146,7 +141,7 @@ int CCSTutorUndefinedState::HandlePlayerSpawned(CBaseEntity *entity, CBaseEntity if (localPlayer != NULL) { - CBasePlayer *player = reinterpret_cast(entity); + CBasePlayer *player = static_cast(entity); if (player != NULL && player->IsPlayer() && player == localPlayer) { @@ -159,19 +154,19 @@ int CCSTutorUndefinedState::HandlePlayerSpawned(CBaseEntity *entity, CBaseEntity } /* <22b995> ../cstrike/dlls/tutor_cs_states.cpp:190 */ -char *CCSTutorUndefinedState::__MAKE_VHOOK(GetStateString)(void) +char *CCSTutorUndefinedState::__MAKE_VHOOK(GetStateString)() { return NULL; } /* <22c03e> ../cstrike/dlls/tutor_cs_states.cpp:198 */ -CCSTutorWaitingForStartState::CCSTutorWaitingForStartState(void) +CCSTutorWaitingForStartState::CCSTutorWaitingForStartState() { m_type = (TUTORMESSAGETYPE_ENEMY_DEATH | TUTORMESSAGETYPE_BUY); } /* <22bab6> ../cstrike/dlls/tutor_cs_states.cpp:203 */ -CCSTutorWaitingForStartState::~CCSTutorWaitingForStartState(void) +CCSTutorWaitingForStartState::~CCSTutorWaitingForStartState() { ; } @@ -179,23 +174,19 @@ CCSTutorWaitingForStartState::~CCSTutorWaitingForStartState(void) /* <22beca> ../cstrike/dlls/tutor_cs_states.cpp:207 */ int CCSTutorWaitingForStartState::__MAKE_VHOOK(CheckForStateTransition)(GameEventType event, CBaseEntity *entity, CBaseEntity *other) { - int ret = 0; - switch (event) { case EVENT_PLAYER_SPAWNED: - ret = HandlePlayerSpawned(entity, other); - break; + return HandlePlayerSpawned(entity, other); case EVENT_BUY_TIME_START: - ret = HandleBuyTimeStart(entity, other); - break; + return HandleBuyTimeStart(entity, other); } - return ret; + return 0; } /* <22b9bb> ../cstrike/dlls/tutor_cs_states.cpp:224 */ -char *CCSTutorWaitingForStartState::__MAKE_VHOOK(GetStateString)(void) +char *CCSTutorWaitingForStartState::__MAKE_VHOOK(GetStateString)() { return g_TutorStateStrings[m_type]; } @@ -207,7 +198,7 @@ int CCSTutorWaitingForStartState::HandlePlayerSpawned(CBaseEntity *entity, CBase if (localPlayer != NULL) { - CBasePlayer *player = reinterpret_cast(entity); + CBasePlayer *player = static_cast(entity); if (player != NULL && player->IsPlayer() && player == localPlayer) { @@ -226,13 +217,13 @@ int CCSTutorWaitingForStartState::HandleBuyTimeStart(CBaseEntity *entity, CBaseE } /* <22c0e2> ../cstrike/dlls/tutor_cs_states.cpp:266 */ -CCSTutorBuyMenuState::CCSTutorBuyMenuState(void) +CCSTutorBuyMenuState::CCSTutorBuyMenuState() { m_type = (TUTORMESSAGETYPE_DEFAULT | TUTORMESSAGETYPE_FRIEND_DEATH | TUTORMESSAGETYPE_BUY); } /* <22ba5a> ../cstrike/dlls/tutor_cs_states.cpp:271 */ -CCSTutorBuyMenuState::~CCSTutorBuyMenuState(void) +CCSTutorBuyMenuState::~CCSTutorBuyMenuState() { ; } @@ -249,7 +240,7 @@ int CCSTutorBuyMenuState::__MAKE_VHOOK(CheckForStateTransition)(GameEventType ev } /* <22ba34> ../cstrike/dlls/tutor_cs_states.cpp:288 */ -char *CCSTutorBuyMenuState::__MAKE_VHOOK(GetStateString)(void) +char *CCSTutorBuyMenuState::__MAKE_VHOOK(GetStateString)() { return g_TutorStateStrings[m_type]; } @@ -259,52 +250,3 @@ int CCSTutorBuyMenuState::HandleRoundStart(CBaseEntity *entity, CBaseEntity *oth { return TUTOR_STATE_FLAG_1; } - -#ifdef HOOK_GAMEDLL - -bool CCSTutorStateSystem::UpdateState(GameEventType event, CBaseEntity *entity, CBaseEntity *other) -{ - return UpdateState_(event, entity, other); -} - -char *CCSTutorStateSystem::GetCurrentStateString(void) -{ - return GetCurrentStateString_(); -} - -CBaseTutorState *CCSTutorStateSystem::ConstructNewState(int stateType) -{ - return ConstructNewState_(stateType); -} - -int CCSTutorUndefinedState::CheckForStateTransition(GameEventType event, CBaseEntity *entity, CBaseEntity *other) -{ - return CheckForStateTransition_(event, entity, other); -} - -char *CCSTutorUndefinedState::GetStateString(void) -{ - return GetStateString_(); -} - -int CCSTutorWaitingForStartState::CheckForStateTransition(GameEventType event, CBaseEntity *entity, CBaseEntity *other) -{ - return CheckForStateTransition_(event, entity, other); -} - -char *CCSTutorWaitingForStartState::GetStateString(void) -{ - return GetStateString_(); -} - -int CCSTutorBuyMenuState::CheckForStateTransition(GameEventType event, CBaseEntity *entity, CBaseEntity *other) -{ - return CheckForStateTransition_(event, entity, other); -} - -char *CCSTutorBuyMenuState::GetStateString(void) -{ - return GetStateString_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/tutor_cs_states.h b/regamedll/dlls/tutor_cs_states.h index 61ac6a01..4affc1b4 100644 --- a/regamedll/dlls/tutor_cs_states.h +++ b/regamedll/dlls/tutor_cs_states.h @@ -65,99 +65,86 @@ enum TutorStateType class CCSTutorStateSystem: public CBaseTutorStateSystem { public: - CCSTutorStateSystem(void); + CCSTutorStateSystem(); - virtual ~CCSTutorStateSystem(void); + virtual ~CCSTutorStateSystem(); virtual bool UpdateState(GameEventType event, CBaseEntity *entity, CBaseEntity *other); - virtual char *GetCurrentStateString(void); + virtual char *GetCurrentStateString(); #ifdef HOOK_GAMEDLL bool UpdateState_(GameEventType event, CBaseEntity *entity, CBaseEntity *other); - char *GetCurrentStateString_(void); + char *GetCurrentStateString_(); CBaseTutorState *ConstructNewState_(int stateType); #endif // HOOK_GAMEDLL protected: virtual CBaseTutorState *ConstructNewState(int stateType); - -};/* size: 8, cachelines: 1, members: 1 */ +}; /* <22bfcb> ../cstrike/dlls/tutor_cs_states.cpp:141 */ class CCSTutorUndefinedState: public CBaseTutorState { public: - CCSTutorUndefinedState(void); + CCSTutorUndefinedState(); - virtual ~CCSTutorUndefinedState(void); + virtual ~CCSTutorUndefinedState(); virtual int CheckForStateTransition(GameEventType event, CBaseEntity *entity, CBaseEntity *other); - virtual char *GetStateString(void); + virtual char *GetStateString(); #ifdef HOOK_GAMEDLL int CheckForStateTransition_(GameEventType event, CBaseEntity *entity, CBaseEntity *other); - char *GetStateString_(void); + char *GetStateString_(); #endif // HOOK_GAMEDLL protected: int HandlePlayerSpawned(CBaseEntity *entity, CBaseEntity *other); - -};/* size: 8, cachelines: 1, members: 1 */ +}; /* <22c03e> ../cstrike/dlls/tutor_cs_states.cpp:198 */ class CCSTutorWaitingForStartState: public CBaseTutorState { public: - CCSTutorWaitingForStartState(void); + CCSTutorWaitingForStartState(); - virtual ~CCSTutorWaitingForStartState(void); + virtual ~CCSTutorWaitingForStartState(); virtual int CheckForStateTransition(GameEventType event, CBaseEntity *entity, CBaseEntity *other); - virtual char *GetStateString(void); + virtual char *GetStateString(); #ifdef HOOK_GAMEDLL int CheckForStateTransition_(GameEventType event, CBaseEntity *entity, CBaseEntity *other); - char *GetStateString_(void); + char *GetStateString_(); #endif // HOOK_GAMEDLL protected: - int HandlePlayerSpawned(CBaseEntity *entity, CBaseEntity *other); int HandleBuyTimeStart(CBaseEntity *entity, CBaseEntity *other); - -};/* size: 8, cachelines: 1, members: 1 */ +}; /* <22c0e2> ../cstrike/dlls/tutor_cs_states.cpp:266 */ class CCSTutorBuyMenuState: public CBaseTutorState { public: - CCSTutorBuyMenuState(void); + CCSTutorBuyMenuState(); - virtual ~CCSTutorBuyMenuState(void); + virtual ~CCSTutorBuyMenuState(); virtual int CheckForStateTransition(GameEventType event, CBaseEntity *entity, CBaseEntity *other); - virtual char *GetStateString(void); + virtual char *GetStateString(); #ifdef HOOK_GAMEDLL int CheckForStateTransition_(GameEventType event, CBaseEntity *entity, CBaseEntity *other); - char *GetStateString_(void); + char *GetStateString_(); #endif // HOOK_GAMEDLL protected: int HandleRoundStart(CBaseEntity *entity, CBaseEntity *other); - -};/* size: 8, cachelines: 1, members: 1 */ - -#ifdef HOOK_GAMEDLL - -#define g_TutorStateStrings (*pg_TutorStateStrings) - -#endif // HOOK_GAMEDLL - -extern char *const g_TutorStateStrings[20]; +}; #endif // TUTOR_CS_STATES_H diff --git a/regamedll/dlls/tutor_cs_tutor.cpp b/regamedll/dlls/tutor_cs_tutor.cpp index 282002a9..f21505d3 100644 --- a/regamedll/dlls/tutor_cs_tutor.cpp +++ b/regamedll/dlls/tutor_cs_tutor.cpp @@ -159,14 +159,10 @@ const char *TutorIdentifierList[] = "INGAME_HINT_3" }; -#else // HOOK_GAMEDLL - -const char *TutorIdentifierList[ TUTOR_NUM_MESSAGES ]; - #endif // HOOK_GAMEDLL /* <212575> ../cstrike/dlls/tutor_cs_tutor.cpp:197 */ -CCSTutor::CCSTutor(void) +CCSTutor::CCSTutor() { m_stateSystem = new CCSTutorStateSystem; @@ -185,7 +181,7 @@ CCSTutor::CCSTutor(void) } /* <217e69> ../cstrike/dlls/tutor_cs_tutor.cpp:221 */ -CCSTutor::~CCSTutor(void) +CCSTutor::~CCSTutor() { if (m_stateSystem != NULL) { @@ -385,7 +381,7 @@ void ReadDefaultValues(char *&messageData, TutorMessage *defaults) } /* <21164e> ../cstrike/dlls/tutor_cs_tutor.cpp:436 */ -void CCSTutor::ReadTutorMessageFile(void) +void CCSTutor::ReadTutorMessageFile() { int messageFileLen = 0; @@ -397,7 +393,7 @@ void CCSTutor::ReadTutorMessageFile(void) if (!messageFile) { - if (UTIL_IsGame("czero")) + if (g_bIsCzeroGame) { CONSOLE_ECHO("Warning: Cannot access tutor message file tutordata.txt\n"); } @@ -448,7 +444,7 @@ void CCSTutor::ReadTutorMessageFile(void) } /* <2126f8> ../cstrike/dlls/tutor_cs_tutor.cpp:491 */ -void CCSTutor::ApplyPersistentDecay(void) +void CCSTutor::ApplyPersistentDecay() { for (TutorMessageID mid = YOU_FIRED_A_SHOT; mid < TUTOR_NUM_MESSAGES; mid++) { @@ -639,7 +635,7 @@ void CCSTutor::CheckForWindowClose(float time) } /* <2134a7> ../cstrike/dlls/tutor_cs_tutor.cpp:715 */ -void CCSTutor::CheckForContentUpdate(void) +void CCSTutor::CheckForContentUpdate() { if (m_currentlyShownMessageID < 0 || m_currentlyShownMessageID >= 150) { @@ -712,7 +708,7 @@ void CCSTutor::ProcessShownDeathsForEvent(TutorMessageEvent *event) } /* <212949> ../cstrike/dlls/tutor_cs_tutor.cpp:794 */ -TutorMessageEvent *CCSTutor::GetTutorMessageUpdateEvent(void) +TutorMessageEvent *CCSTutor::GetTutorMessageUpdateEvent() { TutorMessage *definition = GetTutorMessageDefinition(m_currentlyShownMessageID); @@ -1057,7 +1053,7 @@ void CCSTutor::DeleteEventFromEventList(TutorMessageEvent *event) } /* <213215> ../cstrike/dlls/tutor_cs_tutor.cpp:1163 */ -void CCSTutor::ClearEventList(void) +void CCSTutor::ClearEventList() { while (m_eventList != NULL) { @@ -1086,7 +1082,7 @@ void CCSTutor::DeleteEvent(TutorMessageEvent *event) } /* <210a17> ../cstrike/dlls/tutor_cs_tutor.cpp:1189 */ -void CCSTutor::__MAKE_VHOOK(PurgeMessages)(void) +void CCSTutor::__MAKE_VHOOK(PurgeMessages)() { ClearCurrentEvent(); ClearEventList(); @@ -1099,7 +1095,7 @@ void CCSTutor::__MAKE_VHOOK(PurgeMessages)(void) } /* <2132ca> ../cstrike/dlls/tutor_cs_tutor.cpp:1203 */ -void CCSTutor::ComputeDisplayTimesForMessage(void) +void CCSTutor::ComputeDisplayTimesForMessage() { TutorMessage *message = GetTutorMessageDefinition(m_currentlyShownMessageID); float now = gpGlobals->time; @@ -1206,7 +1202,7 @@ void CCSTutor::__MAKE_VHOOK(ShowTutorMessage)(TutorMessageEvent *event) } /* <2135cc> ../cstrike/dlls/tutor_cs_tutor.cpp:1324 */ -void CCSTutor::ConstructMessageAndDisplay(void) +void CCSTutor::ConstructMessageAndDisplay() { CBasePlayer *localPlayer = UTIL_GetLocalPlayer(); @@ -1429,7 +1425,7 @@ void CCSTutor::HandleWeaponFiredOnEmpty(CBaseEntity *entity, CBaseEntity *other) if (player != NULL && player->IsPlayer() && player == localPlayer) { - CBasePlayerWeapon *currentWeapon = reinterpret_cast(player->m_pActiveItem); + CBasePlayerWeapon *currentWeapon = static_cast(player->m_pActiveItem); if (currentWeapon != NULL && player->m_rgAmmo[currentWeapon->m_iPrimaryAmmoType] <= 0) { @@ -2384,7 +2380,7 @@ void CCSTutor::GetNumPlayersAliveOnTeams(int &numT, int &numCT) } /* <2150d5> ../cstrike/dlls/tutor_cs_tutor.cpp:2749 */ -void CCSTutor::CheckForLooseWeaponViewable(void) +void CCSTutor::CheckForLooseWeaponViewable() { CBasePlayer *localPlayer = UTIL_GetLocalPlayer(); @@ -2412,7 +2408,7 @@ void CCSTutor::CheckForLooseWeaponViewable(void) } /* <21514d> ../cstrike/dlls/tutor_cs_tutor.cpp:2787 */ -void CCSTutor::CheckForLooseDefuserViewable(void) +void CCSTutor::CheckForLooseDefuserViewable() { CBasePlayer *localPlayer = UTIL_GetLocalPlayer(); @@ -2440,7 +2436,7 @@ void CCSTutor::CheckForLooseDefuserViewable(void) } /* <2151c1> ../cstrike/dlls/tutor_cs_tutor.cpp:2826 */ -void CCSTutor::CheckForBombViewable(void) +void CCSTutor::CheckForBombViewable() { CBasePlayer *localPlayer = UTIL_GetLocalPlayer(); @@ -2556,7 +2552,7 @@ void CCSTutor::CheckForBombViewable(void) } /* <215431> ../cstrike/dlls/tutor_cs_tutor.cpp:2959 */ -void CCSTutor::CheckForBombsiteViewable(void) +void CCSTutor::CheckForBombsiteViewable() { CBasePlayer *localPlayer = UTIL_GetLocalPlayer(); @@ -2632,7 +2628,7 @@ void CCSTutor::CheckForBombsiteViewable(void) } /* <21534e> ../cstrike/dlls/tutor_cs_tutor.cpp:3026 */ -TutorMessageID CCSTutor::CheckForInBombZone(void) +TutorMessageID CCSTutor::CheckForInBombZone() { CBasePlayer *localPlayer = UTIL_GetLocalPlayer(); TutorMessageID mid = TUTOR_NUM_MESSAGES; @@ -2678,7 +2674,7 @@ bool CCSTutor::IsBombPlantedInBombsite(CBaseEntity *bombTarget) } /* <2154f4> ../cstrike/dlls/tutor_cs_tutor.cpp:3102 */ -void CCSTutor::CheckForHostageViewable(void) +void CCSTutor::CheckForHostageViewable() { CBasePlayer *localPlayer = UTIL_GetLocalPlayer(); @@ -2735,7 +2731,7 @@ void CCSTutor::CheckForHostageViewable(void) } /* <215646> ../cstrike/dlls/tutor_cs_tutor.cpp:3168 */ -void CCSTutor::CheckForTimeRunningOut(void) +void CCSTutor::CheckForTimeRunningOut() { CBasePlayer *localPlayer = UTIL_GetLocalPlayer(); CHalfLifeMultiplay *mpRules = g_pGameRules; @@ -2772,7 +2768,7 @@ void CCSTutor::CheckForTimeRunningOut(void) } /* <2156fd> ../cstrike/dlls/tutor_cs_tutor.cpp:3218 */ -void CCSTutor::CheckForAllHostagesDead(void) +void CCSTutor::CheckForAllHostagesDead() { bool foundLiveOne = false; CHostage *hostage = NULL; @@ -2793,7 +2789,7 @@ void CCSTutor::CheckForAllHostagesDead(void) } /* <21573c> ../cstrike/dlls/tutor_cs_tutor.cpp:3242 */ -bool CCSTutor::CheckForAllHostagesFollowingSomeone(void) +bool CCSTutor::CheckForAllHostagesFollowingSomeone() { bool foundUnusedOne = false; CHostage *hostage = NULL; @@ -3012,7 +3008,7 @@ void CCSTutor::CheckForNeedToReload(bool isPassiveCheck) return; } - currentWeapon = reinterpret_cast(currentItem); + currentWeapon = static_cast(currentItem); currentWeapon->GetItemInfo(&itemInfo); if (itemInfo.iSlot && itemInfo.iSlot != 1) @@ -3163,7 +3159,7 @@ void CCSTutor::CheckExamineMessages(float time) } /* <215eec> ../cstrike/dlls/tutor_cs_tutor.cpp:3696 */ -bool CCSTutor::CanLocalPlayerBuyStuff(void) +bool CCSTutor::CanLocalPlayerBuyStuff() { CBasePlayer *localPlayer = UTIL_GetLocalPlayer(); @@ -3176,7 +3172,7 @@ bool CCSTutor::CanLocalPlayerBuyStuff(void) } /* <215f25> ../cstrike/dlls/tutor_cs_tutor.cpp:3714 */ -void CCSTutor::CheckBuyZoneMessages(void) +void CCSTutor::CheckBuyZoneMessages() { CBasePlayer *localPlayer = UTIL_GetLocalPlayer(); @@ -3185,8 +3181,8 @@ void CCSTutor::CheckBuyZoneMessages(void) return; } - CBasePlayerWeapon *primary = reinterpret_cast(localPlayer->m_rgpPlayerItems[PRIMARY_WEAPON_SLOT]); - CBasePlayerWeapon *secondary = reinterpret_cast(localPlayer->m_rgpPlayerItems[PISTOL_SLOT]); + CBasePlayerWeapon *primary = static_cast(localPlayer->m_rgpPlayerItems[PRIMARY_WEAPON_SLOT]); + CBasePlayerWeapon *secondary = static_cast(localPlayer->m_rgpPlayerItems[PISTOL_SLOT]); if (primary != NULL) { @@ -3226,13 +3222,13 @@ void CCSTutor::CheckBuyZoneMessages(void) } /* <216cdd> ../cstrike/dlls/tutor_cs_tutor.cpp:3767 */ -bool CCSTutor::IsHostageMap(void) +bool CCSTutor::IsHostageMap() { return UTIL_FindEntityByClassname(NULL, "hostage_entity") != NULL; } /* <216d01> ../cstrike/dlls/tutor_cs_tutor.cpp:3773 */ -bool CCSTutor::IsBombMap(void) +bool CCSTutor::IsBombMap() { CHalfLifeMultiplay *mpRules = g_pGameRules; @@ -3240,7 +3236,7 @@ bool CCSTutor::IsBombMap(void) } /* <216d35> ../cstrike/dlls/tutor_cs_tutor.cpp:3781 */ -void CCSTutor::ResetPlayerDeathInfo(void) +void CCSTutor::ResetPlayerDeathInfo() { for (int i = 0; i < ARRAYSIZE(m_playerDeathInfo); ++i) { @@ -3293,37 +3289,3 @@ void CCSTutor::TransferDeathEvents(TutorMessageEvent *oldEvent, TutorMessageEven } } } - -#ifdef HOOK_GAMEDLL - -void CCSTutor::TutorThink(float time) -{ - TutorThink_(time); -} - -void CCSTutor::PurgeMessages(void) -{ - PurgeMessages_(); -} - -void CCSTutor::CallEventHandler(GameEventType event, CBaseEntity *entity, CBaseEntity *other) -{ - CallEventHandler_(event, entity, other); -} - -void CCSTutor::ShowTutorMessage(TutorMessageEvent *event) -{ - ShowTutorMessage_(event); -} - -void CCSTutor::HandleShotFired(Vector source, Vector target) -{ - HandleShotFired_(source, target); -} - -TutorMessage *CCSTutor::GetTutorMessageDefinition(int messageID) -{ - return GetTutorMessageDefinition_(messageID); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/tutor_cs_tutor.h b/regamedll/dlls/tutor_cs_tutor.h index ae9c7666..620993e7 100644 --- a/regamedll/dlls/tutor_cs_tutor.h +++ b/regamedll/dlls/tutor_cs_tutor.h @@ -86,15 +86,13 @@ struct TutorMessage float m_minDisplayTimeOverride; float m_minRepeatInterval; float m_lastCloseTime; - -};/* size: 56, cachelines: 1, members: 15 */ +}; struct TutorMessageEventParam { char *m_data; TutorMessageEventParam *m_next; - -};/* size: 8, cachelines: 1, members: 2 */ +}; enum TutorMessageID { @@ -262,16 +260,15 @@ struct ClientCorpseStruct { Vector m_position; int m_team; +}; -};/* size: 16, cachelines: 1, members: 2 */ - -typedef std::vector ClientCorpseList; +typedef std::STD_VECTOR ClientCorpseList; typedef ClientCorpseList::iterator ClientCorpseListIter; class CCSTutor: public CBaseTutor { public: - CCSTutor(void); + CCSTutor(); struct PlayerDeathStruct { @@ -279,10 +276,9 @@ public: TutorMessageEvent *m_event; }; - virtual ~CCSTutor(void); - + virtual ~CCSTutor(); virtual void TutorThink(float time); - virtual void PurgeMessages(void); + virtual void PurgeMessages(); virtual void CallEventHandler(GameEventType event, CBaseEntity *entity, CBaseEntity *other); virtual void ShowTutorMessage(TutorMessageEvent *event); virtual void HandleShotFired(Vector source, Vector target); @@ -292,27 +288,28 @@ public: TutorMessageEvent *CreateTutorMessageEvent(TutorMessageID mid, CBaseEntity *entity = NULL, CBaseEntity *other = NULL); void AddToEventList(TutorMessageEvent *event); void DeleteEventFromEventList(TutorMessageEvent *event); - void ClearEventList(void); + void ClearEventList(); void ClearCurrentEvent(bool closeWindow = true, bool processDeathsForEvent = true); void DeleteEvent(TutorMessageEvent *event); bool ShouldShowMessageEvent(TutorMessageEvent *event, float time); NOXREF bool ShouldUpdateCurrentMessage(TutorMessageID messageID); - void ComputeDisplayTimesForMessage(void); + void ComputeDisplayTimesForMessage(); void UpdateCurrentMessage(TutorMessageEvent *event); - void ConstructMessageAndDisplay(void); + void ConstructMessageAndDisplay(); NOXREF void LookupHotKey(TutorMessageID mid, int paramNum, wchar_t *buf, int buflen); void CheckForWindowClose(float time); - void CheckForContentUpdate(void); + void CheckForContentUpdate(); bool HasCurrentWindowBeenActiveLongEnough(float time); void CheckForInterruptingMessageEvent(float time); void CheckForInactiveEvents(float time); void CancelEvent(TutorMessageID mid); void ProcessShownDeathsForEvent(TutorMessageEvent *event); void TransferDeathEvents(TutorMessageEvent *oldEvent, TutorMessageEvent *newEvent); - TutorMessageEvent *GetTutorMessageUpdateEvent(void); + TutorMessageEvent *GetTutorMessageUpdateEvent(); bool GetDuplicateMessagesFromEventList(TutorMessageEvent *&event1, TutorMessageEvent *&event2); - bool IsBombMap(void); - bool IsHostageMap(void); + bool IsBombMap(); + bool IsHostageMap(); + public: void HandleWeaponFired(CBaseEntity *entity, CBaseEntity *other); void HandleWeaponFiredOnEmpty(CBaseEntity *entity, CBaseEntity *other); @@ -372,32 +369,32 @@ public: void HandleCareerTaskDone(CBaseEntity *entity, CBaseEntity *other); void GetNumPlayersAliveOnTeams(int &numT, int &numCT); - void CheckForBombViewable(void); - void CheckForLooseWeaponViewable(void); - void CheckForLooseDefuserViewable(void); - void CheckForBombsiteViewable(void); - TutorMessageID CheckForInBombZone(void); - void CheckForHostageViewable(void); - void CheckForTimeRunningOut(void); - void CheckForAllHostagesDead(void); - bool CheckForAllHostagesFollowingSomeone(void); + void CheckForBombViewable(); + void CheckForLooseWeaponViewable(); + void CheckForLooseDefuserViewable(); + void CheckForBombsiteViewable(); + TutorMessageID CheckForInBombZone(); + void CheckForHostageViewable(); + void CheckForTimeRunningOut(); + void CheckForAllHostagesDead(); + bool CheckForAllHostagesFollowingSomeone(); void CheckHintMessages(float time); void CheckInGameHintMessages(float time); void CheckExamineMessages(float time); void CheckForNeedToReload(bool isPassiveCheck = false); - bool CanLocalPlayerBuyStuff(void); - void CheckBuyZoneMessages(void); + bool CanLocalPlayerBuyStuff(); + void CheckBuyZoneMessages(); bool IsBombPlantedInBombsite(CBaseEntity *bombTarget); - void ReadTutorMessageFile(void); - void ApplyPersistentDecay(void); + void ReadTutorMessageFile(); + void ApplyPersistentDecay(); CBaseEntity *GetEntityForMessageID(int messageID, CBaseEntity *last = NULL); - void ResetPlayerDeathInfo(void); + void ResetPlayerDeathInfo(); void ConstructRecentDeathsList(TeamName team, char *buf, int buflen, TutorMessageEvent *event); #ifdef HOOK_GAMEDLL void TutorThink_(float time); - void PurgeMessages_(void); + void PurgeMessages_(); void CallEventHandler_(GameEventType event, CBaseEntity *entity, CBaseEntity *other); void ShowTutorMessage_(TutorMessageEvent *event); void HandleShotFired_(Vector source, Vector target); @@ -420,16 +417,7 @@ private: int m_messageTypeMask; bool m_haveSpawned; PlayerDeathStruct m_playerDeathInfo[32]; - -};/* size: 356, cachelines: 6, members: 15 */ - -#ifdef HOOK_GAMEDLL - -#define TutorIdentifierList (*pTutorIdentifierList) - -#endif // HOOK_GAMEDLL - -extern const char *TutorIdentifierList[ TUTOR_NUM_MESSAGES ]; +}; void ParseMessageParameters(char *&messageData, TutorMessage *ret); TutorMessage *ConstructTutorMessage(char *&messageData, TutorMessage *defaults); diff --git a/regamedll/dlls/unisignals.h b/regamedll/dlls/unisignals.h index 7d3f4512..4d6c3005 100644 --- a/regamedll/dlls/unisignals.h +++ b/regamedll/dlls/unisignals.h @@ -36,31 +36,20 @@ class CUnifiedSignals { public: - CUnifiedSignals(void) + CUnifiedSignals() { m_flSignal = 0; m_flState = 0; } public: - void Update(void) + void Update() { - int old = m_flSignal; - + m_flState = m_flSignal; m_flSignal = 0; - m_flState = old; - } - void Signal(int flags) - { - m_flSignal |= flags; - } - int GetSignal(void) - { - return m_flSignal; - } - int GetState(void) - { - return m_flState; } + void Signal(int flags) { m_flSignal |= flags; } + int GetSignal() const { return m_flSignal; } + int GetState() const { return m_flState; } private: int m_flSignal; diff --git a/regamedll/dlls/util.cpp b/regamedll/dlls/util.cpp index f3d64b6c..28967fe0 100644 --- a/regamedll/dlls/util.cpp +++ b/regamedll/dlls/util.cpp @@ -123,19 +123,9 @@ int g_groupop = 0; const int gSizes[18] = { 4, 4, 4, 4, 4, 4, 4, 12, 12, 4, 4, 4, 4, 2, 1, 4, 4, 4 }; -#else // HOOK_GAMEDLL - -unsigned int seed_table[256]; -TYPEDESCRIPTION gEntvarsDescription[86]; - -int g_groupop; -int g_groupmask; - -const int gSizes[18]; - #endif // HOOK_GAMEDLL -float UTIL_WeaponTimeBase(void) +float UTIL_WeaponTimeBase() { #ifdef CLIENT_WEAPONS return 0.0; @@ -145,7 +135,7 @@ float UTIL_WeaponTimeBase(void) } /* <1ac4be> ../cstrike/dlls/util.cpp:59 */ -unsigned int U_Random(void) +unsigned int U_Random() { glSeed *= 69069; glSeed += seed_table[glSeed & 0xFF] + 1; @@ -224,7 +214,7 @@ void UTIL_SetGroupTrace(int groupmask, int op) } /* <1ac8bf> ../cstrike/dlls/util.cpp:168 */ -void UTIL_UnsetGroupTrace(void) +void UTIL_UnsetGroupTrace() { g_groupmask = 0; g_groupop = 0; @@ -245,7 +235,7 @@ NOXREF UTIL_GroupTrace::UTIL_GroupTrace(int groupmask, int op) } /* <1ac963> ../cstrike/dlls/util.cpp:188 */ -NOXREF UTIL_GroupTrace::~UTIL_GroupTrace(void) +NOXREF UTIL_GroupTrace::~UTIL_GroupTrace() { g_groupmask = m_oldgroupmask; g_groupop = m_oldgroupop; @@ -948,7 +938,7 @@ void UTIL_TraceModel(const Vector &vecStart, const Vector &vecEnd, int hullNumbe } /* <1aec01> ../cstrike/dlls/util.cpp:1132 */ -NOXREF TraceResult UTIL_GetGlobalTrace(void) +NOXREF TraceResult UTIL_GetGlobalTrace() { TraceResult tr; @@ -1173,7 +1163,7 @@ void UTIL_BloodDrips(const Vector &origin, const Vector &direction, int color, i } /* <1af310> ../cstrike/dlls/util.cpp:1356 */ -Vector UTIL_RandomBloodVector(void) +Vector UTIL_RandomBloodVector() { Vector direction; direction.x = RANDOM_FLOAT(-1, 1); @@ -1584,7 +1574,7 @@ void UTIL_StripToken(const char *pKey, char *pDest) } /* <1b003a> ../cstrike/dlls/util.cpp:1847 */ -CSaveRestoreBuffer::CSaveRestoreBuffer(void) +CSaveRestoreBuffer::CSaveRestoreBuffer() { m_pdata = NULL; } @@ -1596,7 +1586,7 @@ CSaveRestoreBuffer::CSaveRestoreBuffer(SAVERESTOREDATA *pdata) } /* <1b00d4> ../cstrike/dlls/util.cpp:1859 */ -CSaveRestoreBuffer::~CSaveRestoreBuffer(void) +CSaveRestoreBuffer::~CSaveRestoreBuffer() { ; } @@ -2284,7 +2274,7 @@ void CRestore::BufferReadHeader(HEADER *pheader) } /* <1b4654> ../cstrike/dlls/util.cpp:2605 */ -short CRestore::ReadShort(void) +short CRestore::ReadShort() { short tmp = 0; BufferReadBytes((char *)&tmp, sizeof(short)); @@ -2292,7 +2282,7 @@ short CRestore::ReadShort(void) } /* <1b45f5> ../cstrike/dlls/util.cpp:2614 */ -int CRestore::ReadInt(void) +int CRestore::ReadInt() { int tmp = 0; BufferReadBytes((char *)&tmp, sizeof(int)); @@ -2316,7 +2306,7 @@ NOXREF char *CRestore::ReadNamedString(const char *pName) } /* <1b453a> ../cstrike/dlls/util.cpp:2644 */ -char *CRestore::BufferPointer(void) +char *CRestore::BufferPointer() { if (!m_pdata) return NULL; @@ -2351,7 +2341,7 @@ void CRestore::BufferSkipBytes(int bytes) } /* <1b50bc> ../cstrike/dlls/util.cpp:2678 */ -NOXREF int CRestore::BufferSkipZString(void) +NOXREF int CRestore::BufferSkipZString() { if (!m_pdata) return 0; @@ -2467,8 +2457,16 @@ float_precision UTIL_GetPlayerGaitYaw(int playerIndex) int UTIL_ReadFlags(const char *c) { int flags = 0; + while (*c) - flags |= (1 << (*c++ - 'a')); - + { + if (*c >= 'a' && *c <= 'z') + { + flags |= (1 << (*c - 'a')); + } + + *c++; + } + return flags; } diff --git a/regamedll/dlls/util.h b/regamedll/dlls/util.h index 0a60f1ad..71d6b468 100644 --- a/regamedll/dlls/util.h +++ b/regamedll/dlls/util.h @@ -68,7 +68,7 @@ #define cchMapNameMost 32 #define CBSENTENCENAME_MAX 16 -#define CVOXFILESENTENCEMAX 1536 // max number of sentences in game. NOTE: this must match CVOXFILESENTENCEMAX in engine\sound.h!!! +#define CVOXFILESENTENCEMAX 1536 // max number of sentences in game. NOTE: this must match CVOXFILESENTENCEMAX in engine\sound.h #define GROUP_OP_AND 0 #define GROUP_OP_NAND 1 @@ -148,12 +148,7 @@ extern globalvars_t *gpGlobals; #define PLAYBACK_EVENT_DELAY(flags, who, index, delay)\ PLAYBACK_EVENT_FULL(flags, who, index, delay, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, 0, 0, 0, 0) -#ifdef HOOK_GAMEDLL - -// prefix _ -#define __MAKE_VHOOK(fname)\ - fname##_ -#else +#ifndef HOOK_GAMEDLL #define __MAKE_VHOOK(fname)\ fname @@ -228,18 +223,16 @@ typedef struct hudtextparms_s int channel; } hudtextparms_t; -/* size: 40, cachelines: 1, members: 16 */ class UTIL_GroupTrace { public: UTIL_GroupTrace(int groupmask, int op); - ~UTIL_GroupTrace(void); + ~UTIL_GroupTrace(); private: int m_oldgroupmask; int m_oldgroupop; - -};/* size: 8, cachelines: 1, members: 2 */ +}; /* <5da42> ../cstrike/dlls/util.h:67 */ inline void MAKE_STRING_CLASS(const char *str, entvars_t *pev) @@ -379,33 +372,14 @@ inline void STOP_SOUND(edict_t *entity, int channel, const char *sample) EMIT_SOUND_DYN(entity, channel, sample, 0, 0, SND_STOP, PITCH_NORM); } -#ifdef HOOK_GAMEDLL - -#define gEntvarsDescription (*pgEntvarsDescription) -#define seed_table (*pseed_table) -#define glSeed (*pglSeed) -#define g_groupmask (*pg_groupmask) -#define g_groupop (*pg_groupop) -#define gSizes (*pgSizes) - -#endif // HOOK_GAMEDLL - -extern TYPEDESCRIPTION gEntvarsDescription[86]; -extern unsigned int seed_table[256]; -extern unsigned int glSeed; - -extern int g_groupmask; -extern int g_groupop; -extern const int gSizes[18]; - -float UTIL_WeaponTimeBase(void); -unsigned int U_Random(void); +float UTIL_WeaponTimeBase(); +unsigned int U_Random(); void U_Srand(unsigned int seed); int UTIL_SharedRandomLong(unsigned int seed, int low, int high); float UTIL_SharedRandomFloat(unsigned int seed, float low, float high); NOXREF void UTIL_ParametricRocket(entvars_t *pev, Vector vecOrigin, Vector vecAngles, edict_t *owner); void UTIL_SetGroupTrace(int groupmask, int op); -void UTIL_UnsetGroupTrace(void); +void UTIL_UnsetGroupTrace(); NOXREF BOOL UTIL_GetNextBestWeapon(class CBasePlayer *pPlayer, class CBasePlayerItem *pCurrentWeapon); NOXREF float UTIL_AngleMod(float a); NOXREF float UTIL_AngleDiff(float destAngle, float srcAngle); @@ -449,7 +423,7 @@ void UTIL_TraceLine(const Vector &vecStart, const Vector &vecEnd, IGNORE_MONSTER void UTIL_TraceLine(const Vector &vecStart, const Vector &vecEnd, IGNORE_MONSTERS igmon, IGNORE_GLASS ignoreGlass, edict_t *pentIgnore, TraceResult *ptr); void UTIL_TraceHull(const Vector &vecStart, const Vector &vecEnd, IGNORE_MONSTERS igmon, int hullNumber, edict_t *pentIgnore, TraceResult *ptr); void UTIL_TraceModel(const Vector &vecStart, const Vector &vecEnd, int hullNumber, edict_t *pentModel, TraceResult *ptr); -NOXREF TraceResult UTIL_GetGlobalTrace(void); +NOXREF TraceResult UTIL_GetGlobalTrace(); void UTIL_SetSize(entvars_t *pev, const Vector &vecMin, const Vector &vecMax); float UTIL_VecToYaw(const Vector &vec); void UTIL_SetOrigin(entvars_t *pev, const Vector &vecOrigin); @@ -465,7 +439,7 @@ BOOL UTIL_ShouldShowBlood(int color); int UTIL_PointContents(const Vector &vec); void UTIL_BloodStream(const Vector &origin, const Vector &direction, int color, int amount); void UTIL_BloodDrips(const Vector &origin, const Vector &direction, int color, int amount); -Vector UTIL_RandomBloodVector(void); +Vector UTIL_RandomBloodVector(); void UTIL_BloodDecalTrace(TraceResult *pTrace, int bloodColor); void UTIL_DecalTrace(TraceResult *pTrace, int decalNumber); void UTIL_PlayerDecalTrace(TraceResult *pTrace, int playernum, int decalNumber, BOOL bIsCustom); @@ -492,29 +466,7 @@ bool UTIL_IsGame(const char *gameName); float_precision UTIL_GetPlayerGaitYaw(int playerIndex); int UTIL_ReadFlags(const char *c); -/* -* Declared for function overload -*/ -#ifdef HOOK_GAMEDLL - -typedef void (*UTIL_TRACELINE_IGNORE)(const Vector &, const Vector &, IGNORE_MONSTERS, edict_t *, TraceResult *); -typedef void (*UTIL_TRACELINE_IGNORE_GLASS)(const Vector &, const Vector &, IGNORE_MONSTERS, IGNORE_GLASS, edict_t *, TraceResult *); - -typedef int (CSaveRestoreBuffer::*ENTITYINDEX_CBASE)(CBaseEntity *); -typedef int (CSaveRestoreBuffer::*ENTITYINDEX_ENTVARS)(entvars_t *); -typedef int (CSaveRestoreBuffer::*ENTITYINDEX_EOFFSET)(EOFFSET); -typedef int (CSaveRestoreBuffer::*ENTITYINDEX_EDICT)(edict_t *); - -typedef void (CSave::*WRITESTRING_)(const char *,const char *); -typedef void (CSave::*WRITESTRING_COUNT)(const char *,const int *,int); -typedef void (CSave::*WRITEVECTOR_)(const char *,const Vector &); -typedef void (CSave::*WRITEVECTOR_COUNT)(const char *,const float *,int); -typedef void (CSave::*WRITEPOSITIONVECTOR_)(const char *,const Vector &); -typedef void (CSave::*WRITEPOSITIONVECTOR_COUNT)(const char *,const float *,int); - -typedef int (CSaveRestoreBuffer::*CSAVERESTOREBUFFER_VOID)(const char *,const Vector &); -typedef int (CSaveRestoreBuffer::*CSAVERESTOREBUFFER_POINTER)(const char *,const float *,int); - -#endif // HOOK_GAMEDLL +extern int g_groupmask; +extern int g_groupop; #endif // UTIL_H diff --git a/regamedll/dlls/vector.h b/regamedll/dlls/vector.h index f6204be2..65921659 100644 --- a/regamedll/dlls/vector.h +++ b/regamedll/dlls/vector.h @@ -37,7 +37,7 @@ class Vector2D { public: vec_t x, y; - Vector2D(void) : x(0.0), y(0.0) {} + Vector2D() : x(0.0), y(0.0) {} Vector2D(float X, float Y) : x(0.0), y(0.0) { x = X; @@ -78,11 +78,11 @@ public: return Vector2D(x / fl, y / fl); } #endif // PLAY_GAMEDLL - float_precision Length(void) const + float_precision Length() const { return sqrt((float_precision)(x * x + y * y)); } - float LengthSquared(void) const + float LengthSquared() const { return (x * x + y * y); } @@ -94,7 +94,7 @@ public: { return &x; } - Vector2D Normalize(void) const + Vector2D Normalize() const { float_precision flLen = Length(); if (!flLen) @@ -116,7 +116,7 @@ public: { return (LengthSquared() > length * length); } - float_precision NormalizeInPlace(void) + float_precision NormalizeInPlace() { float_precision flLen = Length(); if (flLen > 0.0) @@ -136,8 +136,7 @@ public: return (x > -tolerance && x < tolerance && y > -tolerance && y < tolerance); } - -};/* size: 8, cachelines: 1, members: 2 */ +}; inline float_precision DotProduct(const Vector2D &a, const Vector2D &b) { @@ -154,7 +153,7 @@ class Vector { public: vec_t x, y, z; - Vector(void) : x(0.0), y(0.0), z(0.0) {} + Vector() : x(0.0), y(0.0), z(0.0) {} Vector(float X, float Y, float Z) : x(0.0), y(0.0), z(0.0) { x = X; @@ -173,7 +172,7 @@ public: y = rgfl[1]; z = rgfl[2]; } - Vector operator-(void) const + Vector operator-() const { return Vector(-x, -y, -z); } @@ -226,7 +225,7 @@ public: rgfl[1] = y; rgfl[2] = z; } - float_precision Length(void) const + float_precision Length() const { float_precision x1 = (float_precision)x; float_precision y1 = (float_precision)y; @@ -236,7 +235,7 @@ public: //return sqrt((float_precision)(x * x + y * y + z * z)); } - float_precision LengthSquared(void) const + float_precision LengthSquared() const { return (x * x + y * y + z * z); } @@ -249,7 +248,7 @@ public: return &x; } #ifndef PLAY_GAMEDLL - Vector Normalize(void) + Vector Normalize() { float flLen = Length(); if (flLen == 0) @@ -259,7 +258,7 @@ public: return Vector(x * flLen, y * flLen, z * flLen); } #else - Vector Normalize(void) + Vector Normalize() { float_precision flLen = Length(); if (flLen == 0) @@ -270,7 +269,7 @@ public: } #endif // PLAY_GAMEDLL // for out precision normalize - Vector NormalizePrecision(void) + Vector NormalizePrecision() { #ifndef PLAY_GAMEDLL return Normalize(); @@ -283,14 +282,14 @@ public: return Vector((vec_t)(x * flLen), (vec_t)(y * flLen), (vec_t)(z * flLen)); #endif // PLAY_GAMEDLL } - Vector2D Make2D(void) const + Vector2D Make2D() const { Vector2D Vec2; Vec2.x = x; Vec2.y = y; return Vec2; } - float_precision Length2D(void) const + float_precision Length2D() const { return sqrt((float_precision)(x * x + y * y)); } @@ -303,7 +302,7 @@ public: return (LengthSquared() > length * length); } #ifdef PLAY_GAMEDLL - float_precision NormalizeInPlace(void) + float_precision NormalizeInPlace() { float_precision flLen = Length(); @@ -323,7 +322,7 @@ public: return flLen; } template - float_precision NormalizeInPlace(void) + float_precision NormalizeInPlace() { T flLen = Length(); @@ -343,7 +342,7 @@ public: return flLen; } #else // PLAY_GAMEDLL - float NormalizeInPlace(void) + float NormalizeInPlace() { float flLen = Length(); if (flLen > 0) @@ -367,8 +366,7 @@ public: y > -tolerance && y < tolerance && z > -tolerance && z < tolerance); } - -};/* size: 12, cachelines: 1, members: 3 */ +}; /* <1c0d1> ../cstrike/dlls/vector.h:184 */ inline Vector operator*(float fl, const Vector &v) diff --git a/regamedll/dlls/vehicle.cpp b/regamedll/dlls/vehicle.cpp index 18aa6732..9fa7491c 100644 --- a/regamedll/dlls/vehicle.cpp +++ b/regamedll/dlls/vehicle.cpp @@ -21,10 +21,6 @@ TYPEDESCRIPTION CFuncVehicle::m_SaveData[] = DEFINE_FIELD(CFuncVehicle, m_oldSpeed, FIELD_FLOAT), }; -#else - -TYPEDESCRIPTION IMPL_CLASS(CFuncVehicle, m_SaveData)[12]; - #endif // HOOK_GAMEDLL /* <1ba031> ../cstrike/dlls/vehicle.cpp:9 */ @@ -281,7 +277,7 @@ void CFuncVehicle::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCall } /* <1bc0bd> ../cstrike/dlls/vehicle.cpp:303 */ -void CFuncVehicle::StopSound(void) +void CFuncVehicle::StopSound() { if (m_soundPlaying && pev->noise) { @@ -295,7 +291,7 @@ void CFuncVehicle::StopSound(void) } /* <1bb33d> ../cstrike/dlls/vehicle.cpp:324 */ -void CFuncVehicle::UpdateSound(void) +void CFuncVehicle::UpdateSound() { if (!pev->noise) return; @@ -327,7 +323,7 @@ void CFuncVehicle::UpdateSound(void) } /* <1bc12b> ../cstrike/dlls/vehicle.cpp:368 */ -void CFuncVehicle::CheckTurning(void) +void CFuncVehicle::CheckTurning() { float_precision maxspeed; TraceResult tr; @@ -408,7 +404,7 @@ void CFuncVehicle::CheckTurning(void) } /* <1bc358> ../cstrike/dlls/vehicle.cpp:466 */ -void CFuncVehicle::CollisionDetection(void) +void CFuncVehicle::CollisionDetection() { TraceResult tr; bool bHitSomething = false; @@ -512,7 +508,7 @@ void CFuncVehicle::CollisionDetection(void) } /* <1bc7aa> ../cstrike/dlls/vehicle.cpp:588 */ -void CFuncVehicle::TerrainFollowing(void) +void CFuncVehicle::TerrainFollowing() { TraceResult tr; UTIL_TraceLine(pev->origin, pev->origin + Vector(0, 0, (m_height + 48) * -1), ignore_monsters, dont_ignore_glass, ENT(pev), &tr); @@ -528,7 +524,7 @@ void CFuncVehicle::TerrainFollowing(void) } /* <1bc856> ../cstrike/dlls/vehicle.cpp:609 */ -void CFuncVehicle::Next(void) +void CFuncVehicle::Next() { Vector vGravityVector, forward, right, up; float time = 0.1; @@ -683,7 +679,7 @@ void CFuncVehicle::Next(void) } /* <1bd087> ../cstrike/dlls/vehicle.cpp:764 */ -void CFuncVehicle::DeadEnd(void) +void CFuncVehicle::DeadEnd() { CPathTrack *pTrack = m_ppath; ALERT(at_aiconsole, "TRAIN(%s): Dead end ", STRING(pev->targetname)); @@ -764,7 +760,7 @@ BOOL CFuncVehicle::__MAKE_VHOOK(OnControls)(entvars_t *pevTest) } /* <1bb676> ../cstrike/dlls/vehicle.cpp:841 */ -void CFuncVehicle::Find(void) +void CFuncVehicle::Find() { m_ppath = CPathTrack::Instance(FIND_ENTITY_BY_TARGETNAME(NULL, STRING(pev->target))); @@ -804,7 +800,7 @@ void CFuncVehicle::Find(void) } /* <1bb840> ../cstrike/dlls/vehicle.cpp:878 */ -void CFuncVehicle::NearestPath(void) +void CFuncVehicle::NearestPath() { CBaseEntity *pTrack = NULL; CBaseEntity *pNearest = NULL; @@ -843,7 +839,7 @@ void CFuncVehicle::NearestPath(void) } } - m_ppath = reinterpret_cast(pNearest); + m_ppath = static_cast(pNearest); if (pev->speed != 0) { NextThink(pev->ltime + 0.1, FALSE); @@ -852,7 +848,7 @@ void CFuncVehicle::NearestPath(void) } /* <1bb00a> ../cstrike/dlls/vehicle.cpp:926 */ -void CFuncVehicle::__MAKE_VHOOK(OverrideReset)(void) +void CFuncVehicle::__MAKE_VHOOK(OverrideReset)() { NextThink(pev->ltime + 0.1, FALSE); SetThink(&CFuncVehicle::NearestPath); @@ -870,13 +866,13 @@ CFuncVehicle *CFuncVehicle::Instance(edict_t *pent) } /* <1bb055> ../cstrike/dlls/vehicle.cpp:951 */ -int CFuncVehicle::__MAKE_VHOOK(Classify)(void) +int CFuncVehicle::__MAKE_VHOOK(Classify)() { return CLASS_VEHICLE; } /* <1bb0ef> ../cstrike/dlls/vehicle.cpp:956 */ -void CFuncVehicle::__MAKE_VHOOK(Spawn)(void) +void CFuncVehicle::__MAKE_VHOOK(Spawn)() { if (pev->speed == 0) m_speed = 165; @@ -926,7 +922,7 @@ void CFuncVehicle::__MAKE_VHOOK(Spawn)(void) } /* <1bb13e> ../cstrike/dlls/vehicle.cpp:1005 */ -void CFuncVehicle::__MAKE_VHOOK(Restart)(void) +void CFuncVehicle::__MAKE_VHOOK(Restart)() { ALERT(at_console, "M_speed = %f\n", m_speed); @@ -953,7 +949,7 @@ void CFuncVehicle::__MAKE_VHOOK(Restart)(void) } /* <1bb07b> ../cstrike/dlls/vehicle.cpp:1032 */ -void CFuncVehicle::__MAKE_VHOOK(Precache)(void) +void CFuncVehicle::__MAKE_VHOOK(Precache)() { if (m_flVolume == 0.0f) m_flVolume = 1.0f; @@ -978,7 +974,7 @@ void CFuncVehicle::__MAKE_VHOOK(Precache)(void) LINK_ENTITY_TO_CLASS(func_vehiclecontrols, CFuncVehicleControls); /* <1bbd36> ../cstrike/dlls/vehicle.cpp:1067 */ -void CFuncVehicleControls::Find(void) +void CFuncVehicleControls::Find() { edict_t *pTarget = NULL; @@ -1001,7 +997,7 @@ void CFuncVehicleControls::Find(void) } /* <1bb0c8> ../cstrike/dlls/vehicle.cpp:1088 */ -void CFuncVehicleControls::__MAKE_VHOOK(Spawn)(void) +void CFuncVehicleControls::__MAKE_VHOOK(Spawn)() { pev->solid = SOLID_NOT; pev->movetype = MOVETYPE_NONE; @@ -1013,67 +1009,3 @@ void CFuncVehicleControls::__MAKE_VHOOK(Spawn)(void) SetThink(&CFuncVehicleControls::Find); pev->nextthink = gpGlobals->time; } - -#ifdef HOOK_GAMEDLL - -void CFuncVehicle::Spawn(void) -{ - Spawn_(); -} - -void CFuncVehicle::Precache(void) -{ - Precache_(); -} - -void CFuncVehicle::Restart(void) -{ - Restart_(); -} - -void CFuncVehicle::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -int CFuncVehicle::Save(CSave &save) -{ - return Save_(save); -} - -int CFuncVehicle::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -int CFuncVehicle::Classify(void) -{ - return Classify_(); -} - -void CFuncVehicle::OverrideReset(void) -{ - OverrideReset_(); -} - -BOOL CFuncVehicle::OnControls(entvars_t *pev) -{ - return OnControls_(pev); -} - -void CFuncVehicle::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -void CFuncVehicle::Blocked(CBaseEntity *pOther) -{ - Blocked_(pOther); -} - -void CFuncVehicleControls::Spawn(void) -{ - Spawn_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/vehicle.h b/regamedll/dlls/vehicle.h index 068cf107..8efc2c3b 100644 --- a/regamedll/dlls/vehicle.h +++ b/regamedll/dlls/vehicle.h @@ -55,32 +55,20 @@ class CFuncVehicleControls: 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 public: - void EXPORT Find(void); - -};/* size: 152, cachelines: 3, members: 1 */ + void EXPORT Find(); +}; float_precision Fix2(float angle); void FixupAngles2(Vector &v); -#ifdef HOOK_GAMEDLL - -// linked objects -C_DLLEXPORT void func_vehicle(entvars_t *pev); -C_DLLEXPORT void func_vehiclecontrols(entvars_t *pev); - -#endif // HOOK_GAMEDLL - #endif // VEHICLE_H diff --git a/regamedll/dlls/weapons.cpp b/regamedll/dlls/weapons.cpp index 56679713..a585c5c4 100644 --- a/regamedll/dlls/weapons.cpp +++ b/regamedll/dlls/weapons.cpp @@ -36,17 +36,6 @@ TYPEDESCRIPTION CWeaponBox::m_SaveData[] = const char *g_pModelNameLaser = "sprites/laserbeam.spr"; -#else // HOOK_GAMEDLL - -ItemInfo IMPL_CLASS(CBasePlayerItem, ItemInfoArray)[32]; -AmmoInfo IMPL_CLASS(CBasePlayerItem, AmmoInfoArray)[32]; - -TYPEDESCRIPTION IMPL_CLASS(CBasePlayerItem, m_SaveData)[3]; -TYPEDESCRIPTION IMPL_CLASS(CBasePlayerWeapon, m_SaveData)[7]; -TYPEDESCRIPTION IMPL_CLASS(CWeaponBox, m_SaveData)[4]; - -const char *g_pModelNameLaser; - #endif // HOOK_GAMEDLL short g_sModelIndexLaser; // holds the index for the laser beam @@ -100,7 +89,7 @@ int MaxAmmoCarry(int iszName) // ClearMultiDamage - resets the global multi damage accumulator /* <1d2a29> ../cstrike/dlls/weapons.cpp:110 */ -void ClearMultiDamage(void) +void ClearMultiDamage() { gMultiDamage.pEntity = NULL; gMultiDamage.amount = 0; @@ -171,7 +160,7 @@ void DecalGunshot(TraceResult *pTrace, int iBulletType, bool ClientOnly, entvars void EjectBrass(const Vector &vecOrigin, const Vector &vecLeft, const Vector &vecVelocity, float rotation, int model, int soundtype, int entityIndex) { //CBaseEntity *ent = UTIL_PlayerByIndex(entityIndex); // unused - bool useNewBehavior = UTIL_IsGame("czero"); + bool useNewBehavior = g_bIsCzeroGame; MESSAGE_BEGIN(MSG_PVS, gmsgBrass, vecOrigin); if (!useNewBehavior) @@ -337,7 +326,7 @@ NOXREF void UTIL_PrecacheOtherWeapon2(const char *szClassname) // called by worldspawn /* <1d3191> ../cstrike/dlls/weapons.cpp:345 */ -void W_Precache(void) +void W_Precache() { Q_memset(IMPL_CLASS(CBasePlayerItem, ItemInfoArray), 0, ARRAYSIZE(IMPL_CLASS(CBasePlayerItem, ItemInfoArray))); Q_memset(IMPL_CLASS(CBasePlayerItem, AmmoInfoArray), 0, ARRAYSIZE(IMPL_CLASS(CBasePlayerItem, AmmoInfoArray))); @@ -464,7 +453,7 @@ IMPLEMENT_SAVERESTORE(CBasePlayerItem, CBaseAnimating); IMPLEMENT_SAVERESTORE(CBasePlayerWeapon, CBasePlayerItem); /* <1d1730> ../cstrike/dlls/weapons.cpp:475 */ -void CBasePlayerItem::__MAKE_VHOOK(SetObjectCollisionBox)(void) +void CBasePlayerItem::__MAKE_VHOOK(SetObjectCollisionBox)() { pev->absmin = pev->origin + Vector(-24, -24, 0); pev->absmax = pev->origin + Vector(24, 24, 16); @@ -473,7 +462,7 @@ void CBasePlayerItem::__MAKE_VHOOK(SetObjectCollisionBox)(void) // Sets up movetype, size, solidtype for a new weapon. /* <1d31ab> ../cstrike/dlls/weapons.cpp:485 */ -void CBasePlayerItem::FallInit(void) +void CBasePlayerItem::FallInit() { pev->movetype = MOVETYPE_TOSS; pev->solid = SOLID_BBOX; @@ -496,7 +485,7 @@ void CBasePlayerItem::FallInit(void) // player get it. /* <1d32bc> ../cstrike/dlls/weapons.cpp:506 */ -void CBasePlayerItem::FallThink(void) +void CBasePlayerItem::FallThink() { pev->nextthink = gpGlobals->time + 0.1f; @@ -521,7 +510,7 @@ void CBasePlayerItem::FallThink(void) // Materialize - make a CBasePlayerItem visible and tangible /* <1d3252> ../cstrike/dlls/weapons.cpp:531 */ -void CBasePlayerItem::Materialize(void) +void CBasePlayerItem::Materialize() { if (pev->effects & EF_NODRAW) { @@ -559,7 +548,7 @@ void CBasePlayerItem::Materialize(void) // should it do so now or wait longer? /* <1d327b> ../cstrike/dlls/weapons.cpp:567 */ -void CBasePlayerItem::AttemptToMaterialize(void) +void CBasePlayerItem::AttemptToMaterialize() { float time = g_pGameRules->FlWeaponTryRespawn(this); @@ -576,7 +565,7 @@ void CBasePlayerItem::AttemptToMaterialize(void) // it respawn? /* <1d3348> ../cstrike/dlls/weapons.cpp:584 */ -void CBasePlayerItem::CheckRespawn(void) +void CBasePlayerItem::CheckRespawn() { switch (g_pGameRules->WeaponShouldRespawn(this)) { @@ -591,7 +580,7 @@ void CBasePlayerItem::CheckRespawn(void) // invisible and intangible. Make it visible and tangible. /* <1d1e09> ../cstrike/dlls/weapons.cpp:616 */ -CBaseEntity *CBasePlayerItem::__MAKE_VHOOK(Respawn)(void) +CBaseEntity *CBasePlayerItem::__MAKE_VHOOK(Respawn)() { // make a copy of this weapon that is invisible and inaccessible to players (no touch function). The weapon spawn/respawn code // will decide when to make the weapon visible and touchable. @@ -666,7 +655,7 @@ void CBasePlayerItem::DefaultTouch(CBaseEntity *pOther) } /* <1d3371> ../cstrike/dlls/weapons.cpp:678 */ -void CBasePlayerWeapon::SetPlayerShieldAnim(void) +void CBasePlayerWeapon::SetPlayerShieldAnim() { if (!m_pPlayer->HasShield()) return; @@ -682,7 +671,7 @@ void CBasePlayerWeapon::SetPlayerShieldAnim(void) } /* <1d339a> ../cstrike/dlls/weapons.cpp:689 */ -void CBasePlayerWeapon::ResetPlayerShieldAnim(void) +void CBasePlayerWeapon::ResetPlayerShieldAnim() { if (m_pPlayer->HasShield()) { @@ -694,7 +683,7 @@ void CBasePlayerWeapon::ResetPlayerShieldAnim(void) } /* <1d33c3> ../cstrike/dlls/weapons.cpp:699 */ -void CBasePlayerWeapon::EjectBrassLate(void) +void CBasePlayerWeapon::EjectBrassLate() { int soundType; Vector vecUp, vecRight, vecShellVelocity; @@ -819,7 +808,7 @@ void CBasePlayerWeapon::FireRemaining(int &shotsFired, float &shootTime, BOOL bI if (bIsGlock) { vecDir = m_pPlayer->FireBullets3(vecSrc, gpGlobals->v_forward, 0.05, 8192, 1, BULLET_PLAYER_9MM, 18, 0.9, m_pPlayer->pev, true, m_pPlayer->random_seed); - m_pPlayer->ammo_9mm--; + --m_pPlayer->ammo_9mm; PLAYBACK_EVENT_FULL(flag, m_pPlayer->edict(), m_usFireGlock18, 0, (float *)&g_vecZero, (float *)&g_vecZero, vecDir.x, vecDir.y, (int)(m_pPlayer->pev->punchangle.x * 10000), (int)(m_pPlayer->pev->punchangle.y * 10000), m_iClip == 0, FALSE); @@ -828,7 +817,7 @@ void CBasePlayerWeapon::FireRemaining(int &shotsFired, float &shootTime, BOOL bI { vecDir = m_pPlayer->FireBullets3(vecSrc, gpGlobals->v_forward, m_fBurstSpread, 8192, 2, BULLET_PLAYER_556MM, 30, 0.96, m_pPlayer->pev, false, m_pPlayer->random_seed); - m_pPlayer->ammo_556nato--; + --m_pPlayer->ammo_556nato; PLAYBACK_EVENT_FULL(flag, m_pPlayer->edict(), m_usFireFamas, 0, (float *)&g_vecZero, (float *)&g_vecZero, vecDir.x, vecDir.y, (int)(m_pPlayer->pev->punchangle.x * 10000000), (int)(m_pPlayer->pev->punchangle.y * 10000000), FALSE, FALSE); @@ -865,7 +854,7 @@ BOOL CanAttack(float attack_time, float curtime, BOOL isPredicted) } /* <1d38f0> ../cstrike/dlls/weapons.cpp:890 */ -bool CBasePlayerWeapon::HasSecondaryAttack(void) +bool CBasePlayerWeapon::HasSecondaryAttack() { if (m_pPlayer->HasShield()) { @@ -897,7 +886,7 @@ bool CBasePlayerWeapon::HasSecondaryAttack(void) } /* <1d3919> ../cstrike/dlls/weapons.cpp:915 */ -void CBasePlayerWeapon::__MAKE_VHOOK(ItemPostFrame)(void) +void CBasePlayerWeapon::__MAKE_VHOOK(ItemPostFrame)() { int usableButtons = m_pPlayer->pev->button; @@ -1008,7 +997,7 @@ void CBasePlayerWeapon::__MAKE_VHOOK(ItemPostFrame)(void) { // no fire buttons down - // The following code prevents the player from tapping the firebutton repeatedly + // The following code prevents the player from tapping the firebutton repeatedly // to simulate full auto and retaining the single shot accuracy of single fire if (m_bDelayFire) { @@ -1077,7 +1066,7 @@ void CBasePlayerWeapon::__MAKE_VHOOK(ItemPostFrame)(void) } /* <1d3aac> ../cstrike/dlls/weapons.cpp:1069 */ -void CBasePlayerItem::DestroyItem(void) +void CBasePlayerItem::DestroyItem() { if (m_pPlayer != NULL) { @@ -1101,7 +1090,7 @@ int CBasePlayerItem::__MAKE_VHOOK(AddToPlayer)(CBasePlayer *pPlayer) } /* <1d183d> ../cstrike/dlls/weapons.cpp:1092 */ -void CBasePlayerItem::__MAKE_VHOOK(Drop)(void) +void CBasePlayerItem::__MAKE_VHOOK(Drop)() { SetTouch(NULL); SetThink(&CBaseEntity::SUB_Remove); @@ -1109,7 +1098,7 @@ void CBasePlayerItem::__MAKE_VHOOK(Drop)(void) } /* <1d1866> ../cstrike/dlls/weapons.cpp:1099 */ -void CBasePlayerItem::__MAKE_VHOOK(Kill)(void) +void CBasePlayerItem::__MAKE_VHOOK(Kill)() { SetTouch(NULL); SetThink(&CBaseEntity::SUB_Remove); @@ -1298,7 +1287,7 @@ BOOL CBasePlayerWeapon::AddSecondaryAmmo(int iCount, char *szName, int iMax) // weapon?, etc) /* <1d19ba> ../cstrike/dlls/weapons.cpp:1287 */ -BOOL CBasePlayerWeapon::__MAKE_VHOOK(IsUseable)(void) +BOOL CBasePlayerWeapon::__MAKE_VHOOK(IsUseable)() { if (m_iClip <= 0) { @@ -1313,7 +1302,7 @@ BOOL CBasePlayerWeapon::__MAKE_VHOOK(IsUseable)(void) } /* <1d19f4> ../cstrike/dlls/weapons.cpp:1301 */ -BOOL CBasePlayerWeapon::__MAKE_VHOOK(CanDeploy)(void) +BOOL CBasePlayerWeapon::__MAKE_VHOOK(CanDeploy)() { return TRUE; } @@ -1345,7 +1334,7 @@ BOOL CBasePlayerWeapon::DefaultDeploy(char *szViewModel, char *szWeaponModel, in } /* <1d3df3> ../cstrike/dlls/weapons.cpp:1333 */ -void CBasePlayerWeapon::ReloadSound(void) +void CBasePlayerWeapon::ReloadSound() { Vector newVector; Vector origin; @@ -1403,7 +1392,7 @@ int CBasePlayerWeapon::DefaultReload(int iClipSize, int iAnim, float fDelay) } /* <1d2607> ../cstrike/dlls/weapons.cpp:1389 */ -BOOL CBasePlayerWeapon::__MAKE_VHOOK(PlayEmptySound)(void) +BOOL CBasePlayerWeapon::__MAKE_VHOOK(PlayEmptySound)() { if (m_iPlayEmptySound) { @@ -1427,19 +1416,19 @@ BOOL CBasePlayerWeapon::__MAKE_VHOOK(PlayEmptySound)(void) } /* <1d1a1c> ../cstrike/dlls/weapons.cpp:1414 */ -void CBasePlayerWeapon::__MAKE_VHOOK(ResetEmptySound)(void) +void CBasePlayerWeapon::__MAKE_VHOOK(ResetEmptySound)() { m_iPlayEmptySound = 1; } /* <1d1a44> ../cstrike/dlls/weapons.cpp:1421 */ -int CBasePlayerWeapon::__MAKE_VHOOK(PrimaryAmmoIndex)(void) +int CBasePlayerWeapon::__MAKE_VHOOK(PrimaryAmmoIndex)() { return m_iPrimaryAmmoType; } /* <1d1a6c> ../cstrike/dlls/weapons.cpp:1428 */ -int CBasePlayerWeapon::__MAKE_VHOOK(SecondaryAmmoIndex)(void) +int CBasePlayerWeapon::__MAKE_VHOOK(SecondaryAmmoIndex)() { return -1; } @@ -1454,7 +1443,7 @@ void CBasePlayerWeapon::__MAKE_VHOOK(Holster)(int skiplocal) } /* <1d20fb> ../cstrike/dlls/weapons.cpp:1440 */ -void CBasePlayerAmmo::__MAKE_VHOOK(Spawn)(void) +void CBasePlayerAmmo::__MAKE_VHOOK(Spawn)() { pev->movetype = MOVETYPE_TOSS; pev->solid = SOLID_TRIGGER; @@ -1471,7 +1460,7 @@ void CBasePlayerAmmo::__MAKE_VHOOK(Spawn)(void) } /* <1d1d10> ../cstrike/dlls/weapons.cpp:1458 */ -CBaseEntity *CBasePlayerAmmo::__MAKE_VHOOK(Respawn)(void) +CBaseEntity *CBasePlayerAmmo::__MAKE_VHOOK(Respawn)() { pev->effects |= EF_NODRAW; SetTouch(NULL); @@ -1486,7 +1475,7 @@ CBaseEntity *CBasePlayerAmmo::__MAKE_VHOOK(Respawn)(void) } /* <1d1de0> ../cstrike/dlls/weapons.cpp:1471 */ -void CBasePlayerAmmo::Materialize(void) +void CBasePlayerAmmo::Materialize() { if (pev->effects & EF_NODRAW) { @@ -1581,7 +1570,7 @@ int CBasePlayerWeapon::__MAKE_VHOOK(ExtractClipAmmo)(CBasePlayerWeapon *pWeapon) // RetireWeapon - no more ammo for this gun, put it away. /* <1d1b2e> ../cstrike/dlls/weapons.cpp:1567 */ -void CBasePlayerWeapon::__MAKE_VHOOK(RetireWeapon)(void) +void CBasePlayerWeapon::__MAKE_VHOOK(RetireWeapon)() { // first, no viewmodel at all. m_pPlayer->pev->viewmodel = iStringNull; @@ -1640,7 +1629,7 @@ LINK_ENTITY_TO_CLASS(weaponbox, CWeaponBox); IMPLEMENT_SAVERESTORE(CWeaponBox, CBaseEntity); /* <1d1b57> ../cstrike/dlls/weapons.cpp:1629 */ -void CWeaponBox::__MAKE_VHOOK(Precache)(void) +void CWeaponBox::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/w_weaponbox.mdl"); } @@ -1662,7 +1651,7 @@ void CWeaponBox::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) } /* <1d48ba> ../cstrike/dlls/weapons.cpp:1652 */ -void CWeaponBox::BombThink(void) +void CWeaponBox::BombThink() { if (!m_bIsBomb) return; @@ -1693,7 +1682,7 @@ void CWeaponBox::BombThink(void) } /* <1d1ce7> ../cstrike/dlls/weapons.cpp:1687 */ -void CWeaponBox::__MAKE_VHOOK(Spawn)(void) +void CWeaponBox::__MAKE_VHOOK(Spawn)() { Precache(); @@ -1710,7 +1699,7 @@ void CWeaponBox::__MAKE_VHOOK(Spawn)(void) // box from the world. /* <1d40c4> ../cstrike/dlls/weapons.cpp:1704 */ -void CWeaponBox::Kill(void) +void CWeaponBox::Kill() { CBasePlayerItem *pWeapon; int i; @@ -1755,7 +1744,7 @@ void CWeaponBox::__MAKE_VHOOK(Touch)(CBaseEntity *pOther) return; } - CBasePlayer *pPlayer = reinterpret_cast(pOther); + CBasePlayer *pPlayer = static_cast(pOther); if (pPlayer->m_bIsVIP || pPlayer->m_bShieldDrawn) return; @@ -1867,7 +1856,7 @@ void CWeaponBox::__MAKE_VHOOK(Touch)(CBaseEntity *pOther) { if (m_rgpPlayerItems[i]->IsWeapon() && m_rgpPlayerItems[i]) { - CBasePlayerWeapon *pGrenade = reinterpret_cast(m_rgpPlayerItems[i]); + CBasePlayerWeapon *pGrenade = static_cast(m_rgpPlayerItems[i]); int playerGrenades = pPlayer->m_rgAmmo[pGrenade->m_iPrimaryAmmoType]; int maxGrenades = 0; const char *grenadeName = NULL; @@ -2092,7 +2081,7 @@ BOOL CWeaponBox::HasWeapon(CBasePlayerItem *pCheckItem) // CWeaponBox::IsEmpty - is there anything in this box? /* <1d4354> ../cstrike/dlls/weapons.cpp:2119 */ -BOOL CWeaponBox::IsEmpty(void) +BOOL CWeaponBox::IsEmpty() { int i; @@ -2117,14 +2106,14 @@ BOOL CWeaponBox::IsEmpty(void) } /* <1d1b7f> ../cstrike/dlls/weapons.cpp:2145 */ -void CWeaponBox::__MAKE_VHOOK(SetObjectCollisionBox)(void) +void CWeaponBox::__MAKE_VHOOK(SetObjectCollisionBox)() { pev->absmin = pev->origin + Vector(-16, -16, 0); pev->absmax = pev->origin + Vector(16, 16, 16); } /* <1d1d39> ../cstrike/dlls/weapons.cpp:2167 */ -void CArmoury::__MAKE_VHOOK(Spawn)(void) +void CArmoury::__MAKE_VHOOK(Spawn)() { Precache(); pev->movetype = MOVETYPE_TOSS; @@ -2168,7 +2157,7 @@ void CArmoury::__MAKE_VHOOK(Spawn)(void) } /* <1d1bfb> ../cstrike/dlls/weapons.cpp:2207 */ -void CArmoury::__MAKE_VHOOK(Restart)(void) +void CArmoury::__MAKE_VHOOK(Restart)() { CHalfLifeMultiplay *mp = g_pGameRules; @@ -2224,7 +2213,7 @@ void CArmoury::__MAKE_VHOOK(Restart)(void) } /* <1d1ee9> ../cstrike/dlls/weapons.cpp:2268 */ -void CArmoury::__MAKE_VHOOK(Precache)(void) +void CArmoury::__MAKE_VHOOK(Precache)() { switch (m_iItem) { @@ -2257,7 +2246,7 @@ void CArmoury::ArmouryTouch(CBaseEntity *pOther) if (!pOther->IsPlayer()) return; - CBasePlayer *p = reinterpret_cast(pOther); + CBasePlayer *p = static_cast(pOther); if (p->m_bIsVIP) return; @@ -2406,202 +2395,3 @@ void CArmoury::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) /* <1d4392> ../cstrike/dlls/weapons.cpp:2368 */ LINK_ENTITY_TO_CLASS(armoury_entity, CArmoury); - -#ifdef HOOK_GAMEDLL - -void CArmoury::Spawn(void) -{ - Spawn_(); -} - -void CArmoury::Precache(void) -{ - Precache_(); -} - -void CArmoury::Restart(void) -{ - Restart_(); -} - -void CArmoury::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -void CBasePlayerAmmo::Spawn(void) -{ - Spawn_(); -} - -CBaseEntity *CBasePlayerAmmo::Respawn(void) -{ - return Respawn_(); -} - -int CBasePlayerWeapon::Save(CSave &save) -{ - return Save_(save); -} - -int CBasePlayerWeapon::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -int CBasePlayerWeapon::AddToPlayer(CBasePlayer *pPlayer) -{ - return AddToPlayer_(pPlayer); -} - -int CBasePlayerWeapon::AddDuplicate(CBasePlayerItem *pItem) -{ - return AddDuplicate_(pItem); -} - -BOOL CBasePlayerWeapon::CanDeploy(void) -{ - return CanDeploy_(); -} - -void CBasePlayerWeapon::Holster(int skiplocal) -{ - Holster_(skiplocal); -} - -void CBasePlayerWeapon::ItemPostFrame(void) -{ - ItemPostFrame_(); -} - -int CBasePlayerWeapon::PrimaryAmmoIndex(void) -{ - return PrimaryAmmoIndex_(); -} - -int CBasePlayerWeapon::SecondaryAmmoIndex(void) -{ - return SecondaryAmmoIndex_(); -} - -int CBasePlayerWeapon::UpdateClientData(CBasePlayer *pPlayer) -{ - return UpdateClientData_(pPlayer); -} - -int CBasePlayerWeapon::ExtractAmmo(CBasePlayerWeapon *pWeapon) -{ - return ExtractAmmo_(pWeapon); -} - -int CBasePlayerWeapon::ExtractClipAmmo(CBasePlayerWeapon *pWeapon) -{ - return ExtractClipAmmo_(pWeapon); -} - -BOOL CBasePlayerWeapon::PlayEmptySound(void) -{ - return PlayEmptySound_(); -} - -void CBasePlayerWeapon::ResetEmptySound(void) -{ - ResetEmptySound_(); -} - -void CBasePlayerWeapon::SendWeaponAnim(int iAnim,int skiplocal) -{ - SendWeaponAnim_(iAnim,skiplocal); -} - -BOOL CBasePlayerWeapon::IsUseable(void) -{ - return IsUseable_(); -} - -void CBasePlayerWeapon::RetireWeapon(void) -{ - RetireWeapon_(); -} - -int CBasePlayerItem::Save(CSave &save) -{ - return Save_(save); -} - -int CBasePlayerItem::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -void CBasePlayerItem::SetObjectCollisionBox(void) -{ - SetObjectCollisionBox_(); -} - -CBaseEntity *CBasePlayerItem::Respawn(void) -{ - return Respawn_(); -} - -int CBasePlayerItem::AddToPlayer(CBasePlayer *pPlayer) -{ - return AddToPlayer_(pPlayer); -} - -void CBasePlayerItem::Holster(int skiplocal) -{ - Holster_(skiplocal); -} - -void CBasePlayerItem::Drop(void) -{ - Drop_(); -} - -void CBasePlayerItem::Kill(void) -{ - Kill_(); -} - -void CBasePlayerItem::AttachToPlayer(CBasePlayer *pPlayer) -{ - AttachToPlayer_(pPlayer); -} - -void CWeaponBox::Spawn(void) -{ - Spawn_(); -} - -void CWeaponBox::Precache(void) -{ - Precache_(); -} - -void CWeaponBox::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -int CWeaponBox::Save(CSave &save) -{ - return Save_(save); -} - -int CWeaponBox::Restore(CRestore &restore) -{ - return Restore_(restore); -} - -void CWeaponBox::SetObjectCollisionBox(void) -{ - SetObjectCollisionBox_(); -} - -void CWeaponBox::Touch(CBaseEntity *pOther) -{ - Touch_(pOther); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/weapons.h b/regamedll/dlls/weapons.h index 3c5d26ff..1f0e39f2 100644 --- a/regamedll/dlls/weapons.h +++ b/regamedll/dlls/weapons.h @@ -43,7 +43,7 @@ class CBasePlayer; #define ITEM_FLAG_NOAUTORELOAD 2 #define ITEM_FLAG_NOAUTOSWITCHEMPTY 4 #define ITEM_FLAG_LIMITINWORLD 8 -#define ITEM_FLAG_EXHAUSTIBLE 16 // A player can totally exhaust their ammo supply and lose this weapon +#define ITEM_FLAG_EXHAUSTIBLE 16 // A player can totally exhaust their ammo supply and lose this weapon #define WEAPON_IS_ONTARGET 0x40 @@ -108,79 +108,70 @@ struct ItemInfo int iId; int iFlags; int iWeight; - -};/* size: 44, cachelines: 1, members: 11 */ +}; struct AmmoInfo { const char *pszName; int iId; - -};/* size: 8, cachelines: 1, members: 2 */ +}; struct MULTIDAMAGE { CBaseEntity *pEntity; float amount; int type; - -};/* size: 12, cachelines: 1, members: 3 */ +}; /* <1d04c6> ../cstrike/dlls/weapons.cpp:2156 */ class CArmoury: public CBaseEntity { 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); #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); - void Restart_(void); + void Spawn_(); + void Precache_(); + void Restart_(); void KeyValue_(KeyValueData *pkvd); #endif // HOOK_GAMEDLL public: void EXPORT ArmouryTouch(CBaseEntity *pOther); + public: int m_iItem; int m_iCount; int m_iInitialCount; bool m_bAlreadyCounted; - -};/* size: 168, cachelines: 3, members: 5 */ +}; /* <14ed46> ../cstrike/dlls/weapons.h:56 */ class CGrenade: 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 m_bIsC4 ? FCAP_CONTINUOUS_USE : 0; - } + virtual int ObjectCaps() { return m_bIsC4 ? FCAP_CONTINUOUS_USE : 0; } virtual void Killed(entvars_t *pevAttacker, int iGib); - virtual int BloodColor(void) - { - return DONT_BLEED; - } + virtual int BloodColor() { return DONT_BLEED; } virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); - virtual void BounceSound(void); + virtual void BounceSound(); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); int Save_(CSave &save); int Restore_(CRestore &restore); void Killed_(entvars_t *pevAttacker, int iGib); void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); - void BounceSound_(void); + void BounceSound_(); #endif // HOOK_GAMEDLL @@ -204,26 +195,26 @@ public: void Explode3(TraceResult *pTrace, int bitsDamageType); NOXREF void SG_Explode(TraceResult *pTrace, int bitsDamageType); - void EXPORT Smoke(void); - void EXPORT Smoke2(void); - void EXPORT Smoke3_A(void); - void EXPORT Smoke3_B(void); - void EXPORT Smoke3_C(void); - void EXPORT SG_Smoke(void); + void EXPORT Smoke(); + void EXPORT Smoke2(); + void EXPORT Smoke3_A(); + void EXPORT Smoke3_B(); + void EXPORT Smoke3_C(); + void EXPORT SG_Smoke(); void EXPORT BounceTouch(CBaseEntity *pOther); void EXPORT SlideTouch(CBaseEntity *pOther); void EXPORT C4Touch(CBaseEntity *pOther); void EXPORT ExplodeTouch(CBaseEntity *pOther); - void EXPORT DangerSoundThink(void); - void EXPORT PreDetonate(void); - void EXPORT Detonate(void); - void EXPORT SG_Detonate(void); - void EXPORT Detonate2(void); - void EXPORT Detonate3(void); + void EXPORT DangerSoundThink(); + void EXPORT PreDetonate(); + void EXPORT Detonate(); + void EXPORT SG_Detonate(); + void EXPORT Detonate2(); + void EXPORT Detonate3(); void EXPORT DetonateUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); - void EXPORT TumbleThink(void); - void EXPORT SG_TumbleThink(void); - void EXPORT C4Think(void); + void EXPORT TumbleThink(); + void EXPORT SG_TumbleThink(); + void EXPORT C4Think(); public: static TYPEDESCRIPTION IMPL(m_SaveData)[15]; @@ -252,8 +243,7 @@ public: Vector m_vSmokeDetonate; int m_iBounceCount; BOOL m_fRegisteredSound; - -};/* size: 500, cachelines: 8, members: 26 */ +}; /* <2c9f2c> ../cstrike/dlls/weapons.h:238 */ class CBasePlayerItem: public CBaseAnimating @@ -261,131 +251,66 @@ class CBasePlayerItem: public CBaseAnimating public: virtual int Save(CSave &save); virtual int Restore(CRestore &restore); - virtual void SetObjectCollisionBox(void); - virtual CBaseEntity *Respawn(void); + virtual void SetObjectCollisionBox(); + virtual CBaseEntity *Respawn(); virtual int AddToPlayer(CBasePlayer *pPlayer); - virtual int AddDuplicate(CBasePlayerItem *pItem) - { - return FALSE; - } - virtual int GetItemInfo(ItemInfo *p) - { - return 0; - } - virtual BOOL CanDeploy(void) - { - return TRUE; - } - virtual BOOL CanDrop(void) - { - return TRUE; - } - virtual BOOL Deploy(void) - { - return TRUE; - } - virtual BOOL IsWeapon(void) - { - return FALSE; - } - virtual BOOL CanHolster(void) - { - return TRUE; - } + virtual int AddDuplicate(CBasePlayerItem *pItem) { return FALSE; } + virtual int GetItemInfo(ItemInfo *p) { return 0; } + virtual BOOL CanDeploy() { return TRUE; } + virtual BOOL CanDrop() { return TRUE; } + virtual BOOL Deploy() { return TRUE; } + virtual BOOL IsWeapon() { return FALSE; } + virtual BOOL CanHolster() { return TRUE; } virtual void Holster(int skiplocal = 0); - virtual void UpdateItemInfo(void) {} - virtual void ItemPreFrame(void) {} - virtual void ItemPostFrame(void) {} - virtual void Drop(void); - virtual void Kill(void); + virtual void UpdateItemInfo() {} + virtual void ItemPreFrame() {} + virtual void ItemPostFrame() {} + virtual void Drop(); + virtual void Kill(); virtual void AttachToPlayer(CBasePlayer *pPlayer); - virtual int PrimaryAmmoIndex(void) - { - return -1; - } - virtual int SecondaryAmmoIndex(void) - { - return -1; - } - virtual int UpdateClientData(CBasePlayer *pPlayer) - { - return 0; - } - virtual CBasePlayerItem *GetWeaponPtr(void) - { - return NULL; - } - virtual float GetMaxSpeed(void) - { - return 260.0f; - } - virtual int iItemSlot(void) - { - return 0; - } + virtual int PrimaryAmmoIndex() { return -1; } + virtual int SecondaryAmmoIndex() { return -1; } + virtual int UpdateClientData(CBasePlayer *pPlayer) { return 0; } + virtual CBasePlayerItem *GetWeaponPtr() { return NULL; } + virtual float GetMaxSpeed() { return 260.0f; } + virtual int iItemSlot() { return 0; } #ifdef HOOK_GAMEDLL int Save_(CSave &save); int Restore_(CRestore &restore); - void SetObjectCollisionBox_(void); - CBaseEntity *Respawn_(void); + void SetObjectCollisionBox_(); + CBaseEntity *Respawn_(); int AddToPlayer_(CBasePlayer *pPlayer); void Holster_(int skiplocal); - void Drop_(void); - void Kill_(void); + void Drop_(); + void Kill_(); void AttachToPlayer_(CBasePlayer *pPlayer); #endif // HOOK_GAMEDLL public: - void EXPORT DestroyItem(void); + void EXPORT DestroyItem(); void EXPORT DefaultTouch(CBaseEntity *pOther); - void EXPORT FallThink(void); - void EXPORT Materialize(void); - void EXPORT AttemptToMaterialize(void); + void EXPORT FallThink(); + void EXPORT Materialize(); + void EXPORT AttemptToMaterialize(); - void FallInit(void); - void CheckRespawn(void); -public: - inline int iItemPosition(void) - { - return IMPL(ItemInfoArray)[ m_iId ].iPosition; - } - inline const char *pszAmmo1(void) - { - return IMPL(ItemInfoArray)[ m_iId ].pszAmmo1; - } - inline int iMaxAmmo1(void) - { - return IMPL(ItemInfoArray)[ m_iId ].iMaxAmmo1; - } - inline const char *pszAmmo2(void) - { - return IMPL(ItemInfoArray)[ m_iId ].pszAmmo2; - } - inline int iMaxAmmo2(void) - { - return IMPL(ItemInfoArray)[ m_iId ].iMaxAmmo2; - } - inline const char *pszName(void) - { - return IMPL(ItemInfoArray)[ m_iId ].pszName; - } - inline int iMaxClip(void) - { - return IMPL(ItemInfoArray)[ m_iId ].iMaxClip; - } - inline int iWeight(void) - { - return IMPL(ItemInfoArray)[ m_iId ].iWeight; - } - inline int iFlags(void) - { - return IMPL(ItemInfoArray)[ m_iId ].iFlags; - } -public: + void FallInit(); + void CheckRespawn(); +public: + inline int iItemPosition() const { return IMPL(ItemInfoArray)[ m_iId ].iPosition; } + inline const char *pszAmmo1() const { return IMPL(ItemInfoArray)[ m_iId ].pszAmmo1; } + inline int iMaxAmmo1() const { return IMPL(ItemInfoArray)[ m_iId ].iMaxAmmo1; } + inline const char *pszAmmo2() const { return IMPL(ItemInfoArray)[ m_iId ].pszAmmo2; } + inline int iMaxAmmo2() const { return IMPL(ItemInfoArray)[ m_iId ].iMaxAmmo2; } + inline const char *pszName() const { return IMPL(ItemInfoArray)[ m_iId ].pszName; } + inline int iMaxClip() const { return IMPL(ItemInfoArray)[ m_iId ].iMaxClip; } + inline int iWeight() const { return IMPL(ItemInfoArray)[ m_iId ].iWeight; } + inline int iFlags() const { return IMPL(ItemInfoArray)[ m_iId ].iFlags; } + +public: static TYPEDESCRIPTION IMPL(m_SaveData)[3]; static ItemInfo IMPL(ItemInfoArray)[32]; static AmmoInfo IMPL(AmmoInfoArray)[32]; @@ -393,8 +318,7 @@ public: CBasePlayer *m_pPlayer; CBasePlayerItem *m_pNext; int m_iId; - -};/* size: 192, cachelines: 3, members: 7 */ +}; /* <2c9f52> ../cstrike/dlls/weapons.h:307 */ class CBasePlayerWeapon: public CBasePlayerItem @@ -402,48 +326,35 @@ class CBasePlayerWeapon: public CBasePlayerItem public: virtual int Save(CSave &save); virtual int Restore(CRestore &restore); - virtual int AddToPlayer(CBasePlayer *pPlayer); virtual int AddDuplicate(CBasePlayerItem *pItem); - virtual BOOL CanDeploy(void); - virtual BOOL IsWeapon(void) - { - return TRUE; - } + virtual BOOL CanDeploy(); + virtual BOOL IsWeapon() { return TRUE; } virtual void Holster(int skiplocal = 0); - virtual void UpdateItemInfo(void) {}; - virtual void ItemPostFrame(void); - virtual int PrimaryAmmoIndex(void); - virtual int SecondaryAmmoIndex(void); + virtual void UpdateItemInfo() {}; + virtual void ItemPostFrame(); + virtual int PrimaryAmmoIndex(); + virtual int SecondaryAmmoIndex(); virtual int UpdateClientData(CBasePlayer *pPlayer); - virtual CBasePlayerItem *GetWeaponPtr(void) - { - return (CBasePlayerItem *)this; - } + virtual CBasePlayerItem *GetWeaponPtr() { return (CBasePlayerItem *)this; } virtual int ExtractAmmo(CBasePlayerWeapon *pWeapon); virtual int ExtractClipAmmo(CBasePlayerWeapon *pWeapon); - virtual int AddWeapon(void) + virtual int AddWeapon() { ExtractAmmo(this); return 1; } - virtual BOOL PlayEmptySound(void); - virtual void ResetEmptySound(void); + virtual BOOL PlayEmptySound(); + virtual void ResetEmptySound(); virtual void SendWeaponAnim(int iAnim, int skiplocal = 0); - virtual BOOL IsUseable(void); - virtual void PrimaryAttack(void) {}; - virtual void SecondaryAttack(void) {}; - virtual void Reload(void) {}; - virtual void WeaponIdle(void) {}; - virtual void RetireWeapon(void); - virtual BOOL ShouldWeaponIdle(void) - { - return FALSE; - } - virtual BOOL UseDecrement(void) - { - return FALSE; - } + virtual BOOL IsUseable(); + virtual void PrimaryAttack() {}; + virtual void SecondaryAttack() {}; + virtual void Reload() {}; + virtual void WeaponIdle() {}; + virtual void RetireWeapon(); + virtual BOOL ShouldWeaponIdle() { return FALSE; } + virtual BOOL UseDecrement() { return FALSE; } #ifdef HOOK_GAMEDLL @@ -451,19 +362,19 @@ public: int Restore_(CRestore &restore); int AddToPlayer_(CBasePlayer *pPlayer); int AddDuplicate_(CBasePlayerItem *pItem); - BOOL CanDeploy_(void); + BOOL CanDeploy_(); void Holster_(int skiplocal = 0); - void ItemPostFrame_(void); - int PrimaryAmmoIndex_(void); - int SecondaryAmmoIndex_(void); + void ItemPostFrame_(); + int PrimaryAmmoIndex_(); + int SecondaryAmmoIndex_(); int UpdateClientData_(CBasePlayer *pPlayer); int ExtractAmmo_(CBasePlayerWeapon *pWeapon); int ExtractClipAmmo_(CBasePlayerWeapon *pWeapon); - BOOL PlayEmptySound_(void); - void ResetEmptySound_(void); + BOOL PlayEmptySound_(); + void ResetEmptySound_(); void SendWeaponAnim_(int iAnim, int skiplocal = 0); - BOOL IsUseable_(void); - void RetireWeapon_(void); + BOOL IsUseable_(); + void RetireWeapon_(); #endif // HOOK_GAMEDLL @@ -474,16 +385,16 @@ public: int DefaultReload(int iClipSize, int iAnim, float fDelay); void FireRemaining(int &shotsFired, float &shootTime, BOOL isGlock18); void KickBack(float up_base, float lateral_base, float up_modifier, float lateral_modifier, float up_max, float lateral_max, int direction_change); - void EjectBrassLate(void); - NOXREF void MakeBeam(void); - NOXREF void BeamUpdate(void); - void ReloadSound(void); + void EjectBrassLate(); + NOXREF void MakeBeam(); + NOXREF void BeamUpdate(); + void ReloadSound(); float GetNextAttackDelay(float delay); float GetNextAttackDelay2(float delay); - bool HasSecondaryAttack(void); - BOOL IsPistol(void) { return (m_iId == WEAPON_USP || m_iId == WEAPON_GLOCK18 || m_iId == WEAPON_P228 || m_iId == WEAPON_DEAGLE || m_iId == WEAPON_ELITE || m_iId == WEAPON_FIVESEVEN); } - void SetPlayerShieldAnim(void); - void ResetPlayerShieldAnim(void); + bool HasSecondaryAttack(); + BOOL IsPistol() { return (m_iId == WEAPON_USP || m_iId == WEAPON_GLOCK18 || m_iId == WEAPON_P228 || m_iId == WEAPON_DEAGLE || m_iId == WEAPON_ELITE || m_iId == WEAPON_FIVESEVEN); } + void SetPlayerShieldAnim(); + void ResetPlayerShieldAnim(); bool ShieldSecondaryFire(int iUpAnim, int iDownAnim); public: @@ -524,69 +435,64 @@ public: unsigned short m_usFireFamas; float m_flPrevPrimaryAttack; float m_flLastFireTime; - -};/* size: 336, cachelines: 6, members: 37 */ +}; /* <9716> ../cstrike/dlls/weapons.h:429 */ class CBasePlayerAmmo: public CBaseEntity { public: - virtual void Spawn(void); - virtual BOOL AddAmmo(CBaseEntity *pOther) - { - return TRUE; - } - virtual CBaseEntity *Respawn(void); + virtual void Spawn(); + virtual BOOL AddAmmo(CBaseEntity *pOther) { return TRUE; } + virtual CBaseEntity *Respawn(); #ifdef HOOK_GAMEDLL - void Spawn_(void); - CBaseEntity *Respawn_(void); + void Spawn_(); + CBaseEntity *Respawn_(); #endif // HOOK_GAMEDLL public: void EXPORT DefaultTouch(CBaseEntity *pOther); - void EXPORT Materialize(void); - -};/* size: 152, cachelines: 3, members: 1 */ + void EXPORT Materialize(); +}; /* <1d03c1> ../cstrike/dlls/weapons.h:508 */ class CWeaponBox: 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 void SetObjectCollisionBox(void); + virtual void SetObjectCollisionBox(); virtual void Touch(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); - void SetObjectCollisionBox_(void); + void SetObjectCollisionBox_(); void Touch_(CBaseEntity *pOther); #endif // HOOK_GAMEDLL public: - BOOL IsEmpty(void); + BOOL IsEmpty(); int GiveAmmo(int iCount, char *szName, int iMax, int *pIndex = NULL); - void EXPORT Kill(void); - void EXPORT BombThink(void); + void EXPORT Kill(); + void EXPORT BombThink(); BOOL HasWeapon(CBasePlayerItem *pCheckItem); BOOL PackWeapon(CBasePlayerItem *pWeapon); BOOL PackAmmo(int iszName, int iCount); -public: +public: static TYPEDESCRIPTION IMPL(m_SaveData)[4]; CBasePlayerItem *m_rgpPlayerItems[ MAX_ITEM_TYPES ]; @@ -594,30 +500,23 @@ public: int m_rgAmmo[ MAX_AMMO_SLOTS ]; int m_cAmmoTypes; bool m_bIsBomb; - -};/* size: 440, cachelines: 7, members: 7 */ +}; /* <2ba15a> ../cstrike/dlls/weapons.h:573 */ class CUSP: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL Deploy(void); - virtual float GetMaxSpeed(void) - { - return m_fMaxSpeed; - } - virtual int iItemSlot(void) - { - return PISTOL_SLOT; - } - virtual void PrimaryAttack(void); - virtual void SecondaryAttack(void); - virtual void Reload(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual BOOL Deploy(); + virtual float GetMaxSpeed() { return m_fMaxSpeed; } + virtual int iItemSlot() { return PISTOL_SLOT; } + virtual void PrimaryAttack(); + virtual void SecondaryAttack(); + virtual void Reload(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -625,57 +524,46 @@ public: return FALSE; #endif } - virtual BOOL IsPistol(void) - { - return TRUE; - } + virtual BOOL IsPistol() { return TRUE; } #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL Deploy_(void); - void PrimaryAttack_(void); - void SecondaryAttack_(void); - void Reload_(void); - void WeaponIdle_(void); + BOOL Deploy_(); + void PrimaryAttack_(); + void SecondaryAttack_(); + void Reload_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL public: void USPFire(float flSpread, float flCycleTime, BOOL fUseSemi); - NOXREF void MakeBeam(void); - NOXREF void BeamUpdate(void); + NOXREF void MakeBeam(); + NOXREF void BeamUpdate(); -public: int m_iShell; private: unsigned short m_usFireUSP; - -};/* size: 344, cachelines: 6, members: 3 */ +}; /* <28adc9> ../cstrike/dlls/weapons.h:599 */ class CMP5N: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL Deploy(void); - virtual float GetMaxSpeed(void) - { - return MP5N_MAX_SPEED; - } - int iItemSlot(void) - { - return PRIMARY_WEAPON_SLOT; - } - virtual void PrimaryAttack(void); - virtual void Reload(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual BOOL Deploy(); + virtual float GetMaxSpeed() { return MP5N_MAX_SPEED; } + int iItemSlot() { return PRIMARY_WEAPON_SLOT; } + virtual void PrimaryAttack(); + virtual void Reload(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -686,46 +574,41 @@ public: #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL Deploy_(void); - void PrimaryAttack_(void); - void Reload_(void); - void WeaponIdle_(void); + BOOL Deploy_(); + void PrimaryAttack_(); + void Reload_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL public: void MP5NFire(float flSpread, float flCycleTime, BOOL fUseAutoAim); -public: int m_iShell; int iShellOn; private: unsigned short m_usFireMP5N; - -};/* size: 348, cachelines: 6, members: 4 */ +}; /* <2a553c> ../cstrike/dlls/weapons.h:624 */ class CSG552: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL Deploy(void); - virtual float GetMaxSpeed(void); - virtual int iItemSlot(void) - { - return PRIMARY_WEAPON_SLOT; - } - virtual void PrimaryAttack(void); - virtual void SecondaryAttack(void); - virtual void Reload(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual BOOL Deploy(); + virtual float GetMaxSpeed(); + virtual int iItemSlot() { return PRIMARY_WEAPON_SLOT; } + virtual void PrimaryAttack(); + virtual void SecondaryAttack(); + virtual void Reload(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -736,51 +619,43 @@ public: #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL Deploy_(void); - float GetMaxSpeed_(void); - void PrimaryAttack_(void); - void SecondaryAttack_(void); - void Reload_(void); - void WeaponIdle_(void); + BOOL Deploy_(); + float GetMaxSpeed_(); + void PrimaryAttack_(); + void SecondaryAttack_(); + void Reload_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL public: void SG552Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim); -public: int m_iShell; int iShellOn; private: unsigned short m_usFireSG552; - -};/* size: 348, cachelines: 6, members: 4 */ +}; /* <234730> ../cstrike/dlls/weapons.h:648 */ class CAK47: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL Deploy(void); - virtual float GetMaxSpeed(void) - { - return AK47_MAX_SPEED; - } - virtual int iItemSlot(void) - { - return PRIMARY_WEAPON_SLOT; - } - virtual void PrimaryAttack(void); - virtual void SecondaryAttack(void); - virtual void Reload(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual BOOL Deploy(); + virtual float GetMaxSpeed() { return AK47_MAX_SPEED; } + virtual int iItemSlot() { return PRIMARY_WEAPON_SLOT; } + virtual void PrimaryAttack(); + virtual void SecondaryAttack(); + virtual void Reload(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -791,50 +666,42 @@ public: #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL Deploy_(void); - void PrimaryAttack_(void); - void SecondaryAttack_(void); - void Reload_(void); - void WeaponIdle_(void); + BOOL Deploy_(); + void PrimaryAttack_(); + void SecondaryAttack_(); + void Reload_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL public: void AK47Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim); -public: int m_iShell; int iShellOn; private: unsigned short m_usFireAK47; - -};/* size: 348, cachelines: 6, members: 4 */ +}; /* <239b82> ../cstrike/dlls/weapons.h:672 */ class CAUG: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL Deploy(void); - virtual float GetMaxSpeed(void) - { - return AUG_MAX_SPEED; - } - virtual int iItemSlot(void) - { - return PRIMARY_WEAPON_SLOT; - } - virtual void PrimaryAttack(void); - virtual void SecondaryAttack(void); - virtual void Reload(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual BOOL Deploy(); + virtual float GetMaxSpeed() { return AUG_MAX_SPEED; } + virtual int iItemSlot() { return PRIMARY_WEAPON_SLOT; } + virtual void PrimaryAttack(); + virtual void SecondaryAttack(); + virtual void Reload(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -845,47 +712,42 @@ public: #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL Deploy_(void); - void PrimaryAttack_(void); - void SecondaryAttack_(void); - void Reload_(void); - void WeaponIdle_(void); + BOOL Deploy_(); + void PrimaryAttack_(); + void SecondaryAttack_(); + void Reload_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL public: void AUGFire(float flSpread, float flCycleTime, BOOL fUseAutoAim); -public: int m_iShell; int iShellOn; private: unsigned short m_usFireAug; - -};/* size: 348, cachelines: 6, members: 4 */ +}; /* <23ef02> ../cstrike/dlls/weapons.h:697 */ class CAWP: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL Deploy(void); - virtual float GetMaxSpeed(void); - virtual int iItemSlot(void) - { - return PRIMARY_WEAPON_SLOT; - } - virtual void PrimaryAttack(void); - virtual void SecondaryAttack(void); - virtual void Reload(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual BOOL Deploy(); + virtual float GetMaxSpeed(); + virtual int iItemSlot() { return PRIMARY_WEAPON_SLOT; } + virtual void PrimaryAttack(); + virtual void SecondaryAttack(); + virtual void Reload(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -896,48 +758,43 @@ public: #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL Deploy_(void); - float GetMaxSpeed_(void); - void PrimaryAttack_(void); - void SecondaryAttack_(void); - void Reload_(void); - void WeaponIdle_(void); + BOOL Deploy_(); + float GetMaxSpeed_(); + void PrimaryAttack_(); + void SecondaryAttack_(); + void Reload_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL public: void AWPFire(float flSpread, float flCycleTime, BOOL fUseAutoAim); -public: int m_iShell; private: unsigned short m_usFireAWP; - -};/* size: 344, cachelines: 6, members: 3 */ +}; /* <245949> ../cstrike/dlls/weapons.h:721 */ class CC4: public CBasePlayerWeapon { 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); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL Deploy(void); + virtual BOOL Deploy(); virtual void Holster(int skiplocal); - virtual float GetMaxSpeed(void); - virtual int iItemSlot(void) - { - return C4_SLOT; - } - virtual void PrimaryAttack(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual float GetMaxSpeed(); + virtual int iItemSlot() { return C4_SLOT; } + virtual void PrimaryAttack(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -948,16 +805,16 @@ public: #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); int GetItemInfo_(ItemInfo *p); - BOOL Deploy_(void); + BOOL Deploy_(); void Holster_(int skiplocal); - float GetMaxSpeed_(void); - void PrimaryAttack_(void); - void WeaponIdle_(void); + float GetMaxSpeed_(); + void PrimaryAttack_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL @@ -965,32 +822,26 @@ public: bool m_bStartedArming; bool m_bBombPlacedAnimation; float m_fArmedTime; + private: bool m_bHasShield; - -};/* size: 348, cachelines: 6, members: 5 */ +}; /* <24afee> ../cstrike/dlls/weapons.h:750 */ class CDEAGLE: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL Deploy(void); - virtual float GetMaxSpeed(void) - { - return m_fMaxSpeed; - } - virtual int iItemSlot(void) - { - return PISTOL_SLOT; - } - virtual void PrimaryAttack(void); - virtual void SecondaryAttack(void); - virtual void Reload(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual BOOL Deploy(); + virtual float GetMaxSpeed() { return m_fMaxSpeed; } + virtual int iItemSlot() { return PISTOL_SLOT; } + virtual void PrimaryAttack(); + virtual void SecondaryAttack(); + virtual void Reload(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -998,61 +849,47 @@ public: return FALSE; #endif } - virtual BOOL IsPistol(void) - { - return TRUE; - } + virtual BOOL IsPistol() { return TRUE; } #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL Deploy_(void); - void PrimaryAttack_(void); - void SecondaryAttack_(void); - void Reload_(void); - void WeaponIdle_(void); + BOOL Deploy_(); + void PrimaryAttack_(); + void SecondaryAttack_(); + void Reload_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL public: void DEAGLEFire(float flSpread, float flCycleTime, BOOL fUseSemi); -public: int m_iShell; private: unsigned short m_usFireDeagle; - -};/* size: 344, cachelines: 6, members: 3 */ +}; /* <25ab17> ../cstrike/dlls/weapons.h:778 */ class CFlashbang: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL CanDeploy(void); - virtual BOOL CanDrop(void) - { - return FALSE; - } - virtual BOOL Deploy(void); + virtual BOOL CanDeploy(); + virtual BOOL CanDrop() { return FALSE; } + virtual BOOL Deploy(); virtual void Holster(int skiplocal); - virtual float GetMaxSpeed(void) - { - return m_fMaxSpeed; - } - virtual int iItemSlot(void) - { - return GRENADE_SLOT; - } - virtual void PrimaryAttack(void); - virtual void SecondaryAttack(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual float GetMaxSpeed() { return m_fMaxSpeed; } + virtual int iItemSlot() { return GRENADE_SLOT; } + virtual void PrimaryAttack(); + virtual void SecondaryAttack(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -1060,7 +897,7 @@ public: return FALSE; #endif } - virtual BOOL IsPistol(void) + virtual BOOL IsPistol() { #ifdef REGAMEDLL_FIXES return FALSE; @@ -1072,43 +909,39 @@ public: #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL CanDeploy_(void); - BOOL Deploy_(void); + BOOL CanDeploy_(); + BOOL Deploy_(); void Holster_(int skiplocal); - void PrimaryAttack_(void); - void SecondaryAttack_(void); - void WeaponIdle_(void); + void PrimaryAttack_(); + void SecondaryAttack_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL public: bool ShieldSecondaryFire(int iUpAnim, int iDownAnim); - void SetPlayerShieldAnim(void); - void ResetPlayerShieldAnim(void); - -};/* size: 336, cachelines: 6, members: 1 */ + void SetPlayerShieldAnim(); + void ResetPlayerShieldAnim(); +}; /* <26006d> ../cstrike/dlls/weapons.h:803 */ class CG3SG1: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL Deploy(void); - virtual float GetMaxSpeed(void); - virtual int iItemSlot(void) - { - return PRIMARY_WEAPON_SLOT; - } - virtual void PrimaryAttack(void); - virtual void SecondaryAttack(void); - virtual void Reload(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual BOOL Deploy(); + virtual float GetMaxSpeed(); + virtual int iItemSlot() { return PRIMARY_WEAPON_SLOT; } + virtual void PrimaryAttack(); + virtual void SecondaryAttack(); + virtual void Reload(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -1119,50 +952,42 @@ public: #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL Deploy_(void); - float GetMaxSpeed_(void); - void PrimaryAttack_(void); - void SecondaryAttack_(void); - void Reload_(void); - void WeaponIdle_(void); + BOOL Deploy_(); + float GetMaxSpeed_(); + void PrimaryAttack_(); + void SecondaryAttack_(); + void Reload_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL public: void G3SG1Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim); -public: int m_iShell; private: unsigned short m_usFireG3SG1; - -};/* size: 344, cachelines: 6, members: 3 */ +}; /* <2655b2> ../cstrike/dlls/weapons.h:828 */ class CGLOCK18: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL Deploy(void); - virtual float GetMaxSpeed(void) - { - return m_fMaxSpeed; - } - virtual int iItemSlot(void) - { - return PISTOL_SLOT; - } - virtual void PrimaryAttack(void); - virtual void SecondaryAttack(void); - virtual void Reload(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual BOOL Deploy(); + virtual float GetMaxSpeed() { return m_fMaxSpeed; } + virtual int iItemSlot() { return PISTOL_SLOT; } + virtual void PrimaryAttack(); + virtual void SecondaryAttack(); + virtual void Reload(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -1170,21 +995,18 @@ public: return FALSE; #endif } - virtual BOOL IsPistol(void) - { - return TRUE; - } + virtual BOOL IsPistol() { return TRUE; } #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL Deploy_(void); - void PrimaryAttack_(void); - void SecondaryAttack_(void); - void Reload_(void); - void WeaponIdle_(void); + BOOL Deploy_(); + void PrimaryAttack_(); + void SecondaryAttack_(); + void Reload_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL @@ -1194,35 +1016,25 @@ public: public: int m_iShell; bool m_bBurstFire; - -};/* size: 344, cachelines: 6, members: 3 */ +}; /* <26a48a> ../cstrike/dlls/weapons.h:852 */ class CHEGrenade: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL CanDeploy(void); - virtual BOOL CanDrop(void) - { - return FALSE; - } - virtual BOOL Deploy(void); + virtual BOOL CanDeploy(); + virtual BOOL CanDrop() { return FALSE; } + virtual BOOL Deploy(); virtual void Holster(int skiplocal); - virtual float GetMaxSpeed(void) - { - return m_fMaxSpeed; - } - virtual int iItemSlot(void) - { - return GRENADE_SLOT; - } - virtual void PrimaryAttack(void); - virtual void SecondaryAttack(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual float GetMaxSpeed() { return m_fMaxSpeed; } + virtual int iItemSlot() { return GRENADE_SLOT; } + virtual void PrimaryAttack(); + virtual void SecondaryAttack(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -1233,52 +1045,42 @@ public: #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL CanDeploy_(void); - BOOL Deploy_(void); + BOOL CanDeploy_(); + BOOL Deploy_(); void Holster_(int skiplocal); - void PrimaryAttack_(void); - void SecondaryAttack_(void); - void WeaponIdle_(void); + void PrimaryAttack_(); + void SecondaryAttack_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL public: bool ShieldSecondaryFire(int iUpAnim, int iDownAnim); - void SetPlayerShieldAnim(void); - void ResetPlayerShieldAnim(void); + void SetPlayerShieldAnim(); + void ResetPlayerShieldAnim(); public: unsigned short m_usCreateExplosion; - -};/* size: 340, cachelines: 6, members: 2 */ +}; /* <26f804> ../cstrike/dlls/weapons.h:878 */ class CKnife: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL CanDrop(void) - { - return FALSE; - } - virtual BOOL Deploy(void); + virtual BOOL CanDrop() { return FALSE; } + virtual BOOL Deploy(); virtual void Holster(int skiplocal); - virtual float GetMaxSpeed(void) - { - return m_fMaxSpeed; - } - virtual int iItemSlot(void) - { - return KNIFE_SLOT; - } - virtual void PrimaryAttack(void); - virtual void SecondaryAttack(void); - virtual BOOL UseDecrement(void) + virtual float GetMaxSpeed() { return m_fMaxSpeed; } + virtual int iItemSlot() { return KNIFE_SLOT; } + virtual void PrimaryAttack(); + virtual void SecondaryAttack(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -1286,61 +1088,53 @@ public: return FALSE; #endif } - virtual void WeaponIdle(void); + virtual void WeaponIdle(); #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL Deploy_(void); + BOOL Deploy_(); void Holster_(int skiplocal); - void PrimaryAttack_(void); - void SecondaryAttack_(void); - void WeaponIdle_(void); + void PrimaryAttack_(); + void SecondaryAttack_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL public: - void EXPORT SwingAgain(void); - void EXPORT Smack(void); + void EXPORT SwingAgain(); + void EXPORT Smack(); -public: NOXREF void WeaponAnimation(int iAnimation); int Stab(int fFirst); int Swing(int fFirst); public: - virtual bool ShieldSecondaryFire(int iUpAnim, int iDownAnim); - virtual void SetPlayerShieldAnim(void); - virtual void ResetPlayerShieldAnim(void); + bool ShieldSecondaryFire(int iUpAnim, int iDownAnim); + void SetPlayerShieldAnim(); + void ResetPlayerShieldAnim(); public: TraceResult m_trHit; unsigned short m_usKnife; - -};/* size: 396, cachelines: 7, members: 3 */ +}; /* <275d5a> ../cstrike/dlls/weapons.h:910 */ class CM249: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL Deploy(void); - virtual float GetMaxSpeed(void) - { - return M249_MAX_SPEED; - } - virtual int iItemSlot(void) - { - return PRIMARY_WEAPON_SLOT; - } - virtual void PrimaryAttack(void); - virtual void Reload(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual BOOL Deploy(); + virtual float GetMaxSpeed() { return M249_MAX_SPEED; } + virtual int iItemSlot() { return PRIMARY_WEAPON_SLOT; } + virtual void PrimaryAttack(); + virtual void Reload(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -1351,48 +1145,40 @@ public: #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL Deploy_(void); - void PrimaryAttack_(void); - void Reload_(void); - void WeaponIdle_(void); + BOOL Deploy_(); + void PrimaryAttack_(); + void Reload_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL public: void M249Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim); -public: int m_iShell; int iShellOn; private: unsigned short m_usFireM249; - -};/* size: 348, cachelines: 6, members: 4 */ +}; /* <27b175> ../cstrike/dlls/weapons.h:934 */ class CM3: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL Deploy(void); - virtual float GetMaxSpeed(void) - { - return M3_MAX_SPEED; - } - virtual int iItemSlot(void) - { - return PRIMARY_WEAPON_SLOT; - } - virtual void PrimaryAttack(void); - virtual void Reload(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual BOOL Deploy(); + virtual float GetMaxSpeed() { return M3_MAX_SPEED; } + virtual int iItemSlot() { return PRIMARY_WEAPON_SLOT; } + virtual void PrimaryAttack(); + virtual void Reload(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -1403,13 +1189,13 @@ public: #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL Deploy_(void); - void PrimaryAttack_(void); - void Reload_(void); - void WeaponIdle_(void); + BOOL Deploy_(); + void PrimaryAttack_(); + void Reload_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL @@ -1419,27 +1205,23 @@ public: private: unsigned short m_usFireM3; - -};/* size: 348, cachelines: 6, members: 4 */ +}; /* <280488> ../cstrike/dlls/weapons.h:961 */ class CM4A1: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL Deploy(void); - virtual float GetMaxSpeed(void); - virtual int iItemSlot(void) - { - return PRIMARY_WEAPON_SLOT; - } - virtual void PrimaryAttack(void); - virtual void SecondaryAttack(void); - virtual void Reload(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual BOOL Deploy(); + virtual float GetMaxSpeed(); + virtual int iItemSlot() { return PRIMARY_WEAPON_SLOT; } + virtual void PrimaryAttack(); + virtual void SecondaryAttack(); + virtual void Reload(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -1450,50 +1232,42 @@ public: #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL Deploy_(void); - float GetMaxSpeed_(void); - void PrimaryAttack_(void); - void SecondaryAttack_(void); - void Reload_(void); - void WeaponIdle_(void); + BOOL Deploy_(); + float GetMaxSpeed_(); + void PrimaryAttack_(); + void SecondaryAttack_(); + void Reload_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL public: void M4A1Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim); -public: int m_iShell; int iShellOn; private: unsigned short m_usFireM4A1; - -};/* size: 348, cachelines: 6, members: 4 */ +}; /* <285993> ../cstrike/dlls/weapons.h:987 */ class CMAC10: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL Deploy(void); - virtual float GetMaxSpeed(void) - { - return MAC10_MAX_SPEED; - } - virtual int iItemSlot(void) - { - return PRIMARY_WEAPON_SLOT; - } - virtual void PrimaryAttack(void); - virtual void Reload(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual BOOL Deploy(); + virtual float GetMaxSpeed() { return MAC10_MAX_SPEED; } + virtual int iItemSlot() { return PRIMARY_WEAPON_SLOT; } + virtual void PrimaryAttack(); + virtual void Reload(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -1504,49 +1278,41 @@ public: #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL Deploy_(void); - void PrimaryAttack_(void); - void Reload_(void); - void WeaponIdle_(void); + BOOL Deploy_(); + void PrimaryAttack_(); + void Reload_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL public: void MAC10Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim); -public: int m_iShell; int iShellOn; private: unsigned short m_usFireMAC10; - -};/* size: 348, cachelines: 6, members: 4 */ +}; /* <2902c1> ../cstrike/dlls/weapons.h:1011 */ class CP228: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL Deploy(void); - virtual float GetMaxSpeed(void) - { - return m_fMaxSpeed; - } - virtual int iItemSlot(void) - { - return PISTOL_SLOT; - } - virtual void PrimaryAttack(void); - virtual void SecondaryAttack(void); - virtual void Reload(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual BOOL Deploy(); + virtual float GetMaxSpeed() { return m_fMaxSpeed; } + virtual int iItemSlot() { return PISTOL_SLOT; } + virtual void PrimaryAttack(); + virtual void SecondaryAttack(); + virtual void Reload(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -1554,54 +1320,47 @@ public: return FALSE; #endif } - virtual BOOL IsPistol(void) - { - return TRUE; - } + virtual BOOL IsPistol() { return TRUE; } #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL Deploy_(void); - void PrimaryAttack_(void); - void SecondaryAttack_(void); - void Reload_(void); - void WeaponIdle_(void); + BOOL Deploy_(); + void PrimaryAttack_(); + void SecondaryAttack_(); + void Reload_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL public: void P228Fire(float flSpread, float flCycleTime, BOOL fUseSemi); - NOXREF void MakeBeam(void); - NOXREF void BeamUpdate(void); + NOXREF void MakeBeam(); + NOXREF void BeamUpdate(); public: int m_iShell; private: unsigned short m_usFireP228; - -};/* size: 344, cachelines: 6, members: 3 */ +}; /* <295740> ../cstrike/dlls/weapons.h:1039 */ class CP90: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL Deploy(void); - virtual float GetMaxSpeed(void); - virtual int iItemSlot(void) - { - return PRIMARY_WEAPON_SLOT; - } - virtual void PrimaryAttack(void); - virtual void Reload(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual BOOL Deploy(); + virtual float GetMaxSpeed(); + virtual int iItemSlot() { return PRIMARY_WEAPON_SLOT; } + virtual void PrimaryAttack(); + virtual void Reload(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -1612,47 +1371,42 @@ public: #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL Deploy_(void); - float GetMaxSpeed_(void); - void PrimaryAttack_(void); - void Reload_(void); - void WeaponIdle_(void); + BOOL Deploy_(); + float GetMaxSpeed_(); + void PrimaryAttack_(); + void Reload_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL public: void P90Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim); -public: int m_iShell; int iShellOn; private: unsigned short m_usFireP90; - -};/* size: 348, cachelines: 6, members: 4 */ +}; /* <29abe0> ../cstrike/dlls/weapons.h:1063 */ class CSCOUT: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL Deploy(void); - virtual float GetMaxSpeed(void); - virtual int iItemSlot(void) - { - return PRIMARY_WEAPON_SLOT; - } - virtual void PrimaryAttack(void); - virtual void SecondaryAttack(void); - virtual void Reload(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual BOOL Deploy(); + virtual float GetMaxSpeed(); + virtual int iItemSlot() { return PRIMARY_WEAPON_SLOT; } + virtual void PrimaryAttack(); + virtual void SecondaryAttack(); + virtual void Reload(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -1663,55 +1417,43 @@ public: #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL Deploy_(void); - float GetMaxSpeed_(void); - void PrimaryAttack_(void); - void SecondaryAttack_(void); - void Reload_(void); - void WeaponIdle_(void); + BOOL Deploy_(); + float GetMaxSpeed_(); + void PrimaryAttack_(); + void SecondaryAttack_(); + void Reload_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL public: void SCOUTFire(float flSpread, float flCycleTime, BOOL fUseAutoAim); - -public: int m_iShell; private: unsigned short m_usFireScout; - -};/* size: 344, cachelines: 6, members: 3 */ +}; /* <2aa3d5> ../cstrike/dlls/weapons.h:1089 */ class CSmokeGrenade: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL CanDeploy(void); - virtual BOOL CanDrop(void) - { - return FALSE; - } - virtual BOOL Deploy(void); + virtual BOOL CanDeploy(); + virtual BOOL CanDrop() { return FALSE; } + virtual BOOL Deploy(); virtual void Holster(int skiplocal); - virtual float GetMaxSpeed(void) - { - return m_fMaxSpeed; - } - virtual int iItemSlot(void) - { - return GRENADE_SLOT; - } - virtual void PrimaryAttack(void); - virtual void SecondaryAttack(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual float GetMaxSpeed() { return m_fMaxSpeed; } + virtual int iItemSlot() { return GRENADE_SLOT; } + virtual void PrimaryAttack(); + virtual void SecondaryAttack(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -1722,48 +1464,41 @@ public: #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL CanDeploy_(void); - BOOL Deploy_(void); + BOOL CanDeploy_(); + BOOL Deploy_(); void Holster_(int skiplocal); - void PrimaryAttack_(void); - void SecondaryAttack_(void); - void WeaponIdle_(void); + void PrimaryAttack_(); + void SecondaryAttack_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL public: bool ShieldSecondaryFire(int iUpAnim, int iDownAnim); - void SetPlayerShieldAnim(void); - void ResetPlayerShieldAnim(void); + void SetPlayerShieldAnim(); + void ResetPlayerShieldAnim(); public: unsigned short m_usCreateSmoke; - -};/* size: 340, cachelines: 6, members: 2 */ +}; /* <2af8c3> ../cstrike/dlls/weapons.h:1116 */ class CTMP: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL Deploy(void); - virtual float GetMaxSpeed(void) - { - return TMP_MAX_SPEED; - } - virtual int iItemSlot(void) - { - return PRIMARY_WEAPON_SLOT; - } - virtual void PrimaryAttack(void); - virtual void Reload(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual BOOL Deploy(); + virtual float GetMaxSpeed() { return TMP_MAX_SPEED; } + virtual int iItemSlot() { return PRIMARY_WEAPON_SLOT; } + virtual void PrimaryAttack(); + virtual void Reload(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -1774,13 +1509,13 @@ public: #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL Deploy_(void); - void PrimaryAttack_(void); - void Reload_(void); - void WeaponIdle_(void); + BOOL Deploy_(); + void PrimaryAttack_(); + void Reload_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL @@ -1793,29 +1528,22 @@ public: private: unsigned short m_usFireTMP; - -};/* size: 348, cachelines: 6, members: 4 */ +}; /* <2c9fce> ../cstrike/dlls/weapons.h:1141 */ class CXM1014: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL Deploy(void); - virtual float GetMaxSpeed(void) - { - return XM1014_MAX_SPEED; - } - virtual int iItemSlot(void) - { - return PRIMARY_WEAPON_SLOT; - } - virtual void PrimaryAttack(void); - virtual void Reload(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual BOOL Deploy(); + virtual float GetMaxSpeed() { return XM1014_MAX_SPEED; } + virtual int iItemSlot() { return PRIMARY_WEAPON_SLOT; } + virtual void PrimaryAttack(); + virtual void Reload(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -1826,13 +1554,13 @@ public: #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL Deploy_(void); - void PrimaryAttack_(void); - void Reload_(void); - void WeaponIdle_(void); + BOOL Deploy_(); + void PrimaryAttack_(); + void Reload_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL @@ -1842,29 +1570,22 @@ public: private: unsigned short m_usFireXM1014; - -};/* size: 348, cachelines: 6, members: 4 */ +}; /* <2503f9> ../cstrike/dlls/weapons.h:1167 */ class CELITE: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL Deploy(void); - virtual float GetMaxSpeed(void) - { - return ELITE_MAX_SPEED; - } - virtual int iItemSlot(void) - { - return PISTOL_SLOT; - } - virtual void PrimaryAttack(void); - virtual void Reload(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual BOOL Deploy(); + virtual float GetMaxSpeed() { return ELITE_MAX_SPEED; } + virtual int iItemSlot() { return PISTOL_SLOT; } + virtual void PrimaryAttack(); + virtual void Reload(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -1872,20 +1593,17 @@ public: return FALSE; #endif } - virtual BOOL IsPistol(void) - { - return TRUE; - } + virtual BOOL IsPistol() { return TRUE; } #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL Deploy_(void); - void PrimaryAttack_(void); - void Reload_(void); - void WeaponIdle_(void); + BOOL Deploy_(); + void PrimaryAttack_(); + void Reload_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL @@ -1896,30 +1614,23 @@ public: int m_iShell; unsigned short m_usFireELITE_LEFT; unsigned short m_usFireELITE_RIGHT; - -};/* size: 344, cachelines: 6, members: 4 */ +}; /* <255b29> ../cstrike/dlls/weapons.h:1192 */ class CFiveSeven: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL Deploy(void); - virtual float GetMaxSpeed(void) - { - return m_fMaxSpeed; - } - virtual int iItemSlot(void) - { - return PISTOL_SLOT; - } - virtual void PrimaryAttack(void); - virtual void SecondaryAttack(void); - virtual void Reload(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual BOOL Deploy(); + virtual float GetMaxSpeed() { return m_fMaxSpeed; } + virtual int iItemSlot() { return PISTOL_SLOT; } + virtual void PrimaryAttack(); + virtual void SecondaryAttack(); + virtual void Reload(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -1927,57 +1638,47 @@ public: return FALSE; #endif } - virtual BOOL IsPistol(void) - { - return TRUE; - } + virtual BOOL IsPistol() { return TRUE; } #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL Deploy_(void); - void PrimaryAttack_(void); - void SecondaryAttack_(void); - void Reload_(void); - void WeaponIdle_(void); + BOOL Deploy_(); + void PrimaryAttack_(); + void SecondaryAttack_(); + void Reload_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL public: void FiveSevenFire(float flSpread, float flCycleTime, BOOL fUseSemi); - NOXREF void MakeBeam(void); - NOXREF void BeamUpdate(void); + NOXREF void MakeBeam(); + NOXREF void BeamUpdate(); public: int m_iShell; private: unsigned short m_usFireFiveSeven; - -};/* size: 344, cachelines: 6, members: 3 */ +}; /* <2b4cf9> ../cstrike/dlls/weapons.h:1219 */ class CUMP45: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL Deploy(void); - virtual float GetMaxSpeed(void) - { - return UMP45_MAX_SPEED; - } - virtual int iItemSlot(void) - { - return PRIMARY_WEAPON_SLOT; - } - virtual void PrimaryAttack(void); - virtual void Reload(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual BOOL Deploy(); + virtual float GetMaxSpeed() { return UMP45_MAX_SPEED; } + virtual int iItemSlot() { return PRIMARY_WEAPON_SLOT; } + virtual void PrimaryAttack(); + virtual void Reload(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -1988,13 +1689,13 @@ public: #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL Deploy_(void); - void PrimaryAttack_(void); - void Reload_(void); - void WeaponIdle_(void); + BOOL Deploy_(); + void PrimaryAttack_(); + void Reload_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL @@ -2007,27 +1708,23 @@ public: private: unsigned short m_usFireUMP45; - -};/* size: 348, cachelines: 6, members: 4 */ +}; /* <2a00b3> ../cstrike/dlls/weapons.h:1244 */ class CSG550: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL Deploy(void); - virtual float GetMaxSpeed(void); - virtual int iItemSlot(void) - { - return PRIMARY_WEAPON_SLOT; - } - virtual void PrimaryAttack(void); - virtual void SecondaryAttack(void); - virtual void Reload(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual BOOL Deploy(); + virtual float GetMaxSpeed(); + virtual int iItemSlot() { return PRIMARY_WEAPON_SLOT; } + virtual void PrimaryAttack(); + virtual void SecondaryAttack(); + virtual void Reload(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -2038,15 +1735,15 @@ public: #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL Deploy_(void); - float GetMaxSpeed_(void); - void PrimaryAttack_(void); - void SecondaryAttack_(void); - void Reload_(void); - void WeaponIdle_(void); + BOOL Deploy_(); + float GetMaxSpeed_(); + void PrimaryAttack_(); + void SecondaryAttack_(); + void Reload_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL @@ -2058,30 +1755,23 @@ public: private: unsigned short m_usFireSG550; - -};/* size: 344, cachelines: 6, members: 3 */ +}; /* <2c4bb9> ../cstrike/dlls/weapons.h:1269 */ class CGalil: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL Deploy(void); - virtual float GetMaxSpeed(void) - { - return GALIL_MAX_SPEED; - } - virtual int iItemSlot(void) - { - return PRIMARY_WEAPON_SLOT; - } - virtual void PrimaryAttack(void); - virtual void SecondaryAttack(void); - virtual void Reload(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual BOOL Deploy(); + virtual float GetMaxSpeed() { return GALIL_MAX_SPEED; } + virtual int iItemSlot() { return PRIMARY_WEAPON_SLOT; } + virtual void PrimaryAttack(); + virtual void SecondaryAttack(); + virtual void Reload(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -2092,14 +1782,14 @@ public: #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL Deploy_(void); - void PrimaryAttack_(void); - void SecondaryAttack_(void); - void Reload_(void); - void WeaponIdle_(void); + BOOL Deploy_(); + void PrimaryAttack_(); + void SecondaryAttack_(); + void Reload_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL @@ -2112,30 +1802,23 @@ public: private: unsigned short m_usFireGalil; - -};/* size: 348, cachelines: 6, members: 4 */ +}; /* <2bf676> ../cstrike/dlls/weapons.h:1293 */ class CFamas: public CBasePlayerWeapon { public: - virtual void Spawn(void); - virtual void Precache(void); + virtual void Spawn(); + virtual void Precache(); virtual int GetItemInfo(ItemInfo *p); - virtual BOOL Deploy(void); - virtual float GetMaxSpeed(void) - { - return FAMAS_MAX_SPEED; - } - virtual int iItemSlot(void) - { - return PRIMARY_WEAPON_SLOT; - } - virtual void PrimaryAttack(void); - virtual void SecondaryAttack(void); - virtual void Reload(void); - virtual void WeaponIdle(void); - virtual BOOL UseDecrement(void) + virtual BOOL Deploy(); + virtual float GetMaxSpeed() { return FAMAS_MAX_SPEED; } + virtual int iItemSlot() { return PRIMARY_WEAPON_SLOT; } + virtual void PrimaryAttack(); + virtual void SecondaryAttack(); + virtual void Reload(); + virtual void WeaponIdle(); + virtual BOOL UseDecrement() { #ifdef CLIENT_WEAPONS return TRUE; @@ -2146,14 +1829,14 @@ public: #ifdef HOOK_GAMEDLL - void Spawn_(void); - void Precache_(void); + void Spawn_(); + void Precache_(); int GetItemInfo_(ItemInfo *p); - BOOL Deploy_(void); - void PrimaryAttack_(void); - void SecondaryAttack_(void); - void Reload_(void); - void WeaponIdle_(void); + BOOL Deploy_(); + void PrimaryAttack_(); + void SecondaryAttack_(); + void Reload_(); + void WeaponIdle_(); #endif // HOOK_GAMEDLL @@ -2163,33 +1846,7 @@ public: public: int m_iShell; int iShellOn; - -};/* size: 344, cachelines: 6, members: 3 */ - -#ifdef HOOK_GAMEDLL - -#define g_sModelIndexLaser (*pg_sModelIndexLaser) -#define g_pModelNameLaser (*pg_pModelNameLaser) -#define g_sModelIndexLaserDot (*pg_sModelIndexLaserDot) - -#define g_sModelIndexFireball (*pg_sModelIndexFireball) -#define g_sModelIndexSmoke (*pg_sModelIndexSmoke) -#define g_sModelIndexWExplosion (*pg_sModelIndexWExplosion) -#define g_sModelIndexBubbles (*pg_sModelIndexBubbles) -#define g_sModelIndexBloodDrop (*pg_sModelIndexBloodDrop) -#define g_sModelIndexBloodSpray (*pg_sModelIndexBloodSpray) -#define g_sModelIndexSmokePuff (*pg_sModelIndexSmokePuff) -#define g_sModelIndexFireball2 (*pg_sModelIndexFireball2) -#define g_sModelIndexFireball3 (*pg_sModelIndexFireball3) -#define g_sModelIndexFireball4 (*pg_sModelIndexFireball4) -#define g_sModelIndexCTGhost (*pg_sModelIndexCTGhost) -#define g_sModelIndexTGhost (*pg_sModelIndexTGhost) -#define g_sModelIndexC4Glow (*pg_sModelIndexC4Glow) -#define giAmmoIndex (*pgiAmmoIndex) -#define g_sModelIndexRadio (*pg_sModelIndexRadio) -#define gMultiDamage (*pgMultiDamage) - -#endif // HOOK_GAMEDLL +}; extern short g_sModelIndexLaser; extern const char *g_pModelNameLaser; @@ -2209,7 +1866,6 @@ extern short g_sModelIndexCTGhost; extern short g_sModelIndexTGhost; extern short g_sModelIndexC4Glow; -extern int giAmmoIndex; extern short g_sModelIndexRadio; extern MULTIDAMAGE gMultiDamage; @@ -2217,7 +1873,7 @@ void FindHullIntersection(const Vector &vecSrc, TraceResult &tr, float *mins, fl void AnnounceFlashInterval(float interval, float offset = 0); int MaxAmmoCarry(int iszName); -void ClearMultiDamage(void); +void ClearMultiDamage(); void ApplyMultiDamage(entvars_t *pevInflictor, entvars_t *pevAttacker); void AddMultiDamage(entvars_t *pevInflictor, CBaseEntity *pEntity, float flDamage, int bitsDamageType); void SpawnBlood(Vector vecSpot, int bloodColor, float flDamage); @@ -2228,45 +1884,7 @@ NOXREF void EjectBrass2(const Vector &vecOrigin, const Vector &vecVelocity, floa void AddAmmoNameToAmmoRegistry(const char *szAmmoname); void UTIL_PrecacheOtherWeapon(const char *szClassname); NOXREF void UTIL_PrecacheOtherWeapon2(const char *szClassname); -void W_Precache(void); +void W_Precache(); BOOL CanAttack(float attack_time, float curtime, BOOL isPredicted); -#ifdef HOOK_GAMEDLL - -// linked object -C_DLLEXPORT void weapon_knife(entvars_t *pev); -C_DLLEXPORT void weapon_glock18(entvars_t *pev); -C_DLLEXPORT void weapon_c4(entvars_t *pev); -C_DLLEXPORT void weapon_usp(entvars_t *pev); -C_DLLEXPORT void weapon_smokegrenade(entvars_t *pev); -C_DLLEXPORT void weapon_m4a1(entvars_t *pev); -C_DLLEXPORT void weapon_hegrenade(entvars_t *pev); -C_DLLEXPORT void weapon_flashbang(entvars_t *pev); -C_DLLEXPORT void weapon_famas(entvars_t *pev); -C_DLLEXPORT void weapon_elite(entvars_t *pev); -C_DLLEXPORT void weapon_fiveseven(entvars_t *pev); -C_DLLEXPORT void weapon_p228(entvars_t *pev); -C_DLLEXPORT void weapon_xm1014(entvars_t *pev); -C_DLLEXPORT void weapon_g3sg1(entvars_t *pev); -C_DLLEXPORT void weapon_sg550(entvars_t *pev); -C_DLLEXPORT void weapon_deagle(entvars_t *pev); -C_DLLEXPORT void weapon_awp(entvars_t *pev); -C_DLLEXPORT void weapon_scout(entvars_t *pev); -C_DLLEXPORT void weapon_sg552(entvars_t *pev); -C_DLLEXPORT void weapon_m3(entvars_t *pev); -C_DLLEXPORT void weapon_aug(entvars_t *pev); -C_DLLEXPORT void weapon_galil(entvars_t *pev); -C_DLLEXPORT void weapon_ak47(entvars_t *pev); -C_DLLEXPORT void weapon_m249(entvars_t *pev); -C_DLLEXPORT void weapon_p90(entvars_t *pev); -C_DLLEXPORT void weapon_mac10(entvars_t *pev); -C_DLLEXPORT void weapon_ump45(entvars_t *pev); -C_DLLEXPORT void weapon_mp5navy(entvars_t *pev); -C_DLLEXPORT void weapon_tmp(entvars_t *pev); - -C_DLLEXPORT void armoury_entity(entvars_t *pev); -C_DLLEXPORT void weaponbox(entvars_t *pev); - -#endif // HOOK_GAMEDLL - #endif // WEAPONS_H diff --git a/regamedll/dlls/weapontype.cpp b/regamedll/dlls/weapontype.cpp index b1cc4e8e..6783c7e7 100644 --- a/regamedll/dlls/weapontype.cpp +++ b/regamedll/dlls/weapontype.cpp @@ -215,14 +215,6 @@ WeaponInfoStruct weaponInfo[] = { 0, 0, 0, 0, 0, 0, -1, NULL } }; -#else // HOOK_GAMEDLL - -AutoBuyInfoStruct g_autoBuyInfo[35]; -WeaponAliasInfo weaponAliasInfo[39]; -WeaponBuyAliasInfo weaponBuyAliasInfo[43]; -WeaponClassAliasInfo weaponClassAliasInfo[46]; -WeaponInfoStruct weaponInfo[27]; - #endif // HOOK_GAMEDLL // Given an alias, return the associated weapon ID @@ -333,7 +325,7 @@ bool IsPrimaryWeapon(int id) // Return true if given weapon ID is a secondary weapon /* <22cf19> ../cstrike/dlls/weapontype.cpp:318 */ -NOXREF bool IsSecondaryWeapon(int id) +bool IsSecondaryWeapon(int id) { switch (id) { diff --git a/regamedll/dlls/weapontype.h b/regamedll/dlls/weapontype.h index 8deff4db..0233eadb 100644 --- a/regamedll/dlls/weapontype.h +++ b/regamedll/dlls/weapontype.h @@ -322,7 +322,7 @@ enum shieldgun_e SHIELDGUN_DOWN, }; -//custom +// custom enum shieldgren_e { SHIELDREN_IDLE = 4, @@ -395,23 +395,9 @@ struct WeaponInfoStruct int maxRounds; int ammoType; char *entityName; -};/* size: 32, cachelines: 1, members: 8 */ - -#ifdef HOOK_GAMEDLL - -#define g_autoBuyInfo (*pg_autoBuyInfo) -#define weaponAliasInfo (*pweaponAliasInfo) -#define weaponBuyAliasInfo (*pweaponBuyAliasInfo) -#define weaponClassAliasInfo (*pweaponClassAliasInfo) -#define weaponInfo (*pweaponInfo) - -#endif // HOOK_GAMEDLL +}; extern AutoBuyInfoStruct g_autoBuyInfo[35]; -extern WeaponAliasInfo weaponAliasInfo[39]; -extern WeaponBuyAliasInfo weaponBuyAliasInfo[43]; -extern WeaponClassAliasInfo weaponClassAliasInfo[46]; -extern WeaponInfoStruct weaponInfo[27]; // WeaponType WeaponIdType AliasToWeaponID(const char *alias); @@ -420,7 +406,7 @@ const char *WeaponIDToAlias(int id); WeaponClassType AliasToWeaponClass(const char *alias); WeaponClassType WeaponIDToWeaponClass(int id); bool IsPrimaryWeapon(int id); -NOXREF bool IsSecondaryWeapon(int id); +bool IsSecondaryWeapon(int id); WeaponInfoStruct *GetWeaponInfo(int weaponID); bool CanBuyWeaponByMaptype(int playerTeam, WeaponIdType weaponID, bool useAssasinationRestrictions); diff --git a/regamedll/dlls/world.cpp b/regamedll/dlls/world.cpp index ef8d6a02..710a47ac 100644 --- a/regamedll/dlls/world.cpp +++ b/regamedll/dlls/world.cpp @@ -67,20 +67,25 @@ TYPEDESCRIPTION gGlobalEntitySaveData[] = DEFINE_FIELD(globalentity_t, state, FIELD_INTEGER) }; -#else // HOOK_GAMEDLL - -DLL_DECALLIST gDecals[42]; - -TYPEDESCRIPTION IMPL_CLASS(CGlobalState, m_SaveData)[1]; -TYPEDESCRIPTION gGlobalEntitySaveData[3]; - #endif // HOOK_GAMEDLL +/* <1d9f84> ../cstrike/dlls/world.cpp:111 */ +class CDecal: public CBaseEntity +{ +public: + virtual void Spawn(); + virtual void KeyValue(KeyValueData *pkvd); + +public: + void EXPORT StaticDecal(); + void EXPORT TriggerDecal(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); +}; + /* <1db42b> ../cstrike/dlls/world.cpp:120 */ LINK_ENTITY_TO_CLASS(infodecal, CDecal); /* <1db00a> ../cstrike/dlls/world.cpp:123 */ -void CDecal::__MAKE_VHOOK(Spawn)(void) +void CDecal::Spawn() { if (pev->skin < 0 || (gpGlobals->deathmatch != 0.0f && (pev->spawnflags & SF_DECAL_NOTINDEATHMATCH))) { @@ -132,7 +137,7 @@ void CDecal::TriggerDecal(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP } /* <1daee2> ../cstrike/dlls/world.cpp:171 */ -void CDecal::StaticDecal(void) +void CDecal::StaticDecal() { TraceResult trace; int entityIndex, modelIndex; @@ -142,16 +147,16 @@ void CDecal::StaticDecal(void) entityIndex = (short)ENTINDEX(trace.pHit); if (entityIndex) - modelIndex = (int)VARS(trace.pHit)->modelindex; + modelIndex = VARS(trace.pHit)->modelindex; else modelIndex = 0; - STATIC_DECAL(pev->origin, (int)pev->skin, entityIndex, modelIndex); + STATIC_DECAL(pev->origin, pev->skin, entityIndex, modelIndex); SUB_Remove(); } /* <1db068> ../cstrike/dlls/world.cpp:190 */ -void CDecal::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) +void CDecal::KeyValue(KeyValueData *pkvd) { if (FStrEq(pkvd->szKeyName, "texture")) { @@ -167,11 +172,20 @@ void CDecal::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) CBaseEntity::KeyValue(pkvd); } +// Body queue class here.... It's really just CBaseEntity + +/* <1d9fd1> ../cstrike/dlls/world.cpp:207 */ +class CCorpse: public CBaseEntity +{ +public: + virtual int ObjectCaps() { return FCAP_DONT_SAVE; } +}; + /* <1db4f5> ../cstrike/dlls/world.cpp:212 */ LINK_ENTITY_TO_CLASS(bodyque, CCorpse); /* <1da107> ../cstrike/dlls/world.cpp:214 */ -static void InitBodyQue(void) +static void InitBodyQue() { g_pBodyQueueHead = NULL; } @@ -213,19 +227,19 @@ void CopyToBodyQue(entvars_t *pev) } /* <1db5e9> ../cstrike/dlls/world.cpp:275 */ -void ClearBodyQue(void) +void ClearBodyQue() { ; } /* <1db601> ../cstrike/dlls/world.cpp:294 */ -CGlobalState::CGlobalState(void) +CGlobalState::CGlobalState() { Reset(); } /* <1db63b> ../cstrike/dlls/world.cpp:299 */ -void CGlobalState::Reset(void) +void CGlobalState::Reset() { m_pList = NULL; m_listCount = 0; @@ -254,7 +268,7 @@ globalentity_t *CGlobalState::Find(string_t globalname) // This is available all the time now on impulse 104, remove later /* <1db703> ../cstrike/dlls/world.cpp:329 */ -void CGlobalState::DumpGlobals(void) +void CGlobalState::DumpGlobals() { static char *estates[] = { "Off", "On", "Dead" }; globalentity_t *pTest; @@ -387,7 +401,7 @@ void CGlobalState::EntityUpdate(string_t globalname, string_t mapname) } /* <1dbbae> ../cstrike/dlls/world.cpp:453 */ -void CGlobalState::ClearStates(void) +void CGlobalState::ClearStates() { globalentity_t *pFree = m_pList; @@ -417,7 +431,7 @@ void EXT_FUNC RestoreGlobalState(SAVERESTOREDATA *pSaveData) } /* <1dbe72> ../cstrike/dlls/world.cpp:480 */ -void EXT_FUNC ResetGlobalState(void) +void EXT_FUNC ResetGlobalState() { gGlobalState.ClearStates(); @@ -429,7 +443,7 @@ void EXT_FUNC ResetGlobalState(void) LINK_ENTITY_TO_CLASS(worldspawn, CWorld); /* <1dad1d> ../cstrike/dlls/world.cpp:502 */ -void CWorld::__MAKE_VHOOK(Spawn)(void) +void CWorld::__MAKE_VHOOK(Spawn)() { EmptyEntityHashTable(); g_fGameOver = FALSE; @@ -472,7 +486,7 @@ void CWorld::__MAKE_VHOOK(Spawn)(void) } /* <1dac06> ../cstrike/dlls/world.cpp:542 */ -void CWorld::__MAKE_VHOOK(Precache)(void) +void CWorld::__MAKE_VHOOK(Precache)() { g_pLastSpawn = NULL; g_pLastCTSpawn = NULL; @@ -493,9 +507,9 @@ void CWorld::__MAKE_VHOOK(Precache)(void) g_pGameRules = (CHalfLifeMultiplay *)InstallGameRules(); - //!!!UNDONE why is there so much Spawn code in the Precache function? I'll just keep it here + // UNDONE why is there so much Spawn code in the Precache function? I'll just keep it here - ///!!!LATER - do we want a sound ent in deathmatch? (sjb) + // LATER - do we want a sound ent in deathmatch? (sjb) //pSoundEnt = CBaseEntity::Create("soundent", g_vecZero, g_vecZero, edict()); pSoundEnt = GetClassPtr((CSoundEnt *)NULL); pSoundEnt->Spawn(); @@ -526,7 +540,7 @@ void CWorld::__MAKE_VHOOK(Precache)(void) // clears sound channels PRECACHE_SOUND("common/null.wav"); - //!!! temporary sound for respawning weapons. + // temporary sound for respawning weapons. PRECACHE_SOUND("items/suitchargeok1.wav"); // player picks up a gun. @@ -734,32 +748,3 @@ void CWorld::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) else CBaseEntity::KeyValue(pkvd); } - -#ifdef HOOK_GAMEDLL - -void CDecal::Spawn(void) -{ - Spawn_(); -} - -void CDecal::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -void CWorld::Spawn(void) -{ - Spawn_(); -} - -void CWorld::Precache(void) -{ - Precache_(); -} - -void CWorld::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/world.h b/regamedll/dlls/world.h index 43bfc92c..f1eeece3 100644 --- a/regamedll/dlls/world.h +++ b/regamedll/dlls/world.h @@ -34,33 +34,13 @@ #define SF_DECAL_NOTINDEATHMATCH 2048 -#ifdef HOOK_GAMEDLL - -#define g_pBodyQueueHead (*pg_pBodyQueueHead) -#define gGlobalState (*pgGlobalState) -#define g_flWeaponCheat (*pg_flWeaponCheat) -#define gGlobalEntitySaveData (*pgGlobalEntitySaveData) - -#endif // HOOK_GAMEDLL - void CopyToBodyQue(entvars_t *pev); -void ClearBodyQue(void); +void ClearBodyQue(); void SaveGlobalState(SAVERESTOREDATA *pSaveData); void RestoreGlobalState(SAVERESTOREDATA *pSaveData); -void ResetGlobalState(void); +void ResetGlobalState(); -#ifdef HOOK_GAMEDLL - -// linked object -C_DLLEXPORT void infodecal(entvars_t *pev); -C_DLLEXPORT void bodyque(entvars_t *pev); -C_DLLEXPORT void worldspawn(entvars_t *pev); - -#endif // HOOK_GAMEDLL - -extern edict_t *g_pBodyQueueHead; extern CGlobalState gGlobalState; extern float g_flWeaponCheat; -extern TYPEDESCRIPTION gGlobalEntitySaveData[3]; #endif // WORLD_H diff --git a/regamedll/dlls/wpn_shared.h b/regamedll/dlls/wpn_shared.h index 23670e9f..b8de084e 100644 --- a/regamedll/dlls/wpn_shared.h +++ b/regamedll/dlls/wpn_shared.h @@ -56,21 +56,21 @@ enum awp_e //C4 -#define C4_MAX_AMMO 1 -#define C4_MAX_SPEED 250.0 -#define C4_ARMING_ON_TIME 3.0 - -enum c4_e -{ - C4_IDLE1, - C4_DRAW, - C4_DROP, - C4_ARM -}; - - - -//Deagle +#define C4_MAX_AMMO 1 +#define C4_MAX_SPEED 250.0 +#define C4_ARMING_ON_TIME 3.0 + +enum c4_e +{ + C4_IDLE1, + C4_DRAW, + C4_DROP, + C4_ARM +}; + + + +//Deagle #define DEAGLE_MAX_SPEED 250 #define DEAGLE_DAMAGE 54 #define DEAGLE_RANGE_MODIFER 0.81 @@ -117,25 +117,25 @@ enum elite_e //Famas -#define FAMAS_MAX_SPEED 240 +#define FAMAS_MAX_SPEED 240 #define FAMAS_RELOAD_TIME 3.3 -#define FAMAS_DAMAGE 30 +#define FAMAS_DAMAGE 30 #define FAMAS_DAMAGE_BURST 34 #define FAMAS_RANGE_MODIFER 0.96 -enum famas_e -{ - FAMAS_IDLE1, - FAMAS_RELOAD, - FAMAS_DRAW, - FAMAS_SHOOT1, - FAMAS_SHOOT2, - FAMAS_SHOOT3 -}; - - - -//Fiveseven +enum famas_e +{ + FAMAS_IDLE1, + FAMAS_RELOAD, + FAMAS_DRAW, + FAMAS_SHOOT1, + FAMAS_SHOOT2, + FAMAS_SHOOT3 +}; + + + +//Fiveseven #define FIVESEVEN_MAX_SPEED 250 #define FIVESEVEN_DAMAGE 20 #define FIVESEVEN_RANGE_MODIFER 0.885 @@ -333,23 +333,23 @@ enum m4a1_e //m249 -#define M249_MAX_SPEED 220 -#define M249_DAMAGE 32 -#define M249_RANGE_MODIFER 0.97 -#define M249_RELOAD_TIME 4.7 +#define M249_MAX_SPEED 220 +#define M249_DAMAGE 32 +#define M249_RANGE_MODIFER 0.97 +#define M249_RELOAD_TIME 4.7 -enum m249_e -{ - M249_IDLE1, - M249_SHOOT1, - M249_SHOOT2, - M249_RELOAD, - M249_DRAW -}; - - - -//mac10 +enum m249_e +{ + M249_IDLE1, + M249_SHOOT1, + M249_SHOOT2, + M249_RELOAD, + M249_DRAW +}; + + + +//mac10 #define MAC10_MAX_SPEED 250 #define MAC10_DAMAGE 29 #define MAC10_RANGE_MODIFER 0.82 diff --git a/regamedll/dlls/wpn_shared/wpn_ak47.cpp b/regamedll/dlls/wpn_shared/wpn_ak47.cpp index 3d4bd460..dd46e8c8 100644 --- a/regamedll/dlls/wpn_shared/wpn_ak47.cpp +++ b/regamedll/dlls/wpn_shared/wpn_ak47.cpp @@ -4,21 +4,22 @@ LINK_ENTITY_TO_CLASS(weapon_ak47, CAK47); /* <235327> ../cstrike/dlls/wpn_shared/wpn_ak47.cpp:52 */ -void CAK47::__MAKE_VHOOK(Spawn)(void) +void CAK47::__MAKE_VHOOK(Spawn)() { Precache(); + m_iId = WEAPON_AK47; SET_MODEL(edict(), "models/w_ak47.mdl"); m_iDefaultAmmo = AK47_DEFAULT_GIVE; - m_flAccuracy = 0.2; + m_flAccuracy = 0.2f; m_iShotsFired = 0; FallInit(); } /* <235280> ../cstrike/dlls/wpn_shared/wpn_ak47.cpp:66 */ -void CAK47::__MAKE_VHOOK(Precache)(void) +void CAK47::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_ak47.mdl"); PRECACHE_MODEL("models/w_ak47.mdl"); @@ -52,9 +53,9 @@ int CAK47::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <235300> ../cstrike/dlls/wpn_shared/wpn_ak47.cpp:99 */ -BOOL CAK47::__MAKE_VHOOK(Deploy)(void) +BOOL CAK47::__MAKE_VHOOK(Deploy)() { - m_flAccuracy = 0.2; + m_flAccuracy = 0.2f; m_iShotsFired = 0; iShellOn = 1; @@ -62,13 +63,13 @@ BOOL CAK47::__MAKE_VHOOK(Deploy)(void) } /* <2352da> ../cstrike/dlls/wpn_shared/wpn_ak47.cpp:108 */ -void CAK47::__MAKE_VHOOK(SecondaryAttack)(void) +void CAK47::__MAKE_VHOOK(SecondaryAttack)() { ; } /* <235523> ../cstrike/dlls/wpn_shared/wpn_ak47.cpp:112 */ -void CAK47::__MAKE_VHOOK(PrimaryAttack)(void) +void CAK47::__MAKE_VHOOK(PrimaryAttack)() { if (!(m_pPlayer->pev->flags & FL_ONGROUND)) { @@ -91,12 +92,12 @@ void CAK47::AK47Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) int flag; m_bDelayFire = true; - m_iShotsFired++; + ++m_iShotsFired; - m_flAccuracy = ((m_iShotsFired * m_iShotsFired * m_iShotsFired) / 200) + 0.35; + m_flAccuracy = ((m_iShotsFired * m_iShotsFired * m_iShotsFired) / 200) + 0.35f; - if (m_flAccuracy > 1.25) - m_flAccuracy = 1.25; + if (m_flAccuracy > 1.25f) + m_flAccuracy = 1.25f; if (m_iClip <= 0) { @@ -114,7 +115,7 @@ void CAK47::AK47Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) return; } - m_iClip--; + --m_iClip; m_pPlayer->pev->effects |= EF_MUZZLEFLASH; m_pPlayer->SetAnimation(PLAYER_ATTACK1); @@ -145,7 +146,7 @@ void CAK47::AK47Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0); } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.9; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.9f; if (m_pPlayer->pev->velocity.Length2D() > 0) { @@ -166,79 +167,33 @@ void CAK47::AK47Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) } /* <2353d8> ../cstrike/dlls/wpn_shared/wpn_ak47.cpp:204 */ -void CAK47::__MAKE_VHOOK(Reload)(void) +void CAK47::__MAKE_VHOOK(Reload)() { #ifdef REGAMEDLL_FIXES // to prevent reload if not enough ammo if (m_pPlayer->ammo_762nato <= 0) - { return; - } #endif // REGAMEDLL_FIXES if (DefaultReload(AK47_MAX_CLIP, AK47_RELOAD, AK47_RELOAD_TIME)) { m_pPlayer->SetAnimation(PLAYER_RELOAD); - m_flAccuracy = 0.2; + m_flAccuracy = 0.2f; m_iShotsFired = 0; m_bDelayFire = false; } } /* <23539d> ../cstrike/dlls/wpn_shared/wpn_ak47.cpp:219 */ -void CAK47::__MAKE_VHOOK(WeaponIdle)(void) +void CAK47::__MAKE_VHOOK(WeaponIdle)() { ResetEmptySound(); m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES); if (m_flTimeWeaponIdle <= UTIL_WeaponTimeBase()) { - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0f; SendWeaponAnim(AK47_IDLE1, UseDecrement() != FALSE); } } - -#ifdef HOOK_GAMEDLL - -void CAK47::Spawn(void) -{ - Spawn_(); -} - -void CAK47::Precache(void) -{ - Precache_(); -} - -int CAK47::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CAK47::Deploy(void) -{ - return Deploy_(); -} - -void CAK47::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CAK47::SecondaryAttack(void) -{ - SecondaryAttack_(); -} - -void CAK47::Reload(void) -{ - Reload_(); -} - -void CAK47::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_aug.cpp b/regamedll/dlls/wpn_shared/wpn_aug.cpp index 478cd415..bd45dcb4 100644 --- a/regamedll/dlls/wpn_shared/wpn_aug.cpp +++ b/regamedll/dlls/wpn_shared/wpn_aug.cpp @@ -4,21 +4,22 @@ LINK_ENTITY_TO_CLASS(weapon_aug, CAUG); /* <23a711> ../cstrike/dlls/wpn_shared/wpn_aug.cpp:52 */ -void CAUG::__MAKE_VHOOK(Spawn)(void) +void CAUG::__MAKE_VHOOK(Spawn)() { Precache(); + m_iId = WEAPON_AUG; SET_MODEL(edict(), "models/w_aug.mdl"); m_iDefaultAmmo = AUG_DEFAULT_GIVE; - m_flAccuracy = 0.2; + m_flAccuracy = 0.2f; m_iShotsFired = 0; FallInit(); } /* <23a66a> ../cstrike/dlls/wpn_shared/wpn_aug.cpp:66 */ -void CAUG::__MAKE_VHOOK(Precache)(void) +void CAUG::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_aug.mdl"); PRECACHE_MODEL("models/w_aug.mdl"); @@ -53,9 +54,9 @@ int CAUG::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <23a6ea> ../cstrike/dlls/wpn_shared/wpn_aug.cpp:100 */ -BOOL CAUG::__MAKE_VHOOK(Deploy)(void) +BOOL CAUG::__MAKE_VHOOK(Deploy)() { - m_flAccuracy = 0.2; + m_flAccuracy = 0.2f; m_iShotsFired = 0; iShellOn = 1; @@ -63,18 +64,18 @@ BOOL CAUG::__MAKE_VHOOK(Deploy)(void) } /* <23a6c4> ../cstrike/dlls/wpn_shared/wpn_aug.cpp:109 */ -void CAUG::__MAKE_VHOOK(SecondaryAttack)(void) +void CAUG::__MAKE_VHOOK(SecondaryAttack)() { if (m_pPlayer->m_iFOV == DEFAULT_FOV) m_pPlayer->pev->fov = m_pPlayer->m_iFOV = 55; else m_pPlayer->pev->fov = m_pPlayer->m_iFOV = 90; - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.3; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.3f; } /* <23aa31> ../cstrike/dlls/wpn_shared/wpn_aug.cpp:130 */ -void CAUG::__MAKE_VHOOK(PrimaryAttack)(void) +void CAUG::__MAKE_VHOOK(PrimaryAttack)() { if (!(m_pPlayer->pev->flags & FL_ONGROUND)) { @@ -101,12 +102,12 @@ void CAUG::AUGFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) int flag; m_bDelayFire = true; - m_iShotsFired++; + ++m_iShotsFired; - m_flAccuracy = ((m_iShotsFired * m_iShotsFired * m_iShotsFired) / 215) + 0.3; + m_flAccuracy = ((m_iShotsFired * m_iShotsFired * m_iShotsFired) / 215) + 0.3f; - if (m_flAccuracy > 1) - m_flAccuracy = 1; + if (m_flAccuracy > 1.0f) + m_flAccuracy = 1.0f; if (m_iClip <= 0) { @@ -124,7 +125,7 @@ void CAUG::AUGFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) return; } - m_iClip--; + --m_iClip; m_pPlayer->pev->effects |= EF_MUZZLEFLASH; m_pPlayer->SetAnimation(PLAYER_ATTACK1); @@ -155,7 +156,7 @@ void CAUG::AUGFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0); } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.9; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.9f; if (m_pPlayer->pev->velocity.Length2D() > 0) { @@ -176,12 +177,10 @@ void CAUG::AUGFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) } /* <23a7c2> ../cstrike/dlls/wpn_shared/wpn_aug.cpp:225 */ -void CAUG::__MAKE_VHOOK(Reload)(void) +void CAUG::__MAKE_VHOOK(Reload)() { if (m_pPlayer->ammo_556nato <= 0) - { return; - } if (DefaultReload(AUG_MAX_CLIP, AUG_RELOAD, AUG_RELOAD_TIME)) { @@ -199,7 +198,7 @@ void CAUG::__MAKE_VHOOK(Reload)(void) } /* <23a787> ../cstrike/dlls/wpn_shared/wpn_aug.cpp:245 */ -void CAUG::__MAKE_VHOOK(WeaponIdle)(void) +void CAUG::__MAKE_VHOOK(WeaponIdle)() { ResetEmptySound(); m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES); @@ -209,50 +208,6 @@ void CAUG::__MAKE_VHOOK(WeaponIdle)(void) return; } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0f; SendWeaponAnim(AUG_IDLE1, UseDecrement() != FALSE); } - -#ifdef HOOK_GAMEDLL - -void CAUG::Spawn(void) -{ - Spawn_(); -} - -void CAUG::Precache(void) -{ - Precache_(); -} - -int CAUG::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CAUG::Deploy(void) -{ - return Deploy_(); -} - -void CAUG::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CAUG::SecondaryAttack(void) -{ - SecondaryAttack_(); -} - -void CAUG::Reload(void) -{ - Reload_(); -} - -void CAUG::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_awp.cpp b/regamedll/dlls/wpn_shared/wpn_awp.cpp index 0392d8dd..cd05652b 100644 --- a/regamedll/dlls/wpn_shared/wpn_awp.cpp +++ b/regamedll/dlls/wpn_shared/wpn_awp.cpp @@ -4,9 +4,10 @@ LINK_ENTITY_TO_CLASS(weapon_awp, CAWP); /* <23fb10> ../cstrike/dlls/wpn_shared/wpn_awp.cpp:52 */ -void CAWP::__MAKE_VHOOK(Spawn)(void) +void CAWP::__MAKE_VHOOK(Spawn)() { Precache(); + m_iId = WEAPON_AWP; SET_MODEL(ENT(pev), "models/w_awp.mdl"); @@ -15,7 +16,7 @@ void CAWP::__MAKE_VHOOK(Spawn)(void) } /* <23fa2c> ../cstrike/dlls/wpn_shared/wpn_awp.cpp:64 */ -void CAWP::__MAKE_VHOOK(Precache)(void) +void CAWP::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_awp.mdl"); PRECACHE_MODEL("models/w_awp.mdl"); @@ -53,14 +54,13 @@ int CAWP::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <23fc19> ../cstrike/dlls/wpn_shared/wpn_awp.cpp:100 */ -BOOL CAWP::__MAKE_VHOOK(Deploy)(void) +BOOL CAWP::__MAKE_VHOOK(Deploy)() { if (DefaultDeploy("models/v_awp.mdl", "models/p_awp.mdl", AWP_DRAW, "rifle", UseDecrement() != FALSE)) { m_pPlayer->m_flNextAttack = GetNextAttackDelay(1.45); m_flNextPrimaryAttack = m_pPlayer->m_flNextAttack; - - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0f; return TRUE; } @@ -69,7 +69,7 @@ BOOL CAWP::__MAKE_VHOOK(Deploy)(void) } /* <23faac> ../cstrike/dlls/wpn_shared/wpn_awp.cpp:113 */ -void CAWP::__MAKE_VHOOK(SecondaryAttack)(void) +void CAWP::__MAKE_VHOOK(SecondaryAttack)() { switch (m_pPlayer->m_iFOV) { @@ -90,7 +90,7 @@ void CAWP::__MAKE_VHOOK(SecondaryAttack)(void) } /* <23fd53> ../cstrike/dlls/wpn_shared/wpn_awp.cpp:143 */ -void CAWP::__MAKE_VHOOK(PrimaryAttack)(void) +void CAWP::__MAKE_VHOOK(PrimaryAttack)() { if (!(m_pPlayer->pev->flags & FL_ONGROUND)) { @@ -132,7 +132,7 @@ void CAWP::AWPFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) // If we are not zoomed in, the bullet diverts more. else { - flSpread += 0.08; + flSpread += 0.08f; } if (m_iClip <= 0) @@ -151,14 +151,13 @@ void CAWP::AWPFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) return; } - m_iClip--; - + --m_iClip; m_pPlayer->pev->effects |= EF_MUZZLEFLASH; m_pPlayer->SetAnimation(PLAYER_ATTACK1); UTIL_MakeVectors(m_pPlayer->pev->v_angle + m_pPlayer->pev->punchangle); - m_pPlayer->m_flEjectBrass = gpGlobals->time + 0.55; + m_pPlayer->m_flEjectBrass = gpGlobals->time + 0.55f; m_pPlayer->m_iWeaponVolume = BIG_EXPLOSION_VOLUME; m_pPlayer->m_iWeaponFlash = NORMAL_GUN_FLASH; @@ -183,17 +182,15 @@ void CAWP::AWPFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0); } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2; - m_pPlayer->pev->punchangle.x -= 2; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0f; + m_pPlayer->pev->punchangle.x -= 2.0f; } /* <23fbc1> ../cstrike/dlls/wpn_shared/wpn_awp.cpp:239 */ -void CAWP::__MAKE_VHOOK(Reload)(void) +void CAWP::__MAKE_VHOOK(Reload)() { if (m_pPlayer->ammo_338mag <= 0) - { return; - } if (DefaultReload(AWP_MAX_CLIP, AWP_RELOAD, AWP_RELOAD_TIME)) { @@ -210,20 +207,20 @@ void CAWP::__MAKE_VHOOK(Reload)(void) } /* <23fb86> ../cstrike/dlls/wpn_shared/wpn_awp.cpp:265 */ -void CAWP::__MAKE_VHOOK(WeaponIdle)(void) +void CAWP::__MAKE_VHOOK(WeaponIdle)() { ResetEmptySound(); m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES); if (m_flTimeWeaponIdle <= UTIL_WeaponTimeBase() && m_iClip) { - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 60; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 60.0f; SendWeaponAnim(AWP_IDLE, UseDecrement() != FALSE); } } /* <23fa86> ../cstrike/dlls/wpn_shared/wpn_awp.cpp:283 */ -float CAWP::__MAKE_VHOOK(GetMaxSpeed)(void) +float CAWP::__MAKE_VHOOK(GetMaxSpeed)() { if (m_pPlayer->m_iFOV == DEFAULT_FOV) return AWP_MAX_SPEED; @@ -231,52 +228,3 @@ float CAWP::__MAKE_VHOOK(GetMaxSpeed)(void) // Slower speed when zoomed in. return AWP_MAX_SPEED_ZOOM; } - -#ifdef HOOK_GAMEDLL - -void CAWP::Spawn(void) -{ - Spawn_(); -} - -void CAWP::Precache(void) -{ - Precache_(); -} - -int CAWP::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CAWP::Deploy(void) -{ - return Deploy_(); -} - -float CAWP::GetMaxSpeed(void) -{ - return GetMaxSpeed_(); -} - -void CAWP::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CAWP::SecondaryAttack(void) -{ - SecondaryAttack_(); -} - -void CAWP::Reload(void) -{ - Reload_(); -} - -void CAWP::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_c4.cpp b/regamedll/dlls/wpn_shared/wpn_c4.cpp index 7ac30205..a42acc25 100644 --- a/regamedll/dlls/wpn_shared/wpn_c4.cpp +++ b/regamedll/dlls/wpn_shared/wpn_c4.cpp @@ -4,7 +4,7 @@ LINK_ENTITY_TO_CLASS(weapon_c4, CC4); /* <2469b9> ../cstrike/dlls/wpn_shared/wpn_c4.cpp:50 */ -void CC4::__MAKE_VHOOK(Spawn)(void) +void CC4::__MAKE_VHOOK(Spawn)() { SET_MODEL(edict(), "models/w_backpack.mdl"); @@ -28,11 +28,11 @@ void CC4::__MAKE_VHOOK(Spawn)(void) FallInit(); SetThink(&CBasePlayerItem::FallThink); - pev->nextthink = UTIL_WeaponTimeBase() + 0.1; + pev->nextthink = UTIL_WeaponTimeBase() + 0.1f; } /* <246418> ../cstrike/dlls/wpn_shared/wpn_c4.cpp:80 */ -void CC4::__MAKE_VHOOK(Precache)(void) +void CC4::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_c4.mdl"); PRECACHE_MODEL("models/w_backpack.mdl"); @@ -59,7 +59,7 @@ int CC4::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <2466d5> ../cstrike/dlls/wpn_shared/wpn_c4.cpp:105 */ -BOOL CC4::__MAKE_VHOOK(Deploy)(void) +BOOL CC4::__MAKE_VHOOK(Deploy)() { pev->body = 0; @@ -95,7 +95,7 @@ void CC4::__MAKE_VHOOK(Holster)(int skiplocal) } /* <2464e8> ../cstrike/dlls/wpn_shared/wpn_c4.cpp:152 */ -void CC4::__MAKE_VHOOK(PrimaryAttack)(void) +void CC4::__MAKE_VHOOK(PrimaryAttack)() { BOOL PlaceBomb; @@ -205,7 +205,7 @@ void CC4::__MAKE_VHOOK(PrimaryAttack)(void) // No more c4! m_pPlayer->SetBombIcon(FALSE); - m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--; + --m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]; if (!m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]) { @@ -257,7 +257,7 @@ void CC4::__MAKE_VHOOK(PrimaryAttack)(void) } /* <2464c1> ../cstrike/dlls/wpn_shared/wpn_c4.cpp:358 */ -void CC4::__MAKE_VHOOK(WeaponIdle)(void) +void CC4::__MAKE_VHOOK(WeaponIdle)() { if (m_bStartedArming) { @@ -322,7 +322,7 @@ void CC4::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_T return; } - CBasePlayer *pPlayer = reinterpret_cast(UTIL_PlayerByIndex(1)); + CBasePlayer *pPlayer = static_cast(UTIL_PlayerByIndex(1)); if (pPlayer != NULL) { @@ -355,61 +355,7 @@ void CC4::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_T } /* <2463cc> ../cstrike/dlls/weapons.h:732 */ -float CC4::__MAKE_VHOOK(GetMaxSpeed)(void) +float CC4::__MAKE_VHOOK(GetMaxSpeed)() { return C4_MAX_SPEED; } - -#ifdef HOOK_GAMEDLL - -void CC4::Spawn(void) -{ - Spawn_(); -} - -void CC4::Precache(void) -{ - Precache_(); -} - -void CC4::KeyValue(KeyValueData *pkvd) -{ - KeyValue_(pkvd); -} - -void CC4::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) -{ - Use_(pActivator, pCaller, useType, value); -} - -int CC4::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CC4::Deploy(void) -{ - return Deploy_(); -} - -void CC4::Holster(int skiplocal) -{ - Holster_(skiplocal); -} - -float CC4::GetMaxSpeed(void) -{ - return GetMaxSpeed_(); -} - -void CC4::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CC4::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_deagle.cpp b/regamedll/dlls/wpn_shared/wpn_deagle.cpp index b5f55591..ba0fe4ea 100644 --- a/regamedll/dlls/wpn_shared/wpn_deagle.cpp +++ b/regamedll/dlls/wpn_shared/wpn_deagle.cpp @@ -4,22 +4,23 @@ LINK_ENTITY_TO_CLASS(weapon_deagle, CDEAGLE); /* <24bbe5> ../cstrike/dlls/wpn_shared/wpn_deagle.cpp:51 */ -void CDEAGLE::__MAKE_VHOOK(Spawn)(void) +void CDEAGLE::__MAKE_VHOOK(Spawn)() { Precache(); + m_iId = WEAPON_DEAGLE; SET_MODEL(edict(), "models/w_deagle.mdl"); m_iDefaultAmmo = DEAGLE_DEFAULT_GIVE; m_iWeaponState &= ~WPNSTATE_SHIELD_DRAWN; m_fMaxSpeed = DEAGLE_MAX_SPEED; - m_flAccuracy = 0.9; + m_flAccuracy = 0.9f; FallInit(); } /* <24bb64> ../cstrike/dlls/wpn_shared/wpn_deagle.cpp:68 */ -void CDEAGLE::__MAKE_VHOOK(Precache)(void) +void CDEAGLE::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_deagle.mdl"); PRECACHE_MODEL("models/shield/v_shield_deagle.mdl"); @@ -54,9 +55,9 @@ int CDEAGLE::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <24bccf> ../cstrike/dlls/wpn_shared/wpn_deagle.cpp:103 */ -BOOL CDEAGLE::__MAKE_VHOOK(Deploy)(void) +BOOL CDEAGLE::__MAKE_VHOOK(Deploy)() { - m_flAccuracy = 0.9; + m_flAccuracy = 0.9f; m_fMaxSpeed = DEAGLE_MAX_SPEED; m_iWeaponState &= ~WPNSTATE_SHIELD_DRAWN; m_pPlayer->m_bShieldDrawn = false; @@ -68,7 +69,7 @@ BOOL CDEAGLE::__MAKE_VHOOK(Deploy)(void) } /* <24be08> ../cstrike/dlls/wpn_shared/wpn_deagle.cpp:119 */ -void CDEAGLE::__MAKE_VHOOK(PrimaryAttack)(void) +void CDEAGLE::__MAKE_VHOOK(PrimaryAttack)() { if (!(m_pPlayer->pev->flags & FL_ONGROUND)) { @@ -89,7 +90,7 @@ void CDEAGLE::__MAKE_VHOOK(PrimaryAttack)(void) } /* <24bbbe> ../cstrike/dlls/wpn_shared/wpn_deagle.cpp:131 */ -void CDEAGLE::__MAKE_VHOOK(SecondaryAttack)(void) +void CDEAGLE::__MAKE_VHOOK(SecondaryAttack)() { ShieldSecondaryFire(SHIELDGUN_UP, SHIELDGUN_DOWN); } @@ -100,7 +101,7 @@ void CDEAGLE::DEAGLEFire(float flSpread, float flCycleTime, BOOL fUseSemi) Vector vecAiming, vecSrc, vecDir; int flag; - flCycleTime -= 0.075; + flCycleTime -= 0.075f; if (++m_iShotsFired > 1) { @@ -109,15 +110,15 @@ void CDEAGLE::DEAGLEFire(float flSpread, float flCycleTime, BOOL fUseSemi) if (m_flLastFire != 0.0) { - m_flAccuracy -= (0.4 - (gpGlobals->time - m_flLastFire)) * 0.35; + m_flAccuracy -= (0.4f - (gpGlobals->time - m_flLastFire)) * 0.35f; - if (m_flAccuracy > 0.9) + if (m_flAccuracy > 0.9f) { - m_flAccuracy = 0.9; + m_flAccuracy = 0.9f; } - else if (m_flAccuracy < 0.55) + else if (m_flAccuracy < 0.55f) { - m_flAccuracy = 0.55; + m_flAccuracy = 0.55f; } } @@ -139,7 +140,7 @@ void CDEAGLE::DEAGLEFire(float flSpread, float flCycleTime, BOOL fUseSemi) return; } - m_iClip--; + --m_iClip; m_pPlayer->pev->effects |= EF_MUZZLEFLASH; SetPlayerShieldAnim(); @@ -170,83 +171,37 @@ void CDEAGLE::DEAGLEFire(float flSpread, float flCycleTime, BOOL fUseSemi) m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, FALSE); } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.8; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.8f; m_pPlayer->pev->punchangle.x -= 2; ResetPlayerShieldAnim(); } /* <24bc95> ../cstrike/dlls/wpn_shared/wpn_deagle.cpp:231 */ -void CDEAGLE::__MAKE_VHOOK(Reload)(void) +void CDEAGLE::__MAKE_VHOOK(Reload)() { if (m_pPlayer->ammo_50ae <= 0) - { return; - } if (DefaultReload(DEAGLE_MAX_CLIP, DEAGLE_RELOAD, DEAGLE_RELOAD_TIME)) { m_pPlayer->SetAnimation(PLAYER_RELOAD); - m_flAccuracy = 0.9; + m_flAccuracy = 0.9f; } } /* <24bc5b> ../cstrike/dlls/wpn_shared/wpn_deagle.cpp:243 */ -void CDEAGLE::__MAKE_VHOOK(WeaponIdle)(void) +void CDEAGLE::__MAKE_VHOOK(WeaponIdle)() { ResetEmptySound(); m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES); if (m_flTimeWeaponIdle <= UTIL_WeaponTimeBase()) { - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0f; - if (FBitSet(m_iWeaponState, WPNSTATE_SHIELD_DRAWN)) + if (m_iWeaponState & WPNSTATE_SHIELD_DRAWN) { SendWeaponAnim(SHIELDGUN_DRAWN_IDLE, UseDecrement() != FALSE); } } } - -#ifdef HOOK_GAMEDLL - -void CDEAGLE::Spawn(void) -{ - Spawn_(); -} - -void CDEAGLE::Precache(void) -{ - Precache_(); -} - -int CDEAGLE::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CDEAGLE::Deploy(void) -{ - return Deploy_(); -} - -void CDEAGLE::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CDEAGLE::SecondaryAttack(void) -{ - SecondaryAttack_(); -} - -void CDEAGLE::Reload(void) -{ - Reload_(); -} - -void CDEAGLE::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_elite.cpp b/regamedll/dlls/wpn_shared/wpn_elite.cpp index ca5b4cd2..ba9ff2fb 100644 --- a/regamedll/dlls/wpn_shared/wpn_elite.cpp +++ b/regamedll/dlls/wpn_shared/wpn_elite.cpp @@ -4,20 +4,21 @@ LINK_ENTITY_TO_CLASS(weapon_elite, CELITE); /* <251034> ../cstrike/dlls/wpn_shared/wpn_elite.cpp:54 */ -void CELITE::__MAKE_VHOOK(Spawn)(void) +void CELITE::__MAKE_VHOOK(Spawn)() { Precache(); + m_iId = WEAPON_ELITE; SET_MODEL(edict(), "models/w_elite.mdl"); m_iDefaultAmmo = ELITE_DEFAULT_GIVE; - m_flAccuracy = 0.88; + m_flAccuracy = 0.88f; FallInit(); } /* <250fb3> ../cstrike/dlls/wpn_shared/wpn_elite.cpp:67 */ -void CELITE::__MAKE_VHOOK(Precache)(void) +void CELITE::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_elite.mdl"); PRECACHE_MODEL("models/w_elite.mdl"); @@ -55,9 +56,9 @@ int CELITE::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <25100d> ../cstrike/dlls/wpn_shared/wpn_elite.cpp:103 */ -BOOL CELITE::__MAKE_VHOOK(Deploy)(void) +BOOL CELITE::__MAKE_VHOOK(Deploy)() { - m_flAccuracy = 0.88; + m_flAccuracy = 0.88f; if (!(m_iClip & 1)) { @@ -68,7 +69,7 @@ BOOL CELITE::__MAKE_VHOOK(Deploy)(void) } /* <251335> ../cstrike/dlls/wpn_shared/wpn_elite.cpp:114 */ -void CELITE::__MAKE_VHOOK(PrimaryAttack)(void) +void CELITE::__MAKE_VHOOK(PrimaryAttack)() { if (!(m_pPlayer->pev->flags & FL_ONGROUND)) { @@ -98,14 +99,12 @@ void CELITE::ELITEFire(float flSpread, float flCycleTime, BOOL fUseSemi) Vector vecDir; #ifdef REGAMEDLL_FIXES - flCycleTime -= 0.078; + flCycleTime -= 0.078f; #else - flCycleTime -= 0.125; + flCycleTime -= 0.125f; #endif // REGAMEDLL_FIXES - m_iShotsFired++; - - if (m_iShotsFired > 1) + if (++m_iShotsFired > 1) { return; } @@ -114,15 +113,15 @@ void CELITE::ELITEFire(float flSpread, float flCycleTime, BOOL fUseSemi) if (m_flLastFire) { - m_flAccuracy -= (0.325 - flTimeDiff) * 0.275; + m_flAccuracy -= (0.325f - flTimeDiff) * 0.275f; - if (m_flAccuracy > 0.88) + if (m_flAccuracy > 0.88f) { - m_flAccuracy = 0.88; + m_flAccuracy = 0.88f; } - else if (m_flAccuracy < 0.55) + else if (m_flAccuracy < 0.55f) { - m_flAccuracy = 0.55; + m_flAccuracy = 0.55f; } } @@ -145,8 +144,8 @@ void CELITE::ELITEFire(float flSpread, float flCycleTime, BOOL fUseSemi) } m_flNextPrimaryAttack = m_flNextSecondaryAttack = GetNextAttackDelay(flCycleTime); - m_iClip--; + --m_iClip; m_pPlayer->m_iWeaponVolume = BIG_EXPLOSION_VOLUME; m_pPlayer->m_iWeaponFlash = DIM_GUN_FLASH; @@ -191,30 +190,26 @@ void CELITE::ELITEFire(float flSpread, float flCycleTime, BOOL fUseSemi) m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0); } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0; - m_pPlayer->pev->punchangle.x -= 2.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0f; + m_pPlayer->pev->punchangle.x -= 2.0f; } /* <2510f8> ../cstrike/dlls/wpn_shared/wpn_elite.cpp:239 */ -void CELITE::__MAKE_VHOOK(Reload)(void) +void CELITE::__MAKE_VHOOK(Reload)() { if (m_pPlayer->ammo_9mm <= 0) - { return; - } if (DefaultReload(ELITE_MAX_CLIP, ELITE_RELOAD, ELITE_RELOAD_TIME)) { m_pPlayer->SetAnimation(PLAYER_RELOAD); - m_flAccuracy = 0.88; + m_flAccuracy = 0.88f; } } /* <24fed7> ../cstrike/dlls/wpn_shared/wpn_elite.cpp:251 */ -void CELITE::__MAKE_VHOOK(WeaponIdle)(void) +void CELITE::__MAKE_VHOOK(WeaponIdle)() { - int iAnim; - ResetEmptySound(); m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES); @@ -222,49 +217,9 @@ void CELITE::__MAKE_VHOOK(WeaponIdle)(void) { if (m_iClip) { - iAnim = (m_iClip == 1) ? ELITE_IDLE_LEFTEMPTY : ELITE_IDLE; - - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 60.0; + int iAnim = (m_iClip == 1) ? ELITE_IDLE_LEFTEMPTY : ELITE_IDLE; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 60.0f; SendWeaponAnim(iAnim, UseDecrement() != FALSE); } } } - -#ifdef HOOK_GAMEDLL - -void CELITE::Spawn(void) -{ - Spawn_(); -} - -void CELITE::Precache(void) -{ - Precache_(); -} - -int CELITE::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CELITE::Deploy(void) -{ - return Deploy_(); -} - -void CELITE::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CELITE::Reload(void) -{ - Reload_(); -} - -void CELITE::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_famas.cpp b/regamedll/dlls/wpn_shared/wpn_famas.cpp index c56e8832..71eacd23 100644 --- a/regamedll/dlls/wpn_shared/wpn_famas.cpp +++ b/regamedll/dlls/wpn_shared/wpn_famas.cpp @@ -4,9 +4,10 @@ LINK_ENTITY_TO_CLASS(weapon_famas, CFamas); /* <2c0284> ../cstrike/dlls/wpn_shared/wpn_famas.cpp:52 */ -void CFamas::__MAKE_VHOOK(Spawn)(void) +void CFamas::__MAKE_VHOOK(Spawn)() { Precache(); + m_iId = WEAPON_FAMAS; SET_MODEL(edict(), "models/w_famas.mdl"); @@ -18,7 +19,7 @@ void CFamas::__MAKE_VHOOK(Spawn)(void) } /* <2c01dc> ../cstrike/dlls/wpn_shared/wpn_famas.cpp:66 */ -void CFamas::__MAKE_VHOOK(Precache)(void) +void CFamas::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_famas.mdl"); PRECACHE_MODEL("models/w_famas.mdl"); @@ -55,12 +56,12 @@ int CFamas::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <2c025d> ../cstrike/dlls/wpn_shared/wpn_famas.cpp:102 */ -BOOL CFamas::__MAKE_VHOOK(Deploy)(void) +BOOL CFamas::__MAKE_VHOOK(Deploy)() { m_iShotsFired = 0; m_iFamasShotsFired = 0; m_flFamasShoot = 0; - m_flAccuracy = 0.2; + m_flAccuracy = 0.2f; iShellOn = 1; @@ -68,7 +69,7 @@ BOOL CFamas::__MAKE_VHOOK(Deploy)(void) } /* <2c0236> ../cstrike/dlls/wpn_shared/wpn_famas.cpp:114 */ -void CFamas::__MAKE_VHOOK(SecondaryAttack)(void) +void CFamas::__MAKE_VHOOK(SecondaryAttack)() { if (m_iWeaponState & WPNSTATE_FAMAS_BURST_MODE) { @@ -81,11 +82,11 @@ void CFamas::__MAKE_VHOOK(SecondaryAttack)(void) m_iWeaponState |= WPNSTATE_FAMAS_BURST_MODE; } - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.3; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.3f; } /* <2c04fe> ../cstrike/dlls/wpn_shared/wpn_famas.cpp:129 */ -void CFamas::__MAKE_VHOOK(PrimaryAttack)(void) +void CFamas::__MAKE_VHOOK(PrimaryAttack)() { if (m_pPlayer->pev->waterlevel == 3) { @@ -120,20 +121,20 @@ void CFamas::FamasFire(float flSpread, float flCycleTime, BOOL fUseAutoAim, BOOL if (bFireBurst) { m_iFamasShotsFired = 0; - flCycleTime = 0.55; + flCycleTime = 0.55f; } else { - flSpread += 0.01; + flSpread += 0.01f; } m_bDelayFire = true; - m_iShotsFired++; + ++m_iShotsFired; - m_flAccuracy = (m_iShotsFired * m_iShotsFired * m_iShotsFired / 215) + 0.3; + m_flAccuracy = (m_iShotsFired * m_iShotsFired * m_iShotsFired / 215) + 0.3f; - if (m_flAccuracy > 1) - m_flAccuracy = 1; + if (m_flAccuracy > 1.0f) + m_flAccuracy = 1.0f; if (m_iClip <= 0) { @@ -151,8 +152,7 @@ void CFamas::FamasFire(float flSpread, float flCycleTime, BOOL fUseAutoAim, BOOL return; } - m_iClip--; - + --m_iClip; m_pPlayer->pev->effects |= EF_MUZZLEFLASH; m_pPlayer->SetAnimation(PLAYER_ATTACK1); @@ -183,7 +183,7 @@ void CFamas::FamasFire(float flSpread, float flCycleTime, BOOL fUseAutoAim, BOOL m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0); } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.1; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.1f; if (m_pPlayer->pev->velocity.Length2D() > 0) { @@ -204,19 +204,17 @@ void CFamas::FamasFire(float flSpread, float flCycleTime, BOOL fUseAutoAim, BOOL if (bFireBurst) { - m_iFamasShotsFired++; + ++m_iFamasShotsFired; m_fBurstSpread = flSpread; - m_flFamasShoot = gpGlobals->time + 0.05; + m_flFamasShoot = gpGlobals->time + 0.05f; } } /* <2c0336> ../cstrike/dlls/wpn_shared/wpn_famas.cpp:262 */ -void CFamas::__MAKE_VHOOK(Reload)(void) +void CFamas::__MAKE_VHOOK(Reload)() { if (m_pPlayer->ammo_556nato <= 0) - { return; - } if (DefaultReload(FAMAS_MAX_CLIP, FAMAS_RELOAD, FAMAS_RELOAD_TIME)) { @@ -234,58 +232,14 @@ void CFamas::__MAKE_VHOOK(Reload)(void) } /* <2c02fa> ../cstrike/dlls/wpn_shared/wpn_famas.cpp:284 */ -void CFamas::__MAKE_VHOOK(WeaponIdle)(void) +void CFamas::__MAKE_VHOOK(WeaponIdle)() { ResetEmptySound(); m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES); if (m_flTimeWeaponIdle <= UTIL_WeaponTimeBase()) { - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0f; SendWeaponAnim(FAMAS_IDLE1, UseDecrement() != FALSE); } } - -#ifdef HOOK_GAMEDLL - -void CFamas::Spawn(void) -{ - Spawn_(); -} - -void CFamas::Precache(void) -{ - Precache_(); -} - -int CFamas::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CFamas::Deploy(void) -{ - return Deploy_(); -} - -void CFamas::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CFamas::SecondaryAttack(void) -{ - SecondaryAttack_(); -} - -void CFamas::Reload(void) -{ - Reload_(); -} - -void CFamas::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_fiveseven.cpp b/regamedll/dlls/wpn_shared/wpn_fiveseven.cpp index 7c04aabd..1d4a1410 100644 --- a/regamedll/dlls/wpn_shared/wpn_fiveseven.cpp +++ b/regamedll/dlls/wpn_shared/wpn_fiveseven.cpp @@ -4,21 +4,22 @@ LINK_ENTITY_TO_CLASS(weapon_fiveseven, CFiveSeven); /* <256720> ../cstrike/dlls/wpn_shared/wpn_fiveseven.cpp:51 */ -void CFiveSeven::__MAKE_VHOOK(Spawn)(void) +void CFiveSeven::__MAKE_VHOOK(Spawn)() { Precache(); + m_iId = WEAPON_FIVESEVEN; SET_MODEL(edict(), "models/w_fiveseven.mdl"); m_iDefaultAmmo = FIVESEVEN_DEFAULT_GIVE; m_iWeaponState &= ~WPNSTATE_SHIELD_DRAWN; - m_flAccuracy = 0.92; + m_flAccuracy = 0.92f; FallInit(); } /* <25669f> ../cstrike/dlls/wpn_shared/wpn_fiveseven.cpp:66 */ -void CFiveSeven::__MAKE_VHOOK(Precache)(void) +void CFiveSeven::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_fiveseven.mdl"); PRECACHE_MODEL("models/w_fiveseven.mdl"); @@ -53,9 +54,9 @@ int CFiveSeven::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <25680a> ../cstrike/dlls/wpn_shared/wpn_fiveseven.cpp:101 */ -BOOL CFiveSeven::__MAKE_VHOOK(Deploy)(void) +BOOL CFiveSeven::__MAKE_VHOOK(Deploy)() { - m_flAccuracy = 0.92; + m_flAccuracy = 0.92f; m_fMaxSpeed = FIVESEVEN_MAX_SPEED; m_iWeaponState &= ~WPNSTATE_SHIELD_DRAWN; m_pPlayer->m_bShieldDrawn = false; @@ -67,7 +68,7 @@ BOOL CFiveSeven::__MAKE_VHOOK(Deploy)(void) } /* <256943> ../cstrike/dlls/wpn_shared/wpn_fiveseven.cpp:117 */ -void CFiveSeven::__MAKE_VHOOK(PrimaryAttack)(void) +void CFiveSeven::__MAKE_VHOOK(PrimaryAttack)() { if (!(m_pPlayer->pev->flags & FL_ONGROUND)) { @@ -88,7 +89,7 @@ void CFiveSeven::__MAKE_VHOOK(PrimaryAttack)(void) } /* <2566f9> ../cstrike/dlls/wpn_shared/wpn_fiveseven.cpp:129 */ -void CFiveSeven::__MAKE_VHOOK(SecondaryAttack)(void) +void CFiveSeven::__MAKE_VHOOK(SecondaryAttack)() { ShieldSecondaryFire(SHIELDGUN_UP, SHIELDGUN_DOWN); } @@ -106,17 +107,17 @@ void CFiveSeven::FiveSevenFire(float flSpread, float flCycleTime, BOOL fUseSemi) return; } - if (m_flLastFire != 0.0) + if (m_flLastFire != 0.0f) { - m_flAccuracy -= (0.275 - (gpGlobals->time - m_flLastFire)) * 0.25; + m_flAccuracy -= (0.275f - (gpGlobals->time - m_flLastFire)) * 0.25f; - if (m_flAccuracy > 0.92) + if (m_flAccuracy > 0.92f) { - m_flAccuracy = 0.92; + m_flAccuracy = 0.92f; } - else if (m_flAccuracy < 0.725) + else if (m_flAccuracy < 0.725f) { - m_flAccuracy = 0.725; + m_flAccuracy = 0.725f; } } @@ -138,7 +139,7 @@ void CFiveSeven::FiveSevenFire(float flSpread, float flCycleTime, BOOL fUseSemi) return; } - m_iClip--; + --m_iClip; m_pPlayer->pev->effects |= EF_MUZZLEFLASH; SetPlayerShieldAnim(); @@ -151,8 +152,7 @@ void CFiveSeven::FiveSevenFire(float flSpread, float flCycleTime, BOOL fUseSemi) vecSrc = m_pPlayer->GetGunPosition(); vecAiming = gpGlobals->v_forward; - vecDir = m_pPlayer->FireBullets3(vecSrc, vecAiming, flSpread, 4096, 1, BULLET_PLAYER_57MM, FIVESEVEN_DAMAGE, FIVESEVEN_RANGE_MODIFER, m_pPlayer->pev, false, // TODO: why fiveseven not is IsPistol? - m_pPlayer->random_seed); + vecDir = m_pPlayer->FireBullets3(vecSrc, vecAiming, flSpread, 4096, 1, BULLET_PLAYER_57MM, FIVESEVEN_DAMAGE, FIVESEVEN_RANGE_MODIFER, m_pPlayer->pev, false, m_pPlayer->random_seed); #ifdef CLIENT_WEAPONS flag = FEV_NOTHOST; @@ -170,28 +170,26 @@ void CFiveSeven::FiveSevenFire(float flSpread, float flCycleTime, BOOL fUseSemi) m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, FALSE); } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2; - m_pPlayer->pev->punchangle.x -= 2; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0f; + m_pPlayer->pev->punchangle.x -= 2.0f; ResetPlayerShieldAnim(); } /* <2567d0> ../cstrike/dlls/wpn_shared/wpn_fiveseven.cpp:225 */ -void CFiveSeven::__MAKE_VHOOK(Reload)(void) +void CFiveSeven::__MAKE_VHOOK(Reload)() { if (m_pPlayer->ammo_57mm <= 0) - { return; - } if (DefaultReload(FIVESEVEN_MAX_CLIP, FIVESEVEN_RELOAD, FIVESEVEN_RELOAD_TIME)) { m_pPlayer->SetAnimation(PLAYER_RELOAD); - m_flAccuracy = 0.92; + m_flAccuracy = 0.92f; } } /* <256796> ../cstrike/dlls/wpn_shared/wpn_fiveseven.cpp:238 */ -void CFiveSeven::__MAKE_VHOOK(WeaponIdle)(void) +void CFiveSeven::__MAKE_VHOOK(WeaponIdle)() { ResetEmptySound(); m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES); @@ -203,7 +201,7 @@ void CFiveSeven::__MAKE_VHOOK(WeaponIdle)(void) if (m_pPlayer->HasShield()) { - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0f; if (m_iWeaponState & WPNSTATE_SHIELD_DRAWN) { @@ -212,51 +210,7 @@ void CFiveSeven::__MAKE_VHOOK(WeaponIdle)(void) } else if (m_iClip) { - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0625; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0625f; SendWeaponAnim(FIVESEVEN_IDLE, UseDecrement() != FALSE); } } - -#ifdef HOOK_GAMEDLL - -void CFiveSeven::Spawn(void) -{ - Spawn_(); -} - -void CFiveSeven::Precache(void) -{ - Precache_(); -} - -int CFiveSeven::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CFiveSeven::Deploy(void) -{ - return Deploy_(); -} - -void CFiveSeven::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CFiveSeven::SecondaryAttack(void) -{ - SecondaryAttack_(); -} - -void CFiveSeven::Reload(void) -{ - Reload_(); -} - -void CFiveSeven::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_flashbang.cpp b/regamedll/dlls/wpn_shared/wpn_flashbang.cpp index f1cde457..fd4626e4 100644 --- a/regamedll/dlls/wpn_shared/wpn_flashbang.cpp +++ b/regamedll/dlls/wpn_shared/wpn_flashbang.cpp @@ -4,9 +4,10 @@ LINK_ENTITY_TO_CLASS(weapon_flashbang, CFlashbang); /* <25b72f> ../cstrike/dlls/wpn_shared/wpn_flashbang.cpp:39 */ -void CFlashbang::__MAKE_VHOOK(Spawn)(void) +void CFlashbang::__MAKE_VHOOK(Spawn)() { Precache(); + m_iId = WEAPON_FLASHBANG; SET_MODEL(edict(), "models/w_flashbang.mdl"); @@ -14,7 +15,7 @@ void CFlashbang::__MAKE_VHOOK(Spawn)(void) m_iDefaultAmmo = FLASHBANG_DEFAULT_GIVE; m_flStartThrow = 0; - m_flReleaseThrow = -1.0; + m_flReleaseThrow = -1.0f; m_iWeaponState &= ~WPNSTATE_SHIELD_DRAWN; // get ready to fall down. @@ -22,7 +23,7 @@ void CFlashbang::__MAKE_VHOOK(Spawn)(void) } /* <25b67a> ../cstrike/dlls/wpn_shared/wpn_flashbang.cpp:58 */ -void CFlashbang::__MAKE_VHOOK(Precache)(void) +void CFlashbang::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_flashbang.mdl"); PRECACHE_MODEL("models/shield/v_shield_flashbang.mdl"); @@ -51,9 +52,9 @@ int CFlashbang::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <25b7df> ../cstrike/dlls/wpn_shared/wpn_flashbang.cpp:87 */ -BOOL CFlashbang::__MAKE_VHOOK(Deploy)(void) +BOOL CFlashbang::__MAKE_VHOOK(Deploy)() { - m_flReleaseThrow = -1.0; + m_flReleaseThrow = -1.0f; m_fMaxSpeed = FLASHBANG_MAX_SPEED; m_iWeaponState &= ~WPNSTATE_SHIELD_DRAWN; @@ -68,7 +69,7 @@ BOOL CFlashbang::__MAKE_VHOOK(Deploy)(void) /* <25b6fa> ../cstrike/dlls/wpn_shared/wpn_flashbang.cpp:102 */ void CFlashbang::__MAKE_VHOOK(Holster)(int skiplocal) { - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; if (!m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]) { @@ -77,11 +78,11 @@ void CFlashbang::__MAKE_VHOOK(Holster)(int skiplocal) } m_flStartThrow = 0; - m_flReleaseThrow = -1.0; + m_flReleaseThrow = -1.0f; } /* <25b7a5> ../cstrike/dlls/wpn_shared/wpn_flashbang.cpp:118 */ -void CFlashbang::__MAKE_VHOOK(PrimaryAttack)(void) +void CFlashbang::__MAKE_VHOOK(PrimaryAttack)() { if (m_iWeaponState & WPNSTATE_SHIELD_DRAWN) { @@ -94,7 +95,7 @@ void CFlashbang::__MAKE_VHOOK(PrimaryAttack)(void) m_flStartThrow = gpGlobals->time; SendWeaponAnim(FLASHBANG_PULLPIN, UseDecrement() != FALSE); - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5f; } } @@ -130,21 +131,21 @@ bool CFlashbang::ShieldSecondaryFire(int iUpAnim, int iDownAnim) m_pPlayer->UpdateShieldCrosshair((m_iWeaponState & WPNSTATE_SHIELD_DRAWN) != WPNSTATE_SHIELD_DRAWN); m_pPlayer->ResetMaxSpeed(); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.4; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.4f; m_flNextPrimaryAttack = GetNextAttackDelay(0.4); - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.6; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.6f; return true; } /* <25b81a> ../cstrike/dlls/wpn_shared/wpn_flashbang.cpp:171 */ -void CFlashbang::__MAKE_VHOOK(SecondaryAttack)(void) +void CFlashbang::__MAKE_VHOOK(SecondaryAttack)() { ShieldSecondaryFire(SHIELDGUN_DRAW, SHIELDGUN_DRAWN_IDLE); } /* <25bb97> ../cstrike/dlls/wpn_shared/wpn_flashbang.cpp:176 */ -void CFlashbang::SetPlayerShieldAnim(void) +void CFlashbang::SetPlayerShieldAnim() { if (!m_pPlayer->HasShield()) return; @@ -156,7 +157,7 @@ void CFlashbang::SetPlayerShieldAnim(void) } /* <25bbb9> ../cstrike/dlls/wpn_shared/wpn_flashbang.cpp:187 */ -void CFlashbang::ResetPlayerShieldAnim(void) +void CFlashbang::ResetPlayerShieldAnim() { if (!m_pPlayer->HasShield()) return; @@ -168,7 +169,7 @@ void CFlashbang::ResetPlayerShieldAnim(void) } /* <25a8bd> ../cstrike/dlls/wpn_shared/wpn_flashbang.cpp:198 */ -void CFlashbang::__MAKE_VHOOK(WeaponIdle)(void) +void CFlashbang::__MAKE_VHOOK(WeaponIdle)() { if (m_flReleaseThrow == 0 && m_flStartThrow != 0.0f) m_flReleaseThrow = gpGlobals->time; @@ -187,7 +188,7 @@ void CFlashbang::__MAKE_VHOOK(WeaponIdle)(void) else angThrow.x = -10 + angThrow.x * ((90 + 10) / 90.0); - float_precision flVel = (90.0 - angThrow.x) * 6.0; + float_precision flVel = (90.0f - angThrow.x) * 6.0f; if (flVel > 750.0f) flVel = 750.0f; @@ -207,11 +208,9 @@ void CFlashbang::__MAKE_VHOOK(WeaponIdle)(void) m_flStartThrow = 0; m_flNextPrimaryAttack = GetNextAttackDelay(0.5); - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.75; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.75f; - m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--; - - if (!m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]) + if (--m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0) { // just threw last grenade // set attack times in the future, and weapon idle in the future so we can see the whole throw @@ -235,7 +234,7 @@ void CFlashbang::__MAKE_VHOOK(WeaponIdle)(void) if (m_pPlayer->HasShield()) { - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0f; if (m_iWeaponState & WPNSTATE_SHIELD_DRAWN) { @@ -259,7 +258,7 @@ void CFlashbang::__MAKE_VHOOK(WeaponIdle)(void) // TODO: This is a bug? iAnim = *(int *)&flRand; #endif // REGAMEDLL_FIXES - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 75.0 / 30.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 75.0f / 30.0f; } SendWeaponAnim(iAnim, UseDecrement() != FALSE); @@ -268,56 +267,7 @@ void CFlashbang::__MAKE_VHOOK(WeaponIdle)(void) } /* <25b6d4> ../cstrike/dlls/wpn_shared/wpn_flashbang.cpp:315 */ -BOOL CFlashbang::__MAKE_VHOOK(CanDeploy)(void) +BOOL CFlashbang::__MAKE_VHOOK(CanDeploy)() { return m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] != 0; } - -#ifdef HOOK_GAMEDLL - -void CFlashbang::Spawn(void) -{ - Spawn_(); -} - -void CFlashbang::Precache(void) -{ - Precache_(); -} - -int CFlashbang::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CFlashbang::CanDeploy(void) -{ - return CanDeploy_(); -} - -BOOL CFlashbang::Deploy(void) -{ - return Deploy_(); -} - -void CFlashbang::Holster(int skiplocal) -{ - Holster_(skiplocal); -} - -void CFlashbang::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CFlashbang::SecondaryAttack(void) -{ - SecondaryAttack_(); -} - -void CFlashbang::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_g3sg1.cpp b/regamedll/dlls/wpn_shared/wpn_g3sg1.cpp index e03cd032..663a7c78 100644 --- a/regamedll/dlls/wpn_shared/wpn_g3sg1.cpp +++ b/regamedll/dlls/wpn_shared/wpn_g3sg1.cpp @@ -4,9 +4,10 @@ LINK_ENTITY_TO_CLASS(weapon_g3sg1, CG3SG1); /* <260ca2> ../cstrike/dlls/wpn_shared/wpn_g3sg1.cpp:50 */ -void CG3SG1::__MAKE_VHOOK(Spawn)(void) +void CG3SG1::__MAKE_VHOOK(Spawn)() { Precache(); + m_iId = WEAPON_G3SG1; SET_MODEL(edict(), "models/w_g3sg1.mdl"); @@ -17,7 +18,7 @@ void CG3SG1::__MAKE_VHOOK(Spawn)(void) } /* <260b97> ../cstrike/dlls/wpn_shared/wpn_g3sg1.cpp:63 */ -void CG3SG1::__MAKE_VHOOK(Precache)(void) +void CG3SG1::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_g3sg1.mdl"); PRECACHE_MODEL("models/w_g3sg1.mdl"); @@ -51,14 +52,14 @@ int CG3SG1::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <260c7b> ../cstrike/dlls/wpn_shared/wpn_g3sg1.cpp:96 */ -BOOL CG3SG1::__MAKE_VHOOK(Deploy)(void) +BOOL CG3SG1::__MAKE_VHOOK(Deploy)() { - m_flAccuracy = 0.2; + m_flAccuracy = 0.2f; return DefaultDeploy("models/v_g3sg1.mdl", "models/p_g3sg1.mdl", G3SG1_DRAW, "mp5", UseDecrement() != FALSE); } /* <260c17> ../cstrike/dlls/wpn_shared/wpn_g3sg1.cpp:102 */ -void CG3SG1::__MAKE_VHOOK(SecondaryAttack)(void) +void CG3SG1::__MAKE_VHOOK(SecondaryAttack)() { switch (m_pPlayer->m_iFOV) { @@ -80,11 +81,11 @@ void CG3SG1::__MAKE_VHOOK(SecondaryAttack)(void) } EMIT_SOUND(m_pPlayer->edict(), CHAN_ITEM, "weapons/zoom.wav", 0.2, 2.4); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.3; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.3f; } /* <260eaa> ../cstrike/dlls/wpn_shared/wpn_g3sg1.cpp:133 */ -void CG3SG1::__MAKE_VHOOK(PrimaryAttack)(void) +void CG3SG1::__MAKE_VHOOK(PrimaryAttack)() { if (!(m_pPlayer->pev->flags & FL_ONGROUND)) { @@ -112,21 +113,21 @@ void CG3SG1::G3SG1Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) if (m_pPlayer->pev->fov == DEFAULT_FOV) { - flSpread += 0.025; + flSpread += 0.025f; } if (m_flLastFire) { - m_flAccuracy = (gpGlobals->time - m_flLastFire) * 0.3 + 0.55; + m_flAccuracy = (gpGlobals->time - m_flLastFire) * 0.3f + 0.55f; - if (m_flAccuracy > 0.98) + if (m_flAccuracy > 0.98f) { - m_flAccuracy = 0.98; + m_flAccuracy = 0.98f; } } else { - m_flAccuracy = 0.98; + m_flAccuracy = 0.98f; } m_flLastFire = gpGlobals->time; @@ -147,8 +148,7 @@ void CG3SG1::G3SG1Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) return; } - m_iClip--; - + --m_iClip; m_pPlayer->pev->effects |= EF_MUZZLEFLASH; m_pPlayer->SetAnimation(PLAYER_ATTACK1); @@ -178,23 +178,21 @@ void CG3SG1::G3SG1Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0); } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.8; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.8f; - m_pPlayer->pev->punchangle.x -= UTIL_SharedRandomFloat(m_pPlayer->random_seed + 4, 0.75, 1.75) + m_pPlayer->pev->punchangle.x * 0.25; + m_pPlayer->pev->punchangle.x -= UTIL_SharedRandomFloat(m_pPlayer->random_seed + 4, 0.75, 1.75) + m_pPlayer->pev->punchangle.x * 0.25f; m_pPlayer->pev->punchangle.y += UTIL_SharedRandomFloat(m_pPlayer->random_seed + 5, -0.75, 0.75); } /* <260d53> ../cstrike/dlls/wpn_shared/wpn_g3sg1.cpp:234 */ -void CG3SG1::__MAKE_VHOOK(Reload)(void) +void CG3SG1::__MAKE_VHOOK(Reload)() { if (m_pPlayer->ammo_762nato <= 0) - { return; - } if (DefaultReload(G3SG1_MAX_CLIP, G3SG1_RELOAD, G3SG1_RELOAD_TIME)) { - m_flAccuracy = 0.2; + m_flAccuracy = 0.2f; m_pPlayer->SetAnimation(PLAYER_RELOAD); if (m_pPlayer->pev->fov != DEFAULT_FOV) @@ -206,7 +204,7 @@ void CG3SG1::__MAKE_VHOOK(Reload)(void) } /* <260d18> ../cstrike/dlls/wpn_shared/wpn_g3sg1.cpp:260 */ -void CG3SG1::__MAKE_VHOOK(WeaponIdle)(void) +void CG3SG1::__MAKE_VHOOK(WeaponIdle)() { ResetEmptySound(); m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES); @@ -215,63 +213,14 @@ void CG3SG1::__MAKE_VHOOK(WeaponIdle)(void) { if (m_iClip) { - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 60; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 60.0f; SendWeaponAnim(G3SG1_IDLE, UseDecrement() != FALSE); } } } /* <260bf1> ../cstrike/dlls/wpn_shared/wpn_g3sg1.cpp:277 */ -float CG3SG1::__MAKE_VHOOK(GetMaxSpeed)(void) +float CG3SG1::__MAKE_VHOOK(GetMaxSpeed)() { return (m_pPlayer->m_iFOV == DEFAULT_FOV) ? G3SG1_MAX_SPEED : G3SG1_MAX_SPEED_ZOOM; } - -#ifdef HOOK_GAMEDLL - -void CG3SG1::Spawn(void) -{ - Spawn_(); -} - -void CG3SG1::Precache(void) -{ - Precache_(); -} - -int CG3SG1::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CG3SG1::Deploy(void) -{ - return Deploy_(); -} - -float CG3SG1::GetMaxSpeed(void) -{ - return GetMaxSpeed_(); -} - -void CG3SG1::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CG3SG1::SecondaryAttack(void) -{ - SecondaryAttack_(); -} - -void CG3SG1::Reload(void) -{ - Reload_(); -} - -void CG3SG1::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_galil.cpp b/regamedll/dlls/wpn_shared/wpn_galil.cpp index 5e8ad444..019378ff 100644 --- a/regamedll/dlls/wpn_shared/wpn_galil.cpp +++ b/regamedll/dlls/wpn_shared/wpn_galil.cpp @@ -4,9 +4,10 @@ LINK_ENTITY_TO_CLASS(weapon_galil, CGalil); /* <2c57b0> ../cstrike/dlls/wpn_shared/wpn_galil.cpp:52 */ -void CGalil::__MAKE_VHOOK(Spawn)(void) +void CGalil::__MAKE_VHOOK(Spawn)() { Precache(); + m_iId = WEAPON_GALIL; SET_MODEL(edict(), "models/w_galil.mdl"); @@ -16,7 +17,7 @@ void CGalil::__MAKE_VHOOK(Spawn)(void) } /* <2c5709> ../cstrike/dlls/wpn_shared/wpn_galil.cpp:65 */ -void CGalil::__MAKE_VHOOK(Precache)(void) +void CGalil::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_galil.mdl"); PRECACHE_MODEL("models/w_galil.mdl"); @@ -50,9 +51,9 @@ int CGalil::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <2c5789> ../cstrike/dlls/wpn_shared/wpn_galil.cpp:98 */ -BOOL CGalil::__MAKE_VHOOK(Deploy)(void) +BOOL CGalil::__MAKE_VHOOK(Deploy)() { - m_flAccuracy = 0.2; + m_flAccuracy = 0.2f; m_iShotsFired = 0; iShellOn = 1; @@ -60,13 +61,13 @@ BOOL CGalil::__MAKE_VHOOK(Deploy)(void) } /* <2c5763> ../cstrike/dlls/wpn_shared/wpn_galil.cpp:107 */ -void CGalil::__MAKE_VHOOK(SecondaryAttack)(void) +void CGalil::__MAKE_VHOOK(SecondaryAttack)() { ; } /* <2c59d2> ../cstrike/dlls/wpn_shared/wpn_galil.cpp:111 */ -void CGalil::__MAKE_VHOOK(PrimaryAttack)(void) +void CGalil::__MAKE_VHOOK(PrimaryAttack)() { if (m_pPlayer->pev->waterlevel == 3) { @@ -96,12 +97,12 @@ void CGalil::GalilFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) int flag; m_bDelayFire = true; - m_iShotsFired++; + ++m_iShotsFired; - m_flAccuracy = ((m_iShotsFired * m_iShotsFired * m_iShotsFired) / 200) + 0.35; + m_flAccuracy = ((m_iShotsFired * m_iShotsFired * m_iShotsFired) / 200) + 0.35f; - if (m_flAccuracy > 1.25) - m_flAccuracy = 1.25; + if (m_flAccuracy > 1.25f) + m_flAccuracy = 1.25f; if (m_iClip <= 0) { @@ -119,7 +120,7 @@ void CGalil::GalilFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) return; } - m_iClip--; + --m_iClip; m_pPlayer->pev->effects |= EF_MUZZLEFLASH; m_pPlayer->SetAnimation(PLAYER_ATTACK1); @@ -150,7 +151,7 @@ void CGalil::GalilFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0); } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.28; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.28f; if (m_pPlayer->pev->velocity.Length2D() > 0) { @@ -171,79 +172,33 @@ void CGalil::GalilFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) } /* <2c5861> ../cstrike/dlls/wpn_shared/wpn_galil.cpp:210 */ -void CGalil::__MAKE_VHOOK(Reload)(void) +void CGalil::__MAKE_VHOOK(Reload)() { #ifdef REGAMEDLL_FIXES // to prevent reload if not enough ammo if (m_pPlayer->ammo_556nato <= 0) - { return; - } #endif // REGAMEDLL_FIXES if (DefaultReload(GALIL_MAX_CLIP, GALIL_RELOAD, GALIL_RELOAD_TIME)) { m_pPlayer->SetAnimation(PLAYER_RELOAD); - m_flAccuracy = 0.2; + m_flAccuracy = 0.2f; m_iShotsFired = 0; m_bDelayFire = false; } } /* <2c5826> ../cstrike/dlls/wpn_shared/wpn_galil.cpp:232 */ -void CGalil::__MAKE_VHOOK(WeaponIdle)(void) +void CGalil::__MAKE_VHOOK(WeaponIdle)() { ResetEmptySound(); m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES); if (m_flTimeWeaponIdle <= UTIL_WeaponTimeBase()) { - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0f; SendWeaponAnim(GALIL_IDLE1, UseDecrement() != FALSE); } } - -#ifdef HOOK_GAMEDLL - -void CGalil::Spawn(void) -{ - Spawn_(); -} - -void CGalil::Precache(void) -{ - Precache_(); -} - -int CGalil::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CGalil::Deploy(void) -{ - return Deploy_(); -} - -void CGalil::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CGalil::SecondaryAttack(void) -{ - SecondaryAttack_(); -} - -void CGalil::Reload(void) -{ - Reload_(); -} - -void CGalil::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_glock18.cpp b/regamedll/dlls/wpn_shared/wpn_glock18.cpp index 7e4a0982..7f671703 100644 --- a/regamedll/dlls/wpn_shared/wpn_glock18.cpp +++ b/regamedll/dlls/wpn_shared/wpn_glock18.cpp @@ -4,9 +4,10 @@ LINK_ENTITY_TO_CLASS(weapon_glock18, CGLOCK18); /* <26611a> ../cstrike/dlls/wpn_shared/wpn_glock18.cpp:70 */ -void CGLOCK18::__MAKE_VHOOK(Spawn)(void) +void CGLOCK18::__MAKE_VHOOK(Spawn)() { Precache(); + m_iId = WEAPON_GLOCK18; SET_MODEL(edict(), "models/w_glock18.mdl"); @@ -16,13 +17,13 @@ void CGLOCK18::__MAKE_VHOOK(Spawn)(void) m_iGlock18ShotsFired = 0; m_flGlock18Shoot = 0; - m_flAccuracy = 0.9; + m_flAccuracy = 0.9f; FallInit(); } /* <2660c0> ../cstrike/dlls/wpn_shared/wpn_glock18.cpp:88 */ -void CGLOCK18::__MAKE_VHOOK(Precache)(void) +void CGLOCK18::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_glock18.mdl"); PRECACHE_MODEL("models/w_glock18.mdl"); @@ -61,14 +62,14 @@ int CGLOCK18::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <266281> ../cstrike/dlls/wpn_shared/wpn_glock18.cpp:129 */ -BOOL CGLOCK18::__MAKE_VHOOK(Deploy)(void) +BOOL CGLOCK18::__MAKE_VHOOK(Deploy)() { m_iWeaponState &= ~WPNSTATE_SHIELD_DRAWN; m_bBurstFire = false; m_iGlock18ShotsFired = 0; m_flGlock18Shoot = 0; - m_flAccuracy = 0.9; + m_flAccuracy = 0.9f; m_fMaxSpeed = GLOCK18_MAX_SPEED; m_pPlayer->m_bShieldDrawn = false; @@ -87,7 +88,7 @@ BOOL CGLOCK18::__MAKE_VHOOK(Deploy)(void) } /* <266246> ../cstrike/dlls/wpn_shared/wpn_glock18.cpp:156 */ -void CGLOCK18::__MAKE_VHOOK(SecondaryAttack)(void) +void CGLOCK18::__MAKE_VHOOK(SecondaryAttack)() { if (ShieldSecondaryFire(GLOCK18_SHIELD_UP, GLOCK18_SHIELD_DOWN)) { @@ -105,11 +106,11 @@ void CGLOCK18::__MAKE_VHOOK(SecondaryAttack)(void) m_iWeaponState |= WPNSTATE_GLOCK18_BURST_MODE; } - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.3; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.3f; } /* <2664c3> ../cstrike/dlls/wpn_shared/wpn_glock18.cpp:175 */ -void CGLOCK18::__MAKE_VHOOK(PrimaryAttack)(void) +void CGLOCK18::__MAKE_VHOOK(PrimaryAttack)() { if (m_iWeaponState & WPNSTATE_GLOCK18_BURST_MODE) { @@ -163,28 +164,26 @@ void CGLOCK18::GLOCK18Fire(float flSpread, float flCycleTime, BOOL bFireBurst) } else { - m_iShotsFired++; - - if (m_iShotsFired > 1) + if (++m_iShotsFired > 1) { return; } - flCycleTime -= 0.05; + flCycleTime -= 0.05f; } if (m_flLastFire) { // Mark the time of this shot and determine the accuracy modifier based on the last shot fired... - m_flAccuracy -= (0.325 - (gpGlobals->time - m_flLastFire)) * 0.275; + m_flAccuracy -= (0.325f - (gpGlobals->time - m_flLastFire)) * 0.275f; - if (m_flAccuracy > 0.9) + if (m_flAccuracy > 0.9f) { - m_flAccuracy = 0.9; + m_flAccuracy = 0.9f; } - else if (m_flAccuracy < 0.6) + else if (m_flAccuracy < 0.6f) { - m_flAccuracy = 0.6; + m_flAccuracy = 0.6f; } } @@ -206,8 +205,7 @@ void CGLOCK18::GLOCK18Fire(float flSpread, float flCycleTime, BOOL bFireBurst) return; } - m_iClip--; - + --m_iClip; m_pPlayer->pev->effects |= EF_MUZZLEFLASH; // player "shoot" animation @@ -241,27 +239,24 @@ void CGLOCK18::GLOCK18Fire(float flSpread, float flCycleTime, BOOL bFireBurst) m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, FALSE); } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.5; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.5f; if (bFireBurst) { // Fire off the next two rounds - m_iGlock18ShotsFired++; - m_flGlock18Shoot = gpGlobals->time + 0.1; + ++m_iGlock18ShotsFired; + m_flGlock18Shoot = gpGlobals->time + 0.1f; } ResetPlayerShieldAnim(); } /* <2661e8> ../cstrike/dlls/wpn_shared/wpn_glock18.cpp:307 */ -void CGLOCK18::__MAKE_VHOOK(Reload)(void) +void CGLOCK18::__MAKE_VHOOK(Reload)() { int iResult; - if (m_pPlayer->ammo_9mm <= 0) - { return; - } if (m_pPlayer->HasShield()) iResult = GLOCK18_SHIELD_RELOAD; @@ -278,7 +273,7 @@ void CGLOCK18::__MAKE_VHOOK(Reload)(void) } /* <266190> ../cstrike/dlls/wpn_shared/wpn_glock18.cpp:329 */ -void CGLOCK18::__MAKE_VHOOK(WeaponIdle)(void) +void CGLOCK18::__MAKE_VHOOK(WeaponIdle)() { int iAnim; float flRand; @@ -293,7 +288,7 @@ void CGLOCK18::__MAKE_VHOOK(WeaponIdle)(void) if (m_pPlayer->HasShield()) { - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0f; if (m_iWeaponState & WPNSTATE_SHIELD_DRAWN) { @@ -305,66 +300,22 @@ void CGLOCK18::__MAKE_VHOOK(WeaponIdle)(void) { flRand = RANDOM_FLOAT(0, 1); - if (flRand <= 0.3) + if (flRand <= 0.3f) { iAnim = GLOCK18_IDLE3; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0625; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0625f; } - else if (flRand <= 0.6) + else if (flRand <= 0.6f) { iAnim = GLOCK18_IDLE1; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.75; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.75f; } else { iAnim = GLOCK18_IDLE2; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.5; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.5f; } SendWeaponAnim(iAnim, UseDecrement() != FALSE); } } - -#ifdef HOOK_GAMEDLL - -void CGLOCK18::Spawn(void) -{ - Spawn_(); -} - -void CGLOCK18::Precache(void) -{ - Precache_(); -} - -int CGLOCK18::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CGLOCK18::Deploy(void) -{ - return Deploy_(); -} - -void CGLOCK18::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CGLOCK18::SecondaryAttack(void) -{ - SecondaryAttack_(); -} - -void CGLOCK18::Reload(void) -{ - Reload_(); -} - -void CGLOCK18::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_hegrenade.cpp b/regamedll/dlls/wpn_shared/wpn_hegrenade.cpp index 56d29e34..0c24b926 100644 --- a/regamedll/dlls/wpn_shared/wpn_hegrenade.cpp +++ b/regamedll/dlls/wpn_shared/wpn_hegrenade.cpp @@ -4,9 +4,10 @@ LINK_ENTITY_TO_CLASS(weapon_hegrenade, CHEGrenade); /* <26b07c> ../cstrike/dlls/wpn_shared/wpn_hegrenade.cpp:40 */ -void CHEGrenade::__MAKE_VHOOK(Spawn)(void) +void CHEGrenade::__MAKE_VHOOK(Spawn)() { Precache(); + m_iId = WEAPON_HEGRENADE; SET_MODEL(edict(), "models/w_hegrenade.mdl"); @@ -14,7 +15,7 @@ void CHEGrenade::__MAKE_VHOOK(Spawn)(void) m_iDefaultAmmo = HEGRENADE_DEFAULT_GIVE; m_flStartThrow = 0; - m_flReleaseThrow = -1; + m_flReleaseThrow = -1.0f; m_iWeaponState &= ~WPNSTATE_SHIELD_DRAWN; // get ready to fall down. @@ -22,7 +23,7 @@ void CHEGrenade::__MAKE_VHOOK(Spawn)(void) } /* <26afc7> ../cstrike/dlls/wpn_shared/wpn_hegrenade.cpp:59 */ -void CHEGrenade::__MAKE_VHOOK(Precache)(void) +void CHEGrenade::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_hegrenade.mdl"); PRECACHE_MODEL("models/shield/v_shield_hegrenade.mdl"); @@ -54,9 +55,9 @@ int CHEGrenade::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <26b12c> ../cstrike/dlls/wpn_shared/wpn_hegrenade.cpp:92 */ -BOOL CHEGrenade::__MAKE_VHOOK(Deploy)(void) +BOOL CHEGrenade::__MAKE_VHOOK(Deploy)() { - m_flReleaseThrow = -1; + m_flReleaseThrow = -1.0f; m_fMaxSpeed = HEGRENADE_MAX_SPEED; m_iWeaponState &= ~WPNSTATE_SHIELD_DRAWN; @@ -71,7 +72,7 @@ BOOL CHEGrenade::__MAKE_VHOOK(Deploy)(void) /* <26b047> ../cstrike/dlls/wpn_shared/wpn_hegrenade.cpp:107 */ void CHEGrenade::__MAKE_VHOOK(Holster)(int skiplocal) { - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; if (!m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]) { @@ -80,11 +81,11 @@ void CHEGrenade::__MAKE_VHOOK(Holster)(int skiplocal) } m_flStartThrow = 0; - m_flReleaseThrow = -1; + m_flReleaseThrow = -1.0f; } /* <26b0f2> ../cstrike/dlls/wpn_shared/wpn_hegrenade.cpp:123 */ -void CHEGrenade::__MAKE_VHOOK(PrimaryAttack)(void) +void CHEGrenade::__MAKE_VHOOK(PrimaryAttack)() { if (m_iWeaponState & WPNSTATE_SHIELD_DRAWN) { @@ -97,7 +98,7 @@ void CHEGrenade::__MAKE_VHOOK(PrimaryAttack)(void) m_flStartThrow = gpGlobals->time; SendWeaponAnim(HEGRENADE_PULLPIN, UseDecrement() != FALSE); - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5f; } } @@ -131,21 +132,21 @@ bool CHEGrenade::ShieldSecondaryFire(int iUpAnim, int iDownAnim) m_pPlayer->UpdateShieldCrosshair((m_iWeaponState & WPNSTATE_SHIELD_DRAWN) != WPNSTATE_SHIELD_DRAWN); m_pPlayer->ResetMaxSpeed(); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.4; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.4f; m_flNextPrimaryAttack = GetNextAttackDelay(0.4); - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.6; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.6f; return true; } /* <26b167> ../cstrike/dlls/wpn_shared/wpn_hegrenade.cpp:176 */ -void CHEGrenade::__MAKE_VHOOK(SecondaryAttack)(void) +void CHEGrenade::__MAKE_VHOOK(SecondaryAttack)() { ShieldSecondaryFire(SHIELDGUN_DRAW, SHIELDGUN_DRAWN_IDLE); } /* <26b4c9> ../cstrike/dlls/wpn_shared/wpn_hegrenade.cpp:181 */ -void CHEGrenade::SetPlayerShieldAnim(void) +void CHEGrenade::SetPlayerShieldAnim() { if (!m_pPlayer->HasShield()) return; @@ -157,7 +158,7 @@ void CHEGrenade::SetPlayerShieldAnim(void) } /* <26b4eb> ../cstrike/dlls/wpn_shared/wpn_hegrenade.cpp:192 */ -void CHEGrenade::ResetPlayerShieldAnim(void) +void CHEGrenade::ResetPlayerShieldAnim() { if (!m_pPlayer->HasShield()) return; @@ -169,7 +170,7 @@ void CHEGrenade::ResetPlayerShieldAnim(void) } /* <26a24e> ../cstrike/dlls/wpn_shared/wpn_hegrenade.cpp:202 */ -void CHEGrenade::__MAKE_VHOOK(WeaponIdle)(void) +void CHEGrenade::__MAKE_VHOOK(WeaponIdle)() { if (m_flReleaseThrow == 0 && m_flStartThrow != 0.0f) m_flReleaseThrow = gpGlobals->time; @@ -188,7 +189,7 @@ void CHEGrenade::__MAKE_VHOOK(WeaponIdle)(void) else angThrow.x = -10 + angThrow.x * ((90 + 10) / 90.0); - float flVel = (90.0 - angThrow.x) * 6.0; + float flVel = (90.0f - angThrow.x) * 6.0f; if (flVel > 750.0f) flVel = 750.0f; @@ -208,11 +209,9 @@ void CHEGrenade::__MAKE_VHOOK(WeaponIdle)(void) m_flStartThrow = 0; m_flNextPrimaryAttack = GetNextAttackDelay(0.5); - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.75; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.75f; - m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--; - - if (!m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]) + if (--m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0) { // just threw last grenade // set attack times in the future, and weapon idle in the future so we can see the whole throw @@ -239,13 +238,13 @@ void CHEGrenade::__MAKE_VHOOK(WeaponIdle)(void) } m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + RANDOM_FLOAT(10, 15); - m_flReleaseThrow = -1; + m_flReleaseThrow = -1.0f; } else if (m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]) { if (m_pPlayer->HasShield()) { - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0f; if (m_iWeaponState & WPNSTATE_SHIELD_DRAWN) { @@ -263,56 +262,7 @@ void CHEGrenade::__MAKE_VHOOK(WeaponIdle)(void) } /* <26b021> ../cstrike/dlls/wpn_shared/wpn_hegrenade.cpp:303 */ -BOOL CHEGrenade::__MAKE_VHOOK(CanDeploy)(void) +BOOL CHEGrenade::__MAKE_VHOOK(CanDeploy)() { return m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] != 0; } - -#ifdef HOOK_GAMEDLL - -void CHEGrenade::Spawn(void) -{ - Spawn_(); -} - -void CHEGrenade::Precache(void) -{ - Precache_(); -} - -int CHEGrenade::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CHEGrenade::CanDeploy(void) -{ - return CanDeploy_(); -} - -BOOL CHEGrenade::Deploy(void) -{ - return Deploy_(); -} - -void CHEGrenade::Holster(int skiplocal) -{ - Holster_(skiplocal); -} - -void CHEGrenade::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CHEGrenade::SecondaryAttack(void) -{ - SecondaryAttack_(); -} - -void CHEGrenade::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_knife.cpp b/regamedll/dlls/wpn_shared/wpn_knife.cpp index 66a56999..a38ceb54 100644 --- a/regamedll/dlls/wpn_shared/wpn_knife.cpp +++ b/regamedll/dlls/wpn_shared/wpn_knife.cpp @@ -4,9 +4,10 @@ LINK_ENTITY_TO_CLASS(weapon_knife, CKnife); /* <270586> ../cstrike/dlls/wpn_shared/wpn_knife.cpp:53 */ -void CKnife::__MAKE_VHOOK(Spawn)(void) +void CKnife::__MAKE_VHOOK(Spawn)() { Precache(); + m_iId = WEAPON_KNIFE; SET_MODEL(edict(), "models/w_knife.mdl"); @@ -17,7 +18,7 @@ void CKnife::__MAKE_VHOOK(Spawn)(void) } /* <2704d2> ../cstrike/dlls/wpn_shared/wpn_knife.cpp:66 */ -void CKnife::__MAKE_VHOOK(Precache)(void) +void CKnife::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_knife.mdl"); PRECACHE_MODEL("models/shield/v_shield_knife.mdl"); @@ -58,7 +59,7 @@ int CKnife::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <2707c0> ../cstrike/dlls/wpn_shared/wpn_knife.cpp:102 */ -BOOL CKnife::__MAKE_VHOOK(Deploy)(void) +BOOL CKnife::__MAKE_VHOOK(Deploy)() { EMIT_SOUND(m_pPlayer->edict(), CHAN_ITEM, "weapons/knife_deploy1.wav", 0.3, 2.4); @@ -79,7 +80,7 @@ BOOL CKnife::__MAKE_VHOOK(Deploy)(void) /* <27052b> ../cstrike/dlls/wpn_shared/wpn_knife.cpp:119 */ void CKnife::__MAKE_VHOOK(Holster)(int skiplocal) { - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; } /* <270d70> ../cstrike/dlls/wpn_shared/wpn_knife.cpp:124 */ @@ -149,13 +150,13 @@ void FindHullIntersection(const Vector &vecSrc, TraceResult &tr, float *mins, fl } /* <2714ba> ../cstrike/dlls/wpn_shared/wpn_knife.cpp:185 */ -void CKnife::__MAKE_VHOOK(PrimaryAttack)(void) +void CKnife::__MAKE_VHOOK(PrimaryAttack)() { Swing(TRUE); } /* <270f18> ../cstrike/dlls/wpn_shared/wpn_knife.cpp:190 */ -void CKnife::SetPlayerShieldAnim(void) +void CKnife::SetPlayerShieldAnim() { if (!m_pPlayer->HasShield()) return; @@ -171,7 +172,7 @@ void CKnife::SetPlayerShieldAnim(void) } /* <270f53> ../cstrike/dlls/wpn_shared/wpn_knife.cpp:201 */ -void CKnife::ResetPlayerShieldAnim(void) +void CKnife::ResetPlayerShieldAnim() { if (!m_pPlayer->HasShield()) return; @@ -216,36 +217,36 @@ bool CKnife::ShieldSecondaryFire(int iUpAnim, int iDownAnim) m_pPlayer->ResetMaxSpeed(); m_flNextPrimaryAttack = GetNextAttackDelay(0.4); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.4; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.6; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.4f; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.6f; return true; } /* <270826> ../cstrike/dlls/wpn_shared/wpn_knife.cpp:245 */ -void CKnife::__MAKE_VHOOK(SecondaryAttack)(void) +void CKnife::__MAKE_VHOOK(SecondaryAttack)() { if (!ShieldSecondaryFire(KNIFE_SHIELD_UP, KNIFE_SHIELD_DOWN)) { Stab(TRUE); - pev->nextthink = UTIL_WeaponTimeBase() + 0.35; + pev->nextthink = UTIL_WeaponTimeBase() + 0.35f; } } /* <27055f> ../cstrike/dlls/wpn_shared/wpn_knife.cpp:254 */ -void CKnife::Smack(void) +void CKnife::Smack() { DecalGunshot(&m_trHit, BULLET_PLAYER_CROWBAR, false, m_pPlayer->pev, false); } /* <271493> ../cstrike/dlls/wpn_shared/wpn_knife.cpp:260 */ -void CKnife::SwingAgain(void) +void CKnife::SwingAgain() { Swing(FALSE); } /* <2705fc> ../cstrike/dlls/wpn_shared/wpn_knife.cpp:265 */ -void CKnife::__MAKE_VHOOK(WeaponIdle)(void) +void CKnife::__MAKE_VHOOK(WeaponIdle)() { ResetEmptySound(); m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES); @@ -256,7 +257,7 @@ void CKnife::__MAKE_VHOOK(WeaponIdle)(void) if (m_pPlayer->m_bShieldDrawn) return; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0f; // only idle if the slid isn't back SendWeaponAnim(KNIFE_IDLE, UseDecrement() != FALSE); @@ -272,7 +273,7 @@ int CKnife::Swing(int fFirst) UTIL_MakeVectors(m_pPlayer->pev->v_angle); vecSrc = m_pPlayer->GetGunPosition(); - vecEnd = vecSrc + gpGlobals->v_forward * 48; + vecEnd = vecSrc + gpGlobals->v_forward * 48.0f; UTIL_TraceLine(vecSrc, vecEnd, dont_ignore_monsters, m_pPlayer->edict(), &tr); @@ -310,7 +311,7 @@ int CKnife::Swing(int fFirst) // miss m_flNextPrimaryAttack = GetNextAttackDelay(0.35); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5f; } else { @@ -445,7 +446,7 @@ int CKnife::Stab(int fFirst) UTIL_MakeVectors(m_pPlayer->pev->v_angle); vecSrc = m_pPlayer->GetGunPosition(); - vecEnd = vecSrc + gpGlobals->v_forward * 32; + vecEnd = vecSrc + gpGlobals->v_forward * 32.0f; UTIL_TraceLine(vecSrc, vecEnd, dont_ignore_monsters, m_pPlayer->edict(), &tr); @@ -476,7 +477,7 @@ int CKnife::Stab(int fFirst) SendWeaponAnim(KNIFE_STABMISS, UseDecrement() != FALSE); m_flNextPrimaryAttack = GetNextAttackDelay(1.0); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0f; // play wiff or swish sound if (RANDOM_LONG(0, 1)) @@ -496,7 +497,7 @@ int CKnife::Stab(int fFirst) SendWeaponAnim(KNIFE_STABHIT, UseDecrement() != FALSE); m_flNextPrimaryAttack = GetNextAttackDelay(1.1); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.1; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.1f; // play thwack, smack, or dong sound float flVol = 1.0f; @@ -525,7 +526,7 @@ int CKnife::Stab(int fFirst) //Triple the damage if we are stabbing them in the back. if (flDot > 0.80f) { - flDamage *= 3.0; + flDamage *= 3.0f; } } @@ -572,7 +573,7 @@ int CKnife::Stab(int fFirst) m_pPlayer->m_iWeaponVolume = (int)(flVol * KNIFE_WALLHIT_VOLUME); SetThink(&CKnife::Smack); - pev->nextthink = UTIL_WeaponTimeBase() + 0.2; + pev->nextthink = UTIL_WeaponTimeBase() + 0.2f; ResetPlayerShieldAnim(); } @@ -585,47 +586,3 @@ int CKnife::Stab(int fFirst) return fDidHit; } - -#ifdef HOOK_GAMEDLL - -void CKnife::Spawn(void) -{ - Spawn_(); -} - -void CKnife::Precache(void) -{ - Precache_(); -} - -int CKnife::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CKnife::Deploy(void) -{ - return Deploy_(); -} - -void CKnife::Holster(int skiplocal) -{ - Holster_(skiplocal); -} - -void CKnife::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CKnife::SecondaryAttack(void) -{ - SecondaryAttack_(); -} - -void CKnife::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_m249.cpp b/regamedll/dlls/wpn_shared/wpn_m249.cpp index 510e940f..f930b4b6 100644 --- a/regamedll/dlls/wpn_shared/wpn_m249.cpp +++ b/regamedll/dlls/wpn_shared/wpn_m249.cpp @@ -4,21 +4,22 @@ LINK_ENTITY_TO_CLASS(weapon_m249, CM249); /* <276951> ../cstrike/dlls/wpn_shared/wpn_m249.cpp:51 */ -void CM249::__MAKE_VHOOK(Spawn)(void) +void CM249::__MAKE_VHOOK(Spawn)() { Precache(); + m_iId = WEAPON_M249; SET_MODEL(edict(), "models/w_m249.mdl"); m_iDefaultAmmo = M249_DEFAULT_GIVE; - m_flAccuracy = 0.2; + m_flAccuracy = 0.2f; m_iShotsFired = 0; FallInit(); } /* <2768d0> ../cstrike/dlls/wpn_shared/wpn_m249.cpp:65 */ -void CM249::__MAKE_VHOOK(Precache)(void) +void CM249::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_m249.mdl"); PRECACHE_MODEL("models/w_m249.mdl"); @@ -54,9 +55,9 @@ int CM249::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <27692a> ../cstrike/dlls/wpn_shared/wpn_m249.cpp:101 */ -BOOL CM249::__MAKE_VHOOK(Deploy)(void) +BOOL CM249::__MAKE_VHOOK(Deploy)() { - m_flAccuracy = 0.2; + m_flAccuracy = 0.2f; m_iShotsFired = 0; iShellOn = 1; @@ -64,7 +65,7 @@ BOOL CM249::__MAKE_VHOOK(Deploy)(void) } /* <276b73> ../cstrike/dlls/wpn_shared/wpn_m249.cpp:111 */ -void CM249::__MAKE_VHOOK(PrimaryAttack)(void) +void CM249::__MAKE_VHOOK(PrimaryAttack)() { if (!(m_pPlayer->pev->flags & FL_ONGROUND)) { @@ -87,12 +88,12 @@ void CM249::M249Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) int flag; m_bDelayFire = true; - m_iShotsFired++; + ++m_iShotsFired; - m_flAccuracy = ((m_iShotsFired * m_iShotsFired * m_iShotsFired) / 175) + 0.4; + m_flAccuracy = ((m_iShotsFired * m_iShotsFired * m_iShotsFired) / 175) + 0.4f; - if (m_flAccuracy > 0.9) - m_flAccuracy = 0.9; + if (m_flAccuracy > 0.9f) + m_flAccuracy = 0.9f; if (m_iClip <= 0) { @@ -110,7 +111,7 @@ void CM249::M249Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) return; } - m_iClip--; + --m_iClip; m_pPlayer->pev->effects |= EF_MUZZLEFLASH; m_pPlayer->SetAnimation(PLAYER_ATTACK1); @@ -141,7 +142,7 @@ void CM249::M249Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0); } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.6; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.6f; if (!(m_pPlayer->pev->flags & FL_ONGROUND)) { @@ -162,28 +163,26 @@ void CM249::M249Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) } /* <276a02> ../cstrike/dlls/wpn_shared/wpn_m249.cpp:201 */ -void CM249::__MAKE_VHOOK(Reload)(void) +void CM249::__MAKE_VHOOK(Reload)() { #ifdef REGAMEDLL_FIXES // to prevent reload if not enough ammo if (m_pPlayer->ammo_556natobox <= 0) - { return; - } #endif // REGAMEDLL_FIXES if (DefaultReload(M249_MAX_CLIP, M249_RELOAD, M249_RELOAD_TIME)) { m_pPlayer->SetAnimation(PLAYER_RELOAD); - m_flAccuracy = 0.2; + m_flAccuracy = 0.2f; m_bDelayFire = false; m_iShotsFired = 0; } } /* <2769c7> ../cstrike/dlls/wpn_shared/wpn_m249.cpp:222 */ -void CM249::__MAKE_VHOOK(WeaponIdle)(void) +void CM249::__MAKE_VHOOK(WeaponIdle)() { ResetEmptySound(); m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES); @@ -193,45 +192,6 @@ void CM249::__MAKE_VHOOK(WeaponIdle)(void) return; } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0f; SendWeaponAnim(M249_IDLE1, UseDecrement() != FALSE); } - -#ifdef HOOK_GAMEDLL - -void CM249::Spawn(void) -{ - Spawn_(); -} - -void CM249::Precache(void) -{ - Precache_(); -} - -int CM249::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CM249::Deploy(void) -{ - return Deploy_(); -} - -void CM249::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CM249::Reload(void) -{ - Reload_(); -} - -void CM249::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_m3.cpp b/regamedll/dlls/wpn_shared/wpn_m3.cpp index 917aa42d..2c089d4b 100644 --- a/regamedll/dlls/wpn_shared/wpn_m3.cpp +++ b/regamedll/dlls/wpn_shared/wpn_m3.cpp @@ -4,9 +4,10 @@ LINK_ENTITY_TO_CLASS(weapon_m3, CM3); /* <27be6d> ../cstrike/dlls/wpn_shared/wpn_m3.cpp:54 */ -void CM3::__MAKE_VHOOK(Spawn)(void) +void CM3::__MAKE_VHOOK(Spawn)() { Precache(); + m_iId = WEAPON_M3; SET_MODEL(edict(), "models/w_m3.mdl"); @@ -16,7 +17,7 @@ void CM3::__MAKE_VHOOK(Spawn)(void) } /* <27bc83> ../cstrike/dlls/wpn_shared/wpn_m3.cpp:66 */ -void CM3::__MAKE_VHOOK(Precache)(void) +void CM3::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_m3.mdl"); PRECACHE_MODEL("models/w_m3.mdl"); @@ -51,13 +52,13 @@ int CM3::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <27be46> ../cstrike/dlls/wpn_shared/wpn_m3.cpp:103 */ -BOOL CM3::__MAKE_VHOOK(Deploy)(void) +BOOL CM3::__MAKE_VHOOK(Deploy)() { return DefaultDeploy("models/v_m3.mdl", "models/p_m3.mdl", M3_DRAW, "shotgun", UseDecrement() != FALSE); } /* <27bcdd> ../cstrike/dlls/wpn_shared/wpn_m3.cpp:109 */ -void CM3::__MAKE_VHOOK(PrimaryAttack)(void) +void CM3::__MAKE_VHOOK(PrimaryAttack)() { Vector vecAiming, vecSrc, vecDir; int flag; @@ -90,7 +91,7 @@ void CM3::__MAKE_VHOOK(PrimaryAttack)(void) m_pPlayer->m_iWeaponVolume = LOUD_GUN_VOLUME; m_pPlayer->m_iWeaponFlash = BRIGHT_GUN_FLASH; - m_iClip--; + --m_iClip; m_pPlayer->pev->effects |= EF_MUZZLEFLASH; // player "shoot" animation @@ -118,15 +119,15 @@ void CM3::__MAKE_VHOOK(PrimaryAttack)(void) } if (m_iClip != 0) - m_flPumpTime = UTIL_WeaponTimeBase() + 0.5; + m_flPumpTime = UTIL_WeaponTimeBase() + 0.5f; m_flNextPrimaryAttack = GetNextAttackDelay(0.875); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.875; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.875f; if (m_iClip != 0) - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.5; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.5f; else - m_flTimeWeaponIdle = 0.875; + m_flTimeWeaponIdle = 0.875f; m_fInSpecialReload = 0; @@ -135,11 +136,11 @@ void CM3::__MAKE_VHOOK(PrimaryAttack)(void) else m_pPlayer->pev->punchangle.x -= UTIL_SharedRandomLong(m_pPlayer->random_seed + 1, 8, 11); - m_pPlayer->m_flEjectBrass = gpGlobals->time + 0.45; + m_pPlayer->m_flEjectBrass = gpGlobals->time + 0.45f; } /* <27bf1e> ../cstrike/dlls/wpn_shared/wpn_m3.cpp:182 */ -void CM3::__MAKE_VHOOK(Reload)(void) +void CM3::__MAKE_VHOOK(Reload)() { if (m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 || m_iClip == M3_MAX_CLIP) return; @@ -155,10 +156,10 @@ void CM3::__MAKE_VHOOK(Reload)(void) SendWeaponAnim(M3_START_RELOAD, UseDecrement() != FALSE); m_fInSpecialReload = 1; - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.55; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.55; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.55f; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.55f; m_flNextPrimaryAttack = GetNextAttackDelay(0.55); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.55; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.55f; } else if (m_fInSpecialReload == 1) { @@ -169,20 +170,20 @@ void CM3::__MAKE_VHOOK(Reload)(void) m_fInSpecialReload = 2; SendWeaponAnim(M3_RELOAD, UseDecrement()); - m_flNextReload = UTIL_WeaponTimeBase() + 0.45; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.45; + m_flNextReload = UTIL_WeaponTimeBase() + 0.45f; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.45f; } else { - m_iClip++; - m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--; - m_pPlayer->ammo_buckshot--; + ++m_iClip; + --m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]; + --m_pPlayer->ammo_buckshot; m_fInSpecialReload = 1; } } /* <27bee3> ../cstrike/dlls/wpn_shared/wpn_m3.cpp:228 */ -void CM3::__MAKE_VHOOK(WeaponIdle)(void) +void CM3::__MAKE_VHOOK(WeaponIdle)() { ResetEmptySound(); m_pPlayer->GetAutoaimVector(AUTOAIM_5DEGREES); @@ -210,7 +211,7 @@ void CM3::__MAKE_VHOOK(WeaponIdle)(void) SendWeaponAnim(M3_PUMP, UseDecrement() != FALSE); m_fInSpecialReload = 0; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.5; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.5f; } } else @@ -219,42 +220,3 @@ void CM3::__MAKE_VHOOK(WeaponIdle)(void) } } } - -#ifdef HOOK_GAMEDLL - -void CM3::Spawn(void) -{ - Spawn_(); -} - -void CM3::Precache(void) -{ - Precache_(); -} - -int CM3::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CM3::Deploy(void) -{ - return Deploy_(); -} - -void CM3::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CM3::Reload(void) -{ - Reload_(); -} - -void CM3::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_m4a1.cpp b/regamedll/dlls/wpn_shared/wpn_m4a1.cpp index 1127f9cd..d92e17ec 100644 --- a/regamedll/dlls/wpn_shared/wpn_m4a1.cpp +++ b/regamedll/dlls/wpn_shared/wpn_m4a1.cpp @@ -4,14 +4,15 @@ LINK_ENTITY_TO_CLASS(weapon_m4a1, CM4A1); /* <281059> ../cstrike/dlls/wpn_shared/wpn_m4a1.cpp:62 */ -void CM4A1::__MAKE_VHOOK(Spawn)(void) +void CM4A1::__MAKE_VHOOK(Spawn)() { Precache(); + m_iId = WEAPON_M4A1; SET_MODEL(edict(), "models/w_m4a1.mdl"); m_iDefaultAmmo = M4A1_DEFAULT_GIVE; - m_flAccuracy = 0.2; + m_flAccuracy = 0.2f; m_iShotsFired = 0; m_bDelayFire = true; @@ -19,7 +20,7 @@ void CM4A1::__MAKE_VHOOK(Spawn)(void) } /* <280fb2> ../cstrike/dlls/wpn_shared/wpn_m4a1.cpp:77 */ -void CM4A1::__MAKE_VHOOK(Precache)(void) +void CM4A1::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_m4a1.mdl"); PRECACHE_MODEL("models/w_m4a1.mdl"); @@ -57,10 +58,10 @@ int CM4A1::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <281169> ../cstrike/dlls/wpn_shared/wpn_m4a1.cpp:114 */ -BOOL CM4A1::__MAKE_VHOOK(Deploy)(void) +BOOL CM4A1::__MAKE_VHOOK(Deploy)() { m_bDelayFire = true; - m_flAccuracy = 0.2; + m_flAccuracy = 0.2f; m_iShotsFired = 0; iShellOn = 1; @@ -72,7 +73,7 @@ BOOL CM4A1::__MAKE_VHOOK(Deploy)(void) } /* <281032> ../cstrike/dlls/wpn_shared/wpn_m4a1.cpp:127 */ -void CM4A1::__MAKE_VHOOK(SecondaryAttack)(void) +void CM4A1::__MAKE_VHOOK(SecondaryAttack)() { if (m_iWeaponState & WPNSTATE_M4A1_SILENCED) { @@ -93,7 +94,7 @@ void CM4A1::__MAKE_VHOOK(SecondaryAttack)(void) } /* <2812fd> ../cstrike/dlls/wpn_shared/wpn_m4a1.cpp:149 */ -void CM4A1::__MAKE_VHOOK(PrimaryAttack)(void) +void CM4A1::__MAKE_VHOOK(PrimaryAttack)() { if (m_iWeaponState & WPNSTATE_M4A1_SILENCED) { @@ -134,9 +135,9 @@ void CM4A1::M4A1Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) int flag; m_bDelayFire = true; - m_iShotsFired++; + ++m_iShotsFired; - m_flAccuracy = ((m_iShotsFired * m_iShotsFired * m_iShotsFired) / 220) + 0.3; + m_flAccuracy = ((m_iShotsFired * m_iShotsFired * m_iShotsFired) / 220) + 0.3f; if (m_flAccuracy > 1) m_flAccuracy = 1; @@ -157,7 +158,7 @@ void CM4A1::M4A1Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) return; } - m_iClip--; + --m_iClip; m_pPlayer->SetAnimation(PLAYER_ATTACK1); UTIL_MakeVectors(m_pPlayer->pev->v_angle + m_pPlayer->pev->punchangle); @@ -187,7 +188,9 @@ void CM4A1::M4A1Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) flag = 0; #endif // CLIENT_WEAPONS - m_pPlayer->ammo_556nato--; +#ifndef REGAMEDLL_FIXES + --m_pPlayer->ammo_556nato; +#endif // REGAMEDLL_FIXES PLAYBACK_EVENT_FULL(flag, m_pPlayer->edict(), m_usFireM4A1, 0, (float *)&g_vecZero, (float *)&g_vecZero, vecDir.x, vecDir.y, (int)(m_pPlayer->pev->punchangle.x * 100), (int)(m_pPlayer->pev->punchangle.y * 100), (m_iWeaponState & WPNSTATE_M4A1_SILENCED) == WPNSTATE_M4A1_SILENCED, FALSE); @@ -199,7 +202,7 @@ void CM4A1::M4A1Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0); } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.5; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.5f; if (m_pPlayer->pev->velocity.Length2D() > 0) { @@ -220,7 +223,7 @@ void CM4A1::M4A1Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) } /* <28110b> ../cstrike/dlls/wpn_shared/wpn_m4a1.cpp:257 */ -void CM4A1::__MAKE_VHOOK(Reload)(void) +void CM4A1::__MAKE_VHOOK(Reload)() { if (m_pPlayer->ammo_556nato <= 0) return; @@ -229,14 +232,14 @@ void CM4A1::__MAKE_VHOOK(Reload)(void) { m_pPlayer->SetAnimation(PLAYER_RELOAD); - m_flAccuracy = 0.2; + m_flAccuracy = 0.2f; m_iShotsFired = 0; m_bDelayFire = false; } } /* <2810cf> ../cstrike/dlls/wpn_shared/wpn_m4a1.cpp:279 */ -void CM4A1::__MAKE_VHOOK(WeaponIdle)(void) +void CM4A1::__MAKE_VHOOK(WeaponIdle)() { ResetEmptySound(); m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES); @@ -246,61 +249,12 @@ void CM4A1::__MAKE_VHOOK(WeaponIdle)(void) return; } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0f; SendWeaponAnim((m_iWeaponState & WPNSTATE_M4A1_SILENCED) == WPNSTATE_M4A1_SILENCED ? M4A1_IDLE : M4A1_UNSIL_IDLE, UseDecrement() != FALSE); } /* <28100c> ../cstrike/dlls/wpn_shared/wpn_m4a1.cpp:296 */ -float CM4A1::__MAKE_VHOOK(GetMaxSpeed)(void) +float CM4A1::__MAKE_VHOOK(GetMaxSpeed)() { return M4A1_MAX_SPEED; } - -#ifdef HOOK_GAMEDLL - -void CM4A1::Spawn(void) -{ - Spawn_(); -} - -void CM4A1::Precache(void) -{ - Precache_(); -} - -int CM4A1::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CM4A1::Deploy(void) -{ - return Deploy_(); -} - -float CM4A1::GetMaxSpeed(void) -{ - return GetMaxSpeed_(); -} - -void CM4A1::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CM4A1::SecondaryAttack(void) -{ - SecondaryAttack_(); -} - -void CM4A1::Reload(void) -{ - Reload_(); -} - -void CM4A1::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_mac10.cpp b/regamedll/dlls/wpn_shared/wpn_mac10.cpp index b12f3769..9f2d1db2 100644 --- a/regamedll/dlls/wpn_shared/wpn_mac10.cpp +++ b/regamedll/dlls/wpn_shared/wpn_mac10.cpp @@ -4,21 +4,22 @@ LINK_ENTITY_TO_CLASS(weapon_mac10, CMAC10); /* <28658a> ../cstrike/dlls/wpn_shared/wpn_mac10.cpp:52 */ -void CMAC10::__MAKE_VHOOK(Spawn)(void) +void CMAC10::__MAKE_VHOOK(Spawn)() { Precache(); + m_iId = WEAPON_MAC10; SET_MODEL(edict(), "models/w_mac10.mdl"); m_iDefaultAmmo = MAC10_DEFAULT_GIVE; - m_flAccuracy = 0.15; + m_flAccuracy = 0.15f; m_bDelayFire = false; FallInit(); } /* <286509> ../cstrike/dlls/wpn_shared/wpn_mac10.cpp:66 */ -void CMAC10::__MAKE_VHOOK(Precache)(void) +void CMAC10::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_mac10.mdl"); PRECACHE_MODEL("models/w_mac10.mdl"); @@ -51,9 +52,9 @@ int CMAC10::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <286563> ../cstrike/dlls/wpn_shared/wpn_mac10.cpp:99 */ -BOOL CMAC10::__MAKE_VHOOK(Deploy)(void) +BOOL CMAC10::__MAKE_VHOOK(Deploy)() { - m_flAccuracy = 0.15; + m_flAccuracy = 0.15f; iShellOn = 1; m_bDelayFire = false; @@ -61,7 +62,7 @@ BOOL CMAC10::__MAKE_VHOOK(Deploy)(void) } /* <286786> ../cstrike/dlls/wpn_shared/wpn_mac10.cpp:108 */ -void CMAC10::__MAKE_VHOOK(PrimaryAttack)(void) +void CMAC10::__MAKE_VHOOK(PrimaryAttack)() { if (!(m_pPlayer->pev->flags & FL_ONGROUND)) { @@ -80,12 +81,12 @@ void CMAC10::MAC10Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) int flag; m_bDelayFire = true; - m_iShotsFired++; + ++m_iShotsFired; - m_flAccuracy = ((m_iShotsFired * m_iShotsFired * m_iShotsFired) / 200) + 0.6; + m_flAccuracy = ((m_iShotsFired * m_iShotsFired * m_iShotsFired) / 200) + 0.6f; - if (m_flAccuracy > 1.65) - m_flAccuracy = 1.65; + if (m_flAccuracy > 1.65f) + m_flAccuracy = 1.65f; if (m_iClip <= 0) { @@ -103,7 +104,7 @@ void CMAC10::MAC10Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) return; } - m_iClip--; + --m_iClip; m_pPlayer->pev->effects |= EF_MUZZLEFLASH; m_pPlayer->SetAnimation(PLAYER_ATTACK1); @@ -134,7 +135,7 @@ void CMAC10::MAC10Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0); } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0f; if (!(m_pPlayer->pev->flags & FL_ONGROUND)) { @@ -155,12 +156,10 @@ void CMAC10::MAC10Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) } /* <28663b> ../cstrike/dlls/wpn_shared/wpn_mac10.cpp:199 */ -void CMAC10::__MAKE_VHOOK(Reload)(void) +void CMAC10::__MAKE_VHOOK(Reload)() { if (m_pPlayer->ammo_45acp <= 0) - { return; - } if (DefaultReload(MAC10_MAX_CLIP, MAC10_RELOAD, MAC10_RELOAD_TIME)) { @@ -172,7 +171,7 @@ void CMAC10::__MAKE_VHOOK(Reload)(void) } /* <286600> ../cstrike/dlls/wpn_shared/wpn_mac10.cpp:213 */ -void CMAC10::__MAKE_VHOOK(WeaponIdle)(void) +void CMAC10::__MAKE_VHOOK(WeaponIdle)() { ResetEmptySound(); m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES); @@ -182,45 +181,6 @@ void CMAC10::__MAKE_VHOOK(WeaponIdle)(void) return; } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0f; SendWeaponAnim(MAC10_IDLE1, UseDecrement() != FALSE); } - -#ifdef HOOK_GAMEDLL - -void CMAC10::Spawn(void) -{ - Spawn_(); -} - -void CMAC10::Precache(void) -{ - Precache_(); -} - -int CMAC10::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CMAC10::Deploy(void) -{ - return Deploy_(); -} - -void CMAC10::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CMAC10::Reload(void) -{ - Reload_(); -} - -void CMAC10::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_mp5navy.cpp b/regamedll/dlls/wpn_shared/wpn_mp5navy.cpp index f1a9e47f..65602703 100644 --- a/regamedll/dlls/wpn_shared/wpn_mp5navy.cpp +++ b/regamedll/dlls/wpn_shared/wpn_mp5navy.cpp @@ -4,21 +4,22 @@ LINK_ENTITY_TO_CLASS(weapon_mp5navy, CMP5N); /* <28b9c0> ../cstrike/dlls/wpn_shared/wpn_mp5navy.cpp:52 */ -void CMP5N::__MAKE_VHOOK(Spawn)(void) +void CMP5N::__MAKE_VHOOK(Spawn)() { Precache(); + m_iId = WEAPON_MP5N; SET_MODEL(edict(), "models/w_mp5.mdl"); m_iDefaultAmmo = MP5NAVY_DEFAULT_GIVE; - m_flAccuracy = 0; + m_flAccuracy = 0.0f; m_bDelayFire = false; FallInit(); } /* <28b93f> ../cstrike/dlls/wpn_shared/wpn_mp5navy.cpp:66 */ -void CMP5N::__MAKE_VHOOK(Precache)(void) +void CMP5N::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_mp5.mdl"); PRECACHE_MODEL("models/w_mp5.mdl"); @@ -52,9 +53,9 @@ int CMP5N::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <28b999> ../cstrike/dlls/wpn_shared/wpn_mp5navy.cpp:100 */ -BOOL CMP5N::__MAKE_VHOOK(Deploy)(void) +BOOL CMP5N::__MAKE_VHOOK(Deploy)() { - m_flAccuracy = 0; + m_flAccuracy = 0.0f; m_bDelayFire = false; iShellOn = 1; @@ -62,7 +63,7 @@ BOOL CMP5N::__MAKE_VHOOK(Deploy)(void) } /* <28bbbc> ../cstrike/dlls/wpn_shared/wpn_mp5navy.cpp:109 */ -void CMP5N::__MAKE_VHOOK(PrimaryAttack)(void) +void CMP5N::__MAKE_VHOOK(PrimaryAttack)() { if (!(m_pPlayer->pev->flags & FL_ONGROUND)) { @@ -81,12 +82,12 @@ void CMP5N::MP5NFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) int flag; m_bDelayFire = true; - m_iShotsFired++; + ++m_iShotsFired; - m_flAccuracy = ((m_iShotsFired * m_iShotsFired) / 220.1) + 0.45; + m_flAccuracy = ((m_iShotsFired * m_iShotsFired) / 220.1) + 0.45f; - if (m_flAccuracy > 0.75) - m_flAccuracy = 0.75; + if (m_flAccuracy > 0.75f) + m_flAccuracy = 0.75f; if (m_iClip <= 0) { @@ -104,7 +105,7 @@ void CMP5N::MP5NFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) return; } - m_iClip--; + --m_iClip; m_pPlayer->pev->effects |= EF_MUZZLEFLASH; m_pPlayer->SetAnimation(PLAYER_ATTACK1); @@ -135,7 +136,7 @@ void CMP5N::MP5NFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0); } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0f; if (!(m_pPlayer->pev->flags & FL_ONGROUND)) { @@ -156,12 +157,10 @@ void CMP5N::MP5NFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) } /* <28ba71> ../cstrike/dlls/wpn_shared/wpn_mp5navy.cpp:201 */ -void CMP5N::__MAKE_VHOOK(Reload)(void) +void CMP5N::__MAKE_VHOOK(Reload)() { if (m_pPlayer->ammo_9mm <= 0) - { return; - } if (DefaultReload(MP5N_MAX_CLIP, MP5N_RELOAD, MP5N_RELOAD_TIME)) { @@ -173,7 +172,7 @@ void CMP5N::__MAKE_VHOOK(Reload)(void) } /* <28ba36> ../cstrike/dlls/wpn_shared/wpn_mp5navy.cpp:215 */ -void CMP5N::__MAKE_VHOOK(WeaponIdle)(void) +void CMP5N::__MAKE_VHOOK(WeaponIdle)() { ResetEmptySound(); m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES); @@ -183,45 +182,6 @@ void CMP5N::__MAKE_VHOOK(WeaponIdle)(void) return; } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0f; SendWeaponAnim(MP5N_IDLE1, UseDecrement() != FALSE); } - -#ifdef HOOK_GAMEDLL - -void CMP5N::Spawn(void) -{ - Spawn_(); -} - -void CMP5N::Precache(void) -{ - Precache_(); -} - -int CMP5N::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CMP5N::Deploy(void) -{ - return Deploy_(); -} - -void CMP5N::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CMP5N::Reload(void) -{ - Reload_(); -} - -void CMP5N::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_p228.cpp b/regamedll/dlls/wpn_shared/wpn_p228.cpp index 73a57adc..46cbe7e0 100644 --- a/regamedll/dlls/wpn_shared/wpn_p228.cpp +++ b/regamedll/dlls/wpn_shared/wpn_p228.cpp @@ -4,21 +4,22 @@ LINK_ENTITY_TO_CLASS(weapon_p228, CP228); /* <290eb8> ../cstrike/dlls/wpn_shared/wpn_p228.cpp:65 */ -void CP228::__MAKE_VHOOK(Spawn)(void) +void CP228::__MAKE_VHOOK(Spawn)() { Precache(); + m_iId = WEAPON_P228; SET_MODEL(ENT(pev), "models/w_p228.mdl"); m_iWeaponState &= ~WPNSTATE_SHIELD_DRAWN; m_iDefaultAmmo = P228_DEFAULT_GIVE; - m_flAccuracy = 0.9; + m_flAccuracy = 0.9f; FallInit(); } /* <290e37> ../cstrike/dlls/wpn_shared/wpn_p228.cpp:80 */ -void CP228::__MAKE_VHOOK(Precache)(void) +void CP228::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_p228.mdl"); PRECACHE_MODEL("models/w_p228.mdl"); @@ -53,9 +54,9 @@ int CP228::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <290fc6> ../cstrike/dlls/wpn_shared/wpn_p228.cpp:115 */ -BOOL CP228::__MAKE_VHOOK(Deploy)(void) +BOOL CP228::__MAKE_VHOOK(Deploy)() { - m_flAccuracy = 0.9; + m_flAccuracy = 0.9f; m_fMaxSpeed = P228_MAX_SPEED; m_iWeaponState &= ~WPNSTATE_SHIELD_DRAWN; m_pPlayer->m_bShieldDrawn = false; @@ -67,7 +68,7 @@ BOOL CP228::__MAKE_VHOOK(Deploy)(void) } /* <2910ff> ../cstrike/dlls/wpn_shared/wpn_p228.cpp:130 */ -void CP228::__MAKE_VHOOK(PrimaryAttack)(void) +void CP228::__MAKE_VHOOK(PrimaryAttack)() { if (!(m_pPlayer->pev->flags & FL_ONGROUND)) { @@ -88,7 +89,7 @@ void CP228::__MAKE_VHOOK(PrimaryAttack)(void) } /* <290e91> ../cstrike/dlls/wpn_shared/wpn_p228.cpp:142 */ -void CP228::__MAKE_VHOOK(SecondaryAttack)(void) +void CP228::__MAKE_VHOOK(SecondaryAttack)() { ShieldSecondaryFire(SHIELDGUN_UP, SHIELDGUN_DOWN); } @@ -99,24 +100,24 @@ void CP228::P228Fire(float flSpread, float flCycleTime, BOOL fUseSemi) Vector vecAiming, vecSrc, vecDir; int flag; - flCycleTime -= 0.05; + flCycleTime -= 0.05f; if (++m_iShotsFired > 1) { return; } - if (m_flLastFire != 0.0) + if (m_flLastFire != 0.0f) { - m_flAccuracy -= (0.325 - (gpGlobals->time - m_flLastFire)) * 0.3; + m_flAccuracy -= (0.325f - (gpGlobals->time - m_flLastFire)) * 0.3f; - if (m_flAccuracy > 0.9) + if (m_flAccuracy > 0.9f) { - m_flAccuracy = 0.9; + m_flAccuracy = 0.9f; } - else if (m_flAccuracy < 0.6) + else if (m_flAccuracy < 0.6f) { - m_flAccuracy = 0.6; + m_flAccuracy = 0.6f; } } @@ -138,7 +139,7 @@ void CP228::P228Fire(float flSpread, float flCycleTime, BOOL fUseSemi) return; } - m_iClip--; + --m_iClip; m_pPlayer->pev->effects |= EF_MUZZLEFLASH; SetPlayerShieldAnim(); @@ -169,28 +170,26 @@ void CP228::P228Fire(float flSpread, float flCycleTime, BOOL fUseSemi) m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, FALSE); } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0f; m_pPlayer->pev->punchangle.x -= 2; ResetPlayerShieldAnim(); } /* <290f69> ../cstrike/dlls/wpn_shared/wpn_p228.cpp:241 */ -void CP228::__MAKE_VHOOK(Reload)(void) +void CP228::__MAKE_VHOOK(Reload)() { if (m_pPlayer->ammo_357sig <= 0) - { return; - } if (DefaultReload(P228_MAX_CLIP, m_pPlayer->HasShield() ? P228_SHIELD_RELOAD : P228_RELOAD, P228_RELOAD_TIME)) { m_pPlayer->SetAnimation(PLAYER_RELOAD); - m_flAccuracy = 0.9; + m_flAccuracy = 0.9f; } } /* <290f2e> ../cstrike/dlls/wpn_shared/wpn_p228.cpp:261 */ -void CP228::__MAKE_VHOOK(WeaponIdle)(void) +void CP228::__MAKE_VHOOK(WeaponIdle)() { ResetEmptySound(); m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES); @@ -202,7 +201,7 @@ void CP228::__MAKE_VHOOK(WeaponIdle)(void) if (m_pPlayer->HasShield()) { - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0f; if (m_iWeaponState & WPNSTATE_SHIELD_DRAWN) { @@ -211,51 +210,7 @@ void CP228::__MAKE_VHOOK(WeaponIdle)(void) } else if (m_iClip) { - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0625; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0625f; SendWeaponAnim(P228_IDLE, UseDecrement() != FALSE); } } - -#ifdef HOOK_GAMEDLL - -void CP228::Spawn(void) -{ - Spawn_(); -} - -void CP228::Precache(void) -{ - Precache_(); -} - -int CP228::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CP228::Deploy(void) -{ - return Deploy_(); -} - -void CP228::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CP228::SecondaryAttack(void) -{ - SecondaryAttack_(); -} - -void CP228::Reload(void) -{ - Reload_(); -} - -void CP228::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_p90.cpp b/regamedll/dlls/wpn_shared/wpn_p90.cpp index 6dbdae31..a006d489 100644 --- a/regamedll/dlls/wpn_shared/wpn_p90.cpp +++ b/regamedll/dlls/wpn_shared/wpn_p90.cpp @@ -4,14 +4,15 @@ LINK_ENTITY_TO_CLASS(weapon_p90, CP90); /* <296337> ../cstrike/dlls/wpn_shared/wpn_p90.cpp:51 */ -void CP90::__MAKE_VHOOK(Spawn)(void) +void CP90::__MAKE_VHOOK(Spawn)() { Precache(); + m_iId = WEAPON_P90; SET_MODEL(edict(), "models/w_p90.mdl"); m_iDefaultAmmo = P90_DEFAULT_GIVE; - m_flAccuracy = 0.2; + m_flAccuracy = 0.2f; m_iShotsFired = 0; m_bDelayFire = false; @@ -19,7 +20,7 @@ void CP90::__MAKE_VHOOK(Spawn)(void) } /* <2962b6> ../cstrike/dlls/wpn_shared/wpn_p90.cpp:66 */ -void CP90::__MAKE_VHOOK(Precache)(void) +void CP90::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_p90.mdl"); PRECACHE_MODEL("models/w_p90.mdl"); @@ -53,11 +54,11 @@ int CP90::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <296310> ../cstrike/dlls/wpn_shared/wpn_p90.cpp:100 */ -BOOL CP90::__MAKE_VHOOK(Deploy)(void) +BOOL CP90::__MAKE_VHOOK(Deploy)() { m_iShotsFired = 0; m_bDelayFire = false; - m_flAccuracy = 0.2; + m_flAccuracy = 0.2f; iShellOn = 1; @@ -65,7 +66,7 @@ BOOL CP90::__MAKE_VHOOK(Deploy)(void) } /* <296533> ../cstrike/dlls/wpn_shared/wpn_p90.cpp:110 */ -void CP90::__MAKE_VHOOK(PrimaryAttack)(void) +void CP90::__MAKE_VHOOK(PrimaryAttack)() { if (!(m_pPlayer->pev->flags & FL_ONGROUND)) { @@ -88,9 +89,9 @@ void CP90::P90Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) int flag; m_bDelayFire = true; - m_iShotsFired++; + ++m_iShotsFired; - m_flAccuracy = (m_iShotsFired * m_iShotsFired / 175) + 0.45; + m_flAccuracy = (m_iShotsFired * m_iShotsFired / 175) + 0.45f; if (m_flAccuracy > 1) m_flAccuracy = 1; @@ -111,8 +112,7 @@ void CP90::P90Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) return; } - m_iClip--; - + --m_iClip; m_pPlayer->pev->effects |= EF_MUZZLEFLASH; m_pPlayer->SetAnimation(PLAYER_ATTACK1); @@ -142,7 +142,7 @@ void CP90::P90Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0); } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0f; if (!(m_pPlayer->pev->flags & FL_ONGROUND)) { @@ -163,24 +163,22 @@ void CP90::P90Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) } /* <2963e8> ../cstrike/dlls/wpn_shared/wpn_p90.cpp:202 */ -void CP90::__MAKE_VHOOK(Reload)(void) +void CP90::__MAKE_VHOOK(Reload)() { if (m_pPlayer->ammo_57mm <= 0) - { return; - } if (DefaultReload(P90_MAX_CLIP, P90_RELOAD, P90_RELOAD_TIME)) { m_pPlayer->SetAnimation(PLAYER_RELOAD); - m_flAccuracy = 0.2; + m_flAccuracy = 0.2f; m_iShotsFired = 0; } } /* <2963ad> ../cstrike/dlls/wpn_shared/wpn_p90.cpp:216 */ -void CP90::__MAKE_VHOOK(WeaponIdle)(void) +void CP90::__MAKE_VHOOK(WeaponIdle)() { ResetEmptySound(); m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES); @@ -190,56 +188,12 @@ void CP90::__MAKE_VHOOK(WeaponIdle)(void) return; } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0f; SendWeaponAnim(P90_IDLE1, UseDecrement() != FALSE); } /* <29626a> ../cstrike/dlls/weapons.h:1052 */ -float CP90::__MAKE_VHOOK(GetMaxSpeed)(void) +float CP90::__MAKE_VHOOK(GetMaxSpeed)() { return P90_MAX_SPEED; } - -#ifdef HOOK_GAMEDLL - -void CP90::Spawn(void) -{ - Spawn_(); -} - -void CP90::Precache(void) -{ - Precache_(); -} - -int CP90::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CP90::Deploy(void) -{ - return Deploy_(); -} - -void CP90::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CP90::Reload(void) -{ - Reload_(); -} - -void CP90::WeaponIdle(void) -{ - WeaponIdle_(); -} - -float CP90::GetMaxSpeed(void) -{ - return GetMaxSpeed_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_scout.cpp b/regamedll/dlls/wpn_shared/wpn_scout.cpp index 4c0d6305..c019cf71 100644 --- a/regamedll/dlls/wpn_shared/wpn_scout.cpp +++ b/regamedll/dlls/wpn_shared/wpn_scout.cpp @@ -4,9 +4,10 @@ LINK_ENTITY_TO_CLASS(weapon_scout, CSCOUT); /* <29b7ee> ../cstrike/dlls/wpn_shared/wpn_scout.cpp:50 */ -void CSCOUT::__MAKE_VHOOK(Spawn)(void) +void CSCOUT::__MAKE_VHOOK(Spawn)() { Precache(); + m_iId = WEAPON_SCOUT; SET_MODEL(edict(), "models/w_scout.mdl"); @@ -16,7 +17,7 @@ void CSCOUT::__MAKE_VHOOK(Spawn)(void) } /* <29b70a> ../cstrike/dlls/wpn_shared/wpn_scout.cpp:62 */ -void CSCOUT::__MAKE_VHOOK(Precache)(void) +void CSCOUT::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_scout.mdl"); PRECACHE_MODEL("models/w_scout.mdl"); @@ -50,12 +51,12 @@ int CSCOUT::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <29b8f7> ../cstrike/dlls/wpn_shared/wpn_scout.cpp:96 */ -BOOL CSCOUT::__MAKE_VHOOK(Deploy)(void) +BOOL CSCOUT::__MAKE_VHOOK(Deploy)() { if (DefaultDeploy("models/v_scout.mdl", "models/p_scout.mdl", SCOUT_DRAW, "rifle", UseDecrement() != FALSE)) { m_flNextPrimaryAttack = m_pPlayer->m_flNextAttack = GetNextAttackDelay(1.25); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 1.0f; return TRUE; } @@ -64,7 +65,7 @@ BOOL CSCOUT::__MAKE_VHOOK(Deploy)(void) } /* <29b78a> ../cstrike/dlls/wpn_shared/wpn_scout.cpp:109 */ -void CSCOUT::__MAKE_VHOOK(SecondaryAttack)(void) +void CSCOUT::__MAKE_VHOOK(SecondaryAttack)() { switch (m_pPlayer->m_iFOV) { @@ -89,7 +90,7 @@ void CSCOUT::__MAKE_VHOOK(SecondaryAttack)(void) } /* <29ba31> ../cstrike/dlls/wpn_shared/wpn_scout.cpp:140 */ -void CSCOUT::__MAKE_VHOOK(PrimaryAttack)(void) +void CSCOUT::__MAKE_VHOOK(PrimaryAttack)() { if (!(m_pPlayer->pev->flags & FL_ONGROUND)) { @@ -122,13 +123,10 @@ void CSCOUT::SCOUTFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) // reset a fov m_pPlayer->m_iFOV = DEFAULT_FOV; -#ifdef REGAMEDLL_FIXES - m_pPlayer->pev->fov = DEFAULT_FOV; -#endif // REGAMEDLL_FIXES } else { - flSpread += 0.025; + flSpread += 0.025f; } if (m_iClip <= 0) @@ -147,12 +145,12 @@ void CSCOUT::SCOUTFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) return; } - m_iClip--; + --m_iClip; m_pPlayer->SetAnimation(PLAYER_ATTACK1); UTIL_MakeVectors(m_pPlayer->pev->v_angle + m_pPlayer->pev->punchangle); - m_pPlayer->m_flEjectBrass = gpGlobals->time + 0.56; + m_pPlayer->m_flEjectBrass = gpGlobals->time + 0.56f; m_pPlayer->m_iWeaponVolume = BIG_EXPLOSION_VOLUME; m_pPlayer->m_iWeaponFlash = NORMAL_GUN_FLASH; @@ -177,19 +175,17 @@ void CSCOUT::SCOUTFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0); } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.8; - m_pPlayer->pev->punchangle.x -= 2; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.8f; + m_pPlayer->pev->punchangle.x -= 2.0f; } /* <29b89e> ../cstrike/dlls/wpn_shared/wpn_scout.cpp:232 */ -void CSCOUT::__MAKE_VHOOK(Reload)(void) +void CSCOUT::__MAKE_VHOOK(Reload)() { #ifdef REGAMEDLL_FIXES // to prevent reload if not enough ammo if (m_pPlayer->ammo_762nato <= 0) - { return; - } #endif // REGAMEDLL_FIXES if (DefaultReload(SCOUT_MAX_CLIP, SCOUT_RELOAD, SCOUT_RELOAD_TIME)) @@ -205,7 +201,7 @@ void CSCOUT::__MAKE_VHOOK(Reload)(void) } /* <29b864> ../cstrike/dlls/wpn_shared/wpn_scout.cpp:250 */ -void CSCOUT::__MAKE_VHOOK(WeaponIdle)(void) +void CSCOUT::__MAKE_VHOOK(WeaponIdle)() { ResetEmptySound(); m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES); @@ -217,62 +213,13 @@ void CSCOUT::__MAKE_VHOOK(WeaponIdle)(void) if (m_iClip) { - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 60; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 60.0f; SendWeaponAnim(SCOUT_IDLE, UseDecrement() != FALSE); } } /* <29b764> ../cstrike/dlls/wpn_shared/wpn_scout.cpp:267 */ -float CSCOUT::__MAKE_VHOOK(GetMaxSpeed)(void) +float CSCOUT::__MAKE_VHOOK(GetMaxSpeed)() { return (m_pPlayer->m_iFOV == DEFAULT_FOV) ? SCOUT_MAX_SPEED : SCOUT_MAX_SPEED_ZOOM; } - -#ifdef HOOK_GAMEDLL - -void CSCOUT::Spawn(void) -{ - Spawn_(); -} - -void CSCOUT::Precache(void) -{ - Precache_(); -} - -int CSCOUT::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CSCOUT::Deploy(void) -{ - return Deploy_(); -} - -float CSCOUT::GetMaxSpeed(void) -{ - return GetMaxSpeed_(); -} - -void CSCOUT::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CSCOUT::SecondaryAttack(void) -{ - SecondaryAttack_(); -} - -void CSCOUT::Reload(void) -{ - Reload_(); -} - -void CSCOUT::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_sg550.cpp b/regamedll/dlls/wpn_shared/wpn_sg550.cpp index ab0386c8..d1cf6bad 100644 --- a/regamedll/dlls/wpn_shared/wpn_sg550.cpp +++ b/regamedll/dlls/wpn_shared/wpn_sg550.cpp @@ -4,9 +4,10 @@ LINK_ENTITY_TO_CLASS(weapon_sg550, CSG550); /* <2a0ce8> ../cstrike/dlls/wpn_shared/wpn_sg550.cpp:50 */ -void CSG550::__MAKE_VHOOK(Spawn)(void) +void CSG550::__MAKE_VHOOK(Spawn)() { Precache(); + m_iId = WEAPON_SG550; SET_MODEL(edict(), "models/w_sg550.mdl"); @@ -17,7 +18,7 @@ void CSG550::__MAKE_VHOOK(Spawn)(void) } /* <2a0bdd> ../cstrike/dlls/wpn_shared/wpn_sg550.cpp:63 */ -void CSG550::__MAKE_VHOOK(Precache)(void) +void CSG550::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_sg550.mdl"); PRECACHE_MODEL("models/w_sg550.mdl"); @@ -51,13 +52,13 @@ int CSG550::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <2a0cc1> ../cstrike/dlls/wpn_shared/wpn_sg550.cpp:96 */ -BOOL CSG550::__MAKE_VHOOK(Deploy)(void) +BOOL CSG550::__MAKE_VHOOK(Deploy)() { return DefaultDeploy("models/v_sg550.mdl", "models/p_sg550.mdl", SG550_DRAW, "rifle", UseDecrement() != FALSE); } /* <2a0c5d> ../cstrike/dlls/wpn_shared/wpn_sg550.cpp:101 */ -void CSG550::__MAKE_VHOOK(SecondaryAttack)(void) +void CSG550::__MAKE_VHOOK(SecondaryAttack)() { switch (m_pPlayer->m_iFOV) { @@ -83,7 +84,7 @@ void CSG550::__MAKE_VHOOK(SecondaryAttack)(void) } /* <2a0eef> ../cstrike/dlls/wpn_shared/wpn_sg550.cpp:132 */ -void CSG550::__MAKE_VHOOK(PrimaryAttack)(void) +void CSG550::__MAKE_VHOOK(PrimaryAttack)() { if (!(m_pPlayer->pev->flags & FL_ONGROUND)) { @@ -111,16 +112,16 @@ void CSG550::SG550Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) if (m_pPlayer->pev->fov == DEFAULT_FOV) { - flSpread += 0.025; + flSpread += 0.025f; } if (m_flLastFire) { - m_flAccuracy = (gpGlobals->time - m_flLastFire) * 0.35 + 0.65; + m_flAccuracy = (gpGlobals->time - m_flLastFire) * 0.35f + 0.65f; - if (m_flAccuracy > 0.98) + if (m_flAccuracy > 0.98f) { - m_flAccuracy = 0.98; + m_flAccuracy = 0.98f; } } @@ -142,8 +143,7 @@ void CSG550::SG550Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) return; } - m_iClip--; - + --m_iClip; m_pPlayer->pev->effects |= EF_MUZZLEFLASH; m_pPlayer->SetAnimation(PLAYER_ATTACK1); @@ -173,19 +173,17 @@ void CSG550::SG550Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0); } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.8; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.8f; m_pPlayer->pev->punchangle.x -= UTIL_SharedRandomFloat(m_pPlayer->random_seed + 4, 0.75, 1.25) + m_pPlayer->pev->punchangle.x * 0.25; m_pPlayer->pev->punchangle.y += UTIL_SharedRandomFloat(m_pPlayer->random_seed + 5, -0.75, 0.75); } /* <2a0d98> ../cstrike/dlls/wpn_shared/wpn_sg550.cpp:227 */ -void CSG550::__MAKE_VHOOK(Reload)(void) +void CSG550::__MAKE_VHOOK(Reload)() { if (m_pPlayer->ammo_556nato <= 0) - { return; - } if (DefaultReload(SG550_MAX_CLIP, SG550_RELOAD, SG550_RELOAD_TIME)) { @@ -200,10 +198,9 @@ void CSG550::__MAKE_VHOOK(Reload)(void) } /* <2a0d5e> ../cstrike/dlls/wpn_shared/wpn_sg550.cpp:248 */ -void CSG550::__MAKE_VHOOK(WeaponIdle)(void) +void CSG550::__MAKE_VHOOK(WeaponIdle)() { ResetEmptySound(); - m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES); if (m_flTimeWeaponIdle > UTIL_WeaponTimeBase()) @@ -213,62 +210,13 @@ void CSG550::__MAKE_VHOOK(WeaponIdle)(void) if (m_iClip) { - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 60.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 60.0f; SendWeaponAnim(SG550_IDLE, UseDecrement() != FALSE); } } /* <2a0c37> ../cstrike/dlls/wpn_shared/wpn_sg550.cpp:265 */ -float CSG550::__MAKE_VHOOK(GetMaxSpeed)(void) +float CSG550::__MAKE_VHOOK(GetMaxSpeed)() { return (m_pPlayer->m_iFOV == DEFAULT_FOV) ? SG550_MAX_SPEED : SG550_MAX_SPEED_ZOOM; } - -#ifdef HOOK_GAMEDLL - -void CSG550::Spawn(void) -{ - Spawn_(); -} - -void CSG550::Precache(void) -{ - Precache_(); -} - -int CSG550::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CSG550::Deploy(void) -{ - return Deploy_(); -} - -float CSG550::GetMaxSpeed(void) -{ - return GetMaxSpeed_(); -} - -void CSG550::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CSG550::SecondaryAttack(void) -{ - SecondaryAttack_(); -} - -void CSG550::Reload(void) -{ - Reload_(); -} - -void CSG550::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_sg552.cpp b/regamedll/dlls/wpn_shared/wpn_sg552.cpp index 6cfc93a9..de0d1268 100644 --- a/regamedll/dlls/wpn_shared/wpn_sg552.cpp +++ b/regamedll/dlls/wpn_shared/wpn_sg552.cpp @@ -4,21 +4,22 @@ LINK_ENTITY_TO_CLASS(weapon_sg552, CSG552); /* <2a60cb> ../cstrike/dlls/wpn_shared/wpn_sg552.cpp:52 */ -void CSG552::__MAKE_VHOOK(Spawn)(void) +void CSG552::__MAKE_VHOOK(Spawn)() { Precache(); + m_iId = WEAPON_SG552; SET_MODEL(edict(), "models/w_sg552.mdl"); m_iDefaultAmmo = SG552_DEFAULT_GIVE; - m_flAccuracy = 0.2; + m_flAccuracy = 0.2f; m_iShotsFired = 0; FallInit(); } /* <2a5ffe> ../cstrike/dlls/wpn_shared/wpn_sg552.cpp:66 */ -void CSG552::__MAKE_VHOOK(Precache)(void) +void CSG552::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_sg552.mdl"); PRECACHE_MODEL("models/w_sg552.mdl"); @@ -52,9 +53,9 @@ int CSG552::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <2a60a4> ../cstrike/dlls/wpn_shared/wpn_sg552.cpp:100 */ -BOOL CSG552::__MAKE_VHOOK(Deploy)(void) +BOOL CSG552::__MAKE_VHOOK(Deploy)() { - m_flAccuracy = 0.2; + m_flAccuracy = 0.2f; m_iShotsFired = 0; iShellOn = 1; @@ -62,18 +63,18 @@ BOOL CSG552::__MAKE_VHOOK(Deploy)(void) } /* <2a6058> ../cstrike/dlls/wpn_shared/wpn_sg552.cpp:109 */ -void CSG552::__MAKE_VHOOK(SecondaryAttack)(void) +void CSG552::__MAKE_VHOOK(SecondaryAttack)() { if (m_pPlayer->m_iFOV == DEFAULT_FOV) m_pPlayer->pev->fov = m_pPlayer->m_iFOV = 55; else m_pPlayer->pev->fov = m_pPlayer->m_iFOV = 90; - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.3; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.3f; } /* <2a63eb> ../cstrike/dlls/wpn_shared/wpn_sg552.cpp:130 */ -void CSG552::__MAKE_VHOOK(PrimaryAttack)(void) +void CSG552::__MAKE_VHOOK(PrimaryAttack)() { if (!(m_pPlayer->pev->flags & FL_ONGROUND)) { @@ -102,10 +103,10 @@ void CSG552::SG552Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) m_bDelayFire = true; m_iShotsFired++; - m_flAccuracy = ((m_iShotsFired * m_iShotsFired * m_iShotsFired) / 220) + 0.3; + m_flAccuracy = ((m_iShotsFired * m_iShotsFired * m_iShotsFired) / 220) + 0.3f; - if (m_flAccuracy > 1) - m_flAccuracy = 1; + if (m_flAccuracy > 1.0f) + m_flAccuracy = 1.0f; if (m_iClip <= 0) { @@ -154,7 +155,7 @@ void CSG552::SG552Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0); } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0f; if (m_pPlayer->pev->velocity.Length2D() > 0) { @@ -175,12 +176,10 @@ void CSG552::SG552Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) } /* <2a617c> ../cstrike/dlls/wpn_shared/wpn_sg552.cpp:225 */ -void CSG552::__MAKE_VHOOK(Reload)(void) +void CSG552::__MAKE_VHOOK(Reload)() { if (m_pPlayer->ammo_556nato <= 0) - { return; - } if (DefaultReload(SG552_MAX_CLIP, SG552_RELOAD, SG552_RELOAD_TIME)) { @@ -190,14 +189,14 @@ void CSG552::__MAKE_VHOOK(Reload)(void) } m_pPlayer->SetAnimation(PLAYER_RELOAD); - m_flAccuracy = 0.2; + m_flAccuracy = 0.2f; m_iShotsFired = 0; m_bDelayFire = false; } } /* <2a6141> ../cstrike/dlls/wpn_shared/wpn_sg552.cpp:244 */ -void CSG552::__MAKE_VHOOK(WeaponIdle)(void) +void CSG552::__MAKE_VHOOK(WeaponIdle)() { ResetEmptySound(); m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES); @@ -207,61 +206,15 @@ void CSG552::__MAKE_VHOOK(WeaponIdle)(void) return; } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0f; SendWeaponAnim(SG552_IDLE1, UseDecrement() != FALSE); } /* <2a607e> ../cstrike/dlls/wpn_shared/wpn_sg552.cpp:259 */ -float CSG552::__MAKE_VHOOK(GetMaxSpeed)(void) +float CSG552::__MAKE_VHOOK(GetMaxSpeed)() { - return (m_pPlayer->m_iFOV == DEFAULT_FOV) ? SG552_MAX_SPEED : SG552_MAX_SPEED_ZOOM; + if (m_pPlayer->m_iFOV == DEFAULT_FOV) + return SG552_MAX_SPEED; + + return SG552_MAX_SPEED_ZOOM; } - -#ifdef HOOK_GAMEDLL - -void CSG552::Spawn(void) -{ - Spawn_(); -} - -void CSG552::Precache(void) -{ - Precache_(); -} - -int CSG552::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CSG552::Deploy(void) -{ - return Deploy_(); -} - -float CSG552::GetMaxSpeed(void) -{ - return GetMaxSpeed_(); -} - -void CSG552::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CSG552::SecondaryAttack(void) -{ - SecondaryAttack_(); -} - -void CSG552::Reload(void) -{ - Reload_(); -} - -void CSG552::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_smokegrenade.cpp b/regamedll/dlls/wpn_shared/wpn_smokegrenade.cpp index 61e484c6..9b2170ea 100644 --- a/regamedll/dlls/wpn_shared/wpn_smokegrenade.cpp +++ b/regamedll/dlls/wpn_shared/wpn_smokegrenade.cpp @@ -4,11 +4,11 @@ LINK_ENTITY_TO_CLASS(weapon_smokegrenade, CSmokeGrenade); /* <2aafc7> ../cstrike/dlls/wpn_shared/wpn_smokegrenade.cpp:40 */ -void CSmokeGrenade::__MAKE_VHOOK(Spawn)(void) +void CSmokeGrenade::__MAKE_VHOOK(Spawn)() { Precache(); - m_iId = WEAPON_SMOKEGRENADE; + m_iId = WEAPON_SMOKEGRENADE; SET_MODEL(edict(), "models/w_smokegrenade.mdl"); pev->dmg = 4; @@ -23,7 +23,7 @@ void CSmokeGrenade::__MAKE_VHOOK(Spawn)(void) } /* <2aaf12> ../cstrike/dlls/wpn_shared/wpn_smokegrenade.cpp:59 */ -void CSmokeGrenade::__MAKE_VHOOK(Precache)(void) +void CSmokeGrenade::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_smokegrenade.mdl"); PRECACHE_MODEL("models/shield/v_shield_smokegrenade.mdl"); @@ -53,7 +53,7 @@ int CSmokeGrenade::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <2ab077> ../cstrike/dlls/wpn_shared/wpn_smokegrenade.cpp:89 */ -BOOL CSmokeGrenade::__MAKE_VHOOK(Deploy)(void) +BOOL CSmokeGrenade::__MAKE_VHOOK(Deploy)() { m_iWeaponState &= ~WPNSTATE_SHIELD_DRAWN; @@ -71,7 +71,7 @@ BOOL CSmokeGrenade::__MAKE_VHOOK(Deploy)(void) /* <2aaf92> ../cstrike/dlls/wpn_shared/wpn_smokegrenade.cpp:104 */ void CSmokeGrenade::__MAKE_VHOOK(Holster)(int skiplocal) { - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; if (!m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]) { @@ -86,7 +86,7 @@ void CSmokeGrenade::__MAKE_VHOOK(Holster)(int skiplocal) } /* <2ab03d> ../cstrike/dlls/wpn_shared/wpn_smokegrenade.cpp:120 */ -void CSmokeGrenade::__MAKE_VHOOK(PrimaryAttack)(void) +void CSmokeGrenade::__MAKE_VHOOK(PrimaryAttack)() { if (m_iWeaponState & WPNSTATE_SHIELD_DRAWN) return; @@ -97,7 +97,7 @@ void CSmokeGrenade::__MAKE_VHOOK(PrimaryAttack)(void) m_flStartThrow = gpGlobals->time; SendWeaponAnim(SMOKEGRENADE_PINPULL, UseDecrement() != FALSE); - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.5f; } } @@ -133,21 +133,21 @@ bool CSmokeGrenade::ShieldSecondaryFire(int iUpAnim, int iDownAnim) m_pPlayer->UpdateShieldCrosshair((m_iWeaponState & WPNSTATE_SHIELD_DRAWN) != WPNSTATE_SHIELD_DRAWN); m_pPlayer->ResetMaxSpeed(); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.4; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.4f; m_flNextPrimaryAttack = GetNextAttackDelay(0.4); - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.6; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.6f; return true; } /* <2ab0b2> ../cstrike/dlls/wpn_shared/wpn_smokegrenade.cpp:173 */ -void CSmokeGrenade::__MAKE_VHOOK(SecondaryAttack)(void) +void CSmokeGrenade::__MAKE_VHOOK(SecondaryAttack)() { ShieldSecondaryFire(SHIELDGUN_DRAW, SHIELDGUN_DRAWN_IDLE); } /* <2ab42f> ../cstrike/dlls/wpn_shared/wpn_smokegrenade.cpp:178 */ -void CSmokeGrenade::SetPlayerShieldAnim(void) +void CSmokeGrenade::SetPlayerShieldAnim() { if (!m_pPlayer->HasShield()) return; @@ -159,7 +159,7 @@ void CSmokeGrenade::SetPlayerShieldAnim(void) } /* <2ab451> ../cstrike/dlls/wpn_shared/wpn_smokegrenade.cpp:189 */ -void CSmokeGrenade::ResetPlayerShieldAnim(void) +void CSmokeGrenade::ResetPlayerShieldAnim() { if (!m_pPlayer->HasShield()) return; @@ -171,7 +171,7 @@ void CSmokeGrenade::ResetPlayerShieldAnim(void) } /* <2aa17b> ../cstrike/dlls/wpn_shared/wpn_smokegrenade.cpp:199 */ -void CSmokeGrenade::__MAKE_VHOOK(WeaponIdle)(void) +void CSmokeGrenade::__MAKE_VHOOK(WeaponIdle)() { if (m_flReleaseThrow == 0) m_flReleaseThrow = gpGlobals->time; @@ -190,14 +190,14 @@ void CSmokeGrenade::__MAKE_VHOOK(WeaponIdle)(void) else angThrow.x = -10 + angThrow.x * ((90 + 10) / 90.0); - float_precision flVel = (90.0 - angThrow.x) * 6.0; + float_precision flVel = (90.0f - angThrow.x) * 6.0f; if (flVel > 750.0f) flVel = 750.0f; UTIL_MakeVectors(angThrow); - Vector vecSrc = m_pPlayer->pev->origin + m_pPlayer->pev->view_ofs + gpGlobals->v_forward * 16; + Vector vecSrc = m_pPlayer->pev->origin + m_pPlayer->pev->view_ofs + gpGlobals->v_forward * 16.0f; Vector vecThrow = gpGlobals->v_forward * flVel + m_pPlayer->pev->velocity; CGrenade::ShootSmokeGrenade(m_pPlayer->pev, vecSrc, vecThrow, 1.5, m_usCreateSmoke); @@ -210,11 +210,9 @@ void CSmokeGrenade::__MAKE_VHOOK(WeaponIdle)(void) m_flStartThrow = 0; m_flNextPrimaryAttack = GetNextAttackDelay(0.5); - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.75; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.75f; - m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--; - - if (!m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]) + if (--m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0) { // just threw last grenade // set attack times in the future, and weapon idle in the future so we can see the whole throw @@ -250,7 +248,7 @@ void CSmokeGrenade::__MAKE_VHOOK(WeaponIdle)(void) if (m_pPlayer->HasShield()) { - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0f; if (m_iWeaponState & WPNSTATE_SHIELD_DRAWN) { @@ -269,7 +267,7 @@ void CSmokeGrenade::__MAKE_VHOOK(WeaponIdle)(void) else { iAnim = SMOKEGRENADE_IDLE; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 75.0 / 30.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 75.0f / 30.0f; } SendWeaponAnim(iAnim, UseDecrement() != FALSE); @@ -278,56 +276,7 @@ void CSmokeGrenade::__MAKE_VHOOK(WeaponIdle)(void) } /* <2aaf6c> ../cstrike/dlls/wpn_shared/wpn_smokegrenade.cpp:310 */ -BOOL CSmokeGrenade::__MAKE_VHOOK(CanDeploy)(void) +BOOL CSmokeGrenade::__MAKE_VHOOK(CanDeploy)() { return m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] != 0; } - -#ifdef HOOK_GAMEDLL - -void CSmokeGrenade::Spawn(void) -{ - Spawn_(); -} - -void CSmokeGrenade::Precache(void) -{ - Precache_(); -} - -int CSmokeGrenade::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CSmokeGrenade::CanDeploy(void) -{ - return CanDeploy_(); -} - -BOOL CSmokeGrenade::Deploy(void) -{ - return Deploy_(); -} - -void CSmokeGrenade::Holster(int skiplocal) -{ - Holster_(skiplocal); -} - -void CSmokeGrenade::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CSmokeGrenade::SecondaryAttack(void) -{ - SecondaryAttack_(); -} - -void CSmokeGrenade::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_tmp.cpp b/regamedll/dlls/wpn_shared/wpn_tmp.cpp index dc337d6d..408a779c 100644 --- a/regamedll/dlls/wpn_shared/wpn_tmp.cpp +++ b/regamedll/dlls/wpn_shared/wpn_tmp.cpp @@ -4,14 +4,15 @@ LINK_ENTITY_TO_CLASS(weapon_tmp, CTMP); /* <2b04ba> ../cstrike/dlls/wpn_shared/wpn_tmp.cpp:52 */ -void CTMP::__MAKE_VHOOK(Spawn)(void) +void CTMP::__MAKE_VHOOK(Spawn)() { Precache(); + m_iId = WEAPON_TMP; SET_MODEL(edict(), "models/w_tmp.mdl"); m_iDefaultAmmo = TMP_DEFAULT_GIVE; - m_flAccuracy = 0.2; + m_flAccuracy = 0.2f; m_iShotsFired = 0; m_bDelayFire = false; @@ -19,7 +20,7 @@ void CTMP::__MAKE_VHOOK(Spawn)(void) } /* <2b0439> ../cstrike/dlls/wpn_shared/wpn_tmp.cpp:67 */ -void CTMP::__MAKE_VHOOK(Precache)(void) +void CTMP::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_tmp.mdl"); PRECACHE_MODEL("models/w_tmp.mdl"); @@ -50,9 +51,9 @@ int CTMP::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <2b0493> ../cstrike/dlls/wpn_shared/wpn_tmp.cpp:98 */ -BOOL CTMP::__MAKE_VHOOK(Deploy)(void) +BOOL CTMP::__MAKE_VHOOK(Deploy)() { - m_flAccuracy = 0.2; + m_flAccuracy = 0.2f; m_iShotsFired = 0; m_bDelayFire = false; iShellOn = 1; @@ -61,7 +62,7 @@ BOOL CTMP::__MAKE_VHOOK(Deploy)(void) } /* <2b06b6> ../cstrike/dlls/wpn_shared/wpn_tmp.cpp:108 */ -void CTMP::__MAKE_VHOOK(PrimaryAttack)(void) +void CTMP::__MAKE_VHOOK(PrimaryAttack)() { if (!(m_pPlayer->pev->flags & FL_ONGROUND)) { @@ -80,12 +81,12 @@ void CTMP::TMPFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) int flag; m_bDelayFire = true; - m_iShotsFired++; + ++m_iShotsFired; - m_flAccuracy = ((m_iShotsFired * m_iShotsFired * m_iShotsFired) / 200) + 0.55; + m_flAccuracy = ((m_iShotsFired * m_iShotsFired * m_iShotsFired) / 200) + 0.55f; - if (m_flAccuracy > 1.4) - m_flAccuracy = 1.4; + if (m_flAccuracy > 1.4f) + m_flAccuracy = 1.4f; if (m_iClip <= 0) { @@ -103,7 +104,7 @@ void CTMP::TMPFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) return; } - m_iClip--; + --m_iClip; m_pPlayer->SetAnimation(PLAYER_ATTACK1); UTIL_MakeVectors(m_pPlayer->pev->v_angle + m_pPlayer->pev->punchangle); @@ -132,7 +133,7 @@ void CTMP::TMPFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0); } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0f; if (!(m_pPlayer->pev->flags & FL_ONGROUND)) { @@ -153,27 +154,25 @@ void CTMP::TMPFire(float flSpread, float flCycleTime, BOOL fUseAutoAim) } /* <2b056b> ../cstrike/dlls/wpn_shared/wpn_tmp.cpp:197 */ -void CTMP::__MAKE_VHOOK(Reload)(void) +void CTMP::__MAKE_VHOOK(Reload)() { #ifdef REGAMEDLL_FIXES // to prevent reload if not enough ammo if (m_pPlayer->ammo_9mm <= 0) - { return; - } #endif // REGAMEDLL_FIXES if (DefaultReload(TMP_MAX_CLIP, TMP_RELOAD, TMP_RELOAD_TIME)) { m_pPlayer->SetAnimation(PLAYER_RELOAD); - m_flAccuracy = 0.2; + m_flAccuracy = 0.2f; m_iShotsFired = 0; } } /* <2b0530> ../cstrike/dlls/wpn_shared/wpn_tmp.cpp:211 */ -void CTMP::__MAKE_VHOOK(WeaponIdle)(void) +void CTMP::__MAKE_VHOOK(WeaponIdle)() { ResetEmptySound(); m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES); @@ -183,45 +182,6 @@ void CTMP::__MAKE_VHOOK(WeaponIdle)(void) return; } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0f; SendWeaponAnim(TMP_IDLE1, UseDecrement() != FALSE); } - -#ifdef HOOK_GAMEDLL - -void CTMP::Spawn(void) -{ - Spawn_(); -} - -void CTMP::Precache(void) -{ - Precache_(); -} - -int CTMP::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CTMP::Deploy(void) -{ - return Deploy_(); -} - -void CTMP::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CTMP::Reload(void) -{ - Reload_(); -} - -void CTMP::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_ump45.cpp b/regamedll/dlls/wpn_shared/wpn_ump45.cpp index 9381a3a1..f7a2685b 100644 --- a/regamedll/dlls/wpn_shared/wpn_ump45.cpp +++ b/regamedll/dlls/wpn_shared/wpn_ump45.cpp @@ -4,21 +4,22 @@ LINK_ENTITY_TO_CLASS(weapon_ump45, CUMP45); /* <2b58f0> ../cstrike/dlls/wpn_shared/wpn_ump45.cpp:52 */ -void CUMP45::__MAKE_VHOOK(Spawn)(void) +void CUMP45::__MAKE_VHOOK(Spawn)() { Precache(); + m_iId = WEAPON_UMP45; SET_MODEL(edict(), "models/w_ump45.mdl"); m_iDefaultAmmo = UMP45_DEFAULT_GIVE; - m_flAccuracy = 0; + m_flAccuracy = 0.0f; m_bDelayFire = false; FallInit(); } /* <2b586f> ../cstrike/dlls/wpn_shared/wpn_ump45.cpp:66 */ -void CUMP45::__MAKE_VHOOK(Precache)(void) +void CUMP45::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_ump45.mdl"); PRECACHE_MODEL("models/w_ump45.mdl"); @@ -55,9 +56,9 @@ int CUMP45::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <2b58c9> ../cstrike/dlls/wpn_shared/wpn_ump45.cpp:99 */ -BOOL CUMP45::__MAKE_VHOOK(Deploy)(void) +BOOL CUMP45::__MAKE_VHOOK(Deploy)() { - m_flAccuracy = 0; + m_flAccuracy = 0.0f; m_bDelayFire = false; iShellOn = 1; @@ -65,7 +66,7 @@ BOOL CUMP45::__MAKE_VHOOK(Deploy)(void) } /* <2b5aec> ../cstrike/dlls/wpn_shared/wpn_ump45.cpp:108 */ -void CUMP45::__MAKE_VHOOK(PrimaryAttack)(void) +void CUMP45::__MAKE_VHOOK(PrimaryAttack)() { if (!(m_pPlayer->pev->flags & FL_ONGROUND)) { @@ -84,12 +85,12 @@ void CUMP45::UMP45Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) int flag; m_bDelayFire = true; - m_iShotsFired++; + ++m_iShotsFired; - m_flAccuracy = ((m_iShotsFired * m_iShotsFired) / 120) + 0.5; + m_flAccuracy = ((m_iShotsFired * m_iShotsFired) / 210) + 0.5f; - if (m_flAccuracy > 1) - m_flAccuracy = 1; + if (m_flAccuracy > 1.0f) + m_flAccuracy = 1.0f; if (m_iClip <= 0) { @@ -107,7 +108,7 @@ void CUMP45::UMP45Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) return; } - m_iClip--; + --m_iClip; m_pPlayer->pev->effects |= EF_MUZZLEFLASH; m_pPlayer->SetAnimation(PLAYER_ATTACK1); @@ -138,7 +139,7 @@ void CUMP45::UMP45Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0); } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0f; if (!(m_pPlayer->pev->flags & FL_ONGROUND)) { @@ -159,24 +160,22 @@ void CUMP45::UMP45Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim) } /* <2b59a1> ../cstrike/dlls/wpn_shared/wpn_ump45.cpp:200 */ -void CUMP45::__MAKE_VHOOK(Reload)(void) +void CUMP45::__MAKE_VHOOK(Reload)() { if (m_pPlayer->ammo_45acp <= 0) - { return; - } if (DefaultReload(UMP45_MAX_CLIP, UMP45_RELOAD, UMP45_RELOAD_TIME)) { m_pPlayer->SetAnimation(PLAYER_RELOAD); - m_flAccuracy = 0; + m_flAccuracy = 0.0f; m_iShotsFired = 0; } } /* <2b5966> ../cstrike/dlls/wpn_shared/wpn_ump45.cpp:214 */ -void CUMP45::__MAKE_VHOOK(WeaponIdle)(void) +void CUMP45::__MAKE_VHOOK(WeaponIdle)() { ResetEmptySound(); m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES); @@ -186,45 +185,6 @@ void CUMP45::__MAKE_VHOOK(WeaponIdle)(void) return; } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0f; SendWeaponAnim(UMP45_IDLE1, UseDecrement() != FALSE); } - -#ifdef HOOK_GAMEDLL - -void CUMP45::Spawn(void) -{ - Spawn_(); -} - -void CUMP45::Precache(void) -{ - Precache_(); -} - -int CUMP45::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CUMP45::Deploy(void) -{ - return Deploy_(); -} - -void CUMP45::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CUMP45::Reload(void) -{ - Reload_(); -} - -void CUMP45::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_usp.cpp b/regamedll/dlls/wpn_shared/wpn_usp.cpp index 05470aa1..e9df1590 100644 --- a/regamedll/dlls/wpn_shared/wpn_usp.cpp +++ b/regamedll/dlls/wpn_shared/wpn_usp.cpp @@ -4,7 +4,7 @@ LINK_ENTITY_TO_CLASS(weapon_usp, CUSP); /* <2bad55> ../cstrike/dlls/wpn_shared/wpn_usp.cpp:70 */ -void CUSP::__MAKE_VHOOK(Spawn)(void) +void CUSP::__MAKE_VHOOK(Spawn)() { Precache(); @@ -13,12 +13,12 @@ void CUSP::__MAKE_VHOOK(Spawn)(void) m_iWeaponState &= ~WPNSTATE_SHIELD_DRAWN; m_iDefaultAmmo = USP_DEFAULT_GIVE; - m_flAccuracy = 0.92; + m_flAccuracy = 0.92f; FallInit(); } -void CUSP::__MAKE_VHOOK(Precache)(void) +void CUSP::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_usp.mdl"); PRECACHE_MODEL("models/w_usp.mdl"); @@ -61,7 +61,7 @@ int CUSP::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <2bad2e> ../cstrike/dlls/wpn_shared/wpn_usp.cpp:124 */ -BOOL CUSP::__MAKE_VHOOK(Deploy)(void) +BOOL CUSP::__MAKE_VHOOK(Deploy)() { m_iWeaponState &= ~WPNSTATE_SHIELD_DRAWN; m_flAccuracy = 0.92f; @@ -82,7 +82,7 @@ BOOL CUSP::__MAKE_VHOOK(Deploy)(void) } /* <2bae77> ../cstrike/dlls/wpn_shared/wpn_usp.cpp:147 */ -void CUSP::__MAKE_VHOOK(SecondaryAttack)(void) +void CUSP::__MAKE_VHOOK(SecondaryAttack)() { if (ShieldSecondaryFire(USP_SHIELD_UP, USP_SHIELD_DOWN)) { @@ -104,13 +104,13 @@ void CUSP::__MAKE_VHOOK(SecondaryAttack)(void) Q_strcpy(m_pPlayer->m_szAnimExtention, "onehanded"); } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0; - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 3.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0f; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 3.0f; m_flNextPrimaryAttack = GetNextAttackDelay(3.0); } /* <2bb000> ../cstrike/dlls/wpn_shared/wpn_usp.cpp:173 */ -void CUSP::__MAKE_VHOOK(PrimaryAttack)(void) +void CUSP::__MAKE_VHOOK(PrimaryAttack)() { if (m_iWeaponState & WPNSTATE_USP_SILENCED) { @@ -159,24 +159,24 @@ void CUSP::USPFire(float flSpread, float flCycleTime, BOOL fUseSemi) int iDamage; Vector vecAiming, vecSrc, vecDir; - flCycleTime -= 0.075; + flCycleTime -= 0.075f; if (++m_iShotsFired > 1) { return; } - if (m_flLastFire != 0.0) + if (m_flLastFire != 0.0f) { - m_flAccuracy -= (0.3 - (gpGlobals->time - m_flLastFire)) * 0.275; + m_flAccuracy -= (0.3f - (gpGlobals->time - m_flLastFire)) * 0.275f; - if (m_flAccuracy > 0.92) + if (m_flAccuracy > 0.92f) { - m_flAccuracy = 0.92; + m_flAccuracy = 0.92f; } - else if (m_flAccuracy < 0.6) + else if (m_flAccuracy < 0.6f) { - m_flAccuracy = 0.6; + m_flAccuracy = 0.6f; } } @@ -200,7 +200,7 @@ void CUSP::USPFire(float flSpread, float flCycleTime, BOOL fUseSemi) m_flNextPrimaryAttack = m_flNextSecondaryAttack = GetNextAttackDelay(flCycleTime); - m_iClip--; + --m_iClip; SetPlayerShieldAnim(); m_pPlayer->SetAnimation(PLAYER_ATTACK1); @@ -235,18 +235,16 @@ void CUSP::USPFire(float flSpread, float flCycleTime, BOOL fUseSemi) m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, FALSE); } - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2; - m_pPlayer->pev->punchangle.x -= 2; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.0f; + m_pPlayer->pev->punchangle.x -= 2.0f; ResetPlayerShieldAnim(); } /* <2bae19> ../cstrike/dlls/wpn_shared/wpn_usp.cpp:297 */ -void CUSP::__MAKE_VHOOK(Reload)(void) +void CUSP::__MAKE_VHOOK(Reload)() { if (m_pPlayer->ammo_45acp <= 0) - { return; - } int iResult; if (m_pPlayer->HasShield()) @@ -268,7 +266,7 @@ void CUSP::__MAKE_VHOOK(Reload)(void) } /* <2b9c2a> ../cstrike/dlls/wpn_shared/wpn_usp.cpp:318 */ -void CUSP::__MAKE_VHOOK(WeaponIdle)(void) +void CUSP::__MAKE_VHOOK(WeaponIdle)() { ResetEmptySound(); m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES); @@ -280,7 +278,7 @@ void CUSP::__MAKE_VHOOK(WeaponIdle)(void) if (m_pPlayer->HasShield()) { - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0f; if (m_iWeaponState & WPNSTATE_SHIELD_DRAWN) { @@ -291,51 +289,7 @@ void CUSP::__MAKE_VHOOK(WeaponIdle)(void) { int iAnim = (~m_iWeaponState & WPNSTATE_USP_SILENCED) ? USP_UNSIL_IDLE: USP_IDLE; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 60.0; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 60.0f; SendWeaponAnim(iAnim, UseDecrement()); } } - -#ifdef HOOK_GAMEDLL - -void CUSP::Spawn(void) -{ - Spawn_(); -} - -void CUSP::Precache(void) -{ - Precache_(); -} - -int CUSP::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CUSP::Deploy(void) -{ - return Deploy_(); -} - -void CUSP::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CUSP::SecondaryAttack(void) -{ - SecondaryAttack_(); -} - -void CUSP::Reload(void) -{ - Reload_(); -} - -void CUSP::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/wpn_shared/wpn_xm1014.cpp b/regamedll/dlls/wpn_shared/wpn_xm1014.cpp index 0217f042..0079865e 100644 --- a/regamedll/dlls/wpn_shared/wpn_xm1014.cpp +++ b/regamedll/dlls/wpn_shared/wpn_xm1014.cpp @@ -4,9 +4,10 @@ LINK_ENTITY_TO_CLASS(weapon_xm1014, CXM1014); /* <2cacc6> ../cstrike/dlls/wpn_shared/wpn_xm1014.cpp:53 */ -void CXM1014::__MAKE_VHOOK(Spawn)(void) +void CXM1014::__MAKE_VHOOK(Spawn)() { Precache(); + m_iId = WEAPON_XM1014; SET_MODEL(edict(), "models/w_xm1014.mdl"); @@ -17,7 +18,7 @@ void CXM1014::__MAKE_VHOOK(Spawn)(void) } /* <2caadc> ../cstrike/dlls/wpn_shared/wpn_xm1014.cpp:65 */ -void CXM1014::__MAKE_VHOOK(Precache)(void) +void CXM1014::__MAKE_VHOOK(Precache)() { PRECACHE_MODEL("models/v_xm1014.mdl"); PRECACHE_MODEL("models/w_xm1014.mdl"); @@ -50,13 +51,13 @@ int CXM1014::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p) } /* <2cac9f> ../cstrike/dlls/wpn_shared/wpn_xm1014.cpp:100 */ -BOOL CXM1014::__MAKE_VHOOK(Deploy)(void) +BOOL CXM1014::__MAKE_VHOOK(Deploy)() { return DefaultDeploy("models/v_xm1014.mdl", "models/p_xm1014.mdl", XM1014_DRAW, "m249", UseDecrement() != FALSE); } /* <2cab36> ../cstrike/dlls/wpn_shared/wpn_xm1014.cpp:106 */ -void CXM1014::__MAKE_VHOOK(PrimaryAttack)(void) +void CXM1014::__MAKE_VHOOK(PrimaryAttack)() { Vector vecAiming, vecSrc, vecDir; int flag; @@ -72,7 +73,7 @@ void CXM1014::__MAKE_VHOOK(PrimaryAttack)(void) if (m_iClip <= 0) { Reload(); - + if (!m_iClip) { PlayEmptySound(); @@ -118,15 +119,15 @@ void CXM1014::__MAKE_VHOOK(PrimaryAttack)(void) } if (m_iClip != 0) - m_flPumpTime = UTIL_WeaponTimeBase() + 0.125; + m_flPumpTime = UTIL_WeaponTimeBase() + 0.125f; m_flNextPrimaryAttack = GetNextAttackDelay(0.25); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.25; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.25f; if (m_iClip != 0) - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.25; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.25f; else - m_flTimeWeaponIdle = 0.75; + m_flTimeWeaponIdle = 0.75f; m_fInSpecialReload = 0; @@ -137,7 +138,7 @@ void CXM1014::__MAKE_VHOOK(PrimaryAttack)(void) } /* <2cad77> ../cstrike/dlls/wpn_shared/wpn_xm1014.cpp:182 */ -void CXM1014::__MAKE_VHOOK(Reload)(void) +void CXM1014::__MAKE_VHOOK(Reload)() { if (m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 || m_iClip == XM1014_MAX_CLIP) return; @@ -153,10 +154,10 @@ void CXM1014::__MAKE_VHOOK(Reload)(void) SendWeaponAnim(XM1014_START_RELOAD, UseDecrement() != FALSE); m_fInSpecialReload = 1; - m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.55; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.55; + m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.55f; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.55f; m_flNextPrimaryAttack = GetNextAttackDelay(0.55); - m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.55; + m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.55f; } else if (m_fInSpecialReload == 1) { @@ -173,20 +174,20 @@ void CXM1014::__MAKE_VHOOK(Reload)(void) SendWeaponAnim(XM1014_RELOAD, UseDecrement()); - m_flNextReload = UTIL_WeaponTimeBase() + 0.3; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.3; + m_flNextReload = UTIL_WeaponTimeBase() + 0.3f; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.3f; } else { - m_iClip++; - m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--; - m_pPlayer->ammo_buckshot--; + ++m_iClip; + --m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]; + --m_pPlayer->ammo_buckshot; m_fInSpecialReload = 1; } } /* <2cad3c> ../cstrike/dlls/wpn_shared/wpn_xm1014.cpp:231 */ -void CXM1014::__MAKE_VHOOK(WeaponIdle)(void) +void CXM1014::__MAKE_VHOOK(WeaponIdle)() { ResetEmptySound(); m_pPlayer->GetAutoaimVector(AUTOAIM_5DEGREES); @@ -214,7 +215,7 @@ void CXM1014::__MAKE_VHOOK(WeaponIdle)(void) SendWeaponAnim(XM1014_PUMP, UseDecrement() != FALSE); m_fInSpecialReload = 0; - m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.5; + m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.5f; } } else @@ -223,42 +224,3 @@ void CXM1014::__MAKE_VHOOK(WeaponIdle)(void) } } } - -#ifdef HOOK_GAMEDLL - -void CXM1014::Spawn(void) -{ - Spawn_(); -} - -void CXM1014::Precache(void) -{ - Precache_(); -} - -int CXM1014::GetItemInfo(ItemInfo *p) -{ - return GetItemInfo_(p); -} - -BOOL CXM1014::Deploy(void) -{ - return Deploy_(); -} - -void CXM1014::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CXM1014::Reload(void) -{ - Reload_(); -} - -void CXM1014::WeaponIdle(void) -{ - WeaponIdle_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/engine/common.h b/regamedll/engine/common.h index 0ce575f8..851fcaad 100644 --- a/regamedll/engine/common.h +++ b/regamedll/engine/common.h @@ -75,9 +75,6 @@ typedef struct incomingtransfer_s qboolean custom; } incomingtransfer_t; -//#define Q_functions -#ifndef Q_functions - #ifndef _WIN32 #define _strlwr(p) for (int i = 0; p[i] != 0; i++) p[i] = tolower(p[i]); #endif // _WIN32 @@ -116,28 +113,5 @@ typedef struct incomingtransfer_s //#define Q_FileNameCmp FileNameCmp #define Q_vsnprintf _vsnprintf #define Q_vsnwprintf _vsnwprintf -#else // Q_functions -void Q_strcpy(char *dest, const char *src); -int Q_strlen(const char *str); -NOBODY void Q_memset(void *dest, int fill, int count); -NOBODY void Q_memcpy(void *dest, const void *src, int count); -NOBODY int Q_memcmp(void *m1, void *m2, int count); -NOBODY void Q_strncpy(char *dest, const char *src, int count); -NOBODY char *Q_strrchr(char *s, char c); -NOBODY void Q_strcat(char *dest, char *src); -NOBODY int Q_strcmp(const char *s1, const char *s2); -NOBODY int Q_strncmp(const char *s1, const char *s2, int count); -NOBODY int Q_strncasecmp(const char *s1, const char *s2, int n); -NOBODY int Q_strcasecmp(const char *s1, const char *s2); -NOBODY int Q_stricmp(const char *s1, const char *s2); -NOBODY int Q_strnicmp(const char *s1, const char *s2, int n); -NOBODY int Q_atoi(const char *str); -NOBODY float Q_atof(const char *str); -NOBODY char *Q_strlwr(char *src); -NOBODY int Q_FileNameCmp(char *file1, char *file2); -NOBODY char *Q_strstr(const char *s1, const char *search); -NOBODY uint64 Q_strtoull(char *str); - -#endif // Q_functions #endif // COMMON_H diff --git a/regamedll/engine/studio.h b/regamedll/engine/studio.h index 51334f20..d67d92c4 100644 --- a/regamedll/engine/studio.h +++ b/regamedll/engine/studio.h @@ -123,8 +123,8 @@ typedef struct int soundgroupindex; int numtransitions; // animation node to animation node transition graph int transitionindex; + } studiohdr_t; -/* size: 244, cachelines: 4, members: 36 */ // bones typedef struct @@ -135,8 +135,8 @@ typedef struct int bonecontroller[6]; // bone controller index, -1 == none float value[6]; // default DoF values float scale[6]; // scale for delta DoF values + } mstudiobone_t; -/* size: 112, cachelines: 2, members: 6 */ // bone controllers typedef struct @@ -147,8 +147,8 @@ typedef struct float end; int rest; // byte index value at rest int index; // 0-3 user set controller, 4 mouth + } mstudiobonecontroller_t; -/* size: 24, cachelines: 1, members: 6 */ // demand loaded sequence groups typedef struct @@ -157,8 +157,8 @@ typedef struct char name[64]; // file name int32_t unused1; // cache index pointer int unused2; // hack for group 0 + } mstudioseqgroup_t; -/* size: 104, cachelines: 2, members: 4 */ // sequence descriptions typedef struct @@ -192,14 +192,14 @@ typedef struct int exitnode; // transition node at exit int nodeflags; // transition rules int nextseq; // auto advancing sequences + } mstudioseqdesc_t; -/* size: 176, cachelines: 3, members: 28 */ typedef struct { unsigned short offset[6]; + } mstudioanim_t; -/* size: 12, cachelines: 1, members: 1 */ // animation frames typedef union @@ -210,6 +210,7 @@ typedef union byte total; } num; short int value; + } mstudioanimvalue_t; // body part index @@ -219,7 +220,7 @@ typedef struct int nummodels; int base; int modelindex; // index into models array + } mstudiobodyparts_t; -/* size: 76, cachelines: 2, members: 4 */ #endif // STUDIO_H diff --git a/regamedll/game_shared/GameEvent.h b/regamedll/game_shared/GameEvent.h index a424a58b..719b882c 100644 --- a/regamedll/game_shared/GameEvent.h +++ b/regamedll/game_shared/GameEvent.h @@ -140,12 +140,6 @@ enum GameEventType NUM_GAME_EVENTS, }; -#ifdef HOOK_GAMEDLL - -#define GameEventName (*pGameEventName) - -#endif // HOOK_GAMEDLL - extern const char *GameEventName[ NUM_GAME_EVENTS + 1 ]; #endif // GAME_EVENT_H diff --git a/regamedll/game_shared/bitvec.h b/regamedll/game_shared/bitvec.h index 22f1531b..61390644 100644 --- a/regamedll/game_shared/bitvec.h +++ b/regamedll/game_shared/bitvec.h @@ -43,8 +43,7 @@ public: private: uint32 *m_pDWords; int m_iBit; - -};/* size: 8, cachelines: 1, members: 2 */ +}; // CBitVec allows you to store a list of bits and do operations on them like they were // an atomic type @@ -52,7 +51,7 @@ template class CBitVec { public: - CBitVec(void); + CBitVec(); // Set all values to the specified value (0 or 1..) void Init(int val = 0); @@ -66,10 +65,7 @@ public: bool operator!=(CBitVec const &other); // Get underlying dword representations of the bits. - int GetNumDWords() - { - return NUM_DWORDS; - } + int GetNumDWords() { return NUM_DWORDS; } uint32 GetDWord(int i); void SetDWord(int i, uint32 val); int GetNumBits(); @@ -82,8 +78,7 @@ private: }; unsigned int m_DWords[ NUM_DWORDS ]; - -};/* size: 4, cachelines: 1, members: 1 */ +}; /* <2d39f8> ../game_shared/bitvec.h:73 */ inline CBitVecAccessor::CBitVecAccessor(uint32 *pDWords, int iBit) @@ -118,7 +113,7 @@ inline int CBitVec::GetNumBits() template inline CBitVec::CBitVec() { - for (int i = 0; i < NUM_DWORDS; i++) + for (int i = 0; i < NUM_DWORDS; ++i) m_DWords[i] = 0; } @@ -126,7 +121,7 @@ inline CBitVec::CBitVec() template inline void CBitVec::Init(int val) { - for (int i = 0; i < GetNumBits(); i++) + for (int i = 0; i < GetNumBits(); ++i) { (*this)[i] = val; } @@ -152,7 +147,7 @@ inline CBitVecAccessor CBitVec::operator[](int i) template inline bool CBitVec::operator==(CBitVec const &other) { - for (int i = 0; i < NUM_DWORDS; i++) + for (int i = 0; i < NUM_DWORDS; ++i) { if (m_DWords[i] != other.m_DWords[i]) return false; diff --git a/regamedll/game_shared/bot/bot.cpp b/regamedll/game_shared/bot/bot.cpp index 07bd07e5..7cc3c686 100644 --- a/regamedll/game_shared/bot/bot.cpp +++ b/regamedll/game_shared/bot/bot.cpp @@ -15,18 +15,10 @@ float g_flBotFullThinkInterval = 1.0 / 10.0; const char *BotArgs[4] = { NULL }; bool UseBotArgs = false; -#else // HOOK_GAMEDLL - -float g_flBotCommandInterval; -float g_flBotFullThinkInterval; - -const char *BotArgs[4]; -bool UseBotArgs; - #endif // HOOK_GAMEDLL /* <48fed0> ../game_shared/bot/bot.cpp:28 */ -CBot::CBot(void) +CBot::CBot() { // the profile will be attached after this instance is constructed m_profile = NULL; @@ -52,7 +44,7 @@ bool CBot::__MAKE_VHOOK(Initialize)(const BotProfile *profile) } /* <48fbbd> ../game_shared/bot/bot.cpp:57 */ -void CBot::__MAKE_VHOOK(Spawn)(void) +void CBot::__MAKE_VHOOK(Spawn)() { // Let CBasePlayer set some things up CBasePlayer::Spawn(); @@ -89,7 +81,7 @@ Vector CBot::__MAKE_VHOOK(GetAutoaimVector)(float flDelta) } /* <48ffa8> ../game_shared/bot/bot.cpp:97 */ -void CBot::BotThink(void) +void CBot::BotThink() { if (gpGlobals->time >= m_flNextBotThink) { @@ -109,7 +101,7 @@ void CBot::BotThink(void) } /* <48f723> ../game_shared/bot/bot.cpp:119 */ -void CBot::__MAKE_VHOOK(MoveForward)(void) +void CBot::__MAKE_VHOOK(MoveForward)() { m_forwardSpeed = GetMoveSpeed(); m_buttonFlags |= IN_FORWARD; @@ -119,7 +111,7 @@ void CBot::__MAKE_VHOOK(MoveForward)(void) } /* <48f761> ../game_shared/bot/bot.cpp:130 */ -void CBot::__MAKE_VHOOK(MoveBackward)(void) +void CBot::__MAKE_VHOOK(MoveBackward)() { m_forwardSpeed = -GetMoveSpeed(); m_buttonFlags |= IN_BACK; @@ -129,7 +121,7 @@ void CBot::__MAKE_VHOOK(MoveBackward)(void) } /* <48f79f> ../game_shared/bot/bot.cpp:140 */ -void CBot::__MAKE_VHOOK(StrafeLeft)(void) +void CBot::__MAKE_VHOOK(StrafeLeft)() { m_strafeSpeed = -GetMoveSpeed(); m_buttonFlags |= IN_MOVELEFT; @@ -139,7 +131,7 @@ void CBot::__MAKE_VHOOK(StrafeLeft)(void) } /* <48f7dd> ../game_shared/bot/bot.cpp:150 */ -void CBot::__MAKE_VHOOK(StrafeRight)(void) +void CBot::__MAKE_VHOOK(StrafeRight)() { m_strafeSpeed = GetMoveSpeed(); m_buttonFlags |= IN_MOVERIGHT; @@ -175,7 +167,7 @@ bool CBot::__MAKE_VHOOK(Jump)(bool mustJump) // Zero any MoveForward(), Jump(), etc /* <48f81b> ../game_shared/bot/bot.cpp:187 */ -void CBot::__MAKE_VHOOK(ClearMovement)(void) +void CBot::__MAKE_VHOOK(ClearMovement)() { ResetCommand(); } @@ -183,7 +175,7 @@ void CBot::__MAKE_VHOOK(ClearMovement)(void) // Returns true if we are in the midst of a jump /* <48ffe7> ../game_shared/bot/bot.cpp:196 */ -bool CBot::IsJumping(void) +bool CBot::IsJumping() { // if long time after last jump, we can't be jumping if (gpGlobals->time - m_jumpTimestamp > 3.0f) @@ -201,37 +193,37 @@ bool CBot::IsJumping(void) } /* <48f859> ../game_shared/bot/bot.cpp:214 */ -void CBot::__MAKE_VHOOK(Crouch)(void) +void CBot::__MAKE_VHOOK(Crouch)() { m_isCrouching = true; } /* <48f87f> ../game_shared/bot/bot.cpp:220 */ -void CBot::__MAKE_VHOOK(StandUp)(void) +void CBot::__MAKE_VHOOK(StandUp)() { m_isCrouching = false; } /* <48f8a5> ../game_shared/bot/bot.cpp:227 */ -void CBot::__MAKE_VHOOK(UseEnvironment)(void) +void CBot::__MAKE_VHOOK(UseEnvironment)() { m_buttonFlags |= IN_USE; } /* <48f8cb> ../game_shared/bot/bot.cpp:234 */ -void CBot::__MAKE_VHOOK(PrimaryAttack)(void) +void CBot::__MAKE_VHOOK(PrimaryAttack)() { m_buttonFlags |= IN_ATTACK; } /* <48f8f1> ../game_shared/bot/bot.cpp:240 */ -void CBot::__MAKE_VHOOK(ClearPrimaryAttack)(void) +void CBot::__MAKE_VHOOK(ClearPrimaryAttack)() { m_buttonFlags &= ~IN_ATTACK; } /* <48f917> ../game_shared/bot/bot.cpp:246 */ -void CBot::__MAKE_VHOOK(TogglePrimaryAttack)(void) +void CBot::__MAKE_VHOOK(TogglePrimaryAttack)() { if (m_buttonFlags & IN_ATTACK) m_buttonFlags &= ~IN_ATTACK; @@ -240,13 +232,13 @@ void CBot::__MAKE_VHOOK(TogglePrimaryAttack)(void) } /* <48f93d> ../game_shared/bot/bot.cpp:260 */ -void CBot::__MAKE_VHOOK(SecondaryAttack)(void) +void CBot::__MAKE_VHOOK(SecondaryAttack)() { m_buttonFlags |= IN_ATTACK2; } /* <48f963> ../game_shared/bot/bot.cpp:266 */ -void CBot::__MAKE_VHOOK(Reload)(void) +void CBot::__MAKE_VHOOK(Reload)() { m_buttonFlags |= IN_RELOAD; } @@ -254,7 +246,7 @@ void CBot::__MAKE_VHOOK(Reload)(void) // Returns ratio of ammo left to max ammo (1 = full clip, 0 = empty) /* <490008> ../game_shared/bot/bot.cpp:275 */ -float CBot::GetActiveWeaponAmmoRatio(void) const +float CBot::GetActiveWeaponAmmoRatio() const { CBasePlayerWeapon *weapon = GetActiveWeapon(); @@ -271,7 +263,7 @@ float CBot::GetActiveWeaponAmmoRatio(void) const // Return true if active weapon has an empty clip /* <490058> ../game_shared/bot/bot.cpp:293 */ -bool CBot::IsActiveWeaponClipEmpty(void) const +bool CBot::IsActiveWeaponClipEmpty() const { CBasePlayerWeapon *weapon = GetActiveWeapon(); @@ -284,7 +276,7 @@ bool CBot::IsActiveWeaponClipEmpty(void) const // Return true if active weapon has no ammo at all /* <490096> ../game_shared/bot/bot.cpp:307 */ -bool CBot::IsActiveWeaponOutOfAmmo(void) const +bool CBot::IsActiveWeaponOutOfAmmo() const { CBasePlayerWeapon *gun = GetActiveWeapon(); @@ -303,7 +295,7 @@ bool CBot::IsActiveWeaponOutOfAmmo(void) const // Return true if looking thru weapon's scope /* <4900d4> ../game_shared/bot/bot.cpp:327 */ -bool CBot::IsUsingScope(void) const +bool CBot::IsUsingScope() const { // if our field of view is less than 90, we're looking thru a scope (maybe only true for CS...) if (m_iFOV < 90.0f) @@ -313,7 +305,7 @@ bool CBot::IsUsingScope(void) const } /* <48f989> ../game_shared/bot/bot.cpp:338 */ -void CBot::__MAKE_VHOOK(ExecuteCommand)(void) +void CBot::__MAKE_VHOOK(ExecuteCommand)() { byte adjustedMSec; @@ -337,7 +329,7 @@ void CBot::__MAKE_VHOOK(ExecuteCommand)(void) } /* <4900fa> ../game_shared/bot/bot.cpp:362 */ -void CBot::ResetCommand(void) +void CBot::ResetCommand() { m_forwardSpeed = 0.0f; m_strafeSpeed = 0.0f; @@ -346,7 +338,7 @@ void CBot::ResetCommand(void) } /* <49011b> ../game_shared/bot/bot.cpp:372 */ -byte CBot::ThrottledMsec(void) const +byte CBot::ThrottledMsec() const { int iNewMsec; @@ -402,7 +394,7 @@ bool CBot::IsEnemy(CBaseEntity *ent) const // Return number of enemies left alive /* <49021a> ../game_shared/bot/bot.cpp:434 */ -int CBot::GetEnemiesRemaining(void) const +int CBot::GetEnemiesRemaining() const { int count = 0; @@ -434,7 +426,7 @@ int CBot::GetEnemiesRemaining(void) const // Return number of friends left alive /* <490338> ../game_shared/bot/bot.cpp:467 */ -int CBot::GetFriendsRemaining(void) const +int CBot::GetFriendsRemaining() const { int count = 0; @@ -467,7 +459,7 @@ int CBot::GetFriendsRemaining(void) const } /* <490489> ../game_shared/bot/bot.cpp:503 */ -bool CBot::IsLocalPlayerWatchingMe(void) const +bool CBot::IsLocalPlayerWatchingMe() const { // avoid crash during spawn if (pev == NULL) @@ -551,7 +543,7 @@ ActiveGrenade::ActiveGrenade(int weaponID, CGrenade *grenadeEntity) } /* <49069d> ../game_shared/bot/bot.cpp:597 */ -void ActiveGrenade::OnEntityGone(void) +void ActiveGrenade::OnEntityGone() { if (m_id == WEAPON_SMOKEGRENADE) { @@ -564,7 +556,7 @@ void ActiveGrenade::OnEntityGone(void) } /* <4906e1> ../game_shared/bot/bot.cpp:610 */ -bool ActiveGrenade::IsValid(void) const +bool ActiveGrenade::IsValid() const { if (!m_entity) { @@ -575,101 +567,7 @@ bool ActiveGrenade::IsValid(void) const } /* <490710> ../game_shared/bot/bot.cpp:622 */ -const Vector *ActiveGrenade::GetPosition(void) const +const Vector *ActiveGrenade::GetPosition() const { return &m_entity->pev->origin; } - -#ifdef HOOK_GAMEDLL - -void CBot::Spawn(void) -{ - Spawn_(); -} - -Vector CBot::GetAutoaimVector(float flDelta) -{ - return GetAutoaimVector_(flDelta); -} - -bool CBot::Initialize(const BotProfile *profile) -{ - return Initialize_(profile); -} - -void CBot::Crouch(void) -{ - Crouch_(); -} - -void CBot::StandUp(void) -{ - StandUp_(); -} - -void CBot::MoveForward(void) -{ - MoveForward_(); -} - -void CBot::MoveBackward(void) -{ - MoveBackward_(); -} - -void CBot::StrafeLeft(void) -{ - StrafeLeft_(); -} - -void CBot::StrafeRight(void) -{ - StrafeRight_(); -} - -bool CBot::Jump(bool mustJump) -{ - return Jump_(mustJump); -} - -void CBot::ClearMovement(void) -{ - ClearMovement_(); -} - -void CBot::UseEnvironment(void) -{ - UseEnvironment_(); -} - -void CBot::PrimaryAttack(void) -{ - PrimaryAttack_(); -} - -void CBot::ClearPrimaryAttack(void) -{ - ClearPrimaryAttack_(); -} - -void CBot::TogglePrimaryAttack(void) -{ - TogglePrimaryAttack_(); -} - -void CBot::SecondaryAttack(void) -{ - SecondaryAttack_(); -} - -void CBot::Reload(void) -{ - Reload_(); -} - -void CBot::ExecuteCommand(void) -{ - ExecuteCommand_(); -} - -#endif // HOOK_GAMEDLL diff --git a/regamedll/game_shared/bot/bot.h b/regamedll/game_shared/bot/bot.h index 29c10a84..2ec1fb0b 100644 --- a/regamedll/game_shared/bot/bot.h +++ b/regamedll/game_shared/bot/bot.h @@ -32,26 +32,8 @@ #pragma once #endif -#ifdef HOOK_GAMEDLL - -#define g_flBotCommandInterval (*pg_flBotCommandInterval) -#define g_flBotFullThinkInterval (*pg_flBotFullThinkInterval) - -#define BotArgs (*pBotArgs) -#define UseBotArgs (*pUseBotArgs) - -#endif // HOOK_GAMEDLL - -extern float g_flBotCommandInterval; -extern float g_flBotFullThinkInterval; - -extern const char *BotArgs[4]; -extern bool UseBotArgs; - class BotProfile; -extern bool AreBotsAllowed(); - /* <36c175> ../game_shared/bot/bot.h:36 */ template T *CreateBot(const BotProfile *profile) @@ -88,9 +70,9 @@ class CBot: public CBasePlayer { public: // constructor initializes all values to zero - CBot(void); + CBot(); - virtual void Spawn(void); + virtual void Spawn(); // invoked when injured by something virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) @@ -102,44 +84,44 @@ public: { CBasePlayer::Killed(pevAttacker, iGib); } - virtual void Think(void) {}; - virtual BOOL IsBot(void) { return true; } + virtual void Think() {}; + virtual BOOL IsBot() { return true; } virtual Vector GetAutoaimVector(float flDelta); // invoked when in contact with a CWeaponBox virtual void OnTouchingWeapon(CWeaponBox *box) {} virtual bool Initialize(const BotProfile *profile); - virtual void SpawnBot(void) = 0; + virtual void SpawnBot() = 0; // lightweight maintenance, invoked frequently - virtual void Upkeep(void) = 0; + virtual void Upkeep() = 0; // heavyweight algorithms, invoked less often - virtual void Update(void) = 0; + virtual void Update() = 0; - virtual void Run(void); - virtual void Walk(void); - virtual void Crouch(void); - virtual void StandUp(void); - virtual void MoveForward(void); - virtual void MoveBackward(void); - virtual void StrafeLeft(void); - virtual void StrafeRight(void); + virtual void Run(); + virtual void Walk(); + virtual void Crouch(); + virtual void StandUp(); + virtual void MoveForward(); + virtual void MoveBackward(); + virtual void StrafeLeft(); + virtual void StrafeRight(); // returns true if jump was started #define MUST_JUMP true virtual bool Jump(bool mustJump = false); // zero any MoveForward(), Jump(), etc - virtual void ClearMovement(void); + virtual void ClearMovement(); // Weapon interface - virtual void UseEnvironment(void); - virtual void PrimaryAttack(void); - virtual void ClearPrimaryAttack(void); - virtual void TogglePrimaryAttack(void); - virtual void SecondaryAttack(void); - virtual void Reload(void); + virtual void UseEnvironment(); + virtual void PrimaryAttack(); + virtual void ClearPrimaryAttack(); + virtual void TogglePrimaryAttack(); + virtual void SecondaryAttack(); + virtual void Reload(); // invoked when event occurs in the game (some events have NULL entities) virtual void OnEvent(GameEventType event, CBaseEntity *entity = NULL, CBaseEntity *other = NULL) {}; @@ -168,81 +150,81 @@ public: // returns true if other player is pointing right at us virtual bool IsPlayerLookingAtMe(CBasePlayer *other) const; - virtual void ExecuteCommand(void); + virtual void ExecuteCommand(); virtual void SetModel(const char *modelName); #ifdef HOOK_GAMEDLL - void Spawn_(void); + void Spawn_(); Vector GetAutoaimVector_(float flDelta); bool Initialize_(const BotProfile *profile); - void Crouch_(void); - void StandUp_(void); - void MoveForward_(void); - void MoveBackward_(void); - void StrafeLeft_(void); - void StrafeRight_(void); + void Crouch_(); + void StandUp_(); + void MoveForward_(); + void MoveBackward_(); + void StrafeLeft_(); + void StrafeRight_(); bool Jump_(bool mustJump = false); - void ClearMovement_(void); - void UseEnvironment_(void); - void PrimaryAttack_(void); - void ClearPrimaryAttack_(void); - void TogglePrimaryAttack_(void); - void SecondaryAttack_(void); + void ClearMovement_(); + void UseEnvironment_(); + void PrimaryAttack_(); + void ClearPrimaryAttack_(); + void TogglePrimaryAttack_(); + void SecondaryAttack_(); bool IsPlayerFacingMe_(CBasePlayer *other) const; bool IsPlayerLookingAtMe_(CBasePlayer *other) const; - void Reload_(void); - void ExecuteCommand_(void); + void Reload_(); + void ExecuteCommand_(); void SetModel_(const char *modelName); #endif // HOOK_GAMEDLL public: - unsigned int GetID(void) const { return m_id; } - bool IsRunning(void) const { return m_isRunning; } - bool IsCrouching(void) const { return m_isCrouching; } + unsigned int GetID() const { return m_id; } + bool IsRunning() const { return m_isRunning; } + bool IsCrouching() const { return m_isCrouching; } // push the current posture context onto the top of the stack - void PushPostureContext(void); + void PushPostureContext(); // restore the posture context to the next context on the stack - void PopPostureContext(void); - bool IsJumping(void); + void PopPostureContext(); + bool IsJumping(); // return time last jump began - float GetJumpTimestamp(void) const { return m_jumpTimestamp; } + float GetJumpTimestamp() const { return m_jumpTimestamp; } // returns ratio of ammo left to max ammo (1 = full clip, 0 = empty) - float GetActiveWeaponAmmoRatio(void) const; + float GetActiveWeaponAmmoRatio() const; // return true if active weapon has any empty clip - bool IsActiveWeaponClipEmpty(void) const; + bool IsActiveWeaponClipEmpty() const; // return true if active weapon has no ammo at all - bool IsActiveWeaponOutOfAmmo(void) const; + bool IsActiveWeaponOutOfAmmo() const; // is the weapon in the middle of a reload - bool IsActiveWeaponReloading(void) const; + bool IsActiveWeaponReloading() const; // return true if active weapon's bullet spray has become large and inaccurate - bool IsActiveWeaponRecoilHigh(void) const; + bool IsActiveWeaponRecoilHigh() const; // return the weapon the bot is currently using - CBasePlayerWeapon *GetActiveWeapon(void) const; + CBasePlayerWeapon *GetActiveWeapon() const; // return true if looking thru weapon's scope - bool IsUsingScope(void) const; + bool IsUsingScope() const; // returns TRUE if given entity is our enemy bool IsEnemy(CBaseEntity *ent) const; // return number of enemies left alive - int GetEnemiesRemaining(void) const; + int GetEnemiesRemaining() const; // return number of friends left alive - int GetFriendsRemaining(void) const; + int GetFriendsRemaining() const; // return true if local player is observing this bot - bool IsLocalPlayerWatchingMe(void) const; + bool IsLocalPlayerWatchingMe() const; // output message to console NOXREF void Print(char *format,...) const; @@ -250,13 +232,13 @@ public: // output message to console if we are being watched by the local player void PrintIfWatched(char *format,...) const; - void BotThink(void); - bool IsNetClient(void) const { return false; } + void BotThink(); + bool IsNetClient() const { return false; } int Save(CSave &save) const; int Restore(CRestore &restor) const; // return our personality profile - const BotProfile *GetProfile(void) const { return m_profile; } + const BotProfile *GetProfile() const { return m_profile; } #ifndef HOOK_GAMEDLL protected: @@ -268,11 +250,11 @@ protected: const BotProfile *m_profile; private: - void ResetCommand(void); - byte ThrottledMsec(void) const; + void ResetCommand(); + byte ThrottledMsec() const; // returns current movement speed (for walk/run) - float GetMoveSpeed(void); + float GetMoveSpeed(); // unique bot ID unsigned int m_id; @@ -311,8 +293,7 @@ private: // index of top of stack int m_postureStackIndex; - -};/* size: 2564, cachelines: 41, members: 15 */ +}; /* <48f61d> ../game_shared/bot/bot.h:253 */ inline void CBot::__MAKE_VHOOK(SetModel)(const char *modelName) @@ -321,7 +302,7 @@ inline void CBot::__MAKE_VHOOK(SetModel)(const char *modelName) } /* <48e98a> ../game_shared/bot/bot.h:259 */ -inline float CBot::GetMoveSpeed(void) +inline float CBot::GetMoveSpeed() { if (m_isRunning || m_isCrouching) return pev->maxspeed; @@ -330,25 +311,25 @@ inline float CBot::GetMoveSpeed(void) } /* <48f6a3> ../game_shared/bot/bot.h:269 */ -inline void CBot::Run(void) +inline void CBot::Run() { m_isRunning = true; } /* <48f6c9> ../game_shared/bot/bot.h:275 */ -inline void CBot::Walk(void) +inline void CBot::Walk() { m_isRunning = false; } /* <5d3ed6> ../game_shared/bot/bot.h:281 */ -inline CBasePlayerWeapon *CBot::GetActiveWeapon(void) const +inline CBasePlayerWeapon *CBot::GetActiveWeapon() const { return static_cast(m_pActiveItem); } /* <5c4d70> ../game_shared/bot/bot.h:287 */ -inline bool CBot::IsActiveWeaponReloading(void) const +inline bool CBot::IsActiveWeaponReloading() const { CBasePlayerWeapon *weapon = GetActiveWeapon(); if (weapon == NULL) @@ -358,7 +339,7 @@ inline bool CBot::IsActiveWeaponReloading(void) const } /* <3c5c5c> ../game_shared/bot/bot.h:297 */ -inline bool CBot::IsActiveWeaponRecoilHigh(void) const +inline bool CBot::IsActiveWeaponRecoilHigh() const { CBasePlayerWeapon *gun = GetActiveWeapon(); if (gun != NULL) @@ -370,7 +351,7 @@ inline bool CBot::IsActiveWeaponRecoilHigh(void) const } /* <5194b2> ../game_shared/bot/bot.h:308 */ -inline void CBot::PushPostureContext(void) +inline void CBot::PushPostureContext() { if (m_postureStackIndex == MAX_POSTURE_STACK) { @@ -385,7 +366,7 @@ inline void CBot::PushPostureContext(void) } /* <519534> ../game_shared/bot/bot.h:323 */ -inline void CBot::PopPostureContext(void) +inline void CBot::PopPostureContext() { if (m_postureStackIndex == 0) { @@ -435,26 +416,14 @@ inline bool CBot::__MAKE_VHOOK(IsPlayerLookingAtMe)(CBasePlayer *other) const return false; } -#ifdef HOOK_GAMEDLL +extern float g_flBotCommandInterval; +extern float g_flBotFullThinkInterval; -typedef bool (CBot::*IS_VISIBLE_VECTOR)(const Vector *, bool) const; -typedef bool (CBot::*IS_VISIBLE_CBASE_PLAYER)(CBasePlayer *, bool, unsigned char *) const; +extern const char *BotArgs[4]; +extern bool UseBotArgs; -inline bool CBot::IsPlayerFacingMe(CBasePlayer *other) const -{ - return IsPlayerFacingMe_(other); -} +class BotProfile; -inline bool CBot::IsPlayerLookingAtMe(CBasePlayer *other) const -{ - return IsPlayerLookingAtMe_(other); -} - -inline void CBot::SetModel(const char *modelName) -{ - SetModel_(modelName); -} - -#endif // HOOK_GAMEDLL +extern bool AreBotsAllowed(); #endif // BOT_H diff --git a/regamedll/game_shared/bot/bot_constants.h b/regamedll/game_shared/bot/bot_constants.h index 66eb0a3d..44b1c74d 100644 --- a/regamedll/game_shared/bot/bot_constants.h +++ b/regamedll/game_shared/bot/bot_constants.h @@ -51,12 +51,4 @@ enum BotDifficultyType NUM_DIFFICULTY_LEVELS }; -#ifdef HOOK_GAMEDLL - -#define BotDifficultyName (*pBotDifficultyName) - -#endif // HOOK_GAMEDLL - -extern char *BotDifficultyName[5]; - #endif // BOT_CONSTANTS_H diff --git a/regamedll/game_shared/bot/bot_manager.cpp b/regamedll/game_shared/bot/bot_manager.cpp index 6f2e8ac5..8c0488fa 100644 --- a/regamedll/game_shared/bot/bot_manager.cpp +++ b/regamedll/game_shared/bot/bot_manager.cpp @@ -105,10 +105,6 @@ const char *GameEventName[NUM_GAME_EVENTS + 1] = NULL, }; -#else - -const char *GameEventName[ NUM_GAME_EVENTS + 1 ]; - #endif // HOOK_GAMEDLL // STL uses exceptions, but we are not compiling with them - ignore warning @@ -140,7 +136,7 @@ CBotManager::CBotManager() // Invoked when the round is restarting /* <49f586> ../game_shared/bot/bot_manager.cpp:78 */ -void CBotManager::__MAKE_VHOOK(RestartRound)(void) +void CBotManager::__MAKE_VHOOK(RestartRound)() { DestroyAllGrenades(); } @@ -148,7 +144,7 @@ void CBotManager::__MAKE_VHOOK(RestartRound)(void) // Invoked at the start of each frame /* <49a21c> ../game_shared/bot/bot_manager.cpp:85 */ -void CBotManager::__MAKE_VHOOK(StartFrame)(void) +void CBotManager::__MAKE_VHOOK(StartFrame)() { // debug smoke grenade visualization if (cv_bot_debug.value == 5) @@ -204,7 +200,7 @@ void CBotManager::__MAKE_VHOOK(StartFrame)(void) // Process each active bot for (int i = 1; i <= gpGlobals->maxClients; ++i) { - CBasePlayer *pPlayer = reinterpret_cast(UTIL_PlayerByIndex(i)); + CBasePlayer *pPlayer = static_cast(UTIL_PlayerByIndex(i)); if (!pPlayer) continue; @@ -220,7 +216,7 @@ void CBotManager::__MAKE_VHOOK(StartFrame)(void) // Return the filename for this map's "nav map" file /* <49f7a6> ../game_shared/bot/bot_manager.cpp:205 */ -const char *CBotManager::GetNavMapFilename(void) const +const char *CBotManager::GetNavMapFilename() const { static char filename[256]; Q_sprintf(filename, "maps\\%s.nav", STRING(gpGlobals->mapname)); @@ -300,7 +296,7 @@ void CBotManager::RemoveGrenade(CGrenade *grenade) // Destroy any invalid active grenades /* <49f9fc> ../game_shared/bot/bot_manager.cpp:285 */ -NOXREF void CBotManager::ValidateActiveGrenades(void) +NOXREF void CBotManager::ValidateActiveGrenades() { ActiveGrenadeList::iterator iter = m_activeGrenadeList.begin(); while (iter != m_activeGrenadeList.end()) @@ -318,7 +314,7 @@ NOXREF void CBotManager::ValidateActiveGrenades(void) } /* <49faf3> ../game_shared/bot/bot_manager.cpp:305 */ -void CBotManager::DestroyAllGrenades(void) +void CBotManager::DestroyAllGrenades() { for (ActiveGrenadeList::iterator iter = m_activeGrenadeList.begin(); iter != m_activeGrenadeList.end(); iter++) delete *iter; @@ -482,23 +478,3 @@ bool CBotManager::IsLineBlockedBySmoke(const Vector *from, const Vector *to) // return true if the total length of smoke-covered line-of-sight is too much return (totalSmokedLength > maxSmokedLength); } - - -#ifdef HOOK_GAMEDLL - -void CBotManager::RestartRound(void) -{ - RestartRound_(); -} - -void CBotManager::StartFrame(void) -{ - StartFrame_(); -} - -void CBotManager::OnEvent(GameEventType event, CBaseEntity *entity, CBaseEntity *other) -{ - return OnEvent_(event, entity, other); -} - -#endif // HOOK_GAMEDLL \ No newline at end of file diff --git a/regamedll/game_shared/bot/bot_manager.h b/regamedll/game_shared/bot/bot_manager.h index 576c17af..9f59828c 100644 --- a/regamedll/game_shared/bot/bot_manager.h +++ b/regamedll/game_shared/bot/bot_manager.h @@ -45,90 +45,69 @@ class ActiveGrenade public: ActiveGrenade(int weaponID, CGrenade *grenadeEntity); - void OnEntityGone(void); - bool IsValid(void) const; - NOXREF bool IsEntity(CGrenade *grenade) const - { - return (grenade == m_entity) ? true : false; - } - int GetID(void) const - { - return m_id; - } - const Vector *GetDetonationPosition(void) const - { - return &m_detonationPosition; - } - NOXREF const Vector *GetPosition(void) const; + void OnEntityGone(); + bool IsValid() const; + + bool IsEntity(CGrenade *grenade) const { return (grenade == m_entity) ? true : false; } + int GetID() const { return m_id; } + const Vector *GetDetonationPosition() const { return &m_detonationPosition; } + + const Vector *GetPosition() const; private: int m_id; CGrenade *m_entity; Vector m_detonationPosition; float m_dieTimestamp; - -};/* size: 24, cachelines: 1, members: 4 */ +}; typedef std::STD_LIST ActiveGrenadeList; class CBotManager { public: - CBotManager(void); + CBotManager(); virtual void ClientDisconnect(CBasePlayer *pPlayer) = 0; virtual BOOL ClientCommand(CBasePlayer *pPlayer, const char *pcmd) = 0; - virtual void ServerActivate(void) = 0; - virtual void ServerDeactivate(void) = 0; + virtual void ServerActivate() = 0; + virtual void ServerDeactivate() = 0; virtual void ServerCommand(const char *pcmd) = 0; virtual void AddServerCommand(const char *cmd) = 0; - virtual void AddServerCommands(void) = 0; + virtual void AddServerCommands() = 0; - virtual void RestartRound(void); - virtual void StartFrame(void); + virtual void RestartRound(); + virtual void StartFrame(); - // Invoked when event occurs in the game (some events have NULL entity). // Events are propogated to all bots. - virtual void OnEvent(GameEventType event, CBaseEntity *entity = NULL, CBaseEntity *other = NULL); + virtual void OnEvent(GameEventType event, CBaseEntity *entity = NULL, CBaseEntity *other = NULL); // Invoked when event occurs in the game (some events have NULL entity). + virtual unsigned int GetPlayerPriority(CBasePlayer *player) const = 0; // return priority of player (0 = max pri) - // return priority of player (0 = max pri) - virtual unsigned int GetPlayerPriority(CBasePlayer *player) const = 0; +public: + const char *GetNavMapFilename() const; // return the filename for this map's "nav" file - // return the filename for this map's "nav" file - const char *GetNavMapFilename(void) const; + void AddGrenade(int type, CGrenade *grenade); // add an active grenade to the bot's awareness + void RemoveGrenade(CGrenade *grenade); // the grenade entity in the world is going away + NOXREF void ValidateActiveGrenades(); // destroy any invalid active grenades + void DestroyAllGrenades(); - // add an active grenade to the bot's awareness - void AddGrenade(int type, CGrenade *grenade); - - // the grenade entity in the world is going away - void RemoveGrenade(CGrenade *grenade); - - // destroy any invalid active grenades - NOXREF void ValidateActiveGrenades(void); - void DestroyAllGrenades(void); - - // return true if line intersects smoke volume - bool IsLineBlockedBySmoke(const Vector *from, const Vector *to); - - // return true if position is inside a smoke cloud - bool IsInsideSmokeCloud(const Vector *pos); + bool IsLineBlockedBySmoke(const Vector *from, const Vector *to); // return true if line intersects smoke volume + bool IsInsideSmokeCloud(const Vector *pos); // return true if position is inside a smoke cloud #ifdef HOOK_GAMEDLL - void RestartRound_(void); - void StartFrame_(void); + void RestartRound_(); + void StartFrame_(); void OnEvent_(GameEventType event, CBaseEntity *entity = NULL, CBaseEntity *other = NULL); #endif // HOOK_GAMEDLL private: - // the list of active grenades the bots are aware of ActiveGrenadeList m_activeGrenadeList; -// -};/* size: 12, cachelines: 1, members: 2 */ +}; GameEventType NameToGameEvent(const char *name); diff --git a/regamedll/game_shared/bot/bot_profile.cpp b/regamedll/game_shared/bot/bot_profile.cpp index 7b19cac4..fd773b9a 100644 --- a/regamedll/game_shared/bot/bot_profile.cpp +++ b/regamedll/game_shared/bot/bot_profile.cpp @@ -7,16 +7,7 @@ #ifndef HOOK_GAMEDLL BotProfileManager *TheBotProfiles = NULL; - -char *BotDifficultyName[] = -{ - "EASY", "NORMAL", "HARD", "EXPERT", NULL -}; - -#else // HOOK_GAMEDLL - -BotProfileManager *TheBotProfiles; -char *BotDifficultyName[5]; +char *BotDifficultyName[] = { "EASY", "NORMAL", "HARD", "EXPERT", NULL }; #endif // HOOK_GAMEDLL @@ -43,7 +34,7 @@ const char *BotProfile::GetWeaponPreferenceAsString(int i) const // Return true if this profile has a primary weapon preference /* <4a7acd> ../game_shared/bot/bot_profile.cpp:78 */ -bool BotProfile::HasPrimaryPreference(void) const +bool BotProfile::HasPrimaryPreference() const { for (int i = 0; i < m_weaponPreferenceCount; ++i) { @@ -63,7 +54,7 @@ bool BotProfile::HasPrimaryPreference(void) const // Return true if this profile has a pistol weapon preference /* <4a7b22> ../game_shared/bot/bot_profile.cpp:99 */ -bool BotProfile::HasPistolPreference(void) const +bool BotProfile::HasPistolPreference() const { for (int i = 0; i < m_weaponPreferenceCount; ++i) { @@ -83,7 +74,7 @@ bool BotProfile::IsValidForTeam(BotProfileTeamType team) const } /* <4a7bb2> ../game_shared/bot/bot_profile.cpp:122 */ -BotProfileManager::BotProfileManager(void) +BotProfileManager::BotProfileManager() { m_nextSkin = 0; for (int i = 0; i < NumCustomSkins; ++i) @@ -105,7 +96,7 @@ void BotProfileManager::Init(const char *filename, unsigned int *checksum) if (dataFile == NULL) { - if (UTIL_IsGame("czero")) + if (g_bIsCzeroGame) { CONSOLE_ECHO("WARNING: Cannot access bot profile database '%s'\n", filename); } @@ -256,7 +247,7 @@ void BotProfileManager::Init(const char *filename, unsigned int *checksum) { char *c = Q_strchr(token, '+'); if (c) - *c = '\000'; + *c = '\0'; // find the given template name for (BotProfileList::iterator iter = templateList.begin(); iter != templateList.end(); ++iter) @@ -439,7 +430,7 @@ void BotProfileManager::Init(const char *filename, unsigned int *checksum) { char *c = Q_strchr(token, '+'); if (c) - *c = '\000'; + *c = '\0'; for (int i = 0; i < NUM_DIFFICULTY_LEVELS; ++i) { @@ -497,7 +488,7 @@ void BotProfileManager::Init(const char *filename, unsigned int *checksum) } /* <4a7dfd> ../game_shared/bot/bot_profile.cpp:532 */ -BotProfileManager::~BotProfileManager(void) +BotProfileManager::~BotProfileManager() { Reset(); @@ -510,7 +501,7 @@ BotProfileManager::~BotProfileManager(void) // Free all bot profiles /* <4a7c76> ../game_shared/bot/bot_profile.cpp:548 */ -void BotProfileManager::Reset(void) +void BotProfileManager::Reset() { for (BotProfileList::iterator iter = m_profileList.begin(); iter != m_profileList.end(); ++iter) delete *iter; diff --git a/regamedll/game_shared/bot/bot_profile.h b/regamedll/game_shared/bot/bot_profile.h index 05135d04..899e0feb 100644 --- a/regamedll/game_shared/bot/bot_profile.h +++ b/regamedll/game_shared/bot/bot_profile.h @@ -66,7 +66,7 @@ enum BotProfileTeamType class BotProfile { public: - BotProfile(void) + BotProfile() { m_name = NULL; m_aggression = 0.0f; @@ -83,24 +83,24 @@ public: m_voiceBank = 0; m_prefersSilencer = false; } - const char *GetName(void) const { return m_name; } - float GetAggression(void) const { return m_aggression; } - float GetSkill(void) const { return m_skill; } - float GetTeamwork(void) const { return m_teamwork; } + const char *GetName() const { return m_name; } + float GetAggression() const { return m_aggression; } + float GetSkill() const { return m_skill; } + float GetTeamwork() const { return m_teamwork; } int GetWeaponPreference(int i) const { return m_weaponPreference[i]; } const char *GetWeaponPreferenceAsString(int i) const; - int GetWeaponPreferenceCount(void) const { return m_weaponPreferenceCount; } - bool HasPrimaryPreference(void) const; - bool HasPistolPreference(void) const; - int GetCost(void) const { return m_cost; } - int GetSkin(void) const { return m_skin; } + int GetWeaponPreferenceCount() const { return m_weaponPreferenceCount; } + bool HasPrimaryPreference() const; + bool HasPistolPreference() const; + int GetCost() const { return m_cost; } + int GetSkin() const { return m_skin; } bool IsDifficulty(BotDifficultyType diff) const; - int GetVoicePitch(void) const { return m_voicePitch; } - float GetReactionTime(void) const { return m_reactionTime; } - float GetAttackDelay(void) const { return m_attackDelay; } - int GetVoiceBank(void) const { return m_voiceBank; } + int GetVoicePitch() const { return m_voicePitch; } + float GetReactionTime() const { return m_reactionTime; } + float GetAttackDelay() const { return m_attackDelay; } + int GetVoiceBank() const { return m_voiceBank; } bool IsValidForTeam(BotProfileTeamType team) const; - bool PrefersSilencer(void) const { return m_prefersSilencer; } + bool PrefersSilencer() const { return m_prefersSilencer; } private: void Inherit(const BotProfile *parent, const BotProfile *baseline); @@ -126,8 +126,7 @@ private: enum BotProfileTeamType m_teams; bool m_prefersSilencer; int m_voiceBank; - -}; /* size: 120, cachelines: 2, members: 15 */ +}; /* <4a666f> ../game_shared/bot/bot_profile.h:115 */ inline bool BotProfile::IsDifficulty(BotDifficultyType diff) const @@ -185,11 +184,11 @@ typedef std::STD_LIST BotProfileList; class BotProfileManager { public: - BotProfileManager(void); - ~BotProfileManager(void); + BotProfileManager(); + ~BotProfileManager(); void Init(const char *filename, unsigned int *checksum = NULL); - void Reset(void); + void Reset(); const BotProfile *GetProfile(const char *name, BotProfileTeamType team) const { @@ -201,10 +200,7 @@ public: return NULL; } - const BotProfileList *GetProfileList(void) const - { - return &m_profileList; - } + const BotProfileList *GetProfileList() const { return &m_profileList; } const BotProfile *GetRandomProfile(BotDifficultyType difficulty, BotProfileTeamType team) const; const char *GetCustomSkin(int index); @@ -214,10 +210,7 @@ public: typedef std::STD_VECTOR VoiceBankList; - const VoiceBankList *GetVoiceBanks() const - { - return &m_voiceBanks; - } + const VoiceBankList *GetVoiceBanks() const { return &m_voiceBanks; } int FindVoiceBankIndex(const char *filename); protected: @@ -228,14 +221,7 @@ protected: char *m_skinModelnames[NumCustomSkins]; char *m_skinFilenames[NumCustomSkins]; int m_nextSkin; - -};/* size: 1224, cachelines: 20, members: 6 */ - -#ifdef HOOK_GAMEDLL - -#define TheBotProfiles (*pTheBotProfiles) - -#endif // HOOK_GAMEDLL +}; extern BotProfileManager *TheBotProfiles; diff --git a/regamedll/game_shared/bot/bot_util.cpp b/regamedll/game_shared/bot/bot_util.cpp index 0f1968a1..23d7d2d0 100644 --- a/regamedll/game_shared/bot/bot_util.cpp +++ b/regamedll/game_shared/bot/bot_util.cpp @@ -5,12 +5,7 @@ */ #ifndef HOOK_GAMEDLL -static short s_iBeamSprite = 0; -static float cosTable[ COS_TABLE_SIZE ]; - -#else - -short s_iBeamSprite; +short s_iBeamSprite = 0; float cosTable[ COS_TABLE_SIZE ]; #endif // HOOK_GAMEDLL @@ -35,7 +30,7 @@ bool UTIL_IsNameTaken(const char *name, bool ignoreHumans) { // bots can have prefixes so we need to check the name // against the profile name instead. - CBot *bot = reinterpret_cast(player); + CBot *bot = static_cast(player); if (FStrEq(name, bot->GetProfile()->GetName())) { return true; @@ -50,11 +45,12 @@ bool UTIL_IsNameTaken(const char *name, bool ignoreHumans) } } } + return false; } /* <4ad2da> ../game_shared/bot/bot_util.cpp:66 */ -int UTIL_ClientsInGame(void) +int UTIL_ClientsInGame() { int iCount = 0; for (int iIndex = 1; iIndex <= gpGlobals->maxClients; ++iIndex) @@ -77,7 +73,7 @@ int UTIL_ClientsInGame(void) } /* <4ad385> ../game_shared/bot/bot_util.cpp:93 */ -int UTIL_ActivePlayersInGame(void) +int UTIL_ActivePlayersInGame() { int iCount = 0; for (int iIndex = 1; iIndex <= gpGlobals->maxClients; ++iIndex) @@ -178,7 +174,7 @@ int UTIL_HumansOnTeam(int teamID, bool isAlive) } /* <4ad5db> ../game_shared/bot/bot_util.cpp:210 */ -int UTIL_BotsInGame(void) +int UTIL_BotsInGame() { int iCount = 0; @@ -423,7 +419,7 @@ bool UTIL_IsVisibleToTeam(const Vector &spot, int team, float maxRange) } /* <4adc8e> ../game_shared/bot/bot_util.cpp:479 */ -CBasePlayer *UTIL_GetLocalPlayer(void) +CBasePlayer *UTIL_GetLocalPlayer() { if (!IS_DEDICATED_SERVER()) return static_cast(UTIL_PlayerByIndex(1)); @@ -526,7 +522,7 @@ void CONSOLE_ECHO_LOGGED(char *pszMsg, ...) } /* <4ae198> ../game_shared/bot/bot_util.cpp:592 */ -void BotPrecache(void) +void BotPrecache() { s_iBeamSprite = PRECACHE_MODEL("sprites/smoke.spr"); @@ -545,7 +541,7 @@ void BotPrecache(void) } /* <4ae1b1> ../game_shared/bot/bot_util.cpp:666 */ -void InitBotTrig(void) +void InitBotTrig() { for (int i = 0; i < COS_TABLE_SIZE; ++i) { diff --git a/regamedll/game_shared/bot/bot_util.h b/regamedll/game_shared/bot/bot_util.h index 0be21454..d529f9a8 100644 --- a/regamedll/game_shared/bot/bot_util.h +++ b/regamedll/game_shared/bot/bot_util.h @@ -54,51 +54,21 @@ enum PriorityType class IntervalTimer { public: - IntervalTimer(void) - { - m_timestamp = -1.0f; - } - /* <4c1587> ../game_shared/bot/bot_util.h:136 */ - void Reset(void) - { - m_timestamp = gpGlobals->time; - } - /* <5c4948> ../game_shared/bot/bot_util.h:141 */ - void Start(void) - { - m_timestamp = gpGlobals->time; - } - /* <568aac> ../game_shared/bot/bot_util.h:146 */ - void Invalidate(void) - { - m_timestamp = -1.0f; - } - /* <5687b3> ../game_shared/bot/bot_util.h:151 */ - bool HasStarted(void) const - { - return (m_timestamp > 0.0f); - } + IntervalTimer() { m_timestamp = -1.0f; } + void Reset() { m_timestamp = gpGlobals->time; } + void Start() { m_timestamp = gpGlobals->time; } + void Invalidate() { m_timestamp = -1.0f; } + + bool HasStarted() const { return (m_timestamp > 0.0f); } + // if not started, elapsed time is very large - /* <5687d1> ../game_shared/bot/bot_util.h:157 */ - float GetElapsedTime(void) const - { - return (HasStarted()) ? (gpGlobals->time - m_timestamp) : 99999.9f; - } - /* <2ff607> ../game_shared/bot/bot_util.h:162 */ - bool IsLessThen(float duration) const - { - return (gpGlobals->time - m_timestamp < duration) ? true : false; - } - /* <0> (null):0 */ - bool IsGreaterThen(float duration) const - { - return (gpGlobals->time - m_timestamp > duration) ? true : false; - } + float GetElapsedTime() const { return (HasStarted()) ? (gpGlobals->time - m_timestamp) : 99999.9f; } + bool IsLessThen(float duration) const { return (gpGlobals->time - m_timestamp < duration) ? true : false; } + bool IsGreaterThen(float duration) const { return (gpGlobals->time - m_timestamp > duration) ? true : false; } private: float m_timestamp; - -};/* size: 4, cachelines: 1, members: 1 */ +}; // Simple class for counting down a short interval of time @@ -106,43 +76,19 @@ private: class CountdownTimer { public: - CountdownTimer(void) - { - m_timestamp = -1.0f; - m_duration = 0.0f; - } - /* <569025> ../game_shared/bot/bot_util.h:189 */ - void Reset(void) - { - m_timestamp = gpGlobals->time + m_duration; - } - /* <568aca> ../game_shared/bot/bot_util.h:194 */ - void Start(float duration) - { - m_timestamp = gpGlobals->time + duration; - m_duration = duration; - } - /* <5687b3> ../game_shared/bot/bot_util.h:151 */ - bool HasStarted(void) const - { - return (m_timestamp > 0.0f); - } - /* <5c4621> ../game_shared/bot/bot_util.h:200 */ - void Invalidate(void) - { - m_timestamp = -1.0f; - } - /* <5c463f> ../game_shared/bot/bot_util.h:210 */ - bool IsElapsed(void) const - { - return (gpGlobals->time > m_timestamp); - } + CountdownTimer() { m_timestamp = -1.0f; m_duration = 0.0f; } + void Reset() { m_timestamp = gpGlobals->time + m_duration; } + + void Start(float duration) { m_timestamp = gpGlobals->time + duration; m_duration = duration; } + bool HasStarted() const { return (m_timestamp > 0.0f); } + + void Invalidate() { m_timestamp = -1.0f; } + bool IsElapsed() const { return (gpGlobals->time > m_timestamp); } private: float m_duration; float m_timestamp; - -};/* size: 8, cachelines: 1, members: 2 */ +}; // Return true if the given entity is valid @@ -205,6 +151,7 @@ inline bool IsIntersecting2D(const Vector &startA, const Vector &endA, const Vec { *result = startA + s * (endA - startA); } + return true; } @@ -234,7 +181,7 @@ bool ForEachPlayer(Functor &func) // For zombie game /* ../game_shared/bot/bot_util.h:317 */ -inline bool IsZombieGame(void) +inline bool IsZombieGame() { #ifdef TERRORSTRIKE return true; @@ -243,46 +190,6 @@ inline bool IsZombieGame(void) #endif // TERRORSTRIKE } -#ifdef HOOK_GAMEDLL - -#define s_iBeamSprite (*ps_iBeamSprite) -#define cosTable (*pcosTable) - -#define cv_bot_traceview (*pcv_bot_traceview) -#define cv_bot_stop (*pcv_bot_stop) -#define cv_bot_show_nav (*pcv_bot_show_nav) -#define cv_bot_show_danger (*pcv_bot_show_danger) -#define cv_bot_nav_edit (*pcv_bot_nav_edit) -#define cv_bot_nav_zdraw (*pcv_bot_nav_zdraw) -#define cv_bot_walk (*pcv_bot_walk) -#define cv_bot_difficulty (*pcv_bot_difficulty) -#define cv_bot_debug (*pcv_bot_debug) -#define cv_bot_quicksave (*pcv_bot_quicksave) -#define cv_bot_quota (*pcv_bot_quota) -#define cv_bot_quota_match (*pcv_bot_quota_match) -#define cv_bot_prefix (*pcv_bot_prefix) -#define cv_bot_allow_rogues (*pcv_bot_allow_rogues) -#define cv_bot_allow_pistols (*pcv_bot_allow_pistols) -#define cv_bot_allow_shotguns (*pcv_bot_allow_shotguns) -#define cv_bot_allow_sub_machine_guns (*pcv_bot_allow_sub_machine_guns) -#define cv_bot_allow_rifles (*pcv_bot_allow_rifles) -#define cv_bot_allow_machine_guns (*pcv_bot_allow_machine_guns) -#define cv_bot_allow_grenades (*pcv_bot_allow_grenades) -#define cv_bot_allow_snipers (*pcv_bot_allow_snipers) -#define cv_bot_allow_shield (*pcv_bot_allow_shield) -#define cv_bot_join_team (*pcv_bot_join_team) -#define cv_bot_join_after_player (*pcv_bot_join_after_player) -#define cv_bot_auto_vacate (*pcv_bot_auto_vacate) -#define cv_bot_zombie (*pcv_bot_zombie) -#define cv_bot_defer_to_human (*pcv_bot_defer_to_human) -#define cv_bot_chatter (*pcv_bot_chatter) -#define cv_bot_profile_db (*pcv_bot_profile_db) - -#endif // HOOK_GAMEDLL - -extern short s_iBeamSprite; -extern float cosTable[COS_TABLE_SIZE]; - extern cvar_t cv_bot_traceview; extern cvar_t cv_bot_stop; extern cvar_t cv_bot_show_nav; @@ -320,9 +227,9 @@ int UTIL_HumansOnTeam(int teamID, bool isAlive = false); int UTIL_HumansInGame(bool ignoreSpectators = false); bool UTIL_IsNameTaken(const char *name, bool ignoreHumans = false); -int UTIL_ClientsInGame(void); -int UTIL_ActivePlayersInGame(void); -int UTIL_BotsInGame(void); +int UTIL_ClientsInGame(); +int UTIL_ActivePlayersInGame(); +int UTIL_BotsInGame(); bool UTIL_KickBotFromTeam(TeamName kickTeam); bool UTIL_IsTeamAllBots(int team); CBasePlayer *UTIL_GetClosestPlayer(const Vector *pos, float *distance = NULL); @@ -330,7 +237,7 @@ CBasePlayer *UTIL_GetClosestPlayer(const Vector *pos, int team, float *distance const char *UTIL_GetBotPrefix(); void UTIL_ConstructBotNetName(char *name, int nameLength, const BotProfile *profile); bool UTIL_IsVisibleToTeam(const Vector &spot, int team, float maxRange = -1.0f); -CBasePlayer *UTIL_GetLocalPlayer(void); +CBasePlayer *UTIL_GetLocalPlayer(); NOXREF Vector UTIL_ComputeOrigin(entvars_t *pevVars); NOXREF Vector UTIL_ComputeOrigin(CBaseEntity *pEntity); NOXREF Vector UTIL_ComputeOrigin(edict_t *pentEdict); @@ -342,22 +249,11 @@ void UTIL_DrawBeamPoints(Vector vecStart, Vector vecEnd, int iLifetime, byte bRe void CONSOLE_ECHO(char *pszMsg, ...); void CONSOLE_ECHO_LOGGED(char *pszMsg, ...); -void BotPrecache(void); -void InitBotTrig(void); +void BotPrecache(); +void InitBotTrig(); float BotCOS(float angle); float BotSIN(float angle); bool IsGameEventAudible(enum GameEventType event, CBaseEntity *entity, CBaseEntity *other, float *range, PriorityType *priority, bool *isHostile); void HintMessageToAllPlayers(const char *message); -#ifdef HOOK_GAMEDLL - -typedef CBasePlayer *(*UTIL_GETCLOSE_PLAYER)(const Vector *pos, float *distance); -typedef CBasePlayer *(*UTIL_GETCLOSE_TEAM)(const Vector *pos, int team, float *distance); - -typedef Vector (*UTIL_CUMPUTE_ENTVARS)(entvars_t *pevVars); -typedef Vector (*UTIL_CUMPUTE_CBASE)(CBaseEntity *pEntity); -typedef Vector (*UTIL_CUMPUTE_EDICT)(edict_t *pentEdict); - -#endif // HOOK_GAMEDLL - #endif // BOT_UTIL_H diff --git a/regamedll/game_shared/bot/improv.h b/regamedll/game_shared/bot/improv.h index de9cb3c8..b36ec028 100644 --- a/regamedll/game_shared/bot/improv.h +++ b/regamedll/game_shared/bot/improv.h @@ -52,40 +52,38 @@ public: virtual void OnMoveToFailure(const Vector &goal, MoveToFailureType reason) {}; // invoked when an improv fails to reach a MoveTo goal virtual void OnInjury(float amount) {}; // invoked when the improv is injured - -};/* size: 4, cachelines: 1, members: 1 */ +}; // The Improv interface definition // An "Improv" is an improvisational actor that simulates the // behavor of a human in an unscripted, "make it up as you go" manner. - class CImprov: public IImprovEvent { public: - virtual ~CImprov(void) {}; + virtual ~CImprov() {}; - virtual bool IsAlive(void) const = 0; // return true if this improv is alive + virtual bool IsAlive() const = 0; // return true if this improv is alive virtual void MoveTo(const Vector &goal) = 0; // move improv towards far-away goal (pathfind) virtual void LookAt(const Vector &target) = 0; // define desired view target - virtual void ClearLookAt(void) = 0; // remove view goal + virtual void ClearLookAt() = 0; // remove view goal virtual void FaceTo(const Vector &goal) = 0; // orient body towards goal - virtual void ClearFaceTo(void) = 0; // remove body orientation goal + virtual void ClearFaceTo() = 0; // remove body orientation goal virtual bool IsAtMoveGoal(float error = 20.0f) const = 0; // return true if improv is standing on its movement goal - virtual bool HasLookAt(void) const = 0; // return true if improv has a look at goal - virtual bool HasFaceTo(void) const = 0; // return true if improv has a face to goal - virtual bool IsAtFaceGoal(void) const = 0; // return true if improv is facing towards its face goal + virtual bool HasLookAt() const = 0; // return true if improv has a look at goal + virtual bool HasFaceTo() const = 0; // return true if improv has a face to goal + virtual bool IsAtFaceGoal() const = 0; // return true if improv is facing towards its face goal virtual bool IsFriendInTheWay(const Vector &goalPos) const = 0; // return true if a friend is blocking our line to the given goal position virtual bool IsFriendInTheWay(CBaseEntity *myFriend, const Vector &goalPos) const = 0; // return true if the given friend is blocking our line to the given goal position - virtual void MoveForward(void) = 0; - virtual void MoveBackward(void) = 0; - virtual void StrafeLeft(void) = 0; - virtual void StrafeRight(void) = 0; - virtual bool Jump(void) = 0; - virtual void Crouch(void) = 0; - virtual void StandUp(void) = 0; // "un-crouch" + virtual void MoveForward() = 0; + virtual void MoveBackward() = 0; + virtual void StrafeLeft() = 0; + virtual void StrafeRight() = 0; + virtual bool Jump() = 0; + virtual void Crouch() = 0; + virtual void StandUp() = 0; // "un-crouch" virtual void TrackPath(const Vector &pathGoal, float deltaT) = 0; // move along path by following "pathGoal" virtual void StartLadder(const CNavLadder *ladder, enum NavTraverseType how, const Vector *approachPos, const Vector *departPos) = 0; // invoked when a ladder is encountered while following a path @@ -93,50 +91,42 @@ public: virtual bool TraverseLadder(const CNavLadder *ladder, enum NavTraverseType how, const Vector *approachPos, const Vector *departPos, float deltaT) = 0; // traverse given ladder virtual bool GetSimpleGroundHeightWithFloor(const Vector *pos, float *height, Vector *normal = NULL) = 0; // find "simple" ground height, treating current nav area as part of the floor - virtual void Run(void) = 0; - virtual void Walk(void) = 0; - virtual void Stop(void) = 0; + virtual void Run() = 0; + virtual void Walk() = 0; + virtual void Stop() = 0; - virtual float GetMoveAngle(void) const = 0; // return direction of movement - virtual float GetFaceAngle(void) const = 0; // return direction of view + virtual float GetMoveAngle() const = 0; // return direction of movement + virtual float GetFaceAngle() const = 0; // return direction of view - virtual const Vector &GetFeet(void) const = 0; // return position of "feet" - point below centroid of improv at feet level - virtual const Vector &GetCentroid(void) const = 0; - virtual const Vector &GetEyes(void) const = 0; + virtual const Vector &GetFeet() const = 0; // return position of "feet" - point below centroid of improv at feet level + virtual const Vector &GetCentroid() const = 0; + virtual const Vector &GetEyes() const = 0; - virtual bool IsRunning(void) const = 0; - virtual bool IsWalking(void) const = 0; - virtual bool IsStopped(void) const = 0; + virtual bool IsRunning() const = 0; + virtual bool IsWalking() const = 0; + virtual bool IsStopped() const = 0; - virtual bool IsCrouching(void) const = 0; - virtual bool IsJumping(void) const = 0; - virtual bool IsUsingLadder(void) const = 0; - virtual bool IsOnGround(void) const = 0; - virtual bool IsMoving(void) const = 0; // if true, improv is walking, crawling, running somewhere + virtual bool IsCrouching() const = 0; + virtual bool IsJumping() const = 0; + virtual bool IsUsingLadder() const = 0; + virtual bool IsOnGround() const = 0; + virtual bool IsMoving() const = 0; // if true, improv is walking, crawling, running somewhere - virtual bool CanRun(void) const = 0; - virtual bool CanCrouch(void) const = 0; - virtual bool CanJump(void) const = 0; + virtual bool CanRun() const = 0; + virtual bool CanCrouch() const = 0; + virtual bool CanJump() const = 0; virtual bool IsVisible(const Vector &pos, bool testFOV = false) const = 0; // return true if improv can see position virtual bool IsPlayerLookingAtMe(CBasePlayer *other, float cosTolerance = 0.95f) const = 0; // return true if 'other' is looking right at me virtual CBasePlayer *IsAnyPlayerLookingAtMe(int team = 0, float cosTolerance = 0.95f) const = 0; // return player on given team that is looking right at me (team == 0 means any team), NULL otherwise virtual CBasePlayer *GetClosestPlayerByTravelDistance(int team = 0, float *range = NULL) const = 0; // return actual travel distance to closest player on given team (team == 0 means any team) - virtual CNavArea *GetLastKnownArea(void) const = 0; + virtual CNavArea *GetLastKnownArea() const = 0; virtual void OnUpdate(float deltaT) = 0; // a less frequent, full update 'tick' virtual void OnUpkeep(float deltaT) = 0; // a frequent, lightweight update 'tick' - virtual void OnReset(void) = 0; // reset improv to initial state + virtual void OnReset() = 0; // reset improv to initial state virtual void OnGameEvent(GameEventType event, CBaseEntity *entity, CBaseEntity *other) = 0; // invoked when an event occurs in the game virtual void OnTouch(CBaseEntity *other) = 0; // "other" has touched us - -};/* size: 4, cachelines: 1, members: 1 */ - -#ifdef HOOK_GAMEDLL - -typedef bool (CImprov::*IS_FRIEND_INT_THEWAY_VECTOR)(const Vector &goalPos) const; -typedef bool (CImprov::*IS_FRIEND_INT_THEWAY_CBASEENTITY)(CBaseEntity *myFriend, const Vector &goalPos) const; - -#endif // HOOK_GAMEDLL +}; #endif // IMPROV_H diff --git a/regamedll/game_shared/bot/nav.h b/regamedll/game_shared/bot/nav.h index 38e42a27..d23be68f 100644 --- a/regamedll/game_shared/bot/nav.h +++ b/regamedll/game_shared/bot/nav.h @@ -49,9 +49,6 @@ typedef unsigned int Place; #define WALK_THRU_BREAKABLES 0x02 #define WALK_THRU_EVERYTHING (WALK_THRU_DOORS | WALK_THRU_BREAKABLES) -//class CNavArea; -//class CNavNode; - enum NavErrorType { NAV_OK, @@ -142,10 +139,10 @@ struct Extent Vector lo; Vector hi; - float SizeX(void) const { return hi.x - lo.x; } - float SizeY(void) const { return hi.y - lo.y;} - float SizeZ(void) const { return hi.z - lo.z; } - float Area(void) const { return SizeX() * SizeY(); } + float SizeX() const { return hi.x - lo.x; } + float SizeY() const { return hi.y - lo.y;} + float SizeZ() const { return hi.z - lo.z; } + float Area() const { return SizeX() * SizeY(); } // return true if 'pos' is inside of this extent bool Contains(const Vector *pos) const @@ -154,15 +151,13 @@ struct Extent pos->y >= lo.y && pos->y <= hi.y && pos->z >= lo.z && pos->z <= hi.z); } - -};/* size: 24, cachelines: 1, members: 2 */ +}; struct Ray { Vector from; Vector to; - -};/* size: 24, cachelines: 1, members: 2 */ +}; /* <34358b> ../game_shared/bot/nav.h:134 */ inline NavDirType OppositeDirection(NavDirType dir) diff --git a/regamedll/game_shared/bot/nav_area.cpp b/regamedll/game_shared/bot/nav_area.cpp index da093037..7eb67df9 100644 --- a/regamedll/game_shared/bot/nav_area.cpp +++ b/regamedll/game_shared/bot/nav_area.cpp @@ -20,6 +20,8 @@ #include #endif // _WIN32 +enum { MAX_BLOCKED_AREAS = 256 }; + /* * Globals initialization */ @@ -41,59 +43,29 @@ CNavAreaGrid TheNavAreaGrid; CNavArea *CNavArea::m_openList = NULL; bool CNavArea::m_isReset = false; -FILE_GLOBAL float lastDrawTimestamp = 0.0f; -FILE_GLOBAL NavAreaList goodSizedAreaList; - -FILE_GLOBAL CNavArea *markedArea = NULL; -FILE_GLOBAL CNavArea *lastSelectedArea = NULL; -FILE_GLOBAL NavCornerType markedCorner = NUM_CORNERS; - -FILE_GLOBAL bool isCreatingNavArea = false; -FILE_GLOBAL bool isAnchored = false; -FILE_GLOBAL Vector anchor; - -FILE_GLOBAL bool isPlaceMode = false; -FILE_GLOBAL bool isPlacePainting = false; - -FILE_GLOBAL float editTimestamp = 0.0f; - -FILE_GLOBAL unsigned int BlockedID[ MAX_BLOCKED_AREAS ]; -FILE_GLOBAL int BlockedIDCount = 0; - -#else // HOOK_GAMEDLL - -unsigned int IMPL_CLASS(CNavArea, m_nextID); -unsigned int IMPL_CLASS(CNavArea, m_masterMarker); - -unsigned int IMPL_CLASS(HidingSpot, m_nextID); -unsigned int IMPL_CLASS(HidingSpot, m_masterMarker); - -NavLadderList TheNavLadderList; -HidingSpotList TheHidingSpotList; -NavAreaList TheNavAreaList; -CNavAreaGrid TheNavAreaGrid; -CNavArea *IMPL_CLASS(CNavArea, m_openList); -bool IMPL_CLASS(CNavArea, m_isReset); - -float lastDrawTimestamp; +float lastDrawTimestamp = 0.0f; NavAreaList goodSizedAreaList; -CNavArea *markedArea; -CNavArea *lastSelectedArea; -NavCornerType markedCorner; -bool isCreatingNavArea; -bool isAnchored; + +CNavArea *markedArea = NULL; +CNavArea *lastSelectedArea = NULL; +NavCornerType markedCorner = NUM_CORNERS; + +bool isCreatingNavArea = false; +bool isAnchored = false; Vector anchor; -bool isPlaceMode; -bool isPlacePainting; -float editTimestamp; + +bool isPlaceMode = false; +bool isPlacePainting = false; + +float editTimestamp = 0.0f; unsigned int BlockedID[ MAX_BLOCKED_AREAS ]; -int BlockedIDCount; +int BlockedIDCount = 0; #endif // HOOK_GAMEDLL /* <4c31b5> ../game_shared/bot/nav_area.cpp:63 */ -NOXREF FILE_GLOBAL void buildGoodSizedList(void) +NOXREF void buildGoodSizedList() { const float minSize = 200.0f; @@ -112,7 +84,7 @@ NOXREF FILE_GLOBAL void buildGoodSizedList(void) } /* <4c5551> ../game_shared/bot/nav_area.cpp:87 */ -void DestroyHidingSpots(void) +void DestroyHidingSpots() { // remove all hiding spot references from the nav areas for (NavAreaList::iterator areaIter = TheNavAreaList.begin(); areaIter != TheNavAreaList.end(); areaIter++) @@ -133,7 +105,7 @@ void DestroyHidingSpots(void) // For use when loading from a file /* <4c578e> ../game_shared/bot/nav_area.cpp:109 */ -HidingSpot::HidingSpot(void) +HidingSpot::HidingSpot() { m_pos = Vector(0, 0, 0); m_id = 0; @@ -193,7 +165,7 @@ HidingSpot *GetHidingSpotByID(unsigned int id) // To keep constructors consistent /* <4c5c30> ../game_shared/bot/nav_area.cpp:169 */ -void CNavArea::Initialize(void) +void CNavArea::Initialize() { m_marker = 0; m_parent = NULL; @@ -220,7 +192,7 @@ void CNavArea::Initialize(void) // Constructor used during normal runtime /* <4c5c82> ../game_shared/bot/nav_area.cpp:198 */ -CNavArea::CNavArea(void) +CNavArea::CNavArea() { Initialize(); } @@ -310,7 +282,7 @@ CNavArea::CNavArea(CNavNode *nwNode, class CNavNode *neNode, class CNavNode *seN // Destructor /* <4d58d7> ../game_shared/bot/nav_area.cpp:295 */ -CNavArea::~CNavArea(void) +CNavArea::~CNavArea() { // if we are resetting the system, don't bother cleaning up - all areas are being destroyed if (IMPL(m_isReset)) @@ -961,14 +933,14 @@ bool CNavArea::MergeEdit(CNavArea *adj) } /* <4c78a9> ../game_shared/bot/nav_area.cpp:964 */ -void ApproachAreaAnalysisPrep(void) +void ApproachAreaAnalysisPrep() { // collect "good-sized" areas for computing approach areas buildGoodSizedList(); } /* <4c7a37> ../game_shared/bot/nav_area.cpp:971 */ -void CleanupApproachAreaAnalysisPrep(void) +void CleanupApproachAreaAnalysisPrep() { goodSizedAreaList.clear(); } @@ -976,7 +948,7 @@ void CleanupApproachAreaAnalysisPrep(void) // Destroy ladder representations /* <4c7b18> ../game_shared/bot/nav_area.cpp:980 */ -void DestroyLadders(void) +void DestroyLadders() { while (!TheNavLadderList.empty()) { @@ -989,7 +961,7 @@ void DestroyLadders(void) // Free navigation map data /* <4d6733> ../game_shared/bot/nav_area.cpp:994 */ -void DestroyNavigationMap(void) +void DestroyNavigationMap() { IMPL_CLASS(CNavArea, m_isReset) = true; @@ -1026,7 +998,7 @@ void DestroyNavigationMap(void) // Strip the "analyzed" data out of all navigation areas /* <4c7c70> ../game_shared/bot/nav_area.cpp:1031 */ -void StripNavigationAreas(void) +void StripNavigationAreas() { for (NavAreaList::iterator iter = TheNavAreaList.begin(); iter != TheNavAreaList.end(); ++iter) { @@ -1038,7 +1010,7 @@ void StripNavigationAreas(void) // Remove "analyzed" data from nav area /* <4c7e9a> ../game_shared/bot/nav_area.cpp:1046 */ -void CNavArea::Strip(void) +void CNavArea::Strip() { m_approachCount = 0; m_spotEncounterList.clear(); // memory leak @@ -1142,7 +1114,7 @@ inline CNavArea *findJumpDownArea(const Vector *fromPos, NavDirType dir) // Define connections between adjacent generated areas /* <4d1c46> ../game_shared/bot/nav_area.cpp:1157 */ -void ConnectGeneratedAreas(void) +void ConnectGeneratedAreas() { CONSOLE_ECHO(" Connecting navigation areas...\n"); @@ -1243,7 +1215,7 @@ void ConnectGeneratedAreas(void) // Areas can only be merged if their attributes match. /* <4d922b> ../game_shared/bot/nav_area.cpp:1259 */ -void MergeGeneratedAreas(void) +void MergeGeneratedAreas() { CONSOLE_ECHO(" Merging navigation areas...\n"); @@ -1451,7 +1423,7 @@ void SplitY(CNavArea *area) // Split any long, thin, areas into roughly square chunks. /* <4d7207> ../game_shared/bot/nav_area.cpp:1474 */ -void SquareUpAreas(void) +void SquareUpAreas() { NavAreaList::iterator iter = TheNavAreaList.begin(); @@ -1618,7 +1590,7 @@ int BuildArea(CNavNode *node, int width, int height) // For each ladder in the map, create a navigation representation of it. /* <4d3581> ../game_shared/bot/nav_area.cpp:1645 */ -void BuildLadders(void) +void BuildLadders() { // remove any left-over ladders DestroyLadders(); @@ -1830,7 +1802,7 @@ void BuildLadders(void) // This currently relies on jump areas having extreme slope. /* <4c85c3> ../game_shared/bot/nav_area.cpp:1864 */ -void MarkJumpAreas(void) +void MarkJumpAreas() { for (NavAreaList::iterator iter = TheNavAreaList.begin(); iter != TheNavAreaList.end(); ++iter) { @@ -1863,7 +1835,7 @@ void MarkJumpAreas(void) // with the fewest, largest, rectangles. /* <4d943a> ../game_shared/bot/nav_area.cpp:1899 */ -void GenerateNavigationAreaMesh(void) +void GenerateNavigationAreaMesh() { // haven't yet seen a map use larger than 30... int tryWidth = 50; @@ -2576,7 +2548,7 @@ void CNavArea::DrawMarkedCorner(NavCornerType corner, byte red, byte green, byte // Add to open list in decreasing value order /* <4cbb32> ../game_shared/bot/nav_area.cpp:2634 */ -void CNavArea::AddToOpenList(void) +void CNavArea::AddToOpenList() { // mark as being on open list for quick check m_openMarker = IMPL(m_masterMarker); @@ -2626,7 +2598,7 @@ void CNavArea::AddToOpenList(void) // TODO: "bubbling" does unnecessary work, since the order of all other nodes will be unchanged - only this node is altered /* <4cbd73> ../game_shared/bot/nav_area.cpp:2685 */ -void CNavArea::UpdateOnOpenList(void) +void CNavArea::UpdateOnOpenList() { // since value can only decrease, bubble this area up from current spot while (m_prevOpen && this->GetTotalCost() < m_prevOpen->GetTotalCost()) @@ -2653,7 +2625,7 @@ void CNavArea::UpdateOnOpenList(void) } /* <4cbdbc> ../game_shared/bot/nav_area.cpp:2713 */ -void CNavArea::RemoveFromOpenList(void) +void CNavArea::RemoveFromOpenList() { if (m_prevOpen) m_prevOpen->m_nextOpen = m_nextOpen; @@ -2670,7 +2642,7 @@ void CNavArea::RemoveFromOpenList(void) // Clears the open and closed lists for a new search /* <4cbddf> ../game_shared/bot/nav_area.cpp:2731 */ -void CNavArea::ClearSearchLists(void) +void CNavArea::ClearSearchLists() { CNavArea::MakeNewMarker(); IMPL(m_openList) = NULL; @@ -2768,7 +2740,7 @@ bool IsHidingSpotInCover(const Vector *spot) // Analyze local area neighborhood to find "hiding spots" for this area /* <4cc054> ../game_shared/bot/nav_area.cpp:2834 */ -void CNavArea::ComputeHidingSpots(void) +void CNavArea::ComputeHidingSpots() { struct { @@ -2980,7 +2952,7 @@ void ClassifySniperSpot(HidingSpot *spot) // Analyze local area neighborhood to find "sniper spots" for this area /* <4ccf19> ../game_shared/bot/nav_area.cpp:3049 */ -void CNavArea::ComputeSniperSpots(void) +void CNavArea::ComputeSniperSpots() { if (cv_bot_quicksave.value > 0.0f) return; @@ -3120,7 +3092,7 @@ void CNavArea::AddSpotEncounters(const class CNavArea *from, NavDirType fromDir, // for each possible path thru a nav area. /* <4cd99c> ../game_shared/bot/nav_area.cpp:3192 */ -void CNavArea::ComputeSpotEncounters(void) +void CNavArea::ComputeSpotEncounters() { m_spotEncounterList.clear(); @@ -3155,7 +3127,7 @@ void CNavArea::ComputeSpotEncounters(void) // Decay the danger values /* <4cdca9> ../game_shared/bot/nav_area.cpp:3228 */ -void CNavArea::DecayDanger(void) +void CNavArea::DecayDanger() { // one kill == 1.0, which we will forget about in two minutes const float decayRate = 1.0f / 120.0f; @@ -3244,7 +3216,7 @@ void IncreaseDangerNearby(int teamID, float amount, class CNavArea *startArea, c // Show danger levels for debugging /* <4ce2c4> ../game_shared/bot/nav_area.cpp:3321 */ -void DrawDanger(void) +void DrawDanger() { for (NavAreaList::iterator iter = TheNavAreaList.begin(); iter != TheNavAreaList.end(); ++iter) { @@ -3640,13 +3612,13 @@ int CNavArea::GetPlayerCount(int teamID, CBasePlayer *ignore) const } /* <4cea33> ../game_shared/bot/nav_area.cpp:3749 */ -CNavArea *GetMarkedArea(void) +CNavArea *GetMarkedArea() { return markedArea; } /* <4c2a8c> ../game_shared/bot/nav_area.cpp:3757 */ -void EditNavAreasReset(void) +void EditNavAreasReset() { markedArea = NULL; lastSelectedArea = NULL; @@ -3691,7 +3663,7 @@ void DrawHidingSpots(const class CNavArea *area) // Draw ourselves and adjacent areas /* <4cebe7> ../game_shared/bot/nav_area.cpp:3802 */ -void CNavArea::DrawConnectedAreas(void) +void CNavArea::DrawConnectedAreas() { CBasePlayer *player = UTIL_GetLocalPlayer(); if (player == NULL) @@ -3881,8 +3853,7 @@ public: private: unsigned int m_initialPlace; - -};/* size: 4, cachelines: 1, members: 1 */ +}; // Draw navigation areas and edit them @@ -4051,12 +4022,12 @@ void EditNavAreas(NavEditCmdType cmd) } else { - locName[0] = '\000'; + locName[0] = '\0'; } if (isPlaceMode) { - attrib[0] = '\000'; + attrib[0] = '\0'; } else { @@ -4658,7 +4629,7 @@ inline bool IsAreaVisible(const Vector *pos, const CNavArea *area) // move into/out of our local neighborhood of areas. /* <4cf54c> ../game_shared/bot/nav_area.cpp:4817 */ -void CNavArea::ComputeApproachAreas(void) +void CNavArea::ComputeApproachAreas() { m_approachCount = 0; @@ -4780,14 +4751,14 @@ void CNavArea::ComputeApproachAreas(void) } /* <4cf961> ../game_shared/bot/nav_area.cpp:4947 */ -CNavAreaGrid::CNavAreaGrid(void) : m_cellSize(300.0f) +CNavAreaGrid::CNavAreaGrid() : m_cellSize(300.0f) { m_grid = NULL; Reset(); } /* <4c4a70> ../game_shared/bot/nav_area.cpp:4953 */ -CNavAreaGrid::~CNavAreaGrid(void) +CNavAreaGrid::~CNavAreaGrid() { delete[] m_grid; m_grid = NULL; @@ -4796,7 +4767,7 @@ CNavAreaGrid::~CNavAreaGrid(void) // Clear the grid /* <4cf837> ../game_shared/bot/nav_area.cpp:4962 */ -void CNavAreaGrid::Reset(void) +void CNavAreaGrid::Reset() { if (m_grid) delete[] m_grid; diff --git a/regamedll/game_shared/bot/nav_area.h b/regamedll/game_shared/bot/nav_area.h index e9e3274a..87d7614d 100644 --- a/regamedll/game_shared/bot/nav_area.h +++ b/regamedll/game_shared/bot/nav_area.h @@ -36,37 +36,11 @@ class CNavArea; -enum { MAX_BLOCKED_AREAS = 256 }; - -#ifdef HOOK_GAMEDLL - -#define TheNavLadderList (*pTheNavLadderList) -#define TheHidingSpotList (*pTheHidingSpotList) -#define TheNavAreaList (*pTheNavAreaList) -#define TheNavAreaGrid (*pTheNavAreaGrid) - -#define lastDrawTimestamp (*plastDrawTimestamp) -#define goodSizedAreaList (*pgoodSizedAreaList) -#define markedArea (*pmarkedArea) -#define lastSelectedArea (*plastSelectedArea) -#define markedCorner (*pmarkedCorner) -#define isCreatingNavArea (*pisCreatingNavArea) -#define isAnchored (*pisAnchored) -#define anchor (*panchor) -#define isPlaceMode (*pisPlaceMode) -#define isPlacePainting (*pisPlacePainting) -#define editTimestamp (*peditTimestamp) - -#define BlockedID (*pBlockedID) -#define BlockedIDCount (*pBlockedIDCount) - -#endif // HOOK_GAMEDLL - -void DestroyHidingSpots(void); -void StripNavigationAreas(void); +void DestroyHidingSpots(); +void StripNavigationAreas(); bool SaveNavigationMap(const char *filename); -NavErrorType LoadNavigationMap(void); -void DestroyNavigationMap(void); +NavErrorType LoadNavigationMap(); +void DestroyNavigationMap(); enum NavEditCmdType { @@ -109,11 +83,7 @@ union NavConnect unsigned int id; CNavArea *area; - /* <4c26c6> ../game_shared/bot/nav_area.h:40 */ - bool operator==(const NavConnect &other) const - { - return (area == other.area) ? true : false; - } + bool operator==(const NavConnect &other) const { return (area == other.area) ? true : false; } }; typedef std::STD_LIST NavConnectList; @@ -129,7 +99,7 @@ enum LadderDirectionType class CNavLadder { public: - CNavLadder(void) + CNavLadder() { m_topForwardArea = NULL; m_topRightArea = NULL; @@ -172,15 +142,14 @@ public: if (dead == m_bottomArea) m_bottomArea = NULL; } - -};/* size: 68, cachelines: 2, members: 12 */ +}; typedef std::STD_LIST NavLadderList; class HidingSpot { public: - HidingSpot(void); + HidingSpot(); HidingSpot(const Vector *pos, unsigned char flags); enum @@ -190,54 +159,28 @@ public: IDEAL_SNIPER_SPOT = 0x04 }; - bool HasGoodCover(void) const - { - return (m_flags & IN_COVER) ? true : false; - } - bool IsGoodSniperSpot(void) const - { - return (m_flags & GOOD_SNIPER_SPOT) ? true : false; - } - bool IsIdealSniperSpot(void) const - { - return (m_flags & IDEAL_SNIPER_SPOT) ? true : false; - } - void SetFlags(unsigned char flags) - { - m_flags |= flags; - } - unsigned char GetFlags(void) const - { - return m_flags; - } + bool HasGoodCover() const { return (m_flags & IN_COVER) ? true : false; } + bool IsGoodSniperSpot() const { return (m_flags & GOOD_SNIPER_SPOT) ? true : false; } + bool IsIdealSniperSpot() const { return (m_flags & IDEAL_SNIPER_SPOT) ? true : false; } + + void SetFlags(unsigned char flags) { m_flags |= flags; } + unsigned char GetFlags() const { return m_flags; } + void Save(int fd, unsigned int version) const; void Load(SteamFile *file, unsigned int version); - const Vector *GetPosition(void) const - { - return &m_pos; - } - unsigned int GetID(void) const - { - return m_id; - } - void Mark(void) - { - m_marker = IMPL(m_masterMarker); - } - bool IsMarked(void) const - { - return (m_marker == IMPL(m_masterMarker)) ? true : false; - } - static void ChangeMasterMarker(void) - { - ++IMPL(m_masterMarker); - } + const Vector *GetPosition() const { return &m_pos; } + unsigned int GetID() const { return m_id; } + + void Mark() { m_marker = IMPL(m_masterMarker); } + bool IsMarked() const { return (m_marker == IMPL(m_masterMarker)) ? true : false; } + + static void ChangeMasterMarker() { ++IMPL(m_masterMarker); } #ifndef HOOK_GAMEDLL private: #endif // HOOK_GAMEDLL - friend void DestroyHidingSpots(void); + friend void DestroyHidingSpots(); Vector m_pos; unsigned int m_id; @@ -246,8 +189,7 @@ private: static unsigned int IMPL(m_nextID); static unsigned int IMPL(m_masterMarker); - -};/* size: 24, cachelines: 1, members: 6 */ +}; typedef std::STD_LIST HidingSpotList; @@ -260,8 +202,7 @@ struct SpotOrder HidingSpot *spot; unsigned int id; }; - -};/* size: 8, cachelines: 1, members: 2 */ +}; typedef std::STD_LIST SpotOrderList; @@ -274,8 +215,7 @@ struct SpotEncounter NavDirType toDir; Ray path; // the path segment SpotOrderList spotList; // list of spots to look at, in order of occurrence - -};/* size: 48, cachelines: 1, members: 6 */ +}; typedef std::STD_LIST SpotEncounterList; typedef std::STD_LIST NavAreaList; @@ -286,7 +226,7 @@ class CNavArea { public: CNavArea(CNavNode *nwNode, CNavNode *neNode, CNavNode *seNode, CNavNode *swNode); - CNavArea(void); + CNavArea(); CNavArea(const Vector *corner, const Vector *otherCorner); CNavArea(const Vector *nwCorner, const Vector *neCorner, const Vector *seCorner, const Vector *swCorner); @@ -299,13 +239,13 @@ public: void Save(int fd, unsigned int version); void Load(SteamFile *file, unsigned int version); - NavErrorType PostLoad(void); + NavErrorType PostLoad(); - unsigned int GetID(void) const { return m_id; } + unsigned int GetID() const { return m_id; } void SetAttributes(unsigned char bits) { m_attributeFlags = bits; } - unsigned char GetAttributes(void) const { return m_attributeFlags; } + unsigned char GetAttributes() const { return m_attributeFlags; } void SetPlace(Place place) { m_place = place; } // set place descriptor - Place GetPlace(void) const { return m_place; } // get place descriptor + Place GetPlace() const { return m_place; } // get place descriptor bool IsOverlapping(const Vector *pos) const; // return true if 'pos' is within 2D extents of area bool IsOverlapping(const CNavArea *area) const; // return true if 'area' overlaps our 2D extents @@ -318,7 +258,7 @@ public: bool IsCoplanar(const CNavArea *area) const; // return true if this area and given area are approximately co-planar void GetClosestPointOnArea(const Vector *pos, Vector *close) const; // return closest point to 'pos' on this area - returned point in 'close' float GetDistanceSquaredToPoint(const Vector *pos) const; // return shortest distance between point and this area - bool IsDegenerate(void) const; // return true if this area is badly formed + bool IsDegenerate() const; // return true if this area is badly formed bool IsEdge(NavDirType dir) const; // return true if there are no bi-directional links on the given side int GetAdjacentCount(NavDirType dir) const { return m_connect[dir].size(); } // return number of connected areas in given direction CNavArea *GetAdjacentArea(NavDirType dir, int i) const; // return the i'th adjacent area in the given direction @@ -338,23 +278,23 @@ public: float GetClearedTimestamp(int teamID) { return m_clearedTimestamp[teamID]; } // get time this area was marked "clear" // hiding spots - const HidingSpotList *GetHidingSpotList(void) const { return &m_hidingSpotList; } + const HidingSpotList *GetHidingSpotList() const { return &m_hidingSpotList; } - void ComputeHidingSpots(void); // analyze local area neighborhood to find "hiding spots" in this area - for map learning - void ComputeSniperSpots(void); // analyze local area neighborhood to find "sniper spots" in this area - for map learning + void ComputeHidingSpots(); // analyze local area neighborhood to find "hiding spots" in this area - for map learning + void ComputeSniperSpots(); // analyze local area neighborhood to find "sniper spots" in this area - for map learning SpotEncounter *GetSpotEncounter(const CNavArea *from, const CNavArea *to); // given the areas we are moving between, return the spots we will encounter - void ComputeSpotEncounters(void); // compute spot encounter data - for map learning + void ComputeSpotEncounters(); // compute spot encounter data - for map learning // danger void IncreaseDanger(int teamID, float amount); // increase the danger of this area for the given team float GetDanger(int teamID); // return the danger of this area (decays over time) - float GetSizeX(void) const { return m_extent.hi.x - m_extent.lo.x; } - float GetSizeY(void) const { return m_extent.hi.y - m_extent.lo.y; } + float GetSizeX() const { return m_extent.hi.x - m_extent.lo.x; } + float GetSizeY() const { return m_extent.hi.y - m_extent.lo.y; } - const Extent *GetExtent(void) const { return &m_extent; } - const Vector *GetCenter(void) const { return &m_center; } + const Extent *GetExtent() const { return &m_extent; } + const Vector *GetCenter() const { return &m_center; } const Vector *GetCorner(NavCornerType corner) const; // approach areas @@ -368,46 +308,46 @@ public: }; const ApproachInfo *GetApproachInfo(int i) const { return &m_approach[i]; } - int GetApproachInfoCount(void) const { return m_approachCount; } - void ComputeApproachAreas(void); // determine the set of "approach areas" - for map learning + int GetApproachInfoCount() const { return m_approachCount; } + void ComputeApproachAreas(); // determine the set of "approach areas" - for map learning // A* pathfinding algorithm - static void MakeNewMarker(void) + static void MakeNewMarker() { - ++IMPL(m_masterMarker); - if (IMPL(m_masterMarker) == 0) + if (++IMPL(m_masterMarker) == 0) IMPL(m_masterMarker) = 1; } - void Mark(void) { m_marker = IMPL(m_masterMarker); } - BOOL IsMarked(void) const { return (m_marker == IMPL(m_masterMarker)) ? true : false; } + void Mark() { m_marker = IMPL(m_masterMarker); } + BOOL IsMarked() const { return (m_marker == IMPL(m_masterMarker)) ? true : false; } void SetParent(CNavArea *parent, NavTraverseType how = NUM_TRAVERSE_TYPES) { m_parent = parent; m_parentHow = how; } - CNavArea *GetParent(void) const { return m_parent; } - NavTraverseType GetParentHow(void) const { return m_parentHow; } + CNavArea *GetParent() const { return m_parent; } + NavTraverseType GetParentHow() const { return m_parentHow; } - bool IsOpen(void) const; // true if on "open list" - void AddToOpenList(void); // add to open list in decreasing value order - void UpdateOnOpenList(void); // a smaller value has been found, update this area on the open list - void RemoveFromOpenList(void); - static bool IsOpenListEmpty(void); - static CNavArea *PopOpenList(void); // remove and return the first element of the open list + bool IsOpen() const; // true if on "open list" + void AddToOpenList(); // add to open list in decreasing value order + void UpdateOnOpenList(); // a smaller value has been found, update this area on the open list + void RemoveFromOpenList(); + static bool IsOpenListEmpty(); + static CNavArea *PopOpenList(); // remove and return the first element of the open list - bool IsClosed(void) const; // true if on "closed list" - void AddToClosedList(void); // add to the closed list - void RemoveFromClosedList(void); + bool IsClosed() const; // true if on "closed list" + void AddToClosedList(); // add to the closed list + void RemoveFromClosedList(); - static void ClearSearchLists(void); // clears the open and closed lists for a new search + static void ClearSearchLists(); // clears the open and closed lists for a new search - void SetTotalCost(float value) { m_totalCost = value; } - float GetTotalCost(void) const { return m_totalCost; } - void SetCostSoFar(float value) { m_costSoFar = value; } - float GetCostSoFar(void) const { return m_costSoFar; } + void SetTotalCost(float value) { m_totalCost = value; } + float GetTotalCost() const { return m_totalCost; } + + void SetCostSoFar(float value) { m_costSoFar = value; } + float GetCostSoFar() const { return m_costSoFar; } // editing void Draw(byte red, byte green, byte blue, int duration = 50); // draw area for debugging & editing - void DrawConnectedAreas(void); + void DrawConnectedAreas(); void DrawMarkedCorner(NavCornerType corner, byte red, byte green, byte blue, int duration = 50); bool SplitEdit(bool splitAlongX, float splitEdge, CNavArea **outAlpha = NULL, CNavArea **outBeta = NULL); // split this area into two areas at the given edge - bool MergeEdit(CNavArea *adj); // merge this area and given adjacent area + bool MergeEdit(CNavArea *adj); // merge this area and given adjacent area bool SpliceEdit(CNavArea *other); // create a new area between this area and given area void RaiseCorner(NavCornerType corner, int amount); // raise/lower a corner (or all corners if corner == NUM_CORNERS) @@ -418,18 +358,18 @@ public: #ifndef HOOK_GAMEDLL private: #endif // HOOK_GAMEDLL - friend void ConnectGeneratedAreas(void); - friend void MergeGeneratedAreas(void); - friend void MarkJumpAreas(void); + friend void ConnectGeneratedAreas(); + friend void MergeGeneratedAreas(); + friend void MarkJumpAreas(); friend bool SaveNavigationMap(const char *filename); - friend NavErrorType LoadNavigationMap(void); - friend void DestroyNavigationMap(void); - friend void DestroyHidingSpots(void); - friend void StripNavigationAreas(void); + friend NavErrorType LoadNavigationMap(); + friend void DestroyNavigationMap(); + friend void DestroyHidingSpots(); + friend void StripNavigationAreas(); friend class CNavAreaGrid; friend class CCSBotManager; - void Initialize(void); // to keep constructors consistent + void Initialize(); // to keep constructors consistent static bool IMPL(m_isReset); // if true, don't bother cleaning up in destructor since everything is going away static unsigned int IMPL(m_nextID); // used to allocate unique IDs @@ -451,7 +391,7 @@ private: // danger float m_danger[MAX_AREA_TEAMS]; // danger of this area, allowing bots to avoid areas where they died in the past - zero is no danger float m_dangerTimestamp[MAX_AREA_TEAMS]; // time when danger value was set - used for decaying - void DecayDanger(void); + void DecayDanger(); // hiding spots HidingSpotList m_hidingSpotList; @@ -466,7 +406,7 @@ private: ApproachInfo m_approach[MAX_APPROACH_AREAS]; unsigned char m_approachCount; - void Strip(void); // remove "analyzed" data from nav area + void Strip(); // remove "analyzed" data from nav area // A* pathfinding algorithm static unsigned int IMPL(m_masterMarker); @@ -495,13 +435,12 @@ private: void OnDestroyNotify(CNavArea *dead); // invoked when given area is going away CNavArea *m_prevHash, *m_nextHash; // for hash table in CNavAreaGrid - -};/* size: 532, cachelines: 9, members: 32 */ +}; extern NavAreaList TheNavAreaList; /* <4c1534> ../game_shared/bot/nav_area.h:417 */ -inline bool CNavArea::IsDegenerate(void) const +inline bool CNavArea::IsDegenerate() const { return (m_extent.lo.x >= m_extent.hi.x || m_extent.lo.y >= m_extent.hi.y); } @@ -521,19 +460,19 @@ inline CNavArea *CNavArea::GetAdjacentArea(NavDirType dir, int i) const } /* <5a01dc> ../game_shared/bot/nav_area.h:435 */ -inline bool CNavArea::IsOpen(void) const +inline bool CNavArea::IsOpen() const { return (m_openMarker == IMPL(m_masterMarker)) ? true : false; } /* <5a0a62> ../game_shared/bot/nav_area.h:440 */ -inline bool CNavArea::IsOpenListEmpty(void) +inline bool CNavArea::IsOpenListEmpty() { return (IMPL(m_openList) != NULL) ? false : true; } /* <5a1483> ../game_shared/bot/nav_area.h:445 */ -inline CNavArea *CNavArea::PopOpenList(void) +inline CNavArea *CNavArea::PopOpenList() { if (IMPL(m_openList)) { @@ -548,7 +487,7 @@ inline CNavArea *CNavArea::PopOpenList(void) } /* <5a0a2a> ../game_shared/bot/nav_area.h:460 */ -inline bool CNavArea::IsClosed(void) const +inline bool CNavArea::IsClosed() const { if (IsMarked() && !IsOpen()) return true; @@ -557,13 +496,13 @@ inline bool CNavArea::IsClosed(void) const } /* <5a0a46> ../game_shared/bot/nav_area.h:468 */ -inline void CNavArea::AddToClosedList(void) +inline void CNavArea::AddToClosedList() { Mark(); } /* <5a01f8> ../game_shared/bot/nav_area.h:473 */ -inline void CNavArea::RemoveFromClosedList(void) +inline void CNavArea::RemoveFromClosedList() { // since "closed" is defined as visited (marked) and not on open list, do nothing } @@ -576,17 +515,14 @@ inline void CNavArea::RemoveFromClosedList(void) class CNavAreaGrid { public: - CNavAreaGrid(void); + CNavAreaGrid(); ~CNavAreaGrid(); - void Reset(void); // clear the grid to empty + void Reset(); // clear the grid to empty void Initialize(float minX, float maxX, float minY, float maxY); // clear and reset the grid to the given extents void AddNavArea(CNavArea *area); // add an area to the grid void RemoveNavArea(CNavArea *area); // remove an area from the grid - unsigned int GetNavAreaCount(void) const // return total number of nav areas - { - return m_areaCount; - } + unsigned int GetNavAreaCount() const { return m_areaCount; } // return total number of nav areas CNavArea *GetNavArea(const Vector *pos, float beneathLimt = 120.0f) const; // given a position, return the nav area that IsOverlapping and is *immediately* beneath it CNavArea *GetNavAreaByID(unsigned int id) const; CNavArea *GetNearestNavArea(const Vector *pos, bool anyZ = false) const; @@ -630,8 +566,7 @@ private: return y; } - -};/* size: 1052, cachelines: 17, members: 8 */ +}; class ShortestPathCost { @@ -1138,10 +1073,7 @@ public: class FarAwayFromPositionFunctor { public: - FarAwayFromPositionFunctor(const Vector *pos) - { - m_pos = pos; - } + FarAwayFromPositionFunctor(const Vector *pos) { m_pos = pos; } float operator() (CNavArea *area, CNavArea *fromArea, const CNavLadder *ladder) { @@ -1150,8 +1082,7 @@ public: private: const Vector *m_pos; - -};/* size: 4, cachelines: 1, members: 1 */ +}; // Pick a low-cost area of "decent" size @@ -1228,59 +1159,17 @@ CNavArea *FindMinimumCostArea(CNavArea *startArea, CostFunctor &costFunc) } } -#ifdef HOOK_GAMEDLL - -typedef const Vector *(FIND_SPOT_CBASE)(CBaseEntity *, const Vector *, CNavArea *, float, int, bool); - -typedef void (CNavArea::*SAVE_FD)(int fd, unsigned int version); -typedef void (CNavArea::*SAVE_FILE)(FILE *fp) const; - -typedef bool (CNavArea::*OVERLAP_VECTOR)(const Vector *pos) const; -typedef bool (CNavArea::*OVERLAP_CNAV)(const CNavArea *area) const; - -typedef float (CNavArea::*GETZ_VECTOR)(const Vector *pos) const; -typedef float (CNavArea::*GETZ_TWO_FLOAT)(float x, float y) const; - -typedef void (HidingSpot::*HIDING_SPOT_VOID)(void); -typedef void (HidingSpot::*HIDING_SPOT_VECTOR)(const Vector *pos, unsigned char flags); - -typedef void (HidingSpot::*CNAV_AREA_VOID)(void); -typedef void (HidingSpot::*CNAV_AREA_TWO_VECTOR)(const Vector *corner, const Vector *otherCorner); -typedef void (HidingSpot::*CNAV_AREA_VECTOR)(const Vector *nwCorner, const Vector *neCorner, const Vector *seCorner, const Vector *swCorner); -typedef void (HidingSpot::*CNAV_AREA_NAVNODE)(CNavNode *nwNode, class CNavNode *neNode, class CNavNode *seNode, class CNavNode *swNode); - -#endif // HOOK_GAMEDLL - -extern NavLadderList TheNavLadderList; -extern HidingSpotList TheHidingSpotList; -extern NavAreaList TheNavAreaList; -extern CNavAreaGrid TheNavAreaGrid; -extern float lastDrawTimestamp; -extern NavAreaList goodSizedAreaList; -extern CNavArea *markedArea; -extern CNavArea *lastSelectedArea; -extern NavCornerType markedCorner; -extern bool isCreatingNavArea; -extern bool isAnchored; -extern Vector anchor; -extern bool isPlaceMode; -extern bool isPlacePainting; -extern float editTimestamp; - -extern unsigned int BlockedID[ MAX_BLOCKED_AREAS ]; -extern int BlockedIDCount; - bool IsHidingSpotInCover(const Vector *spot); void ClassifySniperSpot(HidingSpot *spot); -void DestroyHidingSpots(void); +void DestroyHidingSpots(); void EditNavAreas(NavEditCmdType cmd); bool GetGroundHeight(const Vector *pos, float *height, Vector *normal = NULL); bool GetSimpleGroundHeight(const Vector *pos, float *height, Vector *normal = NULL); -CNavArea *GetMarkedArea(void); -void EditNavAreasReset(void); +CNavArea *GetMarkedArea(); +void EditNavAreasReset(); void DrawHidingSpots(const CNavArea *area); void IncreaseDangerNearby(int teamID, float amount, CNavArea *startArea, const Vector *pos, float maxRadius); -void DrawDanger(void); +void DrawDanger(); bool IsSpotOccupied(CBaseEntity *me, const Vector *pos); // if a player is at the given spot, return true const Vector *FindNearbyHidingSpot(CBaseEntity *me, const Vector *pos, CNavArea *startArea, float maxRange = 1000.0f, bool isSniper = false, bool useNearest = false); const Vector *FindNearbyRetreatSpot(CBaseEntity *me, const Vector *start, CNavArea *startArea, float maxRange = 1000.0f, int avoidTeam = 0, bool useCrouchAreas = true); @@ -1289,23 +1178,28 @@ const Vector *FindNearbyRetreatSpot(CBaseEntity *me, const Vector *start, CNavAr bool IsCrossingLineOfFire(const Vector &start, const Vector &finish, CBaseEntity *ignore = NULL, int ignoreTeam = 0); const Vector *FindRandomHidingSpot(CBaseEntity *me, Place place, bool isSniper = false); HidingSpot *GetHidingSpotByID(unsigned int id); -void ApproachAreaAnalysisPrep(void); -void CleanupApproachAreaAnalysisPrep(void); -void DestroyLadders(void); -void DestroyNavigationMap(void); -void StripNavigationAreas(void); +void ApproachAreaAnalysisPrep(); +void CleanupApproachAreaAnalysisPrep(); +void DestroyLadders(); +void DestroyNavigationMap(); +void StripNavigationAreas(); CNavArea *FindFirstAreaInDirection(const Vector *start, NavDirType dir, float range, float beneathLimit, CBaseEntity *traceIgnore, Vector *closePos); bool testJumpDown(const Vector *fromPos, const Vector *toPos); -void ConnectGeneratedAreas(void); -void MergeGeneratedAreas(void); +void ConnectGeneratedAreas(); +void MergeGeneratedAreas(); bool IsAreaRoughlySquare(const CNavArea *area); void SplitX(CNavArea *area); void SplitY(CNavArea *area); -void SquareUpAreas(void); +void SquareUpAreas(); bool TestArea(CNavNode *node, int width, int height); int BuildArea(CNavNode *node, int width, int height); -void BuildLadders(void); -void MarkJumpAreas(void); -void GenerateNavigationAreaMesh(void); +void BuildLadders(); +void MarkJumpAreas(); +void GenerateNavigationAreaMesh(); + +extern NavLadderList TheNavLadderList; +extern HidingSpotList TheHidingSpotList; +extern NavAreaList TheNavAreaList; +extern CNavAreaGrid TheNavAreaGrid; #endif // NAV_AREA_H diff --git a/regamedll/game_shared/bot/nav_file.cpp b/regamedll/game_shared/bot/nav_file.cpp index 68dd2091..7a18dd35 100644 --- a/regamedll/game_shared/bot/nav_file.cpp +++ b/regamedll/game_shared/bot/nav_file.cpp @@ -18,26 +18,13 @@ #include #ifndef _WIN32 - #include - #endif // _WIN32 -/* -* Globals initialization -*/ -#ifndef HOOK_GAMEDLL - -static PlaceDirectory placeDirectory; - -#else // HOOK_GAMEDLL - PlaceDirectory placeDirectory; -#endif // HOOK_GAMEDLL - /* <4edbfc> ../game_shared/bot/nav_file.cpp:60 */ -void PlaceDirectory::Reset(void) +void PlaceDirectory::Reset() { m_directory.clear(); } @@ -504,7 +491,7 @@ void CNavArea::Load(SteamFile *file, unsigned int version) } /* <4f029e> ../game_shared/bot/nav_file.cpp:562 */ -NavErrorType CNavArea::PostLoad(void) +NavErrorType CNavArea::PostLoad() { NavErrorType error = NAV_OK; @@ -864,7 +851,7 @@ void SanityCheckNavigationMap(const char *mapName) } /* <4f19c7> ../game_shared/bot/nav_file.cpp:947 */ -NavErrorType LoadNavigationMap(void) +NavErrorType LoadNavigationMap() { // since the navigation map is destroyed on map change, // if it exists it has already been loaded for this map diff --git a/regamedll/game_shared/bot/nav_file.h b/regamedll/game_shared/bot/nav_file.h index 3bc04741..1830e902 100644 --- a/regamedll/game_shared/bot/nav_file.h +++ b/regamedll/game_shared/bot/nav_file.h @@ -48,7 +48,7 @@ class PlaceDirectory public: typedef unsigned short EntryType; - void Reset(void); + void Reset(); bool IsKnown(Place place) const; // return true if this place is already in the directory EntryType GetEntry(Place place) const; // return the directory entry corresponding to this Place (0 = no entry) void AddPlace(Place place); // add the place to the directory if not already known @@ -60,12 +60,10 @@ private: std::vector m_directory; }; -extern PlaceDirectory placeDirectory; - char *GetBspFilename(const char *navFilename); bool SaveNavigationMap(const char *filename); void LoadLocationFile(const char *filename); void SanityCheckNavigationMap(const char *mapName); // Performs a lightweight sanity-check of the specified map's nav mesh -NavErrorType LoadNavigationMap(void); +NavErrorType LoadNavigationMap(); #endif // NAV_FILE_H diff --git a/regamedll/game_shared/bot/nav_node.cpp b/regamedll/game_shared/bot/nav_node.cpp index 358bdef3..51ecba4e 100644 --- a/regamedll/game_shared/bot/nav_node.cpp +++ b/regamedll/game_shared/bot/nav_node.cpp @@ -10,13 +10,6 @@ NavDirType Opposite[ NUM_DIRECTIONS ] = { SOUTH, WEST, NORTH, EAST }; CNavNode *CNavNode::m_list = NULL; unsigned int CNavNode::m_listLength = 0; -#else // HOOK_GAMEDLL - -NavDirType Opposite[ NUM_DIRECTIONS ]; - -CNavNode *IMPL_CLASS(CNavNode, m_list); -unsigned int IMPL_CLASS(CNavNode, m_listLength); - #endif // HOOK_GAMEDLL //NOXREF Extent NodeMapExtent; @@ -75,7 +68,7 @@ const CNavNode *CNavNode::GetNode(const Vector *pos) return NULL; } -// Return true if this node is bidirectionally linked to +// Return true if this node is bidirectionally linked to // another node in the given direction /* <4f7af2> ../game_shared/bot/nav_node.cpp:86 */ @@ -91,7 +84,7 @@ BOOL CNavNode::IsBiLinked(NavDirType dir) const // that are all bidirectionally linked /* <4f7b1c> ../game_shared/bot/nav_node.cpp:100 */ -BOOL CNavNode::IsClosedCell(void) const +BOOL CNavNode::IsClosedCell() const { if (IsBiLinked( SOUTH ) && IsBiLinked( EAST ) && m_to[ EAST ]->IsBiLinked( SOUTH ) && m_to[ SOUTH ]->IsBiLinked( EAST ) && m_to[ EAST ]->m_to[ SOUTH ] == m_to[ SOUTH ]->m_to[ EAST ]) diff --git a/regamedll/game_shared/bot/nav_node.h b/regamedll/game_shared/bot/nav_node.h index c89329e6..f0dcf129 100644 --- a/regamedll/game_shared/bot/nav_node.h +++ b/regamedll/game_shared/bot/nav_node.h @@ -32,14 +32,6 @@ #pragma once #endif -#ifdef HOOK_GAMEDLL - -#define Opposite (*pOpposite) - -#endif // HOOK_GAMEDLL - -extern NavDirType Opposite[ NUM_DIRECTIONS ]; - class CNavNode { public: @@ -50,66 +42,37 @@ public: // get navigation node connected in given direction, or NULL if cant go that way CNavNode *GetConnectedNode(NavDirType dir) const; - const Vector *GetPosition(void) const; - const Vector *GetNormal(void) const - { - return &m_normal; - } - unsigned int GetID(void) const - { - return m_id; - } + const Vector *GetPosition() const; + const Vector *GetNormal() const { return &m_normal; } + unsigned int GetID() const { return m_id; } - static CNavNode *GetFirst(void) - { - return IMPL(m_list); - } - static unsigned int GetListLength(void) - { - return IMPL(m_listLength); - } - CNavNode *GetNext(void) - { - return m_next; - } + static CNavNode *GetFirst() { return IMPL(m_list); } + static unsigned int GetListLength() { return IMPL(m_listLength); } + + CNavNode *GetNext() { return m_next; } // create a connection FROM this node TO the given node, in the given direction void ConnectTo(CNavNode *node, NavDirType dir); - CNavNode *GetParent(void) const; + CNavNode *GetParent() const; void MarkAsVisited(NavDirType dir); // mark the given direction as having been visited BOOL HasVisited(NavDirType dir); // return TRUE if the given direction has already been searched BOOL IsBiLinked(NavDirType dir) const; // node is bidirectionally linked to another node in the given direction - BOOL IsClosedCell(void) const; // node is the NW corner of a bi-linked quad of nodes + BOOL IsClosedCell() const; // node is the NW corner of a bi-linked quad of nodes - // TODO: Should pass in area that is covering - void Cover(void) - { - m_isCovered = true; - } - // return true if this node has been covered by an area - BOOL IsCovered(void) const - { - return m_isCovered; - } + void Cover() { m_isCovered = true; } // TODO: Should pass in area that is covering + BOOL IsCovered() const { return m_isCovered; } // return true if this node has been covered by an area - // assign the given area to this node - void AssignArea(CNavArea *area); + void AssignArea(CNavArea *area); // assign the given area to this node + CNavArea *GetArea() const; // return associated area - // return associated area - CNavArea *GetArea(void) const; - - void SetAttributes(unsigned char bits) - { - m_attributeFlags = bits; - } - unsigned char GetAttributes(void) const - { - return m_attributeFlags; - } + void SetAttributes(unsigned char bits) { m_attributeFlags = bits; } + unsigned char GetAttributes() const { return m_attributeFlags; } +#ifndef HOOK_GAMEDLL private: - friend void DestroyNavigationMap(void); +#endif // HOOK_GAMEDLL + friend void DestroyNavigationMap(); Vector m_pos; // position of this node in the world Vector m_normal; // surface normal at this location @@ -117,14 +80,9 @@ private: unsigned int m_id; // unique ID of this node unsigned char m_attributeFlags; // set of attribute bit flags (see NavAttributeType) -#ifdef HOOK_GAMEDLL -public: -#endif // HOOK_GAMEDLL static CNavNode *IMPL(m_list); // the master list of all nodes for this map static unsigned int IMPL(m_listLength); -#ifdef HOOK_GAMEDLL -private: -#endif // HOOK_GAMEDLL + CNavNode *m_next; // next link in master list // below are only needed when generating @@ -133,8 +91,7 @@ private: CNavNode *m_parent; // the node prior to this in the search, which we pop back to when this node's search is done (a stack) BOOL m_isCovered; // true when this node is "covered" by a CNavArea CNavArea *m_area; // the area this node is contained within - -};/* size: 68, cachelines: 2, members: 12 */ +}; /* <4c0577> ../game_shared/bot/nav_node.h:74 */ inline CNavNode *CNavNode::GetConnectedNode(NavDirType dir) const @@ -143,13 +100,13 @@ inline CNavNode *CNavNode::GetConnectedNode(NavDirType dir) const } /* <4c05ba> ../game_shared/bot/nav_node.h:79 */ -inline const Vector *CNavNode::GetPosition(void) const +inline const Vector *CNavNode::GetPosition() const { return &m_pos; } /* <3434df> ../game_shared/bot/nav_node.h:84 */ -inline CNavNode *CNavNode::GetParent(void) const +inline CNavNode *CNavNode::GetParent() const { return m_parent; } @@ -176,7 +133,7 @@ inline void CNavNode::AssignArea(CNavArea *area) } /* <4bfdde> ../game_shared/bot/nav_node.h:107 */ -inline CNavArea *CNavNode::GetArea(void) const +inline CNavArea *CNavNode::GetArea() const { return m_area; } diff --git a/regamedll/game_shared/bot/nav_path.cpp b/regamedll/game_shared/bot/nav_path.cpp index f1a37acd..c3990a18 100644 --- a/regamedll/game_shared/bot/nav_path.cpp +++ b/regamedll/game_shared/bot/nav_path.cpp @@ -3,7 +3,7 @@ // Determine actual path positions /* <505025> ../game_shared/bot/nav_path.cpp:24 */ -bool CNavPath::ComputePathPositions(void) +bool CNavPath::ComputePathPositions() { if (m_segmentCount == 0) return false; @@ -138,7 +138,7 @@ bool CNavPath::IsAtEnd(const Vector &pos) const // Return length of path from start to finish /* <5052f6> ../game_shared/bot/nav_path.cpp:161 */ -float CNavPath::GetLength(void) const +float CNavPath::GetLength() const { float length = 0.0f; for (int i = 1; i < GetSegmentCount(); ++i) @@ -310,7 +310,7 @@ bool CNavPath::BuildTrivialPath(const Vector *start, const Vector *goal) // Draw the path for debugging /* <505853> ../game_shared/bot/nav_path.cpp:340 */ -void CNavPath::Draw(void) +void CNavPath::Draw() { if (!IsValid()) return; @@ -363,7 +363,7 @@ int CNavPath::FindNextOccludedNode(int anchor_) // Smooth out path, removing redundant nodes /* <505c26> ../game_shared/bot/nav_path.cpp:396 */ -void CNavPath::Optimize(void) +void CNavPath::Optimize() { // DONT USE THIS: Optimizing the path results in cutting thru obstacles #if 0 @@ -396,7 +396,7 @@ void CNavPath::Optimize(void) } /* <505c6d> ../game_shared/bot/nav_path.cpp:436 */ -CNavPathFollower::CNavPathFollower(void) +CNavPathFollower::CNavPathFollower() { m_improv = NULL; m_path = NULL; @@ -408,7 +408,7 @@ CNavPathFollower::CNavPathFollower(void) } /* <505cce> ../game_shared/bot/nav_path.cpp:447 */ -void CNavPathFollower::Reset(void) +void CNavPathFollower::Reset() { m_segmentIndex = 1; m_isLadderStarted = false; @@ -1038,7 +1038,7 @@ void CNavPathFollower::FeelerReflexAdjustment(Vector *goalPosition, float height // Reset the stuck-checker /* <507a31> ../game_shared/bot/nav_path.cpp:1098 */ -CStuckMonitor::CStuckMonitor(void) +CStuckMonitor::CStuckMonitor() { m_isStuck = false; m_avgVelIndex = 0; @@ -1048,7 +1048,7 @@ CStuckMonitor::CStuckMonitor(void) // Reset the stuck-checker /* <507a73> ../game_shared/bot/nav_path.cpp:1108 */ -void CStuckMonitor::Reset(void) +void CStuckMonitor::Reset() { m_isStuck = false; m_avgVelIndex = 0; diff --git a/regamedll/game_shared/bot/nav_path.h b/regamedll/game_shared/bot/nav_path.h index 49bb27bf..77b9c91b 100644 --- a/regamedll/game_shared/bot/nav_path.h +++ b/regamedll/game_shared/bot/nav_path.h @@ -39,10 +39,7 @@ class CNavPath { public: - CNavPath(void) - { - m_segmentCount = 0; - } + CNavPath() { m_segmentCount = 0; } struct PathSegment { @@ -52,43 +49,27 @@ public: const CNavLadder *ladder; // if "how" refers to a ladder, this is it }; - const PathSegment *operator[](int i) - { - return (i >= 0 && i < m_segmentCount) ? &m_path[i] : NULL; - } - - int GetSegmentCount(void) const - { - return m_segmentCount; - } - const Vector &GetEndpoint(void) const - { - return m_path[ m_segmentCount - 1 ].pos; - } + const PathSegment *operator[](int i) { return (i >= 0 && i < m_segmentCount) ? &m_path[i] : NULL; } + int GetSegmentCount() const { return m_segmentCount; } + const Vector &GetEndpoint() const { return m_path[ m_segmentCount - 1 ].pos; } bool IsAtEnd(const Vector &pos) const; // return true if position is at the end of the path - float GetLength(void) const; // return length of path from start to finish + float GetLength() const; // return length of path from start to finish NOXREF bool GetPointAlongPath(float distAlong, Vector *pointOnPath) const; // return point a given distance along the path - if distance is out of path bounds, point is clamped to start/end - /// return the node index closest to the given distance along the path without going over - returns (-1) if error + // return the node index closest to the given distance along the path without going over - returns (-1) if error int GetSegmentIndexAlongPath(float distAlong) const; - bool IsValid(void) const - { - return (m_segmentCount > 0); - } - void Invalidate(void) - { - m_segmentCount = 0; - } + bool IsValid() const { return (m_segmentCount > 0); } + void Invalidate() { m_segmentCount = 0; } // draw the path for debugging - void Draw(void); + void Draw(); - /// compute closest point on path to given point + // compute closest point on path to given point NOXREF bool FindClosestPointOnPath(const Vector *worldPos, int startIndex, int endIndex, Vector *close) const; - void Optimize(void); + void Optimize(); // Compute shortest path from 'start' to 'goal' via A* algorithm template @@ -169,43 +150,29 @@ public: return true; } - +#ifndef HOOK_GAMEDLL private: +#endif // HOOK_GAMEDLL enum { MAX_PATH_SEGMENTS = 256 }; - PathSegment m_path[ MAX_PATH_SEGMENTS ]; int m_segmentCount; -#ifdef HOOK_GAMEDLL -public: -#endif // HOOK_GAMEDLL - // determine actual path positions - bool ComputePathPositions(void); - // utility function for when start and goal are in the same area - bool BuildTrivialPath(const Vector *start, const Vector *goal); - - // used by Optimize() - int FindNextOccludedNode(int anchor_); - -};/* size: 6148, cachelines: 97, members: 2 */ - + bool ComputePathPositions(); // determine actual path positions + bool BuildTrivialPath(const Vector *start, const Vector *goal); // utility function for when start and goal are in the same area + int FindNextOccludedNode(int anchor_); // used by Optimize() +}; // Monitor improv movement and determine if it becomes stuck class CStuckMonitor { public: - CStuckMonitor(void); + CStuckMonitor(); - void Reset(void); + void Reset(); void Update(CImprov *improv); - bool IsStuck(void) const - { - return m_isStuck; - } - float GetDuration(void) const - { - return m_isStuck ? m_stuckTimer.GetElapsedTime() : 0.0f; - } + + bool IsStuck() const { return m_isStuck; } + float GetDuration() const { return m_isStuck ? m_stuckTimer.GetElapsedTime() : 0.0f; } private: bool m_isStuck; // if true, we are stuck @@ -219,67 +186,41 @@ private: int m_avgVelCount; Vector m_lastCentroid; float m_lastTime; - -};/* size: 64, cachelines: 1, members: 8 */ +}; // The CNavPathFollower class implements path following behavior class CNavPathFollower { public: - CNavPathFollower(void); + CNavPathFollower(); - void SetImprov(CImprov *improv) - { - m_improv = improv; - } - void SetPath(CNavPath *path) - { - m_path = path; - } - void Reset(void); + void SetImprov(CImprov *improv) { m_improv = improv; } + void SetPath(CNavPath *path) { m_path = path; } + void Reset(); - // move improv along path - void Update(float deltaT, bool avoidObstacles = true); + void Update(float deltaT, bool avoidObstacles = true); // move improv along path + void Debug(bool status) { m_isDebug = status; } // turn debugging on/off - // turn debugging on/off - void Debug(bool status) - { - m_isDebug = status; - } - // return true if improv is stuck - bool IsStuck(void) const - { - return m_stuckMonitor.IsStuck(); - } - void ResetStuck(void) - { - m_stuckMonitor.Reset(); - } - // return how long we've been stuck - float GetStuckDuration(void) const - { - return m_stuckMonitor.GetDuration(); - } - // adjust goal position if "feelers" are touched - void FeelerReflexAdjustment(Vector *goalPosition, float height = -1.0f); + bool IsStuck() const { return m_stuckMonitor.IsStuck(); } // return true if improv is stuck + void ResetStuck() { m_stuckMonitor.Reset(); } + float GetStuckDuration() const { return m_stuckMonitor.GetDuration(); } // return how long we've been stuck -#ifdef HOOK_GAMEDLL -public: -#else + void FeelerReflexAdjustment(Vector *goalPosition, float height = -1.0f); // adjust goal position if "feelers" are touched + +#ifndef HOOK_GAMEDLL private: #endif // HOOK_GAMEDLL int FindOurPositionOnPath(Vector *close, bool local) const; // return the closest point to our current position on current path int FindPathPoint(float aheadRange, Vector *point, int *prevIndex); // compute a point a fixed distance ahead along our path. - CImprov *m_improv; // who is doing the path following - CNavPath *m_path; // the path being followed - int m_segmentIndex; // the point on the path the improv is moving towards - int m_behindIndex; // index of the node on the path just behind us - Vector m_goal; // last computed follow goal + CImprov *m_improv; // who is doing the path following + CNavPath *m_path; // the path being followed + int m_segmentIndex; // the point on the path the improv is moving towards + int m_behindIndex; // index of the node on the path just behind us + Vector m_goal; // last computed follow goal bool m_isLadderStarted; bool m_isDebug; CStuckMonitor m_stuckMonitor; - -};/* size: 96, cachelines: 2, members: 8 */ +}; #endif // NAV_PATH_H diff --git a/regamedll/game_shared/bot/simple_state_machine.h b/regamedll/game_shared/bot/simple_state_machine.h index e085a59c..9f621914 100644 --- a/regamedll/game_shared/bot/simple_state_machine.h +++ b/regamedll/game_shared/bot/simple_state_machine.h @@ -39,22 +39,19 @@ template class SimpleState { public: - SimpleState(void) - { - m_parent = NULL; - } + SimpleState() { m_parent = NULL; } virtual ~SimpleState() {}; virtual void OnEnter(T userData) {}; // when state is entered virtual void OnUpdate(T userData) {}; // state behavior virtual void OnExit(T userData) {}; // when state exited - virtual const char *GetName(void) const = 0; // return state name + virtual const char *GetName() const = 0; // return state name void SetParent(SimpleState *parent) { m_parent = parent; } - SimpleState *GetParent(void) const + SimpleState *GetParent() const { return m_parent; } @@ -71,7 +68,7 @@ template class SimpleStateMachine { public: - SimpleStateMachine(void) + SimpleStateMachine() { m_state = NULL; } @@ -92,7 +89,7 @@ public: m_stateTimer.Start(); } // how long have we been in the current state - float GetStateDuration(void) const + float GetStateDuration() const { return m_stateTimer.GetElapsedTime(); } @@ -102,13 +99,13 @@ public: return (state == m_state); } // execute current state of machine - void Update(void) + void Update() { if (m_state) m_state->OnUpdate(m_userData); } -protected: +/*protected:*/ S *m_state; // current behavior state IntervalTimer m_stateTimer; // how long have we been in the current state T m_userData; diff --git a/regamedll/game_shared/perf_counter.h b/regamedll/game_shared/perf_counter.h index 3b7b5c7c..e8ff2a36 100644 --- a/regamedll/game_shared/perf_counter.h +++ b/regamedll/game_shared/perf_counter.h @@ -58,21 +58,20 @@ class CPerformanceCounter { public: - CPerformanceCounter(void); + CPerformanceCounter(); - void InitializePerformanceCounter(void); - double GetCurTime(void); + void InitializePerformanceCounter(); + double GetCurTime(); private: int m_iLowShift; double m_flPerfCounterFreq; double m_flCurrentTime; double m_flLastCurrentTime; - -};/* size: 28, cachelines: 1, members: 4 */ +}; /* <2ebfc> ../game_shared/perf_counter.h:61 */ -inline CPerformanceCounter::CPerformanceCounter(void) : +inline CPerformanceCounter::CPerformanceCounter() : m_iLowShift(0), m_flPerfCounterFreq(0), m_flCurrentTime(0), @@ -82,7 +81,7 @@ inline CPerformanceCounter::CPerformanceCounter(void) : } /* <2ebdd> ../game_shared/perf_counter.h:69 */ -inline void CPerformanceCounter::InitializePerformanceCounter(void) +inline void CPerformanceCounter::InitializePerformanceCounter() { #ifdef _WIN32 @@ -110,7 +109,7 @@ inline void CPerformanceCounter::InitializePerformanceCounter(void) } /* <2ec16> ../game_shared/perf_counter.h:97 */ -inline double CPerformanceCounter::GetCurTime(void) +inline double CPerformanceCounter::GetCurTime() { #ifdef _WIN32 diff --git a/regamedll/game_shared/shared_util.cpp b/regamedll/game_shared/shared_util.cpp index fae039b7..183dd6e8 100644 --- a/regamedll/game_shared/shared_util.cpp +++ b/regamedll/game_shared/shared_util.cpp @@ -5,13 +5,8 @@ */ #ifndef HOOK_GAMEDLL -static char s_shared_token[ 1500 ]; -static char s_shared_quote = '\"'; - -#else - -char s_shared_token[ 1500 ]; -char s_shared_quote; +char s_shared_token[ COM_TOKEN_LEN ]; +char s_shared_quote = '\"'; #endif // HOOK_GAMEDLL @@ -92,7 +87,7 @@ NOXREF const wchar_t *NumAsWString(int val) const int NumBuffers = 4; static wchar_t string[NumBuffers][BufLen]; static int curstring = 0; - + curstring = (curstring + 1) % NumBuffers; int len = BufLen; @@ -120,7 +115,7 @@ const char *NumAsString(int val) // Returns the token parsed by SharedParse() /* <2d4da4> ../game_shared/shared_util.cpp:155 */ -char *SharedGetToken(void) +char *SharedGetToken() { return s_shared_token; } diff --git a/regamedll/game_shared/shared_util.h b/regamedll/game_shared/shared_util.h index 01494724..f3b548e6 100644 --- a/regamedll/game_shared/shared_util.h +++ b/regamedll/game_shared/shared_util.h @@ -37,23 +37,13 @@ #include #endif // _WIN32 -#ifdef HOOK_GAMEDLL - -#define s_shared_token (*ps_shared_token) -#define s_shared_quote (*ps_shared_quote) - -#endif // HOOK_GAMEDLL - -extern char s_shared_token[ 1500 ]; -extern char s_shared_quote; - NOXREF wchar_t *SharedWVarArgs(wchar_t *format, ...); char *SharedVarArgs(char *format, ...); char *BufPrintf(char *buf, int &len, const char *fmt, ...); NOXREF wchar_t *BufWPrintf(wchar_t *buf, int &len, const wchar_t *fmt, ...); NOXREF const wchar_t *NumAsWString(int val); const char *NumAsString(int val); -char *SharedGetToken(void); +char *SharedGetToken(); NOXREF void SharedSetQuoteChar(char c); const char *SharedParse(const char *data); NOXREF bool SharedTokenWaiting(const char *buffer); diff --git a/regamedll/game_shared/steam_util.h b/regamedll/game_shared/steam_util.h index af6b6439..e0969fd6 100644 --- a/regamedll/game_shared/steam_util.h +++ b/regamedll/game_shared/steam_util.h @@ -36,12 +36,9 @@ class SteamFile { public: SteamFile(const char *filename); - ~SteamFile(void); + ~SteamFile(); - bool IsValid(void) const - { - return (m_fileData) ? true : false; - } + bool IsValid() const { return (m_fileData) ? true : false; } bool Read(void *data, int length); private: @@ -50,8 +47,7 @@ private: byte *m_cursor; int m_bytesLeft; - -};/* size: 16, cachelines: 1, members: 4 */ +}; /* <4eb7b4> ../game_shared/steam_util.h:29 */ inline SteamFile::SteamFile(const char *filename) @@ -62,7 +58,7 @@ inline SteamFile::SteamFile(const char *filename) } /* <4eb65d> ../game_shared/steam_util.h:36 */ -inline SteamFile::~SteamFile(void) +inline SteamFile::~SteamFile() { if (m_fileData) FREE_FILE(m_fileData); @@ -75,11 +71,12 @@ inline bool SteamFile::Read(void *data, int length) return false; byte *readCursor = static_cast(data); - for (int i = 0; i < length; i++) + for (int i = 0; i < length; ++i) { *readCursor++ = *m_cursor++; --m_bytesLeft; } + return true; } diff --git a/regamedll/game_shared/voice_gamemgr.cpp b/regamedll/game_shared/voice_gamemgr.cpp index d001597e..5a1df504 100644 --- a/regamedll/game_shared/voice_gamemgr.cpp +++ b/regamedll/game_shared/voice_gamemgr.cpp @@ -8,11 +8,6 @@ cvar_t voice_serverdebug = { "voice_serverdebug", "0", 0, 0.0f, NULL }; cvar_t sv_alltalk = { "sv_alltalk", "0", FCVAR_SERVER, 0.0f, NULL }; -#else - -cvar_t voice_serverdebug; -cvar_t sv_alltalk; - #endif // HOOK_GAMEDLL CPlayerBitVec g_PlayerModEnable; @@ -38,14 +33,14 @@ void VoiceServerDebug(const char *pFmt, ...) } /* <2d3cd1> ../game_shared/voice_gamemgr.cpp:89 */ -CVoiceGameMgr::CVoiceGameMgr(void) +CVoiceGameMgr::CVoiceGameMgr() { m_UpdateInterval = 0; m_nMaxPlayers = 0; } /* <2d3c98> ../game_shared/voice_gamemgr.cpp:96 */ -CVoiceGameMgr::~CVoiceGameMgr(void) +CVoiceGameMgr::~CVoiceGameMgr() { ; } @@ -72,7 +67,7 @@ bool CVoiceGameMgr::Init(IVoiceGameMgrHelper *pHelper, int maxClients) } /* <2d3d4e> ../game_shared/voice_gamemgr.cpp:123 */ -NOXREF void CVoiceGameMgr::SetHelper(IVoiceGameMgrHelper *pHelper) +void CVoiceGameMgr::SetHelper(IVoiceGameMgrHelper *pHelper) { m_pHelper = pHelper; } @@ -163,7 +158,7 @@ bool CVoiceGameMgr::ClientCommand(CBasePlayer *pPlayer, const char *cmd) } /* <2d416b> ../game_shared/voice_gamemgr.cpp:215 */ -void CVoiceGameMgr::UpdateMasks(void) +void CVoiceGameMgr::UpdateMasks() { m_UpdateInterval = 0; diff --git a/regamedll/game_shared/voice_gamemgr.h b/regamedll/game_shared/voice_gamemgr.h index 976fb1c1..a414e5e4 100644 --- a/regamedll/game_shared/voice_gamemgr.h +++ b/regamedll/game_shared/voice_gamemgr.h @@ -36,45 +36,22 @@ #include "voice_common.h" -#ifdef HOOK_GAMEDLL - -#define voice_serverdebug (*pvoice_serverdebug) -#define sv_alltalk (*psv_alltalk) - -#define g_PlayerModEnable (*pg_PlayerModEnable) -#define g_BanMasks (*pg_BanMasks) -#define g_SentGameRulesMasks (*pg_SentGameRulesMasks) -#define g_SentBanMasks (*pg_SentBanMasks) -#define g_bWantModEnable (*pg_bWantModEnable) - -#endif // HOOK_GAMEDLL - -extern cvar_t voice_serverdebug; -extern cvar_t sv_alltalk; - -extern CPlayerBitVec g_PlayerModEnable; -extern CBitVec< VOICE_MAX_PLAYERS > g_BanMasks[ VOICE_MAX_PLAYERS ]; -extern CBitVec< VOICE_MAX_PLAYERS > g_SentGameRulesMasks[ VOICE_MAX_PLAYERS ]; -extern CBitVec< VOICE_MAX_PLAYERS > g_SentBanMasks[ VOICE_MAX_PLAYERS ]; -extern CPlayerBitVec g_bWantModEnable; - /* <111716> ../game_shared/voice_gamemgr.h:23 */ class IVoiceGameMgrHelper { public: virtual ~IVoiceGameMgrHelper() {} virtual bool CanPlayerHearPlayer(CBasePlayer *pListener, CBasePlayer *pTalker) = 0; - -};/* size: 4, cachelines: 1, members: 1 */ +}; class CVoiceGameMgr { public: - CVoiceGameMgr(void); - virtual ~CVoiceGameMgr(void); + CVoiceGameMgr(); + virtual ~CVoiceGameMgr(); bool Init(IVoiceGameMgrHelper *pHelper, int maxClients); - NOXREF void SetHelper(IVoiceGameMgrHelper *pHelper); + void SetHelper(IVoiceGameMgrHelper *pHelper); void Update(double frametime); void ClientConnected(edict_t *pEdict); bool ClientCommand(CBasePlayer *pPlayer, const char *cmd); @@ -84,7 +61,7 @@ public: private: #endif // HOOK_GAMEDLL - void UpdateMasks(void); + void UpdateMasks(); private: int m_msgPlayerVoiceMask; @@ -92,8 +69,7 @@ private: IVoiceGameMgrHelper *m_pHelper; int m_nMaxPlayers; double m_UpdateInterval; - -};/* size: 28, cachelines: 1, members: 6 */ +}; void VoiceServerDebug(const char *pFmt, ...); diff --git a/regamedll/hookers/6153_hooker.cpp b/regamedll/hookers/6153_hooker.cpp index 84afba3e..98ab30a6 100644 --- a/regamedll/hookers/6153_hooker.cpp +++ b/regamedll/hookers/6153_hooker.cpp @@ -2215,10 +2215,10 @@ FunctionHook g_FunctionHooks[] = //virtual func //{ 0x01DD1750, "_ZN7CCorpse10ObjectCapsEv", mfunc_ptr_cast(&CCorpse::ObjectCaps_) }, // DEFAULT //non-virtual func - { 0x01DD1420, "_ZN6CDecal5SpawnEv", mfunc_ptr_cast(&CDecal::Spawn_) }, - { 0x01DD15C0, "_ZN6CDecal11StaticDecalEv", mfunc_ptr_cast(&CDecal::StaticDecal) }, - { 0x01DD1490, "_ZN6CDecal12TriggerDecalEP11CBaseEntityS1_8USE_TYPEf", mfunc_ptr_cast(&CDecal::TriggerDecal) }, - { 0x01DD1690, "_ZN6CDecal8KeyValueEP14KeyValueData_s", mfunc_ptr_cast(&CDecal::KeyValue_) }, + //{ 0x01DD1420, "_ZN6CDecal5SpawnEv", mfunc_ptr_cast(&CDecal::Spawn_) }, // DEFAULT + //{ 0x01DD15C0, "_ZN6CDecal11StaticDecalEv", mfunc_ptr_cast(&CDecal::StaticDecal) }, // DEFAULT + //{ 0x01DD1490, "_ZN6CDecal12TriggerDecalEP11CBaseEntityS1_8USE_TYPEf", mfunc_ptr_cast(&CDecal::TriggerDecal) }, // DEFAULT + //{ 0x01DD1690, "_ZN6CDecal8KeyValueEP14KeyValueData_s", mfunc_ptr_cast(&CDecal::KeyValue_) }, // DEFAULT //{ 0x01DD1760, "_Z13CopyToBodyQueP9entvars_s", (size_t)&CopyToBodyQue }, // PURE //{ 0x01DD1770, "_Z12ClearBodyQuev", (size_t)&ClearBodyQue }, // NOXREF //{ 0x01DD1780, "_ZN12CGlobalStateC2Ev", mfunc_ptr_cast(&CGlobalState__CGlobalState) }, @@ -2399,8 +2399,8 @@ FunctionHook g_FunctionHooks[] = { 0x01DC3D30, "_Z20UTIL_ShowMessageArgsPKcP11CBaseEntityP10CUtlVectorIPcEb", (size_t)&UTIL_ShowMessageArgs }, { 0x01DC3E20, "_Z16UTIL_ShowMessagePKcP11CBaseEntityb", (size_t)&UTIL_ShowMessage }, { 0x01DC3E80, "_Z19UTIL_ShowMessageAllPKcb", (size_t)&UTIL_ShowMessageAll }, - { 0x01DC3F30, "_Z14UTIL_TraceLineRK6VectorS1_15IGNORE_MONSTERS12IGNORE_GLASSP7edict_sP11TraceResult", mfunc_ptr_cast(&UTIL_TraceLine) }, - { 0x01DC3F70, "_Z14UTIL_TraceLineRK6VectorS1_15IGNORE_MONSTERSP7edict_sP11TraceResult", mfunc_ptr_cast(&UTIL_TraceLine) }, + { 0x01DC3F30, "_Z14UTIL_TraceLineRK6VectorS1_15IGNORE_MONSTERS12IGNORE_GLASSP7edict_sP11TraceResult", mfunc_ptr_cast(&UTIL_TraceLine) }, + { 0x01DC3F70, "_Z14UTIL_TraceLineRK6VectorS1_15IGNORE_MONSTERSP7edict_sP11TraceResult", mfunc_ptr_cast(&UTIL_TraceLine) }, { 0x01DC3F90, "_Z14UTIL_TraceHullRK6VectorS1_15IGNORE_MONSTERSiP7edict_sP11TraceResult", (size_t)&UTIL_TraceHull }, { 0x01DC3FB0, "_Z15UTIL_TraceModelRK6VectorS1_iP7edict_sP11TraceResult", (size_t)&UTIL_TraceModel }, //{ 0x01DC3FC0, "_Z19UTIL_GetGlobalTracev", (size_t)&UTIL_GetGlobalTrace }, // NOXREF @@ -3629,26 +3629,27 @@ FunctionHook g_FunctionHooks[] = #ifndef CUtlSymbol_Region - //{ 0x0, "_ZN10CUtlSymbolC2EPKc", mfunc_ptr_cast(&CUtlSymbol::CUtlSymbol) }, - //{ 0x0, "_ZN10CUtlSymbol10InitializeEv", mfunc_ptr_cast(&CUtlSymbol::Initialize) }, - //{ 0x0, "_ZN10CUtlSymbol9CurrTableEv", mfunc_ptr_cast(&CUtlSymbol::CurrTable) }, - //{ 0x0, "_ZNK10CUtlSymbol6StringEv", mfunc_ptr_cast(&CUtlSymbol::String) }, + //{ 0x01DC81F0, "_ZN10CUtlSymbolC2EPKc", mfunc_ptr_cast(&CUtlSymbol::CUtlSymbol) }, + //{ 0x01DC80D0, "_ZN10CUtlSymbol10InitializeEv", mfunc_ptr_cast(&CUtlSymbol::Initialize) }, + //{ 0x01DC8160, "_ZN10CUtlSymbol9CurrTableEv", mfunc_ptr_cast(&CUtlSymbol::CurrTable) }, + //{ 0x01DC82A0, "_ZNK10CUtlSymbol6StringEv", mfunc_ptr_cast(&CUtlSymbol::String) }, + //{ 0x01DC82E0, "_ZNK10CUtlSymboleqEPKc", mfunc_ptr_cast(&CUtlSymbol::operator==) }, //{ 0x01DC8390, "_ZN15CUtlSymbolTable7SymLessERKjS1_", mfunc_ptr_cast(&CUtlSymbolTable::SymLess) }, //{ 0x01DC8410, "_ZN15CUtlSymbolTable8SymLessiERKjS1_", mfunc_ptr_cast(&CUtlSymbolTable::SymLessi) }, //{ 0x01DC8460, "_ZN15CUtlSymbolTableC2Eiib", mfunc_ptr_cast(&CUtlSymbolTable::CUtlSymbolTable) }, // NOXREF //{ 0x01DC84D0, "_ZN15CUtlSymbolTableD2Ev", mfunc_ptr_cast(&CUtlSymbolTable::~CUtlSymbolTable) }, // NOXREF //{ 0x01DC8540, "_ZN15CUtlSymbolTable4FindEPKc", mfunc_ptr_cast(&CUtlSymbolTable::Find) }, // NOXREF - //{ 0x0, "_ZNK15CUtlSymbolTable6StringE10CUtlSymbol", mfunc_ptr_cast(&CUtlSymbolTable::String) }, - //{ 0x0, "_ZN15CUtlSymbolTable9RemoveAllEv", mfunc_ptr_cast(&CUtlSymbolTable::RemoveAll) }, - //{ 0x0, "_ZN15CUtlSymbolTable9AddStringEPKc", mfunc_ptr_cast(&CUtlSymbolTable::AddString) }, + //{ 0x01DC87D0, "_ZNK15CUtlSymbolTable6StringE10CUtlSymbol", mfunc_ptr_cast(&CUtlSymbolTable::String) }, + //{ 0x01DC8800, "_ZN15CUtlSymbolTable9RemoveAllEv", mfunc_ptr_cast(&CUtlSymbolTable::RemoveAll) }, + //{ 0x01DC8680, "_ZN15CUtlSymbolTable9AddStringEPKc", mfunc_ptr_cast(&CUtlSymbolTable::AddString) }, #endif // CUtlSymbol_Region #ifndef Debug_Region //{ 0x0, "", (size_t)&IsDeveloper }, // NOXREF - //{ 0x01D732D0, "_Z12UTIL_DPrintf15DebugOutputTypePcz", mfunc_ptr_cast(&UTIL_DPrintf) }, // NOXREF - { 0x01D73320, "_Z12UTIL_DPrintfPcz", mfunc_ptr_cast(&UTIL_DPrintf) }, + //{ 0x01D732D0, "_Z12UTIL_DPrintf15DebugOutputTypePcz", mfunc_ptr_cast(&UTIL_DPrintf) }, // NOXREF + { 0x01D73320, "_Z12UTIL_DPrintfPcz", mfunc_ptr_cast(&UTIL_DPrintf) }, //{ 0x01D73360, "_Z20UTIL_SetDprintfFlagsPKc", (size_t)&PrintDebugFlags }, // NOXREF //{ 0x0, "_ZL12SetDebugFlagPKcb", (size_t)&SetDebugFlag }, // NOXREF //{ 0x0, "_Z14PrintDebugFlagPKc", (size_t)&PrintDebugFlag }, // NOXREF @@ -3702,10 +3703,10 @@ FunctionHook g_FunctionHooks[] = //{ 0x0, "_ZN13CCSBotManager18AckAnalysisRequestEv", mfunc_ptr_cast(&CCSBotManager::AckAnalysisRequest) }, //{ 0x0, "_ZN13CCSBotManager18GetDifficultyLevelEv", mfunc_ptr_cast(&CCSBotManager::BotDifficultyType GetDifficultyLevel) }, //{ 0x0, "_ZNK13CCSBotManager11GetScenarioEv", mfunc_ptr_cast(&CCSBotManager::GameScenarioType GetScenario) }, - //{ 0x0, "_ZNK13CCSBotManager7GetZoneEi", mfunc_ptr_cast(&CCSBotManager::GetZone) }, // NOXREF - { 0x01D25530, "_ZNK13CCSBotManager7GetZoneEPK6Vector", mfunc_ptr_cast(&CCSBotManager::GetZone) }, - { 0x01D255C0, "_ZNK13CCSBotManager14GetClosestZoneEPK6Vector", mfunc_ptr_cast(&CCSBotManager::GetClosestZone) }, - //{ 0x0, "_ZNK13CCSBotManager14GetClosestZoneEPK11CBaseEntity", mfunc_ptr_cast(&CCSBotManager::GetClosestZone) }, + //{ 0x0, "_ZNK13CCSBotManager7GetZoneEi", mfunc_ptr_cast(&CCSBotManager::GetZone) }, // NOXREF + { 0x01D25530, "_ZNK13CCSBotManager7GetZoneEPK6Vector", mfunc_ptr_cast(&CCSBotManager::GetZone) }, + { 0x01D255C0, "_ZNK13CCSBotManager14GetClosestZoneEPK6Vector", mfunc_ptr_cast(&CCSBotManager::GetClosestZone) }, + //{ 0x0, "_ZNK13CCSBotManager14GetClosestZoneEPK11CBaseEntity", mfunc_ptr_cast(&CCSBotManager::GetClosestZone) }, //{ 0x0, "_ZNK13CCSBotManager12GetZoneCountEv", mfunc_ptr_cast(&CCSBotManager::GetZoneCount) }, { 0x01D25630, "_ZNK13CCSBotManager23GetRandomPositionInZoneEPKNS_4ZoneE", mfunc_ptr_cast(&CCSBotManager::GetRandomPositionInZone) }, { 0x01D25750, "_ZNK13CCSBotManager19GetRandomAreaInZoneEPKNS_4ZoneE", mfunc_ptr_cast(&CCSBotManager::GetRandomAreaInZone) }, @@ -4299,8 +4300,8 @@ FunctionHook g_FunctionHooks[] = //{ 0x01D1A830, "_ZNK16BotPhraseManager8NameToIDEPKc", mfunc_ptr_cast(&BotPhraseManager::NameToID) }, //{ 0x01D1A8A0, "_ZNK16BotPhraseManager8IDToNameEj", mfunc_ptr_cast(&BotPhraseManager::IDToName) }, { 0x01D1A8F0, "_ZNK16BotPhraseManager9GetPhraseEPKc", mfunc_ptr_cast(&BotPhraseManager::GetPhrase) }, - //{ 0x01D1A940, "_ZNK16BotPhraseManager8GetPlaceEPKc", mfunc_ptr_cast(&BotPhraseManager::GetPlace) }, // NOXREF - { 0x01D1A990, "_ZNK16BotPhraseManager8GetPlaceEj", mfunc_ptr_cast(&BotPhraseManager::GetPlace) }, + //{ 0x01D1A940, "_ZNK16BotPhraseManager8GetPlaceEPKc", mfunc_ptr_cast(&BotPhraseManager::GetPlace) }, // NOXREF + { 0x01D1A990, "_ZNK16BotPhraseManager8GetPlaceEj", mfunc_ptr_cast(&BotPhraseManager::GetPlace) }, //{ 0x0, "_ZNK16BotPhraseManager12GetPlaceListEv", mfunc_ptr_cast(&BotPhraseManager::GetPlaceList) }, //{ 0x0, "_ZNK16BotPhraseManager25GetPlaceStatementIntervalEj", mfunc_ptr_cast(&BotPhraseManager::GetPlaceStatementInterval) }, //{ 0x0, "_ZN16BotPhraseManager27ResetPlaceStatementIntervalEj", mfunc_ptr_cast(&BotPhraseManager::ResetPlaceStatementInterval) }, @@ -4324,8 +4325,8 @@ FunctionHook g_FunctionHooks[] = //{ 0x0, "_ZNK12BotStatement10GetSubjectEv", mfunc_ptr_cast(&BotStatement::GetSubject) }, // NOXREF //{ 0x01D1AC90, "_ZNK12BotStatement10IsObsoleteEv", mfunc_ptr_cast(&BotStatement::IsObsolete) }, // NOXREF { 0x01D1ACD0, "_ZN12BotStatement7ConvertEPKS_", mfunc_ptr_cast(&BotStatement::Convert) }, - { 0x01D1ADC0, "_ZN12BotStatement12AppendPhraseEPK9BotPhrase", mfunc_ptr_cast(&BotStatement::AppendPhrase) }, - //{ 0x01D1ADF0, "_ZN12BotStatement12AppendPhraseENS_11ContextTypeE", mfunc_ptr_cast(&BotStatement::AppendPhrase) }, // NOXREF + { 0x01D1ADC0, "_ZN12BotStatement12AppendPhraseEPK9BotPhrase", mfunc_ptr_cast(&BotStatement::AppendPhrase) }, + //{ 0x01D1ADF0, "_ZN12BotStatement12AppendPhraseENS_11ContextTypeE", mfunc_ptr_cast(&BotStatement::AppendPhrase) }, // NOXREF { 0x01D1AE20, "_ZN12BotStatement6UpdateEv", mfunc_ptr_cast(&BotStatement::Update) }, { 0x01D1B2A0, "_ZNK12BotStatement8GetPlaceEv", mfunc_ptr_cast(&BotStatement::GetPlace) }, // NOXREF //{ 0x01D1B2E0, "_ZNK12BotStatement8HasCountEv", mfunc_ptr_cast(&BotStatement::HasCount) }, // NOXREF @@ -4789,8 +4790,9 @@ FunctionHook g_FunctionHooks[] = { 0x01D290C0, "_ZN6Vector16NormalizeInPlaceEv", mfunc_ptr_cast(&Vector::NormalizeInPlace) }, #ifdef _WIN32 - + { 0x01D12570, "", mfunc_ptr_cast(&Vector::Length) }, + { 0x01D9C290, "", mfunc_ptr_cast(&Vector::Length2D) }, { 0x01D4EA30, "", mfunc_ptr_cast(&Vector::Normalize) }, { 0x01DCB800, "", mfunc_ptr_cast(&Vector::operator==) }, { 0x01D130D0, "", mfunc_ptr_cast(&Vector::IsLengthLessThan) }, @@ -4812,9 +4814,9 @@ FunctionHook g_FunctionHooks[] = { 0x01D46310, "_Z17LoadNavigationMapv", (size_t)&LoadNavigationMap }, //IImprovEvent //virtual func - //{ 0x0, "_ZN12IImprovEvent15OnMoveToSuccessERK6Vector", mfunc_ptr_cast(&IImprovEvent::OnMoveToSuccess) }, - //{ 0x0, "_ZN12IImprovEvent15OnMoveToFailureERK6VectorNS_17MoveToFailureTypeE", mfunc_ptr_cast(&IImprovEvent::OnMoveToFailure) }, - //{ 0x0, "_ZN12IImprovEvent8OnInjuryEf", mfunc_ptr_cast(&IImprovEvent::OnInjury) }, + //{ 0x01D56970, "_ZN12IImprovEvent15OnMoveToSuccessERK6Vector", mfunc_ptr_cast(&IImprovEvent::OnMoveToSuccess_) }, + //{ 0x01D56980, "_ZN12IImprovEvent15OnMoveToFailureERK6VectorNS_17MoveToFailureTypeE", mfunc_ptr_cast(&IImprovEvent::OnMoveToFailure_) }, + //{ 0x01D56990, "_ZN12IImprovEvent8OnInjuryEf", mfunc_ptr_cast(&IImprovEvent::OnInjury_) }, //CImprov //virtual func //{ 0x0, "_ZNK7CImprov7IsAliveEv", mfunc_ptr_cast(&CImprov::IsAlive) }, @@ -5196,11 +5198,11 @@ FunctionHook g_FunctionHooks[] = { 0x01D4B3A0, "_ZN16HostageIdleState7OnEnterEP14CHostageImprov", mfunc_ptr_cast(&HostageIdleState::OnEnter_) }, { 0x01D4B3C0, "_ZN16HostageIdleState8OnUpdateEP14CHostageImprov", mfunc_ptr_cast(&HostageIdleState::OnUpdate_) }, { 0x01D4BBB0, "_ZN16HostageIdleState6OnExitEP14CHostageImprov", mfunc_ptr_cast(&HostageIdleState::OnExit_) }, - //{ 0x0, "_ZNK16HostageIdleState7GetNameEv", mfunc_ptr_cast(&HostageIdleState::GetName_) }, // DEFAULT + //{ 0x01D56A30, "_ZNK16HostageIdleState7GetNameEv", mfunc_ptr_cast(&HostageIdleState::GetName_) }, // DEFAULT { 0x01D4BBD0, "_ZN16HostageIdleState25UpdateStationaryAnimationEP14CHostageImprov", mfunc_ptr_cast(&HostageIdleState::UpdateStationaryAnimation_) }, - //{ 0x0, "_ZN16HostageIdleState15OnMoveToSuccessERK6Vector", mfunc_ptr_cast(&HostageIdleState::OnMoveToSuccess_) }, // DEFAULT - //{ 0x0, "_ZN16HostageIdleState15OnMoveToFailureERK6VectorN12IImprovEvent17MoveToFailureTypeE", mfunc_ptr_cast(&HostageIdleState::OnMoveToFailure_) }, // DEFAULT - //{ 0x0, "_ZN16HostageIdleState8OnInjuryEf", mfunc_ptr_cast(&HostageIdleState::OnInjury_) }, // DEFAULT + //{ 0x01D56A40, "_ZN16HostageIdleState15OnMoveToSuccessERK6Vector", mfunc_ptr_cast(&HostageIdleState::OnMoveToSuccess_) }, // DEFAULT + //{ 0x01D56A50, "_ZN16HostageIdleState15OnMoveToFailureERK6VectorN12IImprovEvent17MoveToFailureTypeE", mfunc_ptr_cast(&HostageIdleState::OnMoveToFailure_) }, // DEFAULT + //{ 0x01D56A60, "_ZN16HostageIdleState8OnInjuryEf", mfunc_ptr_cast(&HostageIdleState::OnInjury_) }, // DEFAULT //HostageStateMachine //virtual func //{ 0x01D569D0, "_ZN19HostageStateMachine15OnMoveToSuccessERK6Vector", mfunc_ptr_cast(&HostageStateMachine::OnMoveToSuccess) }, @@ -5222,14 +5224,14 @@ FunctionHook g_FunctionHooks[] = { 0x01D4A5E0, "_ZN28HostageEscapeLookAroundState7OnEnterEP14CHostageImprov", mfunc_ptr_cast(&HostageEscapeLookAroundState::OnEnter_) }, { 0x01D4A620, "_ZN28HostageEscapeLookAroundState8OnUpdateEP14CHostageImprov", mfunc_ptr_cast(&HostageEscapeLookAroundState::OnUpdate_) }, { 0x01D4A680, "_ZN28HostageEscapeLookAroundState6OnExitEP14CHostageImprov", mfunc_ptr_cast(&HostageEscapeLookAroundState::OnExit_) }, - //{ 0x0, "_ZNK28HostageEscapeLookAroundState7GetNameEv", mfunc_ptr_cast(&HostageEscapeLookAroundState::GetName_) }, + //{ 0x01D56B40, "_ZNK28HostageEscapeLookAroundState7GetNameEv", mfunc_ptr_cast(&HostageEscapeLookAroundState::GetName_) }, //HostageEscapeState //virtual func { 0x01D4A690, "_ZN18HostageEscapeState7OnEnterEP14CHostageImprov", mfunc_ptr_cast(&HostageEscapeState::OnEnter_) }, { 0x01D4A720, "_ZN18HostageEscapeState8OnUpdateEP14CHostageImprov", mfunc_ptr_cast(&HostageEscapeState::OnUpdate_) }, { 0x01D4A880, "_ZN18HostageEscapeState6OnExitEP14CHostageImprov", mfunc_ptr_cast(&HostageEscapeState::OnExit_) }, //{ 0x01D56A80, "_ZNK18HostageEscapeState7GetNameEv", mfunc_ptr_cast(&HostageEscapeState::GetName_) }, - //{ 0x0, "_ZN18HostageEscapeState15OnMoveToFailureERK6VectorN12IImprovEvent17MoveToFailureTypeE", mfunc_ptr_cast(&HostageEscapeState::OnMoveToFailure_) }, // NOXREF + //{ 0x01D56A70, "_ZN18HostageEscapeState15OnMoveToFailureERK6VectorN12IImprovEvent17MoveToFailureTypeE", mfunc_ptr_cast(&HostageEscapeState::OnMoveToFailure_) }, // NOXREF //non-virtual func //{ 0x0, "_ZN18HostageEscapeState7ToCoverEv", mfunc_ptr_cast(&HostageEscapeState::ToCover) }, //{ 0x0, "_ZN18HostageEscapeState10LookAroundEv", mfunc_ptr_cast(&HostageEscapeState::LookAround) }, @@ -5422,7 +5424,7 @@ VirtualTableRef g_TableRefs[] = { 0x01DF6FE4, "HostageStateMachine", 4 }, { 0x01DF6FC8, "HostageIdleState", 4 }, { 0x01DF6F9C, "HostageEscapeState", 6 }, - { 0x01DF6F70, "HostageRetreatState", 4 }, + { 0x01DF6F70, "HostageRetreatState", 6 }, { 0x01DF6F44, "HostageFollowState", 4 }, { 0x01DF7180, "HostageEscapeToCoverState", 4 }, { 0x01DF6F18, "HostageAnimateState", 4 }, @@ -6123,7 +6125,6 @@ AddressRef g_DataRefs[] = { 0x01E2A104, "lastDrawTimestamp", (size_t)&plastDrawTimestamp }, { 0x01E2A118, "_ZL13editTimestamp", (size_t)&peditTimestamp }, - //{ 0x0, "goodSizedAreaList", (size_t)&pgoodSizedAreaList }, { 0x01E2A10C, "_ZL10markedArea", (size_t)&pmarkedArea }, { 0x01E2A110, "_ZL16lastSelectedArea", (size_t)&plastSelectedArea }, { 0x01E1158C, "_ZL12markedCorner", (size_t)&pmarkedCorner }, @@ -6160,11 +6161,11 @@ AddressRef g_DataRefs[] = { 0x01E2DAA8, "g_pstudiohdr", (size_t)&pg_pstudiohdr }, { 0x01E2F8C0, "g_pRotationMatrix", (size_t)&pg_pRotationMatrix }, { 0x01E2F8B0, "g_pBoneTransform", (size_t)&pg_pBoneTransform }, - { 0x01E2F8BC, "omega", (size_t)&pomega }, - { 0x01E312E0, "cosom", (size_t)&pcosom }, - { 0x01E306C8, "sinom", (size_t)&psinom }, - { 0x01E2F8B4, "sclp", (size_t)&psclp }, - { 0x01E2F8B8, "sclq", (size_t)&psclq }, + //{ 0x01E2F8BC, "omega", (size_t)&pomega }, // LOCAL + //{ 0x01E312E0, "cosom", (size_t)&pcosom }, // LOCAL + //{ 0x01E306C8, "sinom", (size_t)&psinom }, // LOCAL + //{ 0x01E2F8B4, "sclp", (size_t)&psclp }, // LOCAL + //{ 0x01E2F8B8, "sclq", (size_t)&psclq }, // LOCAL { 0x01E0DF70, "primaryWeaponBuyInfoCT", (size_t)&pprimaryWeaponBuyInfoCT }, { 0x01E0E00C, "secondaryWeaponBuyInfoCT", (size_t)&psecondaryWeaponBuyInfoCT }, diff --git a/regamedll/hookers/hooker.h b/regamedll/hookers/hooker.h index 0d4307d7..079ccd2f 100644 --- a/regamedll/hookers/hooker.h +++ b/regamedll/hookers/hooker.h @@ -15,7 +15,7 @@ extern void *GetFuncRefAddrOrDefault(const char *funcName, void *def); #if defined(HOOK_GAMEDLL) && !defined(REGAMEDLL_UNIT_TESTS) -extern void Regamedll_Game_Init(void); +extern void Regamedll_Game_Init(); extern void _printf2(const char *fmt, ...); extern void _print_chat(class CBasePlayer *pPlayer, const char *fmt, ...); diff --git a/regamedll/hookers/hooker_impl.cpp b/regamedll/hookers/hooker_impl.cpp new file mode 100644 index 00000000..56ad1dcd --- /dev/null +++ b/regamedll/hookers/hooker_impl.cpp @@ -0,0 +1,2201 @@ +#include "precompiled.h" + +// xrefs +void (CBaseEntity::*pCHostage__IdleThink)(); +void (*pBotPhrase__Randomize)(); +void (*pCCSBotManager__AddBot)(); +void (*pCCSBot__UpdateLookAngles)(); + +// globals +TYPEDESCRIPTION IMPL_CLASS(CBaseEntity, m_SaveData)[5]; +TYPEDESCRIPTION IMPL_CLASS(CAirtank, m_SaveData)[1]; +TYPEDESCRIPTION IMPL_CLASS(CBaseAnimating, m_SaveData)[5]; +TYPEDESCRIPTION IMPL_CLASS(CFuncRotating, m_SaveData)[5]; +TYPEDESCRIPTION IMPL_CLASS(CPendulum, m_SaveData)[8]; +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]; +TYPEDESCRIPTION IMPL_CLASS(CAmbientGeneric, m_SaveData)[4]; +TYPEDESCRIPTION IMPL_CLASS(CEnvSound, m_SaveData)[2]; +TYPEDESCRIPTION IMPL_CLASS(CSpeaker, m_SaveData)[1]; +TYPEDESCRIPTION IMPL_CLASS(CGlobalState, m_SaveData)[1]; +TYPEDESCRIPTION IMPL_CLASS(CBaseDoor, m_SaveData)[7]; +TYPEDESCRIPTION IMPL_CLASS(CMomentaryDoor, m_SaveData)[1]; +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]; +TYPEDESCRIPTION IMPL_CLASS(CEnvExplosion, m_SaveData)[2]; +TYPEDESCRIPTION IMPL_CLASS(CBreakable, m_SaveData)[5]; +TYPEDESCRIPTION IMPL_CLASS(CPushable, m_SaveData)[2]; +TYPEDESCRIPTION IMPL_CLASS(CFuncTank, m_SaveData)[26]; +TYPEDESCRIPTION IMPL_CLASS(CFuncTankLaser, m_SaveData)[2]; +TYPEDESCRIPTION IMPL_CLASS(CFuncTankControls, m_SaveData)[1]; +TYPEDESCRIPTION IMPL_CLASS(CGrenade, m_SaveData)[15]; +TYPEDESCRIPTION IMPL_CLASS(CRecharge, m_SaveData)[5]; +TYPEDESCRIPTION IMPL_CLASS(CCycler, m_SaveData)[1]; +TYPEDESCRIPTION IMPL_CLASS(CCyclerSprite, m_SaveData)[3]; +TYPEDESCRIPTION IMPL_CLASS(CWreckage, m_SaveData)[1]; +TYPEDESCRIPTION IMPL_CLASS(CWallHealth, m_SaveData)[5]; +TYPEDESCRIPTION IMPL_CLASS(CLight, m_SaveData)[2]; +TYPEDESCRIPTION IMPL_CLASS(CRuleEntity, m_SaveData)[1]; +TYPEDESCRIPTION IMPL_CLASS(CGameText, m_SaveData)[1]; +TYPEDESCRIPTION IMPL_CLASS(CGamePlayerZone, m_SaveData)[4]; +TYPEDESCRIPTION IMPL_CLASS(CFuncMortarField, m_SaveData)[6]; +TYPEDESCRIPTION IMPL_CLASS(CPathCorner, m_SaveData)[1]; +TYPEDESCRIPTION IMPL_CLASS(CPathTrack, m_SaveData)[5]; +TYPEDESCRIPTION IMPL_CLASS(CBasePlatTrain, m_SaveData)[3]; +TYPEDESCRIPTION IMPL_CLASS(CFuncPlatRot, m_SaveData)[2]; +TYPEDESCRIPTION IMPL_CLASS(CFuncTrain, m_SaveData)[3]; +TYPEDESCRIPTION IMPL_CLASS(CFuncTrackTrain, m_SaveData)[12]; +TYPEDESCRIPTION IMPL_CLASS(CFuncTrackChange, m_SaveData)[9]; +TYPEDESCRIPTION IMPL_CLASS(CGunTarget, m_SaveData)[1]; +TYPEDESCRIPTION IMPL_CLASS(CBaseDelay, m_SaveData)[2]; +TYPEDESCRIPTION IMPL_CLASS(CBaseToggle, m_SaveData)[19]; +TYPEDESCRIPTION IMPL_CLASS(CFuncWeaponCheck, m_SaveData)[6]; +TYPEDESCRIPTION IMPL_CLASS(CBaseGrenCatch, m_SaveData)[5]; +TYPEDESCRIPTION IMPL_CLASS(CFrictionModifier, m_SaveData)[1]; +TYPEDESCRIPTION IMPL_CLASS(CAutoTrigger, m_SaveData)[2]; +TYPEDESCRIPTION IMPL_CLASS(CTriggerRelay, m_SaveData)[1]; +TYPEDESCRIPTION IMPL_CLASS(CMultiManager, m_SaveData)[5]; +TYPEDESCRIPTION IMPL_CLASS(CChangeLevel, m_SaveData)[4]; +TYPEDESCRIPTION IMPL_CLASS(CTriggerChangeTarget, m_SaveData)[1]; +TYPEDESCRIPTION IMPL_CLASS(CTriggerCamera, m_SaveData)[13]; +TYPEDESCRIPTION IMPL_CLASS(CFuncVehicle, m_SaveData)[12]; +TYPEDESCRIPTION IMPL_CLASS(CBasePlayerItem, m_SaveData)[3]; +TYPEDESCRIPTION IMPL_CLASS(CBasePlayerWeapon, m_SaveData)[7]; +TYPEDESCRIPTION IMPL_CLASS(CWeaponBox, m_SaveData)[4]; +TYPEDESCRIPTION IMPL_CLASS(CRevertSaved, m_SaveData)[2]; + +TYPEDESCRIPTION IMPL_CLASS(CBasePlayer, m_playerSaveData)[40]; +TYPEDESCRIPTION gGlobalEntitySaveData[3]; + +// globals gamerules +CHalfLifeMultiplay *g_pGameRules; +char mp_com_token[ COM_TOKEN_LEN ]; +cvar_t *sv_clienttrace; + +// globals player.cpp +int giPrecacheGrunt, gmsgWeapPickup, gmsgHudText, gmsgHudTextArgs, gmsgShake, gmsgFade, gmsgFlashlight, gmsgFlashBattery, gmsgResetHUD, +gmsgInitHUD, gmsgViewMode, gmsgShowGameTitle, gmsgCurWeapon, gmsgHealth, gmsgDamage, gmsgBattery, gmsgTrain, gmsgLogo, +gmsgWeaponList, gmsgAmmoX, gmsgDeathMsg, gmsgScoreAttrib, gmsgScoreInfo, gmsgTeamInfo, gmsgTeamScore, gmsgGameMode, gmsgMOTD, +gmsgServerName, gmsgAmmoPickup, gmsgItemPickup, gmsgHideWeapon, gmsgSayText, gmsgTextMsg, gmsgSetFOV, gmsgShowMenu, gmsgSendAudio, +gmsgRoundTime, gmsgMoney, gmsgBlinkAcct, gmsgArmorType, gmsgStatusValue, gmsgStatusText, gmsgStatusIcon, gmsgBarTime, gmsgReloadSound, +gmsgCrosshair, gmsgNVGToggle, gmsgRadar, gmsgSpectator, gmsgVGUIMenu, gmsgCZCareer, gmsgCZCareerHUD, gmsgTaskTime, gmsgTutorText, +gmsgTutorLine, gmsgShadowIdx, gmsgTutorState, gmsgTutorClose, gmsgAllowSpec, gmsgBombDrop, gmsgBombPickup, gmsgHostagePos, gmsgHostageK, +gmsgGeigerRange, gmsgSendCorpse, gmsgHLTV, gmsgSpecHealth, gmsgForceCam, gmsgADStop, gmsgReceiveW, gmsgScenarioIcon, gmsgBotVoice, +gmsgBuyClose, gmsgItemStatus, gmsgLocation, gmsgSpecHealth2, gmsgBarTime2, gmsgBotProgress, gmsgBrass, gmsgFog, gmsgShowTimer; +BOOL gInitHUD; +cvar_t *sv_aim; +WeaponStruct g_weaponStruct[ MAX_WEAPONS ]; +char *(*CDeadHEV::pm_szPoses)[4]; + +// globals hostages +CHostageManager *g_pHostages; +int g_iHostageNumber; + +cvar_t cv_hostage_debug; +cvar_t cv_hostage_stop; + +float (*CLocalNav::ps_flStepSize); +int (*CLocalNav::pqptr); +EHANDLE (*CLocalNav::pqueue)[20]; +int (*CLocalNav::ptot_inqueue); +float (*CLocalNav::pnodeval); +float (*CLocalNav::pflNextCvarCheck); +float (*CLocalNav::pflLastThinkTime); +EHANDLE (*CLocalNav::phostages)[20]; +int (*CLocalNav::ptot_hostages); + +// globals weapons +const char *g_pModelNameLaser; +ItemInfo IMPL_CLASS(CBasePlayerItem, ItemInfoArray)[32]; +AmmoInfo IMPL_CLASS(CBasePlayerItem, AmmoInfoArray)[32]; + +AutoBuyInfoStruct g_autoBuyInfo[35]; +WeaponAliasInfo weaponAliasInfo[39]; +WeaponBuyAliasInfo weaponBuyAliasInfo[43]; +WeaponClassAliasInfo weaponClassAliasInfo[46]; +WeaponInfoStruct weaponInfo[27]; + +// globals utils +TYPEDESCRIPTION gEntvarsDescription[86]; +unsigned int seed_table[256]; +int g_groupop; +int g_groupmask; +const int gSizes[18]; + +// globals bots +CBotManager *TheBots; +BotPhraseManager *TheBotPhrases; +CBaseEntity *g_pSelectedZombieSpawn; + +CountdownTimer IMPL_CLASS(BotChatterInterface, m_encourageTimer); +IntervalTimer IMPL_CLASS(BotChatterInterface, m_radioSilenceInterval)[ 2 ]; + +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); + +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; + +// globals globals.cpp +const Vector g_vecZero; +u_long g_ulFrameCount; + +// globals func_tank.cpp +Vector gTankSpread[5]; + +// globals func_break.cpp +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]; + +// globals sound.cpp +dynpitchvol_t rgdpvpreset[CDPVPRESETMAX]; +int fSentencesInit; +int gcallsentences; + +// globals cbase.cpp +DLL_FUNCTIONS gFunctionTable; +NEW_DLL_FUNCTIONS gNewDLLFunctions; +CMemoryPool hashItemMemPool; +BOOL gTouchDisabled; + +// globals world.cpp +DLL_DECALLIST gDecals[42]; + +// globals animation.cpp +sv_blending_interface_t svBlending; + +// globals career_tasks.cpp +CCareerTaskManager *TheCareerTasks; +const TaskInfo taskInfo[21]; + +// globals client.cpp +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; + +// globals debug.cpp +DebugOutputLevel outputLevel[ NUM_LEVELS ]; +unsigned int theDebugOutputTypes; +char theDebugBuffer[ DebugBufferSize ]; + +// globals tutors +char *const g_TutorStateStrings[20]; +const char *TutorIdentifierList[150]; + +cvar_t cv_tutor_message_repeats; +cvar_t cv_tutor_debug_level; +cvar_t cv_tutor_view_distance; +cvar_t cv_tutor_viewable_check_interval; +cvar_t cv_tutor_look_distance; +cvar_t cv_tutor_look_angle; +cvar_t cv_tutor_examine_time; +cvar_t cv_tutor_message_minimum_display_time; +cvar_t cv_tutor_message_character_display_time_coefficient; +cvar_t cv_tutor_hint_interval_time; + +// globals game.cpp +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; + +// globals shared_util +char s_shared_token[1500]; +char s_shared_quote; + +// bot util +const char *GameEventName[ NUM_GAME_EVENTS + 1 ]; + +// voice_gamemgr +cvar_t voice_serverdebug; +cvar_t sv_alltalk; + +// bot +float g_flBotCommandInterval; +float g_flBotFullThinkInterval; +const char *BotArgs[4]; +bool UseBotArgs; + +// utlsymbol +LessCtx_t g_LessCtx; + +// bot_profile +BotProfileManager *TheBotProfiles; +char *BotDifficultyName[5]; + +// bot_util +short s_iBeamSprite; +float cosTable[256]; + +// nav_area +unsigned int IMPL_CLASS(CNavArea, m_nextID); +unsigned int IMPL_CLASS(CNavArea, m_masterMarker); +unsigned int IMPL_CLASS(HidingSpot, m_nextID); +unsigned int IMPL_CLASS(HidingSpot, m_masterMarker); +NavLadderList TheNavLadderList; +HidingSpotList TheHidingSpotList; +NavAreaList TheNavAreaList; +CNavAreaGrid TheNavAreaGrid; +CNavArea *IMPL_CLASS(CNavArea, m_openList); +bool IMPL_CLASS(CNavArea, m_isReset); +float lastDrawTimestamp; +NavAreaList goodSizedAreaList; +CNavArea *markedArea; +CNavArea *lastSelectedArea; +NavCornerType markedCorner; +bool isCreatingNavArea; +bool isAnchored; +Vector anchor; +bool isPlaceMode; +bool isPlacePainting; +float editTimestamp; +unsigned int BlockedID[256]; +int BlockedIDCount; + +// nav_node +NavDirType Opposite[4]; +CNavNode *IMPL_CLASS(CNavNode, m_list); +unsigned int IMPL_CLASS(CNavNode, m_listLength); + +// pm_shared +int pm_shared_initialized; +vec3_t rgv3tStuckTable[54]; +int rgStuckLast[MAX_CLIENTS][2]; +int pm_gcTextures; +char pm_grgszTextureName[1024][17]; +char pm_grgchTextureType[1024]; +playermove_t *pmove; +int g_onladder; + +// pm_math +vec3_t vec3_origin; +int nanmask; + +// CAirtank +void CAirtank::Spawn() { Spawn_(); } +void CAirtank::Precache() { 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); } + +// Ammo +void C9MMAmmo::Spawn() { Spawn_(); } +void C9MMAmmo::Precache() { Precache_(); } +BOOL C9MMAmmo::AddAmmo(CBaseEntity *pOther) { return AddAmmo_(pOther); } + +void CBuckShotAmmo::Spawn() { Spawn_(); } +void CBuckShotAmmo::Precache() { Precache_(); } +BOOL CBuckShotAmmo::AddAmmo(CBaseEntity *pOther) { return AddAmmo_(pOther); } + +void C556NatoAmmo::Spawn() { Spawn_(); } +void C556NatoAmmo::Precache() { Precache_(); } +BOOL C556NatoAmmo::AddAmmo(CBaseEntity *pOther) { return AddAmmo_(pOther); } + +void C556NatoBoxAmmo::Spawn() { Spawn_(); } +void C556NatoBoxAmmo::Precache() { Precache_(); } +BOOL C556NatoBoxAmmo::AddAmmo(CBaseEntity *pOther) { return AddAmmo_(pOther); } + +void C762NatoAmmo::Spawn() { Spawn_(); } +void C762NatoAmmo::Precache() { Precache_(); } +BOOL C762NatoAmmo::AddAmmo(CBaseEntity *pOther) { return AddAmmo_(pOther); } + +void C45ACPAmmo::Spawn() { Spawn_(); } +void C45ACPAmmo::Precache() { Precache_(); } +BOOL C45ACPAmmo::AddAmmo(CBaseEntity *pOther) { return AddAmmo_(pOther); } + +void C50AEAmmo::Spawn() { Spawn_(); } +void C50AEAmmo::Precache() { Precache_(); } +BOOL C50AEAmmo::AddAmmo(CBaseEntity *pOther) { return AddAmmo_(pOther); } + +void C338MagnumAmmo::Spawn() { Spawn_(); } +void C338MagnumAmmo::Precache() { Precache_(); } +BOOL C338MagnumAmmo::AddAmmo(CBaseEntity *pOther) { return AddAmmo_(pOther); } + +void C57MMAmmo::Spawn() { Spawn_(); } +void C57MMAmmo::Precache() { Precache_(); } +BOOL C57MMAmmo::AddAmmo(CBaseEntity *pOther) { return AddAmmo_(pOther); } + +void C357SIGAmmo::Spawn() { Spawn_(); } +void C357SIGAmmo::Precache() { Precache_(); } +BOOL C357SIGAmmo::AddAmmo(CBaseEntity *pOther) { return AddAmmo_(pOther); } + +// Animating +int CBaseAnimating::Save(CSave &save) { return Save_(save); } +int CBaseAnimating::Restore(CRestore &restore) { return Restore_(restore); } + +// bmodels +void CFuncWall::Spawn() { Spawn_(); } +void CFuncWall::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +void CFuncWallToggle::Spawn() { Spawn_(); } +void CFuncWallToggle::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +void CFuncConveyor::Spawn() { Spawn_(); } +void CFuncConveyor::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +void CFuncIllusionary::Spawn() { Spawn_(); } +void CFuncIllusionary::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } + +void CFuncMonsterClip::Spawn() { Spawn_(); } + +void CFuncRotating::Spawn() { Spawn_(); } +void CFuncRotating::Precache() { 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() { 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); } + +// buttons +void CBaseButton::Spawn() { Spawn_(); } +void CBaseButton::Precache() { 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() { 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() { 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() { Spawn_(); } + +void CMomentaryRotButton::Spawn() { 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() { Spawn_(); } +void CEnvSpark::Precache() { 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() { Spawn_(); } +int CButtonTarget::ObjectCaps() { 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); } + +// career +void CCareerTask::OnEvent(GameEventType event, CBasePlayer *pAttacker, CBasePlayer *pVictim) { OnEvent_(event, pAttacker, pVictim); } +void CCareerTask::Reset() { Reset_(); } + +void CPreventDefuseTask::OnEvent(GameEventType event, CBasePlayer *pAttacker, CBasePlayer *pVictim) { OnEvent_(event, pAttacker, pVictim); } +void CPreventDefuseTask::Reset() { Reset_(); } + +// cbase +int CBaseEntity::Save(CSave &save) { return Save_(save); } +int CBaseEntity::Restore(CRestore &restore) { return Restore_(restore); } +void CBaseEntity::SetObjectCollisionBox() { 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() { return IsInWorld_(); } +CBaseEntity *CBaseEntity::GetNextTarget() { return GetNextTarget_(); } +BOOL CBaseEntity::FVisible(CBaseEntity *pEntity) { return FVisible_(pEntity); } +BOOL CBaseEntity::FVisible(const Vector &vecOrigin) { return FVisible_(vecOrigin); } + +// combat +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() { return HasHumanGibs_(); } +BOOL CBaseMonster::HasAlienGibs() { return HasHumanGibs_(); } +void CBaseMonster::FadeMonster() { FadeMonster_(); } +void CBaseMonster::GibMonster() { GibMonster_(); } +Activity CBaseMonster::GetDeathActivity() { return GetDeathActivity_(); } +void CBaseMonster::BecomeDead() { BecomeDead_(); } +BOOL CBaseMonster::ShouldFadeOnDeath() { return ShouldFadeOnDeath_(); } +int CBaseMonster::IRelationship(CBaseEntity *pTarget) { return IRelationship_(pTarget); } +void CBaseMonster::MonsterInitDead() { MonsterInitDead_(); } +void CBaseMonster::Look(int iDistance) { Look_(iDistance); } +CBaseEntity *CBaseMonster::BestVisibleEnemy() { return BestVisibleEnemy_(); } +BOOL CBaseMonster::FInViewCone(CBaseEntity *pEntity) { return FInViewCone_(pEntity); } +BOOL CBaseMonster::FInViewCone(const Vector *pOrigin) { return FInViewCone_(pOrigin); } + +// doors +void CBaseDoor::Spawn() { Spawn_(); } +void CBaseDoor::Precache() { Precache_(); } +void CBaseDoor::Restart() { 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() { Spawn_(); } +void CRotDoor::Restart() { Restart_(); } +void CRotDoor::SetToggleState(int state) { SetToggleState_(state); } +void CMomentaryDoor::Spawn() { Spawn_(); } +void CMomentaryDoor::Precache() { 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); } + +// effects +void CBombGlow::Spawn() { Spawn_(); } +void CBombGlow::Think() { Think_(); } + +void CSprite::Spawn() { Spawn_(); } +void CSprite::Precache() { Precache_(); } +void CSprite::Restart() { 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() { Spawn_(); } +void CBeam::Precache() { Precache_(); } + +void CLaser::Spawn() { Spawn_(); } +void CLaser::Precache() { 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() { Spawn_(); } +void CBubbling::Precache() { 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() { Spawn_(); } +void CLightning::Precache() { 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() { Activate_(); } + +void CGlow::Spawn() { Spawn_(); } +int CGlow::Save(CSave &save) { return Save_(save); } +int CGlow::Restore(CRestore &restore) { return Restore_(restore); } +void CGlow::Think() { Think_(); } + +void CGibShooter::Spawn() { Spawn_(); } +void CGibShooter::Precache() { 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() { return CreateGib_(); } + +void CEnvShooter::Precache() { Precache_(); } +void CEnvShooter::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +CGib *CEnvShooter::CreateGib() { return CreateGib_(); } + +void CTestEffect::Spawn() { Spawn_(); } +void CTestEffect::Precache() { Precache_(); } +void CTestEffect::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +void CBlood::Spawn() { 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() { 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() { 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() { Spawn_(); } +void CMessage::Precache() { 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() { Spawn_(); } +void CEnvFunnel::Precache() { Precache_(); } +void CEnvFunnel::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +void CEnvBeverage::Spawn() { Spawn_(); } +void CEnvBeverage::Precache() { Precache_(); } +void CEnvBeverage::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +void CItemSoda::Spawn() { Spawn_(); } +void CItemSoda::Precache() { Precache_(); } + +// explode +void CShower::Spawn() { Spawn_(); } +void CShower::Think() { Think_(); } +void CShower::Touch(CBaseEntity *pOther) { Touch_(pOther); } + +void CEnvExplosion::Spawn() { 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); } + +// func_break +void CBreakable::Spawn() { Spawn_(); } +void CBreakable::Precache() { Precache_(); } +void CBreakable::Restart() { 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() { Spawn_(); } +void CPushable::Precache() { 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); } + +// func_tank +void CFuncTank::Spawn() { Spawn_(); } +void CFuncTank::Precache() { 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() { 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() { Activate_(); } +void CFuncTankLaser::Think() { Think_(); } +void CFuncTankLaser::Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker) { Fire_(barrelEnd, forward, pevAttacker); } + +void CFuncTankRocket::Precache() { 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() { Spawn_(); } +int CFuncTankControls::Save(CSave &save) { return Save_(save); } +int CFuncTankControls::Restore(CRestore &restore) { return Restore_(restore); } +void CFuncTankControls::Think() { Think_(); } +void CFuncTankControls::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +// gamerules +void CGameRules::RefreshSkillData() { 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); } + +// grenade +void CGrenade::Spawn() { 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() { BounceSound_(); } + +// h_battery +void CRecharge::Spawn() { Spawn_(); } +void CRecharge::Precache() { 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); } + +// h_cycler +void CWreckage::Spawn() { Spawn_(); } +void CWreckage::Precache() { Precache_(); } +int CWreckage::Save(CSave &save) { return Save_(save); } +int CWreckage::Restore(CRestore &restore) { return Restore_(restore); } +void CWreckage::Think() { Think_(); } + +void CWeaponCycler::Spawn() { Spawn_(); } +BOOL CWeaponCycler::Deploy() { return Deploy_(); } +void CWeaponCycler::Holster(int skiplocal) { Holster_(skiplocal); } +void CWeaponCycler::PrimaryAttack() { PrimaryAttack_(); } +void CWeaponCycler::SecondaryAttack() { SecondaryAttack_(); } + +void CCyclerSprite::Spawn() { Spawn_(); } +void CCyclerSprite::Restart() { 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() { Think_(); } +void CCyclerSprite::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator,pCaller,useType,value); } + +void CCycler::Spawn() { 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() { Think_(); } +void CCycler::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator,pCaller,useType,value); } + +void CGenericCycler::Spawn() { Spawn_(); } + +void CCyclerProbe::Spawn() { Spawn_(); } + +// healthkit +void CHealthKit::Spawn() { Spawn_(); } +void CHealthKit::Precache() { Precache_(); } +BOOL CHealthKit::MyTouch(CBasePlayer *pPlayer) { return MyTouch_(pPlayer); } + +void CWallHealth::Spawn() { Spawn_(); } +void CWallHealth::Precache() { Precache_(); } +void CWallHealth::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +int CWallHealth::Save(CSave &save) { return Save_(save); } +int CWallHealth::Restore(CRestore &restore) { return Restore_(restore); } +void CWallHealth::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +// items +void CItem::Spawn() { Spawn_(); } +CBaseEntity *CItem::Respawn() { return Respawn_(); } + +void CWorldItem::Spawn() { Spawn_(); } +void CWorldItem::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } + +void CItemSuit::Spawn() { Spawn_(); } +void CItemSuit::Precache() { Precache_(); } +BOOL CItemSuit::MyTouch(CBasePlayer *pPlayer) { return MyTouch_(pPlayer); } + +void CItemBattery::Spawn() { Spawn_(); } +void CItemBattery::Precache() { Precache_(); } +BOOL CItemBattery::MyTouch(CBasePlayer *pPlayer) { return MyTouch_(pPlayer); } + +void CItemAntidote::Spawn() { Spawn_(); } +void CItemAntidote::Precache() { Precache_(); } +BOOL CItemAntidote::MyTouch(CBasePlayer *pPlayer) { return MyTouch_(pPlayer); } + +void CItemSecurity::Spawn() { Spawn_(); } +void CItemSecurity::Precache() { Precache_(); } +BOOL CItemSecurity::MyTouch(CBasePlayer *pPlayer) { return MyTouch_(pPlayer); } + +void CItemLongJump::Spawn() { Spawn_(); } +void CItemLongJump::Precache() { Precache_(); } +BOOL CItemLongJump::MyTouch(CBasePlayer *pPlayer) { return MyTouch_(pPlayer); } + +void CItemKevlar::Spawn() { Spawn_(); } +void CItemKevlar::Precache() { Precache_(); } +BOOL CItemKevlar::MyTouch(CBasePlayer *pPlayer) { return MyTouch_(pPlayer); } + +void CItemAssaultSuit::Spawn() { Spawn_(); } +void CItemAssaultSuit::Precache() { Precache_(); } +BOOL CItemAssaultSuit::MyTouch(CBasePlayer *pPlayer) { return MyTouch_(pPlayer); } + +void CItemThighPack::Spawn() { Spawn_(); } +void CItemThighPack::Precache() { Precache_(); } +BOOL CItemThighPack::MyTouch(CBasePlayer *pPlayer) { return MyTouch_(pPlayer); } + +// lights +void CLight::Spawn() { Spawn_(); } +void CLight::Restart() { Restart_(); } +int CLight::Save(CSave &save) { return Save_(save); } +int CLight::Restore(CRestore &restore) { return Restore_(restore); } +void CLight::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +void CLight::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +void CEnvLight::Spawn() { Spawn_(); } +void CEnvLight::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } + +// maprules +void CRuleEntity::Spawn() { Spawn_(); } +void CRuleEntity::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +int CRuleEntity::Save(CSave &save) { return Save_(save); } +int CRuleEntity::Restore(CRestore &restore) { return Restore_(restore); } + +void CRulePointEntity::Spawn() { Spawn_(); } + +void CRuleBrushEntity::Spawn() { Spawn_(); } + +void CGameScore::Spawn() { Spawn_(); } +void CGameScore::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +void CGameScore::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +void CGameEnd::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +void CGameText::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +int CGameText::Save(CSave &save) { return Save_(save); } +int CGameText::Restore(CRestore &restore) { return Restore_(restore); } +void CGameText::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +void CGameTeamMaster::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +BOOL CGameTeamMaster::IsTriggered(CBaseEntity *pActivator) { return IsTriggered_(pActivator); } +const char *CGameTeamMaster::TeamID() { return TeamID_(); } +void CGameTeamMaster::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +void CGameTeamSet::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +void CGamePlayerZone::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +int CGamePlayerZone::Save(CSave &save) { return Save_(save); } +int CGamePlayerZone::Restore(CRestore &restore) { return Restore_(restore); } +void CGamePlayerZone::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +void CGamePlayerHurt::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +void CGameCounter::Spawn() { Spawn_(); } +void CGameCounter::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +void CGameCounterSet::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +void CGamePlayerEquip::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +void CGamePlayerEquip::Touch(CBaseEntity *pOther) { Touch_(pOther); } +void CGamePlayerEquip::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +void CGamePlayerTeam::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +// mortar +void CFuncMortarField::Spawn() { Spawn_(); } +void CFuncMortarField::Precache() { Precache_(); } +void CFuncMortarField::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +int CFuncMortarField::Save(CSave &save) { return Save_(save); } +int CFuncMortarField::Restore(CRestore &restore) { return Restore_(restore); } + +void CMortar::Spawn() { Spawn_(); } +void CMortar::Precache() { Precache_(); } + +// multiplay_gamerules +void CMapInfo::Spawn() { Spawn_(); } +void CMapInfo::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } + +bool CCStrikeGameMgrHelper::CanPlayerHearPlayer(CBasePlayer *pListener, CBasePlayer *pSender) { return CanPlayerHearPlayer_(pListener, pSender); } + +void CHalfLifeMultiplay::RefreshSkillData() { RefreshSkillData_(); } +void CHalfLifeMultiplay::Think() { Think_(); } +BOOL CHalfLifeMultiplay::IsAllowedToSpawn(CBaseEntity *pEntity) { return IsAllowedToSpawn_(pEntity); } +BOOL CHalfLifeMultiplay::FAllowFlashlight() { return FAllowFlashlight_(); } +BOOL CHalfLifeMultiplay::FShouldSwitchWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon) { return FShouldSwitchWeapon_(pPlayer, pWeapon); } +BOOL CHalfLifeMultiplay::GetNextBestWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeapon) { return GetNextBestWeapon_(pPlayer, pCurrentWeapon); } +BOOL CHalfLifeMultiplay::IsMultiplayer() { return IsMultiplayer_(); } +BOOL CHalfLifeMultiplay::IsDeathmatch() { return IsDeathmatch_(); } +BOOL CHalfLifeMultiplay::IsCoOp() { return IsCoOp_(); } +BOOL CHalfLifeMultiplay::ClientConnected(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[128]) { return ClientConnected_(pEntity, pszName, pszAddress, szRejectReason); } +void CHalfLifeMultiplay::InitHUD(CBasePlayer *pl) { InitHUD_(pl); } +void CHalfLifeMultiplay::ClientDisconnected(edict_t *pClient) { ClientDisconnected_(pClient); } +void CHalfLifeMultiplay::UpdateGameMode(CBasePlayer *pPlayer) { UpdateGameMode_(pPlayer); } +float CHalfLifeMultiplay::FlPlayerFallDamage(CBasePlayer *pPlayer) { return FlPlayerFallDamage_(pPlayer); } +BOOL CHalfLifeMultiplay::FPlayerCanTakeDamage(CBasePlayer *pPlayer, CBaseEntity *pAttacker) { return FPlayerCanTakeDamage_(pPlayer, pAttacker); } +void CHalfLifeMultiplay::PlayerSpawn(CBasePlayer *pPlayer) { PlayerSpawn_(pPlayer); } +void CHalfLifeMultiplay::PlayerThink(CBasePlayer *pPlayer) { PlayerThink_(pPlayer); } +BOOL CHalfLifeMultiplay::FPlayerCanRespawn(CBasePlayer *pPlayer) { return FPlayerCanRespawn_(pPlayer); } +float CHalfLifeMultiplay::FlPlayerSpawnTime(CBasePlayer *pPlayer) { return FlPlayerSpawnTime_(pPlayer); } +edict_t *CHalfLifeMultiplay::GetPlayerSpawnSpot(CBasePlayer *pPlayer) { return GetPlayerSpawnSpot_(pPlayer); } +BOOL CHalfLifeMultiplay::AllowAutoTargetCrosshair() { return AllowAutoTargetCrosshair_(); } +BOOL CHalfLifeMultiplay::ClientCommand_DeadOrAlive(CBasePlayer *pPlayer, const char *pcmd) { return ClientCommand_DeadOrAlive_(pPlayer, pcmd); } +BOOL CHalfLifeMultiplay::ClientCommand(CBasePlayer *pPlayer, const char *pcmd) { return ClientCommand_(pPlayer, pcmd); } +void CHalfLifeMultiplay::ClientUserInfoChanged(CBasePlayer *pPlayer, char *infobuffer) { ClientUserInfoChanged_(pPlayer, infobuffer); } +int CHalfLifeMultiplay::IPointsForKill(CBasePlayer *pAttacker, CBasePlayer *pKilled) { return IPointsForKill_(pAttacker, pKilled); } +void CHalfLifeMultiplay::PlayerKilled(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor) { PlayerKilled_(pVictim, pKiller, pInflictor); } +void CHalfLifeMultiplay::DeathNotice(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor) { DeathNotice_(pVictim, pKiller, pInflictor); } +BOOL CHalfLifeMultiplay::CanHavePlayerItem(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon) { return CanHavePlayerItem_(pPlayer, pWeapon); } +void CHalfLifeMultiplay::PlayerGotWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon) { PlayerGotWeapon_(pPlayer, pWeapon); } +int CHalfLifeMultiplay::WeaponShouldRespawn(CBasePlayerItem *pWeapon) { return WeaponShouldRespawn_(pWeapon); } +float CHalfLifeMultiplay::FlWeaponRespawnTime(CBasePlayerItem *pWeapon) { return FlWeaponRespawnTime_(pWeapon); } +float CHalfLifeMultiplay::FlWeaponTryRespawn(CBasePlayerItem *pWeapon) { return FlWeaponTryRespawn_(pWeapon); } +Vector CHalfLifeMultiplay::VecWeaponRespawnSpot(CBasePlayerItem *pWeapon) { return VecWeaponRespawnSpot_(pWeapon); } +BOOL CHalfLifeMultiplay::CanHaveItem(CBasePlayer *pPlayer, CItem *pItem) { return CanHaveItem_(pPlayer, pItem); } +void CHalfLifeMultiplay::PlayerGotItem(CBasePlayer *pPlayer, CItem *pItem) { PlayerGotItem_(pPlayer, pItem); } +int CHalfLifeMultiplay::ItemShouldRespawn(CItem *pItem) { return ItemShouldRespawn_(pItem); } +float CHalfLifeMultiplay::FlItemRespawnTime(CItem *pItem) { return FlItemRespawnTime_(pItem); } +Vector CHalfLifeMultiplay::VecItemRespawnSpot(CItem *pItem) { return VecItemRespawnSpot_(pItem); } +void CHalfLifeMultiplay::PlayerGotAmmo(CBasePlayer *pPlayer, char *szName, int iCount) { PlayerGotAmmo_(pPlayer, szName, iCount); } +int CHalfLifeMultiplay::AmmoShouldRespawn(CBasePlayerAmmo *pAmmo) { return AmmoShouldRespawn_(pAmmo); } +float CHalfLifeMultiplay::FlAmmoRespawnTime(CBasePlayerAmmo *pAmmo) { return FlAmmoRespawnTime_(pAmmo); } +Vector CHalfLifeMultiplay::VecAmmoRespawnSpot(CBasePlayerAmmo *pAmmo) { return VecAmmoRespawnSpot_(pAmmo); } +float CHalfLifeMultiplay::FlHealthChargerRechargeTime() { return FlHealthChargerRechargeTime_(); } +float CHalfLifeMultiplay::FlHEVChargerRechargeTime() { return FlHEVChargerRechargeTime_(); } +int CHalfLifeMultiplay::DeadPlayerWeapons(CBasePlayer *pPlayer) { return DeadPlayerWeapons_(pPlayer); } +int CHalfLifeMultiplay::DeadPlayerAmmo(CBasePlayer *pPlayer) { return DeadPlayerAmmo_(pPlayer); } +int CHalfLifeMultiplay::PlayerRelationship(CBasePlayer *pPlayer, CBaseEntity *pTarget) { return PlayerRelationship_(pPlayer, pTarget); } +BOOL CHalfLifeMultiplay::FAllowMonsters() { return FAllowMonsters_(); } +void CHalfLifeMultiplay::ServerDeactivate() { ServerDeactivate_(); } +void CHalfLifeMultiplay::CheckMapConditions() { CheckMapConditions_(); } +void CHalfLifeMultiplay::CleanUpMap() { CleanUpMap_(); } +void CHalfLifeMultiplay::RestartRound() { RestartRound_(); } +void CHalfLifeMultiplay::CheckWinConditions() { CheckWinConditions_(); } +void CHalfLifeMultiplay::RemoveGuns() { RemoveGuns_(); } +void CHalfLifeMultiplay::GiveC4() { GiveC4_(); } +void CHalfLifeMultiplay::ChangeLevel() { ChangeLevel_(); } +void CHalfLifeMultiplay::GoToIntermission() { GoToIntermission_(); } + +// pathcorner +void CPathCorner::Spawn() { Spawn_(); } +void CPathCorner::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +int CPathCorner::Save(CSave &save) { return Save_(save); } +int CPathCorner::Restore(CRestore &restore) { return Restore_(restore); } + +void CPathTrack::Spawn() { Spawn_(); } +void CPathTrack::KeyValue(KeyValueData* pkvd) { KeyValue_(pkvd); } +int CPathTrack::Save(CSave &save) { return Save_(save); } +int CPathTrack::Restore(CRestore &restore) { return Restore_(restore); } +void CPathTrack::Activate() { Activate_(); } +void CPathTrack::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +// plats +void CBasePlatTrain::Precache() { Precache_(); } +void CBasePlatTrain::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +int CBasePlatTrain::Save(CSave &save) { return Save_(save); } +int CBasePlatTrain::Restore(CRestore &restore) { return Restore_(restore); } + +void CFuncPlat::Spawn() { Spawn_(); } +void CFuncPlat::Precache() { Precache_(); } +void CFuncPlat::Blocked(CBaseEntity *pOther) { Blocked_(pOther); } +void CFuncPlat::GoUp() { GoUp_(); } +void CFuncPlat::GoDown() { GoDown_(); } +void CFuncPlat::HitTop() { HitTop_(); } +void CFuncPlat::HitBottom() { HitBottom_(); } + +void CPlatTrigger::Touch(CBaseEntity *pOther) { Touch_(pOther); } + +void CFuncPlatRot::Spawn() { Spawn_(); } +int CFuncPlatRot::Save(CSave &save) { return Save_(save); } +int CFuncPlatRot::Restore(CRestore &restore) { return Restore_(restore); } +void CFuncPlatRot::GoUp() { GoUp_(); } +void CFuncPlatRot::GoDown() { GoDown_(); } +void CFuncPlatRot::HitTop() { HitTop_(); } +void CFuncPlatRot::HitBottom() { HitBottom_(); } + +void CFuncTrain::Spawn() { Spawn_(); } +void CFuncTrain::Precache() { Precache_(); } +void CFuncTrain::Restart() { Restart_(); } +void CFuncTrain::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +int CFuncTrain::Save(CSave &save) { return Save_(save); } +int CFuncTrain::Restore(CRestore &restore) { return Restore_(restore); } +void CFuncTrain::Activate() { Activate_(); } +void CFuncTrain::OverrideReset() { OverrideReset_(); } +void CFuncTrain::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } +void CFuncTrain::Blocked(CBaseEntity *pOther) { Blocked_(pOther); } + +void CFuncTrackTrain::Spawn() { Spawn_(); } +void CFuncTrackTrain::Precache() { Precache_(); } +void CFuncTrackTrain::Restart() { Restart_(); } +void CFuncTrackTrain::KeyValue(KeyValueData* pkvd) { KeyValue_(pkvd); } +int CFuncTrackTrain::Save(CSave &save) { return Save_(save); } +int CFuncTrackTrain::Restore(CRestore &restore) { return Restore_(restore); } +void CFuncTrackTrain::OverrideReset() { OverrideReset_(); } +BOOL CFuncTrackTrain::OnControls(entvars_t *pev) { return OnControls_(pev); } +void CFuncTrackTrain::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } +void CFuncTrackTrain::Blocked(CBaseEntity *pOther) { Blocked_(pOther); } + +void CFuncTrainControls::Spawn() { Spawn_(); } + +void CFuncTrackChange::Spawn() { Spawn_(); } +void CFuncTrackChange::Precache() { Precache_(); } +void CFuncTrackChange::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +int CFuncTrackChange::Save(CSave &save) { return Save_(save); } +int CFuncTrackChange::Restore(CRestore &restore) { return Restore_(restore); } +void CFuncTrackChange::OverrideReset() { OverrideReset_(); } +void CFuncTrackChange::Touch(CBaseEntity *pOther) { Touch_(pOther); } +void CFuncTrackChange::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } +BOOL CFuncTrackChange::IsTogglePlat() { return IsTogglePlat_(); } +void CFuncTrackChange::GoUp() { GoUp_(); } +void CFuncTrackChange::GoDown() { GoDown_(); } +void CFuncTrackChange::HitBottom() { HitBottom_(); } +void CFuncTrackChange::HitTop() { HitTop_(); } +void CFuncTrackChange::UpdateAutoTargets(int toggleState) { UpdateAutoTargets_(toggleState); } + +void CFuncTrackAuto::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } +void CFuncTrackAuto::UpdateAutoTargets(int toggleState) { UpdateAutoTargets_(toggleState); } + +void CGunTarget::Spawn() { Spawn_(); } +int CGunTarget::Save(CSave &save) { return Save_(save); } +int CGunTarget::Restore(CRestore &restore) { return Restore_(restore); } +void CGunTarget::Activate() { Activate_(); } +int CGunTarget::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) { return TakeDamage_(pevInflictor, pevAttacker, flDamage, bitsDamageType); } +void CGunTarget::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +// player +void CBasePlayer::Spawn() { Spawn_(); } +void CBasePlayer::Precache() { Precache_(); } +int CBasePlayer::Save(CSave &save) { return Save_(save); } +int CBasePlayer::Restore(CRestore &restore) { return Restore_(restore); } +int CBasePlayer::Classify() { return Classify_(); } +void CBasePlayer::TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType) { TraceAttack_(pevAttacker, flDamage, vecDir, ptr, bitsDamageType); } +int CBasePlayer::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) { return TakeDamage_(pevInflictor, pevAttacker, flDamage, bitsDamageType); } +int CBasePlayer::TakeHealth(float flHealth, int bitsDamageType) { return TakeHealth_(flHealth, bitsDamageType); } +void CBasePlayer::Killed(entvars_t *pevAttacker, int iGib) { Killed_(pevAttacker, iGib); } +void CBasePlayer::AddPoints(int score, BOOL bAllowNegativeScore) { AddPoints_(score, bAllowNegativeScore); } +void CBasePlayer::AddPointsToTeam(int score, BOOL bAllowNegativeScore) { AddPointsToTeam_(score, bAllowNegativeScore); } +BOOL CBasePlayer::AddPlayerItem(CBasePlayerItem *pItem) { return AddPlayerItem_(pItem); } +BOOL CBasePlayer::RemovePlayerItem(CBasePlayerItem *pItem) { return RemovePlayerItem_(pItem); } +int CBasePlayer::GiveAmmo(int iAmount, char *szName, int iMax) { return GiveAmmo_(iAmount, szName, iMax); } +const char *CBasePlayer::TeamID() { return TeamID_(); } +BOOL CBasePlayer::FBecomeProne() { return FBecomeProne_(); } +int CBasePlayer::Illumination() { return Illumination_(); } +void CBasePlayer::ResetMaxSpeed() { ResetMaxSpeed_(); } +void CBasePlayer::Jump() { Jump_(); } +void CBasePlayer::Duck() { Duck_(); } +void CBasePlayer::PreThink() { PreThink_(); } +void CBasePlayer::PostThink() { PostThink_(); } +Vector CBasePlayer::GetGunPosition() { return GetGunPosition_(); } +void CBasePlayer::UpdateClientData() { UpdateClientData_(); } +void CBasePlayer::ImpulseCommands() { ImpulseCommands_(); } +void CBasePlayer::RoundRespawn() { RoundRespawn_(); } +Vector CBasePlayer::GetAutoaimVector(float flDelta) { return GetAutoaimVector_(flDelta); } +void CBasePlayer::Blind(float flUntilTime, float flHoldTime, float flFadeTime, int iAlpha) { Blind_(flUntilTime, flHoldTime, flFadeTime, iAlpha); } + +void CStripWeapons::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +void CRevertSaved::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +int CRevertSaved::Save(CSave &save) { return Save_(save); } +int CRevertSaved::Restore(CRestore &restore) { return Restore_(restore); } +void CRevertSaved::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +void CDeadHEV::Spawn() { Spawn_(); } +void CDeadHEV::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +int CDeadHEV::Classify() { return Classify_(); } + +void CSprayCan::Think() { Think_(); } + +void CInfoIntermission::Spawn() { Spawn_(); } +void CInfoIntermission::Think() { Think_(); } + +void CWShield::Spawn() { Spawn_(); } +void CWShield::Touch(CBaseEntity *pOther) { Touch_(pOther); } + +// singleplay_gamerules +void CHalfLifeRules::Think() { Think_(); } +BOOL CHalfLifeRules::IsAllowedToSpawn(CBaseEntity *pEntity) { return IsAllowedToSpawn_(pEntity); } +BOOL CHalfLifeRules::FShouldSwitchWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon) { return FShouldSwitchWeapon_(pPlayer, pWeapon); } +BOOL CHalfLifeRules::GetNextBestWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeapon) { return GetNextBestWeapon_(pPlayer, pCurrentWeapon); } +BOOL CHalfLifeRules::IsMultiplayer() { return IsMultiplayer_(); } +BOOL CHalfLifeRules::IsDeathmatch() { return IsDeathmatch_(); } +BOOL CHalfLifeRules::IsCoOp() { return IsCoOp_(); } +BOOL CHalfLifeRules::ClientConnected(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[128]) { return ClientConnected_(pEntity, pszName, pszAddress, szRejectReason); } +void CHalfLifeRules::InitHUD(CBasePlayer *pl) { InitHUD_(pl); } +void CHalfLifeRules::ClientDisconnected(edict_t *pClient) { ClientDisconnected_(pClient); } +float CHalfLifeRules::FlPlayerFallDamage(CBasePlayer *pPlayer) { return FlPlayerFallDamage_(pPlayer); } +void CHalfLifeRules::PlayerSpawn(CBasePlayer *pPlayer) { PlayerSpawn_(pPlayer); } +void CHalfLifeRules::PlayerThink(CBasePlayer *pPlayer) { PlayerThink_(pPlayer); } +BOOL CHalfLifeRules::FPlayerCanRespawn(CBasePlayer *pPlayer) { return FPlayerCanRespawn_(pPlayer); } +float CHalfLifeRules::FlPlayerSpawnTime(CBasePlayer *pPlayer) { return FlPlayerSpawnTime_(pPlayer); } +edict_t *CHalfLifeRules::GetPlayerSpawnSpot(CBasePlayer *pPlayer) { return GetPlayerSpawnSpot_(pPlayer); } +BOOL CHalfLifeRules::AllowAutoTargetCrosshair() { return AllowAutoTargetCrosshair_(); } +int CHalfLifeRules::IPointsForKill(CBasePlayer *pAttacker, CBasePlayer *pKilled) { return IPointsForKill_(pAttacker, pKilled); } +void CHalfLifeRules::PlayerKilled(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor) { PlayerKilled_(pVictim, pKiller, pInflictor); } +void CHalfLifeRules::DeathNotice(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor) { DeathNotice_(pVictim, pKiller, pInflictor); } +void CHalfLifeRules::PlayerGotWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon) { PlayerGotWeapon_(pPlayer, pWeapon); } +int CHalfLifeRules::WeaponShouldRespawn(CBasePlayerItem *pWeapon) { return WeaponShouldRespawn_(pWeapon); } +float CHalfLifeRules::FlWeaponRespawnTime(CBasePlayerItem *pWeapon) { return FlWeaponRespawnTime_(pWeapon); } +float CHalfLifeRules::FlWeaponTryRespawn(CBasePlayerItem *pWeapon) { return FlWeaponTryRespawn_(pWeapon); } +Vector CHalfLifeRules::VecWeaponRespawnSpot(CBasePlayerItem *pWeapon) { return VecWeaponRespawnSpot_(pWeapon); } +BOOL CHalfLifeRules::CanHaveItem(CBasePlayer *pPlayer, CItem *pItem) { return CanHaveItem_(pPlayer, pItem); } +void CHalfLifeRules::PlayerGotItem(CBasePlayer *pPlayer, CItem *pItem) { PlayerGotItem_(pPlayer, pItem); } +int CHalfLifeRules::ItemShouldRespawn(CItem *pItem) { return ItemShouldRespawn_(pItem); } +float CHalfLifeRules::FlItemRespawnTime(CItem *pItem) { return FlItemRespawnTime_(pItem); } +Vector CHalfLifeRules::VecItemRespawnSpot(CItem *pItem) { return VecItemRespawnSpot_(pItem); } +void CHalfLifeRules::PlayerGotAmmo(CBasePlayer *pPlayer, char *szName, int iCount) { PlayerGotAmmo_(pPlayer, szName, iCount); } +int CHalfLifeRules::AmmoShouldRespawn(CBasePlayerAmmo *pAmmo) { return AmmoShouldRespawn_(pAmmo); } +float CHalfLifeRules::FlAmmoRespawnTime(CBasePlayerAmmo *pAmmo) { return FlAmmoRespawnTime_(pAmmo); } +Vector CHalfLifeRules::VecAmmoRespawnSpot(CBasePlayerAmmo *pAmmo) { return VecAmmoRespawnSpot_(pAmmo); } +float CHalfLifeRules::FlHealthChargerRechargeTime() { return FlHealthChargerRechargeTime_(); } +int CHalfLifeRules::DeadPlayerWeapons(CBasePlayer *pPlayer) { return DeadPlayerWeapons_(pPlayer); } +int CHalfLifeRules::DeadPlayerAmmo(CBasePlayer *pPlayer) { return DeadPlayerAmmo_(pPlayer); } +int CHalfLifeRules::PlayerRelationship(CBasePlayer *pPlayer, CBaseEntity *pTarget) { return PlayerRelationship_(pPlayer, pTarget); } +BOOL CHalfLifeRules::FAllowMonsters() { return FAllowMonsters_(); } + +// sound +void CAmbientGeneric::Spawn() { Spawn_(); } +void CAmbientGeneric::Precache() { Precache_(); } +void CAmbientGeneric::Restart() { Restart_(); } +void CAmbientGeneric::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +int CAmbientGeneric::Save(CSave &save) { Save_(save); } +int CAmbientGeneric::Restore(CRestore &restore) { Restore_(restore); } + +void CEnvSound::Spawn() { Spawn_(); } +void CEnvSound::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +int CEnvSound::Save(CSave &save) { return Save_(save); } +int CEnvSound::Restore(CRestore &restore) { return Restore_(restore); } +void CEnvSound::Think() { Think_(); } + +void CSpeaker::Spawn() { Spawn_(); } +void CSpeaker::Precache() { Precache_(); } +void CSpeaker::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +int CSpeaker::Save(CSave &save) { return Save_(save); } +int CSpeaker::Restore(CRestore &restore) { return Restore_(restore); } + +// soundent +void CSoundEnt::Spawn() { Spawn_(); } +void CSoundEnt::Precache() { Precache_(); } +void CSoundEnt::Think() { Think_(); } + +// spectator +void CBaseSpectator::Spawn() { Spawn_(); } + +// subs +void CNullEntity::Spawn() { Spawn_(); } + +void CPointEntity::Spawn() { Spawn_(); } + +void CBaseDelay::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +int CBaseDelay::Save(CSave &save) { return Save_(save); } +int CBaseDelay::Restore(CRestore &restore) { return Restore_(restore); } + +void CBaseToggle::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +int CBaseToggle::Save(CSave &save) { return Save_(save); } +int CBaseToggle::Restore(CRestore &restore) { return Restore_(restore); } + +void CBaseDMStart::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +BOOL CBaseDMStart::IsTriggered(CBaseEntity *pEntity) { return IsTriggered_(pEntity); } + +// training_gamerules +void CBaseGrenCatch::Spawn() { Spawn_(); } +void CBaseGrenCatch::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +int CBaseGrenCatch::Save(CSave &save) { return Save_(save); } +int CBaseGrenCatch::Restore(CRestore &restore) { return Restore_(restore); } +void CBaseGrenCatch::Think() { Think_(); } +void CBaseGrenCatch::Touch(CBaseEntity *pOther) { Touch_(pOther); } + +void CFuncWeaponCheck::Spawn() { Spawn_(); } +void CFuncWeaponCheck::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +int CFuncWeaponCheck::Save(CSave &save) { return Save_(save); } +int CFuncWeaponCheck::Restore(CRestore &restore) { return Restore_(restore); } +void CFuncWeaponCheck::Touch(CBaseEntity *pOther) { Touch_(pOther); } + +BOOL CHalfLifeTraining::IsDeathmatch() { return IsDeathmatch_(); } +void CHalfLifeTraining::InitHUD(CBasePlayer *pl) { InitHUD_(pl); } +void CHalfLifeTraining::PlayerSpawn(CBasePlayer *pPlayer) { PlayerSpawn_(pPlayer); } +void CHalfLifeTraining::PlayerThink(CBasePlayer *pPlayer) { PlayerThink_(pPlayer); } +BOOL CHalfLifeTraining::FPlayerCanRespawn(CBasePlayer *pPlayer) { return FPlayerCanRespawn_(pPlayer); } +edict_t *CHalfLifeTraining::GetPlayerSpawnSpot(CBasePlayer *pPlayer) { return GetPlayerSpawnSpot_(pPlayer); } +void CHalfLifeTraining::PlayerKilled(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor) { PlayerKilled_(pVictim, pKiller, pInflictor); } +int CHalfLifeTraining::ItemShouldRespawn(CItem *pItem) { return ItemShouldRespawn_(pItem); } +void CHalfLifeTraining::CheckWinConditions() { CheckWinConditions_(); } + +// triggers +void CFrictionModifier::Spawn() { Spawn_(); } +void CFrictionModifier::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +int CFrictionModifier::Save(CSave &save) { return Save_(save); } +int CFrictionModifier::Restore(CRestore &restore) { return Restore_(restore); } + +void CAutoTrigger::Spawn() { Spawn_(); } +void CAutoTrigger::Precache() { Precache_(); } +void CAutoTrigger::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +int CAutoTrigger::Save(CSave &save) { return Save_(save); } +int CAutoTrigger::Restore(CRestore &restore) { return Restore_(restore); } +void CAutoTrigger::Think() { Think_(); } + +void CTriggerRelay::Spawn() { Spawn_(); } +void CTriggerRelay::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +int CTriggerRelay::Save(CSave &save) { return Save_(save); } +int CTriggerRelay::Restore(CRestore &restore) { return Restore_(restore); } +void CTriggerRelay::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +void CMultiManager::Spawn() { Spawn_(); } +void CMultiManager::Restart() { Restart_(); } +void CMultiManager::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +int CMultiManager::Save(CSave &save) { return Save_(save); } +int CMultiManager::Restore(CRestore &restore) { return Restore_(restore); } +BOOL CMultiManager::HasTarget(string_t targetname) { return HasTarget_(targetname); } + +void CRenderFxManager::Spawn() { Spawn_(); } +void CRenderFxManager::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +void CBaseTrigger::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } + +void CTriggerHurt::Spawn() { Spawn_(); } + +void CTriggerMonsterJump::Spawn() { Spawn_(); } +void CTriggerMonsterJump::Think() { Think_(); } +void CTriggerMonsterJump::Touch(CBaseEntity *pOther) { Touch_(pOther); } + +void CTriggerCDAudio::Spawn() { Spawn_(); } +void CTriggerCDAudio::Touch(CBaseEntity *pOther) { Touch_(pOther); } +void CTriggerCDAudio::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +void CTargetCDAudio::Spawn() { Spawn_(); } +void CTargetCDAudio::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +void CTargetCDAudio::Think() { Think_(); } +void CTargetCDAudio::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +void CTriggerMultiple::Spawn() { Spawn_(); } + +void CTriggerOnce::Spawn() { Spawn_(); } + +void CTriggerCounter::Spawn() { Spawn_(); } + +void CTriggerVolume::Spawn() { Spawn_(); } + +void CFireAndDie::Spawn() { Spawn_(); } +void CFireAndDie::Precache() { Precache_(); } +void CFireAndDie::Think() { Think_(); } + +void CChangeLevel::Spawn() { Spawn_(); } +void CChangeLevel::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +int CChangeLevel::Save(CSave &save) { return Save_(save); } +int CChangeLevel::Restore(CRestore &restore) { return Restore_(restore); } + +void CLadder::Spawn() { Spawn_(); } +void CLadder::Precache() { Precache_(); } +void CLadder::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } + +void CTriggerPush::Spawn() { Spawn_(); } +void CTriggerPush::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +void CTriggerPush::Touch(CBaseEntity *pOther) { Touch_(pOther); } + +void CTriggerTeleport::Spawn() { Spawn_(); } + +void CBuyZone::Spawn() { Spawn_(); } + +void CBombTarget::Spawn() { Spawn_(); } + +void CHostageRescue::Spawn() { Spawn_(); } + +void CEscapeZone::Spawn() { Spawn_(); } + +void CVIP_SafetyZone::Spawn() { Spawn_(); } + +void CTriggerSave::Spawn() { Spawn_(); } + +void CTriggerEndSection::Spawn() { Spawn_(); } +void CTriggerEndSection::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } + +void CTriggerGravity::Spawn() { Spawn_(); } + +void CTriggerChangeTarget::Spawn() { Spawn_(); } +void CTriggerChangeTarget::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +int CTriggerChangeTarget::Save(CSave &save) { return Save_(save); } +int CTriggerChangeTarget::Restore(CRestore &restore) { return Restore_(restore); } +void CTriggerChangeTarget::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +void CTriggerCamera::Spawn() { Spawn_(); } +void CTriggerCamera::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +int CTriggerCamera::Save(CSave &save) { return Save_(save); } +int CTriggerCamera::Restore(CRestore &restore) { return Restore_(restore); } +void CTriggerCamera::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +void CClientFog::Spawn() { Spawn_(); } +void CClientFog::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } + +void CWeather::Spawn() { Spawn_(); } + +// tutor_base_tutor +bool CBaseTutor::IsEntityInViewOfPlayer(CBaseEntity *entity, CBasePlayer *player) { return IsEntityInViewOfPlayer_(entity, player); } +bool CBaseTutor::IsBombsiteInViewOfPlayer(CBaseEntity *entity, CBasePlayer *player) { return IsBombsiteInViewOfPlayer_(entity, player); } +bool CBaseTutor::IsEntityInBombsite(CBaseEntity *bombsite, CBaseEntity *entity) { return IsEntityInBombsite_(bombsite, entity); } +bool CBaseTutor::IsPlayerLookingAtPosition(Vector *origin, CBasePlayer *player) { return IsPlayerLookingAtPosition_(origin, player); } +bool CBaseTutor::IsPlayerLookingAtEntity(CBaseEntity *entity, CBasePlayer *player) { return IsPlayerLookingAtEntity_(entity, player); } + +// tutor_cs_states +bool CCSTutorStateSystem::UpdateState(GameEventType event, CBaseEntity *entity, CBaseEntity *other) { return UpdateState_(event, entity, other); } +char *CCSTutorStateSystem::GetCurrentStateString() { return GetCurrentStateString_(); } +CBaseTutorState *CCSTutorStateSystem::ConstructNewState(int stateType) { return ConstructNewState_(stateType); } + +int CCSTutorUndefinedState::CheckForStateTransition(GameEventType event, CBaseEntity *entity, CBaseEntity *other) { return CheckForStateTransition_(event, entity, other); } +char *CCSTutorUndefinedState::GetStateString() { return GetStateString_(); } + +int CCSTutorWaitingForStartState::CheckForStateTransition(GameEventType event, CBaseEntity *entity, CBaseEntity *other) { return CheckForStateTransition_(event, entity, other); } +char *CCSTutorWaitingForStartState::GetStateString() { return GetStateString_(); } + +int CCSTutorBuyMenuState::CheckForStateTransition(GameEventType event, CBaseEntity *entity, CBaseEntity *other) { return CheckForStateTransition_(event, entity, other); } +char *CCSTutorBuyMenuState::GetStateString() { return GetStateString_(); } + +// tutor_cs_tutor +void CCSTutor::TutorThink(float time) { TutorThink_(time); } +void CCSTutor::PurgeMessages() { PurgeMessages_(); } +void CCSTutor::CallEventHandler(GameEventType event, CBaseEntity *entity, CBaseEntity *other) { CallEventHandler_(event, entity, other); } +void CCSTutor::ShowTutorMessage(TutorMessageEvent *event) { ShowTutorMessage_(event); } +void CCSTutor::HandleShotFired(Vector source, Vector target) { HandleShotFired_(source, target); } +TutorMessage *CCSTutor::GetTutorMessageDefinition(int messageID) { return GetTutorMessageDefinition_(messageID); } + +// vehicle +void CFuncVehicle::Spawn() { Spawn_(); } +void CFuncVehicle::Precache() { Precache_(); } +void CFuncVehicle::Restart() { Restart_(); } +void CFuncVehicle::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +int CFuncVehicle::Save(CSave &save) { return Save_(save); } +int CFuncVehicle::Restore(CRestore &restore) { return Restore_(restore); } +int CFuncVehicle::Classify() { return Classify_(); } +void CFuncVehicle::OverrideReset() { OverrideReset_(); } +BOOL CFuncVehicle::OnControls(entvars_t *pev) { return OnControls_(pev); } +void CFuncVehicle::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } +void CFuncVehicle::Blocked(CBaseEntity *pOther) { Blocked_(pOther); } +void CFuncVehicleControls::Spawn() { Spawn_(); } + +// weapons +void CArmoury::Spawn() { Spawn_(); } +void CArmoury::Precache() { Precache_(); } +void CArmoury::Restart() { Restart_(); } +void CArmoury::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } + +void CBasePlayerAmmo::Spawn() { Spawn_(); } +CBaseEntity *CBasePlayerAmmo::Respawn() { return Respawn_(); } + +int CBasePlayerWeapon::Save(CSave &save) { return Save_(save); } +int CBasePlayerWeapon::Restore(CRestore &restore) { return Restore_(restore); } +int CBasePlayerWeapon::AddToPlayer(CBasePlayer *pPlayer) { return AddToPlayer_(pPlayer); } +int CBasePlayerWeapon::AddDuplicate(CBasePlayerItem *pItem) { return AddDuplicate_(pItem); } +BOOL CBasePlayerWeapon::CanDeploy() { return CanDeploy_(); } +void CBasePlayerWeapon::Holster(int skiplocal) { Holster_(skiplocal); } +void CBasePlayerWeapon::ItemPostFrame() { ItemPostFrame_(); } +int CBasePlayerWeapon::PrimaryAmmoIndex() { return PrimaryAmmoIndex_(); } +int CBasePlayerWeapon::SecondaryAmmoIndex() { return SecondaryAmmoIndex_(); } +int CBasePlayerWeapon::UpdateClientData(CBasePlayer *pPlayer) { return UpdateClientData_(pPlayer); } +int CBasePlayerWeapon::ExtractAmmo(CBasePlayerWeapon *pWeapon) { return ExtractAmmo_(pWeapon); } +int CBasePlayerWeapon::ExtractClipAmmo(CBasePlayerWeapon *pWeapon) { return ExtractClipAmmo_(pWeapon); } +BOOL CBasePlayerWeapon::PlayEmptySound() { return PlayEmptySound_(); } +void CBasePlayerWeapon::ResetEmptySound() { ResetEmptySound_(); } +void CBasePlayerWeapon::SendWeaponAnim(int iAnim,int skiplocal) { SendWeaponAnim_(iAnim,skiplocal); } +BOOL CBasePlayerWeapon::IsUseable() { return IsUseable_(); } +void CBasePlayerWeapon::RetireWeapon() { RetireWeapon_(); } + +int CBasePlayerItem::Save(CSave &save) { return Save_(save); } +int CBasePlayerItem::Restore(CRestore &restore) { return Restore_(restore); } +void CBasePlayerItem::SetObjectCollisionBox() { SetObjectCollisionBox_(); } +CBaseEntity *CBasePlayerItem::Respawn() { return Respawn_(); } +int CBasePlayerItem::AddToPlayer(CBasePlayer *pPlayer) { return AddToPlayer_(pPlayer); } +void CBasePlayerItem::Holster(int skiplocal) { Holster_(skiplocal); } +void CBasePlayerItem::Drop() { Drop_(); } +void CBasePlayerItem::Kill() { Kill_(); } +void CBasePlayerItem::AttachToPlayer(CBasePlayer *pPlayer) { AttachToPlayer_(pPlayer); } + +void CWeaponBox::Spawn() { Spawn_(); } +void CWeaponBox::Precache() { Precache_(); } +void CWeaponBox::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +int CWeaponBox::Save(CSave &save) { return Save_(save); } +int CWeaponBox::Restore(CRestore &restore) { return Restore_(restore); } +void CWeaponBox::SetObjectCollisionBox() { SetObjectCollisionBox_(); } +void CWeaponBox::Touch(CBaseEntity *pOther) { Touch_(pOther); } + +// world +//void CDecal::Spawn() { Spawn_(); } +//void CDecal::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } + +void CWorld::Spawn() { Spawn_(); } +void CWorld::Precache() { Precache_(); } +void CWorld::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } + +// AK47 +void CAK47::Spawn() { Spawn_(); } +void CAK47::Precache() { Precache_(); } +int CAK47::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CAK47::Deploy() { return Deploy_(); } +void CAK47::PrimaryAttack() { PrimaryAttack_(); } +void CAK47::SecondaryAttack() { SecondaryAttack_(); } +void CAK47::Reload() { Reload_(); } +void CAK47::WeaponIdle() { WeaponIdle_(); } + +// AUG +void CAUG::Spawn() { Spawn_(); } +void CAUG::Precache() { Precache_(); } +int CAUG::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CAUG::Deploy() { return Deploy_(); } +void CAUG::PrimaryAttack() { PrimaryAttack_(); } +void CAUG::SecondaryAttack() { SecondaryAttack_(); } +void CAUG::Reload() { Reload_(); } +void CAUG::WeaponIdle() { WeaponIdle_(); } + +// AWP +void CAWP::Spawn() { Spawn_(); } +void CAWP::Precache() { Precache_(); } +int CAWP::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CAWP::Deploy() { return Deploy_(); } +float CAWP::GetMaxSpeed() { return GetMaxSpeed_(); } +void CAWP::PrimaryAttack() { PrimaryAttack_(); } +void CAWP::SecondaryAttack() { SecondaryAttack_(); } +void CAWP::Reload() { Reload_(); } +void CAWP::WeaponIdle() { WeaponIdle_(); } + +// C4 +void CC4::Spawn() { Spawn_(); } +void CC4::Precache() { Precache_(); } +void CC4::KeyValue(KeyValueData *pkvd) { KeyValue_(pkvd); } +void CC4::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } +int CC4::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CC4::Deploy() { return Deploy_(); } +void CC4::Holster(int skiplocal) { Holster_(skiplocal); } +float CC4::GetMaxSpeed() { return GetMaxSpeed_(); } +void CC4::PrimaryAttack() { PrimaryAttack_(); } +void CC4::WeaponIdle() { WeaponIdle_(); } + +// DEAGLE +void CDEAGLE::Spawn() { Spawn_(); } +void CDEAGLE::Precache() { Precache_(); } +int CDEAGLE::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CDEAGLE::Deploy() { return Deploy_(); } +void CDEAGLE::PrimaryAttack() { PrimaryAttack_(); } +void CDEAGLE::SecondaryAttack() { SecondaryAttack_(); } +void CDEAGLE::Reload() { Reload_(); } +void CDEAGLE::WeaponIdle() { WeaponIdle_(); } + +// ELITE +void CELITE::Spawn() { Spawn_(); } +void CELITE::Precache() { Precache_(); } +int CELITE::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CELITE::Deploy() { return Deploy_(); } +void CELITE::PrimaryAttack() { PrimaryAttack_(); } +void CELITE::Reload() { Reload_(); } +void CELITE::WeaponIdle() { WeaponIdle_(); } + +// FAMAS +void CFamas::Spawn() { Spawn_(); } +void CFamas::Precache() { Precache_(); } +int CFamas::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CFamas::Deploy() { return Deploy_(); } +void CFamas::PrimaryAttack() { PrimaryAttack_(); } +void CFamas::SecondaryAttack() { SecondaryAttack_(); } +void CFamas::Reload() { Reload_(); } +void CFamas::WeaponIdle() { WeaponIdle_(); } + +// FIVESEVEN +void CFiveSeven::Spawn() { Spawn_(); } +void CFiveSeven::Precache() { Precache_(); } +int CFiveSeven::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CFiveSeven::Deploy() { return Deploy_(); } +void CFiveSeven::PrimaryAttack() { PrimaryAttack_(); } +void CFiveSeven::SecondaryAttack() { SecondaryAttack_(); } +void CFiveSeven::Reload() { Reload_(); } +void CFiveSeven::WeaponIdle() { WeaponIdle_(); } + +// FLASHBANG +void CFlashbang::Spawn() { Spawn_(); } +void CFlashbang::Precache() { Precache_(); } +int CFlashbang::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CFlashbang::CanDeploy() { return CanDeploy_(); } +BOOL CFlashbang::Deploy() { return Deploy_(); } +void CFlashbang::Holster(int skiplocal) { Holster_(skiplocal); } +void CFlashbang::PrimaryAttack() { PrimaryAttack_(); } +void CFlashbang::SecondaryAttack() { SecondaryAttack_(); } +void CFlashbang::WeaponIdle() { WeaponIdle_(); } + +// G3SG1 +void CG3SG1::Spawn() { Spawn_(); } +void CG3SG1::Precache() { Precache_(); } +int CG3SG1::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CG3SG1::Deploy() { return Deploy_(); } +float CG3SG1::GetMaxSpeed() { return GetMaxSpeed_(); } +void CG3SG1::PrimaryAttack() { PrimaryAttack_(); } +void CG3SG1::SecondaryAttack() { SecondaryAttack_(); } +void CG3SG1::Reload() { Reload_(); } +void CG3SG1::WeaponIdle() { WeaponIdle_(); } + +// GALIL +void CGalil::Spawn() { Spawn_(); } +void CGalil::Precache() { Precache_(); } +int CGalil::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CGalil::Deploy() { return Deploy_(); } +void CGalil::PrimaryAttack() { PrimaryAttack_(); } +void CGalil::SecondaryAttack() { SecondaryAttack_(); } +void CGalil::Reload() { Reload_(); } +void CGalil::WeaponIdle() { WeaponIdle_(); } + +// GLOCK18 +void CGLOCK18::Spawn() { Spawn_(); } +void CGLOCK18::Precache() { Precache_(); } +int CGLOCK18::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CGLOCK18::Deploy() { return Deploy_(); } +void CGLOCK18::PrimaryAttack() { PrimaryAttack_(); } +void CGLOCK18::SecondaryAttack() { SecondaryAttack_(); } +void CGLOCK18::Reload() { Reload_(); } +void CGLOCK18::WeaponIdle() { WeaponIdle_(); } + +// HEGRENADE +void CHEGrenade::Spawn() { Spawn_(); } +void CHEGrenade::Precache() { Precache_(); } +int CHEGrenade::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CHEGrenade::CanDeploy() { return CanDeploy_(); } +BOOL CHEGrenade::Deploy() { return Deploy_(); } +void CHEGrenade::Holster(int skiplocal) { Holster_(skiplocal); } +void CHEGrenade::PrimaryAttack() { PrimaryAttack_(); } +void CHEGrenade::SecondaryAttack() { SecondaryAttack_(); } +void CHEGrenade::WeaponIdle() { WeaponIdle_(); } + +// KNIFE +void CKnife::Spawn() { Spawn_(); } +void CKnife::Precache() { Precache_(); } +int CKnife::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CKnife::Deploy() { return Deploy_(); } +void CKnife::Holster(int skiplocal) { Holster_(skiplocal); } +void CKnife::PrimaryAttack() { PrimaryAttack_(); } +void CKnife::SecondaryAttack() { SecondaryAttack_(); } +void CKnife::WeaponIdle() { WeaponIdle_(); } + +// M3 +void CM3::Spawn() { Spawn_(); } +void CM3::Precache() { Precache_(); } +int CM3::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CM3::Deploy() { return Deploy_(); } +void CM3::PrimaryAttack() { PrimaryAttack_(); } +void CM3::Reload() { Reload_(); } +void CM3::WeaponIdle() { WeaponIdle_(); } + +// M4A1 +void CM4A1::Spawn() { Spawn_(); } +void CM4A1::Precache() { Precache_(); } +int CM4A1::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CM4A1::Deploy() { return Deploy_(); } +float CM4A1::GetMaxSpeed() { return GetMaxSpeed_(); } +void CM4A1::PrimaryAttack() { PrimaryAttack_(); } +void CM4A1::SecondaryAttack() { SecondaryAttack_(); } +void CM4A1::Reload() { Reload_(); } +void CM4A1::WeaponIdle() { WeaponIdle_(); } + +// M249 +void CM249::Spawn() { Spawn_(); } +void CM249::Precache() { Precache_(); } +int CM249::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CM249::Deploy() { return Deploy_(); } +void CM249::PrimaryAttack() { PrimaryAttack_(); } +void CM249::Reload() { Reload_(); } +void CM249::WeaponIdle() { WeaponIdle_(); } + +// MAC10 +void CMAC10::Spawn() { Spawn_(); } +void CMAC10::Precache() { Precache_(); } +int CMAC10::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CMAC10::Deploy() { return Deploy_(); } +void CMAC10::PrimaryAttack() { PrimaryAttack_(); } +void CMAC10::Reload() { Reload_(); } +void CMAC10::WeaponIdle() { WeaponIdle_(); } + +// MP5NAVY +void CMP5N::Spawn() { Spawn_(); } +void CMP5N::Precache() { Precache_(); } +int CMP5N::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CMP5N::Deploy() { return Deploy_(); } +void CMP5N::PrimaryAttack() { PrimaryAttack_(); } +void CMP5N::Reload() { Reload_(); } +void CMP5N::WeaponIdle() { WeaponIdle_(); } + +// P90 +void CP90::Spawn() { Spawn_(); } +void CP90::Precache() { Precache_(); } +int CP90::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CP90::Deploy() { return Deploy_(); } +void CP90::PrimaryAttack() { PrimaryAttack_(); } +void CP90::Reload() { Reload_(); } +void CP90::WeaponIdle() { WeaponIdle_(); } +float CP90::GetMaxSpeed() { return GetMaxSpeed_(); } + +// P228 +void CP228::Spawn() { Spawn_(); } +void CP228::Precache() { Precache_(); } +int CP228::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CP228::Deploy() { return Deploy_(); } +void CP228::PrimaryAttack() { PrimaryAttack_(); } +void CP228::SecondaryAttack() { SecondaryAttack_(); } +void CP228::Reload() { Reload_(); } +void CP228::WeaponIdle() { WeaponIdle_(); } + +// SCOUT +void CSCOUT::Spawn() { Spawn_(); } +void CSCOUT::Precache() { Precache_(); } +int CSCOUT::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CSCOUT::Deploy() { return Deploy_(); } +float CSCOUT::GetMaxSpeed() { return GetMaxSpeed_(); } +void CSCOUT::PrimaryAttack() { PrimaryAttack_(); } +void CSCOUT::SecondaryAttack() { SecondaryAttack_(); } +void CSCOUT::Reload() { Reload_(); } +void CSCOUT::WeaponIdle() { WeaponIdle_(); } + +// SG550 +void CSG550::Spawn() { Spawn_(); } +void CSG550::Precache() { Precache_(); } +int CSG550::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CSG550::Deploy() { return Deploy_(); } +float CSG550::GetMaxSpeed() { return GetMaxSpeed_(); } +void CSG550::PrimaryAttack() { PrimaryAttack_(); } +void CSG550::SecondaryAttack() { SecondaryAttack_(); } +void CSG550::Reload() { Reload_(); } +void CSG550::WeaponIdle() { WeaponIdle_(); } + +// SG552 +void CSG552::Spawn() { Spawn_(); } +void CSG552::Precache() { Precache_(); } +int CSG552::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CSG552::Deploy() { return Deploy_(); } +float CSG552::GetMaxSpeed() { return GetMaxSpeed_(); } +void CSG552::PrimaryAttack() { PrimaryAttack_(); } +void CSG552::SecondaryAttack() { SecondaryAttack_(); } +void CSG552::Reload() { Reload_(); } +void CSG552::WeaponIdle() { WeaponIdle_(); } + +// SMOKEGRENADE +void CSmokeGrenade::Spawn() { Spawn_(); } +void CSmokeGrenade::Precache() { Precache_(); } +int CSmokeGrenade::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CSmokeGrenade::CanDeploy() { return CanDeploy_(); } +BOOL CSmokeGrenade::Deploy() { return Deploy_(); } +void CSmokeGrenade::Holster(int skiplocal) { Holster_(skiplocal); } +void CSmokeGrenade::PrimaryAttack() { PrimaryAttack_(); } +void CSmokeGrenade::SecondaryAttack() { SecondaryAttack_(); } +void CSmokeGrenade::WeaponIdle() { WeaponIdle_(); } + +// TMP +void CTMP::Spawn() { Spawn_(); } +void CTMP::Precache() { Precache_(); } +int CTMP::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CTMP::Deploy() { return Deploy_(); } +void CTMP::PrimaryAttack() { PrimaryAttack_(); } +void CTMP::Reload() { Reload_(); } +void CTMP::WeaponIdle() { WeaponIdle_(); } + +// UMP45 +void CUMP45::Spawn() { Spawn_(); } +void CUMP45::Precache() { Precache_(); } +int CUMP45::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CUMP45::Deploy() { return Deploy_(); } +void CUMP45::PrimaryAttack() { PrimaryAttack_(); } +void CUMP45::Reload() { Reload_(); } +void CUMP45::WeaponIdle() { WeaponIdle_(); } + +// USP +void CUSP::Spawn() { Spawn_(); } +void CUSP::Precache() { Precache_(); } +int CUSP::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CUSP::Deploy() { return Deploy_(); } +void CUSP::PrimaryAttack() { PrimaryAttack_(); } +void CUSP::SecondaryAttack() { SecondaryAttack_(); } +void CUSP::Reload() { Reload_(); } +void CUSP::WeaponIdle() { WeaponIdle_(); } + +// XM1014 +void CXM1014::Spawn() { Spawn_(); } +void CXM1014::Precache() { Precache_(); } +int CXM1014::GetItemInfo(ItemInfo *p) { return GetItemInfo_(p); } +BOOL CXM1014::Deploy() { return Deploy_(); } +void CXM1014::PrimaryAttack() { PrimaryAttack_(); } +void CXM1014::Reload() { Reload_(); } +void CXM1014::WeaponIdle() { WeaponIdle_(); } + +// hostage +void CHostage::Spawn() { Spawn_(); } +void CHostage::Precache() { Precache_(); } +int CHostage::ObjectCaps() { return ObjectCaps_(); } +int CHostage::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) { return TakeDamage_(pevInflictor, pevAttacker, flDamage, bitsDamageType); } +void CHostage::Touch(CBaseEntity *pOther) { Touch_(pOther); } +void CHostage::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); } + +// hostage_improv +void CHostageImprov::OnMoveToFailure(const Vector &goal, MoveToFailureType reason) { OnMoveToFailure_(goal, reason); } +bool CHostageImprov::IsAlive() const { return IsAlive_(); } +void CHostageImprov::MoveTo(const Vector &goal) { MoveTo_(goal); } +void CHostageImprov::LookAt(const Vector &target) { LookAt_(target); } +void CHostageImprov::ClearLookAt() { ClearLookAt_(); } +void CHostageImprov::FaceTo(const Vector &goal) { FaceTo_(goal); } +void CHostageImprov::ClearFaceTo() { ClearFaceTo_(); } +bool CHostageImprov::IsAtMoveGoal(float error) const { return IsAtMoveGoal_(error); } +bool CHostageImprov::IsAtFaceGoal() const { return IsAtFaceGoal_(); } +bool CHostageImprov::IsFriendInTheWay(const Vector &goalPos) const { return IsFriendInTheWay_(goalPos); } +bool CHostageImprov::IsFriendInTheWay(CBaseEntity *myFriend, const Vector &goalPos) const { return IsFriendInTheWay_(myFriend, goalPos); } +bool CHostageImprov::Jump() { return Jump_(); } +void CHostageImprov::Crouch() { Crouch_(); } +void CHostageImprov::StandUp() { StandUp_(); } +void CHostageImprov::TrackPath(const Vector &pathGoal, float deltaT) { TrackPath_(pathGoal, deltaT); } +void CHostageImprov::StartLadder(const CNavLadder *ladder, NavTraverseType how, const Vector *approachPos, const Vector *departPos) { StartLadder_(ladder, how, approachPos, departPos); } +bool CHostageImprov::TraverseLadder(const CNavLadder *ladder, NavTraverseType how, const Vector *approachPos, const Vector *departPos, float deltaT) { return TraverseLadder_(ladder, how, approachPos, departPos, deltaT); } +bool CHostageImprov::GetSimpleGroundHeightWithFloor(const Vector *pos, float *height, Vector *normal) { return GetSimpleGroundHeightWithFloor_(pos, height, normal); } +void CHostageImprov::Run() { Run_(); } +void CHostageImprov::Walk() { Walk_(); } +void CHostageImprov::Stop() { Stop_(); } +const Vector &CHostageImprov::GetFeet() const { return GetFeet_(); } +const Vector &CHostageImprov::GetCentroid() const { return GetCentroid_(); } +const Vector &CHostageImprov::GetEyes() const { return GetEyes_(); } +bool CHostageImprov::IsOnGround() const { return IsOnGround_(); } +bool CHostageImprov::IsMoving() const { return IsMoving_(); } +bool CHostageImprov::IsVisible(const Vector &pos, bool testFOV) const { return IsVisible_(pos, testFOV); } +bool CHostageImprov::IsPlayerLookingAtMe(CBasePlayer *other, float cosTolerance) const { return IsPlayerLookingAtMe_(other, cosTolerance); } +CBasePlayer *CHostageImprov::IsAnyPlayerLookingAtMe(int team, float cosTolerance) const { return IsAnyPlayerLookingAtMe_(team, cosTolerance); } +CBasePlayer *CHostageImprov::GetClosestPlayerByTravelDistance(int team, float *range) const { return GetClosestPlayerByTravelDistance_(team, range); } +void CHostageImprov::OnUpdate(float deltaT) { OnUpdate_(deltaT); } +void CHostageImprov::OnUpkeep(float deltaT) { OnUpkeep_(deltaT); } +void CHostageImprov::OnReset() { OnReset_(); } +void CHostageImprov::OnGameEvent(GameEventType event, CBaseEntity *entity, CBaseEntity *other) { OnGameEvent_(event, entity, other); } +void CHostageImprov::OnTouch(CBaseEntity *other) { OnTouch_(other); } + +// hostage_idle +void HostageIdleState::OnEnter(CHostageImprov *improv) { OnEnter_(improv); } +void HostageIdleState::OnUpdate(CHostageImprov *improv) { OnUpdate_(improv); } +void HostageIdleState::OnExit(CHostageImprov *improv) { OnExit_(improv); } +void HostageIdleState::UpdateStationaryAnimation(CHostageImprov *improv) { UpdateStationaryAnimation_(improv); } + +// hostage_escape +void HostageEscapeToCoverState::OnEnter(CHostageImprov *improv) { OnEnter_(improv); } +void HostageEscapeToCoverState::OnUpdate(CHostageImprov *improv) { OnUpdate_(improv); } +void HostageEscapeToCoverState::OnExit(CHostageImprov *improv) { OnExit_(improv); } + +void HostageEscapeToCoverState::OnMoveToFailure(const Vector &goal, MoveToFailureType reason) { OnMoveToFailure_(goal, reason); } +void HostageEscapeToCoverState::OnMoveToFailure_(const Vector &goal, MoveToFailureType reason) +{ + // TODO: why this - 1? Hacks? + // need investigation + HostageEscapeState *escape = (HostageEscapeState *)*((int *)this - 1); + escape->LookAround(); +} + + +void HostageEscapeLookAroundState::OnEnter(CHostageImprov *improv) { OnEnter_(improv); } +void HostageEscapeLookAroundState::OnUpdate(CHostageImprov *improv) { OnUpdate_(improv); } +void HostageEscapeLookAroundState::OnExit(CHostageImprov *improv) { OnExit_(improv); } + +void HostageEscapeState::OnEnter(CHostageImprov *improv) { OnEnter_(improv); } +void HostageEscapeState::OnUpdate(CHostageImprov *improv) { OnUpdate_(improv); } +void HostageEscapeState::OnExit(CHostageImprov *improv) { OnExit_(improv); } + +// hostage_follow +void HostageFollowState::OnEnter(CHostageImprov *improv) { OnEnter_(improv); } +void HostageFollowState::OnUpdate(CHostageImprov *improv) { OnUpdate_(improv); } +void HostageFollowState::OnExit(CHostageImprov *improv) { OnExit_(improv); } +void HostageFollowState::UpdateStationaryAnimation(CHostageImprov *improv) { UpdateStationaryAnimation_(improv); } + +// hostage_animate +void HostageAnimateState::OnEnter(CHostageImprov *improv) { OnEnter_(improv); } +void HostageAnimateState::OnUpdate(CHostageImprov *improv) { OnUpdate_(improv); } +void HostageAnimateState::OnExit(CHostageImprov *improv) { OnExit_(improv); } + +// hostage_retreat +void HostageRetreatState::OnEnter(CHostageImprov *improv) { OnEnter_(improv); } +void HostageRetreatState::OnUpdate(CHostageImprov *improv) { OnUpdate_(improv); } +void HostageRetreatState::OnExit(CHostageImprov *improv) { OnExit_(improv); } + +// cs_bot +void CCSBot::Walk() { 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); } + +// cs_bot_chatter +// 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. +void __declspec(naked) BotPhrase::Randomize() { __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); } + +// cs_bot_event +void CCSBot::OnEvent(GameEventType event, CBaseEntity *entity, CBaseEntity *other) { OnEvent_(event, entity, other); } + +// cs_bot_init +bool CCSBot::Initialize(const BotProfile *profile) { return Initialize_(profile); } +void CCSBot::SpawnBot() { SpawnBot_(); } +void CCSBot::RoundRespawn() { RoundRespawn_(); } + +// cs_bot_manager +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() { ServerActivate_(); } +void CCSBotManager::ServerDeactivate() { ServerDeactivate_(); } +void CCSBotManager::ServerCommand(const char *pcmd) { ServerCommand_(pcmd); } +void CCSBotManager::AddServerCommand(const char *cmd) { AddServerCommand_(cmd); } +void CCSBotManager::AddServerCommands() { AddServerCommands_(); } +void CCSBotManager::RestartRound() { RestartRound_(); } +void CCSBotManager::StartFrame() { 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); } + +// cs_bot_update +void CCSBot::Upkeep() { Upkeep_(); } +void CCSBot::Update() { Update_(); } + +// cs_bot_vision +void __declspec(naked) CCSBot::UpdateLookAngles() { __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); } + +// cs_bot_weapon +void CCSBot::OnTouchingWeapon(CWeaponBox *box) { OnTouchingWeapon_(box); } + +// cs_bot_idle +void IdleState::OnEnter(CCSBot *me) { OnEnter_(me); } +void IdleState::OnUpdate(CCSBot *me) { OnUpdate_(me); } + +// cs_bot_attack +void AttackState::OnEnter(CCSBot *me) { OnEnter_(me); } +void AttackState::OnUpdate(CCSBot *me) { OnUpdate_(me); } +void AttackState::OnExit(CCSBot *me) { OnExit_(me); } + +// cs_bot_buy +void BuyState::OnEnter(CCSBot *me) { OnEnter_(me); } +void BuyState::OnUpdate(CCSBot *me) { OnUpdate_(me); } +void BuyState::OnExit(CCSBot *me) { OnExit_(me); } + +// cs_bot_hide +void HideState::OnEnter(CCSBot *me) { OnEnter_(me); } +void HideState::OnUpdate(CCSBot *me) { OnUpdate_(me); } +void HideState::OnExit(CCSBot *me) { OnExit_(me); } + +// cs_bot_move_to +void MoveToState::OnEnter(CCSBot *me) { OnEnter_(me); } +void MoveToState::OnUpdate(CCSBot *me) { OnUpdate_(me); } +void MoveToState::OnExit(CCSBot *me) { OnExit_(me); } + +// cs_bot_follow +void FollowState::OnEnter(CCSBot *me) { OnEnter_(me); } +void FollowState::OnUpdate(CCSBot *me) { OnUpdate_(me); } +void FollowState::OnExit(CCSBot *me) { OnExit_(me); } + +// cs_bot_hunt +void HuntState::OnEnter(CCSBot *me) { OnEnter_(me); } +void HuntState::OnUpdate(CCSBot *me) { OnUpdate_(me); } +void HuntState::OnExit(CCSBot *me) { OnExit_(me); } + +// cs_bot_investigate_noise +void InvestigateNoiseState::OnEnter(CCSBot *me) { OnEnter_(me); } +void InvestigateNoiseState::OnUpdate(CCSBot *me) { OnUpdate_(me); } +void InvestigateNoiseState::OnExit(CCSBot *me) { OnExit_(me); } + +// cs_bot_plant_bomb +void PlantBombState::OnEnter(CCSBot *me) { OnEnter_(me); } +void PlantBombState::OnUpdate(CCSBot *me) { OnUpdate_(me); } +void PlantBombState::OnExit(CCSBot *me) { OnExit_(me); } + +// cs_bot_defuse_bomb +void DefuseBombState::OnEnter(CCSBot *me) { OnEnter_(me); } +void DefuseBombState::OnUpdate(CCSBot *me) { OnUpdate_(me); } +void DefuseBombState::OnExit(CCSBot *me) { OnExit_(me); } + +// cs_bot_use_entity +void UseEntityState::OnEnter(CCSBot *me) { OnEnter_(me); } +void UseEntityState::OnUpdate(CCSBot *me) { OnUpdate_(me); } +void UseEntityState::OnExit(CCSBot *me) { OnExit_(me); } + +// cs_bot_escape_from_bomb +void EscapeFromBombState::OnEnter(CCSBot *me) { OnEnter_(me); } +void EscapeFromBombState::OnUpdate(CCSBot *me) { OnUpdate_(me); } +void EscapeFromBombState::OnExit(CCSBot *me) { OnExit_(me); } + +// cs_bot_fetch_bomb +void FetchBombState::OnEnter(CCSBot *me) { OnEnter_(me); } +void FetchBombState::OnUpdate(CCSBot *me) { OnUpdate_(me); } + +// bot_manager +void CBotManager::RestartRound() { RestartRound_(); } +void CBotManager::StartFrame() { StartFrame_(); } +void CBotManager::OnEvent(GameEventType event, CBaseEntity *entity, CBaseEntity *other) { return OnEvent_(event, entity, other); } + +// bot +void CBot::Spawn() { Spawn_(); } +Vector CBot::GetAutoaimVector(float flDelta) { return GetAutoaimVector_(flDelta); } +bool CBot::Initialize(const BotProfile *profile) { return Initialize_(profile); } +void CBot::Crouch() { Crouch_(); } +void CBot::StandUp() { StandUp_(); } +void CBot::MoveForward() { MoveForward_(); } +void CBot::MoveBackward() { MoveBackward_(); } +void CBot::StrafeLeft() { StrafeLeft_(); } +void CBot::StrafeRight() { StrafeRight_(); } +bool CBot::Jump(bool mustJump) { return Jump_(mustJump); } +void CBot::ClearMovement() { ClearMovement_(); } +void CBot::UseEnvironment() { UseEnvironment_(); } +void CBot::PrimaryAttack() { PrimaryAttack_(); } +void CBot::ClearPrimaryAttack() { ClearPrimaryAttack_(); } +void CBot::TogglePrimaryAttack() { TogglePrimaryAttack_(); } +void CBot::SecondaryAttack() { SecondaryAttack_(); } +void CBot::Reload() { Reload_(); } +void CBot::ExecuteCommand() { ExecuteCommand_(); } + + +// hostage_improv.h +// NavAreaBuildPath hook +bool NavAreaBuildPath__HostagePathCost__wrapper(CNavArea *startArea, CNavArea *goalArea, const Vector *goalPos, HostagePathCost &costFunc, CNavArea **closestArea) { return NavAreaBuildPath(startArea, goalArea, goalPos, costFunc, closestArea); } + +// NavAreaBuildPath hook +bool NavAreaBuildPath__ShortestPathCost__wrapper(CNavArea *startArea, CNavArea *goalArea, const Vector *goalPos, ShortestPathCost &costFunc, CNavArea **closestArea) { return NavAreaBuildPath(startArea, goalArea, goalPos, costFunc, closestArea); } + +// NavAreaBuildPath hook +bool NavAreaBuildPath__PathCost__wrapper(CNavArea *startArea, CNavArea *goalArea, const Vector *goalPos, PathCost &costFunc, CNavArea **closestArea) { return NavAreaBuildPath(startArea, goalArea, goalPos, costFunc, closestArea); } + +// NavAreaTravelDistance hook +float_precision NavAreaTravelDistance__PathCost__wrapper(CNavArea *startArea, CNavArea *endArea, PathCost &costFunc) { return NavAreaTravelDistance(startArea, endArea, costFunc); } + + +// functions +bool CBot::IsPlayerFacingMe(CBasePlayer *other) const +{ + return IsPlayerFacingMe_(other); +} + +bool CBot::IsPlayerLookingAtMe(CBasePlayer *other) const +{ + return IsPlayerLookingAtMe_(other); +} + +void CBot::SetModel(const char *modelName) +{ + SetModel_(modelName); +} diff --git a/regamedll/hookers/hooker_impl.h b/regamedll/hookers/hooker_impl.h new file mode 100644 index 00000000..b7d143ea --- /dev/null +++ b/regamedll/hookers/hooker_impl.h @@ -0,0 +1,912 @@ +/* +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by the +* Free Software Foundation; either version 2 of the License, or (at +* your option) any later version. +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +* +* In addition, as a special exception, the author gives permission to +* link the code of this program with the Half-Life Game Engine ("HL +* Engine") and Modified Game Libraries ("MODs") developed by Valve, +* L.L.C ("Valve"). You must obey the GNU General Public License in all +* respects for all of the code used other than the HL Engine and MODs +* from Valve. If you modify this file, you may extend this exception +* to your version of the file, but you are not obligated to do so. If +* you do not wish to do so, delete this exception statement from your +* version. +* +*/ + +#ifndef HOOKER_IMPL_H +#define HOOKER_IMPL_H +#ifdef _WIN32 +#pragma once +#endif + +#include "studio.h" +#include "game_shared/voice_common.h" + +class CBaseEntity; +class CBaseMonster; +class CBasePlayer; +class CGrenade; + +class CBot; +class CCSBot; +class CCSBotManager; +class BotStatement; +class BotPhrase; +class CSGameState; + +class CImprov; +class CNavArea; +class HidingSpot; +class CNavNode; +class PathCost; +class ShortestPathCost; +class HostagePathCost; +class CHostageImprov; +class CLocalNav; +class HostageAnimateState; + +class CSave; +class CGraph; +class CRestore; +class CSaveRestoreBuffer; + +#define __MAKE_VHOOK(fname)\ + fname##_ + +#define IMPL IMPLEMENT_ARRAY +#define IMPLEMENT_ARRAY(var)\ + (*p##var) + +#define IMPL_CLASS IMPLEMENT_ARRAY_CLASS +#define IMPLEMENT_ARRAY_CLASS(baseClass,var)\ + (*baseClass::p##var) + +// refs +extern void (CBaseEntity::*pCHostage__IdleThink)(); +extern void (*pBotPhrase__Randomize)(); +extern void (*pCCSBotManager__AddBot)(); +extern void (*pCCSBot__UpdateLookAngles)(); + +// globals export +#define g_engfuncs (*pg_engfuncs) +#define gpGlobals (*pgpGlobals) + +// globals cbase +#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) + +// globals player +#define m_szPoses (*pm_szPoses) +#define g_weaponStruct (*pg_weaponStruct) +#define gEvilImpulse101 (*pgEvilImpulse101) +#define g_szMapBriefingText (*pg_szMapBriefingText) +#define g_pevLastInflictor (*pg_pevLastInflictor) +#define g_pLastSpawn (*pg_pLastSpawn) +#define g_pLastCTSpawn (*pg_pLastCTSpawn) +#define g_pLastTerroristSpawn (*pg_pLastTerroristSpawn) +#define gInitHUD (*pgInitHUD) +#define sv_aim (*psv_aim) +#define zombieSpawnCount (*pzombieSpawnCount) +#define zombieSpawn (*pzombieSpawn) +#define g_pSelectedZombieSpawn (*pg_pSelectedZombieSpawn) +#define giPrecacheGrunt (*pgiPrecacheGrunt) +#define gmsgWeapPickup (*pgmsgWeapPickup) +#define gmsgHudText (*pgmsgHudText) +#define gmsgHudTextArgs (*pgmsgHudTextArgs) +#define gmsgShake (*pgmsgShake) +#define gmsgFade (*pgmsgFade) +#define gmsgFlashlight (*pgmsgFlashlight) +#define gmsgFlashBattery (*pgmsgFlashBattery) +#define gmsgResetHUD (*pgmsgResetHUD) +#define gmsgInitHUD (*pgmsgInitHUD) +#define gmsgViewMode (*pgmsgViewMode) +#define gmsgShowGameTitle (*pgmsgShowGameTitle) +#define gmsgCurWeapon (*pgmsgCurWeapon) +#define gmsgHealth (*pgmsgHealth) +#define gmsgDamage (*pgmsgDamage) +#define gmsgBattery (*pgmsgBattery) +#define gmsgTrain (*pgmsgTrain) +#define gmsgLogo (*pgmsgLogo) +#define gmsgWeaponList (*pgmsgWeaponList) +#define gmsgAmmoX (*pgmsgAmmoX) +#define gmsgDeathMsg (*pgmsgDeathMsg) +#define gmsgScoreAttrib (*pgmsgScoreAttrib) +#define gmsgScoreInfo (*pgmsgScoreInfo) +#define gmsgTeamInfo (*pgmsgTeamInfo) +#define gmsgTeamScore (*pgmsgTeamScore) +#define gmsgGameMode (*pgmsgGameMode) +#define gmsgMOTD (*pgmsgMOTD) +#define gmsgServerName (*pgmsgServerName) +#define gmsgAmmoPickup (*pgmsgAmmoPickup) +#define gmsgItemPickup (*pgmsgItemPickup) +#define gmsgHideWeapon (*pgmsgHideWeapon) +#define gmsgSayText (*pgmsgSayText) +#define gmsgTextMsg (*pgmsgTextMsg) +#define gmsgSetFOV (*pgmsgSetFOV) +#define gmsgShowMenu (*pgmsgShowMenu) +#define gmsgSendAudio (*pgmsgSendAudio) +#define gmsgRoundTime (*pgmsgRoundTime) +#define gmsgMoney (*pgmsgMoney) +#define gmsgBlinkAcct (*pgmsgBlinkAcct) +#define gmsgArmorType (*pgmsgArmorType) +#define gmsgStatusValue (*pgmsgStatusValue) +#define gmsgStatusText (*pgmsgStatusText) +#define gmsgStatusIcon (*pgmsgStatusIcon) +#define gmsgBarTime (*pgmsgBarTime) +#define gmsgReloadSound (*pgmsgReloadSound) +#define gmsgCrosshair (*pgmsgCrosshair) +#define gmsgNVGToggle (*pgmsgNVGToggle) +#define gmsgRadar (*pgmsgRadar) +#define gmsgSpectator (*pgmsgSpectator) +#define gmsgVGUIMenu (*pgmsgVGUIMenu) +#define gmsgCZCareer (*pgmsgCZCareer) +#define gmsgCZCareerHUD (*pgmsgCZCareerHUD) +#define gmsgTaskTime (*pgmsgTaskTime) +#define gmsgTutorText (*pgmsgTutorText) +#define gmsgTutorLine (*pgmsgTutorLine) +#define gmsgShadowIdx (*pgmsgShadowIdx) +#define gmsgTutorState (*pgmsgTutorState) +#define gmsgTutorClose (*pgmsgTutorClose) +#define gmsgAllowSpec (*pgmsgAllowSpec) +#define gmsgBombDrop (*pgmsgBombDrop) +#define gmsgBombPickup (*pgmsgBombPickup) +#define gmsgHostagePos (*pgmsgHostagePos) +#define gmsgHostageK (*pgmsgHostageK) +#define gmsgGeigerRange (*pgmsgGeigerRange) +#define gmsgSendCorpse (*pgmsgSendCorpse) +#define gmsgHLTV (*pgmsgHLTV) +#define gmsgSpecHealth (*pgmsgSpecHealth) +#define gmsgForceCam (*pgmsgForceCam) +#define gmsgADStop (*pgmsgADStop) +#define gmsgReceiveW (*pgmsgReceiveW) +#define gmsgScenarioIcon (*pgmsgScenarioIcon) +#define gmsgBotVoice (*pgmsgBotVoice) +#define gmsgBuyClose (*pgmsgBuyClose) +#define gmsgItemStatus (*pgmsgItemStatus) +#define gmsgLocation (*pgmsgLocation) +#define gmsgSpecHealth2 (*pgmsgSpecHealth2) +#define gmsgBarTime2 (*pgmsgBarTime2) +#define gmsgBotProgress (*pgmsgBotProgress) +#define gmsgBrass (*pgmsgBrass) +#define gmsgFog (*pgmsgFog) +#define gmsgShowTimer (*pgmsgShowTimer) + +// globals skill +#define gSkillData (*pgSkillData) + +// globals career +#define TheCareerTasks (*pTheCareerTasks) +#define taskInfo (*ptaskInfo) + +// globals triggers +#define st_szNextMap (*pst_szNextMap) +#define st_szNextSpot (*pst_szNextSpot) + +// globals animation +#define svBlending (*psvBlending) +#define IEngineStudio (*pIEngineStudio) +#define g_pstudiohdr (*pg_pstudiohdr) +#define g_pRotationMatrix (*pg_pRotationMatrix) +#define g_pBoneTransform (*pg_pBoneTransform) + +// globals sound +#define gszallsentencenames (*pgszallsentencenames) +#define rgsentenceg (*prgsentenceg) +#define fSentencesInit (*pfSentencesInit) +#define gcallsentences (*pgcallsentences) +#define rgdpvpreset (*prgdpvpreset) + +// globals world +#define gDecals (*pgDecals) + +// globals client +#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) + +// globals debug +#define outputLevel (*poutputLevel) +#define theDebugOutputTypes (*ptheDebugOutputTypes) +#define theDebugBuffer (*ptheDebugBuffer) + +// globals func_break +#define pSoundsWood (*ppSoundsWood) +#define pSoundsFlesh (*ppSoundsFlesh) +#define pSoundsGlass (*ppSoundsGlass) +#define pSoundsMetal (*ppSoundsMetal) +#define pSoundsConcrete (*ppSoundsConcrete) +#define pSpawnObjects (*ppSpawnObjects) +#define m_soundNames (*pm_soundNames) + +// globals func_tank +#define gTankSpread (*pgTankSpread) + +// globals game +#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) + +// globals gamerules +#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) + +// globals soundent +#define pSoundEnt (*ppSoundEnt) + +// globals weapons +#define g_sModelIndexLaser (*pg_sModelIndexLaser) +#define g_pModelNameLaser (*pg_pModelNameLaser) +#define g_sModelIndexLaserDot (*pg_sModelIndexLaserDot) +#define g_sModelIndexFireball (*pg_sModelIndexFireball) +#define g_sModelIndexSmoke (*pg_sModelIndexSmoke) +#define g_sModelIndexWExplosion (*pg_sModelIndexWExplosion) +#define g_sModelIndexBubbles (*pg_sModelIndexBubbles) +#define g_sModelIndexBloodDrop (*pg_sModelIndexBloodDrop) +#define g_sModelIndexBloodSpray (*pg_sModelIndexBloodSpray) +#define g_sModelIndexSmokePuff (*pg_sModelIndexSmokePuff) +#define g_sModelIndexFireball2 (*pg_sModelIndexFireball2) +#define g_sModelIndexFireball3 (*pg_sModelIndexFireball3) +#define g_sModelIndexFireball4 (*pg_sModelIndexFireball4) +#define g_sModelIndexCTGhost (*pg_sModelIndexCTGhost) +#define g_sModelIndexTGhost (*pg_sModelIndexTGhost) +#define g_sModelIndexC4Glow (*pg_sModelIndexC4Glow) +#define giAmmoIndex (*pgiAmmoIndex) +#define g_sModelIndexRadio (*pg_sModelIndexRadio) +#define gMultiDamage (*pgMultiDamage) + +// globals weapontype +#define g_autoBuyInfo (*pg_autoBuyInfo) +#define weaponAliasInfo (*pweaponAliasInfo) +#define weaponBuyAliasInfo (*pweaponBuyAliasInfo) +#define weaponClassAliasInfo (*pweaponClassAliasInfo) +#define weaponInfo (*pweaponInfo) + +// globals wolrd +#define g_pBodyQueueHead (*pg_pBodyQueueHead) +#define gGlobalState (*pgGlobalState) +#define g_flWeaponCheat (*pg_flWeaponCheat) +#define gGlobalEntitySaveData (*pgGlobalEntitySaveData) + +// globals globals +#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) + +#define WorldGraph (*pWorldGraph) + +// hostages +#define g_pHostages (*pg_pHostages) +#define g_iHostageNumber (*pg_iHostageNumber) + +#define cv_hostage_debug (*pcv_hostage_debug) +#define cv_hostage_stop (*pcv_hostage_stop) +#define s_flStepSize_LocalNav (*m_LocalNav->ps_flStepSize) + +#define flNextCvarCheck (*pflNextCvarCheck) +#define s_flStepSize (*ps_flStepSize) +#define flLastThinkTime (*pflLastThinkTime) +#define nodeval (*pnodeval) +#define tot_hostages (*ptot_hostages) +#define tot_inqueue (*ptot_inqueue) +#define qptr (*pqptr) +#define _queue (*pqueue) +#define hostages (*phostages) + +// utils +#define gEntvarsDescription (*pgEntvarsDescription) +#define seed_table (*pseed_table) +#define glSeed (*pglSeed) +#define g_groupmask (*pg_groupmask) +#define g_groupop (*pg_groupop) +#define gSizes (*pgSizes) + +// tutor +#define TheTutor (*pTheTutor) +#define g_TutorStateStrings (*pg_TutorStateStrings) +#define TutorIdentifierList (*pTutorIdentifierList) + +#define s_tutorDisabledThisGame (*ps_tutorDisabledThisGame) +#define s_nextCvarCheckTime (*ps_nextCvarCheckTime) + +#define cv_tutor_message_repeats (*pcv_tutor_message_repeats) +#define cv_tutor_debug_level (*pcv_tutor_debug_level) +#define cv_tutor_view_distance (*pcv_tutor_view_distance) +#define cv_tutor_viewable_check_interval (*pcv_tutor_viewable_check_interval) +#define cv_tutor_look_distance (*pcv_tutor_look_distance) +#define cv_tutor_look_angle (*pcv_tutor_look_angle) +#define cv_tutor_examine_time (*pcv_tutor_examine_time) +#define cv_tutor_message_minimum_display_time (*pcv_tutor_message_minimum_display_time) +#define cv_tutor_message_character_display_time_coefficient (*pcv_tutor_message_character_display_time_coefficient) +#define cv_tutor_hint_interval_time (*pcv_tutor_hint_interval_time) + +// bots +#define _navAreaCount (*pnavAreaCount) +#define _currentIndex (*pcurrentIndex) +#define primaryWeaponBuyInfoCT (*pprimaryWeaponBuyInfoCT) +#define secondaryWeaponBuyInfoCT (*psecondaryWeaponBuyInfoCT) +#define primaryWeaponBuyInfoT (*pprimaryWeaponBuyInfoT) +#define secondaryWeaponBuyInfoT (*psecondaryWeaponBuyInfoT) +#define TheBotPhrases (*pTheBotPhrases) +#define g_pSelectedZombieSpawn (*pg_pSelectedZombieSpawn) +#define TheBots (*pTheBots) + +// bot_util +#define s_iBeamSprite (*ps_iBeamSprite) +#define cosTable (*pcosTable) + +#define cv_bot_traceview (*pcv_bot_traceview) +#define cv_bot_stop (*pcv_bot_stop) +#define cv_bot_show_nav (*pcv_bot_show_nav) +#define cv_bot_show_danger (*pcv_bot_show_danger) +#define cv_bot_nav_edit (*pcv_bot_nav_edit) +#define cv_bot_nav_zdraw (*pcv_bot_nav_zdraw) +#define cv_bot_walk (*pcv_bot_walk) +#define cv_bot_difficulty (*pcv_bot_difficulty) +#define cv_bot_debug (*pcv_bot_debug) +#define cv_bot_quicksave (*pcv_bot_quicksave) +#define cv_bot_quota (*pcv_bot_quota) +#define cv_bot_quota_match (*pcv_bot_quota_match) +#define cv_bot_prefix (*pcv_bot_prefix) +#define cv_bot_allow_rogues (*pcv_bot_allow_rogues) +#define cv_bot_allow_pistols (*pcv_bot_allow_pistols) +#define cv_bot_allow_shotguns (*pcv_bot_allow_shotguns) +#define cv_bot_allow_sub_machine_guns (*pcv_bot_allow_sub_machine_guns) +#define cv_bot_allow_rifles (*pcv_bot_allow_rifles) +#define cv_bot_allow_machine_guns (*pcv_bot_allow_machine_guns) +#define cv_bot_allow_grenades (*pcv_bot_allow_grenades) +#define cv_bot_allow_snipers (*pcv_bot_allow_snipers) +#define cv_bot_allow_shield (*pcv_bot_allow_shield) +#define cv_bot_join_team (*pcv_bot_join_team) +#define cv_bot_join_after_player (*pcv_bot_join_after_player) +#define cv_bot_auto_vacate (*pcv_bot_auto_vacate) +#define cv_bot_zombie (*pcv_bot_zombie) +#define cv_bot_defer_to_human (*pcv_bot_defer_to_human) +#define cv_bot_chatter (*pcv_bot_chatter) +#define cv_bot_profile_db (*pcv_bot_profile_db) + +// shared_util +#define s_shared_token (*ps_shared_token) +#define s_shared_quote (*ps_shared_quote) + +// bot util +#define GameEventName (*pGameEventName) + +// voice_gamemgr +#define voice_serverdebug (*pvoice_serverdebug) +#define sv_alltalk (*psv_alltalk) + +#define g_PlayerModEnable (*pg_PlayerModEnable) +#define g_BanMasks (*pg_BanMasks) +#define g_SentGameRulesMasks (*pg_SentGameRulesMasks) +#define g_SentBanMasks (*pg_SentBanMasks) +#define g_bWantModEnable (*pg_bWantModEnable) + +// bot +#define g_flBotCommandInterval (*pg_flBotCommandInterval) +#define g_flBotFullThinkInterval (*pg_flBotFullThinkInterval) +#define BotArgs (*pBotArgs) +#define UseBotArgs (*pUseBotArgs) +#define BotDifficultyName (*pBotDifficultyName) + +// utlsymbol +#define g_LessCtx (*pg_LessCtx) + +// bot_profile +#define TheBotProfiles (*pTheBotProfiles) + +// nav_area +#define TheNavLadderList (*pTheNavLadderList) +#define TheHidingSpotList (*pTheHidingSpotList) +#define TheNavAreaList (*pTheNavAreaList) +#define TheNavAreaGrid (*pTheNavAreaGrid) +#define lastDrawTimestamp (*plastDrawTimestamp) +#define goodSizedAreaList (*pgoodSizedAreaList) +#define markedArea (*pmarkedArea) +#define lastSelectedArea (*plastSelectedArea) +#define markedCorner (*pmarkedCorner) +#define isCreatingNavArea (*pisCreatingNavArea) +#define isAnchored (*pisAnchored) +#define anchor (*panchor) +#define isPlaceMode (*pisPlaceMode) +#define isPlacePainting (*pisPlacePainting) +#define editTimestamp (*peditTimestamp) +#define BlockedID (*pBlockedID) +#define BlockedIDCount (*pBlockedIDCount) + +// nav_node +#define Opposite (*pOpposite) + +// pm_shared +#define pmove (*pg_ppmove) +#define pm_shared_initialized (*ppm_shared_initialized) +#define rgv3tStuckTable (*prgv3tStuckTable) +#define pm_gcTextures (*ppm_gcTextures) +#define pm_grgszTextureName (*ppm_grgszTextureName) +#define pm_grgchTextureType (*ppm_grgchTextureType) +#define rgStuckLast (*prgStuckLast) +#define g_onladder (*pg_onladder) + +// pm_math +#define vec3_origin (*pvec3_origin) +#define nanmask (*pnanmask) + +// 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); +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); +C_DLLEXPORT void ambient_generic(entvars_t *pev); +C_DLLEXPORT void env_sound(entvars_t *pev); +C_DLLEXPORT void speaker(entvars_t *pev); +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); +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); +C_DLLEXPORT void spark_shower(entvars_t *pev); +C_DLLEXPORT void env_explosion(entvars_t *pev); +C_DLLEXPORT void func_breakable(entvars_t *pev); +C_DLLEXPORT void func_pushable(entvars_t *pev); +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); +C_DLLEXPORT void info_map_parameters(entvars_t *pev); +C_DLLEXPORT void weapon_knife(entvars_t *pev); +C_DLLEXPORT void weapon_glock18(entvars_t *pev); +C_DLLEXPORT void weapon_c4(entvars_t *pev); +C_DLLEXPORT void weapon_usp(entvars_t *pev); +C_DLLEXPORT void weapon_smokegrenade(entvars_t *pev); +C_DLLEXPORT void weapon_m4a1(entvars_t *pev); +C_DLLEXPORT void weapon_hegrenade(entvars_t *pev); +C_DLLEXPORT void weapon_flashbang(entvars_t *pev); +C_DLLEXPORT void weapon_famas(entvars_t *pev); +C_DLLEXPORT void weapon_elite(entvars_t *pev); +C_DLLEXPORT void weapon_fiveseven(entvars_t *pev); +C_DLLEXPORT void weapon_p228(entvars_t *pev); +C_DLLEXPORT void weapon_xm1014(entvars_t *pev); +C_DLLEXPORT void weapon_g3sg1(entvars_t *pev); +C_DLLEXPORT void weapon_sg550(entvars_t *pev); +C_DLLEXPORT void weapon_deagle(entvars_t *pev); +C_DLLEXPORT void weapon_awp(entvars_t *pev); +C_DLLEXPORT void weapon_scout(entvars_t *pev); +C_DLLEXPORT void weapon_sg552(entvars_t *pev); +C_DLLEXPORT void weapon_m3(entvars_t *pev); +C_DLLEXPORT void weapon_aug(entvars_t *pev); +C_DLLEXPORT void weapon_galil(entvars_t *pev); +C_DLLEXPORT void weapon_ak47(entvars_t *pev); +C_DLLEXPORT void weapon_m249(entvars_t *pev); +C_DLLEXPORT void weapon_p90(entvars_t *pev); +C_DLLEXPORT void weapon_mac10(entvars_t *pev); +C_DLLEXPORT void weapon_ump45(entvars_t *pev); +C_DLLEXPORT void weapon_mp5navy(entvars_t *pev); +C_DLLEXPORT void weapon_tmp(entvars_t *pev); +C_DLLEXPORT void armoury_entity(entvars_t *pev); +C_DLLEXPORT void weaponbox(entvars_t *pev); +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); +C_DLLEXPORT void game_score(entvars_t *pev); +C_DLLEXPORT void game_end(entvars_t *pev); +C_DLLEXPORT void game_text(entvars_t *pev); +C_DLLEXPORT void game_team_master(entvars_t *pev); +C_DLLEXPORT void game_team_set(entvars_t *pev); +C_DLLEXPORT void game_zone_player(entvars_t *pev); +C_DLLEXPORT void game_player_hurt(entvars_t *pev); +C_DLLEXPORT void game_counter(entvars_t *pev); +C_DLLEXPORT void game_counter_set(entvars_t *pev); +C_DLLEXPORT void game_player_equip(entvars_t *pev); +C_DLLEXPORT void game_player_team(entvars_t *pev); +C_DLLEXPORT void func_mortar_field(entvars_t *pev); +C_DLLEXPORT void monster_mortar(entvars_t *pev); +C_DLLEXPORT void path_corner(entvars_t *pev); +C_DLLEXPORT void func_plat(entvars_t *pev); +C_DLLEXPORT void func_platrot(entvars_t *pev); +C_DLLEXPORT void func_train(entvars_t *pev); +C_DLLEXPORT void func_tracktrain(entvars_t *pev); +C_DLLEXPORT void func_traincontrols(entvars_t *pev); +C_DLLEXPORT void func_trackchange(entvars_t *pev); +C_DLLEXPORT void func_trackautochange(entvars_t *pev); +C_DLLEXPORT void func_guntarget(entvars_t *pev); +C_DLLEXPORT void player(entvars_t *pev); +C_DLLEXPORT void weapon_shield(entvars_t *pev); +C_DLLEXPORT void info_intermission(entvars_t *pev); +C_DLLEXPORT void player_loadsaved(entvars_t *pev); +C_DLLEXPORT void player_weaponstrip(entvars_t *pev); +C_DLLEXPORT void monster_hevsuit_dead(entvars_t *pev); +C_DLLEXPORT void soundent(entvars_t *pev); +C_DLLEXPORT void info_null(entvars_t *pev); +C_DLLEXPORT void info_player_deathmatch(entvars_t *pev); +C_DLLEXPORT void info_player_start(entvars_t *pev); +C_DLLEXPORT void info_vip_start(entvars_t *pev); +C_DLLEXPORT void info_landmark(entvars_t *pev); +C_DLLEXPORT void info_hostage_rescue(entvars_t *pev); +C_DLLEXPORT void info_bomb_target(entvars_t *pev); +C_DLLEXPORT void DelayedUse(entvars_t *pev); +C_DLLEXPORT void func_grencatch(entvars_t *pev); +C_DLLEXPORT void func_weaponcheck(entvars_t *pev); +C_DLLEXPORT void path_track(entvars_t *pev); +C_DLLEXPORT void func_friction(entvars_t *pev); +C_DLLEXPORT void trigger_auto(entvars_t *pev); +C_DLLEXPORT void trigger_relay(entvars_t *pev); +C_DLLEXPORT void multi_manager(entvars_t *pev); +C_DLLEXPORT void env_render(entvars_t *pev); +C_DLLEXPORT void trigger(entvars_t *pev); +C_DLLEXPORT void trigger_hurt(entvars_t *pev); +C_DLLEXPORT void trigger_monsterjump(entvars_t *pev); +C_DLLEXPORT void trigger_cdaudio(entvars_t *pev); +C_DLLEXPORT void target_cdaudio(entvars_t *pev); +C_DLLEXPORT void trigger_multiple(entvars_t *pev); +C_DLLEXPORT void trigger_once(entvars_t *pev); +C_DLLEXPORT void trigger_counter(entvars_t *pev); +C_DLLEXPORT void trigger_transition(entvars_t *pev); +C_DLLEXPORT void fireanddie(entvars_t *pev); +C_DLLEXPORT void trigger_changelevel(entvars_t *pev); +C_DLLEXPORT void func_ladder(entvars_t *pev); +C_DLLEXPORT void trigger_push(entvars_t *pev); +C_DLLEXPORT void trigger_teleport(entvars_t *pev); +C_DLLEXPORT void info_teleport_destination(entvars_t *pev); +C_DLLEXPORT void func_buyzone(entvars_t *pev); +C_DLLEXPORT void func_bomb_target(entvars_t *pev); +C_DLLEXPORT void func_hostage_rescue(entvars_t *pev); +C_DLLEXPORT void func_escapezone(entvars_t *pev); +C_DLLEXPORT void func_vip_safetyzone(entvars_t *pev); +C_DLLEXPORT void trigger_autosave(entvars_t *pev); +C_DLLEXPORT void trigger_endsection(entvars_t *pev); +C_DLLEXPORT void trigger_gravity(entvars_t *pev); +C_DLLEXPORT void trigger_changetarget(entvars_t *pev); +C_DLLEXPORT void trigger_camera(entvars_t *pev); +C_DLLEXPORT void env_snow(entvars_t *pev); +C_DLLEXPORT void func_snow(entvars_t *pev); +C_DLLEXPORT void env_rain(entvars_t *pev); +C_DLLEXPORT void func_rain(entvars_t *pev); +C_DLLEXPORT void env_fog(entvars_t *pev); +C_DLLEXPORT void func_vehicle(entvars_t *pev); +C_DLLEXPORT void func_vehiclecontrols(entvars_t *pev); +C_DLLEXPORT void infodecal(entvars_t *pev); +C_DLLEXPORT void bodyque(entvars_t *pev); +C_DLLEXPORT void worldspawn(entvars_t *pev); +C_DLLEXPORT void hostage_entity(entvars_t *pev); +C_DLLEXPORT void monster_scientist(entvars_t *pev); +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); +C_DLLEXPORT void item_airtank(entvars_t *pev); + + + + + + + + + + +// declared functions +C_DLLEXPORT void WINAPI GiveFnptrsToDll(enginefuncs_t *pEnginefuncsTable, globalvars_t *pGlobals); +bool NavAreaBuildPath__HostagePathCost__wrapper(CNavArea *startArea, CNavArea *goalArea, const Vector *goalPos, HostagePathCost &costFunc, CNavArea **closestArea); +bool NavAreaBuildPath__ShortestPathCost__wrapper(CNavArea *startArea, CNavArea *goalArea, const Vector *goalPos, ShortestPathCost &costFunc, CNavArea **closestArea); +bool NavAreaBuildPath__PathCost__wrapper(CNavArea *startArea, CNavArea *goalArea, const Vector *goalPos, PathCost &costFunc, CNavArea **closestArea); +float_precision NavAreaTravelDistance__PathCost__wrapper(CNavArea *startArea, CNavArea *endArea, PathCost &costFunc); + +//typedef struct server_studio_api_s server_studio_api_t; +//typedef struct sv_blending_interface_s sv_blending_interface_t; + +typedef int (CGraph::*FIND_NEAREST_NODE_ENTITY)(const Vector &, CBaseEntity *); +typedef int (CGraph::*FIND_NEAREST_NODE_INT)(const Vector &, int); +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 *); +typedef bool (CHostageImprov::*IS_FRIEND_IN_THE_WAY_VECTOR)(const Vector &) const; +typedef bool (CHostageImprov::*IS_FRIEND_IN_THE_WAY_CBASE)(CBaseEntity *, const Vector &) const; +typedef bool (CHostageImprov::*IS_FRIEND_IN_THE_WAY)() const; +typedef BOOL (CLocalNav::*PATH_CLEAR_TRACE_RESULT)(Vector &, Vector &, int, TraceResult &); +typedef BOOL (CLocalNav::*PATH_CLEAR_DEFAULT)(Vector &, Vector &, int); +typedef void (HostageAnimateState::*ADD_SEQUENCE_NAME)(CHostageImprov *, const char *, float, float); +typedef void (HostageAnimateState::*ADD_SEQUENCE_NUMBER)(CHostageImprov *, int, float, float); +typedef int (CSaveRestoreBuffer::*ENTITYINDEX_CBASE)(CBaseEntity *); +typedef int (CSaveRestoreBuffer::*ENTITYINDEX_ENTVARS)(entvars_t *); +typedef int (CSaveRestoreBuffer::*ENTITYINDEX_EOFFSET)(EOFFSET); +typedef int (CSaveRestoreBuffer::*ENTITYINDEX_EDICT)(edict_t *); +typedef void (CSave::*WRITESTRING_)(const char *,const char *); +typedef void (CSave::*WRITESTRING_COUNT)(const char *,const int *,int); +typedef void (CSave::*WRITEVECTOR_)(const char *,const Vector &); +typedef void (CSave::*WRITEVECTOR_COUNT)(const char *,const float *,int); +typedef void (CSave::*WRITEPOSITIONVECTOR_)(const char *,const Vector &); +typedef void (CSave::*WRITEPOSITIONVECTOR_COUNT)(const char *,const float *,int); +typedef int (CSaveRestoreBuffer::*CSAVERESTOREBUFFER_VOID)(const char *,const Vector &); +typedef int (CSaveRestoreBuffer::*CSAVERESTOREBUFFER_POINTER)(const char *,const float *,int); +typedef bool (CCSBot::*CS_IS_VISIBLE_VECTOR)(const Vector *, bool) const; +typedef bool (CCSBot::*CS_IS_VISIBLE_CBASEPLAYER)(CBasePlayer *, bool, unsigned char *) const; +typedef const Vector *(FIND_SPOT_CSSBOT)(CCSBot *, float); +typedef void (CCSBot::*HIDE_NAV_AREA)(CNavArea *, float, float, bool); +typedef void (CCSBot::*HIDE_VECTOR)(const Vector *, float, bool); +typedef const CSGameState *(CCSBot::*GETGAMESTATE_CONST)() const; +typedef CSGameState *(CCSBot::*GETGAMESTATE_NOTCONST)(); +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); +typedef CBasePlayer *(*UTIL_GETCLOSE_PLAYER)(const Vector *pos, float *distance); +typedef CBasePlayer *(*UTIL_GETCLOSE_TEAM)(const Vector *pos, int team, float *distance); +typedef Vector (*UTIL_CUMPUTE_ENTVARS)(entvars_t *pevVars); +typedef Vector (*UTIL_CUMPUTE_CBASE)(CBaseEntity *pEntity); +typedef Vector (*UTIL_CUMPUTE_EDICT)(edict_t *pentEdict); +typedef bool (CBot::*IS_VISIBLE_VECTOR)(const Vector *, bool) const; +typedef bool (CBot::*IS_VISIBLE_CBASE_PLAYER)(CBasePlayer *, bool, unsigned char *) const; +typedef bool (CImprov::*IS_FRIEND_INT_THEWAY_VECTOR)(const Vector &goalPos) const; +typedef bool (CImprov::*IS_FRIEND_INT_THEWAY_CBASEENTITY)(CBaseEntity *myFriend, const Vector &goalPos) const; +typedef const Vector *(FIND_SPOT_CBASE)(CBaseEntity *, const Vector *, CNavArea *, float, int, bool); +typedef void (CNavArea::*SAVE_FD)(int fd, unsigned int version); +typedef void (CNavArea::*SAVE_FILE)(FILE *fp) const; +typedef bool (CNavArea::*OVERLAP_VECTOR)(const Vector *pos) const; +typedef bool (CNavArea::*OVERLAP_CNAV)(const CNavArea *area) const; +typedef float (CNavArea::*GETZ_VECTOR)(const Vector *pos) const; +typedef float (CNavArea::*GETZ_TWO_FLOAT)(float x, float y) const; +typedef void (HidingSpot::*HIDING_SPOT_VOID)(); +typedef void (HidingSpot::*HIDING_SPOT_VECTOR)(const Vector *pos, unsigned char flags); +typedef void (HidingSpot::*CNAV_AREA_VOID)(); +typedef void (HidingSpot::*CNAV_AREA_TWO_VECTOR)(const Vector *corner, const Vector *otherCorner); +typedef void (HidingSpot::*CNAV_AREA_VECTOR)(const Vector *nwCorner, const Vector *neCorner, const Vector *seCorner, const Vector *swCorner); +typedef void (HidingSpot::*CNAV_AREA_NAVNODE)(CNavNode *nwNode, class CNavNode *neNode, class CNavNode *seNode, class CNavNode *swNode); + +// externs +extern struct WeaponAliasInfo weaponAliasInfo[39]; +extern struct WeaponBuyAliasInfo weaponBuyAliasInfo[43]; +extern struct WeaponClassAliasInfo weaponClassAliasInfo[46]; +extern struct WeaponInfoStruct weaponInfo[27]; +extern edict_t *g_pBodyQueueHead; +extern TYPEDESCRIPTION gGlobalEntitySaveData[3]; +extern TYPEDESCRIPTION gEntvarsDescription[86]; +extern unsigned int seed_table[256]; +extern unsigned int glSeed; +extern const int gSizes[18]; +extern bool s_tutorDisabledThisGame; +extern float s_nextCvarCheckTime; +extern char *const g_TutorStateStrings[20]; +extern const char *TutorIdentifierList[150]; +extern struct sv_blending_interface_s svBlending; +extern struct server_studio_api_s 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; +extern const struct TaskInfo taskInfo[21]; +extern CMemoryPool hashItemMemPool; +extern BOOL gTouchDisabled; +extern DLL_FUNCTIONS gFunctionTable; +extern NEW_DLL_FUNCTIONS gNewDLLFunctions; +extern char grgszTextureName[1024][17]; +extern char grgchTextureType[1024]; +extern int fTextureTypeInit; +extern struct sentenceg rgsentenceg[200]; +extern int fSentencesInit; +extern int gcallsentences; +extern struct dynpitchvol rgdpvpreset[27]; +extern struct PLAYERPVSSTATUS g_PVSStatus[32]; +extern bool g_bClientPrintEnable; +extern char *sPlayerModelFiles[12]; +extern struct entity_field_alias_t entity_field_alias[6]; +extern struct entity_field_alias_t player_field_alias[3]; +extern struct entity_field_alias_t custom_entity_field_alias[9]; +extern int g_serveractive; +extern struct DebugOutputLevel outputLevel[6]; +extern unsigned int theDebugOutputTypes; +extern char theDebugBuffer[1024]; +extern Vector gTankSpread[5]; +extern class CCStrikeGameMgrHelper g_GameMgrHelper; +extern cvar_t *sv_clienttrace; +extern class CHalfLifeMultiplay *g_pMPGameRules; +extern char mp_com_token[1500]; +extern int giAmmoIndex; +extern char *m_szPoses[4]; +extern struct WeaponStruct g_weaponStruct[32]; +extern int zombieSpawnCount; +extern struct ZombieSpawn zombieSpawn[256]; +extern CBaseEntity *g_pSelectedZombieSpawn; +extern char st_szNextMap[32]; +extern char st_szNextSpot[32]; +extern char s_shared_token[1500]; +extern char s_shared_quote; +extern cvar_t voice_serverdebug; +extern cvar_t sv_alltalk; +extern CPlayerBitVec g_PlayerModEnable; +extern CBitVec< VOICE_MAX_PLAYERS > g_BanMasks[ VOICE_MAX_PLAYERS ]; +extern CBitVec< VOICE_MAX_PLAYERS > g_SentGameRulesMasks[ VOICE_MAX_PLAYERS ]; +extern CBitVec< VOICE_MAX_PLAYERS > g_SentBanMasks[ VOICE_MAX_PLAYERS ]; +extern CPlayerBitVec g_bWantModEnable; +extern struct LessCtx_t g_LessCtx; +extern short s_iBeamSprite; +extern float cosTable[256]; +extern float lastDrawTimestamp; +extern std::list_vs6 goodSizedAreaList; +extern CNavArea *markedArea; +extern CNavArea *lastSelectedArea; +extern enum NavCornerType markedCorner; +extern bool isCreatingNavArea; +extern bool isAnchored; +extern Vector anchor; +extern bool isPlaceMode; +extern bool isPlacePainting; +extern float editTimestamp; +extern unsigned int BlockedID[256]; +extern int BlockedIDCount; +extern enum NavDirType Opposite[4]; +extern int pm_shared_initialized; +extern vec3_t rgv3tStuckTable[54]; +extern int rgStuckLast[32][2]; +extern int g_onladder; +extern int pm_gcTextures; +extern char pm_grgszTextureName[1024][17]; +extern char pm_grgchTextureType[1024]; +extern char *BotDifficultyName[5]; + +#endif // HOOKER_IMPL_H diff --git a/regamedll/hookers/main.cpp b/regamedll/hookers/main.cpp index 30427ac3..6f7df25f 100644 --- a/regamedll/hookers/main.cpp +++ b/regamedll/hookers/main.cpp @@ -46,7 +46,7 @@ #define ORIGINAL_FILESYSTEM_DLL_NAME "filesystem_stdio2.so" #endif -IBaseInterface *CreateFileSystemInterface(void); +IBaseInterface *CreateFileSystemInterface(); InterfaceReg iface = InterfaceReg(CreateFileSystemInterface, "VFileSystem009"); int HookGameDLL(size_t gameAddr, size_t engAddr); @@ -57,7 +57,7 @@ CSysModule *g_pOriginalGameDLLModule = NULL; CreateInterfaceFn g_OriginalFileSystemFactory = NULL; IFileSystem *g_pOriginalFileSystem = NULL; -IBaseInterface *CreateFileSystemInterface(void) +IBaseInterface *CreateFileSystemInterface() { if (g_pOriginalFileSystem) return g_pOriginalFileSystem; diff --git a/regamedll/hookers/main_mp.cpp b/regamedll/hookers/main_mp.cpp index 35dfe65d..15fc95b0 100644 --- a/regamedll/hookers/main_mp.cpp +++ b/regamedll/hookers/main_mp.cpp @@ -39,11 +39,8 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) g_ReGameDLLRuntimeConfig.parseFromCommandLine(GetCommandLineA()); Module hlds_exe; - if (!GetModuleHandle("hl.exe")) + if (FindModuleByName("hlds.exe", &hlds_exe)) { - if (!FindModuleByName("hlds.exe", &hlds_exe)) - return (FALSE); - TestSuite_Init(NULL, &hlds_exe, NULL); } #endif // _WIN32 diff --git a/regamedll/hookers/regamedll_debug.cpp b/regamedll/hookers/regamedll_debug.cpp index ac72b883..e14410ed 100644 --- a/regamedll/hookers/regamedll_debug.cpp +++ b/regamedll/hookers/regamedll_debug.cpp @@ -26,7 +26,7 @@ void Regamedll_Debug_logStrDup(const char *s, void *ptr) g_ReGameDLLDebugLog.flush(); } -void Regamedll_Debug_Init(void) +void Regamedll_Debug_Init() { //g_ReGameDLLDebugLog.exceptions(std::ios::badbit | std::ios::failbit); //g_ReGameDLLDebugLog.open("d:\\REGAME_SERVER\\regamedll_debug.log", std::ios::out | std::ios::binary); @@ -45,7 +45,7 @@ void _print_chat(class CBasePlayer *pPlayer, const char *fmt, ...) Q_strcat(Dest, "\n"); else Dest[Q_strlen(Dest) - 1] = '\n'; - + UTIL_SayText(Dest, (class CBaseEntity *)pPlayer); } @@ -62,7 +62,7 @@ void _print_console(struct entvars_s *pev, const char *fmt, ...) Q_strcat(Dest, "\n"); else Dest[Q_strlen(Dest) - 1] = '\n'; - + ClientPrint(pev, HUD_PRINTCONSOLE, Dest); } @@ -84,14 +84,14 @@ void _printf2(const char *fmt, ...) Q_strcat(Dest, "\n"); else Dest[Q_strlen(Dest) - 1] = '\n'; - + SERVER_PRINT(Dest); } #if defined(HOOK_GAMEDLL) && !defined(REGAMEDLL_UNIT_TESTS) extern int nCountHook; -void Regamedll_Game_Init(void) +void Regamedll_Game_Init() { #ifdef _WIN32 if (g_ReGameDLLRuntimeConfig.disableAllHooks) diff --git a/regamedll/hookers/regamedll_debug.h b/regamedll/hookers/regamedll_debug.h index d3e61ebb..33b14c9a 100644 --- a/regamedll/hookers/regamedll_debug.h +++ b/regamedll/hookers/regamedll_debug.h @@ -10,12 +10,12 @@ extern void Regamedll_Debug_logAlloc(size_t sz, void *ptr); extern void Regamedll_Debug_logRealloc(size_t sz, void *oldPtr, void *newPtr); extern void Regamedll_Debug_logFree(void *ptr); extern void Regamedll_Debug_logStrDup(const char *s, void *ptr); -extern void Regamedll_Debug_Init(void); +extern void Regamedll_Debug_Init(); #endif // _WIN32 #if defined(HOOK_GAMEDLL) && !defined(REGAMEDLL_UNIT_TESTS) -extern void Regamedll_Game_Init(void); +extern void Regamedll_Game_Init(); #endif // HOOK_GAMEDLL extern void _printf2(const char *fmt, ...); diff --git a/regamedll/msvc/ReGameDLL.vcxproj b/regamedll/msvc/ReGameDLL.vcxproj index 4a286a43..d2348f36 100644 --- a/regamedll/msvc/ReGameDLL.vcxproj +++ b/regamedll/msvc/ReGameDLL.vcxproj @@ -17,6 +17,10 @@ Debug Win32 + + Release MP Play + Win32 + Release MP Win32 @@ -45,6 +49,7 @@ false false false + false false false false @@ -56,6 +61,8 @@ + + @@ -64,6 +71,7 @@ false false false + false false false false @@ -75,6 +83,8 @@ + + @@ -86,6 +96,8 @@ + + false @@ -96,6 +108,7 @@ false false false + false false false false @@ -107,6 +120,8 @@ + + @@ -115,6 +130,7 @@ false false false + false false false false @@ -124,6 +140,7 @@ false false false + false false false false @@ -136,6 +153,8 @@ + + false @@ -149,6 +168,8 @@ + + false @@ -161,6 +182,8 @@ + + @@ -168,6 +191,7 @@ false false false + false false @@ -175,6 +199,7 @@ false false false + false false false false @@ -183,6 +208,7 @@ false false false + false false @@ -190,6 +216,7 @@ false false false + false false false false @@ -199,6 +226,7 @@ false false false + false false false false @@ -208,6 +236,7 @@ false false false + false false false false @@ -217,6 +246,7 @@ false false false + false false false false @@ -226,6 +256,7 @@ false false false + false false false false @@ -235,6 +266,7 @@ false false false + false false false false @@ -244,6 +276,7 @@ false false false + false false false false @@ -253,6 +286,7 @@ false false false + false false false false @@ -262,6 +296,7 @@ false false false + false false false false @@ -271,6 +306,7 @@ false false false + false false false false @@ -280,6 +316,7 @@ false false false + false false false false @@ -289,6 +326,7 @@ false false false + false false false false @@ -298,6 +336,7 @@ false false false + false false false false @@ -324,6 +363,7 @@ false false false + false false @@ -331,6 +371,7 @@ false false false + false false @@ -338,6 +379,7 @@ false false false + false false @@ -345,6 +387,7 @@ false false false + false false @@ -352,6 +395,7 @@ false false false + false false @@ -359,6 +403,7 @@ false false false + false false @@ -366,6 +411,7 @@ false false false + false false @@ -373,6 +419,7 @@ false false false + false false @@ -417,6 +464,7 @@ false false false + false false false false @@ -426,6 +474,7 @@ false false false + false false false false @@ -435,6 +484,7 @@ false false false + false false false false @@ -444,6 +494,7 @@ false false false + false false false false @@ -453,6 +504,7 @@ false false false + false false false false @@ -462,6 +514,7 @@ false false false + false false false false @@ -471,6 +524,7 @@ false false false + false false false false @@ -480,6 +534,7 @@ false false false + false false false false @@ -489,6 +544,7 @@ false false false + false false false false @@ -498,6 +554,7 @@ false false false + false false false false @@ -507,6 +564,7 @@ false false false + false false false false @@ -516,6 +574,7 @@ false false false + false false false false @@ -525,6 +584,7 @@ false false false + false false false false @@ -534,6 +594,7 @@ false false false + false false false false @@ -543,6 +604,7 @@ false false false + false false false false @@ -552,6 +614,7 @@ false false false + false false false false @@ -561,6 +624,7 @@ false false false + false false false false @@ -570,6 +634,7 @@ false false false + false false false false @@ -579,6 +644,7 @@ false false false + false false false false @@ -588,6 +654,7 @@ false false false + false false false false @@ -597,6 +664,7 @@ false false false + false false false false @@ -606,6 +674,7 @@ false false false + false false false false @@ -615,6 +684,7 @@ false false false + false false false false @@ -624,6 +694,7 @@ false false false + false false false false @@ -633,6 +704,7 @@ false false false + false false false false @@ -642,6 +714,7 @@ false false false + false false false false @@ -651,6 +724,7 @@ false false false + false false false false @@ -659,6 +733,7 @@ false false false + false false false false @@ -669,6 +744,7 @@ false false false + false false false false @@ -687,17 +763,26 @@ true true + true true true true true + true true + + true + true + true + true + true true + true true @@ -706,6 +791,7 @@ true true true + true true @@ -714,6 +800,7 @@ true true + true @@ -723,8 +810,30 @@ - - + + + + + + + + + + true + true + true + true + + + true + true + true + true + true + true + true + true + @@ -739,10 +848,12 @@ Create Create Create + Create Create precompiled.h precompiled.h precompiled.h + precompiled.h precompiled.h Create precompiled.h @@ -754,45 +865,53 @@ true true + true true true + true true true + true true true + true true true + true true true true + true true true true + true true true true + true true @@ -830,6 +949,8 @@ + + @@ -840,6 +961,8 @@ + + @@ -850,6 +973,8 @@ + + @@ -857,6 +982,7 @@ false false false + false false @@ -956,6 +1082,7 @@ + @@ -1035,6 +1162,7 @@ true true true + true true true @@ -1043,14 +1171,12 @@ true true true + true true true - - {792df067-9904-4579-99b9-46c17277ade3} - {ceb94f7c-e459-4673-aabb-36e2074396c0} false @@ -1090,6 +1216,13 @@ v120 true + + DynamicLibrary + true + MultiByte + v120 + true + DynamicLibrary true @@ -1131,6 +1264,9 @@ + + + @@ -1170,6 +1306,13 @@ + + mp + AllRules.ruleset + + + + mp AllRules.ruleset @@ -1323,7 +1466,52 @@ Level3 Full true - REGAMEDLL_ADD;REGAMEDLL_SELF;REGAMEDLL_CHECKS;CLIENT_WEAPONS;USE_BREAKPAD_HANDLER;DEDICATED;_CRT_SECURE_NO_WARNINGS;NDEBUG;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) + REGAMEDLL_ADD;REGAMEDLL_FIXES;REGAMEDLL_SELF;REGAMEDLL_CHECKS;CLIENT_WEAPONS;USE_BREAKPAD_HANDLER;DEDICATED;_CRT_SECURE_NO_WARNINGS;NDEBUG;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) + Precise + /arch:IA32 %(AdditionalOptions) + MultiThreaded + Use + precompiled.h + ProgramDatabase + true + false + Default + true + true + + + true + psapi.lib;ws2_32.lib;$(ProjectDir)../lib/steam_api.lib;%(AdditionalDependencies) + + + mp.def + $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories) + true + true + true + + + IF EXIST "$(ProjectDir)PostBuild_mp.bat" (CALL "$(ProjectDir)PostBuild_mp.bat" "$(TargetDir)" "$(TargetName)" "$(TargetExt)" "$(ProjectDir)") + Automatic deployment script + + + echo Empty Action + Force build to run Pre-Build event + subversion.always.run + subversion.always.run + + + + + IF EXIST "$(ProjectDir)PreBuild.bat" (CALL "$(ProjectDir)PreBuild.bat" "$(ProjectDir)..\version\" "$(ProjectDir)..\") + Setup version from Git revision + + + $(ProjectDir)\..\;$(ProjectDir)\..\hookers\;$(ProjectDir)\..\common;$(ProjectDir)\..\dlls;$(ProjectDir)\..\engine;$(ProjectDir)\..\public;$(ProjectDir)\..\public\regamedll;$(ProjectDir)\..\pm_shared;$(ProjectDir)\..\regamedll\;$(ProjectDir)\..\testsuite\;$(VCInstallDir)UnitTest\include;$(SolutionDir)..\dep\bzip2\include\;$(SolutionDir)..\dep\cppunitlite\include\;%(AdditionalIncludeDirectories) + Level3 + Full + true + REGAMEDLL_SELF;REGAMEDLL_CHECKS;CLIENT_WEAPONS;USE_BREAKPAD_HANDLER;DEDICATED;_CRT_SECURE_NO_WARNINGS;NDEBUG;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions) Precise /arch:IA32 %(AdditionalOptions) MultiThreaded diff --git a/regamedll/msvc/ReGameDLL.vcxproj.filters b/regamedll/msvc/ReGameDLL.vcxproj.filters index 8e4fe551..1295749c 100644 --- a/regamedll/msvc/ReGameDLL.vcxproj.filters +++ b/regamedll/msvc/ReGameDLL.vcxproj.filters @@ -573,6 +573,9 @@ regamedll + + hookers + @@ -1142,6 +1145,9 @@ game_shared\bot + + hookers + diff --git a/regamedll/pm_shared/pm_debug.cpp b/regamedll/pm_shared/pm_debug.cpp index e4aede47..782587e3 100644 --- a/regamedll/pm_shared/pm_debug.cpp +++ b/regamedll/pm_shared/pm_debug.cpp @@ -5,7 +5,7 @@ // Expand debugging BBOX particle hulls by this many units. #define BOX_GAP 0.0f -static int PM_boxpnt[6][4] = +int PM_boxpnt[6][4] = { { 0, 4, 6, 2 }, // +X { 0, 1, 5, 4 }, // +Y @@ -16,7 +16,7 @@ static int PM_boxpnt[6][4] = }; /* <2d0110> ../cstrike/pm_shared/pm_debug.c:43 */ -void PM_ShowClipBox(void) +void PM_ShowClipBox() { #ifdef _DEBUG if (!pmove->runfuncs) @@ -202,7 +202,7 @@ void PM_DrawBBox(vec3_t mins, vec3_t maxs, vec3_t origin, int pcolor, float life // Tries to shoot a ray out by about 128 units. /* <2d03e9> ../cstrike/pm_shared/pm_debug.c:260 */ -void PM_ViewEntity(void) +void PM_ViewEntity() { vec3_t forward, right, up; float raydist = 256.0f; diff --git a/regamedll/pm_shared/pm_debug.h b/regamedll/pm_shared/pm_debug.h index 6323a607..9ab4a955 100644 --- a/regamedll/pm_shared/pm_debug.h +++ b/regamedll/pm_shared/pm_debug.h @@ -32,11 +32,11 @@ #pragma once #endif -void PM_ShowClipBox(void); +void PM_ShowClipBox(); void PM_ParticleLine(vec3_t start, vec3_t end, int pcolor, float life, float vert); void PM_DrawRectangle(vec3_t tl, vec3_t bl, vec3_t tr, vec3_t br, int pcolor, float life); void PM_DrawPhysEntBBox(int num, int pcolor, float life); void PM_DrawBBox(vec3_t mins, vec3_t maxs, vec3_t origin, int pcolor, float life); -void PM_ViewEntity(void); +void PM_ViewEntity(); #endif // PM_DEBUG_H diff --git a/regamedll/pm_shared/pm_defs.h b/regamedll/pm_shared/pm_defs.h index 7ac088de..4ecbf003 100644 --- a/regamedll/pm_shared/pm_defs.h +++ b/regamedll/pm_shared/pm_defs.h @@ -94,7 +94,6 @@ typedef struct physent_s vec3_t vuser4; } physent_t; -/* size: 224, cachelines: 4, members: 33 */ typedef struct playermove_s { @@ -173,7 +172,7 @@ typedef struct playermove_s void (*Con_NPrintf)(int idx, char *fmt, ...); void (*Con_DPrintf)(char *fmt, ...); void (*Con_Printf)(char *fmt, ...); - double (*Sys_FloatTime)(void); + double (*Sys_FloatTime)(); void (*PM_StuckTouch)(int hitent, pmtrace_t *ptraceresult); int (*PM_PointContents)(float *p, int *truecontents); int (*PM_TruePointContents)(float *p); @@ -196,6 +195,5 @@ typedef struct playermove_s void (*PM_PlaybackEventFull)(int flags, int clientindex, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); } playermove_t; -/* size: 325056, cachelines: 5079, members: 94 */ #endif // PM_DEFS_H diff --git a/regamedll/pm_shared/pm_math.cpp b/regamedll/pm_shared/pm_math.cpp index fd114d7e..f677336e 100644 --- a/regamedll/pm_shared/pm_math.cpp +++ b/regamedll/pm_shared/pm_math.cpp @@ -8,11 +8,6 @@ vec3_t vec3_origin = {0, 0, 0}; int nanmask = 255<<23; -#else - -vec3_t vec3_origin; -int nanmask; - #endif // HOOK_GAMEDLL /* <2ce436> ../cstrike/pm_shared/pm_math.c:35 */ @@ -250,6 +245,7 @@ int VectorCompare(const vec_t *v1, const vec_t *v2) if (v1[i] != v2[i]) return 0; } + return 1; } @@ -360,7 +356,7 @@ int Q_log2(int val) { int answer = 0; while (val >>= 1) - answer++; + ++answer; return answer; } @@ -382,7 +378,10 @@ void VectorMatrix(vec_t *forward, vec_t *right, vec_t *up) return; } - tmp[0] = 0; tmp[1] = 0; tmp[2] = 1.0; + tmp[0] = 0; + tmp[1] = 0; + tmp[2] = 1.0f; + _CrossProduct(forward, tmp, right); VectorNormalize(right); _CrossProduct(right, forward, up); @@ -408,7 +407,7 @@ void VectorAngles(const vec_t *forward, vec_t *angles) if (yaw < 0) yaw += 360; - tmp = sqrt (forward[0]*forward[0] + forward[1]*forward[1]); + tmp = sqrt (forward[0] * forward[0] + forward[1] * forward[1]); pitch = (atan2(forward[2], tmp) * 180 / M_PI); if (pitch < 0) pitch += 360; diff --git a/regamedll/pm_shared/pm_math.h b/regamedll/pm_shared/pm_math.h index 16dfe22a..894aa59c 100644 --- a/regamedll/pm_shared/pm_math.h +++ b/regamedll/pm_shared/pm_math.h @@ -36,13 +36,6 @@ #define YAW 1 // left/right #define ROLL 2 // fall over -#ifdef HOOK_GAMEDLL - -#define vec3_origin (*pvec3_origin) -#define nanmask (*pnanmask) - -#endif // HOOK_GAMEDLL - extern vec3_t vec3_origin; extern int nanmask; diff --git a/regamedll/pm_shared/pm_shared.cpp b/regamedll/pm_shared/pm_shared.cpp index 84686afc..1af9d5c8 100644 --- a/regamedll/pm_shared/pm_shared.cpp +++ b/regamedll/pm_shared/pm_shared.cpp @@ -5,31 +5,17 @@ */ #ifndef HOOK_GAMEDLL -static int pm_shared_initialized = 0; - -static vec3_t rgv3tStuckTable[54]; -static int rgStuckLast[MAX_CLIENTS][2]; - -static int pm_gcTextures = 0; -static char pm_grgszTextureName[1024][17]; -static char pm_grgchTextureType[1024]; - -playermove_t *pmove = NULL; -int g_onladder = 0; - -#else // HOOK_GAMEDLL - -int pm_shared_initialized; +int pm_shared_initialized = 0; vec3_t rgv3tStuckTable[54]; int rgStuckLast[MAX_CLIENTS][2]; -int pm_gcTextures; -char pm_grgszTextureName[CTEXTURESMAX][CBTEXTURENAMEMAX]; -char pm_grgchTextureType[CTEXTURESMAX]; +int pm_gcTextures = 0; +char pm_grgszTextureName[1024][17]; +char pm_grgchTextureType[1024]; -playermove_t *pmove; -int g_onladder; +playermove_t *pmove = NULL; +int g_onladder = 0; #endif // HOOK_GAMEDLL @@ -50,7 +36,7 @@ void PM_SwapTextures(int i, int j) } /* <2cc691> ../cstrike/pm_shared/pm_shared.c:180 */ -NOXREF int PM_IsThereGrassTexture(void) +NOXREF int PM_IsThereGrassTexture() { int i; @@ -64,7 +50,7 @@ NOXREF int PM_IsThereGrassTexture(void) } /* <2cc6bb> ../cstrike/pm_shared/pm_shared.c:193 */ -void PM_SortTextures(void) +void PM_SortTextures() { // Bubble sort, yuck, but this only occurs at startup and it's only 512 elements... int i, j; @@ -83,7 +69,7 @@ void PM_SortTextures(void) } /* <2cc720> ../cstrike/pm_shared/pm_shared.c:213 */ -void PM_InitTextureTypes(void) +void PM_InitTextureTypes() { char buffer[512]; int i, j; @@ -360,7 +346,7 @@ int PM_MapTextureTypeStepType(char chTextureType) } /* <2cc8af> ../cstrike/pm_shared/pm_shared.c:512 */ -void PM_CatagorizeTextureType(void) +void PM_CatagorizeTextureType() { vec3_t start, end; const char *pTextureName; @@ -395,7 +381,7 @@ void PM_CatagorizeTextureType(void) } /* <2cc93c> ../cstrike/pm_shared/pm_shared.c:546 */ -void PM_UpdateStepSound(void) +void PM_UpdateStepSound() { float fvol; vec3_t knee; @@ -552,7 +538,7 @@ qboolean PM_AddToTouched(pmtrace_t tr, vec_t *impactvelocity) } /* <2cca88> ../cstrike/pm_shared/pm_shared.c:707 */ -void PM_CheckVelocity(void) +void PM_CheckVelocity() { int i; @@ -637,7 +623,7 @@ int PM_ClipVelocity(vec_t *in, vec_t *normal, vec_t *out, float overbounce) } /* <2ccc93> ../cstrike/pm_shared/pm_shared.c:784 */ -void PM_AddCorrectGravity(void) +void PM_AddCorrectGravity() { float_precision ent_gravity; @@ -660,7 +646,7 @@ void PM_AddCorrectGravity(void) } /* <2cc482> ../cstrike/pm_shared/pm_shared.c:806 */ -void PM_FixupGravityVelocity(void) +void PM_FixupGravityVelocity() { float_precision ent_gravity; @@ -678,7 +664,7 @@ void PM_FixupGravityVelocity(void) } /* <2ccd08> ../cstrike/pm_shared/pm_shared.c:831 */ -int PM_FlyMove(void) +int PM_FlyMove() { int bumpcount, numbumps; vec3_t dir; @@ -754,7 +740,7 @@ int PM_FlyMove(void) // Save entity that blocked us (since fraction was < 1.0) // for contact - // Add it if it's not already in the list!!! + // Add it if it's not already in the list PM_AddToTouched(trace, pmove->velocity); // If the plane we hit has a high z component in the normal, then @@ -900,7 +886,7 @@ void PM_Accelerate(vec_t *wishdir, float_precision wishspeed, float accel) // Only used by players. Moves along the ground when player is a MOVETYPE_WALK. /* <2cceaf> ../cstrike/pm_shared/pm_shared.c:1071 */ -void PM_WalkMove(void) +void PM_WalkMove() { int clip; int oldonground; @@ -1090,7 +1076,7 @@ usedown: // Handles both ground friction and water friction /* <2ccffb> ../cstrike/pm_shared/pm_shared.c:1249 */ -void PM_Friction(void) +void PM_Friction() { float *vel; float speed; @@ -1215,7 +1201,7 @@ void PM_AirAccelerate(vec_t *wishdir, float wishspeed, float accel) } /* <2cd14b> ../cstrike/pm_shared/pm_shared.c:1368 */ -void PM_WaterMove(void) +void PM_WaterMove() { int i; vec3_t wishvel; @@ -1323,7 +1309,7 @@ void PM_WaterMove(void) } /* <2cd220> ../cstrike/pm_shared/pm_shared.c:1464 */ -void PM_AirMove(void) +void PM_AirMove() { int i; vec3_t wishvel; @@ -1372,7 +1358,7 @@ void PM_AirMove(void) } /* <2cc586> ../cstrike/pm_shared/pm_shared.c:1510 */ -qboolean PM_InWater(void) +qboolean PM_InWater() { return (pmove->waterlevel > 1); } @@ -1380,7 +1366,7 @@ qboolean PM_InWater(void) // Sets pmove->waterlevel and pmove->watertype values. /* <2cd2a7> ../cstrike/pm_shared/pm_shared.c:1522 */ -qboolean PM_CheckWater(void) +qboolean PM_CheckWater() { vec3_t point; int cont; @@ -1451,7 +1437,7 @@ qboolean PM_CheckWater(void) } /* <2cd33a> ../cstrike/pm_shared/pm_shared.c:1593 */ -void PM_CatagorizePosition(void) +void PM_CatagorizePosition() { vec3_t point; pmtrace_t tr; @@ -1542,7 +1528,7 @@ void PM_ResetStuckOffsets(int nIndex, int server) // allow for the cut precision of the net coordinates /* <2cd3cf> ../cstrike/pm_shared/pm_shared.c:1681 */ -int PM_CheckStuck(void) +int PM_CheckStuck() { vec3_t base; vec3_t offset; @@ -1662,7 +1648,7 @@ int PM_CheckStuck(void) } /* <2cd61f> ../cstrike/pm_shared/pm_shared.c:1807 */ -void PM_SpectatorMove(void) +void PM_SpectatorMove() { float_precision speed, drop, friction; float_precision control, newspeed; @@ -1839,7 +1825,7 @@ void PM_FixPlayerCrouchStuck(int direction) } /* <2cd7cd> ../cstrike/pm_shared/pm_shared.c:1983 */ -void PM_Duck(void) +void PM_Duck() { float_precision duckFraction; @@ -2079,7 +2065,7 @@ void PM_LadderMove(physent_t *pLadder) } /* <2cda06> ../cstrike/pm_shared/pm_shared.c:2457 */ -physent_t *PM_Ladder(void) +physent_t *PM_Ladder() { int i; physent_t *pe; @@ -2113,7 +2099,7 @@ physent_t *PM_Ladder(void) } /* <2cda77> ../cstrike/pm_shared/pm_shared.c:2491 */ -void PM_WaterJump(void) +void PM_WaterJump() { if (pmove->waterjumptime > 10000) { @@ -2138,7 +2124,7 @@ void PM_WaterJump(void) } /* <2cda8d> ../cstrike/pm_shared/pm_shared.c:2519 */ -void PM_AddGravity(void) +void PM_AddGravity() { float ent_gravity; @@ -2178,7 +2164,7 @@ pmtrace_t PM_PushEntity(vec_t *push) } /* <2cdb13> ../cstrike/pm_shared/pm_shared.c:2569 */ -void PM_Physics_Toss(void) +void PM_Physics_Toss() { pmtrace_t trace; vec3_t move; @@ -2284,7 +2270,7 @@ void PM_Physics_Toss(void) } /* <2cdba2> ../cstrike/pm_shared/pm_shared.c:2674 */ -void PM_NoClip(void) +void PM_NoClip() { int i; vec3_t wishvel; @@ -2318,7 +2304,7 @@ void PM_NoClip(void) // movement logic does. /* <2ccab0> ../cstrike/pm_shared/pm_shared.c:2711 */ -void PM_PreventMegaBunnyJumping(void) +void PM_PreventMegaBunnyJumping() { // Current player speed float_precision spd; @@ -2346,7 +2332,7 @@ void PM_PreventMegaBunnyJumping(void) } /* <2cc541> ../cstrike/pm_shared/pm_shared.c:2741 */ -void PM_Jump(void) +void PM_Jump() { if (pmove->dead) { @@ -2469,12 +2455,14 @@ void PM_Jump(void) else #endif // REGAMEDLL_ADD { - pmove->velocity[2] = sqrt((float_precision)(2 * 800 * 45.0f)); + // NOTE: don't do it in .f (float) + pmove->velocity[2] = sqrt(2.0 * 800.0f * 45.0f); } if (pmove->fuser2 > 0.0f) { - float_precision flRatio = (100 - pmove->fuser2 * 0.001f * 19.0f) * 0.01f; + // NOTE: don't do it in .f (float) + float_precision flRatio = (100.0 - pmove->fuser2 * 0.001 * 19.0) * 0.01; pmove->velocity[2] *= flRatio; } @@ -2489,7 +2477,7 @@ void PM_Jump(void) } /* <2cdc4b> ../cstrike/pm_shared/pm_shared.c:2869 */ -void PM_CheckWaterJump(void) +void PM_CheckWaterJump() { vec3_t vecStart, vecEnd; vec3_t flatforward; @@ -2565,7 +2553,7 @@ void PM_CheckWaterJump(void) } /* <2cdcd3> ../cstrike/pm_shared/pm_shared.c:2933 */ -void PM_CheckFalling(void) +void PM_CheckFalling() { if (pmove->onground != -1 && !pmove->dead && pmove->flFallVelocity >= PM_PLAYER_FALL_PUNCH_THRESHHOLD) { @@ -2614,7 +2602,7 @@ void PM_CheckFalling(void) } /* <2cdd60> ../cstrike/pm_shared/pm_shared.c:2988 */ -void PM_PlayWaterSounds(void) +void PM_PlayWaterSounds() { // Did we enter or leave water? if (pmove->oldwaterlevel != 0) @@ -2678,12 +2666,12 @@ void PM_DropPunchAngle(vec_t *punchangle) len = Q_max(len, 0.0); #else len = Q_max(len, 0.0f); -#endif // HOOK_GAMEDLL +#endif // PLAY_GAMEDLL VectorScale(punchangle, len, punchangle); } /* <2cdeb8> ../cstrike/pm_shared/pm_shared.c:3069 */ -void PM_CheckParamters(void) +void PM_CheckParamters() { float spd; float_precision maxspeed; @@ -2746,7 +2734,7 @@ void PM_CheckParamters(void) } /* <2cdfc3> ../cstrike/pm_shared/pm_shared.c:3136 */ -void PM_ReduceTimers(void) +void PM_ReduceTimers() { if (pmove->flTimeStepSound > 0) { @@ -2790,7 +2778,7 @@ void PM_ReduceTimers(void) } /* <2cc577> ../cstrike/pm_shared/pm_shared.c:3203 */ -qboolean PM_ShouldDoSpectMode(void) +qboolean PM_ShouldDoSpectMode() { return (pmove->iuser3 <= 0 || pmove->deadflag == DEAD_DEAD); } @@ -3052,7 +3040,7 @@ void PM_PlayerMove(qboolean server) } /* <2ce101> ../cstrike/pm_shared/pm_shared.c:3479 */ -void PM_CreateStuckTable(void) +void PM_CreateStuckTable() { float x, y, z; diff --git a/regamedll/pm_shared/pm_shared.h b/regamedll/pm_shared/pm_shared.h index ebed44a8..407278de 100644 --- a/regamedll/pm_shared/pm_shared.h +++ b/regamedll/pm_shared/pm_shared.h @@ -79,84 +79,62 @@ // Only allow bunny jumping up to 1.2x server / player maxspeed setting #define BUNNYJUMP_MAX_SPEED_FACTOR 1.2f -#ifdef HOOK_GAMEDLL - -#define pmove (*pg_ppmove) -#define pm_shared_initialized (*ppm_shared_initialized) -#define rgv3tStuckTable (*prgv3tStuckTable) - -#define pm_gcTextures (*ppm_gcTextures) -#define pm_grgszTextureName (*ppm_grgszTextureName) -#define pm_grgchTextureType (*ppm_grgchTextureType) -#define rgStuckLast (*prgStuckLast) -#define g_onladder (*pg_onladder) - -#endif // HOOK_GAMEDLL - -extern playermove_t *pmove; -extern int pm_shared_initialized; -extern vec3_t rgv3tStuckTable[54]; -extern int rgStuckLast[MAX_CLIENTS][2]; -extern int g_onladder; - -extern int pm_gcTextures; -extern char pm_grgszTextureName[ CTEXTURESMAX ][ CBTEXTURENAMEMAX ]; -extern char pm_grgchTextureType[ CTEXTURESMAX ]; - void PM_SwapTextures(int i, int j); -NOXREF int PM_IsThereGrassTexture(void); -void PM_SortTextures(void); -void PM_InitTextureTypes(void); +NOXREF int PM_IsThereGrassTexture(); +void PM_SortTextures(); +void PM_InitTextureTypes(); char PM_FindTextureType(char *name); void PM_PlayStepSound(int step, float fvol); int PM_MapTextureTypeStepType(char chTextureType); -void PM_CatagorizeTextureType(void); -void PM_UpdateStepSound(void); +void PM_CatagorizeTextureType(); +void PM_UpdateStepSound(); qboolean PM_AddToTouched(pmtrace_t tr, vec_t *impactvelocity); -void PM_CheckVelocity(void); +void PM_CheckVelocity(); int PM_ClipVelocity(vec_t *in, vec_t *normal, vec_t *out, float overbounce); -void PM_AddCorrectGravity(void); -void PM_FixupGravityVelocity(void); -int PM_FlyMove(void); +void PM_AddCorrectGravity(); +void PM_FixupGravityVelocity(); +int PM_FlyMove(); void PM_Accelerate(vec_t *wishdir, float_precision wishspeed, float accel); -void PM_WalkMove(void); -void PM_Friction(void); +void PM_WalkMove(); +void PM_Friction(); void PM_AirAccelerate(vec_t *wishdir, float wishspeed, float accel); -void PM_WaterMove(void); -void PM_AirMove(void); -qboolean PM_InWater(void); -qboolean PM_CheckWater(void); -void PM_CatagorizePosition(void); +void PM_WaterMove(); +void PM_AirMove(); +qboolean PM_InWater(); +qboolean PM_CheckWater(); +void PM_CatagorizePosition(); int PM_GetRandomStuckOffsets(int nIndex, int server, vec_t *offset); void PM_ResetStuckOffsets(int nIndex, int server); -int PM_CheckStuck(void); -void PM_SpectatorMove(void); +int PM_CheckStuck(); +void PM_SpectatorMove(); float PM_SplineFraction(float value, float scale); NOXREF float PM_SimpleSpline(float value); void PM_FixPlayerCrouchStuck(int direction); -void PM_Duck(void); +void PM_Duck(); void PM_LadderMove(physent_t *pLadder); -physent_t *PM_Ladder(void); -void PM_WaterJump(void); -void PM_AddGravity(void); +physent_t *PM_Ladder(); +void PM_WaterJump(); +void PM_AddGravity(); pmtrace_t PM_PushEntity(vec_t *push); -void PM_Physics_Toss(void); -void PM_NoClip(void); -void PM_PreventMegaBunnyJumping(void); -void PM_Jump(void); -void PM_CheckWaterJump(void); -void PM_CheckFalling(void); -void PM_PlayWaterSounds(void); +void PM_Physics_Toss(); +void PM_NoClip(); +void PM_PreventMegaBunnyJumping(); +void PM_Jump(); +void PM_CheckWaterJump(); +void PM_CheckFalling(); +void PM_PlayWaterSounds(); float PM_CalcRoll(vec_t *angles, vec_t *velocity, float rollangle, float rollspeed); void PM_DropPunchAngle(vec_t *punchangle); -void PM_CheckParamters(void); -void PM_ReduceTimers(void); -qboolean PM_ShouldDoSpectMode(void); +void PM_CheckParamters(); +void PM_ReduceTimers(); +qboolean PM_ShouldDoSpectMode(); void PM_PlayerMove(qboolean server); -void PM_CreateStuckTable(void); +void PM_CreateStuckTable(); void PM_Move(struct playermove_s *ppmove, int server); NOXREF int PM_GetVisEntInfo(int ent); NOXREF int PM_GetPhysEntInfo(int ent); void PM_Init(struct playermove_s *ppmove); +extern playermove_t *pmove; + #endif // PM_SHARED_H diff --git a/regamedll/public/MemPool.cpp b/regamedll/public/MemPool.cpp index 7856a0bc..269c607c 100644 --- a/regamedll/public/MemPool.cpp +++ b/regamedll/public/MemPool.cpp @@ -15,14 +15,14 @@ CMemoryPool::CMemoryPool(int blockSize, int numElements) } /* <3fe967> ../public/MemPool.cpp:52 */ -CMemoryPool::~CMemoryPool(void) +CMemoryPool::~CMemoryPool() { - for (int i = 0; i < _numBlobs; i++) + for (int i = 0; i < _numBlobs; ++i) free(_memBlob[i]); } /* <3fe99c> ../public/MemPool.cpp:109 */ -void CMemoryPool::AddNewBlob(void) +void CMemoryPool::AddNewBlob() { int sizeMultiplier = pow(2.0, _numBlobs); int nElements = _blocksPerBlob * sizeMultiplier; @@ -43,7 +43,7 @@ void CMemoryPool::AddNewBlob(void) #endif // _WIN32 void **newBlob = (void **)_headOfFreeList; - for (int j = 0; j < nElements - 1; j++) + for (int j = 0; j < nElements - 1; ++j) { newBlob[0] = (char *)newBlob + _blockSize; newBlob = (void **)newBlob[0]; @@ -52,7 +52,7 @@ void CMemoryPool::AddNewBlob(void) newBlob[0] = NULL; _numElements += nElements; - _numBlobs++; + ++_numBlobs; #ifdef _WIN32 if (_numBlobs >= MAX_BLOBS - 1) @@ -68,7 +68,7 @@ void *CMemoryPool::Alloc(unsigned int amount) if (amount > (unsigned int)_blockSize) return NULL; - _blocksAllocated++; + ++_blocksAllocated; _peakAlloc = Q_max(_peakAlloc, _blocksAllocated); if (_blocksAllocated >= _numElements) @@ -94,7 +94,7 @@ void CMemoryPool::Free(void *memblock) Q_memset(memblock, 0xDD, _blockSize); #endif // _DEBUG - _blocksAllocated--; + --_blocksAllocated; *((void **)memblock) = _headOfFreeList; _headOfFreeList = memblock; } diff --git a/regamedll/public/MemPool.h b/regamedll/public/MemPool.h index 49427427..79a11ea1 100644 --- a/regamedll/public/MemPool.h +++ b/regamedll/public/MemPool.h @@ -37,20 +37,15 @@ class CMemoryPool { public: CMemoryPool(int blockSize, int numElements); - ~CMemoryPool(void); -public: + ~CMemoryPool(); + void *Alloc(unsigned int amount); void Free(void *memblock); - int Count(void) - { - return _blocksAllocated; - } - void AddNewBlob(void); + int Count() { return _blocksAllocated; } + void AddNewBlob(); + public: - enum - { - MAX_BLOBS = 16 - }; + enum { MAX_BLOBS = 16 }; int _blockSize; int _blocksPerBlob; @@ -60,7 +55,6 @@ public: int _numBlobs; int _peakAlloc; int _blocksAllocated; - -};/* size: 92, cachelines: 2, members: 8 */ +}; #endif // MEMPOOL_H diff --git a/regamedll/public/utlsymbol.cpp b/regamedll/public/utlsymbol.cpp index 31aec6f2..27bf0196 100644 --- a/regamedll/public/utlsymbol.cpp +++ b/regamedll/public/utlsymbol.cpp @@ -5,19 +5,16 @@ */ #ifndef HOOK_GAMEDLL -static LessCtx_t g_LessCtx; -CUtlSymbolTable *CUtlSymbol::s_pSymbolTable = 0; - -#else - LessCtx_t g_LessCtx; -CUtlSymbolTable *CUtlSymbol::s_pSymbolTable; #endif // HOOK_GAMEDLL +CUtlSymbolTable *CUtlSymbol::s_pSymbolTable = 0; + /* <401141> ../public/utlsymbol.cpp:31 */ -void CUtlSymbol::Initialize(void) +void CUtlSymbol::Initialize() { + // necessary to allow us to create global symbols static bool symbolsInitialized = false; if (!symbolsInitialized) { @@ -27,127 +24,108 @@ void CUtlSymbol::Initialize(void) } /* <40125f> ../public/utlsymbol.cpp:42 */ -NOBODY CUtlSymbolTable *CUtlSymbol::CurrTable(void) +CUtlSymbolTable *CUtlSymbol::CurrTable() { -// Initialize(void); // 44 - return NULL; + Initialize(); + return s_pSymbolTable; } /* <403946> ../public/utlsymbol.cpp:53 */ -NOBODY CUtlSymbol::CUtlSymbol(const char *pStr) +CUtlSymbol::CUtlSymbol(const char *pStr) { -// CurrTable(void); // 55 + m_Id = CurrTable()->AddString(pStr); } /* <4013a8> ../public/utlsymbol.cpp:58 */ -NOBODY const char *CUtlSymbol::String(void) const +const char *CUtlSymbol::String() const { -// CurrTable(void); // 60 -// String(const class CUtlSymbolTable *const this, -// class CUtlSymbol id); // 60 - return NULL; + return CurrTable()->String(m_Id); } /* <40154b> ../public/utlsymbol.cpp:67 */ -NOBODY bool CUtlSymbol::operator==(const char *pStr) const +bool CUtlSymbol::operator==(const char *pStr) const { -// String(const class CUtlSymbol *const this); // 71 - return false; + if (m_Id == UTL_INVAL_SYMBOL) + return false; + + return Q_strcmp(String(), pStr) == 0; } /* <40104d> ../public/utlsymbol.cpp:91 */ -NOBODY bool CUtlSymbolTable::SymLess(const unsigned int &i1, const unsigned int &i2) +bool CUtlSymbolTable::SymLess(const unsigned int &i1, const unsigned int &i2) { -// { -// const char *str1; // 93 -// const char *str2; // 95 -// operator[](CUtlVector *const this, -// int i); // 94 -// operator[](CUtlVector *const this, -// int i); // 96 -// } - return false; + const char *str1 = g_LessCtx.m_pTable->String(i1); + const char *str2 = g_LessCtx.m_pTable->String(i2); + + return Q_strcmp(str1, str2) < 0; } /* <400f73> ../public/utlsymbol.cpp:102 */ -NOBODY bool CUtlSymbolTable::SymLessi(const unsigned int &i1, const unsigned int &i2) +bool CUtlSymbolTable::SymLessi(const unsigned int &i1, const unsigned int &i2) { -// { -// const char *str1; // 104 -// const char *str2; // 106 -// operator[](CUtlVector *const this, -// int i); // 105 -// operator[](CUtlVector *const this, -// int i); // 107 -// } - return false; + const char *str1 = g_LessCtx.m_pTable->String(i1); + const char *str2 = g_LessCtx.m_pTable->String(i2); + + return Q_stricmp(str1, str2) < 0; } /* <4016f4> ../public/utlsymbol.cpp:120 */ -NOBODY CUtlSymbolTable::CUtlSymbolTable(int growSize, int initSize, bool caseInsensitive) +CUtlSymbolTable::CUtlSymbolTable(int growSize, int initSize, bool caseInsensitive) : + m_Lookup(growSize, initSize, caseInsensitive ? SymLessi : SymLess), + m_Strings(256) { -// CUtlRBTree(CUtlRBTree *const this, -// int growSize, -// int initSize, -// LessFunc_t lessfunc); // 121 -// CUtlVector(CUtlVector *const this, -// int growSize, -// int initSize); // 121 + ; } /* <401823> ../public/utlsymbol.cpp:125 */ -NOBODY CUtlSymbolTable::~CUtlSymbolTable(void) +CUtlSymbolTable::~CUtlSymbolTable() { -// ~CUtlVector(CUtlVector::~CUtlSymbolTable(// int const __in_chrg); // 125 -// ~CUtlRBTree(CUtlRBTree *const this, -// int const __in_chrg); // 125 + // Release the stringpool string data + RemoveAll(); } /* <4019b0> ../public/utlsymbol.cpp:130 */ -NOBODY CUtlSymbol CUtlSymbolTable::Find(const char *pString) const +CUtlSymbol CUtlSymbolTable::Find(const char *pString) const { -// { -// UtlSymId_t idx; // 141 -// Find(const class CUtlRBTree *const this, -// const unsigned int &search); // 141 -// CUtlSymbol(CUtlSymbol *const this, -// UtlSymId_t id); // 142 -// CUtlSymbol(CUtlSymbol *const this); // 133 -// } + // Passing this special invalid symbol makes the comparison function + // use the string passed in the context + UtlSymId_t idx = m_Lookup.Find(UTL_INVAL_SYMBOL); + return CUtlSymbol(idx); } +// Finds and/or creates a symbol based on the string + /* <40358d> ../public/utlsymbol.cpp:150 */ -NOBODY CUtlSymbol CUtlSymbolTable::AddString(const char *pString) +CUtlSymbol CUtlSymbolTable::AddString(const char *pString) { -// { -// class CUtlSymbol id; // 155 -// int len; // 161 -// int stridx; // 162 -// UtlSymId_t idx; // 164 -// IsValid(const class CUtlSymbol *const this); // 157 -// CUtlSymbol(CUtlSymbol *const this, -// UtlSymId_t id); // 165 -// AddMultipleToTail(CUtlVector *const this, -// int num); // 162 -// Insert(CUtlRBTree *const this, -// const unsigned int &insert); // 164 -// CUtlSymbol(CUtlSymbol *const this, -// UtlSymId_t id); // 153 -// } + if (!pString) + return CUtlSymbol(UTL_INVAL_SYMBOL); + + CUtlSymbol id = Find(pString); + + if (id.IsValid()) + return id; + + int len = Q_strlen(pString) + 1; + int stridx = m_Strings.AddMultipleToTail(len); + + UtlSymId_t idx = m_Lookup.Insert(stridx); + return CUtlSymbol(idx); } /* <401b8f> ../public/utlsymbol.cpp:173 */ -NOBODY const char *CUtlSymbolTable::String(CUtlSymbol id) const +const char *CUtlSymbolTable::String(CUtlSymbol id) const { -// IsValid(const class CUtlSymbol *const this); // 175 -// operator[](const class CUtlVector *const this, -// int i); // 179 - return NULL; + if (!id.IsValid()) + return ""; + + assert(m_Lookup.IsValidIndex((UtlSymId_t)id)); + return &m_Strings[id]; } /* <401c10> ../public/utlsymbol.cpp:187 */ -NOBODY void CUtlSymbolTable::RemoveAll(void) +void CUtlSymbolTable::RemoveAll() { -// RemoveAll(CUtlRBTree *const this); // 189 -// RemoveAll(CUtlVector *const this); // 190 + m_Lookup.RemoveAll(); + m_Strings.RemoveAll(); } diff --git a/regamedll/public/utlsymbol.h b/regamedll/public/utlsymbol.h index 245b187f..cf95bff6 100644 --- a/regamedll/public/utlsymbol.h +++ b/regamedll/public/utlsymbol.h @@ -43,9 +43,9 @@ struct LessCtx_t { char const *m_pUserString; CUtlSymbolTable *m_pTable; - + LessCtx_t() : m_pUserString(0), m_pTable(0) {} -};/* size: 8, cachelines: 1, members: 2 */ +}; /* <400e59> ../public/utlsymbol.h:46 */ class CUtlSymbol @@ -56,41 +56,31 @@ public: CUtlSymbol(UtlSymId_t id) : m_Id(id) {} CUtlSymbol(const char* pStr); CUtlSymbol(CUtlSymbol const &sym) : m_Id(sym.m_Id) {} - + // operator= CUtlSymbol &operator=(CUtlSymbol const &src) { m_Id = src.m_Id; return *this; } + // operator== - bool operator==(CUtlSymbol const &src) const - { - return m_Id == src.m_Id; - } + bool operator==(CUtlSymbol const &src) const { return m_Id == src.m_Id; } bool operator==(const char *pStr) const; + // Is valid? - bool IsValid() const - { - return m_Id != UTL_INVAL_SYMBOL; - } - // Gets at the symbol - operator UtlSymId_t/* const*/() const // warning #858 - { - return m_Id; - } - // Gets the string associated with the symbol - const char *String() const; + bool IsValid() const { return m_Id != UTL_INVAL_SYMBOL; } + + operator UtlSymId_t/* const*/() const { return m_Id; } // Gets at the symbol + const char *String() const; // Gets the string associated with the symbol protected: - // Initializes the symbol table - static void Initialize(void); - // returns the current symbol table - static CUtlSymbolTable *CurrTable(void); + static void Initialize(); // Initializes the symbol table + static CUtlSymbolTable *CurrTable(); // returns the current symbol table UtlSymId_t m_Id; static CUtlSymbolTable *s_pSymbolTable; -};/* size: 2, cachelines: 1, members: 2 */ +}; class CUtlSymbolTable { @@ -99,31 +89,19 @@ public: CUtlSymbolTable(int growSize = 0,int initSize = 32,bool caseInsensitive = false); ~CUtlSymbolTable(); - // Finds and/or creates a symbol based on the string - CUtlSymbol AddString(const char *pString); + CUtlSymbol AddString(const char *pString); // Finds and/or creates a symbol based on the string + CUtlSymbol Find(const char *pString) const; // Finds the symbol for pString - // Finds the symbol for pString - CUtlSymbol Find(const char *pString) const; + const char *String(CUtlSymbol id) const; // Look up the string associated with a particular symbol + void RemoveAll(); // Remove all symbols in the table - // Look up the string associated with a particular symbol - const char *String(CUtlSymbol id) const; - - // Remove all symbols in the table. - void RemoveAll(void); public: static bool SymLess(const unsigned int &i1, const unsigned int &i2); static bool SymLessi(const unsigned int &i1, const unsigned int &i2); + protected: CUtlRBTree m_Lookup; CUtlVector m_Strings; -};/* size: 44, cachelines: 1, members: 2 */ - -#ifdef HOOK_GAMEDLL - -#define g_LessCtx (*pg_LessCtx) - -#endif // HOOK_GAMEDLL - -extern LessCtx_t g_LessCtx; +}; #endif // UTL_SYMBOL_H diff --git a/regamedll/public/utlvector.h b/regamedll/public/utlvector.h index d46f5aa8..5b8e0aec 100644 --- a/regamedll/public/utlvector.h +++ b/regamedll/public/utlvector.h @@ -5,9 +5,8 @@ #endif #include "utlmemory.h" -//#include "tier0/platform.h" -template< class T > +template class CUtlVector { public: @@ -551,7 +550,7 @@ void CUtlVector::Purge() template inline void CUtlVector::PurgeAndDeleteElements() { - for(int i=0; i < m_Size; i++) + for (int i = 0; i < m_Size; i++) delete Element(i); Purge(); diff --git a/regamedll/regamedll/RegameDLLRuntimeConfig.cpp b/regamedll/regamedll/RegameDLLRuntimeConfig.cpp index 1c039751..59c7cf1f 100644 --- a/regamedll/regamedll/RegameDLLRuntimeConfig.cpp +++ b/regamedll/regamedll/RegameDLLRuntimeConfig.cpp @@ -11,7 +11,7 @@ CRegameDLLRuntimeConfig::CRegameDLLRuntimeConfig() testPlayerMode = TPM_DISABLE; } -void CRegameDLLRuntimeConfig::parseFromConfigFile(void) +void CRegameDLLRuntimeConfig::parseFromConfigFile() { #ifdef _WIN32 diff --git a/regamedll/regamedll/RegameDLLRuntimeConfig.h b/regamedll/regamedll/RegameDLLRuntimeConfig.h index eba87b4b..05bb9640 100644 --- a/regamedll/regamedll/RegameDLLRuntimeConfig.h +++ b/regamedll/regamedll/RegameDLLRuntimeConfig.h @@ -20,7 +20,7 @@ public: char testConfigFileName[260]; TestPlayerMode testPlayerMode; - void parseFromConfigFile(void); + void parseFromConfigFile(); void parseFromCommandLine(const char *cmdLine); }; diff --git a/regamedll/regamedll/classes_dummy.cpp b/regamedll/regamedll/classes_dummy.cpp index c31c14d0..564860cb 100644 --- a/regamedll/regamedll/classes_dummy.cpp +++ b/regamedll/regamedll/classes_dummy.cpp @@ -11,68 +11,68 @@ class CDummyWeaponClass: public CXM1014 { public: - virtual void Precache(void) {}; + virtual void Precache() {}; virtual int Save(CSave &save) { return 0; }; virtual int Restore(CRestore &restore) { return 0; }; virtual int AddToPlayer(CBasePlayer *pPlayer) { return 0; }; virtual int AddDuplicate(CBasePlayerItem *pItem) { return 0; }; - virtual BOOL CanDeploy(void) { return FALSE; }; - virtual BOOL IsWeapon(void) { return TRUE; } + virtual BOOL CanDeploy() { return FALSE; }; + virtual BOOL IsWeapon() { return TRUE; } virtual void Holster(int skiplocal = 0) {}; - virtual void UpdateItemInfo(void) {}; - virtual void ItemPostFrame(void) {}; - virtual int PrimaryAmmoIndex(void) { return 0; }; - virtual int SecondaryAmmoIndex(void) { return 0; }; + virtual void UpdateItemInfo() {}; + virtual void ItemPostFrame() {}; + virtual int PrimaryAmmoIndex() { return 0; }; + virtual int SecondaryAmmoIndex() { return 0; }; virtual int UpdateClientData(CBasePlayer *pPlayer) { return 0; }; - virtual CBasePlayerItem *GetWeaponPtr(void) { return NULL; } + virtual CBasePlayerItem *GetWeaponPtr() { return NULL; } virtual int ExtractAmmo(CBasePlayerWeapon *pWeapon) { return 0; }; virtual int ExtractClipAmmo(CBasePlayerWeapon *pWeapon) { return 0; }; - virtual int AddWeapon(void) { return 0; } - virtual BOOL PlayEmptySound(void) { return FALSE; }; - virtual void ResetEmptySound(void) {}; + virtual int AddWeapon() { return 0; } + virtual BOOL PlayEmptySound() { return FALSE; }; + virtual void ResetEmptySound() {}; virtual void SendWeaponAnim(int iAnim, int skiplocal = 0) {}; - virtual BOOL IsUseable(void) { return FALSE; }; - virtual void PrimaryAttack(void) {}; - virtual void SecondaryAttack(void) {}; - virtual void Reload(void) {}; - virtual void WeaponIdle(void) {}; - virtual void RetireWeapon(void) {}; - virtual BOOL ShouldWeaponIdle(void) { return FALSE; } - virtual BOOL UseDecrement(void) { return FALSE; } + virtual BOOL IsUseable() { return FALSE; }; + virtual void PrimaryAttack() {}; + virtual void SecondaryAttack() {}; + virtual void Reload() {}; + virtual void WeaponIdle() {}; + virtual void RetireWeapon() {}; + virtual BOOL ShouldWeaponIdle() { return FALSE; } + virtual BOOL UseDecrement() { return FALSE; } }; class CDummyWeaponClassExtra: public CDummyWeaponClass { public: - virtual void Precache(void) {}; + virtual void Precache() {}; virtual int Save(CSave &save) { return 0; }; virtual int Restore(CRestore &restore) { return 0; }; virtual int AddToPlayer(CBasePlayer *pPlayer) { return 0; }; virtual int AddDuplicate(CBasePlayerItem *pItem) { return 0; }; - virtual BOOL CanDeploy(void) { return FALSE; }; - virtual BOOL IsWeapon(void) { return TRUE; } + virtual BOOL CanDeploy() { return FALSE; }; + virtual BOOL IsWeapon() { return TRUE; } virtual void Holster(int skiplocal = 0) {}; - virtual void UpdateItemInfo(void) {}; - virtual void ItemPostFrame(void) {}; - virtual int PrimaryAmmoIndex(void) { return 0; }; - virtual int SecondaryAmmoIndex(void) { return 0; }; + virtual void UpdateItemInfo() {}; + virtual void ItemPostFrame() {}; + virtual int PrimaryAmmoIndex() { return 0; }; + virtual int SecondaryAmmoIndex() { return 0; }; virtual int UpdateClientData(CBasePlayer *pPlayer) { return 0; }; - virtual CBasePlayerItem *GetWeaponPtr(void) { return NULL; } + virtual CBasePlayerItem *GetWeaponPtr() { return NULL; } virtual int ExtractAmmo(CBasePlayerWeapon *pWeapon) { return 0; }; virtual int ExtractClipAmmo(CBasePlayerWeapon *pWeapon) { return 0; }; - virtual int AddWeapon(void) { return 0; } - virtual BOOL PlayEmptySound(void) { return FALSE; }; - virtual void ResetEmptySound(void) {}; + virtual int AddWeapon() { return 0; } + virtual BOOL PlayEmptySound() { return FALSE; }; + virtual void ResetEmptySound() {}; virtual void SendWeaponAnim(int iAnim, int skiplocal = 0) {}; - virtual BOOL IsUseable(void) { return FALSE; }; - virtual void PrimaryAttack(void) {}; - virtual void SecondaryAttack(void) {}; - virtual void Reload(void) {}; - virtual void WeaponIdle(void) {}; - virtual void RetireWeapon(void) {}; - virtual BOOL ShouldWeaponIdle(void) { return FALSE; } - virtual BOOL UseDecrement(void) { return FALSE; } + virtual BOOL IsUseable() { return FALSE; }; + virtual void PrimaryAttack() {}; + virtual void SecondaryAttack() {}; + virtual void Reload() {}; + virtual void WeaponIdle() {}; + virtual void RetireWeapon() {}; + virtual BOOL ShouldWeaponIdle() { return FALSE; } + virtual BOOL UseDecrement() { return FALSE; } }; volatile CDummyWeaponClass *g_pDummyWeaponClass = &CDummyWeaponClass(); diff --git a/regamedll/regamedll/dlls.h b/regamedll/regamedll/dlls.h index b346ed0d..973f1e12 100644 --- a/regamedll/regamedll/dlls.h +++ b/regamedll/regamedll/dlls.h @@ -29,6 +29,11 @@ #include "mathlib.h" #include "extdll.h" +// declared virtual function's and globals for hooks +#ifdef HOOK_GAMEDLL +#include "hooker_impl.h" +#endif // HOOK_GAMEDLL + #include "h_export.h" #include "schedule.h" #include "archtypes.h" diff --git a/regamedll/regamedll/precompiled.h b/regamedll/regamedll/precompiled.h index fcc5a235..f0819824 100644 --- a/regamedll/regamedll/precompiled.h +++ b/regamedll/regamedll/precompiled.h @@ -20,7 +20,6 @@ // STL containers Visual Studio 6.0 #include "stl/vector" #include "stl/list" - #endif // HOOK_GAMEDLL //valve libs stuff @@ -31,9 +30,6 @@ #include "basetypes.h" #include "interface.h" -#include "utlbuffer.h" -#include "utlrbtree.h" -#include "utlsymbol.h" //testsuite #include "testsuite/testsuite.h" @@ -41,8 +37,6 @@ #include "testsuite/recorder.h" #include "testsuite/demoplayer.h" -#include "bzip2/bzlib.h" - #include "hookchains_impl.h" #include "regamedll_interfaces.h" #include "regamedll_interfaces_impl.h"