Code cleanup

Hookers Refactoring
Removed __MAKE_VHOOK
Fix compilation under linux with ICC 17 (GCC 6.2)
This commit is contained in:
s1lent 2017-07-02 03:40:10 +07:00
parent 63e16f78ab
commit adaddda871
No known key found for this signature in database
GPG Key ID: 0FE401DC73916B5C
191 changed files with 8524 additions and 12451 deletions

View File

@ -4,6 +4,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sstream> #include <sstream>
#include <cmath>
void Assertions::StringEquals(std::string message, std::string expected, std::string actual, const char* fileName, long lineNumber) { void Assertions::StringEquals(std::string message, std::string expected, std::string actual, const char* fileName, long lineNumber) {
if (expected != actual) { if (expected != actual) {
@ -57,7 +58,7 @@ void Assertions::CharEquals(std::string message, char expected, char actual, con
} }
void Assertions::DoubleEquals(std::string message, double expected, double actual, double epsilon, const char* fileName, long lineNumber) { void Assertions::DoubleEquals(std::string message, double expected, double actual, double epsilon, const char* fileName, long lineNumber) {
if (abs(expected - actual) > epsilon) { if (std::abs(expected - actual) > epsilon) {
std::stringstream ss; std::stringstream ss;
ss << message << " (expected '" << expected << "', got '" << actual << "')"; ss << message << " (expected '" << expected << "', got '" << actual << "')";
throw TestFailException(ss.str(), std::string(fileName), lineNumber); throw TestFailException(ss.str(), std::string(fileName), lineNumber);

View File

@ -154,7 +154,7 @@ void setupToolchain(NativeBinarySpec b)
]) ])
cfg.linkerOptions.args '-no-opt-class-analysis' cfg.linkerOptions.args '-no-opt-class-analysis'
cfg.compilerOptions.args '-Qoption,cpp,--treat_func_as_string_literal_cpp', '-g0', '-fno-rtti' cfg.compilerOptions.args '-Qoption,cpp,--treat_func_as_string_literal_cpp', '-g0', '-fno-rtti', '-fno-exceptions'
cfg.projectLibpath(project, '/lib/linux32') cfg.projectLibpath(project, '/lib/linux32')
cfg.extraLibs 'dl', 'm', 'stdc++', 'aelf32' cfg.extraLibs 'dl', 'm', 'stdc++', 'aelf32'
} }

View File

@ -15,7 +15,7 @@ TYPEDESCRIPTION CAirtank::m_SaveData[] =
LINK_ENTITY_TO_CLASS(item_airtank, CAirtank, CCSAirtank) LINK_ENTITY_TO_CLASS(item_airtank, CAirtank, CCSAirtank)
IMPLEMENT_SAVERESTORE(CAirtank, CGrenade) IMPLEMENT_SAVERESTORE(CAirtank, CGrenade)
void CAirtank::__MAKE_VHOOK(Spawn)() void CAirtank::Spawn()
{ {
Precache(); Precache();
@ -37,13 +37,13 @@ void CAirtank::__MAKE_VHOOK(Spawn)()
m_state = 1; m_state = 1;
} }
void CAirtank::__MAKE_VHOOK(Precache)() void CAirtank::Precache()
{ {
PRECACHE_MODEL("models/w_oxygen.mdl"); PRECACHE_MODEL("models/w_oxygen.mdl");
PRECACHE_SOUND("doors/aliendoor3.wav"); PRECACHE_SOUND("doors/aliendoor3.wav");
} }
void CAirtank::__MAKE_VHOOK(Killed)(entvars_t *pevAttacker, int iGib) void CAirtank::Killed(entvars_t *pevAttacker, int iGib)
{ {
pev->owner = ENT(pevAttacker); pev->owner = ENT(pevAttacker);

View File

@ -46,16 +46,6 @@ public:
void EXPORT TankThink(); void EXPORT TankThink();
void EXPORT TankTouch(CBaseEntity *pOther); void EXPORT TankTouch(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Killed_(entvars_t *pevAttacker, int iGib);
#endif
public: public:
static TYPEDESCRIPTION IMPL(m_SaveData)[1]; static TYPEDESCRIPTION IMPL(m_SaveData)[1];

View File

@ -1,19 +1,19 @@
#include "precompiled.h" #include "precompiled.h"
void C9MMAmmo::__MAKE_VHOOK(Spawn)() void C9MMAmmo::Spawn()
{ {
Precache(); Precache();
SET_MODEL(ENT(pev), "models/w_9mmclip.mdl"); SET_MODEL(ENT(pev), "models/w_9mmclip.mdl");
CBasePlayerAmmo::Spawn(); CBasePlayerAmmo::Spawn();
} }
void C9MMAmmo::__MAKE_VHOOK(Precache)() void C9MMAmmo::Precache()
{ {
PRECACHE_MODEL("models/w_9mmclip.mdl"); PRECACHE_MODEL("models/w_9mmclip.mdl");
PRECACHE_SOUND("items/9mmclip1.wav"); PRECACHE_SOUND("items/9mmclip1.wav");
} }
BOOL C9MMAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther) BOOL C9MMAmmo::AddAmmo(CBaseEntity *pOther)
{ {
if (pOther->GiveAmmo(AMMO_9MM_BUY, "9mm") == -1) if (pOther->GiveAmmo(AMMO_9MM_BUY, "9mm") == -1)
{ {
@ -26,20 +26,20 @@ BOOL C9MMAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
LINK_ENTITY_TO_CLASS(ammo_9mm, C9MMAmmo, CCS9MMAmmo) LINK_ENTITY_TO_CLASS(ammo_9mm, C9MMAmmo, CCS9MMAmmo)
void CBuckShotAmmo::__MAKE_VHOOK(Spawn)() void CBuckShotAmmo::Spawn()
{ {
Precache(); Precache();
SET_MODEL(ENT(pev), "models/w_shotbox.mdl"); SET_MODEL(ENT(pev), "models/w_shotbox.mdl");
CBasePlayerAmmo::Spawn(); CBasePlayerAmmo::Spawn();
} }
void CBuckShotAmmo::__MAKE_VHOOK(Precache)() void CBuckShotAmmo::Precache()
{ {
PRECACHE_MODEL("models/w_shotbox.mdl"); PRECACHE_MODEL("models/w_shotbox.mdl");
PRECACHE_SOUND("items/9mmclip1.wav"); PRECACHE_SOUND("items/9mmclip1.wav");
} }
BOOL CBuckShotAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther) BOOL CBuckShotAmmo::AddAmmo(CBaseEntity *pOther)
{ {
if (pOther->GiveAmmo(AMMO_BUCKSHOT_BUY, "buckshot") == -1) if (pOther->GiveAmmo(AMMO_BUCKSHOT_BUY, "buckshot") == -1)
{ {
@ -52,20 +52,20 @@ BOOL CBuckShotAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
LINK_ENTITY_TO_CLASS(ammo_buckshot, CBuckShotAmmo, CCSBuckShotAmmo) LINK_ENTITY_TO_CLASS(ammo_buckshot, CBuckShotAmmo, CCSBuckShotAmmo)
void C556NatoAmmo::__MAKE_VHOOK(Spawn)() void C556NatoAmmo::Spawn()
{ {
Precache(); Precache();
SET_MODEL(ENT(pev), "models/w_9mmclip.mdl"); SET_MODEL(ENT(pev), "models/w_9mmclip.mdl");
CBasePlayerAmmo::Spawn(); CBasePlayerAmmo::Spawn();
} }
void C556NatoAmmo::__MAKE_VHOOK(Precache)() void C556NatoAmmo::Precache()
{ {
PRECACHE_MODEL("models/w_9mmclip.mdl"); PRECACHE_MODEL("models/w_9mmclip.mdl");
PRECACHE_SOUND("items/9mmclip1.wav"); PRECACHE_SOUND("items/9mmclip1.wav");
} }
BOOL C556NatoAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther) BOOL C556NatoAmmo::AddAmmo(CBaseEntity *pOther)
{ {
if (pOther->GiveAmmo(AMMO_556NATO_BUY, "556Nato") == -1) if (pOther->GiveAmmo(AMMO_556NATO_BUY, "556Nato") == -1)
{ {
@ -78,20 +78,20 @@ BOOL C556NatoAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
LINK_ENTITY_TO_CLASS(ammo_556nato, C556NatoAmmo, CCS556NatoAmmo) LINK_ENTITY_TO_CLASS(ammo_556nato, C556NatoAmmo, CCS556NatoAmmo)
void C556NatoBoxAmmo::__MAKE_VHOOK(Spawn)() void C556NatoBoxAmmo::Spawn()
{ {
Precache(); Precache();
SET_MODEL(ENT(pev), "models/w_9mmclip.mdl"); SET_MODEL(ENT(pev), "models/w_9mmclip.mdl");
CBasePlayerAmmo::Spawn(); CBasePlayerAmmo::Spawn();
} }
void C556NatoBoxAmmo::__MAKE_VHOOK(Precache)() void C556NatoBoxAmmo::Precache()
{ {
PRECACHE_MODEL("models/w_9mmclip.mdl"); PRECACHE_MODEL("models/w_9mmclip.mdl");
PRECACHE_SOUND("items/9mmclip1.wav"); PRECACHE_SOUND("items/9mmclip1.wav");
} }
BOOL C556NatoBoxAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther) BOOL C556NatoBoxAmmo::AddAmmo(CBaseEntity *pOther)
{ {
if (pOther->GiveAmmo(AMMO_556NATOBOX_BUY, "556NatoBox") == -1) if (pOther->GiveAmmo(AMMO_556NATOBOX_BUY, "556NatoBox") == -1)
{ {
@ -104,20 +104,20 @@ BOOL C556NatoBoxAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
LINK_ENTITY_TO_CLASS(ammo_556natobox, C556NatoBoxAmmo, CCS556NatoBoxAmmo) LINK_ENTITY_TO_CLASS(ammo_556natobox, C556NatoBoxAmmo, CCS556NatoBoxAmmo)
void C762NatoAmmo::__MAKE_VHOOK(Spawn)() void C762NatoAmmo::Spawn()
{ {
Precache(); Precache();
SET_MODEL(ENT(pev), "models/w_9mmclip.mdl"); SET_MODEL(ENT(pev), "models/w_9mmclip.mdl");
CBasePlayerAmmo::Spawn(); CBasePlayerAmmo::Spawn();
} }
void C762NatoAmmo::__MAKE_VHOOK(Precache)() void C762NatoAmmo::Precache()
{ {
PRECACHE_MODEL("models/w_9mmclip.mdl"); PRECACHE_MODEL("models/w_9mmclip.mdl");
PRECACHE_SOUND("items/9mmclip1.wav"); PRECACHE_SOUND("items/9mmclip1.wav");
} }
BOOL C762NatoAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther) BOOL C762NatoAmmo::AddAmmo(CBaseEntity *pOther)
{ {
if (pOther->GiveAmmo(AMMO_762NATO_BUY, "762Nato") == -1) if (pOther->GiveAmmo(AMMO_762NATO_BUY, "762Nato") == -1)
{ {
@ -130,20 +130,20 @@ BOOL C762NatoAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
LINK_ENTITY_TO_CLASS(ammo_762nato, C762NatoAmmo, CCS762NatoAmmo) LINK_ENTITY_TO_CLASS(ammo_762nato, C762NatoAmmo, CCS762NatoAmmo)
void C45ACPAmmo::__MAKE_VHOOK(Spawn)() void C45ACPAmmo::Spawn()
{ {
Precache(); Precache();
SET_MODEL(ENT(pev), "models/w_9mmclip.mdl"); SET_MODEL(ENT(pev), "models/w_9mmclip.mdl");
CBasePlayerAmmo::Spawn(); CBasePlayerAmmo::Spawn();
} }
void C45ACPAmmo::__MAKE_VHOOK(Precache)() void C45ACPAmmo::Precache()
{ {
PRECACHE_MODEL("models/w_9mmclip.mdl"); PRECACHE_MODEL("models/w_9mmclip.mdl");
PRECACHE_SOUND("items/9mmclip1.wav"); PRECACHE_SOUND("items/9mmclip1.wav");
} }
BOOL C45ACPAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther) BOOL C45ACPAmmo::AddAmmo(CBaseEntity *pOther)
{ {
if (pOther->GiveAmmo(AMMO_45ACP_BUY, "45acp") == -1) if (pOther->GiveAmmo(AMMO_45ACP_BUY, "45acp") == -1)
{ {
@ -156,20 +156,20 @@ BOOL C45ACPAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
LINK_ENTITY_TO_CLASS(ammo_45acp, C45ACPAmmo, CCS45ACPAmmo) LINK_ENTITY_TO_CLASS(ammo_45acp, C45ACPAmmo, CCS45ACPAmmo)
void C50AEAmmo::__MAKE_VHOOK(Spawn)() void C50AEAmmo::Spawn()
{ {
Precache(); Precache();
SET_MODEL(ENT(pev), "models/w_9mmclip.mdl"); SET_MODEL(ENT(pev), "models/w_9mmclip.mdl");
CBasePlayerAmmo::Spawn(); CBasePlayerAmmo::Spawn();
} }
void C50AEAmmo::__MAKE_VHOOK(Precache)() void C50AEAmmo::Precache()
{ {
PRECACHE_MODEL("models/w_9mmclip.mdl"); PRECACHE_MODEL("models/w_9mmclip.mdl");
PRECACHE_SOUND("items/9mmclip1.wav"); PRECACHE_SOUND("items/9mmclip1.wav");
} }
BOOL C50AEAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther) BOOL C50AEAmmo::AddAmmo(CBaseEntity *pOther)
{ {
if (pOther->GiveAmmo(AMMO_50AE_BUY, "50AE") == -1) if (pOther->GiveAmmo(AMMO_50AE_BUY, "50AE") == -1)
{ {
@ -182,20 +182,20 @@ BOOL C50AEAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
LINK_ENTITY_TO_CLASS(ammo_50ae, C50AEAmmo, CCS50AEAmmo) LINK_ENTITY_TO_CLASS(ammo_50ae, C50AEAmmo, CCS50AEAmmo)
void C338MagnumAmmo::__MAKE_VHOOK(Spawn)() void C338MagnumAmmo::Spawn()
{ {
Precache(); Precache();
SET_MODEL(ENT(pev), "models/w_9mmclip.mdl"); SET_MODEL(ENT(pev), "models/w_9mmclip.mdl");
CBasePlayerAmmo::Spawn(); CBasePlayerAmmo::Spawn();
} }
void C338MagnumAmmo::__MAKE_VHOOK(Precache)() void C338MagnumAmmo::Precache()
{ {
PRECACHE_MODEL("models/w_9mmclip.mdl"); PRECACHE_MODEL("models/w_9mmclip.mdl");
PRECACHE_SOUND("items/9mmclip1.wav"); PRECACHE_SOUND("items/9mmclip1.wav");
} }
BOOL C338MagnumAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther) BOOL C338MagnumAmmo::AddAmmo(CBaseEntity *pOther)
{ {
if (pOther->GiveAmmo(AMMO_338MAG_BUY, "338Magnum") == -1) if (pOther->GiveAmmo(AMMO_338MAG_BUY, "338Magnum") == -1)
{ {
@ -208,20 +208,20 @@ BOOL C338MagnumAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
LINK_ENTITY_TO_CLASS(ammo_338magnum, C338MagnumAmmo, CCS338MagnumAmmo) LINK_ENTITY_TO_CLASS(ammo_338magnum, C338MagnumAmmo, CCS338MagnumAmmo)
void C57MMAmmo::__MAKE_VHOOK(Spawn)() void C57MMAmmo::Spawn()
{ {
Precache(); Precache();
SET_MODEL(ENT(pev), "models/w_9mmclip.mdl"); SET_MODEL(ENT(pev), "models/w_9mmclip.mdl");
CBasePlayerAmmo::Spawn(); CBasePlayerAmmo::Spawn();
} }
void C57MMAmmo::__MAKE_VHOOK(Precache)() void C57MMAmmo::Precache()
{ {
PRECACHE_MODEL("models/w_9mmclip.mdl"); PRECACHE_MODEL("models/w_9mmclip.mdl");
PRECACHE_SOUND("items/9mmclip1.wav"); PRECACHE_SOUND("items/9mmclip1.wav");
} }
BOOL C57MMAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther) BOOL C57MMAmmo::AddAmmo(CBaseEntity *pOther)
{ {
if (pOther->GiveAmmo(AMMO_57MM_BUY, "57mm") == -1) if (pOther->GiveAmmo(AMMO_57MM_BUY, "57mm") == -1)
{ {
@ -234,20 +234,20 @@ BOOL C57MMAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
LINK_ENTITY_TO_CLASS(ammo_57mm, C57MMAmmo, CCS57MMAmmo) LINK_ENTITY_TO_CLASS(ammo_57mm, C57MMAmmo, CCS57MMAmmo)
void C357SIGAmmo::__MAKE_VHOOK(Spawn)() void C357SIGAmmo::Spawn()
{ {
Precache(); Precache();
SET_MODEL(ENT(pev), "models/w_9mmclip.mdl"); SET_MODEL(ENT(pev), "models/w_9mmclip.mdl");
CBasePlayerAmmo::Spawn(); CBasePlayerAmmo::Spawn();
} }
void C357SIGAmmo::__MAKE_VHOOK(Precache)() void C357SIGAmmo::Precache()
{ {
PRECACHE_MODEL("models/w_9mmclip.mdl"); PRECACHE_MODEL("models/w_9mmclip.mdl");
PRECACHE_SOUND("items/9mmclip1.wav"); PRECACHE_SOUND("items/9mmclip1.wav");
} }
BOOL C357SIGAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther) BOOL C357SIGAmmo::AddAmmo(CBaseEntity *pOther)
{ {
if (pOther->GiveAmmo(AMMO_357SIG_BUY, "357SIG") == -1) if (pOther->GiveAmmo(AMMO_357SIG_BUY, "357SIG") == -1)
{ {

View File

@ -38,15 +38,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Precache(); virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther); virtual BOOL AddAmmo(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
BOOL AddAmmo_(CBaseEntity *pOther);
#endif
}; };
class CBuckShotAmmo: public CBasePlayerAmmo class CBuckShotAmmo: public CBasePlayerAmmo
@ -55,15 +46,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Precache(); virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther); virtual BOOL AddAmmo(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
BOOL AddAmmo_(CBaseEntity *pOther);
#endif
}; };
class C556NatoAmmo: public CBasePlayerAmmo class C556NatoAmmo: public CBasePlayerAmmo
@ -72,15 +54,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Precache(); virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther); virtual BOOL AddAmmo(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
BOOL AddAmmo_(CBaseEntity *pOther);
#endif
}; };
class C556NatoBoxAmmo: public CBasePlayerAmmo class C556NatoBoxAmmo: public CBasePlayerAmmo
@ -89,15 +62,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Precache(); virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther); virtual BOOL AddAmmo(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
BOOL AddAmmo_(CBaseEntity *pOther);
#endif
}; };
class C762NatoAmmo: public CBasePlayerAmmo class C762NatoAmmo: public CBasePlayerAmmo
@ -106,15 +70,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Precache(); virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther); virtual BOOL AddAmmo(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
BOOL AddAmmo_(CBaseEntity *pOther);
#endif
}; };
class C45ACPAmmo: public CBasePlayerAmmo class C45ACPAmmo: public CBasePlayerAmmo
@ -123,15 +78,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Precache(); virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther); virtual BOOL AddAmmo(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
BOOL AddAmmo_(CBaseEntity *pOther);
#endif
}; };
class C50AEAmmo: public CBasePlayerAmmo class C50AEAmmo: public CBasePlayerAmmo
@ -140,15 +86,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Precache(); virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther); virtual BOOL AddAmmo(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
BOOL AddAmmo_(CBaseEntity *pOther);
#endif
}; };
class C338MagnumAmmo: public CBasePlayerAmmo class C338MagnumAmmo: public CBasePlayerAmmo
@ -157,15 +94,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Precache(); virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther); virtual BOOL AddAmmo(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
BOOL AddAmmo_(CBaseEntity *pOther);
#endif
}; };
class C57MMAmmo: public CBasePlayerAmmo class C57MMAmmo: public CBasePlayerAmmo
@ -174,14 +102,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Precache(); virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther); virtual BOOL AddAmmo(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
BOOL AddAmmo_(CBaseEntity *pOther);
#endif
}; };
class C357SIGAmmo: public CBasePlayerAmmo class C357SIGAmmo: public CBasePlayerAmmo
@ -190,15 +110,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Precache(); virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther); virtual BOOL AddAmmo(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
BOOL AddAmmo_(CBaseEntity *pOther);
#endif
}; };
#endif // AMMO_H #endif // AMMO_H

View File

@ -32,11 +32,11 @@
#pragma once #pragma once
#endif #endif
#define NUM_BLENDING 9 #define NUM_BLENDING 9
#define ANIM_SWIM_1 8 #define ANIM_SWIM_1 8
#define ANIM_SWIM_2 9 #define ANIM_SWIM_2 9
#define ANIM_FIRST_DEATH_SEQUENCE 101 #define ANIM_FIRST_DEATH_SEQUENCE 101
#include "monsterevent.h" #include "monsterevent.h"

View File

@ -77,30 +77,6 @@ public:
virtual BOOL FInViewCone(CBaseEntity *pEntity); virtual BOOL FInViewCone(CBaseEntity *pEntity);
virtual BOOL FInViewCone(const Vector *pOrigin); virtual BOOL FInViewCone(const Vector *pOrigin);
#ifdef HOOK_GAMEDLL
void KeyValue_(KeyValueData *pkvd);
void TraceAttack_(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType);
BOOL TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
BOOL TakeHealth_(float flHealth, int bitsDamageType);
void Killed_(entvars_t *pevAttacker, int iGib);
float ChangeYaw_(int speed);
BOOL HasHumanGibs_();
BOOL HasAlienGibs_();
void FadeMonster_();
void GibMonster_();
Activity GetDeathActivity_();
void BecomeDead_();
BOOL ShouldFadeOnDeath_();
int IRelationship_(CBaseEntity *pTarget);
void MonsterInitDead_();
void Look_(int iDistance);
CBaseEntity *BestVisibleEnemy_();
BOOL FInViewCone_(CBaseEntity *pEntity);
BOOL FInViewCone_(const Vector *pOrigin);
#endif
public: public:
void MakeIdealYaw(Vector vecTarget); void MakeIdealYaw(Vector vecTarget);
Activity GetSmallFlinchActivity(); Activity GetSmallFlinchActivity();
@ -134,7 +110,7 @@ public:
public: public:
Activity m_Activity; // what the monster is doing (animation) Activity m_Activity; // what the monster is doing (animation)
Activity m_IdealActivity; // monster should switch to this activity Activity m_IdealActivity; // monster should switch to this activity
int m_LastHitGroup; // the last body region that took damage int m_LastHitGroup; // the last body region that took damage
int m_bitsDamageType; // what types of damage has monster (player) taken int m_bitsDamageType; // what types of damage has monster (player) taken
byte m_rgbTimeBasedDamage[8]; byte m_rgbTimeBasedDamage[8];
@ -144,10 +120,10 @@ public:
int m_afMemory; int m_afMemory;
float m_flNextAttack; // cannot attack again until this time float m_flNextAttack; // cannot attack again until this time
EHANDLE m_hEnemy; // the entity that the monster is fighting. EHANDLE m_hEnemy; // the entity that the monster is fighting.
EHANDLE m_hTargetEnt; // the entity that the monster is trying to reach EHANDLE m_hTargetEnt; // the entity that the monster is trying to reach
float m_flFieldOfView; // width of monster's field of view ( dot product ) float m_flFieldOfView; // width of monster's field of view ( dot product )
int m_bloodColor; // color of blood particless int m_bloodColor; // color of blood particless
Vector m_HackedGunPos; // HACK until we can query end of gun Vector m_HackedGunPos; // HACK until we can query end of gun
Vector m_vecEnemyLKP; // last known position of enemy. (enemy's origin) Vector m_vecEnemyLKP; // last known position of enemy. (enemy's origin)
}; };

View File

@ -36,7 +36,7 @@ Vector VecBModelOrigin(entvars_t *pevBModel)
LINK_ENTITY_TO_CLASS(func_wall, CFuncWall, CCSFuncWall) LINK_ENTITY_TO_CLASS(func_wall, CFuncWall, CCSFuncWall)
void CFuncWall::__MAKE_VHOOK(Spawn)() void CFuncWall::Spawn()
{ {
pev->angles = g_vecZero; pev->angles = g_vecZero;
@ -50,7 +50,7 @@ void CFuncWall::__MAKE_VHOOK(Spawn)()
pev->flags |= FL_WORLDBRUSH; pev->flags |= FL_WORLDBRUSH;
} }
void CFuncWall::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CFuncWall::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
if (ShouldToggle(useType, int(pev->frame))) if (ShouldToggle(useType, int(pev->frame)))
{ {
@ -60,7 +60,7 @@ void CFuncWall::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller,
LINK_ENTITY_TO_CLASS(func_wall_toggle, CFuncWallToggle, CCSFuncWallToggle) LINK_ENTITY_TO_CLASS(func_wall_toggle, CFuncWallToggle, CCSFuncWallToggle)
void CFuncWallToggle::__MAKE_VHOOK(Spawn)() void CFuncWallToggle::Spawn()
{ {
CFuncWall::Spawn(); CFuncWall::Spawn();
@ -94,7 +94,7 @@ BOOL CFuncWallToggle::IsOn()
return TRUE; return TRUE;
} }
void CFuncWallToggle::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CFuncWallToggle::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
int status = IsOn(); int status = IsOn();
@ -109,7 +109,7 @@ void CFuncWallToggle::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pC
LINK_ENTITY_TO_CLASS(func_conveyor, CFuncConveyor, CCSFuncConveyor) LINK_ENTITY_TO_CLASS(func_conveyor, CFuncConveyor, CCSFuncConveyor)
void CFuncConveyor::__MAKE_VHOOK(Spawn)() void CFuncConveyor::Spawn()
{ {
SetMovedir(pev); SetMovedir(pev);
CFuncWall::Spawn(); CFuncWall::Spawn();
@ -148,7 +148,7 @@ void CFuncConveyor::UpdateSpeed(float speed)
pev->rendercolor.z = (speedCode & 0xFF); pev->rendercolor.z = (speedCode & 0xFF);
} }
void CFuncConveyor::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CFuncConveyor::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
pev->speed = -pev->speed; pev->speed = -pev->speed;
UpdateSpeed(pev->speed); UpdateSpeed(pev->speed);
@ -156,7 +156,7 @@ void CFuncConveyor::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCal
LINK_ENTITY_TO_CLASS(func_illusionary, CFuncIllusionary, CCSFuncIllusionary) LINK_ENTITY_TO_CLASS(func_illusionary, CFuncIllusionary, CCSFuncIllusionary)
void CFuncIllusionary::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CFuncIllusionary::KeyValue(KeyValueData *pkvd)
{ {
// skin is used for content type // skin is used for content type
if (FStrEq(pkvd->szKeyName, "skin")) if (FStrEq(pkvd->szKeyName, "skin"))
@ -168,7 +168,7 @@ void CFuncIllusionary::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CBaseToggle::KeyValue(pkvd); CBaseToggle::KeyValue(pkvd);
} }
void CFuncIllusionary::__MAKE_VHOOK(Spawn)() void CFuncIllusionary::Spawn()
{ {
pev->angles = g_vecZero; pev->angles = g_vecZero;
pev->movetype = MOVETYPE_NONE; pev->movetype = MOVETYPE_NONE;
@ -186,7 +186,7 @@ void CFuncIllusionary::__MAKE_VHOOK(Spawn)()
LINK_ENTITY_TO_CLASS(func_monsterclip, CFuncMonsterClip, CCSFuncMonsterClip) LINK_ENTITY_TO_CLASS(func_monsterclip, CFuncMonsterClip, CCSFuncMonsterClip)
void CFuncMonsterClip::__MAKE_VHOOK(Spawn)() void CFuncMonsterClip::Spawn()
{ {
CFuncWall::Spawn(); CFuncWall::Spawn();
@ -201,7 +201,7 @@ void CFuncMonsterClip::__MAKE_VHOOK(Spawn)()
LINK_ENTITY_TO_CLASS(func_rotating, CFuncRotating, CCSFuncRotating) LINK_ENTITY_TO_CLASS(func_rotating, CFuncRotating, CCSFuncRotating)
IMPLEMENT_SAVERESTORE(CFuncRotating, CBaseEntity) IMPLEMENT_SAVERESTORE(CFuncRotating, CBaseEntity)
void CFuncRotating::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CFuncRotating::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "fanfriction")) if (FStrEq(pkvd->szKeyName, "fanfriction"))
{ {
@ -250,7 +250,7 @@ void CFuncRotating::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
// "dmg" damage to inflict when blocked (2 default) // "dmg" damage to inflict when blocked (2 default)
// REVERSE will cause the it to rotate in the opposite direction. // REVERSE will cause the it to rotate in the opposite direction.
void CFuncRotating::__MAKE_VHOOK(Spawn)() void CFuncRotating::Spawn()
{ {
#ifdef REGAMEDLL_FIXES #ifdef REGAMEDLL_FIXES
m_angles = pev->angles; m_angles = pev->angles;
@ -404,7 +404,7 @@ void CFuncRotating::Restart()
} }
#endif #endif
void CFuncRotating::__MAKE_VHOOK(Precache)() void CFuncRotating::Precache()
{ {
char *szSoundFile = (char *)STRING(pev->message); char *szSoundFile = (char *)STRING(pev->message);
@ -652,7 +652,7 @@ void CFuncRotating::RotatingUse(CBaseEntity *pActivator, CBaseEntity *pCaller, U
} }
// RotatingBlocked - An entity has blocked the brush // RotatingBlocked - An entity has blocked the brush
void CFuncRotating::__MAKE_VHOOK(Blocked)(CBaseEntity *pOther) void CFuncRotating::Blocked(CBaseEntity *pOther)
{ {
pOther->TakeDamage(pev, pev, pev->dmg, DMG_CRUSH); pOther->TakeDamage(pev, pev, pev->dmg, DMG_CRUSH);
} }
@ -660,7 +660,7 @@ void CFuncRotating::__MAKE_VHOOK(Blocked)(CBaseEntity *pOther)
LINK_ENTITY_TO_CLASS(func_pendulum, CPendulum, CCSPendulum) LINK_ENTITY_TO_CLASS(func_pendulum, CPendulum, CCSPendulum)
IMPLEMENT_SAVERESTORE(CPendulum, CBaseEntity) IMPLEMENT_SAVERESTORE(CPendulum, CBaseEntity)
void CPendulum::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CPendulum::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "distance")) if (FStrEq(pkvd->szKeyName, "distance"))
{ {
@ -676,7 +676,7 @@ void CPendulum::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CBaseEntity::KeyValue(pkvd); CBaseEntity::KeyValue(pkvd);
} }
void CPendulum::__MAKE_VHOOK(Spawn)() void CPendulum::Spawn()
{ {
// set the axis of rotation // set the axis of rotation
CBaseToggle::AxisDir(pev); CBaseToggle::AxisDir(pev);
@ -760,7 +760,7 @@ void CPendulum::Stop()
pev->avelocity = g_vecZero; pev->avelocity = g_vecZero;
} }
void CPendulum::__MAKE_VHOOK(Blocked)(CBaseEntity *pOther) void CPendulum::Blocked(CBaseEntity *pOther)
{ {
m_time = gpGlobals->time; m_time = gpGlobals->time;
} }
@ -816,7 +816,7 @@ void CPendulum::Swing()
} }
} }
void CPendulum::__MAKE_VHOOK(Touch)(CBaseEntity *pOther) void CPendulum::Touch(CBaseEntity *pOther)
{ {
entvars_t *pevOther = pOther->pev; entvars_t *pevOther = pOther->pev;

View File

@ -77,14 +77,6 @@ public:
// Bmodels don't go across transitions // Bmodels don't go across transitions
virtual int ObjectCaps() { return CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; } virtual int ObjectCaps() { return CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
}; };
class CFuncWallToggle: public CFuncWall class CFuncWallToggle: public CFuncWall
@ -93,13 +85,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
void TurnOff(); void TurnOff();
void TurnOn(); void TurnOn();
@ -112,13 +97,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
void UpdateSpeed(float speed); void UpdateSpeed(float speed);
}; };
@ -131,13 +109,6 @@ public:
virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
virtual int ObjectCaps() { return CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; } virtual int ObjectCaps() { return CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
#ifdef HOOK_GAMEDLL
void Spawn_();
void KeyValue_(KeyValueData *pkvd);
#endif
public: public:
void EXPORT SloshTouch(CBaseEntity *pOther); void EXPORT SloshTouch(CBaseEntity *pOther);
}; };
@ -156,14 +127,6 @@ public:
// Clear out func_wall's use function // Clear out func_wall's use function
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) {} virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) {}
#ifdef HOOK_GAMEDLL
void Spawn_();
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
}; };
class CFuncRotating: public CBaseEntity class CFuncRotating: public CBaseEntity
@ -182,17 +145,6 @@ public:
virtual void Restart(); virtual void Restart();
#endif #endif
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Blocked_(CBaseEntity *pOther);
#endif
public: public:
void EXPORT SpinUp(); void EXPORT SpinUp();
void EXPORT SpinDown(); void EXPORT SpinDown();
@ -227,17 +179,6 @@ public:
virtual void Touch(CBaseEntity *pOther); virtual void Touch(CBaseEntity *pOther);
virtual void Blocked(CBaseEntity *pOther); virtual void Blocked(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Touch_(CBaseEntity *pOther);
void Blocked_(CBaseEntity *pOther);
#endif
public: public:
void EXPORT Swing(); void EXPORT Swing();
void EXPORT PendulumUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); void EXPORT PendulumUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
@ -249,7 +190,7 @@ public:
public: public:
static TYPEDESCRIPTION IMPL(m_SaveData)[8]; static TYPEDESCRIPTION IMPL(m_SaveData)[8];
float m_accel; // Acceleration float m_accel; // acceleration
float m_distance; float m_distance;
float m_time; float m_time;
float m_damp; float m_damp;

View File

@ -39,7 +39,7 @@ int GetBotFollowCount(CBasePlayer *leader)
} }
// Change movement speed to walking // Change movement speed to walking
void CCSBot::__MAKE_VHOOK(Walk)() void CCSBot::Walk()
{ {
if (m_mustRunTimer.IsElapsed()) if (m_mustRunTimer.IsElapsed())
{ {
@ -53,7 +53,7 @@ void CCSBot::__MAKE_VHOOK(Walk)()
// Return true if jump was started. // Return true if jump was started.
// This is extended from the base jump to disallow jumping when in a crouch area. // This is extended from the base jump to disallow jumping when in a crouch area.
bool CCSBot::__MAKE_VHOOK(Jump)(bool mustJump) bool CCSBot::Jump(bool mustJump)
{ {
// prevent jumping if we're crouched, unless we're in a crouchjump area - jump wins // prevent jumping if we're crouched, unless we're in a crouchjump area - jump wins
bool inCrouchJumpArea = (m_lastKnownArea && bool inCrouchJumpArea = (m_lastKnownArea &&
@ -70,7 +70,7 @@ bool CCSBot::__MAKE_VHOOK(Jump)(bool mustJump)
// Invoked when injured by something // Invoked when injured by something
// NOTE: We dont want to directly call Attack() here, or the bots will have super-human reaction times when injured // NOTE: We dont want to directly call Attack() here, or the bots will have super-human reaction times when injured
BOOL CCSBot::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) BOOL CCSBot::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{ {
CBaseEntity *attacker = GetClassPtr<CCSEntity>((CBaseEntity *)pevInflictor); CBaseEntity *attacker = GetClassPtr<CCSEntity>((CBaseEntity *)pevInflictor);
@ -146,7 +146,7 @@ BOOL CCSBot::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAtt
} }
// Invoked when killed // Invoked when killed
void CCSBot::__MAKE_VHOOK(Killed)(entvars_t *pevAttacker, int iGib) void CCSBot::Killed(entvars_t *pevAttacker, int iGib)
{ {
PrintIfWatched("Killed( attacker = %s )\n", STRING(pevAttacker->netname)); PrintIfWatched("Killed( attacker = %s )\n", STRING(pevAttacker->netname));

View File

@ -80,13 +80,6 @@ public:
virtual void OnEnter(CCSBot *me); virtual void OnEnter(CCSBot *me);
virtual void OnUpdate(CCSBot *me); virtual void OnUpdate(CCSBot *me);
virtual const char *GetName() const { return "Idle"; } virtual const char *GetName() const { return "Idle"; }
#ifdef HOOK_GAMEDLL
void OnEnter_(CCSBot *me);
void OnUpdate_(CCSBot *me);
#endif
}; };
class HuntState: public BotState class HuntState: public BotState
@ -97,15 +90,8 @@ public:
virtual void OnExit(CCSBot *me); virtual void OnExit(CCSBot *me);
virtual const char *GetName() const { return "Hunt"; } virtual const char *GetName() const { return "Hunt"; }
#ifdef HOOK_GAMEDLL
void OnEnter_(CCSBot *me);
void OnUpdate_(CCSBot *me);
void OnExit_(CCSBot *me);
#endif
void ClearHuntArea() { m_huntArea = NULL; } void ClearHuntArea() { m_huntArea = NULL; }
private: private:
CNavArea *m_huntArea; CNavArea *m_huntArea;
}; };
@ -118,14 +104,6 @@ public:
virtual void OnExit(CCSBot *me); virtual void OnExit(CCSBot *me);
virtual const char *GetName() const { return "Attack"; } virtual const char *GetName() const { return "Attack"; }
#ifdef HOOK_GAMEDLL
void OnEnter_(CCSBot *me);
void OnUpdate_(CCSBot *me);
void OnExit_(CCSBot *me);
#endif
void SetCrouchAndHold(bool crouch) { m_crouchAndHold = crouch; } void SetCrouchAndHold(bool crouch) { m_crouchAndHold = crouch; }
void StopAttacking(CCSBot *me); void StopAttacking(CCSBot *me);
@ -164,14 +142,6 @@ public:
virtual void OnExit(CCSBot *me); virtual void OnExit(CCSBot *me);
virtual const char *GetName() const { return "InvestigateNoise"; } virtual const char *GetName() const { return "InvestigateNoise"; }
#ifdef HOOK_GAMEDLL
void OnEnter_(CCSBot *me);
void OnUpdate_(CCSBot *me);
void OnExit_(CCSBot *me);
#endif
private: private:
void AttendCurrentNoise(CCSBot *me); void AttendCurrentNoise(CCSBot *me);
Vector m_checkNoisePosition; Vector m_checkNoisePosition;
@ -185,14 +155,6 @@ public:
virtual void OnExit(CCSBot *me); virtual void OnExit(CCSBot *me);
virtual const char *GetName() const { return "Buy"; } virtual const char *GetName() const { return "Buy"; }
#ifdef HOOK_GAMEDLL
void OnEnter_(CCSBot *me);
void OnUpdate_(CCSBot *me);
void OnExit_(CCSBot *me);
#endif
private: private:
bool m_isInitialDelay; bool m_isInitialDelay;
int m_prefRetries; int m_prefRetries;
@ -213,14 +175,6 @@ public:
virtual void OnExit(CCSBot *me); virtual void OnExit(CCSBot *me);
virtual const char *GetName() const { return "MoveTo"; } virtual const char *GetName() const { return "MoveTo"; }
#ifdef HOOK_GAMEDLL
void OnEnter_(CCSBot *me);
void OnUpdate_(CCSBot *me);
void OnExit_(CCSBot *me);
#endif
void SetGoalPosition(const Vector &pos) { m_goalPosition = pos; } void SetGoalPosition(const Vector &pos) { m_goalPosition = pos; }
void SetRouteType(RouteType route) { m_routeType = route; } void SetRouteType(RouteType route) { m_routeType = route; }
@ -237,14 +191,6 @@ public:
virtual void OnEnter(CCSBot *me); virtual void OnEnter(CCSBot *me);
virtual void OnUpdate(CCSBot *me); virtual void OnUpdate(CCSBot *me);
virtual const char *GetName() const { return "FetchBomb"; } virtual const char *GetName() const { return "FetchBomb"; }
#ifdef HOOK_GAMEDLL
void OnEnter_(CCSBot *me);
void OnUpdate_(CCSBot *me);
#endif
}; };
class PlantBombState: public BotState class PlantBombState: public BotState
@ -254,15 +200,6 @@ public:
virtual void OnUpdate(CCSBot *me); virtual void OnUpdate(CCSBot *me);
virtual void OnExit(CCSBot *me); virtual void OnExit(CCSBot *me);
virtual const char *GetName() const { return "PlantBomb"; } virtual const char *GetName() const { return "PlantBomb"; }
#ifdef HOOK_GAMEDLL
void OnEnter_(CCSBot *me);
void OnUpdate_(CCSBot *me);
void OnExit_(CCSBot *me);
#endif
}; };
class DefuseBombState: public BotState class DefuseBombState: public BotState
@ -272,14 +209,6 @@ public:
virtual void OnUpdate(CCSBot *me); virtual void OnUpdate(CCSBot *me);
virtual void OnExit(CCSBot *me); virtual void OnExit(CCSBot *me);
virtual const char *GetName() const { return "DefuseBomb"; } virtual const char *GetName() const { return "DefuseBomb"; }
#ifdef HOOK_GAMEDLL
void OnEnter_(CCSBot *me);
void OnUpdate_(CCSBot *me);
void OnExit_(CCSBot *me);
#endif
}; };
class HideState: public BotState class HideState: public BotState
@ -290,14 +219,6 @@ public:
virtual void OnExit(CCSBot *me); virtual void OnExit(CCSBot *me);
virtual const char *GetName() const { return "Hide"; } virtual const char *GetName() const { return "Hide"; }
#ifdef HOOK_GAMEDLL
void OnEnter_(CCSBot *me);
void OnUpdate_(CCSBot *me);
void OnExit_(CCSBot *me);
#endif
public: public:
void SetHidingSpot(const Vector &pos) { m_hidingSpot = pos; } void SetHidingSpot(const Vector &pos) { m_hidingSpot = pos; }
const Vector &GetHidingSpot() const { return m_hidingSpot; } const Vector &GetHidingSpot() const { return m_hidingSpot; }
@ -333,15 +254,6 @@ public:
virtual void OnUpdate(CCSBot *me); virtual void OnUpdate(CCSBot *me);
virtual void OnExit(CCSBot *me); virtual void OnExit(CCSBot *me);
virtual const char *GetName() const { return "EscapeFromBomb"; } virtual const char *GetName() const { return "EscapeFromBomb"; }
#ifdef HOOK_GAMEDLL
void OnEnter_(CCSBot *me);
void OnUpdate_(CCSBot *me);
void OnExit_(CCSBot *me);
#endif
}; };
class FollowState: public BotState class FollowState: public BotState
@ -352,19 +264,9 @@ public:
virtual void OnExit(CCSBot *me); virtual void OnExit(CCSBot *me);
virtual const char *GetName() const { return "Follow"; } virtual const char *GetName() const { return "Follow"; }
#ifdef HOOK_GAMEDLL
void OnEnter_(CCSBot *me);
void OnUpdate_(CCSBot *me);
void OnExit_(CCSBot *me);
#endif
void SetLeader(CBaseEntity *leader) { m_leader = leader; } void SetLeader(CBaseEntity *leader) { m_leader = leader; }
#ifndef HOOK_GAMEDLL
private: private:
#endif
void ComputeLeaderMotionState(float leaderSpeed); void ComputeLeaderMotionState(float leaderSpeed);
EHANDLE m_leader; EHANDLE m_leader;
@ -402,14 +304,6 @@ public:
virtual void OnExit(CCSBot *me); virtual void OnExit(CCSBot *me);
virtual const char *GetName() const { return "UseEntity"; } virtual const char *GetName() const { return "UseEntity"; }
#ifdef HOOK_GAMEDLL
void OnEnter_(CCSBot *me);
void OnUpdate_(CCSBot *me);
void OnExit_(CCSBot *me);
#endif
void SetEntity(CBaseEntity *entity) { m_entity = entity; } void SetEntity(CBaseEntity *entity) { m_entity = entity; }
private: private:
@ -422,47 +316,27 @@ class CCSBot: public CBot
public: public:
CCSBot(); // constructor initializes all values to zero CCSBot(); // constructor initializes all values to zero
virtual BOOL TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType); // invoked when injured by something (EXTEND) - returns the amount of damage inflicted virtual BOOL TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType); // invoked when injured by something (EXTEND) - returns the amount of damage inflicted
virtual void Killed(entvars_t *pevAttacker, int iGib); // invoked when killed (EXTEND) virtual void Killed(entvars_t *pevAttacker, int iGib); // invoked when killed (EXTEND)
virtual void RoundRespawn(); virtual void RoundRespawn();
virtual void Blind(float duration, float holdTime, float fadeTime, int alpha = 255); // player blinded by a flashbang virtual void Blind(float duration, float holdTime, float fadeTime, int alpha = 255); // player blinded by a flashbang
virtual void OnTouchingWeapon(CWeaponBox *box); // invoked when in contact with a CWeaponBox virtual void OnTouchingWeapon(CWeaponBox *box); // invoked when in contact with a CWeaponBox
virtual bool Initialize(const BotProfile *profile); // (EXTEND) prepare bot for action virtual bool Initialize(const BotProfile *profile); // (EXTEND) prepare bot for action
virtual void SpawnBot(); // (EXTEND) spawn the bot into the game virtual void SpawnBot(); // (EXTEND) spawn the bot into the game
virtual void Upkeep(); // lightweight maintenance, invoked frequently virtual void Upkeep(); // lightweight maintenance, invoked frequently
virtual void Update(); // heavyweight algorithms, invoked less often virtual void Update(); // heavyweight algorithms, invoked less often
virtual void Walk(); virtual void Walk();
virtual bool Jump(bool mustJump = false); // returns true if jump was started virtual bool Jump(bool mustJump = false); // returns true if jump was started
virtual void OnEvent(GameEventType event, CBaseEntity *entity = NULL, CBaseEntity *other = NULL); // invoked when event occurs in the game (some events have NULL entity) virtual void OnEvent(GameEventType event, CBaseEntity *entity = NULL, CBaseEntity *other = NULL); // invoked when event occurs in the game (some events have NULL entity)
#define CHECK_FOV true #define CHECK_FOV true
virtual bool IsVisible(const Vector *pos, bool testFOV = false) const; // return true if we can see the point virtual bool IsVisible(const Vector *pos, bool testFOV = false) const; // return true if we can see the point
virtual bool IsVisible(CBasePlayer *player, bool testFOV = false, unsigned char *visParts = NULL) const; // return true if we can see any part of the player virtual bool IsVisible(CBasePlayer *player, bool testFOV = false, unsigned char *visParts = NULL) const; // return true if we can see any part of the player
virtual bool IsEnemyPartVisible(VisiblePartType part) const; // if enemy is visible, return the part we see for our current enemy virtual bool IsEnemyPartVisible(VisiblePartType part) const; // if enemy is visible, return the part we see for our current enemy
#ifdef HOOK_GAMEDLL
bool Initialize_(const BotProfile *profile);
void SpawnBot_();
void Upkeep_();
void Update_();
void Walk_();
bool Jump_(bool mustJump);
void Blind_(float duration, float holdTime, float fadeTime, int alpha);
BOOL TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
void Killed_(entvars_t *pevAttacker, int iGib);
void OnTouchingWeapon_(CWeaponBox *box);
void OnEvent_(GameEventType event, CBaseEntity *entity, CBaseEntity *other);
bool IsVisible_(const Vector *pos, bool testFOV) const;
bool IsVisible_(CBasePlayer *player, bool testFOV, unsigned char *visParts) const;
bool IsEnemyPartVisible_(VisiblePartType part) const;
void RoundRespawn_();
#endif
public: public:
void Disconnect(); void Disconnect();
@ -488,70 +362,70 @@ public:
void Hide(const Vector *hidingSpot, float duration = -1.0f, bool holdPosition = false); // move to the given hiding place void Hide(const Vector *hidingSpot, float duration = -1.0f, bool holdPosition = false); // move to the given hiding place
bool IsHiding() const; // returns true if bot is currently hiding bool IsHiding() const; // returns true if bot is currently hiding
bool IsAtHidingSpot() const; // return true if we are hiding and at our hiding spot bool IsAtHidingSpot() const; // return true if we are hiding and at our hiding spot
bool TryToRetreat(); // retreat to a nearby hiding spot, away from enemies bool TryToRetreat(); // retreat to a nearby hiding spot, away from enemies
void Hunt(); void Hunt();
bool IsHunting() const; // returns true if bot is currently hunting bool IsHunting() const; // returns true if bot is currently hunting
void Attack(CBasePlayer *victim); void Attack(CBasePlayer *victim);
void FireWeaponAtEnemy(); // fire our active weapon towards our current enemy void FireWeaponAtEnemy(); // fire our active weapon towards our current enemy
void StopAttacking(); void StopAttacking();
bool IsAttacking() const; // returns true if bot is currently engaging a target bool IsAttacking() const; // returns true if bot is currently engaging a target
void MoveTo(const Vector *pos, RouteType route = SAFEST_ROUTE); // move to potentially distant position void MoveTo(const Vector *pos, RouteType route = SAFEST_ROUTE); // move to potentially distant position
bool IsMovingTo() const; // return true if we are in the MoveTo state bool IsMovingTo() const; // return true if we are in the MoveTo state
void PlantBomb(); void PlantBomb();
void FetchBomb(); // bomb has been dropped - go get it void FetchBomb(); // bomb has been dropped - go get it
bool NoticeLooseBomb() const; // return true if we noticed the bomb on the ground or on radar bool NoticeLooseBomb() const; // return true if we noticed the bomb on the ground or on radar
bool CanSeeLooseBomb() const; // return true if we directly see the loose bomb bool CanSeeLooseBomb() const; // return true if we directly see the loose bomb
bool IsCarryingBomb() const; bool IsCarryingBomb() const;
void DefuseBomb(); void DefuseBomb();
bool IsDefusingBomb() const; // returns true if bot is currently defusing the bomb bool IsDefusingBomb() const; // returns true if bot is currently defusing the bomb
bool CanSeePlantedBomb() const; // return true if we directly see the planted bomb bool CanSeePlantedBomb() const; // return true if we directly see the planted bomb
void EscapeFromBomb(); void EscapeFromBomb();
bool IsEscapingFromBomb() const; // return true if we are escaping from the bomb bool IsEscapingFromBomb() const; // return true if we are escaping from the bomb
void RescueHostages(); void RescueHostages();
void UseEntity(CBaseEntity *entity); // use the entity void UseEntity(CBaseEntity *entity); // use the entity
bool IsBuying() const; bool IsBuying() const;
void Panic(CBasePlayer *enemy); // look around in panic void Panic(CBasePlayer *enemy); // look around in panic
void Follow(CBasePlayer *player); // begin following given Player void Follow(CBasePlayer *player); // begin following given Player
void ContinueFollowing(); // continue following our leader after finishing what we were doing void ContinueFollowing(); // continue following our leader after finishing what we were doing
void StopFollowing(); // stop following void StopFollowing(); // stop following
bool IsFollowing() const; // return true if we are following someone (not necessarily in the follow state) bool IsFollowing() const; // return true if we are following someone (not necessarily in the follow state)
CBasePlayer *GetFollowLeader(); // return the leader we are following CBasePlayer *GetFollowLeader(); // return the leader we are following
float GetFollowDuration() const; // return how long we've been following our leader float GetFollowDuration() const; // return how long we've been following our leader
bool CanAutoFollow() const; // return true if we can auto-follow bool CanAutoFollow() const; // return true if we can auto-follow
bool IsNotMoving() const; // return true if we are currently standing still bool IsNotMoving() const; // return true if we are currently standing still
void AimAtEnemy(); // point our weapon towards our enemy void AimAtEnemy(); // point our weapon towards our enemy
void StopAiming(); // stop aiming at enemy void StopAiming(); // stop aiming at enemy
bool IsAimingAtEnemy() const; // returns true if we are trying to aim at an enemy bool IsAimingAtEnemy() const; // returns true if we are trying to aim at an enemy
bool IsSurprised() const; // return true if we are "surprised" bool IsSurprised() const; // return true if we are "surprised"
float GetSurpriseDelay() const; float GetSurpriseDelay() const;
void ClearSurpriseDelay(); void ClearSurpriseDelay();
float GetStateTimestamp() const; // get time current state was entered float GetStateTimestamp() const; // get time current state was entered
bool IsDoingScenario() const; // return true if we will do scenario-related tasks bool IsDoingScenario() const; // return true if we will do scenario-related tasks
// scenario / gamestate // scenario / gamestate
CSGameState *GetGameState(); // return an interface to this bot's gamestate CSGameState *GetGameState(); // return an interface to this bot's gamestate
const CSGameState *GetGameState() const; // return an interface to this bot's gamestate const CSGameState *GetGameState() const; // return an interface to this bot's gamestate
bool IsAtBombsite(); // return true if we are in a bomb planting zone bool IsAtBombsite(); // return true if we are in a bomb planting zone
bool GuardRandomZone(float range = 500.0f); // pick a random zone and hide near it bool GuardRandomZone(float range = 500.0f); // pick a random zone and hide near it
bool IsBusy() const; // return true if we are busy doing something important bool IsBusy() const; // return true if we are busy doing something important
// high-level tasks // high-level tasks
enum TaskType enum TaskType
@ -587,7 +461,7 @@ public:
// behavior modifiers // behavior modifiers
enum DispositionType enum DispositionType
{ {
ENGAGE_AND_INVESTIGATE, // engage enemies on sight and investigate enemy noises ENGAGE_AND_INVESTIGATE, // engage enemies on sight and investigate enemy noises
OPPORTUNITY_FIRE, // engage enemies on sight, but only look towards enemy noises, dont investigate OPPORTUNITY_FIRE, // engage enemies on sight, but only look towards enemy noises, dont investigate
SELF_DEFENSE, // only engage if fired on, or very close to enemy SELF_DEFENSE, // only engage if fired on, or very close to enemy
IGNORE_ENEMIES, // ignore all enemies - useful for ducking around corners, running away, etc IGNORE_ENEMIES, // ignore all enemies - useful for ducking around corners, running away, etc
@ -595,8 +469,8 @@ public:
NUM_DISPOSITIONS NUM_DISPOSITIONS
}; };
void SetDisposition(DispositionType disposition); // define how we react to enemies void SetDisposition(DispositionType disposition); // define how we react to enemies
DispositionType GetDisposition() const; // return enum describing current disposition DispositionType GetDisposition() const; // return enum describing current disposition
void IgnoreEnemies(float duration); // ignore enemies for a short duration void IgnoreEnemies(float duration); // ignore enemies for a short duration
@ -616,24 +490,24 @@ public:
void DecreaseMorale(); void DecreaseMorale();
// listening for noises // listening for noises
bool IsNoiseHeard() const; // return true if we have heard a noise bool IsNoiseHeard() const; // return true if we have heard a noise
bool ShouldInvestigateNoise(float *retNoiseDist = NULL); bool ShouldInvestigateNoise(float *retNoiseDist = NULL);
void InvestigateNoise(); // investigate recent enemy noise void InvestigateNoise(); // investigate recent enemy noise
const Vector *GetNoisePosition() const; // return position of last heard noise, or NULL if none heard const Vector *GetNoisePosition() const; // return position of last heard noise, or NULL if none heard
CNavArea *GetNoiseArea() const; // return area where noise was heard CNavArea *GetNoiseArea() const; // return area where noise was heard
void ForgetNoise(); // clear the last heard noise void ForgetNoise(); // clear the last heard noise
bool CanSeeNoisePosition() const; // return true if we directly see where we think the noise came from bool CanSeeNoisePosition() const; // return true if we directly see where we think the noise came from
float GetNoiseRange() const; // return approximate distance to last noise heard float GetNoiseRange() const; // return approximate distance to last noise heard
bool CanHearNearbyEnemyGunfire(float range = -1.0f) const; // return true if we hear nearby threatening enemy gunfire within given range (-1 == infinite) bool CanHearNearbyEnemyGunfire(float range = -1.0f) const; // return true if we hear nearby threatening enemy gunfire within given range (-1 == infinite)
PriorityType GetNoisePriority() const; // return priority of last heard noise PriorityType GetNoisePriority() const; // return priority of last heard noise
// radio and chatter // radio and chatter
void SendRadioMessage(GameEventType event); // send voice chatter void SendRadioMessage(GameEventType event); // send voice chatter
BotChatterInterface *GetChatter(); // return an interface to this bot's chatter system BotChatterInterface *GetChatter(); // return an interface to this bot's chatter system
bool RespondToHelpRequest(CBasePlayer *them, Place place, float maxRange = -1.0f); // decide if we should move to help the player, return true if we will bool RespondToHelpRequest(CBasePlayer *them, Place place, float maxRange = -1.0f); // decide if we should move to help the player, return true if we will
void StartVoiceFeedback(float duration); void StartVoiceFeedback(float duration);
bool IsUsingVoice() const; // new-style "voice" chatter gets voice feedback bool IsUsingVoice() const; // new-style "voice" chatter gets voice feedback
// enemies // enemies
// BOTPORT: GetEnemy() collides with GetEnemy() in CBaseEntity - need to use different nomenclature // BOTPORT: GetEnemy() collides with GetEnemy() in CBaseEntity - need to use different nomenclature
@ -642,32 +516,32 @@ public:
CBasePlayer *GetEnemy(); CBasePlayer *GetEnemy();
int GetNearbyEnemyCount() const; // return max number of nearby enemies we've seen recently int GetNearbyEnemyCount() const; // return max number of nearby enemies we've seen recently
unsigned int GetEnemyPlace() const; // return location where we see the majority of our enemies unsigned int GetEnemyPlace() const; // return location where we see the majority of our enemies
bool CanSeeBomber() const; // return true if we can see the bomb carrier bool CanSeeBomber() const; // return true if we can see the bomb carrier
CBasePlayer *GetBomber() const; CBasePlayer *GetBomber() const;
int GetNearbyFriendCount() const; // return number of nearby teammates int GetNearbyFriendCount() const; // return number of nearby teammates
CBasePlayer *GetClosestVisibleFriend() const; // return the closest friend that we can see CBasePlayer *GetClosestVisibleFriend() const; // return the closest friend that we can see
CBasePlayer *GetClosestVisibleHumanFriend() const; // return the closest human friend that we can see CBasePlayer *GetClosestVisibleHumanFriend() const; // return the closest human friend that we can see
bool IsOutnumbered() const; // return true if we are outnumbered by enemies bool IsOutnumbered() const; // return true if we are outnumbered by enemies
int OutnumberedCount() const; // return number of enemies we are outnumbered by int OutnumberedCount() const; // return number of enemies we are outnumbered by
#define ONLY_VISIBLE_ENEMIES true #define ONLY_VISIBLE_ENEMIES true
CBasePlayer *GetImportantEnemy(bool checkVisibility = false) const; // return the closest "important" enemy for the given scenario (bomb carrier, VIP, hostage escorter) CBasePlayer *GetImportantEnemy(bool checkVisibility = false) const; // return the closest "important" enemy for the given scenario (bomb carrier, VIP, hostage escorter)
void UpdateReactionQueue(); // update our reaction time queue void UpdateReactionQueue(); // update our reaction time queue
CBasePlayer *GetRecognizedEnemy(); // return the most dangerous threat we are "conscious" of CBasePlayer *GetRecognizedEnemy(); // return the most dangerous threat we are "conscious" of
bool IsRecognizedEnemyReloading(); // return true if the enemy we are "conscious" of is reloading bool IsRecognizedEnemyReloading(); // return true if the enemy we are "conscious" of is reloading
bool IsRecognizedEnemyProtectedByShield(); // return true if the enemy we are "conscious" of is hiding behind a shield bool IsRecognizedEnemyProtectedByShield(); // return true if the enemy we are "conscious" of is hiding behind a shield
float GetRangeToNearestRecognizedEnemy(); // return distance to closest enemy we are "conscious" of float GetRangeToNearestRecognizedEnemy(); // return distance to closest enemy we are "conscious" of
CBasePlayer *GetAttacker() const; // return last enemy that hurt us CBasePlayer *GetAttacker() const; // return last enemy that hurt us
float GetTimeSinceAttacked() const; // return duration since we were last injured by an attacker float GetTimeSinceAttacked() const; // return duration since we were last injured by an attacker
float GetFirstSawEnemyTimestamp() const; // time since we saw any enemies float GetFirstSawEnemyTimestamp() const; // time since we saw any enemies
float GetLastSawEnemyTimestamp() const; float GetLastSawEnemyTimestamp() const;
float GetTimeSinceLastSawEnemy() const; float GetTimeSinceLastSawEnemy() const;
float GetTimeSinceAcquiredCurrentEnemy() const; float GetTimeSinceAcquiredCurrentEnemy() const;
bool HasNotSeenEnemyForLongTime() const; // return true if we haven't seen an enemy for "a long time" bool HasNotSeenEnemyForLongTime() const; // return true if we haven't seen an enemy for "a long time"
const Vector &GetLastKnownEnemyPosition() const; const Vector &GetLastKnownEnemyPosition() const;
bool IsEnemyVisible() const; // is our current enemy visible bool IsEnemyVisible() const; // is our current enemy visible
float GetEnemyDeathTimestamp() const; float GetEnemyDeathTimestamp() const;
@ -679,7 +553,7 @@ public:
bool HasPath() const; bool HasPath() const;
void DestroyPath(); void DestroyPath();
float GetFeetZ() const; // return Z of bottom of feet float GetFeetZ() const; // return Z of bottom of feet
enum PathResult enum PathResult
{ {
@ -688,12 +562,12 @@ public:
PATH_FAILURE, // we failed to reach the end of the path PATH_FAILURE, // we failed to reach the end of the path
}; };
#define NO_SPEED_CHANGE false #define NO_SPEED_CHANGE false
PathResult UpdatePathMovement(bool allowSpeedChange = true); // move along our computed path - if allowSpeedChange is true, bot will walk when near goal to ensure accuracy PathResult UpdatePathMovement(bool allowSpeedChange = true); // move along our computed path - if allowSpeedChange is true, bot will walk when near goal to ensure accuracy
bool AStarSearch(CNavArea *startArea, CNavArea *goalArea); // find shortest path from startArea to goalArea - don't actually buid the path bool AStarSearch(CNavArea *startArea, CNavArea *goalArea); // find shortest path from startArea to goalArea - don't actually buid the path
bool ComputePath(CNavArea *goalArea, const Vector *goal, RouteType route); // compute path to goal position bool ComputePath(CNavArea *goalArea, const Vector *goal, RouteType route); // compute path to goal position
bool StayOnNavMesh(); bool StayOnNavMesh();
CNavArea *GetLastKnownArea() const; // return the last area we know we were inside of CNavArea *GetLastKnownArea() const; // return the last area we know we were inside of
const Vector &GetPathEndpoint() const; // return final position of our current path const Vector &GetPathEndpoint() const; // return final position of our current path
float GetPathDistanceRemaining() const; // eturn estimated distance left to travel along path float GetPathDistanceRemaining() const; // eturn estimated distance left to travel along path
void ResetStuckMonitor(); void ResetStuckMonitor();
@ -701,38 +575,38 @@ public:
const Vector &GetPathPosition(int numpath) const; const Vector &GetPathPosition(int numpath) const;
bool GetSimpleGroundHeightWithFloor(const Vector *pos, float *height, Vector *normal = NULL); // find "simple" ground height, treating current nav area as part of the floor bool GetSimpleGroundHeightWithFloor(const Vector *pos, float *height, Vector *normal = NULL); // find "simple" ground height, treating current nav area as part of the floor
Place GetPlace() const; // get our current radio chatter place Place GetPlace() const; // get our current radio chatter place
bool IsUsingLadder() const; // returns true if we are in the process of negotiating a ladder bool IsUsingLadder() const; // returns true if we are in the process of negotiating a ladder
void GetOffLadder(); void GetOffLadder();
void SetGoalEntity(CBaseEntity *entity); void SetGoalEntity(CBaseEntity *entity);
CBaseEntity *GetGoalEntity(); CBaseEntity *GetGoalEntity();
bool IsNearJump() const; // return true if nearing a jump in the path bool IsNearJump() const; // return true if nearing a jump in the path
float GetApproximateFallDamage(float height) const; // return how much damage will will take from the given fall height float GetApproximateFallDamage(float height) const; // return how much damage will will take from the given fall height
void ForceRun(float duration); // force the bot to run if it moves for the given duration void ForceRun(float duration); // force the bot to run if it moves for the given duration
void Wiggle(); // random movement, for getting un-stuck void Wiggle(); // random movement, for getting un-stuck
bool IsFriendInTheWay(const Vector *goalPos) const; // return true if a friend is between us and the given position bool IsFriendInTheWay(const Vector *goalPos) const; // return true if a friend is between us and the given position
void FeelerReflexAdjustment(Vector *goalPosition); // do reflex avoidance movements if our "feelers" are touched void FeelerReflexAdjustment(Vector *goalPosition); // do reflex avoidance movements if our "feelers" are touched
// looking around // looking around
void SetLookAngles(float yaw, float pitch); // set our desired look angles void SetLookAngles(float yaw, float pitch); // set our desired look angles
void UpdateLookAngles(); // move actual view angles towards desired ones void UpdateLookAngles(); // move actual view angles towards desired ones
void UpdateLookAround(bool updateNow = false); // update "looking around" mechanism void UpdateLookAround(bool updateNow = false); // update "looking around" mechanism
void InhibitLookAround(float duration); // block all "look at" and "looking around" behavior for given duration - just look ahead void InhibitLookAround(float duration); // block all "look at" and "looking around" behavior for given duration - just look ahead
// TODO: Clean up notion of "forward angle" and "look ahead angle" // TODO: Clean up notion of "forward angle" and "look ahead angle"
void SetForwardAngle(float angle); // define our forward facing void SetForwardAngle(float angle); // define our forward facing
void SetLookAheadAngle(float angle); // define default look ahead angle void SetLookAheadAngle(float angle); // define default look ahead angle
// look at the given point in space for the given duration (-1 means forever) // look at the given point in space for the given duration (-1 means forever)
void SetLookAt(const char *desc, const Vector *pos, PriorityType pri, float duration = -1.0f, bool clearIfClose = false, float angleTolerance = 5.0f); void SetLookAt(const char *desc, const Vector *pos, PriorityType pri, float duration = -1.0f, bool clearIfClose = false, float angleTolerance = 5.0f);
void ClearLookAt(); // stop looking at a point in space and just look ahead void ClearLookAt(); // stop looking at a point in space and just look ahead
bool IsLookingAtSpot(PriorityType pri = PRIORITY_LOW) const; // return true if we are looking at spot with equal or higher priority bool IsLookingAtSpot(PriorityType pri = PRIORITY_LOW) const; // return true if we are looking at spot with equal or higher priority
bool IsViewMoving(float angleVelThreshold = 1.0f) const; // returns true if bot's view angles are rotating (not still) bool IsViewMoving(float angleVelThreshold = 1.0f) const; // returns true if bot's view angles are rotating (not still)
const Vector &GetEyePosition() const const Vector &GetEyePosition() const
{ {
@ -745,31 +619,31 @@ public:
void ComputeApproachPoints(); // determine the set of "approach points" representing where the enemy can enter this region void ComputeApproachPoints(); // determine the set of "approach points" representing where the enemy can enter this region
void UpdateApproachPoints(); // recompute the approach point set if we have moved far enough to invalidate the current ones void UpdateApproachPoints(); // recompute the approach point set if we have moved far enough to invalidate the current ones
void ClearApproachPoints(); void ClearApproachPoints();
void DrawApproachPoints(); // for debugging void DrawApproachPoints(); // for debugging
float GetHidingSpotCheckTimestamp(HidingSpot *spot) const; // return time when given spot was last checked float GetHidingSpotCheckTimestamp(HidingSpot *spot) const; // return time when given spot was last checked
void SetHidingSpotCheckTimestamp(HidingSpot *spot); // set the timestamp of the given spot to now void SetHidingSpotCheckTimestamp(HidingSpot *spot); // set the timestamp of the given spot to now
// weapon query and equip // weapon query and equip
#define MUST_EQUIP true #define MUST_EQUIP true
void EquipBestWeapon(bool mustEquip = false); // equip the best weapon we are carrying that has ammo void EquipBestWeapon(bool mustEquip = false); // equip the best weapon we are carrying that has ammo
void EquipPistol(); // equip our pistol void EquipPistol(); // equip our pistol
void EquipKnife(); // equip our knife void EquipKnife(); // equip our knife
#define DONT_USE_SMOKE_GRENADE true #define DONT_USE_SMOKE_GRENADE true
bool EquipGrenade(bool noSmoke = false); // equip a grenade, return false if we cant bool EquipGrenade(bool noSmoke = false); // equip a grenade, return false if we cant
bool IsUsingKnife() const; // returns true if we have knife equipped bool IsUsingKnife() const; // returns true if we have knife equipped
bool IsUsingPistol() const; // returns true if we have pistol equipped bool IsUsingPistol() const; // returns true if we have pistol equipped
bool IsUsingGrenade() const; // returns true if we have grenade equipped bool IsUsingGrenade() const; // returns true if we have grenade equipped
bool IsUsingSniperRifle() const; // returns true if using a "sniper" rifle bool IsUsingSniperRifle() const; // returns true if using a "sniper" rifle
bool IsUsingAWP() const; // returns true if we have AWP equipped bool IsUsingAWP() const; // returns true if we have AWP equipped
bool IsSniper() const; // return true if we have a sniper rifle in our inventory bool IsSniper() const; // return true if we have a sniper rifle in our inventory
bool IsSniping() const; // return true if we are actively sniping (moving to sniper spot or settled in) bool IsSniping() const; // return true if we are actively sniping (moving to sniper spot or settled in)
bool IsUsingShotgun() const; // returns true if using a shotgun bool IsUsingShotgun() const; // returns true if using a shotgun
bool IsUsingMachinegun() const; // returns true if using the big 'ol machinegun bool IsUsingMachinegun() const; // returns true if using the big 'ol machinegun
void ThrowGrenade(const Vector *target); // begin the process of throwing the grenade void ThrowGrenade(const Vector *target); // begin the process of throwing the grenade
bool IsThrowingGrenade() const; // return true if we are in the process of throwing a grenade bool IsThrowingGrenade() const; // return true if we are in the process of throwing a grenade
bool HasGrenade() const; // return true if we have a grenade in our inventory bool HasGrenade() const; // return true if we have a grenade in our inventory
bool DoesActiveWeaponHaveSilencer() const; bool DoesActiveWeaponHaveSilencer() const;
@ -779,34 +653,32 @@ public:
bool IsRapidFiring() const; bool IsRapidFiring() const;
enum ZoomType { NO_ZOOM, LOW_ZOOM, HIGH_ZOOM }; enum ZoomType { NO_ZOOM, LOW_ZOOM, HIGH_ZOOM };
ZoomType GetZoomLevel() const; // return the current zoom level of our weapon ZoomType GetZoomLevel() const; // return the current zoom level of our weapon
bool AdjustZoom(float range); // change our zoom level to be appropriate for the given range bool AdjustZoom(float range); // change our zoom level to be appropriate for the given range
bool IsPrimaryWeaponEmpty() const; // return true if primary weapon doesn't exist or is totally out of ammo bool IsPrimaryWeaponEmpty() const; // return true if primary weapon doesn't exist or is totally out of ammo
bool IsPistolEmpty() const; // return true if secondary weapon doesn't exist or is totally out of ammo bool IsPistolEmpty() const; // return true if secondary weapon doesn't exist or is totally out of ammo
int GetHostageEscortCount() const; int GetHostageEscortCount() const;
void IncreaseHostageEscortCount(); void IncreaseHostageEscortCount();
float GetRangeToFarthestEscortedHostage() const; float GetRangeToFarthestEscortedHostage() const;
void ResetWaitForHostagePatience(); void ResetWaitForHostagePatience();
void ResetValues(); // reset internal data to initial state void ResetValues(); // reset internal data to initial state
void BotDeathThink(); void BotDeathThink();
CBasePlayer *FindNearbyPlayer(); CBasePlayer *FindNearbyPlayer();
void AdjustSafeTime(); // called when enemy seen to adjust safe time for this round void AdjustSafeTime(); // called when enemy seen to adjust safe time for this round
void EXPORT BotTouch(CBaseEntity *other); void EXPORT BotTouch(CBaseEntity *other);
bool HasAnyAmmo(CBasePlayerWeapon *weapon) const; bool HasAnyAmmo(CBasePlayerWeapon *weapon) const;
#ifndef HOOK_GAMEDLL
private: private:
#endif
friend class CCSBotManager; friend class CCSBotManager;
// TODO: Get rid of these // TODO: Get rid of these
friend class AttackState; friend class AttackState;
friend class BuyState; friend class BuyState;
char m_name[64]; // copied from STRING(pev->netname) for debugging char m_name[64]; // copied from STRING(pev->netname) for debugging
// behavior properties // behavior properties
float m_combatRange; // desired distance between us and them during gunplay float m_combatRange; // desired distance between us and them during gunplay
@ -814,21 +686,21 @@ private:
mutable CountdownTimer m_rogueTimer; mutable CountdownTimer m_rogueTimer;
MoraleType m_morale; // our current morale, based on our win/loss history MoraleType m_morale; // our current morale, based on our win/loss history
bool m_diedLastRound; // true if we died last round bool m_diedLastRound; // true if we died last round
float m_safeTime; // duration at the beginning of the round where we feel "safe" float m_safeTime; // duration at the beginning of the round where we feel "safe"
bool m_wasSafe; // true if we were in the safe time last update bool m_wasSafe; // true if we were in the safe time last update
NavRelativeDirType m_blindMoveDir; // which way to move when we're blind NavRelativeDirType m_blindMoveDir; // which way to move when we're blind
bool m_blindFire; // if true, fire weapon while blinded bool m_blindFire; // if true, fire weapon while blinded
// TODO: implement through CountdownTimer // TODO: implement through CountdownTimer
float m_surpriseDelay; // when we were surprised float m_surpriseDelay; // when we were surprised
float m_surpriseTimestamp; float m_surpriseTimestamp;
bool m_isFollowing; // true if we are following someone bool m_isFollowing; // true if we are following someone
EHANDLE m_leader; // the ID of who we are following EHANDLE m_leader; // the ID of who we are following
float m_followTimestamp; // when we started following float m_followTimestamp; // when we started following
float m_allowAutoFollowTime; // time when we can auto follow float m_allowAutoFollowTime; // time when we can auto follow
CountdownTimer m_hurryTimer; // if valid, bot is in a hurry CountdownTimer m_hurryTimer; // if valid, bot is in a hurry
// instances of each possible behavior state, to avoid dynamic memory allocation during runtime // instances of each possible behavior state, to avoid dynamic memory allocation during runtime
IdleState m_idleState; IdleState m_idleState;
@ -846,13 +718,13 @@ private:
UseEntityState m_useEntityState; UseEntityState m_useEntityState;
// TODO: Allow multiple simultaneous state machines (look around, etc) // TODO: Allow multiple simultaneous state machines (look around, etc)
void SetState(BotState *state); // set the current behavior state void SetState(BotState *state); // set the current behavior state
BotState *m_state; // current behavior state BotState *m_state; // current behavior state
float m_stateTimestamp; // time state was entered float m_stateTimestamp; // time state was entered
bool m_isAttacking; // if true, special Attack state is overriding the state machine bool m_isAttacking; // if true, special Attack state is overriding the state machine
TaskType m_task; // our current task TaskType m_task; // our current task
EHANDLE m_taskEntity; // an entity used for our task EHANDLE m_taskEntity; // an entity used for our task
// navigation // navigation
Vector m_goalPosition; Vector m_goalPosition;
@ -860,10 +732,10 @@ private:
void MoveTowardsPosition(const Vector *pos); // move towards position, independant of view angle void MoveTowardsPosition(const Vector *pos); // move towards position, independant of view angle
void MoveAwayFromPosition(const Vector *pos); // move away from position, independant of view angle void MoveAwayFromPosition(const Vector *pos); // move away from position, independant of view angle
void StrafeAwayFromPosition(const Vector *pos); // strafe (sidestep) away from position, independant of view angle void StrafeAwayFromPosition(const Vector *pos); // strafe (sidestep) away from position, independant of view angle
void StuckCheck(); // check if we have become stuck void StuckCheck(); // check if we have become stuck
CNavArea *m_currentArea; // the nav area we are standing on CNavArea *m_currentArea; // the nav area we are standing on
CNavArea *m_lastKnownArea; // the last area we were in CNavArea *m_lastKnownArea; // the last area we were in
EHANDLE m_avoid; // higher priority player we need to make way for EHANDLE m_avoid; // higher priority player we need to make way for
float m_avoidTimestamp; float m_avoidTimestamp;
bool m_isJumpCrouching; bool m_isJumpCrouching;
@ -874,16 +746,16 @@ private:
enum { MAX_PATH_LENGTH = 256 }; enum { MAX_PATH_LENGTH = 256 };
struct ConnectInfo struct ConnectInfo
{ {
CNavArea *area; // the area along the path CNavArea *area; // the area along the path
NavTraverseType how; // how to enter this area from the previous one NavTraverseType how; // how to enter this area from the previous one
Vector pos; // our movement goal position at this point in the path Vector pos; // our movement goal position at this point in the path
const CNavLadder *ladder; // if "how" refers to a ladder, this is it const CNavLadder *ladder; // if "how" refers to a ladder, this is it
} }
m_path[MAX_PATH_LENGTH]; m_path[MAX_PATH_LENGTH];
int m_pathLength; int m_pathLength;
int m_pathIndex; int m_pathIndex;
float m_areaEnteredTimestamp; float m_areaEnteredTimestamp;
void BuildTrivialPath(const Vector *goal); // build trivial path to goal, assuming we are already in the same area void BuildTrivialPath(const Vector *goal); // build trivial path to goal, assuming we are already in the same area
bool FindGrenadeTossPathTarget(Vector *pos); bool FindGrenadeTossPathTarget(Vector *pos);
CountdownTimer m_repathTimer; // must have elapsed before bot can pathfind again CountdownTimer m_repathTimer; // must have elapsed before bot can pathfind again
@ -893,11 +765,11 @@ private:
void SetPathIndex(int newIndex); // set the current index along the path void SetPathIndex(int newIndex); // set the current index along the path
void DrawPath(); void DrawPath();
int FindOurPositionOnPath(Vector *close, bool local = false) const; // compute the closest point to our current position on our path int FindOurPositionOnPath(Vector *close, bool local = false) const; // compute the closest point to our current position on our path
int FindPathPoint(float aheadRange, Vector *point, int *prevIndex = NULL); // compute a point a fixed distance ahead along our path. int FindPathPoint(float aheadRange, Vector *point, int *prevIndex = NULL); // compute a point a fixed distance ahead along our path.
bool FindClosestPointOnPath(const Vector *worldPos, int startIndex, int endIndex, Vector *close) const; // compute closest point on path to given point bool FindClosestPointOnPath(const Vector *worldPos, int startIndex, int endIndex, Vector *close) const; // compute closest point on path to given point
bool IsStraightLinePathWalkable(const Vector *goal) const; // test for un-jumpable height change, or unrecoverable fall bool IsStraightLinePathWalkable(const Vector *goal) const; // test for un-jumpable height change, or unrecoverable fall
mutable CountdownTimer m_avoidFriendTimer; // used to throttle how often we check for friends in our path mutable CountdownTimer m_avoidFriendTimer; // used to throttle how often we check for friends in our path
mutable bool m_isFriendInTheWay; // true if a friend is blocking our path mutable bool m_isFriendInTheWay; // true if a friend is blocking our path
CountdownTimer m_politeTimer; // we'll wait for friend to move until this runs out CountdownTimer m_politeTimer; // we'll wait for friend to move until this runs out
bool m_isWaitingBehindFriend; // true if we are waiting for a friend to move bool m_isWaitingBehindFriend; // true if we are waiting for a friend to move
@ -913,23 +785,23 @@ private:
FACE_DESCENDING_LADDER, FACE_DESCENDING_LADDER,
MOUNT_ASCENDING_LADDER, // move toward ladder until "on" it MOUNT_ASCENDING_LADDER, // move toward ladder until "on" it
MOUNT_DESCENDING_LADDER, // move toward ladder until "on" it MOUNT_DESCENDING_LADDER, // move toward ladder until "on" it
ASCEND_LADDER, // go up the ladder ASCEND_LADDER, // go up the ladder
DESCEND_LADDER, // go down the ladder DESCEND_LADDER, // go down the ladder
DISMOUNT_ASCENDING_LADDER, // get off of the ladder DISMOUNT_ASCENDING_LADDER, // get off of the ladder
DISMOUNT_DESCENDING_LADDER, // get off of the ladder DISMOUNT_DESCENDING_LADDER, // get off of the ladder
MOVE_TO_DESTINATION, // dismount ladder and move to destination area MOVE_TO_DESTINATION, // dismount ladder and move to destination area
} }
m_pathLadderState; m_pathLadderState;
bool m_pathLadderFaceIn; // if true, face towards ladder, otherwise face away bool m_pathLadderFaceIn; // if true, face towards ladder, otherwise face away
const CNavLadder *m_pathLadder; // the ladder we need to use to reach the next area const CNavLadder *m_pathLadder; // the ladder we need to use to reach the next area
bool UpdateLadderMovement(); // called by UpdatePathMovement() bool UpdateLadderMovement(); // called by UpdatePathMovement()
NavRelativeDirType m_pathLadderDismountDir; // which way to dismount NavRelativeDirType m_pathLadderDismountDir; // which way to dismount
float m_pathLadderDismountTimestamp; // time when dismount started float m_pathLadderDismountTimestamp; // time when dismount started
float m_pathLadderEnd; // if ascending, z of top, if descending z of bottom float m_pathLadderEnd; // if ascending, z of top, if descending z of bottom
void ComputeLadderEndpoint(bool isAscending); void ComputeLadderEndpoint(bool isAscending);
float m_pathLadderTimestamp; // time when we started using ladder - for timeout check float m_pathLadderTimestamp; // time when we started using ladder - for timeout check
CountdownTimer m_mustRunTimer; // if nonzero, bot cannot walk CountdownTimer m_mustRunTimer; // if nonzero, bot cannot walk
// game scenario mechanisms // game scenario mechanisms
CSGameState m_gameState; CSGameState m_gameState;
@ -947,32 +819,32 @@ private:
float m_noiseTimestamp; // when we heard it (can get zeroed) float m_noiseTimestamp; // when we heard it (can get zeroed)
CNavArea *m_noiseArea; // the nav area containing the noise CNavArea *m_noiseArea; // the nav area containing the noise
float m_noiseCheckTimestamp; float m_noiseCheckTimestamp;
PriorityType m_noisePriority; // priority of currently heard noise PriorityType m_noisePriority; // priority of currently heard noise
bool UpdateLookAtNoise(); // return true if we decided to look towards the most recent noise source bool UpdateLookAtNoise(); // return true if we decided to look towards the most recent noise source
bool m_isNoiseTravelRangeChecked; bool m_isNoiseTravelRangeChecked;
// "looking around" mechanism // "looking around" mechanism
float m_lookAroundStateTimestamp; // time of next state change float m_lookAroundStateTimestamp; // time of next state change
float m_lookAheadAngle; // our desired forward look angle float m_lookAheadAngle; // our desired forward look angle
float m_forwardAngle; // our current forward facing direction float m_forwardAngle; // our current forward facing direction
float m_inhibitLookAroundTimestamp; // time when we can look around again float m_inhibitLookAroundTimestamp; // time when we can look around again
enum LookAtSpotState enum LookAtSpotState
{ {
NOT_LOOKING_AT_SPOT, // not currently looking at a point in space NOT_LOOKING_AT_SPOT, // not currently looking at a point in space
LOOK_TOWARDS_SPOT, // in the process of aiming at m_lookAtSpot LOOK_TOWARDS_SPOT, // in the process of aiming at m_lookAtSpot
LOOK_AT_SPOT, // looking at m_lookAtSpot LOOK_AT_SPOT, // looking at m_lookAtSpot
NUM_LOOK_AT_SPOT_STATES NUM_LOOK_AT_SPOT_STATES
} }
m_lookAtSpotState; m_lookAtSpotState;
Vector m_lookAtSpot; // the spot we're currently looking at Vector m_lookAtSpot; // the spot we're currently looking at
PriorityType m_lookAtSpotPriority; PriorityType m_lookAtSpotPriority;
float m_lookAtSpotDuration; // how long we need to look at the spot float m_lookAtSpotDuration; // how long we need to look at the spot
float m_lookAtSpotTimestamp; // when we actually began looking at the spot float m_lookAtSpotTimestamp; // when we actually began looking at the spot
float m_lookAtSpotAngleTolerance; // how exactly we must look at the spot float m_lookAtSpotAngleTolerance; // how exactly we must look at the spot
bool m_lookAtSpotClearIfClose; // if true, the look at spot is cleared if it gets close to us bool m_lookAtSpotClearIfClose; // if true, the look at spot is cleared if it gets close to us
const char *m_lookAtDesc; // for debugging const char *m_lookAtDesc; // for debugging
void UpdateLookAt(); void UpdateLookAt();
void UpdatePeripheralVision(); // update enounter spot timestamps, etc void UpdatePeripheralVision(); // update enounter spot timestamps, etc
float m_peripheralTimestamp; float m_peripheralTimestamp;
@ -982,14 +854,14 @@ private:
unsigned char m_approachPointCount; unsigned char m_approachPointCount;
Vector m_approachPointViewPosition; // the position used when computing current approachPoint set Vector m_approachPointViewPosition; // the position used when computing current approachPoint set
bool BendLineOfSight(const Vector *eye, const Vector *point, Vector *bend) const; // "bend" our line of sight until we can see the target point. Return bend point, false if cant bend. bool BendLineOfSight(const Vector *eye, const Vector *point, Vector *bend) const; // "bend" our line of sight until we can see the target point. Return bend point, false if cant bend.
bool FindApproachPointNearestPath(Vector *pos); // find the approach point that is nearest to our current path, ahead of us bool FindApproachPointNearestPath(Vector *pos); // find the approach point that is nearest to our current path, ahead of us
bool m_isWaitingToTossGrenade; // lining up throw bool m_isWaitingToTossGrenade; // lining up throw
CountdownTimer m_tossGrenadeTimer; // timeout timer for grenade tossing CountdownTimer m_tossGrenadeTimer; // timeout timer for grenade tossing
SpotEncounter *m_spotEncounter; // the spots we will encounter as we move thru our current area SpotEncounter *m_spotEncounter; // the spots we will encounter as we move thru our current area
float m_spotCheckTimestamp; // when to check next encounter spot float m_spotCheckTimestamp; // when to check next encounter spot
// TODO: Add timestamp for each possible client to hiding spots // TODO: Add timestamp for each possible client to hiding spots
enum { MAX_CHECKED_SPOTS = 64 }; enum { MAX_CHECKED_SPOTS = 64 };
@ -1002,32 +874,32 @@ private:
int m_checkedHidingSpotCount; int m_checkedHidingSpotCount;
// view angle mechanism // view angle mechanism
float m_lookPitch; // our desired look pitch angle float m_lookPitch; // our desired look pitch angle
float m_lookPitchVel; float m_lookPitchVel;
float m_lookYaw; // our desired look yaw angle float m_lookYaw; // our desired look yaw angle
float m_lookYawVel; float m_lookYawVel;
// aim angle mechanism // aim angle mechanism
mutable Vector m_eyePos; mutable Vector m_eyePos;
Vector m_aimOffset; // current error added to victim's position to get actual aim spot Vector m_aimOffset; // current error added to victim's position to get actual aim spot
Vector m_aimOffsetGoal; // desired aim offset Vector m_aimOffsetGoal; // desired aim offset
float m_aimOffsetTimestamp; // time of next offset adjustment float m_aimOffsetTimestamp; // time of next offset adjustment
float m_aimSpreadTimestamp; // time used to determine max spread as it begins to tighten up float m_aimSpreadTimestamp; // time used to determine max spread as it begins to tighten up
void SetAimOffset(float accuracy); // set the current aim offset void SetAimOffset(float accuracy); // set the current aim offset
void UpdateAimOffset(); // wiggle aim error based on m_accuracy void UpdateAimOffset(); // wiggle aim error based on m_accuracy
Vector m_aimSpot; // the spot we are currently aiming to fire at Vector m_aimSpot; // the spot we are currently aiming to fire at
// attack state data // attack state data
DispositionType m_disposition; // how we will react to enemies DispositionType m_disposition; // how we will react to enemies
CountdownTimer m_ignoreEnemiesTimer; // how long will we ignore enemies CountdownTimer m_ignoreEnemiesTimer; // how long will we ignore enemies
mutable EHANDLE m_enemy; // our current enemy mutable EHANDLE m_enemy; // our current enemy
bool m_isEnemyVisible; // result of last visibility test on enemy bool m_isEnemyVisible; // result of last visibility test on enemy
unsigned char m_visibleEnemyParts; // which parts of the visible enemy do we see unsigned char m_visibleEnemyParts; // which parts of the visible enemy do we see
Vector m_lastEnemyPosition; // last place we saw the enemy Vector m_lastEnemyPosition; // last place we saw the enemy
float m_lastSawEnemyTimestamp; float m_lastSawEnemyTimestamp;
float m_firstSawEnemyTimestamp; float m_firstSawEnemyTimestamp;
float m_currentEnemyAcquireTimestamp; float m_currentEnemyAcquireTimestamp;
float m_enemyDeathTimestamp; // if m_enemy is dead, this is when he died float m_enemyDeathTimestamp; // if m_enemy is dead, this is when he died
bool m_isLastEnemyDead; // true if we killed or saw our last enemy die bool m_isLastEnemyDead; // true if we killed or saw our last enemy die
int m_nearbyEnemyCount; // max number of enemies we've seen recently int m_nearbyEnemyCount; // max number of enemies we've seen recently
unsigned int m_enemyPlace; // the location where we saw most of our enemies unsigned int m_enemyPlace; // the location where we saw most of our enemies
@ -1038,22 +910,22 @@ private:
bool isEnemy; bool isEnemy;
} }
m_watchInfo[MAX_CLIENTS]; m_watchInfo[MAX_CLIENTS];
mutable EHANDLE m_bomber; // points to bomber if we can see him mutable EHANDLE m_bomber; // points to bomber if we can see him
int m_nearbyFriendCount; // number of nearby teammates int m_nearbyFriendCount; // number of nearby teammates
mutable EHANDLE m_closestVisibleFriend; // the closest friend we can see mutable EHANDLE m_closestVisibleFriend; // the closest friend we can see
mutable EHANDLE m_closestVisibleHumanFriend; // the closest human friend we can see mutable EHANDLE m_closestVisibleHumanFriend; // the closest human friend we can see
CBasePlayer *m_attacker; // last enemy that hurt us (may not be same as m_enemy) CBasePlayer *m_attacker; // last enemy that hurt us (may not be same as m_enemy)
float m_attackedTimestamp; // when we were hurt by the m_attacker float m_attackedTimestamp; // when we were hurt by the m_attacker
int m_lastVictimID; // the entindex of the last victim we killed, or zero int m_lastVictimID; // the entindex of the last victim we killed, or zero
bool m_isAimingAtEnemy; // if true, we are trying to aim at our enemy bool m_isAimingAtEnemy; // if true, we are trying to aim at our enemy
bool m_isRapidFiring; // if true, RunUpkeep() will toggle our primary attack as fast as it can bool m_isRapidFiring; // if true, RunUpkeep() will toggle our primary attack as fast as it can
IntervalTimer m_equipTimer; // how long have we had our current weapon equipped IntervalTimer m_equipTimer; // how long have we had our current weapon equipped
bool DoEquip(CBasePlayerWeapon *gun); // equip the given item bool DoEquip(CBasePlayerWeapon *gun); // equip the given item
void ReloadCheck(); // reload our weapon if we must void ReloadCheck(); // reload our weapon if we must
void SilencerCheck(); // use silencer void SilencerCheck(); // use silencer
float m_fireWeaponTimestamp; float m_fireWeaponTimestamp;
@ -1073,12 +945,12 @@ private:
byte m_enemyQueueCount; byte m_enemyQueueCount;
byte m_enemyQueueAttendIndex; // index of the timeframe we are "conscious" of byte m_enemyQueueAttendIndex; // index of the timeframe we are "conscious" of
CBasePlayer *FindMostDangerousThreat(); // return most dangerous threat in my field of view (feeds into reaction time queue) CBasePlayer *FindMostDangerousThreat(); // return most dangerous threat in my field of view (feeds into reaction time queue)
// stuck detection // stuck detection
bool m_isStuck; bool m_isStuck;
float m_stuckTimestamp; // time when we got stuck float m_stuckTimestamp; // time when we got stuck
Vector m_stuckSpot; // the location where we became stuck Vector m_stuckSpot; // the location where we became stuck
NavRelativeDirType m_wiggleDirection; NavRelativeDirType m_wiggleDirection;
float m_wiggleTimestamp; float m_wiggleTimestamp;
float m_stuckJumpTimestamp; // time for next jump when stuck float m_stuckJumpTimestamp; // time for next jump when stuck
@ -1090,16 +962,16 @@ private:
Vector m_lastOrigin; Vector m_lastOrigin;
// chatter mechanism // chatter mechanism
GameEventType m_lastRadioCommand; // last radio command we recieved GameEventType m_lastRadioCommand; // last radio command we recieved
void RespondToRadioCommands(); void RespondToRadioCommands();
bool IsRadioCommand(GameEventType event) const; // returns true if the radio message is an order to do something bool IsRadioCommand(GameEventType event) const; // returns true if the radio message is an order to do something
#define NO_FORCE false #define NO_FORCE false
void EndVoiceFeedback(bool force = true); void EndVoiceFeedback(bool force = true);
float m_lastRadioRecievedTimestamp; // time we recieved a radio message float m_lastRadioRecievedTimestamp; // time we recieved a radio message
float m_lastRadioSentTimestamp; // time when we send a radio message float m_lastRadioSentTimestamp; // time when we send a radio message
EHANDLE m_radioSubject; // who issued the radio message EHANDLE m_radioSubject; // who issued the radio message
Vector m_radioPosition; // position referred to in radio message Vector m_radioPosition; // position referred to in radio message
float m_voiceFeedbackStartTimestamp; float m_voiceFeedbackStartTimestamp;
float m_voiceFeedbackEndTimestamp; // new-style "voice" chatter gets voice feedback float m_voiceFeedbackEndTimestamp; // new-style "voice" chatter gets voice feedback
BotChatterInterface m_chatter; BotChatterInterface m_chatter;

View File

@ -81,14 +81,14 @@ void BotMeme::Transmit(CCSBot *sender) const
} }
// A teammate called for help - respond // A teammate called for help - respond
void BotHelpMeme::__MAKE_VHOOK(Interpret)(CCSBot *sender, CCSBot *receiver) const void BotHelpMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
{ {
const float maxHelpRange = 3000.0f; // 2000 const float maxHelpRange = 3000.0f; // 2000
receiver->RespondToHelpRequest(sender, m_place, maxHelpRange); receiver->RespondToHelpRequest(sender, m_place, maxHelpRange);
} }
// A teammate reported information about a bombsite // A teammate reported information about a bombsite
void BotBombsiteStatusMeme::__MAKE_VHOOK(Interpret)(CCSBot *sender, CCSBot *receiver) const void BotBombsiteStatusMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
{ {
// remember this bombsite's status // remember this bombsite's status
if (m_status == CLEAR) if (m_status == CLEAR)
@ -108,7 +108,7 @@ void BotBombsiteStatusMeme::__MAKE_VHOOK(Interpret)(CCSBot *sender, CCSBot *rece
} }
// A teammate reported information about the bomb // A teammate reported information about the bomb
void BotBombStatusMeme::__MAKE_VHOOK(Interpret)(CCSBot *sender, CCSBot *receiver) const void BotBombStatusMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
{ {
// update our gamestate based on teammate's report // update our gamestate based on teammate's report
switch (m_state) switch (m_state)
@ -138,7 +138,7 @@ void BotBombStatusMeme::__MAKE_VHOOK(Interpret)(CCSBot *sender, CCSBot *receiver
} }
// A teammate has asked that we follow him // A teammate has asked that we follow him
void BotFollowMeme::__MAKE_VHOOK(Interpret)(CCSBot *sender, CCSBot *receiver) const void BotFollowMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
{ {
if (receiver->IsRogue()) if (receiver->IsRogue())
return; return;
@ -164,7 +164,7 @@ void BotFollowMeme::__MAKE_VHOOK(Interpret)(CCSBot *sender, CCSBot *receiver) co
} }
// A teammate has asked us to defend a place // A teammate has asked us to defend a place
void BotDefendHereMeme::__MAKE_VHOOK(Interpret)(CCSBot *sender, CCSBot *receiver) const void BotDefendHereMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
{ {
if (receiver->IsRogue()) if (receiver->IsRogue())
return; return;
@ -195,7 +195,7 @@ void BotDefendHereMeme::__MAKE_VHOOK(Interpret)(CCSBot *sender, CCSBot *receiver
} }
// A teammate has asked where the bomb is planted // A teammate has asked where the bomb is planted
void BotWhereBombMeme::__MAKE_VHOOK(Interpret)(CCSBot *sender, CCSBot *receiver) const void BotWhereBombMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
{ {
int zone = receiver->GetGameState()->GetPlantedBombsite(); int zone = receiver->GetGameState()->GetPlantedBombsite();
@ -204,13 +204,13 @@ void BotWhereBombMeme::__MAKE_VHOOK(Interpret)(CCSBot *sender, CCSBot *receiver)
} }
// A teammate has asked us to report in // A teammate has asked us to report in
void BotRequestReportMeme::__MAKE_VHOOK(Interpret)(CCSBot *sender, CCSBot *receiver) const void BotRequestReportMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
{ {
receiver->GetChatter()->ReportingIn(); receiver->GetChatter()->ReportingIn();
} }
// A teammate told us all the hostages are gone // A teammate told us all the hostages are gone
void BotAllHostagesGoneMeme::__MAKE_VHOOK(Interpret)(CCSBot *sender, CCSBot *receiver) const void BotAllHostagesGoneMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
{ {
receiver->GetGameState()->AllHostagesGone(); receiver->GetGameState()->AllHostagesGone();
@ -219,7 +219,7 @@ void BotAllHostagesGoneMeme::__MAKE_VHOOK(Interpret)(CCSBot *sender, CCSBot *rec
} }
// A teammate told us a CT is talking to a hostage // A teammate told us a CT is talking to a hostage
void BotHostageBeingTakenMeme::__MAKE_VHOOK(Interpret)(CCSBot *sender, CCSBot *receiver) const void BotHostageBeingTakenMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
{ {
receiver->GetGameState()->HostageWasTaken(); receiver->GetGameState()->HostageWasTaken();

View File

@ -32,10 +32,10 @@
#pragma once #pragma once
#endif #endif
#define UNDEFINED_COUNT 0xFFFF #define UNDEFINED_COUNT 0xFFFF
#define MAX_PLACES_PER_MAP 64 #define MAX_PLACES_PER_MAP 64
#define UNDEFINED_SUBJECT (-1) #define UNDEFINED_SUBJECT (-1)
#define COUNT_MANY 4 // equal to or greater than this is "many" #define COUNT_MANY 4 // equal to or greater than this is "many"
class CCSBot; class CCSBot;
class BotChatterInterface; class BotChatterInterface;
@ -48,7 +48,7 @@ typedef unsigned int CountCriteria;
class BotMeme class BotMeme
{ {
public: public:
void Transmit(CCSBot *sender) const; // transmit meme to other bots void Transmit(CCSBot *sender) const; // transmit meme to other bots
virtual ~BotMeme(){} virtual ~BotMeme(){}
virtual void Interpret(CCSBot *sender, CCSBot *receiver) const = 0; // cause the given bot to act on this meme virtual void Interpret(CCSBot *sender, CCSBot *receiver) const = 0; // cause the given bot to act on this meme
@ -58,26 +58,12 @@ class BotAllHostagesGoneMeme: public BotMeme
{ {
public: public:
virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme
#ifdef HOOK_GAMEDLL
void Interpret_(CCSBot *sender, CCSBot *receiver) const;
#endif
}; };
class BotHostageBeingTakenMeme: public BotMeme class BotHostageBeingTakenMeme: public BotMeme
{ {
public: public:
virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme
#ifdef HOOK_GAMEDLL
void Interpret_(CCSBot *sender, CCSBot *receiver) const;
#endif
}; };
class BotHelpMeme: public BotMeme class BotHelpMeme: public BotMeme
@ -89,12 +75,6 @@ public:
} }
virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme
#ifdef HOOK_GAMEDLL
void Interpret_(CCSBot *sender, CCSBot *receiver) const;
#endif
private: private:
Place m_place; Place m_place;
}; };
@ -104,28 +84,22 @@ class BotBombsiteStatusMeme: public BotMeme
public: public:
enum StatusType { CLEAR, PLANTED }; enum StatusType { CLEAR, PLANTED };
BotBombsiteStatusMeme(int zoneIndex, StatusType status) BotBombsiteStatusMeme(int zoneIndex = 0, StatusType status = CLEAR)
{ {
m_zoneIndex = zoneIndex; m_zoneIndex = zoneIndex;
m_status = status; m_status = status;
} }
virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme
#ifdef HOOK_GAMEDLL
void Interpret_(CCSBot *sender, CCSBot *receiver) const;
#endif
private: private:
int m_zoneIndex; // the bombsite int m_zoneIndex; // the bombsite
StatusType m_status; // whether it is cleared or the bomb is there (planted) StatusType m_status; // whether it is cleared or the bomb is there (planted)
}; };
class BotBombStatusMeme: public BotMeme class BotBombStatusMeme: public BotMeme
{ {
public: public:
BotBombStatusMeme(CSGameState::BombState state, const Vector &pos) BotBombStatusMeme(CSGameState::BombState state = CSGameState::MOVING, const Vector &pos = nullptr)
{ {
m_state = state; m_state = state;
m_pos = pos; m_pos = pos;
@ -134,12 +108,6 @@ public:
public: public:
virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme
#ifdef HOOK_GAMEDLL
void Interpret_(CCSBot *sender, CCSBot *receiver) const;
#endif
private: private:
CSGameState::BombState m_state; CSGameState::BombState m_state;
Vector m_pos; Vector m_pos;
@ -149,28 +117,16 @@ class BotFollowMeme: public BotMeme
{ {
public: public:
virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme
#ifdef HOOK_GAMEDLL
void Interpret_(CCSBot *sender, CCSBot *receiver) const;
#endif
}; };
class BotDefendHereMeme: public BotMeme class BotDefendHereMeme: public BotMeme
{ {
public: public:
BotDefendHereMeme(const Vector &pos) BotDefendHereMeme(const Vector &pos = nullptr)
{ {
m_pos = pos; m_pos = pos;
} }
virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme
#ifdef HOOK_GAMEDLL
void Interpret_(CCSBot *sender, CCSBot *receiver) const;
#endif
private: private:
Vector m_pos; Vector m_pos;
@ -180,25 +136,12 @@ class BotWhereBombMeme: public BotMeme
{ {
public: public:
virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme
#ifdef HOOK_GAMEDLL
void Interpret_(CCSBot *sender, CCSBot *receiver) const;
#endif
}; };
class BotRequestReportMeme: public BotMeme class BotRequestReportMeme: public BotMeme
{ {
public: public:
virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme
#ifdef HOOK_GAMEDLL
void Interpret_(CCSBot *sender, CCSBot *receiver) const;
#endif
}; };
enum BotStatementType enum BotStatementType
@ -214,7 +157,7 @@ enum BotStatementType
REPORT_MY_PLAN, REPORT_MY_PLAN,
REPORT_INFORMATION, REPORT_INFORMATION,
REPORT_EMOTE, REPORT_EMOTE,
REPORT_ACKNOWLEDGE, // affirmative or negative REPORT_ACKNOWLEDGE, // affirmative or negative
REPORT_ENEMIES_REMAINING, REPORT_ENEMIES_REMAINING,
REPORT_FRIENDLY_FIRE, REPORT_FRIENDLY_FIRE,
REPORT_KILLED_FRIEND, REPORT_KILLED_FRIEND,
@ -244,12 +187,12 @@ typedef std::STD_VECTOR<BotSpeakableVector *> BotVoiceBankVector;
class BotPhrase class BotPhrase
{ {
public: public:
char *GetSpeakable(int bankIndex, float *duration = NULL) const; // return a random speakable and its duration in seconds that meets the current criteria char *GetSpeakable(int bankIndex, float *duration = nullptr) const; // return a random speakable and its duration in seconds that meets the current criteria
// NOTE: Criteria must be set just before the GetSpeakable() call, since they are shared among all bots // NOTE: Criteria must be set just before the GetSpeakable() call, since they are shared among all bots
void ClearCriteria() const; void ClearCriteria() const;
void SetPlaceCriteria(PlaceCriteria place) const; // all returned phrases must have this place criteria void SetPlaceCriteria(PlaceCriteria place) const; // all returned phrases must have this place criteria
void SetCountCriteria(CountCriteria count) const; // all returned phrases must have this count criteria void SetCountCriteria(CountCriteria count) const; // all returned phrases must have this count criteria
const char *GetName() const { return m_name; } const char *GetName() const { return m_name; }
Place GetID() const { return m_id; } Place GetID() const { return m_id; }
@ -257,26 +200,23 @@ public:
bool IsImportant() const { return m_isImportant; } // return true if this phrase is part of an important statement bool IsImportant() const { return m_isImportant; } // return true if this phrase is part of an important statement
bool IsPlace() const { return m_isPlace; } bool IsPlace() const { return m_isPlace; }
void Randomize(); // randomly shuffle the speakable order void Randomize(); // randomly shuffle the speakable order
#ifndef HOOK_GAMEDLL
private: private:
#endif
friend class BotPhraseManager; friend class BotPhraseManager;
BotPhrase(unsigned int id, bool isPlace); BotPhrase(unsigned int id, bool isPlace);
~BotPhrase(); ~BotPhrase();
char *m_name; char *m_name;
Place m_id; Place m_id;
bool m_isPlace; // true if this is a Place phrase bool m_isPlace; // true if this is a Place phrase
GameEventType m_radioEvent; GameEventType m_radioEvent;
bool m_isImportant; // mission-critical statement bool m_isImportant; // mission-critical statement
mutable BotVoiceBankVector m_voiceBank; // array of voice banks (arrays of speakables) mutable BotVoiceBankVector m_voiceBank; // array of voice banks (arrays of speakables)
std::STD_VECTOR<int> m_count; // number of speakables std::STD_VECTOR<int> m_count; // number of speakables
mutable std::STD_VECTOR< int > m_index; // index of next speakable to return mutable std::STD_VECTOR< int > m_index; // index of next speakable to return
int m_numVoiceBanks; // number of voice banks that have been initialized int m_numVoiceBanks; // number of voice banks that have been initialized
void InitVoiceBank(int bankIndex); // sets up the vector of voice banks for the first bankIndex voice banks void InitVoiceBank(int bankIndex); // sets up the vector of voice banks for the first bankIndex voice banks
mutable PlaceCriteria m_placeCriteria; mutable PlaceCriteria m_placeCriteria;
@ -336,10 +276,7 @@ public:
// set time of last statement of given type was emitted by a teammate for the given place // set time of last statement of given type was emitted by a teammate for the given place
void ResetPlaceStatementInterval(Place place) const; void ResetPlaceStatementInterval(Place place) const;
#ifndef HOOK_GAMEDLL
private: private:
#endif
int FindPlaceIndex(Place where) const; int FindPlaceIndex(Place where) const;
// master list of all phrase collections // master list of all phrase collections
@ -414,25 +351,25 @@ public:
CCSBot *GetOwner() const; CCSBot *GetOwner() const;
BotStatementType GetType() const { return m_type; } // return the type of statement this is BotStatementType GetType() const { return m_type; } // return the type of statement this is
bool IsImportant() const; // return true if this statement is "important" and not personality chatter bool IsImportant() const; // return true if this statement is "important" and not personality chatter
bool HasSubject() const { return (m_subject != UNDEFINED_SUBJECT); } bool HasSubject() const { return (m_subject != UNDEFINED_SUBJECT); }
void SetSubject(int playerID) { m_subject = playerID; } // who this statement is about void SetSubject(int playerID) { m_subject = playerID; } // who this statement is about
int GetSubject() const { return m_subject; } // who this statement is about int GetSubject() const { return m_subject; } // who this statement is about
bool HasPlace() const { return (GetPlace()) ? true : false; } bool HasPlace() const { return (GetPlace()) ? true : false; }
Place GetPlace() const; // if this statement refers to a specific place, return that place Place GetPlace() const; // if this statement refers to a specific place, return that place
void SetPlace(Place where) { m_place = where; } // explicitly set place void SetPlace(Place where) { m_place = where; } // explicitly set place
bool HasCount() const; // return true if this statement has an associated count bool HasCount() const; // return true if this statement has an associated count
bool IsRedundant(const BotStatement *say) const; // return true if this statement is the same as the given one bool IsRedundant(const BotStatement *say) const; // return true if this statement is the same as the given one
bool IsObsolete() const; // return true if this statement is no longer appropriate to say bool IsObsolete() const; // return true if this statement is no longer appropriate to say
void Convert(const BotStatement *say); // possibly change what were going to say base on what teammate is saying void Convert(const BotStatement *say); // possibly change what were going to say base on what teammate is saying
void AppendPhrase(const BotPhrase *phrase); void AppendPhrase(const BotPhrase *phrase);
void SetStartTime(float timestamp) { m_startTime = timestamp; } // define the earliest time this statement can be spoken void SetStartTime(float timestamp) { m_startTime = timestamp; } // define the earliest time this statement can be spoken
float GetStartTime() const { return m_startTime; } float GetStartTime() const { return m_startTime; }
enum ConditionType enum ConditionType
@ -444,7 +381,7 @@ public:
}; };
void AddCondition(ConditionType condition); // conditions must be true for the statement to be spoken void AddCondition(ConditionType condition); // conditions must be true for the statement to be spoken
bool IsValid() const; // verify all attached conditions bool IsValid() const; // verify all attached conditions
enum ContextType enum ContextType
{ {
@ -456,20 +393,18 @@ public:
}; };
void AppendPhrase(ContextType contextPhrase); // special phrases that depend on the context void AppendPhrase(ContextType contextPhrase); // special phrases that depend on the context
bool Update(); // emit statement over time, return false if statement is done bool Update(); // emit statement over time, return false if statement is done
bool IsSpeaking() const { return m_isSpeaking; } // return true if this statement is currently being spoken bool IsSpeaking() const { return m_isSpeaking; } // return true if this statement is currently being spoken
float GetTimestamp() const { return m_timestamp; } // get time statement was created (but not necessarily started talking) float GetTimestamp() const { return m_timestamp; } // get time statement was created (but not necessarily started talking)
void AttachMeme(BotMeme *meme); // attach a meme to this statement, to be transmitted to other friendly bots when spoken void AttachMeme(BotMeme *meme); // attach a meme to this statement, to be transmitted to other friendly bots when spoken
public: public:
friend class BotChatterInterface; friend class BotChatterInterface;
BotChatterInterface *m_chatter; // the chatter system this statement is part of BotChatterInterface *m_chatter; // the chatter system this statement is part of
BotStatement *m_next, *m_prev; // linked list hooks
BotStatement *m_next, *m_prev; // linked list hooks BotStatementType m_type; // what kind of statement this is
BotStatementType m_type; // what kind of statement this is
int m_subject; // who this subject is about int m_subject; // who this subject is about
Place m_place; // explicit place - note some phrases have implicit places as well Place m_place; // explicit place - note some phrases have implicit places as well
BotMeme *m_meme; // a statement can only have a single meme for now BotMeme *m_meme; // a statement can only have a single meme for now
@ -477,7 +412,7 @@ public:
float m_timestamp; // time when message was created float m_timestamp; // time when message was created
float m_startTime; // the earliest time this statement can be spoken float m_startTime; // the earliest time this statement can be spoken
float m_expireTime; // time when this statement is no longer valid float m_expireTime; // time when this statement is no longer valid
float m_speakTimestamp; // time when message began being spoken float m_speakTimestamp; // time when message began being spoken
bool m_isSpeaking; // true if this statement is current being spoken bool m_isSpeaking; // true if this statement is current being spoken
float m_nextTime; // time for next phrase to begin float m_nextTime; // time for next phrase to begin
@ -523,18 +458,18 @@ public:
NORMAL, // full chatter NORMAL, // full chatter
MINIMAL, // only scenario-critical events MINIMAL, // only scenario-critical events
RADIO, // use the standard radio instead RADIO, // use the standard radio instead
OFF // no chatter at all OFF // no chatter at all
}; };
VerbosityType GetVerbosity() const; // return our current level of verbosity VerbosityType GetVerbosity() const; // return our current level of verbosity
CCSBot *GetOwner() const { return m_me; } CCSBot *GetOwner() const { return m_me; }
bool IsTalking() const; // return true if we are currently talking bool IsTalking() const; // return true if we are currently talking
float GetRadioSilenceDuration(); // return time since any teammate said anything float GetRadioSilenceDuration(); // return time since any teammate said anything
void ResetRadioSilenceDuration(); void ResetRadioSilenceDuration();
enum { MUST_ADD = 1 }; enum { MUST_ADD = 1 };
void AddStatement(BotStatement *statement, bool mustAdd = false); // register a statement for speaking void AddStatement(BotStatement *statement, bool mustAdd = false); // register a statement for speaking
void RemoveStatement(BotStatement *statement); // remove a statement void RemoveStatement(BotStatement *statement); // remove a statement
BotStatement *GetActiveStatement(); // returns the statement that is being spoken, or is next to be spoken if no-one is speaking now BotStatement *GetActiveStatement(); // returns the statement that is being spoken, or is next to be spoken if no-one is speaking now
BotStatement *GetStatement() const; // returns our current statement, or NULL if we aren't speaking BotStatement *GetStatement() const; // returns our current statement, or NULL if we aren't speaking
@ -590,20 +525,17 @@ public:
bool SeesAtLeastOneEnemy() const { return m_seeAtLeastOneEnemy; } bool SeesAtLeastOneEnemy() const { return m_seeAtLeastOneEnemy; }
#ifndef HOOK_GAMEDLL
private: private:
#endif BotStatement *m_statementList; // list of all active/pending messages for this bot
void ReportEnemies(); // track nearby enemy count and generate enemy activity statements
BotStatement *m_statementList; // list of all active/pending messages for this bot bool ShouldSpeak() const; // return true if we speaking makes sense now
void ReportEnemies(); // track nearby enemy count and generate enemy activity statements
bool ShouldSpeak() const; // return true if we speaking makes sense now
CCSBot *m_me; // the bot this chatter is for CCSBot *m_me; // the bot this chatter is for
bool m_seeAtLeastOneEnemy; bool m_seeAtLeastOneEnemy;
float m_timeWhenSawFirstEnemy; float m_timeWhenSawFirstEnemy;
bool m_reportedEnemies; bool m_reportedEnemies;
bool m_requestedBombLocation; // true if we already asked where the bomb has been planted bool m_requestedBombLocation; // true if we already asked where the bomb has been planted
int m_pitch; int m_pitch;
@ -616,14 +548,14 @@ private:
CountdownTimer m_spottedLooseBombTimer; CountdownTimer m_spottedLooseBombTimer;
CountdownTimer m_heardNoiseTimer; CountdownTimer m_heardNoiseTimer;
CountdownTimer m_escortingHostageTimer; CountdownTimer m_escortingHostageTimer;
static CountdownTimer IMPL(m_encourageTimer); // timer to know when we can "encourage" the human player again - shared by all bots static CountdownTimer IMPL(m_encourageTimer); // timer to know when we can "encourage" the human player again - shared by all bots
}; };
inline BotChatterInterface::VerbosityType BotChatterInterface::GetVerbosity() const inline BotChatterInterface::VerbosityType BotChatterInterface::GetVerbosity() const
{ {
const char *string = cv_bot_chatter.string; const char *string = cv_bot_chatter.string;
if (string == NULL) if (string == nullptr)
return NORMAL; return NORMAL;
if (string[0] == 'm' || string[0] == 'M') if (string[0] == 'm' || string[0] == 'M')
@ -640,8 +572,7 @@ inline BotChatterInterface::VerbosityType BotChatterInterface::GetVerbosity() co
inline bool BotChatterInterface::IsTalking() const inline bool BotChatterInterface::IsTalking() const
{ {
if (m_statementList != NULL) if (m_statementList) {
{
return m_statementList->IsSpeaking(); return m_statementList->IsSpeaking();
} }

View File

@ -1,6 +1,6 @@
#include "precompiled.h" #include "precompiled.h"
void CCSBot::__MAKE_VHOOK(OnEvent)(GameEventType event, CBaseEntity *entity, CBaseEntity *other) void CCSBot::OnEvent(GameEventType event, CBaseEntity *entity, CBaseEntity *other)
{ {
GetGameState()->OnEvent(event, entity, other); GetGameState()->OnEvent(event, entity, other);
GetChatter()->OnEvent(event, entity, other); GetChatter()->OnEvent(event, entity, other);
@ -113,7 +113,7 @@ void CCSBot::__MAKE_VHOOK(OnEvent)(GameEventType event, CBaseEntity *entity, CBa
// allow us to sneak past windows, doors, etc // allow us to sneak past windows, doors, etc
IgnoreEnemies(1.0f); IgnoreEnemies(1.0f);
// move to last known position of enemy - this could cause us to flank if // move to last known position of enemy - this could cause us to flank if
// the danger has changed due to our teammate's recent death // the danger has changed due to our teammate's recent death
SetTask(MOVE_TO_LAST_KNOWN_ENEMY_POSITION, GetEnemy()); SetTask(MOVE_TO_LAST_KNOWN_ENEMY_POSITION, GetEnemy());
MoveTo(&GetLastKnownEnemyPosition()); MoveTo(&GetLastKnownEnemyPosition());
@ -133,7 +133,7 @@ void CCSBot::__MAKE_VHOOK(OnEvent)(GameEventType event, CBaseEntity *entity, CBa
GetChatter()->EnemiesRemaining(); GetChatter()->EnemiesRemaining();
if (IsVisible(&victim->pev->origin, CHECK_FOV)) if (IsVisible(&victim->pev->origin, CHECK_FOV))
{ {
// congratulate teammates on their kills // congratulate teammates on their kills
if (killer != this) if (killer != this)
{ {

View File

@ -111,7 +111,7 @@ CCSBot::CCSBot() : m_chatter(this), m_gameState(this)
} }
// Prepare bot for action // Prepare bot for action
bool CCSBot::__MAKE_VHOOK(Initialize)(const BotProfile *profile) bool CCSBot::Initialize(const BotProfile *profile)
{ {
// extend // extend
CBot::Initialize(profile); CBot::Initialize(profile);
@ -292,7 +292,7 @@ void CCSBot::ResetValues()
// Called when bot is placed in map, and when bots are reset after a round ends. // Called when bot is placed in map, and when bots are reset after a round ends.
// NOTE: For some reason, this can be called twice when a bot is added. // NOTE: For some reason, this can be called twice when a bot is added.
void CCSBot::__MAKE_VHOOK(SpawnBot)() void CCSBot::SpawnBot()
{ {
TheCSBots()->ValidateMapData(); TheCSBots()->ValidateMapData();
ResetValues(); ResetValues();
@ -309,7 +309,7 @@ void CCSBot::__MAKE_VHOOK(SpawnBot)()
} }
} }
void CCSBot::__MAKE_VHOOK(RoundRespawn)() void CCSBot::RoundRespawn()
{ {
// do the normal player spawn process // do the normal player spawn process
CBasePlayer::RoundRespawn(); CBasePlayer::RoundRespawn();

View File

@ -87,7 +87,7 @@ CCSBotManager::CCSBotManager()
} }
// Invoked when a new round begins // Invoked when a new round begins
void CCSBotManager::__MAKE_VHOOK(RestartRound)() void CCSBotManager::RestartRound()
{ {
// extend // extend
CBotManager::RestartRound(); CBotManager::RestartRound();
@ -168,7 +168,7 @@ void UTIL_DrawBox(Extent *extent, int lifetime, int red, int green, int blue)
// Called each frame // Called each frame
void CCSBotManager::__MAKE_VHOOK(StartFrame)() void CCSBotManager::StartFrame()
{ {
// EXTEND // EXTEND
CBotManager::StartFrame(); CBotManager::StartFrame();
@ -242,7 +242,7 @@ bool CCSBotManager::IsOnOffense(CBasePlayer *player) const
} }
// Invoked when a map has just been loaded // Invoked when a map has just been loaded
void CCSBotManager::__MAKE_VHOOK(ServerActivate)() void CCSBotManager::ServerActivate()
{ {
DestroyNavigationMap(); DestroyNavigationMap();
IMPL(m_isMapDataLoaded) = false; IMPL(m_isMapDataLoaded) = false;
@ -262,12 +262,12 @@ void CCSBotManager::__MAKE_VHOOK(ServerActivate)()
TheBotPhrases->OnMapChange(); TheBotPhrases->OnMapChange();
} }
void CCSBotManager::__MAKE_VHOOK(AddServerCommand)(const char *cmd) void CCSBotManager::AddServerCommand(const char *cmd)
{ {
ADD_SERVER_COMMAND((char *)cmd, Bot_ServerCommand); ADD_SERVER_COMMAND((char *)cmd, Bot_ServerCommand);
} }
void CCSBotManager::__MAKE_VHOOK(AddServerCommands)() void CCSBotManager::AddServerCommands()
{ {
static bool fFirstTime = true; static bool fFirstTime = true;
@ -322,12 +322,12 @@ void CCSBotManager::__MAKE_VHOOK(AddServerCommands)()
AddServerCommand("bot_nav_check_consistency"); AddServerCommand("bot_nav_check_consistency");
} }
void CCSBotManager::__MAKE_VHOOK(ServerDeactivate)() void CCSBotManager::ServerDeactivate()
{ {
m_bServerActive = false; m_bServerActive = false;
} }
void CCSBotManager::__MAKE_VHOOK(ClientDisconnect)(CBasePlayer *pPlayer) void CCSBotManager::ClientDisconnect(CBasePlayer *pPlayer)
{ {
if (!pPlayer || !pPlayer->IsBot()) if (!pPlayer || !pPlayer->IsBot())
return; return;
@ -362,7 +362,7 @@ void PrintAllEntities()
} }
} }
void CCSBotManager::__MAKE_VHOOK(ServerCommand)(const char *pcmd) void CCSBotManager::ServerCommand(const char *pcmd)
{ {
if (!m_bServerActive || !AreBotsAllowed()) if (!m_bServerActive || !AreBotsAllowed())
return; return;
@ -756,7 +756,7 @@ void CCSBotManager::__MAKE_VHOOK(ServerCommand)(const char *pcmd)
} }
} }
BOOL CCSBotManager::__MAKE_VHOOK(ClientCommand)(CBasePlayer *pPlayer, const char *pcmd) BOOL CCSBotManager::ClientCommand(CBasePlayer *pPlayer, const char *pcmd)
{ {
#ifndef REGAMEDLL_FIXES #ifndef REGAMEDLL_FIXES
if (pPlayer && UTIL_GetLocalPlayer()) if (pPlayer && UTIL_GetLocalPlayer())
@ -1319,7 +1319,7 @@ CNavArea *CCSBotManager::GetRandomAreaInZone(const Zone *zone) const
return zone->m_area[ RANDOM_LONG(0, zone->m_areaCount - 1) ]; return zone->m_area[ RANDOM_LONG(0, zone->m_areaCount - 1) ];
} }
void CCSBotManager::__MAKE_VHOOK(OnEvent)(GameEventType event, CBaseEntity *entity, CBaseEntity *other) void CCSBotManager::OnEvent(GameEventType event, CBaseEntity *entity, CBaseEntity *other)
{ {
switch (event) switch (event)
{ {
@ -1380,7 +1380,7 @@ void CCSBotManager::SetLooseBomb(CBaseEntity *bomb)
} }
// Return true if player is important to scenario (VIP, bomb carrier, etc) // Return true if player is important to scenario (VIP, bomb carrier, etc)
bool CCSBotManager::__MAKE_VHOOK(IsImportantPlayer)(CBasePlayer *player) const bool CCSBotManager::IsImportantPlayer(CBasePlayer *player) const
{ {
switch (GetScenario()) switch (GetScenario())
{ {
@ -1411,7 +1411,7 @@ bool CCSBotManager::__MAKE_VHOOK(IsImportantPlayer)(CBasePlayer *player) const
} }
// Return priority of player (0 = max pri) // Return priority of player (0 = max pri)
unsigned int CCSBotManager::__MAKE_VHOOK(GetPlayerPriority)(CBasePlayer *player) const unsigned int CCSBotManager::GetPlayerPriority(CBasePlayer *player) const
{ {
const unsigned int lowestPriority = 0xFFFFFFFF; const unsigned int lowestPriority = 0xFFFFFFFF;

View File

@ -50,29 +50,12 @@ public:
virtual void AddServerCommand(const char *cmd); virtual void AddServerCommand(const char *cmd);
virtual void AddServerCommands(); virtual void AddServerCommands();
virtual void RestartRound(); // (EXTEND) invoked when a new round begins virtual void RestartRound(); // (EXTEND) invoked when a new round begins
virtual void StartFrame(); // (EXTEND) called each frame virtual void StartFrame(); // (EXTEND) called each frame
virtual void OnEvent(GameEventType event, CBaseEntity *entity = NULL, CBaseEntity *other = NULL); virtual void OnEvent(GameEventType event, CBaseEntity *entity = nullptr, CBaseEntity *other = nullptr);
virtual unsigned int GetPlayerPriority(CBasePlayer *player) const; // return priority of player (0 = max pri) virtual unsigned int GetPlayerPriority(CBasePlayer *player) const; // return priority of player (0 = max pri)
virtual bool IsImportantPlayer(CBasePlayer *player) const; // return true if player is important to scenario (VIP, bomb carrier, etc) virtual bool IsImportantPlayer(CBasePlayer *player) const; // return true if player is important to scenario (VIP, bomb carrier, etc)
#ifdef HOOK_GAMEDLL
void ClientDisconnect_(CBasePlayer *pPlayer);
BOOL ClientCommand_(CBasePlayer *pPlayer, const char *pcmd);
void ServerActivate_();
void ServerDeactivate_();
void ServerCommand_(const char *pcmd);
void AddServerCommand_(const char *cmd);
void AddServerCommands_();
void RestartRound_();
void StartFrame_();
void OnEvent_(GameEventType event, CBaseEntity *entity, CBaseEntity *other);
unsigned int GetPlayerPriority_(CBasePlayer *player) const;
bool IsImportantPlayer_(CBasePlayer *player) const;
#endif
public: public:
void ValidateMapData(); void ValidateMapData();
@ -120,21 +103,21 @@ public:
// "zones" // "zones"
// depending on the game mode, these are bomb zones, rescue zones, etc. // depending on the game mode, these are bomb zones, rescue zones, etc.
enum { MAX_ZONES = 4 }; // max # of zones in a map enum { MAX_ZONES = 4 }; // max # of zones in a map
enum { MAX_ZONE_NAV_AREAS = 16 }; // max # of nav areas in a zone enum { MAX_ZONE_NAV_AREAS = 16 }; // max # of nav areas in a zone
struct Zone struct Zone
{ {
CBaseEntity *m_entity; // the map entity CBaseEntity *m_entity; // the map entity
CNavArea *m_area[MAX_ZONE_NAV_AREAS]; // nav areas that overlap this zone CNavArea *m_area[MAX_ZONE_NAV_AREAS]; // nav areas that overlap this zone
int m_areaCount; int m_areaCount;
Vector m_center; Vector m_center;
bool m_isLegacy; // if true, use pev->origin and 256 unit radius as zone bool m_isLegacy; // if true, use pev->origin and 256 unit radius as zone
int m_index; int m_index;
Extent m_extent; Extent m_extent;
}; };
const Zone *GetZone(int i) const { return &m_zone[i]; } const Zone *GetZone(int i) const { return &m_zone[i]; }
const Zone *GetZone(const Vector *pos) const; // return the zone that contains the given position const Zone *GetZone(const Vector *pos) const; // return the zone that contains the given position
const Zone *GetClosestZone(const Vector *pos) const; // return the closest zone to the given position const Zone *GetClosestZone(const Vector *pos) const; // return the closest zone to the given position
const Zone *GetClosestZone(const CBaseEntity *entity) const { return GetClosestZone(&entity->pev->origin); } // return the closest zone to the given entity const Zone *GetClosestZone(const CBaseEntity *entity) const { return GetClosestZone(&entity->pev->origin); } // return the closest zone to the given entity
int GetZoneCount() const { return m_zoneCount; } int GetZoneCount() const { return m_zoneCount; }
@ -143,13 +126,13 @@ public:
// Return the zone closest to the given position, using the given cost heuristic // Return the zone closest to the given position, using the given cost heuristic
template<typename CostFunctor> template<typename CostFunctor>
const Zone *GetClosestZone(CNavArea *startArea, CostFunctor costFunc, float *travelDistance = NULL) const const Zone *GetClosestZone(CNavArea *startArea, CostFunctor costFunc, float *travelDistance = nullptr) const
{ {
const Zone *closeZone = NULL; const Zone *closeZone = nullptr;
float closeDist = 99999999.9f; float closeDist = 99999999.9f;
if (startArea == NULL) if (startArea == nullptr)
return NULL; return nullptr;
for (int i = 0; i < m_zoneCount; ++i) for (int i = 0; i < m_zoneCount; ++i)
{ {
@ -166,7 +149,7 @@ public:
} }
} }
if (travelDistance != NULL) if (travelDistance)
*travelDistance = closeDist; *travelDistance = closeDist;
return closeZone; return closeZone;
@ -176,22 +159,22 @@ public:
const Zone *GetRandomZone() const const Zone *GetRandomZone() const
{ {
if (!m_zoneCount) if (!m_zoneCount)
return NULL; return nullptr;
return &m_zone[RANDOM_LONG(0, m_zoneCount - 1)]; return &m_zone[RANDOM_LONG(0, m_zoneCount - 1)];
} }
bool IsBombPlanted() const { return m_isBombPlanted; } // returns true if bomb has been planted bool IsBombPlanted() const { return m_isBombPlanted; } // returns true if bomb has been planted
float GetBombPlantTimestamp() const { return m_bombPlantTimestamp; } // return time bomb was planted float GetBombPlantTimestamp() const { return m_bombPlantTimestamp; } // return time bomb was planted
bool IsTimeToPlantBomb() const { return (gpGlobals->time >= m_earliestBombPlantTimestamp); } // return true if it's ok to try to plant bomb bool IsTimeToPlantBomb() const { return (gpGlobals->time >= m_earliestBombPlantTimestamp); } // return true if it's ok to try to plant bomb
CBasePlayer *GetBombDefuser() const { return m_bombDefuser; } // return the player currently defusing the bomb, or NULL CBasePlayer *GetBombDefuser() const { return m_bombDefuser; } // return the player currently defusing the bomb, or NULL
float GetBombTimeLeft() const; // get the time remaining before the planted bomb explodes float GetBombTimeLeft() const; // get the time remaining before the planted bomb explodes
CBaseEntity *GetLooseBomb() { return m_looseBomb; } // return the bomb if it is loose on the ground CBaseEntity *GetLooseBomb() { return m_looseBomb; } // return the bomb if it is loose on the ground
CNavArea *GetLooseBombArea() const { return m_looseBombArea; } // return area that bomb is in/near CNavArea *GetLooseBombArea() const { return m_looseBombArea; } // return area that bomb is in/near
void SetLooseBomb(CBaseEntity *bomb); void SetLooseBomb(CBaseEntity *bomb);
float GetRadioMessageTimestamp(GameEventType event, int teamID) const; // return the last time the given radio message was sent for given team float GetRadioMessageTimestamp(GameEventType event, int teamID) const; // return the last time the given radio message was sent for given team
float GetRadioMessageInterval(GameEventType event, int teamID) const; // return the interval since the last time this message was sent float GetRadioMessageInterval(GameEventType event, int teamID) const; // return the interval since the last time this message was sent
void SetRadioMessageTimestamp(GameEventType event, int teamID); void SetRadioMessageTimestamp(GameEventType event, int teamID);
void ResetRadioMessageTimestamps(); void ResetRadioMessageTimestamps();
@ -214,7 +197,7 @@ public:
bool IsWeaponUseable(CBasePlayerItem *item) const; // return true if the bot can use this weapon bool IsWeaponUseable(CBasePlayerItem *item) const; // return true if the bot can use this weapon
bool IsDefenseRushing() const { return m_isDefenseRushing; } // returns true if defense team has "decided" to rush this round bool IsDefenseRushing() const { return m_isDefenseRushing; } // returns true if defense team has "decided" to rush this round
bool IsOnDefense(CBasePlayer *player) const; // return true if this player is on "defense" bool IsOnDefense(CBasePlayer *player) const; // return true if this player is on "defense"
bool IsOnOffense(CBasePlayer *player) const; // return true if this player is on "offense" bool IsOnOffense(CBasePlayer *player) const; // return true if this player is on "offense"
@ -231,34 +214,32 @@ public:
bool AddBot(const BotProfile *profile, BotProfileTeamType team); bool AddBot(const BotProfile *profile, BotProfileTeamType team);
#define FROM_CONSOLE true #define FROM_CONSOLE true
bool BotAddCommand(BotProfileTeamType team, bool isFromConsole = false); // process the "bot_add" console command bool BotAddCommand(BotProfileTeamType team, bool isFromConsole = false); // process the "bot_add" console command
#ifndef HOOK_GAMEDLL
private: private:
#endif
static float IMPL(m_flNextCVarCheck); static float IMPL(m_flNextCVarCheck);
static bool IMPL(m_isMapDataLoaded); // true if we've attempted to load map data static bool IMPL(m_isMapDataLoaded); // true if we've attempted to load map data
static bool IMPL(m_isLearningMap); static bool IMPL(m_isLearningMap);
static bool IMPL(m_isAnalysisRequested); static bool IMPL(m_isAnalysisRequested);
GameScenarioType m_gameScenario; // what kind of game are we playing GameScenarioType m_gameScenario; // what kind of game are we playing
Zone m_zone[MAX_ZONES]; Zone m_zone[MAX_ZONES];
int m_zoneCount; int m_zoneCount;
bool m_isBombPlanted; // true if bomb has been planted bool m_isBombPlanted; // true if bomb has been planted
float m_bombPlantTimestamp; // time bomb was planted float m_bombPlantTimestamp; // time bomb was planted
float m_earliestBombPlantTimestamp; // don't allow planting until after this time has elapsed float m_earliestBombPlantTimestamp; // don't allow planting until after this time has elapsed
CBasePlayer *m_bombDefuser; // the player currently defusing a bomb CBasePlayer *m_bombDefuser; // the player currently defusing a bomb
EHANDLE m_looseBomb; // will be non-NULL if bomb is loose on the ground EHANDLE m_looseBomb; // will be non-NULL if bomb is loose on the ground
CNavArea *m_looseBombArea; // area that bomb is is/near CNavArea *m_looseBombArea; // area that bomb is is/near
bool m_isRoundOver; // true if the round has ended bool m_isRoundOver; // true if the round has ended
float m_radioMsgTimestamp[24][2]; float m_radioMsgTimestamp[24][2];
float m_lastSeenEnemyTimestamp; float m_lastSeenEnemyTimestamp;
float m_roundStartTimestamp; // the time when the current round began float m_roundStartTimestamp; // the time when the current round began
bool m_isDefenseRushing; // whether defensive team is rushing this round or not bool m_isDefenseRushing; // whether defensive team is rushing this round or not

View File

@ -1,7 +1,7 @@
#include "precompiled.h" #include "precompiled.h"
// Lightweight maintenance, invoked frequently // Lightweight maintenance, invoked frequently
void CCSBot::__MAKE_VHOOK(Upkeep)() void CCSBot::Upkeep()
{ {
if (TheCSBots()->IsLearningMap() || !IsAlive()) if (TheCSBots()->IsLearningMap() || !IsAlive())
return; return;
@ -147,7 +147,7 @@ void CCSBot::__MAKE_VHOOK(Upkeep)()
} }
// Heavyweight processing, invoked less often // Heavyweight processing, invoked less often
void CCSBot::__MAKE_VHOOK(Update)() void CCSBot::Update()
{ {
if (TheCSBots()->IsAnalysisRequested() && m_processMode == PROCESS_NORMAL) if (TheCSBots()->IsAnalysisRequested() && m_processMode == PROCESS_NORMAL)
{ {

View File

@ -194,7 +194,7 @@ void CCSBot::UpdateLookAngles()
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
// Return true if we can see the point // Return true if we can see the point
bool CCSBot::__MAKE_VHOOK(IsVisible)(const Vector *pos, bool testFOV) const bool CCSBot::IsVisible(const Vector *pos, bool testFOV) const
{ {
// we can't see anything if we're blind // we can't see anything if we're blind
if (IsBlind()) if (IsBlind())
@ -221,7 +221,7 @@ bool CCSBot::__MAKE_VHOOK(IsVisible)(const Vector *pos, bool testFOV) const
// Return true if we can see any part of the player // Return true if we can see any part of the player
// Check parts in order of importance. Return the first part seen in "visParts" if it is non-NULL. // Check parts in order of importance. Return the first part seen in "visParts" if it is non-NULL.
bool CCSBot::__MAKE_VHOOK(IsVisible)(CBasePlayer *player, bool testFOV, unsigned char *visParts) const bool CCSBot::IsVisible(CBasePlayer *player, bool testFOV, unsigned char *visParts) const
{ {
Vector spot = player->pev->origin; Vector spot = player->pev->origin;
VisiblePartType testVisParts = NONE; VisiblePartType testVisParts = NONE;
@ -275,7 +275,7 @@ bool CCSBot::__MAKE_VHOOK(IsVisible)(CBasePlayer *player, bool testFOV, unsigned
return false; return false;
} }
bool CCSBot::__MAKE_VHOOK(IsEnemyPartVisible)(VisiblePartType part) const bool CCSBot::IsEnemyPartVisible(VisiblePartType part) const
{ {
if (!IsEnemyVisible()) if (!IsEnemyVisible())
return false; return false;
@ -974,7 +974,7 @@ float CCSBot::GetRangeToNearestRecognizedEnemy()
} }
// Blind the bot for the given duration // Blind the bot for the given duration
void CCSBot::__MAKE_VHOOK(Blind)(float duration, float holdTime, float fadeTime, int alpha) void CCSBot::Blind(float duration, float holdTime, float fadeTime, int alpha)
{ {
// extend // extend
CBasePlayer::Blind(duration, holdTime, fadeTime, alpha); CBasePlayer::Blind(duration, holdTime, fadeTime, alpha);

View File

@ -793,7 +793,7 @@ void CCSBot::SilencerCheck()
} }
// Invoked when in contact with a CWeaponBox // Invoked when in contact with a CWeaponBox
void CCSBot::__MAKE_VHOOK(OnTouchingWeapon)(CWeaponBox *box) void CCSBot::OnTouchingWeapon(CWeaponBox *box)
{ {
auto pDroppedWeapon = box->m_rgpPlayerItems[ PRIMARY_WEAPON_SLOT ]; auto pDroppedWeapon = box->m_rgpPlayerItems[ PRIMARY_WEAPON_SLOT ];

View File

@ -43,7 +43,7 @@ public:
void Reset(); void Reset();
void OnEvent(GameEventType event, CBaseEntity *entity, CBaseEntity *other); // Event handling void OnEvent(GameEventType event, CBaseEntity *entity, CBaseEntity *other); // Event handling
bool IsRoundOver() const; // true if round has been won or lost (but not yet reset) bool IsRoundOver() const; // true if round has been won or lost (but not yet reset)
// bomb defuse scenario // bomb defuse scenario
enum BombState enum BombState
@ -73,22 +73,22 @@ public:
void MarkBombsiteAsPlanted(int zoneIndex); // mark bombsite as the location of the planted bomb void MarkBombsiteAsPlanted(int zoneIndex); // mark bombsite as the location of the planted bomb
enum { UNKNOWN = -1 }; enum { UNKNOWN = -1 };
int GetPlantedBombsite() const; // return the zone index of the planted bombsite, or UNKNOWN int GetPlantedBombsite() const; // return the zone index of the planted bombsite, or UNKNOWN
bool IsAtPlantedBombsite() const; // return true if we are currently in the bombsite where the bomb is planted bool IsAtPlantedBombsite() const; // return true if we are currently in the bombsite where the bomb is planted
int GetNextBombsiteToSearch(); // return the zone index of the next bombsite to search int GetNextBombsiteToSearch(); // return the zone index of the next bombsite to search
bool IsBombsiteClear(int zoneIndex) const; // return true if given bombsite has been cleared bool IsBombsiteClear(int zoneIndex) const; // return true if given bombsite has been cleared
void ClearBombsite(int zoneIndex); // mark bombsite as clear void ClearBombsite(int zoneIndex); // mark bombsite as clear
const Vector *GetBombPosition() const; // return where we think the bomb is, or NULL if we don't know const Vector *GetBombPosition() const; // return where we think the bomb is, or NULL if we don't know
// hostage rescue scenario // hostage rescue scenario
CHostage *GetNearestFreeHostage(Vector *knowPos = NULL) const; // return the closest free hostage, and where we think it is (knowPos) CHostage *GetNearestFreeHostage(Vector *knowPos = NULL) const; // return the closest free hostage, and where we think it is (knowPos)
const Vector *GetRandomFreeHostagePosition(); const Vector *GetRandomFreeHostagePosition();
bool AreAllHostagesBeingRescued() const; // return true if there are no free hostages bool AreAllHostagesBeingRescued() const; // return true if there are no free hostages
bool AreAllHostagesGone() const; // all hostages have been rescued or are dead bool AreAllHostagesGone() const; // all hostages have been rescued or are dead
void AllHostagesGone(); // someone told us all the hostages are gone void AllHostagesGone(); // someone told us all the hostages are gone
bool HaveSomeHostagesBeenTaken() const { return m_haveSomeHostagesBeenTaken; } // return true if one or more hostages have been moved by the CT's bool HaveSomeHostagesBeenTaken() const { return m_haveSomeHostagesBeenTaken; } // return true if one or more hostages have been moved by the CT's
void HostageWasTaken() { m_haveSomeHostagesBeenTaken = true; } // someone told us a CT is talking to a hostage void HostageWasTaken() { m_haveSomeHostagesBeenTaken = true; } // someone told us a CT is talking to a hostage
CHostage *GetNearestVisibleFreeHostage() const; CHostage *GetNearestVisibleFreeHostage() const;
@ -103,10 +103,7 @@ public:
}; };
ValidateStatusType ValidateHostagePositions(); // update our knowledge with what we currently see - returns bitflag events ValidateStatusType ValidateHostagePositions(); // update our knowledge with what we currently see - returns bitflag events
#ifndef HOOK_GAMEDLL
private: private:
#endif
CCSBot *m_owner; // who owns this gamestate CCSBot *m_owner; // who owns this gamestate
bool m_isRoundOver; // true if round is over, but no yet reset bool m_isRoundOver; // true if round is over, but no yet reset
@ -123,13 +120,13 @@ private:
Vector m_looseBombPos; Vector m_looseBombPos;
bool m_isBombsiteClear[4]; // corresponds to zone indices in CCSBotManager bool m_isBombsiteClear[4]; // corresponds to zone indices in CCSBotManager
int m_bombsiteSearchOrder[4]; // randomized order of bombsites to search int m_bombsiteSearchOrder[4]; // randomized order of bombsites to search
int m_bombsiteCount; int m_bombsiteCount;
int m_bombsiteSearchIndex; // the next step in the search int m_bombsiteSearchIndex; // the next step in the search
int m_plantedBombsite; // zone index of the bombsite where the planted bomb is int m_plantedBombsite; // zone index of the bombsite where the planted bomb is
bool m_isPlantedBombPosKnown; // if true, we know the exact location of the bomb bool m_isPlantedBombPosKnown; // if true, we know the exact location of the bomb
Vector m_plantedBombPos; Vector m_plantedBombPos;
// hostage rescue scenario // hostage rescue scenario
@ -142,12 +139,12 @@ private:
bool isFree; // not being escorted by a CT bool isFree; // not being escorted by a CT
} }
m_hostage[MAX_HOSTAGES]; m_hostage[MAX_HOSTAGES];
int m_hostageCount; // number of hostages left in map int m_hostageCount; // number of hostages left in map
CountdownTimer m_validateInterval; CountdownTimer m_validateInterval;
CBaseEntity *GetNearestHostage() const; // return the closest live hostage CBaseEntity *GetNearestHostage() const; // return the closest live hostage
void InitializeHostageInfo(); // initialize our knowledge of the number and location of hostages void InitializeHostageInfo(); // initialize our knowledge of the number and location of hostages
bool m_allHostagesRescued; // if true, so every hostages been is rescued bool m_allHostagesRescued; // if true, so every hostages been is rescued
bool m_haveSomeHostagesBeenTaken; // true if a hostage has been moved by a CT (and we've seen it) bool m_haveSomeHostagesBeenTaken; // true if a hostage has been moved by a CT (and we've seen it)
}; };

View File

@ -1,7 +1,7 @@
#include "precompiled.h" #include "precompiled.h"
// Begin attacking // Begin attacking
void AttackState::__MAKE_VHOOK(OnEnter)(CCSBot *me) void AttackState::OnEnter(CCSBot *me)
{ {
CBasePlayer *enemy = me->GetEnemy(); CBasePlayer *enemy = me->GetEnemy();
@ -125,7 +125,7 @@ void AttackState::StopAttacking(CCSBot *me)
} }
// Perform attack behavior // Perform attack behavior
void AttackState::__MAKE_VHOOK(OnUpdate)(CCSBot *me) void AttackState::OnUpdate(CCSBot *me)
{ {
// can't be stuck while attacking // can't be stuck while attacking
me->ResetStuckMonitor(); me->ResetStuckMonitor();
@ -534,7 +534,7 @@ void AttackState::__MAKE_VHOOK(OnUpdate)(CCSBot *me)
} }
// Finish attack // Finish attack
void AttackState::__MAKE_VHOOK(OnExit)(CCSBot *me) void AttackState::OnExit(CCSBot *me)
{ {
me->PrintIfWatched("AttackState:OnExit()\n"); me->PrintIfWatched("AttackState:OnExit()\n");

View File

@ -17,7 +17,7 @@ bool HasDefaultPistol(CCSBot *me)
} }
// Buy weapons, armor, etc. // Buy weapons, armor, etc.
void BuyState::__MAKE_VHOOK(OnEnter)(CCSBot *me) void BuyState::OnEnter(CCSBot *me)
{ {
m_retries = 0; m_retries = 0;
m_prefRetries = 0; m_prefRetries = 0;
@ -125,64 +125,64 @@ enum WeaponType
struct BuyInfo struct BuyInfo
{ {
WeaponType type; WeaponType type;
bool preferred; // more challenging bots prefer these weapons bool preferred; // more challenging bots prefer these weapons
char *buyAlias; // the buy alias for this equipment char *buyAlias; // the buy alias for this equipment
}; };
// These tables MUST be kept in sync with the CT and T buy aliases // These tables MUST be kept in sync with the CT and T buy aliases
#ifndef HOOK_GAMEDLL #ifndef HOOK_GAMEDLL
static BuyInfo primaryWeaponBuyInfoCT[ PRIMARY_WEAPON_BUY_COUNT ] = BuyInfo primaryWeaponBuyInfoCT[ PRIMARY_WEAPON_BUY_COUNT ] =
{ {
{ SHOTGUN, false, "m3" }, // WEAPON_M3 { SHOTGUN, false, "m3" }, // WEAPON_M3
{ SHOTGUN, false, "xm1014" }, // WEAPON_XM1014 { SHOTGUN, false, "xm1014" }, // WEAPON_XM1014
{ SUB_MACHINE_GUN, false, "tmp" }, // WEAPON_TMP { SUB_MACHINE_GUN, false, "tmp" }, // WEAPON_TMP
{ SUB_MACHINE_GUN, false, "mp5" }, // WEAPON_MP5N { SUB_MACHINE_GUN, false, "mp5" }, // WEAPON_MP5N
{ SUB_MACHINE_GUN, false, "ump45" }, // WEAPON_UMP45 { SUB_MACHINE_GUN, false, "ump45" }, // WEAPON_UMP45
{ SUB_MACHINE_GUN, false, "p90" }, // WEAPON_P90 { SUB_MACHINE_GUN, false, "p90" }, // WEAPON_P90
{ RIFLE, true, "famas" }, // WEAPON_FAMAS { RIFLE, true, "famas" }, // WEAPON_FAMAS
{ SNIPER_RIFLE, false, "scout" }, // WEAPON_SCOUT { SNIPER_RIFLE, false, "scout" }, // WEAPON_SCOUT
{ RIFLE, true, "m4a1" }, // WEAPON_M4A1 { RIFLE, true, "m4a1" }, // WEAPON_M4A1
{ RIFLE, false, "aug" }, // WEAPON_AUG { RIFLE, false, "aug" }, // WEAPON_AUG
{ SNIPER_RIFLE, true, "sg550" }, // WEAPON_SG550 { SNIPER_RIFLE, true, "sg550" }, // WEAPON_SG550
{ SNIPER_RIFLE, true, "awp" }, // WEAPON_AWP { SNIPER_RIFLE, true, "awp" }, // WEAPON_AWP
{ MACHINE_GUN, false, "m249" } // WEAPON_M249 { MACHINE_GUN, false, "m249" }, // WEAPON_M249
}; };
static BuyInfo secondaryWeaponBuyInfoCT[ SECONDARY_WEAPON_BUY_COUNT ] = BuyInfo secondaryWeaponBuyInfoCT[ SECONDARY_WEAPON_BUY_COUNT ] =
{ {
// { PISTOL, false, "glock" }, // { PISTOL, false, "glock" },
// { PISTOL, false, "usp" }, // { PISTOL, false, "usp" },
{ PISTOL, true, "p228" }, { PISTOL, true, "p228" },
{ PISTOL, true, "deagle" }, { PISTOL, true, "deagle" },
{ PISTOL, true, "fn57" } { PISTOL, true, "fn57" },
}; };
static BuyInfo primaryWeaponBuyInfoT[ PRIMARY_WEAPON_BUY_COUNT ] = BuyInfo primaryWeaponBuyInfoT[ PRIMARY_WEAPON_BUY_COUNT ] =
{ {
{ SHOTGUN, false, "m3" }, // WEAPON_M3 { SHOTGUN, false, "m3" }, // WEAPON_M3
{ SHOTGUN, false, "xm1014" }, // WEAPON_XM1014 { SHOTGUN, false, "xm1014" }, // WEAPON_XM1014
{ SUB_MACHINE_GUN, false, "mac10" }, // WEAPON_MAC10 { SUB_MACHINE_GUN, false, "mac10" }, // WEAPON_MAC10
{ SUB_MACHINE_GUN, false, "mp5" }, // WEAPON_MP5N { SUB_MACHINE_GUN, false, "mp5" }, // WEAPON_MP5N
{ SUB_MACHINE_GUN, false, "ump45" }, // WEAPON_UMP45 { SUB_MACHINE_GUN, false, "ump45" }, // WEAPON_UMP45
{ SUB_MACHINE_GUN, false, "p90" }, // WEAPON_P90 { SUB_MACHINE_GUN, false, "p90" }, // WEAPON_P90
{ RIFLE, true, "galil" }, // WEAPON_GALIL { RIFLE, true, "galil" }, // WEAPON_GALIL
{ RIFLE, true, "ak47" }, // WEAPON_AK47 { RIFLE, true, "ak47" }, // WEAPON_AK47
{ SNIPER_RIFLE, false, "scout" }, // WEAPON_SCOUT { SNIPER_RIFLE, false, "scout" }, // WEAPON_SCOUT
{ RIFLE, true, "sg552" }, // WEAPON_SG552 { RIFLE, true, "sg552" }, // WEAPON_SG552
{ SNIPER_RIFLE, true, "awp" }, // WEAPON_AWP { SNIPER_RIFLE, true, "awp" }, // WEAPON_AWP
{ SNIPER_RIFLE, true, "g3sg1" }, // WEAPON_G3SG1 { SNIPER_RIFLE, true, "g3sg1" }, // WEAPON_G3SG1
{ MACHINE_GUN, false, "m249" } // WEAPON_M249 { MACHINE_GUN, false, "m249" }, // WEAPON_M249
}; };
static BuyInfo secondaryWeaponBuyInfoT[ SECONDARY_WEAPON_BUY_COUNT ] = BuyInfo secondaryWeaponBuyInfoT[ SECONDARY_WEAPON_BUY_COUNT ] =
{ {
// { PISTOL, false, "glock" }, // { PISTOL, false, "glock" },
// { PISTOL, false, "usp" }, // { PISTOL, false, "usp" },
{ PISTOL, true, "p228" }, { PISTOL, true, "p228" },
{ PISTOL, true, "deagle" }, { PISTOL, true, "deagle" },
{ PISTOL, true, "elites" } { PISTOL, true, "elites" },
}; };
#else // HOOK_GAMEDLL #else // HOOK_GAMEDLL
@ -220,7 +220,7 @@ inline WeaponType GetWeaponType(const char *alias)
return NUM_WEAPON_TYPES; return NUM_WEAPON_TYPES;
} }
void BuyState::__MAKE_VHOOK(OnUpdate)(CCSBot *me) void BuyState::OnUpdate(CCSBot *me)
{ {
// wait for a Navigation Mesh // wait for a Navigation Mesh
if (!TheNavAreaList.size()) if (!TheNavAreaList.size())
@ -516,7 +516,7 @@ void BuyState::__MAKE_VHOOK(OnUpdate)(CCSBot *me)
} }
} }
void BuyState::__MAKE_VHOOK(OnExit)(CCSBot *me) void BuyState::OnExit(CCSBot *me)
{ {
me->ResetStuckMonitor(); me->ResetStuckMonitor();
me->EquipBestWeapon(); me->EquipBestWeapon();

View File

@ -1,7 +1,7 @@
#include "precompiled.h" #include "precompiled.h"
// Begin defusing the bomb // Begin defusing the bomb
void DefuseBombState::__MAKE_VHOOK(OnEnter)(CCSBot *me) void DefuseBombState::OnEnter(CCSBot *me)
{ {
me->Crouch(); me->Crouch();
me->SetDisposition(CCSBot::SELF_DEFENSE); me->SetDisposition(CCSBot::SELF_DEFENSE);
@ -9,7 +9,7 @@ void DefuseBombState::__MAKE_VHOOK(OnEnter)(CCSBot *me)
} }
// Defuse the bomb // Defuse the bomb
void DefuseBombState::__MAKE_VHOOK(OnUpdate)(CCSBot *me) void DefuseBombState::OnUpdate(CCSBot *me)
{ {
const Vector *bombPos = me->GetGameState()->GetBombPosition(); const Vector *bombPos = me->GetGameState()->GetBombPosition();
@ -60,7 +60,7 @@ void DefuseBombState::__MAKE_VHOOK(OnUpdate)(CCSBot *me)
} }
} }
void DefuseBombState::__MAKE_VHOOK(OnExit)(CCSBot *me) void DefuseBombState::OnExit(CCSBot *me)
{ {
me->StandUp(); me->StandUp();
me->ResetStuckMonitor(); me->ResetStuckMonitor();

View File

@ -1,6 +1,6 @@
#include "precompiled.h" #include "precompiled.h"
void EscapeFromBombState::__MAKE_VHOOK(OnEnter)(CCSBot *me) void EscapeFromBombState::OnEnter(CCSBot *me)
{ {
me->StandUp(); me->StandUp();
me->Run(); me->Run();
@ -9,7 +9,7 @@ void EscapeFromBombState::__MAKE_VHOOK(OnEnter)(CCSBot *me)
} }
// Escape from the bomb // Escape from the bomb
void EscapeFromBombState::__MAKE_VHOOK(OnUpdate)(CCSBot *me) void EscapeFromBombState::OnUpdate(CCSBot *me)
{ {
const Vector *bombPos = me->GetGameState()->GetBombPosition(); const Vector *bombPos = me->GetGameState()->GetBombPosition();
@ -37,7 +37,7 @@ void EscapeFromBombState::__MAKE_VHOOK(OnUpdate)(CCSBot *me)
} }
} }
void EscapeFromBombState::__MAKE_VHOOK(OnExit)(CCSBot *me) void EscapeFromBombState::OnExit(CCSBot *me)
{ {
me->EquipBestWeapon(); me->EquipBestWeapon();
} }

View File

@ -1,13 +1,13 @@
#include "precompiled.h" #include "precompiled.h"
// Move to the bomb on the floor and pick it up // Move to the bomb on the floor and pick it up
void FetchBombState::__MAKE_VHOOK(OnEnter)(CCSBot *me) void FetchBombState::OnEnter(CCSBot *me)
{ {
me->DestroyPath(); me->DestroyPath();
} }
// Move to the bomb on the floor and pick it up // Move to the bomb on the floor and pick it up
void FetchBombState::__MAKE_VHOOK(OnUpdate)(CCSBot *me) void FetchBombState::OnUpdate(CCSBot *me)
{ {
if (me->IsCarryingBomb()) if (me->IsCarryingBomb())
{ {

View File

@ -1,7 +1,7 @@
#include "precompiled.h" #include "precompiled.h"
// Follow our leader // Follow our leader
void FollowState::__MAKE_VHOOK(OnEnter)(CCSBot *me) void FollowState::OnEnter(CCSBot *me)
{ {
me->StandUp(); me->StandUp();
me->Run(); me->Run();
@ -72,7 +72,7 @@ void FollowState::ComputeLeaderMotionState(float leaderSpeed)
// Follow our leader // Follow our leader
// TODO: Clean up this nasty mess // TODO: Clean up this nasty mess
void FollowState::__MAKE_VHOOK(OnUpdate)(CCSBot *me) void FollowState::OnUpdate(CCSBot *me)
{ {
// if we lost our leader, give up // if we lost our leader, give up
if (m_leader == NULL || !m_leader->IsAlive()) if (m_leader == NULL || !m_leader->IsAlive())
@ -254,7 +254,7 @@ void FollowState::__MAKE_VHOOK(OnUpdate)(CCSBot *me)
} }
} }
void FollowState::__MAKE_VHOOK(OnExit)(CCSBot *me) void FollowState::OnExit(CCSBot *me)
{ {
; ;
} }

View File

@ -2,7 +2,7 @@
// Begin moving to a nearby hidey-hole. // Begin moving to a nearby hidey-hole.
// NOTE: Do not forget this state may include a very long "move-to" time to get to our hidey spot! // NOTE: Do not forget this state may include a very long "move-to" time to get to our hidey spot!
void HideState::__MAKE_VHOOK(OnEnter)(CCSBot *me) void HideState::OnEnter(CCSBot *me)
{ {
m_isAtSpot = false; m_isAtSpot = false;
@ -40,7 +40,7 @@ void HideState::__MAKE_VHOOK(OnEnter)(CCSBot *me)
// Move to a nearby hidey-hole. // Move to a nearby hidey-hole.
// NOTE: Do not forget this state may include a very long "move-to" time to get to our hidey spot! // NOTE: Do not forget this state may include a very long "move-to" time to get to our hidey spot!
void HideState::__MAKE_VHOOK(OnUpdate)(CCSBot *me) void HideState::OnUpdate(CCSBot *me)
{ {
// wait until finished reloading to leave hide state // wait until finished reloading to leave hide state
if (!me->IsActiveWeaponReloading()) if (!me->IsActiveWeaponReloading())
@ -421,7 +421,7 @@ void HideState::__MAKE_VHOOK(OnUpdate)(CCSBot *me)
} }
} }
void HideState::__MAKE_VHOOK(OnExit)(CCSBot *me) void HideState::OnExit(CCSBot *me)
{ {
m_isHoldingPosition = false; m_isHoldingPosition = false;

View File

@ -1,7 +1,7 @@
#include "precompiled.h" #include "precompiled.h"
// Begin the hunt // Begin the hunt
void HuntState::__MAKE_VHOOK(OnEnter)(CCSBot *me) void HuntState::OnEnter(CCSBot *me)
{ {
// lurking death // lurking death
if (me->IsUsingKnife() && me->IsWellPastSafe() && !me->IsHurrying()) if (me->IsUsingKnife() && me->IsWellPastSafe() && !me->IsHurrying())
@ -16,7 +16,7 @@ void HuntState::__MAKE_VHOOK(OnEnter)(CCSBot *me)
} }
// Hunt down our enemies // Hunt down our enemies
void HuntState::__MAKE_VHOOK(OnUpdate)(CCSBot *me) void HuntState::OnUpdate(CCSBot *me)
{ {
// if we've been hunting for a long time, drop into Idle for a moment to // if we've been hunting for a long time, drop into Idle for a moment to
// select something else to do // select something else to do
@ -188,7 +188,7 @@ void HuntState::__MAKE_VHOOK(OnUpdate)(CCSBot *me)
} }
// Done hunting // Done hunting
void HuntState::__MAKE_VHOOK(OnExit)(CCSBot *me) void HuntState::OnExit(CCSBot *me)
{ {
; ;
} }

View File

@ -6,7 +6,7 @@ const float sniperHideRange = 2000.0f;
// The Idle state. // The Idle state.
// We never stay in the Idle state - it is a "home base" for the state machine that // We never stay in the Idle state - it is a "home base" for the state machine that
// does various checks to determine what we should do next. // does various checks to determine what we should do next.
void IdleState::__MAKE_VHOOK(OnEnter)(CCSBot *me) void IdleState::OnEnter(CCSBot *me)
{ {
me->DestroyPath(); me->DestroyPath();
me->SetEnemy(NULL); me->SetEnemy(NULL);
@ -21,7 +21,7 @@ void IdleState::__MAKE_VHOOK(OnEnter)(CCSBot *me)
} }
// Determine what we should do next // Determine what we should do next
void IdleState::__MAKE_VHOOK(OnUpdate)(CCSBot *me) void IdleState::OnUpdate(CCSBot *me)
{ {
// all other states assume GetLastKnownArea() is valid, ensure that it is // all other states assume GetLastKnownArea() is valid, ensure that it is
if (!me->GetLastKnownArea() && me->StayOnNavMesh() == false) if (!me->GetLastKnownArea() && me->StayOnNavMesh() == false)

View File

@ -21,13 +21,13 @@ void InvestigateNoiseState::AttendCurrentNoise(CCSBot *me)
me->ForgetNoise(); me->ForgetNoise();
} }
void InvestigateNoiseState::__MAKE_VHOOK(OnEnter)(CCSBot *me) void InvestigateNoiseState::OnEnter(CCSBot *me)
{ {
AttendCurrentNoise(me); AttendCurrentNoise(me);
} }
// Use TravelDistance instead of distance... // Use TravelDistance instead of distance...
void InvestigateNoiseState::__MAKE_VHOOK(OnUpdate)(CCSBot *me) void InvestigateNoiseState::OnUpdate(CCSBot *me)
{ {
float newNoiseDist; float newNoiseDist;
if (me->ShouldInvestigateNoise(&newNoiseDist)) if (me->ShouldInvestigateNoise(&newNoiseDist))
@ -104,7 +104,7 @@ void InvestigateNoiseState::__MAKE_VHOOK(OnUpdate)(CCSBot *me)
} }
} }
void InvestigateNoiseState::__MAKE_VHOOK(OnExit)(CCSBot *me) void InvestigateNoiseState::OnExit(CCSBot *me)
{ {
// reset to run mode in case we were sneaking about // reset to run mode in case we were sneaking about
me->Run(); me->Run();

View File

@ -1,7 +1,7 @@
#include "precompiled.h" #include "precompiled.h"
// Move to a potentially far away position. // Move to a potentially far away position.
void MoveToState::__MAKE_VHOOK(OnEnter)(CCSBot *me) void MoveToState::OnEnter(CCSBot *me)
{ {
if (me->IsUsingKnife() && me->IsWellPastSafe() && !me->IsHurrying()) if (me->IsUsingKnife() && me->IsWellPastSafe() && !me->IsHurrying())
{ {
@ -35,7 +35,7 @@ void MoveToState::__MAKE_VHOOK(OnEnter)(CCSBot *me)
} }
// Move to a potentially far away position. // Move to a potentially far away position.
void MoveToState::__MAKE_VHOOK(OnUpdate)(CCSBot *me) void MoveToState::OnUpdate(CCSBot *me)
{ {
// assume that we are paying attention and close enough to know our enemy died // assume that we are paying attention and close enough to know our enemy died
if (me->GetTask() == CCSBot::MOVE_TO_LAST_KNOWN_ENEMY_POSITION) if (me->GetTask() == CCSBot::MOVE_TO_LAST_KNOWN_ENEMY_POSITION)
@ -287,7 +287,7 @@ void MoveToState::__MAKE_VHOOK(OnUpdate)(CCSBot *me)
} }
} }
void MoveToState::__MAKE_VHOOK(OnExit)(CCSBot *me) void MoveToState::OnExit(CCSBot *me)
{ {
// reset to run in case we were walking near our goal position // reset to run in case we were walking near our goal position
me->Run(); me->Run();

View File

@ -1,7 +1,7 @@
#include "precompiled.h" #include "precompiled.h"
// Plant the bomb. // Plant the bomb.
void PlantBombState::__MAKE_VHOOK(OnEnter)(CCSBot *me) void PlantBombState::OnEnter(CCSBot *me)
{ {
me->Crouch(); me->Crouch();
me->SetDisposition(CCSBot::SELF_DEFENSE); me->SetDisposition(CCSBot::SELF_DEFENSE);
@ -14,7 +14,7 @@ void PlantBombState::__MAKE_VHOOK(OnEnter)(CCSBot *me)
} }
// Plant the bomb. // Plant the bomb.
void PlantBombState::__MAKE_VHOOK(OnUpdate)(CCSBot *me) void PlantBombState::OnUpdate(CCSBot *me)
{ {
CBasePlayerWeapon *gun = me->GetActiveWeapon(); CBasePlayerWeapon *gun = me->GetActiveWeapon();
bool holdingC4 = false; bool holdingC4 = false;
@ -44,7 +44,7 @@ void PlantBombState::__MAKE_VHOOK(OnUpdate)(CCSBot *me)
me->Idle(); me->Idle();
} }
void PlantBombState::__MAKE_VHOOK(OnExit)(CCSBot *me) void PlantBombState::OnExit(CCSBot *me)
{ {
// equip our rifle (in case we were interrupted while holding C4) // equip our rifle (in case we were interrupted while holding C4)
me->EquipBestWeapon(); me->EquipBestWeapon();

View File

@ -2,12 +2,12 @@
// Face the entity and "use" it // Face the entity and "use" it
// NOTE: This state assumes we are standing in range of the entity to be used, with no obstructions. // NOTE: This state assumes we are standing in range of the entity to be used, with no obstructions.
void UseEntityState::__MAKE_VHOOK(OnEnter)(CCSBot *me) void UseEntityState::OnEnter(CCSBot *me)
{ {
; ;
} }
void UseEntityState::__MAKE_VHOOK(OnUpdate)(CCSBot *me) void UseEntityState::OnUpdate(CCSBot *me)
{ {
// in the very rare situation where two or more bots "used" a hostage at the same time, // in the very rare situation where two or more bots "used" a hostage at the same time,
// one bot will fail and needs to time out of this state // one bot will fail and needs to time out of this state
@ -38,7 +38,7 @@ void UseEntityState::__MAKE_VHOOK(OnUpdate)(CCSBot *me)
} }
} }
void UseEntityState::__MAKE_VHOOK(OnExit)(CCSBot *me) void UseEntityState::OnExit(CCSBot *me)
{ {
me->ClearLookAt(); me->ClearLookAt();
me->ResetStuckMonitor(); me->ResetStuckMonitor();

View File

@ -55,7 +55,7 @@ TYPEDESCRIPTION CEnvSpark::m_SaveData[] =
IMPLEMENT_SAVERESTORE(CEnvGlobal, CBaseEntity) IMPLEMENT_SAVERESTORE(CEnvGlobal, CBaseEntity)
LINK_ENTITY_TO_CLASS(env_global, CEnvGlobal, CCSEnvGlobal) LINK_ENTITY_TO_CLASS(env_global, CEnvGlobal, CCSEnvGlobal)
void CEnvGlobal::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CEnvGlobal::KeyValue(KeyValueData *pkvd)
{ {
pkvd->fHandled = TRUE; pkvd->fHandled = TRUE;
@ -76,7 +76,7 @@ void CEnvGlobal::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CPointEntity::KeyValue(pkvd); CPointEntity::KeyValue(pkvd);
} }
void CEnvGlobal::__MAKE_VHOOK(Spawn)() void CEnvGlobal::Spawn()
{ {
if (!m_globalstate) if (!m_globalstate)
{ {
@ -93,7 +93,7 @@ void CEnvGlobal::__MAKE_VHOOK(Spawn)()
} }
} }
void CEnvGlobal::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CEnvGlobal::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
GLOBALESTATE oldState = gGlobalState.EntityGetState(m_globalstate); GLOBALESTATE oldState = gGlobalState.EntityGetState(m_globalstate);
GLOBALESTATE newState; GLOBALESTATE newState;
@ -138,7 +138,7 @@ IMPLEMENT_SAVERESTORE(CMultiSource, CBaseEntity)
LINK_ENTITY_TO_CLASS(multisource, CMultiSource, CCSMultiSource) LINK_ENTITY_TO_CLASS(multisource, CMultiSource, CCSMultiSource)
// Cache user-entity-field values until spawn is called. // Cache user-entity-field values until spawn is called.
void CMultiSource::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CMultiSource::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "style") if (FStrEq(pkvd->szKeyName, "style")
|| FStrEq(pkvd->szKeyName, "height") || FStrEq(pkvd->szKeyName, "height")
@ -157,7 +157,7 @@ void CMultiSource::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CPointEntity::KeyValue(pkvd); CPointEntity::KeyValue(pkvd);
} }
void CMultiSource::__MAKE_VHOOK(Spawn)() void CMultiSource::Spawn()
{ {
// set up think for later registration // set up think for later registration
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
@ -178,7 +178,7 @@ void CMultiSource::Restart()
} }
#endif #endif
void CMultiSource::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CMultiSource::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
int i = 0; int i = 0;
@ -214,7 +214,7 @@ void CMultiSource::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCall
} }
} }
BOOL CMultiSource::__MAKE_VHOOK(IsTriggered)(CBaseEntity *) BOOL CMultiSource::IsTriggered(CBaseEntity *)
{ {
// Is everything triggered? // Is everything triggered?
int i = 0; int i = 0;
@ -295,7 +295,7 @@ void CMultiSource::Register()
IMPLEMENT_SAVERESTORE(CBaseButton, CBaseToggle) IMPLEMENT_SAVERESTORE(CBaseButton, CBaseToggle)
void CBaseButton::__MAKE_VHOOK(Precache)() void CBaseButton::Precache()
{ {
char *pszSound; char *pszSound;
@ -355,7 +355,7 @@ void CBaseButton::__MAKE_VHOOK(Precache)()
} }
// Cache user-entity-field values until spawn is called. // Cache user-entity-field values until spawn is called.
void CBaseButton::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CBaseButton::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "changetarget")) if (FStrEq(pkvd->szKeyName, "changetarget"))
{ {
@ -392,7 +392,7 @@ void CBaseButton::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
} }
// ButtonShot // ButtonShot
BOOL CBaseButton::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) BOOL CBaseButton::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{ {
BUTTON_CODE code = ButtonResponseToTouch(); BUTTON_CODE code = ButtonResponseToTouch();
@ -447,7 +447,7 @@ BOOL CBaseButton::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *p
// 3) in-out // 3) in-out
LINK_ENTITY_TO_CLASS(func_button, CBaseButton, CCSButton) LINK_ENTITY_TO_CLASS(func_button, CBaseButton, CCSButton)
void CBaseButton::__MAKE_VHOOK(Spawn)() void CBaseButton::Spawn()
{ {
char *pszSound; char *pszSound;
@ -834,7 +834,7 @@ void CBaseButton::ButtonBackHome()
LINK_ENTITY_TO_CLASS(func_rot_button, CRotButton, CCSRotButton) LINK_ENTITY_TO_CLASS(func_rot_button, CRotButton, CCSRotButton)
void CRotButton::__MAKE_VHOOK(Spawn)() void CRotButton::Spawn()
{ {
char *pszSound; char *pszSound;
@ -899,7 +899,7 @@ void CRotButton::__MAKE_VHOOK(Spawn)()
IMPLEMENT_SAVERESTORE(CMomentaryRotButton, CBaseToggle) IMPLEMENT_SAVERESTORE(CMomentaryRotButton, CBaseToggle)
LINK_ENTITY_TO_CLASS(momentary_rot_button, CMomentaryRotButton, CCSMomentaryRotButton) LINK_ENTITY_TO_CLASS(momentary_rot_button, CMomentaryRotButton, CCSMomentaryRotButton)
void CMomentaryRotButton::__MAKE_VHOOK(Spawn)() void CMomentaryRotButton::Spawn()
{ {
CBaseToggle::AxisDir(pev); CBaseToggle::AxisDir(pev);
@ -939,7 +939,7 @@ void CMomentaryRotButton::__MAKE_VHOOK(Spawn)()
m_lastUsed = 0; m_lastUsed = 0;
} }
void CMomentaryRotButton::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CMomentaryRotButton::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "returnspeed")) if (FStrEq(pkvd->szKeyName, "returnspeed"))
{ {
@ -963,7 +963,7 @@ void CMomentaryRotButton::PlaySound()
// BUGBUG: This design causes a latentcy. When the button is retriggered, the first impulse // BUGBUG: This design causes a latentcy. When the button is retriggered, the first impulse
// will send the target in the wrong direction because the parameter is calculated based on the // will send the target in the wrong direction because the parameter is calculated based on the
// current, not future position. // current, not future position.
void CMomentaryRotButton::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CMomentaryRotButton::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
pev->ideal_yaw = CBaseToggle::AxisDelta(pev->spawnflags, pev->angles, m_start) / m_flMoveDistance; pev->ideal_yaw = CBaseToggle::AxisDelta(pev->spawnflags, pev->angles, m_start) / m_flMoveDistance;
@ -1115,7 +1115,7 @@ IMPLEMENT_SAVERESTORE(CEnvSpark, CBaseEntity)
LINK_ENTITY_TO_CLASS(env_spark, CEnvSpark, CCSEnvSpark) LINK_ENTITY_TO_CLASS(env_spark, CEnvSpark, CCSEnvSpark)
LINK_ENTITY_TO_CLASS(env_debris, CEnvSpark, CCSEnvSpark) LINK_ENTITY_TO_CLASS(env_debris, CEnvSpark, CCSEnvSpark)
void CEnvSpark::__MAKE_VHOOK(Spawn)() void CEnvSpark::Spawn()
{ {
SetThink(NULL); SetThink(NULL);
SetUse(NULL); SetUse(NULL);
@ -1148,7 +1148,7 @@ void CEnvSpark::__MAKE_VHOOK(Spawn)()
Precache(); Precache();
} }
void CEnvSpark::__MAKE_VHOOK(Precache)() void CEnvSpark::Precache()
{ {
PRECACHE_SOUND("buttons/spark1.wav"); PRECACHE_SOUND("buttons/spark1.wav");
PRECACHE_SOUND("buttons/spark2.wav"); PRECACHE_SOUND("buttons/spark2.wav");
@ -1158,7 +1158,7 @@ void CEnvSpark::__MAKE_VHOOK(Precache)()
PRECACHE_SOUND("buttons/spark6.wav"); PRECACHE_SOUND("buttons/spark6.wav");
} }
void CEnvSpark::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CEnvSpark::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "MaxDelay")) if (FStrEq(pkvd->szKeyName, "MaxDelay"))
{ {
@ -1197,7 +1197,7 @@ void CEnvSpark::SparkStop(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP
LINK_ENTITY_TO_CLASS(button_target, CButtonTarget, CCSButtonTarget) LINK_ENTITY_TO_CLASS(button_target, CButtonTarget, CCSButtonTarget)
void CButtonTarget::__MAKE_VHOOK(Spawn)() void CButtonTarget::Spawn()
{ {
pev->movetype = MOVETYPE_PUSH; pev->movetype = MOVETYPE_PUSH;
pev->solid = SOLID_BSP; pev->solid = SOLID_BSP;
@ -1211,7 +1211,7 @@ void CButtonTarget::__MAKE_VHOOK(Spawn)()
} }
} }
void CButtonTarget::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CButtonTarget::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
if (!ShouldToggle(useType, int(pev->frame))) if (!ShouldToggle(useType, int(pev->frame)))
return; return;
@ -1226,7 +1226,7 @@ void CButtonTarget::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCal
SUB_UseTargets(pActivator, USE_OFF, 0); SUB_UseTargets(pActivator, USE_OFF, 0);
} }
int CButtonTarget::__MAKE_VHOOK(ObjectCaps)() int CButtonTarget::ObjectCaps()
{ {
int caps = (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); int caps = (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION);
@ -1236,7 +1236,7 @@ int CButtonTarget::__MAKE_VHOOK(ObjectCaps)()
return caps; return caps;
} }
BOOL CButtonTarget::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) BOOL CButtonTarget::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{ {
Use(Instance(pevAttacker), this, USE_TOGGLE, 0); Use(Instance(pevAttacker), this, USE_TOGGLE, 0);
return TRUE; return TRUE;

View File

@ -63,16 +63,6 @@ public:
virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
static TYPEDESCRIPTION IMPL(m_SaveData)[3]; static TYPEDESCRIPTION IMPL(m_SaveData)[3];
@ -85,12 +75,6 @@ class CRotButton: public CBaseButton
{ {
public: public:
virtual void Spawn(); virtual void Spawn();
#ifdef HOOK_GAMEDLL
void Spawn_();
#endif
}; };
class CMomentaryRotButton: public CBaseToggle class CMomentaryRotButton: public CBaseToggle
@ -113,16 +97,6 @@ public:
} }
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
void EXPORT Off(); void EXPORT Off();
void EXPORT Return(); void EXPORT Return();
@ -153,16 +127,6 @@ public:
virtual int Save(CSave &save); virtual int Save(CSave &save);
virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
#endif
public: public:
void EXPORT SparkThink(); void EXPORT SparkThink();
void EXPORT SparkStart(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); void EXPORT SparkStart(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
@ -180,16 +144,6 @@ public:
virtual int ObjectCaps(); virtual int ObjectCaps();
virtual BOOL TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType); virtual BOOL TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
int ObjectCaps_();
BOOL TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
}; };
char *ButtonSound(int sound); char *ButtonSound(int sound);

View File

@ -9,27 +9,27 @@ CCareerTaskManager *TheCareerTasks = NULL;
const TaskInfo taskInfo[] = const TaskInfo taskInfo[] =
{ {
{ "defuse", EVENT_BOMB_DEFUSED, &CCareerTask::NewTask }, { "defuse", EVENT_BOMB_DEFUSED, &CCareerTask::NewTask },
{ "plant", EVENT_BOMB_PLANTED, &CCareerTask::NewTask }, { "plant", EVENT_BOMB_PLANTED, &CCareerTask::NewTask },
{ "rescue", EVENT_HOSTAGE_RESCUED, &CCareerTask::NewTask }, { "rescue", EVENT_HOSTAGE_RESCUED, &CCareerTask::NewTask },
{ "killall", EVENT_KILL_ALL, &CCareerTask::NewTask }, { "killall", EVENT_KILL_ALL, &CCareerTask::NewTask },
{ "kill", EVENT_KILL, &CCareerTask::NewTask }, { "kill", EVENT_KILL, &CCareerTask::NewTask },
{ "killwith", EVENT_KILL, &CCareerTask::NewTask }, { "killwith", EVENT_KILL, &CCareerTask::NewTask },
{ "killblind", EVENT_KILL_FLASHBANGED, &CCareerTask::NewTask }, { "killblind", EVENT_KILL_FLASHBANGED, &CCareerTask::NewTask },
{ "killvip", EVENT_KILL, &CCareerTask::NewTask }, { "killvip", EVENT_KILL, &CCareerTask::NewTask },
{ "headshot", EVENT_HEADSHOT, &CCareerTask::NewTask }, { "headshot", EVENT_HEADSHOT, &CCareerTask::NewTask },
{ "headshotwith", EVENT_HEADSHOT, &CCareerTask::NewTask }, { "headshotwith", EVENT_HEADSHOT, &CCareerTask::NewTask },
{ "winfast", EVENT_ROUND_WIN, &CCareerTask::NewTask }, { "winfast", EVENT_ROUND_WIN, &CCareerTask::NewTask },
{ "rescue", EVENT_HOSTAGE_RESCUED, &CCareerTask::NewTask }, { "rescue", EVENT_HOSTAGE_RESCUED, &CCareerTask::NewTask },
{ "rescueall", EVENT_ALL_HOSTAGES_RESCUED, &CCareerTask::NewTask }, { "rescueall", EVENT_ALL_HOSTAGES_RESCUED, &CCareerTask::NewTask },
{ "injure", EVENT_PLAYER_TOOK_DAMAGE, &CCareerTask::NewTask }, { "injure", EVENT_PLAYER_TOOK_DAMAGE, &CCareerTask::NewTask },
{ "injurewith", EVENT_PLAYER_TOOK_DAMAGE, &CCareerTask::NewTask }, { "injurewith", EVENT_PLAYER_TOOK_DAMAGE, &CCareerTask::NewTask },
{ "killdefuser", EVENT_KILL, &CCareerTask::NewTask }, { "killdefuser", EVENT_KILL, &CCareerTask::NewTask },
{ "stoprescue", EVENT_KILL, &CCareerTask::NewTask }, { "stoprescue", EVENT_KILL, &CCareerTask::NewTask },
{ "defendhostages", EVENT_ROUND_WIN, &CCareerTask::NewTask }, { "defendhostages", EVENT_ROUND_WIN, &CCareerTask::NewTask },
{ "hostagessurvive", EVENT_ROUND_WIN, &CCareerTask::NewTask }, { "hostagessurvive", EVENT_ROUND_WIN, &CCareerTask::NewTask },
{ "preventdefuse", EVENT_ROUND_WIN, &CPreventDefuseTask::NewTask }, { "preventdefuse", EVENT_ROUND_WIN, &CPreventDefuseTask::NewTask },
{ NULL, EVENT_INVALID, &CCareerTask::NewTask } { nullptr, EVENT_INVALID, &CCareerTask::NewTask },
}; };
#endif #endif
@ -52,7 +52,7 @@ CPreventDefuseTask::CPreventDefuseTask(const char *taskName, GameEventType event
m_defuseStartedThisRound = false; m_defuseStartedThisRound = false;
} }
void CPreventDefuseTask::__MAKE_VHOOK(Reset)() void CPreventDefuseTask::Reset()
{ {
m_bombPlantedThisRound = false; m_bombPlantedThisRound = false;
m_defuseStartedThisRound = false; m_defuseStartedThisRound = false;
@ -60,7 +60,7 @@ void CPreventDefuseTask::__MAKE_VHOOK(Reset)()
CCareerTask::Reset(); CCareerTask::Reset();
} }
void CPreventDefuseTask::__MAKE_VHOOK(OnEvent)(GameEventType event, CBasePlayer *pAttacker, CBasePlayer *pVictim) void CPreventDefuseTask::OnEvent(GameEventType event, CBasePlayer *pAttacker, CBasePlayer *pVictim)
{ {
if (IsComplete()) if (IsComplete())
return; return;
@ -123,7 +123,7 @@ CCareerTask::CCareerTask(const char *taskName, GameEventType event, const char *
} }
} }
void CCareerTask::__MAKE_VHOOK(Reset)() void CCareerTask::Reset()
{ {
m_eventsSeen = 0; m_eventsSeen = 0;
m_isComplete = false; m_isComplete = false;
@ -225,7 +225,7 @@ void CCareerTask::OnWeaponInjury(int weaponId, int weaponClassId, bool attackerH
SendPartialNotification(); SendPartialNotification();
} }
void CCareerTask::__MAKE_VHOOK(OnEvent)(GameEventType event, CBasePlayer *pVictim, CBasePlayer *pAttacker) void CCareerTask::OnEvent(GameEventType event, CBasePlayer *pVictim, CBasePlayer *pAttacker)
{ {
if (m_isComplete) if (m_isComplete)
return; return;

View File

@ -44,13 +44,6 @@ public:
virtual void Reset(); virtual void Reset();
virtual bool IsTaskCompletableThisRound() { return true; } virtual bool IsTaskCompletableThisRound() { return true; }
#ifdef HOOK_GAMEDLL
void OnEvent_(GameEventType event, CBasePlayer *pAttacker, CBasePlayer *pVictim);
void Reset_();
#endif
public: public:
static CCareerTask *NewTask(const char *taskName, GameEventType event, const char *weaponName, int n, bool mustLive, bool crossRounds, int id, bool isComplete); static CCareerTask *NewTask(const char *taskName, GameEventType event, const char *weaponName, int n, bool mustLive, bool crossRounds, int id, bool isComplete);
@ -97,13 +90,6 @@ public:
virtual void Reset(); virtual void Reset();
virtual bool IsTaskCompletableThisRound() { return m_bombPlantedThisRound && !m_defuseStartedThisRound; } virtual bool IsTaskCompletableThisRound() { return m_bombPlantedThisRound && !m_defuseStartedThisRound; }
#ifdef HOOK_GAMEDLL
void OnEvent_(GameEventType event, CBasePlayer *pAttacker, CBasePlayer *pVictim);
void Reset_();
#endif
public: public:
static CCareerTask *NewTask(const char *taskName, GameEventType event, const char *weaponName, int n, bool mustLive, bool crossRounds, int id, bool isComplete); static CCareerTask *NewTask(const char *taskName, GameEventType event, const char *weaponName, int n, bool mustLive, bool crossRounds, int id, bool isComplete);

View File

@ -303,22 +303,10 @@ void REMOVE_ENTITY(edict_t *pEntity)
} }
} }
void CONSOLE_ECHO_(char *pszMsg, ...)
{
va_list argptr;
static char szStr[1024];
va_start(argptr, pszMsg);
vsprintf(szStr, pszMsg, argptr);
va_end(argptr);
SERVER_PRINT(szStr);
}
void loopPerformance() void loopPerformance()
{ {
CPerformanceCounter loopCounter; CCounter loopCounter;
loopCounter.InitializePerformanceCounter(); loopCounter.Init();
double start, end; double start, end;
int i; int i;
@ -777,7 +765,7 @@ CBaseEntity *EHANDLE::operator->()
return (CBaseEntity *)GET_PRIVATE(Get()); return (CBaseEntity *)GET_PRIVATE(Get());
} }
BOOL CBaseEntity::__MAKE_VHOOK(TakeHealth)(float flHealth, int bitsDamageType) BOOL CBaseEntity::TakeHealth(float flHealth, int bitsDamageType)
{ {
if (pev->takedamage == DAMAGE_NO) if (pev->takedamage == DAMAGE_NO)
return FALSE; return FALSE;
@ -795,7 +783,7 @@ BOOL CBaseEntity::__MAKE_VHOOK(TakeHealth)(float flHealth, int bitsDamageType)
return TRUE; return TRUE;
} }
BOOL CBaseEntity::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) BOOL CBaseEntity::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{ {
Vector vecTemp; Vector vecTemp;
@ -846,14 +834,14 @@ BOOL CBaseEntity::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *p
return TRUE; return TRUE;
} }
void CBaseEntity::__MAKE_VHOOK(Killed)(entvars_t *pevAttacker, int iGib) void CBaseEntity::Killed(entvars_t *pevAttacker, int iGib)
{ {
pev->takedamage = DAMAGE_NO; pev->takedamage = DAMAGE_NO;
pev->deadflag = DEAD_DEAD; pev->deadflag = DEAD_DEAD;
UTIL_Remove(this); UTIL_Remove(this);
} }
CBaseEntity *CBaseEntity::__MAKE_VHOOK(GetNextTarget)() CBaseEntity *CBaseEntity::GetNextTarget()
{ {
if (FStringNull(pev->target)) if (FStringNull(pev->target))
return NULL; return NULL;
@ -867,7 +855,7 @@ CBaseEntity *CBaseEntity::__MAKE_VHOOK(GetNextTarget)()
return Instance(pTarget); return Instance(pTarget);
} }
int CBaseEntity::__MAKE_VHOOK(Save)(CSave &save) int CBaseEntity::Save(CSave &save)
{ {
if (save.WriteEntVars("ENTVARS", pev)) if (save.WriteEntVars("ENTVARS", pev))
{ {
@ -877,7 +865,7 @@ int CBaseEntity::__MAKE_VHOOK(Save)(CSave &save)
return 0; return 0;
} }
int CBaseEntity::__MAKE_VHOOK(Restore)(CRestore &restore) int CBaseEntity::Restore(CRestore &restore)
{ {
int status = restore.ReadEntVars("ENTVARS", pev); int status = restore.ReadEntVars("ENTVARS", pev);
if (status) if (status)
@ -948,7 +936,7 @@ void SetObjectCollisionBox(entvars_t *pev)
pev->absmax.z += 1; pev->absmax.z += 1;
} }
void CBaseEntity::__MAKE_VHOOK(SetObjectCollisionBox)() void CBaseEntity::SetObjectCollisionBox()
{ {
::SetObjectCollisionBox(pev); ::SetObjectCollisionBox(pev);
} }
@ -982,7 +970,7 @@ int CBaseEntity::IsDormant()
return (pev->flags & FL_DORMANT) == FL_DORMANT; return (pev->flags & FL_DORMANT) == FL_DORMANT;
} }
BOOL CBaseEntity::__MAKE_VHOOK(IsInWorld)() BOOL CBaseEntity::IsInWorld()
{ {
// position // position
if (pev->origin.x >= 4096.0 || pev->origin.y >= 4096.0 || pev->origin.z >= 4096.0) if (pev->origin.x >= 4096.0 || pev->origin.y >= 4096.0 || pev->origin.z >= 4096.0)
@ -1018,7 +1006,7 @@ int CBaseEntity::ShouldToggle(USE_TYPE useType, BOOL currentState)
return 1; return 1;
} }
int CBaseEntity::__MAKE_VHOOK(DamageDecal)(int bitsDamageType) int CBaseEntity::DamageDecal(int bitsDamageType)
{ {
if (pev->rendermode == kRenderTransAlpha) if (pev->rendermode == kRenderTransAlpha)
return -1; return -1;

View File

@ -294,24 +294,6 @@ public:
virtual BOOL FVisible(CBaseEntity *pEntity); virtual BOOL FVisible(CBaseEntity *pEntity);
virtual BOOL FVisible(const Vector &vecOrigin); virtual BOOL FVisible(const Vector &vecOrigin);
#ifdef HOOK_GAMEDLL
int Save_(CSave &save);
int Restore_(CRestore &restore);
void SetObjectCollisionBox_();
void TraceAttack_(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType);
BOOL TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
BOOL TakeHealth_(float flHealth, int bitsDamageType);
void Killed_(entvars_t *pevAttacker, int iGib);
void TraceBleed_(float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType);
int DamageDecal_(int bitsDamageType);
BOOL IsInWorld_();
CBaseEntity *GetNextTarget_();
BOOL FVisible_(CBaseEntity *pEntity);
BOOL FVisible_(const Vector &vecOrigin);
#endif
public: public:
// allow engine to allocate instance data // allow engine to allocate instance data
void *operator new(size_t stAllocateBlock, entvars_t *pevnew) { return ALLOC_PRIVATE(ENT(pevnew), stAllocateBlock); } void *operator new(size_t stAllocateBlock, entvars_t *pevnew) { return ALLOC_PRIVATE(ENT(pevnew), stAllocateBlock); }
@ -433,13 +415,6 @@ class CPointEntity: public CBaseEntity {
public: public:
virtual void Spawn(); virtual void Spawn();
virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); } virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); }
#ifdef HOOK_GAMEDLL
void Spawn_();
#endif
}; };
// MultiSouce // MultiSouce
@ -457,17 +432,6 @@ public:
virtual void Restart(); virtual void Restart();
#endif #endif
#ifdef HOOK_GAMEDLL
void Spawn_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
BOOL IsTriggered_(CBaseEntity *pActivator);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
void EXPORT Register(); void EXPORT Register();
@ -487,14 +451,6 @@ public:
virtual int Save(CSave &save); virtual int Save(CSave &save);
virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
#ifdef HOOK_GAMEDLL
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
#endif
public: public:
void SUB_UseTargets(CBaseEntity *pActivator, USE_TYPE useType, float value); void SUB_UseTargets(CBaseEntity *pActivator, USE_TYPE useType, float value);
void EXPORT DelayThink(); void EXPORT DelayThink();
@ -511,13 +467,6 @@ public:
virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
virtual void HandleAnimEvent(MonsterEvent_t *pEvent) {} virtual void HandleAnimEvent(MonsterEvent_t *pEvent) {}
#ifdef HOOK_GAMEDLL
int Save_(CSave &save);
int Restore_(CRestore &restore);
#endif
public: public:
// Basic Monster Animation functions // Basic Monster Animation functions
float StudioFrameAdvance(float flInterval = 0.0f); // accumulate animation frame time from last time called until now float StudioFrameAdvance(float flInterval = 0.0f); // accumulate animation frame time from last time called until now
@ -526,7 +475,6 @@ public:
int LookupActivityHeaviest(int activity); int LookupActivityHeaviest(int activity);
int LookupSequence(const char *label); int LookupSequence(const char *label);
void ResetSequenceInfo(); void ResetSequenceInfo();
void ResetSequenceInfo_();
void DispatchAnimEvents(float flFutureInterval = 0.1f); // Handle events that have happend since last time called up until X seconds into the future void DispatchAnimEvents(float flFutureInterval = 0.1f); // Handle events that have happend since last time called up until X seconds into the future
float SetBoneController(int iController, float flValue = 0.0f); float SetBoneController(int iController, float flValue = 0.0f);
void InitBoneControllers(); void InitBoneControllers();
@ -541,6 +489,11 @@ public:
int ExtractBbox(int sequence, float *mins, float *maxs); int ExtractBbox(int sequence, float *mins, float *maxs);
void SetSequenceBox(); void SetSequenceBox();
#ifdef REGAMEDLL_API
void ResetSequenceInfo_OrigFunc();
#endif
public: public:
static TYPEDESCRIPTION IMPL(m_SaveData)[5]; static TYPEDESCRIPTION IMPL(m_SaveData)[5];
@ -561,14 +514,6 @@ public:
virtual int GetToggleState() { return m_toggle_state; } virtual int GetToggleState() { return m_toggle_state; }
virtual float GetDelay() { return m_flWait; } virtual float GetDelay() { return m_flWait; }
#ifdef HOOK_GAMEDLL
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
#endif
public: public:
void LinearMove(Vector vecDest, float flSpeed); void LinearMove(Vector vecDest, float flSpeed);
void EXPORT LinearMoveDone(); void EXPORT LinearMoveDone();
@ -606,11 +551,11 @@ public:
int m_bitsDamageInflict; // DMG_ damage type that the door or tigger does int m_bitsDamageInflict; // DMG_ damage type that the door or tigger does
string_t m_sMaster; // If this button has a master switch, this is the targetname. string_t m_sMaster; // If this button has a master switch, this is the targetname.
// A master switch must be of the multisource type. If all // A master switch must be of the multisource type. If all
// of the switches in the multisource have been triggered, then // of the switches in the multisource have been triggered, then
// the button will be allowed to operate. Otherwise, it will be // the button will be allowed to operate. Otherwise, it will be
// deactivated. // deactivated.
}; };
#include "basemonster.h" #include "basemonster.h"
@ -638,18 +583,6 @@ public:
virtual void Restart(); virtual void Restart();
#endif #endif
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
BOOL TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
int Save_(CSave &save);
int Restore_(CRestore &restore);
#endif
public: public:
void RotSpawn(); void RotSpawn();
void ButtonActivate(); void ButtonActivate();
@ -690,15 +623,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Precache(); virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
#endif
}; };
// Converts a entvars_t * to a class pointer // Converts a entvars_t * to a class pointer
@ -746,7 +670,6 @@ void RemoveEntityHashValue(entvars_t *pev, const char *value, hash_types_e field
void printEntities(); void printEntities();
edict_t *CREATE_NAMED_ENTITY(string_t iClass); edict_t *CREATE_NAMED_ENTITY(string_t iClass);
void REMOVE_ENTITY(edict_t *pEntity); void REMOVE_ENTITY(edict_t *pEntity);
void CONSOLE_ECHO_(char *pszMsg, ...);
void loopPerformance(); void loopPerformance();
int DispatchSpawn(edict_t *pent); int DispatchSpawn(edict_t *pent);
void DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd); void DispatchKeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd);

View File

@ -526,16 +526,6 @@ void EXT_FUNC ClientPutInServer(edict_t *pEntity)
UTIL_ClientPrintAll(HUD_PRINTNOTIFY, "#Game_connected", (sName[0] != '\0') ? sName : "<unconnected>"); UTIL_ClientPrintAll(HUD_PRINTNOTIFY, "#Game_connected", (sName[0] != '\0') ? sName : "<unconnected>");
} }
NOXREF int Q_strlen_(const char *str)
{
int count = 0;
if (str && *str) {
while (str[count++ + 1]);
}
return count;
}
void Host_Say(edict_t *pEntity, BOOL teamonly) void Host_Say(edict_t *pEntity, BOOL teamonly)
{ {
CBasePlayer *client; CBasePlayer *client;

View File

@ -110,6 +110,15 @@ extern bool g_skipCareerInitialSpawn;
extern unsigned short m_usResetDecals; extern unsigned short m_usResetDecals;
extern unsigned short g_iShadowSprite; extern unsigned short g_iShadowSprite;
#ifdef REGAMEDLL_API
void HandleMenu_ChooseAppearance_OrigFunc(CBasePlayer *player, int slot);
BOOL HandleMenu_ChooseTeam_OrigFunc(CBasePlayer *player, int slot);
bool BuyGunAmmo_OrigFunc(CBasePlayer *player, CBasePlayerItem *weapon, bool bBlinkMoney);
CBaseEntity *BuyWeaponByWeaponID_OrigFunc(CBasePlayer *pPlayer, WeaponIdType weaponID);
void ShowMenu_OrigFunc(CBasePlayer *pPlayer, int bitsValidSlots, int nDisplayTime, BOOL fNeedMore, char *pszText);
void ShowVGUIMenu_OrigFunc(CBasePlayer *pPlayer, int MenuType, int BitMask, char *szOldMenu);
#endif
int CMD_ARGC_(); int CMD_ARGC_();
const char *CMD_ARGV_(int i); const char *CMD_ARGV_(int i);
void set_suicide_frame(entvars_t *pev); void set_suicide_frame(entvars_t *pev);
@ -119,14 +128,11 @@ void ClientDisconnect(edict_t *pEntity);
void respawn(entvars_t *pev, BOOL fCopyCorpse = FALSE); void respawn(entvars_t *pev, BOOL fCopyCorpse = FALSE);
void ClientKill(edict_t *pEntity); void ClientKill(edict_t *pEntity);
void ShowMenu(CBasePlayer *pPlayer, int bitsValidSlots, int nDisplayTime, BOOL fNeedMore, char *pszText); void ShowMenu(CBasePlayer *pPlayer, int bitsValidSlots, int nDisplayTime, BOOL fNeedMore, char *pszText);
void ShowMenu_(CBasePlayer *pPlayer, int bitsValidSlots, int nDisplayTime, BOOL fNeedMore, char *pszText);
void ShowVGUIMenu(CBasePlayer *pPlayer, int MenuType, int BitMask, char *szOldMenu); void ShowVGUIMenu(CBasePlayer *pPlayer, int MenuType, int BitMask, char *szOldMenu);
void ShowVGUIMenu_(CBasePlayer *pPlayer, int MenuType, int BitMask, char *szOldMenu);
void ListPlayers(CBasePlayer *current); void ListPlayers(CBasePlayer *current);
void ProcessKickVote(CBasePlayer *pVotingPlayer, CBasePlayer *pKickPlayer); void ProcessKickVote(CBasePlayer *pVotingPlayer, CBasePlayer *pKickPlayer);
void CheckStartMoney(); void CheckStartMoney();
void ClientPutInServer(edict_t *pEntity); void ClientPutInServer(edict_t *pEntity);
int Q_strlen_(const char *str);
void Host_Say(edict_t *pEntity, BOOL teamonly); void Host_Say(edict_t *pEntity, BOOL teamonly);
void DropSecondary(CBasePlayer *pPlayer); void DropSecondary(CBasePlayer *pPlayer);
void DropPrimary(CBasePlayer *pPlayer); void DropPrimary(CBasePlayer *pPlayer);
@ -135,19 +141,15 @@ void BuyPistol(CBasePlayer *pPlayer, int iSlot);
void BuyShotgun(CBasePlayer *pPlayer, int iSlot); void BuyShotgun(CBasePlayer *pPlayer, int iSlot);
void BuySubMachineGun(CBasePlayer *pPlayer, int iSlot); void BuySubMachineGun(CBasePlayer *pPlayer, int iSlot);
CBaseEntity *BuyWeaponByWeaponID(CBasePlayer *pPlayer, WeaponIdType weaponID); CBaseEntity *BuyWeaponByWeaponID(CBasePlayer *pPlayer, WeaponIdType weaponID);
CBaseEntity *BuyWeaponByWeaponID_(CBasePlayer *pPlayer, WeaponIdType weaponID);
void BuyRifle(CBasePlayer *pPlayer, int iSlot); void BuyRifle(CBasePlayer *pPlayer, int iSlot);
void BuyMachineGun(CBasePlayer *pPlayer, int iSlot); void BuyMachineGun(CBasePlayer *pPlayer, int iSlot);
void BuyItem(CBasePlayer *pPlayer, int iSlot); void BuyItem(CBasePlayer *pPlayer, int iSlot);
void HandleMenu_ChooseAppearance(CBasePlayer *player, int slot); void HandleMenu_ChooseAppearance(CBasePlayer *player, int slot);
void HandleMenu_ChooseAppearance_(CBasePlayer *player, int slot);
BOOL HandleMenu_ChooseTeam(CBasePlayer *player, int slot); BOOL HandleMenu_ChooseTeam(CBasePlayer *player, int slot);
BOOL HandleMenu_ChooseTeam_(CBasePlayer *player, int slot);
void Radio1(CBasePlayer *player, int slot); void Radio1(CBasePlayer *player, int slot);
void Radio2(CBasePlayer *player, int slot); void Radio2(CBasePlayer *player, int slot);
void Radio3(CBasePlayer *player, int slot); void Radio3(CBasePlayer *player, int slot);
bool BuyGunAmmo(CBasePlayer *player, CBasePlayerItem *weapon, bool bBlinkMoney); bool BuyGunAmmo(CBasePlayer *player, CBasePlayerItem *weapon, bool bBlinkMoney);
bool BuyGunAmmo_(CBasePlayer *player, CBasePlayerItem *weapon, bool bBlinkMoney);
bool BuyAmmo(CBasePlayer *player, int nSlot, bool bBlinkMoney); bool BuyAmmo(CBasePlayer *player, int nSlot, bool bBlinkMoney);
CBaseEntity *EntityFromUserID(int userID); CBaseEntity *EntityFromUserID(int userID);
int CountPlayersInServer(); int CountPlayersInServer();

View File

@ -202,7 +202,7 @@ void CGib::SpawnRandomGibs(entvars_t *pevVictim, int cGibs, int human)
} }
} }
BOOL CBaseMonster::__MAKE_VHOOK(HasHumanGibs)() BOOL CBaseMonster::HasHumanGibs()
{ {
int myClass = Classify(); int myClass = Classify();
@ -215,7 +215,7 @@ BOOL CBaseMonster::__MAKE_VHOOK(HasHumanGibs)()
return FALSE; return FALSE;
} }
BOOL CBaseMonster::__MAKE_VHOOK(HasAlienGibs)() BOOL CBaseMonster::HasAlienGibs()
{ {
int myClass = Classify(); int myClass = Classify();
if (myClass == CLASS_ALIEN_MILITARY if (myClass == CLASS_ALIEN_MILITARY
@ -229,7 +229,7 @@ BOOL CBaseMonster::__MAKE_VHOOK(HasAlienGibs)()
return FALSE; return FALSE;
} }
void CBaseMonster::__MAKE_VHOOK(FadeMonster)() void CBaseMonster::FadeMonster()
{ {
StopAnimation(); StopAnimation();
@ -242,7 +242,7 @@ void CBaseMonster::__MAKE_VHOOK(FadeMonster)()
SUB_StartFadeOut(); SUB_StartFadeOut();
} }
void CBaseMonster::__MAKE_VHOOK(GibMonster)() void CBaseMonster::GibMonster()
{ {
TraceResult tr; TraceResult tr;
bool gibbed = false; bool gibbed = false;
@ -288,7 +288,7 @@ void CBaseMonster::__MAKE_VHOOK(GibMonster)()
// GetDeathActivity - determines the best type of death // GetDeathActivity - determines the best type of death
// anim to play. // anim to play.
Activity CBaseMonster::__MAKE_VHOOK(GetDeathActivity)() Activity CBaseMonster::GetDeathActivity()
{ {
Activity deathActivity; Activity deathActivity;
BOOL fTriedDirection; BOOL fTriedDirection;
@ -453,7 +453,7 @@ NOXREF Activity CBaseMonster::GetSmallFlinchActivity()
return flinchActivity; return flinchActivity;
} }
void CBaseMonster::__MAKE_VHOOK(BecomeDead)() void CBaseMonster::BecomeDead()
{ {
// don't let autoaim aim at corpses. // don't let autoaim aim at corpses.
pev->takedamage = DAMAGE_YES; pev->takedamage = DAMAGE_YES;
@ -521,7 +521,7 @@ void CBaseMonster::CallGibMonster()
UTIL_Remove(this); UTIL_Remove(this);
} }
void CBaseMonster::__MAKE_VHOOK(Killed)(entvars_t *pevAttacker, int iGib) void CBaseMonster::Killed(entvars_t *pevAttacker, int iGib)
{ {
// unsigned int cCount = 0; // unsigned int cCount = 0;
// BOOL fDone = FALSE; // BOOL fDone = FALSE;
@ -711,7 +711,7 @@ void CGib::Spawn(const char *szGibModel)
m_cBloodDecals = 5; m_cBloodDecals = 5;
} }
BOOL CBaseMonster::__MAKE_VHOOK(TakeHealth)(float flHealth, int bitsDamageType) BOOL CBaseMonster::TakeHealth(float flHealth, int bitsDamageType)
{ {
if (pev->takedamage == DAMAGE_NO) if (pev->takedamage == DAMAGE_NO)
return FALSE; return FALSE;
@ -730,7 +730,7 @@ BOOL CBaseMonster::__MAKE_VHOOK(TakeHealth)(float flHealth, int bitsDamageType)
// //
// Time-based damage: only occurs while the monster is within the trigger_hurt. // Time-based damage: only occurs while the monster is within the trigger_hurt.
// When a monster is poisoned via an arrow etc it takes all the poison damage at once. // When a monster is poisoned via an arrow etc it takes all the poison damage at once.
BOOL CBaseMonster::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) BOOL CBaseMonster::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{ {
if (pev->takedamage == DAMAGE_NO) if (pev->takedamage == DAMAGE_NO)
return FALSE; return FALSE;
@ -1320,7 +1320,7 @@ NOXREF CBaseEntity *CBaseMonster::CheckTraceHullAttack(float flDist, int iDamage
// FInViewCone - returns true is the passed ent is in // FInViewCone - returns true is the passed ent is in
// the caller's forward view cone. The dot product is performed // the caller's forward view cone. The dot product is performed
// in 2d, making the view cone infinitely tall. // in 2d, making the view cone infinitely tall.
BOOL CBaseMonster::__MAKE_VHOOK(FInViewCone)(CBaseEntity *pEntity) BOOL CBaseMonster::FInViewCone(CBaseEntity *pEntity)
{ {
Vector2D vec2LOS; Vector2D vec2LOS;
float flDot; float flDot;
@ -1345,7 +1345,7 @@ BOOL CBaseMonster::__MAKE_VHOOK(FInViewCone)(CBaseEntity *pEntity)
// FInViewCone - returns true is the passed vector is in // FInViewCone - returns true is the passed vector is in
// the caller's forward view cone. The dot product is performed // the caller's forward view cone. The dot product is performed
// in 2d, making the view cone infinitely tall. // in 2d, making the view cone infinitely tall.
BOOL CBaseMonster::__MAKE_VHOOK(FInViewCone)(const Vector *pOrigin) BOOL CBaseMonster::FInViewCone(const Vector *pOrigin)
{ {
Vector2D vec2LOS; Vector2D vec2LOS;
float flDot; float flDot;
@ -1369,7 +1369,7 @@ BOOL CBaseMonster::__MAKE_VHOOK(FInViewCone)(const Vector *pOrigin)
// FVisible - returns true if a line can be traced from // FVisible - returns true if a line can be traced from
// the caller's eyes to the target // the caller's eyes to the target
BOOL CBaseEntity::__MAKE_VHOOK(FVisible)(CBaseEntity *pEntity) BOOL CBaseEntity::FVisible(CBaseEntity *pEntity)
{ {
TraceResult tr; TraceResult tr;
Vector vecLookerOrigin; Vector vecLookerOrigin;
@ -1402,7 +1402,7 @@ BOOL CBaseEntity::__MAKE_VHOOK(FVisible)(CBaseEntity *pEntity)
// FVisible - returns true if a line can be traced from // FVisible - returns true if a line can be traced from
// the caller's eyes to the target vector // the caller's eyes to the target vector
BOOL CBaseEntity::__MAKE_VHOOK(FVisible)(const Vector &vecOrigin) BOOL CBaseEntity::FVisible(const Vector &vecOrigin)
{ {
TraceResult tr; TraceResult tr;
Vector vecLookerOrigin; Vector vecLookerOrigin;
@ -1424,7 +1424,7 @@ BOOL CBaseEntity::__MAKE_VHOOK(FVisible)(const Vector &vecOrigin)
} }
} }
void CBaseEntity::__MAKE_VHOOK(TraceAttack)(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType) void CBaseEntity::TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType)
{ {
Vector vecOrigin = ptr->vecEndPos - vecDir * 4; Vector vecOrigin = ptr->vecEndPos - vecDir * 4;
@ -1442,7 +1442,7 @@ void CBaseEntity::__MAKE_VHOOK(TraceAttack)(entvars_t *pevAttacker, float flDama
} }
} }
void CBaseMonster::__MAKE_VHOOK(TraceAttack)(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType) void CBaseMonster::TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType)
{ {
Vector vecOrigin = ptr->vecEndPos - vecDir * 4; Vector vecOrigin = ptr->vecEndPos - vecDir * 4;
@ -1859,7 +1859,7 @@ Vector CBaseEntity::FireBullets3(Vector vecSrc, Vector vecDirShooting, float vec
return Vector(x * vecSpread, y * vecSpread, 0); return Vector(x * vecSpread, y * vecSpread, 0);
} }
void CBaseEntity::__MAKE_VHOOK(TraceBleed)(float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType) void CBaseEntity::TraceBleed(float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType)
{ {
if (BloodColor() == DONT_BLEED) if (BloodColor() == DONT_BLEED)
return; return;

View File

@ -113,7 +113,7 @@ void PlayLockSounds(entvars_t *pev, locksound_t *pls, int flocked, int fbutton)
} }
// Cache user-entity-field values until spawn is called. // Cache user-entity-field values until spawn is called.
void CBaseDoor::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CBaseDoor::KeyValue(KeyValueData *pkvd)
{ {
//skin is used for content type //skin is used for content type
if (FStrEq(pkvd->szKeyName, "skin")) if (FStrEq(pkvd->szKeyName, "skin"))
@ -192,7 +192,7 @@ LINK_ENTITY_TO_CLASS(func_door, CBaseDoor, CCSDoor)
// func_water - same as a door. // func_water - same as a door.
LINK_ENTITY_TO_CLASS(func_water, CBaseDoor, CCSDoor) LINK_ENTITY_TO_CLASS(func_water, CBaseDoor, CCSDoor)
void CBaseDoor::__MAKE_VHOOK(Spawn)() void CBaseDoor::Spawn()
{ {
Precache(); Precache();
SetMovedir(pev); SetMovedir(pev);
@ -251,7 +251,7 @@ void CBaseDoor::__MAKE_VHOOK(Spawn)()
m_lastBlockedTimestamp = 0; m_lastBlockedTimestamp = 0;
} }
void CBaseDoor::__MAKE_VHOOK(Restart)() void CBaseDoor::Restart()
{ {
SetMovedir(pev); SetMovedir(pev);
m_toggle_state = TS_AT_BOTTOM; m_toggle_state = TS_AT_BOTTOM;
@ -263,7 +263,7 @@ void CBaseDoor::__MAKE_VHOOK(Restart)()
SetTouch(&CBaseDoor::DoorTouch); SetTouch(&CBaseDoor::DoorTouch);
} }
void CBaseDoor::__MAKE_VHOOK(SetToggleState)(int state) void CBaseDoor::SetToggleState(int state)
{ {
if (state == TS_AT_TOP) if (state == TS_AT_TOP)
UTIL_SetOrigin(pev, m_vecPosition2); UTIL_SetOrigin(pev, m_vecPosition2);
@ -274,7 +274,7 @@ void CBaseDoor::__MAKE_VHOOK(SetToggleState)(int state)
#define noiseMoving noise1 #define noiseMoving noise1
#define noiseArrived noise2 #define noiseArrived noise2
void CBaseDoor::__MAKE_VHOOK(Precache)() void CBaseDoor::Precache()
{ {
char *pszSound; char *pszSound;
@ -457,7 +457,7 @@ void CBaseDoor::DoorTouch(CBaseEntity *pOther)
} }
// Used by SUB_UseTargets, when a door is the target of a button. // Used by SUB_UseTargets, when a door is the target of a button.
void CBaseDoor::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CBaseDoor::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
m_hActivator = pActivator; m_hActivator = pActivator;
@ -725,7 +725,7 @@ void CBaseDoor::DoorHitBottom()
} }
} }
void CBaseDoor::__MAKE_VHOOK(Blocked)(CBaseEntity *pOther) void CBaseDoor::Blocked(CBaseEntity *pOther)
{ {
edict_t *pentTarget = NULL; edict_t *pentTarget = NULL;
CBaseDoor *pDoor = NULL; CBaseDoor *pDoor = NULL;
@ -847,7 +847,7 @@ void CBaseDoor::__MAKE_VHOOK(Blocked)(CBaseEntity *pOther)
// 4) screechy metal // 4) screechy metal
LINK_ENTITY_TO_CLASS(func_door_rotating, CRotDoor, CCSRotDoor) LINK_ENTITY_TO_CLASS(func_door_rotating, CRotDoor, CCSRotDoor)
void CRotDoor::__MAKE_VHOOK(Restart)() void CRotDoor::Restart()
{ {
CBaseToggle::AxisDir(pev); CBaseToggle::AxisDir(pev);
@ -878,7 +878,7 @@ void CRotDoor::__MAKE_VHOOK(Restart)()
DoorGoDown(); DoorGoDown();
} }
void CRotDoor::__MAKE_VHOOK(Spawn)() void CRotDoor::Spawn()
{ {
Precache(); Precache();
@ -941,7 +941,7 @@ void CRotDoor::__MAKE_VHOOK(Spawn)()
} }
} }
void CRotDoor::__MAKE_VHOOK(SetToggleState)(int state) void CRotDoor::SetToggleState(int state)
{ {
if (state == TS_AT_TOP) if (state == TS_AT_TOP)
pev->angles = m_vecAngle2; pev->angles = m_vecAngle2;
@ -954,7 +954,7 @@ void CRotDoor::__MAKE_VHOOK(SetToggleState)(int state)
LINK_ENTITY_TO_CLASS(momentary_door, CMomentaryDoor, CCSMomentaryDoor) LINK_ENTITY_TO_CLASS(momentary_door, CMomentaryDoor, CCSMomentaryDoor)
IMPLEMENT_SAVERESTORE(CMomentaryDoor, CBaseToggle) IMPLEMENT_SAVERESTORE(CMomentaryDoor, CBaseToggle)
void CMomentaryDoor::__MAKE_VHOOK(Spawn)() void CMomentaryDoor::Spawn()
{ {
SetMovedir(pev); SetMovedir(pev);
@ -989,7 +989,7 @@ void CMomentaryDoor::__MAKE_VHOOK(Spawn)()
Precache(); Precache();
} }
void CMomentaryDoor::__MAKE_VHOOK(Precache)() void CMomentaryDoor::Precache()
{ {
// set the door's "in-motion" sound // set the door's "in-motion" sound
switch (m_bMoveSnd) switch (m_bMoveSnd)
@ -1035,7 +1035,7 @@ void CMomentaryDoor::__MAKE_VHOOK(Precache)()
} }
} }
void CMomentaryDoor::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CMomentaryDoor::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "movesnd")) if (FStrEq(pkvd->szKeyName, "movesnd"))
{ {
@ -1056,7 +1056,7 @@ void CMomentaryDoor::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CBaseToggle::KeyValue(pkvd); CBaseToggle::KeyValue(pkvd);
} }
void CMomentaryDoor::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CMomentaryDoor::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
// Momentary buttons will pass down a float in here // Momentary buttons will pass down a float in here
if (useType != USE_SET) if (useType != USE_SET)

View File

@ -69,20 +69,6 @@ public:
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Blocked(CBaseEntity *pOther); virtual void Blocked(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
void Restart_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void SetToggleState_(int state);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void Blocked_(CBaseEntity *pOther);
#endif
public: public:
static TYPEDESCRIPTION IMPL(m_SaveData)[7]; static TYPEDESCRIPTION IMPL(m_SaveData)[7];
@ -97,10 +83,10 @@ public:
public: public:
byte m_bHealthValue; // some doors are medi-kit doors, they give players health byte m_bHealthValue; // some doors are medi-kit doors, they give players health
byte m_bMoveSnd; // sound a door makes while moving byte m_bMoveSnd; // sound a door makes while moving
byte m_bStopSnd; // sound a door makes when it stops byte m_bStopSnd; // sound a door makes when it stops
locksound_t m_ls; // door lock sounds locksound_t m_ls; // door lock sounds
byte m_bLockedSound; // ordinals from entity selection byte m_bLockedSound; // ordinals from entity selection
byte m_bLockedSentence; byte m_bLockedSentence;
@ -116,15 +102,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Restart(); virtual void Restart();
virtual void SetToggleState(int state); virtual void SetToggleState(int state);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Restart_();
void SetToggleState_(int state);
#endif
}; };
class CMomentaryDoor: public CBaseToggle class CMomentaryDoor: public CBaseToggle
@ -138,21 +115,10 @@ public:
virtual int ObjectCaps() { return (CBaseToggle::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); } virtual int ObjectCaps() { return (CBaseToggle::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); }
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
static TYPEDESCRIPTION IMPL(m_SaveData)[1]; static TYPEDESCRIPTION IMPL(m_SaveData)[1];
byte m_bMoveSnd; // sound a door makes while moving byte m_bMoveSnd; // sound a door makes while moving
}; };
void PlayLockSounds(entvars_t *pev, locksound_t *pls, int flocked, int fbutton); void PlayLockSounds(entvars_t *pev, locksound_t *pls, int flocked, int fbutton);

View File

@ -65,7 +65,7 @@ LINK_ENTITY_TO_CLASS(info_target, CPointEntity, CCSPointEntity)
LINK_ENTITY_TO_CLASS(env_bubbles, CBubbling, CCSBubbling) LINK_ENTITY_TO_CLASS(env_bubbles, CBubbling, CCSBubbling)
IMPLEMENT_SAVERESTORE(CBubbling, CBaseEntity) IMPLEMENT_SAVERESTORE(CBubbling, CBaseEntity)
void CBubbling::__MAKE_VHOOK(Spawn)() void CBubbling::Spawn()
{ {
Precache(); Precache();
SET_MODEL(ENT(pev), STRING(pev->model)); // Set size SET_MODEL(ENT(pev), STRING(pev->model)); // Set size
@ -95,13 +95,13 @@ void CBubbling::__MAKE_VHOOK(Spawn)()
m_state = 0; m_state = 0;
} }
void CBubbling::__MAKE_VHOOK(Precache)() void CBubbling::Precache()
{ {
// Precache bubble sprite // Precache bubble sprite
m_bubbleModel = PRECACHE_MODEL("sprites/bubble.spr"); m_bubbleModel = PRECACHE_MODEL("sprites/bubble.spr");
} }
void CBubbling::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CBubbling::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
if (ShouldToggle(useType, m_state)) if (ShouldToggle(useType, m_state))
m_state = !m_state; m_state = !m_state;
@ -118,7 +118,7 @@ void CBubbling::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller,
} }
} }
void CBubbling::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CBubbling::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "density")) if (FStrEq(pkvd->szKeyName, "density"))
{ {
@ -156,14 +156,14 @@ void CBubbling::FizzThink()
LINK_ENTITY_TO_CLASS(beam, CBeam, CCSBeam) LINK_ENTITY_TO_CLASS(beam, CBeam, CCSBeam)
void CBeam::__MAKE_VHOOK(Spawn)() void CBeam::Spawn()
{ {
// Remove model & collisions // Remove model & collisions
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
Precache(); Precache();
} }
void CBeam::__MAKE_VHOOK(Precache)() void CBeam::Precache()
{ {
if (pev->owner) if (pev->owner)
{ {
@ -354,7 +354,7 @@ LINK_ENTITY_TO_CLASS(env_lightning, CLightning, CCSLightning)
LINK_ENTITY_TO_CLASS(env_beam, CLightning, CCSLightning) LINK_ENTITY_TO_CLASS(env_beam, CLightning, CCSLightning)
IMPLEMENT_SAVERESTORE(CLightning, CBeam) IMPLEMENT_SAVERESTORE(CLightning, CBeam)
void CLightning::__MAKE_VHOOK(Spawn)() void CLightning::Spawn()
{ {
if (FStringNull(m_iszSpriteName)) if (FStringNull(m_iszSpriteName))
{ {
@ -405,19 +405,19 @@ void CLightning::__MAKE_VHOOK(Spawn)()
} }
} }
void CLightning::__MAKE_VHOOK(Precache)() void CLightning::Precache()
{ {
m_spriteTexture = PRECACHE_MODEL((char *)STRING(m_iszSpriteName)); m_spriteTexture = PRECACHE_MODEL((char *)STRING(m_iszSpriteName));
CBeam::Precache(); CBeam::Precache();
} }
void CLightning::__MAKE_VHOOK(Activate)() void CLightning::Activate()
{ {
if (ServerSide()) if (ServerSide())
BeamUpdateVars(); BeamUpdateVars();
} }
void CLightning::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CLightning::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "LightningStart")) if (FStrEq(pkvd->szKeyName, "LightningStart"))
{ {
@ -849,7 +849,7 @@ void CLightning::BeamUpdateVars()
LINK_ENTITY_TO_CLASS(env_laser, CLaser, CCSLaser) LINK_ENTITY_TO_CLASS(env_laser, CLaser, CCSLaser)
IMPLEMENT_SAVERESTORE(CLaser, CBeam) IMPLEMENT_SAVERESTORE(CLaser, CBeam)
void CLaser::__MAKE_VHOOK(Spawn)() void CLaser::Spawn()
{ {
if (FStringNull(pev->model)) if (FStringNull(pev->model))
{ {
@ -880,7 +880,7 @@ void CLaser::__MAKE_VHOOK(Spawn)()
TurnOn(); TurnOn();
} }
void CLaser::__MAKE_VHOOK(Precache)() void CLaser::Precache()
{ {
pev->modelindex = PRECACHE_MODEL((char *)STRING(pev->model)); pev->modelindex = PRECACHE_MODEL((char *)STRING(pev->model));
@ -890,7 +890,7 @@ void CLaser::__MAKE_VHOOK(Precache)()
} }
} }
void CLaser::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CLaser::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "LaserTarget")) if (FStrEq(pkvd->szKeyName, "LaserTarget"))
{ {
@ -968,7 +968,7 @@ void CLaser::TurnOn()
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }
void CLaser::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CLaser::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
int active = IsOn(); int active = IsOn();
@ -1008,7 +1008,7 @@ void CLaser::StrikeThink()
LINK_ENTITY_TO_CLASS(env_glow, CGlow, CCSGlow) LINK_ENTITY_TO_CLASS(env_glow, CGlow, CCSGlow)
IMPLEMENT_SAVERESTORE(CGlow, CPointEntity) IMPLEMENT_SAVERESTORE(CGlow, CPointEntity)
void CGlow::__MAKE_VHOOK(Spawn)() void CGlow::Spawn()
{ {
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
pev->movetype = MOVETYPE_NONE; pev->movetype = MOVETYPE_NONE;
@ -1028,7 +1028,7 @@ void CGlow::__MAKE_VHOOK(Spawn)()
m_lastTime = gpGlobals->time; m_lastTime = gpGlobals->time;
} }
void CGlow::__MAKE_VHOOK(Think)() void CGlow::Think()
{ {
Animate(pev->framerate * (gpGlobals->time - m_lastTime)); Animate(pev->framerate * (gpGlobals->time - m_lastTime));
@ -1046,7 +1046,7 @@ void CGlow::Animate(float frames)
LINK_ENTITY_TO_CLASS(env_bombglow, CBombGlow, CCSBombGlow) LINK_ENTITY_TO_CLASS(env_bombglow, CBombGlow, CCSBombGlow)
void CBombGlow::__MAKE_VHOOK(Spawn)() void CBombGlow::Spawn()
{ {
#ifdef REGAMEDLL_FIXES #ifdef REGAMEDLL_FIXES
PRECACHE_MODEL("sprites/flare1.spr"); PRECACHE_MODEL("sprites/flare1.spr");
@ -1069,7 +1069,7 @@ void CBombGlow::__MAKE_VHOOK(Spawn)()
m_bSetModel = false; m_bSetModel = false;
} }
void CBombGlow::__MAKE_VHOOK(Think)() void CBombGlow::Think()
{ {
if (!m_bSetModel) if (!m_bSetModel)
{ {
@ -1099,7 +1099,7 @@ void CBombGlow::__MAKE_VHOOK(Think)()
LINK_ENTITY_TO_CLASS(env_sprite, CSprite, CCSSprite) LINK_ENTITY_TO_CLASS(env_sprite, CSprite, CCSSprite)
IMPLEMENT_SAVERESTORE(CSprite, CPointEntity) IMPLEMENT_SAVERESTORE(CSprite, CPointEntity)
void CSprite::__MAKE_VHOOK(Spawn)() void CSprite::Spawn()
{ {
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
pev->movetype = MOVETYPE_NONE; pev->movetype = MOVETYPE_NONE;
@ -1123,7 +1123,7 @@ void CSprite::__MAKE_VHOOK(Spawn)()
} }
} }
void CSprite::__MAKE_VHOOK(Restart)() void CSprite::Restart()
{ {
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
pev->movetype = MOVETYPE_NONE; pev->movetype = MOVETYPE_NONE;
@ -1136,7 +1136,7 @@ void CSprite::__MAKE_VHOOK(Restart)()
TurnOn(); TurnOn();
} }
void CSprite::__MAKE_VHOOK(Precache)() void CSprite::Precache()
{ {
PRECACHE_MODEL((char *)STRING(pev->model)); PRECACHE_MODEL((char *)STRING(pev->model));
@ -1259,7 +1259,7 @@ void CSprite::TurnOn()
pev->frame = 0; pev->frame = 0;
} }
void CSprite::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CSprite::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
int on = pev->effects != EF_NODRAW; int on = pev->effects != EF_NODRAW;
@ -1275,7 +1275,7 @@ void CSprite::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, U
IMPLEMENT_SAVERESTORE(CGibShooter, CBaseDelay) IMPLEMENT_SAVERESTORE(CGibShooter, CBaseDelay)
LINK_ENTITY_TO_CLASS(gibshooter, CGibShooter, CCSGibShooter) LINK_ENTITY_TO_CLASS(gibshooter, CGibShooter, CCSGibShooter)
void CGibShooter::__MAKE_VHOOK(Precache)() void CGibShooter::Precache()
{ {
if (g_Language == LANGUAGE_GERMAN) if (g_Language == LANGUAGE_GERMAN)
{ {
@ -1287,7 +1287,7 @@ void CGibShooter::__MAKE_VHOOK(Precache)()
} }
} }
void CGibShooter::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CGibShooter::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "m_iGibs")) if (FStrEq(pkvd->szKeyName, "m_iGibs"))
{ {
@ -1313,13 +1313,13 @@ void CGibShooter::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CBaseDelay::KeyValue(pkvd); CBaseDelay::KeyValue(pkvd);
} }
void CGibShooter::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CGibShooter::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
SetThink(&CGibShooter::ShootThink); SetThink(&CGibShooter::ShootThink);
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }
void CGibShooter::__MAKE_VHOOK(Spawn)() void CGibShooter::Spawn()
{ {
Precache(); Precache();
@ -1340,7 +1340,7 @@ void CGibShooter::__MAKE_VHOOK(Spawn)()
pev->body = MODEL_FRAMES(m_iGibModelIndex); pev->body = MODEL_FRAMES(m_iGibModelIndex);
} }
CGib *CGibShooter::__MAKE_VHOOK(CreateGib)() CGib *CGibShooter::CreateGib()
{ {
if (CVAR_GET_FLOAT("violence_hgibs") == 0) if (CVAR_GET_FLOAT("violence_hgibs") == 0)
return NULL; return NULL;
@ -1427,7 +1427,7 @@ void CGibShooter::ShootThink()
LINK_ENTITY_TO_CLASS(env_shooter, CEnvShooter, CCSEnvShooter) LINK_ENTITY_TO_CLASS(env_shooter, CEnvShooter, CCSEnvShooter)
void CEnvShooter::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CEnvShooter::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "shootmodel")) if (FStrEq(pkvd->szKeyName, "shootmodel"))
{ {
@ -1466,13 +1466,13 @@ void CEnvShooter::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CGibShooter::KeyValue(pkvd); CGibShooter::KeyValue(pkvd);
} }
void CEnvShooter::__MAKE_VHOOK(Precache)() void CEnvShooter::Precache()
{ {
m_iGibModelIndex = PRECACHE_MODEL((char *)STRING(pev->model)); m_iGibModelIndex = PRECACHE_MODEL((char *)STRING(pev->model));
CBreakable::MaterialSoundPrecache((Materials)m_iGibMaterial); CBreakable::MaterialSoundPrecache((Materials)m_iGibMaterial);
} }
CGib *CEnvShooter::__MAKE_VHOOK(CreateGib)() CGib *CEnvShooter::CreateGib()
{ {
CGib *pGib = GetClassPtr<CCSGib>((CGib *)NULL); CGib *pGib = GetClassPtr<CCSGib>((CGib *)NULL);
@ -1499,12 +1499,12 @@ CGib *CEnvShooter::__MAKE_VHOOK(CreateGib)()
LINK_ENTITY_TO_CLASS(test_effect, CTestEffect, CCSTestEffect) LINK_ENTITY_TO_CLASS(test_effect, CTestEffect, CCSTestEffect)
void CTestEffect::__MAKE_VHOOK(Spawn)() void CTestEffect::Spawn()
{ {
Precache(); Precache();
} }
void CTestEffect::__MAKE_VHOOK(Precache)() void CTestEffect::Precache()
{ {
PRECACHE_MODEL("sprites/lgtning.spr"); PRECACHE_MODEL("sprites/lgtning.spr");
} }
@ -1563,7 +1563,7 @@ void CTestEffect::TestThink()
} }
} }
void CTestEffect::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CTestEffect::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
SetThink(&CTestEffect::TestThink); SetThink(&CTestEffect::TestThink);
@ -1573,7 +1573,7 @@ void CTestEffect::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCalle
LINK_ENTITY_TO_CLASS(env_blood, CBlood, CCSBlood) LINK_ENTITY_TO_CLASS(env_blood, CBlood, CCSBlood)
void CBlood::__MAKE_VHOOK(Spawn)() void CBlood::Spawn()
{ {
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
pev->movetype = MOVETYPE_NONE; pev->movetype = MOVETYPE_NONE;
@ -1583,7 +1583,7 @@ void CBlood::__MAKE_VHOOK(Spawn)()
SetMovedir(pev); SetMovedir(pev);
} }
void CBlood::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CBlood::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "color")) if (FStrEq(pkvd->szKeyName, "color"))
{ {
@ -1637,7 +1637,7 @@ Vector CBlood::BloodPosition(CBaseEntity *pActivator)
return pev->origin; return pev->origin;
} }
void CBlood::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CBlood::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
if (pev->spawnflags & SF_BLOOD_STREAM) if (pev->spawnflags & SF_BLOOD_STREAM)
UTIL_BloodStream(BloodPosition(pActivator), Direction(), (Color() == BLOOD_COLOR_RED) ? 70 : Color(), int(BloodAmount())); UTIL_BloodStream(BloodPosition(pActivator), Direction(), (Color() == BLOOD_COLOR_RED) ? 70 : Color(), int(BloodAmount()));
@ -1661,7 +1661,7 @@ void CBlood::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, US
LINK_ENTITY_TO_CLASS(env_shake, CShake, CCSShake) LINK_ENTITY_TO_CLASS(env_shake, CShake, CCSShake)
void CShake::__MAKE_VHOOK(Spawn)() void CShake::Spawn()
{ {
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
pev->movetype = MOVETYPE_NONE; pev->movetype = MOVETYPE_NONE;
@ -1672,7 +1672,7 @@ void CShake::__MAKE_VHOOK(Spawn)()
pev->dmg = 0; pev->dmg = 0;
} }
void CShake::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CShake::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "amplitude")) if (FStrEq(pkvd->szKeyName, "amplitude"))
{ {
@ -1698,14 +1698,14 @@ void CShake::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CPointEntity::KeyValue(pkvd); CPointEntity::KeyValue(pkvd);
} }
void CShake::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CShake::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
UTIL_ScreenShake(pev->origin, Amplitude(), Frequency(), Duration(), Radius()); UTIL_ScreenShake(pev->origin, Amplitude(), Frequency(), Duration(), Radius());
} }
LINK_ENTITY_TO_CLASS(env_fade, CFade, CCSFade) LINK_ENTITY_TO_CLASS(env_fade, CFade, CCSFade)
void CFade::__MAKE_VHOOK(Spawn)() void CFade::Spawn()
{ {
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
pev->movetype = MOVETYPE_NONE; pev->movetype = MOVETYPE_NONE;
@ -1713,7 +1713,7 @@ void CFade::__MAKE_VHOOK(Spawn)()
pev->frame = 0; pev->frame = 0;
} }
void CFade::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CFade::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "duration")) if (FStrEq(pkvd->szKeyName, "duration"))
{ {
@ -1729,7 +1729,7 @@ void CFade::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CPointEntity::KeyValue(pkvd); CPointEntity::KeyValue(pkvd);
} }
void CFade::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CFade::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
int fadeFlags = 0; int fadeFlags = 0;
@ -1754,7 +1754,7 @@ void CFade::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE
LINK_ENTITY_TO_CLASS(env_message, CMessage, CCSMessage) LINK_ENTITY_TO_CLASS(env_message, CMessage, CCSMessage)
void CMessage::__MAKE_VHOOK(Spawn)() void CMessage::Spawn()
{ {
Precache(); Precache();
@ -1787,7 +1787,7 @@ void CMessage::__MAKE_VHOOK(Spawn)()
pev->scale = 1.0f; pev->scale = 1.0f;
} }
void CMessage::__MAKE_VHOOK(Precache)() void CMessage::Precache()
{ {
if (pev->noise) if (pev->noise)
{ {
@ -1795,7 +1795,7 @@ void CMessage::__MAKE_VHOOK(Precache)()
} }
} }
void CMessage::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CMessage::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "messagesound")) if (FStrEq(pkvd->szKeyName, "messagesound"))
{ {
@ -1816,7 +1816,7 @@ void CMessage::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CPointEntity::KeyValue(pkvd); CPointEntity::KeyValue(pkvd);
} }
void CMessage::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CMessage::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
CBaseEntity *pPlayer = NULL; CBaseEntity *pPlayer = NULL;
@ -1847,12 +1847,12 @@ void CMessage::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller,
LINK_ENTITY_TO_CLASS(env_funnel, CEnvFunnel, CCSEnvFunnel) LINK_ENTITY_TO_CLASS(env_funnel, CEnvFunnel, CCSEnvFunnel)
void CEnvFunnel::__MAKE_VHOOK(Precache)() void CEnvFunnel::Precache()
{ {
m_iSprite = PRECACHE_MODEL("sprites/flare6.spr"); m_iSprite = PRECACHE_MODEL("sprites/flare6.spr");
} }
void CEnvFunnel::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CEnvFunnel::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
MESSAGE_BEGIN(MSG_BROADCAST, SVC_TEMPENTITY); MESSAGE_BEGIN(MSG_BROADCAST, SVC_TEMPENTITY);
WRITE_BYTE(TE_LARGEFUNNEL); WRITE_BYTE(TE_LARGEFUNNEL);
@ -1878,14 +1878,14 @@ void CEnvFunnel::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }
void CEnvFunnel::__MAKE_VHOOK(Spawn)() void CEnvFunnel::Spawn()
{ {
Precache(); Precache();
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
pev->effects = EF_NODRAW; pev->effects = EF_NODRAW;
} }
void CEnvBeverage::__MAKE_VHOOK(Precache)() void CEnvBeverage::Precache()
{ {
PRECACHE_MODEL("models/can.mdl"); PRECACHE_MODEL("models/can.mdl");
PRECACHE_SOUND("weapons/g_bounce3.wav"); PRECACHE_SOUND("weapons/g_bounce3.wav");
@ -1893,7 +1893,7 @@ void CEnvBeverage::__MAKE_VHOOK(Precache)()
LINK_ENTITY_TO_CLASS(env_beverage, CEnvBeverage, CCSEnvBeverage) LINK_ENTITY_TO_CLASS(env_beverage, CEnvBeverage, CCSEnvBeverage)
void CEnvBeverage::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CEnvBeverage::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
if (pev->frags != 0.0f || pev->health <= 0.0f) if (pev->frags != 0.0f || pev->health <= 0.0f)
{ {
@ -1915,7 +1915,7 @@ void CEnvBeverage::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCall
pev->health--; pev->health--;
} }
void CEnvBeverage::__MAKE_VHOOK(Spawn)() void CEnvBeverage::Spawn()
{ {
Precache(); Precache();
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
@ -1928,14 +1928,14 @@ void CEnvBeverage::__MAKE_VHOOK(Spawn)()
} }
} }
void CItemSoda::__MAKE_VHOOK(Precache)() void CItemSoda::Precache()
{ {
; ;
} }
LINK_ENTITY_TO_CLASS(item_sodacan, CItemSoda, CCSItemSoda) LINK_ENTITY_TO_CLASS(item_sodacan, CItemSoda, CCSItemSoda)
void CItemSoda::__MAKE_VHOOK(Spawn)() void CItemSoda::Spawn()
{ {
Precache(); Precache();
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;

View File

@ -86,17 +86,6 @@ public:
} }
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
void Restart_();
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
void EXPORT AnimateThink(); void EXPORT AnimateThink();
void EXPORT ExpandThink(); void EXPORT ExpandThink();
@ -168,13 +157,6 @@ public:
} }
virtual Vector Center() { return (GetStartPos() + GetEndPos()) * 0.5f; } virtual Vector Center() { return (GetStartPos() + GetEndPos()) * 0.5f; }
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
#endif
public: public:
void EXPORT TriggerTouch(CBaseEntity *pOther); void EXPORT TriggerTouch(CBaseEntity *pOther);
@ -245,17 +227,6 @@ public:
virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
void TurnOn(); void TurnOn();
void TurnOff(); void TurnOff();
@ -283,17 +254,6 @@ public:
virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); } virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); }
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
void EXPORT FizzThink(); void EXPORT FizzThink();
@ -316,17 +276,6 @@ public:
virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
virtual void Activate(); virtual void Activate();
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Activate_();
#endif
public: public:
void EXPORT StrikeThink(); void EXPORT StrikeThink();
void EXPORT DamageThink(); void EXPORT DamageThink();
@ -371,15 +320,6 @@ public:
virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
virtual void Think(); virtual void Think();
#ifdef HOOK_GAMEDLL
void Spawn_();
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Think_();
#endif
void Animate(float frames); void Animate(float frames);
public: public:
@ -395,13 +335,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Think(); virtual void Think();
#ifdef HOOK_GAMEDLL
void Spawn_();
void Think_();
#endif
public: public:
float m_lastTime; float m_lastTime;
float m_tmBeepPeriod; float m_tmBeepPeriod;
@ -419,18 +352,6 @@ public:
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual CGib *CreateGib(); virtual CGib *CreateGib();
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
CGib *CreateGib_();
#endif
public: public:
void EXPORT ShootThink(); void EXPORT ShootThink();
@ -453,15 +374,6 @@ public:
virtual void Precache(); virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
virtual CGib *CreateGib(); virtual CGib *CreateGib();
#ifdef HOOK_GAMEDLL
void Precache_();
void KeyValue_(KeyValueData *pkvd);
CGib *CreateGib_();
#endif
}; };
#define MAX_BEAM 24 #define MAX_BEAM 24
@ -473,14 +385,6 @@ public:
virtual void Precache(); virtual void Precache();
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
void EXPORT TestThink(); void EXPORT TestThink();
@ -501,14 +405,6 @@ public:
virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
void KeyValue_(KeyValueData *pkvd);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
int Color() const { return pev->impulse; } int Color() const { return pev->impulse; }
float BloodAmount() const { return pev->dmg; } float BloodAmount() const { return pev->dmg; }
@ -528,14 +424,6 @@ public:
virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
void KeyValue_(KeyValueData *pkvd);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
float Amplitude() const { return pev->scale; } float Amplitude() const { return pev->scale; }
float Frequency() const { return pev->dmg_save; } float Frequency() const { return pev->dmg_save; }
@ -555,14 +443,6 @@ public:
virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
void KeyValue_(KeyValueData *pkvd);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
float Duration() const { return pev->dmg_take; } float Duration() const { return pev->dmg_take; }
float HoldTime() const { return pev->dmg_save; } float HoldTime() const { return pev->dmg_save; }
@ -578,16 +458,6 @@ public:
virtual void Precache(); virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
}; };
class CEnvFunnel: public CBaseDelay class CEnvFunnel: public CBaseDelay
@ -597,14 +467,6 @@ public:
virtual void Precache(); virtual void Precache();
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
int m_iSprite; int m_iSprite;
}; };
@ -615,15 +477,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Precache(); virtual void Precache();
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
}; };
class CItemSoda: public CBaseEntity class CItemSoda: public CBaseEntity
@ -632,13 +485,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Precache(); virtual void Precache();
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
#endif
public: public:
void EXPORT CanThink(); void EXPORT CanThink();
void EXPORT CanTouch(CBaseEntity *pOther); void EXPORT CanTouch(CBaseEntity *pOther);

View File

@ -15,7 +15,7 @@ TYPEDESCRIPTION CEnvExplosion::m_SaveData[] =
LINK_ENTITY_TO_CLASS(spark_shower, CShower, CCSShower) LINK_ENTITY_TO_CLASS(spark_shower, CShower, CCSShower)
void CShower::__MAKE_VHOOK(Spawn)() void CShower::Spawn()
{ {
pev->velocity = RANDOM_FLOAT(200, 300) * pev->angles; pev->velocity = RANDOM_FLOAT(200, 300) * pev->angles;
pev->velocity.x += RANDOM_FLOAT(-100, 100); pev->velocity.x += RANDOM_FLOAT(-100, 100);
@ -40,7 +40,7 @@ void CShower::__MAKE_VHOOK(Spawn)()
pev->angles = g_vecZero; pev->angles = g_vecZero;
} }
void CShower::__MAKE_VHOOK(Think)() void CShower::Think()
{ {
UTIL_Sparks(pev->origin); UTIL_Sparks(pev->origin);
@ -54,7 +54,7 @@ void CShower::__MAKE_VHOOK(Think)()
pev->flags &= ~FL_ONGROUND; pev->flags &= ~FL_ONGROUND;
} }
void CShower::__MAKE_VHOOK(Touch)(CBaseEntity *pOther) void CShower::Touch(CBaseEntity *pOther)
{ {
if (pev->flags & FL_ONGROUND) if (pev->flags & FL_ONGROUND)
pev->velocity = pev->velocity * 0.1f; pev->velocity = pev->velocity * 0.1f;
@ -70,7 +70,7 @@ void CShower::__MAKE_VHOOK(Touch)(CBaseEntity *pOther)
IMPLEMENT_SAVERESTORE(CEnvExplosion, CBaseMonster) IMPLEMENT_SAVERESTORE(CEnvExplosion, CBaseMonster)
LINK_ENTITY_TO_CLASS(env_explosion, CEnvExplosion, CCSEnvExplosion) LINK_ENTITY_TO_CLASS(env_explosion, CEnvExplosion, CCSEnvExplosion)
void CEnvExplosion::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CEnvExplosion::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "iMagnitude")) if (FStrEq(pkvd->szKeyName, "iMagnitude"))
{ {
@ -81,7 +81,7 @@ void CEnvExplosion::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CBaseEntity::KeyValue(pkvd); CBaseEntity::KeyValue(pkvd);
} }
void CEnvExplosion::__MAKE_VHOOK(Spawn)() void CEnvExplosion::Spawn()
{ {
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
pev->effects = EF_NODRAW; pev->effects = EF_NODRAW;
@ -97,7 +97,7 @@ void CEnvExplosion::__MAKE_VHOOK(Spawn)()
m_spriteScale = int(flSpriteScale); m_spriteScale = int(flSpriteScale);
} }
void CEnvExplosion::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CEnvExplosion::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
TraceResult tr; TraceResult tr;

View File

@ -46,15 +46,6 @@ public:
virtual int ObjectCaps() { return FCAP_DONT_SAVE; } virtual int ObjectCaps() { return FCAP_DONT_SAVE; }
virtual void Think(); virtual void Think();
virtual void Touch(CBaseEntity *pOther); virtual void Touch(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Think_();
void Touch_(CBaseEntity *pOther);
#endif
}; };
class CEnvExplosion: public CBaseMonster class CEnvExplosion: public CBaseMonster
@ -66,16 +57,6 @@ public:
virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
void EXPORT Smoke(); void EXPORT Smoke();

View File

@ -106,7 +106,7 @@ TYPEDESCRIPTION CPushable::m_SaveData[] =
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
void CBreakable::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CBreakable::KeyValue(KeyValueData *pkvd)
{ {
// UNDONE_WC: explicitly ignoring these fields, but they shouldn't be in the map file! // UNDONE_WC: explicitly ignoring these fields, but they shouldn't be in the map file!
if (FStrEq(pkvd->szKeyName, "explosion")) if (FStrEq(pkvd->szKeyName, "explosion"))
@ -172,7 +172,7 @@ void CBreakable::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
LINK_ENTITY_TO_CLASS(func_breakable, CBreakable, CCSBreakable) LINK_ENTITY_TO_CLASS(func_breakable, CBreakable, CCSBreakable)
IMPLEMENT_SAVERESTORE(CBreakable, CBaseEntity) IMPLEMENT_SAVERESTORE(CBreakable, CBaseEntity)
void CBreakable::__MAKE_VHOOK(Spawn)() void CBreakable::Spawn()
{ {
Precache(); Precache();
@ -212,7 +212,7 @@ void CBreakable::__MAKE_VHOOK(Spawn)()
} }
} }
void CBreakable::__MAKE_VHOOK(Restart)() void CBreakable::Restart()
{ {
pev->solid = SOLID_BSP; pev->solid = SOLID_BSP;
pev->movetype = MOVETYPE_PUSH; pev->movetype = MOVETYPE_PUSH;
@ -316,7 +316,7 @@ void CBreakable::MaterialSoundRandom(edict_t *pEdict, Materials soundMaterial, f
} }
} }
void CBreakable::__MAKE_VHOOK(Precache)() void CBreakable::Precache()
{ {
const char *pGibName = NULL; const char *pGibName = NULL;
@ -533,7 +533,7 @@ void CBreakable::BreakTouch(CBaseEntity *pOther)
// Smash the our breakable object // Smash the our breakable object
// Break when triggered // Break when triggered
void CBreakable::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CBreakable::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
if (IsBreakable()) if (IsBreakable())
{ {
@ -551,7 +551,7 @@ void CBreakable::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller
} }
} }
void CBreakable::__MAKE_VHOOK(TraceAttack)(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType) void CBreakable::TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType)
{ {
// random spark if this is a 'computer' object // random spark if this is a 'computer' object
if (RANDOM_LONG(0, 1)) if (RANDOM_LONG(0, 1))
@ -587,7 +587,7 @@ void CBreakable::__MAKE_VHOOK(TraceAttack)(entvars_t *pevAttacker, float flDamag
// Special takedamage for func_breakable. Allows us to make // Special takedamage for func_breakable. Allows us to make
// exceptions that are breakable-specific // exceptions that are breakable-specific
// bitsDamageType indicates the type of damage sustained ie: DMG_CRUSH // bitsDamageType indicates the type of damage sustained ie: DMG_CRUSH
BOOL CBreakable::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) BOOL CBreakable::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{ {
Vector vecTemp; Vector vecTemp;
@ -676,7 +676,7 @@ void CBreakable::Die()
// The more negative pev->health, the louder // The more negative pev->health, the louder
// the sound should be. // the sound should be.
#ifdef REGAMEDLL_FIXES #ifdef REGAMEDLL_FIXES
fvol = RANDOM_FLOAT(0.85f, 1.0f) + (Q_abs(pev->health) / 100.0f); fvol = RANDOM_FLOAT(0.85f, 1.0f) + (Q_abs(pev->health) / 100.0f);
#else #else
@ -849,7 +849,7 @@ BOOL CBreakable::IsBreakable()
return m_Material != matUnbreakableGlass; return m_Material != matUnbreakableGlass;
} }
int CBreakable::__MAKE_VHOOK(DamageDecal)(int bitsDamageType) int CBreakable::DamageDecal(int bitsDamageType)
{ {
if (m_Material == matGlass) if (m_Material == matGlass)
return DECAL_GLASSBREAK1 + RANDOM_LONG(0, 2); return DECAL_GLASSBREAK1 + RANDOM_LONG(0, 2);
@ -863,7 +863,7 @@ int CBreakable::__MAKE_VHOOK(DamageDecal)(int bitsDamageType)
LINK_ENTITY_TO_CLASS(func_pushable, CPushable, CCSPushable) LINK_ENTITY_TO_CLASS(func_pushable, CPushable, CCSPushable)
IMPLEMENT_SAVERESTORE(CPushable, CBreakable) IMPLEMENT_SAVERESTORE(CPushable, CBreakable)
void CPushable::__MAKE_VHOOK(Spawn)() void CPushable::Spawn()
{ {
if (pev->spawnflags & SF_PUSH_BREAKABLE) if (pev->spawnflags & SF_PUSH_BREAKABLE)
CBreakable::Spawn(); CBreakable::Spawn();
@ -898,7 +898,7 @@ void CPushable::__MAKE_VHOOK(Spawn)()
m_soundTime = 0; m_soundTime = 0;
} }
void CPushable::__MAKE_VHOOK(Precache)() void CPushable::Precache()
{ {
for (int i = 0; i < 3; ++i) for (int i = 0; i < 3; ++i)
{ {
@ -935,7 +935,7 @@ void CPushable::Restart()
} }
#endif #endif
void CPushable::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CPushable::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "size")) if (FStrEq(pkvd->szKeyName, "size"))
{ {
@ -972,7 +972,7 @@ void CPushable::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
} }
// Pull the func_pushable // Pull the func_pushable
void CPushable::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CPushable::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
if (!pActivator || !pActivator->IsPlayer()) if (!pActivator || !pActivator->IsPlayer())
{ {
@ -990,7 +990,7 @@ void CPushable::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller,
} }
} }
void CPushable::__MAKE_VHOOK(Touch)(CBaseEntity *pOther) void CPushable::Touch(CBaseEntity *pOther)
{ {
if (FClassnameIs(pOther->pev, "worldspawn")) if (FClassnameIs(pOther->pev, "worldspawn"))
return; return;
@ -1078,7 +1078,7 @@ void CPushable::Move(CBaseEntity *pOther, int push)
} }
} }
BOOL CPushable::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) BOOL CPushable::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{ {
if (pev->spawnflags & SF_PUSH_BREAKABLE) if (pev->spawnflags & SF_PUSH_BREAKABLE)
{ {

View File

@ -88,21 +88,6 @@ public:
virtual int DamageDecal(int bitsDamageType); virtual int DamageDecal(int bitsDamageType);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
void Restart_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void TraceAttack_(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType);
BOOL TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
int DamageDecal_(int bitsDamageType);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
void EXPORT BreakTouch(CBaseEntity *pOther); void EXPORT BreakTouch(CBaseEntity *pOther);
void DamageSound(); void DamageSound();
@ -157,27 +142,13 @@ public:
virtual void Restart(); virtual void Restart();
#endif #endif
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
BOOL TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
void Touch_(CBaseEntity *pOther);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
void Move(CBaseEntity *pMover, int push); void Move(CBaseEntity *pMover, int push);
void EXPORT StopSound() void EXPORT StopSound()
{ {
#if 0 #if 0
Vector dist = pev->oldorigin - pev->origin; Vector dist = pev->oldorigin - pev->origin;
if (dist.Length() <= 0) if (dist.Length() <= 0) {
{
STOP_SOUND(ENT(pev), CHAN_WEAPON, m_soundNames[m_lastSound]); STOP_SOUND(ENT(pev), CHAN_WEAPON, m_soundNames[m_lastSound]);
} }
#endif #endif

View File

@ -61,7 +61,7 @@ const int MAX_FIRING_SPREADS = ARRAYSIZE(gTankSpread);
IMPLEMENT_SAVERESTORE(CFuncTank, CBaseEntity) IMPLEMENT_SAVERESTORE(CFuncTank, CBaseEntity)
void CFuncTank::__MAKE_VHOOK(Spawn)() void CFuncTank::Spawn()
{ {
Precache(); Precache();
@ -90,7 +90,7 @@ void CFuncTank::__MAKE_VHOOK(Spawn)()
pev->oldorigin = pev->origin; pev->oldorigin = pev->origin;
} }
void CFuncTank::__MAKE_VHOOK(Precache)() void CFuncTank::Precache()
{ {
if (m_iszSpriteSmoke) if (m_iszSpriteSmoke)
{ {
@ -108,7 +108,7 @@ void CFuncTank::__MAKE_VHOOK(Precache)()
} }
} }
void CFuncTank::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CFuncTank::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "yawrate")) if (FStrEq(pkvd->szKeyName, "yawrate"))
{ {
@ -219,7 +219,7 @@ void CFuncTank::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CBaseEntity::KeyValue(pkvd); CBaseEntity::KeyValue(pkvd);
} }
BOOL CFuncTank::__MAKE_VHOOK(OnControls)(entvars_t *pevTest) BOOL CFuncTank::OnControls(entvars_t *pevTest)
{ {
if (!(pev->spawnflags & SF_TANK_CANCONTROL)) if (!(pev->spawnflags & SF_TANK_CANCONTROL))
return FALSE; return FALSE;
@ -323,7 +323,7 @@ void CFuncTank::ControllerPostFrame()
} }
} }
void CFuncTank::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CFuncTank::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
// player controlled turret // player controlled turret
if (pev->spawnflags & SF_TANK_CANCONTROL) if (pev->spawnflags & SF_TANK_CANCONTROL)
@ -373,7 +373,7 @@ BOOL CFuncTank::InRange(float range)
return TRUE; return TRUE;
} }
void CFuncTank::__MAKE_VHOOK(Think)() void CFuncTank::Think()
{ {
pev->avelocity = g_vecZero; pev->avelocity = g_vecZero;
TrackTarget(); TrackTarget();
@ -580,7 +580,7 @@ void CFuncTank::AdjustAnglesForBarrel(Vector &angles, float distance)
} }
// Fire targets and spawn sprites // Fire targets and spawn sprites
void CFuncTank::__MAKE_VHOOK(Fire)(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker) void CFuncTank::Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker)
{ {
if (m_fireLast != 0.0f) if (m_fireLast != 0.0f)
{ {
@ -656,7 +656,7 @@ void CFuncTank::StopRotSound()
LINK_ENTITY_TO_CLASS(func_tank, CFuncTankGun, CCSFuncTankGun) LINK_ENTITY_TO_CLASS(func_tank, CFuncTankGun, CCSFuncTankGun)
void CFuncTankGun::__MAKE_VHOOK(Fire)(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker) void CFuncTankGun::Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker)
{ {
if (m_fireLast != 0.0f) if (m_fireLast != 0.0f)
{ {
@ -696,7 +696,7 @@ void CFuncTankGun::__MAKE_VHOOK(Fire)(const Vector &barrelEnd, const Vector &for
LINK_ENTITY_TO_CLASS(func_tanklaser, CFuncTankLaser, CCSFuncTankLaser) LINK_ENTITY_TO_CLASS(func_tanklaser, CFuncTankLaser, CCSFuncTankLaser)
IMPLEMENT_SAVERESTORE(CFuncTankLaser, CFuncTank) IMPLEMENT_SAVERESTORE(CFuncTankLaser, CFuncTank)
void CFuncTankLaser::__MAKE_VHOOK(Activate)() void CFuncTankLaser::Activate()
{ {
if (!GetLaser()) if (!GetLaser())
{ {
@ -709,7 +709,7 @@ void CFuncTankLaser::__MAKE_VHOOK(Activate)()
} }
} }
void CFuncTankLaser::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CFuncTankLaser::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "laserentity")) if (FStrEq(pkvd->szKeyName, "laserentity"))
{ {
@ -744,7 +744,7 @@ CLaser *CFuncTankLaser::GetLaser()
return m_pLaser; return m_pLaser;
} }
void CFuncTankLaser::__MAKE_VHOOK(Think)() void CFuncTankLaser::Think()
{ {
if (m_pLaser != NULL && gpGlobals->time > m_laserTime) if (m_pLaser != NULL && gpGlobals->time > m_laserTime)
{ {
@ -754,7 +754,7 @@ void CFuncTankLaser::__MAKE_VHOOK(Think)()
CFuncTank::Think(); CFuncTank::Think();
} }
void CFuncTankLaser::__MAKE_VHOOK(Fire)(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker) void CFuncTankLaser::Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker)
{ {
int i; int i;
TraceResult tr; TraceResult tr;
@ -791,13 +791,13 @@ void CFuncTankLaser::__MAKE_VHOOK(Fire)(const Vector &barrelEnd, const Vector &f
LINK_ENTITY_TO_CLASS(func_tankrocket, CFuncTankRocket, CCSFuncTankRocket) LINK_ENTITY_TO_CLASS(func_tankrocket, CFuncTankRocket, CCSFuncTankRocket)
void CFuncTankRocket::__MAKE_VHOOK(Precache)() void CFuncTankRocket::Precache()
{ {
UTIL_PrecacheOther("rpg_rocket"); UTIL_PrecacheOther("rpg_rocket");
CFuncTank::Precache(); CFuncTank::Precache();
} }
void CFuncTankRocket::__MAKE_VHOOK(Fire)(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker) void CFuncTankRocket::Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker)
{ {
int i; int i;
@ -821,7 +821,7 @@ void CFuncTankRocket::__MAKE_VHOOK(Fire)(const Vector &barrelEnd, const Vector &
LINK_ENTITY_TO_CLASS(func_tankmortar, CFuncTankMortar, CCSFuncTankMortar) LINK_ENTITY_TO_CLASS(func_tankmortar, CFuncTankMortar, CCSFuncTankMortar)
void CFuncTankMortar::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CFuncTankMortar::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "iMagnitude")) if (FStrEq(pkvd->szKeyName, "iMagnitude"))
{ {
@ -832,7 +832,7 @@ void CFuncTankMortar::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CFuncTank::KeyValue(pkvd); CFuncTank::KeyValue(pkvd);
} }
void CFuncTankMortar::__MAKE_VHOOK(Fire)(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker) void CFuncTankMortar::Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker)
{ {
if (m_fireLast != 0.0f) if (m_fireLast != 0.0f)
{ {
@ -858,7 +858,7 @@ void CFuncTankMortar::__MAKE_VHOOK(Fire)(const Vector &barrelEnd, const Vector &
LINK_ENTITY_TO_CLASS(func_tankcontrols, CFuncTankControls, CCSFuncTankControls) LINK_ENTITY_TO_CLASS(func_tankcontrols, CFuncTankControls, CCSFuncTankControls)
IMPLEMENT_SAVERESTORE(CFuncTankControls, CBaseEntity) IMPLEMENT_SAVERESTORE(CFuncTankControls, CBaseEntity)
void CFuncTankControls::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CFuncTankControls::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
// pass the Use command onto the controls // pass the Use command onto the controls
if (m_pTank != NULL) if (m_pTank != NULL)
@ -870,7 +870,7 @@ void CFuncTankControls::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *
assert(m_pTank != NULL); assert(m_pTank != NULL);
} }
void CFuncTankControls::__MAKE_VHOOK(Think)() void CFuncTankControls::Think()
{ {
edict_t *pTarget = NULL; edict_t *pTarget = NULL;
@ -889,7 +889,7 @@ void CFuncTankControls::__MAKE_VHOOK(Think)()
m_pTank = static_cast<CFuncTank *>(Instance(pTarget)); m_pTank = static_cast<CFuncTank *>(Instance(pTarget));
} }
void CFuncTankControls::__MAKE_VHOOK(Spawn)() void CFuncTankControls::Spawn()
{ {
pev->solid = SOLID_TRIGGER; pev->solid = SOLID_TRIGGER;
pev->movetype = MOVETYPE_NONE; pev->movetype = MOVETYPE_NONE;

View File

@ -65,20 +65,6 @@ public:
virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker); virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
virtual Vector UpdateTargetPosition(CBaseEntity *pTarget) { return pTarget->BodyTarget(pev->origin); } virtual Vector UpdateTargetPosition(CBaseEntity *pTarget) { return pTarget->BodyTarget(pev->origin); }
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
BOOL OnControls_(entvars_t *pevTest);
void Think_();
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void Fire_(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
#endif
public: public:
void TrackTarget(); void TrackTarget();
void StartRotSound(); void StartRotSound();
@ -160,11 +146,6 @@ class CFuncTankGun: public CFuncTank
{ {
public: public:
virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker); virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
#ifdef HOOK_GAMEDLL
void Fire_(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
#endif
}; };
class CFuncTankLaser: public CFuncTank class CFuncTankLaser: public CFuncTank
@ -177,17 +158,6 @@ public:
virtual void Think(); virtual void Think();
virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker); virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
#ifdef HOOK_GAMEDLL
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Activate_();
void Think_();
void Fire_(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
#endif
CLaser *GetLaser(); CLaser *GetLaser();
public: public:
@ -203,14 +173,6 @@ class CFuncTankRocket: public CFuncTank
public: public:
virtual void Precache(); virtual void Precache();
virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker); virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
#ifdef HOOK_GAMEDLL
void Precache_();
void Fire_(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
#endif
}; };
class CFuncTankMortar: public CFuncTank class CFuncTankMortar: public CFuncTank
@ -218,14 +180,6 @@ class CFuncTankMortar: public CFuncTank
public: public:
virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker); virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
#ifdef HOOK_GAMEDLL
void KeyValue_(KeyValueData *pkvd);
void Fire_(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
#endif
}; };
class CFuncTankControls: public CBaseEntity class CFuncTankControls: public CBaseEntity
@ -238,16 +192,6 @@ public:
virtual void Think(); virtual void Think();
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Think_();
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
static TYPEDESCRIPTION IMPL(m_SaveData)[1]; static TYPEDESCRIPTION IMPL(m_SaveData)[1];
CFuncTank *m_pTank; CFuncTank *m_pTank;

View File

@ -10,7 +10,6 @@ CGameRules *g_pGameRules = NULL;
#endif #endif
CGameRules::CGameRules() CGameRules::CGameRules()
: m_GameDesc()
{ {
m_bFreezePeriod = FALSE; m_bFreezePeriod = FALSE;
m_bBombDropped = FALSE; m_bBombDropped = FALSE;
@ -20,11 +19,13 @@ CGameRules::CGameRules()
Q_strcpy(m_GameDesc, AreRunningCZero() ? "Condition Zero" : "Counter-Strike"); Q_strcpy(m_GameDesc, AreRunningCZero() ? "Condition Zero" : "Counter-Strike");
} }
#ifndef HOOK_GAMEDLL
CGameRules::~CGameRules() CGameRules::~CGameRules()
{ {
delete[] m_GameDesc; delete[] m_GameDesc;
m_GameDesc = nullptr; m_GameDesc = nullptr;
} }
#endif
// this is the game name that gets seen in the server browser // this is the game name that gets seen in the server browser
const char *CGameRules::GetGameDescription() const char *CGameRules::GetGameDescription()
@ -36,7 +37,7 @@ const char *CGameRules::GetGameDescription()
#endif #endif
} }
BOOL CGameRules::__MAKE_VHOOK(CanHaveAmmo)(CBasePlayer *pPlayer, const char *pszAmmoName, int iMaxCarry) BOOL CGameRules::CanHaveAmmo(CBasePlayer *pPlayer, const char *pszAmmoName, int iMaxCarry)
{ {
if (pszAmmoName) if (pszAmmoName)
{ {
@ -54,7 +55,7 @@ BOOL CGameRules::__MAKE_VHOOK(CanHaveAmmo)(CBasePlayer *pPlayer, const char *psz
return FALSE; return FALSE;
} }
edict_t *CGameRules::__MAKE_VHOOK(GetPlayerSpawnSpot)(CBasePlayer *pPlayer) edict_t *CGameRules::GetPlayerSpawnSpot(CBasePlayer *pPlayer)
{ {
// gat valid spawn point // gat valid spawn point
edict_t *pentSpawnSpot = pPlayer->EntSelectSpawnPoint(); edict_t *pentSpawnSpot = pPlayer->EntSelectSpawnPoint();
@ -77,7 +78,7 @@ edict_t *CGameRules::__MAKE_VHOOK(GetPlayerSpawnSpot)(CBasePlayer *pPlayer)
return pentSpawnSpot; return pentSpawnSpot;
} }
BOOL CGameRules::__MAKE_VHOOK(CanHavePlayerItem)(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon) BOOL CGameRules::CanHavePlayerItem(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon)
{ {
// only living players can have items // only living players can have items
if (pPlayer->pev->deadflag != DEAD_NO) if (pPlayer->pev->deadflag != DEAD_NO)
@ -115,7 +116,7 @@ BOOL CGameRules::__MAKE_VHOOK(CanHavePlayerItem)(CBasePlayer *pPlayer, CBasePlay
return TRUE; return TRUE;
} }
void CGameRules::__MAKE_VHOOK(RefreshSkillData)() void CGameRules::RefreshSkillData()
{ {
int iSkill = int(CVAR_GET_FLOAT("skill")); int iSkill = int(CVAR_GET_FLOAT("skill"));

View File

@ -60,12 +60,6 @@
#define WINNER_NONE 0 #define WINNER_NONE 0
#define WINNER_DRAW 1 #define WINNER_DRAW 1
#if defined(REGAMEDLL_ADD) && !defined(HOOK_GAMEDLL)
#define VFUNC virtual
#else
#define VFUNC
#endif
enum enum
{ {
WINSTATUS_CTS = 1, WINSTATUS_CTS = 1,
@ -128,44 +122,44 @@ enum RewardRules
// custom enum // custom enum
enum RewardAccount enum RewardAccount
{ {
REWARD_TARGET_BOMB = 3500, REWARD_TARGET_BOMB = 3500,
REWARD_VIP_ESCAPED = 3500, REWARD_VIP_ESCAPED = 3500,
REWARD_VIP_ASSASSINATED = 3250, REWARD_VIP_ASSASSINATED = 3250,
REWARD_TERRORISTS_ESCAPED = 3150, REWARD_TERRORISTS_ESCAPED = 3150,
REWARD_CTS_PREVENT_ESCAPE = 3500, REWARD_CTS_PREVENT_ESCAPE = 3500,
REWARD_ESCAPING_TERRORISTS_NEUTRALIZED = 3250, REWARD_ESCAPING_TERRORISTS_NEUTRALIZED = 3250,
REWARD_BOMB_DEFUSED = 3250, REWARD_BOMB_DEFUSED = 3250,
REWARD_BOMB_PLANTED = 800, REWARD_BOMB_PLANTED = 800,
REWARD_BOMB_EXPLODED = 3250, REWARD_BOMB_EXPLODED = 3250,
REWARD_CTS_WIN = 3000, REWARD_CTS_WIN = 3000,
REWARD_TERRORISTS_WIN = 3000, REWARD_TERRORISTS_WIN = 3000,
REWARD_ALL_HOSTAGES_RESCUED = 2500, REWARD_ALL_HOSTAGES_RESCUED = 2500,
// the end round was by the expiration time // the end round was by the expiration time
REWARD_TARGET_BOMB_SAVED = 3250, REWARD_TARGET_BOMB_SAVED = 3250,
REWARD_HOSTAGE_NOT_RESCUED = 3250, REWARD_HOSTAGE_NOT_RESCUED = 3250,
REWARD_VIP_NOT_ESCAPED = 3250, REWARD_VIP_NOT_ESCAPED = 3250,
// loser bonus // loser bonus
REWARD_LOSER_BONUS_DEFAULT = 1400, REWARD_LOSER_BONUS_DEFAULT = 1400,
REWARD_LOSER_BONUS_MIN = 1500, REWARD_LOSER_BONUS_MIN = 1500,
REWARD_LOSER_BONUS_MAX = 3000, REWARD_LOSER_BONUS_MAX = 3000,
REWARD_LOSER_BONUS_ADD = 500, REWARD_LOSER_BONUS_ADD = 500,
REWARD_RESCUED_HOSTAGE = 750, REWARD_RESCUED_HOSTAGE = 750,
REWARD_KILLED_ENEMY = 300, REWARD_KILLED_ENEMY = 300,
REWARD_KILLED_VIP = 2500, REWARD_KILLED_VIP = 2500,
REWARD_VIP_HAVE_SELF_RESCUED = 2500, REWARD_VIP_HAVE_SELF_RESCUED = 2500,
REWARD_TAKEN_HOSTAGE = 1000, REWARD_TAKEN_HOSTAGE = 1000,
REWARD_TOOK_HOSTAGE_ACC = 100, REWARD_TOOK_HOSTAGE_ACC = 100,
REWARD_TOOK_HOSTAGE = 150, REWARD_TOOK_HOSTAGE = 150,
}; };
// custom enum // custom enum
enum PaybackForBadThing enum PaybackForBadThing
{ {
PAYBACK_FOR_KILLED_TEAMMATES = -3300, PAYBACK_FOR_KILLED_TEAMMATES = -3300,
}; };
// custom enum // custom enum
@ -203,13 +197,13 @@ enum
// custom enum // custom enum
enum enum
{ {
SCENARIO_BLOCK_TIME_EXPRIRED = (1 << 0), // flag "a" SCENARIO_BLOCK_TIME_EXPRIRED = (1 << 0), // flag "a"
SCENARIO_BLOCK_NEED_PLAYERS = (1 << 1), // flag "b" SCENARIO_BLOCK_NEED_PLAYERS = (1 << 1), // flag "b"
SCENARIO_BLOCK_VIP_ESCAPE = (1 << 2), // flag "c" SCENARIO_BLOCK_VIP_ESCAPE = (1 << 2), // flag "c"
SCENARIO_BLOCK_PRISON_ESCAPE = (1 << 3), // flag "d" SCENARIO_BLOCK_PRISON_ESCAPE = (1 << 3), // flag "d"
SCENARIO_BLOCK_BOMB = (1 << 4), // flag "e" SCENARIO_BLOCK_BOMB = (1 << 4), // flag "e"
SCENARIO_BLOCK_TEAM_EXTERMINATION = (1 << 5), // flag "f" SCENARIO_BLOCK_TEAM_EXTERMINATION = (1 << 5), // flag "f"
SCENARIO_BLOCK_HOSTAGE_RESCUE = (1 << 6), // flag "g" SCENARIO_BLOCK_HOSTAGE_RESCUE = (1 << 6), // flag "g"
}; };
// Player relationship return codes // Player relationship return codes
@ -228,49 +222,53 @@ class CGameRules
{ {
public: public:
CGameRules(); CGameRules();
#ifndef HOOK_GAMEDLL
virtual ~CGameRules(); virtual ~CGameRules();
virtual void RefreshSkillData(); // fill skill data struct with proper values #endif
virtual void Think() = 0; // runs every server frame, should handle any timer tasks, periodic events, etc.
virtual void RefreshSkillData(); // fill skill data struct with proper values
virtual void Think() = 0; // runs every server frame, should handle any timer tasks, periodic events, etc.
virtual BOOL IsAllowedToSpawn(CBaseEntity *pEntity) = 0; // Can this item spawn (eg monsters don't spawn in deathmatch). virtual BOOL IsAllowedToSpawn(CBaseEntity *pEntity) = 0; // Can this item spawn (eg monsters don't spawn in deathmatch).
virtual BOOL FAllowFlashlight() = 0; // Are players allowed to switch on their flashlight? virtual BOOL FAllowFlashlight() = 0; // Are players allowed to switch on their flashlight?
virtual BOOL FShouldSwitchWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon) = 0; // should the player switch to this weapon? virtual BOOL FShouldSwitchWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon) = 0; // should the player switch to this weapon?
virtual BOOL GetNextBestWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeapon) = 0; // I can't use this weapon anymore, get me the next best one. virtual BOOL GetNextBestWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeapon) = 0; // I can't use this weapon anymore, get me the next best one.
// Functions to verify the single/multiplayer status of a game // Functions to verify the single/multiplayer status of a game
virtual BOOL IsMultiplayer() = 0; // is this a multiplayer game? (either coop or deathmatch) virtual BOOL IsMultiplayer() = 0; // is this a multiplayer game? (either coop or deathmatch)
virtual BOOL IsDeathmatch() = 0; // is this a deathmatch game? virtual BOOL IsDeathmatch() = 0; // is this a deathmatch game?
virtual BOOL IsTeamplay() { return FALSE; } // is this deathmatch game being played with team rules? virtual BOOL IsTeamplay() { return FALSE; } // is this deathmatch game being played with team rules?
virtual BOOL IsCoOp() = 0; // is this a coop game? virtual BOOL IsCoOp() = 0; // is this a coop game?
virtual const char *GetGameDescription(); // this is the game name that gets seen in the server browser virtual const char *GetGameDescription(); // this is the game name that gets seen in the server browser
// Client connection/disconnection // Client connection/disconnection
virtual BOOL ClientConnected(edict_t *pEntity, const char *pszName, const char *pszAddress, char *szRejectReason) = 0; // a client just connected to the server (player hasn't spawned yet) virtual BOOL ClientConnected(edict_t *pEntity, const char *pszName, const char *pszAddress, char *szRejectReason) = 0; // a client just connected to the server (player hasn't spawned yet)
virtual void InitHUD(CBasePlayer *pl) = 0; // the client dll is ready for updating virtual void InitHUD(CBasePlayer *pl) = 0; // the client dll is ready for updating
virtual void ClientDisconnected(edict_t *pClient) = 0; // a client just disconnected from the server virtual void ClientDisconnected(edict_t *pClient) = 0; // a client just disconnected from the server
virtual void UpdateGameMode(CBasePlayer *pPlayer) {}; // the client needs to be informed of the current game mode virtual void UpdateGameMode(CBasePlayer *pPlayer) {}; // the client needs to be informed of the current game mode
// Client damage rules // Client damage rules
virtual float FlPlayerFallDamage(CBasePlayer *pPlayer) = 0; virtual float FlPlayerFallDamage(CBasePlayer *pPlayer) = 0;
virtual BOOL FPlayerCanTakeDamage(CBasePlayer *pPlayer, CBaseEntity *pAttacker) { return TRUE; } // can this player take damage from this attacker? virtual BOOL FPlayerCanTakeDamage(CBasePlayer *pPlayer, CBaseEntity *pAttacker) { return TRUE; } // can this player take damage from this attacker?
virtual BOOL ShouldAutoAim(CBasePlayer *pPlayer, edict_t *target) { return TRUE; } virtual BOOL ShouldAutoAim(CBasePlayer *pPlayer, edict_t *target) { return TRUE; }
// Client spawn/respawn control // Client spawn/respawn control
virtual void PlayerSpawn(CBasePlayer *pPlayer) = 0; // called by CBasePlayer::Spawn just before releasing player into the game virtual void PlayerSpawn(CBasePlayer *pPlayer) = 0; // called by CBasePlayer::Spawn just before releasing player into the game
virtual void PlayerThink(CBasePlayer *pPlayer) = 0; // called by CBasePlayer::PreThink every frame, before physics are run and after keys are accepted virtual void PlayerThink(CBasePlayer *pPlayer) = 0; // called by CBasePlayer::PreThink every frame, before physics are run and after keys are accepted
virtual BOOL FPlayerCanRespawn(CBasePlayer *pPlayer) = 0; // is this player allowed to respawn now? virtual BOOL FPlayerCanRespawn(CBasePlayer *pPlayer) = 0; // is this player allowed to respawn now?
virtual float FlPlayerSpawnTime(CBasePlayer *pPlayer) = 0; // When in the future will this player be able to spawn? virtual float FlPlayerSpawnTime(CBasePlayer *pPlayer) = 0; // When in the future will this player be able to spawn?
virtual edict_t *GetPlayerSpawnSpot(CBasePlayer *pPlayer); // Place this player on their spawnspot and face them the proper direction. virtual edict_t *GetPlayerSpawnSpot(CBasePlayer *pPlayer); // Place this player on their spawnspot and face them the proper direction.
virtual BOOL AllowAutoTargetCrosshair() { return TRUE; } virtual BOOL AllowAutoTargetCrosshair() { return TRUE; }
virtual BOOL ClientCommand_DeadOrAlive(CBasePlayer *pPlayer, const char *pcmd) { return FALSE; } virtual BOOL ClientCommand_DeadOrAlive(CBasePlayer *pPlayer, const char *pcmd) { return FALSE; }
virtual BOOL ClientCommand(CBasePlayer *pPlayer, const char *pcmd) { return FALSE; } // handles the user commands; returns TRUE if command handled properly virtual BOOL ClientCommand(CBasePlayer *pPlayer, const char *pcmd) { return FALSE; } // handles the user commands; returns TRUE if command handled properly
virtual void ClientUserInfoChanged(CBasePlayer *pPlayer, char *infobuffer) {}; // the player has changed userinfo; can change it now virtual void ClientUserInfoChanged(CBasePlayer *pPlayer, char *infobuffer) {}; // the player has changed userinfo; can change it now
// Client kills/scoring // Client kills/scoring
virtual int IPointsForKill(CBasePlayer *pAttacker, CBasePlayer *pKilled) = 0; // how many points do I award whoever kills this player? virtual int IPointsForKill(CBasePlayer *pAttacker, CBasePlayer *pKilled) = 0; // how many points do I award whoever kills this player?
virtual void PlayerKilled(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor) = 0; // Called each time a player dies virtual void PlayerKilled(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor) = 0; // Called each time a player dies
virtual void DeathNotice(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pevInflictor) = 0; // Call this from within a GameRules class to report an obituary. virtual void DeathNotice(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pevInflictor) = 0; // Call this from within a GameRules class to report an obituary.
// Weapon retrieval // Weapon retrieval
virtual BOOL CanHavePlayerItem(CBasePlayer *pPlayer, CBasePlayerItem *pItem); // The player is touching an CBasePlayerItem, do I give it to him? virtual BOOL CanHavePlayerItem(CBasePlayer *pPlayer, CBasePlayerItem *pItem); // The player is touching an CBasePlayerItem, do I give it to him?
@ -287,21 +285,21 @@ public:
virtual void PlayerGotItem(CBasePlayer *pPlayer, CItem *pItem) = 0; // call each time a player picks up an item (battery, healthkit, longjump) virtual void PlayerGotItem(CBasePlayer *pPlayer, CItem *pItem) = 0; // call each time a player picks up an item (battery, healthkit, longjump)
// Item spawn/respawn control // Item spawn/respawn control
virtual int ItemShouldRespawn(CItem *pItem) = 0; // Should this item respawn? virtual int ItemShouldRespawn(CItem *pItem) = 0; // Should this item respawn?
virtual float FlItemRespawnTime(CItem *pItem) = 0; // when may this item respawn? virtual float FlItemRespawnTime(CItem *pItem) = 0; // when may this item respawn?
virtual Vector VecItemRespawnSpot(CItem *pItem) = 0; // where in the world should this item respawn? virtual Vector VecItemRespawnSpot(CItem *pItem) = 0; // where in the world should this item respawn?
// Ammo retrieval // Ammo retrieval
virtual BOOL CanHaveAmmo(CBasePlayer *pPlayer, const char *pszAmmoName, int iMaxCarry); // can this player take more of this ammo? virtual BOOL CanHaveAmmo(CBasePlayer *pPlayer, const char *pszAmmoName, int iMaxCarry); // can this player take more of this ammo?
virtual void PlayerGotAmmo(CBasePlayer *pPlayer, char *szName, int iCount) = 0; // called each time a player picks up some ammo in the world virtual void PlayerGotAmmo(CBasePlayer *pPlayer, char *szName, int iCount) = 0; // called each time a player picks up some ammo in the world
// Ammo spawn/respawn control // Ammo spawn/respawn control
virtual int AmmoShouldRespawn(CBasePlayerAmmo *pAmmo) = 0; // should this ammo item respawn? virtual int AmmoShouldRespawn(CBasePlayerAmmo *pAmmo) = 0; // should this ammo item respawn?
virtual float FlAmmoRespawnTime(CBasePlayerAmmo *pAmmo) = 0; // when should this ammo item respawn? virtual float FlAmmoRespawnTime(CBasePlayerAmmo *pAmmo) = 0; // when should this ammo item respawn?
virtual Vector VecAmmoRespawnSpot(CBasePlayerAmmo *pAmmo) = 0; // where in the world should this ammo item respawn? virtual Vector VecAmmoRespawnSpot(CBasePlayerAmmo *pAmmo) = 0; // where in the world should this ammo item respawn?
// Healthcharger respawn control // Healthcharger respawn control
virtual float FlHealthChargerRechargeTime() = 0; // how long until a depleted HealthCharger recharges itself? virtual float FlHealthChargerRechargeTime() = 0; // how long until a depleted HealthCharger recharges itself?
virtual float FlHEVChargerRechargeTime() { return 0.0f; } // how long until a depleted HealthCharger recharges itself? virtual float FlHEVChargerRechargeTime() { return 0.0f; } // how long until a depleted HealthCharger recharges itself?
// What happens to a dead player's weapons // What happens to a dead player's weapons
@ -312,7 +310,7 @@ public:
// Teamplay stuff // Teamplay stuff
virtual const char *GetTeamID(CBaseEntity *pEntity) = 0; // what team is this entity on? virtual const char *GetTeamID(CBaseEntity *pEntity) = 0; // what team is this entity on?
virtual int PlayerRelationship(CBasePlayer *pPlayer, CBaseEntity *pTarget) = 0; // What is the player's relationship with this entity? virtual int PlayerRelationship(CBasePlayer *pPlayer, CBaseEntity *pTarget) = 0; // What is the player's relationship with this entity?
virtual int GetTeamIndex(const char *pTeamName) { return -1; } virtual int GetTeamIndex(const char *pTeamName) { return -1; }
virtual const char *GetIndexedTeamName(int teamIndex) { return ""; } virtual const char *GetIndexedTeamName(int teamIndex) { return ""; }
virtual BOOL IsValidTeam(const char *pTeamName) { return TRUE; } virtual BOOL IsValidTeam(const char *pTeamName) { return TRUE; }
@ -333,26 +331,17 @@ public:
virtual void ServerDeactivate() {}; virtual void ServerDeactivate() {};
virtual void CheckMapConditions() {}; virtual void CheckMapConditions() {};
#ifdef HOOK_GAMEDLL
void RefreshSkillData_();
edict_t *GetPlayerSpawnSpot_(CBasePlayer *pPlayer);
BOOL CanHavePlayerItem_(CBasePlayer *pPlayer, CBasePlayerItem *pItem);
BOOL CanHaveAmmo_(CBasePlayer *pPlayer, const char *pszAmmoName, int iMaxCarry);
#endif
// inline function's // inline function's
inline bool IsGameOver() const { return m_bGameOver; } inline bool IsGameOver() const { return m_bGameOver; }
inline void SetGameOver() { m_bGameOver = true; } inline void SetGameOver() { m_bGameOver = true; }
public: public:
BOOL m_bFreezePeriod; // TRUE at beginning of round, set to FALSE when the period expires BOOL m_bFreezePeriod; // TRUE at beginning of round, set to FALSE when the period expires
BOOL m_bBombDropped; BOOL m_bBombDropped;
// custom // custom
char *m_GameDesc; CUSTOM_MEMBER char *m_GameDesc;
bool m_bGameOver; // intermission or finale (deprecated name g_fGameOver) CUSTOM_MEMBER bool m_bGameOver; // intermission or finale (deprecated name g_fGameOver)
}; };
// CHalfLifeRules - rules for the single player Half-Life game. // CHalfLifeRules - rules for the single player Half-Life game.
@ -360,7 +349,10 @@ class CHalfLifeRules: public CGameRules
{ {
public: public:
CHalfLifeRules(); CHalfLifeRules();
#ifndef HOOK_GAMEDLL
virtual ~CHalfLifeRules() {}; virtual ~CHalfLifeRules() {};
#endif
virtual void Think(); virtual void Think();
virtual BOOL IsAllowedToSpawn(CBaseEntity *pEntity); virtual BOOL IsAllowedToSpawn(CBaseEntity *pEntity);
@ -437,50 +429,6 @@ public:
// Monsters // Monsters
virtual BOOL FAllowMonsters(); virtual BOOL FAllowMonsters();
#ifdef HOOK_GAMEDLL
void Think_();
BOOL IsAllowedToSpawn_(CBaseEntity *pEntity);
BOOL FShouldSwitchWeapon_(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon);
BOOL GetNextBestWeapon_(CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeapon);
BOOL IsMultiplayer_();
BOOL IsDeathmatch_();
BOOL IsCoOp_();
BOOL ClientConnected_(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[128]);
void InitHUD_(CBasePlayer *pl);
void ClientDisconnected_(edict_t *pClient);
float FlPlayerFallDamage_(CBasePlayer *pPlayer);
void PlayerSpawn_(CBasePlayer *pPlayer);
void PlayerThink_(CBasePlayer *pPlayer);
BOOL FPlayerCanRespawn_(CBasePlayer *pPlayer);
float FlPlayerSpawnTime_(CBasePlayer *pPlayer);
edict_t *GetPlayerSpawnSpot_(CBasePlayer *pPlayer);
BOOL AllowAutoTargetCrosshair_();
int IPointsForKill_(CBasePlayer *pAttacker, CBasePlayer *pKilled);
void PlayerKilled_(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor);
void DeathNotice_(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor);
void PlayerGotWeapon_(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon);
int WeaponShouldRespawn_(CBasePlayerItem *pWeapon);
float FlWeaponRespawnTime_(CBasePlayerItem *pWeapon);
float FlWeaponTryRespawn_(CBasePlayerItem *pWeapon);
Vector VecWeaponRespawnSpot_(CBasePlayerItem *pWeapon);
BOOL CanHaveItem_(CBasePlayer *pPlayer, CItem *pItem);
void PlayerGotItem_(CBasePlayer *pPlayer, CItem *pItem);
int ItemShouldRespawn_(CItem *pItem);
float FlItemRespawnTime_(CItem *pItem);
Vector VecItemRespawnSpot_(CItem *pItem);
void PlayerGotAmmo_(CBasePlayer *pPlayer, char *szName, int iCount);
int AmmoShouldRespawn_(CBasePlayerAmmo *pAmmo);
float FlAmmoRespawnTime_(CBasePlayerAmmo *pAmmo);
Vector VecAmmoRespawnSpot_(CBasePlayerAmmo *pAmmo);
float FlHealthChargerRechargeTime_();
int DeadPlayerWeapons_(CBasePlayer *pPlayer);
int DeadPlayerAmmo_(CBasePlayer *pPlayer);
int PlayerRelationship_(CBasePlayer *pPlayer, CBaseEntity *pTarget);
BOOL FAllowMonsters_();
#endif // HOOK_GAMEDLL
}; };
// CHalfLifeMultiplay - rules for the basic half life multiplayer competition // CHalfLifeMultiplay - rules for the basic half life multiplayer competition
@ -508,7 +456,7 @@ public:
virtual BOOL ClientConnected(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[128]); virtual BOOL ClientConnected(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[128]);
virtual void InitHUD(CBasePlayer *pl); // the client dll is ready for updating virtual void InitHUD(CBasePlayer *pl); // the client dll is ready for updating
virtual void ClientDisconnected(edict_t *pClient); virtual void ClientDisconnected(edict_t *pClient);
virtual void UpdateGameMode(CBasePlayer *pPlayer); // the client needs to be informed of the current game mode virtual void UpdateGameMode(CBasePlayer *pPlayer); // the client needs to be informed of the current game mode
// Client damage rules // Client damage rules
virtual float FlPlayerFallDamage(CBasePlayer *pPlayer); virtual float FlPlayerFallDamage(CBasePlayer *pPlayer);
@ -595,64 +543,29 @@ public:
virtual void ChangeLevel(); virtual void ChangeLevel();
virtual void GoToIntermission(); virtual void GoToIntermission();
#if defined(REGAMEDLL_API) || defined(HOOK_GAMEDLL) #ifdef REGAMEDLL_API
void RefreshSkillData_(); BOOL FShouldSwitchWeapon_OrigFunc(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon);
void Think_(); BOOL GetNextBestWeapon_OrigFunc(CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeapon);
BOOL IsAllowedToSpawn_(CBaseEntity *pEntity); float FlPlayerFallDamage_OrigFunc(CBasePlayer *pPlayer);
BOOL FAllowFlashlight_(); BOOL FPlayerCanTakeDamage_OrigFunc(CBasePlayer *pPlayer, CBaseEntity *pAttacker);
BOOL FShouldSwitchWeapon_(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon); void PlayerSpawn_OrigFunc(CBasePlayer *pPlayer);
BOOL GetNextBestWeapon_(CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeapon); BOOL FPlayerCanRespawn_OrigFunc(CBasePlayer *pPlayer);
BOOL IsMultiplayer_(); edict_t *GetPlayerSpawnSpot_OrigFunc(CBasePlayer *pPlayer);
BOOL IsDeathmatch_(); void ClientUserInfoChanged_OrigFunc(CBasePlayer *pPlayer, char *infobuffer);
BOOL IsCoOp_(); void PlayerKilled_OrigFunc(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor);
BOOL ClientConnected_(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[128]); void DeathNotice_OrigFunc(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor);
void InitHUD_(CBasePlayer *pl); BOOL CanHavePlayerItem_OrigFunc(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon);
void ClientDisconnected_(edict_t *pClient); int DeadPlayerWeapons_OrigFunc(CBasePlayer *pPlayer);
void UpdateGameMode_(CBasePlayer *pPlayer); void ServerDeactivate_OrigFunc();
float FlPlayerFallDamage_(CBasePlayer *pPlayer); void CheckMapConditions_OrigFunc();
BOOL FPlayerCanTakeDamage_(CBasePlayer *pPlayer, CBaseEntity *pAttacker); void CleanUpMap_OrigFunc();
void PlayerSpawn_(CBasePlayer *pPlayer); void RestartRound_OrigFunc();
void PlayerThink_(CBasePlayer *pPlayer); void CheckWinConditions_OrigFunc();
BOOL FPlayerCanRespawn_(CBasePlayer *pPlayer); void RemoveGuns_OrigFunc();
float FlPlayerSpawnTime_(CBasePlayer *pPlayer); void GiveC4_OrigFunc();
edict_t *GetPlayerSpawnSpot_(CBasePlayer *pPlayer); void ChangeLevel_OrigFunc();
BOOL AllowAutoTargetCrosshair_(); void GoToIntermission_OrigFunc();
BOOL ClientCommand_DeadOrAlive_(CBasePlayer *pPlayer, const char *pcmd); void BalanceTeams_OrigFunc();
BOOL ClientCommand_(CBasePlayer *pPlayer, const char *pcmd);
void ClientUserInfoChanged_(CBasePlayer *pPlayer, char *infobuffer);
int IPointsForKill_(CBasePlayer *pAttacker, CBasePlayer *pKilled);
void PlayerKilled_(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor);
void DeathNotice_(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor);
BOOL CanHavePlayerItem_(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon);
void PlayerGotWeapon_(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon);
int WeaponShouldRespawn_(CBasePlayerItem *pWeapon);
float FlWeaponRespawnTime_(CBasePlayerItem *pWeapon);
float FlWeaponTryRespawn_(CBasePlayerItem *pWeapon);
Vector VecWeaponRespawnSpot_(CBasePlayerItem *pWeapon);
BOOL CanHaveItem_(CBasePlayer *pPlayer, CItem *pItem);
void PlayerGotItem_(CBasePlayer *pPlayer, CItem *pItem);
int ItemShouldRespawn_(CItem *pItem);
float FlItemRespawnTime_(CItem *pItem);
Vector VecItemRespawnSpot_(CItem *pItem);
void PlayerGotAmmo_(CBasePlayer *pPlayer, char *szName, int iCount);
int AmmoShouldRespawn_(CBasePlayerAmmo *pAmmo);
float FlAmmoRespawnTime_(CBasePlayerAmmo *pAmmo);
Vector VecAmmoRespawnSpot_(CBasePlayerAmmo *pAmmo);
float FlHealthChargerRechargeTime_();
float FlHEVChargerRechargeTime_();
int DeadPlayerWeapons_(CBasePlayer *pPlayer);
int DeadPlayerAmmo_(CBasePlayer *pPlayer);
int PlayerRelationship_(CBasePlayer *pPlayer, CBaseEntity *pTarget);
BOOL FAllowMonsters_();
void ServerDeactivate_();
void CheckMapConditions_();
void CleanUpMap_();
void RestartRound_();
void CheckWinConditions_();
void RemoveGuns_();
void GiveC4_();
void ChangeLevel_();
void GoToIntermission_();
#endif #endif
public: public:
@ -742,8 +655,6 @@ public:
void ResetCurrentVIP(); void ResetCurrentVIP();
VFUNC void BalanceTeams(); VFUNC void BalanceTeams();
void BalanceTeams_();
VFUNC void SwapAllPlayers(); VFUNC void SwapAllPlayers();
VFUNC void UpdateTeamScores(); VFUNC void UpdateTeamScores();
VFUNC void EndRoundMessage(const char *sentence, int event); VFUNC void EndRoundMessage(const char *sentence, int event);
@ -782,18 +693,18 @@ public:
float m_flRestartRoundTime; // The global time when the round is supposed to end, if this is not 0 (deprecated name m_fTeamCount) float m_flRestartRoundTime; // The global time when the round is supposed to end, if this is not 0 (deprecated name m_fTeamCount)
float m_flCheckWinConditions; float m_flCheckWinConditions;
float m_fRoundStartTime; // Time round has started (deprecated name m_fRoundCount) float m_fRoundStartTime; // Time round has started (deprecated name m_fRoundCount)
int m_iRoundTime; // (From mp_roundtime) - How many seconds long this round is. int m_iRoundTime; // (From mp_roundtime) - How many seconds long this round is.
int m_iRoundTimeSecs; int m_iRoundTimeSecs;
int m_iIntroRoundTime; // (From mp_freezetime) - How many seconds long the intro round (when players are frozen) is. int m_iIntroRoundTime; // (From mp_freezetime) - How many seconds long the intro round (when players are frozen) is.
float m_fRoundStartTimeReal; // The global time when the intro round ends and the real one starts float m_fRoundStartTimeReal; // The global time when the intro round ends and the real one starts
// wrote the original "m_flRoundTime" comment for this variable). // wrote the original "m_flRoundTime" comment for this variable).
int m_iAccountTerrorist; int m_iAccountTerrorist;
int m_iAccountCT; int m_iAccountCT;
int m_iNumTerrorist; // The number of terrorists on the team (this is generated at the end of a round) int m_iNumTerrorist; // The number of terrorists on the team (this is generated at the end of a round)
int m_iNumCT; // The number of CTs on the team (this is generated at the end of a round) int m_iNumCT; // The number of CTs on the team (this is generated at the end of a round)
int m_iNumSpawnableTerrorist; int m_iNumSpawnableTerrorist;
int m_iNumSpawnableCT; int m_iNumSpawnableCT;
int m_iSpawnPointCount_Terrorist; // Number of Terrorist spawn points int m_iSpawnPointCount_Terrorist; // Number of Terrorist spawn points
int m_iSpawnPointCount_CT; // Number of CT spawn points int m_iSpawnPointCount_CT; // Number of CT spawn points
int m_iHostagesRescued; int m_iHostagesRescued;
int m_iHostagesTouched; int m_iHostagesTouched;
@ -814,22 +725,22 @@ public:
BOOL m_bMapHasVIPSafetyZone; // TRUE = has VIP safety zone, FALSE = does not have VIP safetyzone BOOL m_bMapHasVIPSafetyZone; // TRUE = has VIP safety zone, FALSE = does not have VIP safetyzone
BOOL m_bMapHasCameras; BOOL m_bMapHasCameras;
int m_iC4Timer; int m_iC4Timer;
int m_iC4Guy; // The current Terrorist who has the C4. int m_iC4Guy; // The current Terrorist who has the C4.
int m_iLoserBonus; // the amount of money the losing team gets. This scales up as they lose more rounds in a row int m_iLoserBonus; // the amount of money the losing team gets. This scales up as they lose more rounds in a row
int m_iNumConsecutiveCTLoses; // the number of rounds the CTs have lost in a row. int m_iNumConsecutiveCTLoses; // the number of rounds the CTs have lost in a row.
int m_iNumConsecutiveTerroristLoses; // the number of rounds the Terrorists have lost in a row. int m_iNumConsecutiveTerroristLoses; // the number of rounds the Terrorists have lost in a row.
float m_fMaxIdlePeriod; // For the idle kick functionality. This is tha max amount of time that the player has to be idle before being kicked float m_fMaxIdlePeriod; // For the idle kick functionality. This is tha max amount of time that the player has to be idle before being kicked
int m_iLimitTeams; int m_iLimitTeams;
bool m_bLevelInitialized; bool m_bLevelInitialized;
bool m_bRoundTerminating; bool m_bRoundTerminating;
bool m_bCompleteReset; // Set to TRUE to have the scores reset next time round restarts bool m_bCompleteReset; // Set to TRUE to have the scores reset next time round restarts
float m_flRequiredEscapeRatio; float m_flRequiredEscapeRatio;
int m_iNumEscapers; int m_iNumEscapers;
int m_iHaveEscaped; int m_iHaveEscaped;
bool m_bCTCantBuy; bool m_bCTCantBuy;
bool m_bTCantBuy; // Who can and can't buy. bool m_bTCantBuy; // Who can and can't buy.
float m_flBombRadius; float m_flBombRadius;
int m_iConsecutiveVIP; int m_iConsecutiveVIP;
int m_iTotalGunCount; int m_iTotalGunCount;
@ -864,11 +775,11 @@ protected:
bool m_bSkipSpawn; bool m_bSkipSpawn;
// custom // custom
bool m_bSkipShowMenu; CUSTOM_MEMBER bool m_bSkipShowMenu;
bool m_bNeededPlayers; CUSTOM_MEMBER bool m_bNeededPlayers;
float m_flEscapeRatio; CUSTOM_MEMBER float m_flEscapeRatio;
float m_flTimeLimit; CUSTOM_MEMBER float m_flTimeLimit;
float m_flGameStartTime; CUSTOM_MEMBER float m_flGameStartTime;
}; };
typedef struct mapcycle_item_s typedef struct mapcycle_item_s
@ -892,19 +803,15 @@ class CCStrikeGameMgrHelper: public IVoiceGameMgrHelper
{ {
public: public:
virtual bool CanPlayerHearPlayer(CBasePlayer *pListener, CBasePlayer *pSender); virtual bool CanPlayerHearPlayer(CBasePlayer *pListener, CBasePlayer *pSender);
#ifdef HOOK_GAMEDLL
bool CanPlayerHearPlayer_(CBasePlayer *pListener, CBasePlayer *pSender);
#endif
}; };
extern CGameRules DLLEXPORT *g_pGameRules; extern CGameRules DLLEXPORT *g_pGameRules;
#ifdef REGAMEDLL_API
CGameRules *InstallGameRules_OrigFunc();
#endif
CGameRules *InstallGameRules(); CGameRules *InstallGameRules();
CGameRules *InstallGameRules_();
// Gets us at the CS game rules // Gets us at the CS game rules
inline CHalfLifeMultiplay *CSGameRules() inline CHalfLifeMultiplay *CSGameRules()

View File

@ -511,7 +511,7 @@ void CGrenade::SG_Smoke()
} }
} }
void CGrenade::__MAKE_VHOOK(Killed)(entvars_t *pevAttacker, int iGib) void CGrenade::Killed(entvars_t *pevAttacker, int iGib)
{ {
Detonate(); Detonate();
} }
@ -730,7 +730,7 @@ void CGrenade::SlideTouch(CBaseEntity *pOther)
} }
} }
void CGrenade::__MAKE_VHOOK(BounceSound)() void CGrenade::BounceSound()
{ {
if (pev->dmg > 50.0f) if (pev->dmg > 50.0f)
{ {
@ -819,7 +819,7 @@ void CGrenade::SG_TumbleThink()
} }
} }
void CGrenade::__MAKE_VHOOK(Spawn)() void CGrenade::Spawn()
{ {
m_iBounceCount = 0; m_iBounceCount = 0;
pev->movetype = MOVETYPE_BOUNCE; pev->movetype = MOVETYPE_BOUNCE;
@ -939,7 +939,7 @@ CGrenade *CGrenade::ShootTimed(entvars_t *pevOwner, Vector vecStart, Vector vecV
return pGrenade; return pGrenade;
} }
void CGrenade::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CGrenade::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
if (!m_bIsC4) if (!m_bIsC4)
return; return;

View File

@ -19,7 +19,7 @@ TYPEDESCRIPTION CRecharge::m_SaveData[] =
IMPLEMENT_SAVERESTORE(CRecharge, CBaseEntity) IMPLEMENT_SAVERESTORE(CRecharge, CBaseEntity)
LINK_ENTITY_TO_CLASS(func_recharge, CRecharge, CCSRecharge) LINK_ENTITY_TO_CLASS(func_recharge, CRecharge, CCSRecharge)
void CRecharge::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CRecharge::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "style") if (FStrEq(pkvd->szKeyName, "style")
|| FStrEq(pkvd->szKeyName, "height") || FStrEq(pkvd->szKeyName, "height")
@ -38,7 +38,7 @@ void CRecharge::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CBaseToggle::KeyValue(pkvd); CBaseToggle::KeyValue(pkvd);
} }
void CRecharge::__MAKE_VHOOK(Spawn)() void CRecharge::Spawn()
{ {
Precache(); Precache();
@ -54,14 +54,14 @@ void CRecharge::__MAKE_VHOOK(Spawn)()
pev->frame = 0; pev->frame = 0;
} }
void CRecharge::__MAKE_VHOOK(Precache)() void CRecharge::Precache()
{ {
PRECACHE_SOUND("items/suitcharge1.wav"); PRECACHE_SOUND("items/suitcharge1.wav");
PRECACHE_SOUND("items/suitchargeno1.wav"); PRECACHE_SOUND("items/suitchargeno1.wav");
PRECACHE_SOUND("items/suitchargeok1.wav"); PRECACHE_SOUND("items/suitchargeok1.wav");
} }
void CRecharge::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CRecharge::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
// if it's not a player, ignore // if it's not a player, ignore
if (!FClassnameIs(pActivator->pev, "player")) if (!FClassnameIs(pActivator->pev, "player"))

View File

@ -43,17 +43,6 @@ public:
virtual int ObjectCaps() { return ((CBaseToggle::ObjectCaps() | FCAP_CONTINUOUS_USE) & ~FCAP_ACROSS_TRANSITION); } virtual int ObjectCaps() { return ((CBaseToggle::ObjectCaps() | FCAP_CONTINUOUS_USE) & ~FCAP_ACROSS_TRANSITION); }
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
void EXPORT Off(); void EXPORT Off();
void EXPORT Recharge(); void EXPORT Recharge();

View File

@ -26,7 +26,7 @@ TYPEDESCRIPTION CWreckage::m_SaveData[] =
IMPLEMENT_SAVERESTORE(CCycler, CBaseToggle) IMPLEMENT_SAVERESTORE(CCycler, CBaseToggle)
void CGenericCycler::__MAKE_VHOOK(Spawn)() void CGenericCycler::Spawn()
{ {
GenericCyclerSpawn((char *)STRING(pev->model), Vector(-16, -16, 0), Vector(16, 16, 72)); GenericCyclerSpawn((char *)STRING(pev->model), Vector(-16, -16, 0), Vector(16, 16, 72));
} }
@ -34,7 +34,7 @@ void CGenericCycler::__MAKE_VHOOK(Spawn)()
LINK_ENTITY_TO_CLASS(cycler, CGenericCycler, CCSGenericCycler) LINK_ENTITY_TO_CLASS(cycler, CGenericCycler, CCSGenericCycler)
LINK_ENTITY_TO_CLASS(cycler_prdroid, CCyclerProbe, CCSCyclerProbe) LINK_ENTITY_TO_CLASS(cycler_prdroid, CCyclerProbe, CCSCyclerProbe)
void CCyclerProbe::__MAKE_VHOOK(Spawn)() void CCyclerProbe::Spawn()
{ {
pev->origin = pev->origin + Vector(0, 0, 16); pev->origin = pev->origin + Vector(0, 0, 16);
GenericCyclerSpawn("models/prdroid.mdl", Vector(-16, -16, -16), Vector(16, 16, 16)); GenericCyclerSpawn("models/prdroid.mdl", Vector(-16, -16, -16), Vector(16, 16, 16));
@ -60,7 +60,7 @@ void CCycler::GenericCyclerSpawn(char *szModel, Vector vecMin, Vector vecMax)
UTIL_SetSize(pev, vecMin, vecMax); UTIL_SetSize(pev, vecMin, vecMax);
} }
void CCycler::__MAKE_VHOOK(Spawn)() void CCycler::Spawn()
{ {
InitBoneControllers(); InitBoneControllers();
@ -95,7 +95,7 @@ void CCycler::__MAKE_VHOOK(Spawn)()
} }
// cycler think // cycler think
void CCycler::__MAKE_VHOOK(Think)() void CCycler::Think()
{ {
pev->nextthink = gpGlobals->time + 0.1f; pev->nextthink = gpGlobals->time + 0.1f;
@ -123,7 +123,7 @@ void CCycler::__MAKE_VHOOK(Think)()
} }
// CyclerUse - starts a rotation trend // CyclerUse - starts a rotation trend
void CCycler::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CCycler::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
m_animate = !m_animate; m_animate = !m_animate;
@ -134,7 +134,7 @@ void CCycler::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, U
} }
// CyclerPain , changes sequences when shot // CyclerPain , changes sequences when shot
BOOL CCycler::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) BOOL CCycler::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{ {
if (m_animate) if (m_animate)
{ {
@ -164,7 +164,7 @@ BOOL CCycler::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAt
LINK_ENTITY_TO_CLASS(cycler_sprite, CCyclerSprite, CCSCyclerSprite) LINK_ENTITY_TO_CLASS(cycler_sprite, CCyclerSprite, CCSCyclerSprite)
IMPLEMENT_SAVERESTORE(CCyclerSprite, CBaseEntity) IMPLEMENT_SAVERESTORE(CCyclerSprite, CBaseEntity)
void CCyclerSprite::__MAKE_VHOOK(Spawn)() void CCyclerSprite::Spawn()
{ {
pev->solid = SOLID_SLIDEBOX; pev->solid = SOLID_SLIDEBOX;
pev->movetype = MOVETYPE_NONE; pev->movetype = MOVETYPE_NONE;
@ -187,7 +187,7 @@ void CCyclerSprite::__MAKE_VHOOK(Spawn)()
m_rendercolor = pev->rendercolor; m_rendercolor = pev->rendercolor;
} }
void CCyclerSprite::__MAKE_VHOOK(Restart)() void CCyclerSprite::Restart()
{ {
pev->solid = SOLID_SLIDEBOX; pev->solid = SOLID_SLIDEBOX;
pev->movetype = MOVETYPE_NONE; pev->movetype = MOVETYPE_NONE;
@ -205,7 +205,7 @@ void CCyclerSprite::__MAKE_VHOOK(Restart)()
pev->rendercolor = m_rendercolor; pev->rendercolor = m_rendercolor;
} }
void CCyclerSprite::__MAKE_VHOOK(Think)() void CCyclerSprite::Think()
{ {
if (ShouldAnimate()) if (ShouldAnimate())
{ {
@ -216,13 +216,13 @@ void CCyclerSprite::__MAKE_VHOOK(Think)()
m_lastTime = gpGlobals->time; m_lastTime = gpGlobals->time;
} }
void CCyclerSprite::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CCyclerSprite::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
m_animate = !m_animate; m_animate = !m_animate;
ALERT(at_console, "Sprite: %s\n", STRING(pev->model)); ALERT(at_console, "Sprite: %s\n", STRING(pev->model));
} }
BOOL CCyclerSprite::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) BOOL CCyclerSprite::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{ {
if (m_maxFrame > 1.0) if (m_maxFrame > 1.0)
{ {
@ -244,7 +244,7 @@ void CCyclerSprite::Animate(float frames)
LINK_ENTITY_TO_CLASS(cycler_weapon, CWeaponCycler, CCSWeaponCycler) LINK_ENTITY_TO_CLASS(cycler_weapon, CWeaponCycler, CCSWeaponCycler)
void CWeaponCycler::__MAKE_VHOOK(Spawn)() void CWeaponCycler::Spawn()
{ {
pev->solid = SOLID_SLIDEBOX; pev->solid = SOLID_SLIDEBOX;
pev->movetype = MOVETYPE_NONE; pev->movetype = MOVETYPE_NONE;
@ -260,7 +260,7 @@ void CWeaponCycler::__MAKE_VHOOK(Spawn)()
SetTouch(&CWeaponCycler::DefaultTouch); SetTouch(&CWeaponCycler::DefaultTouch);
} }
BOOL CWeaponCycler::__MAKE_VHOOK(Deploy)() BOOL CWeaponCycler::Deploy()
{ {
m_pPlayer->pev->viewmodel = m_iszModel; m_pPlayer->pev->viewmodel = m_iszModel;
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0f; m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0f;
@ -271,18 +271,18 @@ BOOL CWeaponCycler::__MAKE_VHOOK(Deploy)()
return TRUE; return TRUE;
} }
void CWeaponCycler::__MAKE_VHOOK(Holster)(int skiplocal) void CWeaponCycler::Holster(int skiplocal)
{ {
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f; m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5f;
} }
void CWeaponCycler::__MAKE_VHOOK(PrimaryAttack)() void CWeaponCycler::PrimaryAttack()
{ {
SendWeaponAnim(pev->sequence); SendWeaponAnim(pev->sequence);
m_flNextPrimaryAttack = gpGlobals->time + 0.3f; m_flNextPrimaryAttack = gpGlobals->time + 0.3f;
} }
void CWeaponCycler::__MAKE_VHOOK(SecondaryAttack)() void CWeaponCycler::SecondaryAttack()
{ {
float flFrameRate, flGroundSpeed; float flFrameRate, flGroundSpeed;
@ -305,7 +305,7 @@ void CWeaponCycler::__MAKE_VHOOK(SecondaryAttack)()
IMPLEMENT_SAVERESTORE(CWreckage, CBaseToggle) IMPLEMENT_SAVERESTORE(CWreckage, CBaseToggle)
LINK_ENTITY_TO_CLASS(cycler_wreckage, CWreckage, CCSWreckage) LINK_ENTITY_TO_CLASS(cycler_wreckage, CWreckage, CCSWreckage)
void CWreckage::__MAKE_VHOOK(Spawn)() void CWreckage::Spawn()
{ {
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
pev->movetype = MOVETYPE_NONE; pev->movetype = MOVETYPE_NONE;
@ -325,7 +325,7 @@ void CWreckage::__MAKE_VHOOK(Spawn)()
m_flStartTime = int(gpGlobals->time); m_flStartTime = int(gpGlobals->time);
} }
void CWreckage::__MAKE_VHOOK(Precache)() void CWreckage::Precache()
{ {
if (!FStringNull(pev->model)) if (!FStringNull(pev->model))
{ {
@ -333,7 +333,7 @@ void CWreckage::__MAKE_VHOOK(Precache)()
} }
} }
void CWreckage::__MAKE_VHOOK(Think)() void CWreckage::Think()
{ {
StudioFrameAdvance(); StudioFrameAdvance();
pev->nextthink = gpGlobals->time + 0.2f; pev->nextthink = gpGlobals->time + 0.2f;

View File

@ -46,17 +46,6 @@ public:
virtual void Think(); virtual void Think();
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
int Save_(CSave &save);
int Restore_(CRestore &restore);
BOOL TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
void Think_();
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
void GenericCyclerSpawn(char *szModel, Vector vecMin, Vector vecMax); void GenericCyclerSpawn(char *szModel, Vector vecMin, Vector vecMax);
@ -71,13 +60,6 @@ class CGenericCycler: public CCycler
{ {
public: public:
virtual void Spawn(); virtual void Spawn();
#ifdef HOOK_GAMEDLL
void Spawn_();
#endif
}; };
// Probe droid imported for tech demo compatibility // Probe droid imported for tech demo compatibility
@ -85,13 +67,6 @@ class CCyclerProbe: public CCycler
{ {
public: public:
virtual void Spawn(); virtual void Spawn();
#ifdef HOOK_GAMEDLL
void Spawn_();
#endif
}; };
class CCyclerSprite: public CBaseEntity class CCyclerSprite: public CBaseEntity
@ -106,18 +81,6 @@ public:
virtual void Think(); virtual void Think();
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Restart_();
int Save_(CSave &save);
int Restore_(CRestore &restore);
BOOL TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
void Think_();
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
void Animate(float frames); void Animate(float frames);
inline int ShouldAnimate() { return (m_animate && m_maxFrame > 1.0f); } inline int ShouldAnimate() { return (m_animate && m_maxFrame > 1.0f); }
@ -145,16 +108,6 @@ public:
virtual void PrimaryAttack(); virtual void PrimaryAttack();
virtual void SecondaryAttack(); virtual void SecondaryAttack();
#ifdef HOOK_GAMEDLL
void Spawn_();
BOOL Deploy_();
void Holster_(int skiplocal = 0);
void PrimaryAttack_();
void SecondaryAttack_();
#endif
public: public:
int m_iszModel; int m_iszModel;
int m_iModel; int m_iModel;
@ -170,16 +123,6 @@ public:
virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
virtual void Think(); virtual void Think();
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Think_();
#endif
public: public:
static TYPEDESCRIPTION IMPL(m_SaveData)[1]; static TYPEDESCRIPTION IMPL(m_SaveData)[1];

View File

@ -18,7 +18,7 @@ TYPEDESCRIPTION CWallHealth::m_SaveData[] =
LINK_ENTITY_TO_CLASS(item_healthkit, CHealthKit, CCSHealthKit) LINK_ENTITY_TO_CLASS(item_healthkit, CHealthKit, CCSHealthKit)
void CHealthKit::__MAKE_VHOOK(Spawn)() void CHealthKit::Spawn()
{ {
Precache(); Precache();
SET_MODEL(ENT(pev), "models/w_medkit.mdl"); SET_MODEL(ENT(pev), "models/w_medkit.mdl");
@ -26,13 +26,13 @@ void CHealthKit::__MAKE_VHOOK(Spawn)()
CItem::Spawn(); CItem::Spawn();
} }
void CHealthKit::__MAKE_VHOOK(Precache)() void CHealthKit::Precache()
{ {
PRECACHE_MODEL("models/w_medkit.mdl"); PRECACHE_MODEL("models/w_medkit.mdl");
PRECACHE_SOUND("items/smallmedkit1.wav"); PRECACHE_SOUND("items/smallmedkit1.wav");
} }
BOOL CHealthKit::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer) BOOL CHealthKit::MyTouch(CBasePlayer *pPlayer)
{ {
#ifdef REGAMEDLL_ADD #ifdef REGAMEDLL_ADD
if (pPlayer->HasRestrictItem(ITEM_HEALTHKIT, ITEM_TYPE_TOUCHED)) if (pPlayer->HasRestrictItem(ITEM_HEALTHKIT, ITEM_TYPE_TOUCHED))
@ -61,7 +61,7 @@ BOOL CHealthKit::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer)
IMPLEMENT_SAVERESTORE(CWallHealth, CBaseEntity) IMPLEMENT_SAVERESTORE(CWallHealth, CBaseEntity)
LINK_ENTITY_TO_CLASS(func_healthcharger, CWallHealth, CCSWallHealth) LINK_ENTITY_TO_CLASS(func_healthcharger, CWallHealth, CCSWallHealth)
void CWallHealth::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CWallHealth::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "style") || FStrEq(pkvd->szKeyName, "height") || FStrEq(pkvd->szKeyName, "value1") || FStrEq(pkvd->szKeyName, "value2") || FStrEq(pkvd->szKeyName, "value3")) if (FStrEq(pkvd->szKeyName, "style") || FStrEq(pkvd->szKeyName, "height") || FStrEq(pkvd->szKeyName, "value1") || FStrEq(pkvd->szKeyName, "value2") || FStrEq(pkvd->szKeyName, "value3"))
{ {
@ -76,7 +76,7 @@ void CWallHealth::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CBaseToggle::KeyValue(pkvd); CBaseToggle::KeyValue(pkvd);
} }
void CWallHealth::__MAKE_VHOOK(Spawn)() void CWallHealth::Spawn()
{ {
Precache(); Precache();
@ -93,14 +93,14 @@ void CWallHealth::__MAKE_VHOOK(Spawn)()
pev->frame = 0.0f; pev->frame = 0.0f;
} }
void CWallHealth::__MAKE_VHOOK(Precache)() void CWallHealth::Precache()
{ {
PRECACHE_SOUND("items/medshot4.wav"); PRECACHE_SOUND("items/medshot4.wav");
PRECACHE_SOUND("items/medshotno1.wav"); PRECACHE_SOUND("items/medshotno1.wav");
PRECACHE_SOUND("items/medcharge4.wav"); PRECACHE_SOUND("items/medcharge4.wav");
} }
void CWallHealth::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CWallHealth::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
// Make sure that we have a caller // Make sure that we have a caller
if (!pActivator) if (!pActivator)

View File

@ -38,15 +38,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Precache(); virtual void Precache();
virtual BOOL MyTouch(CBasePlayer *pPlayer); virtual BOOL MyTouch(CBasePlayer *pPlayer);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
BOOL MyTouch_(CBasePlayer *pPlayer);
#endif
}; };
class CWallHealth: public CBaseToggle class CWallHealth: public CBaseToggle
@ -60,17 +51,6 @@ public:
virtual int ObjectCaps() { return (CBaseToggle::ObjectCaps() | FCAP_CONTINUOUS_USE) & ~FCAP_ACROSS_TRANSITION; } virtual int ObjectCaps() { return (CBaseToggle::ObjectCaps() | FCAP_CONTINUOUS_USE) & ~FCAP_ACROSS_TRANSITION; }
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
void EXPORT Off(); void EXPORT Off();
void EXPORT Recharge(); void EXPORT Recharge();

View File

@ -173,10 +173,9 @@ struct
LINK_ENTITY_TO_CLASS(hostage_entity, CHostage, CCSHostage) LINK_ENTITY_TO_CLASS(hostage_entity, CHostage, CCSHostage)
LINK_ENTITY_TO_CLASS(monster_scientist, CHostage, CCSHostage) LINK_ENTITY_TO_CLASS(monster_scientist, CHostage, CCSHostage)
void CHostage::__MAKE_VHOOK(Spawn)() void CHostage::Spawn()
{ {
if (!g_pHostages) if (!g_pHostages) {
{
g_pHostages = new CHostageManager; g_pHostages = new CHostageManager;
} }
@ -223,13 +222,7 @@ void CHostage::__MAKE_VHOOK(Spawn)()
DROP_TO_FLOOR(edict()); DROP_TO_FLOOR(edict());
#ifndef HOOK_GAMEDLL
SetThink(&CHostage::IdleThink); SetThink(&CHostage::IdleThink);
#else
// TODO: fix test demo
SetThink(pCHostage__IdleThink);
#endif
pev->nextthink = gpGlobals->time + RANDOM_FLOAT(0.1, 0.2); pev->nextthink = gpGlobals->time + RANDOM_FLOAT(0.1, 0.2);
m_flNextFullThink = gpGlobals->time + RANDOM_FLOAT(0.1, 0.2); m_flNextFullThink = gpGlobals->time + RANDOM_FLOAT(0.1, 0.2);
@ -252,7 +245,7 @@ void CHostage::__MAKE_VHOOK(Spawn)()
m_improv = NULL; m_improv = NULL;
} }
void CHostage::__MAKE_VHOOK(Precache)() void CHostage::Precache()
{ {
static int which = 0; static int which = 0;
@ -551,12 +544,7 @@ void CHostage::RePosition()
DROP_TO_FLOOR(edict()); DROP_TO_FLOOR(edict());
SetActivity(ACT_IDLE); SetActivity(ACT_IDLE);
#ifndef HOOK_GAMEDLL
SetThink(&CHostage::IdleThink); SetThink(&CHostage::IdleThink);
#else
// TODO: fix test demo
SetThink(pCHostage__IdleThink);
#endif
pev->nextthink = gpGlobals->time + RANDOM_FLOAT(0.1, 0.2); pev->nextthink = gpGlobals->time + RANDOM_FLOAT(0.1, 0.2);
m_fHasPath = FALSE; m_fHasPath = FALSE;
@ -578,7 +566,7 @@ void CHostage::TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir
} }
} }
BOOL CHostage::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) BOOL CHostage::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{ {
#ifdef REGAMEDLL_ADD #ifdef REGAMEDLL_ADD
if (hostagehurtable.value <= 0) if (hostagehurtable.value <= 0)
@ -830,7 +818,7 @@ void CHostage::ApplyHostagePenalty(CBasePlayer *pAttacker)
} }
} }
void CHostage::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CHostage::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
if (!pActivator->IsPlayer()) if (!pActivator->IsPlayer())
return; return;
@ -936,12 +924,12 @@ void CHostage::GiveCTTouchBonus(CBasePlayer *pPlayer)
UTIL_LogPrintf("\"%s<%i><%s><CT>\" triggered \"Touched_A_Hostage\"\n", STRING(pPlayer->pev->netname), GETPLAYERUSERID(pPlayer->edict()), GETPLAYERAUTHID(pPlayer->edict())); UTIL_LogPrintf("\"%s<%i><%s><CT>\" triggered \"Touched_A_Hostage\"\n", STRING(pPlayer->pev->netname), GETPLAYERUSERID(pPlayer->edict()), GETPLAYERAUTHID(pPlayer->edict()));
} }
int CHostage::__MAKE_VHOOK(ObjectCaps)() int CHostage::ObjectCaps()
{ {
return (CBaseMonster::ObjectCaps() | FCAP_MUST_SPAWN | FCAP_ONOFF_USE); return (CBaseMonster::ObjectCaps() | FCAP_MUST_SPAWN | FCAP_ONOFF_USE);
} }
void CHostage::__MAKE_VHOOK(Touch)(CBaseEntity *pOther) void CHostage::Touch(CBaseEntity *pOther)
{ {
Vector2D vPush; Vector2D vPush;
const float pushForce = 50.0f; const float pushForce = 50.0f;

View File

@ -32,19 +32,19 @@
#pragma once #pragma once
#endif #endif
#define MAX_NODES 100 #define MAX_NODES 100
#define MAX_HOSTAGES 12 #define MAX_HOSTAGES 12
#define MAX_HOSTAGES_NAV 20 #define MAX_HOSTAGES_NAV 20
#define HOSTAGE_STEPSIZE 26.0f #define HOSTAGE_STEPSIZE 26.0f
#define HOSTAGE_STEPSIZE_DEFAULT 18.0f #define HOSTAGE_STEPSIZE_DEFAULT 18.0f
#define VEC_HOSTAGE_VIEW Vector(0, 0, 12) #define VEC_HOSTAGE_VIEW Vector(0, 0, 12)
#define VEC_HOSTAGE_HULL_MIN Vector(-10, -10, 0) #define VEC_HOSTAGE_HULL_MIN Vector(-10, -10, 0)
#define VEC_HOSTAGE_HULL_MAX Vector(10, 10, 62) #define VEC_HOSTAGE_HULL_MAX Vector(10, 10, 62)
#define VEC_HOSTAGE_CROUCH Vector(10, 10, 30) #define VEC_HOSTAGE_CROUCH Vector(10, 10, 30)
#define RESCUE_HOSTAGES_RADIUS 256.0f // rescue zones from legacy info_* #define RESCUE_HOSTAGES_RADIUS 256.0f // rescue zones from legacy info_*
class CHostage; class CHostage;
class CLocalNav; class CLocalNav;
@ -105,17 +105,6 @@ public:
virtual void Touch(CBaseEntity *pOther); virtual void Touch(CBaseEntity *pOther);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
int ObjectCaps_();
BOOL TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
void Touch_(CBaseEntity *pOther);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
void EXPORT IdleThink(); void EXPORT IdleThink();
void EXPORT Remove(); void EXPORT Remove();
@ -144,21 +133,19 @@ public:
bool IsFollowingSomeone() { return IsFollowing(); } bool IsFollowingSomeone() { return IsFollowing(); }
CBaseEntity *GetLeader() // return our leader, or NULL CBaseEntity *GetLeader() // return our leader, or NULL
{ {
if (m_improv != NULL) if (m_improv) {
{
return m_improv->GetFollowLeader(); return m_improv->GetFollowLeader();
} }
return m_hTargetEnt; return m_hTargetEnt;
} }
bool IsFollowing(const CBaseEntity *entity = NULL) bool IsFollowing(const CBaseEntity *entity = nullptr)
{ {
if (m_improv != NULL) if (m_improv) {
{
return m_improv->IsFollowing(); return m_improv->IsFollowing();
} }
if ((!entity && !m_hTargetEnt) || (entity != NULL && m_hTargetEnt != entity)) if ((!entity && !m_hTargetEnt) || (entity && m_hTargetEnt != entity))
return false; return false;
if (m_State != FOLLOW) if (m_State != FOLLOW)
@ -265,7 +252,7 @@ public:
{ {
CHostage *hostage = m_hostage[i]; CHostage *hostage = m_hostage[i];
if (hostage == NULL || hostage->pev->deadflag == DEAD_DEAD) if (!hostage || hostage->pev->deadflag == DEAD_DEAD)
continue; continue;
if (func(hostage) == false) if (func(hostage) == false)
@ -274,11 +261,11 @@ public:
return true; return true;
} }
inline CHostage *GetClosestHostage(const Vector &pos, float *resultRange = NULL) inline CHostage *GetClosestHostage(const Vector &pos, float *resultRange = nullptr)
{ {
float range; float range;
float closeRange = 1e8f; float closeRange = 1e8f;
CHostage *close = NULL; CHostage *close = nullptr;
for (int i = 0; i < m_hostageCount; i++) for (int i = 0; i < m_hostageCount; i++)
{ {

View File

@ -19,12 +19,12 @@ CHostageImprov::CHostageImprov(CBaseEntity *entity)
OnReset(); OnReset();
} }
bool CHostageImprov::__MAKE_VHOOK(IsAlive)() const bool CHostageImprov::IsAlive() const
{ {
return m_hostage->pev->deadflag != DEAD_DEAD; return m_hostage->pev->deadflag != DEAD_DEAD;
} }
void CHostageImprov::__MAKE_VHOOK(MoveTo)(const Vector &goal) void CHostageImprov::MoveTo(const Vector &goal)
{ {
m_moveGoal = goal; m_moveGoal = goal;
m_path.Invalidate(); m_path.Invalidate();
@ -37,7 +37,7 @@ void CHostageImprov::__MAKE_VHOOK(MoveTo)(const Vector &goal)
} }
// Find "simple" ground height, treating current nav area as part of the floor // Find "simple" ground height, treating current nav area as part of the floor
bool CHostageImprov::__MAKE_VHOOK(GetSimpleGroundHeightWithFloor)(const Vector *pos, float *height, Vector *normal) bool CHostageImprov::GetSimpleGroundHeightWithFloor(const Vector *pos, float *height, Vector *normal)
{ {
if (GetSimpleGroundHeight(pos, height, normal)) if (GetSimpleGroundHeight(pos, height, normal))
{ {
@ -74,24 +74,24 @@ bool CHostageImprov::DiscontinuityJump(float ground, bool onlyJumpDown, bool mus
return false; return false;
} }
void CHostageImprov::__MAKE_VHOOK(LookAt)(const Vector &target) void CHostageImprov::LookAt(const Vector &target)
{ {
m_isLookingAt = true; m_isLookingAt = true;
m_viewGoal = target; m_viewGoal = target;
} }
void CHostageImprov::__MAKE_VHOOK(ClearLookAt)() void CHostageImprov::ClearLookAt()
{ {
m_isLookingAt = false; m_isLookingAt = false;
} }
void CHostageImprov::__MAKE_VHOOK(FaceTo)(const Vector &goal) void CHostageImprov::FaceTo(const Vector &goal)
{ {
m_isFacingTo = true; m_isFacingTo = true;
m_faceGoal = goal; m_faceGoal = goal;
} }
void CHostageImprov::__MAKE_VHOOK(ClearFaceTo)() void CHostageImprov::ClearFaceTo()
{ {
m_isFacingTo = false; m_isFacingTo = false;
} }
@ -290,18 +290,18 @@ void CHostageImprov::FaceOutwards()
FaceTo(to); FaceTo(to);
} }
bool CHostageImprov::__MAKE_VHOOK(IsAtMoveGoal)(float error) const bool CHostageImprov::IsAtMoveGoal(float error) const
{ {
return (GetFeet() - m_moveGoal).IsLengthLessThan(error); return (GetFeet() - m_moveGoal).IsLengthLessThan(error);
} }
bool CHostageImprov::__MAKE_VHOOK(IsAtFaceGoal)() const bool CHostageImprov::IsAtFaceGoal() const
{ {
return false; return false;
} }
// Return true if a friend is between us and the given position // Return true if a friend is between us and the given position
bool CHostageImprov::__MAKE_VHOOK(IsFriendInTheWay)(const Vector &goalPos) const bool CHostageImprov::IsFriendInTheWay(const Vector &goalPos) const
{ {
// do this check less often to ease CPU burden // do this check less often to ease CPU burden
if (!m_avoidFriendTimer.IsElapsed()) if (!m_avoidFriendTimer.IsElapsed())
@ -349,7 +349,7 @@ bool CHostageImprov::__MAKE_VHOOK(IsFriendInTheWay)(const Vector &goalPos) const
} }
// Return true if a friend is between us and the given entity // Return true if a friend is between us and the given entity
bool CHostageImprov::__MAKE_VHOOK(IsFriendInTheWay)(CBaseEntity *myFriend, const Vector &goalPos) const bool CHostageImprov::IsFriendInTheWay(CBaseEntity *myFriend, const Vector &goalPos) const
{ {
if (m_hostage == myFriend) if (m_hostage == myFriend)
return false; return false;
@ -414,7 +414,7 @@ float CHostageImprov::GetSpeed()
return -1.0f; return -1.0f;
} }
bool CHostageImprov::__MAKE_VHOOK(Jump)() bool CHostageImprov::Jump()
{ {
if (IsCrouching() || g_pHostages->IsNearbyHostageJumping(this)) if (IsCrouching() || g_pHostages->IsNearbyHostageJumping(this))
return false; return false;
@ -443,17 +443,17 @@ bool CHostageImprov::__MAKE_VHOOK(Jump)()
return true; return true;
} }
void CHostageImprov::__MAKE_VHOOK(Run)() void CHostageImprov::Run()
{ {
m_moveType = m_moveLimit; m_moveType = m_moveLimit;
} }
void CHostageImprov::__MAKE_VHOOK(Walk)() void CHostageImprov::Walk()
{ {
m_moveType = (m_moveLimit > Walking) ? Walking : m_moveLimit; m_moveType = (m_moveLimit > Walking) ? Walking : m_moveLimit;
} }
void CHostageImprov::__MAKE_VHOOK(Stop)() void CHostageImprov::Stop()
{ {
MoveTo(GetFeet()); MoveTo(GetFeet());
m_hostage->pev->velocity = Vector(0, 0, 0); m_hostage->pev->velocity = Vector(0, 0, 0);
@ -464,35 +464,35 @@ void CHostageImprov::__MAKE_VHOOK(Stop)()
m_moveType = m_moveLimit; m_moveType = m_moveLimit;
} }
const Vector &CHostageImprov::__MAKE_VHOOK(GetFeet)() const const Vector &CHostageImprov::GetFeet() const
{ {
return m_hostage->pev->origin; return m_hostage->pev->origin;
} }
const Vector &CHostageImprov::__MAKE_VHOOK(GetCentroid)() const const Vector &CHostageImprov::GetCentroid() const
{ {
m_centroid = m_hostage->pev->origin + Vector(0, 0, HalfHumanHeight); m_centroid = m_hostage->pev->origin + Vector(0, 0, HalfHumanHeight);
return m_centroid; return m_centroid;
} }
const Vector &CHostageImprov::__MAKE_VHOOK(GetEyes)() const const Vector &CHostageImprov::GetEyes() const
{ {
m_eye = m_hostage->pev->origin + Vector(0, 0, HumanHeight) - Vector(0, 0, 7); m_eye = m_hostage->pev->origin + Vector(0, 0, HumanHeight) - Vector(0, 0, 7);
return m_eye; return m_eye;
} }
bool CHostageImprov::__MAKE_VHOOK(IsOnGround)() const bool CHostageImprov::IsOnGround() const
{ {
return (m_hostage->pev->flags & FL_ONGROUND) != 0; return (m_hostage->pev->flags & FL_ONGROUND) != 0;
} }
bool CHostageImprov::__MAKE_VHOOK(IsMoving)() const bool CHostageImprov::IsMoving() const
{ {
float const epsilon = 10.0f; float const epsilon = 10.0f;
return m_actualVel.IsLengthGreaterThan(epsilon); return m_actualVel.IsLengthGreaterThan(epsilon);
} }
bool CHostageImprov::__MAKE_VHOOK(IsVisible)(const Vector &pos, bool testFOV) const bool CHostageImprov::IsVisible(const Vector &pos, bool testFOV) const
{ {
const Vector eye = GetEyes(); const Vector eye = GetEyes();
TraceResult result; TraceResult result;
@ -501,7 +501,7 @@ bool CHostageImprov::__MAKE_VHOOK(IsVisible)(const Vector &pos, bool testFOV) co
return result.flFraction == 1.0f; return result.flFraction == 1.0f;
} }
bool CHostageImprov::__MAKE_VHOOK(IsPlayerLookingAtMe)(CBasePlayer *other, float cosTolerance) const bool CHostageImprov::IsPlayerLookingAtMe(CBasePlayer *other, float cosTolerance) const
{ {
Vector2D toOther = (other->pev->origin - GetCentroid()).Make2D(); Vector2D toOther = (other->pev->origin - GetCentroid()).Make2D();
toOther.NormalizeInPlace(); toOther.NormalizeInPlace();
@ -522,7 +522,7 @@ bool CHostageImprov::__MAKE_VHOOK(IsPlayerLookingAtMe)(CBasePlayer *other, float
return false; return false;
} }
CBasePlayer *CHostageImprov::__MAKE_VHOOK(IsAnyPlayerLookingAtMe)(int team, float cosTolerance) const CBasePlayer *CHostageImprov::IsAnyPlayerLookingAtMe(int team, float cosTolerance) const
{ {
for (int i = 1; i <= gpGlobals->maxClients; ++i) for (int i = 1; i <= gpGlobals->maxClients; ++i)
{ {
@ -543,7 +543,7 @@ CBasePlayer *CHostageImprov::__MAKE_VHOOK(IsAnyPlayerLookingAtMe)(int team, floa
return NULL; return NULL;
} }
CBasePlayer *CHostageImprov::__MAKE_VHOOK(GetClosestPlayerByTravelDistance)(int team, float *range) const CBasePlayer *CHostageImprov::GetClosestPlayerByTravelDistance(int team, float *range) const
{ {
CBasePlayer *close = NULL; CBasePlayer *close = NULL;
float closeRange = 9.9999998e10f; float closeRange = 9.9999998e10f;
@ -579,7 +579,7 @@ CBasePlayer *CHostageImprov::__MAKE_VHOOK(GetClosestPlayerByTravelDistance)(int
return close; return close;
} }
void CHostageImprov::__MAKE_VHOOK(OnReset)() void CHostageImprov::OnReset()
{ {
m_moveFlags = 0; m_moveFlags = 0;
m_moveType = Stopped; m_moveType = Stopped;
@ -672,7 +672,7 @@ void CHostageImprov::UpdateVision()
m_visionTimer.Start(RANDOM_FLOAT(0.4f, 0.6f)); m_visionTimer.Start(RANDOM_FLOAT(0.4f, 0.6f));
} }
void CHostageImprov::__MAKE_VHOOK(TrackPath)(const Vector &pathGoal, float deltaT) void CHostageImprov::TrackPath(const Vector &pathGoal, float deltaT)
{ {
FaceTowards(pathGoal, deltaT); FaceTowards(pathGoal, deltaT);
MoveTowards(pathGoal, deltaT); MoveTowards(pathGoal, deltaT);
@ -731,12 +731,12 @@ void CHostageImprov::ResetToKnownGoodPosition()
Stop(); Stop();
} }
void CHostageImprov::__MAKE_VHOOK(StartLadder)(const CNavLadder *ladder, NavTraverseType how, const Vector *approachPos, const Vector *departPos) void CHostageImprov::StartLadder(const CNavLadder *ladder, NavTraverseType how, const Vector *approachPos, const Vector *departPos)
{ {
m_traversingLadder = true; m_traversingLadder = true;
} }
bool CHostageImprov::__MAKE_VHOOK(TraverseLadder)(const CNavLadder *ladder, NavTraverseType how, const Vector *approachPos, const Vector *departPos, float deltaT) bool CHostageImprov::TraverseLadder(const CNavLadder *ladder, NavTraverseType how, const Vector *approachPos, const Vector *departPos, float deltaT)
{ {
Vector goal; Vector goal;
@ -984,7 +984,7 @@ void CHostageImprov::UpdatePosition(float deltaT)
m_moveFlags = 0; m_moveFlags = 0;
} }
void CHostageImprov::__MAKE_VHOOK(OnUpkeep)(float deltaT) void CHostageImprov::OnUpkeep(float deltaT)
{ {
if (IsAlive()) if (IsAlive())
{ {
@ -1069,7 +1069,7 @@ void CHostageImprov::UpdateGrenadeReactions()
} }
} }
void CHostageImprov::__MAKE_VHOOK(OnUpdate)(float deltaT) void CHostageImprov::OnUpdate(float deltaT)
{ {
if (!IsAlive() || cv_hostage_stop.value > 0.0f) if (!IsAlive() || cv_hostage_stop.value > 0.0f)
return; return;
@ -1225,7 +1225,7 @@ void CHostageImprov::__MAKE_VHOOK(OnUpdate)(float deltaT)
m_animateState.OnUpdate(this); m_animateState.OnUpdate(this);
} }
void CHostageImprov::__MAKE_VHOOK(OnGameEvent)(GameEventType event, CBaseEntity *entity, CBaseEntity *other) void CHostageImprov::OnGameEvent(GameEventType event, CBaseEntity *entity, CBaseEntity *other)
{ {
switch (event) switch (event)
{ {
@ -1330,7 +1330,7 @@ void CHostageImprov::__MAKE_VHOOK(OnGameEvent)(GameEventType event, CBaseEntity
} }
} }
void CHostageImprov::__MAKE_VHOOK(OnTouch)(CBaseEntity *other) void CHostageImprov::OnTouch(CBaseEntity *other)
{ {
const char *classname; const char *classname;
Vector2D to; Vector2D to;
@ -1719,7 +1719,7 @@ void CHostageImprov::Wave()
} }
// Invoked when an improv fails to reach a MoveTo goal // Invoked when an improv fails to reach a MoveTo goal
void CHostageImprov::__MAKE_VHOOK(OnMoveToFailure)(const Vector &goal, MoveToFailureType reason) void CHostageImprov::OnMoveToFailure(const Vector &goal, MoveToFailureType reason)
{ {
m_behavior.OnMoveToFailure(goal, reason); m_behavior.OnMoveToFailure(goal, reason);
@ -1814,7 +1814,7 @@ void CHostageImprov::ClearPath()
} }
} }
void CHostageImprov::__MAKE_VHOOK(Crouch)() void CHostageImprov::Crouch()
{ {
const float minCrouchTime = 1.0f; const float minCrouchTime = 1.0f;
@ -1826,7 +1826,7 @@ void CHostageImprov::__MAKE_VHOOK(Crouch)()
UTIL_SetSize(m_hostage->pev, VEC_HOSTAGE_HULL_MIN, VEC_HOSTAGE_CROUCH); UTIL_SetSize(m_hostage->pev, VEC_HOSTAGE_HULL_MIN, VEC_HOSTAGE_CROUCH);
} }
void CHostageImprov::__MAKE_VHOOK(StandUp)() void CHostageImprov::StandUp()
{ {
if (!IsCrouching() || !m_minCrouchTimer.IsElapsed()) if (!IsCrouching() || !m_minCrouchTimer.IsElapsed())
{ {

View File

@ -42,7 +42,7 @@ enum HostageChatterType;
class CHostageImprov: public CImprov class CHostageImprov: public CImprov
{ {
public: public:
CHostageImprov(CBaseEntity *entity); CHostageImprov(CBaseEntity *entity = nullptr);
~CHostageImprov() {}; ~CHostageImprov() {};
// invoked when an improv reaches its MoveTo goal // invoked when an improv reaches its MoveTo goal
@ -81,7 +81,7 @@ public:
virtual void TrackPath(const Vector &pathGoal, float deltaT); // move along path by following "pathGoal" virtual void TrackPath(const Vector &pathGoal, float deltaT); // move along path by following "pathGoal"
virtual void StartLadder(const CNavLadder *ladder, NavTraverseType how, const Vector *approachPos, const Vector *departPos); virtual void StartLadder(const CNavLadder *ladder, NavTraverseType how, const Vector *approachPos, const Vector *departPos);
virtual bool TraverseLadder(const CNavLadder *ladder, NavTraverseType how, const Vector *approachPos, const Vector *departPos, float deltaT); virtual bool TraverseLadder(const CNavLadder *ladder, NavTraverseType how, const Vector *approachPos, const Vector *departPos, float deltaT);
virtual bool GetSimpleGroundHeightWithFloor(const Vector *pos, float *height, Vector *normal = NULL); virtual bool GetSimpleGroundHeightWithFloor(const Vector *pos, float *height, Vector *normal = nullptr);
virtual void Run(); virtual void Run();
virtual void Walk(); virtual void Walk();
virtual void Stop(); virtual void Stop();
@ -104,54 +104,14 @@ public:
virtual bool IsVisible(const Vector &pos, bool testFOV = false) const; // return true if hostage can see position virtual bool IsVisible(const Vector &pos, bool testFOV = false) const; // return true if hostage can see position
virtual bool IsPlayerLookingAtMe(CBasePlayer *other, float cosTolerance = 0.95f) const; virtual bool IsPlayerLookingAtMe(CBasePlayer *other, float cosTolerance = 0.95f) const;
virtual CBasePlayer *IsAnyPlayerLookingAtMe(int team = 0, float cosTolerance = 0.95f) const; virtual CBasePlayer *IsAnyPlayerLookingAtMe(int team = 0, float cosTolerance = 0.95f) const;
virtual CBasePlayer *GetClosestPlayerByTravelDistance(int team = 0, float *range = NULL) const; virtual CBasePlayer *GetClosestPlayerByTravelDistance(int team = 0, float *range = nullptr) const;
virtual CNavArea *GetLastKnownArea() const { return m_lastKnownArea; } virtual CNavArea *GetLastKnownArea() const { return m_lastKnownArea; }
virtual void OnUpdate(float deltaT); virtual void OnUpdate(float deltaT);
virtual void OnUpkeep(float deltaT); virtual void OnUpkeep(float deltaT);
virtual void OnReset(); virtual void OnReset();
virtual void OnGameEvent(GameEventType event, CBaseEntity *entity = NULL, CBaseEntity *other = NULL); virtual void OnGameEvent(GameEventType event, CBaseEntity *entity = nullptr, CBaseEntity *other = nullptr);
virtual void OnTouch(CBaseEntity *other); // in contact with "other" virtual void OnTouch(CBaseEntity *other); // in contact with "other"
#ifdef HOOK_GAMEDLL
void OnMoveToFailure_(const Vector &goal, MoveToFailureType reason);
bool IsAlive_() const;
void MoveTo_(const Vector &goal);
void LookAt_(const Vector &target);
void ClearLookAt_();
void FaceTo_(const Vector &goal);
void ClearFaceTo_();
bool IsAtMoveGoal_(float error = 20.0f) const;
bool IsAtFaceGoal_() const;
bool IsFriendInTheWay_(const Vector &goalPos) const;
bool IsFriendInTheWay_(CBaseEntity *myFriend, const Vector &goalPos) const;
bool Jump_();
void Crouch_();
void StandUp_();
void TrackPath_(const Vector &pathGoal, float deltaT);
void StartLadder_(const CNavLadder *ladder, NavTraverseType how, const Vector *approachPos, const Vector *departPos);
bool TraverseLadder_(const CNavLadder *ladder, NavTraverseType how, const Vector *approachPos, const Vector *departPos, float deltaT);
bool GetSimpleGroundHeightWithFloor_(const Vector *pos, float *height, Vector *normal = NULL);
void Run_();
void Walk_();
void Stop_();
const Vector &GetFeet_() const;
const Vector &GetCentroid_() const;
const Vector &GetEyes_() const;
bool IsOnGround_() const;
bool IsMoving_() const;
bool IsVisible_(const Vector &pos, bool testFOV = false) const;
bool IsPlayerLookingAtMe_(CBasePlayer *other, float cosTolerance = 0.95f) const;
CBasePlayer *IsAnyPlayerLookingAtMe_(int team = 0, float cosTolerance = 0.95f) const;
CBasePlayer *GetClosestPlayerByTravelDistance_(int team = 0, float *range = NULL) const;
void OnUpdate_(float deltaT);
void OnUpkeep_(float deltaT);
void OnReset_();
void OnGameEvent_(GameEventType event, CBaseEntity *entity = NULL, CBaseEntity *other = NULL);
void OnTouch_(CBaseEntity *other);
#endif // HOOK_GAMEDLL
#ifdef PLAY_GAMEDLL #ifdef PLAY_GAMEDLL
void ApplyForce2(float_precision x, float_precision y); void ApplyForce2(float_precision x, float_precision y);
#endif #endif
@ -180,7 +140,7 @@ public:
// begin following "leader" // begin following "leader"
void Follow(CBasePlayer *leader) { m_followState.SetLeader(leader); m_behavior.SetState(&m_followState); } void Follow(CBasePlayer *leader) { m_followState.SetLeader(leader); m_behavior.SetState(&m_followState); }
bool IsFollowing(const CBaseEntity *leader = NULL) const { return m_behavior.IsState(&m_followState); } bool IsFollowing(const CBaseEntity *leader = nullptr) const { return m_behavior.IsState(&m_followState); }
// Escape // Escape
void Escape() { m_behavior.SetState(&m_escapeState); } void Escape() { m_behavior.SetState(&m_escapeState); }
@ -223,7 +183,7 @@ public:
bool FaceTowards(const Vector &target, float deltaT); // rotate body to face towards "target" bool FaceTowards(const Vector &target, float deltaT); // rotate body to face towards "target"
float GetSpeed(); float GetSpeed();
void SetMoveAngle(float angle) { m_moveAngle = angle; } void SetMoveAngle(float angle) { m_moveAngle = angle; }
void Wiggle(); // attempt to wiggle-out of begin stuck void Wiggle(); // attempt to wiggle-out of begin stuck
void ClearPath(); void ClearPath();
#define HOSTAGE_ONLY_JUMP_DOWN true #define HOSTAGE_ONLY_JUMP_DOWN true
@ -281,12 +241,12 @@ private:
bool m_isLookingAt; bool m_isLookingAt;
Vector m_faceGoal; Vector m_faceGoal;
bool m_isFacingTo; bool m_isFacingTo;
CNavPath m_path; // current path to follow CNavPath m_path; // current path to follow
CNavPathFollower m_follower; CNavPathFollower m_follower;
Vector m_lastPosition; Vector m_lastPosition;
MoveType m_moveType; MoveType m_moveType;
MoveType m_moveLimit; MoveType m_moveLimit;
bool m_isCrouching; // true if hostage is crouching bool m_isCrouching; // true if hostage is crouching
CountdownTimer m_minCrouchTimer; CountdownTimer m_minCrouchTimer;
float m_moveAngle; float m_moveAngle;
NavRelativeDirType m_wiggleDirection; NavRelativeDirType m_wiggleDirection;
@ -294,7 +254,7 @@ private:
CountdownTimer m_wiggleTimer; // for wiggling CountdownTimer m_wiggleTimer; // for wiggling
CountdownTimer m_wiggleJumpTimer; CountdownTimer m_wiggleJumpTimer;
CountdownTimer m_inhibitObstacleAvoidance; CountdownTimer m_inhibitObstacleAvoidance;
CountdownTimer m_jumpTimer; // if zero, we can jump CountdownTimer m_jumpTimer; // if zero, we can jump
bool m_hasJumped; bool m_hasJumped;
bool m_hasJumpedIntoAir; bool m_hasJumpedIntoAir;
@ -313,7 +273,7 @@ public:
{ {
m_me = me; m_me = me;
m_goalPos = goalPos; m_goalPos = goalPos;
m_blocker = NULL; m_blocker = nullptr;
} }
bool operator()(CHostage *them) bool operator()(CHostage *them)
{ {
@ -338,7 +298,7 @@ class HostagePathCost
public: public:
float operator()(CNavArea *area, CNavArea *fromArea, const CNavLadder *ladder) float operator()(CNavArea *area, CNavArea *fromArea, const CNavLadder *ladder)
{ {
if (fromArea == NULL) if (fromArea == nullptr)
{ {
// first area in path, no cost // first area in path, no cost
return 0.0f; return 0.0f;

View File

@ -53,9 +53,7 @@ typedef struct localnode_s
} localnode_t; } localnode_t;
#ifndef HOOK_GAMEDLL #ifndef HOOK_GAMEDLL
#define s_flStepSize_LocalNav m_LocalNav->s_flStepSize #define s_flStepSize_LocalNav m_LocalNav->s_flStepSize
#endif #endif
class CLocalNav class CLocalNav
@ -101,10 +99,7 @@ public:
static void HostagePrethink(); static void HostagePrethink();
static float s_flStepSize; static float s_flStepSize;
#ifndef HOOK_GAMEDLL
private: private:
#endif
static EHANDLE _queue[MAX_HOSTAGES_NAV]; static EHANDLE _queue[MAX_HOSTAGES_NAV];
static int qptr; static int qptr;
static int tot_inqueue; static int tot_inqueue;

View File

@ -80,15 +80,6 @@ public:
virtual void OnMoveToFailure(const Vector &goal, MoveToFailureType reason) { m_moveState = MoveFailed; } virtual void OnMoveToFailure(const Vector &goal, MoveToFailureType reason) { m_moveState = MoveFailed; }
virtual void OnInjury(float amount = -1.0f) { m_fleeTimer.Invalidate(); m_mustFlee = true; } virtual void OnInjury(float amount = -1.0f) { m_fleeTimer.Invalidate(); m_mustFlee = true; }
#ifdef HOOK_GAMEDLL
void OnEnter_(CHostageImprov *improv);
void OnUpdate_(CHostageImprov *improv);
void OnExit_(CHostageImprov *improv);
void UpdateStationaryAnimation_(CHostageImprov *improv);
#endif
private: private:
CountdownTimer m_waveTimer; CountdownTimer m_waveTimer;
CountdownTimer m_fleeTimer; CountdownTimer m_fleeTimer;
@ -120,15 +111,6 @@ public:
virtual const char *GetName() const { return "Escape:ToCover"; } virtual const char *GetName() const { return "Escape:ToCover"; }
virtual void OnMoveToFailure(const Vector &goal, MoveToFailureType reason); virtual void OnMoveToFailure(const Vector &goal, MoveToFailureType reason);
#ifdef HOOK_GAMEDLL
void OnEnter_(CHostageImprov *improv);
void OnUpdate_(CHostageImprov *improv);
void OnExit_(CHostageImprov *improv);
void OnMoveToFailure_(const Vector &goal, MoveToFailureType reason);
#endif
public: public:
void SetRescueGoal(const Vector &rescueGoal) { m_rescueGoal = rescueGoal; } void SetRescueGoal(const Vector &rescueGoal) { m_rescueGoal = rescueGoal; }
@ -148,14 +130,6 @@ public:
virtual void OnExit(CHostageImprov *improv); virtual void OnExit(CHostageImprov *improv);
virtual const char *GetName() const { return "Escape:LookAround"; } virtual const char *GetName() const { return "Escape:LookAround"; }
#ifdef HOOK_GAMEDLL
void OnEnter_(CHostageImprov *improv);
void OnUpdate_(CHostageImprov *improv);
void OnExit_(CHostageImprov *improv);
#endif
private: private:
CountdownTimer m_timer; CountdownTimer m_timer;
}; };
@ -176,14 +150,6 @@ public:
virtual const char *GetName() const { return "Escape"; } virtual const char *GetName() const { return "Escape"; }
virtual void OnMoveToFailure(const Vector &goal, MoveToFailureType reason) { m_behavior.OnMoveToFailure(goal, reason); } virtual void OnMoveToFailure(const Vector &goal, MoveToFailureType reason) { m_behavior.OnMoveToFailure(goal, reason); }
#ifdef HOOK_GAMEDLL
void OnEnter_(CHostageImprov *improv);
void OnUpdate_(CHostageImprov *improv);
void OnExit_(CHostageImprov *improv);
#endif
public: public:
void ToCover() { m_behavior.SetState(&m_toCoverState); } void ToCover() { m_behavior.SetState(&m_toCoverState); }
void LookAround() { m_behavior.SetState(&m_lookAroundState); } void LookAround() { m_behavior.SetState(&m_lookAroundState); }
@ -205,15 +171,6 @@ public:
virtual void OnUpdate(CHostageImprov *improv); virtual void OnUpdate(CHostageImprov *improv);
virtual void OnExit(CHostageImprov *improv); virtual void OnExit(CHostageImprov *improv);
virtual const char *GetName() const { return "Retreat"; } virtual const char *GetName() const { return "Retreat"; }
#ifdef HOOK_GAMEDLL
void OnEnter_(CHostageImprov *improv);
void OnUpdate_(CHostageImprov *improv);
void OnExit_(CHostageImprov *improv);
#endif
}; };
class HostageFollowState: public HostageState class HostageFollowState: public HostageState
@ -227,15 +184,6 @@ public:
virtual const char *GetName() const { return "Follow"; } virtual const char *GetName() const { return "Follow"; }
virtual void UpdateStationaryAnimation(CHostageImprov *improv); virtual void UpdateStationaryAnimation(CHostageImprov *improv);
#ifdef HOOK_GAMEDLL
void OnEnter_(CHostageImprov *improv);
void OnUpdate_(CHostageImprov *improv);
void OnExit_(CHostageImprov *improv);
void UpdateStationaryAnimation_(CHostageImprov *improv);
#endif
public: public:
void SetLeader(CBaseEntity *leader) { m_leader = leader; } void SetLeader(CBaseEntity *leader) { m_leader = leader; }
CBaseEntity *GetLeader() const { return m_leader; } CBaseEntity *GetLeader() const { return m_leader; }
@ -262,14 +210,6 @@ public:
virtual void OnExit(CHostageImprov *improv); virtual void OnExit(CHostageImprov *improv);
virtual const char *GetName() const { return "Animate"; } virtual const char *GetName() const { return "Animate"; }
#ifdef HOOK_GAMEDLL
void OnEnter_(CHostageImprov *improv);
void OnUpdate_(CHostageImprov *improv);
void OnExit_(CHostageImprov *improv);
#endif
public: public:
struct SeqInfo struct SeqInfo
{ {

View File

@ -72,12 +72,12 @@ bool HostageAnimateState::IsDoneHolding()
return false; return false;
} }
void HostageAnimateState::__MAKE_VHOOK(OnEnter)(CHostageImprov *improv) void HostageAnimateState::OnEnter(CHostageImprov *improv)
{ {
; ;
} }
void HostageAnimateState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv) void HostageAnimateState::OnUpdate(CHostageImprov *improv)
{ {
if (m_sequenceCount <= 0) if (m_sequenceCount <= 0)
return; return;
@ -103,7 +103,7 @@ void HostageAnimateState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv)
StartSequence(improv, &m_sequence[m_currentSequence]); StartSequence(improv, &m_sequence[m_currentSequence]);
} }
void HostageAnimateState::__MAKE_VHOOK(OnExit)(CHostageImprov *improv) void HostageAnimateState::OnExit(CHostageImprov *improv)
{ {
; ;
} }

View File

@ -1,6 +1,6 @@
#include "precompiled.h" #include "precompiled.h"
void HostageEscapeToCoverState::__MAKE_VHOOK(OnEnter)(CHostageImprov *improv) void HostageEscapeToCoverState::OnEnter(CHostageImprov *improv)
{ {
CNavPath path; CNavPath path;
HostagePathCost pathCost; HostagePathCost pathCost;
@ -35,7 +35,7 @@ void HostageEscapeToCoverState::__MAKE_VHOOK(OnEnter)(CHostageImprov *improv)
m_canEscape = true; m_canEscape = true;
} }
void HostageEscapeToCoverState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv) void HostageEscapeToCoverState::OnUpdate(CHostageImprov *improv)
{ {
if (!m_canEscape) if (!m_canEscape)
{ {
@ -67,18 +67,18 @@ void HostageEscapeToCoverState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv)
} }
} }
void HostageEscapeToCoverState::__MAKE_VHOOK(OnExit)(CHostageImprov *improv) void HostageEscapeToCoverState::OnExit(CHostageImprov *improv)
{ {
; ;
} }
void HostageEscapeToCoverState::__MAKE_VHOOK(OnMoveToFailure)(const Vector &goal, MoveToFailureType reason) void HostageEscapeToCoverState::OnMoveToFailure(const Vector &goal, MoveToFailureType reason)
{ {
HostageEscapeState *escape = static_cast<HostageEscapeState *>(GetParent()); HostageEscapeState *escape = static_cast<HostageEscapeState *>(GetParent());
escape->LookAround(); escape->LookAround();
} }
void HostageEscapeLookAroundState::__MAKE_VHOOK(OnEnter)(CHostageImprov *improv) void HostageEscapeLookAroundState::OnEnter(CHostageImprov *improv)
{ {
m_timer.Start(RANDOM_FLOAT(5, 10)); m_timer.Start(RANDOM_FLOAT(5, 10));
@ -86,7 +86,7 @@ void HostageEscapeLookAroundState::__MAKE_VHOOK(OnEnter)(CHostageImprov *improv)
improv->FaceOutwards(); improv->FaceOutwards();
} }
void HostageEscapeLookAroundState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv) void HostageEscapeLookAroundState::OnUpdate(CHostageImprov *improv)
{ {
improv->UpdateIdleActivity(ACT_IDLE_SNEAKY, ACT_IDLE_SNEAKY_FIDGET); improv->UpdateIdleActivity(ACT_IDLE_SNEAKY, ACT_IDLE_SNEAKY_FIDGET);
@ -97,12 +97,12 @@ void HostageEscapeLookAroundState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv
} }
} }
void HostageEscapeLookAroundState::__MAKE_VHOOK(OnExit)(CHostageImprov *improv) void HostageEscapeLookAroundState::OnExit(CHostageImprov *improv)
{ {
improv->ClearFaceTo(); improv->ClearFaceTo();
} }
void HostageEscapeState::__MAKE_VHOOK(OnEnter)(CHostageImprov *improv) void HostageEscapeState::OnEnter(CHostageImprov *improv)
{ {
const CCSBotManager::Zone *zone = TheCSBots()->GetRandomZone(); const CCSBotManager::Zone *zone = TheCSBots()->GetRandomZone();
@ -117,7 +117,7 @@ void HostageEscapeState::__MAKE_VHOOK(OnEnter)(CHostageImprov *improv)
m_canEscape = true; m_canEscape = true;
} }
void HostageEscapeState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv) void HostageEscapeState::OnUpdate(CHostageImprov *improv)
{ {
if (!m_canEscape || (improv->IsScared() && improv->GetScareIntensity() == CHostageImprov::TERRIFIED)) if (!m_canEscape || (improv->IsScared() && improv->GetScareIntensity() == CHostageImprov::TERRIFIED))
{ {
@ -164,7 +164,7 @@ void HostageEscapeState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv)
} }
} }
void HostageEscapeState::__MAKE_VHOOK(OnExit)(CHostageImprov *improv) void HostageEscapeState::OnExit(CHostageImprov *improv)
{ {
improv->Run(); improv->Run();
} }

View File

@ -1,6 +1,6 @@
#include "precompiled.h" #include "precompiled.h"
void HostageFollowState::__MAKE_VHOOK(OnEnter)(CHostageImprov *improv) void HostageFollowState::OnEnter(CHostageImprov *improv)
{ {
improv->Chatter(HOSTAGE_CHATTER_START_FOLLOW); improv->Chatter(HOSTAGE_CHATTER_START_FOLLOW);
improv->Agree(); improv->Agree();
@ -21,7 +21,7 @@ void HostageFollowState::__MAKE_VHOOK(OnEnter)(CHostageImprov *improv)
} }
} }
void HostageFollowState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv) void HostageFollowState::OnUpdate(CHostageImprov *improv)
{ {
// if we lost our leader, give up // if we lost our leader, give up
if (m_leader == NULL) if (m_leader == NULL)
@ -192,12 +192,12 @@ void HostageFollowState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv)
} }
} }
void HostageFollowState::__MAKE_VHOOK(OnExit)(CHostageImprov *improv) void HostageFollowState::OnExit(CHostageImprov *improv)
{ {
improv->Stop(); improv->Stop();
} }
void HostageFollowState::__MAKE_VHOOK(UpdateStationaryAnimation)(CHostageImprov *improv) void HostageFollowState::UpdateStationaryAnimation(CHostageImprov *improv)
{ {
if (improv->IsScared()) if (improv->IsScared())
improv->UpdateIdleActivity(ACT_FOLLOW_IDLE_SCARED, ACT_RESET); improv->UpdateIdleActivity(ACT_FOLLOW_IDLE_SCARED, ACT_RESET);

View File

@ -1,13 +1,13 @@
#include "precompiled.h" #include "precompiled.h"
void HostageIdleState::__MAKE_VHOOK(OnEnter)(CHostageImprov *improv) void HostageIdleState::OnEnter(CHostageImprov *improv)
{ {
m_moveState = MoveDone; m_moveState = MoveDone;
m_fleeTimer.Invalidate(); m_fleeTimer.Invalidate();
m_mustFlee = false; m_mustFlee = false;
} }
void HostageIdleState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv) void HostageIdleState::OnUpdate(CHostageImprov *improv)
{ {
if (!UTIL_ActivePlayersInGame()) if (!UTIL_ActivePlayersInGame())
return; return;
@ -57,7 +57,7 @@ void HostageIdleState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv)
improv->Stop(); improv->Stop();
improv->FaceOutwards(); improv->FaceOutwards();
const float crouchChance = 33.3f; const float crouchChance = 33.3f;
if (improv->IsScared() && !improv->IsAtHome() && RANDOM_FLOAT(0, 100) <= crouchChance) if (improv->IsScared() && !improv->IsAtHome() && RANDOM_FLOAT(0, 100) <= crouchChance)
{ {
@ -92,7 +92,7 @@ void HostageIdleState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv)
{ {
const float attentionRange = 700.0f; const float attentionRange = 700.0f;
float rangeT = (improv->GetCentroid() - captor->pev->origin).Length(); float rangeT = (improv->GetCentroid() - captor->pev->origin).Length();
if (rangeT < attentionRange) if (rangeT < attentionRange)
{ {
const float cosTolerance = 0.95f; const float cosTolerance = 0.95f;
@ -228,13 +228,13 @@ void HostageIdleState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv)
} }
} }
void HostageIdleState::__MAKE_VHOOK(OnExit)(CHostageImprov *improv) void HostageIdleState::OnExit(CHostageImprov *improv)
{ {
improv->StandUp(); improv->StandUp();
improv->ClearFaceTo(); improv->ClearFaceTo();
} }
void HostageIdleState::__MAKE_VHOOK(UpdateStationaryAnimation)(CHostageImprov *improv) void HostageIdleState::UpdateStationaryAnimation(CHostageImprov *improv)
{ {
if (improv->IsScared()) if (improv->IsScared())
{ {

View File

@ -1,12 +1,12 @@
#include "precompiled.h" #include "precompiled.h"
void HostageRetreatState::__MAKE_VHOOK(OnEnter)(CHostageImprov *improv) void HostageRetreatState::OnEnter(CHostageImprov *improv)
{ {
improv->Walk(); improv->Walk();
improv->MoveTo(improv->GetEntity()->m_vStart); improv->MoveTo(improv->GetEntity()->m_vStart);
} }
void HostageRetreatState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv) void HostageRetreatState::OnUpdate(CHostageImprov *improv)
{ {
if (improv->IsAtHome()) if (improv->IsAtHome())
{ {
@ -37,7 +37,7 @@ void HostageRetreatState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv)
improv->Walk(); improv->Walk();
} }
void HostageRetreatState::__MAKE_VHOOK(OnExit)(CHostageImprov *improv) void HostageRetreatState::OnExit(CHostageImprov *improv)
{ {
; ;
} }

View File

@ -46,7 +46,7 @@ ItemInfo itemInfo[] = {
#ifndef REGAMEDLL_FIXES #ifndef REGAMEDLL_FIXES
LINK_ENTITY_TO_CLASS(world_items, CWorldItem, CCSWorldItem) LINK_ENTITY_TO_CLASS(world_items, CWorldItem, CCSWorldItem)
void CWorldItem::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CWorldItem::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "type")) if (FStrEq(pkvd->szKeyName, "type"))
{ {
@ -57,7 +57,7 @@ void CWorldItem::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CBaseEntity::KeyValue(pkvd); CBaseEntity::KeyValue(pkvd);
} }
void CWorldItem::__MAKE_VHOOK(Spawn)() void CWorldItem::Spawn()
{ {
CBaseEntity *pEntity = NULL; CBaseEntity *pEntity = NULL;
@ -90,7 +90,7 @@ void CWorldItem::__MAKE_VHOOK(Spawn)()
} }
#endif #endif
void CItem::__MAKE_VHOOK(Spawn)() void CItem::Spawn()
{ {
pev->movetype = MOVETYPE_TOSS; pev->movetype = MOVETYPE_TOSS;
pev->solid = SOLID_TRIGGER; pev->solid = SOLID_TRIGGER;
@ -132,7 +132,7 @@ void CItem::ItemTouch(CBaseEntity *pOther)
UTIL_Remove(this); UTIL_Remove(this);
} }
CBaseEntity *CItem::__MAKE_VHOOK(Respawn)() CBaseEntity *CItem::Respawn()
{ {
SetTouch(NULL); SetTouch(NULL);
@ -163,20 +163,20 @@ void CItem::Materialize()
// NOTE: useless thing // NOTE: useless thing
#ifndef REGAMEDLL_FIXES #ifndef REGAMEDLL_FIXES
void CItemSuit::__MAKE_VHOOK(Spawn)() void CItemSuit::Spawn()
{ {
Precache(); Precache();
SET_MODEL(ENT(pev), "models/w_kevlar.mdl"); SET_MODEL(ENT(pev), "models/w_kevlar.mdl");
CItem::Spawn(); CItem::Spawn();
} }
void CItemSuit::__MAKE_VHOOK(Precache)() void CItemSuit::Precache()
{ {
PRECACHE_MODEL("models/w_kevlar.mdl"); PRECACHE_MODEL("models/w_kevlar.mdl");
PRECACHE_SOUND("items/tr_kevlar.wav"); PRECACHE_SOUND("items/tr_kevlar.wav");
} }
BOOL CItemSuit::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer) BOOL CItemSuit::MyTouch(CBasePlayer *pPlayer)
{ {
if (pPlayer->pev->weapons & (1 << WEAPON_SUIT)) if (pPlayer->pev->weapons & (1 << WEAPON_SUIT))
return FALSE; return FALSE;
@ -192,20 +192,20 @@ BOOL CItemSuit::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer)
LINK_ENTITY_TO_CLASS(item_suit, CItemSuit, CCSItemSuit) LINK_ENTITY_TO_CLASS(item_suit, CItemSuit, CCSItemSuit)
#endif #endif
void CItemBattery::__MAKE_VHOOK(Spawn)() void CItemBattery::Spawn()
{ {
Precache(); Precache();
SET_MODEL(ENT(pev), "models/w_battery.mdl"); SET_MODEL(ENT(pev), "models/w_battery.mdl");
CItem::Spawn(); CItem::Spawn();
} }
void CItemBattery::__MAKE_VHOOK(Precache)() void CItemBattery::Precache()
{ {
PRECACHE_MODEL("models/w_battery.mdl"); PRECACHE_MODEL("models/w_battery.mdl");
PRECACHE_SOUND("items/gunpickup2.wav"); PRECACHE_SOUND("items/gunpickup2.wav");
} }
BOOL CItemBattery::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer) BOOL CItemBattery::MyTouch(CBasePlayer *pPlayer)
{ {
#ifdef REGAMEDLL_ADD #ifdef REGAMEDLL_ADD
if (pPlayer->HasRestrictItem(ITEM_BATTERY, ITEM_TYPE_TOUCHED)) if (pPlayer->HasRestrictItem(ITEM_BATTERY, ITEM_TYPE_TOUCHED))
@ -244,19 +244,19 @@ BOOL CItemBattery::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer)
LINK_ENTITY_TO_CLASS(item_battery, CItemBattery, CCSItemBattery) LINK_ENTITY_TO_CLASS(item_battery, CItemBattery, CCSItemBattery)
void CItemAntidote::__MAKE_VHOOK(Spawn)() void CItemAntidote::Spawn()
{ {
Precache(); Precache();
SET_MODEL(ENT(pev), "models/w_antidote.mdl"); SET_MODEL(ENT(pev), "models/w_antidote.mdl");
CItem::Spawn(); CItem::Spawn();
} }
void CItemAntidote::__MAKE_VHOOK(Precache)() void CItemAntidote::Precache()
{ {
PRECACHE_MODEL("models/w_antidote.mdl"); PRECACHE_MODEL("models/w_antidote.mdl");
} }
BOOL CItemAntidote::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer) BOOL CItemAntidote::MyTouch(CBasePlayer *pPlayer)
{ {
#ifdef REGAMEDLL_ADD #ifdef REGAMEDLL_ADD
if (pPlayer->HasRestrictItem(ITEM_ANTIDOTE, ITEM_TYPE_TOUCHED)) if (pPlayer->HasRestrictItem(ITEM_ANTIDOTE, ITEM_TYPE_TOUCHED))
@ -273,19 +273,19 @@ LINK_ENTITY_TO_CLASS(item_antidote, CItemAntidote, CCSItemAntidote)
// NOTE: useless thing // NOTE: useless thing
#ifndef REGAMEDLL_FIXES #ifndef REGAMEDLL_FIXES
void CItemSecurity::__MAKE_VHOOK(Spawn)() void CItemSecurity::Spawn()
{ {
Precache(); Precache();
SET_MODEL(ENT(pev), "models/w_security.mdl"); SET_MODEL(ENT(pev), "models/w_security.mdl");
CItem::Spawn(); CItem::Spawn();
} }
void CItemSecurity::__MAKE_VHOOK(Precache)() void CItemSecurity::Precache()
{ {
PRECACHE_MODEL("models/w_security.mdl"); PRECACHE_MODEL("models/w_security.mdl");
} }
BOOL CItemSecurity::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer) BOOL CItemSecurity::MyTouch(CBasePlayer *pPlayer)
{ {
pPlayer->m_rgItems[ ITEM_ID_SECURITY ] += 1; pPlayer->m_rgItems[ ITEM_ID_SECURITY ] += 1;
return TRUE; return TRUE;
@ -294,19 +294,19 @@ BOOL CItemSecurity::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer)
LINK_ENTITY_TO_CLASS(item_security, CItemSecurity, CCSItemSecurity) LINK_ENTITY_TO_CLASS(item_security, CItemSecurity, CCSItemSecurity)
#endif #endif
void CItemLongJump::__MAKE_VHOOK(Spawn)() void CItemLongJump::Spawn()
{ {
Precache(); Precache();
SET_MODEL(ENT(pev), "models/w_longjump.mdl"); SET_MODEL(ENT(pev), "models/w_longjump.mdl");
CItem::Spawn(); CItem::Spawn();
} }
void CItemLongJump::__MAKE_VHOOK(Precache)() void CItemLongJump::Precache()
{ {
PRECACHE_MODEL("models/w_longjump.mdl"); PRECACHE_MODEL("models/w_longjump.mdl");
} }
BOOL CItemLongJump::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer) BOOL CItemLongJump::MyTouch(CBasePlayer *pPlayer)
{ {
#ifdef REGAMEDLL_ADD #ifdef REGAMEDLL_ADD
if (pPlayer->HasRestrictItem(ITEM_LONGJUMP, ITEM_TYPE_TOUCHED)) if (pPlayer->HasRestrictItem(ITEM_LONGJUMP, ITEM_TYPE_TOUCHED))
@ -336,19 +336,19 @@ BOOL CItemLongJump::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer)
LINK_ENTITY_TO_CLASS(item_longjump, CItemLongJump, CCSItemLongJump) LINK_ENTITY_TO_CLASS(item_longjump, CItemLongJump, CCSItemLongJump)
void CItemKevlar::__MAKE_VHOOK(Spawn)() void CItemKevlar::Spawn()
{ {
Precache(); Precache();
SET_MODEL(ENT(pev), "models/w_kevlar.mdl"); SET_MODEL(ENT(pev), "models/w_kevlar.mdl");
CItem::Spawn(); CItem::Spawn();
} }
void CItemKevlar::__MAKE_VHOOK(Precache)() void CItemKevlar::Precache()
{ {
PRECACHE_MODEL("models/w_kevlar.mdl"); PRECACHE_MODEL("models/w_kevlar.mdl");
} }
BOOL CItemKevlar::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer) BOOL CItemKevlar::MyTouch(CBasePlayer *pPlayer)
{ {
#ifdef REGAMEDLL_ADD #ifdef REGAMEDLL_ADD
if (pPlayer->HasRestrictItem(ITEM_KEVLAR, ITEM_TYPE_TOUCHED)) if (pPlayer->HasRestrictItem(ITEM_KEVLAR, ITEM_TYPE_TOUCHED))
@ -379,19 +379,19 @@ BOOL CItemKevlar::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer)
LINK_ENTITY_TO_CLASS(item_kevlar, CItemKevlar, CCSItemKevlar) LINK_ENTITY_TO_CLASS(item_kevlar, CItemKevlar, CCSItemKevlar)
void CItemAssaultSuit::__MAKE_VHOOK(Spawn)() void CItemAssaultSuit::Spawn()
{ {
Precache(); Precache();
SET_MODEL(ENT(pev), "models/w_assault.mdl"); SET_MODEL(ENT(pev), "models/w_assault.mdl");
CItem::Spawn(); CItem::Spawn();
} }
void CItemAssaultSuit::__MAKE_VHOOK(Precache)() void CItemAssaultSuit::Precache()
{ {
PRECACHE_MODEL("models/w_assault.mdl"); PRECACHE_MODEL("models/w_assault.mdl");
} }
BOOL CItemAssaultSuit::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer) BOOL CItemAssaultSuit::MyTouch(CBasePlayer *pPlayer)
{ {
#ifdef REGAMEDLL_ADD #ifdef REGAMEDLL_ADD
if (pPlayer->HasRestrictItem(ITEM_ASSAULT, ITEM_TYPE_TOUCHED)) if (pPlayer->HasRestrictItem(ITEM_ASSAULT, ITEM_TYPE_TOUCHED))
@ -421,19 +421,19 @@ BOOL CItemAssaultSuit::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer)
LINK_ENTITY_TO_CLASS(item_assaultsuit, CItemAssaultSuit, CCSItemAssaultSuit) LINK_ENTITY_TO_CLASS(item_assaultsuit, CItemAssaultSuit, CCSItemAssaultSuit)
void CItemThighPack::__MAKE_VHOOK(Spawn)() void CItemThighPack::Spawn()
{ {
Precache(); Precache();
SET_MODEL(ENT(pev), "models/w_thighpack.mdl"); SET_MODEL(ENT(pev), "models/w_thighpack.mdl");
CItem::Spawn(); CItem::Spawn();
} }
void CItemThighPack::__MAKE_VHOOK(Precache)() void CItemThighPack::Precache()
{ {
PRECACHE_MODEL("models/w_thighpack.mdl"); PRECACHE_MODEL("models/w_thighpack.mdl");
} }
BOOL CItemThighPack::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer) BOOL CItemThighPack::MyTouch(CBasePlayer *pPlayer)
{ {
if (pPlayer->m_iTeam != CT || pPlayer->m_bHasDefuser) if (pPlayer->m_iTeam != CT || pPlayer->m_bHasDefuser)
return FALSE; return FALSE;

View File

@ -93,13 +93,6 @@ public:
virtual CBaseEntity *Respawn(); virtual CBaseEntity *Respawn();
virtual BOOL MyTouch(CBasePlayer *pPlayer) { return FALSE; } virtual BOOL MyTouch(CBasePlayer *pPlayer) { return FALSE; }
#ifdef HOOK_GAMEDLL
void Spawn_();
CBaseEntity *Respawn_();
#endif
public: public:
void EXPORT ItemTouch(CBaseEntity *pOther); void EXPORT ItemTouch(CBaseEntity *pOther);
void EXPORT Materialize(); void EXPORT Materialize();
@ -111,13 +104,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
#ifdef HOOK_GAMEDLL
void Spawn_();
void KeyValue_(KeyValueData *pkvd);
#endif
public: public:
int m_iType; int m_iType;
}; };
@ -128,15 +114,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Precache(); virtual void Precache();
virtual BOOL MyTouch(CBasePlayer *pPlayer); virtual BOOL MyTouch(CBasePlayer *pPlayer);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
BOOL MyTouch_(CBasePlayer *pPlayer);
#endif
}; };
class CItemBattery: public CItem class CItemBattery: public CItem
@ -145,15 +122,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Precache(); virtual void Precache();
virtual BOOL MyTouch(CBasePlayer *pPlayer); virtual BOOL MyTouch(CBasePlayer *pPlayer);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
BOOL MyTouch_(CBasePlayer *pPlayer);
#endif
}; };
class CItemAntidote: public CItem class CItemAntidote: public CItem
@ -162,15 +130,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Precache(); virtual void Precache();
virtual BOOL MyTouch(CBasePlayer *pPlayer); virtual BOOL MyTouch(CBasePlayer *pPlayer);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
BOOL MyTouch_(CBasePlayer *pPlayer);
#endif
}; };
class CItemSecurity: public CItem class CItemSecurity: public CItem
@ -179,15 +138,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Precache(); virtual void Precache();
virtual BOOL MyTouch(CBasePlayer *pPlayer); virtual BOOL MyTouch(CBasePlayer *pPlayer);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
BOOL MyTouch_(CBasePlayer *pPlayer);
#endif
}; };
class CItemLongJump: public CItem class CItemLongJump: public CItem
@ -196,15 +146,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Precache(); virtual void Precache();
virtual BOOL MyTouch(CBasePlayer *pPlayer); virtual BOOL MyTouch(CBasePlayer *pPlayer);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
BOOL MyTouch_(CBasePlayer *pPlayer);
#endif
}; };
class CItemKevlar: public CItem class CItemKevlar: public CItem
@ -213,15 +154,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Precache(); virtual void Precache();
virtual BOOL MyTouch(CBasePlayer *pPlayer); virtual BOOL MyTouch(CBasePlayer *pPlayer);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
BOOL MyTouch_(CBasePlayer *pPlayer);
#endif
}; };
class CItemAssaultSuit: public CItem class CItemAssaultSuit: public CItem
@ -230,15 +162,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Precache(); virtual void Precache();
virtual BOOL MyTouch(CBasePlayer *pPlayer); virtual BOOL MyTouch(CBasePlayer *pPlayer);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
BOOL MyTouch_(CBasePlayer *pPlayer);
#endif
}; };
class CItemThighPack: public CItem class CItemThighPack: public CItem
@ -247,15 +170,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Precache(); virtual void Precache();
virtual BOOL MyTouch(CBasePlayer *pPlayer); virtual BOOL MyTouch(CBasePlayer *pPlayer);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
BOOL MyTouch_(CBasePlayer *pPlayer);
#endif
}; };
ItemID GetItemIdByName(const char *pszName); ItemID GetItemIdByName(const char *pszName);

View File

@ -17,7 +17,7 @@ LINK_ENTITY_TO_CLASS(light, CLight, CCSLight)
IMPLEMENT_SAVERESTORE(CLight, CPointEntity) IMPLEMENT_SAVERESTORE(CLight, CPointEntity)
// Cache user-entity-field values until spawn is called. // Cache user-entity-field values until spawn is called.
void CLight::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CLight::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "style")) if (FStrEq(pkvd->szKeyName, "style"))
{ {
@ -38,7 +38,7 @@ void CLight::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CPointEntity::KeyValue(pkvd); CPointEntity::KeyValue(pkvd);
} }
void CLight::__MAKE_VHOOK(Spawn)() void CLight::Spawn()
{ {
// inert light // inert light
if (FStringNull(pev->targetname)) if (FStringNull(pev->targetname))
@ -61,7 +61,7 @@ void CLight::__MAKE_VHOOK(Spawn)()
} }
} }
void CLight::__MAKE_VHOOK(Restart)() void CLight::Restart()
{ {
if (m_iStyle >= 32) if (m_iStyle >= 32)
{ {
@ -82,7 +82,7 @@ void CLight::__MAKE_VHOOK(Restart)()
} }
} }
void CLight::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CLight::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
if (m_iStyle >= 32) if (m_iStyle >= 32)
{ {
@ -109,7 +109,7 @@ void CLight::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, US
LINK_ENTITY_TO_CLASS(light_spot, CLight, CCSLight) LINK_ENTITY_TO_CLASS(light_spot, CLight, CCSLight)
LINK_ENTITY_TO_CLASS(light_environment, CEnvLight, CCSEnvLight) LINK_ENTITY_TO_CLASS(light_environment, CEnvLight, CCSEnvLight)
void CEnvLight::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CEnvLight::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "_light")) if (FStrEq(pkvd->szKeyName, "_light"))
{ {
@ -145,7 +145,7 @@ void CEnvLight::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CLight::KeyValue(pkvd); CLight::KeyValue(pkvd);
} }
void CEnvLight::__MAKE_VHOOK(Spawn)() void CEnvLight::Spawn()
{ {
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
// NOTE: fix negative the values for function sprintf from STD C++: // NOTE: fix negative the values for function sprintf from STD C++:

View File

@ -44,17 +44,6 @@ public:
virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Restart_();
int Save_(CSave &save);
int Restore_(CRestore &restore);
void KeyValue_(KeyValueData *pkvd);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
static TYPEDESCRIPTION IMPL(m_SaveData)[2]; static TYPEDESCRIPTION IMPL(m_SaveData)[2];
private: private:
@ -68,14 +57,6 @@ class CEnvLight: public CLight
public: public:
virtual void Spawn(); virtual void Spawn();
virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
#ifdef HOOK_GAMEDLL
void Spawn_();
void KeyValue_(KeyValueData *pkvd);
#endif
}; };
#endif // LIGHT_H #endif // LIGHT_H

View File

@ -60,7 +60,7 @@ void CMapInfo::CheckMapInfo()
CSGameRules()->m_bTCantBuy = bTCantBuy; CSGameRules()->m_bTCantBuy = bTCantBuy;
} }
void CMapInfo::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CMapInfo::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "buying")) if (FStrEq(pkvd->szKeyName, "buying"))
{ {
@ -78,7 +78,7 @@ void CMapInfo::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
} }
} }
void CMapInfo::__MAKE_VHOOK(Spawn)() void CMapInfo::Spawn()
{ {
pev->movetype = MOVETYPE_NONE; pev->movetype = MOVETYPE_NONE;
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;

View File

@ -37,13 +37,6 @@ public:
virtual void UpdateOnRemove(); virtual void UpdateOnRemove();
void CheckMapInfo(); void CheckMapInfo();
#ifdef HOOK_GAMEDLL
void Spawn_();
void KeyValue_(KeyValueData *pkvd);
#endif
public: public:
InfoMapBuyParam m_iBuyingStatus; InfoMapBuyParam m_iBuyingStatus;
float m_flBombRadius; float m_flBombRadius;

View File

@ -29,14 +29,14 @@ TYPEDESCRIPTION CGamePlayerZone::m_SaveData[] =
IMPLEMENT_SAVERESTORE(CRuleEntity, CBaseEntity) IMPLEMENT_SAVERESTORE(CRuleEntity, CBaseEntity)
void CRuleEntity::__MAKE_VHOOK(Spawn)() void CRuleEntity::Spawn()
{ {
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
pev->movetype = MOVETYPE_NONE; pev->movetype = MOVETYPE_NONE;
pev->effects = EF_NODRAW; pev->effects = EF_NODRAW;
} }
void CRuleEntity::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CRuleEntity::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "master")) if (FStrEq(pkvd->szKeyName, "master"))
{ {
@ -60,14 +60,14 @@ BOOL CRuleEntity::CanFireForActivator(CBaseEntity *pActivator)
return TRUE; return TRUE;
} }
void CRulePointEntity::__MAKE_VHOOK(Spawn)() void CRulePointEntity::Spawn()
{ {
CRuleEntity::Spawn(); CRuleEntity::Spawn();
pev->frame = 0; pev->frame = 0;
pev->model = 0; pev->model = 0;
} }
void CRuleBrushEntity::__MAKE_VHOOK(Spawn)() void CRuleBrushEntity::Spawn()
{ {
SET_MODEL(edict(), STRING(pev->model)); SET_MODEL(edict(), STRING(pev->model));
CRuleEntity::Spawn(); CRuleEntity::Spawn();
@ -75,12 +75,12 @@ void CRuleBrushEntity::__MAKE_VHOOK(Spawn)()
LINK_ENTITY_TO_CLASS(game_score, CGameScore, CCSGameScore) LINK_ENTITY_TO_CLASS(game_score, CGameScore, CCSGameScore)
void CGameScore::__MAKE_VHOOK(Spawn)() void CGameScore::Spawn()
{ {
CRulePointEntity::Spawn(); CRulePointEntity::Spawn();
} }
void CGameScore::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CGameScore::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "points")) if (FStrEq(pkvd->szKeyName, "points"))
{ {
@ -91,7 +91,7 @@ void CGameScore::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CRulePointEntity::KeyValue(pkvd); CRulePointEntity::KeyValue(pkvd);
} }
void CGameScore::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CGameScore::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
if (!CanFireForActivator(pActivator)) if (!CanFireForActivator(pActivator))
return; return;
@ -112,7 +112,7 @@ void CGameScore::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller
LINK_ENTITY_TO_CLASS(game_end, CGameEnd, CCSGameEnd) LINK_ENTITY_TO_CLASS(game_end, CGameEnd, CCSGameEnd)
void CGameEnd::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CGameEnd::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
if (!CanFireForActivator(pActivator)) if (!CanFireForActivator(pActivator))
return; return;
@ -123,7 +123,7 @@ void CGameEnd::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller,
LINK_ENTITY_TO_CLASS(game_text, CGameText, CCSGameText) LINK_ENTITY_TO_CLASS(game_text, CGameText, CCSGameText)
IMPLEMENT_SAVERESTORE(CGameText, CRulePointEntity) IMPLEMENT_SAVERESTORE(CGameText, CRulePointEntity)
void CGameText::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CGameText::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "channel")) if (FStrEq(pkvd->szKeyName, "channel"))
{ {
@ -193,7 +193,7 @@ void CGameText::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CRulePointEntity::KeyValue(pkvd); CRulePointEntity::KeyValue(pkvd);
} }
void CGameText::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CGameText::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
if (!CanFireForActivator(pActivator)) if (!CanFireForActivator(pActivator))
return; return;
@ -213,7 +213,7 @@ void CGameText::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller,
LINK_ENTITY_TO_CLASS(game_team_master, CGameTeamMaster, CCSGameTeamMaster) LINK_ENTITY_TO_CLASS(game_team_master, CGameTeamMaster, CCSGameTeamMaster)
void CGameTeamMaster::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CGameTeamMaster::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "teamindex")) if (FStrEq(pkvd->szKeyName, "teamindex"))
{ {
@ -243,7 +243,7 @@ void CGameTeamMaster::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CRulePointEntity::KeyValue(pkvd); CRulePointEntity::KeyValue(pkvd);
} }
void CGameTeamMaster::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CGameTeamMaster::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
if (!CanFireForActivator(pActivator)) if (!CanFireForActivator(pActivator))
return; return;
@ -281,12 +281,12 @@ void CGameTeamMaster::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pC
} }
} }
BOOL CGameTeamMaster::__MAKE_VHOOK(IsTriggered)(CBaseEntity *pActivator) BOOL CGameTeamMaster::IsTriggered(CBaseEntity *pActivator)
{ {
return TeamMatch(pActivator); return TeamMatch(pActivator);
} }
const char *CGameTeamMaster::__MAKE_VHOOK(TeamID)() const char *CGameTeamMaster::TeamID()
{ {
// Currently set to "no team" // Currently set to "no team"
if (m_teamIndex < 0) if (m_teamIndex < 0)
@ -323,7 +323,7 @@ BOOL CGameTeamMaster::TeamMatch(CBaseEntity *pActivator)
LINK_ENTITY_TO_CLASS(game_team_set, CGameTeamSet, CCSGameTeamSet) LINK_ENTITY_TO_CLASS(game_team_set, CGameTeamSet, CCSGameTeamSet)
void CGameTeamSet::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CGameTeamSet::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
if (!CanFireForActivator(pActivator)) if (!CanFireForActivator(pActivator))
return; return;
@ -348,7 +348,7 @@ void CGameTeamSet::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCall
LINK_ENTITY_TO_CLASS(game_zone_player, CGamePlayerZone, CCSGamePlayerZone) LINK_ENTITY_TO_CLASS(game_zone_player, CGamePlayerZone, CCSGamePlayerZone)
IMPLEMENT_SAVERESTORE(CGamePlayerZone, CRuleBrushEntity) IMPLEMENT_SAVERESTORE(CGamePlayerZone, CRuleBrushEntity)
void CGamePlayerZone::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CGamePlayerZone::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "intarget")) if (FStrEq(pkvd->szKeyName, "intarget"))
{ {
@ -374,7 +374,7 @@ void CGamePlayerZone::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CRuleBrushEntity::KeyValue(pkvd); CRuleBrushEntity::KeyValue(pkvd);
} }
void CGamePlayerZone::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CGamePlayerZone::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
int playersInCount = 0; int playersInCount = 0;
int playersOutCount = 0; int playersOutCount = 0;
@ -432,7 +432,7 @@ void CGamePlayerZone::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pC
LINK_ENTITY_TO_CLASS(game_player_hurt, CGamePlayerHurt, CCSGamePlayerHurt) LINK_ENTITY_TO_CLASS(game_player_hurt, CGamePlayerHurt, CCSGamePlayerHurt)
void CGamePlayerHurt::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CGamePlayerHurt::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
if (!CanFireForActivator(pActivator)) if (!CanFireForActivator(pActivator))
return; return;
@ -455,14 +455,14 @@ void CGamePlayerHurt::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pC
LINK_ENTITY_TO_CLASS(game_counter, CGameCounter, CCSGameCounter) LINK_ENTITY_TO_CLASS(game_counter, CGameCounter, CCSGameCounter)
void CGameCounter::__MAKE_VHOOK(Spawn)() void CGameCounter::Spawn()
{ {
// Save off the initial count // Save off the initial count
SetInitialValue(CountValue()); SetInitialValue(CountValue());
CRulePointEntity::Spawn(); CRulePointEntity::Spawn();
} }
void CGameCounter::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CGameCounter::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
if (!CanFireForActivator(pActivator)) if (!CanFireForActivator(pActivator))
return; return;
@ -501,7 +501,7 @@ void CGameCounter::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCall
LINK_ENTITY_TO_CLASS(game_counter_set, CGameCounterSet, CCSGameCounterSet) LINK_ENTITY_TO_CLASS(game_counter_set, CGameCounterSet, CCSGameCounterSet)
void CGameCounterSet::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CGameCounterSet::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
if (!CanFireForActivator(pActivator)) if (!CanFireForActivator(pActivator))
return; return;
@ -516,7 +516,7 @@ void CGameCounterSet::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pC
LINK_ENTITY_TO_CLASS(game_player_equip, CGamePlayerEquip, CCSGamePlayerEquip) LINK_ENTITY_TO_CLASS(game_player_equip, CGamePlayerEquip, CCSGamePlayerEquip)
void CGamePlayerEquip::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CGamePlayerEquip::KeyValue(KeyValueData *pkvd)
{ {
CRulePointEntity::KeyValue(pkvd); CRulePointEntity::KeyValue(pkvd);
@ -540,7 +540,7 @@ void CGamePlayerEquip::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
} }
} }
void CGamePlayerEquip::__MAKE_VHOOK(Touch)(CBaseEntity *pOther) void CGamePlayerEquip::Touch(CBaseEntity *pOther)
{ {
if (!CanFireForActivator(pOther)) if (!CanFireForActivator(pOther))
return; return;
@ -581,7 +581,7 @@ void CGamePlayerEquip::EquipPlayer(CBaseEntity *pEntity)
} }
} }
void CGamePlayerEquip::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CGamePlayerEquip::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
EquipPlayer(pActivator); EquipPlayer(pActivator);
} }
@ -601,7 +601,7 @@ const char *CGamePlayerTeam::TargetTeamName(const char *pszTargetName)
return NULL; return NULL;
} }
void CGamePlayerTeam::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CGamePlayerTeam::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
if (!CanFireForActivator(pActivator)) if (!CanFireForActivator(pActivator))
return; return;

View File

@ -65,15 +65,6 @@ public:
virtual int Save(CSave &save); virtual int Save(CSave &save);
virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
#ifdef HOOK_GAMEDLL
void Spawn_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
#endif
public: public:
static TYPEDESCRIPTION IMPL(m_SaveData)[1]; static TYPEDESCRIPTION IMPL(m_SaveData)[1];
@ -91,13 +82,6 @@ class CRulePointEntity: public CRuleEntity
{ {
public: public:
virtual void Spawn(); virtual void Spawn();
#ifdef HOOK_GAMEDLL
void Spawn_();
#endif
}; };
// CRuleBrushEntity -- base class for all rule "brush" entities (not brushes) // CRuleBrushEntity -- base class for all rule "brush" entities (not brushes)
@ -106,13 +90,6 @@ class CRuleBrushEntity: public CRuleEntity
{ {
public: public:
virtual void Spawn(); virtual void Spawn();
#ifdef HOOK_GAMEDLL
void Spawn_();
#endif
}; };
// CGameScore / game_score -- award points to player / team // CGameScore / game_score -- award points to player / team
@ -126,14 +103,6 @@ public:
virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
void KeyValue_(KeyValueData *pkvd);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
int Points() const { return int(pev->frags); } int Points() const { return int(pev->frags); }
BOOL AllowNegativeScore() { return pev->spawnflags & SF_SCORE_NEGATIVE; } BOOL AllowNegativeScore() { return pev->spawnflags & SF_SCORE_NEGATIVE; }
@ -147,13 +116,6 @@ class CGameEnd: public CRulePointEntity
{ {
public: public:
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
}; };
// CGameText / game_text -- NON-Localized HUD Message (use env_message to display a titles.txt message) // CGameText / game_text -- NON-Localized HUD Message (use env_message to display a titles.txt message)
@ -166,15 +128,6 @@ public:
virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
BOOL MessageToAll() const { return (pev->spawnflags & SF_ENVTEXT_ALLPLAYERS) == SF_ENVTEXT_ALLPLAYERS; } BOOL MessageToAll() const { return (pev->spawnflags & SF_ENVTEXT_ALLPLAYERS) == SF_ENVTEXT_ALLPLAYERS; }
void MessageSet(const char *pMessage) { pev->message = ALLOC_STRING(pMessage); } void MessageSet(const char *pMessage) { pev->message = ALLOC_STRING(pMessage); }
@ -202,15 +155,6 @@ public:
virtual const char *TeamID(); virtual const char *TeamID();
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void KeyValue_(KeyValueData *pkvd);
BOOL IsTriggered_(CBaseEntity *pActivator);
const char *TeamID_();
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
BOOL RemoveOnFire() const { return (pev->spawnflags & SF_TEAMMASTER_FIREONCE) == SF_TEAMMASTER_FIREONCE; } BOOL RemoveOnFire() const { return (pev->spawnflags & SF_TEAMMASTER_FIREONCE) == SF_TEAMMASTER_FIREONCE; }
BOOL AnyTeam() const { return (pev->spawnflags & SF_TEAMMASTER_ANYTEAM) == SF_TEAMMASTER_ANYTEAM; } BOOL AnyTeam() const { return (pev->spawnflags & SF_TEAMMASTER_ANYTEAM) == SF_TEAMMASTER_ANYTEAM; }
@ -231,12 +175,6 @@ class CGameTeamSet: public CRulePointEntity
public: public:
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
BOOL RemoveOnFire() const { return (pev->spawnflags & SF_TEAMSET_FIREONCE) == SF_TEAMSET_FIREONCE; } BOOL RemoveOnFire() const { return (pev->spawnflags & SF_TEAMSET_FIREONCE) == SF_TEAMSET_FIREONCE; }
BOOL ShouldClearTeam() const { return (pev->spawnflags & SF_TEAMSET_CLEARTEAM) == SF_TEAMSET_CLEARTEAM; } BOOL ShouldClearTeam() const { return (pev->spawnflags & SF_TEAMSET_CLEARTEAM) == SF_TEAMSET_CLEARTEAM; }
@ -252,15 +190,6 @@ public:
virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
static TYPEDESCRIPTION IMPL(m_SaveData)[4]; static TYPEDESCRIPTION IMPL(m_SaveData)[4];
@ -278,12 +207,6 @@ class CGamePlayerHurt: public CRulePointEntity
public: public:
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
BOOL RemoveOnFire() const { return (pev->spawnflags & SF_PKILL_FIREONCE) == SF_PKILL_FIREONCE; } BOOL RemoveOnFire() const { return (pev->spawnflags & SF_PKILL_FIREONCE) == SF_PKILL_FIREONCE; }
}; };
@ -297,13 +220,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
BOOL RemoveOnFire() const { return (pev->spawnflags & SF_GAMECOUNT_FIREONCE) == SF_GAMECOUNT_FIREONCE; } BOOL RemoveOnFire() const { return (pev->spawnflags & SF_GAMECOUNT_FIREONCE) == SF_GAMECOUNT_FIREONCE; }
BOOL ResetOnFire() const { return (pev->spawnflags & SF_GAMECOUNT_RESET) == SF_GAMECOUNT_RESET; } BOOL ResetOnFire() const { return (pev->spawnflags & SF_GAMECOUNT_RESET) == SF_GAMECOUNT_RESET; }
@ -328,12 +244,6 @@ class CGameCounterSet: public CRulePointEntity
public: public:
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
BOOL RemoveOnFire() const { return (pev->spawnflags & SF_GAMECOUNTSET_FIREONCE) == SF_GAMECOUNTSET_FIREONCE; } BOOL RemoveOnFire() const { return (pev->spawnflags & SF_GAMECOUNTSET_FIREONCE) == SF_GAMECOUNTSET_FIREONCE; }
}; };
@ -347,14 +257,6 @@ public:
virtual void Touch(CBaseEntity *pOther); virtual void Touch(CBaseEntity *pOther);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void KeyValue_(KeyValueData *pkvd);
void Touch_(CBaseEntity *pOther);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
BOOL UseOnly() const { return (pev->spawnflags & SF_PLAYEREQUIP_USEONLY) == SF_PLAYEREQUIP_USEONLY; } BOOL UseOnly() const { return (pev->spawnflags & SF_PLAYEREQUIP_USEONLY) == SF_PLAYEREQUIP_USEONLY; }
@ -375,12 +277,6 @@ class CGamePlayerTeam: public CRulePointEntity
public: public:
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
private: private:
BOOL RemoveOnFire() const { return (pev->spawnflags & SF_PTEAM_FIREONCE) == SF_PTEAM_FIREONCE; } BOOL RemoveOnFire() const { return (pev->spawnflags & SF_PTEAM_FIREONCE) == SF_PTEAM_FIREONCE; }
BOOL ShouldKillPlayer() const { return (pev->spawnflags & SF_PTEAM_KILL) == SF_PTEAM_KILL; } BOOL ShouldKillPlayer() const { return (pev->spawnflags & SF_PTEAM_KILL) == SF_PTEAM_KILL; }

View File

@ -20,7 +20,7 @@ TYPEDESCRIPTION CFuncMortarField::m_SaveData[] =
LINK_ENTITY_TO_CLASS(func_mortar_field, CFuncMortarField, CCSFuncMortarField) LINK_ENTITY_TO_CLASS(func_mortar_field, CFuncMortarField, CCSFuncMortarField)
IMPLEMENT_SAVERESTORE(CFuncMortarField, CBaseToggle) IMPLEMENT_SAVERESTORE(CFuncMortarField, CBaseToggle)
void CFuncMortarField::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CFuncMortarField::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "m_iszXController")) if (FStrEq(pkvd->szKeyName, "m_iszXController"))
{ {
@ -50,7 +50,7 @@ void CFuncMortarField::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
} }
// Drop bombs from above // Drop bombs from above
void CFuncMortarField::__MAKE_VHOOK(Spawn)() void CFuncMortarField::Spawn()
{ {
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
@ -63,7 +63,7 @@ void CFuncMortarField::__MAKE_VHOOK(Spawn)()
Precache(); Precache();
} }
void CFuncMortarField::__MAKE_VHOOK(Precache)() void CFuncMortarField::Precache()
{ {
PRECACHE_SOUND("weapons/mortar.wav"); PRECACHE_SOUND("weapons/mortar.wav");
PRECACHE_SOUND("weapons/mortarhit.wav"); PRECACHE_SOUND("weapons/mortarhit.wav");
@ -155,7 +155,7 @@ void CFuncMortarField::FieldUse(CBaseEntity *pActivator, CBaseEntity *pCaller, U
LINK_ENTITY_TO_CLASS(monster_mortar, CMortar, CCSMortar) LINK_ENTITY_TO_CLASS(monster_mortar, CMortar, CCSMortar)
void CMortar::__MAKE_VHOOK(Spawn)() void CMortar::Spawn()
{ {
pev->movetype = MOVETYPE_NONE; pev->movetype = MOVETYPE_NONE;
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
@ -166,7 +166,7 @@ void CMortar::__MAKE_VHOOK(Spawn)()
Precache(); Precache();
} }
void CMortar::__MAKE_VHOOK(Precache)() void CMortar::Precache()
{ {
m_spriteTexture = PRECACHE_MODEL("sprites/lgtning.spr"); m_spriteTexture = PRECACHE_MODEL("sprites/lgtning.spr");
} }

View File

@ -44,16 +44,6 @@ public:
// Bmodels don't go across transitions // Bmodels don't go across transitions
virtual int ObjectCaps() { return CBaseToggle::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; } virtual int ObjectCaps() { return CBaseToggle::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
#endif
public: public:
void EXPORT FieldUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); void EXPORT FieldUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
@ -74,13 +64,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void Precache(); virtual void Precache();
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
#endif
void EXPORT MortarExplode(); void EXPORT MortarExplode();
public: public:

View File

@ -42,7 +42,7 @@ int CGraph::FindNearestNode(const Vector &vecOrigin, CBaseEntity *pEntity)
return 0; return 0;
} }
float CBaseMonster::__MAKE_VHOOK(ChangeYaw)(int speed) float CBaseMonster::ChangeYaw(int speed)
{ {
return 0.0f; return 0.0f;
} }
@ -66,7 +66,7 @@ NOXREF void CBaseMonster::CorpseFallThink()
pev->nextthink = gpGlobals->time + 0.1f; pev->nextthink = gpGlobals->time + 0.1f;
} }
void CBaseMonster::__MAKE_VHOOK(MonsterInitDead)() void CBaseMonster::MonsterInitDead()
{ {
InitBoneControllers(); InitBoneControllers();
@ -88,7 +88,7 @@ void CBaseMonster::__MAKE_VHOOK(MonsterInitDead)()
pev->nextthink = gpGlobals->time + 0.5f; pev->nextthink = gpGlobals->time + 0.5f;
} }
BOOL CBaseMonster::__MAKE_VHOOK(ShouldFadeOnDeath)() BOOL CBaseMonster::ShouldFadeOnDeath()
{ {
return FALSE; return FALSE;
} }
@ -98,12 +98,12 @@ BOOL CBaseMonster::FCheckAITrigger()
return FALSE; return FALSE;
} }
void CBaseMonster::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CBaseMonster::KeyValue(KeyValueData *pkvd)
{ {
CBaseToggle::KeyValue(pkvd); CBaseToggle::KeyValue(pkvd);
} }
int CBaseMonster::__MAKE_VHOOK(IRelationship)(CBaseEntity *pTarget) int CBaseMonster::IRelationship(CBaseEntity *pTarget)
{ {
static int const iEnemy[14][14] = static int const iEnemy[14][14] =
{ {
@ -136,7 +136,7 @@ int CBaseMonster::__MAKE_VHOOK(IRelationship)(CBaseEntity *pTarget)
// Function also sets the Looker's m_pLink // Function also sets the Looker's m_pLink
// to the head of a link list that contains all visible ents. // to the head of a link list that contains all visible ents.
// (linked via each ent's m_pLink field) // (linked via each ent's m_pLink field)
void CBaseMonster::__MAKE_VHOOK(Look)(int iDistance) void CBaseMonster::Look(int iDistance)
{ {
int iSighted = 0; int iSighted = 0;
@ -213,7 +213,7 @@ void CBaseMonster::__MAKE_VHOOK(Look)(int iDistance)
// //
// UNDONE: currently, this only returns the closest enemy. // UNDONE: currently, this only returns the closest enemy.
// we'll want to consider distance, relationship, attack types, back turned, etc. // we'll want to consider distance, relationship, attack types, back turned, etc.
CBaseEntity *CBaseMonster::__MAKE_VHOOK(BestVisibleEnemy)() CBaseEntity *CBaseMonster::BestVisibleEnemy()
{ {
CBaseEntity *pReturn; CBaseEntity *pReturn;
CBaseEntity *pNextEnt; CBaseEntity *pNextEnt;

View File

@ -179,7 +179,7 @@ BOOL CHalfLifeMultiplay::IsCareer()
LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN2(CHalfLifeMultiplay, CSGameRules, ServerDeactivate) LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN2(CHalfLifeMultiplay, CSGameRules, ServerDeactivate)
void EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(ServerDeactivate)() void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(ServerDeactivate)()
{ {
if (!IsCareer()) if (!IsCareer())
{ {
@ -191,7 +191,7 @@ void EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(ServerDeactivate)()
UTIL_LogPrintf("Career End\n"); UTIL_LogPrintf("Career End\n");
} }
bool CCStrikeGameMgrHelper::__MAKE_VHOOK(CanPlayerHearPlayer)(CBasePlayer *pListener, CBasePlayer *pSender) bool CCStrikeGameMgrHelper::CanPlayerHearPlayer(CBasePlayer *pListener, CBasePlayer *pSender)
{ {
if ( if (
#ifndef REGAMEDLL_FIXES #ifndef REGAMEDLL_FIXES
@ -611,7 +611,7 @@ CHalfLifeMultiplay::CHalfLifeMultiplay()
#endif #endif
} }
void CHalfLifeMultiplay::__MAKE_VHOOK(RefreshSkillData)() void CHalfLifeMultiplay::RefreshSkillData()
{ {
// load all default values // load all default values
CGameRules::RefreshSkillData(); CGameRules::RefreshSkillData();
@ -644,7 +644,7 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(RefreshSkillData)()
LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN2(CHalfLifeMultiplay, CSGameRules, RemoveGuns) LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN2(CHalfLifeMultiplay, CSGameRules, RemoveGuns)
void EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(RemoveGuns)() void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(RemoveGuns)()
{ {
CBaseEntity *toremove = NULL; CBaseEntity *toremove = NULL;
@ -675,9 +675,11 @@ void CHalfLifeMultiplay::UpdateTeamScores()
LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN2(CHalfLifeMultiplay, CSGameRules, CleanUpMap) LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN2(CHalfLifeMultiplay, CSGameRules, CleanUpMap)
void EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(CleanUpMap)() void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(CleanUpMap)()
{ {
#ifdef REGAMEDLL_FIXES #ifdef REGAMEDLL_FIXES
UTIL_RestartOther("multi_manager");
// Release or reset everything entities in depending of flags ObjectCaps // Release or reset everything entities in depending of flags ObjectCaps
// (FCAP_MUST_RESET / FCAP_MUST_RELEASE) // (FCAP_MUST_RESET / FCAP_MUST_RELEASE)
UTIL_ResetEntities(); UTIL_ResetEntities();
@ -703,7 +705,6 @@ void EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(CleanUpMap)()
UTIL_RestartOther("func_button"); UTIL_RestartOther("func_button");
UTIL_RestartOther("trigger_auto"); UTIL_RestartOther("trigger_auto");
UTIL_RestartOther("trigger_once"); UTIL_RestartOther("trigger_once");
UTIL_RestartOther("multi_manager");
#endif #endif
// Remove grenades and C4 // Remove grenades and C4
@ -735,7 +736,7 @@ void EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(CleanUpMap)()
LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN2(CHalfLifeMultiplay, CSGameRules, GiveC4) LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN2(CHalfLifeMultiplay, CSGameRules, GiveC4)
void EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(GiveC4)() void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(GiveC4)()
{ {
int iTeamCount; int iTeamCount;
int iTemp = 0; int iTemp = 0;
@ -927,7 +928,7 @@ void CHalfLifeMultiplay::QueueCareerRoundEndMenu(float tmDelay, int iWinStatus)
LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN2(CHalfLifeMultiplay, CSGameRules, CheckWinConditions) LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN2(CHalfLifeMultiplay, CSGameRules, CheckWinConditions)
// Check if the scenario has been won/lost. // Check if the scenario has been won/lost.
void EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(CheckWinConditions)() void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(CheckWinConditions)()
{ {
if (HasRoundInfinite()) if (HasRoundInfinite())
return; return;
@ -1637,7 +1638,7 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(BalanceTeams)()
LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN2(CHalfLifeMultiplay, CSGameRules, CheckMapConditions) LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN2(CHalfLifeMultiplay, CSGameRules, CheckMapConditions)
void EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(CheckMapConditions)() void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(CheckMapConditions)()
{ {
// Check to see if this map has a bomb target in it // Check to see if this map has a bomb target in it
if (UTIL_FindEntityByClassname(NULL, "func_bomb_target")) if (UTIL_FindEntityByClassname(NULL, "func_bomb_target"))
@ -1672,7 +1673,7 @@ void EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(CheckMapConditions)()
LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN2(CHalfLifeMultiplay, CSGameRules, RestartRound) LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN2(CHalfLifeMultiplay, CSGameRules, RestartRound)
void EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(RestartRound)() void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(RestartRound)()
{ {
// tell bots that the round is restarting // tell bots that the round is restarting
if (TheBots) if (TheBots)
@ -2371,7 +2372,7 @@ void CHalfLifeMultiplay::PickNextVIP()
} }
} }
void CHalfLifeMultiplay::__MAKE_VHOOK(Think)() void CHalfLifeMultiplay::Think()
{ {
MonitorTutorStatus(); MonitorTutorStatus();
m_VoiceGameMgr.Update(gpGlobals->frametime); m_VoiceGameMgr.Update(gpGlobals->frametime);
@ -3200,24 +3201,24 @@ void CHalfLifeMultiplay::CareerRestart()
} }
} }
BOOL CHalfLifeMultiplay::__MAKE_VHOOK(IsMultiplayer)() BOOL CHalfLifeMultiplay::IsMultiplayer()
{ {
return TRUE; return TRUE;
} }
BOOL CHalfLifeMultiplay::__MAKE_VHOOK(IsDeathmatch)() BOOL CHalfLifeMultiplay::IsDeathmatch()
{ {
return TRUE; return TRUE;
} }
BOOL CHalfLifeMultiplay::__MAKE_VHOOK(IsCoOp)() BOOL CHalfLifeMultiplay::IsCoOp()
{ {
return gpGlobals->coop; return gpGlobals->coop;
} }
LINK_HOOK_CLASS_CUSTOM_CHAIN(BOOL, CHalfLifeMultiplay, CSGameRules, FShouldSwitchWeapon, (CBasePlayer *pPlayer, CBasePlayerItem *pWeapon), pPlayer, pWeapon) LINK_HOOK_CLASS_CUSTOM_CHAIN(BOOL, CHalfLifeMultiplay, CSGameRules, FShouldSwitchWeapon, (CBasePlayer *pPlayer, CBasePlayerItem *pWeapon), pPlayer, pWeapon)
BOOL EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(FShouldSwitchWeapon)(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon) BOOL EXT_FUNC CHalfLifeMultiplay::__API_HOOK(FShouldSwitchWeapon)(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon)
{ {
if (!pWeapon->CanDeploy()) if (!pWeapon->CanDeploy())
return FALSE; return FALSE;
@ -3239,7 +3240,7 @@ BOOL EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(FShouldSwitchWeapon)(CBasePlayer *
LINK_HOOK_CLASS_CUSTOM_CHAIN(BOOL, CHalfLifeMultiplay, CSGameRules, GetNextBestWeapon, (CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeapon), pPlayer, pCurrentWeapon) LINK_HOOK_CLASS_CUSTOM_CHAIN(BOOL, CHalfLifeMultiplay, CSGameRules, GetNextBestWeapon, (CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeapon), pPlayer, pCurrentWeapon)
BOOL EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(GetNextBestWeapon)(CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeapon) BOOL EXT_FUNC CHalfLifeMultiplay::__API_HOOK(GetNextBestWeapon)(CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeapon)
{ {
CBasePlayerItem *pCheck; CBasePlayerItem *pCheck;
CBasePlayerItem *pBest; // this will be used in the event that we don't find a weapon in the same category. CBasePlayerItem *pBest; // this will be used in the event that we don't find a weapon in the same category.
@ -3295,30 +3296,30 @@ BOOL EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(GetNextBestWeapon)(CBasePlayer *pP
return TRUE; return TRUE;
} }
BOOL CHalfLifeMultiplay::__MAKE_VHOOK(ClientCommand_DeadOrAlive)(CBasePlayer *pPlayer, const char *pcmd) BOOL CHalfLifeMultiplay::ClientCommand_DeadOrAlive(CBasePlayer *pPlayer, const char *pcmd)
{ {
return m_VoiceGameMgr.ClientCommand(pPlayer, pcmd); return m_VoiceGameMgr.ClientCommand(pPlayer, pcmd);
} }
BOOL CHalfLifeMultiplay::__MAKE_VHOOK(ClientCommand)(CBasePlayer *pPlayer, const char *pcmd) BOOL CHalfLifeMultiplay::ClientCommand(CBasePlayer *pPlayer, const char *pcmd)
{ {
return FALSE; return FALSE;
} }
BOOL CHalfLifeMultiplay::__MAKE_VHOOK(ClientConnected)(edict_t *pEntity, const char *pszName, const char *pszAddress, char *szRejectReason) BOOL CHalfLifeMultiplay::ClientConnected(edict_t *pEntity, const char *pszName, const char *pszAddress, char *szRejectReason)
{ {
m_VoiceGameMgr.ClientConnected(pEntity); m_VoiceGameMgr.ClientConnected(pEntity);
return TRUE; return TRUE;
} }
void CHalfLifeMultiplay::__MAKE_VHOOK(UpdateGameMode)(CBasePlayer *pPlayer) void CHalfLifeMultiplay::UpdateGameMode(CBasePlayer *pPlayer)
{ {
MESSAGE_BEGIN(MSG_ONE, gmsgGameMode, NULL, pPlayer->edict()); MESSAGE_BEGIN(MSG_ONE, gmsgGameMode, NULL, pPlayer->edict());
WRITE_BYTE(1); WRITE_BYTE(1);
MESSAGE_END(); MESSAGE_END();
} }
void CHalfLifeMultiplay::__MAKE_VHOOK(InitHUD)(CBasePlayer *pl) void CHalfLifeMultiplay::InitHUD(CBasePlayer *pl)
{ {
int i; int i;
@ -3488,7 +3489,7 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(InitHUD)(CBasePlayer *pl)
#endif #endif
} }
void CHalfLifeMultiplay::__MAKE_VHOOK(ClientDisconnected)(edict_t *pClient) void CHalfLifeMultiplay::ClientDisconnected(edict_t *pClient)
{ {
if (pClient) if (pClient)
{ {
@ -3584,7 +3585,7 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(ClientDisconnected)(edict_t *pClient)
LINK_HOOK_CLASS_CUSTOM_CHAIN(float, CHalfLifeMultiplay, CSGameRules, FlPlayerFallDamage, (CBasePlayer *pPlayer), pPlayer) LINK_HOOK_CLASS_CUSTOM_CHAIN(float, CHalfLifeMultiplay, CSGameRules, FlPlayerFallDamage, (CBasePlayer *pPlayer), pPlayer)
float EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(FlPlayerFallDamage)(CBasePlayer *pPlayer) float EXT_FUNC CHalfLifeMultiplay::__API_HOOK(FlPlayerFallDamage)(CBasePlayer *pPlayer)
{ {
pPlayer->m_flFallVelocity -= PLAYER_MAX_SAFE_FALL_SPEED; pPlayer->m_flFallVelocity -= PLAYER_MAX_SAFE_FALL_SPEED;
return pPlayer->m_flFallVelocity * DAMAGE_FOR_FALL_SPEED * 1.25; return pPlayer->m_flFallVelocity * DAMAGE_FOR_FALL_SPEED * 1.25;
@ -3592,7 +3593,7 @@ float EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(FlPlayerFallDamage)(CBasePlayer *
LINK_HOOK_CLASS_CUSTOM_CHAIN(BOOL, CHalfLifeMultiplay, CSGameRules, FPlayerCanTakeDamage, (CBasePlayer *pPlayer, CBaseEntity *pAttacker), pPlayer, pAttacker) LINK_HOOK_CLASS_CUSTOM_CHAIN(BOOL, CHalfLifeMultiplay, CSGameRules, FPlayerCanTakeDamage, (CBasePlayer *pPlayer, CBaseEntity *pAttacker), pPlayer, pAttacker)
BOOL EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(FPlayerCanTakeDamage)(CBasePlayer *pPlayer, CBaseEntity *pAttacker) BOOL EXT_FUNC CHalfLifeMultiplay::__API_HOOK(FPlayerCanTakeDamage)(CBasePlayer *pPlayer, CBaseEntity *pAttacker)
{ {
if (!pAttacker || PlayerRelationship(pPlayer, pAttacker) != GR_TEAMMATE) if (!pAttacker || PlayerRelationship(pPlayer, pAttacker) != GR_TEAMMATE)
{ {
@ -3607,7 +3608,7 @@ BOOL EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(FPlayerCanTakeDamage)(CBasePlayer
return FALSE; return FALSE;
} }
void CHalfLifeMultiplay::__MAKE_VHOOK(PlayerThink)(CBasePlayer *pPlayer) void CHalfLifeMultiplay::PlayerThink(CBasePlayer *pPlayer)
{ {
if (m_bGameOver) if (m_bGameOver)
{ {
@ -3708,7 +3709,7 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(PlayerThink)(CBasePlayer *pPlayer)
LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN(CHalfLifeMultiplay, CSGameRules, PlayerSpawn, (CBasePlayer *pPlayer), pPlayer) LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN(CHalfLifeMultiplay, CSGameRules, PlayerSpawn, (CBasePlayer *pPlayer), pPlayer)
// Purpose: Player has just spawned. Equip them. // Purpose: Player has just spawned. Equip them.
void EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(PlayerSpawn)(CBasePlayer *pPlayer) void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(PlayerSpawn)(CBasePlayer *pPlayer)
{ {
// This is tied to the joining state (m_iJoiningState).. add it when the joining state is there. // This is tied to the joining state (m_iJoiningState).. add it when the joining state is there.
if (pPlayer->m_bJustConnected) if (pPlayer->m_bJustConnected)
@ -3721,7 +3722,7 @@ void EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(PlayerSpawn)(CBasePlayer *pPlayer)
LINK_HOOK_CLASS_CUSTOM_CHAIN(BOOL, CHalfLifeMultiplay, CSGameRules, FPlayerCanRespawn, (CBasePlayer *pPlayer), pPlayer) LINK_HOOK_CLASS_CUSTOM_CHAIN(BOOL, CHalfLifeMultiplay, CSGameRules, FPlayerCanRespawn, (CBasePlayer *pPlayer), pPlayer)
BOOL EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(FPlayerCanRespawn)(CBasePlayer *pPlayer) BOOL EXT_FUNC CHalfLifeMultiplay::__API_HOOK(FPlayerCanRespawn)(CBasePlayer *pPlayer)
{ {
#ifdef REGAMEDLL_ADD #ifdef REGAMEDLL_ADD
if (forcerespawn.value <= 0) if (forcerespawn.value <= 0)
@ -3776,26 +3777,26 @@ BOOL EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(FPlayerCanRespawn)(CBasePlayer *pP
return TRUE; return TRUE;
} }
float CHalfLifeMultiplay::__MAKE_VHOOK(FlPlayerSpawnTime)(CBasePlayer *pPlayer) float CHalfLifeMultiplay::FlPlayerSpawnTime(CBasePlayer *pPlayer)
{ {
return gpGlobals->time; return gpGlobals->time;
} }
BOOL CHalfLifeMultiplay::__MAKE_VHOOK(AllowAutoTargetCrosshair)() BOOL CHalfLifeMultiplay::AllowAutoTargetCrosshair()
{ {
return FALSE; return FALSE;
} }
// IPointsForKill - how many points awarded to anyone // IPointsForKill - how many points awarded to anyone
// that kills this player? // that kills this player?
int CHalfLifeMultiplay::__MAKE_VHOOK(IPointsForKill)(CBasePlayer *pAttacker, CBasePlayer *pKilled) int CHalfLifeMultiplay::IPointsForKill(CBasePlayer *pAttacker, CBasePlayer *pKilled)
{ {
return 1; return 1;
} }
LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN(CHalfLifeMultiplay, CSGameRules, PlayerKilled, (CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor), pVictim, pKiller, pInflictor) LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN(CHalfLifeMultiplay, CSGameRules, PlayerKilled, (CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor), pVictim, pKiller, pInflictor)
void EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(PlayerKilled)(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor) void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(PlayerKilled)(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor)
{ {
DeathNotice(pVictim, pKiller, pInflictor); DeathNotice(pVictim, pKiller, pInflictor);
@ -3947,7 +3948,7 @@ void EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(PlayerKilled)(CBasePlayer *pVictim
LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN(CHalfLifeMultiplay, CSGameRules, DeathNotice, (CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pevInflictor), pVictim, pKiller, pevInflictor) LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN(CHalfLifeMultiplay, CSGameRules, DeathNotice, (CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pevInflictor), pVictim, pKiller, pevInflictor)
void EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(DeathNotice)(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pevInflictor) void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(DeathNotice)(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pevInflictor)
{ {
// Work out what killed the player, and send a message to all clients about it // Work out what killed the player, and send a message to all clients about it
// CBaseEntity *Killer = CBaseEntity::Instance(pKiller); // CBaseEntity *Killer = CBaseEntity::Instance(pKiller);
@ -4078,21 +4079,21 @@ void EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(DeathNotice)(CBasePlayer *pVictim,
// PlayerGotWeapon - player has grabbed a weapon that was // PlayerGotWeapon - player has grabbed a weapon that was
// sitting in the world // sitting in the world
void CHalfLifeMultiplay::__MAKE_VHOOK(PlayerGotWeapon)(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon) void CHalfLifeMultiplay::PlayerGotWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon)
{ {
; ;
} }
// FlWeaponRespawnTime - what is the time in the future // FlWeaponRespawnTime - what is the time in the future
// at which this weapon may spawn? // at which this weapon may spawn?
float CHalfLifeMultiplay::__MAKE_VHOOK(FlWeaponRespawnTime)(CBasePlayerItem *pWeapon) float CHalfLifeMultiplay::FlWeaponRespawnTime(CBasePlayerItem *pWeapon)
{ {
return gpGlobals->time + WEAPON_RESPAWN_TIME; return gpGlobals->time + WEAPON_RESPAWN_TIME;
} }
// FlWeaponRespawnTime - Returns 0 if the weapon can respawn now, // FlWeaponRespawnTime - Returns 0 if the weapon can respawn now,
// otherwise it returns the time at which it can try to spawn again. // otherwise it returns the time at which it can try to spawn again.
float CHalfLifeMultiplay::__MAKE_VHOOK(FlWeaponTryRespawn)(CBasePlayerItem *pWeapon) float CHalfLifeMultiplay::FlWeaponTryRespawn(CBasePlayerItem *pWeapon)
{ {
if (pWeapon && pWeapon->m_iId && (pWeapon->iFlags() & ITEM_FLAG_LIMITINWORLD)) if (pWeapon && pWeapon->m_iId && (pWeapon->iFlags() & ITEM_FLAG_LIMITINWORLD))
{ {
@ -4106,12 +4107,12 @@ float CHalfLifeMultiplay::__MAKE_VHOOK(FlWeaponTryRespawn)(CBasePlayerItem *pWea
return 0; return 0;
} }
Vector CHalfLifeMultiplay::__MAKE_VHOOK(VecWeaponRespawnSpot)(CBasePlayerItem *pWeapon) Vector CHalfLifeMultiplay::VecWeaponRespawnSpot(CBasePlayerItem *pWeapon)
{ {
return pWeapon->pev->origin; return pWeapon->pev->origin;
} }
int CHalfLifeMultiplay::__MAKE_VHOOK(WeaponShouldRespawn)(CBasePlayerItem *pWeapon) int CHalfLifeMultiplay::WeaponShouldRespawn(CBasePlayerItem *pWeapon)
{ {
if (pWeapon->pev->spawnflags & SF_NORESPAWN) if (pWeapon->pev->spawnflags & SF_NORESPAWN)
{ {
@ -4123,22 +4124,22 @@ int CHalfLifeMultiplay::__MAKE_VHOOK(WeaponShouldRespawn)(CBasePlayerItem *pWeap
LINK_HOOK_CLASS_CUSTOM_CHAIN(BOOL, CHalfLifeMultiplay, CSGameRules, CanHavePlayerItem, (CBasePlayer *pPlayer, CBasePlayerItem *pItem), pPlayer, pItem) LINK_HOOK_CLASS_CUSTOM_CHAIN(BOOL, CHalfLifeMultiplay, CSGameRules, CanHavePlayerItem, (CBasePlayer *pPlayer, CBasePlayerItem *pItem), pPlayer, pItem)
BOOL EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(CanHavePlayerItem)(CBasePlayer *pPlayer, CBasePlayerItem *pItem) BOOL EXT_FUNC CHalfLifeMultiplay::__API_HOOK(CanHavePlayerItem)(CBasePlayer *pPlayer, CBasePlayerItem *pItem)
{ {
return CGameRules::CanHavePlayerItem(pPlayer, pItem); return CGameRules::CanHavePlayerItem(pPlayer, pItem);
} }
BOOL CHalfLifeMultiplay::__MAKE_VHOOK(CanHaveItem)(CBasePlayer *pPlayer, CItem *pItem) BOOL CHalfLifeMultiplay::CanHaveItem(CBasePlayer *pPlayer, CItem *pItem)
{ {
return TRUE; return TRUE;
} }
void CHalfLifeMultiplay::__MAKE_VHOOK(PlayerGotItem)(CBasePlayer *pPlayer, CItem *pItem) void CHalfLifeMultiplay::PlayerGotItem(CBasePlayer *pPlayer, CItem *pItem)
{ {
; ;
} }
int CHalfLifeMultiplay::__MAKE_VHOOK(ItemShouldRespawn)(CItem *pItem) int CHalfLifeMultiplay::ItemShouldRespawn(CItem *pItem)
{ {
if (pItem->pev->spawnflags & SF_NORESPAWN) if (pItem->pev->spawnflags & SF_NORESPAWN)
{ {
@ -4148,27 +4149,27 @@ int CHalfLifeMultiplay::__MAKE_VHOOK(ItemShouldRespawn)(CItem *pItem)
return GR_ITEM_RESPAWN_YES; return GR_ITEM_RESPAWN_YES;
} }
float CHalfLifeMultiplay::__MAKE_VHOOK(FlItemRespawnTime)(CItem *pItem) float CHalfLifeMultiplay::FlItemRespawnTime(CItem *pItem)
{ {
return gpGlobals->time + ITEM_RESPAWN_TIME; return gpGlobals->time + ITEM_RESPAWN_TIME;
} }
Vector CHalfLifeMultiplay::__MAKE_VHOOK(VecItemRespawnSpot)(CItem *pItem) Vector CHalfLifeMultiplay::VecItemRespawnSpot(CItem *pItem)
{ {
return pItem->pev->origin; return pItem->pev->origin;
} }
void CHalfLifeMultiplay::__MAKE_VHOOK(PlayerGotAmmo)(CBasePlayer *pPlayer, char *szName, int iCount) void CHalfLifeMultiplay::PlayerGotAmmo(CBasePlayer *pPlayer, char *szName, int iCount)
{ {
; ;
} }
BOOL CHalfLifeMultiplay::__MAKE_VHOOK(IsAllowedToSpawn)(CBaseEntity *pEntity) BOOL CHalfLifeMultiplay::IsAllowedToSpawn(CBaseEntity *pEntity)
{ {
return TRUE; return TRUE;
} }
int CHalfLifeMultiplay::__MAKE_VHOOK(AmmoShouldRespawn)(CBasePlayerAmmo *pAmmo) int CHalfLifeMultiplay::AmmoShouldRespawn(CBasePlayerAmmo *pAmmo)
{ {
if (pAmmo->pev->spawnflags & SF_NORESPAWN) if (pAmmo->pev->spawnflags & SF_NORESPAWN)
{ {
@ -4178,41 +4179,41 @@ int CHalfLifeMultiplay::__MAKE_VHOOK(AmmoShouldRespawn)(CBasePlayerAmmo *pAmmo)
return GR_AMMO_RESPAWN_YES; return GR_AMMO_RESPAWN_YES;
} }
float CHalfLifeMultiplay::__MAKE_VHOOK(FlAmmoRespawnTime)(CBasePlayerAmmo *pAmmo) float CHalfLifeMultiplay::FlAmmoRespawnTime(CBasePlayerAmmo *pAmmo)
{ {
return gpGlobals->time + 20.0f; return gpGlobals->time + 20.0f;
} }
Vector CHalfLifeMultiplay::__MAKE_VHOOK(VecAmmoRespawnSpot)(CBasePlayerAmmo *pAmmo) Vector CHalfLifeMultiplay::VecAmmoRespawnSpot(CBasePlayerAmmo *pAmmo)
{ {
return pAmmo->pev->origin; return pAmmo->pev->origin;
} }
float CHalfLifeMultiplay::__MAKE_VHOOK(FlHealthChargerRechargeTime)() float CHalfLifeMultiplay::FlHealthChargerRechargeTime()
{ {
return 60; return 60;
} }
float CHalfLifeMultiplay::__MAKE_VHOOK(FlHEVChargerRechargeTime)() float CHalfLifeMultiplay::FlHEVChargerRechargeTime()
{ {
return 30; return 30;
} }
LINK_HOOK_CLASS_CUSTOM_CHAIN(int, CHalfLifeMultiplay, CSGameRules, DeadPlayerWeapons, (CBasePlayer *pPlayer), pPlayer) LINK_HOOK_CLASS_CUSTOM_CHAIN(int, CHalfLifeMultiplay, CSGameRules, DeadPlayerWeapons, (CBasePlayer *pPlayer), pPlayer)
int EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(DeadPlayerWeapons)(CBasePlayer *pPlayer) int EXT_FUNC CHalfLifeMultiplay::__API_HOOK(DeadPlayerWeapons)(CBasePlayer *pPlayer)
{ {
return GR_PLR_DROP_GUN_ACTIVE; return GR_PLR_DROP_GUN_ACTIVE;
} }
int CHalfLifeMultiplay::__MAKE_VHOOK(DeadPlayerAmmo)(CBasePlayer *pPlayer) int CHalfLifeMultiplay::DeadPlayerAmmo(CBasePlayer *pPlayer)
{ {
return GR_PLR_DROP_AMMO_ACTIVE; return GR_PLR_DROP_AMMO_ACTIVE;
} }
LINK_HOOK_CLASS_CUSTOM_CHAIN(edict_t *, CHalfLifeMultiplay, CSGameRules, GetPlayerSpawnSpot, (CBasePlayer *pPlayer), pPlayer) LINK_HOOK_CLASS_CUSTOM_CHAIN(edict_t *, CHalfLifeMultiplay, CSGameRules, GetPlayerSpawnSpot, (CBasePlayer *pPlayer), pPlayer)
edict_t *EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(GetPlayerSpawnSpot)(CBasePlayer *pPlayer) edict_t *EXT_FUNC CHalfLifeMultiplay::__API_HOOK(GetPlayerSpawnSpot)(CBasePlayer *pPlayer)
{ {
// gat valid spawn point // gat valid spawn point
edict_t *pentSpawnSpot = CGameRules::GetPlayerSpawnSpot(pPlayer); edict_t *pentSpawnSpot = CGameRules::GetPlayerSpawnSpot(pPlayer);
@ -4228,7 +4229,7 @@ edict_t *EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(GetPlayerSpawnSpot)(CBasePlaye
return pentSpawnSpot; return pentSpawnSpot;
} }
int CHalfLifeMultiplay::__MAKE_VHOOK(PlayerRelationship)(CBasePlayer *pPlayer, CBaseEntity *pTarget) int CHalfLifeMultiplay::PlayerRelationship(CBasePlayer *pPlayer, CBaseEntity *pTarget)
{ {
#ifdef REGAMEDLL_ADD #ifdef REGAMEDLL_ADD
if (IsFreeForAll()) if (IsFreeForAll())
@ -4258,7 +4259,7 @@ int CHalfLifeMultiplay::__MAKE_VHOOK(PlayerRelationship)(CBasePlayer *pPlayer, C
return GR_TEAMMATE; return GR_TEAMMATE;
} }
BOOL CHalfLifeMultiplay::__MAKE_VHOOK(FAllowFlashlight)() BOOL CHalfLifeMultiplay::FAllowFlashlight()
{ {
static cvar_t *mp_flashlight = NULL; static cvar_t *mp_flashlight = NULL;
@ -4271,7 +4272,7 @@ BOOL CHalfLifeMultiplay::__MAKE_VHOOK(FAllowFlashlight)()
return FALSE; return FALSE;
} }
BOOL CHalfLifeMultiplay::__MAKE_VHOOK(FAllowMonsters)() BOOL CHalfLifeMultiplay::FAllowMonsters()
{ {
#ifdef REGAMEDLL_FIXES #ifdef REGAMEDLL_FIXES
return FALSE; return FALSE;
@ -4282,7 +4283,7 @@ BOOL CHalfLifeMultiplay::__MAKE_VHOOK(FAllowMonsters)()
LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN2(CHalfLifeMultiplay, CSGameRules, GoToIntermission) LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN2(CHalfLifeMultiplay, CSGameRules, GoToIntermission)
void EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(GoToIntermission)() void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(GoToIntermission)()
{ {
if (m_bGameOver) if (m_bGameOver)
return; return;
@ -4812,7 +4813,7 @@ void CHalfLifeMultiplay::ProcessMapVote(CBasePlayer *player, int iVote)
LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN2(CHalfLifeMultiplay, CSGameRules, ChangeLevel); LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN2(CHalfLifeMultiplay, CSGameRules, ChangeLevel);
// Server is changing to a new level, check mapcycle.txt for map name and setup info // Server is changing to a new level, check mapcycle.txt for map name and setup info
void EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(ChangeLevel)() void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(ChangeLevel)()
{ {
static char szPreviousMapCycleFile[256]; static char szPreviousMapCycleFile[256];
static mapcycle_t mapcycle; static mapcycle_t mapcycle;
@ -4995,7 +4996,7 @@ void CHalfLifeMultiplay::SendMOTDToClient(edict_t *client)
LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN(CHalfLifeMultiplay, CSGameRules, ClientUserInfoChanged, (CBasePlayer *pPlayer, char *infobuffer), pPlayer, infobuffer); LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN(CHalfLifeMultiplay, CSGameRules, ClientUserInfoChanged, (CBasePlayer *pPlayer, char *infobuffer), pPlayer, infobuffer);
void EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(ClientUserInfoChanged)(CBasePlayer *pPlayer, char *infobuffer) void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(ClientUserInfoChanged)(CBasePlayer *pPlayer, char *infobuffer)
{ {
pPlayer->SetPlayerModel(pPlayer->m_bHasC4); pPlayer->SetPlayerModel(pPlayer->m_bHasC4);
pPlayer->SetPrefsFromUserinfo(infobuffer); pPlayer->SetPrefsFromUserinfo(infobuffer);

View File

@ -37,7 +37,10 @@
#define CAMERA_MODE_SPEC_ONLY_FRIST_PERSON 2 #define CAMERA_MODE_SPEC_ONLY_FRIST_PERSON 2
int GetForceCamera(CBasePlayer *pObserver); int GetForceCamera(CBasePlayer *pObserver);
int GetForceCamera_(CBasePlayer *pObserver);
void UpdateClientEffects(CBasePlayer *pObserver, int oldMode); void UpdateClientEffects(CBasePlayer *pObserver, int oldMode);
#ifdef REGAMEDLL_API
int GetForceCamera_OrigFunc(CBasePlayer *pObserver);
#endif
#endif // OBSERVER_H #endif // OBSERVER_H

View File

@ -24,7 +24,7 @@ TYPEDESCRIPTION CPathTrack::m_SaveData[] =
LINK_ENTITY_TO_CLASS(path_corner, CPathCorner, CCSPathCorner) LINK_ENTITY_TO_CLASS(path_corner, CPathCorner, CCSPathCorner)
IMPLEMENT_SAVERESTORE(CPathCorner, CPointEntity) IMPLEMENT_SAVERESTORE(CPathCorner, CPointEntity)
void CPathCorner::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CPathCorner::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "wait")) if (FStrEq(pkvd->szKeyName, "wait"))
{ {
@ -35,7 +35,7 @@ void CPathCorner::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CPointEntity::KeyValue(pkvd); CPointEntity::KeyValue(pkvd);
} }
void CPathCorner::__MAKE_VHOOK(Spawn)() void CPathCorner::Spawn()
{ {
assert(("path_corner without a targetname", !FStringNull(pev->targetname))); assert(("path_corner without a targetname", !FStringNull(pev->targetname)));
} }
@ -43,7 +43,7 @@ void CPathCorner::__MAKE_VHOOK(Spawn)()
IMPLEMENT_SAVERESTORE(CPathTrack, CBaseEntity) IMPLEMENT_SAVERESTORE(CPathTrack, CBaseEntity)
LINK_ENTITY_TO_CLASS(path_track, CPathTrack, CCSPathTrack) LINK_ENTITY_TO_CLASS(path_track, CPathTrack, CCSPathTrack)
void CPathTrack::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CPathTrack::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "altpath")) if (FStrEq(pkvd->szKeyName, "altpath"))
{ {
@ -54,7 +54,7 @@ void CPathTrack::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CPointEntity::KeyValue(pkvd); CPointEntity::KeyValue(pkvd);
} }
void CPathTrack::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CPathTrack::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
int on; int on;
@ -117,7 +117,7 @@ void CPathTrack::Link()
} }
} }
void CPathTrack::__MAKE_VHOOK(Spawn)() void CPathTrack::Spawn()
{ {
pev->solid = SOLID_TRIGGER; pev->solid = SOLID_TRIGGER;
UTIL_SetSize(pev, Vector(-8, -8, -8), Vector(8, 8, 8)); UTIL_SetSize(pev, Vector(-8, -8, -8), Vector(8, 8, 8));
@ -126,7 +126,7 @@ void CPathTrack::__MAKE_VHOOK(Spawn)()
m_pprevious = NULL; m_pprevious = NULL;
} }
void CPathTrack::__MAKE_VHOOK(Activate)() void CPathTrack::Activate()
{ {
// Link to next, and back-link // Link to next, and back-link
if (!FStringNull(pev->targetname)) if (!FStringNull(pev->targetname))

View File

@ -41,15 +41,6 @@ public:
virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
virtual float GetDelay() { return m_flWait; } virtual float GetDelay() { return m_flWait; }
#ifdef HOOK_GAMEDLL
void Spawn_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
#endif
public: public:
static TYPEDESCRIPTION IMPL(m_SaveData)[1]; static TYPEDESCRIPTION IMPL(m_SaveData)[1];

View File

@ -63,7 +63,7 @@ TYPEDESCRIPTION CGunTarget::m_SaveData[] =
IMPLEMENT_SAVERESTORE(CBasePlatTrain, CBaseToggle) IMPLEMENT_SAVERESTORE(CBasePlatTrain, CBaseToggle)
void CBasePlatTrain::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CBasePlatTrain::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "lip")) if (FStrEq(pkvd->szKeyName, "lip"))
{ {
@ -107,7 +107,7 @@ void CBasePlatTrain::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
#define noiseMoving noise #define noiseMoving noise
#define noiseArrived noise1 #define noiseArrived noise1
void CBasePlatTrain::__MAKE_VHOOK(Precache)() void CBasePlatTrain::Precache()
{ {
// set the plat's "in-motion" sound // set the plat's "in-motion" sound
switch (m_bMoveSnd) switch (m_bMoveSnd)
@ -292,7 +292,7 @@ void CFuncPlat::Setup()
} }
} }
void CFuncPlat::__MAKE_VHOOK(Precache)() void CFuncPlat::Precache()
{ {
CBasePlatTrain::Precache(); CBasePlatTrain::Precache();
@ -303,7 +303,7 @@ void CFuncPlat::__MAKE_VHOOK(Precache)()
} }
} }
void CFuncPlat::__MAKE_VHOOK(Spawn)() void CFuncPlat::Spawn()
{ {
Setup(); Setup();
Precache(); Precache();
@ -359,7 +359,7 @@ void CPlatTrigger::SpawnInsideTrigger(CFuncPlat *pPlatform)
UTIL_SetSize(pev, vecTMin, vecTMax); UTIL_SetSize(pev, vecTMin, vecTMax);
} }
void CPlatTrigger::__MAKE_VHOOK(Touch)(CBaseEntity *pOther) void CPlatTrigger::Touch(CBaseEntity *pOther)
{ {
// Ignore touches by non-players // Ignore touches by non-players
entvars_t *pevToucher = pOther->pev; entvars_t *pevToucher = pOther->pev;
@ -418,7 +418,7 @@ void CFuncPlat::PlatUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE
} }
// Platform is at top, now starts moving down. // Platform is at top, now starts moving down.
void CFuncPlat::__MAKE_VHOOK(GoDown)() void CFuncPlat::GoDown()
{ {
if (pev->noiseMovement) if (pev->noiseMovement)
{ {
@ -432,7 +432,7 @@ void CFuncPlat::__MAKE_VHOOK(GoDown)()
} }
// Platform has hit bottom. Stops and waits forever. // Platform has hit bottom. Stops and waits forever.
void CFuncPlat::__MAKE_VHOOK(HitBottom)() void CFuncPlat::HitBottom()
{ {
if (pev->noiseMovement) if (pev->noiseMovement)
{ {
@ -449,7 +449,7 @@ void CFuncPlat::__MAKE_VHOOK(HitBottom)()
} }
// Platform is at bottom, now starts moving up // Platform is at bottom, now starts moving up
void CFuncPlat::__MAKE_VHOOK(GoUp)() void CFuncPlat::GoUp()
{ {
if (pev->noiseMovement) if (pev->noiseMovement)
{ {
@ -463,7 +463,7 @@ void CFuncPlat::__MAKE_VHOOK(GoUp)()
} }
// Platform has hit top. Pauses, then starts back down again. // Platform has hit top. Pauses, then starts back down again.
void CFuncPlat::__MAKE_VHOOK(HitTop)() void CFuncPlat::HitTop()
{ {
if (pev->noiseMovement) if (pev->noiseMovement)
{ {
@ -486,7 +486,7 @@ void CFuncPlat::__MAKE_VHOOK(HitTop)()
} }
} }
void CFuncPlat::__MAKE_VHOOK(Blocked)(CBaseEntity *pOther) void CFuncPlat::Blocked(CBaseEntity *pOther)
{ {
ALERT(at_aiconsole, "%s Blocked by %s\n", STRING(pev->classname), STRING(pOther->pev->classname)); ALERT(at_aiconsole, "%s Blocked by %s\n", STRING(pev->classname), STRING(pOther->pev->classname));
@ -536,20 +536,20 @@ void CFuncPlatRot::SetupRotation()
} }
} }
void CFuncPlatRot::__MAKE_VHOOK(Spawn)() void CFuncPlatRot::Spawn()
{ {
CFuncPlat::Spawn(); CFuncPlat::Spawn();
SetupRotation(); SetupRotation();
} }
void CFuncPlatRot::__MAKE_VHOOK(GoDown)() void CFuncPlatRot::GoDown()
{ {
CFuncPlat::GoDown(); CFuncPlat::GoDown();
RotMove(m_start, pev->nextthink - pev->ltime); RotMove(m_start, pev->nextthink - pev->ltime);
} }
// Platform has hit bottom. Stops and waits forever. // Platform has hit bottom. Stops and waits forever.
void CFuncPlatRot::__MAKE_VHOOK(HitBottom)() void CFuncPlatRot::HitBottom()
{ {
CFuncPlat::HitBottom(); CFuncPlat::HitBottom();
pev->avelocity = g_vecZero; pev->avelocity = g_vecZero;
@ -557,14 +557,14 @@ void CFuncPlatRot::__MAKE_VHOOK(HitBottom)()
} }
// Platform is at bottom, now starts moving up // Platform is at bottom, now starts moving up
void CFuncPlatRot::__MAKE_VHOOK(GoUp)() void CFuncPlatRot::GoUp()
{ {
CFuncPlat::GoUp(); CFuncPlat::GoUp();
RotMove(m_end, pev->nextthink - pev->ltime); RotMove(m_end, pev->nextthink - pev->ltime);
} }
// Platform has hit top. Pauses, then starts back down again. // Platform has hit top. Pauses, then starts back down again.
void CFuncPlatRot::__MAKE_VHOOK(HitTop)() void CFuncPlatRot::HitTop()
{ {
CFuncPlat::HitTop(); CFuncPlat::HitTop();
pev->avelocity = g_vecZero; pev->avelocity = g_vecZero;
@ -591,7 +591,7 @@ void CFuncPlatRot::RotMove(Vector &destAngle, float time)
LINK_ENTITY_TO_CLASS(func_train, CFuncTrain, CCSFuncTrain) LINK_ENTITY_TO_CLASS(func_train, CFuncTrain, CCSFuncTrain)
IMPLEMENT_SAVERESTORE(CFuncTrain, CBasePlatTrain) IMPLEMENT_SAVERESTORE(CFuncTrain, CBasePlatTrain)
void CFuncTrain::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CFuncTrain::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "sounds")) if (FStrEq(pkvd->szKeyName, "sounds"))
{ {
@ -602,7 +602,7 @@ void CFuncTrain::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CBasePlatTrain::KeyValue(pkvd); CBasePlatTrain::KeyValue(pkvd);
} }
void CFuncTrain::__MAKE_VHOOK(Blocked)(CBaseEntity *pOther) void CFuncTrain::Blocked(CBaseEntity *pOther)
{ {
if (gpGlobals->time < m_flActivateFinished) if (gpGlobals->time < m_flActivateFinished)
return; return;
@ -611,7 +611,7 @@ void CFuncTrain::__MAKE_VHOOK(Blocked)(CBaseEntity *pOther)
pOther->TakeDamage(pev, pev, pev->dmg, DMG_CRUSH); pOther->TakeDamage(pev, pev, pev->dmg, DMG_CRUSH);
} }
void CFuncTrain::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CFuncTrain::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
if (pev->spawnflags & SF_TRAIN_WAIT_RETRIGGER) if (pev->spawnflags & SF_TRAIN_WAIT_RETRIGGER)
{ {
@ -765,7 +765,7 @@ void CFuncTrain::Next()
} }
} }
void CFuncTrain::__MAKE_VHOOK(Activate)() void CFuncTrain::Activate()
{ {
// Not yet active, so teleport to first target // Not yet active, so teleport to first target
if (!m_activated) if (!m_activated)
@ -803,7 +803,7 @@ void CFuncTrain::__MAKE_VHOOK(Activate)()
// dmg default 2 // dmg default 2
// sounds // sounds
// 1) ratchet metal // 1) ratchet metal
void CFuncTrain::__MAKE_VHOOK(Spawn)() void CFuncTrain::Spawn()
{ {
Precache(); Precache();
@ -846,7 +846,7 @@ void CFuncTrain::__MAKE_VHOOK(Spawn)()
m_volume = 0.85f; m_volume = 0.85f;
} }
void CFuncTrain::__MAKE_VHOOK(Restart)() void CFuncTrain::Restart()
{ {
if (pev->speed == 0) if (pev->speed == 0)
pev->speed = 100; pev->speed = 100;
@ -888,12 +888,12 @@ void CFuncTrain::__MAKE_VHOOK(Restart)()
#endif #endif
} }
void CFuncTrain::__MAKE_VHOOK(Precache)() void CFuncTrain::Precache()
{ {
CBasePlatTrain::Precache(); CBasePlatTrain::Precache();
} }
void CFuncTrain::__MAKE_VHOOK(OverrideReset)() void CFuncTrain::OverrideReset()
{ {
CBaseEntity *pTarg; CBaseEntity *pTarg;
@ -921,7 +921,7 @@ void CFuncTrain::__MAKE_VHOOK(OverrideReset)()
IMPLEMENT_SAVERESTORE(CFuncTrackTrain, CBaseEntity) IMPLEMENT_SAVERESTORE(CFuncTrackTrain, CBaseEntity)
LINK_ENTITY_TO_CLASS(func_tracktrain, CFuncTrackTrain, CCSFuncTrackTrain) LINK_ENTITY_TO_CLASS(func_tracktrain, CFuncTrackTrain, CCSFuncTrackTrain)
void CFuncTrackTrain::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CFuncTrackTrain::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "wheels")) if (FStrEq(pkvd->szKeyName, "wheels"))
{ {
@ -970,7 +970,7 @@ void CFuncTrackTrain::NextThink(float thinkTime, BOOL alwaysThink)
pev->nextthink = thinkTime; pev->nextthink = thinkTime;
} }
void CFuncTrackTrain::__MAKE_VHOOK(Blocked)(CBaseEntity *pOther) void CFuncTrackTrain::Blocked(CBaseEntity *pOther)
{ {
entvars_t *pevOther = pOther->pev; entvars_t *pevOther = pOther->pev;
@ -1007,7 +1007,7 @@ void CFuncTrackTrain::__MAKE_VHOOK(Blocked)(CBaseEntity *pOther)
#endif #endif
} }
void CFuncTrackTrain::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CFuncTrackTrain::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
if (useType != USE_SET) if (useType != USE_SET)
{ {
@ -1356,7 +1356,7 @@ void CFuncTrackTrain::SetControls(entvars_t *pevControls)
m_controlMaxs = pevControls->maxs + offset; m_controlMaxs = pevControls->maxs + offset;
} }
BOOL CFuncTrackTrain::__MAKE_VHOOK(OnControls)(entvars_t *pevTest) BOOL CFuncTrackTrain::OnControls(entvars_t *pevTest)
{ {
Vector offset = pevTest->origin - pev->origin; Vector offset = pevTest->origin - pev->origin;
@ -1474,7 +1474,7 @@ void CFuncTrackTrain::NearestPath()
} }
} }
void CFuncTrackTrain::__MAKE_VHOOK(OverrideReset)() void CFuncTrackTrain::OverrideReset()
{ {
NextThink(pev->ltime + 0.1f, FALSE); NextThink(pev->ltime + 0.1f, FALSE);
SetThink(&CFuncTrackTrain::NearestPath); SetThink(&CFuncTrackTrain::NearestPath);
@ -1490,7 +1490,7 @@ CFuncTrackTrain *CFuncTrackTrain::Instance(edict_t *pent)
return NULL; return NULL;
} }
void CFuncTrackTrain::__MAKE_VHOOK(Spawn)() void CFuncTrackTrain::Spawn()
{ {
if (pev->speed == 0) if (pev->speed == 0)
m_speed = 165; m_speed = 165;
@ -1535,7 +1535,7 @@ void CFuncTrackTrain::__MAKE_VHOOK(Spawn)()
Precache(); Precache();
} }
void CFuncTrackTrain::__MAKE_VHOOK(Restart)() void CFuncTrackTrain::Restart()
{ {
ALERT(at_console, "M_speed = %f\n", m_speed); ALERT(at_console, "M_speed = %f\n", m_speed);
@ -1555,7 +1555,7 @@ void CFuncTrackTrain::__MAKE_VHOOK(Restart)()
SetThink(&CFuncTrackTrain::Find); SetThink(&CFuncTrackTrain::Find);
} }
void CFuncTrackTrain::__MAKE_VHOOK(Precache)() void CFuncTrackTrain::Precache()
{ {
if (m_flVolume == 0.0f) if (m_flVolume == 0.0f)
m_flVolume = 1.0f; m_flVolume = 1.0f;
@ -1603,7 +1603,7 @@ void CFuncTrainControls::Find()
UTIL_Remove(this); UTIL_Remove(this);
} }
void CFuncTrainControls::__MAKE_VHOOK(Spawn)() void CFuncTrainControls::Spawn()
{ {
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
pev->movetype = MOVETYPE_NONE; pev->movetype = MOVETYPE_NONE;
@ -1616,7 +1616,7 @@ void CFuncTrainControls::__MAKE_VHOOK(Spawn)()
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
} }
BOOL CFuncTrackChange::__MAKE_VHOOK(IsTogglePlat)() BOOL CFuncTrackChange::IsTogglePlat()
{ {
return TRUE; return TRUE;
} }
@ -1624,7 +1624,7 @@ BOOL CFuncTrackChange::__MAKE_VHOOK(IsTogglePlat)()
LINK_ENTITY_TO_CLASS(func_trackchange, CFuncTrackChange, CCSFuncTrackChange) LINK_ENTITY_TO_CLASS(func_trackchange, CFuncTrackChange, CCSFuncTrackChange)
IMPLEMENT_SAVERESTORE(CFuncTrackChange, CFuncPlatRot) IMPLEMENT_SAVERESTORE(CFuncTrackChange, CFuncPlatRot)
void CFuncTrackChange::__MAKE_VHOOK(Spawn)() void CFuncTrackChange::Spawn()
{ {
Setup(); Setup();
if (pev->spawnflags & SF_TRACK_DONT_MOVE) if (pev->spawnflags & SF_TRACK_DONT_MOVE)
@ -1655,7 +1655,7 @@ void CFuncTrackChange::__MAKE_VHOOK(Spawn)()
Precache(); Precache();
} }
void CFuncTrackChange::__MAKE_VHOOK(Precache)() void CFuncTrackChange::Precache()
{ {
// Can't trigger sound // Can't trigger sound
PRECACHE_SOUND("buttons/button11.wav"); PRECACHE_SOUND("buttons/button11.wav");
@ -1664,7 +1664,7 @@ void CFuncTrackChange::__MAKE_VHOOK(Precache)()
} }
// UNDONE: Filter touches before re-evaluating the train. // UNDONE: Filter touches before re-evaluating the train.
void CFuncTrackChange::__MAKE_VHOOK(Touch)(CBaseEntity *pOther) void CFuncTrackChange::Touch(CBaseEntity *pOther)
{ {
#if 0 #if 0
TRAIN_CODE code; TRAIN_CODE code;
@ -1672,7 +1672,7 @@ void CFuncTrackChange::__MAKE_VHOOK(Touch)(CBaseEntity *pOther)
#endif #endif
} }
void CFuncTrackChange::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CFuncTrackChange::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "train")) if (FStrEq(pkvd->szKeyName, "train"))
{ {
@ -1696,7 +1696,7 @@ void CFuncTrackChange::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
} }
} }
void CFuncTrackChange::__MAKE_VHOOK(OverrideReset)() void CFuncTrackChange::OverrideReset()
{ {
pev->nextthink = pev->ltime + 1.0f; pev->nextthink = pev->ltime + 1.0f;
SetThink(&CFuncTrackChange::Find); SetThink(&CFuncTrackChange::Find);
@ -1804,7 +1804,7 @@ void CFuncTrackChange::UpdateTrain(Vector &dest)
m_train->pev->velocity = pev->velocity + (local * (1.0 / time)); m_train->pev->velocity = pev->velocity + (local * (1.0 / time));
} }
void CFuncTrackChange::__MAKE_VHOOK(GoDown)() void CFuncTrackChange::GoDown()
{ {
if (m_code == TRAIN_BLOCKING) if (m_code == TRAIN_BLOCKING)
return; return;
@ -1837,7 +1837,7 @@ void CFuncTrackChange::__MAKE_VHOOK(GoDown)()
} }
// Platform is at bottom, now starts moving up // Platform is at bottom, now starts moving up
void CFuncTrackChange::__MAKE_VHOOK(GoUp)() void CFuncTrackChange::GoUp()
{ {
if (m_code == TRAIN_BLOCKING) if (m_code == TRAIN_BLOCKING)
return; return;
@ -1871,7 +1871,7 @@ void CFuncTrackChange::__MAKE_VHOOK(GoUp)()
} }
// Normal track change // Normal track change
void CFuncTrackChange::__MAKE_VHOOK(UpdateAutoTargets)(int toggleState) void CFuncTrackChange::UpdateAutoTargets(int toggleState)
{ {
if (!m_trackTop || !m_trackBottom) if (!m_trackTop || !m_trackBottom)
return; return;
@ -1887,7 +1887,7 @@ void CFuncTrackChange::__MAKE_VHOOK(UpdateAutoTargets)(int toggleState)
m_trackBottom->pev->spawnflags |= SF_PATH_DISABLED; m_trackBottom->pev->spawnflags |= SF_PATH_DISABLED;
} }
void CFuncTrackChange::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CFuncTrackChange::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
if (m_toggle_state != TS_AT_TOP && m_toggle_state != TS_AT_BOTTOM) if (m_toggle_state != TS_AT_TOP && m_toggle_state != TS_AT_BOTTOM)
return; return;
@ -1925,7 +1925,7 @@ void CFuncTrackChange::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *p
} }
// Platform has hit bottom. Stops and waits forever. // Platform has hit bottom. Stops and waits forever.
void CFuncTrackChange::__MAKE_VHOOK(HitBottom)() void CFuncTrackChange::HitBottom()
{ {
CFuncPlatRot::HitBottom(); CFuncPlatRot::HitBottom();
if (m_code == TRAIN_FOLLOWING) if (m_code == TRAIN_FOLLOWING)
@ -1941,7 +1941,7 @@ void CFuncTrackChange::__MAKE_VHOOK(HitBottom)()
} }
// Platform has hit bottom. Stops and waits forever. // Platform has hit bottom. Stops and waits forever.
void CFuncTrackChange::__MAKE_VHOOK(HitTop)() void CFuncTrackChange::HitTop()
{ {
CFuncPlatRot::HitTop(); CFuncPlatRot::HitTop();
if (m_code == TRAIN_FOLLOWING) if (m_code == TRAIN_FOLLOWING)
@ -1961,7 +1961,7 @@ void CFuncTrackChange::__MAKE_VHOOK(HitTop)()
LINK_ENTITY_TO_CLASS(func_trackautochange, CFuncTrackAuto, CCSFuncTrackAuto) LINK_ENTITY_TO_CLASS(func_trackautochange, CFuncTrackAuto, CCSFuncTrackAuto)
// Auto track change // Auto track change
void CFuncTrackAuto::__MAKE_VHOOK(UpdateAutoTargets)(int toggleState) void CFuncTrackAuto::UpdateAutoTargets(int toggleState)
{ {
CPathTrack *pTarget, *pNextTarget; CPathTrack *pTarget, *pNextTarget;
@ -1995,7 +1995,7 @@ void CFuncTrackAuto::__MAKE_VHOOK(UpdateAutoTargets)(int toggleState)
} }
} }
void CFuncTrackAuto::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CFuncTrackAuto::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
CPathTrack *pTarget; CPathTrack *pTarget;
@ -2052,7 +2052,7 @@ void CFuncTrackAuto::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCa
LINK_ENTITY_TO_CLASS(func_guntarget, CGunTarget, CCSGunTarget) LINK_ENTITY_TO_CLASS(func_guntarget, CGunTarget, CCSGunTarget)
IMPLEMENT_SAVERESTORE(CGunTarget, CBaseMonster) IMPLEMENT_SAVERESTORE(CGunTarget, CBaseMonster)
void CGunTarget::__MAKE_VHOOK(Spawn)() void CGunTarget::Spawn()
{ {
pev->solid = SOLID_BSP; pev->solid = SOLID_BSP;
pev->movetype = MOVETYPE_PUSH; pev->movetype = MOVETYPE_PUSH;
@ -2079,7 +2079,7 @@ void CGunTarget::__MAKE_VHOOK(Spawn)()
} }
} }
void CGunTarget::__MAKE_VHOOK(Activate)() void CGunTarget::Activate()
{ {
CBaseEntity *pTarg; CBaseEntity *pTarg;
@ -2159,7 +2159,7 @@ void CGunTarget::Stop()
pev->takedamage = DAMAGE_NO; pev->takedamage = DAMAGE_NO;
} }
BOOL CGunTarget::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) BOOL CGunTarget::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{ {
if (pev->health > 0) if (pev->health > 0)
{ {
@ -2180,7 +2180,7 @@ BOOL CGunTarget::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pe
return FALSE; return FALSE;
} }
void CGunTarget::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CGunTarget::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
if (!ShouldToggle(useType, m_on)) if (!ShouldToggle(useType, m_on))
return; return;

View File

@ -58,15 +58,6 @@ public:
// This is done to fix spawn flag collisions between this class and a derived class // This is done to fix spawn flag collisions between this class and a derived class
virtual BOOL IsTogglePlat() { return (pev->spawnflags & SF_PLAT_TOGGLE) != 0; } virtual BOOL IsTogglePlat() { return (pev->spawnflags & SF_PLAT_TOGGLE) != 0; }
#ifdef HOOK_GAMEDLL
void Precache_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
#endif
public: public:
static TYPEDESCRIPTION IMPL(m_SaveData)[3]; static TYPEDESCRIPTION IMPL(m_SaveData)[3];
@ -86,18 +77,6 @@ public:
virtual void HitTop(); virtual void HitTop();
virtual void HitBottom(); virtual void HitBottom();
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
void Blocked_(CBaseEntity *pOther);
void GoUp_();
void GoDown_();
void HitTop_();
void HitBottom_();
#endif
public: public:
void Setup(); void Setup();
void EXPORT PlatUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); void EXPORT PlatUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
@ -112,12 +91,6 @@ public:
virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION) | FCAP_DONT_SAVE; } virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION) | FCAP_DONT_SAVE; }
virtual void Touch(CBaseEntity *pOther); virtual void Touch(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Touch_(CBaseEntity *pOther);
#endif
public: public:
void SpawnInsideTrigger(CFuncPlat *pPlatform); void SpawnInsideTrigger(CFuncPlat *pPlatform);
@ -136,18 +109,6 @@ public:
virtual void HitTop(); virtual void HitTop();
virtual void HitBottom(); virtual void HitBottom();
#ifdef HOOK_GAMEDLL
void Spawn_();
int Save_(CSave &save);
int Restore_(CRestore &restore);
void GoUp_();
void GoDown_();
void HitTop_();
void HitBottom_();
#endif
public: public:
void SetupRotation(); void SetupRotation();
void RotMove(Vector &destAngle, float time); void RotMove(Vector &destAngle, float time);
@ -173,21 +134,6 @@ public:
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Blocked(CBaseEntity *pOther); virtual void Blocked(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
void Restart_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Activate_();
void OverrideReset_();
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void Blocked_(CBaseEntity *pOther);
#endif
public: public:
void EXPORT Wait(); void EXPORT Wait();
void EXPORT Next(); void EXPORT Next();
@ -208,12 +154,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual int ObjectCaps() { return CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; } virtual int ObjectCaps() { return CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
#ifdef HOOK_GAMEDLL
void Spawn_();
#endif
public: public:
void EXPORT Find(); void EXPORT Find();
}; };
@ -238,25 +178,6 @@ public:
virtual void HitBottom(); virtual void HitBottom();
virtual void UpdateAutoTargets(int toggleState); virtual void UpdateAutoTargets(int toggleState);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void OverrideReset_();
void Touch_(CBaseEntity *pOther);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
BOOL IsTogglePlat_();
void GoUp_();
void GoDown_();
void HitBottom_();
void HitTop_();
void UpdateAutoTargets_(int toggleState);
#endif
public: public:
void EXPORT Find(); void EXPORT Find();
TRAIN_CODE EvaluateTrain(CPathTrack *pcurrent); TRAIN_CODE EvaluateTrain(CPathTrack *pcurrent);
@ -288,14 +209,6 @@ class CFuncTrackAuto: public CFuncTrackChange
public: public:
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void UpdateAutoTargets(int toggleState); virtual void UpdateAutoTargets(int toggleState);
#ifdef HOOK_GAMEDLL
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void UpdateAutoTargets_(int toggleState);
#endif
}; };
class CGunTarget: public CBaseMonster class CGunTarget: public CBaseMonster
@ -312,17 +225,6 @@ public:
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual Vector BodyTarget(const Vector &posSrc) { return pev->origin; } virtual Vector BodyTarget(const Vector &posSrc) { return pev->origin; }
#ifdef HOOK_GAMEDLL
void Spawn_();
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Activate_();
BOOL TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
void EXPORT Next(); void EXPORT Next();
void EXPORT Start(); void EXPORT Start();

View File

@ -724,12 +724,12 @@ LINK_HOOK_CLASS_CHAIN(BOOL, CBasePlayer, TakeHealth, (float flHealth, int bitsDa
// override takehealth // override takehealth
// bitsDamageType indicates type of damage healed. // bitsDamageType indicates type of damage healed.
BOOL EXT_FUNC CBasePlayer::__API_VHOOK(TakeHealth)(float flHealth, int bitsDamageType) BOOL EXT_FUNC CBasePlayer::__API_HOOK(TakeHealth)(float flHealth, int bitsDamageType)
{ {
return CBaseMonster::TakeHealth(flHealth, bitsDamageType); return CBaseMonster::TakeHealth(flHealth, bitsDamageType);
} }
Vector CBasePlayer::__MAKE_VHOOK(GetGunPosition)() Vector CBasePlayer::GetGunPosition()
{ {
return pev->origin + pev->view_ofs; return pev->origin + pev->view_ofs;
} }
@ -750,7 +750,7 @@ bool CBasePlayer::IsHittingShield(Vector &vecDirection, TraceResult *ptr)
LINK_HOOK_CLASS_VOID_CHAIN(CBasePlayer, TraceAttack, (entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType), pevAttacker, flDamage, vecDir, ptr, bitsDamageType) LINK_HOOK_CLASS_VOID_CHAIN(CBasePlayer, TraceAttack, (entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType), pevAttacker, flDamage, vecDir, ptr, bitsDamageType)
void EXT_FUNC CBasePlayer::__API_VHOOK(TraceAttack)(entvars_t *pevAttacker, float flDamage, VectorRef vecDir, TraceResult *ptr, int bitsDamageType) void EXT_FUNC CBasePlayer::__API_HOOK(TraceAttack)(entvars_t *pevAttacker, float flDamage, VectorRef vecDir, TraceResult *ptr, int bitsDamageType)
{ {
bool bShouldBleed = true; bool bShouldBleed = true;
bool bShouldSpark = false; bool bShouldSpark = false;
@ -981,7 +981,7 @@ LINK_HOOK_CLASS_CHAIN(BOOL, CBasePlayer, TakeDamage, (entvars_t *pevInflictor, e
// NOTE: each call to TakeDamage with bitsDamageType set to a time-based damage // NOTE: each call to TakeDamage with bitsDamageType set to a time-based damage
// type will cause the damage time countdown to be reset. Thus the ongoing effects of poison, radiation // type will cause the damage time countdown to be reset. Thus the ongoing effects of poison, radiation
// etc are implemented with subsequent calls to TakeDamage using DMG_GENERIC. // etc are implemented with subsequent calls to TakeDamage using DMG_GENERIC.
BOOL EXT_FUNC CBasePlayer::__API_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker, FloatRef flDamage, int bitsDamageType) BOOL EXT_FUNC CBasePlayer::__API_HOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker, FloatRef flDamage, int bitsDamageType)
{ {
BOOL bTookDamage; BOOL bTookDamage;
float flRatio = ARMOR_RATIO; float flRatio = ARMOR_RATIO;
@ -2010,7 +2010,7 @@ void CBasePlayer::SendFOV(int fov)
LINK_HOOK_CLASS_VOID_CHAIN(CBasePlayer, Killed, (entvars_t *pevAttacker, int iGib), pevAttacker, iGib) LINK_HOOK_CLASS_VOID_CHAIN(CBasePlayer, Killed, (entvars_t *pevAttacker, int iGib), pevAttacker, iGib)
void EXT_FUNC CBasePlayer::__API_VHOOK(Killed)(entvars_t *pevAttacker, int iGib) void EXT_FUNC CBasePlayer::__API_HOOK(Killed)(entvars_t *pevAttacker, int iGib)
{ {
m_canSwitchObserverModes = false; m_canSwitchObserverModes = false;
@ -3047,7 +3047,7 @@ NOXREF void CBasePlayer::ThrowWeapon(char *pszItemName)
LINK_ENTITY_TO_CLASS(weapon_shield, CWShield, CCSShield) LINK_ENTITY_TO_CLASS(weapon_shield, CWShield, CCSShield)
void CWShield::__MAKE_VHOOK(Spawn)() void CWShield::Spawn()
{ {
pev->movetype = MOVETYPE_TOSS; pev->movetype = MOVETYPE_TOSS;
pev->solid = SOLID_TRIGGER; pev->solid = SOLID_TRIGGER;
@ -3056,7 +3056,7 @@ void CWShield::__MAKE_VHOOK(Spawn)()
SET_MODEL(ENT(pev), "models/w_shield.mdl"); SET_MODEL(ENT(pev), "models/w_shield.mdl");
} }
void CWShield::__MAKE_VHOOK(Touch)(CBaseEntity *pOther) void CWShield::Touch(CBaseEntity *pOther)
{ {
if (!pOther->IsPlayer()) if (!pOther->IsPlayer())
return; return;
@ -3697,7 +3697,7 @@ void CBasePlayer::PlayerDeathThink()
LINK_HOOK_CLASS_VOID_CHAIN2(CBasePlayer, RoundRespawn) LINK_HOOK_CLASS_VOID_CHAIN2(CBasePlayer, RoundRespawn)
void EXT_FUNC CBasePlayer::__API_VHOOK(RoundRespawn)() void EXT_FUNC CBasePlayer::__API_HOOK(RoundRespawn)()
{ {
m_canSwitchObserverModes = true; m_canSwitchObserverModes = true;
@ -4049,7 +4049,7 @@ void CBasePlayer::HostageUsed()
LINK_HOOK_CLASS_VOID_CHAIN2(CBasePlayer, Jump) LINK_HOOK_CLASS_VOID_CHAIN2(CBasePlayer, Jump)
void EXT_FUNC CBasePlayer::__API_VHOOK(Jump)() void EXT_FUNC CBasePlayer::__API_HOOK(Jump)()
{ {
if (pev->flags & FL_WATERJUMP) if (pev->flags & FL_WATERJUMP)
return; return;
@ -4121,7 +4121,7 @@ NOXREF void FixPlayerCrouchStuck(edict_t *pPlayer)
LINK_HOOK_CLASS_VOID_CHAIN2(CBasePlayer, Duck) LINK_HOOK_CLASS_VOID_CHAIN2(CBasePlayer, Duck)
void EXT_FUNC CBasePlayer::__API_VHOOK(Duck)() void EXT_FUNC CBasePlayer::__API_HOOK(Duck)()
{ {
if (pev->button & IN_DUCK) if (pev->button & IN_DUCK)
SetAnimation(PLAYER_WALK); SetAnimation(PLAYER_WALK);
@ -4129,7 +4129,7 @@ void EXT_FUNC CBasePlayer::__API_VHOOK(Duck)()
LINK_HOOK_CLASS_CHAIN2(int, CBasePlayer, ObjectCaps) LINK_HOOK_CLASS_CHAIN2(int, CBasePlayer, ObjectCaps)
int EXT_FUNC CBasePlayer::__API_VHOOK(ObjectCaps)() int EXT_FUNC CBasePlayer::__API_HOOK(ObjectCaps)()
{ {
return (CBaseMonster::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); return (CBaseMonster::ObjectCaps() & ~FCAP_ACROSS_TRANSITION);
} }
@ -4137,14 +4137,14 @@ int EXT_FUNC CBasePlayer::__API_VHOOK(ObjectCaps)()
LINK_HOOK_CLASS_CHAIN2(int, CBasePlayer, Classify) LINK_HOOK_CLASS_CHAIN2(int, CBasePlayer, Classify)
// ID's player as such. // ID's player as such.
int EXT_FUNC CBasePlayer::__API_VHOOK(Classify)() int EXT_FUNC CBasePlayer::__API_HOOK(Classify)()
{ {
return CLASS_PLAYER; return CLASS_PLAYER;
} }
LINK_HOOK_CLASS_VOID_CHAIN(CBasePlayer, AddPoints, (int score, BOOL bAllowNegativeScore), score, bAllowNegativeScore) LINK_HOOK_CLASS_VOID_CHAIN(CBasePlayer, AddPoints, (int score, BOOL bAllowNegativeScore), score, bAllowNegativeScore)
void EXT_FUNC CBasePlayer::__API_VHOOK(AddPoints)(int score, BOOL bAllowNegativeScore) void EXT_FUNC CBasePlayer::__API_HOOK(AddPoints)(int score, BOOL bAllowNegativeScore)
{ {
// Positive score always adds // Positive score always adds
if (score < 0 && !bAllowNegativeScore) if (score < 0 && !bAllowNegativeScore)
@ -4177,7 +4177,7 @@ void EXT_FUNC CBasePlayer::__API_VHOOK(AddPoints)(int score, BOOL bAllowNegative
LINK_HOOK_CLASS_VOID_CHAIN(CBasePlayer, AddPointsToTeam, (int score, BOOL bAllowNegativeScore), score, bAllowNegativeScore) LINK_HOOK_CLASS_VOID_CHAIN(CBasePlayer, AddPointsToTeam, (int score, BOOL bAllowNegativeScore), score, bAllowNegativeScore)
void EXT_FUNC CBasePlayer::__API_VHOOK(AddPointsToTeam)(int score, BOOL bAllowNegativeScore) void EXT_FUNC CBasePlayer::__API_HOOK(AddPointsToTeam)(int score, BOOL bAllowNegativeScore)
{ {
int index = entindex(); int index = entindex();
for (int i = 1; i <= gpGlobals->maxClients; ++i) for (int i = 1; i <= gpGlobals->maxClients; ++i)
@ -4270,7 +4270,7 @@ bool CBasePlayer::CanPlayerBuy(bool display)
LINK_HOOK_CLASS_VOID_CHAIN2(CBasePlayer, PreThink) LINK_HOOK_CLASS_VOID_CHAIN2(CBasePlayer, PreThink)
void EXT_FUNC CBasePlayer::__API_VHOOK(PreThink)() void EXT_FUNC CBasePlayer::__API_HOOK(PreThink)()
{ {
// These buttons have changed this frame // These buttons have changed this frame
int buttonsChanged = (m_afButtonLast ^ pev->button); int buttonsChanged = (m_afButtonLast ^ pev->button);
@ -4851,7 +4851,7 @@ void CBasePlayer::UpdatePlayerSound()
LINK_HOOK_CLASS_VOID_CHAIN2(CBasePlayer, PostThink) LINK_HOOK_CLASS_VOID_CHAIN2(CBasePlayer, PostThink)
void EXT_FUNC CBasePlayer::__API_VHOOK(PostThink)() void EXT_FUNC CBasePlayer::__API_HOOK(PostThink)()
{ {
// intermission or finale // intermission or finale
if (g_pGameRules->IsGameOver()) if (g_pGameRules->IsGameOver())
@ -5208,7 +5208,7 @@ void CBasePlayer::SetScoreAttrib(CBasePlayer *dest)
LINK_HOOK_CLASS_VOID_CHAIN2(CBasePlayer, Spawn) LINK_HOOK_CLASS_VOID_CHAIN2(CBasePlayer, Spawn)
void EXT_FUNC CBasePlayer::__API_VHOOK(Spawn)() void EXT_FUNC CBasePlayer::__API_HOOK(Spawn)()
{ {
int i; int i;
@ -5565,7 +5565,7 @@ void EXT_FUNC CBasePlayer::__API_VHOOK(Spawn)()
LINK_HOOK_CLASS_VOID_CHAIN2(CBasePlayer, Precache) LINK_HOOK_CLASS_VOID_CHAIN2(CBasePlayer, Precache)
void EXT_FUNC CBasePlayer::__API_VHOOK(Precache)() void EXT_FUNC CBasePlayer::__API_HOOK(Precache)()
{ {
#ifndef REGAMEDLL_FIXES #ifndef REGAMEDLL_FIXES
// in the event that the player JUST spawned, and the level node graph // in the event that the player JUST spawned, and the level node graph
@ -5607,7 +5607,7 @@ void EXT_FUNC CBasePlayer::__API_VHOOK(Precache)()
m_fInitHUD = TRUE; m_fInitHUD = TRUE;
} }
int CBasePlayer::__MAKE_VHOOK(Save)(CSave &save) int CBasePlayer::Save(CSave &save)
{ {
if (!CBaseMonster::Save(save)) if (!CBaseMonster::Save(save))
return 0; return 0;
@ -5638,7 +5638,7 @@ NOXREF void CBasePlayer::RenewItems()
; ;
} }
int CBasePlayer::__MAKE_VHOOK(Restore)(CRestore &restore) int CBasePlayer::Restore(CRestore &restore)
{ {
if (!CBaseMonster::Restore(restore)) if (!CBaseMonster::Restore(restore))
return 0; return 0;
@ -5866,7 +5866,7 @@ NOXREF void CBasePlayer::SelectPrevItem(int iItem)
; ;
} }
const char *CBasePlayer::__MAKE_VHOOK(TeamID)() const char *CBasePlayer::TeamID()
{ {
// Not fully connected yet // Not fully connected yet
if (!pev) if (!pev)
@ -5891,7 +5891,7 @@ void CSprayCan::Spawn(entvars_t *pevOwner)
EMIT_SOUND(ENT(pev), CHAN_VOICE, "player/sprayer.wav", VOL_NORM, ATTN_NORM); EMIT_SOUND(ENT(pev), CHAN_VOICE, "player/sprayer.wav", VOL_NORM, ATTN_NORM);
} }
void CSprayCan::__MAKE_VHOOK(Think)() void CSprayCan::Think()
{ {
TraceResult tr; TraceResult tr;
int playernum; int playernum;
@ -6082,7 +6082,7 @@ void CBasePlayer::ForceClientDllUpdate()
LINK_HOOK_CLASS_VOID_CHAIN2(CBasePlayer, ImpulseCommands) LINK_HOOK_CLASS_VOID_CHAIN2(CBasePlayer, ImpulseCommands)
void EXT_FUNC CBasePlayer::__API_VHOOK(ImpulseCommands)() void EXT_FUNC CBasePlayer::__API_HOOK(ImpulseCommands)()
{ {
TraceResult tr; TraceResult tr;
@ -6395,11 +6395,11 @@ void CBasePlayer::HandleSignals()
{ {
if (CSGameRules()->IsMultiplayer()) if (CSGameRules()->IsMultiplayer())
{ {
#ifdef REGAMEDLL_ADD #ifdef REGAMEDLL_ADD
if (buytime.value != 0.0f) if (buytime.value != 0.0f)
#endif #endif
{ {
if (!CSGameRules()->m_bMapHasBuyZone) if (!CSGameRules()->m_bMapHasBuyZone)
OLD_CheckBuyZone(this); OLD_CheckBuyZone(this);
} }
@ -6456,7 +6456,7 @@ void CBasePlayer::HandleSignals()
LINK_HOOK_CLASS_CHAIN(BOOL, CBasePlayer, AddPlayerItem, (CBasePlayerItem *pItem), pItem) LINK_HOOK_CLASS_CHAIN(BOOL, CBasePlayer, AddPlayerItem, (CBasePlayerItem *pItem), pItem)
// Add a weapon to the player (Item == Weapon == Selectable Object) // Add a weapon to the player (Item == Weapon == Selectable Object)
BOOL EXT_FUNC CBasePlayer::__API_VHOOK(AddPlayerItem)(CBasePlayerItem *pItem) BOOL EXT_FUNC CBasePlayer::__API_HOOK(AddPlayerItem)(CBasePlayerItem *pItem)
{ {
CBasePlayerItem *pInsert = m_rgpPlayerItems[ pItem->iItemSlot() ]; CBasePlayerItem *pInsert = m_rgpPlayerItems[ pItem->iItemSlot() ];
while (pInsert) while (pInsert)
@ -6523,7 +6523,7 @@ BOOL EXT_FUNC CBasePlayer::__API_VHOOK(AddPlayerItem)(CBasePlayerItem *pItem)
LINK_HOOK_CLASS_CHAIN(BOOL, CBasePlayer, RemovePlayerItem, (CBasePlayerItem *pItem), pItem) LINK_HOOK_CLASS_CHAIN(BOOL, CBasePlayer, RemovePlayerItem, (CBasePlayerItem *pItem), pItem)
BOOL EXT_FUNC CBasePlayer::__API_VHOOK(RemovePlayerItem)(CBasePlayerItem *pItem) BOOL EXT_FUNC CBasePlayer::__API_HOOK(RemovePlayerItem)(CBasePlayerItem *pItem)
{ {
if (m_pActiveItem == pItem) if (m_pActiveItem == pItem)
{ {
@ -6561,7 +6561,7 @@ BOOL EXT_FUNC CBasePlayer::__API_VHOOK(RemovePlayerItem)(CBasePlayerItem *pItem)
LINK_HOOK_CLASS_CHAIN(int, CBasePlayer, GiveAmmo, (int iCount, char *szName, int iMax), iCount, szName, iMax) LINK_HOOK_CLASS_CHAIN(int, CBasePlayer, GiveAmmo, (int iCount, char *szName, int iMax), iCount, szName, iMax)
// Returns the unique ID for the ammo, or -1 if error // Returns the unique ID for the ammo, or -1 if error
int EXT_FUNC CBasePlayer::__API_VHOOK(GiveAmmo)(int iCount, char *szName, int iMax) int EXT_FUNC CBasePlayer::__API_HOOK(GiveAmmo)(int iCount, char *szName, int iMax)
{ {
if (pev->flags & FL_SPECTATOR) if (pev->flags & FL_SPECTATOR)
return -1; return -1;
@ -6781,7 +6781,7 @@ LINK_HOOK_CLASS_VOID_CHAIN2(CBasePlayer, UpdateClientData)
// Also called at start of demo recording and playback by // Also called at start of demo recording and playback by
// ForceClientDllUpdate to ensure the demo gets messages // ForceClientDllUpdate to ensure the demo gets messages
// reflecting all of the HUD state info. // reflecting all of the HUD state info.
void EXT_FUNC CBasePlayer::__API_VHOOK(UpdateClientData)() void EXT_FUNC CBasePlayer::__API_HOOK(UpdateClientData)()
{ {
if (m_fInitHUD) if (m_fInitHUD)
{ {
@ -7138,7 +7138,7 @@ void EXT_FUNC CBasePlayer::__API_VHOOK(UpdateClientData)()
} }
} }
BOOL CBasePlayer::__MAKE_VHOOK(FBecomeProne)() BOOL CBasePlayer::FBecomeProne()
{ {
m_afPhysicsFlags |= PFLAG_ONBARNACLE; m_afPhysicsFlags |= PFLAG_ONBARNACLE;
return TRUE; return TRUE;
@ -7155,7 +7155,7 @@ NOXREF void CBasePlayer::BarnacleVictimReleased()
} }
// return player light level plus virtual muzzle flash // return player light level plus virtual muzzle flash
int CBasePlayer::__MAKE_VHOOK(Illumination)() int CBasePlayer::Illumination()
{ {
int iIllum = CBaseEntity::Illumination(); int iIllum = CBaseEntity::Illumination();
@ -7177,7 +7177,7 @@ void CBasePlayer::EnableControl(BOOL fControl)
LINK_HOOK_CLASS_VOID_CHAIN2(CBasePlayer, ResetMaxSpeed) LINK_HOOK_CLASS_VOID_CHAIN2(CBasePlayer, ResetMaxSpeed)
void EXT_FUNC CBasePlayer::__API_VHOOK(ResetMaxSpeed)() void EXT_FUNC CBasePlayer::__API_HOOK(ResetMaxSpeed)()
{ {
float speed; float speed;
@ -7221,7 +7221,7 @@ bool CBasePlayer::HintMessage(const char *pMessage, BOOL bDisplayIfPlayerDead, B
return true; return true;
} }
Vector CBasePlayer::__MAKE_VHOOK(GetAutoaimVector)(float flDelta) Vector CBasePlayer::GetAutoaimVector(float flDelta)
{ {
Vector vecSrc; Vector vecSrc;
BOOL m_fOldTargeting; BOOL m_fOldTargeting;
@ -7320,7 +7320,7 @@ int CBasePlayer::GetCustomDecalFrames()
LINK_HOOK_CLASS_VOID_CHAIN(CBasePlayer, Blind, (float duration, float holdTime, float fadeTime, int alpha), duration, holdTime, fadeTime, alpha) LINK_HOOK_CLASS_VOID_CHAIN(CBasePlayer, Blind, (float duration, float holdTime, float fadeTime, int alpha), duration, holdTime, fadeTime, alpha)
void EXT_FUNC CBasePlayer::__API_VHOOK(Blind)(float duration, float holdTime, float fadeTime, int alpha) void EXT_FUNC CBasePlayer::__API_HOOK(Blind)(float duration, float holdTime, float fadeTime, int alpha)
{ {
m_blindUntilTime = gpGlobals->time + duration; m_blindUntilTime = gpGlobals->time + duration;
m_blindStartTime = gpGlobals->time; m_blindStartTime = gpGlobals->time;
@ -7873,12 +7873,12 @@ void CBasePlayer::TabulateAmmo()
ammo_357sig = AmmoInventory(GetAmmoIndex("357SIG")); ammo_357sig = AmmoInventory(GetAmmoIndex("357SIG"));
} }
int CDeadHEV::__MAKE_VHOOK(Classify)() int CDeadHEV::Classify()
{ {
return CLASS_HUMAN_MILITARY; return CLASS_HUMAN_MILITARY;
} }
void CDeadHEV::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CDeadHEV::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "pose")) if (FStrEq(pkvd->szKeyName, "pose"))
{ {
@ -7891,7 +7891,7 @@ void CDeadHEV::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
LINK_ENTITY_TO_CLASS(monster_hevsuit_dead, CDeadHEV, CCSDeadHEV) LINK_ENTITY_TO_CLASS(monster_hevsuit_dead, CDeadHEV, CCSDeadHEV)
void CDeadHEV::__MAKE_VHOOK(Spawn)() void CDeadHEV::Spawn()
{ {
PRECACHE_MODEL("models/player.mdl"); PRECACHE_MODEL("models/player.mdl");
SET_MODEL(ENT(pev), "models/player.mdl"); SET_MODEL(ENT(pev), "models/player.mdl");
@ -7919,7 +7919,7 @@ void CDeadHEV::__MAKE_VHOOK(Spawn)()
LINK_ENTITY_TO_CLASS(player_weaponstrip, CStripWeapons, CCSStripWeapons) LINK_ENTITY_TO_CLASS(player_weaponstrip, CStripWeapons, CCSStripWeapons)
void CStripWeapons::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CStripWeapons::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
CBasePlayer *pPlayer = NULL; CBasePlayer *pPlayer = NULL;
@ -7941,7 +7941,7 @@ void CStripWeapons::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCal
LINK_ENTITY_TO_CLASS(player_loadsaved, CRevertSaved, CCSRevertSaved) LINK_ENTITY_TO_CLASS(player_loadsaved, CRevertSaved, CCSRevertSaved)
IMPLEMENT_SAVERESTORE(CRevertSaved, CPointEntity) IMPLEMENT_SAVERESTORE(CRevertSaved, CPointEntity)
void CRevertSaved::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CRevertSaved::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "duration")) if (FStrEq(pkvd->szKeyName, "duration"))
{ {
@ -7967,7 +7967,7 @@ void CRevertSaved::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CPointEntity::KeyValue(pkvd); CPointEntity::KeyValue(pkvd);
} }
void CRevertSaved::__MAKE_VHOOK(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); UTIL_ScreenFadeAll(pev->rendercolor, Duration(), HoldTime(), int(pev->renderamt), FFADE_OUT);
pev->nextthink = gpGlobals->time + MessageTime(); pev->nextthink = gpGlobals->time + MessageTime();
@ -7994,7 +7994,7 @@ void CRevertSaved::LoadThink()
SERVER_COMMAND("reload\n"); SERVER_COMMAND("reload\n");
} }
void CInfoIntermission::__MAKE_VHOOK(Spawn)() void CInfoIntermission::Spawn()
{ {
UTIL_SetOrigin(pev, pev->origin); UTIL_SetOrigin(pev, pev->origin);
@ -8004,7 +8004,7 @@ void CInfoIntermission::__MAKE_VHOOK(Spawn)()
pev->nextthink = gpGlobals->time + 2.0f; // let targets spawn! pev->nextthink = gpGlobals->time + 2.0f; // let targets spawn!
} }
void CInfoIntermission::__MAKE_VHOOK(Think)() void CInfoIntermission::Think()
{ {
// find my target // find my target
edict_t *pTarget = FIND_ENTITY_BY_TARGETNAME(NULL, STRING(pev->target)); edict_t *pTarget = FIND_ENTITY_BY_TARGETNAME(NULL, STRING(pev->target));

View File

@ -284,13 +284,6 @@ class CCSPlayer;
class CStripWeapons: public CPointEntity { class CStripWeapons: public CPointEntity {
public: public:
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
}; };
// Multiplayer intermission spots. // Multiplayer intermission spots.
@ -298,14 +291,6 @@ class CInfoIntermission: public CPointEntity {
public: public:
virtual void Spawn(); virtual void Spawn();
virtual void Think(); virtual void Think();
#ifdef HOOK_GAMEDLL
void Spawn_();
void Think_();
#endif
}; };
// Dead HEV suit prop // Dead HEV suit prop
@ -315,14 +300,6 @@ public:
virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
virtual int Classify(); virtual int Classify();
#ifdef HOOK_GAMEDLL
void Spawn_();
void KeyValue_(KeyValueData *pkvd);
int Classify_();
#endif
public: public:
int m_iPose; // which sequence to display -- temporary, don't need to save int m_iPose; // which sequence to display -- temporary, don't need to save
static char *m_szPoses[4]; static char *m_szPoses[4];
@ -333,12 +310,6 @@ public:
virtual void Think(); virtual void Think();
virtual int ObjectCaps() { return FCAP_DONT_SAVE; } virtual int ObjectCaps() { return FCAP_DONT_SAVE; }
#ifdef HOOK_GAMEDLL
void Think_();
#endif
public: public:
void Spawn(entvars_t *pevOwner); void Spawn(entvars_t *pevOwner);
}; };
@ -397,37 +368,50 @@ public:
virtual void Blind(float flUntilTime, float flHoldTime, float flFadeTime, int iAlpha); virtual void Blind(float flUntilTime, float flHoldTime, float flFadeTime, int iAlpha);
virtual void OnTouchingWeapon(CWeaponBox *pWeapon) { } virtual void OnTouchingWeapon(CWeaponBox *pWeapon) { }
#if defined(REGAMEDLL_API) || defined(HOOK_GAMEDLL) #ifdef REGAMEDLL_API
void Spawn_(); void Spawn_OrigFunc();
void Precache_(); void Precache_OrigFunc();
int ObjectCaps_(); int ObjectCaps_OrigFunc();
int Classify_(); int Classify_OrigFunc();
int Save_(CSave &save); void TraceAttack_OrigFunc(entvars_t *pevAttacker, float flDamage, VectorRef vecDir, TraceResult *ptr, int bitsDamageType);
int Restore_(CRestore &restore); BOOL TakeDamage_OrigFunc(entvars_t *pevInflictor, entvars_t *pevAttacker, FloatRef flDamage, int bitsDamageType);
void TraceAttack_(entvars_t *pevAttacker, float flDamage, VectorRef vecDir, TraceResult *ptr, int bitsDamageType); BOOL TakeHealth_OrigFunc(float flHealth, int bitsDamageType);
BOOL TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, FloatRef flDamage, int bitsDamageType); void Killed_OrigFunc(entvars_t *pevAttacker, int iGib);
BOOL TakeHealth_(float flHealth, int bitsDamageType); void AddPoints_OrigFunc(int score, BOOL bAllowNegativeScore);
void Killed_(entvars_t *pevAttacker, int iGib); void AddPointsToTeam_OrigFunc(int score, BOOL bAllowNegativeScore);
void AddPoints_(int score, BOOL bAllowNegativeScore); BOOL AddPlayerItem_OrigFunc(CBasePlayerItem *pItem);
void AddPointsToTeam_(int score, BOOL bAllowNegativeScore); BOOL RemovePlayerItem_OrigFunc(CBasePlayerItem *pItem);
BOOL AddPlayerItem_(CBasePlayerItem *pItem); int GiveAmmo_OrigFunc(int iAmount, char *szName, int iMax);
BOOL RemovePlayerItem_(CBasePlayerItem *pItem); void ResetMaxSpeed_OrigFunc();
int GiveAmmo_(int iAmount, char *szName, int iMax); void Jump_OrigFunc();
void ResetMaxSpeed_(); void Duck_OrigFunc();
void Jump_(); void PreThink_OrigFunc();
void Duck_(); void PostThink_OrigFunc();
void PreThink_(); void UpdateClientData_OrigFunc();
void PostThink_(); void ImpulseCommands_OrigFunc();
void UpdateClientData_(); void RoundRespawn_OrigFunc();
void ImpulseCommands_(); void Blind_OrigFunc(float flUntilTime, float flHoldTime, float flFadeTime, int iAlpha);
void RoundRespawn_(); CBasePlayer *Observer_IsValidTarget_OrigFunc(int iPlayerIndex, bool bSameTeam);
void Blind_(float flUntilTime, float flHoldTime, float flFadeTime, int iAlpha); void Radio_OrigFunc(const char *msg_id, const char *msg_verbose = NULL, short pitch = 100, bool showIcon = true);
const char *TeamID_(); void AddAccount_OrigFunc(int amount, RewardType type = RT_NONE, bool bTrackChange = true);
BOOL FBecomeProne_(); void Disappear_OrigFunc();
int Illumination_(); void MakeVIP_OrigFunc();
Vector GetGunPosition_(); void GiveDefaultItems_OrigFunc();
Vector GetAutoaimVector_(float flDelta); bool SetClientUserInfoName_OrigFunc(char *infobuffer, char *szNewName);
#endif void SetAnimation_OrigFunc(PLAYER_ANIM playerAnim);
void StartObserver_OrigFunc(Vector &vecPosition, Vector &vecViewAngle);
void DropPlayerItem_OrigFunc(const char *pszItemName);
CBaseEntity *GiveNamedItem_OrigFunc(const char *pszName);
void DropShield_OrigFunc(bool bDeploy = true);
void GiveShield_OrigFunc(bool bDeploy = true);
bool HasRestrictItem_OrigFunc(ItemID item, ItemRestType type);
void OnSpawnEquip_OrigFunc(bool addDefault = true, bool equipGame = true);
bool MakeBomber_OrigFunc();
bool GetIntoGame_OrigFunc();
void StartDeathCam_OrigFunc();
CCSPlayer *CSPlayer() const;
#endif // REGAMEDLL_API
public: public:
static CBasePlayer *Instance(edict_t *pent) { return (CBasePlayer *)GET_PRIVATE(pent ? pent : ENT(0)); } static CBasePlayer *Instance(edict_t *pent) { return (CBasePlayer *)GET_PRIVATE(pent ? pent : ENT(0)); }
@ -437,8 +421,6 @@ public:
void SpawnClientSideCorpse(); void SpawnClientSideCorpse();
void Observer_FindNextPlayer(bool bReverse, const char *name = NULL); void Observer_FindNextPlayer(bool bReverse, const char *name = NULL);
CBasePlayer *Observer_IsValidTarget(int iPlayerIndex, bool bSameTeam); CBasePlayer *Observer_IsValidTarget(int iPlayerIndex, bool bSameTeam);
CBasePlayer *Observer_IsValidTarget_(int iPlayerIndex, bool bSameTeam);
void Disconnect(); void Disconnect();
void Observer_Think(); void Observer_Think();
void Observer_HandleButtons(); void Observer_HandleButtons();
@ -448,17 +430,13 @@ public:
int IsObserver() { return pev->iuser1; } int IsObserver() { return pev->iuser1; }
void PlantC4(); void PlantC4();
void Radio(const char *msg_id, const char *msg_verbose = NULL, short pitch = 100, bool showIcon = true); void Radio(const char *msg_id, const char *msg_verbose = NULL, short pitch = 100, bool showIcon = true);
void Radio_(const char *msg_id, const char *msg_verbose = NULL, short pitch = 100, bool showIcon = true);
CBasePlayer *GetNextRadioRecipient(CBasePlayer *pStartPlayer); CBasePlayer *GetNextRadioRecipient(CBasePlayer *pStartPlayer);
void SmartRadio(); void SmartRadio();
void ThrowWeapon(char *pszItemName); void ThrowWeapon(char *pszItemName);
void ThrowPrimary(); void ThrowPrimary();
void AddAccount(int amount, RewardType type = RT_NONE, bool bTrackChange = true); void AddAccount(int amount, RewardType type = RT_NONE, bool bTrackChange = true);
void AddAccount_(int amount, RewardType type = RT_NONE, bool bTrackChange = true);
void Disappear(); void Disappear();
void Disappear_();
void MakeVIP(); void MakeVIP();
void MakeVIP_();
bool CanPlayerBuy(bool display = false); bool CanPlayerBuy(bool display = false);
void SwitchTeam(); void SwitchTeam();
void TabulateAmmo(); void TabulateAmmo();
@ -470,14 +448,12 @@ public:
void RenewItems(); void RenewItems();
void PackDeadPlayerItems(); void PackDeadPlayerItems();
void GiveDefaultItems(); void GiveDefaultItems();
void GiveDefaultItems_();
void RemoveAllItems(BOOL removeSuit); void RemoveAllItems(BOOL removeSuit);
void SetBombIcon(BOOL bFlash = FALSE); void SetBombIcon(BOOL bFlash = FALSE);
void SetProgressBarTime(int time); void SetProgressBarTime(int time);
void SetProgressBarTime2(int time, float timeElapsed); void SetProgressBarTime2(int time, float timeElapsed);
void SetPlayerModel(BOOL HasC4); void SetPlayerModel(BOOL HasC4);
bool SetClientUserInfoName(char *infobuffer, char *szNewName); bool SetClientUserInfoName(char *infobuffer, char *szNewName);
bool SetClientUserInfoName_(char *infobuffer, char *szNewName);
void SetClientUserInfoModel(char *infobuffer, char *szNewModel); void SetClientUserInfoModel(char *infobuffer, char *szNewModel);
void SetClientUserInfoModel_api(char *infobuffer, char *szNewModel); void SetClientUserInfoModel_api(char *infobuffer, char *szNewModel);
void SetNewPlayerModel(const char *modelName); void SetNewPlayerModel(const char *modelName);
@ -501,16 +477,12 @@ public:
void UpdatePlayerSound(); void UpdatePlayerSound();
void DeathSound(); void DeathSound();
void SetAnimation(PLAYER_ANIM playerAnim); void SetAnimation(PLAYER_ANIM playerAnim);
void SetAnimation_(PLAYER_ANIM playerAnim);
void SetWeaponAnimType(const char *szExtention) { Q_strcpy(m_szAnimExtention, szExtention); } void SetWeaponAnimType(const char *szExtention) { Q_strcpy(m_szAnimExtention, szExtention); }
void CheatImpulseCommands(int iImpulse); void CheatImpulseCommands(int iImpulse);
void StartDeathCam(); void StartDeathCam();
void StartDeathCam_();
void StartObserver(Vector &vecPosition, Vector &vecViewAngle); void StartObserver(Vector &vecPosition, Vector &vecViewAngle);
void StartObserver_(Vector &vecPosition, Vector &vecViewAngle);
void HandleSignals(); void HandleSignals();
void DropPlayerItem(const char *pszItemName); void DropPlayerItem(const char *pszItemName);
void DropPlayerItem_(const char *pszItemName);
bool HasPlayerItem(CBasePlayerItem *pCheckItem); bool HasPlayerItem(CBasePlayerItem *pCheckItem);
bool HasNamedPlayerItem(const char *pszItemName); bool HasNamedPlayerItem(const char *pszItemName);
bool HasWeapons(); bool HasWeapons();
@ -521,7 +493,6 @@ public:
void ItemPreFrame(); void ItemPreFrame();
void ItemPostFrame(); void ItemPostFrame();
CBaseEntity *GiveNamedItem(const char *pszName); CBaseEntity *GiveNamedItem(const char *pszName);
CBaseEntity *GiveNamedItem_(const char *pszName);
CBaseEntity *GiveNamedItemEx(const char *pszName); CBaseEntity *GiveNamedItemEx(const char *pszName);
void EnableControl(BOOL fControl); void EnableControl(BOOL fControl);
bool HintMessage(const char *pMessage, BOOL bDisplayIfPlayerDead = FALSE, BOOL bOverride = FALSE); bool HintMessage(const char *pMessage, BOOL bDisplayIfPlayerDead = FALSE, BOOL bOverride = FALSE);
@ -570,9 +541,7 @@ public:
bool IsProtectedByShield() { return HasShield() && m_bShieldDrawn; } bool IsProtectedByShield() { return HasShield() && m_bShieldDrawn; }
void RemoveShield(); void RemoveShield();
void DropShield(bool bDeploy = true); void DropShield(bool bDeploy = true);
void DropShield_(bool bDeploy = true);
void GiveShield(bool bDeploy = true); void GiveShield(bool bDeploy = true);
void GiveShield_(bool bDeploy = true);
bool IsHittingShield(Vector &vecDirection, TraceResult *ptr); bool IsHittingShield(Vector &vecDirection, TraceResult *ptr);
bool SelectSpawnSpot(const char *pEntClassName, CBaseEntity* &pSpot); bool SelectSpawnSpot(const char *pEntClassName, CBaseEntity* &pSpot);
bool IsReloading() const; bool IsReloading() const;
@ -616,28 +585,17 @@ public:
void ReloadWeapons(CBasePlayerItem *pWeapon = nullptr, bool bForceReload = false, bool bForceRefill = false); void ReloadWeapons(CBasePlayerItem *pWeapon = nullptr, bool bForceReload = false, bool bForceRefill = false);
void TeamChangeUpdate(); void TeamChangeUpdate();
bool HasRestrictItem(ItemID item, ItemRestType type); bool HasRestrictItem(ItemID item, ItemRestType type);
bool HasRestrictItem_(ItemID item, ItemRestType type);
void DropSecondary(); void DropSecondary();
void DropPrimary(); void DropPrimary();
void OnSpawnEquip(bool addDefault = true, bool equipGame = true); void OnSpawnEquip(bool addDefault = true, bool equipGame = true);
void OnSpawnEquip_(bool addDefault = true, bool equipGame = true);
void RemoveBomb(); void RemoveBomb();
void HideTimer(); void HideTimer();
bool MakeBomber(); bool MakeBomber();
bool MakeBomber_();
bool GetIntoGame(); bool GetIntoGame();
bool GetIntoGame_();
CBasePlayerItem *GetItemByName(const char *itemName); CBasePlayerItem *GetItemByName(const char *itemName);
CBasePlayerItem *GetItemById(WeaponIdType weaponID); CBasePlayerItem *GetItemById(WeaponIdType weaponID);
#ifdef REGAMEDLL_API
CCSPlayer *CSPlayer() const;
#endif
// templates // templates
template<typename Functor> template<typename Functor>
CBasePlayerItem *ForEachItem(int slot, const Functor &func) CBasePlayerItem *ForEachItem(int slot, const Functor &func)
@ -871,13 +829,6 @@ public:
virtual void Spawn(); virtual void Spawn();
virtual void EXPORT Touch(CBaseEntity *pOther); virtual void EXPORT Touch(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_();
void Touch_(CBaseEntity *pOther);
#endif
public: public:
void SetCantBePickedUpByUser(CBaseEntity *pEntity, float time) void SetCantBePickedUpByUser(CBaseEntity *pEntity, float time)
{ {

View File

@ -40,15 +40,6 @@ public:
virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
public: public:
void EXPORT MessageThink(); void EXPORT MessageThink();
void EXPORT LoadThink(); void EXPORT LoadThink();

View File

@ -42,16 +42,16 @@
#define IMPL_CLASS(baseClass,var)\ #define IMPL_CLASS(baseClass,var)\
baseClass::var baseClass::var
#endif #endif // HOOK_GAMEDLL
#define IMPLEMENT_SAVERESTORE(derivedClass, baseClass)\ #define IMPLEMENT_SAVERESTORE(derivedClass, baseClass)\
int derivedClass::__MAKE_VHOOK(Save)(CSave &save)\ int derivedClass::Save(CSave &save)\
{\ {\
if (!baseClass::Save(save))\ if (!baseClass::Save(save))\
return 0;\ return 0;\
return save.WriteFields(#derivedClass, this, IMPL(m_SaveData), ARRAYSIZE(IMPL(m_SaveData)));\ return save.WriteFields(#derivedClass, this, IMPL(m_SaveData), ARRAYSIZE(IMPL(m_SaveData)));\
}\ }\
int derivedClass::__MAKE_VHOOK(Restore)(CRestore &restore)\ int derivedClass::Restore(CRestore &restore)\
{\ {\
if (!baseClass::Restore(restore))\ if (!baseClass::Restore(restore))\
return 0;\ return 0;\
@ -126,12 +126,8 @@ public:
void WriteFunction(const char *pname, void **data, int count); void WriteFunction(const char *pname, void **data, int count);
int WriteEntVars(const char *pname, entvars_t *pev); int WriteEntVars(const char *pname, entvars_t *pev);
int WriteFields(const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); int WriteFields(const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount);
private: private:
#ifdef HOOK_GAMEDLL
public:
#endif
int DataEmpty(const char *pdata, int size); int DataEmpty(const char *pdata, int size);
void BufferField(const char *pname, int size, const char *pdata); void BufferField(const char *pname, int size, const char *pdata);
void BufferString(char *pdata, int len); void BufferString(char *pdata, int len);

View File

@ -6,27 +6,27 @@ CHalfLifeRules::CHalfLifeRules()
RefreshSkillData(); RefreshSkillData();
} }
void CHalfLifeRules::__MAKE_VHOOK(Think)() void CHalfLifeRules::Think()
{ {
; ;
} }
BOOL CHalfLifeRules::__MAKE_VHOOK(IsMultiplayer)() BOOL CHalfLifeRules::IsMultiplayer()
{ {
return FALSE; return FALSE;
} }
BOOL CHalfLifeRules::__MAKE_VHOOK(IsDeathmatch)() BOOL CHalfLifeRules::IsDeathmatch()
{ {
return FALSE; return FALSE;
} }
BOOL CHalfLifeRules::__MAKE_VHOOK(IsCoOp)() BOOL CHalfLifeRules::IsCoOp()
{ {
return FALSE; return FALSE;
} }
BOOL CHalfLifeRules::__MAKE_VHOOK(FShouldSwitchWeapon)(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon) BOOL CHalfLifeRules::FShouldSwitchWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon)
{ {
if (!pPlayer->m_pActiveItem) if (!pPlayer->m_pActiveItem)
{ {
@ -42,27 +42,27 @@ BOOL CHalfLifeRules::__MAKE_VHOOK(FShouldSwitchWeapon)(CBasePlayer *pPlayer, CBa
return TRUE; return TRUE;
} }
BOOL CHalfLifeRules::__MAKE_VHOOK(GetNextBestWeapon)(CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeapon) BOOL CHalfLifeRules::GetNextBestWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeapon)
{ {
return FALSE; return FALSE;
} }
BOOL CHalfLifeRules::__MAKE_VHOOK(ClientConnected)(edict_t *pEntity, const char *pszName, const char *pszAddress, char *szRejectReason) BOOL CHalfLifeRules::ClientConnected(edict_t *pEntity, const char *pszName, const char *pszAddress, char *szRejectReason)
{ {
return TRUE; return TRUE;
} }
void CHalfLifeRules::__MAKE_VHOOK(InitHUD)(CBasePlayer *pl) void CHalfLifeRules::InitHUD(CBasePlayer *pl)
{ {
; ;
} }
void CHalfLifeRules::__MAKE_VHOOK(ClientDisconnected)(edict_t *pClient) void CHalfLifeRules::ClientDisconnected(edict_t *pClient)
{ {
; ;
} }
float CHalfLifeRules::__MAKE_VHOOK(FlPlayerFallDamage)(CBasePlayer *pPlayer) float CHalfLifeRules::FlPlayerFallDamage(CBasePlayer *pPlayer)
{ {
// subtract off the speed at which a player is allowed to fall without being hurt, // subtract off the speed at which a player is allowed to fall without being hurt,
// so damage will be based on speed beyond that, not the entire fall // so damage will be based on speed beyond that, not the entire fall
@ -70,7 +70,7 @@ float CHalfLifeRules::__MAKE_VHOOK(FlPlayerFallDamage)(CBasePlayer *pPlayer)
return pPlayer->m_flFallVelocity * DAMAGE_FOR_FALL_SPEED; return pPlayer->m_flFallVelocity * DAMAGE_FOR_FALL_SPEED;
} }
void CHalfLifeRules::__MAKE_VHOOK(PlayerSpawn)(CBasePlayer *pPlayer) void CHalfLifeRules::PlayerSpawn(CBasePlayer *pPlayer)
{ {
pPlayer->pev->weapons |= (1 << WEAPON_SUIT); pPlayer->pev->weapons |= (1 << WEAPON_SUIT);
@ -83,62 +83,62 @@ void CHalfLifeRules::__MAKE_VHOOK(PlayerSpawn)(CBasePlayer *pPlayer)
pPlayer->GiveAmmo(24, "45acp"); pPlayer->GiveAmmo(24, "45acp");
} }
BOOL CHalfLifeRules::__MAKE_VHOOK(AllowAutoTargetCrosshair)() BOOL CHalfLifeRules::AllowAutoTargetCrosshair()
{ {
return (g_iSkillLevel == SKILL_EASY); return (g_iSkillLevel == SKILL_EASY);
} }
void CHalfLifeRules::__MAKE_VHOOK(PlayerThink)(CBasePlayer *pPlayer) void CHalfLifeRules::PlayerThink(CBasePlayer *pPlayer)
{ {
; ;
} }
BOOL CHalfLifeRules::__MAKE_VHOOK(FPlayerCanRespawn)(CBasePlayer *pPlayer) BOOL CHalfLifeRules::FPlayerCanRespawn(CBasePlayer *pPlayer)
{ {
return TRUE; return TRUE;
} }
float CHalfLifeRules::__MAKE_VHOOK(FlPlayerSpawnTime)(CBasePlayer *pPlayer) float CHalfLifeRules::FlPlayerSpawnTime(CBasePlayer *pPlayer)
{ {
return gpGlobals->time; return gpGlobals->time;
} }
int CHalfLifeRules::__MAKE_VHOOK(IPointsForKill)(CBasePlayer *pAttacker, CBasePlayer *pKilled) int CHalfLifeRules::IPointsForKill(CBasePlayer *pAttacker, CBasePlayer *pKilled)
{ {
return 1; return 1;
} }
void CHalfLifeRules::__MAKE_VHOOK(PlayerKilled)(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor) void CHalfLifeRules::PlayerKilled(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor)
{ {
; ;
} }
void CHalfLifeRules::__MAKE_VHOOK(DeathNotice)(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor) void CHalfLifeRules::DeathNotice(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor)
{ {
; ;
} }
void CHalfLifeRules::__MAKE_VHOOK(PlayerGotWeapon)(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon) void CHalfLifeRules::PlayerGotWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon)
{ {
; ;
} }
float CHalfLifeRules::__MAKE_VHOOK(FlWeaponRespawnTime)(CBasePlayerItem *pWeapon) float CHalfLifeRules::FlWeaponRespawnTime(CBasePlayerItem *pWeapon)
{ {
return -1; return -1;
} }
float CHalfLifeRules::__MAKE_VHOOK(FlWeaponTryRespawn)(CBasePlayerItem *pWeapon) float CHalfLifeRules::FlWeaponTryRespawn(CBasePlayerItem *pWeapon)
{ {
return 0; return 0;
} }
Vector CHalfLifeRules::__MAKE_VHOOK(VecWeaponRespawnSpot)(CBasePlayerItem *pWeapon) Vector CHalfLifeRules::VecWeaponRespawnSpot(CBasePlayerItem *pWeapon)
{ {
return pWeapon->pev->origin; return pWeapon->pev->origin;
} }
edict_t *CHalfLifeRules::__MAKE_VHOOK(GetPlayerSpawnSpot)(CBasePlayer *pPlayer) edict_t *CHalfLifeRules::GetPlayerSpawnSpot(CBasePlayer *pPlayer)
{ {
CBaseEntity *pSpot = UTIL_FindEntityByClassname(NULL, "info_player_start"); CBaseEntity *pSpot = UTIL_FindEntityByClassname(NULL, "info_player_start");
@ -158,83 +158,83 @@ edict_t *CHalfLifeRules::__MAKE_VHOOK(GetPlayerSpawnSpot)(CBasePlayer *pPlayer)
return pSpot->edict(); return pSpot->edict();
} }
int CHalfLifeRules::__MAKE_VHOOK(WeaponShouldRespawn)(CBasePlayerItem *pWeapon) int CHalfLifeRules::WeaponShouldRespawn(CBasePlayerItem *pWeapon)
{ {
return GR_WEAPON_RESPAWN_NO; return GR_WEAPON_RESPAWN_NO;
} }
BOOL CHalfLifeRules::__MAKE_VHOOK(CanHaveItem)(CBasePlayer *pPlayer, CItem *pItem) BOOL CHalfLifeRules::CanHaveItem(CBasePlayer *pPlayer, CItem *pItem)
{ {
return TRUE; return TRUE;
} }
void CHalfLifeRules::__MAKE_VHOOK(PlayerGotItem)(CBasePlayer *pPlayer, CItem *pItem) void CHalfLifeRules::PlayerGotItem(CBasePlayer *pPlayer, CItem *pItem)
{ {
; ;
} }
int CHalfLifeRules::__MAKE_VHOOK(ItemShouldRespawn)(CItem *pItem) int CHalfLifeRules::ItemShouldRespawn(CItem *pItem)
{ {
return GR_ITEM_RESPAWN_NO; return GR_ITEM_RESPAWN_NO;
} }
float CHalfLifeRules::__MAKE_VHOOK(FlItemRespawnTime)(CItem *pItem) float CHalfLifeRules::FlItemRespawnTime(CItem *pItem)
{ {
return -1; return -1;
} }
Vector CHalfLifeRules::__MAKE_VHOOK(VecItemRespawnSpot)(CItem *pItem) Vector CHalfLifeRules::VecItemRespawnSpot(CItem *pItem)
{ {
return pItem->pev->origin; return pItem->pev->origin;
} }
BOOL CHalfLifeRules::__MAKE_VHOOK(IsAllowedToSpawn)(CBaseEntity *pEntity) BOOL CHalfLifeRules::IsAllowedToSpawn(CBaseEntity *pEntity)
{ {
return TRUE; return TRUE;
} }
void CHalfLifeRules::__MAKE_VHOOK(PlayerGotAmmo)(CBasePlayer *pPlayer, char *szName, int iCount) void CHalfLifeRules::PlayerGotAmmo(CBasePlayer *pPlayer, char *szName, int iCount)
{ {
; ;
} }
int CHalfLifeRules::__MAKE_VHOOK(AmmoShouldRespawn)(CBasePlayerAmmo *pAmmo) int CHalfLifeRules::AmmoShouldRespawn(CBasePlayerAmmo *pAmmo)
{ {
return GR_AMMO_RESPAWN_NO; return GR_AMMO_RESPAWN_NO;
} }
float CHalfLifeRules::__MAKE_VHOOK(FlAmmoRespawnTime)(CBasePlayerAmmo *pAmmo) float CHalfLifeRules::FlAmmoRespawnTime(CBasePlayerAmmo *pAmmo)
{ {
return -1; return -1;
} }
Vector CHalfLifeRules::__MAKE_VHOOK(VecAmmoRespawnSpot)(CBasePlayerAmmo *pAmmo) Vector CHalfLifeRules::VecAmmoRespawnSpot(CBasePlayerAmmo *pAmmo)
{ {
return pAmmo->pev->origin; return pAmmo->pev->origin;
} }
float CHalfLifeRules::__MAKE_VHOOK(FlHealthChargerRechargeTime)() float CHalfLifeRules::FlHealthChargerRechargeTime()
{ {
return 0; return 0;
} }
int CHalfLifeRules::__MAKE_VHOOK(DeadPlayerWeapons)(CBasePlayer *pPlayer) int CHalfLifeRules::DeadPlayerWeapons(CBasePlayer *pPlayer)
{ {
return GR_PLR_DROP_GUN_NO; return GR_PLR_DROP_GUN_NO;
} }
int CHalfLifeRules::__MAKE_VHOOK(DeadPlayerAmmo)(CBasePlayer *pPlayer) int CHalfLifeRules::DeadPlayerAmmo(CBasePlayer *pPlayer)
{ {
return GR_PLR_DROP_AMMO_NO; return GR_PLR_DROP_AMMO_NO;
} }
int CHalfLifeRules::__MAKE_VHOOK(PlayerRelationship)(CBasePlayer *pPlayer, CBaseEntity *pTarget) int CHalfLifeRules::PlayerRelationship(CBasePlayer *pPlayer, CBaseEntity *pTarget)
{ {
// why would a single player in half life need this? // why would a single player in half life need this?
return GR_NOTTEAMMATE; return GR_NOTTEAMMATE;
} }
BOOL CHalfLifeRules::__MAKE_VHOOK(FAllowMonsters)() BOOL CHalfLifeRules::FAllowMonsters()
{ {
return TRUE; return TRUE;
} }

View File

@ -87,7 +87,7 @@ IMPLEMENT_SAVERESTORE(CAmbientGeneric, CBaseEntity)
// 200 : "Small Radius" // 200 : "Small Radius"
// 125 : "Medium Radius" // 125 : "Medium Radius"
// 80 : "Large Radius" // 80 : "Large Radius"
void CAmbientGeneric::__MAKE_VHOOK(Spawn)() void CAmbientGeneric::Spawn()
{ {
if (pev->spawnflags & AMBIENT_SOUND_EVERYWHERE) if (pev->spawnflags & AMBIENT_SOUND_EVERYWHERE)
{ {
@ -144,7 +144,7 @@ void CAmbientGeneric::__MAKE_VHOOK(Spawn)()
Precache(); Precache();
} }
void CAmbientGeneric::__MAKE_VHOOK(Restart)() void CAmbientGeneric::Restart()
{ {
if (pev->spawnflags & AMBIENT_SOUND_EVERYWHERE) if (pev->spawnflags & AMBIENT_SOUND_EVERYWHERE)
{ {
@ -210,7 +210,7 @@ void CAmbientGeneric::__MAKE_VHOOK(Restart)()
} }
} }
void CAmbientGeneric::__MAKE_VHOOK(Precache)() void CAmbientGeneric::Precache()
{ {
char *szSoundFile = (char *)STRING(pev->message); char *szSoundFile = (char *)STRING(pev->message);
@ -658,7 +658,7 @@ void CAmbientGeneric::ToggleUse(CBaseEntity *pActivator, CBaseEntity *pCaller, U
// KeyValue - load keyvalue pairs into member data of the // KeyValue - load keyvalue pairs into member data of the
// ambient generic. NOTE: called BEFORE spawn! // ambient generic. NOTE: called BEFORE spawn!
void CAmbientGeneric::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CAmbientGeneric::KeyValue(KeyValueData *pkvd)
{ {
// NOTE: changing any of the modifiers in this code // NOTE: changing any of the modifiers in this code
// NOTE: also requires changing InitModulationParms code. // NOTE: also requires changing InitModulationParms code.
@ -857,7 +857,7 @@ void CAmbientGeneric::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
LINK_ENTITY_TO_CLASS(env_sound, CEnvSound, CCSEnvSound) LINK_ENTITY_TO_CLASS(env_sound, CEnvSound, CCSEnvSound)
IMPLEMENT_SAVERESTORE(CEnvSound, CBaseEntity) IMPLEMENT_SAVERESTORE(CEnvSound, CBaseEntity)
void CEnvSound::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CEnvSound::KeyValue(KeyValueData *pkvd)
{ {
if (FStrEq(pkvd->szKeyName, "radius")) if (FStrEq(pkvd->szKeyName, "radius"))
{ {
@ -913,7 +913,7 @@ BOOL FEnvSoundInRange(entvars_t *pev, entvars_t *pevTarget, float *pflRange)
// a new in-range, visible sound entity resets a new room_type. // a new in-range, visible sound entity resets a new room_type.
// //
// CONSIDER: if player in water state, autoset roomtype to 14,15 or 16. // CONSIDER: if player in water state, autoset roomtype to 14,15 or 16.
void CEnvSound::__MAKE_VHOOK(Think)() void CEnvSound::Think()
{ {
// get pointer to client if visible; FIND_CLIENT_IN_PVS will // get pointer to client if visible; FIND_CLIENT_IN_PVS will
// cycle through visible clients on consecutive calls. // cycle through visible clients on consecutive calls.
@ -1006,7 +1006,7 @@ void CEnvSound::__MAKE_VHOOK(Think)()
// env_sound - spawn a sound entity that will set player roomtype // env_sound - spawn a sound entity that will set player roomtype
// when player moves in range and sight. // when player moves in range and sight.
void CEnvSound::__MAKE_VHOOK(Spawn)() void CEnvSound::Spawn()
{ {
// spread think times // spread think times
pev->nextthink = gpGlobals->time + RANDOM_FLOAT(0.0, 0.5); pev->nextthink = gpGlobals->time + RANDOM_FLOAT(0.0, 0.5);
@ -1819,7 +1819,7 @@ LINK_ENTITY_TO_CLASS(speaker, CSpeaker, CCSSpeaker)
IMPLEMENT_SAVERESTORE(CSpeaker, CBaseEntity) IMPLEMENT_SAVERESTORE(CSpeaker, CBaseEntity)
// ambient_generic - general-purpose user-defined static sound // ambient_generic - general-purpose user-defined static sound
void CSpeaker::__MAKE_VHOOK(Spawn)() void CSpeaker::Spawn()
{ {
char *szSoundFile = (char *)STRING(pev->message); char *szSoundFile = (char *)STRING(pev->message);
@ -1843,7 +1843,7 @@ void CSpeaker::__MAKE_VHOOK(Spawn)()
Precache(); Precache();
} }
void CSpeaker::__MAKE_VHOOK(Precache)() void CSpeaker::Precache()
{ {
if (!(pev->spawnflags & SPEAKER_START_SILENT)) if (!(pev->spawnflags & SPEAKER_START_SILENT))
{ {
@ -1970,7 +1970,7 @@ void CSpeaker::ToggleUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE
// KeyValue - load keyvalue pairs into member data // KeyValue - load keyvalue pairs into member data
// NOTE: called BEFORE spawn! // NOTE: called BEFORE spawn!
void CSpeaker::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CSpeaker::KeyValue(KeyValueData *pkvd)
{ {
// preset // preset
if (FStrEq(pkvd->szKeyName, "preset")) if (FStrEq(pkvd->szKeyName, "preset"))

View File

@ -116,17 +116,6 @@ public:
virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); } virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); }
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
void Restart_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
#endif
public: public:
void EXPORT ToggleUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); void EXPORT ToggleUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void EXPORT RampThink(); void EXPORT RampThink();
@ -150,16 +139,6 @@ public:
virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
virtual void Think(); virtual void Think();
#ifdef HOOK_GAMEDLL
void Spawn_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Think_();
#endif
public: public:
static TYPEDESCRIPTION IMPL(m_SaveData)[2]; static TYPEDESCRIPTION IMPL(m_SaveData)[2];
@ -177,16 +156,6 @@ public:
virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); } virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); }
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
#endif
public: public:
void EXPORT ToggleUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); void EXPORT ToggleUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void EXPORT SpeakerThink(); void EXPORT SpeakerThink();

View File

@ -54,7 +54,7 @@ NOXREF BOOL CSound::FIsScent()
return FALSE; return FALSE;
} }
void CSoundEnt::__MAKE_VHOOK(Spawn)() void CSoundEnt::Spawn()
{ {
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
Initialize(); Initialize();
@ -65,7 +65,7 @@ void CSoundEnt::__MAKE_VHOOK(Spawn)()
// Think - at interval, the entire active sound list is checked // Think - at interval, the entire active sound list is checked
// for sounds that have ExpireTimes less than or equal // for sounds that have ExpireTimes less than or equal
// to the current world time, and these sounds are deallocated. // to the current world time, and these sounds are deallocated.
void CSoundEnt::__MAKE_VHOOK(Think)() void CSoundEnt::Think()
{ {
int iSound; int iSound;
int iPreviousSound; int iPreviousSound;
@ -102,7 +102,7 @@ void CSoundEnt::__MAKE_VHOOK(Think)()
} }
// Precache - dummy function // Precache - dummy function
void CSoundEnt::__MAKE_VHOOK(Precache)() void CSoundEnt::Precache()
{ {
; ;
} }

View File

@ -84,14 +84,6 @@ public:
virtual int ObjectCaps() { return FCAP_DONT_SAVE; } virtual int ObjectCaps() { return FCAP_DONT_SAVE; }
virtual void Think(); virtual void Think();
#ifdef HOOK_GAMEDLL
void Spawn_();
void Precache_();
void Think_();
#endif
public: public:
void Initialize(); void Initialize();

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