diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 2e3bcc8f..219f0946 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -22,6 +22,10 @@ dependencies { compile 'org.doomedsociety.gradlecpp:gradle-cpp-plugin:1.2' compile 'org.eclipse.jgit:org.eclipse.jgit:3.7.0.201502260915-r' + compile 'org.apache.commons:commons-compress:1.9' + compile 'org.apache.ant:ant-compress:1.2' + compile 'org.apache.ant:ant:1.9.6' + //compile 'org.tmatesoft.svnkit:svnkit:1.8.5' //compile 'org.apache.velocity:velocity-tools:2.0' diff --git a/buildSrc/src/main/groovy/gradlecpp/RegameDLLPlayTestTask.groovy b/buildSrc/src/main/groovy/gradlecpp/RegameDLLPlayTestTask.groovy index e21609e4..4b58e713 100644 --- a/buildSrc/src/main/groovy/gradlecpp/RegameDLLPlayTestTask.groovy +++ b/buildSrc/src/main/groovy/gradlecpp/RegameDLLPlayTestTask.groovy @@ -39,15 +39,21 @@ class RegamedllPlayTestTask extends DefaultTask { TeamCityIntegration.suiteStarted("regamedllDemo.${testFor.name}") int failCount = 0; - testDemos.getFiles().each { f -> + testDemos.getFiles().each { f -> + + demoRunner.prepareEngine(); def testInfo = RegamedllTestParser.parseTestInfo(f) + TeamCityIntegration.testStarted(testInfo.testName) if (!TeamCityIntegration.writeOutput) { - print "Running ReGameDLL_CS test demo ${testInfo.testName} " + println "Running ReGameDLL_CS test demo ${testInfo.testName} " System.out.flush() } + println "Preparing files for test demo ${testInfo.testName} " + + demoRunner.prepareDemo(f) def testRes = demoRunner.runTest(testInfo, regamedllTestLogs) diff --git a/buildSrc/src/main/groovy/regamedll/testdemo/RegameDLLDemoRunner.groovy b/buildSrc/src/main/groovy/regamedll/testdemo/RegameDLLDemoRunner.groovy index 4a192be3..47e214fe 100644 --- a/buildSrc/src/main/groovy/regamedll/testdemo/RegameDLLDemoRunner.groovy +++ b/buildSrc/src/main/groovy/regamedll/testdemo/RegameDLLDemoRunner.groovy @@ -7,6 +7,8 @@ import dirsync.model.tree.DirectoryNode import dirsync.model.tree.FSMapper import dirsync.model.tree.ZipData import dirsync.model.tree.ZipTreeMapper +import org.apache.ant.compress.taskdefs.Unzip +import org.apache.tools.ant.types.PatternSet; class RegamedllDemoRunner { ZipTreeMapper regamedllImage = new ZipTreeMapper() @@ -30,6 +32,29 @@ class RegamedllDemoRunner { this.postExtract = postExtract } + void prepareDemo(File demoArchive) { + + if (demoArchive == null) { + throw new RuntimeException("ReGameDLL_CS testdemos: file is null") + } + + PatternSet patt = new PatternSet(); + + patt.setExcludes("**/*.bin"); + patt.setExcludes("**/*.xml"); + + //patt.setIncludes("**/cstrike/*"); + //patt.setIncludes("**/czero/*"); + //patt.setIncludes("**/valve/*"); + + Unzip unzipper = new Unzip(); + + unzipper.setDest( rootDir ); // directory unzipped + unzipper.setSrc( demoArchive ); // zip file + unzipper.addPatternset( patt ); + unzipper.execute(); + } + void prepareEngine() { def existingTree = FileSystemTreeBuilder.buildFileSystemTree(rootDir) def cmds = FileTreeComparator.mergeTrees(engineImageTree, existingTree) @@ -43,12 +68,14 @@ class RegamedllDemoRunner { TestResult runTest(RegamedllTestInfo info, File testLogDir) { long startTime = System.currentTimeMillis() - prepareEngine() + + //prepareEngine() def outPath = new File(testLogDir, "${info.testName}_run.log") def cmdParams = [] cmdParams << new File(rootDir, 'hlds.exe').absolutePath + cmdParams.addAll(info.hldsArgs) if (info.regamedllExtraArgs) { cmdParams.addAll(info.regamedllExtraArgs) @@ -58,7 +85,6 @@ class RegamedllDemoRunner { def pb = new ProcessBuilder(cmdParams).redirectErrorStream(true).directory(rootDir) def sout = new StringBuffer() - def p = pb.start() p.consumeProcessOutput(sout, sout) diff --git a/regamedll/build.gradle b/regamedll/build.gradle index 0350ad74..26299cc4 100644 --- a/regamedll/build.gradle +++ b/regamedll/build.gradle @@ -19,6 +19,7 @@ import org.gradle.nativeplatform.SharedLibraryBinarySpec import regamedll.testdemo.RegamedllDemoRunner import versioning.RegamedllVersionInfo import org.apache.commons.io.FilenameUtils +import org.apache.commons.compress.archivers.ArchiveInputStream apply plugin: 'cpp' apply plugin: IccCompilerPlugin @@ -37,6 +38,7 @@ configurations { dependencies { regamedll_tests 'regamedll.testdemos:cstrike-fulltests-2:2.0' + regamedll_tests 'regamedll.testdemos:czero-ladder_hard:2.0' //regamedll_tests 'regamedll.testdemos:cstrike-multiplayer-2:2.0' //regamedll_tests 'regamedll.testdemos:cstrike-hostage-2:2.0' //regamedll_tests 'regamedll.testdemos:cstrike-weapon-1:1.0' @@ -125,7 +127,7 @@ void setupToolchain(NativeBinarySpec b) { } b.lib LazyNativeDepSet.create(dep_bzip2, 'bzip2', b.buildType.name, true) - cfg.singleDefines 'USE_BREAKPAD_HANDLER', 'DEDICATED', 'REGAMEDLL_SELF', 'HOOK_GAMEDLL' + cfg.singleDefines 'USE_BREAKPAD_HANDLER', 'DEDICATED', 'REGAMEDLL_SELF', 'HOOK_GAMEDLL', 'BUILD_GRADLE' if (cfg instanceof MsvcToolchainConfig) { @@ -367,7 +369,8 @@ task prepareDevEnvGamedll << { def regamedllImage = new File(project.projectDir, gamedllDir) regamedllImage.mkdirs() def demoRunner = new RegamedllDemoRunner(project.configurations.regamedll_playtest_image.getFiles(), regamedllImage, null) - demoRunner.prepareGamedll() + demoRunner.prepareEngine() + //demoRunner.prepareDemo() } } diff --git a/regamedll/dlls/airtank.cpp b/regamedll/dlls/airtank.cpp index 7da61e07..049947cc 100644 --- a/regamedll/dlls/airtank.cpp +++ b/regamedll/dlls/airtank.cpp @@ -12,7 +12,7 @@ TYPEDESCRIPTION CAirtank::m_SaveData[] = #else -TYPEDESCRIPTION (*CAirtank::m_SaveData)[1]; +TYPEDESCRIPTION (*CAirtank::pm_SaveData)[1]; #endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/airtank.h b/regamedll/dlls/airtank.h index 00aa6df1..04f23915 100644 --- a/regamedll/dlls/airtank.h +++ b/regamedll/dlls/airtank.h @@ -59,14 +59,7 @@ public: #endif // HOOK_GAMEDLL public: - -#ifndef HOOK_GAMEDLL - - static TYPEDESCRIPTION m_SaveData[1]; -#else - static TYPEDESCRIPTION (*m_SaveData)[1]; - -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1]; private: int m_state; diff --git a/regamedll/dlls/animating.cpp b/regamedll/dlls/animating.cpp index 870cdf33..5cfdd7df 100644 --- a/regamedll/dlls/animating.cpp +++ b/regamedll/dlls/animating.cpp @@ -16,7 +16,7 @@ TYPEDESCRIPTION CBaseAnimating::m_SaveData[] = #else -TYPEDESCRIPTION (*CBaseAnimating::m_SaveData)[5]; +TYPEDESCRIPTION (*CBaseAnimating::pm_SaveData)[5]; #endif // HOOK_GAMEDLL @@ -92,19 +92,22 @@ BOOL CBaseAnimating::GetSequenceFlags(void) } /* <10837> ../cstrike/dlls/animating.cpp:171 */ -NOBODY float CBaseAnimating::SetBoneController(int iController, float flValue) +float CBaseAnimating::SetBoneController(int iController, float flValue) { -// { -// void *pmodel; // 173 -// } + void *pmodel = GET_MODEL_PTR( ENT(pev) ); + + return SetController(pmodel, pev, iController, flValue); } /* <10893> ../cstrike/dlls/animating.cpp:180 */ -NOBODY void CBaseAnimating::InitBoneControllers(void) +void CBaseAnimating::InitBoneControllers(void) { -// { -// void *pmodel; // 182 -// } + void *pmodel = GET_MODEL_PTR(ENT(pev)); + + SetController(pmodel, pev, 0, 0); + SetController(pmodel, pev, 1, 0); + SetController(pmodel, pev, 2, 0); + SetController(pmodel, pev, 3, 0); } /* <108d3> ../cstrike/dlls/animating.cpp:192 */ diff --git a/regamedll/dlls/animation.cpp b/regamedll/dlls/animation.cpp index 80db16b8..aa2037d3 100644 --- a/regamedll/dlls/animation.cpp +++ b/regamedll/dlls/animation.cpp @@ -173,14 +173,58 @@ NOBODY int GetAnimationEvent(void *pmodel, entvars_t *pev, MonsterEvent_t *pMons } /* <157e1> ../cstrike/dlls/animation.cpp:359 */ -NOBODY float SetController(void *pmodel, entvars_t *pev, int iController, float flValue) +float SetController(void *pmodel, entvars_t *pev, int iController, float flValue) { -// { -// studiohdr_t *pstudiohdr; // 361 -// mstudiobonecontroller_t *pbonecontroller; // 367 -// int i; // 370 -// int setting; // 404 -// } + studiohdr_t *pstudiohdr = (studiohdr_t *)pmodel; + + if (!pstudiohdr) + return flValue; + + int i; + mstudiobonecontroller_t *pbonecontroller = (mstudiobonecontroller_t *)((byte *)pstudiohdr + pstudiohdr->bonecontrollerindex); + for (i = 0; i < pstudiohdr->numbonecontrollers; i++, pbonecontroller++) + { + if (pbonecontroller->index == iController) + break; + } + + if (i >= pstudiohdr->numbonecontrollers) + return flValue; + + if (pbonecontroller->type & (STUDIO_XR | STUDIO_YR | STUDIO_ZR)) + { + if (pbonecontroller->end < pbonecontroller->start) + flValue = -flValue; + + if (pbonecontroller->end > pbonecontroller->start + 359.0) + { + if (flValue > 360.0) + flValue = flValue - (int64_t)(flValue / 360.0) * 360.0; + + else if (flValue < 0.0) + flValue = flValue + (int64_t)((flValue / -360.0) + 1) * 360.0; + } + else + { + if (flValue > ((pbonecontroller->start + pbonecontroller->end) / 2) + 180) + flValue -= 360; + + if (flValue < ((pbonecontroller->start + pbonecontroller->end) / 2) - 180) + flValue += 360; + } + } + + int setting = (int64_t)(255.0f * (flValue - pbonecontroller->start) / (pbonecontroller->end - pbonecontroller->start)); + + if (setting < 0) + setting = 0; + + if (setting > 255) + setting = 255; + + pev->controller[ iController ] = setting; + + return setting * (1.0f / 255.0f) * (pbonecontroller->end - pbonecontroller->start) + pbonecontroller->start; } /* <15883> ../cstrike/dlls/animation.cpp:414 */ diff --git a/regamedll/dlls/animation.h b/regamedll/dlls/animation.h index 953c0124..c33800bd 100644 --- a/regamedll/dlls/animation.h +++ b/regamedll/dlls/animation.h @@ -46,7 +46,7 @@ NOBODY void SequencePrecache(void *pmodel, const char *pSequenceName); void GetSequenceInfo(void *pmodel, entvars_t *pev, float *pflFrameRate, float *pflGroundSpeed); int GetSequenceFlags(void *pmodel, entvars_t *pev); NOBODY int GetAnimationEvent(void *pmodel, entvars_t *pev, MonsterEvent_t *pMonsterEvent, float flStart, float flEnd, int index); -NOBODY float SetController(void *pmodel, entvars_t *pev, int iController, float flValue); +float SetController(void *pmodel, entvars_t *pev, int iController, float flValue); NOBODY float SetBlending(void *pmodel, entvars_t *pev, int iBlender, float flValue); NOBODY int FindTransition(void *pmodel, int iEndingAnim, int iGoalAnim, int *piDir); NOBODY void SetBodygroup(void *pmodel, entvars_t *pev, int iGroup, int iValue); diff --git a/regamedll/dlls/basemonster.h b/regamedll/dlls/basemonster.h index 68b99749..50052306 100644 --- a/regamedll/dlls/basemonster.h +++ b/regamedll/dlls/basemonster.h @@ -37,10 +37,10 @@ class CBaseMonster: public CBaseToggle { public: NOBODY virtual void KeyValue(KeyValueData *pkvd); - NOBODY virtual void TraceAttack(entvars_t *pevAttacker,float flDamage,Vector vecDir,TraceResult *ptr,int bitsDamageType); - NOBODY virtual int TakeDamage(entvars_t *pevInflictor,entvars_t *pevAttacker,float flDamage,int bitsDamageType); - NOBODY virtual int TakeHealth(float flHealth,int bitsDamageType); - NOBODY virtual void Killed(entvars_t *pevAttacker,int iGib); + NOBODY virtual void TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType); + NOBODY virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType); + NOBODY virtual int TakeHealth(float flHealth, int bitsDamageType); + NOBODY virtual void Killed(entvars_t *pevAttacker, int iGib); virtual int BloodColor(void) { return m_bloodColor; @@ -55,13 +55,13 @@ public: NOBODY virtual void FadeMonster(void); NOBODY virtual void GibMonster(void); NOBODY virtual Activity GetDeathActivity(void); - NOBODY virtual void BecomeDead(void); + virtual void BecomeDead(void); NOBODY virtual BOOL ShouldFadeOnDeath(void); NOBODY virtual int IRelationship(CBaseEntity *pTarget); NOBODY virtual void PainSound(void) {}; NOBODY virtual void ResetMaxSpeed(void) {}; NOBODY virtual void ReportAIState(void) {}; - NOBODY virtual void MonsterInitDead(void); + virtual void MonsterInitDead(void); NOBODY virtual void Look(int iDistance); NOBODY virtual CBaseEntity *BestVisibleEnemy(void); NOBODY virtual BOOL FInViewCone(CBaseEntity *pEntity); @@ -70,10 +70,10 @@ public: #ifdef HOOK_GAMEDLL void KeyValue_(KeyValueData *pkvd); - 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 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); float ChangeYaw_(int speed); BOOL HasHumanGibs_(void); BOOL HasAlienGibs_(void); @@ -100,9 +100,11 @@ public: NOBODY int DeadTakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType); NOBODY float DamageForce(float damage); NOBODY void RadiusDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int iClassIgnore, int bitsDamageType); - NOBODY void RadiusDamage(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int iClassIgnore, int bitsDamageType); - //wtf?? - //void RadiusDamage2(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int iClassIgnore, int bitsDamageType); + NOXREF void RadiusDamage(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int iClassIgnore, int bitsDamageType); + void RadiusDamage2(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int iClassIgnore, int bitsDamageType) + { + ::RadiusDamage2(vecSrc, pevInflictor, pevAttacker, flDamage, flDamage * (RANDOM_FLOAT(0.5, 1.5) + 3), iClassIgnore, bitsDamageType); + } void SetConditions(int iConditions) { m_afConditions |= iConditions; @@ -157,7 +159,7 @@ public: } NOBODY void CorpseFallThink(void); NOBODY CBaseEntity *CheckTraceHullAttack(float flDist, int iDamage, int iDmgType); - NOBODY void MakeDamageBloodDecal(int cCount, float flNoise, TraceResult *ptr, Vector &vecDir); + 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; @@ -181,14 +183,17 @@ 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 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)(Vector *); -#endif + +#endif // HOOK_GAMEDLL #endif // BASEMONSTER_H diff --git a/regamedll/dlls/bmodels.cpp b/regamedll/dlls/bmodels.cpp index d865aa83..b26ef3a3 100644 --- a/regamedll/dlls/bmodels.cpp +++ b/regamedll/dlls/bmodels.cpp @@ -28,8 +28,8 @@ TYPEDESCRIPTION CPendulum::m_SaveData[] = #else -TYPEDESCRIPTION (*CFuncRotating::m_SaveData)[5]; -TYPEDESCRIPTION (*CPendulum::m_SaveData)[8]; +TYPEDESCRIPTION (*CFuncRotating::pm_SaveData)[5]; +TYPEDESCRIPTION (*CPendulum::pm_SaveData)[8]; #endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/bmodels.h b/regamedll/dlls/bmodels.h index f6e0091f..e0942a5e 100644 --- a/regamedll/dlls/bmodels.h +++ b/regamedll/dlls/bmodels.h @@ -196,13 +196,9 @@ public: NOBODY void EXPORT RotatingUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); NOBODY void EXPORT Rotate(void); NOBODY void RampPitchVol(int fUp); -public: -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[5]; -#else - static TYPEDESCRIPTION (*m_SaveData)[5]; -#endif // HOOK_GAMEDLL +public: + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[5]; public: float m_flFanFriction; @@ -249,11 +245,7 @@ public: NOBODY void EXPORT Stop(void); NOBODY void EXPORT RopeTouch(CBaseEntity *pOther); -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[8]; -#else - static TYPEDESCRIPTION (*m_SaveData)[8]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[8]; public: float m_accel; diff --git a/regamedll/dlls/buttons.cpp b/regamedll/dlls/buttons.cpp index 1b670965..b1b33b6b 100644 --- a/regamedll/dlls/buttons.cpp +++ b/regamedll/dlls/buttons.cpp @@ -49,11 +49,11 @@ TYPEDESCRIPTION CEnvSpark::m_SaveData[] = #else -TYPEDESCRIPTION (*CEnvGlobal::m_SaveData)[3]; -TYPEDESCRIPTION (*CMultiSource::m_SaveData)[4]; -TYPEDESCRIPTION (*CBaseButton::m_SaveData)[8]; -TYPEDESCRIPTION (*CMomentaryRotButton::m_SaveData)[6]; -TYPEDESCRIPTION (*CEnvSpark::m_SaveData)[1]; +TYPEDESCRIPTION (*CEnvGlobal::pm_SaveData)[3]; +TYPEDESCRIPTION (*CMultiSource::pm_SaveData)[4]; +TYPEDESCRIPTION (*CBaseButton::pm_SaveData)[8]; +TYPEDESCRIPTION (*CMomentaryRotButton::pm_SaveData)[6]; +TYPEDESCRIPTION (*CEnvSpark::pm_SaveData)[1]; #endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/buttons.h b/regamedll/dlls/buttons.h index 534d5bb3..59d2bb9b 100644 --- a/regamedll/dlls/buttons.h +++ b/regamedll/dlls/buttons.h @@ -53,11 +53,7 @@ public: #endif // HOOK_GAMEDLL public: -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[3]; -#else // HOOK_GAMEDLL - static TYPEDESCRIPTION (*m_SaveData)[3]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[3]; public: string_t m_globalstate; @@ -115,11 +111,7 @@ public: } public: -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[6]; -#else // HOOK_GAMEDLL - static TYPEDESCRIPTION (*m_SaveData)[6]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[6]; public: int m_lastUsed; @@ -157,11 +149,7 @@ public: NOBODY void EXPORT SparkStop(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); public: -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[1]; -#else // HOOK_GAMEDLL - static TYPEDESCRIPTION (*m_SaveData)[1]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1]; public: float m_flDelay; diff --git a/regamedll/dlls/career_tasks.h b/regamedll/dlls/career_tasks.h index 914c4b29..f532fe46 100644 --- a/regamedll/dlls/career_tasks.h +++ b/regamedll/dlls/career_tasks.h @@ -94,6 +94,8 @@ private: typedef std::list CareerTaskList; +typedef CareerTaskList::iterator CareerTaskListIt; + /* <1efed1> ../cstrike/dlls/career_tasks.cpp:636 */ class CCareerTaskManager { diff --git a/regamedll/dlls/cbase.cpp b/regamedll/dlls/cbase.cpp index a392bee9..da89b998 100644 --- a/regamedll/dlls/cbase.cpp +++ b/regamedll/dlls/cbase.cpp @@ -333,7 +333,7 @@ NOBODY void loopPerformance(void) } /* <313df> ../cstrike/dlls/cbase.cpp:451 */ -extern "C" _DLLEXPORT int GetEntityAPI(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) +C_DLLEXPORT int GetEntityAPI(DLL_FUNCTIONS *pFunctionTable, int interfaceVersion) { if (!pFunctionTable || interfaceVersion != INTERFACE_VERSION) return 0; diff --git a/regamedll/dlls/cbase.h b/regamedll/dlls/cbase.h index ab8848b7..3bd47675 100644 --- a/regamedll/dlls/cbase.h +++ b/regamedll/dlls/cbase.h @@ -32,10 +32,6 @@ #pragma once #endif -//#include "archtypes.h" -//#include "saverestore.h" -//#include "schedule.h" - #include "monsterevent.h" #include @@ -255,8 +251,6 @@ class CSound; #define hashItemMemPool (*phashItemMemPool) #define gTouchDisabled (*pgTouchDisabled) -#define g_flWeaponCheat (*pg_flWeaponCheat) - #define gFunctionTable (*pgFunctionTable) #define gNewDLLFunctions (*pgNewDLLFunctions) @@ -265,13 +259,10 @@ class CSound; #define fTextureTypeInit (*pfTextureTypeInit) #define gcTextures (*pgcTextures) -#define g_pBodyQueueHead (*pg_pBodyQueueHead) - #endif // HOOK_GAMEDLL extern CMemoryPool hashItemMemPool; extern BOOL gTouchDisabled; -extern float g_flWeaponCheat; extern DLL_FUNCTIONS gFunctionTable; extern NEW_DLL_FUNCTIONS gNewDLLFunctions; @@ -281,7 +272,6 @@ extern char grgchTextureType[ CTEXTURESMAX ]; extern int fTextureTypeInit; extern int gcTextures; -extern edict_t *g_pBodyQueueHead; extern CUtlVector< hash_item_t > stringsHashTable; class EHANDLE @@ -510,17 +500,14 @@ public: #endif // HOOK_GAMEDLL public: - void *operator new(size_t stAllocateBlock,entvars_t *pevnew) + void *operator new(size_t stAllocateBlock, entvars_t *pevnew) { return ALLOC_PRIVATE(ENT(pevnew), stAllocateBlock); } - // TODO: it is not declared in linux or the compiler this erease -//#ifdef _WIN32 void operator delete(void *pMem, entvars_t *pev) { pev->flags |= FL_KILLME; } -//#endif void UpdateOnRemove(void); void EXPORT SUB_Remove(void); void EXPORT SUB_DoNothing(void); @@ -542,26 +529,26 @@ public: return FALSE; } public: - INLINEBODY static CBaseEntity *Instance(edict_t *pent) + static CBaseEntity *Instance(edict_t *pent) { return (CBaseEntity *)GET_PRIVATE(pent ? pent : ENT(0)); } - INLINEBODY static CBaseEntity *Instance(entvars_t *pevit) + static CBaseEntity *Instance(entvars_t *pevit) { return Instance(ENT(pevit)); } - INLINEBODY static CBaseEntity *Instance(int offset) + static CBaseEntity *Instance(int offset) { return Instance(ENT(offset)); } - INLINEBODY CBaseMonster *GetMonsterPointer(entvars_t *pevMonster) + CBaseMonster *GetMonsterPointer(entvars_t *pevMonster) { CBaseEntity *pEntity = Instance(pevMonster); if(pEntity) return pEntity->MyMonsterPointer(); return NULL; } - INLINEBODY CBaseMonster *GetMonsterPointer(edict_t *pentMonster) + CBaseMonster *GetMonsterPointer(edict_t *pentMonster) { CBaseEntity *pEntity = Instance(pentMonster); if(pEntity) @@ -569,15 +556,15 @@ public: return NULL; } static CBaseEntity *Create(char *szName, const Vector &vecOrigin, const Vector &vecAngles, edict_t *pentOwner = NULL); - INLINEBODY edict_t *edict(void) + edict_t *edict(void) { return ENT(pev); } - INLINEBODY EOFFSET eoffset(void) + EOFFSET eoffset(void) { return OFFSET(pev); } - INLINEBODY int entindex(void) + int entindex(void) { return ENTINDEX(edict()); } @@ -586,13 +573,7 @@ public: CBaseEntity *m_pGoalEnt; CBaseEntity *m_pLink; -#ifndef HOOK_GAMEDLL - - static TYPEDESCRIPTION m_SaveData[5]; -#else - static TYPEDESCRIPTION (*m_SaveData)[5]; - -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[5]; void (CBaseEntity::*m_pfnThink)(void); //int m_pfnThink_Flag; @@ -716,15 +697,9 @@ public: public: NOBODY void EXPORT Register(void); + public: - -#ifndef HOOK_GAMEDLL - - static TYPEDESCRIPTION m_SaveData[4]; -#else - static TYPEDESCRIPTION (*m_SaveData)[4]; - -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[4]; EHANDLE m_rgEntities[MS_MAX_TARGETS]; int m_rgTriggered[MS_MAX_TARGETS]; @@ -753,16 +728,7 @@ public: void SUB_UseTargets(CBaseEntity *pActivator, USE_TYPE useType, float value); void EXPORT DelayThink(void); public: - -#ifndef HOOK_GAMEDLL - - static TYPEDESCRIPTION m_SaveData[2]; - -#else // HOOK_GAMEDLL - - static TYPEDESCRIPTION (*m_SaveData)[2]; - -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[2]; float m_flDelay; int m_iszKillTarget; @@ -793,8 +759,8 @@ public: int LookupSequence(const char *label); void ResetSequenceInfo(void); NOBODY void DispatchAnimEvents(float flFutureInterval = 0.1f); - NOBODY float SetBoneController(int iController, float flValue); - NOBODY void InitBoneControllers(void); + float SetBoneController(int iController, float flValue); + void InitBoneControllers(void); NOBODY float SetBlending(int iBlender, float flValue); NOBODY void GetBonePosition(int iBone, Vector &origin, Vector &angles); NOXREF void GetAutomovement(Vector &origin, Vector &angles, float flInterval = 0.1f); @@ -805,14 +771,7 @@ public: NOBODY int ExtractBbox(int sequence, float *mins, float *maxs); NOBODY void SetSequenceBox(void); public: - -#ifndef HOOK_GAMEDLL - - static TYPEDESCRIPTION m_SaveData[5]; -#else - static TYPEDESCRIPTION (*m_SaveData)[5]; - -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[5]; float m_flFrameRate; float m_flGroundSpeed; @@ -857,14 +816,7 @@ public: NOBODY static float AxisDelta(int flags, Vector &angle1, Vector &angle2); public: - -#ifndef HOOK_GAMEDLL - - static TYPEDESCRIPTION m_SaveData[19]; -#else - static TYPEDESCRIPTION (*m_SaveData)[19]; - -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[19]; TOGGLE_STATE m_toggle_state; float m_flActivateFinished; @@ -945,14 +897,7 @@ public: NOBODY BUTTON_CODE ButtonResponseToTouch(void); public: - -#ifndef HOOK_GAMEDLL - - static TYPEDESCRIPTION m_SaveData[8]; -#else - static TYPEDESCRIPTION (*m_SaveData)[8]; - -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[8]; BOOL m_fStayPushed; BOOL m_fRotating; @@ -1035,14 +980,7 @@ public: NOBODY void InitModulationParms(void); public: - -#ifndef HOOK_GAMEDLL - - static TYPEDESCRIPTION m_SaveData[4]; -#else - static TYPEDESCRIPTION (*m_SaveData)[4]; - -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[4]; float m_flAttenuation; dynpitchvol_t m_dpv; @@ -1069,14 +1007,7 @@ public: #endif // HOOK_GAMEDLL public: - -#ifndef HOOK_GAMEDLL - - static TYPEDESCRIPTION m_SaveData[2]; -#else - static TYPEDESCRIPTION (*m_SaveData)[2]; - -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[2]; float m_flRadius; float m_flRoomtype; @@ -1107,14 +1038,7 @@ public: NOBODY void EXPORT ToggleUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); NOBODY void EXPORT SpeakerThink(void); public: - -#ifndef HOOK_GAMEDLL - - static TYPEDESCRIPTION m_SaveData[1]; -#else - static TYPEDESCRIPTION (*m_SaveData)[1]; - -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1]; int m_preset; };/* size: 156, cachelines: 3, members: 3 */ @@ -1162,30 +1086,6 @@ NOBODY void SaveReadFields(SAVERESTOREDATA *pSaveData, const char *pname, void * NOBODY void SetObjectCollisionBox(entvars_t *pev); NOBODY void OnFreeEntPrivateData(edict_t *pEnt); -NOBODY void CopyToBodyQue(entvars_t *pev); -NOBODY void ClearBodyQue(void); -NOBODY void SaveGlobalState(SAVERESTOREDATA *pSaveData); -NOBODY void RestoreGlobalState(SAVERESTOREDATA *pSaveData); -NOBODY void ResetGlobalState(void); - -/* extern "C" */ - -//extern "C" _DLLEXPORT void ambient_generic(entvars_t *pev); -//extern "C" _DLLEXPORT void env_sound(entvars_t *pev); -//extern "C" _DLLEXPORT void speaker(entvars_t *pev); - -//extern "C" _DLLEXPORT void infodecal(entvars_t *pev); -//extern "C" _DLLEXPORT void worldspawn(entvars_t *pev); -//extern "C" _DLLEXPORT void bodyque(entvars_t *pev); - -//extern "C" void infodecal(entvars_t *pev); -//extern "C" void worldspawn(entvars_t *pev); -//extern "C" void bodyque(entvars_t *pev); - -//NOBODY void infodecal(entvars_t *pev); -//NOBODY void worldspawn(entvars_t *pev); -//NOBODY void bodyque(entvars_t *pev); - #ifdef HOOK_GAMEDLL typedef BOOL (CBaseEntity::*FVISIBLE_ENTITY)(CBaseEntity *); diff --git a/regamedll/dlls/client.cpp b/regamedll/dlls/client.cpp index 028b3f78..04684974 100644 --- a/regamedll/dlls/client.cpp +++ b/regamedll/dlls/client.cpp @@ -731,9 +731,15 @@ NOBODY BOOL HandleRadioAliasCommands(CBasePlayer *pPlayer, const char *pszComman // } } +void (*pClientCommand)(edict_t *pEntity); + /* <4c6c1> ../cstrike/dlls/client.cpp:3234 */ -NOBODY void ClientCommand(edict_t *pEntity) +NOBODY void __declspec(naked) ClientCommand(edict_t *pEntity) { + __asm + { + jmp pClientCommand + } // { // const char *pcmd; // 3236 // const char *pstr; // 3237 diff --git a/regamedll/dlls/client.h b/regamedll/dlls/client.h index 5ad5d79a..bc092527 100644 --- a/regamedll/dlls/client.h +++ b/regamedll/dlls/client.h @@ -189,4 +189,7 @@ void CreateInstancedBaselines(void); int InconsistentFile(const edict_t *player, const char *filename, char *disconnect_message); int AllowLagCompensation(void); +// refs +extern void (*pClientCommand)(edict_t *pEntity); + #endif // CLIENT_H diff --git a/regamedll/dlls/combat.cpp b/regamedll/dlls/combat.cpp index 57ef13b7..801f4832 100644 --- a/regamedll/dlls/combat.cpp +++ b/regamedll/dlls/combat.cpp @@ -179,8 +179,19 @@ NOBODY Activity CBaseMonster::GetSmallFlinchActivity(void) } /* <5f8a6> ../cstrike/dlls/combat.cpp:525 */ -NOBODY void CBaseMonster::BecomeDead_(void) +void CBaseMonster::BecomeDead_(void) { + // don't let autoaim aim at corpses. + pev->takedamage = DAMAGE_YES; + + // give the corpse half of the monster's original maximum health. + pev->health = pev->max_health / 2; + + // max_health now becomes a counter for how many blood decals the corpse can place. + pev->max_health = 5; + + // make the corpse fly away from the attack vector + pev->movetype = MOVETYPE_TOSS; } /* <5f8cc> ../cstrike/dlls/combat.cpp:542 */ @@ -287,6 +298,10 @@ int CBaseMonster::TakeHealth_(float flHealth, int bitsDamageType) if (pev->takedamage == DAMAGE_NO) return 0; + // clear out any damage types we healed. + // UNDONE: generic health should not heal any + // UNDONE: time-based damage + m_bitsDamageType &= ~(bitsDamageType & ~DMG_TIMEBASED); return CBaseEntity::TakeHealth(flHealth, bitsDamageType); } @@ -453,6 +468,24 @@ NOBODY void RadiusDamage2(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pev // } } +/* <5e0d2> ../cstrike/dlls/combat.cpp:1442 */ +NOBODY void CBaseMonster::RadiusDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int iClassIgnore, int bitsDamageType) +{ + if (flDamage > 80) + ::RadiusDamage(pev->origin, pevInflictor, pevAttacker, flDamage, flDamage * 3.5, iClassIgnore, bitsDamageType); + else + RadiusDamage2(pev->origin, pevInflictor, pevAttacker, flDamage, iClassIgnore, bitsDamageType); +} + +/* <5e0d2> ../cstrike/dlls/combat.cpp:1448 */ +NOXREF void CBaseMonster::RadiusDamage(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int iClassIgnore, int bitsDamageType) +{ + if (flDamage > 80) + ::RadiusDamage(vecSrc, pevInflictor, pevAttacker, flDamage, flDamage * 3.5, iClassIgnore, bitsDamageType); + else + RadiusDamage2(vecSrc, pevInflictor, pevAttacker, flDamage, iClassIgnore, bitsDamageType); +} + /* <61949> ../cstrike/dlls/combat.cpp:1454 */ NOBODY CBaseEntity *CBaseMonster::CheckTraceHullAttack(float flDist, int iDamage, int iDmgType) { @@ -670,13 +703,15 @@ NOBODY void CBaseEntity::FireBullets(ULONG cShots, Vector vecSrc, Vector vecDirS } /* <62693> ../cstrike/dlls/combat.cpp:1856 */ -/* linkage=_Z4vstrPf */ -NOBODY NOXREF char *vstr(float *v) +NOXREF char *vstr(float *v) { -// { -// int idx; // 1858 -// char string; // 1859 -// } + static int idx = 0; + static char string[ 16 ][ 1024 ]; + + idx = (idx + 1) % 0xF; + Q_sprintf(string[ idx ], "%.4f %.4f %.4f", v[0], v[1], v[2]); + + return string[ idx ]; } Vector (*pFireBullets3)(Vector, Vector, float, float, int, int, int, float, entvars_t *, bool, int); @@ -685,7 +720,7 @@ Vector (*pFireBullets3)(Vector, Vector, float, float, int, int, int, float, entv Vector __declspec(naked) CBaseEntity::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) { UNTESTED - //TODO: crash to czero + //TODO: crash a test to czero __asm { @@ -771,7 +806,7 @@ Vector __declspec(naked) CBaseEntity::FireBullets3(Vector vecSrc, Vector vecDirS } if (!pevAttacker) - pevAttacker = pev; + pevAttacker = pev; // the default attacker is ourselves gMultiDamage.type = (DMG_BULLET | DMG_NEVERGIB); @@ -779,6 +814,8 @@ Vector __declspec(naked) CBaseEntity::FireBullets3(Vector vecSrc, Vector vecDirS if (IsPlayer()) { + // Use player's random seed. + // get circular gaussian spread x = UTIL_SharedRandomFloat(shared_rand, -0.5, 0.5) + UTIL_SharedRandomFloat(shared_rand + 1, -0.5, 0.5); y = UTIL_SharedRandomFloat(shared_rand + 2, -0.5, 0.5) + UTIL_SharedRandomFloat(shared_rand + 3, -0.5, 0.5); } @@ -931,11 +968,12 @@ void CBaseEntity::TraceBleed_(float flDamage, Vector vecDir, TraceResult *ptr, i if (!(bitsDamageType & (DMG_CRUSH | DMG_BULLET | DMG_SLASH | DMG_BLAST | DMG_CLUB | DMG_MORTAR))) return; - int i; + // make blood decal on the wall! TraceResult Bloodtr; Vector vecTraceDir; float flNoise; int cCount; + int i; if (flDamage < 10.0f) { @@ -955,7 +993,9 @@ void CBaseEntity::TraceBleed_(float flDamage, Vector vecDir, TraceResult *ptr, i for (i = 0; i < cCount; i++) { + // trace in the opposite direction the shot came from (the direction the shot is going) vecTraceDir = vecDir * -1.0f; + vecTraceDir.x += RANDOM_FLOAT(-flNoise, flNoise); vecTraceDir.y += RANDOM_FLOAT(-flNoise, flNoise); vecTraceDir.z += RANDOM_FLOAT(-flNoise, flNoise); @@ -970,17 +1010,40 @@ void CBaseEntity::TraceBleed_(float flDamage, Vector vecDir, TraceResult *ptr, i } /* <62e0e> ../cstrike/dlls/combat.cpp:2145 */ -NOBODY void CBaseMonster::MakeDamageBloodDecal(int cCount, float flNoise, TraceResult *ptr, Vector &vecDir) +NOXREF void CBaseMonster::MakeDamageBloodDecal(int cCount, float flNoise, TraceResult *ptr, Vector &vecDir) { -// { -// TraceResult Bloodtr; // 2148 -// class Vector vecTraceDir; // 2149 -// int i; // 2150 -// operator*(const Vector *const this, -// float fl); // 2174 -// operator+(const Vector *const this, -// const Vector &v); // 2174 -// } + // make blood decal on the wall! + TraceResult Bloodtr; + Vector vecTraceDir; + int i; + + if (!IsAlive()) + { + // dealing with a dead monster. + if (pev->max_health <= 0) + { + // no blood decal for a monster that has already decalled its limit. + return; + } + else + pev->max_health--; + } + + for (i = 0 ; i < cCount ; i++) + { + vecTraceDir = vecDir; + + vecTraceDir.x += RANDOM_FLOAT(-flNoise, flNoise); + vecTraceDir.y += RANDOM_FLOAT(-flNoise, flNoise); + vecTraceDir.z += RANDOM_FLOAT(-flNoise, flNoise); + + UTIL_TraceLine(ptr->vecEndPos, ptr->vecEndPos + vecTraceDir * 172, ignore_monsters, ENT(pev), &Bloodtr); + + if (Bloodtr.flFraction != 1.0) + { + UTIL_BloodDecalTrace(&Bloodtr, BloodColor()); + } + } } /* <62f3e> ../cstrike/dlls/combat.cpp:2197 */ diff --git a/regamedll/dlls/decals.h b/regamedll/dlls/decals.h index 33fe7d9b..39f893f2 100644 --- a/regamedll/dlls/decals.h +++ b/regamedll/dlls/decals.h @@ -82,7 +82,9 @@ typedef struct { char *name; int index; + } DLL_DECALLIST; +/* size: 8, cachelines: 1, members: 2 */ #ifdef HOOK_GAMEDLL diff --git a/regamedll/dlls/doors.cpp b/regamedll/dlls/doors.cpp index 762fcb4a..24c9a7dc 100644 --- a/regamedll/dlls/doors.cpp +++ b/regamedll/dlls/doors.cpp @@ -23,8 +23,8 @@ TYPEDESCRIPTION CMomentaryDoor::m_SaveData[] = #else -TYPEDESCRIPTION (*CBaseDoor::m_SaveData)[7]; -TYPEDESCRIPTION (*CMomentaryDoor::m_SaveData)[1]; +TYPEDESCRIPTION (*CBaseDoor::pm_SaveData)[7]; +TYPEDESCRIPTION (*CMomentaryDoor::pm_SaveData)[1]; #endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/doors.h b/regamedll/dlls/doors.h index 0db71e2e..6fa33725 100644 --- a/regamedll/dlls/doors.h +++ b/regamedll/dlls/doors.h @@ -88,11 +88,7 @@ public: #endif // HOOK_GAMEDLL public: -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[7]; -#else - static TYPEDESCRIPTION (*m_SaveData)[7]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[7]; public: NOBODY void EXPORT DoorTouch(CBaseEntity *pOther); @@ -163,11 +159,7 @@ public: #endif // HOOK_GAMEDLL public: -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[1]; -#else - static TYPEDESCRIPTION (*m_SaveData)[1]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1]; public: BYTE m_bMoveSnd; diff --git a/regamedll/dlls/effects.cpp b/regamedll/dlls/effects.cpp index 9e2d0ebf..37b4679f 100644 --- a/regamedll/dlls/effects.cpp +++ b/regamedll/dlls/effects.cpp @@ -61,12 +61,12 @@ TYPEDESCRIPTION CGibShooter::m_SaveData[] = #else -TYPEDESCRIPTION (*CBubbling::m_SaveData)[3]; -TYPEDESCRIPTION (*CLightning::m_SaveData)[13]; -TYPEDESCRIPTION (*CLaser::m_SaveData)[3]; -TYPEDESCRIPTION (*CGlow::m_SaveData)[2]; -TYPEDESCRIPTION (*CSprite::m_SaveData)[2]; -TYPEDESCRIPTION (*CGibShooter::m_SaveData)[7]; +TYPEDESCRIPTION (*CBubbling::pm_SaveData)[3]; +TYPEDESCRIPTION (*CLightning::pm_SaveData)[13]; +TYPEDESCRIPTION (*CLaser::pm_SaveData)[3]; +TYPEDESCRIPTION (*CGlow::pm_SaveData)[2]; +TYPEDESCRIPTION (*CSprite::pm_SaveData)[2]; +TYPEDESCRIPTION (*CGibShooter::pm_SaveData)[7]; #endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/effects.h b/regamedll/dlls/effects.h index 86487b02..c77f1491 100644 --- a/regamedll/dlls/effects.h +++ b/regamedll/dlls/effects.h @@ -164,11 +164,7 @@ public: NOBODY void EXPORT AnimateUntilDead(void); NOBODY static CSprite *SpriteCreate(const char *pSpriteName, const Vector &origin, BOOL animate); -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[2]; -#else // HOOK_GAMEDLL - static TYPEDESCRIPTION (*m_SaveData)[2]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[2]; private: @@ -370,13 +366,9 @@ public: NOBODY void FireAtPoint(TraceResult &point); NOBODY void EXPORT StrikeThink(void); -public: -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[3]; -#else // HOOK_GAMEDLL - static TYPEDESCRIPTION (*m_SaveData)[3]; -#endif // HOOK_GAMEDLL +public: + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[3]; public: CSprite *m_pSprite; @@ -419,12 +411,7 @@ public: void EXPORT FizzThink(void); public: - -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[3]; -#else // HOOK_GAMEDLL - static TYPEDESCRIPTION (*m_SaveData)[3]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[3]; public: int m_density; @@ -476,11 +463,7 @@ public: void BeamUpdateVars(void); public: -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[13]; -#else // HOOK_GAMEDLL - static TYPEDESCRIPTION (*m_SaveData)[13]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[13]; public: int m_active; @@ -519,11 +502,7 @@ public: NOBODY void Animate(float frames); public: -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[2]; -#else // HOOK_GAMEDLL - static TYPEDESCRIPTION (*m_SaveData)[2]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[2]; public: float m_lastTime; @@ -572,11 +551,7 @@ public: public: void EXPORT ShootThink(void); public: -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[7]; -#else // HOOK_GAMEDLL - static TYPEDESCRIPTION (*m_SaveData)[7]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[7]; public: int m_iGibs; diff --git a/regamedll/dlls/explode.cpp b/regamedll/dlls/explode.cpp index b2a72ac6..782b12fd 100644 --- a/regamedll/dlls/explode.cpp +++ b/regamedll/dlls/explode.cpp @@ -13,7 +13,7 @@ TYPEDESCRIPTION CEnvExplosion::m_SaveData[] = #else // HOOK_GAMEDLL -TYPEDESCRIPTION (*CEnvExplosion::m_SaveData)[2]; +TYPEDESCRIPTION (*CEnvExplosion::pm_SaveData)[2]; #endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/explode.h b/regamedll/dlls/explode.h index 9b08ebb0..5a020d73 100644 --- a/regamedll/dlls/explode.h +++ b/regamedll/dlls/explode.h @@ -89,11 +89,7 @@ public: NOBODY void EXPORT Smoke(void); public: -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[2]; -#else - static TYPEDESCRIPTION (*m_SaveData)[2]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[2]; public: int m_iMagnitude; diff --git a/regamedll/dlls/func_break.cpp b/regamedll/dlls/func_break.cpp index 6e5992ff..1339df12 100644 --- a/regamedll/dlls/func_break.cpp +++ b/regamedll/dlls/func_break.cpp @@ -116,8 +116,8 @@ const char *(*CBreakable::ppSoundsGlass)[3]; char *(*CPushable::pm_soundNames)[3]; -TYPEDESCRIPTION (*CBreakable::m_SaveData)[5]; -TYPEDESCRIPTION (*CPushable::m_SaveData)[2]; +TYPEDESCRIPTION (*CBreakable::pm_SaveData)[5]; +TYPEDESCRIPTION (*CPushable::pm_SaveData)[2]; #endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/func_break.h b/regamedll/dlls/func_break.h index 0640ac56..3b95cbe4 100644 --- a/regamedll/dlls/func_break.h +++ b/regamedll/dlls/func_break.h @@ -147,11 +147,7 @@ public: static const char *pSoundsConcrete[3]; static const char *pSpawnObjects[32]; -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[5]; -#else - static TYPEDESCRIPTION (*m_SaveData)[5]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[5]; public: Materials m_Material; @@ -207,11 +203,7 @@ public: } public: -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[2]; -#else - static TYPEDESCRIPTION (*m_SaveData)[2]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[2]; public: static char *m_soundNames[3]; diff --git a/regamedll/dlls/func_tank.cpp b/regamedll/dlls/func_tank.cpp index d7e41c0a..75f9d974 100644 --- a/regamedll/dlls/func_tank.cpp +++ b/regamedll/dlls/func_tank.cpp @@ -48,9 +48,9 @@ TYPEDESCRIPTION CFuncTankControls::m_SaveData[] = #else -TYPEDESCRIPTION (*CFuncTank::m_SaveData)[26]; -TYPEDESCRIPTION (*CFuncTankLaser::m_SaveData)[2]; -TYPEDESCRIPTION (*CFuncTankControls::m_SaveData)[1]; +TYPEDESCRIPTION (*CFuncTank::pm_SaveData)[26]; +TYPEDESCRIPTION (*CFuncTankLaser::pm_SaveData)[2]; +TYPEDESCRIPTION (*CFuncTankControls::pm_SaveData)[1]; #endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/func_tank.h b/regamedll/dlls/func_tank.h index 0888ca22..325fc509 100644 --- a/regamedll/dlls/func_tank.h +++ b/regamedll/dlls/func_tank.h @@ -135,11 +135,7 @@ public: NOBODY void ControllerPostFrame(void); public: -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[26]; -#else // HOOK_GAMEDLL - static TYPEDESCRIPTION (*m_SaveData)[26]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[26]; protected: CBasePlayer *m_pController; @@ -208,12 +204,7 @@ public: NOBODY CLaser *GetLaser(void); public: - -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[2]; -#else // HOOK_GAMEDLL - static TYPEDESCRIPTION (*m_SaveData)[2]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[2]; private: CLaser *m_pLaser; @@ -282,11 +273,7 @@ public: #endif // HOOK_GAMEDLL public: -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[1]; -#else // HOOK_GAMEDLL - static TYPEDESCRIPTION (*m_SaveData)[1]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1]; public: CFuncTank *m_pTank; diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index 322f2be7..4af07150 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -405,7 +405,7 @@ cvar_t sk_scientist_heal3; #endif //HOOK_GAMEDLL /* <9c900> ../cstrike/dlls/game.cpp:500 */ -NOBODY void GameDLLInit(void) +void GameDLLInit(void) { g_psv_gravity = CVAR_GET_POINTER("sv_gravity"); g_psv_aim = CVAR_GET_POINTER("sv_aim"); @@ -494,8 +494,7 @@ NOBODY void GameDLLInit(void) CVAR_REGISTER(&sk_scientist_heal2); CVAR_REGISTER(&sk_scientist_heal3); - //TODO: Reverse me Bot_RegisterCvars(); Tutor_RegisterCVars(); - //Hostage_RegisterCVars(); + Hostage_RegisterCVars(); } diff --git a/regamedll/dlls/gamerules.h b/regamedll/dlls/gamerules.h index df566814..a6e54838 100644 --- a/regamedll/dlls/gamerules.h +++ b/regamedll/dlls/gamerules.h @@ -34,6 +34,8 @@ #include "game_shared/voice_gamemgr.h" +#define COM_TOKEN_LEN 1500 + #define MAX_RULE_BUFFER 1024 #define MAX_VOTE_MAPS 100 #define ITEM_RESPAWN_TIME 30 @@ -430,7 +432,7 @@ private: NOBODY bool IsBombPlanted(void); NOBODY void MarkLivingPlayersOnTeamAsNotReceivingMoneyNextRound(int iTeam); - INLINEBODY inline void TerminateRound(float tmDelay, int iWinStatus) + inline void TerminateRound(float tmDelay, int iWinStatus) { m_iRoundWinStatus = iWinStatus; m_bRoundTerminating = true; @@ -599,6 +601,7 @@ public: #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 @@ -606,6 +609,7 @@ 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(void); @@ -625,9 +629,11 @@ char *GetTeam(int teamNo); NOBODY void EndRoundMessage(const char *sentence, int event); NOBODY void ReadMultiplayCvars(CHalfLifeMultiplay *mp); NOBODY void DestroyMapCycle(mapcycle_t *cycle); -NOBODY char *MP_COM_GetToken(void); -NOBODY char *MP_COM_Parse(char *data); -NOBODY int MP_COM_TokenWaiting(char *buffer); + +char *MP_COM_GetToken(void); +char *MP_COM_Parse(char *data); +NOXREF int MP_COM_TokenWaiting(char *buffer); + NOBODY int ReloadMapCycleFile(char *filename, mapcycle_t *cycle); NOBODY int CountPlayers(void); NOBODY void ExtractCommandString(char *s, char *szCommand); diff --git a/regamedll/dlls/ggrenade.cpp b/regamedll/dlls/ggrenade.cpp index 59ed9219..f235e929 100644 --- a/regamedll/dlls/ggrenade.cpp +++ b/regamedll/dlls/ggrenade.cpp @@ -26,7 +26,7 @@ TYPEDESCRIPTION CGrenade::m_SaveData[] = #else // HOOK_GAMEDLL -TYPEDESCRIPTION (*CGrenade::m_SaveData)[15]; +TYPEDESCRIPTION (*CGrenade::pm_SaveData)[15]; #endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/h_battery.cpp b/regamedll/dlls/h_battery.cpp index 2d443451..3d0d7f6a 100644 --- a/regamedll/dlls/h_battery.cpp +++ b/regamedll/dlls/h_battery.cpp @@ -16,7 +16,7 @@ TYPEDESCRIPTION CRecharge::m_SaveData[] = #else -TYPEDESCRIPTION (*CRecharge::m_SaveData)[5]; +TYPEDESCRIPTION (*CRecharge::pm_SaveData)[5]; #endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/h_battery.h b/regamedll/dlls/h_battery.h index 6c2ec266..86406c3b 100644 --- a/regamedll/dlls/h_battery.h +++ b/regamedll/dlls/h_battery.h @@ -64,16 +64,9 @@ public: public: void EXPORT Off(void); void EXPORT Recharge(void); + public: - -#ifndef HOOK_GAMEDLL - - static TYPEDESCRIPTION m_SaveData[5]; - -#else - static TYPEDESCRIPTION (*m_SaveData)[5]; - -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[5]; float m_flNextCharge; int m_iReactivate; diff --git a/regamedll/dlls/h_cycler.cpp b/regamedll/dlls/h_cycler.cpp index 8daf716f..a15d4c0e 100644 --- a/regamedll/dlls/h_cycler.cpp +++ b/regamedll/dlls/h_cycler.cpp @@ -24,9 +24,9 @@ TYPEDESCRIPTION CWreckage::m_SaveData[] = #else -TYPEDESCRIPTION (*CCycler::m_SaveData)[1]; -TYPEDESCRIPTION (*CCyclerSprite::m_SaveData)[3]; -TYPEDESCRIPTION (*CWreckage::m_SaveData)[1]; +TYPEDESCRIPTION (*CCycler::pm_SaveData)[1]; +TYPEDESCRIPTION (*CCyclerSprite::pm_SaveData)[3]; +TYPEDESCRIPTION (*CWreckage::pm_SaveData)[1]; #endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/h_cycler.h b/regamedll/dlls/h_cycler.h index 55c21a7f..7654e5b4 100644 --- a/regamedll/dlls/h_cycler.h +++ b/regamedll/dlls/h_cycler.h @@ -46,33 +46,9 @@ public: NOBODY virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType); NOBODY virtual void Think(void); NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); -public: - NOBODY void Animate(float frames); - inline int ShouldAnimate(void) - { - return m_animate && m_maxFrame > 1.0; - } -public: - -#ifndef HOOK_GAMEDLL - - static TYPEDESCRIPTION m_SaveData[3]; -#else - static TYPEDESCRIPTION (*m_SaveData)[3]; - -#endif // HOOK_GAMEDLL - - int m_animate; - float m_lastTime; - float m_maxFrame; - int m_renderfx; - int m_rendermode; - float m_renderamt; - vec3_t m_rendercolor; #ifdef HOOK_GAMEDLL -public: NOBODY void Spawn_(void); NOBODY void Restart_(void); NOBODY int Save_(CSave &save); @@ -83,6 +59,24 @@ public: #endif // HOOK_GAMEDLL +public: + NOBODY void Animate(float frames); + inline int ShouldAnimate(void) + { + return m_animate && m_maxFrame > 1.0; + } + +public: + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[3]; + + int m_animate; + float m_lastTime; + float m_maxFrame; + int m_renderfx; + int m_rendermode; + float m_renderamt; + vec3_t m_rendercolor; + };/* size: 188, cachelines: 3, members: 9 */ class CCycler: public CBaseMonster @@ -102,18 +96,6 @@ public: } NOBODY virtual void Think(void); NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); -public: - void GenericCyclerSpawn(char *szModel, Vector vecMin, Vector vecMax); -public: -#ifndef HOOK_GAMEDLL - - static TYPEDESCRIPTION m_SaveData[1]; -#else - static TYPEDESCRIPTION (*m_SaveData)[1]; - -#endif // HOOK_GAMEDLL - - int m_animate; #ifdef HOOK_GAMEDLL @@ -126,6 +108,14 @@ public: #endif // HOOK_GAMEDLL +public: + void GenericCyclerSpawn(char *szModel, Vector vecMin, Vector vecMax); + +public: + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1]; + + int m_animate; + };/* size: 408, cachelines: 7, members: 3 */ class CGenericCycler: public CCycler @@ -172,9 +162,6 @@ public: } NOBODY virtual void PrimaryAttack(void); NOBODY virtual void SecondaryAttack(void); -public: - int m_iszModel; - int m_iModel; #ifdef HOOK_GAMEDLL @@ -186,6 +173,10 @@ public: #endif // HOOK_GAMEDLL +public: + int m_iszModel; + int m_iModel; + };/* size: 344, cachelines: 6, members: 3 */ class CWreckage: public CBaseMonster @@ -195,16 +186,6 @@ class CWreckage: public CBaseMonster NOBODY virtual int Save(CSave &save); NOBODY virtual int Restore(CRestore &restore); NOBODY virtual void Think(void); -public: -#ifndef HOOK_GAMEDLL - - static TYPEDESCRIPTION m_SaveData[1]; -#else - static TYPEDESCRIPTION (*m_SaveData)[1]; - -#endif // HOOK_GAMEDLL - - int m_flStartTime; #ifdef HOOK_GAMEDLL @@ -216,6 +197,11 @@ public: #endif // HOOK_GAMEDLL +public: + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1]; + + int m_flStartTime; + };/* size: 408, cachelines: 7, members: 3 */ #endif // H_CYCLER_H diff --git a/regamedll/dlls/h_export.h b/regamedll/dlls/h_export.h index e5c3d0d0..8bc69e0e 100644 --- a/regamedll/dlls/h_export.h +++ b/regamedll/dlls/h_export.h @@ -48,6 +48,6 @@ extern enginefuncs_t g_engfuncs; extern globalvars_t *gpGlobals; -extern "C" _DLLEXPORT void WINAPI GiveFnptrsToDll(enginefuncs_t *pEnginefuncsTable,globalvars_t *pGlobals); +extern "C" C_DLLEXPORT void WINAPI GiveFnptrsToDll(enginefuncs_t *pEnginefuncsTable,globalvars_t *pGlobals); #endif // H_EXPORT_H diff --git a/regamedll/dlls/healthkit.cpp b/regamedll/dlls/healthkit.cpp index 9b528730..02d62c10 100644 --- a/regamedll/dlls/healthkit.cpp +++ b/regamedll/dlls/healthkit.cpp @@ -16,7 +16,7 @@ TYPEDESCRIPTION CWallHealth::m_SaveData[] = #else -TYPEDESCRIPTION (*CWallHealth::m_SaveData)[5]; +TYPEDESCRIPTION (*CWallHealth::pm_SaveData)[5]; #endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/healthkit.h b/regamedll/dlls/healthkit.h index 97e48709..ef119923 100644 --- a/regamedll/dlls/healthkit.h +++ b/regamedll/dlls/healthkit.h @@ -84,11 +84,7 @@ public: void EXPORT Off(void); void EXPORT Recharge(void); -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[5]; -#else - static TYPEDESCRIPTION (*m_SaveData)[5]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[5]; public: float m_flNextCharge; diff --git a/regamedll/dlls/hostage/hostage.cpp b/regamedll/dlls/hostage/hostage.cpp index 68879f50..b664f8be 100644 --- a/regamedll/dlls/hostage/hostage.cpp +++ b/regamedll/dlls/hostage/hostage.cpp @@ -5,13 +5,13 @@ */ #ifndef HOOK_GAMEDLL -//cvar_t cv_hostage_stop = { "hostage_stop", "0", FCVAR_SERVER }; -//cvar_t cv_hostage_debug = { "hostage_debug", "0", FCVAR_SERVER }; +cvar_t cv_hostage_stop = { "hostage_stop", "0", FCVAR_SERVER }; +cvar_t cv_hostage_debug = { "hostage_debug", "0", FCVAR_SERVER }; #else -//cvar_t cv_hostage_debug; -//cvar_t cv_hostage_stop; +cvar_t cv_hostage_debug; +cvar_t cv_hostage_stop; #endif // HOOK_GAMEDLL @@ -601,8 +601,10 @@ void CHostage::PreThink(void) } /* <45e24e> ../cstrike/dlls/hostage/hostage.cpp:1421 */ -NOBODY void Hostage_RegisterCVars(void) +void Hostage_RegisterCVars(void) { + CVAR_REGISTER(&cv_hostage_debug); + CVAR_REGISTER(&cv_hostage_stop); } /* <45e2a6> ../cstrike/dlls/hostage/hostage.cpp:1430 */ diff --git a/regamedll/dlls/hostage/hostage.h b/regamedll/dlls/hostage/hostage.h index 093bb8aa..ce734af2 100644 --- a/regamedll/dlls/hostage/hostage.h +++ b/regamedll/dlls/hostage/hostage.h @@ -273,12 +273,18 @@ private: #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; -NOBODY void Hostage_RegisterCVars(void); +extern cvar_t cv_hostage_debug; +extern cvar_t cv_hostage_stop; + +void Hostage_RegisterCVars(void); NOBODY void InstallHostageManager(void); #endif // HOSTAGE_H diff --git a/regamedll/dlls/lights.cpp b/regamedll/dlls/lights.cpp index 328e9f85..a9aa97ca 100644 --- a/regamedll/dlls/lights.cpp +++ b/regamedll/dlls/lights.cpp @@ -13,7 +13,7 @@ TYPEDESCRIPTION CLight::m_SaveData[] = #else -TYPEDESCRIPTION (*CLight::m_SaveData)[2]; +TYPEDESCRIPTION (*CLight::pm_SaveData)[2]; #endif // HOOK_GAMEDLL @@ -164,14 +164,26 @@ void CEnvLight::KeyValue_(KeyValueData *pkvd) /* ../cstrike/dlls/lights.cpp:215 */ void CEnvLight::Spawn_(void) { +#if defined(HOOK_GAMEDLL) +// NOTE: fix negative the values for function sprintf from STD C++: +// expected - sv_skyvec_y "0.000000" +// with using sprintf from STD C++, got - sv_skyvec_y "-0.000000" +// If we not doing it then the test will be failed! +#define SPRINTF_OLD_STD_FIX + 0 +#else +#define SPRINTF_OLD_STD_FIX +#endif // HOOK_GAMEDLL + char szVector[64]; UTIL_MakeAimVectors( pev->angles ); - Q_sprintf(szVector, "%f", gpGlobals->v_forward.x); + Q_sprintf(szVector, "%f", gpGlobals->v_forward.x SPRINTF_OLD_STD_FIX); CVAR_SET_STRING("sv_skyvec_x", szVector); - Q_sprintf(szVector, "%f", gpGlobals->v_forward.y); + + Q_sprintf(szVector, "%f", gpGlobals->v_forward.y SPRINTF_OLD_STD_FIX); CVAR_SET_STRING("sv_skyvec_y", szVector); - Q_sprintf(szVector, "%f", gpGlobals->v_forward.z); + + Q_sprintf(szVector, "%f", gpGlobals->v_forward.z SPRINTF_OLD_STD_FIX); CVAR_SET_STRING("sv_skyvec_z", szVector); CLight::Spawn(); diff --git a/regamedll/dlls/lights.h b/regamedll/dlls/lights.h index bf9ae611..ce659b11 100644 --- a/regamedll/dlls/lights.h +++ b/regamedll/dlls/lights.h @@ -43,7 +43,7 @@ public: virtual int Save(CSave &save); virtual int Restore(CRestore &restore); virtual void KeyValue(KeyValueData *pkvd); - NOBODY 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 @@ -56,11 +56,7 @@ public: #endif // HOOK_GAMEDLL -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[2]; -#else // HOOK_GAMEDLL - static TYPEDESCRIPTION (*m_SaveData)[2]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[2]; private: @@ -83,6 +79,6 @@ public: 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 3a903714..6e3dcbfa 100644 --- a/regamedll/dlls/maprules.cpp +++ b/regamedll/dlls/maprules.cpp @@ -25,9 +25,9 @@ TYPEDESCRIPTION CGamePlayerZone::m_SaveData[] = #else -TYPEDESCRIPTION (*CRuleEntity::m_SaveData)[1]; -TYPEDESCRIPTION (*CGameText::m_SaveData)[1]; -TYPEDESCRIPTION (*CGamePlayerZone::m_SaveData)[4]; +TYPEDESCRIPTION (*CRuleEntity::pm_SaveData)[1]; +TYPEDESCRIPTION (*CGameText::pm_SaveData)[1]; +TYPEDESCRIPTION (*CGamePlayerZone::pm_SaveData)[4]; #endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/maprules.h b/regamedll/dlls/maprules.h index 7b68cf55..f391bbfd 100644 --- a/regamedll/dlls/maprules.h +++ b/regamedll/dlls/maprules.h @@ -76,11 +76,7 @@ public: #endif // HOOK_GAMEDLL public: -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[1]; -#else // HOOK_GAMEDLL - static TYPEDESCRIPTION (*m_SaveData)[1]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1]; void SetMaster(int iszMaster) { @@ -88,6 +84,7 @@ public: } protected: BOOL CanFireForActivator(CBaseEntity *pActivator); + private: string_t m_iszMaster; @@ -202,12 +199,10 @@ public: { return STRING(pev->message); } + public: -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[1]; -#else // HOOK_GAMEDLL - static TYPEDESCRIPTION (*m_SaveData)[1]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1]; + private: hudtextparms_t m_textParms; @@ -285,10 +280,10 @@ public: class CGamePlayerZone: public CRuleBrushEntity { public: - void KeyValue(KeyValueData *pkvd); - int Save(CSave &save); - int Restore(CRestore &restore); - void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); + NOBODY virtual void KeyValue(KeyValueData *pkvd); + NOBODY virtual int Save(CSave &save); + NOBODY virtual int Restore(CRestore &restore); + NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); #ifdef HOOK_GAMEDLL @@ -300,11 +295,7 @@ public: #endif // HOOK_GAMEDLL public: -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[4]; -#else // HOOK_GAMEDLL - static TYPEDESCRIPTION (*m_SaveData)[4]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[4]; private: string_t m_iszInTarget; @@ -449,7 +440,7 @@ public: class CGamePlayerTeam: public CRulePointEntity { public: - void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); + NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); #ifdef HOOK_GAMEDLL diff --git a/regamedll/dlls/monsters.h b/regamedll/dlls/monsters.h index 55c3ef6c..5034f27c 100644 --- a/regamedll/dlls/monsters.h +++ b/regamedll/dlls/monsters.h @@ -116,8 +116,15 @@ class CGib: public CBaseEntity public: virtual int ObjectCaps(void) { - return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION)|FCAP_DONT_SAVE; + return ObjectCaps_(); } +#ifdef HOOK_GAMEDLL + int ObjectCaps_(void) + { + return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION) | FCAP_DONT_SAVE; + } +#endif // HOOK_GAMEDLL + public: NOBODY void Spawn(const char *szGibModel); NOBODY void EXPORT BounceGibTouch(CBaseEntity *pOther); diff --git a/regamedll/dlls/mortar.cpp b/regamedll/dlls/mortar.cpp index 2c195e98..d5639dec 100644 --- a/regamedll/dlls/mortar.cpp +++ b/regamedll/dlls/mortar.cpp @@ -17,7 +17,7 @@ TYPEDESCRIPTION CFuncMortarField::m_SaveData[] = #else -TYPEDESCRIPTION (*CFuncMortarField::m_SaveData)[6]; +TYPEDESCRIPTION (*CFuncMortarField::pm_SaveData)[6]; #endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/mortar.h b/regamedll/dlls/mortar.h index 5522d9ae..291e9157 100644 --- a/regamedll/dlls/mortar.h +++ b/regamedll/dlls/mortar.h @@ -64,11 +64,7 @@ public: NOBODY void EXPORT FieldUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); public: -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[6]; -#else // HOOK_GAMEDLL - static TYPEDESCRIPTION (*m_SaveData)[6]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[6]; public: int m_iszXController; @@ -95,6 +91,7 @@ public: #endif // HOOK_GAMEDLL NOBODY void EXPORT MortarExplode(void); + public: int m_spriteTexture; diff --git a/regamedll/dlls/mpstubb.cpp b/regamedll/dlls/mpstubb.cpp index 1b786d62..25edde09 100644 --- a/regamedll/dlls/mpstubb.cpp +++ b/regamedll/dlls/mpstubb.cpp @@ -60,6 +60,24 @@ void CBaseMonster::CorpseFallThink(void) /* ../cstrike/dlls/mpstubb.cpp:62 */ void CBaseMonster::MonsterInitDead_(void) { + InitBoneControllers(); + + pev->solid = SOLID_BBOX; + pev->movetype = MOVETYPE_TOSS; + + pev->frame = 0; + ResetSequenceInfo(); + pev->framerate = 0; + + pev->max_health = pev->health; + pev->deadflag = DEAD_DEAD; + + UTIL_SetSize(pev, g_vecZero, g_vecZero); + UTIL_SetOrigin(pev, pev->origin); + + BecomeDead(); + SetThink(&CBaseEntity::SUB_Remove); + pev->nextthink = gpGlobals->time + 0.5; } /* ../cstrike/dlls/mpstubb.cpp:89 */ diff --git a/regamedll/dlls/multiplay_gamerules.cpp b/regamedll/dlls/multiplay_gamerules.cpp index cceac3d4..26931bc5 100644 --- a/regamedll/dlls/multiplay_gamerules.cpp +++ b/regamedll/dlls/multiplay_gamerules.cpp @@ -5,12 +5,12 @@ */ #ifndef HOOK_GAMEDLL -//static char mp_com_token[1500]; +static char mp_com_token[ COM_TOKEN_LEN ]; cvar_t *sv_clienttrace; #else -//char mp_com_token[1500]; +char mp_com_token[ COM_TOKEN_LEN ]; cvar_t *sv_clienttrace; #endif // HOOK_GAMEDLL @@ -163,14 +163,14 @@ char *GetTeam(int teamNo) { switch (teamNo) { - case TERRORIST: - return "TERRORIST"; - case CT: - return "CT"; - case SPECTATOR: - return "SPECTATOR"; - default: - break; + case TERRORIST: + return "TERRORIST"; + case CT: + return "CT"; + case SPECTATOR: + return "SPECTATOR"; + default: + break; } return ""; } @@ -1448,27 +1448,106 @@ NOBODY void DestroyMapCycle(mapcycle_t *cycle) } /* <115d30> ../cstrike/dlls/multiplay_gamerules.cpp:4271 */ -NOBODY char *MP_COM_GetToken(void) +char *MP_COM_GetToken(void) { + return mp_com_token; } /* <115d4d> ../cstrike/dlls/multiplay_gamerules.cpp:4283 */ -NOBODY char *MP_COM_Parse(char *data) +char *MP_COM_Parse(char *data) { -// -//skipwhite: // 4295 -// { -// int c; // 4285 -// int len; // 4286 -// } + int c; + int len; + + len = 0; + mp_com_token[0] = '\0'; + + if (!data) + { + return NULL; + } + +skipwhite: + // skip whitespace + while (*data <= ' ') + { + if (!data[0]) + return NULL; + + data++; + } + + c = *data; + + // skip // comments till the next line + if (c == '/' && data[1] == '/') + { + while (*data && *data != '\n') + data++; + + goto skipwhite; // start over new line + } + + // handle quoted strings specially: copy till the end or another quote + if (c == '\"') + { + data++; // skip starting quote + + while (true) + { + // get char and advance + c = *data++; + + if (c == '\"' || !c) + { + mp_com_token[len] = '\0'; + return data; + } + + mp_com_token[ len++ ] = c; + } + } + + // parse single characters + if (c == '{' || c == '}'|| c == ')'|| c == '(' || c == '\'' || c == ',') + { + mp_com_token[ len++ ] = c; + mp_com_token[ len ] = '\0'; + + return data + 1; + } + + // parse a regular word + do + { + mp_com_token[ len++ ] = c; + data++; + c = *data; + + if (c == '{' || c == '}'|| c == ')'|| c == '(' || c == '\'' || c == ',') + break; + } + while (c > 32); + + mp_com_token[len] = '\0'; + return data; } /* <115db1> ../cstrike/dlls/multiplay_gamerules.cpp:4360 */ -NOBODY int MP_COM_TokenWaiting(char *buffer) +NOXREF int MP_COM_TokenWaiting(char *buffer) { -// { -// char *p; // 4362 -// } + char *p; + + p = buffer; + while (*p && *p != '\n') + { + if (!isspace(*p) || isalnum(*p)) + return 1; + + p++; + } + + return 0; } /* <115e11> ../cstrike/dlls/multiplay_gamerules.cpp:4384 */ diff --git a/regamedll/dlls/pathcorner.cpp b/regamedll/dlls/pathcorner.cpp index aeb792ec..c06b516c 100644 --- a/regamedll/dlls/pathcorner.cpp +++ b/regamedll/dlls/pathcorner.cpp @@ -21,8 +21,8 @@ TYPEDESCRIPTION CPathTrack::m_SaveData[] = #else // HOOK_GAMEDLL -TYPEDESCRIPTION (*CPathCorner::m_SaveData)[1]; -TYPEDESCRIPTION (*CPathTrack::m_SaveData)[5]; +TYPEDESCRIPTION (*CPathCorner::pm_SaveData)[1]; +TYPEDESCRIPTION (*CPathTrack::pm_SaveData)[5]; #endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/pathcorner.h b/regamedll/dlls/pathcorner.h index c96aa624..81a05f12 100644 --- a/regamedll/dlls/pathcorner.h +++ b/regamedll/dlls/pathcorner.h @@ -57,17 +57,11 @@ public: #endif // HOOK_GAMEDLL public: -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[1]; -#else // HOOK_GAMEDLL - static TYPEDESCRIPTION (*m_SaveData)[1]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1]; private: float m_flWait; };/* size: 156, cachelines: 3, members: 3 */ - - #endif // PATHCORNER_H diff --git a/regamedll/dlls/plats.cpp b/regamedll/dlls/plats.cpp index a16a16dd..f4620ca6 100644 --- a/regamedll/dlls/plats.cpp +++ b/regamedll/dlls/plats.cpp @@ -61,12 +61,12 @@ TYPEDESCRIPTION CGunTarget::m_SaveData[] = #else -TYPEDESCRIPTION (*CBasePlatTrain::m_SaveData)[3]; -TYPEDESCRIPTION (*CFuncPlatRot::m_SaveData)[2]; -TYPEDESCRIPTION (*CFuncTrain::m_SaveData)[3]; -TYPEDESCRIPTION (*CFuncTrackTrain::m_SaveData)[12]; -TYPEDESCRIPTION (*CFuncTrackChange::m_SaveData)[9]; -TYPEDESCRIPTION (*CGunTarget::m_SaveData)[1]; +TYPEDESCRIPTION (*CBasePlatTrain::pm_SaveData)[3]; +TYPEDESCRIPTION (*CFuncPlatRot::pm_SaveData)[2]; +TYPEDESCRIPTION (*CFuncTrain::pm_SaveData)[3]; +TYPEDESCRIPTION (*CFuncTrackTrain::pm_SaveData)[12]; +TYPEDESCRIPTION (*CFuncTrackChange::pm_SaveData)[9]; +TYPEDESCRIPTION (*CGunTarget::pm_SaveData)[1]; #endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/plats.h b/regamedll/dlls/plats.h index 3149243e..77bee762 100644 --- a/regamedll/dlls/plats.h +++ b/regamedll/dlls/plats.h @@ -83,11 +83,7 @@ public: #endif // HOOK_GAMEDLL public: -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[3]; -#else // HOOK_GAMEDLL - static TYPEDESCRIPTION (*m_SaveData)[3]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[3]; public: BYTE m_bMoveSnd; @@ -121,13 +117,12 @@ public: #endif // HOOK_GAMEDLL public: - void Setup(void); + NOBODY void Setup(void); -public: - void EXPORT PlatUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); - void EXPORT CallGoDown(void); - void EXPORT CallHitTop(void); - void EXPORT CallHitBottom(void); + NOBODY void EXPORT PlatUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); + NOBODY void EXPORT CallGoDown(void); + NOBODY void EXPORT CallHitTop(void); + NOBODY void EXPORT CallHitBottom(void); };/* size: 320, cachelines: 5, members: 1 */ @@ -189,11 +184,7 @@ public: NOBODY void RotMove(Vector &destAngle, float time); public: -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[2]; -#else // HOOK_GAMEDLL - static TYPEDESCRIPTION (*m_SaveData)[2]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[2]; public: Vector m_end; @@ -232,15 +223,11 @@ public: #endif // HOOK_GAMEDLL public: - void EXPORT Wait(void); - void EXPORT Next(void); + NOBODY void EXPORT Wait(void); + NOBODY void EXPORT Next(void); public: -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[3]; -#else // HOOK_GAMEDLL - static TYPEDESCRIPTION (*m_SaveData)[3]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[3]; public: Vector m_vStartPosition; @@ -272,7 +259,7 @@ public: #endif // HOOK_GAMEDLL public: - void EXPORT Find(void); + NOBODY void EXPORT Find(void); };/* size: 152, cachelines: 3, members: 1 */ @@ -338,11 +325,7 @@ public: } public: -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[9]; -#else // HOOK_GAMEDLL - static TYPEDESCRIPTION (*m_SaveData)[9]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[9]; public: CPathTrack *m_trackTop; @@ -438,11 +421,7 @@ public: NOBODY void Stop(void); public: -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[1]; -#else // HOOK_GAMEDLL - static TYPEDESCRIPTION (*m_SaveData)[1]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1]; private: BOOL m_on; diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index dcaab6a5..f7c6099b 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -186,6 +186,14 @@ WeaponStruct g_weaponStruct[MAX_WEAPONS] = { 0, 0, 0, 0, 0 } }; +char *CDeadHEV::m_szPoses[] = +{ + "deadback", + "deadsitting", + "deadstomach", + "deadtable" +}; + #else //HOOK_GAMEDLL int giPrecacheGrunt; @@ -211,7 +219,7 @@ int gmsgWeaponList; //int gmsgDeathMsg; int gmsgScoreAttrib; int gmsgScoreInfo; -//int gmsgTeamInfo; +int gmsgTeamInfo; //int gmsgTeamScore; //int gmsgGameMode; //int gmsgMOTD; @@ -262,7 +270,7 @@ int gmsgScenarioIcon; int gmsgBotVoice; int gmsgBuyClose; int gmsgItemStatus; -//int gmsgLocation; +int gmsgLocation; int gmsgSpecHealth2; int gmsgBarTime2; int gmsgBotProgress; @@ -273,9 +281,10 @@ int gmsgBotProgress; BOOL gInitHUD; cvar_t *sv_aim; -TYPEDESCRIPTION (*CRevertSaved::m_SaveData)[2]; -TYPEDESCRIPTION (*CBasePlayer::m_playerSaveData)[40]; +TYPEDESCRIPTION (*CRevertSaved::pm_SaveData)[2]; +TYPEDESCRIPTION (*CBasePlayer::pm_playerSaveData)[40]; WeaponStruct g_weaponStruct[ MAX_WEAPONS ]; +char *(*CDeadHEV::pm_szPoses)[4]; #endif //HOOK_GAMEDLL @@ -311,11 +320,7 @@ void WriteSigonMessages(void) { for (int i = 0; i < MAX_WEAPONS; i++) { -#ifndef HOOK_GAMEDLL - ItemInfo &II = CBasePlayerItem::ItemInfoArray[i]; -#else - ItemInfo &II = (*CBasePlayerItem::pItemInfoArray)[i]; -#endif // HOOK_GAMEDLL + ItemInfo &II = IMPLEMENT_ARRAY_CLASS(CBasePlayerItem, ItemInfoArray)[i]; if (!II.iId) continue; @@ -559,31 +564,33 @@ NOXREF CBasePlayer *CBasePlayer::GetNextRadioRecipient(CBasePlayer *pStartPlayer if (FNullEnt(pEntity->edict())) break; - //BOOL bSend = FALSE; + BOOL bSend = FALSE; CBasePlayer *pPlayer = GetClassPtr((CBasePlayer *)pEntity->pev); if (pEntity->IsPlayer()) { - if (pEntity->pev->flags != FL_DORMANT) - { - if (pPlayer && pPlayer->m_iTeam == m_iTeam) - return pPlayer; - } + if (pEntity->IsDormant()) + continue; + + if (pPlayer && pPlayer->m_iTeam == m_iTeam) + bSend = TRUE; } else if (pPlayer) { - if (pPlayer->pev->iuser1 == OBS_CHASE_LOCKED || pPlayer->pev->iuser1 == OBS_CHASE_FREE || pPlayer->pev->iuser1 == OBS_IN_EYE) - { - if (!FNullEnt(m_hObserverTarget)) - continue; + if (pPlayer->pev->iuser1 != OBS_CHASE_LOCKED && pPlayer->pev->iuser1 != OBS_CHASE_FREE && pPlayer->pev->iuser1 != OBS_IN_EYE) + continue; - CBasePlayer *pTarget = (CBasePlayer *)CBaseEntity::Instance(pPlayer->m_hObserverTarget->pev); - if (pTarget && pTarget->m_iTeam == m_iTeam) - { - return pPlayer; - } - } + if (!FNullEnt(m_hObserverTarget)) + continue; + + CBasePlayer *pTarget = (CBasePlayer *)CBaseEntity::Instance( pPlayer->m_hObserverTarget->pev ); + + if (pTarget && pTarget->m_iTeam == m_iTeam) + bSend = TRUE; } + + if (bSend) + return pPlayer; } return NULL; } @@ -625,7 +632,7 @@ void CBasePlayer::Radio(const char *msg_id, const char *msg_verbose, short pitch CBasePlayer *pTarget = (CBasePlayer *)CBaseEntity::Instance(pPlayer->m_hObserverTarget->pev); - if (pTarget && pTarget->m_iTeam == pPlayer->m_iTeam) + if (pTarget && pTarget->m_iTeam == m_iTeam) bSend = TRUE; } @@ -640,6 +647,8 @@ void CBasePlayer::Radio(const char *msg_id, const char *msg_verbose, short pitch if (msg_verbose) { + // search the place name where is located the player + const char *placeName = NULL; Place playerPlace = TheNavAreaGrid.GetPlace( &pev->origin ); const BotPhraseList *placeList = TheBotPhrases->GetPlaceList(); @@ -1220,13 +1229,9 @@ void packPlayerItem(CBasePlayer *pPlayer, CBasePlayerItem *pItem, bool packAmmo) pWeaponBox->pev->nextthink = gpGlobals->time + 300; pWeaponBox->PackWeapon(pItem); -#ifndef HOOK_GAMEDLL if (packAmmo) - pWeaponBox->PackAmmo(MAKE_STRING(CBasePlayerItem::ItemInfoArray[pItem->m_iId].pszAmmo1), pPlayer->m_rgAmmo[pItem->PrimaryAmmoIndex()]); -#else // HOOK_GAMEDLL - if (packAmmo) - pWeaponBox->PackAmmo(MAKE_STRING((*CBasePlayerItem::pItemInfoArray)[pItem->m_iId].pszAmmo1), pPlayer->m_rgAmmo[pItem->PrimaryAmmoIndex()]); -#endif // HOOK_GAMEDLL + pWeaponBox->PackAmmo(MAKE_STRING( IMPLEMENT_ARRAY_CLASS(CBasePlayerItem, ItemInfoArray)[ pItem->m_iId ].pszAmmo1 ), pPlayer->m_rgAmmo[pItem->PrimaryAmmoIndex()]); + SET_MODEL(ENT(pWeaponBox->pev), modelName); } } @@ -1250,10 +1255,9 @@ void CBasePlayer::PackDeadPlayerItems(void) int nBestWeight = 0; CBasePlayerItem *pBestItem = NULL; - //TODO: 1 - 6? for (int n = 0; n < MAX_ITEM_TYPES; n++) { - CBasePlayerItem *pPlayerItem = m_rgpPlayerItems[n]; + CBasePlayerItem *pPlayerItem = m_rgpPlayerItems[ n ]; while (pPlayerItem != NULL) { @@ -2784,7 +2788,7 @@ void WINAPI_HOOK CBasePlayer::MenuPrint(const char *msg) const char *msg_portion = msg; char sbuf[MAX_BUFFER_MENU_BRIEFING + 1]; - while (strlen(msg_portion) >= MAX_BUFFER_MENU_BRIEFING) + while (Q_strlen(msg_portion) >= MAX_BUFFER_MENU_BRIEFING) { Q_strncpy(sbuf, msg_portion, MAX_BUFFER_MENU_BRIEFING); sbuf[ MAX_BUFFER_MENU_BRIEFING ] = '\0'; @@ -4191,17 +4195,10 @@ int CBasePlayer::GetAmmoIndex(const char *psz) for (int i = 1; i < MAX_AMMO_SLOTS; i++) { -#ifndef HOOK_GAMEDLL - if (!AmmoInfoArray[i].pszName) - continue; - - if (!Q_stricmp(psz, CBasePlayerItem::AmmoInfoArray[i].pszName)) -#else - if (!(*CBasePlayerItem::pAmmoInfoArray)[i].pszName) + if (!IMPLEMENT_ARRAY_CLASS(CBasePlayerItem, AmmoInfoArray)[ i ].pszName) continue; - if (!Q_stricmp(psz, (*CBasePlayerItem::pAmmoInfoArray)[i].pszName)) -#endif // HOOK_GAMEDLL + if (!Q_stricmp(psz, IMPLEMENT_ARRAY_CLASS(CBasePlayerItem, AmmoInfoArray)[ i ].pszName)) return i; } return -1; @@ -4737,9 +4734,9 @@ NOBODY void CBasePlayer::SwitchTeam(void) void CBasePlayer::UpdateShieldCrosshair(bool draw) { if (draw) - m_iHideHUD &= ~HIDEHUD_CROSSHAIR;//0xFFFFFFBF;//0xBF; + m_iHideHUD &= ~HIDEHUD_CROSSHAIR; else - m_iHideHUD |= HIDEHUD_CROSSHAIR;//0x40 + m_iHideHUD |= HIDEHUD_CROSSHAIR; } /* <152fbc> ../cstrike/dlls/player.cpp:9313 */ @@ -4783,37 +4780,68 @@ void CBasePlayer::TabulateAmmo(void) } /* <1511eb> ../cstrike/dlls/player.cpp:9365 */ -NOBODY int CDeadHEV::Classify_(void) +int CDeadHEV::Classify_(void) { + return CLASS_HUMAN_MILITARY; } /* <152451> ../cstrike/dlls/player.cpp:9375 */ -NOBODY void CDeadHEV::KeyValue_(KeyValueData *pkvd) +void CDeadHEV::KeyValue_(KeyValueData *pkvd) { -// FStrEq(const char *sz1, -// const char *sz2); // 9377 -// KeyValue(CDeadHEV *const this, -// KeyValueData *pkvd); // 9375 + if (FStrEq(pkvd->szKeyName, "pose")) + { + m_iPose = atoi(pkvd->szValue); + pkvd->fHandled = TRUE; + } + else + CBaseMonster::KeyValue(pkvd); } /* <159a88> ../cstrike/dlls/player.cpp:9386 */ LINK_ENTITY_TO_CLASS(monster_hevsuit_dead, CDeadHEV); /* <1513ce> ../cstrike/dlls/player.cpp:9391 */ -NOBODY void CDeadHEV::Spawn_(void) +void CDeadHEV::Spawn_(void) { + PRECACHE_MODEL("models/player.mdl"); + SET_MODEL(ENT(pev), "models/player.mdl"); + + pev->effects = 0; + pev->yaw_speed = 8.0f; + + pev->sequence = 0; + pev->body = 1; + + m_bloodColor = BLOOD_COLOR_RED; + pev->sequence = LookupSequence(m_szPoses[ m_iPose ]); + + if (pev->sequence == -1) + { + ALERT(at_console, "Dead hevsuit with bad pose\n"); + pev->sequence = 0; + pev->effects = EF_BRIGHTFIELD; + } + + pev->health = 8; + MonsterInitDead(); } /* <159b64> ../cstrike/dlls/player.cpp:9426 */ LINK_ENTITY_TO_CLASS(player_weaponstrip, CStripWeapons); /* <15f62f> ../cstrike/dlls/player.cpp:9428 */ -NOBODY void CStripWeapons::Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) +void CStripWeapons::Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { -// { -// class CBasePlayer *pPlayer; // 9430 -// Instance(edict_t *pent); // 9438 -// } + CBasePlayer *pPlayer = NULL; + + if (pActivator && pActivator->IsPlayer()) + pPlayer = (CBasePlayer *)pActivator; + + else if (!g_pGameRules->IsDeathmatch()) + pPlayer = (CBasePlayer *)Instance(INDEXENT(1)); + + if (pPlayer) + pPlayer->RemoveAllItems(FALSE); } /* <159c40> ../cstrike/dlls/player.cpp:9473 */ @@ -4823,149 +4851,342 @@ LINK_ENTITY_TO_CLASS(player_loadsaved, CRevertSaved); IMPLEMENT_SAVERESTORE(CRevertSaved, CPointEntity); /* <152540> ../cstrike/dlls/player.cpp:9483 */ -NOBODY void CRevertSaved::KeyValue_(KeyValueData *pkvd) +void CRevertSaved::KeyValue_(KeyValueData *pkvd) { -// FStrEq(const char *sz1, -// const char *sz2); // 9485 -// FStrEq(const char *sz1, -// const char *sz2); // 9490 -// KeyValue(CRevertSaved *const this, -// KeyValueData *pkvd); // 9483 -// atof(const char *__nptr); // 9487 -// atof(const char *__nptr); // 9492 + if (FStrEq(pkvd->szKeyName, "duration")) + { + SetDuration( atof(pkvd->szValue) ); + pkvd->fHandled = TRUE; + } + else if (FStrEq(pkvd->szKeyName, "holdtime")) + { + SetHoldTime( atof(pkvd->szValue) ); + pkvd->fHandled = TRUE; + } + else if (FStrEq(pkvd->szKeyName, "messagetime")) + { + SetMessageTime( atof(pkvd->szValue) ); + pkvd->fHandled = TRUE; + } + else if (FStrEq(pkvd->szKeyName, "loadtime")) + { + SetLoadTime( atof(pkvd->szValue) ); + pkvd->fHandled = TRUE; + } + else + CPointEntity::KeyValue(pkvd); } /* <151365> ../cstrike/dlls/player.cpp:9509 */ -NOBODY void CRevertSaved::Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) +void CRevertSaved::Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { + UTIL_ScreenFadeAll(pev->rendercolor, Duration(), HoldTime(), (int)pev->renderamt, FFADE_OUT); + pev->nextthink = gpGlobals->time + MessageTime(); + SetThink(&CRevertSaved::MessageThink); } /* <152a96> ../cstrike/dlls/player.cpp:9517 */ -NOBODY void CRevertSaved::MessageThink(void) +void CRevertSaved::MessageThink(void) { -// { -// float nextThink; // 9520 -// LoadThink(CRevertSaved *const this); // 9527 -// } + float nextThink = LoadTime() - MessageTime(); + UTIL_ShowMessageAll(STRING(pev->message)); + + if (nextThink > 0) + { + pev->nextthink = gpGlobals->time + nextThink; + SetThink(&CRevertSaved::LoadThink); + } + else + LoadThink(); } /* <15198b> ../cstrike/dlls/player.cpp:9531 */ -NOBODY void CRevertSaved::LoadThink(void) +void CRevertSaved::LoadThink(void) { -// LoadThink(CRevertSaved *const this); // 9531 + if (!gpGlobals->deathmatch) + SERVER_COMMAND("reload\n"); } /* <15133c> ../cstrike/dlls/player.cpp:9549 */ -NOBODY void CInfoIntermission::Spawn_(void) +void CInfoIntermission::Spawn_(void) { + UTIL_SetOrigin(pev, pev->origin); + + pev->solid = SOLID_NOT; + pev->effects = EF_NODRAW; + pev->v_angle = g_vecZero; + pev->nextthink = gpGlobals->time + 2; } /* <1530e6> ../cstrike/dlls/player.cpp:9560 */ -NOBODY void CInfoIntermission::Think_(void) +void CInfoIntermission::Think_(void) { -// { -// edict_t *pTarget; // 9562 -// FIND_ENTITY_BY_TARGETNAME(edict_t *entStart, -// const char *pszName); // 9565 -// FNullEnt(const edict_t *pent); // 9567 -// operator-(const Vector *const this, -// const Vector &v); // 9569 -// Normalize(const Vector *const this); // 9569 -// } + edict_t *pTarget = FIND_ENTITY_BY_TARGETNAME(NULL, STRING(pev->target)); + + if (!FNullEnt(pTarget)) + { + pev->v_angle = UTIL_VecToAngles((pTarget->v.origin - pev->origin).Normalize()); + pev->v_angle.x = -pev->v_angle.x; + } } /* <159d1c> ../cstrike/dlls/player.cpp:9574 */ LINK_ENTITY_TO_CLASS(info_intermission, CInfoIntermission); /* <159df8> ../cstrike/dlls/player.cpp:9586 */ -NOBODY void CBasePlayer::StudioEstimateGait(void) +void CBasePlayer::StudioEstimateGait(void) { -// { -// float dt; // 9588 -// Vector est_velocity; // 9589 -// operator-(const Vector *const this, -// const Vector &v); // 9604 -// Length(const Vector *const this); // 9607 -// { -// float flYawDiff; // 9618 -// float flYaw; // 9619 -// } -// } + float_precision dt; + Vector est_velocity; + + dt = gpGlobals->frametime; + + if (dt < 0) + dt = 0; + + else if (dt > 1.0) + dt = 1; + + if (dt == 0) + { + m_flGaitMovement = 0; + return; + } + + est_velocity = pev->origin - m_prevgaitorigin; + m_prevgaitorigin = pev->origin; + + m_flGaitMovement = est_velocity.Length(); + + if (dt <= 0 || m_flGaitMovement / dt < 5) + { + m_flGaitMovement = 0; + + est_velocity.x = 0; + est_velocity.y = 0; + } + + if (!est_velocity.x && !est_velocity.y) + { + float_precision flYawDiff = pev->angles.y - m_flGaityaw; + float_precision flYaw = fmod(flYawDiff, 360); + + flYawDiff = flYawDiff - (int64_t)(flYawDiff / 360) * 360; + + if (flYawDiff > 180) + flYawDiff -= 360; + + if (flYawDiff < -180) + flYawDiff += 360; + + if (flYaw < -180) + flYaw += 360; + + else if (flYaw > 180) + flYaw -= 360; + + if (flYaw > -5 && flYaw < 5) + m_flYawModifier = 0.05; + + if (flYaw < -90 || flYaw > 90) + m_flYawModifier = 3.5; + + if (dt < 0.25) + flYawDiff *= dt * m_flYawModifier; + else + flYawDiff *= dt; + + if ((float_precision)abs((int64_t)flYawDiff) < 0.1) + flYawDiff = 0; + + m_flGaityaw += flYawDiff; + m_flGaityaw -= (int64_t)(m_flGaityaw / 360) * 360; + + m_flGaitMovement = 0; + } + else + { + m_flGaityaw = (atan2((float_precision)est_velocity.y, (float_precision)est_velocity.x) * 180 / M_PI); + + if (m_flGaityaw > 180) + m_flGaityaw = 180; + + if (m_flGaityaw < -180) + m_flGaityaw = -180; + } } /* <159f01> ../cstrike/dlls/player.cpp:9685 */ -NOBODY void CBasePlayer::StudioPlayerBlend(int *pBlend, float *pPitch) +NOXREF void CBasePlayer::StudioPlayerBlend(int *pBlend, float *pPitch) { -// { -// float range; // 9688 -// } + // calc up/down pointing + float range = (float)(int64_t)(*pPitch * 3.0f); + + *pBlend = range; + + if (range <= -45.0f) + { + *pBlend = 255; + *pPitch = 0; + } + else if (range >= 45.0f) + { + *pBlend = 0; + *pPitch = 0; + } + else + { + *pBlend = (int64_t)((45.0f - range) * (255.0f / 90.0f)); + *pPitch = 0; + } } /* <159f81> ../cstrike/dlls/player.cpp:9709 */ -NOBODY void CBasePlayer::CalculatePitchBlend(void) +NOXREF void CBasePlayer::CalculatePitchBlend(void) { -// { -// int iBlend; // 9711 -// float temp; // 9712 -// StudioPlayerBlend(CBasePlayer *const this, -// int *pBlend, -// float *pPitch); // 9714 -// } + int iBlend; + float temp = pev->angles.x; + + StudioPlayerBlend(&iBlend, &temp); + + pev->blending[1] = iBlend; + m_flPitch = iBlend; } /* <15a007> ../cstrike/dlls/player.cpp:9720 */ -NOBODY void CBasePlayer::CalculateYawBlend(void) +void CBasePlayer::CalculateYawBlend(void) { -// { -// float dt; // 9722 -// float flYaw; // 9723 -// float maxyaw; // 9745 -// float blend_yaw; // 9763 -// } + float dt; + float maxyaw = 255.0f; + + float_precision flYaw; + float_precision blend_yaw; + + dt = gpGlobals->frametime; + + if (dt < 0) + dt = 0; + + else if (dt > 1) + dt = 1; + + StudioEstimateGait(); + + flYaw = fmod((float_precision)(pev->angles.y - m_flGaityaw), 360); + + if (flYaw < -180) + flYaw += 360; + + else if (flYaw > 180) + flYaw -= 360; + + if (m_flGaitMovement != 0.0) + { + if (flYaw > 120) + { + m_flGaityaw -= 180; + m_flGaitMovement = -m_flGaitMovement; + flYaw -= 180; + } + else if (flYaw < -120) + { + m_flGaityaw += 180; + m_flGaitMovement = -m_flGaitMovement; + flYaw += 180; + } + } + + flYaw = (flYaw / 90) * 128 + 127; + + if (flYaw > 255) + flYaw = 255; + + else if (flYaw < 0) + flYaw = 0; + + blend_yaw = maxyaw - flYaw; + + pev->blending[0] = (int64_t)blend_yaw; + m_flYaw = blend_yaw; } /* <15a07b> ../cstrike/dlls/player.cpp:9776 */ -NOBODY void CBasePlayer::StudioProcessGait(void) +void CBasePlayer::StudioProcessGait(void) { -// { -// mstudioseqdesc_t *pseqdesc; // 9778 -// float dt; // 9779 -// class model_s *model; // 9793 -// studiohdr_t *pstudiohdr; // 9797 -// CalculatePitchBlend(CBasePlayer *const this); // 9791 -// } + mstudioseqdesc_t *pseqdesc; + float_precision dt = gpGlobals->frametime; + + if (dt < 0.0) + dt = 0; + + else if (dt > 1.0) + dt = 1; + + CalculateYawBlend(); + CalculatePitchBlend(); + + model_t *model = (model_t *)GET_MODEL_PTR(edict()); + + if (!model) + return; + + studiohdr_t *pstudiohdr = (studiohdr_t *)model; + + pseqdesc = (mstudioseqdesc_t *)((byte *)pstudiohdr + pstudiohdr->seqindex) + pev->gaitsequence; + + if (pseqdesc->linearmovement.x > 0.0f) + m_flGaitframe += (m_flGaitMovement / pseqdesc->linearmovement.x) * pseqdesc->numframes; + else + m_flGaitframe += pev->framerate * pseqdesc->fps * dt; + + m_flGaitframe -= (int)(m_flGaitframe / pseqdesc->numframes) * pseqdesc->numframes; + + if (m_flGaitframe < 0) + m_flGaitframe += pseqdesc->numframes; } /* <15a444> ../cstrike/dlls/player.cpp:9821 */ -NOBODY void CBasePlayer::ResetStamina(void) +NOXREF void CBasePlayer::ResetStamina(void) { + pev->fuser1 = 0; + pev->fuser3 = 0; + pev->fuser2 = 0; } /* <15a467> ../cstrike/dlls/player.cpp:9829 */ -NOBODY float GetPlayerPitch(const edict_t *pEdict) +float GetPlayerPitch(const edict_t *pEdict) { -// { -// class CBasePlayer *pPlayer; // 9831 -// Instance(entvars_t *pev); // 9836 -// } -} - -/* <15a5f9> ../cstrike/dlls/player.cpp:9863 */ -NOBODY int GetPlayerGaitsequence(edict_t *pEdict) -{ -// { -// class CBasePlayer *pPlayer; // 9865 -// Instance(entvars_t *pev); // 9870 -// } + entvars_t *pev = VARS((edict_t *)pEdict); + CBasePlayer *pPlayer = reinterpret_cast< CBasePlayer * >(CBasePlayer::Instance( pev )); + + if (!pPlayer) + return 0.0f; + + return pPlayer->m_flPitch; } /* <15a530> ../cstrike/dlls/player.cpp:9846 */ -NOBODY float GetPlayerYaw(const edict_t *pEdict) +float GetPlayerYaw(const edict_t *pEdict) { -// { -// class CBasePlayer *pPlayer; // 9848 -// Instance(entvars_t *pev); // 9853 -// } + entvars_t *pev = VARS((edict_t *)pEdict); + CBasePlayer *pPlayer = reinterpret_cast< CBasePlayer * >(CBasePlayer::Instance( pev )); + + if (!pPlayer) + return 0.0f; + + return pPlayer->m_flYaw; +} + +/* <15a5f9> ../cstrike/dlls/player.cpp:9863 */ +int GetPlayerGaitsequence(edict_t *pEdict) +{ + entvars_t *pev = VARS((edict_t *)pEdict); + CBasePlayer *pPlayer = reinterpret_cast< CBasePlayer * >(CBasePlayer::Instance( pev )); + + if (!pPlayer) + return 1; + + return pPlayer->m_iGaitsequence; } /* <15a6c2> ../cstrike/dlls/player.cpp:9880 */ @@ -4996,29 +5217,86 @@ void CBasePlayer::SpawnClientSideCorpse(void) } /* <15a7a2> ../cstrike/dlls/player.cpp:9909 */ -NOBODY BOOL CBasePlayer::IsArmored(int nHitGroup) +NOXREF BOOL CBasePlayer::IsArmored(int nHitGroup) { -// { -// BOOL fApplyArmor; // 9911 -// } -// IsArmored(CBasePlayer *const this, -// int nHitGroup); // 9909 + BOOL fApplyArmor = FALSE; + + if (m_iKevlar == ARMOR_TYPE_EMPTY) + return FALSE; + + switch (nHitGroup) + { + case HITGROUP_HEAD: + { + fApplyArmor = (m_iKevlar == ARMOR_TYPE_HELMET); + break; + } + case HITGROUP_GENERIC: + case HITGROUP_CHEST: + case HITGROUP_STOMACH: + case HITGROUP_LEFTARM: + case HITGROUP_RIGHTARM: + fApplyArmor = TRUE; + break; + } + + return fApplyArmor; } /* <15a847> ../cstrike/dlls/player.cpp:9939 */ -NOBODY BOOL CBasePlayer::ShouldDoLargeFlinch(int nHitGroup, int nGunType) +NOXREF BOOL CBasePlayer::ShouldDoLargeFlinch(int nHitGroup, int nGunType) { + if (pev->flags & FL_DUCKING) + return FALSE; + + if (nHitGroup != HITGROUP_LEFTLEG && nHitGroup != HITGROUP_RIGHTLEG) + { + switch (nGunType) + { + case WEAPON_SCOUT: + case WEAPON_AUG: + case WEAPON_SG550: + case WEAPON_GALIL: + case WEAPON_FAMAS: + case WEAPON_AWP: + case WEAPON_M3: + case WEAPON_M4A1: + case WEAPON_G3SG1: + case WEAPON_DEAGLE: + case WEAPON_SG552: + case WEAPON_AK47: + return TRUE; + } + } + + return FALSE; } /* <15a87d> ../cstrike/dlls/player.cpp:9971 */ -NOBODY void CBasePlayer::SetPrefsFromUserinfo(char *infobuffer) +void CBasePlayer::SetPrefsFromUserinfo(char *infobuffer) { -// { -// const char *pszKeyVal; // 9973 -// atoi(const char *__nptr); // 10005 -// atoi(const char *__nptr); // 9994 -// atoi(const char *__nptr); // 9983 -// } + const char *pszKeyVal; + + pszKeyVal = GET_KEY_VALUE(infobuffer, "_cl_autowepswitch"); + + if (Q_strcmp(pszKeyVal, "")) + m_iAutoWepSwitch = atoi(pszKeyVal); + else + m_iAutoWepSwitch = 1; + + pszKeyVal = GET_KEY_VALUE(infobuffer, "_vgui_menus"); + + if (Q_strcmp(pszKeyVal, "")) + m_bVGUIMenus = atoi(pszKeyVal) != 0; + else + m_bVGUIMenus = true; + + pszKeyVal = GET_KEY_VALUE(infobuffer, "_ah"); + + if (Q_strcmp(pszKeyVal, "")) + m_bShowHints = atoi(pszKeyVal) != 0; + else + m_bShowHints = true; } /* <15a92a> ../cstrike/dlls/player.cpp:10013 */ @@ -5048,7 +5326,7 @@ bool CBasePlayer::CanAffordPrimary(void) { temp = &g_weaponStruct[ i ]; - if (temp->m_side & TERRORIST && temp->m_slot == PRIMARY_WEAPON_SLOT && account >= temp->m_price) + if ((temp->m_side & TERRORIST) && temp->m_slot == PRIMARY_WEAPON_SLOT && account >= temp->m_price) return true; } } @@ -5059,7 +5337,7 @@ bool CBasePlayer::CanAffordPrimary(void) { temp = &g_weaponStruct[ i ]; - if (temp->m_side & CT && temp->m_slot == PRIMARY_WEAPON_SLOT && account >= temp->m_price) + if ((temp->m_side & CT) && temp->m_slot == PRIMARY_WEAPON_SLOT && account >= temp->m_price) return true; } } @@ -5102,14 +5380,10 @@ bool CBasePlayer::CanAffordSecondaryAmmo(void) /* <15ac14> ../cstrike/dlls/player.cpp:10199 */ bool CBasePlayer::CanAffordArmor(void) { - if (m_iKevlar == 1 && pev->armorvalue == 100.0f && m_iAccount >= HELMET_PRICE) + if (m_iKevlar == ARMOR_TYPE_KEVLAR && pev->armorvalue == 100.0f && m_iAccount >= HELMET_PRICE) return true; return (m_iAccount >= KEVLAR_PRICE); - - //if (m_iKevlar != 1 || pev->armorvalue != 100.0f || m_iAccount < HELMET_PRICE) - // return (m_iAccount >= KEVLAR_PRICE); - //return true; } /* <15ac3c> ../cstrike/dlls/player.cpp:10217 */ @@ -5201,87 +5475,192 @@ NOBODY void CBasePlayer::ClientCommand(const char *cmd, const char *arg1, const } /* <15aea9> ../cstrike/dlls/player.cpp:10401 */ -NOBODY const char *GetBuyStringForWeaponClass(int weaponClass) +NOXREF const char *GetBuyStringForWeaponClass(int weaponClass) { + switch (weaponClass) + { + case WEAPONCLASS_PISTOL: + return "deagle elites fn57 usp glock p228 shield"; + case WEAPONCLASS_SNIPERRIFLE: + return "awp sg550 g3sg1 scout"; + case WEAPONCLASS_GRENADE: + return "hegren"; + case WEAPONCLASS_SHOTGUN: + return "xm1014 m3"; + case WEAPONCLASS_SUBMACHINEGUN: + return "p90 ump45 mp5 tmp mac10"; + case WEAPONCLASS_MACHINEGUN: + return "m249"; + case WEAPONCLASS_RIFLE: + return "sg552 aug ak47 m4a1 galil famas"; + } + + return NULL; } /* <15aee9> ../cstrike/dlls/player.cpp:10454 */ -NOBODY void CBasePlayer::ClearAutoBuyData(void) +void CBasePlayer::ClearAutoBuyData(void) { + m_autoBuyString[0] = '\0'; } /* <15af11> ../cstrike/dlls/player.cpp:10459 */ -NOBODY void CBasePlayer::AddAutoBuyData(const char *str) +void CBasePlayer::AddAutoBuyData(const char *str) { -// { -// int len; // 10461 -// } + int len = Q_strlen(m_autoBuyString); + + if (len < MAX_AUTOBUY_LENGTH - 1) + { + if (len > 0) + m_autoBuyString[ len ] = ' '; + + Q_strncat(m_autoBuyString, str, MAX_AUTOBUY_LENGTH - len); + } } /* <15af66> ../cstrike/dlls/player.cpp:10478 */ -NOBODY void CBasePlayer::InitRebuyData(const char *str) -{ +void CBasePlayer::InitRebuyData(const char *str) +{ + if (!str || Q_strlen(str) > MAX_REBUY_LENGTH) + { + return; + } + + if (m_rebuyString != NULL) + { + delete m_rebuyString; + m_rebuyString = NULL; + } + + m_rebuyString = new char[ Q_strlen(str) + 1 ]; + Q_strcpy(m_rebuyString, str); + m_rebuyString[ Q_strlen(str) ] = '\0'; } /* <15be4f> ../cstrike/dlls/player.cpp:10500 */ NOBODY void CBasePlayer::AutoBuy(void) { -// { -// const char *c; // 10502 -// bool boughtPrimary; // 10504 -// bool boughtSecondary; // 10505 -// char prioritizedString; // 10519 -// PickFlashKillWeaponString(CBasePlayer *const this); // 10507 -// PickGrenadeKillWeaponString(CBasePlayer *const this); // 10513 -// PrioritizeAutoBuyString(CBasePlayer *const this, -// char *autobuyString, -// const char *priorityString); // 10524 -// PrioritizeAutoBuyString(CBasePlayer *const this, -// char *autobuyString, -// const char *priorityString); // 10531 -// PickFlashKillWeaponString(CBasePlayer *const this); // 10542 -// } + const int d = sizeof(g_SentBanMasks); + const char *c = NULL; + bool boughtPrimary = false; + bool boughtSecondary = false; + char prioritizedString[ MAX_AUTOBUY_LENGTH ]; + + c = PickFlashKillWeaponString(); + + if (c != NULL) + { + ParseAutoBuyString(c, boughtPrimary, boughtSecondary); + } + + c = PickGrenadeKillWeaponString(); + + if (c != NULL) + { + ParseAutoBuyString(c, boughtPrimary, boughtSecondary); + } + + // TODO: Reverse me + c = PickPrimaryCareerTaskWeapon(); + + if (c != NULL) + { + Q_strcpy(prioritizedString, c); + + PrioritizeAutoBuyString(prioritizedString, m_autoBuyString); + ParseAutoBuyString(prioritizedString, boughtPrimary, boughtSecondary); + } + + // TODO: Reverse me + c = PickSecondaryCareerTaskWeapon(); + + if (c != NULL) + { + Q_strcpy(prioritizedString, c); + + PrioritizeAutoBuyString(prioritizedString, m_autoBuyString); + ParseAutoBuyString(prioritizedString, boughtPrimary, boughtSecondary); + } + + ParseAutoBuyString(m_autoBuyString, boughtPrimary, boughtSecondary); + + c = PickFlashKillWeaponString(); + + if (c != NULL) + { + ParseAutoBuyString(c, boughtPrimary, boughtSecondary); + } + + if (TheTutor) + TheTutor->OnEvent( EVENT_PLAYER_LEFT_BUY_ZONE ); } /* <14ea4e> ../cstrike/dlls/player.cpp:10556 */ -NOBODY bool IsPrimaryWeaponClass(int classId) +NOXREF bool IsPrimaryWeaponClass(int classId) { + return (classId >= WEAPONCLASS_SUBMACHINEGUN && classId <= WEAPONCLASS_SNIPERRIFLE); } /* <15afbe> ../cstrike/dlls/player.cpp:10571 */ -NOBODY bool IsPrimaryWeaponId(int id) +NOXREF bool IsPrimaryWeaponId(int id) { -// { -// const char *alias; // 10573 -// int classId; // 10579 -// } + int classId = WEAPONCLASS_NONE; + const char *alias = WeaponIDToAlias( id ); + + if (alias) + { + classId = AliasToWeaponClass(alias); + } + + return IsPrimaryWeaponClass(classId); } /* <14ea6f> ../cstrike/dlls/player.cpp:10583 */ -NOBODY bool IsSecondaryWeaponClass(int classId) +NOXREF bool IsSecondaryWeaponClass(int classId) { + return (classId == WEAPONCLASS_PISTOL); } /* <15b059> ../cstrike/dlls/player.cpp:10588 */ -NOBODY bool IsSecondaryWeaponId(int id) +NOXREF bool IsSecondaryWeaponId(int id) { -// { -// const char *alias; // 10590 -// int classId; // 10596 -// } + int classId = WEAPONCLASS_NONE; + const char *alias = WeaponIDToAlias( id ); + + if (alias) + { + classId = AliasToWeaponClass(alias); + } + + return IsSecondaryWeaponClass(classId); } /* <15b0f1> ../cstrike/dlls/player.cpp:10600 */ -NOBODY const char *GetWeaponAliasFromName(const char *weaponName) +NOXREF const char *GetWeaponAliasFromName(const char *weaponName) { + UNTESTED + + if (!Q_strncmp(weaponName, "weapon_", 7)) + weaponName += 7; + + return weaponName; } /* <15b133> ../cstrike/dlls/player.cpp:10607 */ -NOBODY bool CurrentWeaponSatisfies(CBasePlayerWeapon *pWeapon, int id, int classId) +NOXREF bool CurrentWeaponSatisfies(CBasePlayerWeapon *pWeapon, int id, int classId) { -// { -// const char *weaponName; // 10612 -// } + if (pWeapon == NULL) + return false; + + const char *weaponName = GetWeaponAliasFromName( pWeapon->pszName() ); + + if (id && AliasToWeaponID( weaponName ) == id) + return true; + + if (classId && AliasToWeaponClass( weaponName ) == classId) + return true; + + return false; } /* <15b1eb> ../cstrike/dlls/player.cpp:10623 */ @@ -5368,302 +5747,523 @@ NOBODY const char *CBasePlayer::PickSecondaryCareerTaskWeapon(void) } /* <15b9ea> ../cstrike/dlls/player.cpp:10759 */ -NOBODY const char *CBasePlayer::PickFlashKillWeaponString(void) +NOXREF const char *CBasePlayer::PickFlashKillWeaponString(void) { -// { -// bool foundOne; // 10761 -// CareerTaskListIt it; // 10762 -// { -// class CCareerTask *pTask; // 10765 -// operator++(_List_iterator *const this); // 10776 -// } -// } + bool foundOne = false; + + for (CareerTaskListIt it = TheCareerTasks->GetTasks()->begin(); it != TheCareerTasks->GetTasks()->end(); ++it) + { + CCareerTask *pTask = (*it); + + if (!pTask->IsComplete() && !Q_strcmp(pTask->GetTaskName(), "killblind")) + { + foundOne = true; + break; + } + } + + if (foundOne) + return "flash flash"; + + return NULL; + } /* <15baa1> ../cstrike/dlls/player.cpp:10787 */ -NOBODY const char *CBasePlayer::PickGrenadeKillWeaponString(void) +NOXREF const char *CBasePlayer::PickGrenadeKillWeaponString(void) { -// { -// bool foundOne; // 10789 -// CareerTaskListIt it; // 10790 -// { -// class CCareerTask *pTask; // 10793 -// operator++(_List_iterator *const this); // 10804 -// } -// } + bool foundOne = false; + + for (CareerTaskListIt it = TheCareerTasks->GetTasks()->begin(); it != TheCareerTasks->GetTasks()->end(); ++it) + { + CCareerTask *pTask = (*it); + + if (!pTask->IsComplete() && pTask->GetWeaponId() == WEAPON_HEGRENADE) + { + foundOne = true; + break; + } + } + + if (foundOne) + return "hegren"; + + return NULL; } /* <15bb0c> ../cstrike/dlls/player.cpp:10816 */ -NOBODY void CBasePlayer::PrioritizeAutoBuyString(char *autobuyString, const char *priorityString) +void CBasePlayer::PrioritizeAutoBuyString(char *autobuyString, const char *priorityString) { -// { -// char newString; // 10818 -// int newStringPos; // 10819 -// char priorityToken; // 10820 -// const char *priorityChar; // 10827 -// char *autobuyPosition; // 10872 -// } + char newString[ MAX_AUTOBUY_LENGTH ]; + int newStringPos = 0; + char priorityToken[32]; + + if (!priorityString || !autobuyString) + return; + + const char *priorityChar = priorityString; + + while (*priorityChar != '\0') + { + int i = 0; + + while (*priorityChar != '\0' && *priorityChar != ' ') + { + priorityToken[ i++ ] = *priorityChar; + priorityChar++; + } + + priorityToken[i] = 0; + + while (*priorityChar == ' ') + priorityChar++; + + if (!Q_strlen(priorityToken)) + continue; + + char *autoBuyPosition = Q_strstr(autobuyString, priorityToken); + + if (autoBuyPosition != NULL) + { + while (*autoBuyPosition != '\0' && *autoBuyPosition != ' ') + { + newString[ newStringPos ] = *autoBuyPosition; + *autoBuyPosition = ' '; + + ++newStringPos; + ++autoBuyPosition; + } + + newString[ newStringPos++ ] = ' '; + } + } + + char *autobuyPosition = autobuyString; + + while (*autobuyPosition != '\0') + { + while (*autobuyPosition == ' ') + autobuyPosition++; + + while (*autobuyPosition != '\0' && *autobuyPosition != ' ') + { + newString[ newStringPos++ ] = *autobuyPosition; + autobuyPosition++; + } + + newString[ newStringPos++ ] = ' '; + } + + newString[ newStringPos ] = 0; + Q_sprintf(autobuyString, "%s", newString); } /* <15bcd5> ../cstrike/dlls/player.cpp:10899 */ -NOBODY void CBasePlayer::ParseAutoBuyString(const char *string, bool &boughtPrimary, bool &boughtSecondary) +void CBasePlayer::ParseAutoBuyString(const char *string, bool &boughtPrimary, bool &boughtSecondary) { -// { -// char command; // 10901 -// const char *c; // 10902 -// { -// int i; // 10912 -// class AutoBuyInfoStruct *commandInfo; // 10945 -// GetAutoBuyCommandInfo(CBasePlayer *const this, -// const char *command); // 10945 -// ShouldExecuteAutoBuyCommand(CBasePlayer *const this, -// const class AutoBuyInfoStruct *commandInfo, -// bool boughtPrimary, -// bool boughtSecondary); // 10947 -// ClientCommand(CBasePlayer *const this, -// const char *cmd, -// const char *arg1, -// const char *arg2, -// const char *arg3); // 10949 -// } -// } + char command[32]; + const char *c = string; + + if (!string || !string[0]) + return; + + while (*c) + { + int i = 0; + + while (*c && (*c != ' ') && i < sizeof(command)) + { + command[i] = *c; + ++c; + ++i; + } + + if (*c == ' ') + ++c; + + command[i] = 0; + i = 0; + + while (command[i] != 0) + { + if (command[i] == ' ') + { + command[i] = 0; + break; + } + + ++i; + } + + if (!Q_strlen(command)) + continue; + + AutoBuyInfoStruct *commandInfo = GetAutoBuyCommandInfo(command); + if (ShouldExecuteAutoBuyCommand(commandInfo, boughtPrimary, boughtSecondary)) + { + ClientCommand(commandInfo->m_command); + PostAutoBuyCommandProcessing(commandInfo, boughtPrimary, boughtSecondary); + } + } } /* <15bb6b> ../cstrike/dlls/player.cpp:10957 */ -NOBODY bool CBasePlayer::ShouldExecuteAutoBuyCommand(AutoBuyInfoStruct *commandInfo, bool boughtPrimary, bool boughtSecondary) +NOXREF bool CBasePlayer::ShouldExecuteAutoBuyCommand(AutoBuyInfoStruct *commandInfo, bool boughtPrimary, bool boughtSecondary) { + if (!commandInfo) + return false; + + if (boughtPrimary && (commandInfo->m_class & AUTOBUYCLASS_PRIMARY) != 0 && !(commandInfo->m_class & AUTOBUYCLASS_AMMO)) + return false; + + if (boughtSecondary && (commandInfo->m_class & AUTOBUYCLASS_SECONDARY) != 0 && !(commandInfo->m_class & AUTOBUYCLASS_AMMO)) + return false; + + return true; } /* <15bbfa> ../cstrike/dlls/player.cpp:10978 */ -AutoBuyInfoStruct *CBasePlayer::GetAutoBuyCommandInfo(const char *command) +NOXREF AutoBuyInfoStruct *CBasePlayer::GetAutoBuyCommandInfo(const char *command) { -// { -// class AutoBuyInfoStruct *ret; // 10980 -// int i; // 10982 -// class AutoBuyInfoStruct *temp; // 10983 -// } + int i = 0; + AutoBuyInfoStruct *ret = NULL; + AutoBuyInfoStruct *temp = NULL; + + while (ret == NULL) + { + temp = &(g_autoBuyInfo[ i ]); + + if (!temp->m_class) + break; + + if (Q_stricmp(temp->m_command, command) == 0) + ret = temp; + + i++; + } + + return ret; } /* <15bc49> ../cstrike/dlls/player.cpp:11000 */ -NOBODY void CBasePlayer::PostAutoBuyCommandProcessing(AutoBuyInfoStruct *commandInfo, bool &boughtPrimary, bool &boughtSecondary) +void CBasePlayer::PostAutoBuyCommandProcessing(AutoBuyInfoStruct *commandInfo, bool &boughtPrimary, bool &boughtSecondary) { -// { -// class CBasePlayerWeapon *primary; // 11002 -// class CBasePlayerWeapon *secondary; // 11003 -// } + CBasePlayerWeapon *primary = (CBasePlayerWeapon *)m_rgpPlayerItems[ PRIMARY_WEAPON_SLOT ]; + CBasePlayerWeapon *secondary = (CBasePlayerWeapon *)m_rgpPlayerItems[ PISTOL_SLOT ]; + + if (!commandInfo) + return; + + if (primary != NULL && !Q_stricmp(STRING(primary->pev->classname), commandInfo->m_classname)) + boughtPrimary = true; + + else if (commandInfo->m_class & AUTOBUYCLASS_SHIELD && HasShield()) + boughtPrimary = true; + + else if (secondary != NULL && !Q_stricmp(STRING(secondary->pev->classname), commandInfo->m_classname)) + boughtSecondary = true; } /* <15c0b4> ../cstrike/dlls/player.cpp:11027 */ -NOBODY void CBasePlayer::BuildRebuyStruct(void) +void CBasePlayer::BuildRebuyStruct(void) { -// { -// class CBasePlayerWeapon *primary; // 11035 -// class CBasePlayerWeapon *secondary; // 11036 -// int iAmmoIndex; // 11072 -// GetAmmoIndex(const char *psz); // 11075 -// GetAmmoIndex(const char *psz); // 11087 -// GetAmmoIndex(const char *psz); // 11099 -// } + int iAmmoIndex; + + if (m_bIsInRebuy) + return; + + CBasePlayerWeapon *primary = (CBasePlayerWeapon *)m_rgpPlayerItems[ PRIMARY_WEAPON_SLOT ]; + CBasePlayerWeapon *secondary = (CBasePlayerWeapon *)m_rgpPlayerItems[ PISTOL_SLOT ]; + + if (primary != NULL) + { + m_rebuyStruct.m_primaryWeapon = primary->m_iId; + m_rebuyStruct.m_primaryAmmo = m_rgAmmo[ primary->m_iPrimaryAmmoType ]; + } + else + { + m_rebuyStruct.m_primaryAmmo = 0; + + if (HasShield()) + m_rebuyStruct.m_primaryWeapon = WEAPON_SHIELDGUN; + else + m_rebuyStruct.m_primaryWeapon = 0; + } + + if (secondary != NULL) + { + m_rebuyStruct.m_secondaryWeapon = secondary->m_iId; + m_rebuyStruct.m_secondaryAmmo = m_rgAmmo[ secondary->m_iPrimaryAmmoType ]; + } + else + { + m_rebuyStruct.m_secondaryWeapon = 0; + m_rebuyStruct.m_secondaryAmmo = 0; + } + + iAmmoIndex = GetAmmoIndex("HEGrenade"); + + if (iAmmoIndex != -1) + m_rebuyStruct.m_heGrenade = m_rgAmmo[ iAmmoIndex ]; + else + m_rebuyStruct.m_heGrenade = 0; + + iAmmoIndex = GetAmmoIndex("Flashbang"); + + if (iAmmoIndex != -1) + m_rebuyStruct.m_flashbang = m_rgAmmo[ iAmmoIndex ]; + else + m_rebuyStruct.m_flashbang = 0; + + iAmmoIndex = GetAmmoIndex("SmokeGrenade"); + + if (iAmmoIndex != -1) + m_rebuyStruct.m_smokeGrenade = m_rgAmmo[ iAmmoIndex ]; + else + m_rebuyStruct.m_smokeGrenade = 0; + + m_rebuyStruct.m_defuser = m_bHasDefuser; + m_rebuyStruct.m_nightVision = m_bHasNightVision; + m_rebuyStruct.m_armor = m_iKevlar; } /* <15c37d> ../cstrike/dlls/player.cpp:11134 */ -NOBODY void CBasePlayer::Rebuy(void) +void CBasePlayer::Rebuy(void) { -// { -// char *fileData; // 11138 -// char *token; // 11140 -// RebuyArmor(CBasePlayer *const this); // 11182 -// RebuyPrimaryWeapon(CBasePlayer *const this); // 11146 -// RebuyPrimaryAmmo(CBasePlayer *const this); // 11150 -// RebuySecondaryWeapon(CBasePlayer *const this); // 11154 -// RebuySecondaryAmmo(CBasePlayer *const this); // 11158 -// RebuyHEGrenade(CBasePlayer *const this); // 11162 -// RebuyFlashbang(CBasePlayer *const this); // 11166 -// RebuySmokeGrenade(CBasePlayer *const this); // 11170 -// RebuyDefuser(CBasePlayer *const this); // 11174 -// RebuyNightVision(CBasePlayer *const this); // 11178 -// } + char *fileData = m_rebuyString; + char *token; + + m_bIsInRebuy = true; + + while (true) + { + fileData = MP_COM_Parse(fileData); + token = MP_COM_GetToken(); + + if (!fileData) + break; + + if (!Q_stricmp(token, "primaryWeapon")) + RebuyPrimaryWeapon(); + else if (!Q_stricmp(token, "primaryAmmo")) + RebuyPrimaryAmmo(); + else if (!Q_stricmp(token, "secondaryWeapon")) + RebuySecondaryWeapon(); + else if (!Q_stricmp(token, "secondaryAmmo")) + RebuySecondaryAmmo(); + else if (!Q_stricmp(token, "hegrenade")) + RebuyHEGrenade(); + else if (!Q_stricmp(token, "flashbang")) + RebuyFlashbang(); + else if (!Q_stricmp(token, "smokegrenade")) + RebuySmokeGrenade(); + else if (!Q_stricmp(token, "defuser")) + RebuyDefuser(); + else if (!Q_stricmp(token, "nightvision")) + RebuyNightVision(); + else if (!Q_stricmp(token, "armor")) + RebuyArmor(); + } + + m_bIsInRebuy = false; + + if (TheTutor) + TheTutor->OnEvent(EVENT_PLAYER_LEFT_BUY_ZONE); } /* <15c96a> ../cstrike/dlls/player.cpp:11200 */ -NOBODY void CBasePlayer::RebuyPrimaryWeapon(void) +NOXREF void CBasePlayer::RebuyPrimaryWeapon(void) { -// { -// const char *alias; // 11209 -// ClientCommand(CBasePlayer *const this, -// const char *cmd, -// const char *arg1, -// const char *arg2, -// const char *arg3); // 11212 -// } + if (!m_rgpPlayerItems[ PRIMARY_WEAPON_SLOT ]) + { + if (m_rebuyStruct.m_primaryWeapon) + { + const char *alias = WeaponIDToAlias(m_rebuyStruct.m_primaryWeapon); + + if (alias != NULL) + ClientCommand(alias); + } + } } /* <15c9e4> ../cstrike/dlls/player.cpp:11217 */ -NOBODY void CBasePlayer::RebuyPrimaryAmmo(void) +NOXREF void CBasePlayer::RebuyPrimaryAmmo(void) { -// { -// class CBasePlayerWeapon *primary; // 11219 -// ClientCommand(CBasePlayer *const this, -// const char *cmd, -// const char *arg1, -// const char *arg2, -// const char *arg3); // 11229 -// } + CBasePlayerWeapon *primary = (CBasePlayerWeapon *)m_rgpPlayerItems[ PRIMARY_WEAPON_SLOT ]; + + if (primary != NULL) + { + if (m_rebuyStruct.m_primaryAmmo > m_rgAmmo[ primary->m_iPrimaryAmmoType ]) + ClientCommand("primammo"); + } } /* <15ca68> ../cstrike/dlls/player.cpp:11233 */ -NOBODY void CBasePlayer::RebuySecondaryWeapon(void) -{ -// { -// const char *alias; // 11237 -// ClientCommand(CBasePlayer *const this, -// const char *cmd, -// const char *arg1, -// const char *arg2, -// const char *arg3); // 11240 -// } +NOXREF void CBasePlayer::RebuySecondaryWeapon(void) +{ + if (m_rebuyStruct.m_secondaryWeapon) + { + const char *alias = WeaponIDToAlias(m_rebuyStruct.m_secondaryWeapon); + + if (alias != NULL) + ClientCommand(alias); + } } /* <15cae2> ../cstrike/dlls/player.cpp:11245 */ -NOBODY void CBasePlayer::RebuySecondaryAmmo(void) +NOXREF void CBasePlayer::RebuySecondaryAmmo(void) { -// { -// class CBasePlayerWeapon *secondary; // 11247 -// ClientCommand(CBasePlayer *const this, -// const char *cmd, -// const char *arg1, -// const char *arg2, -// const char *arg3); // 11255 -// } + CBasePlayerWeapon *secondary = (CBasePlayerWeapon *)m_rgpPlayerItems[ PISTOL_SLOT ]; + + if (secondary) + { + if (m_rebuyStruct.m_secondaryAmmo > m_rgAmmo[ secondary->m_iPrimaryAmmoType ]) + ClientCommand("secammo"); + } } /* <15cb66> ../cstrike/dlls/player.cpp:11259 */ -NOBODY void CBasePlayer::RebuyHEGrenade(void) +NOXREF void CBasePlayer::RebuyHEGrenade(void) { -// { -// int iAmmoIndex; // 11262 -// int numToBuy; // 11269 -// GetAmmoIndex(const char *psz); // 11262 -// { -// int i; // 11272 -// ClientCommand(CBasePlayer *const this, -// const char *cmd, -// const char *arg1, -// const char *arg2, -// const char *arg3); // 11274 -// } -// } + int iAmmoIndex = GetAmmoIndex("HEGrenade"); + + if (iAmmoIndex == -1) + return; + + int numToBuy = m_rebuyStruct.m_heGrenade - m_rgAmmo[ iAmmoIndex ]; + + for (int i = 0; i < numToBuy; i++) + ClientCommand("hegren"); } /* <15cc3f> ../cstrike/dlls/player.cpp:11279 */ -NOBODY void CBasePlayer::RebuyFlashbang(void) +NOXREF void CBasePlayer::RebuyFlashbang(void) { -// { -// int iAmmoIndex; // 11282 -// int numToBuy; // 11289 -// GetAmmoIndex(const char *psz); // 11282 -// { -// int i; // 11292 -// ClientCommand(CBasePlayer *const this, -// const char *cmd, -// const char *arg1, -// const char *arg2, -// const char *arg3); // 11294 -// } -// } + int iAmmoIndex = GetAmmoIndex("Flashbang"); + + if (iAmmoIndex == -1) + return; + + int numToBuy = m_rebuyStruct.m_flashbang - m_rgAmmo[ iAmmoIndex ]; + + for (int i = 0; i < numToBuy; i++) + ClientCommand("flash"); } /* <15cd18> ../cstrike/dlls/player.cpp:11299 */ -NOBODY void CBasePlayer::RebuySmokeGrenade(void) +NOXREF void CBasePlayer::RebuySmokeGrenade(void) { -// { -// int iAmmoIndex; // 11302 -// int numToBuy; // 11309 -// GetAmmoIndex(const char *psz); // 11302 -// { -// int i; // 11312 -// ClientCommand(CBasePlayer *const this, -// const char *cmd, -// const char *arg1, -// const char *arg2, -// const char *arg3); // 11314 -// } -// } + int iAmmoIndex = GetAmmoIndex("SmokeGrenade"); + + if (iAmmoIndex == -1) + return; + + int numToBuy = m_rebuyStruct.m_smokeGrenade - m_rgAmmo[ iAmmoIndex ]; + + for (int i = 0; i < numToBuy; i++) + ClientCommand("sgren"); } /* <15cdf1> ../cstrike/dlls/player.cpp:11319 */ -NOBODY void CBasePlayer::RebuyDefuser(void) +void CBasePlayer::RebuyDefuser(void) { -// ClientCommand(CBasePlayer::RebuyDefuser(// const char *cmd, -// const char *arg1, -// const char *arg2, -// const char *arg3); // 11327 + if (m_rebuyStruct.m_defuser) + { + if (!m_bHasDefuser) + ClientCommand("defuser"); + } } /* <15ce59> ../cstrike/dlls/player.cpp:11330 */ -NOBODY void CBasePlayer::RebuyNightVision(void) +void CBasePlayer::RebuyNightVision(void) { -// ClientCommand(CBasePlayer::RebuyNightVision(// const char *cmd, -// const char *arg1, -// const char *arg2, -// const char *arg3); // 11338 + if (m_rebuyStruct.m_nightVision) + { + if (!m_bHasNightVision) + ClientCommand("nvgs"); + } } /* <15cec1> ../cstrike/dlls/player.cpp:11341 */ -NOBODY void CBasePlayer::RebuyArmor(void) +void CBasePlayer::RebuyArmor(void) { -// ClientCommand(CBasePlayer::RebuyArmor(// const char *cmd, -// const char *arg1, -// const char *arg2, -// const char *arg3); // 11361 -// ClientCommand(CBasePlayer *const this, -// const char *cmd, -// const char *arg1, -// const char *arg2, -// const char *arg3); // 11357 + if (m_rebuyStruct.m_armor) + { + if (m_rebuyStruct.m_armor > m_iKevlar) + { + if (m_rebuyStruct.m_armor == 1) + ClientCommand("vest"); + else + ClientCommand("vesthelm"); + } + } } /* <15cf7c> ../cstrike/dlls/player.cpp:11366 */ -NOBODY bool CBasePlayer::IsObservingPlayer(CBasePlayer *pPlayer) +bool CBasePlayer::IsObservingPlayer(CBasePlayer *pPlayer) { -// edict(CBaseEntity *const this); // 11368 -// FNullEnt(const edict_t *pent); // 11368 -// entindex(CBaseEntity *const this); // 11371 + if (!pPlayer || pev->flags == FL_DORMANT) + return false; + + if (FNullEnt(pPlayer)) + return false; + + return (pev->iuser1 == OBS_IN_EYE && pev->iuser2 == pPlayer->entindex()) != 0; } /* <15d049> ../cstrike/dlls/player.cpp:11380 */ -NOBODY void CBasePlayer::UpdateLocation(bool forceUpdate) +void CBasePlayer::UpdateLocation(bool forceUpdate) { -// { -// const char *placeName; // 11390 -// { -// Place playerPlace; // 11393 -// const BotPhraseList *placeList; // 11394 -// int i; // 11395 -// { -// const_iterator iter; // 11398 -// operator++(_List_const_iterator *const this); // 11398 -// } -// } -// { -// int i; // 11416 -// { -// class CBasePlayer *player; // 11418 -// edict(CBaseEntity *const this); // 11425 -// MESSAGE_BEGIN(int msg_dest, -// int msg_type, -// const float *pOrigin, -// edict_t *ed); // 11425 -// entindex(CBaseEntity *const this); // 11426 -// edict(CBaseEntity *const this); // 11434 -// MESSAGE_BEGIN(int msg_dest, -// int msg_type, -// const float *pOrigin, -// edict_t *ed); // 11434 -// entindex(CBaseEntity *const this); // 11435 -// } -// } -// } + if (!forceUpdate && m_flLastUpdateTime >= gpGlobals->time + 2) + return; + + const char *placeName = ""; + + if (pev->deadflag == DEAD_NO && UTIL_IsGame("czero")) + { + Place playerPlace = TheNavAreaGrid.GetPlace( &pev->origin ); + const BotPhraseList *placeList = TheBotPhrases->GetPlaceList(); + + for (BotPhraseList::const_iterator iter = placeList->begin(); iter != placeList->end(); ++iter) + { + if ((*iter)->GetID() == playerPlace) + { + placeName = (*iter)->GetName(); + break; + } + } + } + + if (!placeName[0] || (m_lastLocation[0] && !Q_strcmp(placeName, &m_lastLocation[1]))) + { + return; + } + + m_flLastUpdateTime = gpGlobals->time; + Q_snprintf(m_lastLocation, sizeof(m_lastLocation), "#%s", placeName); + + for (int i = 1; i <= gpGlobals->maxClients; i++) + { + CBasePlayer *player = (CBasePlayer *)UTIL_PlayerByIndex( i ); + + if (!player) + continue; + + if (player->m_iTeam == m_iTeam || player->m_iTeam == SPECTATOR) + { + MESSAGE_BEGIN(MSG_ONE, gmsgLocation, NULL, player->edict()); + WRITE_BYTE(entindex()); + WRITE_STRING(m_lastLocation); + MESSAGE_END(); + } + else if (forceUpdate) + { + MESSAGE_BEGIN(MSG_ONE, gmsgLocation, NULL, player->edict()); + WRITE_BYTE(entindex()); + WRITE_STRING(""); + MESSAGE_END(); + } + } } #ifdef HOOK_GAMEDLL @@ -5738,36 +6338,6 @@ int CBasePlayer::GiveAmmo(int iAmount,char *szName,int iMax) return GiveAmmo_(iAmount,szName,iMax); } -void CBasePlayer::StartSneaking(void) -{ - StartSneaking_(); -} - -void CBasePlayer::StopSneaking(void) -{ - StopSneaking_(); -} - -BOOL CBasePlayer::IsSneaking(void) -{ - return IsSneaking_(); -} - -BOOL CBasePlayer::IsAlive(void) -{ - return IsAlive_(); -} - -BOOL CBasePlayer::IsPlayer(void) -{ - return IsPlayer_(); -} - -BOOL CBasePlayer::IsNetClient(void) -{ - return IsNetClient_(); -} - const char *CBasePlayer::TeamID(void) { return TeamID_(); @@ -5778,21 +6348,11 @@ BOOL CBasePlayer::FBecomeProne(void) return FBecomeProne_(); } -Vector CBasePlayer::BodyTarget(const Vector &posSrc) -{ - return BodyTarget_(posSrc); -} - int CBasePlayer::Illumination(void) { return Illumination_(); } -BOOL CBasePlayer::ShouldFadeOnDeath(void) -{ - return ShouldFadeOnDeath_(); -} - void CBasePlayer::ResetMaxSpeed(void) { ResetMaxSpeed_(); @@ -5823,11 +6383,6 @@ Vector CBasePlayer::GetGunPosition(void) return GetGunPosition_(); } -BOOL CBasePlayer::IsBot(void) -{ - return IsBot_(); -} - void CBasePlayer::UpdateClientData(void) { UpdateClientData_(); @@ -5853,11 +6408,6 @@ void CBasePlayer::Blind(float flUntilTime,float flHoldTime,float flFadeTime,int Blind_(flUntilTime,flHoldTime,flFadeTime,iAlpha); } -void CBasePlayer::OnTouchingWeapon(CWeaponBox *pWeapon) -{ - OnTouchingWeapon_(pWeapon); -} - void CStripWeapons::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { Use_(pActivator, pCaller, useType, value); diff --git a/regamedll/dlls/player.h b/regamedll/dlls/player.h index dae43e73..4676d6ee 100644 --- a/regamedll/dlls/player.h +++ b/regamedll/dlls/player.h @@ -35,7 +35,7 @@ #include "hintmessage.h" //#include "weapons.h" -#define MAX_BUFFER_MENU 175//?? +#define MAX_BUFFER_MENU 175//? #define MAX_BUFFER_MENU_BRIEFING 50 #define MAX_PLAYER_NAME_LENGTH 32 @@ -271,11 +271,103 @@ struct WeaponStruct };/* size: 20, cachelines: 1, members: 5 */ +#ifdef HOOK_GAMEDLL + +#define m_szPoses (*pm_szPoses) +#define g_weaponStruct (*pg_weaponStruct) +#define gEvilImpulse101 (*pgEvilImpulse101) +#define g_szMapBriefingText (*pg_szMapBriefingText) +#define gInitHUD (*pgInitHUD) +#define sv_aim (*psv_aim) +#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 { public: - NOBODY 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 @@ -289,8 +381,8 @@ public: class CInfoIntermission: public CPointEntity { public: - NOBODY virtual void Spawn(void); - NOBODY virtual void Think(void); + virtual void Spawn(void); + virtual void Think(void); #ifdef HOOK_GAMEDLL @@ -305,9 +397,9 @@ public: class CDeadHEV: public CBaseMonster { public: - NOBODY virtual void Spawn(void); - NOBODY virtual void KeyValue(KeyValueData *pkvd); - NOBODY virtual int Classify(void); + virtual void Spawn(void); + virtual void KeyValue(KeyValueData *pkvd); + virtual int Classify(void); #ifdef HOOK_GAMEDLL @@ -320,7 +412,7 @@ public: public: int m_iPose; - char *m_szPoses[4]; + static char *m_szPoses[4]; };/* size: 408, cachelines: 7, members: 3 */ @@ -382,59 +474,60 @@ 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.0f; - //} - virtual void StopSneaking(void); - //{ - // m_tSneaking = gpGlobals->time + 30.0f; - //} - 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); - //} - virtual BOOL IsNetClient(void); - //{ - // return TRUE; - //} + NOBODY virtual void StartSneaking(void) + { + StartSneaking_(); + } + NOBODY virtual void StopSneaking(void) + { + StopSneaking_(); + } + NOBODY virtual BOOL IsSneaking(void) + { + return IsSneaking_(); + } + NOBODY virtual BOOL IsAlive(void) + { + return IsAlive_(); + } + NOBODY virtual BOOL IsPlayer(void) + { + return IsPlayer_(); + } + NOBODY virtual BOOL IsNetClient(void) + { + return IsNetClient_(); + } NOBODY virtual const char *TeamID(void); NOBODY virtual BOOL FBecomeProne(void); - virtual Vector BodyTarget(const Vector &posSrc); - //{ - // return Center() + pev->view_ofs * RANDOM_FLOAT(0.5,1.1); - // + NOBODY virtual Vector BodyTarget(const Vector &posSrc) + { + return BodyTarget_(posSrc); + } NOBODY virtual int Illumination(void); - virtual BOOL ShouldFadeOnDeath(void); - //{ - // return FALSE; - //} + NOBODY virtual BOOL ShouldFadeOnDeath(void) + { + return ShouldFadeOnDeath_(); + } NOBODY virtual void ResetMaxSpeed(void); NOBODY virtual void Jump(void); NOBODY virtual void Duck(void); NOBODY virtual void PreThink(void); NOBODY virtual void PostThink(void); NOBODY virtual Vector GetGunPosition(void); - virtual BOOL IsBot(void); - //{ - // return FALSE; - //} + NOBODY virtual BOOL IsBot(void) + { + return IsBot_(); + } NOBODY virtual void UpdateClientData(void); NOBODY virtual void ImpulseCommands(void); virtual void RoundRespawn(void); virtual Vector GetAutoaimVector(float flDelta); NOBODY virtual void Blind(float flUntilTime, float flHoldTime, float flFadeTime, int iAlpha); - virtual void OnTouchingWeapon(CWeaponBox *pWeapon);// = 0; - //{ - //} + NOBODY virtual void OnTouchingWeapon(CWeaponBox *pWeapon) + { + OnTouchingWeapon_(pWeapon); + } #ifdef HOOK_GAMEDLL @@ -508,6 +601,7 @@ public: void Blind_(float flUntilTime, float flHoldTime, float flFadeTime, int iAlpha); void OnTouchingWeapon_(CWeaponBox *pWeapon) { + ; } #endif // HOOK_GAMEDLL @@ -615,17 +709,17 @@ public: NOBODY int GetCustomDecalFrames(void); NOBODY void InitStatusBar(void); NOBODY void UpdateStatusBar(void); - NOBODY void StudioEstimateGait(void); - NOBODY void StudioPlayerBlend(int *pBlend, float *pPitch); - NOBODY void CalculatePitchBlend(void); - NOBODY void CalculateYawBlend(void); - NOBODY void StudioProcessGait(void); + void StudioEstimateGait(void); + NOXREF void StudioPlayerBlend(int *pBlend, float *pPitch); + NOXREF void CalculatePitchBlend(void); + void CalculateYawBlend(void); + void StudioProcessGait(void); NOBODY void SendHostagePos(void); void SendHostageIcons(void); - NOBODY void ResetStamina(void); - NOBODY BOOL IsArmored(int nHitGroup); - NOBODY BOOL ShouldDoLargeFlinch(int nHitGroup, int nGunType); - NOBODY void SetPrefsFromUserinfo(char *infobuffer); + NOXREF void ResetStamina(void); + NOXREF BOOL IsArmored(int nHitGroup); + NOXREF BOOL ShouldDoLargeFlinch(int nHitGroup, int nGunType); + void SetPrefsFromUserinfo(char *infobuffer); NOBODY void SendWeatherInfo(void); void UpdateShieldCrosshair(bool); bool HasShield(void); @@ -648,39 +742,50 @@ public: NOBODY bool IsAutoFollowAllowed(void); NOBODY void InhibitAutoFollow(float); NOBODY void AllowAutoFollow(void); - NOBODY void ClearAutoBuyData(void); - NOBODY void AddAutoBuyData(const char *str); + void ClearAutoBuyData(void); + void AddAutoBuyData(const char *str); NOBODY void AutoBuy(void); - NOBODY void ClientCommand(const char *cmd, const char *arg1, const char *arg2, const char *arg3); - NOBODY void PrioritizeAutoBuyString(char *autobuyString, const char *priorityString); + NOBODY void ClientCommand(const char *cmd, const char *arg1 = NULL, const char *arg2 = NULL, const char *arg3 = NULL); + void PrioritizeAutoBuyString(char *autobuyString, const char *priorityString); NOBODY const char *PickPrimaryCareerTaskWeapon(void); NOBODY const char *PickSecondaryCareerTaskWeapon(void); - NOBODY const char *PickFlashKillWeaponString(void); - NOBODY const char *PickGrenadeKillWeaponString(void); - NOBODY bool ShouldExecuteAutoBuyCommand(AutoBuyInfoStruct *commandInfo, bool boughtPrimary, bool boughtSecondary); - NOBODY void PostAutoBuyCommandProcessing(AutoBuyInfoStruct *commandInfo, bool &boughtPrimary, bool &boughtSecondary); - NOBODY void ParseAutoBuyString(const char *string, bool &boughtPrimary, bool &boughtSecondary); - NOBODY AutoBuyInfoStruct *GetAutoBuyCommandInfo(const char *command); + NOXREF const char *PickFlashKillWeaponString(void); + NOXREF const char *PickGrenadeKillWeaponString(void); + NOXREF 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); + NOXREF AutoBuyInfoStruct *GetAutoBuyCommandInfo(const char *command); NOBODY void InitRebuyData(const char *str); - NOBODY void BuildRebuyStruct(void); - NOBODY void Rebuy(void); - NOBODY void RebuyPrimaryWeapon(void); - NOBODY void RebuyPrimaryAmmo(void); - NOBODY void RebuySecondaryWeapon(void); - NOBODY void RebuySecondaryAmmo(void); - NOBODY void RebuyHEGrenade(void); - NOBODY void RebuyFlashbang(void); - NOBODY void RebuySmokeGrenade(void); - NOBODY void RebuyDefuser(void); - NOBODY void RebuyNightVision(void); - NOBODY void RebuyArmor(void); - NOBODY void UpdateLocation(bool); - NOBODY void SetObserverAutoDirector(bool); - NOBODY bool IsObservingPlayer(CBasePlayer *pPlayer); - NOBODY bool CanSwitchObserverModes(void); - NOBODY void Intense(void); + void BuildRebuyStruct(void); + void Rebuy(void); + NOXREF void RebuyPrimaryWeapon(void); + NOXREF void RebuyPrimaryAmmo(void); + NOXREF void RebuySecondaryWeapon(void); + NOXREF void RebuySecondaryAmmo(void); + NOXREF void RebuyHEGrenade(void); + NOXREF void RebuyFlashbang(void); + NOXREF void RebuySmokeGrenade(void); + void RebuyDefuser(void); + void RebuyNightVision(void); + void RebuyArmor(void); + void UpdateLocation(bool forceUpdate); + void SetObserverAutoDirector(bool val) + { + m_bObserverAutoDirector = val; + } + bool IsObservingPlayer(CBasePlayer *pPlayer); + bool CanSwitchObserverModes(void) + { + return m_canSwitchObserverModes; + } + NOBODY void Intense(void) + { + //m_musicState = INTENSE; + //m_intenseTimestamp = gpGlobals->time; + } + public: - int random_seed;//Lin - 404 | 384 | Currnet (396:) + int random_seed; unsigned short m_usPlayerBleed; EHANDLE m_hObserverTarget; float m_flNextObserverInput; @@ -717,7 +822,6 @@ public: bool m_bHasNightVision; bool m_bNightVisionOn; Vector m_vRecentPath[ MAX_RECENT_PATH ]; - float m_flIdleCheckTime; float m_flRadioTime; int m_iRadioMessages; @@ -832,20 +936,15 @@ public: float m_flNextDecalTime; char m_szTeamName[ TEAM_NAME_LENGTH ]; -#ifndef HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_playerSaveData)[40]; - static TYPEDESCRIPTION m_playerSaveData[40]; -#else - static TYPEDESCRIPTION (*m_playerSaveData)[40]; - -#endif // HOOK_GAMEDLL - -//TOOD: check out +//TOOD: check out! //protected: - int m_modelIndexPlayer; + int m_modelIndexPlayer;//++1964 char m_szAnimExtention[32]; int m_iGaitsequence; + float m_flGaitframe; float m_flGaityaw; Vector m_prevgaitorigin; @@ -903,97 +1002,7 @@ public: float m_flTimeToIgnoreTouches; };/* size: 164, cachelines: 3, members: 3 */ -#ifdef HOOK_GAMEDLL - -#define g_weaponStruct (*pg_weaponStruct) -#define gEvilImpulse101 (*pgEvilImpulse101) -#define g_szMapBriefingText (*pg_szMapBriefingText) -#define gInitHUD (*pgInitHUD) -#define sv_aim (*psv_aim) -#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 - +extern char *m_szPoses[4]; extern WeaponStruct g_weaponStruct[MAX_WEAPONS]; extern int gEvilImpulse101; @@ -1024,7 +1033,7 @@ extern int gmsgWeaponList; //extern int gmsgDeathMsg; extern int gmsgScoreAttrib; extern int gmsgScoreInfo; -//extern int gmsgTeamInfo; +extern int gmsgTeamInfo; //extern int gmsgTeamScore; //extern int gmsgGameMode; //extern int gmsgMOTD; @@ -1075,7 +1084,7 @@ extern int gmsgScenarioIcon; extern int gmsgBotVoice; extern int gmsgBuyClose; extern int gmsgItemStatus; -//extern int gmsgLocation; +extern int gmsgLocation; extern int gmsgSpecHealth2; extern int gmsgBarTime2; extern int gmsgBotProgress; @@ -1101,10 +1110,6 @@ NOXREF void EscapeZoneIcon_Set(CBasePlayer *player); NOXREF void EscapeZoneIcon_Clear(CBasePlayer *player); NOXREF void VIP_SafetyZoneIcon_Set(CBasePlayer *player); - - - - NOBODY void LinkUserMessages(void); void WriteSigonMessages(void); void SendItemStatus(CBasePlayer *pPlayer); @@ -1122,16 +1127,16 @@ NOBODY CBaseEntity *FindZombieSpawn(CBaseEntity *player, bool forceSpawn); NOBODY edict_t *EntSelectSpawnPoint(CBaseEntity *pPlayer); void SetScoreAttrib(CBasePlayer *dest, CBasePlayer *src); NOBODY CBaseEntity *FindEntityForward(CBaseEntity *pMe); -NOBODY float GetPlayerPitch(const edict_t *pEdict); -NOBODY int GetPlayerGaitsequence(edict_t *pEdict); -NOBODY float GetPlayerYaw(const edict_t *pEdict); -NOBODY const char *GetBuyStringForWeaponClass(int weaponClass); -NOBODY bool IsPrimaryWeaponClass(int classId); -NOBODY bool IsPrimaryWeaponId(int id); -NOBODY bool IsSecondaryWeaponClass(int classId); -NOBODY bool IsSecondaryWeaponId(int id); -NOBODY const char *GetWeaponAliasFromName(const char *weaponName); -NOBODY bool CurrentWeaponSatisfies(CBasePlayerWeapon *pWeapon, int id, int classId); +float GetPlayerPitch(const edict_t *pEdict); +float GetPlayerYaw(const edict_t *pEdict); +int GetPlayerGaitsequence(edict_t *pEdict); +NOXREF const char *GetBuyStringForWeaponClass(int weaponClass); +NOXREF bool IsPrimaryWeaponClass(int classId); +NOXREF bool IsPrimaryWeaponId(int id); +NOXREF bool IsSecondaryWeaponClass(int classId); +NOXREF bool IsSecondaryWeaponId(int id); +NOXREF const char *GetWeaponAliasFromName(const char *weaponName); +NOXREF bool CurrentWeaponSatisfies(CBasePlayerWeapon *pWeapon, int id, int classId); // refs extern void (*CBasePlayer__UpdateClientData)(void); diff --git a/regamedll/dlls/revert_saved.h b/regamedll/dlls/revert_saved.h index a4f0c069..7685fd5a 100644 --- a/regamedll/dlls/revert_saved.h +++ b/regamedll/dlls/revert_saved.h @@ -36,10 +36,10 @@ class CRevertSaved: public CPointEntity { public: - NOBODY void KeyValue(KeyValueData *pkvd); - NOBODY int Save(CSave &save); - NOBODY int Restore(CRestore &restore); - NOBODY void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); + void KeyValue(KeyValueData *pkvd); + int Save(CSave &save); + int Restore(CRestore &restore); + void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); #ifdef HOOK_GAMEDLL @@ -51,8 +51,8 @@ public: #endif // HOOK_GAMEDLL public: - NOBODY void EXPORT MessageThink(void); - NOBODY void EXPORT LoadThink(void); + void EXPORT MessageThink(void); + void EXPORT LoadThink(void); public: inline float Duration(void) @@ -89,12 +89,7 @@ public: } public: - -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[2]; -#else // HOOK_GAMEDLL - static TYPEDESCRIPTION (*m_SaveData)[2]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[2]; public: float m_messageTime; diff --git a/regamedll/dlls/saverestore.h b/regamedll/dlls/saverestore.h index fdb2e202..144f0fa1 100644 --- a/regamedll/dlls/saverestore.h +++ b/regamedll/dlls/saverestore.h @@ -36,6 +36,12 @@ #ifndef HOOK_GAMEDLL +#define IMPLEMENT_ARRAY(var)\ + var + +#define IMPLEMENT_ARRAY_CLASS(baseClass,var)\ + baseClass::var + #define IMPLEMENT_SAVERESTORE(derivedClass,baseClass)\ int derivedClass::Save(CSave &save)\ {\ @@ -52,18 +58,24 @@ #else // HOOK_GAMEDLL +#define IMPLEMENT_ARRAY(var)\ + (*p##var) + +#define IMPLEMENT_ARRAY_CLASS(baseClass,var)\ + (*baseClass::p##var) + #define IMPLEMENT_SAVERESTORE(derivedClass, baseClass)\ int derivedClass::Save_(CSave &save)\ {\ if(!baseClass::Save(save))\ return 0;\ - return save.WriteFields(#derivedClass, this, (*m_SaveData), ARRAYSIZE(*m_SaveData));\ + return save.WriteFields(#derivedClass, this, (*pm_SaveData), ARRAYSIZE(*pm_SaveData));\ }\ int derivedClass::Restore_(CRestore &restore)\ {\ if(!baseClass::Restore(restore))\ return 0;\ - return restore.ReadFields(#derivedClass, this, (*m_SaveData), ARRAYSIZE(*m_SaveData));\ + return restore.ReadFields(#derivedClass, this, (*pm_SaveData), ARRAYSIZE(*pm_SaveData));\ } #endif // HOOK_GAMEDLL @@ -111,7 +123,9 @@ public: 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); @@ -197,15 +211,13 @@ private: private: int m_global; BOOL m_precache; + };/* size: 12, cachelines: 1, members: 3 */ /* <245f6> ../cstrike/dlls/saverestore.h:153 */ class CGlobalState { public: - //TODO: it unused! - static TYPEDESCRIPTION m_SaveData[0]; - NOBODY CGlobalState(); NOBODY void Reset(void); NOBODY void ClearStates(void); @@ -214,7 +226,7 @@ public: NOBODY void EntityUpdate(string_t globalname, string_t mapname); NOBODY const globalentity_t *EntityFromTable(string_t globalname); NOBODY GLOBALESTATE EntityGetState(string_t globalname); - INLINEBODY int EntityInTable(string_t globalname) + int EntityInTable(string_t globalname) { if(Find(globalname) != NULL) return 1; @@ -224,22 +236,19 @@ public: NOBODY int Restore(CRestore &restore); NOBODY void DumpGlobals(void); + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1]; + #ifdef HOOK_GAMEDLL public: #else private: #endif // HOOK_GAMEDLL globalentity_t *Find(string_t globalname); + private: globalentity_t *m_pList; int m_listCount; };/* size: 8, cachelines: 1, members: 3 */ -#ifdef HOOK_GAMEDLL -#define gGlobalState (*pgGlobalState) -#endif // HOOK_GAMEDLL - -extern CGlobalState gGlobalState; - #endif // SAVERESTORE_H diff --git a/regamedll/dlls/sound.cpp b/regamedll/dlls/sound.cpp index 0b68ff58..541292fc 100644 --- a/regamedll/dlls/sound.cpp +++ b/regamedll/dlls/sound.cpp @@ -62,9 +62,9 @@ TYPEDESCRIPTION CSpeaker::m_SaveData[] = int fSentencesInit; int gcallsentences; -TYPEDESCRIPTION (*CAmbientGeneric::m_SaveData)[4]; -TYPEDESCRIPTION (*CEnvSound::m_SaveData)[2]; -TYPEDESCRIPTION (*CSpeaker::m_SaveData)[1]; +TYPEDESCRIPTION (*CAmbientGeneric::pm_SaveData)[4]; +TYPEDESCRIPTION (*CEnvSound::pm_SaveData)[2]; +TYPEDESCRIPTION (*CSpeaker::pm_SaveData)[1]; #endif // HOOK_GAMEDLL @@ -371,10 +371,10 @@ int USENTENCEG_Pick(int isentenceg, char *szfound) USENTENCEG_InitLRU(plru, count); else { - strcpy(szfound, "!"); - strcat(szfound, szgroupname); - sprintf(sznum, "%d", ipick); - strcat(szfound, sznum); + Q_strcpy(szfound, "!"); + Q_strcat(szfound, szgroupname); + Q_sprintf(sznum, "%d", ipick); + Q_strcat(szfound, sznum); return ipick; } } diff --git a/regamedll/dlls/subs.cpp b/regamedll/dlls/subs.cpp index 90c422b9..33363cf9 100644 --- a/regamedll/dlls/subs.cpp +++ b/regamedll/dlls/subs.cpp @@ -36,8 +36,8 @@ TYPEDESCRIPTION CBaseToggle::m_SaveData[] = #else // HOOK_GAMEDLL -TYPEDESCRIPTION (*CBaseDelay::m_SaveData)[2]; -TYPEDESCRIPTION (*CBaseToggle::m_SaveData)[19]; +TYPEDESCRIPTION (*CBaseDelay::pm_SaveData)[2]; +TYPEDESCRIPTION (*CBaseToggle::pm_SaveData)[19]; #endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/subs.h b/regamedll/dlls/subs.h index 1d7dddbe..d0a06d71 100644 --- a/regamedll/dlls/subs.h +++ b/regamedll/dlls/subs.h @@ -62,15 +62,6 @@ public: };/* size: 152, cachelines: 3, members: 1 */ -//NOBODY extern "C" _DLLEXPORT void info_null(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void info_player_deathmatch(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void info_player_start(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void info_vip_start(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void info_landmark(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void info_hostage_rescue(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void info_bomb_target(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void DelayedUse(entvars_t *pev); - void FireTargets(const char *targetName, CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); void SetMovedir(entvars_t *pev); NOBODY BOOL FEntIsVisible(entvars_t *pev, entvars_t *pevTarget); diff --git a/regamedll/dlls/training_gamerules.cpp b/regamedll/dlls/training_gamerules.cpp index c7572c3f..a0a8e433 100644 --- a/regamedll/dlls/training_gamerules.cpp +++ b/regamedll/dlls/training_gamerules.cpp @@ -26,8 +26,8 @@ TYPEDESCRIPTION CBaseGrenCatch::m_SaveData[] = #else -TYPEDESCRIPTION (*CFuncWeaponCheck::m_SaveData)[6]; -TYPEDESCRIPTION (*CBaseGrenCatch::m_SaveData)[5]; +TYPEDESCRIPTION (*CFuncWeaponCheck::pm_SaveData)[6]; +TYPEDESCRIPTION (*CBaseGrenCatch::pm_SaveData)[5]; #endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/training_gamerules.h b/regamedll/dlls/training_gamerules.h index 673ae9c0..168899b4 100644 --- a/regamedll/dlls/training_gamerules.h +++ b/regamedll/dlls/training_gamerules.h @@ -111,14 +111,8 @@ public: #endif // HOOK_GAMEDLL public: + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[5]; -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[5]; -#else - static TYPEDESCRIPTION (*m_SaveData)[5]; -#endif // HOOK_GAMEDLL - -public: int m_NeedGrenadeType; string_t sTriggerOnGrenade; string_t sDisableOnGrenade; @@ -148,12 +142,7 @@ public: #endif // HOOK_GAMEDLL public: - -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[6]; -#else - static TYPEDESCRIPTION (*m_SaveData)[6]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[6]; private: string_t sTriggerWithItems; @@ -162,6 +151,7 @@ private: unsigned int sItemName[32]; int iItemCount; int iAnyWeapon; + };/* size: 300, cachelines: 5, members: 8 */ -#endif //T RAINING_GAMERULES_H +#endif // TRAINING_GAMERULES_H diff --git a/regamedll/dlls/trains.h b/regamedll/dlls/trains.h index fc62686d..c5f44f9b 100644 --- a/regamedll/dlls/trains.h +++ b/regamedll/dlls/trains.h @@ -86,12 +86,9 @@ public: NOBODY CPathTrack *GetNext(void); NOBODY CPathTrack *GetPrevious(void); - -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[5]; -#else // HOOK_GAMEDLL - static TYPEDESCRIPTION (*m_SaveData)[5]; -#endif // HOOK_GAMEDLL + +public: + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[5]; float m_length; string_t m_altName; @@ -157,11 +154,8 @@ public: NOBODY static CFuncTrackTrain *Instance(edict_t *pent); -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[12]; -#else // HOOK_GAMEDLL - static TYPEDESCRIPTION (*m_SaveData)[12]; -#endif // HOOK_GAMEDLL +public: + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[12]; CPathTrack *m_ppath; float m_length; @@ -248,13 +242,9 @@ public: public: NOBODY static CFuncVehicle *Instance(edict_t *pent); -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[12]; -#else // HOOK_GAMEDLL - static TYPEDESCRIPTION (*m_SaveData)[12]; -#endif // HOOK_GAMEDLL - public: + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[12]; + CPathTrack *m_ppath; float m_length; float m_width; diff --git a/regamedll/dlls/triggers.cpp b/regamedll/dlls/triggers.cpp index dfa087ff..5d781262 100644 --- a/regamedll/dlls/triggers.cpp +++ b/regamedll/dlls/triggers.cpp @@ -61,13 +61,13 @@ TYPEDESCRIPTION CTriggerCamera::m_SaveData[] = #else -TYPEDESCRIPTION (*CFrictionModifier::m_SaveData)[1]; -TYPEDESCRIPTION (*CAutoTrigger::m_SaveData)[2]; -TYPEDESCRIPTION (*CTriggerRelay::m_SaveData)[1]; -TYPEDESCRIPTION (*CMultiManager::m_SaveData)[5]; -TYPEDESCRIPTION (*CChangeLevel::m_SaveData)[4]; -TYPEDESCRIPTION (*CTriggerChangeTarget::m_SaveData)[1]; -TYPEDESCRIPTION (*CTriggerCamera::m_SaveData)[13]; +TYPEDESCRIPTION (*CFrictionModifier::pm_SaveData)[1]; +TYPEDESCRIPTION (*CAutoTrigger::pm_SaveData)[2]; +TYPEDESCRIPTION (*CTriggerRelay::pm_SaveData)[1]; +TYPEDESCRIPTION (*CMultiManager::pm_SaveData)[5]; +TYPEDESCRIPTION (*CChangeLevel::pm_SaveData)[4]; +TYPEDESCRIPTION (*CTriggerChangeTarget::pm_SaveData)[1]; +TYPEDESCRIPTION (*CTriggerCamera::pm_SaveData)[13]; #endif // HOOK_GAMEDLL diff --git a/regamedll/dlls/triggers.h b/regamedll/dlls/triggers.h index cfa50bfb..74b33199 100644 --- a/regamedll/dlls/triggers.h +++ b/regamedll/dlls/triggers.h @@ -86,19 +86,13 @@ public: #endif // HOOK_GAMEDLL public: - void EXPORT ChangeFriction(CBaseEntity *pOther); + NOBODY void EXPORT ChangeFriction(CBaseEntity *pOther); public: - -#ifndef HOOK_GAMEDLL - - static TYPEDESCRIPTION m_SaveData[1]; -#else - static TYPEDESCRIPTION (*m_SaveData)[1]; - -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1]; float m_frictionFraction; + };/* size: 156, cachelines: 3, members: 3 */ /* <19e39c> ../cstrike/dlls/triggers.cpp:108 */ @@ -132,17 +126,11 @@ public: #endif // HOOK_GAMEDLL public: + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[2]; -#ifndef HOOK_GAMEDLL - - static TYPEDESCRIPTION m_SaveData[2]; -#else - static TYPEDESCRIPTION (*m_SaveData)[2]; - -#endif // HOOK_GAMEDLL + int m_globalstate; // 160 + USE_TYPE triggerType; // 164 - int m_globalstate;//160 - USE_TYPE triggerType;//164 };/* size: 168, cachelines: 3, members: 4 */ /* <19e3ed> ../cstrike/dlls/triggers.cpp:191 */ @@ -174,13 +162,8 @@ public: #endif // HOOK_GAMEDLL -#ifndef HOOK_GAMEDLL - - static TYPEDESCRIPTION m_SaveData[1]; -#else - static TYPEDESCRIPTION (*m_SaveData)[1]; - -#endif // HOOK_GAMEDLL +public: + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1]; USE_TYPE triggerType; @@ -219,6 +202,7 @@ public: NOBODY void EXPORT ManagerThink(void); NOBODY void EXPORT ManagerUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); + private: /* <19dfe1> ../cstrike/dlls/triggers.cpp:293 */ inline BOOL IsClone(void) @@ -236,14 +220,10 @@ private: return TRUE; return FALSE; } - CMultiManager *Clone(void); -public: + NOBODY CMultiManager *Clone(void); -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[5]; -#else - static TYPEDESCRIPTION (*m_SaveData)[5]; -#endif // HOOK_GAMEDLL +public: + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[5]; int m_cTargets;//312 int m_index; @@ -268,7 +248,6 @@ public: #endif // HOOK_GAMEDLL - };/* size: 152, cachelines: 3, members: 1 */ /* <19e55f> ../cstrike/dlls/triggers.cpp:566 */ @@ -379,6 +358,7 @@ public: public: NOBODY void Play(void); + };/* size: 152, cachelines: 3, members: 1 */ /* <19e725> ../cstrike/dlls/triggers.cpp:1080 */ @@ -388,7 +368,9 @@ public: NOBODY virtual void Spawn(void); #ifdef HOOK_GAMEDLL + void Spawn_(void); + #endif // HOOK_GAMEDLL };/* size: 312, cachelines: 5, members: 1 */ @@ -400,7 +382,9 @@ public: NOBODY virtual void Spawn(void); #ifdef HOOK_GAMEDLL + void Spawn_(void); + #endif // HOOK_GAMEDLL };/* size: 312, cachelines: 5, members: 1 */ @@ -412,7 +396,9 @@ public: NOBODY virtual void Spawn(void); #ifdef HOOK_GAMEDLL + void Spawn_(void); + #endif // HOOK_GAMEDLL };/* size: 312, cachelines: 5, members: 1 */ @@ -424,7 +410,9 @@ public: NOBODY virtual void Spawn(void); #ifdef HOOK_GAMEDLL + void Spawn_(void); + #endif // HOOK_GAMEDLL };/* size: 152, cachelines: 3, members: 1 */ @@ -485,15 +473,9 @@ public: NOBODY static int ChangeList(LEVELLIST *pLevelList, int maxList); NOBODY static int AddTransitionToList(LEVELLIST *pLevelList, int listCount, const char *pMapName, const char *pLandmarkName, edict_t *pentLandmark); NOBODY static int InTransitionVolume(CBaseEntity *pEntity, char *pVolumeName); -public: -#ifndef HOOK_GAMEDLL - - static TYPEDESCRIPTION m_SaveData[4]; -#else - static TYPEDESCRIPTION (*m_SaveData)[4]; - -#endif // HOOK_GAMEDLL +public: + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[4]; char m_szMapName[ cchMapNameMost ]; char m_szLandmarkName[ cchMapNameMost ]; @@ -545,7 +527,9 @@ public: NOBODY virtual void Spawn(void); #ifdef HOOK_GAMEDLL + void Spawn_(void); + #endif // HOOK_GAMEDLL };/* size: 312, cachelines: 5, members: 1 */ @@ -557,10 +541,13 @@ public: NOBODY virtual void Spawn(void); #ifdef HOOK_GAMEDLL + void Spawn_(void); + #endif // HOOK_GAMEDLL NOBODY void EXPORT BuyTouch(CBaseEntity *pOther); + };/* size: 312, cachelines: 5, members: 1 */ /* <19eb2e> ../cstrike/dlls/triggers.cpp:2007 */ @@ -570,12 +557,15 @@ public: NOBODY virtual void Spawn(void); #ifdef HOOK_GAMEDLL + void Spawn_(void); + #endif // HOOK_GAMEDLL public: - void EXPORT BombTargetTouch(CBaseEntity *pOther); - void EXPORT BombTargetUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); + NOBODY void EXPORT BombTargetTouch(CBaseEntity *pOther); + NOBODY void EXPORT BombTargetUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); + };/* size: 312, cachelines: 5, members: 1 */ /* <19eb81> ../cstrike/dlls/triggers.cpp:2056 */ @@ -585,11 +575,14 @@ public: NOBODY virtual void Spawn(void); #ifdef HOOK_GAMEDLL + void Spawn_(void); + #endif // HOOK_GAMEDLL public: NOBODY void EXPORT HostageRescueTouch(CBaseEntity *pOther); + };/* size: 312, cachelines: 5, members: 1 */ /* <19ebd9> ../cstrike/dlls/triggers.cpp:2098 */ @@ -599,10 +592,13 @@ public: NOBODY virtual void Spawn(void); #ifdef HOOK_GAMEDLL + void Spawn_(void); + #endif // HOOK_GAMEDLL NOBODY void EXPORT EscapeTouch(CBaseEntity *pOther); + };/* size: 312, cachelines: 5, members: 1 */ /* <19ec2c> ../cstrike/dlls/triggers.cpp:2155 */ @@ -612,10 +608,13 @@ public: NOBODY virtual void Spawn(void); #ifdef HOOK_GAMEDLL + void Spawn_(void); + #endif // HOOK_GAMEDLL NOBODY void EXPORT VIP_SafetyTouch(CBaseEntity *pOther); + };/* size: 312, cachelines: 5, members: 1 */ /* <19ec7f> ../cstrike/dlls/triggers.cpp:2198 */ @@ -625,10 +624,13 @@ public: NOBODY virtual void Spawn(void); #ifdef HOOK_GAMEDLL + void Spawn_(void); + #endif // HOOK_GAMEDLL NOBODY void EXPORT SaveTouch(CBaseEntity *pOther); + };/* size: 312, cachelines: 5, members: 1 */ /* <19ecd2> ../cstrike/dlls/triggers.cpp:2234 */ @@ -639,8 +641,10 @@ public: NOBODY virtual void KeyValue(KeyValueData *pkvd); #ifdef HOOK_GAMEDLL + void Spawn_(void); void KeyValue_(KeyValueData *pkvd); + #endif // HOOK_GAMEDLL public: @@ -656,10 +660,13 @@ public: NOBODY virtual void Spawn(void); #ifdef HOOK_GAMEDLL + void Spawn_(void); + #endif // HOOK_GAMEDLL NOBODY void EXPORT GravityTouch(CBaseEntity *pOther); + };/* size: 312, cachelines: 5, members: 1 */ /* <19ed7d> ../cstrike/dlls/triggers.cpp:2335 */ @@ -691,15 +698,11 @@ public: #endif // HOOK_GAMEDLL public: -#ifndef HOOK_GAMEDLL - - static TYPEDESCRIPTION m_SaveData[1]; -#else - static TYPEDESCRIPTION (*m_SaveData)[1]; - -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1]; + private: int m_iszNewTarget; + };/* size: 164, cachelines: 3, members: 3 */ /* <19edd0> ../cstrike/dlls/triggers.cpp:2391 */ @@ -735,13 +738,7 @@ public: NOBODY void Move(void); public: -#ifndef HOOK_GAMEDLL - - static TYPEDESCRIPTION m_SaveData[13]; -#else - static TYPEDESCRIPTION (*m_SaveData)[13]; - -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[13]; EHANDLE m_hPlayer; EHANDLE m_hTarget; @@ -777,7 +774,6 @@ public: };/* size: 312, cachelines: 5, members: 1 */ - /* <1a5b85> ../cstrike/dlls/triggers.cpp:2710 */ class CClientFog: public CBaseEntity { @@ -799,42 +795,6 @@ public: };/* size: 164, cachelines: 3, members: 4 */ -//NOBODY extern "C" _DLLEXPORT void func_friction(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void trigger_auto(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void trigger_relay(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void multi_manager(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void env_render(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void trigger(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void trigger_hurt(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void trigger_monsterjump(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void trigger_cdaudio(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void target_cdaudio(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void trigger_multiple(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void trigger_once(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void trigger_counter(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void trigger_transition(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void fireanddie(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void trigger_changelevel(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void func_ladder(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void trigger_push(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void trigger_teleport(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void info_teleport_destination(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void func_buyzone(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void func_bomb_target(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void func_hostage_rescue(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void func_escapezone(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void func_vip_safetyzone(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void trigger_autosave(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void trigger_endsection(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void trigger_gravity(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void trigger_changetarget(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void trigger_camera(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void env_snow(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void func_snow(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void env_rain(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void func_rain(entvars_t *pev); -//NOBODY extern "C" _DLLEXPORT void env_fog(entvars_t *pev); - NOBODY void PlayCDTrack(int iTrack); NOBODY int BuildChangeList(LEVELLIST * pLevelList, int maxList); NOBODY void NextLevel(void); diff --git a/regamedll/dlls/util.cpp b/regamedll/dlls/util.cpp index bbd6329d..857b6f5e 100644 --- a/regamedll/dlls/util.cpp +++ b/regamedll/dlls/util.cpp @@ -745,10 +745,10 @@ void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, cons WRITE_STRING(" "); //TODO: oh yeah else { - if (strlen(pMessage) >= 512) + if (Q_strlen(pMessage) >= 512) { char tmp[512]; - strncpy(tmp, pMessage, 511); + Q_strncpy(tmp, pMessage, 511); tmp[511] = 0; WRITE_STRING(tmp); } @@ -1779,7 +1779,7 @@ NOXREF void CSave::WriteTime(const char *pname, const float *data, int count) /* <1b1053> ../cstrike/dlls/util.cpp:2065 */ NOXREF void CSave::WriteString(const char *pname, const char *pdata) { - BufferField(pname, strlen(pdata) + 1, pdata); + BufferField(pname, Q_strlen(pdata) + 1, pdata); } /* <1b121f> ../cstrike/dlls/util.cpp:2076 */ @@ -1789,13 +1789,13 @@ NOXREF void CSave::WriteString(const char *pname, const int *stringId, int count int size = 0; for (i = 0; i < count; i++) - size += strlen(STRING(stringId[i])) + 1; + size += Q_strlen(STRING(stringId[i])) + 1; BufferHeader(pname, size); for (i = 0; i < count; i++) { const char *pString = STRING(stringId[i]); - BufferData(pString, strlen(pString) + 1); + BufferData(pString, Q_strlen(pString) + 1); } } @@ -1845,7 +1845,7 @@ NOXREF void CSave::WriteFunction(const char *pname, void **data, int count) const char *functionName = NAME_FOR_FUNCTION((uint32)*data); if (functionName) - BufferField(pname, strlen(functionName) + 1, functionName); + BufferField(pname, Q_strlen(functionName) + 1, functionName); else ALERT(at_error, "Invalid function pointer in entity!"); } @@ -2109,7 +2109,7 @@ int CRestore::ReadField(void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCoun } pInputData = pString; - if (!strlen((char *)pInputData)) + if (!Q_strlen((char *)pInputData)) *((int *)pOutputData) = 0; else { @@ -2211,7 +2211,7 @@ int CRestore::ReadField(void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCoun break; case FIELD_FUNCTION: { - if (!strlen((char *)pInputData)) + if (!Q_strlen((char *)pInputData)) *((int *)pOutputData) = 0; else *((int *)pOutputData) = FUNCTION_FROM_NAME((char *)pInputData); @@ -2369,7 +2369,7 @@ NOXREF int CRestore::BufferCheckZString(const char *string) return 0; int maxLen = m_pdata->bufferSize - m_pdata->size; - int len = strlen(string); + int len = Q_strlen(string); if (len <= maxLen) { diff --git a/regamedll/dlls/util.h b/regamedll/dlls/util.h index 6f599faa..79fc0044 100644 --- a/regamedll/dlls/util.h +++ b/regamedll/dlls/util.h @@ -101,7 +101,7 @@ extern globalvars_t *gpGlobals; #ifndef HOOK_GAMEDLL #define LINK_ENTITY_TO_CLASS(mapClassName,DLLClassName)\ - extern "C" _DLLEXPORT void mapClassName(entvars_t *pev);\ + C_DLLEXPORT void mapClassName(entvars_t *pev);\ void mapClassName(entvars_t *pev)\ {\ GetClassPtr((DLLClassName *)pev);\ @@ -126,7 +126,7 @@ typedef enum dont_ignore_glass = 0 } IGNORE_GLASS; -typedef enum +enum { point_hull = 0, human_hull = 1, @@ -329,13 +329,6 @@ extern int g_groupmask; extern int g_groupop; extern const int gSizes[18]; -//extern "C" _DLLEXPORT void func_recharge(entvars_t *pev); -//extern "C" _DLLEXPORT void cycler_prdroid(entvars_t *pev); -//extern "C" _DLLEXPORT void cycler(entvars_t *pev); -//extern "C" _DLLEXPORT void cycler_sprite(entvars_t *pev); -//extern "C" _DLLEXPORT void cycler_weapon(entvars_t *pev); -//extern "C" _DLLEXPORT void cycler_wreckage(entvars_t *pev); - 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); @@ -369,7 +362,7 @@ void UTIL_ScreenFadeAll(const Vector &color, float fadeTime, float fadeHold, int void UTIL_ScreenFade(CBaseEntity *pEntity, const Vector &color, float fadeTime, float fadeHold = 0.0f, int alpha = 0, int flags = 0); void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, const char *pMessage); void UTIL_HudMessageAll(const hudtextparms_t &textparms, const char *pMessage); -void UTIL_ClientPrintAll(int msg_dest, const char *msg_name, const char *param1, const char *param2, const char *param3, const char *param4); +void UTIL_ClientPrintAll(int msg_dest, const char *msg_name, const char *param1 = NULL, const char *param2 = NULL, const char *param3 = NULL, const char *param4 = NULL); void ClientPrint(entvars_t *client, int msg_dest, const char *msg_name, const char *param1 = NULL, const char *param2 = NULL, const char *param3 = NULL, const char *param4 = NULL); NOXREF void UTIL_SayText(const char *pText, CBaseEntity *pEntity); void UTIL_SayTextAll(const char *pText, CBaseEntity *pEntity); @@ -377,9 +370,9 @@ char *UTIL_dtos1(int d); char *UTIL_dtos2(int d); NOXREF char *UTIL_dtos3(int d); NOXREF char *UTIL_dtos4(int d); -void UTIL_ShowMessageArgs(const char *pString, CBaseEntity *pPlayer, CUtlVector *args, bool isHint); -void UTIL_ShowMessage(const char *pString, CBaseEntity *pEntity, bool isHint); -void UTIL_ShowMessageAll(const char *pString, bool isHint); +void UTIL_ShowMessageArgs(const char *pString, CBaseEntity *pPlayer, CUtlVector *args, bool isHint = false); +void UTIL_ShowMessage(const char *pString, CBaseEntity *pEntity, bool isHint = false); +void UTIL_ShowMessageAll(const char *pString, bool isHint = false); void UTIL_TraceLine(const Vector &vecStart, const Vector &vecEnd, IGNORE_MONSTERS igmon, edict_t *pentIgnore, TraceResult *ptr); 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); @@ -426,7 +419,12 @@ NOXREF int GetPlayerTeam(int index); bool UTIL_IsGame(const char *gameName); float UTIL_GetPlayerGaitYaw(int playerIndex); +// combat.cpp NOBODY void RadiusFlash(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int iClassIgnore, int bitsDamageType); +NOBODY void GetAmountOfPlayerVisible(Vector vecSrc, CBaseEntity *entity); +NOBODY void RadiusDamage(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, float flRadius, int iClassIgnore, int bitsDamageType); +NOBODY void RadiusDamage2(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, float flRadius, int iClassIgnore, int bitsDamageType); +NOXREF char *vstr(float *v); /* * Declared for function overload diff --git a/regamedll/dlls/vector.h b/regamedll/dlls/vector.h index aaf0933f..dbc1d688 100644 --- a/regamedll/dlls/vector.h +++ b/regamedll/dlls/vector.h @@ -35,7 +35,7 @@ #ifdef HOOK_GAMEDLL // probably gamedll compiled with flag /fpmath:fasted, -// so you need to use double, otherwise the demo will fail +// so we need to use type double, otherwise will be the test failed typedef double float_precision; diff --git a/regamedll/dlls/vehicle.cpp b/regamedll/dlls/vehicle.cpp index a3e650a4..3f10be63 100644 --- a/regamedll/dlls/vehicle.cpp +++ b/regamedll/dlls/vehicle.cpp @@ -23,12 +23,12 @@ TYPEDESCRIPTION CFuncVehicle::m_SaveData[] = #else -TYPEDESCRIPTION (*CFuncVehicle::m_SaveData)[12]; +TYPEDESCRIPTION (*CFuncVehicle::pm_SaveData)[12]; #endif // HOOK_GAMEDLL /* <1bc835> ../cstrike/dlls/vehicle.cpp:20 */ -void FixupAngles2(Vector &v) +NOBODY void FixupAngles2(Vector &v) { } @@ -39,7 +39,7 @@ IMPLEMENT_SAVERESTORE(CFuncVehicle, CBaseEntity); LINK_ENTITY_TO_CLASS(func_vehicle, CFuncVehicle); /* <1bb408> ../cstrike/dlls/vehicle.cpp:57 */ -void CFuncVehicle::KeyValue_(KeyValueData *pkvd) +NOBODY void CFuncVehicle::KeyValue_(KeyValueData *pkvd) { // FStrEq(const char *sz1, // const char *sz2); // 59 @@ -70,12 +70,12 @@ void CFuncVehicle::KeyValue_(KeyValueData *pkvd) } /* <1bc059> ../cstrike/dlls/vehicle.cpp:109 */ -void CFuncVehicle::NextThink(float thinkTime, BOOL alwaysThink) +NOBODY void CFuncVehicle::NextThink(float thinkTime, BOOL alwaysThink) { } /* <1bb9d0> ../cstrike/dlls/vehicle.cpp:120 */ -void CFuncVehicle::Blocked_(CBaseEntity *pOther) +NOBODY void CFuncVehicle::Blocked_(CBaseEntity *pOther) { // { // entvars_t *pevOther; // 122 @@ -125,7 +125,7 @@ void CFuncVehicle::Blocked_(CBaseEntity *pOther) } /* <1bcf96> ../cstrike/dlls/vehicle.cpp:179 */ -void CFuncVehicle::Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) +NOBODY void CFuncVehicle::Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) { // StopSound(CFuncVehicle *const this); // 197 // { @@ -136,7 +136,7 @@ void CFuncVehicle::Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE } /* <1bc0bd> ../cstrike/dlls/vehicle.cpp:303 */ -void CFuncVehicle::StopSound(void) +NOBODY void CFuncVehicle::StopSound(void) { // { // short unsigned int us_encode; // 308 @@ -145,7 +145,7 @@ void CFuncVehicle::StopSound(void) } /* <1bb33d> ../cstrike/dlls/vehicle.cpp:324 */ -void CFuncVehicle::UpdateSound(void) +NOBODY void CFuncVehicle::UpdateSound(void) { // { // float flpitch; // 326 @@ -159,7 +159,7 @@ void CFuncVehicle::UpdateSound(void) } /* <1bc12b> ../cstrike/dlls/vehicle.cpp:368 */ -void CFuncVehicle::CheckTurning(void) +NOBODY void CFuncVehicle::CheckTurning(void) { // { // float maxspeed; // 370 @@ -185,7 +185,7 @@ void CFuncVehicle::CheckTurning(void) } /* <1bc358> ../cstrike/dlls/vehicle.cpp:466 */ -void CFuncVehicle::CollisionDetection(void) +NOBODY void CFuncVehicle::CollisionDetection(void) { // { // TraceResult tr; // 468 @@ -234,7 +234,7 @@ void CFuncVehicle::CollisionDetection(void) } /* <1bc7aa> ../cstrike/dlls/vehicle.cpp:588 */ -void CFuncVehicle::TerrainFollowing(void) +NOBODY void CFuncVehicle::TerrainFollowing(void) { // { // TraceResult tr; // 590 @@ -244,7 +244,7 @@ void CFuncVehicle::TerrainFollowing(void) } /* <1bc856> ../cstrike/dlls/vehicle.cpp:609 */ -void CFuncVehicle::Next(void) +NOBODY void CFuncVehicle::Next(void) { // { // Vector vGravityVector; // 611 @@ -335,7 +335,7 @@ void CFuncVehicle::Next(void) } /* <1bd087> ../cstrike/dlls/vehicle.cpp:764 */ -void CFuncVehicle::DeadEnd(void) +NOBODY void CFuncVehicle::DeadEnd(void) { // { // class CPathTrack *pTrack; // 767 @@ -344,7 +344,7 @@ void CFuncVehicle::DeadEnd(void) } /* <1bd0d4> ../cstrike/dlls/vehicle.cpp:810 */ -void CFuncVehicle::SetControls(entvars_t *pevControls) +NOBODY void CFuncVehicle::SetControls(entvars_t *pevControls) { // { // Vector offset; // 812 @@ -358,7 +358,7 @@ void CFuncVehicle::SetControls(entvars_t *pevControls) } /* <1bb1b2> ../cstrike/dlls/vehicle.cpp:819 */ -BOOL CFuncVehicle::OnControls_(entvars_t *pevTest) +NOBODY BOOL CFuncVehicle::OnControls_(entvars_t *pevTest) { // { // Vector offset; // 821 @@ -375,7 +375,7 @@ BOOL CFuncVehicle::OnControls_(entvars_t *pevTest) } /* <1bb676> ../cstrike/dlls/vehicle.cpp:841 */ -void CFuncVehicle::Find(void) +NOBODY void CFuncVehicle::Find(void) { // { // entvars_t *pevTarget; // 847 @@ -399,7 +399,7 @@ void CFuncVehicle::Find(void) } /* <1bb840> ../cstrike/dlls/vehicle.cpp:878 */ -void CFuncVehicle::NearestPath(void) +NOBODY void CFuncVehicle::NearestPath(void) { // { // class CBaseEntity *pTrack; // 880 @@ -424,13 +424,13 @@ void CFuncVehicle::NearestPath(void) } /* <1bb00a> ../cstrike/dlls/vehicle.cpp:926 */ -void CFuncVehicle::OverrideReset_(void) +NOBODY void CFuncVehicle::OverrideReset_(void) { // NextThink(class CFuncVehicle *const this, float thinkTime, BOOL alwaysThink); // 928 } /* <1bd198> ../cstrike/dlls/vehicle.cpp:933 */ -CFuncVehicle *CFuncVehicle::Instance(edict_t *pent) +NOBODY CFuncVehicle *CFuncVehicle::Instance(edict_t *pent) { // FClassnameIs(edict_t *pent, // const char *szClassname); // 935 @@ -438,19 +438,19 @@ CFuncVehicle *CFuncVehicle::Instance(edict_t *pent) } /* <1bb055> ../cstrike/dlls/vehicle.cpp:951 */ -int CFuncVehicle::Classify_(void) +NOBODY int CFuncVehicle::Classify_(void) { } /* <1bb0ef> ../cstrike/dlls/vehicle.cpp:956 */ -void CFuncVehicle::Spawn_(void) +NOBODY void CFuncVehicle::Spawn_(void) { // NextThink(CFuncVehicle::Spawn(// float thinkTime, // BOOL alwaysThink); // 999 } /* <1bb13e> ../cstrike/dlls/vehicle.cpp:1005 */ -void CFuncVehicle::Restart_(void) +NOBODY void CFuncVehicle::Restart_(void) { // STOP_SOUND(edict_t *entity, // int channel, @@ -461,7 +461,7 @@ void CFuncVehicle::Restart_(void) } /* <1bb07b> ../cstrike/dlls/vehicle.cpp:1032 */ -void CFuncVehicle::Precache_(void) +NOBODY void CFuncVehicle::Precache_(void) { } @@ -469,7 +469,7 @@ void CFuncVehicle::Precache_(void) LINK_ENTITY_TO_CLASS(func_vehiclecontrols, CFuncVehicleControls); /* <1bbd36> ../cstrike/dlls/vehicle.cpp:1067 */ -void CFuncVehicleControls::Find(void) +NOBODY void CFuncVehicleControls::Find(void) { // { // edict_t *pTarget; // 1069 @@ -487,7 +487,7 @@ void CFuncVehicleControls::Find(void) } /* <1bb0c8> ../cstrike/dlls/vehicle.cpp:1088 */ -void CFuncVehicleControls::Spawn_(void) +NOBODY void CFuncVehicleControls::Spawn_(void) { } diff --git a/regamedll/dlls/vehicle.h b/regamedll/dlls/vehicle.h index 2d3133d0..bb7d4560 100644 --- a/regamedll/dlls/vehicle.h +++ b/regamedll/dlls/vehicle.h @@ -77,4 +77,6 @@ public: };/* size: 152, cachelines: 3, members: 1 */ +NOBODY void FixupAngles2(Vector &v); + #endif // VEHICLE_H diff --git a/regamedll/dlls/weapons.cpp b/regamedll/dlls/weapons.cpp index 833fd359..2c0ad8c6 100644 --- a/regamedll/dlls/weapons.cpp +++ b/regamedll/dlls/weapons.cpp @@ -41,9 +41,9 @@ const char *g_pModelNameLaser = "sprites/laserbeam.spr"; ItemInfo (*CBasePlayerItem::pItemInfoArray)[32]; AmmoInfo (*CBasePlayerItem::pAmmoInfoArray)[32]; -TYPEDESCRIPTION (*CBasePlayerItem::m_SaveData)[3]; -TYPEDESCRIPTION (*CBasePlayerWeapon::m_SaveData)[7]; -TYPEDESCRIPTION (*CWeaponBox::m_SaveData)[4]; +TYPEDESCRIPTION (*CBasePlayerItem::pm_SaveData)[3]; +TYPEDESCRIPTION (*CBasePlayerWeapon::pm_SaveData)[7]; +TYPEDESCRIPTION (*CWeaponBox::pm_SaveData)[4]; const char *g_pModelNameLaser; @@ -76,19 +76,13 @@ int MaxAmmoCarry(int iszName) { for (int i = 0; i < MAX_WEAPONS; i++) { -#ifndef HOOK_GAMEDLL - if (CBasePlayerItem::ItemInfoArray[i].pszAmmo1 && !Q_strcmp(STRING(iszName), CBasePlayerItem::ItemInfoArray[i].pszAmmo1)) - return CBasePlayerItem::ItemInfoArray[i].iMaxAmmo1; + ItemInfo *pInfo = &IMPLEMENT_ARRAY_CLASS(CBasePlayerItem, ItemInfoArray)[ i ]; - if (CBasePlayerItem::ItemInfoArray[i].pszAmmo2 && !Q_strcmp(STRING(iszName), CBasePlayerItem::ItemInfoArray[i].pszAmmo2)) - return CBasePlayerItem::ItemInfoArray[i].iMaxAmmo2; -#else - if ((*CBasePlayerItem::pItemInfoArray)[i].pszAmmo1 && !Q_strcmp(STRING(iszName), (*CBasePlayerItem::pItemInfoArray)[i].pszAmmo1)) - return (*CBasePlayerItem::pItemInfoArray)[i].iMaxAmmo1; + if (pInfo->pszAmmo1 && !Q_strcmp(STRING(iszName), pInfo->pszAmmo1)) + return pInfo->iMaxAmmo1; - if ((*CBasePlayerItem::pItemInfoArray)[i].pszAmmo2 && !Q_strcmp(STRING(iszName), (*CBasePlayerItem::pItemInfoArray)[i].pszAmmo2)) - return (*CBasePlayerItem::pItemInfoArray)[i].iMaxAmmo2; -#endif // HOOK_GAMEDLL + if (pInfo->pszAmmo2 && !Q_strcmp(STRING(iszName), pInfo->pszAmmo2)) + return pInfo->iMaxAmmo2; } ALERT(at_console, "MaxAmmoCarry() doesn't recognize '%s'!\n", STRING(iszName)); @@ -168,13 +162,12 @@ NOBODY void EjectBrass2(Vector &vecOrigin, Vector &vecVelocity, float rotation, /* <1d020f> ../cstrike/dlls/weapons.cpp:242 */ NOXREF void AddAmmoNameToAmmoRegistry(const char *szAmmoname) { -#ifndef HOOK_GAMEDLL for (int i = 0; i < MAX_AMMO_SLOTS; i++) { - if (!CBasePlayerItem::AmmoInfoArray[i].pszName) + if (!IMPLEMENT_ARRAY_CLASS(CBasePlayerItem, AmmoInfoArray)[ i ].pszName) continue; - if (!Q_stricmp(CBasePlayerItem::AmmoInfoArray[i].pszName, szAmmoName)) + if (!Q_stricmp(IMPLEMENT_ARRAY_CLASS(CBasePlayerItem, AmmoInfoArray)[ i ].pszName, szAmmoname)) return; } @@ -183,29 +176,8 @@ NOXREF void AddAmmoNameToAmmoRegistry(const char *szAmmoname) if (giAmmoIndex >= MAX_AMMO_SLOTS) giAmmoIndex = 0; - CBasePlayerItem::AmmoInfoArray[ giAmmoIndex ].pszName = szAmmoName; - CBasePlayerItem::AmmoInfoArray[ giAmmoIndex ].iId = giAmmoIndex; - -#else // HOOK_GAMEDLL - - for (int i = 0; i < MAX_AMMO_SLOTS; i++) - { - if (!(*CBasePlayerItem::pAmmoInfoArray)[i].pszName) - continue; - - if (!Q_stricmp((*CBasePlayerItem::pAmmoInfoArray)[i].pszName, szAmmoname)) - return; - } - - giAmmoIndex++; - - if (giAmmoIndex >= MAX_AMMO_SLOTS) - giAmmoIndex = 0; - - (*CBasePlayerItem::pAmmoInfoArray)[ giAmmoIndex ].pszName = szAmmoname; - (*CBasePlayerItem::pAmmoInfoArray)[ giAmmoIndex ].iId = giAmmoIndex; - -#endif // HOOK_GAMEDLL + IMPLEMENT_ARRAY_CLASS(CBasePlayerItem, AmmoInfoArray)[ giAmmoIndex ].pszName = szAmmoname; + IMPLEMENT_ARRAY_CLASS(CBasePlayerItem, AmmoInfoArray)[ giAmmoIndex ].iId = giAmmoIndex; } /* <1d2e01> ../cstrike/dlls/weapons.cpp:265 */ @@ -229,12 +201,7 @@ void UTIL_PrecacheOtherWeapon(const char *szClassname) if (((CBasePlayerItem *)pEntity)->GetItemInfo(&II)) { -#ifndef HOOK_GAMEDLL - CBasePlayerItem::ItemInfoArray[II.iId] = II; -#else - (*CBasePlayerItem::pItemInfoArray)[II.iId] = II; -#endif // HOOK_GAMEDLL - + IMPLEMENT_ARRAY_CLASS(CBasePlayerItem, ItemInfoArray)[ II.iId ] = II; if (II.pszAmmo1 && *II.pszAmmo1) AddAmmoNameToAmmoRegistry(II.pszAmmo1); @@ -268,12 +235,7 @@ NOXREF void UTIL_PrecacheOtherWeapon2(const char *szClassname) if (((CBasePlayerItem *)pEntity)->GetItemInfo(&II)) { -#ifndef HOOK_GAMEDLL - CBasePlayerItem::ItemInfoArray[II.iId] = II; -#else - (*CBasePlayerItem::pItemInfoArray)[II.iId] = II; -#endif // HOOK_GAMEDLL - + IMPLEMENT_ARRAY_CLASS(CBasePlayerItem, ItemInfoArray)[ II.iId ] = II; if (II.pszAmmo1 && *II.pszAmmo1) AddAmmoNameToAmmoRegistry(II.pszAmmo1); @@ -288,15 +250,8 @@ NOXREF void UTIL_PrecacheOtherWeapon2(const char *szClassname) /* <1d3191> ../cstrike/dlls/weapons.cpp:345 */ void W_Precache(void) -{ -#ifndef HOOK_GAMEDLL - memset(CBasePlayerItem::ItemInfoArray, 0, ARRAYSIZE(CBasePlayerItem::ItemInfoArray)); - memset(CBasePlayerItem::AmmoInfoArray, 0, ARRAYSIZE(CBasePlayerItem::AmmoInfoArray)); -#else - memset((*CBasePlayerItem::pItemInfoArray), 0, ARRAYSIZE((*CBasePlayerItem::pItemInfoArray))); - memset((*CBasePlayerItem::pAmmoInfoArray), 0, ARRAYSIZE((*CBasePlayerItem::pAmmoInfoArray))); -#endif // HOOK_GAMEDLL - +{ + memset(IMPLEMENT_ARRAY_CLASS(CBasePlayerItem, ItemInfoArray), 0, ARRAYSIZE( IMPLEMENT_ARRAY_CLASS(CBasePlayerItem, ItemInfoArray) )); giAmmoIndex = 0; UTIL_PrecacheOther("item_suit"); diff --git a/regamedll/dlls/weapons.h b/regamedll/dlls/weapons.h index 922baeab..2d48db32 100644 --- a/regamedll/dlls/weapons.h +++ b/regamedll/dlls/weapons.h @@ -194,12 +194,7 @@ public: NOBODY void EXPORT C4Think(void); public: - -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[15]; -#else - static TYPEDESCRIPTION (*m_SaveData)[15]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[15]; bool m_bStartDefuse; bool m_bIsC4; @@ -230,8 +225,8 @@ public: #ifdef HOOK_GAMEDLL -#define ItemInfoArray (*pItemInfoArray) -#define AmmoInfoArray (*pAmmoInfoArray) +//#define ItemInfoArray (*pItemInfoArray) +//#define AmmoInfoArray (*pAmmoInfoArray) #endif // HOOK_GAMEDLL @@ -349,51 +344,47 @@ public: public: inline int iItemPosition(void) { - return ItemInfoArray[ m_iId ].iPosition; + return IMPLEMENT_ARRAY(ItemInfoArray)[ m_iId ].iPosition; } inline const char *pszAmmo1(void) { - return ItemInfoArray[ m_iId ].pszAmmo1; + return IMPLEMENT_ARRAY(ItemInfoArray)[ m_iId ].pszAmmo1; } inline int iMaxAmmo1(void) { - return ItemInfoArray[ m_iId ].iMaxAmmo1; + return IMPLEMENT_ARRAY(ItemInfoArray)[ m_iId ].iMaxAmmo1; } inline const char *pszAmmo2(void) { - return ItemInfoArray[ m_iId ].pszAmmo2; + return IMPLEMENT_ARRAY(ItemInfoArray)[ m_iId ].pszAmmo2; } inline int iMaxAmmo2(void) { - return ItemInfoArray[ m_iId ].iMaxAmmo2; + return IMPLEMENT_ARRAY(ItemInfoArray)[ m_iId ].iMaxAmmo2; } inline const char *pszName(void) { - return ItemInfoArray[ m_iId ].pszName; + return IMPLEMENT_ARRAY(ItemInfoArray)[ m_iId ].pszName; } inline int iMaxClip(void) { - return ItemInfoArray[ m_iId ].iMaxClip; + return IMPLEMENT_ARRAY(ItemInfoArray)[ m_iId ].iMaxClip; } inline int iWeight(void) { - return ItemInfoArray[ m_iId ].iWeight; + return IMPLEMENT_ARRAY(ItemInfoArray)[ m_iId ].iWeight; } inline int iFlags(void) { - return ItemInfoArray[ m_iId ].iFlags; + return IMPLEMENT_ARRAY(ItemInfoArray)[ m_iId ].iFlags; } public: -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[3]; -#else - static TYPEDESCRIPTION (*m_SaveData)[3]; -#endif // HOOK_GAMEDLL - static ItemInfo ItemInfoArray[32]; - static AmmoInfo AmmoInfoArray[32]; + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[3]; + static ItemInfo IMPLEMENT_ARRAY(ItemInfoArray)[32]; + static AmmoInfo IMPLEMENT_ARRAY(AmmoInfoArray)[32]; - CBasePlayer *m_pPlayer;//180 + CBasePlayer *m_pPlayer; CBasePlayerItem *m_pNext; int m_iId; @@ -493,11 +484,8 @@ public: bool ShieldSecondaryFire(int iUpAnim,int iDownAnim); public: -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[7]; -#else - static TYPEDESCRIPTION (*m_SaveData)[7]; -#endif // HOOK_GAMEDLL + + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[7]; int m_iPlayEmptySound; int m_fFireOnEmpty; @@ -596,11 +584,7 @@ public: BOOL PackAmmo(int iszName, int iCount); public: -#ifndef HOOK_GAMEDLL - static TYPEDESCRIPTION m_SaveData[4]; -#else - static TYPEDESCRIPTION (*m_SaveData)[4]; -#endif // HOOK_GAMEDLL + static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[4]; CBasePlayerItem *m_rgpPlayerItems[ MAX_ITEM_TYPES ]; int m_rgiszAmmo[ MAX_AMMO_SLOTS ]; @@ -1654,46 +1638,6 @@ extern short g_sModelIndexC4Glow; extern int giAmmoIndex; extern short g_sModelIndexRadio; extern MULTIDAMAGE gMultiDamage; - -//extern "C" _DLLEXPORT void weapon_usp(entvars_t *pev); -//_DLLEXPORT void weapon_usp(entvars_t *pev); - -//extern "C" _DLLEXPORT void func_weaponcheck(entvars_t *pev); -//extern "C" _DLLEXPORT void func_grencatch(entvars_t *pev); - -//extern "C" _DLLEXPORT void weaponbox(entvars_t *pev); -//extern "C" _DLLEXPORT void armoury_entity(entvars_t *pev); - -//extern "C" _DLLEXPORT void weapon_usp(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_mp5navy(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_sg552(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_ak47(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_aug(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_awp(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_c4(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_deagle(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_flashbang(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_g3sg1(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_glock18(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_hegrenade(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_knife(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_m249(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_m3(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_m4a1(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_mac10(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_p228(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_p90(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_scout(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_smokegrenade(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_tmp(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_elite(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_xm1014(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_fiveseven(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_ump45(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_sg550(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_galil(entvars_t *pev); -//extern "C" _DLLEXPORT void weapon_famas(entvars_t *pev); -//extern "C" _DLLEXPORT void grenade(entvars_t *pev); NOBODY void FindHullIntersection(Vector &vecSrc, TraceResult &tr, float *mins, float *maxs, edict_t *pEntity); diff --git a/regamedll/dlls/world.cpp b/regamedll/dlls/world.cpp index 69ccb056..b4755ad7 100644 --- a/regamedll/dlls/world.cpp +++ b/regamedll/dlls/world.cpp @@ -13,7 +13,7 @@ float g_flWeaponCheat; */ #ifndef HOOK_GAMEDLL -DLL_DECALLIST gDecals2[] = +DLL_DECALLIST gDecals[] = { { "{shot1", 0 }, // DECAL_GUNSHOT1 { "{shot2", 0 }, // DECAL_GUNSHOT2 @@ -59,17 +59,29 @@ DLL_DECALLIST gDecals2[] = { "{mommablob", 0 }, // DECAL_MOMMASPLAT // BM Mortar spray?? need decal*/ }; +TYPEDESCRIPTION CGlobalState::m_SaveData[] = +{ + DEFINE_FIELD(CGlobalState, m_listCount, FIELD_INTEGER) +}; + +TYPEDESCRIPTION gGlobalEntitySaveData[] = +{ + DEFINE_ARRAY(globalentity_t, name, FIELD_CHARACTER, 64), + DEFINE_ARRAY(globalentity_t, levelName, FIELD_CHARACTER, 32), + DEFINE_FIELD(globalentity_t, state, FIELD_INTEGER) +}; + #else // HOOK_GAMEDLL DLL_DECALLIST gDecals[42]; + +TYPEDESCRIPTION (*CGlobalState::pm_SaveData)[1]; +TYPEDESCRIPTION gGlobalEntitySaveData[3]; #endif // HOOK_GAMEDLL /* <1db42b> ../cstrike/dlls/world.cpp:120 */ -//void infodecal(entvars_t *pev) -//{ -// GetClassPtr((CDecal *)pev); -//} +LINK_ENTITY_TO_CLASS(infodecal, CDecal); /* <1db00a> ../cstrike/dlls/world.cpp:123 */ NOBODY void CDecal::Spawn(void) @@ -124,13 +136,10 @@ NOBODY void CDecal::KeyValue(KeyValueData *pkvd) } /* <1db4f5> ../cstrike/dlls/world.cpp:212 */ -//void bodyque(entvars_t *pev) -//{ -// GetClassPtr((CCorpse *)pev); -//} +LINK_ENTITY_TO_CLASS(bodyque, CCorpse); /* <1da107> ../cstrike/dlls/world.cpp:214 */ -INLINEBODY NOXREF void InitBodyQue(void) +NOXREF void InitBodyQue(void) { g_pBodyQueueHead = NULL; } @@ -299,10 +308,7 @@ NOBODY void ResetGlobalState(void) } /* <1dbeff> ../cstrike/dlls/world.cpp:493 */ -///extern "C" _DLLEXPORT void __cdecl worldspawn(entvars_t *pev) -//{ -// GetClassPtr((CWorld *)pev); -//} +LINK_ENTITY_TO_CLASS(worldspawn, CWorld); /* <1dad1d> ../cstrike/dlls/world.cpp:502 */ void CWorld::Spawn_(void) @@ -323,7 +329,7 @@ void CWorld::Spawn_(void) pFile = (char *)LOAD_FILE_FOR_ME(UTIL_VarArgs("maps/%s.txt",STRING(gpGlobals->mapname)), &flength); if (pFile && flength) { - strncpy(g_szMapBriefingText, pFile, 510); + Q_strncpy(g_szMapBriefingText, pFile, 510); #ifdef REGAMEDLL_FIXES g_szMapBriefingText[510] = 0; #endif // REGAMEDLL_FIXES @@ -336,7 +342,7 @@ void CWorld::Spawn_(void) pFile = (char *)LOAD_FILE_FOR_ME(UTIL_VarArgs("maps/default.txt"), &flength); if (pFile && flength) { - strncpy(g_szMapBriefingText, pFile, 510); + Q_strncpy(g_szMapBriefingText, pFile, 510); #ifdef REGAMEDLL_FIXES g_szMapBriefingText[510] = 0; #endif // REGAMEDLL_FIXES diff --git a/regamedll/dlls/world.h b/regamedll/dlls/world.h new file mode 100644 index 00000000..a49c888d --- /dev/null +++ b/regamedll/dlls/world.h @@ -0,0 +1,55 @@ +/* +* +* 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 WORLD_H +#define WORLD_H +#ifdef _WIN32 +#pragma once +#endif + +#ifdef HOOK_GAMEDLL + +#define g_pBodyQueueHead (*pg_pBodyQueueHead) +#define gGlobalState (*pgGlobalState) +#define g_flWeaponCheat (*pg_flWeaponCheat) +#define gGlobalEntitySaveData (*pgGlobalEntitySaveData) + +#endif // HOOK_GAMEDLL + +NOBODY void CopyToBodyQue(entvars_t *pev); +NOBODY void ClearBodyQue(void); +NOBODY void SaveGlobalState(SAVERESTOREDATA *pSaveData); +NOBODY void RestoreGlobalState(SAVERESTOREDATA *pSaveData); +NOBODY void ResetGlobalState(void); + +extern edict_t *g_pBodyQueueHead; +extern CGlobalState gGlobalState; +extern float g_flWeaponCheat; +extern TYPEDESCRIPTION gGlobalEntitySaveData[3]; + +#endif // WORLD_H diff --git a/regamedll/engine/common.h b/regamedll/engine/common.h index 3c046d51..7284d683 100644 --- a/regamedll/engine/common.h +++ b/regamedll/engine/common.h @@ -37,8 +37,6 @@ #include "FileSystem.h" #include "info.h" -#define COM_TOKEN_LEN 1024 - // Don't allow overflow #define SIZEBUF_CHECK_OVERFLOW 0 #define SIZEBUF_ALLOW_OVERFLOW BIT(0) diff --git a/regamedll/game_shared/bot/bot_manager.cpp b/regamedll/game_shared/bot/bot_manager.cpp index 8098e1d6..8678483a 100644 --- a/regamedll/game_shared/bot/bot_manager.cpp +++ b/regamedll/game_shared/bot/bot_manager.cpp @@ -241,7 +241,7 @@ bool CBotManager::IsInsideSmokeCloud(const Vector *pos) } /* <49fd8b> ../game_shared/bot/bot_manager.cpp:355 */ -NOBODY bool CBotManager::IsLineBlockedBySmoke(const Vector *from, const Vector *to) +bool CBotManager::IsLineBlockedBySmoke(const Vector *from, const Vector *to) { const float smokeRadiusSq = smokeRadius * smokeRadius; diff --git a/regamedll/game_shared/bot/bot_manager.h b/regamedll/game_shared/bot/bot_manager.h index 2a6b9a33..5079ec78 100644 --- a/regamedll/game_shared/bot/bot_manager.h +++ b/regamedll/game_shared/bot/bot_manager.h @@ -122,7 +122,7 @@ public: NOBODY void DestroyAllGrenades(void); // return true if line intersects smoke volume - NOBODY bool IsLineBlockedBySmoke(const Vector *from, const Vector *to); + bool IsLineBlockedBySmoke(const Vector *from, const Vector *to); // return true if position is inside a smoke cloud bool IsInsideSmokeCloud(const Vector *pos); diff --git a/regamedll/game_shared/bot/bot_profile.cpp b/regamedll/game_shared/bot/bot_profile.cpp index 63520a79..4500955c 100644 --- a/regamedll/game_shared/bot/bot_profile.cpp +++ b/regamedll/game_shared/bot/bot_profile.cpp @@ -48,8 +48,9 @@ NOBODY bool BotProfile::HasPistolPreference(void) const } /* <4a7b5e> ../game_shared/bot/bot_profile.cpp:112 */ -NOBODY bool BotProfile::IsValidForTeam(BotProfileTeamType team) const +bool BotProfile::IsValidForTeam(BotProfileTeamType team) const { + return (team == BOT_TEAM_ANY || m_teams == BOT_TEAM_ANY || team == m_teams); } /* <4a7bb2> ../game_shared/bot/bot_profile.cpp:122 */ diff --git a/regamedll/game_shared/bot/bot_profile.h b/regamedll/game_shared/bot/bot_profile.h index c349c3a9..4632e6c1 100644 --- a/regamedll/game_shared/bot/bot_profile.h +++ b/regamedll/game_shared/bot/bot_profile.h @@ -93,14 +93,14 @@ public: { return m_weaponPreference[i]; } - const char *GetWeaponPreferenceAsString(int i) const; + NOBODY const char *GetWeaponPreferenceAsString(int i) const; int GetWeaponPreferenceCount(void) const { return m_weaponPreferenceCount; } - bool HasPrimaryPreference(void) const; - bool HasPistolPreference(void) const; + NOBODY bool HasPrimaryPreference(void) const; + NOBODY bool HasPistolPreference(void) const; int GetCost(void) const { @@ -110,7 +110,7 @@ public: { return m_skin; } - bool IsDifficulty(BotDifficultyType diff) const; + NOBODY bool IsDifficulty(BotDifficultyType diff) const; int GetVoicePitch(void) const { return m_voicePitch; @@ -133,7 +133,7 @@ public: return m_prefersSilencer; } // TODO: it func private - void Inherit(const BotProfile *parent, const BotProfile *baseline); + NOBODY void Inherit(const BotProfile *parent, const BotProfile *baseline); private: diff --git a/regamedll/game_shared/bot/bot_util.h b/regamedll/game_shared/bot/bot_util.h index dd3e0e15..0b89a88b 100644 --- a/regamedll/game_shared/bot/bot_util.h +++ b/regamedll/game_shared/bot/bot_util.h @@ -196,7 +196,7 @@ inline bool IsIntersecting2D(const Vector &startA, const Vector &endA, const Vec template < typename Functor > -INLINEBODY bool ForEachPlayer(Functor &func) +bool ForEachPlayer(Functor &func) { for(int i = 1; i <= gpGlobals->maxClients; i++) { diff --git a/regamedll/game_shared/shared_util.cpp b/regamedll/game_shared/shared_util.cpp index 7f935048..6619e25e 100644 --- a/regamedll/game_shared/shared_util.cpp +++ b/regamedll/game_shared/shared_util.cpp @@ -34,16 +34,16 @@ char *SharedVarArgs(char *format, ...) const int BufLen = 1024; const int NumBuffers = 4; - static char string[NumBuffers][BufLen]; + static char string[ NumBuffers ][ BufLen ]; static int curstring = 0; curstring = (curstring + 1) % NumBuffers; va_start(argptr, format); - Q_vsnprintf(string[curstring], BufLen, format, argptr); + Q_vsnprintf(string[ curstring ], BufLen, format, argptr); va_end(argptr); - return string[curstring]; + return string[ curstring ]; } /* <2d4ba1> ../game_shared/shared_util.cpp:90 */ @@ -56,8 +56,8 @@ char *BufPrintf(char *buf, int &len, const char *fmt, ...) Q_vsnprintf(buf, len, fmt, argptr); va_end(argptr); - len -= strlen(buf); - return buf + strlen(buf); + len -= Q_strlen(buf); + return buf + Q_strlen(buf); } return NULL; } diff --git a/regamedll/hookers/6153_hooker.cpp b/regamedll/hookers/6153_hooker.cpp index cfa7fb82..f8ea65fc 100644 --- a/regamedll/hookers/6153_hooker.cpp +++ b/regamedll/hookers/6153_hooker.cpp @@ -93,13 +93,13 @@ extern const size_t g_BaseOffset = NULL; //#define Bot_Region //#define CS_Util_Region //#define CS_Init_Region -//#define Main_Region //#define H_Region //#define Tutor_CS_Region //#define Nav_Region //#define Hostage_Region //#define GameShr_BotProfile_Region //#define VoiceManager_Region +//#define Vector_Region //#define Data_References_Region //#define Function_References_Region @@ -225,16 +225,16 @@ FunctionHook g_FunctionHooks[] = #ifndef Monsters_Region //CGib //virtual func - //{ 0x0, "_ZN4CGib10ObjectCapsEv", mfunc_ptr_cast(&CGib::ObjectCaps) }, + { 0x01D70C90, "_ZN4CGib10ObjectCapsEv", mfunc_ptr_cast(&CGib::ObjectCaps_) }, //non-virtual func - //{ 0x0, "_ZN4CGib5SpawnEPKc", mfunc_ptr_cast(&CGib::Spawn) }, - //{ 0x0, "_ZN4CGib14BounceGibTouchEP11CBaseEntity", mfunc_ptr_cast(&CGib::BounceGibTouch) }, - //{ 0x0, "_ZN4CGib14StickyGibTouchEP11CBaseEntity", mfunc_ptr_cast(&CGib::StickyGibTouch) }, - //{ 0x0, "_ZN4CGib12WaitTillLandEv", mfunc_ptr_cast(&CGib::WaitTillLand) }, - //{ 0x0, "_ZN4CGib13LimitVelocityEv", mfunc_ptr_cast(&CGib::LimitVelocity) }, - //{ 0x0, "_ZN4CGib12SpawnHeadGibEP9entvars_s", mfunc_ptr_cast(&CGib::SpawnHeadGib) }, - //{ 0x0, "_ZN4CGib15SpawnRandomGibsEP9entvars_sii", mfunc_ptr_cast(&CGib::SpawnRandomGibs) }, - //{ 0x0, "_ZN4CGib15SpawnStickyGibsEP9entvars_s6Vectori", mfunc_ptr_cast(&CGib::SpawnStickyGibs) }, + //{ 0x01D6FFE0, "_ZN4CGib5SpawnEPKc", mfunc_ptr_cast(&CGib::Spawn) }, + //{ 0x01D6FCA0, "_ZN4CGib14BounceGibTouchEP11CBaseEntity", mfunc_ptr_cast(&CGib::BounceGibTouch) }, + //{ 0x01D6FE40, "_ZN4CGib14StickyGibTouchEP11CBaseEntity", mfunc_ptr_cast(&CGib::StickyGibTouch) }, + //{ 0x01D6FBF0, "_ZN4CGib12WaitTillLandEv", mfunc_ptr_cast(&CGib::WaitTillLand) }, + //{ 0x01D6E550, "_ZN4CGib13LimitVelocityEv", mfunc_ptr_cast(&CGib::LimitVelocity) }, + //{ 0x01D6EAB0, "_ZN4CGib12SpawnHeadGibEP9entvars_s", mfunc_ptr_cast(&CGib::SpawnHeadGib) }, + //{ 0x01D6EEB0, "_ZN4CGib15SpawnRandomGibsEP9entvars_sii", mfunc_ptr_cast(&CGib::SpawnRandomGibs) }, + //{ 0x01D6E640, "_ZN4CGib15SpawnStickyGibsEP9entvars_s6Vectori", mfunc_ptr_cast(&CGib::SpawnStickyGibs) }, // NOXREF #endif // Monsters_Region #ifndef AirTank_Region @@ -356,6 +356,7 @@ FunctionHook g_FunctionHooks[] = //{ 0x01D63700, "_ZL21SetObjectCollisionBoxP9entvars_s", (size_t)&SetObjectCollisionBox }, //{ 0x01D63BE0, "_Z20OnFreeEntPrivateDataP7edict_s", (size_t)&OnFreeEntPrivateData }, //{ 0x01D80630, "_Z11GameDLLInitv", (size_t)&GameDLLInit }, + //{ 0x0, "_Z12GetSkillCvarPc", (size_t)&GetSkillCvar }, //NOXREF //{ 0x01D626F0, "_Z13DispatchSpawnP7edict_s", (size_t)&DispatchSpawn }, //{ 0x01D629D0, "_Z13DispatchThinkP7edict_s", (size_t)&DispatchThink }, //{ 0x01D62990, "_Z11DispatchUseP7edict_sS0_", (size_t)&DispatchUse }, @@ -390,7 +391,7 @@ FunctionHook g_FunctionHooks[] = ////{ 0x0, "_ZN11CBaseEntity21SetObjectCollisionBoxEv", mfunc_ptr_cast(&CBaseEntity::SetObjectCollisionBox) }, ////{ 0x0, "_ZN11CBaseEntity8ClassifyEv", mfunc_ptr_cast(&CBaseEntity::Classify) }, ////{ 0x0, "_ZN11CBaseEntity11DeathNoticeEP9entvars_s", mfunc_ptr_cast(&CBaseEntity::DeathNotice) }, - //{ 0x0, "_ZN11CBaseEntity11TraceAttackEP9entvars_sf6VectorP11TraceResulti", mfunc_ptr_cast(&CBaseEntity::TraceAttack_) }, + //{ 0x01D719D0, "_ZN11CBaseEntity11TraceAttackEP9entvars_sf6VectorP11TraceResulti", mfunc_ptr_cast(&CBaseEntity::TraceAttack_) }, //{ 0x0, "_ZN11CBaseEntity10TakeDamageEP9entvars_sS1_fi", mfunc_ptr_cast(&CBaseEntity::TakeDamage_) }, { 0x01D63190, "_ZN11CBaseEntity10TakeHealthEfi", mfunc_ptr_cast(&CBaseEntity::TakeHealth_) }, //{ 0x0, "_ZN11CBaseEntity6KilledEP9entvars_si", mfunc_ptr_cast(&CBaseEntity::Killed_) }, @@ -435,18 +436,17 @@ FunctionHook g_FunctionHooks[] = ////{ 0x0, "_ZN11CBaseEntity11EarPositionEv", mfunc_ptr_cast(&CBaseEntity::EarPosition) }, ////{ 0x0, "_ZN11CBaseEntity10BodyTargetERK6Vector", mfunc_ptr_cast(&CBaseEntity::BodyTarget) }, ////{ 0x0, "_ZN11CBaseEntity12IlluminationEv", mfunc_ptr_cast(&CBaseEntity::Illumination) }, - //{ 0x0, "_ZN11CBaseEntity8FVisibleEPS_", mfunc_ptr_cast(&CBaseEntity::FVisible_) }, - //{ 0x0, "_ZN11CBaseEntity8FVisibleERK6Vector", mfunc_ptr_cast(&CBaseEntity::FVisible_) }, + //{ 0x01D71840, "_ZN11CBaseEntity8FVisibleEPS_", mfunc_ptr_cast(&CBaseEntity::FVisible_) }, + //{ 0x01D71950, "_ZN11CBaseEntity8FVisibleERK6Vector", mfunc_ptr_cast(&CBaseEntity::FVisible_) }, //non-virtual func - //{ 0x01E14A68, "_ZN11CBaseEntity10m_SaveDataE", mfunc_ptr_cast(&CBaseEntity::m_SaveData) }, { 0x01DBAF90, "_ZN11CBaseEntity14UpdateOnRemoveEv", mfunc_ptr_cast(&CBaseEntity::UpdateOnRemove) }, { 0x01DBAFF0, "_ZN11CBaseEntity10SUB_RemoveEv", mfunc_ptr_cast(&CBaseEntity::SUB_Remove) }, { 0x01DBB0A0, "_ZN11CBaseEntity13SUB_DoNothingEv", mfunc_ptr_cast(&CBaseEntity::SUB_DoNothing) }, - //{ 0x0, "_ZN11CBaseEntity16SUB_StartFadeOutEv", mfunc_ptr_cast(&CBaseEntity::SUB_StartFadeOut) }, - //{ 0x0, "_ZN11CBaseEntity11SUB_FadeOutEv", mfunc_ptr_cast(&CBaseEntity::SUB_FadeOut) }, + //{ 0x01D6FB10, "_ZN11CBaseEntity16SUB_StartFadeOutEv", mfunc_ptr_cast(&CBaseEntity::SUB_StartFadeOut) }, + //{ 0x01D6FB80, "_ZN11CBaseEntity11SUB_FadeOutEv", mfunc_ptr_cast(&CBaseEntity::SUB_FadeOut) }, //{ 0x0, "_ZN11CBaseEntity17SUB_CallUseToggleEv", mfunc_ptr_cast(&CBaseEntity::SUB_CallUseToggle) }, { 0x01D63AC0, "_ZN11CBaseEntity12ShouldToggleE8USE_TYPEi", mfunc_ptr_cast(&CBaseEntity::ShouldToggle) }, - //{ 0x0, "_ZN11CBaseEntity11FireBulletsEj6VectorS0_S0_fiiiP9entvars_s", mfunc_ptr_cast(&CBaseEntity::FireBullets) }, + //{ 0x01D71BC0, "_ZN11CBaseEntity11FireBulletsEj6VectorS0_S0_fiiiP9entvars_s", mfunc_ptr_cast(&CBaseEntity::FireBullets) }, //C!@{ 0x01D72480, "_ZN11CBaseEntity12FireBullets3E6VectorS0_ffiiifP9entvars_sbi", mfunc_ptr_cast(&CBaseEntity::FireBullets3) }, { 0x01DBB190, "_ZN11CBaseEntity14SUB_UseTargetsEPS_8USE_TYPEf", mfunc_ptr_cast(&CBaseEntity::SUB_UseTargets) }, { 0x01DBB260, "_Z11FireTargetsPKcP11CBaseEntityS2_8USE_TYPEf", (size_t)&FireTargets }, @@ -455,6 +455,10 @@ FunctionHook g_FunctionHooks[] = { 0x01D639B0, "_ZN11CBaseEntity9IsDormantEv", mfunc_ptr_cast(&CBaseEntity::IsDormant) }, //{ 0x0, "_ZN11CBaseEntity16IsLockedByMasterEv", mfunc_ptr_cast(&CBaseEntity::IsLockedByMaster) }, // NOXREF { 0x01D63B20, "_ZN11CBaseEntity6CreateEPcRK6VectorS3_P7edict_s", mfunc_ptr_cast(&CBaseEntity::Create) }, + + + + //CPointEntity //{ 0x01DBACC0, "_ZN12CPointEntity5SpawnEv", mfunc_ptr_cast(&CPointEntity::Spawn) }, //{ 0x0, "_ZN12CPointEntity10ObjectCapsEv", mfunc_ptr_cast(&CPointEntity::ObjectCaps) }, @@ -483,8 +487,8 @@ FunctionHook g_FunctionHooks[] = { 0x01D5A0A0, "_ZN14CBaseAnimating17ResetSequenceInfoEv", mfunc_ptr_cast(&CBaseAnimating::ResetSequenceInfo) }, //{ 0x0, "_ZN14CBaseAnimating18DispatchAnimEventsEf", mfunc_ptr_cast(&CBaseAnimating::DispatchAnimEvents) }, - //{ 0x01D5A280, "_ZN14CBaseAnimating17SetBoneControllerEif", mfunc_ptr_cast(&CBaseAnimating::SetBoneController) }, - //{ 0x0, "_ZN14CBaseAnimating19InitBoneControllersEv", mfunc_ptr_cast(&CBaseAnimating::InitBoneControllers) }, + { 0x01D5A280, "_ZN14CBaseAnimating17SetBoneControllerEif", mfunc_ptr_cast(&CBaseAnimating::SetBoneController) }, + { 0x01D5A2B0, "_ZN14CBaseAnimating19InitBoneControllersEv", mfunc_ptr_cast(&CBaseAnimating::InitBoneControllers) }, //{ 0x0, "_ZN14CBaseAnimating11SetBlendingEif", mfunc_ptr_cast(&CBaseAnimating::SetBlending) }, //{ 0x0, "_ZN14CBaseAnimating15GetBonePositionEiR6VectorS1_", mfunc_ptr_cast(&CBaseAnimating::GetBonePosition) }, //{ 0x0, "_ZN14CBaseAnimating15GetAutomovementER6VectorS1_f", mfunc_ptr_cast(&CBaseAnimating::GetAutomovement) }, @@ -541,45 +545,49 @@ FunctionHook g_FunctionHooks[] = //virtual func //{ 0x01D8AD30, "_ZN12CBaseMonster8KeyValueEP14KeyValueData_s", mfunc_ptr_cast(&CBaseMonster::KeyValue) }, - //{ 0x0, "_ZN12CBaseMonster11TraceAttackEP9entvars_sf6VectorP11TraceResulti", mfunc_ptr_cast(&CBaseMonster::TraceAttack) }, - //{ 0x0, "_ZN12CBaseMonster10TakeDamageEP9entvars_sS1_fi", mfunc_ptr_cast(&CBaseMonster::TakeDamage) }, + //{ 0x01D71AA0, "_ZN12CBaseMonster11TraceAttackEP9entvars_sf6VectorP11TraceResulti", mfunc_ptr_cast(&CBaseMonster::TraceAttack) }, + //{ 0x01D70180, "_ZN12CBaseMonster10TakeDamageEP9entvars_sS1_fi", mfunc_ptr_cast(&CBaseMonster::TakeDamage) }, { 0x01D70130, "_ZN12CBaseMonster10TakeHealthEfi", mfunc_ptr_cast(&CBaseMonster::TakeHealth_) }, - //{ 0x0, "_ZN12CBaseMonster6KilledEP9entvars_si", mfunc_ptr_cast(&CBaseMonster::Killed) }, + //{ 0x01D6F9D0, "_ZN12CBaseMonster6KilledEP9entvars_si", mfunc_ptr_cast(&CBaseMonster::Killed_) }, //{ 0x0, "_ZN12CBaseMonster10BloodColorEv", mfunc_ptr_cast(&CBaseMonster::BloodColor) }, //{ 0x0, "_ZN12CBaseMonster7IsAliveEv", mfunc_ptr_cast(&CBaseMonster::IsAlive) }, //{ 0x0, "_ZN12CBaseMonster9ChangeYawEi", mfunc_ptr_cast(&CBaseMonster::ChangeYaw) }, - //{ 0x0, "_ZN12CBaseMonster12HasHumanGibsEv", mfunc_ptr_cast(&CBaseMonster::HasHumanGibs) }, - //{ 0x0, "_ZN12CBaseMonster12HasAlienGibsEv", mfunc_ptr_cast(&CBaseMonster::HasAlienGibs) }, - //{ 0x0, "_ZN12CBaseMonster11FadeMonsterEv", mfunc_ptr_cast(&CBaseMonster::FadeMonster) }, - //{ 0x0, "_ZN12CBaseMonster10GibMonsterEv", mfunc_ptr_cast(&CBaseMonster::GibMonster) }, - //{ 0x0, "_ZN12CBaseMonster16GetDeathActivityEv", mfunc_ptr_cast(&CBaseMonster::GetDeathActivity) }, - //{ 0x0, "_ZN12CBaseMonster10BecomeDeadEv", mfunc_ptr_cast(&CBaseMonster::BecomeDead) }, + //{ 0x01D6F360, "_ZN12CBaseMonster12HasHumanGibsEv", mfunc_ptr_cast(&CBaseMonster::HasHumanGibs) }, + //{ 0x01D6F390, "_ZN12CBaseMonster12HasAlienGibsEv", mfunc_ptr_cast(&CBaseMonster::HasAlienGibs) }, + //{ 0x01D6F3C0, "_ZN12CBaseMonster11FadeMonsterEv", mfunc_ptr_cast(&CBaseMonster::FadeMonster) }, + //{ 0x01D6F4B0, "_ZN12CBaseMonster10GibMonsterEv", mfunc_ptr_cast(&CBaseMonster::GibMonster) }, + //{ 0x01D6F5A0, "_ZN12CBaseMonster16GetDeathActivityEv", mfunc_ptr_cast(&CBaseMonster::GetDeathActivity) }, + { 0x01D6F880, "_ZN12CBaseMonster10BecomeDeadEv", mfunc_ptr_cast(&CBaseMonster::BecomeDead_) }, //{ 0x0, "_ZN12CBaseMonster17ShouldFadeOnDeathEv", mfunc_ptr_cast(&CBaseMonster::ShouldFadeOnDeath) }, //{ 0x0, "_ZN12CBaseMonster13IRelationshipEP11CBaseEntity", mfunc_ptr_cast(&CBaseMonster::IRelationship) }, //{ 0x0, "_ZN12CBaseMonster9PainSoundEv", mfunc_ptr_cast(&CBaseMonster::PainSound) }, //{ 0x0, "_ZN12CBaseMonster13ResetMaxSpeedEv", mfunc_ptr_cast(&CBaseMonster::ResetMaxSpeed) }, //{ 0x0, "_ZN12CBaseMonster13ReportAIStateEv", mfunc_ptr_cast(&CBaseMonster::ReportAIState) }, - //{ 0x0, "_ZN12CBaseMonster15MonsterInitDeadEv", mfunc_ptr_cast(&CBaseMonster::MonsterInitDead) }, + { 0x01D8AC60, "_ZN12CBaseMonster15MonsterInitDeadEv", mfunc_ptr_cast(&CBaseMonster::MonsterInitDead_) }, //{ 0x0, "_ZN12CBaseMonster4LookEi", mfunc_ptr_cast(&CBaseMonster::Look) }, //{ 0x0, "_ZN12CBaseMonster16BestVisibleEnemyEv", mfunc_ptr_cast(&CBaseMonster::BestVisibleEnemy) }, - //{ 0x0, "_ZN12CBaseMonster11FInViewConeEP11CBaseEntity", mfunc_ptr_cast(&CBaseMonster::FInViewCone) }, - //{ 0x0, "_ZN12CBaseMonster11FInViewConeEP6Vector", mfunc_ptr_cast(&CBaseMonster::FInViewCone) }, + //{ 0x01D716D0, "_ZN12CBaseMonster11FInViewConeEP11CBaseEntity", mfunc_ptr_cast(&CBaseMonster::FInViewCone_) }, + //{ 0x01D71790, "_ZN12CBaseMonster11FInViewConeEP6Vector", mfunc_ptr_cast(&CBaseMonster::FInViewCone_) }, //non-virtual func //{ 0x0, "_ZN12CBaseMonster12MakeIdealYawE6Vector", mfunc_ptr_cast(&CBaseMonster::MakeIdealYaw) }, - //{ 0x0, "_ZN12CBaseMonster22GetSmallFlinchActivityEv", mfunc_ptr_cast(&CBaseMonster::GetSmallFlinchActivity) }, - //{ 0x0, "_ZN12CBaseMonster16ShouldGibMonsterEi", mfunc_ptr_cast(&CBaseMonster::ShouldGibMonster) }, - //{ 0x0, "_ZN12CBaseMonster14CallGibMonsterEv", mfunc_ptr_cast(&CBaseMonster::CallGibMonster) }, - //{ 0x0, "_ZN12CBaseMonster15FCheckAITriggerEv", mfunc_ptr_cast(&CBaseMonster::FCheckAITrigger) }, - //{ 0x0, "_ZN12CBaseMonster14DeadTakeDamageEP9entvars_sS1_fi", mfunc_ptr_cast(&CBaseMonster::DeadTakeDamage) }, - //{ 0x0, "_ZN12CBaseMonster11DamageForceEf", mfunc_ptr_cast(&CBaseMonster::DamageForce) }, - //{ 0x0, "_ZN12CBaseMonster12RadiusDamageEP9entvars_sS1_fii", mfunc_ptr_cast(&CBaseMonster::RadiusDamage) }, - //{ 0x0, "_ZN12CBaseMonster12RadiusDamageE6VectorP9entvars_sS2_fii", mfunc_ptr_cast(&CBaseMonster::RadiusDamage) }, - //{ 0x0, "_ZN12CBaseMonster15CorpseFallThinkEv", mfunc_ptr_cast(&CBaseMonster::CorpseFallThink) }, - //{ 0x0, "_ZN12CBaseMonster20CheckTraceHullAttackEfii", mfunc_ptr_cast(&CBaseMonster::CheckTraceHullAttack) }, - //{ 0x0, "_ZN12CBaseMonster20MakeDamageBloodDecalEifP11TraceResultRK6Vector", mfunc_ptr_cast(&CBaseMonster::MakeDamageBloodDecal) }, + //{ 0x01D6F7F0, "_ZN12CBaseMonster22GetSmallFlinchActivityEv", mfunc_ptr_cast(&CBaseMonster::GetSmallFlinchActivity) }, // NOXREF + //{ 0x01D6F8C0, "_ZN12CBaseMonster16ShouldGibMonsterEi", mfunc_ptr_cast(&CBaseMonster::ShouldGibMonster) }, // NOXREF + //{ 0x01D6F8F0, "_ZN12CBaseMonster14CallGibMonsterEv", mfunc_ptr_cast(&CBaseMonster::CallGibMonster) }, + //{ 0x01D8AD20, "_ZN12CBaseMonster15FCheckAITriggerEv", mfunc_ptr_cast(&CBaseMonster::FCheckAITrigger) }, + //{ 0x01D705B0, "_ZN12CBaseMonster14DeadTakeDamageEP9entvars_sS1_fi", mfunc_ptr_cast(&CBaseMonster::DeadTakeDamage) }, + //{ 0x01D707C0, "_ZN12CBaseMonster11DamageForceEf", mfunc_ptr_cast(&CBaseMonster::DamageForce) }, // NOXREF + //{ 0x01D71470, "_ZN12CBaseMonster12RadiusDamageEP9entvars_sS1_fii", mfunc_ptr_cast(&CBaseMonster::RadiusDamage) }, + //{ 0x01D71520, "_ZN12CBaseMonster12RadiusDamageE6VectorP9entvars_sS2_fii", mfunc_ptr_cast(&CBaseMonster::RadiusDamage) }, // NOXREF + //{ 0x0, "_ZN12CBaseMonster13RadiusDamage2E6VectorP9entvars_sS2_fii", mfunc_ptr_cast(&CBaseMonster::RadiusDamage2) }, // NOXREF + //{ 0x01D8AC10, "_ZN12CBaseMonster15CorpseFallThinkEv", mfunc_ptr_cast(&CBaseMonster::CorpseFallThink) }, + //{ 0x01D715D0, "_ZN12CBaseMonster20CheckTraceHullAttackEfii", mfunc_ptr_cast(&CBaseMonster::CheckTraceHullAttack) }, // NOXREF + //{ 0x01D730E0, "_ZN12CBaseMonster20MakeDamageBloodDecalEifP11TraceResultRK6Vector", mfunc_ptr_cast(&CBaseMonster::MakeDamageBloodDecal) }, // NOXREF { 0x01D73240, "_ZN12CBaseMonster10BloodSplatER6VectorS1_ii", mfunc_ptr_cast(&CBaseMonster::BloodSplat) }, - - //{ 0x0, "_Z11RadiusFlash6VectorP9entvars_sS1_fii", (size_t)&RadiusFlash }, + //{ 0x01D70800, "_Z11RadiusFlash6VectorP9entvars_sS1_fii", (size_t)&RadiusFlash }, + //{ 0x0, "_ZL24GetAmountOfPlayerVisible6VectorP11CBaseEntity_constprop_21", (size_t)&GetAmountOfPlayerVisible }, + //{ 0x01D70CA0, "_Z12RadiusDamage6VectorP9entvars_sS1_ffii", (size_t)&RadiusDamage }, + //{ 0x01D711B0, "_Z13RadiusDamage26VectorP9entvars_sS1_ffii", (size_t)&RadiusDamage2 }, + //{ 0x01D72430, "_Z4vstrPf", (size_t)&vstr }, // NOXREF #endif // BaseMonster_Region @@ -608,7 +616,7 @@ FunctionHook g_FunctionHooks[] = { 0x01D21030, "_ZN11CBasePlayer7IsAliveEv", mfunc_ptr_cast(&CBasePlayer::IsAlive_) }, //{ 0x0, "_ZN11CBasePlayer8IsPlayerEv", mfunc_ptr_cast(&CBasePlayer::IsPlayer_) }, //{ 0x0, "_ZN11CBasePlayer11IsNetClientEv", mfunc_ptr_cast(&CBasePlayer::IsNetClient_) }, - //{ 0x0, "_ZN11CBasePlayer6TeamIDEv", mfunc_ptr_cast(&CBasePlayer::TeamID_) }, + //{ 0x01DA6950, "_ZN11CBasePlayer6TeamIDEv", mfunc_ptr_cast(&CBasePlayer::TeamID_) }, //{ 0x01DA9BF0, "_ZN11CBasePlayer12FBecomeProneEv", mfunc_ptr_cast(&CBasePlayer::FBecomeProne_) }, //{ 0x01D20F60, "_ZN11CBasePlayer10BodyTargetERK6Vector", mfunc_ptr_cast(&CBasePlayer::BodyTarget_) }, //{ 0x0, "_ZN11CBasePlayer12IlluminationEv", mfunc_ptr_cast(&CBasePlayer::Illumination_) }, @@ -645,7 +653,7 @@ FunctionHook g_FunctionHooks[] = //{ 0x0, "_ZN11CBasePlayer9DisappearEv", mfunc_ptr_cast(&CBasePlayer::Disappear) }, { 0x01DA15B0, "_ZN11CBasePlayer7MakeVIPEv", mfunc_ptr_cast(&CBasePlayer::MakeVIP) }, //{ 0x0, "_ZN11CBasePlayer12CanPlayerBuyEb", mfunc_ptr_cast(&CBasePlayer::CanPlayerBuy) }, - //{ 0x0, "_ZN11CBasePlayer10SwitchTeamEv", mfunc_ptr_cast(&CBasePlayer::SwitchTeam) }, + //{ 0x01DAB070, "_ZN11CBasePlayer10SwitchTeamEv", mfunc_ptr_cast(&CBasePlayer::SwitchTeam) }, { 0x01DAB820, "_ZN11CBasePlayer12TabulateAmmoEv", mfunc_ptr_cast(&CBasePlayer::TabulateAmmo) }, { 0x01D9B9B0, "_ZN11CBasePlayer4PainEib", mfunc_ptr_cast(&CBasePlayer::Pain) }, { 0x01D9F410, "_ZN11CBasePlayer9IsBombGuyEv", mfunc_ptr_cast(&CBasePlayer::IsBombGuy) }, @@ -745,17 +753,17 @@ FunctionHook g_FunctionHooks[] = //{ 0x0, "_ZN11CBasePlayer20GetCustomDecalFramesEv", mfunc_ptr_cast(&CBasePlayer::GetCustomDecalFrames) }, //{ 0x0, "_ZN11CBasePlayer13InitStatusBarEv", mfunc_ptr_cast(&CBasePlayer::InitStatusBar) }, //{ 0x01DAA270, "_ZN11CBasePlayer15UpdateStatusBarEv", mfunc_ptr_cast(&CBasePlayer::UpdateStatusBar) }, - //{ 0x0, "_ZN11CBasePlayer18StudioEstimateGaitEv", mfunc_ptr_cast(&CBasePlayer::StudioEstimateGait) }, - //{ 0x0, "_ZN11CBasePlayer17StudioPlayerBlendEPiPf", mfunc_ptr_cast(&CBasePlayer::StudioPlayerBlend) }, - //{ 0x0, "_ZN11CBasePlayer19CalculatePitchBlendEv", mfunc_ptr_cast(&CBasePlayer::CalculatePitchBlend) }, - //{ 0x0, "_ZN11CBasePlayer17CalculateYawBlendEv", mfunc_ptr_cast(&CBasePlayer::CalculateYawBlend) }, - //{ 0x0, "_ZN11CBasePlayer17StudioProcessGaitEv", mfunc_ptr_cast(&CBasePlayer::StudioProcessGait) }, + { 0x01DAC0F0, "_ZN11CBasePlayer18StudioEstimateGaitEv", mfunc_ptr_cast(&CBasePlayer::StudioEstimateGait) }, + //{ 0x01DAC400, "_ZN11CBasePlayer17StudioPlayerBlendEPiPf", mfunc_ptr_cast(&CBasePlayer::StudioPlayerBlend) }, // NOXREF + //{ 0x01DAC490, "_ZN11CBasePlayer19CalculatePitchBlendEv", mfunc_ptr_cast(&CBasePlayer::CalculatePitchBlend) }, // NOXREF + { 0x01DAC510, "_ZN11CBasePlayer17CalculateYawBlendEv", mfunc_ptr_cast(&CBasePlayer::CalculateYawBlend) }, + { 0x01DAC640, "_ZN11CBasePlayer17StudioProcessGaitEv", mfunc_ptr_cast(&CBasePlayer::StudioProcessGait) }, //{ 0x0, "_ZN11CBasePlayer14SendHostagePosEv", mfunc_ptr_cast(&CBasePlayer::SendHostagePos) }, { 0x01DA8DE0, "_ZN11CBasePlayer16SendHostageIconsEv", mfunc_ptr_cast(&CBasePlayer::SendHostageIcons) }, - //{ 0x0, "_ZN11CBasePlayer12ResetStaminaEv", mfunc_ptr_cast(&CBasePlayer::ResetStamina) }, - //{ 0x0, "_ZN11CBasePlayer9IsArmoredEi", mfunc_ptr_cast(&CBasePlayer::IsArmored) }, - //{ 0x0, "_ZN11CBasePlayer19ShouldDoLargeFlinchEii", mfunc_ptr_cast(&CBasePlayer::ShouldDoLargeFlinch) }, - //{ 0x0, "_ZN11CBasePlayer20SetPrefsFromUserinfoEPc", mfunc_ptr_cast(&CBasePlayer::SetPrefsFromUserinfo) }, + //{ 0x01DAC7C0, "_ZN11CBasePlayer12ResetStaminaEv", mfunc_ptr_cast(&CBasePlayer::ResetStamina) }, // NOXREF + //{ 0x01DACA10, "_ZN11CBasePlayer9IsArmoredEi", mfunc_ptr_cast(&CBasePlayer::IsArmored) }, // NOXREF + //{ 0x01DACA60, "_ZN11CBasePlayer19ShouldDoLargeFlinchEii", mfunc_ptr_cast(&CBasePlayer::ShouldDoLargeFlinch) }, // NOXREF + { 0x01DACAD0, "_ZN11CBasePlayer20SetPrefsFromUserinfoEPc", mfunc_ptr_cast(&CBasePlayer::SetPrefsFromUserinfo) }, //{ 0x0, "_ZN11CBasePlayer15SendWeatherInfoEv", mfunc_ptr_cast(&CBasePlayer::SendWeatherInfo) }, { 0x01DAB6F0, "_ZN11CBasePlayer21UpdateShieldCrosshairEb", mfunc_ptr_cast(&CBasePlayer::UpdateShieldCrosshair) }, { 0x01DA0DA0, "_ZN11CBasePlayer9HasShieldEv", mfunc_ptr_cast(&CBasePlayer::HasShield) }, @@ -769,38 +777,38 @@ FunctionHook g_FunctionHooks[] = //{ 0x0, "_ZNK11CBasePlayer19IsAutoFollowAllowedEv", mfunc_ptr_cast(&CBasePlayer::IsAutoFollowAllowed) }, //{ 0x0, "_ZN11CBasePlayer17InhibitAutoFollowEf", mfunc_ptr_cast(&CBasePlayer::InhibitAutoFollow) }, //{ 0x0, "_ZN11CBasePlayer15AllowAutoFollowEv", mfunc_ptr_cast(&CBasePlayer::AllowAutoFollow) }, - //{ 0x0, "_ZN11CBasePlayer16ClearAutoBuyDataEv", mfunc_ptr_cast(&CBasePlayer::ClearAutoBuyData) }, - //{ 0x0, "_ZN11CBasePlayer14AddAutoBuyDataEPKc", mfunc_ptr_cast(&CBasePlayer::AddAutoBuyData) }, + //{ 0x01DAD180, "_ZN11CBasePlayer16ClearAutoBuyDataEv", mfunc_ptr_cast(&CBasePlayer::ClearAutoBuyData) }, + { 0x01DAD190, "_ZN11CBasePlayer14AddAutoBuyDataEPKc", mfunc_ptr_cast(&CBasePlayer::AddAutoBuyData) }, //{ 0x01DAD280, "_ZN11CBasePlayer7AutoBuyEv", mfunc_ptr_cast(&CBasePlayer::AutoBuy) }, //{ 0x01DAD0D0, "_ZN11CBasePlayer13ClientCommandEPKcS1_S1_S1_", mfunc_ptr_cast(&CBasePlayer::ClientCommand) }, - //{ 0x0, "_ZN11CBasePlayer23PrioritizeAutoBuyStringEPcPKc", mfunc_ptr_cast(&CBasePlayer::PrioritizeAutoBuyString) }, - //{ 0x0, "_ZN11CBasePlayer27PickPrimaryCareerTaskWeaponEv", mfunc_ptr_cast(&CBasePlayer::PickPrimaryCareerTaskWeapon) }, - //{ 0x0, "_ZN11CBasePlayer29PickSecondaryCareerTaskWeaponEv", mfunc_ptr_cast(&CBasePlayer::PickSecondaryCareerTaskWeapon) }, - //{ 0x0, "_ZN11CBasePlayer25PickFlashKillWeaponStringEv", mfunc_ptr_cast(&CBasePlayer::PickFlashKillWeaponString) }, - //{ 0x0, "_ZN11CBasePlayer27PickGrenadeKillWeaponStringEv", mfunc_ptr_cast(&CBasePlayer::PickGrenadeKillWeaponString) }, - //{ 0x0, "_ZN11CBasePlayer27ShouldExecuteAutoBuyCommandEPK17AutoBuyInfoStructbb", mfunc_ptr_cast(&CBasePlayer::ShouldExecuteAutoBuyCommand) }, - //{ 0x01DADFF0, "_ZN11CBasePlayer28PostAutoBuyCommandProcessingEPK17AutoBuyInfoStructRbS3_", mfunc_ptr_cast(&CBasePlayer::PostAutoBuyCommandProcessing) }, - //{ 0x01DADE20, "_ZN11CBasePlayer18ParseAutoBuyStringEPKcRbS2_", mfunc_ptr_cast(&CBasePlayer::ParseAutoBuyString) }, + { 0x01DADD00, "_ZN11CBasePlayer23PrioritizeAutoBuyStringEPcPKc", mfunc_ptr_cast(&CBasePlayer::PrioritizeAutoBuyString) }, + //{ 0x01DAD590, "_ZN11CBasePlayer27PickPrimaryCareerTaskWeaponEv", mfunc_ptr_cast(&CBasePlayer::PickPrimaryCareerTaskWeapon) }, + //{ 0x01DAD930, "_ZN11CBasePlayer29PickSecondaryCareerTaskWeaponEv", mfunc_ptr_cast(&CBasePlayer::PickSecondaryCareerTaskWeapon) }, + //{ 0x01DADC60, "_ZN11CBasePlayer25PickFlashKillWeaponStringEv", mfunc_ptr_cast(&CBasePlayer::PickFlashKillWeaponString) }, // NOXREF + //{ 0x01DADCC0, "_ZN11CBasePlayer27PickGrenadeKillWeaponStringEv", mfunc_ptr_cast(&CBasePlayer::PickGrenadeKillWeaponString) }, // NOXREF + //{ 0x01DADF70, "_ZN11CBasePlayer27ShouldExecuteAutoBuyCommandEPK17AutoBuyInfoStructbb", mfunc_ptr_cast(&CBasePlayer::ShouldExecuteAutoBuyCommand) }, // NOXREF + { 0x01DADFF0, "_ZN11CBasePlayer28PostAutoBuyCommandProcessingEPK17AutoBuyInfoStructRbS3_", mfunc_ptr_cast(&CBasePlayer::PostAutoBuyCommandProcessing) }, + { 0x01DADE20, "_ZN11CBasePlayer18ParseAutoBuyStringEPKcRbS2_", mfunc_ptr_cast(&CBasePlayer::ParseAutoBuyString) }, //{ 0x01DADFB0, "_ZN11CBasePlayer21GetAutoBuyCommandInfoEPKc", mfunc_ptr_cast(&CBasePlayer::GetAutoBuyCommandInfo) }, // NOXREF - //{ 0x0, "_ZN11CBasePlayer13InitRebuyDataEPKc", mfunc_ptr_cast(&CBasePlayer::InitRebuyData) }, - //{ 0x0, "_ZN11CBasePlayer16BuildRebuyStructEv", mfunc_ptr_cast(&CBasePlayer::BuildRebuyStruct) }, - //{ 0x0, "_ZN11CBasePlayer5RebuyEv", mfunc_ptr_cast(&CBasePlayer::Rebuy) }, - //{ 0x0, "_ZN11CBasePlayer18RebuyPrimaryWeaponEv", mfunc_ptr_cast(&CBasePlayer::RebuyPrimaryWeapon) }, - //{ 0x0, "_ZN11CBasePlayer16RebuyPrimaryAmmoEv", mfunc_ptr_cast(&CBasePlayer::RebuyPrimaryAmmo) }, - //{ 0x0, "_ZN11CBasePlayer20RebuySecondaryWeaponEv", mfunc_ptr_cast(&CBasePlayer::RebuySecondaryWeapon) }, - //{ 0x0, "_ZN11CBasePlayer18RebuySecondaryAmmoEv", mfunc_ptr_cast(&CBasePlayer::RebuySecondaryAmmo) }, - //{ 0x0, "_ZN11CBasePlayer14RebuyHEGrenadeEv", mfunc_ptr_cast(&CBasePlayer::RebuyHEGrenade) }, - //{ 0x0, "_ZN11CBasePlayer14RebuyFlashbangEv", mfunc_ptr_cast(&CBasePlayer::RebuyFlashbang) }, - //{ 0x0, "_ZN11CBasePlayer17RebuySmokeGrenadeEv", mfunc_ptr_cast(&CBasePlayer::RebuySmokeGrenade) }, - //{ 0x0, "_ZN11CBasePlayer12RebuyDefuserEv", mfunc_ptr_cast(&CBasePlayer::RebuyDefuser) }, - //{ 0x0, "_ZN11CBasePlayer16RebuyNightVisionEv", mfunc_ptr_cast(&CBasePlayer::RebuyNightVision) }, - //{ 0x0, "_ZN11CBasePlayer10RebuyArmorEv", mfunc_ptr_cast(&CBasePlayer::RebuyArmor) }, - //{ 0x01DAEAB0, "_ZN11CBasePlayer14UpdateLocationEb", mfunc_ptr_cast(&CBasePlayer::UpdateLocation) }, + { 0x01DAD1F0, "_ZN11CBasePlayer13InitRebuyDataEPKc", mfunc_ptr_cast(&CBasePlayer::InitRebuyData) }, + { 0x01DAE0A0, "_ZN11CBasePlayer16BuildRebuyStructEv", mfunc_ptr_cast(&CBasePlayer::BuildRebuyStruct) }, + { 0x01DAE260, "_ZN11CBasePlayer5RebuyEv", mfunc_ptr_cast(&CBasePlayer::Rebuy) }, + //{ 0x01DAE580, "_ZN11CBasePlayer18RebuyPrimaryWeaponEv", mfunc_ptr_cast(&CBasePlayer::RebuyPrimaryWeapon) }, // NOXREF + //{ 0x01DAE5E0, "_ZN11CBasePlayer16RebuyPrimaryAmmoEv", mfunc_ptr_cast(&CBasePlayer::RebuyPrimaryAmmo) }, // NOXREF + //{ 0x01DAE650, "_ZN11CBasePlayer20RebuySecondaryWeaponEv", mfunc_ptr_cast(&CBasePlayer::RebuySecondaryWeapon) }, // NOXREF + //{ 0x01DAE6B0, "_ZN11CBasePlayer18RebuySecondaryAmmoEv", mfunc_ptr_cast(&CBasePlayer::RebuySecondaryAmmo) }, + //{ 0x01DAE720, "_ZN11CBasePlayer14RebuyHEGrenadeEv", mfunc_ptr_cast(&CBasePlayer::RebuyHEGrenade) }, // NOXREF + //{ 0x01DAE7C0, "_ZN11CBasePlayer14RebuyFlashbangEv", mfunc_ptr_cast(&CBasePlayer::RebuyFlashbang) }, // NOXREF + //{ 0x01DAE860, "_ZN11CBasePlayer17RebuySmokeGrenadeEv", mfunc_ptr_cast(&CBasePlayer::RebuySmokeGrenade) }, // NOXREF + { 0x01DAE900, "_ZN11CBasePlayer12RebuyDefuserEv", mfunc_ptr_cast(&CBasePlayer::RebuyDefuser) }, + { 0x01DAE960, "_ZN11CBasePlayer16RebuyNightVisionEv", mfunc_ptr_cast(&CBasePlayer::RebuyNightVision) }, + { 0x01DAE9C0, "_ZN11CBasePlayer10RebuyArmorEv", mfunc_ptr_cast(&CBasePlayer::RebuyArmor) }, + { 0x01DAEAB0, "_ZN11CBasePlayer14UpdateLocationEb", mfunc_ptr_cast(&CBasePlayer::UpdateLocation) }, //{ 0x0, "_ZN11CBasePlayer23SetObserverAutoDirectorEb", mfunc_ptr_cast(&CBasePlayer::SetObserverAutoDirector) }, - //{ 0x0, "_ZN11CBasePlayer17IsObservingPlayerEPS_", mfunc_ptr_cast(&CBasePlayer::IsObservingPlayer) }, + { 0x01DAEA40, "_ZN11CBasePlayer17IsObservingPlayerEPS_", mfunc_ptr_cast(&CBasePlayer::IsObservingPlayer) }, //{ 0x0, "_ZNK11CBasePlayer22CanSwitchObserverModesEv", mfunc_ptr_cast(&CBasePlayer::CanSwitchObserverModes) }, //{ 0x0, "_ZN11CBasePlayer7IntenseEv", mfunc_ptr_cast(&CBasePlayer::Intense) }, - //{ 0x0, "_Z16LinkUserMessagesv", (size_t)&LinkUserMessages }, + //{ 0x01D9AB20, "_Z16LinkUserMessagesv", (size_t)&LinkUserMessages }, { 0x01D9B0F0, "_Z18WriteSigonMessagesv", (size_t)&WriteSigonMessages }, { 0x01D9B280, "_Z14SendItemStatusP11CBasePlayer", (size_t)&SendItemStatus }, { 0x01D9D8A0, "_ZL14GetCSModelNamei", (size_t)&GetCSModelName }, @@ -822,15 +830,16 @@ FunctionHook g_FunctionHooks[] = #endif // _WIN32 //{ 0x01DA6D60, "_Z17FindEntityForwardP11CBaseEntity", (size_t)&FindEntityForward }, // NOXREF - //{ 0x0, "_Z14GetPlayerPitchPK7edict_s", (size_t)&GetPlayerPitch }, - //{ 0x0, "_Z21GetPlayerGaitsequencePK7edict_s", (size_t)&GetPlayerGaitsequence }, - //{ 0x0, "_Z12GetPlayerYawPK7edict_s", (size_t)&GetPlayerYaw }, - //{ 0x0, "_Z20IsPrimaryWeaponClassi", (size_t)&IsPrimaryWeaponClass }, - //{ 0x0, "_Z17IsPrimaryWeaponIdi", (size_t)&IsPrimaryWeaponId }, - //{ 0x0, "_Z22IsSecondaryWeaponClassi", (size_t)&IsSecondaryWeaponClass }, - //{ 0x0, "_Z19IsSecondaryWeaponIdi", (size_t)&IsSecondaryWeaponId }, - //{ 0x0, "_Z22GetWeaponAliasFromNamePKc", (size_t)&GetWeaponAliasFromName }, - //{ 0x0, "_Z22CurrentWeaponSatisfiesP17CBasePlayerWeaponii", (size_t)&CurrentWeaponSatisfies }, + { 0x01DAC7E0, "_Z14GetPlayerPitchPK7edict_s", (size_t)&GetPlayerPitch }, + { 0x01DAC830, "_Z12GetPlayerYawPK7edict_s", (size_t)&GetPlayerYaw }, + { 0x01DAC880, "_Z21GetPlayerGaitsequencePK7edict_s", (size_t)&GetPlayerGaitsequence }, + //{ 0x01DAD120, "_Z26GetBuyStringForWeaponClassi", (size_t)&GetBuyStringForWeaponClass }, // NOXREF + //{ 0x01DAD470, "_Z20IsPrimaryWeaponClassi", (size_t)&IsPrimaryWeaponClass }, // NOXREF + //{ 0x01DAD490, "_Z17IsPrimaryWeaponIdi", (size_t)&IsPrimaryWeaponId }, // NOXREF + //{ 0x01DAD4C0, "_Z22IsSecondaryWeaponClassi", (size_t)&IsSecondaryWeaponClass }, // NOXREF + //{ 0x01DAD4D0, "_Z19IsSecondaryWeaponIdi", (size_t)&IsSecondaryWeaponId }, // NOXREF + //{ 0x01DAD500, "_Z22GetWeaponAliasFromNamePKc", (size_t)&GetWeaponAliasFromName }, // NOXREF + //{ 0x01DAD520, "_Z22CurrentWeaponSatisfiesP17CBasePlayerWeaponii", (size_t)&CurrentWeaponSatisfies }, // NOXREF //CWShield //virtual func //{ 0x0, "_ZN8CWShield5SpawnEv", mfunc_ptr_cast(&CWShield::Spawn) }, @@ -849,25 +858,25 @@ FunctionHook g_FunctionHooks[] = //{ 0x01DA6C00, "_ZN11CBloodSplat5SprayEv", mfunc_ptr_cast(&CBloodSplat::Spray) }, // NOXREF //CDeadHEV //virtual func - //{ 0x0, "_ZN8CDeadHEV5SpawnEv", mfunc_ptr_cast(&CDeadHEV::Spawn_) }, - //{ 0x0, "_ZN8CDeadHEV8ClassifyEv", mfunc_ptr_cast(&CDeadHEV::Classify_) }, - //{ 0x01DABA40, "_ZN8CDeadHEV8KeyValueEP14KeyValueData_s", mfunc_ptr_cast(&CDeadHEV::KeyValue_) }, + { 0x01DABAF0, "_ZN8CDeadHEV5SpawnEv", mfunc_ptr_cast(&CDeadHEV::Spawn_) }, + { 0x01DABAE0, "_ZN8CDeadHEV8ClassifyEv", mfunc_ptr_cast(&CDeadHEV::Classify_) }, + { 0x01DABA40, "_ZN8CDeadHEV8KeyValueEP14KeyValueData_s", mfunc_ptr_cast(&CDeadHEV::KeyValue_) }, //CStripWeapons //virtual func - //{ 0x0, "_ZN13CStripWeapons3UseEP11CBaseEntityS1_8USE_TYPEf", mfunc_ptr_cast(&CStripWeapons::Use_) }, + { 0x01DABC10, "_ZN13CStripWeapons3UseEP11CBaseEntityS1_8USE_TYPEf", mfunc_ptr_cast(&CStripWeapons::Use_) }, //CRevertSaved //virtual func - //{ 0x0, "_ZN12CRevertSaved8KeyValueEP14KeyValueData_s", mfunc_ptr_cast(&CRevertSaved::KeyValue_) }, - //{ 0x0, "_ZN12CRevertSaved4SaveER5CSave", mfunc_ptr_cast(&CRevertSaved::Save_) }, - //{ 0x0, "_ZN12CRevertSaved7RestoreER8CRestore", mfunc_ptr_cast(&CRevertSaved::Restore_) }, - //{ 0x0, "_ZN12CRevertSaved3UseEP11CBaseEntityS1_8USE_TYPEf", mfunc_ptr_cast(&CRevertSaved::Use_) }, + { 0x01DABD20, "_ZN12CRevertSaved8KeyValueEP14KeyValueData_s", mfunc_ptr_cast(&CRevertSaved::KeyValue_) }, + { 0x01DABCC0, "_ZN12CRevertSaved4SaveER5CSave", mfunc_ptr_cast(&CRevertSaved::Save_) }, + { 0x01DABCF0, "_ZN12CRevertSaved7RestoreER8CRestore", mfunc_ptr_cast(&CRevertSaved::Restore_) }, + { 0x01DABE10, "_ZN12CRevertSaved3UseEP11CBaseEntityS1_8USE_TYPEf", mfunc_ptr_cast(&CRevertSaved::Use_) }, //non-virtual func - //{ 0x0, "_ZN12CRevertSaved12MessageThinkEv", mfunc_ptr_cast(&CRevertSaved::MessageThink) }, - //{ 0x0, "_ZN12CRevertSaved9LoadThinkEv", mfunc_ptr_cast(&CRevertSaved::LoadThink) }, + { 0x01DABE70, "_ZN12CRevertSaved12MessageThinkEv", mfunc_ptr_cast(&CRevertSaved::MessageThink) }, + { 0x01DABEF0, "_ZN12CRevertSaved9LoadThinkEv", mfunc_ptr_cast(&CRevertSaved::LoadThink) }, //CInfoIntermission //virtual func - //{ 0x0, "_ZN17CInfoIntermission5SpawnEv", mfunc_ptr_cast(&CInfoIntermission::Spawn_) }, - //{ 0x0, "_ZN17CInfoIntermission5ThinkEv", mfunc_ptr_cast(&CInfoIntermission::Think_) }, + { 0x01DABF20, "_ZN17CInfoIntermission5SpawnEv", mfunc_ptr_cast(&CInfoIntermission::Spawn_) }, + { 0x01DABF90, "_ZN17CInfoIntermission5ThinkEv", mfunc_ptr_cast(&CInfoIntermission::Think_) }, //linked object //{ 0x01D9B1F0, "player", (size_t)&player }, //{ 0x01DAC0A0, "info_intermission", (size_t)&info_intermission }, @@ -1017,7 +1026,7 @@ FunctionHook g_FunctionHooks[] = //{ 0x0, "_ZN11CGibShooter4SaveER5CSave", mfunc_ptr_cast(&CGibShooter::Save_) }, //{ 0x0, "_ZN11CGibShooter7RestoreER8CRestore", mfunc_ptr_cast(&CGibShooter::Restore_) }, //{ 0x0, "_ZN11CGibShooter3UseEP11CBaseEntityS1_8USE_TYPEf", mfunc_ptr_cast(&CGibShooter::Use_) }, - //{ 0x0, "_ZN11CGibShooter9CreateGibEv", mfunc_ptr_cast(&CGibShooter::CreateGib_) }, + //{ 0x01D79E20, "_ZN11CGibShooter9CreateGibEv", mfunc_ptr_cast(&CGibShooter::CreateGib_) }, //non-virtual func //{ 0x0, "_ZN11CGibShooter10ShootThinkEv", mfunc_ptr_cast(&CGibShooter::ShootThink) }, //CEnvShooter @@ -1289,6 +1298,7 @@ FunctionHook g_FunctionHooks[] = //{ 0x0, "_ZN12CFuncVehicle9StopSoundEv", mfunc_ptr_cast(&CFuncVehicle::StopSound) }, //{ 0x0, "_ZN12CFuncVehicle11UpdateSoundEv", mfunc_ptr_cast(&CFuncVehicle::UpdateSound) }, //{ 0x0, "_ZN12CFuncVehicle8InstanceEP7edict_s", mfunc_ptr_cast(&CFuncVehicle::Instance) }, + //{ 0x0, "", (size_t)&FixupAngles2 }, // NOXREF //CFuncVehicleControls //virtual func //{ 0x0, "_ZN20CFuncVehicleControls5SpawnEv", mfunc_ptr_cast(&CFuncVehicleControls::Spawn) }, @@ -1386,7 +1396,7 @@ FunctionHook g_FunctionHooks[] = //{ 0x0, "_ZN10CBreakable18ExplosionMagnitudeEv", mfunc_ptr_cast(&CBreakable::ExplosionMagnitude) }, // NOXREF //{ 0x0, "_ZN10CBreakable21ExplosionSetMagnitudeEi", mfunc_ptr_cast(&CBreakable::ExplosionSetMagnitude) }, // NOXREF //{ 0x0, "_ZN10CBreakable21MaterialSoundPrecacheE9Materials", mfunc_ptr_cast(&CBreakable::MaterialSoundPrecache) }, - //{ 0x0, "_ZN10CBreakable19MaterialSoundRandomEP7edict_s9Materialsf", mfunc_ptr_cast(&CBreakable::MaterialSoundRandom) }, + //{ 0x01D7C710, "_ZN10CBreakable19MaterialSoundRandomEP7edict_s9Materialsf", mfunc_ptr_cast(&CBreakable::MaterialSoundRandom) }, //{ 0x0, "_ZN10CBreakable17MaterialSoundListE9MaterialsRi", mfunc_ptr_cast(&CBreakable::MaterialSoundList) }, //CPushable //virtual func @@ -2162,7 +2172,7 @@ FunctionHook g_FunctionHooks[] = //{ 0x0, "_ZN6CGraph10AllocNodesEv", mfunc_ptr_cast(&CGraph::AllocNodes) }, //{ 0x0, "_ZN6CGraph12CheckNODFileEPc", mfunc_ptr_cast(&CGraph::CheckNODFile) }, //{ 0x0, "_ZN6CGraph10FLoadGraphEPc", mfunc_ptr_cast(&CGraph::FLoadGraph) }, - //{ 0x0, "_ZN6CGraph17FSetGraphPointersEv", mfunc_ptr_cast(&CGraph::FSetGraphPointers) }, + //{ 0x01D8ABB0, "_ZN6CGraph17FSetGraphPointersEv", mfunc_ptr_cast(&CGraph::FSetGraphPointers) }, //{ 0x0, "_ZN6CGraph19ShowNodeConnectionsEi", mfunc_ptr_cast(&CGraph::ShowNodeConnections) }, //{ 0x0, "_ZN6CGraph15FindNearestNodeERK6VectorP11CBaseEntity", mfunc_ptr_cast(&CGraph::FindNearestNode) }, //{ 0x0, "_ZN6CGraph15FindNearestNodeERK6Vectori", mfunc_ptr_cast(&CGraph::FindNearestNode) }, @@ -2565,9 +2575,9 @@ FunctionHook g_FunctionHooks[] = //{ 0x0, "_Z15EndRoundMessagePKci", (size_t)&EndRoundMessage }, //{ 0x01D8BD80, "_ZL18ReadMultiplayCvarsP18CHalfLifeMultiplay", (size_t)&ReadMultiplayCvars }, //{ 0x0, "_Z15DestroyMapCycleP10mapcycle_s", (size_t)&DestroyMapCycle }, - //{ 0x0, "_Z15MP_COM_GetTokenv", (size_t)&MP_COM_GetToken }, - //{ 0x0, "_Z12MP_COM_ParsePc", (size_t)&MP_COM_Parse }, - //{ 0x0, "_Z19MP_COM_TokenWaitingPc", (size_t)&MP_COM_TokenWaiting }, + { 0x01D926B0, "_Z15MP_COM_GetTokenv", (size_t)&MP_COM_GetToken }, + { 0x01D926C0, "_Z12MP_COM_ParsePc", (size_t)&MP_COM_Parse }, + //{ 0x01D927A0, "_Z19MP_COM_TokenWaitingPc", (size_t)&MP_COM_TokenWaiting }, // NOXREF //{ 0x0, "_Z18ReloadMapCycleFilePcP10mapcycle_s", (size_t)&ReloadMapCycleFile }, //{ 0x0, "_Z12CountPlayersv", (size_t)&CountPlayers }, //{ 0x0, "_Z20ExtractCommandStringPcS_", (size_t)&ExtractCommandString }, @@ -3406,7 +3416,7 @@ FunctionHook g_FunctionHooks[] = { 0x01D5A9A0, "_Z15GetSequenceInfoPvP9entvars_sPfS2_", (size_t)&GetSequenceInfo }, { 0x01D5AA60, "_Z16GetSequenceFlagsPvP9entvars_s", (size_t)&GetSequenceFlags }, //{ 0x0, "_Z17GetAnimationEventPvP9entvars_sP14MonsterEvent_tffi", (size_t)&GetAnimationEvent }, - //{ 0x0, "_Z13SetControllerPvP9entvars_sif", (size_t)&SetController }, + //{ 0x01D5ABF0, "_Z13SetControllerPvP9entvars_sif", (size_t)&SetController }, //{ 0x0, "_Z11SetBlendingPvP9entvars_sif", (size_t)&SetBlending }, //{ 0x0, "_Z14FindTransitionPviiPi", (size_t)&FindTransition }, //{ 0x0, "_Z12SetBodygroupPvP9entvars_sii", (size_t)&SetBodygroup }, @@ -3916,7 +3926,7 @@ FunctionHook g_FunctionHooks[] = //{ 0x0, "_ZN9HuntState13ClearHuntAreaEv", mfunc_ptr_cast(&HuntState::ClearHuntArea) }, // NOXREF //AttackState //virtual func - //{ 0x0, "_ZN11AttackState7OnEnterEP6CCSBot", mfunc_ptr_cast(&AttackState::OnEnter) }, + //{ 0x01D10960, "_ZN11AttackState7OnEnterEP6CCSBot", mfunc_ptr_cast(&AttackState::OnEnter) }, //{ 0x0, "_ZN11AttackState8OnUpdateEP6CCSBot", mfunc_ptr_cast(&AttackState::OnUpdate) }, //{ 0x0, "_ZN11AttackState6OnExitEP6CCSBot", mfunc_ptr_cast(&AttackState::OnExit) }, //{ 0x0, "_ZNK11AttackState7GetNameEv", mfunc_ptr_cast(&AttackState::GetName) }, @@ -4270,13 +4280,6 @@ FunctionHook g_FunctionHooks[] = #endif // CS_Init_Region -#ifndef Main_Region - - //{ 0x01D80630, "_Z11GameDLLInitv", (size_t)&GameDLLInit }, - //{ 0x0, "_Z12GetSkillCvarPc", (size_t)&GetSkillCvar }, //NOXREF - -#endif // Main_Region - #ifndef H_Region //AI @@ -4586,7 +4589,7 @@ FunctionHook g_FunctionHooks[] = //{ 0x0, "_ZNK10BotProfile14GetAttackDelayEv", mfunc_ptr_cast(&BotProfile::GetAttackDelay) }, // NOXREF //{ 0x0, "_ZNK10BotProfile12GetVoiceBankEv", mfunc_ptr_cast(&BotProfile::GetVoiceBank) }, // NOXREF - //{ 0x0, "_ZNK10BotProfile14IsValidForTeamE18BotProfileTeamType", mfunc_ptr_cast(&BotProfile::IsValidForTeam) }, + { 0x01D34E90, "_ZNK10BotProfile14IsValidForTeamE18BotProfileTeamType", mfunc_ptr_cast(&BotProfile::IsValidForTeam) }, //{ 0x0, "_ZNK10BotProfile15PrefersSilencerEv", mfunc_ptr_cast(&BotProfile::PrefersSilencer) }, // NOXREF //{ 0x0, "_ZN10BotProfile7InheritEPKS_S1_", mfunc_ptr_cast(&BotProfile::Inherit) }, //BotProfileManager @@ -4624,6 +4627,12 @@ FunctionHook g_FunctionHooks[] = #endif // VoiceManager_Region +#ifndef Vector_Region + + { 0x01D71160, "_ZN8Vector2D16NormalizeInPlaceEv", mfunc_ptr_cast(&Vector2D::NormalizeInPlace) }, + +#endif // Vector_Region + #ifndef Nav_Region //Nav_File @@ -5101,7 +5110,7 @@ FunctionHook g_FunctionHooks[] = //{ 0x0, "_ZNK8CHostage8IsAtHomeEv", mfunc_ptr_cast(&CHostage::IsAtHome) }, //{ 0x0, "_ZNK8CHostage15GetHomePositionEv", mfunc_ptr_cast(&CHostage::GetHomePosition) }, //CHostageManager - //{ 0x0, "_Z21Hostage_RegisterCVarsv", (size_t)&Hostage_RegisterCVars }, + //{ 0x01D4EE20, "_Z21Hostage_RegisterCVarsv", (size_t)&Hostage_RegisterCVars }, // NOXREF //{ 0x01D4EE40, "_Z21InstallHostageManagerv", (size_t)&InstallHostageManager }, //{ 0x0, "_ZN15CHostageManager14ServerActivateEv", mfunc_ptr_cast(&CHostageManager::ServerActivate) }, @@ -5161,6 +5170,8 @@ AddressRef g_FunctionRefs[] = { 0x01D2EDD0, "_ZN6CCSBot16UpdateLookAnglesEv", (size_t)&pCCSBot__UpdateLookAngles }, { 0x01D2D9B0, "_ZN6CCSBot6UpdateEv", (size_t)&pCCSBot__Update }, + { 0x01D68840, "_Z13ClientCommandP7edict_s", (size_t)&pClientCommand }, + #endif // Function_References_Region { NULL, NULL, NULL } }; @@ -5203,13 +5214,14 @@ AddressRef g_DataRefs[] = { 0x01E76568, "giAmmoIndex", (size_t)&pgiAmmoIndex }, { 0x01E75EC4, "g_sModelIndexRadio", (size_t)&pg_sModelIndexRadio }, - { 0x01E75EA8, "gMultiDamage", (size_t)&pgMultiDamage }, + { 0x01E75EB8, "gMultiDamage", (size_t)&pgMultiDamage }, { 0x01E29880, "s_iBeamSprite", (size_t)&ps_iBeamSprite }, { 0x01E29480, "cosTable", (size_t)&pcosTable }, { 0x01E61E4C, "WorldGraph", (size_t)&pWorldGraph }, { 0x01E61B98, "g_pGameRules", (size_t)&pg_pGameRules }, { 0x01E62560, "g_pMPGameRules", (size_t)&pg_pMPGameRules }, + { 0x01E61E70, "mp_com_token", (size_t)&pmp_com_token }, { 0x01E0B0B0, "weaponAliasInfo", (size_t)&pweaponAliasInfo }, { 0x01E0B1E8, "weaponBuyAliasInfo", (size_t)&pweaponBuyAliasInfo }, @@ -5249,6 +5261,7 @@ AddressRef g_DataRefs[] = { 0x01E75CF8, "glSeed", (size_t)&pglSeed }, { 0x01E21598, "seed_table", (size_t)&pseed_table }, { 0x01E21998, "gEntvarsDescription", (size_t)&pgEntvarsDescription }, + //{ 0x0, "gGlobalEntitySaveData", (size_t)&pgGlobalEntitySaveData }, { 0x01E7656C, "g_pBodyQueueHead", (size_t)&pg_pBodyQueueHead }, { 0x01E76570, "gGlobalState", (size_t)&pgGlobalState }, { 0x01E22C50, "gDecals", (size_t)&pgDecals }, @@ -5278,7 +5291,7 @@ AddressRef g_DataRefs[] = //{ 0x0, "gmsgDeathMsg", (size_t)&pgmsgDeathMsg }, { 0x01E635EC, "gmsgScoreAttrib", (size_t)&pgmsgScoreAttrib }, { 0x01E635F0, "gmsgScoreInfo", (size_t)&pgmsgScoreInfo }, - //{ 0x0, "gmsgTeamInfo", (size_t)&pgmsgTeamInfo }, + { 0x01E635F4, "gmsgTeamInfo", (size_t)&pgmsgTeamInfo }, //{ 0x0, "gmsgTeamScore", (size_t)&pgmsgTeamScore }, //{ 0x0, "gmsgGameMode", (size_t)&pgmsgGameMode }, //{ 0x0, "gmsgMOTD", (size_t)&pgmsgMOTD }, @@ -5329,7 +5342,7 @@ AddressRef g_DataRefs[] = { 0x01E636B8, "gmsgBotVoice", (size_t)&pgmsgBotVoice }, { 0x01E636BC, "gmsgBuyClose", (size_t)&pgmsgBuyClose }, { 0x01E636C0, "gmsgItemStatus", (size_t)&pgmsgItemStatus }, - //{ 0x0, "gmsgLocation", (size_t)&pgmsgLocation }, + { 0x01E636C4, "gmsgLocation", (size_t)&pgmsgLocation }, { 0x01E636C8, "gmsgSpecHealth2", (size_t)&pgmsgSpecHealth2 }, { 0x01E636CC, "gmsgBarTime2", (size_t)&pgmsgBarTime2 }, { 0x01E636D0, "gmsgBotProgress", (size_t)&pgmsgBotProgress }, @@ -5506,65 +5519,71 @@ AddressRef g_DataRefs[] = //{ 0x0, "_ZN10CBreakable12pSoundsGlassE", mfunc_ptr_cast(&CBreakable::ppSoundsGlass) }, //{ 0x0, "_ZN9CPushable12m_soundNamesE", mfunc_ptr_cast(&CPushable::pm_soundNames) }, - { 0x01E1BE38, "_ZN6CLight10m_SaveDataE", mfunc_ptr_cast(&CLight::m_SaveData) }, - { 0x01E1BB00, "_ZN11CWallHealth10m_SaveDataE", mfunc_ptr_cast(&CWallHealth::m_SaveData) }, - { 0x01E1B850, "_ZN9CRecharge10m_SaveDataE", mfunc_ptr_cast(&CRecharge::m_SaveData) }, - //{ 0x0, "_ZN16CFuncMortarField10m_SaveDataE", mfunc_ptr_cast(&CFuncMortarField::m_SaveData) }, - //{ 0x0, "_ZN13CEnvExplosion10m_SaveDataE", mfunc_ptr_cast(&CEnvExplosion::m_SaveData) }, - //{ 0x0, "_ZN13CFuncRotating10m_SaveDataE", mfunc_ptr_cast(&CFuncRotating::m_SaveData) }, - //{ 0x0, "_ZN9CPendulum10m_SaveDataE", mfunc_ptr_cast(&CPendulum::m_SaveData) }, - //{ 0x0, "_ZN9CBaseDoor10m_SaveDataE", mfunc_ptr_cast(&CBaseDoor::m_SaveData) }, - //{ 0x0, "_ZN14CMomentaryDoor10m_SaveDataE", mfunc_ptr_cast(&CMomentaryDoor::m_SaveData) }, + { 0x01E1E00C, "_ZN8CDeadHEV9m_szPosesE", mfunc_ptr_cast(&CDeadHEV::pm_szPoses) }, - //{ 0x0, "_ZN10CBreakable10m_SaveDataE", mfunc_ptr_cast(&CBreakable::m_SaveData) }, - //{ 0x0, "_ZN9CPushable10m_SaveDataE", mfunc_ptr_cast(&CPushable::m_SaveData) }, - //{ 0x0, "_ZN9CFuncTank10m_SaveDataE", mfunc_ptr_cast(&CFuncTank::m_SaveData) }, - //{ 0x0, "_ZN14CFuncTankLaser10m_SaveDataE", mfunc_ptr_cast(&CFuncTankLaser::m_SaveData) }, - //{ 0x0, "_ZN17CFuncTankControls10m_SaveDataE", mfunc_ptr_cast(&CFuncTankControls::m_SaveData) }, - //{ 0x0, "_ZN12CFuncVehicle10m_SaveDataE", mfunc_ptr_cast(&CFuncVehicle::m_SaveData) }, - //{ 0x0, "_ZN11CPathCorner10m_SaveDataE", mfunc_ptr_cast(&CPathCorner::m_SaveData) }, - //{ 0x0, "_ZN10CPathTrack10m_SaveDataE", mfunc_ptr_cast(&CPathTrack::m_SaveData) }, - //{ 0x0, "_ZN12CRevertSaved10m_SaveDataE", mfunc_ptr_cast(&CRevertSaved::m_SaveData) }, - //{ 0x0, "_ZN11CRuleEntity10m_SaveDataE", mfunc_ptr_cast(&CRuleEntity::m_SaveData) }, - //{ 0x0, "_ZN9CGameText10m_SaveDataE", mfunc_ptr_cast(&CGameText::m_SaveData) }, - //{ 0x0, "_ZN15CGamePlayerZone10m_SaveDataE", mfunc_ptr_cast(&CGamePlayerZone::m_SaveData) }, - - //{ 0x0, "_ZN17CFrictionModifier10m_SaveDataE", mfunc_ptr_cast(&CFrictionModifier::m_SaveData) }, - //{ 0x0, "_ZN12CAutoTrigger10m_SaveDataE", mfunc_ptr_cast(&CAutoTrigger::m_SaveData) }, - //{ 0x0, "_ZN13CTriggerRelay10m_SaveDataE", mfunc_ptr_cast(&CTriggerRelay::m_SaveData) }, - //{ 0x0, "_ZN13CMultiManager10m_SaveDataE", mfunc_ptr_cast(&CMultiManager::m_SaveData) }, - //{ 0x0, "_ZN12CChangeLevel10m_SaveDataE", mfunc_ptr_cast(&CChangeLevel::m_SaveData) }, - //{ 0x0, "_ZN20CTriggerChangeTarget10m_SaveDataE", mfunc_ptr_cast(&CTriggerChangeTarget::m_SaveData) }, - //{ 0x0, "_ZN14CTriggerCamera10m_SaveDataE", mfunc_ptr_cast(&CTriggerCamera::m_SaveData) }, - //{ 0x0, "_ZN16CFuncWeaponCheck10m_SaveDataE", mfunc_ptr_cast(&CFuncWeaponCheck::m_SaveData) }, - //{ 0x0, "_ZN14CBaseGrenCatch10m_SaveDataE", mfunc_ptr_cast(&CBaseGrenCatch::m_SaveData) }, - //{ 0x0, "_ZN8CAirtank10m_SaveDataE", mfunc_ptr_cast(&CAirtank::m_SaveData) }, - //{ 0x0, "_ZN11CBaseEntity10m_SaveDataE", mfunc_ptr_cast(&CBaseEntity::m_SaveData) }, - //{ 0x0, "_ZN12CMultiSource10m_SaveDataE", mfunc_ptr_cast(&CMultiSource::m_SaveData) }, - { 0x01E20538, "_ZN10CBaseDelay10m_SaveDataE", mfunc_ptr_cast(&CBaseDelay::m_SaveData) }, - { 0x01E13438, "_ZN14CBaseAnimating10m_SaveDataE", mfunc_ptr_cast(&CBaseAnimating::m_SaveData) }, - //{ 0x0, "_ZN11CBaseToggle10m_SaveDataE", mfunc_ptr_cast(&CBaseToggle::m_SaveData) }, - //{ 0x0, "_ZN11CBaseButton10m_SaveDataE", mfunc_ptr_cast(&CBaseButton::m_SaveData) }, - //{ 0x0, "_ZN15CAmbientGeneric10m_SaveDataE", mfunc_ptr_cast(&CAmbientGeneric::m_SaveData) }, - //{ 0x0, "_ZN9CEnvSound10m_SaveDataE", mfunc_ptr_cast(&CEnvSound::m_SaveData) }, - //{ 0x0, "_ZN8CSpeaker10m_SaveDataE", mfunc_ptr_cast(&CSpeaker::m_SaveData) }, - //{ 0x0, "_ZN9CBubbling10m_SaveDataE", mfunc_ptr_cast(&CBubbling::m_SaveData) }, - //{ 0x0, "_ZN10CLightning10m_SaveDataE", mfunc_ptr_cast(&CLightning::m_SaveData) }, - //{ 0x0, "_ZN6CLaser10m_SaveDataE", mfunc_ptr_cast(&CLaser::m_SaveData) }, - //{ 0x0, "_ZN5CGlow10m_SaveDataE", mfunc_ptr_cast(&CGlow::m_SaveData) }, - //{ 0x0, "_ZN7CSprite10m_SaveDataE", mfunc_ptr_cast(&CSprite::m_SaveData) }, - //{ 0x0, "_ZN11CGibShooter10m_SaveDataE", mfunc_ptr_cast(&CGibShooter::m_SaveData) }, - - //{ 0x01E227AC, "_ZN15CBasePlayerItem10m_SaveDataE", mfunc_ptr_cast(&CBasePlayerItem::m_SaveData) }, - //{ 0x01E227E0, "_ZN17CBasePlayerWeapon10m_SaveDataE", mfunc_ptr_cast(&CBasePlayerWeapon::m_SaveData) }, - //{ 0x0, "_ZN10CWeaponBox10m_SaveDataE", mfunc_ptr_cast(&CWeaponBox::m_SaveData) }, - - //{ 0x0, "_ZN14CBasePlatTrain10m_SaveDataE", mfunc_ptr_cast(&CBasePlatTrain::m_SaveData) }, - //{ 0x0, "_ZN12CFuncPlatRot10m_SaveDataE", mfunc_ptr_cast(&CFuncPlatRot::m_SaveData) }, - //{ 0x0, "_ZN10CFuncTrain10m_SaveDataE", mfunc_ptr_cast(&CFuncTrain::m_SaveData) }, - //{ 0x0, "_ZN15CFuncTrackTrain10m_SaveDataE", mfunc_ptr_cast(&CFuncTrackTrain::m_SaveData) }, - //{ 0x0, "_ZN16CFuncTrackChange10m_SaveDataE", mfunc_ptr_cast(&CFuncTrackChange::m_SaveData) }, - //{ 0x0, "_ZN10CGunTarget10m_SaveDataE", mfunc_ptr_cast(&CGunTarget::m_SaveData) }, + //{ 0x01E14A68, "_ZN11CBaseEntity10m_SaveDataE", mfunc_ptr_cast(&CBaseEntity::pm_SaveData) }, + //{ 0x0, "_ZN12CGlobalState10m_SaveDataE", mfunc_ptr_cast(&CGlobalState::pm_SaveData) }, + //{ 0x0, "_ZN9CEnvSpark10m_SaveDataE", mfunc_ptr_cast(&CEnvSpark::pm_SaveData) }, + //{ 0x0, "_ZN19CMomentaryRotButton10m_SaveDataE", mfunc_ptr_cast(&CMomentaryRotButton::pm_SaveData) }, + //{ 0x0, "_ZN10CEnvGlobal10m_SaveDataE", mfunc_ptr_cast(&CEnvGlobal::pm_SaveData) }, + //{ 0x0, "_ZN8CGrenade10m_SaveDataE", mfunc_ptr_cast(&CGrenade::pm_SaveData) }, + //{ 0x0, "_ZN9CWreckage10m_SaveDataE", mfunc_ptr_cast(&CWreckage::pm_SaveData) }, + //{ 0x0, "_ZN13CCyclerSprite10m_SaveDataE", mfunc_ptr_cast(&CCyclerSprite::pm_SaveData) }, + //{ 0x0, "_ZN7CCycler10m_SaveDataE", mfunc_ptr_cast(&CCycler::pm_SaveData) }, + { 0x01E1BE38, "_ZN6CLight10m_SaveDataE", mfunc_ptr_cast(&CLight::pm_SaveData) }, + { 0x01E1BB00, "_ZN11CWallHealth10m_SaveDataE", mfunc_ptr_cast(&CWallHealth::pm_SaveData) }, + { 0x01E1B850, "_ZN9CRecharge10m_SaveDataE", mfunc_ptr_cast(&CRecharge::pm_SaveData) }, + //{ 0x0, "_ZN16CFuncMortarField10m_SaveDataE", mfunc_ptr_cast(&CFuncMortarField::pm_SaveData) }, + //{ 0x0, "_ZN13CEnvExplosion10m_SaveDataE", mfunc_ptr_cast(&CEnvExplosion::pm_SaveData) }, + //{ 0x0, "_ZN13CFuncRotating10m_SaveDataE", mfunc_ptr_cast(&CFuncRotating::pm_SaveData) }, + //{ 0x0, "_ZN9CPendulum10m_SaveDataE", mfunc_ptr_cast(&CPendulum::pm_SaveData) }, + //{ 0x0, "_ZN9CBaseDoor10m_SaveDataE", mfunc_ptr_cast(&CBaseDoor::pm_SaveData) }, + //{ 0x0, "_ZN14CMomentaryDoor10m_SaveDataE", mfunc_ptr_cast(&CMomentaryDoor::pm_SaveData) }, + //{ 0x0, "_ZN10CBreakable10m_SaveDataE", mfunc_ptr_cast(&CBreakable::pm_SaveData) }, + //{ 0x0, "_ZN9CPushable10m_SaveDataE", mfunc_ptr_cast(&CPushable::pm_SaveData) }, + //{ 0x0, "_ZN9CFuncTank10m_SaveDataE", mfunc_ptr_cast(&CFuncTank::pm_SaveData) }, + //{ 0x0, "_ZN14CFuncTankLaser10m_SaveDataE", mfunc_ptr_cast(&CFuncTankLaser::pm_SaveData) }, + //{ 0x0, "_ZN17CFuncTankControls10m_SaveDataE", mfunc_ptr_cast(&CFuncTankControls::pm_SaveData) }, + //{ 0x0, "_ZN12CFuncVehicle10m_SaveDataE", mfunc_ptr_cast(&CFuncVehicle::pm_SaveData) }, + //{ 0x0, "_ZN11CPathCorner10m_SaveDataE", mfunc_ptr_cast(&CPathCorner::pm_SaveData) }, + //{ 0x0, "_ZN10CPathTrack10m_SaveDataE", mfunc_ptr_cast(&CPathTrack::pm_SaveData) }, + { 0x01E1E01C, "_ZN12CRevertSaved10m_SaveDataE", mfunc_ptr_cast(&CRevertSaved::pm_SaveData) }, + //{ 0x0, "_ZN11CRuleEntity10m_SaveDataE", mfunc_ptr_cast(&CRuleEntity::pm_SaveData) }, + //{ 0x0, "_ZN9CGameText10m_SaveDataE", mfunc_ptr_cast(&CGameText::pm_SaveData) }, + //{ 0x0, "_ZN15CGamePlayerZone10m_SaveDataE", mfunc_ptr_cast(&CGamePlayerZone::pm_SaveData) }, + //{ 0x0, "_ZN17CFrictionModifier10m_SaveDataE", mfunc_ptr_cast(&CFrictionModifier::pm_SaveData) }, + //{ 0x0, "_ZN12CAutoTrigger10m_SaveDataE", mfunc_ptr_cast(&CAutoTrigger::pm_SaveData) }, + //{ 0x0, "_ZN13CTriggerRelay10m_SaveDataE", mfunc_ptr_cast(&CTriggerRelay::pm_SaveData) }, + //{ 0x0, "_ZN13CMultiManager10m_SaveDataE", mfunc_ptr_cast(&CMultiManager::pm_SaveData) }, + //{ 0x0, "_ZN12CChangeLevel10m_SaveDataE", mfunc_ptr_cast(&CChangeLevel::pm_SaveData) }, + //{ 0x0, "_ZN20CTriggerChangeTarget10m_SaveDataE", mfunc_ptr_cast(&CTriggerChangeTarget::pm_SaveData) }, + //{ 0x0, "_ZN14CTriggerCamera10m_SaveDataE", mfunc_ptr_cast(&CTriggerCamera::pm_SaveData) }, + //{ 0x0, "_ZN16CFuncWeaponCheck10m_SaveDataE", mfunc_ptr_cast(&CFuncWeaponCheck::pm_SaveData) }, + //{ 0x0, "_ZN14CBaseGrenCatch10m_SaveDataE", mfunc_ptr_cast(&CBaseGrenCatch::pm_SaveData) }, + //{ 0x0, "_ZN8CAirtank10m_SaveDataE", mfunc_ptr_cast(&CAirtank::pm_SaveData) }, + //{ 0x0, "_ZN12CMultiSource10m_SaveDataE", mfunc_ptr_cast(&CMultiSource::pm_SaveData) }, + { 0x01E20538, "_ZN10CBaseDelay10m_SaveDataE", mfunc_ptr_cast(&CBaseDelay::pm_SaveData) }, + { 0x01E13438, "_ZN14CBaseAnimating10m_SaveDataE", mfunc_ptr_cast(&CBaseAnimating::pm_SaveData) }, + //{ 0x0, "_ZN11CBaseToggle10m_SaveDataE", mfunc_ptr_cast(&CBaseToggle::pm_SaveData) }, + //{ 0x0, "_ZN11CBaseButton10m_SaveDataE", mfunc_ptr_cast(&CBaseButton::pm_SaveData) }, + //{ 0x0, "_ZN15CAmbientGeneric10m_SaveDataE", mfunc_ptr_cast(&CAmbientGeneric::pm_SaveData) }, + //{ 0x0, "_ZN9CEnvSound10m_SaveDataE", mfunc_ptr_cast(&CEnvSound::pm_SaveData) }, + //{ 0x0, "_ZN8CSpeaker10m_SaveDataE", mfunc_ptr_cast(&CSpeaker::pm_SaveData) }, + //{ 0x0, "_ZN9CBubbling10m_SaveDataE", mfunc_ptr_cast(&CBubbling::pm_SaveData) }, + //{ 0x0, "_ZN10CLightning10m_SaveDataE", mfunc_ptr_cast(&CLightning::pm_SaveData) }, + //{ 0x0, "_ZN6CLaser10m_SaveDataE", mfunc_ptr_cast(&CLaser::pm_SaveData) }, + //{ 0x0, "_ZN5CGlow10m_SaveDataE", mfunc_ptr_cast(&CGlow::pm_SaveData) }, + //{ 0x0, "_ZN7CSprite10m_SaveDataE", mfunc_ptr_cast(&CSprite::pm_SaveData) }, + //{ 0x0, "_ZN11CGibShooter10m_SaveDataE", mfunc_ptr_cast(&CGibShooter::pm_SaveData) }, + //{ 0x01E227AC, "_ZN15CBasePlayerItem10m_SaveDataE", mfunc_ptr_cast(&CBasePlayerItem::pm_SaveData) }, + //{ 0x01E227E0, "_ZN17CBasePlayerWeapon10m_SaveDataE", mfunc_ptr_cast(&CBasePlayerWeapon::pm_SaveData) }, + //{ 0x0, "_ZN10CWeaponBox10m_SaveDataE", mfunc_ptr_cast(&CWeaponBox::pm_SaveData) }, + //{ 0x0, "_ZN14CBasePlatTrain10m_SaveDataE", mfunc_ptr_cast(&CBasePlatTrain::pm_SaveData) }, + //{ 0x0, "_ZN12CFuncPlatRot10m_SaveDataE", mfunc_ptr_cast(&CFuncPlatRot::pm_SaveData) }, + //{ 0x0, "_ZN10CFuncTrain10m_SaveDataE", mfunc_ptr_cast(&CFuncTrain::pm_SaveData) }, + //{ 0x0, "_ZN15CFuncTrackTrain10m_SaveDataE", mfunc_ptr_cast(&CFuncTrackTrain::pm_SaveData) }, + //{ 0x0, "_ZN16CFuncTrackChange10m_SaveDataE", mfunc_ptr_cast(&CFuncTrackChange::pm_SaveData) }, + //{ 0x0, "_ZN10CGunTarget10m_SaveDataE", mfunc_ptr_cast(&CGunTarget::pm_SaveData) }, { 0x01E75FE0, "_ZN15CBasePlayerItem13ItemInfoArrayE", mfunc_ptr_cast(&CBasePlayerItem::pItemInfoArray) }, { 0x01E75ED8, "_ZN15CBasePlayerItem13AmmoInfoArrayE", mfunc_ptr_cast(&CBasePlayerItem::pAmmoInfoArray) }, @@ -5584,8 +5603,9 @@ AddressRef g_DataRefs[] = //{ 0x01E23448, "cv_tutor_message_minimum_display_time", (size_t)&pcv_tutor_message_minimum_display_time }, //{ 0x01E2345C, "cv_tutor_message_character_display_time_coefficient", (size_t)&pcv_tutor_message_character_display_time_coefficient }, //{ 0x01E23470, "cv_tutor_hint_interval_time", (size_t)&pcv_tutor_hint_interval_time }, - //{ 0x01E11EE4, "cv_hostage_debug", (size_t)&pcv_hostage_debug }+ - //{ 0x01E11EF8, "cv_hostage_stop", (size_t)&pcv_hostage_stop }+ + + { 0x01E11EE4, "cv_hostage_debug", (size_t)&pcv_hostage_debug }, + { 0x01E11EF8, "cv_hostage_stop", (size_t)&pcv_hostage_stop }, //{ 0x0, "TheNavLadderList", (size_t)&pTheNavLadderList }, { 0x01E2A0F4, "TheHidingSpotList", (size_t)&pTheHidingSpotList }, diff --git a/regamedll/hookers/hooker.cpp b/regamedll/hookers/hooker.cpp index c5e1afe4..3f2d6188 100644 --- a/regamedll/hookers/hooker.cpp +++ b/regamedll/hookers/hooker.cpp @@ -43,6 +43,17 @@ void printAddrRebase(size_t addr,const char *funcName) printf("#%d. %s - 0x%p\n", ++inum, funcName, (void *)addr); } +FunctionHook *GetFunctionPtrByName(const char *funcName) +{ + for (FunctionHook *cfh = &g_FunctionHooks[0]; cfh->symbolName; cfh++) + { + if (!strcmp(cfh->symbolName, funcName)) + return cfh; + } + + return NULL; +} + void *GetOriginalFuncAddrOrDie(const char *funcName) { for (FunctionHook *cfh = &g_FunctionHooks[0]; cfh->symbolName; cfh++) @@ -181,7 +192,6 @@ int HookGameDLL(size_t gameAddr, size_t engAddr) { if (!HookFunction(&g_GameDLLModule, hookFunc)) return (FALSE); - hookFunc++; } } diff --git a/regamedll/hookers/hooker.h b/regamedll/hookers/hooker.h index 2ba0a2a5..3529244c 100644 --- a/regamedll/hookers/hooker.h +++ b/regamedll/hookers/hooker.h @@ -3,6 +3,7 @@ #include "osconfig.h" extern void printAddrRebase(size_t addr,const char *funcName); +extern FunctionHook *GetFunctionPtrByName(const char *funcName); extern void *GetOriginalFuncAddrOrDie(const char *funcName); extern void *GetOriginalFuncAddrOrDefault(const char *funcName, void *def); extern void *GetFuncRefAddrOrDie(const char *funcName); diff --git a/regamedll/hookers/memory.cpp b/regamedll/hookers/memory.cpp index 7148ea2f..7bd2dab7 100644 --- a/regamedll/hookers/memory.cpp +++ b/regamedll/hookers/memory.cpp @@ -726,7 +726,7 @@ bool HIDDEN HookFunction(Module *module, FunctionHook *hook) patch[0] = 0xE9; #if 1 - if(strcmp(hook->symbolName,"_ZN6CCSBot16UpdateLookAnglesEv")==0) + if(strcmp(hook->symbolName,"_ZN11CBasePlayer18StudioEstimateGaitEv")==0) { addr_orig = (void *)hook->originalAddress; @@ -736,6 +736,7 @@ bool HIDDEN HookFunction(Module *module, FunctionHook *hook) #endif ExchangeMemoryBytes(hook->originalAddress, (size_t)patch, 5); + hook->bIsHooked = true; return true; } diff --git a/regamedll/hookers/memory.h b/regamedll/hookers/memory.h index 5a92f66f..36e62195 100644 --- a/regamedll/hookers/memory.h +++ b/regamedll/hookers/memory.h @@ -76,6 +76,7 @@ struct FunctionHook const char *symbolName; size_t handlerFunc; int symbolIndex; + bool bIsHooked; }; struct AddressRef diff --git a/regamedll/msvc/ReGameDLL.vcxproj b/regamedll/msvc/ReGameDLL.vcxproj index 52369553..f6dedd1d 100644 --- a/regamedll/msvc/ReGameDLL.vcxproj +++ b/regamedll/msvc/ReGameDLL.vcxproj @@ -535,6 +535,7 @@ + @@ -579,6 +580,7 @@ + @@ -821,8 +823,8 @@ $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories) - IF EXIST "$(ProjectDir)PostBuild.bat" (CALL "$(ProjectDir)PostBuild.bat" "$(TargetDir)" "$(TargetName)" "$(TargetExt)" "$(ProjectDir)") Automatic deployment script + IF EXIST "$(ProjectDir)PostBuild.bat" (CALL "$(ProjectDir)PostBuild.bat" "$(TargetDir)" "$(TargetName)" "$(TargetExt)" "$(ProjectDir)") echo Empty Action diff --git a/regamedll/msvc/ReGameDLL.vcxproj.filters b/regamedll/msvc/ReGameDLL.vcxproj.filters index 4b03ada8..3674110a 100644 --- a/regamedll/msvc/ReGameDLL.vcxproj.filters +++ b/regamedll/msvc/ReGameDLL.vcxproj.filters @@ -1100,6 +1100,12 @@ engine + + dlls + + + dlls + diff --git a/regamedll/regamedll/RegameDLLRuntimeConfig.cpp b/regamedll/regamedll/RegameDLLRuntimeConfig.cpp index a24fdbba..af9505eb 100644 --- a/regamedll/regamedll/RegameDLLRuntimeConfig.cpp +++ b/regamedll/regamedll/RegameDLLRuntimeConfig.cpp @@ -4,11 +4,62 @@ CRegameDLLRuntimeConfig g_ReGameDLLRuntimeConfig; CRegameDLLRuntimeConfig::CRegameDLLRuntimeConfig() { + bIsZero = false; disableAllHooks = false; testRecordingFileName[0] = 0; + testConfigFileName[0] = 0; testPlayerMode = TPM_DISABLE; } +void CRegameDLLRuntimeConfig::parseFromConfigFile(void) +{ +#ifdef _WIN32 + + if (strlen(testConfigFileName) <= 0) + return; + + std::string str; + std::string path( bIsZero ? "./czero/server.cfg" : "./cstrike/server.cfg" ); + std::string pattern = "exec tests/"; + + std::ifstream intput_file( path ); + std::vector< std::string > out; + + bool bFound = false; + while (std::getline(intput_file, str)) + { + if (str.find( pattern ) != -1) + { + bFound = true; + + std::ostringstream stringStream; + stringStream << pattern << testConfigFileName; + str = stringStream.str(); + } + + out.push_back( str.c_str() ); + } + + if (!bFound) + { + std::ostringstream stringStream; + stringStream << "\n" << pattern << testConfigFileName; + + out.push_back( stringStream.str() ); + } + + intput_file.close(); + + std::ofstream output_file( path ); + std::ostream_iterator< std::string > output_iterator(output_file, "\n"); + std::copy(out.begin(), out.end(), output_iterator); + + out.clear(); + output_file.close(); + +#endif // _WIN32 +} + void CRegameDLLRuntimeConfig::parseFromCommandLine(const char *cmdLine) { char localBuf[2048]; @@ -20,8 +71,6 @@ void CRegameDLLRuntimeConfig::parseFromCommandLine(const char *cmdLine) getNextToken(&cpos); //skip executable path - bIsZero = false; - BOOL bGame = FALSE; const char *token = getNextToken(&cpos); while (token != NULL) { @@ -47,23 +96,33 @@ void CRegameDLLRuntimeConfig::parseFromCommandLine(const char *cmdLine) testRecordingFileName[sizeof(testRecordingFileName) - 1] = 0; testPlayerMode = TPM_PLAY; } + else if (!strcmp(token, "--regamedll-cfg-init")) + { + const char *fname = getNextToken(&cpos); + + if (fname != NULL) + { + strncpy(testConfigFileName, fname, sizeof(testConfigFileName)); + testConfigFileName[sizeof(testConfigFileName) - 1] = 0; + } + } else if (!strcmp(token, "--regamedll-disable-all-hooks")) { disableAllHooks = true; } else if (!strcmp(token, "-game")) { - bGame = TRUE; - } - else if (bGame) - { - if (!strcmp(token, "czero")) - bIsZero = true; + const char *szTokenGame = getNextToken(&cpos); - bGame = FALSE; + if (szTokenGame != NULL && !strcmp(szTokenGame, "czero")) + bIsZero = true; } + token = getNextToken(&cpos); } + + // parse config filename for testdemo + parseFromConfigFile(); } const char *CRegameDLLRuntimeConfig::getNextToken(char* *pBuf) diff --git a/regamedll/regamedll/RegameDLLRuntimeConfig.h b/regamedll/regamedll/RegameDLLRuntimeConfig.h index c5a7bb7a..eba87b4b 100644 --- a/regamedll/regamedll/RegameDLLRuntimeConfig.h +++ b/regamedll/regamedll/RegameDLLRuntimeConfig.h @@ -17,8 +17,10 @@ public: bool bIsZero; bool disableAllHooks; char testRecordingFileName[260]; + char testConfigFileName[260]; TestPlayerMode testPlayerMode; + void parseFromConfigFile(void); void parseFromCommandLine(const char *cmdLine); }; diff --git a/regamedll/regamedll/dlls.h b/regamedll/regamedll/dlls.h index 45eed853..c525b34c 100644 --- a/regamedll/regamedll/dlls.h +++ b/regamedll/regamedll/dlls.h @@ -35,7 +35,6 @@ #include "enginecallback.h" //#include "entity_state.h" #include "nodes.h" -#include "saverestore.h" #include "screenfade.h" #include "utlvector.h" @@ -46,6 +45,7 @@ // Globals vars #include "globals.h" +#include "saverestore.h" // GameInit #include "game.h" @@ -62,6 +62,7 @@ #include "util.h" #include "decals.h" #include "cbase.h" +#include "world.h" #include "sound.h" #include "basemonster.h" diff --git a/regamedll/unittests/struct_offsets_tests.cpp b/regamedll/unittests/struct_offsets_tests.cpp index 653d3169..8a1aaf1b 100644 --- a/regamedll/unittests/struct_offsets_tests.cpp +++ b/regamedll/unittests/struct_offsets_tests.cpp @@ -48,6 +48,7 @@ TEST(StructOffsets, ReversingChecks, 5000) REPEAT_SIZEOF_PRINT(HostageFollowState); REPEAT_SIZEOF_PRINT(CHalfLifeMultiplay); REPEAT_SIZEOF_PRINT(CHalfLifeTraining); + REPEAT_SIZEOF_PRINT(CGib); // offset the members REPEAT_OFFSETOF_PRINT(CBaseEntity, pev); @@ -62,6 +63,7 @@ TEST(StructOffsets, ReversingChecks, 5000) CHECK_CLASS_SIZE(CHalfLifeMultiplay, 0x2D0u, 0x2C4u); CHECK_CLASS_SIZE(CHalfLifeTraining, 0x2E8u, 0x2D8u); + CHECK_CLASS_SIZE(CGib, 0x98, 0xA8); //CHECK_CLASS_SIZE(CBotManager, 12u, 12); //CHECK_CLASS_SIZE(CCSBotManager, 740, 0x2E0u);//0x2E4u | 0x2E0u