WIP CZ: Reversed functions from Improved hostages

This commit is contained in:
s1lentq 2015-12-23 00:07:49 +06:00
parent 6b05ce2c89
commit 9416463508
45 changed files with 4266 additions and 2444 deletions

View File

@ -28,7 +28,7 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure'
## Current status ## Current status
<ul> <ul>
<li> Counter-Strike 1.6 - 100%</li> <li> Counter-Strike 1.6 - 100%</li>
<li> Counter-Strike: Condition Zero - 35%</li> <li> Counter-Strike: Condition Zero - 63%</li>
</ul> </ul>
## Build instructions ## Build instructions

View File

@ -32,7 +32,7 @@
#pragma once #pragma once
#endif #endif
#ifdef HOOK_GAMEDLL #ifdef PLAY_GAMEDLL
// probably gamedll compiled with flag /fpmath:fasted, // probably gamedll compiled with flag /fpmath:fasted,
// so we need to use type double, otherwise will be the test failed // so we need to use type double, otherwise will be the test failed
@ -43,7 +43,7 @@ typedef double float_precision;
typedef float float_precision; typedef float float_precision;
#endif // HOOK_GAMEDLL #endif // PLAY_GAMEDLL
/* <42b7f> ../common/mathlib.h:3 */ /* <42b7f> ../common/mathlib.h:3 */
typedef float vec_t; typedef float vec_t;

View File

@ -58,7 +58,7 @@ int GetBodygroup(void *pmodel, entvars_t *pev, int iGroup);
C_DLLEXPORT int Server_GetBlendingInterface(int version, struct sv_blending_interface_s **ppinterface, struct engine_studio_api_s *pstudio, float *rotationmatrix, float *bonetransform); C_DLLEXPORT int Server_GetBlendingInterface(int version, struct sv_blending_interface_s **ppinterface, struct engine_studio_api_s *pstudio, float *rotationmatrix, float *bonetransform);
void AngleQuaternion(vec_t *angles, vec_t *quaternion); void AngleQuaternion(vec_t *angles, vec_t *quaternion);
void QuaternionSlerp(vec_t *p, vec_t *q, float t, vec_t *qt); void QuaternionSlerp(vec_t *p, vec_t *q, float t, vec_t *qt);
NOBODY void QuaternionMatrix(vec_t *quaternion, float (*matrix)[4]); void QuaternionMatrix(vec_t *quaternion, float (*matrix)[4]);
mstudioanim_t *StudioGetAnim(model_t *m_pSubModel, mstudioseqdesc_t *pseqdesc); mstudioanim_t *StudioGetAnim(model_t *m_pSubModel, mstudioseqdesc_t *pseqdesc);
mstudioanim_t *LookupAnimation(model_t *model, mstudioseqdesc_t *pseqdesc, int index); mstudioanim_t *LookupAnimation(model_t *model, mstudioseqdesc_t *pseqdesc, int index);
void StudioCalcBoneAdj(float dadt, float *adj, const byte *pcontroller1, const byte *pcontroller2, byte mouthopen); void StudioCalcBoneAdj(float dadt, float *adj, const byte *pcontroller1, const byte *pcontroller2, byte mouthopen);

View File

@ -3,8 +3,12 @@
/* <333bca> ../cstrike/dlls/bot/cs_bot_init.cpp:57 */ /* <333bca> ../cstrike/dlls/bot/cs_bot_init.cpp:57 */
NOBODY void InstallBotControl(void) NOBODY void InstallBotControl(void)
{ {
// ~CBotManager(CBotManager *const this, if (TheBots != NULL)
// int const __in_chrg); // 60 {
delete TheBots;
}
TheBots = new CCSBotManager;
} }
/* <333cb3> ../cstrike/dlls/bot/cs_bot_init.cpp:68 */ /* <333cb3> ../cstrike/dlls/bot/cs_bot_init.cpp:68 */

View File

@ -718,7 +718,7 @@ public:
int LookupSequence(const char *label); int LookupSequence(const char *label);
void ResetSequenceInfo(void); void ResetSequenceInfo(void);
void DispatchAnimEvents(float flFutureInterval = 0.1f); void DispatchAnimEvents(float flFutureInterval = 0.1f);
float SetBoneController(int iController, float flValue); float SetBoneController(int iController, float flValue = 0.0f);
void InitBoneControllers(void); void InitBoneControllers(void);
NOXREF float SetBlending(int iBlender, float flValue); NOXREF float SetBlending(int iBlender, float flValue);

View File

@ -2271,7 +2271,7 @@ BOOL HandleMenu_ChooseTeam(CBasePlayer *player, int slot)
TheBots->OnEvent(EVENT_PLAYER_CHANGED_TEAM, player); TheBots->OnEvent(EVENT_PLAYER_CHANGED_TEAM, player);
} }
TeamChangeUpdate(player, team); TeamChangeUpdate(player, player->m_iTeam);
szOldTeam = GetTeam(oldTeam); szOldTeam = GetTeam(oldTeam);
szNewTeam = GetTeam(team); szNewTeam = GetTeam(team);

View File

@ -794,14 +794,14 @@ int CBaseMonster::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *p
if (pInflictor) if (pInflictor)
{ {
#if 0 #ifndef PLAY_GAMEDLL
vecDir = (pInflictor->Center() - Vector(0, 0, 10) - Center()).Normalize(); vecDir = (pInflictor->Center() - Vector(0, 0, 10) - Center()).Normalize();
#else #else
// TODO: fix test demo // TODO: fix test demo
vecDir = NormalizeSubtract< vecDir = NormalizeSubtract<
float_precision, float, float_precision, float_precision float_precision, float, float_precision, float_precision
>(Center(), pInflictor->Center() - Vector(0, 0, 10)); >(Center(), pInflictor->Center() - Vector(0, 0, 10));
#endif #endif // PLAY_GAMEDLL
vecDir = g_vecAttackDir = vecDir.Normalize(); vecDir = g_vecAttackDir = vecDir.Normalize();
} }
} }

View File

@ -40,13 +40,13 @@ edict_t *CGameRules::__MAKE_VHOOK(GetPlayerSpawnSpot)(CBasePlayer *pPlayer)
{ {
edict_t *pentSpawnSpot = EntSelectSpawnPoint(pPlayer); edict_t *pentSpawnSpot = EntSelectSpawnPoint(pPlayer);
#if HOOK_GAMEDLL #ifndef PLAY_GAMEDLL
pPlayer->pev->origin = VARS(pentSpawnSpot)->origin + Vector(0, 0, 1);
#else
// TODO: fix test demo // TODO: fix test demo
pPlayer->pev->origin = VARS(pentSpawnSpot)->origin; pPlayer->pev->origin = VARS(pentSpawnSpot)->origin;
pPlayer->pev->origin.z += 1; pPlayer->pev->origin.z += 1;
#else #endif // PLAY_GAMEDLL
pPlayer->pev->origin = VARS(pentSpawnSpot)->origin + Vector(0, 0, 1);
#endif // HOOK_GAMEDLL
pPlayer->pev->v_angle = g_vecZero; pPlayer->pev->v_angle = g_vecZero;
pPlayer->pev->velocity = g_vecZero; pPlayer->pev->velocity = g_vecZero;

View File

@ -192,7 +192,7 @@ void CHostage::SetActivity(int act)
void CHostage::IdleThink(void) void CHostage::IdleThink(void)
{ {
float flInterval; float flInterval;
const float upkeepRate = 0.3f; const float upkeepRate = 0.03f;
const float giveUpTime = (1 / 30.0f); const float giveUpTime = (1 / 30.0f);
float const updateRate = 0.1f; float const updateRate = 0.1f;
@ -240,7 +240,7 @@ void CHostage::IdleThink(void)
return; return;
} }
if (m_hTargetEnt != NULL && (m_bStuck && gpGlobals->time - m_flStuckTime > 5.0 || m_hTargetEnt->pev->deadflag != DEAD_NO)) if (m_hTargetEnt != NULL && (m_bStuck && gpGlobals->time - m_flStuckTime > 5.0f || m_hTargetEnt->pev->deadflag != DEAD_NO))
{ {
m_State = STAND; m_State = STAND;
m_hTargetEnt = NULL; m_hTargetEnt = NULL;
@ -325,8 +325,8 @@ void CHostage::IdleThink(void)
MESSAGE_BEGIN(MSG_SPEC, SVC_DIRECTOR); MESSAGE_BEGIN(MSG_SPEC, SVC_DIRECTOR);
WRITE_BYTE(9); WRITE_BYTE(9);
WRITE_BYTE(DRC_CMD_EVENT); WRITE_BYTE(DRC_CMD_EVENT);
WRITE_SHORT((player != NULL) ? player->entindex() : 0); WRITE_SHORT(player != NULL ? player->entindex() : 0);
WRITE_SHORT(player->entindex()); WRITE_SHORT(entindex());
WRITE_LONG(15); WRITE_LONG(15);
MESSAGE_END(); MESSAGE_END();
@ -840,7 +840,7 @@ void CHostage::__MAKE_VHOOK(Touch)(CBaseEntity *pOther)
vPush = (pev->origin - pOther->pev->origin).Make2D(); vPush = (pev->origin - pOther->pev->origin).Make2D();
#ifndef HOOK_GAMEDLL #ifndef PLAY_GAMEDLL
vPush = vPush.Normalize() * pushForce; vPush = vPush.Normalize() * pushForce;
pev->velocity.x += vPush.x; pev->velocity.x += vPush.x;
@ -848,7 +848,7 @@ void CHostage::__MAKE_VHOOK(Touch)(CBaseEntity *pOther)
#else #else
// TODO: fix test demo // TODO: fix test demo
pev->velocity = pev->velocity + NormalizeMulScalar<float_precision, float_precision, float>(vPush, pushForce); pev->velocity = pev->velocity + NormalizeMulScalar<float_precision, float_precision, float>(vPush, pushForce);
#endif // HOOK_GAMEDLL #endif // PLAY_GAMEDLL
} }
/* <45dd66> ../cstrike/dlls/hostage/hostage.cpp:910 */ /* <45dd66> ../cstrike/dlls/hostage/hostage.cpp:910 */
@ -1173,14 +1173,14 @@ void CHostage::Wiggle(void)
} }
} }
#ifndef HOOK_GAMEDLL #ifndef PLAY_GAMEDLL
vec = vec + Vector(RANDOM_FLOAT(-3, 3), RANDOM_FLOAT(-3, 3), 0); vec = vec + Vector(RANDOM_FLOAT(-3, 3), RANDOM_FLOAT(-3, 3), 0);
#else #else
// TODO: fix test demo // TODO: fix test demo
vec.y = vec.y + RANDOM_FLOAT(-3.0, 3.0); vec.y = vec.y + RANDOM_FLOAT(-3.0, 3.0);
vec.x = vec.x + RANDOM_FLOAT(-3.0, 3.0); vec.x = vec.x + RANDOM_FLOAT(-3.0, 3.0);
#endif // HOOK_GAMEDLL #endif // PLAY_GAMEDLL
pev->velocity = pev->velocity + (vec.Normalize() * 100); pev->velocity = pev->velocity + (vec.Normalize() * 100);
} }

View File

@ -154,12 +154,10 @@ public:
bool IsFollowingSomeone(void) bool IsFollowingSomeone(void)
{ {
UNTESTED
return m_improv->IsFollowing(); return m_improv->IsFollowing();
} }
CBaseEntity *GetLeader(void) CBaseEntity *GetLeader(void)
{ {
UNTESTED
if (m_improv != NULL) if (m_improv != NULL)
{ {
return m_improv->GetFollowLeader(); return m_improv->GetFollowLeader();
@ -173,19 +171,20 @@ public:
} }
bool IsValid(void) bool IsValid(void)
{ {
UNTESTED
return (pev->takedamage == DAMAGE_YES); return (pev->takedamage == DAMAGE_YES);
} }
bool IsDead(void) bool IsDead(void)
{ {
UNTESTED
return (pev->deadflag == DEAD_DEAD); return (pev->deadflag == DEAD_DEAD);
} }
bool IsAtHome(void) bool IsAtHome(void)
{ {
return (pev->origin - m_vStart).IsLengthGreaterThan(20) != true; return (pev->origin - m_vStart).IsLengthGreaterThan(20) != true;
} }
NOBODY const Vector *GetHomePosition(void); const Vector *GetHomePosition(void)
{
return &m_vStart;
}
public: public:
enum state enum state
@ -243,7 +242,6 @@ public:
class SimpleChatter class SimpleChatter
{ {
public: public:
SimpleChatter(void); SimpleChatter(void);
~SimpleChatter(void); ~SimpleChatter(void);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -467,14 +467,14 @@ int CLocalNav::PathTraversable(Vector &vecSource, Vector &vecDest, int fNoMonste
{ {
if (flTotal >= s_flStepSize) if (flTotal >= s_flStepSize)
{ {
#ifndef HOOK_GAMEDLL #ifndef PLAY_GAMEDLL
vecDestTmp = vecSrcTmp + (vecDir * s_flStepSize); vecDestTmp = vecSrcTmp + (vecDir * s_flStepSize);
#else #else
// fix test demo // TODO: fix test demo
vecDestTmp[0] = vecSrcTmp[0] + (vecDir[0] * s_flStepSize); vecDestTmp[0] = vecSrcTmp[0] + (vecDir[0] * s_flStepSize);
vecDestTmp[1] = vecSrcTmp[1] + (float)(vecDir[1] * s_flStepSize); vecDestTmp[1] = vecSrcTmp[1] + (float)(vecDir[1] * s_flStepSize);
vecDestTmp[2] = vecSrcTmp[2] + (vecDir[2] * s_flStepSize); vecDestTmp[2] = vecSrcTmp[2] + (vecDir[2] * s_flStepSize);
#endif // HOOK_GAMEDLL #endif // PLAY_GAMEDLL
} }
else else

View File

@ -49,31 +49,23 @@ class HostageStateMachine: public SimpleStateMachine<CHostageImprov *, HostageSt
public: public:
virtual void OnMoveToSuccess(const Vector &goal) virtual void OnMoveToSuccess(const Vector &goal)
{ {
if (m_state != NULL) if (m_state)
{
m_state->OnMoveToSuccess(goal); m_state->OnMoveToSuccess(goal);
}
} }
virtual void OnMoveToFailure(const Vector &goal, MoveToFailureType reason) virtual void OnMoveToFailure(const Vector &goal, MoveToFailureType reason)
{ {
if (m_state != NULL) if (m_state)
{
m_state->OnMoveToFailure(goal, reason); m_state->OnMoveToFailure(goal, reason);
}
} }
virtual void OnInjury(float amount) virtual void OnInjury(float amount)
{ {
if (m_state != NULL) if (m_state)
{
m_state->OnInjury(amount); m_state->OnInjury(amount);
}
} }
void UpdateStationaryAnimation(CHostageImprov *improv) void UpdateStationaryAnimation(CHostageImprov *improv)
{ {
if (m_state != NULL) if (m_state)
{
m_state->UpdateStationaryAnimation(improv); m_state->UpdateStationaryAnimation(improv);
}
} }
};/* size: 16, cachelines: 1, members: 2 */ };/* size: 16, cachelines: 1, members: 2 */
@ -100,7 +92,7 @@ public:
{ {
m_moveState = MoveFailed; m_moveState = MoveFailed;
} }
virtual void OnInjury(float amount) virtual void OnInjury(float amount = -1.0f)
{ {
m_fleeTimer.Invalidate(); m_fleeTimer.Invalidate();
m_mustFlee = true; m_mustFlee = true;
@ -150,8 +142,22 @@ public:
return "Escape:ToCover"; 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 // HOOK_GAMEDLL
public: public:
void SetRescueGoal(const Vector &rescueGoal); void SetRescueGoal(const Vector &rescueGoal)
{
m_rescueGoal = rescueGoal;
}
private: private:
Vector m_rescueGoal; Vector m_rescueGoal;
Vector m_spot; Vector m_spot;
@ -173,6 +179,14 @@ public:
return "Escape:LookAround"; return "Escape:LookAround";
} }
#ifdef HOOK_GAMEDLL
void OnEnter_(CHostageImprov *improv);
void OnUpdate_(CHostageImprov *improv);
void OnExit_(CHostageImprov *improv);
#endif // HOOK_GAMEDLL
private: private:
CountdownTimer m_timer; CountdownTimer m_timer;
@ -193,13 +207,27 @@ public:
} }
virtual void OnMoveToFailure(const Vector &goal, MoveToFailureType reason) virtual void OnMoveToFailure(const Vector &goal, MoveToFailureType reason)
{ {
//TODO: i'm unsure m_behavior.OnMoveToFailure(goal, reason);
if (m_behavior.IsState(this))
IImprovEvent::OnMoveToFailure(goal, reason);
} }
#ifdef HOOK_GAMEDLL
void OnEnter_(CHostageImprov *improv);
void OnUpdate_(CHostageImprov *improv);
void OnExit_(CHostageImprov *improv);
#endif // HOOK_GAMEDLL
public: public:
void ToCover(void); void ToCover(void)
void LookAround(void); {
m_behavior.SetState(&m_toCoverState);
}
void LookAround(void)
{
m_behavior.SetState(&m_lookAroundState);
}
private: private:
HostageEscapeToCoverState m_toCoverState; HostageEscapeToCoverState m_toCoverState;
HostageEscapeLookAroundState m_lookAroundState; HostageEscapeLookAroundState m_lookAroundState;
@ -252,17 +280,27 @@ public:
} }
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 // HOOK_GAMEDLL
public: public:
void SetLeader(CBaseEntity *leader) void SetLeader(CBaseEntity *leader)
{ {
m_leader = leader; m_leader = leader;
} }
CBaseEntity *GetLeader(void) CBaseEntity *GetLeader(void) const
{ {
return m_leader; return m_leader;
} }
private: private:
EHANDLE m_leader; mutable EHANDLE m_leader;
Vector m_lastLeaderPos; Vector m_lastLeaderPos;
bool m_isWaiting; bool m_isWaiting;
float m_stopRange; float m_stopRange;
@ -329,16 +367,16 @@ public:
void AddSequence(CHostageImprov *improv, const char *seqName, float holdTime = -1.0f, float rate = 1.0f); void AddSequence(CHostageImprov *improv, const char *seqName, float holdTime = -1.0f, float rate = 1.0f);
void AddSequence(CHostageImprov *improv, int activity, float holdTime = -1.0f, float rate = 1.0f); void AddSequence(CHostageImprov *improv, int activity, float holdTime = -1.0f, float rate = 1.0f);
bool IsBusy(void) bool IsBusy(void) const
{ {
return (m_sequenceCount > 0); return (m_sequenceCount > 0);
} }
bool IsPlaying(CHostageImprov *improv, const char *seqName); NOXREF bool IsPlaying(CHostageImprov *improv, const char *seqName) const;
int GetCurrentSequenceID(void) int GetCurrentSequenceID(void)
{ {
return m_currentSequence; return m_currentSequence;
} }
PerformanceType GetPerformance(void) PerformanceType GetPerformance(void) const
{ {
return m_performance; return m_performance;
} }

View File

@ -87,19 +87,13 @@ void HostageAnimateState::__MAKE_VHOOK(OnEnter)(CHostageImprov *improv)
; ;
} }
/* <410d79> ../cstrike/dlls/hostage/states/hostage_animate.cpp:139 */
void HostageAnimateState::__MAKE_VHOOK(OnExit)(CHostageImprov *improv)
{
;
}
/* <410fb2> ../cstrike/dlls/hostage/states/hostage_animate.cpp:108 */ /* <410fb2> ../cstrike/dlls/hostage/states/hostage_animate.cpp:108 */
void HostageAnimateState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv) void HostageAnimateState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv)
{ {
if (m_sequenceCount <= 0) if (m_sequenceCount <= 0)
return; return;
if (!improv->m_hostage->m_fSequenceFinished && m_sequence[m_currentSequence].seqID >= 0) if (!improv->GetEntity()->m_fSequenceFinished && m_sequence[m_currentSequence].seqID >= 0)
return; return;
if (m_sequence[m_currentSequence].holdTime >= 0) if (m_sequence[m_currentSequence].holdTime >= 0)
@ -120,13 +114,24 @@ void HostageAnimateState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv)
StartSequence(improv, &m_sequence[m_currentSequence]); StartSequence(improv, &m_sequence[m_currentSequence]);
} }
/* <4112d1> ../cstrike/dlls/hostage/states/hostage_animate.cpp:147 */ /* <410d79> ../cstrike/dlls/hostage/states/hostage_animate.cpp:139 */
bool HostageAnimateState::IsPlaying(CHostageImprov *improv, const char *seqName) void HostageAnimateState::__MAKE_VHOOK(OnExit)(CHostageImprov *improv)
{ {
// { ;
// class CHostage *hostage; // 152 }
// int id; // 154
// } /* <4112d1> ../cstrike/dlls/hostage/states/hostage_animate.cpp:147 */
NOXREF bool HostageAnimateState::IsPlaying(CHostageImprov *improv, const char *seqName) const
{
int id = 0;
CHostage *hostage = improv->GetEntity();
if (m_sequenceCount > 0)
{
id = m_sequence[m_currentSequence].seqID;
}
return LookupSequence(hostage, seqName) == id;
} }
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL

View File

@ -1,105 +1,242 @@
#include "precompiled.h" #include "precompiled.h"
/* <4205b1> ../cstrike/dlls/hostage/states/hostage_escape.cpp:12 */ /* <4205b1> ../cstrike/dlls/hostage/states/hostage_escape.cpp:12 */
void HostageEscapeToCoverState::OnEnter(CHostageImprov *improv) void HostageEscapeToCoverState::__MAKE_VHOOK(OnEnter)(CHostageImprov *improv)
{ {
// { CNavPath path;
// class CNavPath path; // 18 HostagePathCost pathCost;
// class HostagePathCost pathCost; // 19
// Invalidate(CNavPath *const this); // 14 improv->GetPath()->Invalidate();
// CNavPath(CNavPath *const this); // 18 m_canEscape = false;
// Compute<HostagePathCost>(CNavPath *const this,
// const Vector *start, if (!path.Compute(&improv->GetFeet(), &m_rescueGoal, pathCost))
// const Vector *goal, return;
// class HostagePathCost &costFunc); // 20
// { const float moveRange = 500.0f;
// float const moveRange; // 23 int idx = path.GetSegmentIndexAlongPath(moveRange);
// int idx; // 24
// { if (idx < 0)
// Vector pathPos; // 32 return;
// float const hidingRange; // 34
// const Vector *spot; // 35 if (idx < path.GetSegmentCount() - 1)
// operator[](CNavPath *const this, ++idx;
// int i); // 32
// Vector(Vector *const this, Vector pathPos = path[idx]->pos;
// const Vector &v); // 32 const float hidingRange = 450.0f;
// } const Vector *spot = FindNearbyHidingSpot(improv->GetEntity(), &pathPos, TheNavAreaGrid.GetNearestNavArea(&pathPos), hidingRange);
// }
// } if (spot == NULL)
spot = &pathPos;
m_spot = *spot;
improv->Run();
improv->MoveTo(m_spot);
m_canEscape = true;
} }
/* <41fd51> ../cstrike/dlls/hostage/states/hostage_escape.cpp:52 */ /* <41fd51> ../cstrike/dlls/hostage/states/hostage_escape.cpp:52 */
void HostageEscapeToCoverState::OnUpdate(CHostageImprov *improv) void HostageEscapeToCoverState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv)
{ {
// Idle(CHostageImprov *const this); // 57 if (!m_canEscape)
// OnUpdate(HostageEscapeToCoverState *const this, {
// class CHostageImprov *improv); // 52 improv->Idle();
return;
}
if (IsSpotOccupied(improv->GetEntity(), &m_spot))
{
const float emergencyHidingRange = 300.0f;
const Vector *spot = FindNearbyHidingSpot(improv->GetEntity(), &improv->GetFeet(), improv->GetLastKnownArea(), emergencyHidingRange);
if (spot == NULL)
{
HostageEscapeState *escape = (HostageEscapeState *)GetParent();
escape->LookAround();
return;
}
m_spot = *spot;
improv->MoveTo(m_spot);
}
if (improv->IsAtMoveGoal())
{
HostageEscapeState *escape = (HostageEscapeState *)GetParent();
escape->LookAround();
return;
}
} }
/* <41f65f> ../cstrike/dlls/hostage/states/hostage_escape.cpp:95 */ /* <41f65f> ../cstrike/dlls/hostage/states/hostage_escape.cpp:95 */
void HostageEscapeToCoverState::OnExit(CHostageImprov *improv) void HostageEscapeToCoverState::__MAKE_VHOOK(OnExit)(CHostageImprov *improv)
{ {
;
} }
/* <41faaf> ../cstrike/dlls/hostage/states/hostage_escape.cpp:100 */ /* <41faaf> ../cstrike/dlls/hostage/states/hostage_escape.cpp:100 */
void HostageEscapeToCoverState::OnMoveToFailure(const Vector &goal, MoveToFailureType reason) void HostageEscapeToCoverState::__MAKE_VHOOK(OnMoveToFailure)(const Vector &goal, MoveToFailureType reason)
{ {
// { #ifndef HOOK_GAMEDLL
// class HostageEscapeState *escape; // 103 HostageEscapeState *escape = (HostageEscapeState *)GetParent();
// LookAround(HostageEscapeState *const this); // 104 #else
// } // TODO: why this - 1? Hacks?
// need investigation
HostageEscapeState *escape = (HostageEscapeState *)*((int *)this - 1);
#endif // HOOK_GAMEDLL
escape->LookAround();
} }
/* <41fa2f> ../cstrike/dlls/hostage/states/hostage_escape.cpp:110 */ /* <41fa2f> ../cstrike/dlls/hostage/states/hostage_escape.cpp:110 */
void HostageEscapeLookAroundState::OnEnter(CHostageImprov *improv) void HostageEscapeLookAroundState::__MAKE_VHOOK(OnEnter)(CHostageImprov *improv)
{ {
// Start(CountdownTimer *const this, m_timer.Start(RANDOM_FLOAT(5, 10));
// float duration); // 112
improv->Stop();
improv->FaceOutwards();
} }
/* <41fc67> ../cstrike/dlls/hostage/states/hostage_escape.cpp:119 */ /* <41fc67> ../cstrike/dlls/hostage/states/hostage_escape.cpp:119 */
void HostageEscapeLookAroundState::OnUpdate(CHostageImprov *improv) void HostageEscapeLookAroundState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv)
{ {
// IsElapsed(const class CountdownTimer *const this); // 123 improv->UpdateIdleActivity(ACT_IDLE_SNEAKY, ACT_IDLE_SNEAKY_FIDGET);
// OnUpdate(HostageEscapeLookAroundState *const this,
// class CHostageImprov *improv); // 119 if (m_timer.IsElapsed())
{
HostageEscapeState *escape = (HostageEscapeState *)GetParent();
escape->ToCover();
}
} }
/* <41f693> ../cstrike/dlls/hostage/states/hostage_escape.cpp:133 */ /* <41f693> ../cstrike/dlls/hostage/states/hostage_escape.cpp:133 */
void HostageEscapeLookAroundState::OnExit(CHostageImprov *improv) void HostageEscapeLookAroundState::__MAKE_VHOOK(OnExit)(CHostageImprov *improv)
{ {
improv->ClearFaceTo();
} }
/* <41fb6b> ../cstrike/dlls/hostage/states/hostage_escape.cpp:145 */ /* <41fb6b> ../cstrike/dlls/hostage/states/hostage_escape.cpp:145 */
void HostageEscapeState::OnEnter(CHostageImprov *improv) void HostageEscapeState::__MAKE_VHOOK(OnEnter)(CHostageImprov *improv)
{ {
// { CCSBotManager *ctrl = TheCSBots();
// class CCSBotManager *ctrl; // 148 const CCSBotManager::Zone *zone = ctrl->GetRandomZone();
// const class Zone *zone; // 149
// GetRandomZone(const class CCSBotManager *const this); // 149 if (zone != NULL)
// SetRescueGoal(HostageEscapeToCoverState *const this, {
// const Vector &rescueGoal); // 153 m_toCoverState.SetRescueGoal(zone->m_center);
// SetState(SimpleStateMachine<CHostageImprov*, HostageState> *const this,
// class HostageState *newState); // 156 m_behavior.Reset(improv);
// Reset(SimpleStateMachine<CHostageImprov*, HostageState> *const this, m_behavior.SetState(&m_toCoverState);
// class CHostageImprov *userData); // 155 }
// }
m_canEscape = true;
} }
/* <41fe8e> ../cstrike/dlls/hostage/states/hostage_escape.cpp:167 */ /* <41fe8e> ../cstrike/dlls/hostage/states/hostage_escape.cpp:167 */
void HostageEscapeState::OnUpdate(CHostageImprov *improv) void HostageEscapeState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv)
{ {
// { if (!m_canEscape || (improv->IsScared() && improv->GetScareIntensity() == CHostageImprov::TERRIFIED))
// class CBasePlayer *player; // 192 {
// { improv->Stop();
// float const farRange; // 198 improv->Idle();
// } return;
// } }
// OnUpdate(HostageEscapeState *const this,
// class CHostageImprov *improv); // 167 if (m_runTimer.IsElapsed())
improv->Walk();
else
improv->Run();
CBasePlayer *player = improv->GetClosestVisiblePlayer(UNASSIGNED);
if (player != NULL)
{
if (player->m_iTeam != TERRORIST)
{
improv->Stop();
improv->Idle();
return;
}
const float farRange = 750.0f;
if ((player->pev->origin - improv->GetCentroid().IsLengthGreaterThan(farRange)))
{
improv->Frighten(CHostageImprov::NERVOUS);
m_runTimer.Start(RANDOM_FLOAT(3, 6));
m_behavior.SetState(&m_toCoverState);
}
else
{
improv->Frighten(CHostageImprov::SCARED);
improv->Stop();
improv->Idle();
return;
}
}
else
{
m_behavior.Update();
}
} }
/* <41f6c7> ../cstrike/dlls/hostage/states/hostage_escape.cpp:230 */ /* <41f6c7> ../cstrike/dlls/hostage/states/hostage_escape.cpp:230 */
void HostageEscapeState::__MAKE_VHOOK(OnExit)(CHostageImprov *improv)
{
improv->Run();
}
#ifdef HOOK_GAMEDLL
void HostageEscapeToCoverState::OnEnter(CHostageImprov *improv)
{
OnEnter_(improv);
}
void HostageEscapeToCoverState::OnUpdate(CHostageImprov *improv)
{
OnUpdate_(improv);
}
void HostageEscapeToCoverState::OnExit(CHostageImprov *improv)
{
OnExit_(improv);
}
void HostageEscapeToCoverState::OnMoveToFailure(const Vector &goal, MoveToFailureType reason)
{
OnMoveToFailure_(goal, reason);
}
void HostageEscapeLookAroundState::OnEnter(CHostageImprov *improv)
{
OnEnter_(improv);
}
void HostageEscapeLookAroundState::OnUpdate(CHostageImprov *improv)
{
OnUpdate_(improv);
}
void HostageEscapeLookAroundState::OnExit(CHostageImprov *improv)
{
OnExit_(improv);
}
void HostageEscapeState::OnEnter(CHostageImprov *improv)
{
OnEnter_(improv);
}
void HostageEscapeState::OnUpdate(CHostageImprov *improv)
{
OnUpdate_(improv);
}
void HostageEscapeState::OnExit(CHostageImprov *improv) void HostageEscapeState::OnExit(CHostageImprov *improv)
{ {
OnExit_(improv);
} }
#endif // HOOK_GAMEDLL

View File

@ -1,59 +1,234 @@
#include "precompiled.h" #include "precompiled.h"
/* <42e3e3> ../cstrike/dlls/hostage/states/hostage_follow.cpp:12 */ /* <42e3e3> ../cstrike/dlls/hostage/states/hostage_follow.cpp:12 */
void HostageFollowState::OnEnter(CHostageImprov *improv) void HostageFollowState::__MAKE_VHOOK(OnEnter)(CHostageImprov *improv)
{ {
// Invalidate(CountdownTimer *const this); // 28 improv->Chatter(HOSTAGE_CHATTER_START_FOLLOW);
// OnEnter(HostageFollowState *const this, improv->Agree();
// class CHostageImprov *improv); // 12
m_isWaiting = false;
m_isWaitingForFriend = false;
improv->MoveTo(improv->GetFeet());
m_lastLeaderPos = Vector(999999, 999999, 999999);
m_makeWayTimer.Invalidate();
m_stopRange = RANDOM_FLOAT(125, 175);
if (improv->IsTerroristNearby())
{
improv->DelayedChatter(3, HOSTAGE_CHATTER_WARN_NEARBY);
}
} }
/* <42deaf> ../cstrike/dlls/hostage/states/hostage_follow.cpp:40 */ /* <42deaf> ../cstrike/dlls/hostage/states/hostage_follow.cpp:40 */
void HostageFollowState::OnUpdate(CHostageImprov *improv) void HostageFollowState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv)
{ {
// { // if we lost our leader, give up
// float range; // 58 if (m_leader == NULL)
// float const giveUpRange; // 61 {
// float const maxPathLength; // 62 improv->Idle();
// float const walkRange; // 70 return;
// float const continueRange; // 71 }
// float leaderSpeed; // 74
// float const runThreshold; // 75 if (m_leader->pev->deadflag != DEAD_NO)
// bool isLeaderRunning; // 76 {
// float const movedRange; // 246 improv->Frighten(CHostageImprov::TERRIFIED);
// { improv->Idle();
// float const closeRange; // 117 return;
// class CBasePlayer *terrorist; // 193 }
// {
// bool makeWay; // 120 float_precision range = (m_leader->pev->origin - improv->GetCentroid()).Length();
// float const cosTolerance; // 123
// { const float maxPathLength = 3000.0f;
// Vector to; // 148 const float giveUpRange = 1000.0f;
// Vector cross; // 152
// Vector lat; // 154 if (range > giveUpRange || improv->GetPath()->GetSegmentCount() > 0 && improv->GetPath()->GetLength() > maxPathLength)
// float const sideStepSize; // 168 {
// Vector sideStepPos; // 169 improv->Idle();
// float ground; // 172 return;
// { }
// float const push; // 178
// } const float walkRange = m_stopRange + 50.0f;
// } const float continueRange = m_stopRange + 20.0f;
// } const float runThreshold = 140.0f;
// }
// { bool isLeaderRunning;
// bool doWait; // 206 float leaderSpeed = m_leader->pev->velocity.Make2D().Length();
// }
// } if (leaderSpeed > runThreshold)
{
isLeaderRunning = true;
m_isWaiting = false;
}
else
{
// track when began to run
isLeaderRunning = false;
if (!m_isWaiting)
{
if (range < m_stopRange)
{
m_isWaiting = true;
m_impatientTimer.Start(RANDOM_FLOAT(5.0, 20.0));
}
}
else if (range > continueRange)
m_isWaiting = false;
}
if (!m_isWaiting)
{
bool makeWay = improv->IsFriendInTheWay();
if (makeWay && !m_isWaitingForFriend)
{
m_isWaitingForFriend = true;
m_waitForFriendTimer.Start(15.0);
improv->Stop();
return;
}
if (makeWay && !m_waitForFriendTimer.IsElapsed())
{
improv->Stop();
return;
}
if (improv->GetPath()->GetSegmentCount() <= 0 && m_repathTimer.IsElapsed())
{
improv->MoveTo(m_leader->pev->origin);
m_lastLeaderPos = m_leader->pev->origin;
m_repathTimer.Start(1.0);
}
if (isLeaderRunning || range > walkRange)
improv->Run();
else
improv->Walk();
const float movedRange = 35.0f;
if ((m_lastLeaderPos - m_leader->pev->origin).IsLengthGreaterThan(movedRange))
{
improv->MoveTo(m_leader->pev->origin);
m_lastLeaderPos = m_leader->pev->origin;
}
return;
}
if (m_impatientTimer.IsElapsed() && !TheCSBots()->IsRoundOver())
{
m_impatientTimer.Start(RANDOM_FLOAT(20.0, 30.0));
if (improv->CanSeeRescueZone())
improv->Chatter(HOSTAGE_CHATTER_SEE_RESCUE_ZONE, false);
else
improv->Chatter(HOSTAGE_CHATTER_IMPATIENT_FOR_RESCUE, false);
}
const float closeRange = 200.0f;
if ((m_leader->pev->origin - improv->GetCentroid()).IsLengthLessThan(closeRange))
{
bool makeWay = false;
const float cosTolerance = 0.99f;
if (improv->IsPlayerLookingAtMe((CBasePlayer *)((CBaseEntity *)m_leader), cosTolerance))
{
if (!m_makeWayTimer.HasStarted())
{
m_makeWayTimer.Start(RANDOM_FLOAT(0.4, 0.75));
}
else if (m_makeWayTimer.IsElapsed())
{
m_impatientTimer.Invalidate();
Vector to = (m_leader->pev->origin - improv->GetCentroid());
to.NormalizeInPlace();
Vector cross(-to.y, -to.x, 0);
if (cross.x * gpGlobals->v_forward.x - cross.y * gpGlobals->v_forward.y < 0)
cross.y = to.x;
else
cross.x = to.y;
float ground;
float const sideStepSize = 15.0f;
Vector sideStepPos = improv->GetFeet() + cross * sideStepSize;
if (GetGroundHeight(&sideStepPos, &ground))
{
if (abs((int)(ground - improv->GetFeet().z)) < 18.0f)
{
const float push = 20.0f;
Vector lat = cross * push;
improv->ApplyForce(lat);
improv->MoveTo(sideStepPos);
return;
}
}
}
}
else
{
m_makeWayTimer.Invalidate();
}
}
improv->Stop();
CBasePlayer *terrorist = improv->GetClosestVisiblePlayer(TERRORIST);
if (terrorist != NULL)
{
improv->LookAt(terrorist->EyePosition());
}
else
{
improv->LookAt(m_leader->EyePosition());
}
} }
/* <42e1aa> ../cstrike/dlls/hostage/states/hostage_follow.cpp:256 */ /* <42e1aa> ../cstrike/dlls/hostage/states/hostage_follow.cpp:256 */
void HostageFollowState::OnExit(CHostageImprov *improv) void HostageFollowState::__MAKE_VHOOK(OnExit)(CHostageImprov *improv)
{ {
improv->Stop();
} }
/* <42e38f> ../cstrike/dlls/hostage/states/hostage_follow.cpp:270 */ /* <42e38f> ../cstrike/dlls/hostage/states/hostage_follow.cpp:270 */
void HostageFollowState::__MAKE_VHOOK(UpdateStationaryAnimation)(CHostageImprov *improv)
{
if (improv->IsScared())
improv->UpdateIdleActivity(ACT_FOLLOW_IDLE_SCARED, ACT_RESET);
else
improv->UpdateIdleActivity(ACT_FOLLOW_IDLE, ACT_FOLLOW_IDLE_FIDGET);
}
#ifdef HOOK_GAMEDLL
void HostageFollowState::OnEnter(CHostageImprov *improv)
{
OnEnter_(improv);
}
void HostageFollowState::OnUpdate(CHostageImprov *improv)
{
OnUpdate_(improv);
}
void HostageFollowState::OnExit(CHostageImprov *improv)
{
OnExit_(improv);
}
void HostageFollowState::UpdateStationaryAnimation(CHostageImprov *improv) void HostageFollowState::UpdateStationaryAnimation(CHostageImprov *improv)
{ {
// UpdateStationaryAnimation(HostageFollowState *const this, UpdateStationaryAnimation_(improv);
// class CHostageImprov *improv); // 270
} }
#endif // HOOK_GAMEDLL

View File

@ -11,12 +11,231 @@ void HostageIdleState::__MAKE_VHOOK(OnEnter)(CHostageImprov *improv)
/* <43c197> ../cstrike/dlls/hostage/states/hostage_idle.cpp:23 */ /* <43c197> ../cstrike/dlls/hostage/states/hostage_idle.cpp:23 */
void HostageIdleState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv) void HostageIdleState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv)
{ {
if (!UTIL_ActivePlayersInGame())
return;
if (m_mustFlee || (improv->IsScared() && !improv->IsTerroristNearby() && m_moveState != Moving))
{
if (!m_mustFlee && improv->GetScareIntensity() == CHostageImprov::TERRIFIED)
m_mustFlee = true;
if ((improv->GetScareIntensity() == CHostageImprov::TERRIFIED || m_mustFlee) || (m_fleeTimer.IsElapsed() && improv->GetScareIntensity() > CHostageImprov::NERVOUS))
{
m_fleeTimer.Start(RANDOM_FLOAT(10, 20));
const float fleeChance = 33.3f;
const float terroristRecentTime = 5.0f;
if (!m_mustFlee && improv->GetTimeSinceLastSawPlayer(TERRORIST) > terroristRecentTime && RANDOM_FLOAT(0, 100) < fleeChance)
m_mustFlee = true;
if (m_mustFlee)
{
m_mustFlee = false;
const Vector *spot = FindNearbyRetreatSpot(NULL, &improv->GetFeet(), improv->GetLastKnownArea(), 500.0, TERRORIST, false);
if (spot != NULL)
{
improv->MoveTo(*spot);
improv->Run();
m_moveState = Moving;
if (improv->GetScareIntensity() == CHostageImprov::TERRIFIED)
{
improv->Frighten(CHostageImprov::SCARED);
}
return;
}
}
}
}
if (m_moveState && improv->IsAtMoveGoal())
{
m_moveState = NotMoving;
improv->Stop();
improv->FaceOutwards();
const float crouchChance = 33.3f;
if (improv->IsScared() && !improv->IsAtHome() && RANDOM_FLOAT(0, 100) <= crouchChance)
{
improv->Crouch();
}
return;
}
if (m_moveState == Moving)
{
improv->Run();
return;
}
if (!improv->IsAtMoveGoal(75.0f))
{
improv->Walk();
m_moveState = Moving;
return;
}
CBasePlayer *rescuer = improv->GetClosestVisiblePlayer(CT);
CBasePlayer *captor = improv->GetClosestVisiblePlayer(TERRORIST);
if (rescuer != NULL)
{
improv->LookAt(rescuer->EyePosition());
improv->Stop();
if (captor != NULL)
{
const float attentionRange = 700.0f;
float rangeT = (improv->GetCentroid() - captor->pev->origin).Length();
if (rangeT < attentionRange)
{
const float cosTolerance = 0.95f;
if (improv->IsAnyPlayerLookingAtMe(TERRORIST, cosTolerance))
{
improv->LookAt(captor->EyePosition());
}
else
{
TraceResult result;
UTIL_TraceLine(rescuer->pev->origin, captor->pev->origin, ignore_monsters, ignore_glass, captor->edict(), &result);
if (result.flFraction != 1.0f && m_disagreeTimer.IsElapsed())
{
improv->Disagree();
m_disagreeTimer.Start(RANDOM_FLOAT(2, 4));
}
}
return;
}
}
else if (!TheCSBots()->IsRoundOver() && m_askTimer.IsElapsed())
{
const float closeRange = 200.0f;
if ((rescuer->pev->origin - improv->GetCentroid()).IsLengthLessThan(closeRange))
{
if (improv->IsPlayerLookingAtMe(rescuer, 0.99))
{
HostageChatterType say;
if (improv->IsTerroristNearby())
say = HOSTAGE_CHATTER_WARN_NEARBY;
else
say = HOSTAGE_CHATTER_PLEASE_RESCUE_ME;
improv->Chatter(say, false);
m_askTimer.Start(RANDOM_FLOAT(3, 10));
}
}
}
if (m_waveTimer.IsElapsed())
{
CHostage *hostage = improv->GetEntity();
const float waveRange = 250.0f;
if ((rescuer->pev->origin - hostage->pev->origin).IsLengthGreaterThan(waveRange))
{
improv->Stop();
improv->Wave();
improv->LookAt(rescuer->EyePosition());
improv->Chatter(HOSTAGE_CHATTER_CALL_TO_RESCUER, false);
m_moveState = NotMoving;
m_waveTimer.Start(RANDOM_FLOAT(10, 20));
}
}
}
else if (captor != NULL)
{
improv->LookAt(captor->EyePosition());
improv->Stop();
const float closeRange = 200.0f;
if ((captor->pev->origin - improv->GetCentroid()).IsLengthLessThan(closeRange) && improv->IsPlayerLookingAtMe(captor, 0.99))
{
if (!m_intimidatedTimer.HasStarted())
{
m_intimidatedTimer.Start();
}
if (!improv->IsScared())
{
improv->Frighten(CHostageImprov::NERVOUS);
}
const float minThreatenTime = 1.0f;
if ((!m_intimidatedTimer.HasStarted() || m_intimidatedTimer.IsGreaterThen(minThreatenTime)) && m_pleadTimer.IsElapsed())
{
improv->Chatter(HOSTAGE_CHATTER_INTIMIDATED, true);
m_pleadTimer.Start(RANDOM_FLOAT(10, 20));
}
if (!improv->IsAtHome())
{
improv->Chatter(HOSTAGE_CHATTER_RETREAT, true);
improv->Retreat();
}
}
else
{
m_intimidatedTimer.Invalidate();
}
}
else
{
improv->ClearLookAt();
const float pushbackRange = 60.0f;
if (pushbackRange - improv->GetAggression() * 5.0f < TheCSBots()->GetElapsedRoundTime() && m_escapeTimer.IsElapsed())
{
const float stayHomeDuration = 5.0f;
m_escapeTimer.Start(stayHomeDuration);
float sightTimeT = improv->GetTimeSinceLastSawPlayer(TERRORIST);
float sightTimeCT = improv->GetTimeSinceLastSawPlayer(CT);
const float waitTime = 15.0f - improv->GetAggression() * 3.0f;
if (sightTimeT > waitTime && sightTimeCT > waitTime)
{
if (improv->IsTerroristNearby())
{
if (cv_hostage_debug.value > 0.0f)
{
CONSOLE_ECHO("Hostage: I want to escape, but a T is nearby\n");
}
m_escapeTimer.Start(waitTime);
}
else
{
improv->Escape();
if (cv_hostage_debug.value > 0.0f)
{
CONSOLE_ECHO("Hostage: I'm escaping!\n");
}
}
}
}
}
} }
/* <43c59b> ../cstrike/dlls/hostage/states/hostage_idle.cpp:297 */ /* <43c59b> ../cstrike/dlls/hostage/states/hostage_idle.cpp:297 */
void HostageIdleState::__MAKE_VHOOK(OnExit)(CHostageImprov *improv) void HostageIdleState::__MAKE_VHOOK(OnExit)(CHostageImprov *improv)
{ {
improv->StandUp();
improv->ClearFaceTo();
} }
/* <43c783> ../cstrike/dlls/hostage/states/hostage_idle.cpp:307 */ /* <43c783> ../cstrike/dlls/hostage/states/hostage_idle.cpp:307 */

View File

@ -4,20 +4,39 @@
void HostageRetreatState::__MAKE_VHOOK(OnEnter)(CHostageImprov *improv) void HostageRetreatState::__MAKE_VHOOK(OnEnter)(CHostageImprov *improv)
{ {
improv->Walk(); improv->Walk();
improv->MoveTo(improv->m_hostage->m_vStart); improv->MoveTo(improv->GetEntity()->m_vStart);
} }
/* <44a220> ../cstrike/dlls/hostage/states/hostage_retreat.cpp:20 */ /* <44a220> ../cstrike/dlls/hostage/states/hostage_retreat.cpp:20 */
void HostageRetreatState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv) void HostageRetreatState::__MAKE_VHOOK(OnUpdate)(CHostageImprov *improv)
{ {
// { if (improv->IsAtHome())
// class CBasePlayer *player; // 40 {
// { improv->Stop();
// float const farRange; // 45 improv->Idle();
// } return;
// } }
// OnUpdate(HostageRetreatState *const this,
// class CHostageImprov *improv); // 20 CBasePlayer *player = improv->GetClosestVisiblePlayer(UNASSIGNED);
if (player != NULL)
{
const float farRange = 400.0f;
if ((player->pev->origin - improv->GetCentroid()).IsLengthGreaterThan(farRange))
{
if (player->m_iTeam == CT && !improv->IsScared())
{
improv->Stop();
improv->Idle();
return;
}
}
}
if (improv->IsScared() && improv->GetScareIntensity() == CHostageImprov::TERRIFIED)
improv->Run();
else
improv->Walk();
} }
/* <44a023> ../cstrike/dlls/hostage/states/hostage_retreat.cpp:79 */ /* <44a023> ../cstrike/dlls/hostage/states/hostage_retreat.cpp:79 */

View File

@ -552,7 +552,10 @@ CHalfLifeMultiplay::CHalfLifeMultiplay(void)
m_fRoundCount = 0; m_fRoundCount = 0;
m_fIntroRoundCount = 0; m_fIntroRoundCount = 0;
#ifndef CSTRIKE
InstallBotControl(); InstallBotControl();
#endif // CSTRIKE
InstallHostageManager(); InstallHostageManager();
m_bSkipSpawn = m_bInCareerGame; m_bSkipSpawn = m_bInCareerGame;
@ -1938,12 +1941,12 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(RestartRound)(void)
} }
// check if the losing team is in a losing streak & that the loser bonus hasen't maxed out. // check if the losing team is in a losing streak & that the loser bonus hasen't maxed out.
if(m_iNumConsecutiveTerroristLoses > 1 && m_iLoserBonus < REWARD_LOSER_BONUS_MAX) if (m_iNumConsecutiveTerroristLoses > 1 && m_iLoserBonus < REWARD_LOSER_BONUS_MAX)
{ {
// help out the team in the losing streak // help out the team in the losing streak
m_iLoserBonus += REWARD_LOSER_BONUS_ADD; m_iLoserBonus += REWARD_LOSER_BONUS_ADD;
} }
else if(m_iNumConsecutiveCTLoses > 1 && m_iLoserBonus < REWARD_LOSER_BONUS_MAX) else if (m_iNumConsecutiveCTLoses > 1 && m_iLoserBonus < REWARD_LOSER_BONUS_MAX)
{ {
// help out the team in the losing streak // help out the team in the losing streak
m_iLoserBonus += REWARD_LOSER_BONUS_ADD; m_iLoserBonus += REWARD_LOSER_BONUS_ADD;

View File

@ -1195,14 +1195,14 @@ void CFuncTrackTrain::Next(void)
CPathTrack *pnext = m_ppath->LookAhead(&nextPos, pev->speed * 0.1, 1); CPathTrack *pnext = m_ppath->LookAhead(&nextPos, pev->speed * 0.1, 1);
nextPos.z += m_height; nextPos.z += m_height;
#if 0 #ifndef PLAY_GAMEDLL
pev->velocity = (nextPos - pev->origin) * 10; pev->velocity = (nextPos - pev->origin) * 10;
#else #else
// TODO: fix test demo // TODO: fix test demo
pev->velocity.x = ((float_precision)(nextPos.x - pev->origin.x) * 10.0f); pev->velocity.x = ((float_precision)(nextPos.x - pev->origin.x) * 10.0f);
pev->velocity.y = ((float_precision)(nextPos.y - pev->origin.y) * 10.0f); pev->velocity.y = ((float_precision)(nextPos.y - pev->origin.y) * 10.0f);
pev->velocity.z = ((nextPos.z - pev->origin.z) * 10.0f); pev->velocity.z = ((nextPos.z - pev->origin.z) * 10.0f);
#endif #endif // PLAY_GAMEDLL
Vector nextFront = pev->origin; Vector nextFront = pev->origin;
nextFront.z -= m_height; nextFront.z -= m_height;
@ -1223,7 +1223,7 @@ void CFuncTrackTrain::Next(void)
angles.y += fixAngleY; angles.y += fixAngleY;
// !!! All of this crap has to be done to make the angles not wrap around, revisit this. // !!! All of this crap has to be done to make the angles not wrap around, revisit this.
#if 0 #ifndef PLAY_GAMEDLL
FixupAngles(angles); FixupAngles(angles);
FixupAngles(pev->angles); FixupAngles(pev->angles);
#else #else
@ -1232,7 +1232,8 @@ void CFuncTrackTrain::Next(void)
angles.z = Fix(angles.z); angles.z = Fix(angles.z);
FixupAngles(pev->angles); FixupAngles(pev->angles);
#endif #endif // PLAY_GAMEDLL
if (!pnext || (delta.x == 0 && delta.y == 0)) if (!pnext || (delta.x == 0 && delta.y == 0))
angles = pev->angles; angles = pev->angles;

View File

@ -51,7 +51,7 @@ public:
{ {
return Vector2D(x - v.x, y - v.y); return Vector2D(x - v.x, y - v.y);
} }
#ifdef HOOK_GAMEDLL #ifdef PLAY_GAMEDLL
Vector2D operator*(float_precision fl) const Vector2D operator*(float_precision fl) const
{ {
return Vector2D((vec_t)(x * fl), (vec_t)(y * fl)); return Vector2D((vec_t)(x * fl), (vec_t)(y * fl));
@ -77,7 +77,7 @@ public:
{ {
return Vector2D(x / fl, y / fl); return Vector2D(x / fl, y / fl);
} }
#endif // HOOK_GAMEDLL #endif // PLAY_GAMEDLL
float_precision Length(void) const float_precision Length(void) const
{ {
return sqrt((float_precision)(x * x + y * y)); return sqrt((float_precision)(x * x + y * y));
@ -102,11 +102,11 @@ public:
flLen = 1 / flLen; flLen = 1 / flLen;
#ifdef HOOK_GAMEDLL #ifdef PLAY_GAMEDLL
return Vector2D((vec_t)(x * flLen), (vec_t)(y * flLen)); return Vector2D((vec_t)(x * flLen), (vec_t)(y * flLen));
#else #else
return Vector2D(x * flLen, y * flLen); return Vector2D(x * flLen, y * flLen);
#endif // HOOK_GAMEDLL #endif // PLAY_GAMEDLL
} }
bool IsLengthLessThan(float length) const bool IsLengthLessThan(float length) const
{ {
@ -139,7 +139,7 @@ public:
};/* size: 8, cachelines: 1, members: 2 */ };/* size: 8, cachelines: 1, members: 2 */
inline float DotProduct(const Vector2D &a, const Vector2D &b) inline float_precision DotProduct(const Vector2D &a, const Vector2D &b)
{ {
return (a.x * b.x + a.y * b.y); return (a.x * b.x + a.y * b.y);
} }
@ -193,7 +193,7 @@ public:
{ {
return Vector(x - v.x, y - v.y, z - v.z); return Vector(x - v.x, y - v.y, z - v.z);
} }
#ifdef HOOK_GAMEDLL #ifdef PLAY_GAMEDLL
Vector operator*(float_precision fl) const Vector operator*(float_precision fl) const
{ {
return Vector((vec_t)(x * fl), (vec_t)(y * fl), (vec_t)(z * fl)); return Vector((vec_t)(x * fl), (vec_t)(y * fl), (vec_t)(z * fl));
@ -219,7 +219,7 @@ public:
{ {
return Vector(x / fl, y / fl, z / fl); return Vector(x / fl, y / fl, z / fl);
} }
#endif // HOOK_GAMEDLL #endif // PLAY_GAMEDLL
void CopyToArray(float *rgfl) const void CopyToArray(float *rgfl) const
{ {
rgfl[0] = x; rgfl[0] = x;
@ -236,7 +236,7 @@ public:
//return sqrt((float_precision)(x * x + y * y + z * z)); //return sqrt((float_precision)(x * x + y * y + z * z));
} }
float LengthSquared(void) const float_precision LengthSquared(void) const
{ {
return (x * x + y * y + z * z); return (x * x + y * y + z * z);
} }
@ -248,7 +248,7 @@ public:
{ {
return &x; return &x;
} }
#ifndef HOOK_GAMEDLL #ifndef PLAY_GAMEDLL
Vector Normalize(void) Vector Normalize(void)
{ {
float flLen = Length(); float flLen = Length();
@ -268,11 +268,11 @@ public:
vec_t fTemp = (vec_t)(1 / flLen); vec_t fTemp = (vec_t)(1 / flLen);
return Vector(x * fTemp, y * fTemp, z * fTemp); return Vector(x * fTemp, y * fTemp, z * fTemp);
} }
#endif // HOOK_GAMEDLL #endif // PLAY_GAMEDLL
// for out precision normalize // for out precision normalize
Vector NormalizePrecision(void) Vector NormalizePrecision(void)
{ {
#ifndef HOOK_GAMEDLL #ifndef PLAY_GAMEDLL
return Normalize(); return Normalize();
#else #else
float_precision flLen = Length(); float_precision flLen = Length();
@ -281,7 +281,7 @@ public:
flLen = 1 / flLen; flLen = 1 / flLen;
return Vector((vec_t)(x * flLen), (vec_t)(y * flLen), (vec_t)(z * flLen)); return Vector((vec_t)(x * flLen), (vec_t)(y * flLen), (vec_t)(z * flLen));
#endif // HOOK_GAMEDLL #endif // PLAY_GAMEDLL
} }
Vector2D Make2D(void) const Vector2D Make2D(void) const
{ {
@ -302,7 +302,7 @@ public:
{ {
return (LengthSquared() > length * length); return (LengthSquared() > length * length);
} }
#ifdef HOOK_GAMEDLL #ifdef PLAY_GAMEDLL
float_precision NormalizeInPlace(void) float_precision NormalizeInPlace(void)
{ {
float_precision flLen = Length(); float_precision flLen = Length();
@ -322,7 +322,27 @@ public:
return flLen; return flLen;
} }
#else // HOOK_GAMEDLL template<typename T>
float_precision NormalizeInPlace(void)
{
T flLen = Length();
if (flLen > 0)
{
x = (vec_t)(1 / flLen * x);
y = (vec_t)(1 / flLen * y);
z = (vec_t)(1 / flLen * z);
}
else
{
x = 0;
y = 0;
z = 1;
}
return flLen;
}
#else // PLAY_GAMEDLL
float NormalizeInPlace(void) float NormalizeInPlace(void)
{ {
float flLen = Length(); float flLen = Length();
@ -340,7 +360,7 @@ public:
} }
return flLen; return flLen;
} }
#endif // HOOK_GAMEDLL #endif // PLAY_GAMEDLL
bool IsZero(float tolerance = 0.01f) const bool IsZero(float tolerance = 0.01f) const
{ {
return (x > -tolerance && x < tolerance && return (x > -tolerance && x < tolerance &&
@ -362,6 +382,11 @@ inline float_precision DotProduct(const Vector &a, const Vector &b)
return (a.x * b.x + a.y * b.y + a.z * b.z); return (a.x * b.x + a.y * b.y + a.z * b.z);
} }
inline float_precision DotProduct2D(const Vector &a, const Vector &b)
{
return (a.x * b.x + a.y * b.y);
}
/* <1ba548> ../cstrike/dlls/vector.h:186 */ /* <1ba548> ../cstrike/dlls/vector.h:186 */
inline Vector CrossProduct(const Vector &a, const Vector &b) inline Vector CrossProduct(const Vector &a, const Vector &b)
{ {
@ -401,7 +426,7 @@ inline Vector NormalizeSubtract(Vector vecStart, Vector vecDest)
{ {
Vector dir; Vector dir;
#ifdef HOOK_GAMEDLL #ifdef PLAY_GAMEDLL
X floatX = (vecDest.x - vecStart.x); X floatX = (vecDest.x - vecStart.x);
Y floatY = (vecDest.y - vecStart.y); Y floatY = (vecDest.y - vecStart.y);
@ -423,17 +448,13 @@ inline Vector NormalizeSubtract(Vector vecStart, Vector vecDest)
} }
#else #else
dir = (vecDest - vecStart).Normalize(); dir = (vecDest - vecStart).Normalize();
#endif // HOOK_GAMEDLL #endif // PLAY_GAMEDLL
return dir; return dir;
} }
#ifdef HOOK_GAMEDLL #ifdef PLAY_GAMEDLL
template< template<typename X, typename Y, typename LenType>
typename X,
typename Y,
typename LenType
>
inline Vector NormalizeMulScalar(Vector2D vec, float scalar) inline Vector NormalizeMulScalar(Vector2D vec, float scalar)
{ {
LenType flLen; LenType flLen;
@ -457,6 +478,6 @@ inline Vector NormalizeMulScalar(Vector2D vec, float scalar)
return Vector((vec_t)(floatX * scalar), (vec_t)(floatY * scalar), 0); return Vector((vec_t)(floatX * scalar), (vec_t)(floatY * scalar), 0);
} }
#endif // HOOK_GAMEDLL #endif // PLAY_GAMEDLL
#endif // VECTOR_H #endif // VECTOR_H

View File

@ -35,7 +35,7 @@
#include "osconfig.h" #include "osconfig.h"
#include "mathlib.h" #include "mathlib.h"
// Has no references on server side. // Has no references on multiplayer library CS.
#define NOXREF #define NOXREF
// Function body is not implemented. // Function body is not implemented.
#define NOBODY #define NOBODY
@ -43,8 +43,6 @@
#define UNTESTED #define UNTESTED
// Function is doubt reversed // Function is doubt reversed
#define TODOBODY #define TODOBODY
// Function is inlined in code and has no references.
#define INLINEBODY
#define BIT(n) (1<<(n)) #define BIT(n) (1<<(n))

View File

@ -140,113 +140,12 @@ enum GameEventType
NUM_GAME_EVENTS, NUM_GAME_EVENTS,
}; };
#ifdef DEFINE_EVENT_NAMES #ifdef HOOK_GAMEDLL
/* size: 96 */ #define GameEventName (*pGameEventName)
const char *GameEventName[NUM_GAME_EVENTS + 1] =
{
"EVENT_INVALID",
"EVENT_WEAPON_FIRED",
"EVENT_WEAPON_FIRED_ON_EMPTY",
"EVENT_WEAPON_RELOADED",
"EVENT_HE_GRENADE_EXPLODED",
"EVENT_FLASHBANG_GRENADE_EXPLODED",
"EVENT_SMOKE_GRENADE_EXPLODED",
"EVENT_GRENADE_BOUNCED",
"EVENT_BEING_SHOT_AT",
"EVENT_PLAYER_BLINDED_BY_FLASHBANG",
"EVENT_PLAYER_FOOTSTEP",
"EVENT_PLAYER_JUMPED",
"EVENT_PLAYER_DIED",
"EVENT_PLAYER_LANDED_FROM_HEIGHT",
"EVENT_PLAYER_TOOK_DAMAGE",
"EVENT_HOSTAGE_DAMAGED",
"EVENT_HOSTAGE_KILLED",
"EVENT_DOOR",
"EVENT_BREAK_GLASS",
"EVENT_BREAK_WOOD",
"EVENT_BREAK_METAL",
"EVENT_BREAK_FLESH",
"EVENT_BREAK_CONCRETE",
"EVENT_BOMB_PLANTED",
"EVENT_BOMB_DROPPED",
"EVENT_BOMB_PICKED_UP",
"EVENT_BOMB_BEEP",
"EVENT_BOMB_DEFUSING",
"EVENT_BOMB_DEFUSE_ABORTED",
"EVENT_BOMB_DEFUSED",
"EVENT_BOMB_EXPLODED",
"EVENT_HOSTAGE_USED",
"EVENT_HOSTAGE_RESCUED",
"EVENT_ALL_HOSTAGES_RESCUED",
"EVENT_VIP_ESCAPED",
"EVENT_VIP_ASSASSINATED",
"EVENT_TERRORISTS_WIN",
"EVENT_CTS_WIN",
"EVENT_ROUND_DRAW",
"EVENT_ROUND_WIN",
"EVENT_ROUND_LOSS",
"EVENT_ROUND_START",
"EVENT_PLAYER_SPAWNED",
"EVENT_CLIENT_CORPSE_SPAWNED",
"EVENT_BUY_TIME_START",
"EVENT_PLAYER_LEFT_BUY_ZONE",
"EVENT_DEATH_CAMERA_START",
"EVENT_KILL_ALL",
"EVENT_ROUND_TIME",
"EVENT_DIE",
"EVENT_KILL",
"EVENT_HEADSHOT",
"EVENT_KILL_FLASHBANGED",
"EVENT_TUTOR_BUY_MENU_OPENNED",
"EVENT_TUTOR_AUTOBUY",
"EVENT_PLAYER_BOUGHT_SOMETHING",
"EVENT_TUTOR_NOT_BUYING_ANYTHING",
"EVENT_TUTOR_NEED_TO_BUY_PRIMARY_WEAPON",
"EVENT_TUTOR_NEED_TO_BUY_PRIMARY_AMMO",
"EVENT_TUTOR_NEED_TO_BUY_SECONDARY_AMMO",
"EVENT_TUTOR_NEED_TO_BUY_ARMOR",
"EVENT_TUTOR_NEED_TO_BUY_DEFUSE_KIT",
"EVENT_TUTOR_NEED_TO_BUY_GRENADE",
"EVENT_CAREER_TASK_DONE",
"EVENT_START_RADIO_1",
"EVENT_RADIO_COVER_ME",
"EVENT_RADIO_YOU_TAKE_THE_POINT",
"EVENT_RADIO_HOLD_THIS_POSITION",
"EVENT_RADIO_REGROUP_TEAM",
"EVENT_RADIO_FOLLOW_ME",
"EVENT_RADIO_TAKING_FIRE",
"EVENT_START_RADIO_2",
"EVENT_RADIO_GO_GO_GO",
"EVENT_RADIO_TEAM_FALL_BACK",
"EVENT_RADIO_STICK_TOGETHER_TEAM",
"EVENT_RADIO_GET_IN_POSITION_AND_WAIT",
"EVENT_RADIO_STORM_THE_FRONT",
"EVENT_RADIO_REPORT_IN_TEAM",
"EVENT_START_RADIO_3",
"EVENT_RADIO_AFFIRMATIVE",
"EVENT_RADIO_ENEMY_SPOTTED",
"EVENT_RADIO_NEED_BACKUP",
"EVENT_RADIO_SECTOR_CLEAR",
"EVENT_RADIO_IN_POSITION",
"EVENT_RADIO_REPORTING_IN",
"EVENT_RADIO_GET_OUT_OF_THERE",
"EVENT_RADIO_NEGATIVE",
"EVENT_RADIO_ENEMY_DOWN",
"EVENT_END_RADIO",
"EVENT_NEW_MATCH",
"EVENT_PLAYER_CHANGED_TEAM",
"EVENT_BULLET_IMPACT",
"EVENT_GAME_COMMENCE",
"EVENT_WEAPON_ZOOMED",
"EVENT_HOSTAGE_CALLED_FOR_HELP",
NULL,
};
#else // DEFINE_EVENT_NAMES #endif // HOOK_GAMEDLL
extern const char *GameEventName[ NUM_GAME_EVENTS ]; extern const char *GameEventName[ NUM_GAME_EVENTS + 1 ];
#endif // DEFINE_EVENT_NAMES
#endif // GAME_EVENT_H #endif // GAME_EVENT_H

View File

@ -1,61 +1,158 @@
#include "precompiled.h" #include "precompiled.h"
/*
* Globals initialization
*/
#ifndef HOOK_GAMEDLL
const char *GameEventName[NUM_GAME_EVENTS + 1] =
{
"EVENT_INVALID",
"EVENT_WEAPON_FIRED",
"EVENT_WEAPON_FIRED_ON_EMPTY",
"EVENT_WEAPON_RELOADED",
"EVENT_HE_GRENADE_EXPLODED",
"EVENT_FLASHBANG_GRENADE_EXPLODED",
"EVENT_SMOKE_GRENADE_EXPLODED",
"EVENT_GRENADE_BOUNCED",
"EVENT_BEING_SHOT_AT",
"EVENT_PLAYER_BLINDED_BY_FLASHBANG",
"EVENT_PLAYER_FOOTSTEP",
"EVENT_PLAYER_JUMPED",
"EVENT_PLAYER_DIED",
"EVENT_PLAYER_LANDED_FROM_HEIGHT",
"EVENT_PLAYER_TOOK_DAMAGE",
"EVENT_HOSTAGE_DAMAGED",
"EVENT_HOSTAGE_KILLED",
"EVENT_DOOR",
"EVENT_BREAK_GLASS",
"EVENT_BREAK_WOOD",
"EVENT_BREAK_METAL",
"EVENT_BREAK_FLESH",
"EVENT_BREAK_CONCRETE",
"EVENT_BOMB_PLANTED",
"EVENT_BOMB_DROPPED",
"EVENT_BOMB_PICKED_UP",
"EVENT_BOMB_BEEP",
"EVENT_BOMB_DEFUSING",
"EVENT_BOMB_DEFUSE_ABORTED",
"EVENT_BOMB_DEFUSED",
"EVENT_BOMB_EXPLODED",
"EVENT_HOSTAGE_USED",
"EVENT_HOSTAGE_RESCUED",
"EVENT_ALL_HOSTAGES_RESCUED",
"EVENT_VIP_ESCAPED",
"EVENT_VIP_ASSASSINATED",
"EVENT_TERRORISTS_WIN",
"EVENT_CTS_WIN",
"EVENT_ROUND_DRAW",
"EVENT_ROUND_WIN",
"EVENT_ROUND_LOSS",
"EVENT_ROUND_START",
"EVENT_PLAYER_SPAWNED",
"EVENT_CLIENT_CORPSE_SPAWNED",
"EVENT_BUY_TIME_START",
"EVENT_PLAYER_LEFT_BUY_ZONE",
"EVENT_DEATH_CAMERA_START",
"EVENT_KILL_ALL",
"EVENT_ROUND_TIME",
"EVENT_DIE",
"EVENT_KILL",
"EVENT_HEADSHOT",
"EVENT_KILL_FLASHBANGED",
"EVENT_TUTOR_BUY_MENU_OPENNED",
"EVENT_TUTOR_AUTOBUY",
"EVENT_PLAYER_BOUGHT_SOMETHING",
"EVENT_TUTOR_NOT_BUYING_ANYTHING",
"EVENT_TUTOR_NEED_TO_BUY_PRIMARY_WEAPON",
"EVENT_TUTOR_NEED_TO_BUY_PRIMARY_AMMO",
"EVENT_TUTOR_NEED_TO_BUY_SECONDARY_AMMO",
"EVENT_TUTOR_NEED_TO_BUY_ARMOR",
"EVENT_TUTOR_NEED_TO_BUY_DEFUSE_KIT",
"EVENT_TUTOR_NEED_TO_BUY_GRENADE",
"EVENT_CAREER_TASK_DONE",
"EVENT_START_RADIO_1",
"EVENT_RADIO_COVER_ME",
"EVENT_RADIO_YOU_TAKE_THE_POINT",
"EVENT_RADIO_HOLD_THIS_POSITION",
"EVENT_RADIO_REGROUP_TEAM",
"EVENT_RADIO_FOLLOW_ME",
"EVENT_RADIO_TAKING_FIRE",
"EVENT_START_RADIO_2",
"EVENT_RADIO_GO_GO_GO",
"EVENT_RADIO_TEAM_FALL_BACK",
"EVENT_RADIO_STICK_TOGETHER_TEAM",
"EVENT_RADIO_GET_IN_POSITION_AND_WAIT",
"EVENT_RADIO_STORM_THE_FRONT",
"EVENT_RADIO_REPORT_IN_TEAM",
"EVENT_START_RADIO_3",
"EVENT_RADIO_AFFIRMATIVE",
"EVENT_RADIO_ENEMY_SPOTTED",
"EVENT_RADIO_NEED_BACKUP",
"EVENT_RADIO_SECTOR_CLEAR",
"EVENT_RADIO_IN_POSITION",
"EVENT_RADIO_REPORTING_IN",
"EVENT_RADIO_GET_OUT_OF_THERE",
"EVENT_RADIO_NEGATIVE",
"EVENT_RADIO_ENEMY_DOWN",
"EVENT_END_RADIO",
"EVENT_NEW_MATCH",
"EVENT_PLAYER_CHANGED_TEAM",
"EVENT_BULLET_IMPACT",
"EVENT_GAME_COMMENCE",
"EVENT_WEAPON_ZOOMED",
"EVENT_HOSTAGE_CALLED_FOR_HELP",
NULL,
};
#else
const char *GameEventName[ NUM_GAME_EVENTS + 1 ];
#endif // HOOK_GAMEDLL
// STL uses exceptions, but we are not compiling with them - ignore warning // STL uses exceptions, but we are not compiling with them - ignore warning
#pragma warning(disable : 4530) #pragma warning(disable : 4530)
//#define DEFINE_EVENT_NAMES const float smokeRadius = 115.0f; // for smoke grenades
/*#include "extdll.h" // Convert name to GameEventType
#include "util.h" // TODO: Find more appropriate place for this function
#include "cbase.h"
#include "weapons.h"
#include "soundent.h"
#include "gamerules.h"
#include "player.h"
#include "client.h"
#include "game_shared/perf_counter.h"
#include "bot.h"
#include "bot_manager.h"
#include "nav_area.h"
#include "bot_util.h"
#include "hostage.h"
#include "tutor.h"*/
//#define CHECK_PERFORMANCE
const float smokeRadius = 115.0f; ///< for smoke grenades
/* <49f6d7> ../game_shared/bot/bot_manager.cpp:58 */ /* <49f6d7> ../game_shared/bot/bot_manager.cpp:58 */
NOBODY GameEventType NameToGameEvent(const char *name) GameEventType NameToGameEvent(const char *name)
{ {
/*for (int i=0; GameEventName[i]; ++i) for (int i = 0; GameEventName[i] != NULL; ++i)
{
if (!Q_stricmp(GameEventName[i], name)) if (!Q_stricmp(GameEventName[i], name))
return static_cast<GameEventType>(i);*/ return static_cast<GameEventType>(i);
}
return EVENT_INVALID; return EVENT_INVALID;
} }
/* <49f733> ../game_shared/bot/bot_manager.cpp:69 */ /* <49f733> ../game_shared/bot/bot_manager.cpp:69 */
NOBODY CBotManager::CBotManager() CBotManager::CBotManager()
{ {
//InitBotTrig(); InitBotTrig();
} }
// Invoked when the round is restarting
/* <49f586> ../game_shared/bot/bot_manager.cpp:78 */ /* <49f586> ../game_shared/bot/bot_manager.cpp:78 */
void CBotManager::__MAKE_VHOOK(RestartRound)(void) void CBotManager::__MAKE_VHOOK(RestartRound)(void)
{ {
DestroyAllGrenades(); DestroyAllGrenades();
} }
// Invoked at the start of each frame
/* <49a21c> ../game_shared/bot/bot_manager.cpp:85 */
void CBotManager::__MAKE_VHOOK(StartFrame)(void) void CBotManager::__MAKE_VHOOK(StartFrame)(void)
{ {
// debug smoke grenade visualization // debug smoke grenade visualization
if (cv_bot_debug.value == 5) if (cv_bot_debug.value == 5)
{ {
UNTESTED
Vector edge, lastEdge; Vector edge, lastEdge;
ActiveGrenadeList::iterator iter = m_activeGrenadeList.begin(); ActiveGrenadeList::iterator iter = m_activeGrenadeList.begin();
@ -115,12 +212,13 @@ void CBotManager::__MAKE_VHOOK(StartFrame)(void)
if (pPlayer->IsBot() && IsEntityValid(pPlayer)) if (pPlayer->IsBot() && IsEntityValid(pPlayer))
{ {
CBot *pBot = static_cast<CBot *>(pPlayer); CBot *pBot = static_cast<CBot *>(pPlayer);
pBot->BotThink(); pBot->BotThink();
} }
} }
} }
// Return the filename for this map's "nav map" file
/* <49f7a6> ../game_shared/bot/bot_manager.cpp:205 */ /* <49f7a6> ../game_shared/bot/bot_manager.cpp:205 */
const char *CBotManager::GetNavMapFilename(void) const const char *CBotManager::GetNavMapFilename(void) const
{ {
@ -129,6 +227,10 @@ const char *CBotManager::GetNavMapFilename(void) const
return filename; return filename;
} }
// Invoked when given player does given event (some events have NULL player).
// Events are propogated to all bots.
// TODO: This has become the game-wide event dispatcher. We should restructure this.
/* <49f17b> ../game_shared/bot/bot_manager.cpp:219 */ /* <49f17b> ../game_shared/bot/bot_manager.cpp:219 */
void CBotManager::__MAKE_VHOOK(OnEvent)(GameEventType event, CBaseEntity *entity, CBaseEntity *other) void CBotManager::__MAKE_VHOOK(OnEvent)(GameEventType event, CBaseEntity *entity, CBaseEntity *other)
{ {
@ -168,6 +270,8 @@ void CBotManager::__MAKE_VHOOK(OnEvent)(GameEventType event, CBaseEntity *entity
} }
} }
// Add an active grenade to the bot's awareness
/* <49f7ff> ../game_shared/bot/bot_manager.cpp:257 */ /* <49f7ff> ../game_shared/bot/bot_manager.cpp:257 */
void CBotManager::AddGrenade(int type, CGrenade *grenade) void CBotManager::AddGrenade(int type, CGrenade *grenade)
{ {
@ -176,6 +280,8 @@ void CBotManager::AddGrenade(int type, CGrenade *grenade)
m_activeGrenadeList.push_back(ag); m_activeGrenadeList.push_back(ag);
} }
// The grenade entity in the world is going away
/* <49f95a> ../game_shared/bot/bot_manager.cpp:267 */ /* <49f95a> ../game_shared/bot/bot_manager.cpp:267 */
void CBotManager::RemoveGrenade(CGrenade *grenade) void CBotManager::RemoveGrenade(CGrenade *grenade)
{ {
@ -191,6 +297,8 @@ void CBotManager::RemoveGrenade(CGrenade *grenade)
} }
} }
// Destroy any invalid active grenades
/* <49f9fc> ../game_shared/bot/bot_manager.cpp:285 */ /* <49f9fc> ../game_shared/bot/bot_manager.cpp:285 */
NOXREF void CBotManager::ValidateActiveGrenades(void) NOXREF void CBotManager::ValidateActiveGrenades(void)
{ {
@ -210,7 +318,7 @@ NOXREF void CBotManager::ValidateActiveGrenades(void)
} }
/* <49faf3> ../game_shared/bot/bot_manager.cpp:305 */ /* <49faf3> ../game_shared/bot/bot_manager.cpp:305 */
NOXREF void CBotManager::DestroyAllGrenades(void) void CBotManager::DestroyAllGrenades(void)
{ {
for (ActiveGrenadeList::iterator iter = m_activeGrenadeList.begin(); iter != m_activeGrenadeList.end(); iter++) for (ActiveGrenadeList::iterator iter = m_activeGrenadeList.begin(); iter != m_activeGrenadeList.end(); iter++)
delete *iter; delete *iter;
@ -218,6 +326,8 @@ NOXREF void CBotManager::DestroyAllGrenades(void)
m_activeGrenadeList.clear(); m_activeGrenadeList.clear();
} }
// Return true if position is inside a smoke cloud
/* <49fc24> ../game_shared/bot/bot_manager.cpp:317 */ /* <49fc24> ../game_shared/bot/bot_manager.cpp:317 */
bool CBotManager::IsInsideSmokeCloud(const Vector *pos) bool CBotManager::IsInsideSmokeCloud(const Vector *pos)
{ {
@ -225,6 +335,8 @@ bool CBotManager::IsInsideSmokeCloud(const Vector *pos)
while (iter != m_activeGrenadeList.end()) while (iter != m_activeGrenadeList.end())
{ {
ActiveGrenade *ag = *iter; ActiveGrenade *ag = *iter;
// lazy validation
if (!ag->IsValid()) if (!ag->IsValid())
{ {
delete ag; delete ag;
@ -242,9 +354,15 @@ bool CBotManager::IsInsideSmokeCloud(const Vector *pos)
return true; return true;
} }
} }
return false; return false;
} }
// Return true if line intersects smoke volume
// Determine the length of the line of sight covered by each smoke cloud,
// and sum them (overlap is additive for obstruction).
// If the overlap exceeds the threshold, the bot can't see through.
/* <49fd8b> ../game_shared/bot/bot_manager.cpp:355 */ /* <49fd8b> ../game_shared/bot/bot_manager.cpp:355 */
bool CBotManager::IsLineBlockedBySmoke(const Vector *from, const Vector *to) bool CBotManager::IsLineBlockedBySmoke(const Vector *from, const Vector *to)
{ {
@ -262,6 +380,7 @@ bool CBotManager::IsLineBlockedBySmoke(const Vector *from, const Vector *to)
{ {
ActiveGrenade *ag = *iter; ActiveGrenade *ag = *iter;
// lazy validation
if (!ag->IsValid()) if (!ag->IsValid())
{ {
delete ag; delete ag;
@ -357,7 +476,10 @@ bool CBotManager::IsLineBlockedBySmoke(const Vector *from, const Vector *to)
} }
} }
// define how much smoke a bot can see thru
const float maxSmokedLength = 0.7f * smokeRadius; const float maxSmokedLength = 0.7f * smokeRadius;
// return true if the total length of smoke-covered line-of-sight is too much
return (totalSmokedLength > maxSmokedLength); return (totalSmokedLength > maxSmokedLength);
} }

View File

@ -36,19 +36,6 @@
#pragma warning(disable : 4530) #pragma warning(disable : 4530)
#include <list> #include <list>
#include "game_shared/GameEvent.h"
#ifndef _WIN32
//#ifndef max
//#define max(a,b) ((a) > (b) ? (a) : (b))
//#endif // max
//#ifndef min
//#define min(a,b) ((a) < (b) ? (a) : (b))
//#endif // min
#endif // _WIN32
class CNavArea; class CNavArea;
class CGrenade; class CGrenade;
@ -82,7 +69,7 @@ private:
};/* size: 24, cachelines: 1, members: 4 */ };/* size: 24, cachelines: 1, members: 4 */
typedef std::list<ActiveGrenade *> ActiveGrenadeList; typedef std::STD_LIST<ActiveGrenade *> ActiveGrenadeList;
class CBotManager class CBotManager
{ {
@ -138,16 +125,11 @@ public:
private: private:
#if defined(_WIN32) && defined(HOOK_GAMEDLL)
// The member m_activeGrenadeList on Windows must be with offset +8
// on Linux : +4
int unknown_padding;
#endif // HOOK_GAMEDLL
// the list of active grenades the bots are aware of // the list of active grenades the bots are aware of
ActiveGrenadeList m_activeGrenadeList; ActiveGrenadeList m_activeGrenadeList;
// //
};/* size: 12, cachelines: 1, members: 2 */ };/* size: 12, cachelines: 1, members: 2 */
GameEventType NameToGameEvent(const char *name);
#endif // BOT_MANAGER_H #endif // BOT_MANAGER_H

View File

@ -57,7 +57,7 @@ bool UTIL_IsNameTaken(const char *name, bool ignoreHumans)
int UTIL_ClientsInGame(void) int UTIL_ClientsInGame(void)
{ {
int iCount = 0; int iCount = 0;
for (int iIndex = 1; iIndex <= gpGlobals->maxClients; iIndex++) for (int iIndex = 1; iIndex <= gpGlobals->maxClients; ++iIndex)
{ {
CBaseEntity *pPlayer = UTIL_PlayerByIndex(iIndex); CBaseEntity *pPlayer = UTIL_PlayerByIndex(iIndex);
@ -70,8 +70,9 @@ int UTIL_ClientsInGame(void)
if (FStrEq(STRING(pPlayer->pev->netname), "")) if (FStrEq(STRING(pPlayer->pev->netname), ""))
continue; continue;
iCount++; ++iCount;
} }
return iCount; return iCount;
} }
@ -79,7 +80,7 @@ int UTIL_ClientsInGame(void)
int UTIL_ActivePlayersInGame(void) int UTIL_ActivePlayersInGame(void)
{ {
int iCount = 0; int iCount = 0;
for (int iIndex = 1; iIndex <= gpGlobals->maxClients; iIndex++) for (int iIndex = 1; iIndex <= gpGlobals->maxClients; ++iIndex)
{ {
CBaseEntity *entity = UTIL_PlayerByIndex(iIndex); CBaseEntity *entity = UTIL_PlayerByIndex(iIndex);
@ -101,7 +102,7 @@ int UTIL_ActivePlayersInGame(void)
if (player->m_iJoiningState != JOINED) if (player->m_iJoiningState != JOINED)
continue; continue;
iCount++; ++iCount;
} }
return iCount; return iCount;
@ -112,7 +113,7 @@ int UTIL_HumansInGame(bool ignoreSpectators)
{ {
int iCount = 0; int iCount = 0;
for (int iIndex = 1; iIndex <= gpGlobals->maxClients; iIndex++) for (int iIndex = 1; iIndex <= gpGlobals->maxClients; ++iIndex)
{ {
CBaseEntity *entity = UTIL_PlayerByIndex(iIndex); CBaseEntity *entity = UTIL_PlayerByIndex(iIndex);
@ -136,7 +137,7 @@ int UTIL_HumansInGame(bool ignoreSpectators)
if (ignoreSpectators && player->m_iJoiningState != JOINED) if (ignoreSpectators && player->m_iJoiningState != JOINED)
continue; continue;
iCount++; ++iCount;
} }
return iCount; return iCount;
@ -146,7 +147,7 @@ int UTIL_HumansInGame(bool ignoreSpectators)
NOBODY int UTIL_HumansOnTeam(int teamID, bool isAlive) NOBODY int UTIL_HumansOnTeam(int teamID, bool isAlive)
{ {
int iCount = 0; int iCount = 0;
for (int iIndex = 1; iIndex <= gpGlobals->maxClients; iIndex++) for (int iIndex = 1; iIndex <= gpGlobals->maxClients; ++iIndex)
{ {
CBaseEntity *entity = UTIL_PlayerByIndex(iIndex); CBaseEntity *entity = UTIL_PlayerByIndex(iIndex);
@ -170,7 +171,7 @@ NOBODY int UTIL_HumansOnTeam(int teamID, bool isAlive)
if (isAlive && !player->IsAlive()) if (isAlive && !player->IsAlive())
continue; continue;
iCount++; ++iCount;
} }
return iCount; return iCount;
@ -181,7 +182,7 @@ NOBODY int UTIL_BotsInGame(void)
{ {
int iCount = 0; int iCount = 0;
for (int iIndex = 1; iIndex <= gpGlobals->maxClients; iIndex++) for (int iIndex = 1; iIndex <= gpGlobals->maxClients; ++iIndex)
{ {
CBasePlayer *pPlayer = static_cast<CBasePlayer *>(UTIL_PlayerByIndex(iIndex)); CBasePlayer *pPlayer = static_cast<CBasePlayer *>(UTIL_PlayerByIndex(iIndex));
@ -197,7 +198,7 @@ NOBODY int UTIL_BotsInGame(void)
if (!pPlayer->IsBot()) if (!pPlayer->IsBot())
continue; continue;
iCount++; ++iCount;
} }
return iCount; return iCount;
@ -267,7 +268,7 @@ bool UTIL_KickBotFromTeam(TeamName kickTeam)
NOBODY bool UTIL_IsTeamAllBots(int team) NOBODY bool UTIL_IsTeamAllBots(int team)
{ {
int botCount = 0; int botCount = 0;
for (int i=1; i <= gpGlobals->maxClients; ++i) for (int i = 1; i <= gpGlobals->maxClients; ++i)
{ {
CBasePlayer *player = static_cast<CBasePlayer *>(UTIL_PlayerByIndex(i)); CBasePlayer *player = static_cast<CBasePlayer *>(UTIL_PlayerByIndex(i));
@ -301,7 +302,7 @@ NOBODY bool UTIL_IsTeamAllBots(int team)
CBasePlayer *closePlayer = NULL; CBasePlayer *closePlayer = NULL;
float closeDistSq = 1.0e12f; // 999999999999.9f float closeDistSq = 1.0e12f; // 999999999999.9f
for (int i = 1; i <= gpGlobals->maxClients; i++) for (int i = 1; i <= gpGlobals->maxClients; ++i)
{ {
CBasePlayer *player = static_cast<CBasePlayer *>(UTIL_PlayerByIndex(i)); CBasePlayer *player = static_cast<CBasePlayer *>(UTIL_PlayerByIndex(i));
@ -334,7 +335,7 @@ NOBODY /*extern*/ CBasePlayer *UTIL_GetClosestPlayer(const Vector *pos, int team
CBasePlayer *closePlayer = NULL; CBasePlayer *closePlayer = NULL;
float closeDistSq = 1.0e12f; // 999999999999.9f float closeDistSq = 1.0e12f; // 999999999999.9f
for (int i = 1; i <= gpGlobals->maxClients; i++) for (int i = 1; i <= gpGlobals->maxClients; ++i)
{ {
CBasePlayer *player = static_cast<CBasePlayer *>(UTIL_PlayerByIndex(i)); CBasePlayer *player = static_cast<CBasePlayer *>(UTIL_PlayerByIndex(i));
@ -546,7 +547,7 @@ void BotPrecache(void)
/* <4ae1b1> ../game_shared/bot/bot_util.cpp:666 */ /* <4ae1b1> ../game_shared/bot/bot_util.cpp:666 */
void InitBotTrig(void) void InitBotTrig(void)
{ {
for (int i = 0; i < COS_TABLE_SIZE; i++) for (int i = 0; i < COS_TABLE_SIZE; ++i)
{ {
float_precision angle = 2.0f * M_PI * (float)i / (float)(COS_TABLE_SIZE - 1); float_precision angle = 2.0f * M_PI * (float)i / (float)(COS_TABLE_SIZE - 1);
cosTable[i] = cos(angle); cosTable[i] = cos(angle);

View File

@ -97,7 +97,7 @@ public:
{ {
return (gpGlobals->time - m_timestamp > duration) ? true : false; return (gpGlobals->time - m_timestamp > duration) ? true : false;
} }
private: /*private:*/
float m_timestamp; float m_timestamp;
};/* size: 4, cachelines: 1, members: 1 */ };/* size: 4, cachelines: 1, members: 1 */

View File

@ -400,6 +400,7 @@ inline bool IsEntityWalkable(entvars_t *entity, unsigned int flags)
} }
// Check LOS, ignoring any entities that we can walk through // Check LOS, ignoring any entities that we can walk through
/* <38d33d> ../game_shared/bot/nav.h:330 */ /* <38d33d> ../game_shared/bot/nav.h:330 */
inline bool IsWalkableTraceLineClear(Vector &from, Vector &to, unsigned int flags = 0) inline bool IsWalkableTraceLineClear(Vector &from, Vector &to, unsigned int flags = 0)
{ {

View File

@ -2069,17 +2069,8 @@ bool CNavArea::IsCoplanar(const CNavArea *area) const
// NOTE: pos->z is not used. // NOTE: pos->z is not used.
/* <4c8963> ../game_shared/bot/nav_area.cpp:2114 */ /* <4c8963> ../game_shared/bot/nav_area.cpp:2114 */
float (*pGetZ__Vector)(const Vector *pos); float CNavArea::GetZ(const Vector *pos) const
float __declspec(naked) CNavArea::GetZ(const Vector *pos) const
{ {
__asm
{
jmp pGetZ__Vector
}
UNTESTED
// Crash
/*
float dx = m_extent.hi.x - m_extent.lo.x; float dx = m_extent.hi.x - m_extent.lo.x;
float dy = m_extent.hi.y - m_extent.lo.y; float dy = m_extent.hi.y - m_extent.lo.y;
@ -2105,7 +2096,6 @@ float __declspec(naked) CNavArea::GetZ(const Vector *pos) const
float southZ = m_swZ + u * (m_extent.hi.z - m_swZ); float southZ = m_swZ + u * (m_extent.hi.z - m_swZ);
return northZ + v * (southZ - northZ); return northZ + v * (southZ - northZ);
*/
} }
/* <4caa36> ../game_shared/bot/nav_area.cpp:2143 */ /* <4caa36> ../game_shared/bot/nav_area.cpp:2143 */
@ -3462,10 +3452,14 @@ const Vector *FindNearbyHidingSpot(CBaseEntity *me, const Vector *pos, CNavArea
} }
// select a hiding spot at random // select a hiding spot at random
int which = RANDOM_LONG(0, collector.m_count-1); int which = RANDOM_LONG(0, collector.m_count - 1);
return collector.m_hidingSpot[ which ]; return collector.m_hidingSpot[ which ];
} }
// Return true if moving from "start" to "finish" will cross a player's line of fire
// The path from "start" to "finish" is assumed to be a straight line
// "start" and "finish" are assumed to be points on the ground
/* <4c3feb> ../game_shared/bot/nav_area.cpp:3591 */ /* <4c3feb> ../game_shared/bot/nav_area.cpp:3591 */
bool IsCrossingLineOfFire(const Vector &start, const Vector &finish, CBaseEntity *ignore, int ignoreTeam) bool IsCrossingLineOfFire(const Vector &start, const Vector &finish, CBaseEntity *ignore, int ignoreTeam)
{ {
@ -4925,49 +4919,43 @@ void CNavAreaGrid::RemoveNavArea(CNavArea *area)
--m_areaCount; --m_areaCount;
} }
CNavArea *(*pGetNavArea)(const Vector *pos, float beneathLimit);
// Given a position, return the nav area that IsOverlapping and is *immediately* beneath it // Given a position, return the nav area that IsOverlapping and is *immediately* beneath it
/* <4cff5e> ../game_shared/bot/nav_area.cpp:5080 */ /* <4cff5e> ../game_shared/bot/nav_area.cpp:5080 */
CNavArea __declspec(naked) *CNavAreaGrid::GetNavArea(const Vector *pos, float beneathLimit) const CNavArea *CNavAreaGrid::GetNavArea(const Vector *pos, float beneathLimit) const
{ {
__asm
{
jmp pGetNavArea
}
UNTESTED
//TODO: Crash NavAreaList::iterator iter = list->begin()
/*
if (m_grid == NULL) if (m_grid == NULL)
return NULL; return NULL;
// get list in cell that contains position
int x = WorldToGridX(pos->x); int x = WorldToGridX(pos->x);
int y = WorldToGridY(pos->y); int y = WorldToGridY(pos->y);
NavAreaList *list = &m_grid[x + y * m_gridSizeX]; NavAreaList *list = &m_grid[x + y * m_gridSizeX];
// search cell list to find correct area
CNavArea *use = NULL; CNavArea *use = NULL;
float useZ = -100000000.0f; float useZ = -99999999.9f;
Vector testPos = *pos + Vector(0, 0, 5); Vector testPos = *pos + Vector(0, 0, 5);
if (list == NULL)
return NULL;
for (NavAreaList::iterator iter = list->begin(); iter != list->end(); ++iter) for (NavAreaList::iterator iter = list->begin(); iter != list->end(); ++iter)
{ {
CNavArea *area = *iter; CNavArea *area = *iter;
// check if position is within 2D boundaries of this area
if (area->IsOverlapping(&testPos)) if (area->IsOverlapping(&testPos))
{ {
// project position onto area to get Z
float z = area->GetZ(&testPos); float z = area->GetZ(&testPos);
// if area is above us, skip it
if (z > testPos.z) if (z > testPos.z)
continue; continue;
// if area is too far below us, skip it
if (z < pos->z - beneathLimit) if (z < pos->z - beneathLimit)
continue; continue;
// if area is higher than the one we have, use this instead
if (z > useZ) if (z > useZ)
{ {
use = area; use = area;
@ -4975,36 +4963,29 @@ CNavArea __declspec(naked) *CNavAreaGrid::GetNavArea(const Vector *pos, float be
} }
} }
} }
return use;
*/
}
CNavArea *(*pGetNearestNavArea)(const Vector *pos, bool anyZ); return use;
}
// Given a position in the world, return the nav area that is closest // Given a position in the world, return the nav area that is closest
// and at the same height, or beneath it. // and at the same height, or beneath it.
// Used to find initial area if we start off of the mesh. // Used to find initial area if we start off of the mesh.
/* <4d33b4> ../game_shared/bot/nav_area.cpp:5133 */ /* <4d33b4> ../game_shared/bot/nav_area.cpp:5133 */
NOBODY __declspec(naked) CNavArea *CNavAreaGrid::GetNearestNavArea(const Vector *pos, bool anyZ) const CNavArea *CNavAreaGrid::GetNearestNavArea(const Vector *pos, bool anyZ) const
{ {
__asm if (m_grid == NULL)
{
jmp pGetNearestNavArea
}
//TODO: UNTESTED
// Result: Crashed TheNavAreaList.begin()
/* if (m_grid == NULL)
return NULL; return NULL;
CNavArea *close = NULL; CNavArea *close = NULL;
float closeDistSq = 100000000.0f; float closeDistSq = 100000000.0f;
// quick check
close = GetNavArea(pos); close = GetNavArea(pos);
if (close) if (close)
return close; return close;
// ensure source position is well behaved
Vector source; Vector source;
source.x = pos->x; source.x = pos->x;
source.y = pos->y; source.y = pos->y;
@ -5014,6 +4995,9 @@ NOBODY __declspec(naked) CNavArea *CNavAreaGrid::GetNearestNavArea(const Vector
source.z += HalfHumanHeight; source.z += HalfHumanHeight;
// TODO: Step incrementally using grid for speed
// find closest nav area
for (NavAreaList::iterator iter = TheNavAreaList.begin(); iter != TheNavAreaList.end(); ++iter) for (NavAreaList::iterator iter = TheNavAreaList.begin(); iter != TheNavAreaList.end(); ++iter)
{ {
CNavArea *area = *iter; CNavArea *area = *iter;
@ -5022,8 +5006,11 @@ NOBODY __declspec(naked) CNavArea *CNavAreaGrid::GetNearestNavArea(const Vector
area->GetClosestPointOnArea(&source, &areaPos); area->GetClosestPointOnArea(&source, &areaPos);
float distSq = (areaPos - source).LengthSquared(); float distSq = (areaPos - source).LengthSquared();
// keep the closest area
if (distSq < closeDistSq) if (distSq < closeDistSq)
{ {
// check LOS to area
if (!anyZ) if (!anyZ)
{ {
TraceResult result; TraceResult result;
@ -5035,8 +5022,8 @@ NOBODY __declspec(naked) CNavArea *CNavAreaGrid::GetNearestNavArea(const Vector
close = area; close = area;
} }
} }
return close; return close;
*/
} }
// Given an ID, return the associated area // Given an ID, return the associated area
@ -5063,7 +5050,7 @@ Place CNavAreaGrid::GetPlace(const Vector *pos) const
{ {
CNavArea *area = GetNearestNavArea(pos, true); CNavArea *area = GetNearestNavArea(pos, true);
if (area) if (area != NULL)
{ {
return area->GetPlace(); return area->GetPlace();
} }

File diff suppressed because it is too large Load Diff

View File

@ -142,7 +142,6 @@ void PlaceDirectory::Load(SteamFile *file)
char *GetBspFilename(const char *navFilename) char *GetBspFilename(const char *navFilename)
{ {
static char bspFilename[256]; static char bspFilename[256];
Q_sprintf(bspFilename, "maps\\%s.bsp", STRING(gpGlobals->mapname)); Q_sprintf(bspFilename, "maps\\%s.bsp", STRING(gpGlobals->mapname));
int len = Q_strlen(bspFilename); int len = Q_strlen(bspFilename);
@ -174,7 +173,7 @@ void CNavArea::Save(FILE *fp) const
} }
/* <4f09b8> ../game_shared/bot/nav_file.cpp:212 */ /* <4f09b8> ../game_shared/bot/nav_file.cpp:212 */
NOBODY void CNavArea::Save(int fd, unsigned int version) void CNavArea::Save(int fd, unsigned int version)
{ {
// save ID // save ID
Q_write(fd, &m_id, sizeof(unsigned int)); Q_write(fd, &m_id, sizeof(unsigned int));
@ -235,8 +234,11 @@ NOBODY void CNavArea::Save(int fd, unsigned int version)
// Save the approach areas for this area // Save the approach areas for this area
// save number of approach areas // save number of approach areas
Q_write(fd, &m_approachCount, sizeof(unsigned char)); Q_write(fd, &m_approachCount, sizeof(unsigned char));
if (cv_bot_debug.value > 0.0f) if (cv_bot_debug.value > 0.0f)
{
CONSOLE_ECHO(" m_approachCount = %d\n", m_approachCount); CONSOLE_ECHO(" m_approachCount = %d\n", m_approachCount);
}
// save approach area info // save approach area info
unsigned char type; unsigned char type;
@ -333,7 +335,7 @@ NOBODY void CNavArea::Save(int fd, unsigned int version)
} }
/* <4ee669> ../game_shared/bot/nav_file.cpp:379 */ /* <4ee669> ../game_shared/bot/nav_file.cpp:379 */
NOBODY void CNavArea::Load(SteamFile *file, unsigned int version) void CNavArea::Load(SteamFile *file, unsigned int version)
{ {
// load ID // load ID
file->Read(&m_id, sizeof(unsigned int)); file->Read(&m_id, sizeof(unsigned int));
@ -395,7 +397,7 @@ NOBODY void CNavArea::Load(SteamFile *file, unsigned int version)
else else
{ {
// load HidingSpot objects for this area // load HidingSpot objects for this area
for (int h=0; h<hidingSpotCount; ++h) for (int h = 0; h < hidingSpotCount; ++h)
{ {
// create new hiding spot and put on master list // create new hiding spot and put on master list
HidingSpot *spot = new HidingSpot; HidingSpot *spot = new HidingSpot;
@ -455,7 +457,7 @@ NOBODY void CNavArea::Load(SteamFile *file, unsigned int version)
return; return;
} }
for (unsigned int e = 0; e<count; ++e) for (unsigned int e = 0; e < count; ++e)
{ {
SpotEncounter encounter; SpotEncounter encounter;
@ -502,7 +504,7 @@ NOBODY void CNavArea::Load(SteamFile *file, unsigned int version)
} }
/* <4f029e> ../game_shared/bot/nav_file.cpp:562 */ /* <4f029e> ../game_shared/bot/nav_file.cpp:562 */
NOBODY NavErrorType CNavArea::PostLoad(void) NavErrorType CNavArea::PostLoad(void)
{ {
NavErrorType error = NAV_OK; NavErrorType error = NAV_OK;
@ -611,9 +613,10 @@ NOBODY NavErrorType CNavArea::PostLoad(void)
return error; return error;
} }
// Changes all '/' characters into '\' characters, in place.
/* <4edbe0> ../game_shared/bot/nav_file.cpp:680 */ /* <4edbe0> ../game_shared/bot/nav_file.cpp:680 */
void COM_FixSlashes(char *pname) inline void COM_FixSlashes(char *pname)
{ {
#ifdef _WIN32 #ifdef _WIN32
while (*pname) while (*pname)
@ -632,8 +635,10 @@ void COM_FixSlashes(char *pname)
#endif // _WIN32 #endif // _WIN32
} }
// Store AI navigation data to a file
/* <4f3e47> ../game_shared/bot/nav_file.cpp:702 */ /* <4f3e47> ../game_shared/bot/nav_file.cpp:702 */
NOBODY bool SaveNavigationMap(const char *filename) bool SaveNavigationMap(const char *filename)
{ {
if (filename == NULL) if (filename == NULL)
return false; return false;
@ -723,8 +728,11 @@ NOBODY bool SaveNavigationMap(const char *filename)
return true; return true;
} }
// Load place map
// This is legacy code - Places are stored directly in the nav file now
/* <4f169d> ../game_shared/bot/nav_file.cpp:811 */ /* <4f169d> ../game_shared/bot/nav_file.cpp:811 */
NOBODY void LoadLocationFile(const char *filename) void LoadLocationFile(const char *filename)
{ {
char locFilename[256]; char locFilename[256];
Q_strcpy(locFilename, filename); Q_strcpy(locFilename, filename);
@ -783,8 +791,10 @@ NOBODY void LoadLocationFile(const char *filename)
} }
} }
// Performs a lightweight sanity-check of the specified map's nav mesh
/* <4f05c5> ../game_shared/bot/nav_file.cpp:876 */ /* <4f05c5> ../game_shared/bot/nav_file.cpp:876 */
NOBODY void SanityCheckNavigationMap(const char *mapName) void SanityCheckNavigationMap(const char *mapName)
{ {
if (!mapName) if (!mapName)
{ {
@ -849,19 +859,13 @@ NOBODY void SanityCheckNavigationMap(const char *mapName)
return; return;
} }
} }
CONSOLE_ECHO("navigation file %s passes the sanity check.\n", navFilename); CONSOLE_ECHO("navigation file %s passes the sanity check.\n", navFilename);
} }
void (*pLoadNavigationMap)(void);
/* <4f19c7> ../game_shared/bot/nav_file.cpp:947 */ /* <4f19c7> ../game_shared/bot/nav_file.cpp:947 */
NOBODY NavErrorType __declspec(naked) LoadNavigationMap(void) NavErrorType LoadNavigationMap(void)
{ {
__asm
{
jmp pLoadNavigationMap
}
/*
// since the navigation map is destroyed on map change, // since the navigation map is destroyed on map change,
// if it exists it has already been loaded for this map // if it exists it has already been loaded for this map
if (!TheNavAreaList.empty()) if (!TheNavAreaList.empty())
@ -992,5 +996,4 @@ NOBODY NavErrorType __declspec(naked) LoadNavigationMap(void)
BuildLadders(); BuildLadders();
return NAV_OK; return NAV_OK;
*/
} }

View File

@ -60,21 +60,12 @@ private:
std::vector<Place> m_directory; std::vector<Place> m_directory;
}; };
#ifdef HOOK_GAMEDLL
#define placeDirectory (*pplaceDirectory)
#endif // HOOK_GAMEDLL
extern PlaceDirectory placeDirectory; extern PlaceDirectory placeDirectory;
NOBODY char *GetBspFilename(const char *navFilename); char *GetBspFilename(const char *navFilename);
NOBODY void COM_FixSlashes(char *pname); bool SaveNavigationMap(const char *filename);
NOBODY bool SaveNavigationMap(const char *filename); void LoadLocationFile(const char *filename);
NOBODY void LoadLocationFile(const char *filename); void SanityCheckNavigationMap(const char *mapName); // Performs a lightweight sanity-check of the specified map's nav mesh
NOBODY void SanityCheckNavigationMap(const char *mapName); NavErrorType LoadNavigationMap(void);
NOBODY NavErrorType LoadNavigationMap(void);
extern void (*pLoadNavigationMap)(void);
#endif // NAV_FILE_H #endif // NAV_FILE_H

View File

@ -5,70 +5,97 @@
*/ */
#ifndef HOOK_GAMEDLL #ifndef HOOK_GAMEDLL
//NavDirType Opposite[ NUM_DIRECTIONS ] = { SOUTH, WEST, NORTH, EAST }; NavDirType Opposite[ NUM_DIRECTIONS ] = { SOUTH, WEST, NORTH, EAST };
CNavNode *CNavNode::m_list = NULL; CNavNode *CNavNode::m_list = NULL;
unsigned int CNavNode::m_listLength = 0; unsigned int CNavNode::m_listLength = 0;
//Extent NodeMapExtent;
#else // HOOK_GAMEDLL #else // HOOK_GAMEDLL
//NavDirType Opposite[ NUM_DIRECTIONS ]; NavDirType Opposite[ NUM_DIRECTIONS ];
CNavNode *IMPL_CLASS(CNavNode, m_list); CNavNode *IMPL_CLASS(CNavNode, m_list);
unsigned int IMPL_CLASS(CNavNode, m_listLength); unsigned int IMPL_CLASS(CNavNode, m_listLength);
//Extent NodeMapExtent;
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
//NOXREF Extent NodeMapExtent;
/* <4f79dc> ../game_shared/bot/nav_node.cpp:23 */ /* <4f79dc> ../game_shared/bot/nav_node.cpp:23 */
CNavNode::CNavNode(const Vector *pos, const Vector *normal, class CNavNode *parent) CNavNode::CNavNode(const Vector *pos, const Vector *normal, CNavNode *parent)
{ {
// { m_pos = *pos;
// unsigned int nextID; // 28 m_normal = *normal;
// {
// int i; // 31 static unsigned int nextID = 1;
// } m_id = nextID++;
// }
for (int i = 0; i < NUM_DIRECTIONS; ++i)
m_to[i] = NULL;
m_visited = 0;
m_parent = parent;
m_next = IMPL(m_list);
IMPL(m_list) = this;
IMPL(m_listLength)++;
m_isCovered = FALSE;
m_area = NULL;
m_attributeFlags = 0;
} }
// Create a connection FROM this node TO the given node, in the given direction
/* <4f7a31> ../game_shared/bot/nav_node.cpp:54 */ /* <4f7a31> ../game_shared/bot/nav_node.cpp:54 */
void CNavNode::ConnectTo(CNavNode *node, NavDirType dir) void CNavNode::ConnectTo(CNavNode *node, NavDirType dir)
{ {
m_to[ dir ] = node;
} }
// Return node at given position
// TODO: Need a hash table to make this lookup fast
/* <4f7a75> ../game_shared/bot/nav_node.cpp:64 */ /* <4f7a75> ../game_shared/bot/nav_node.cpp:64 */
const CNavNode *CNavNode::GetNode(const Vector *pos) const CNavNode *CNavNode::GetNode(const Vector *pos)
{ {
// { const float tolerance = 0.45f * GenerationStepSize;
// float const tolerance; // 66
// { for (const CNavNode *node = IMPL(m_list); node != NULL; node = node->m_next)
// const class CNavNode *node; // 68 {
// { float dx = ABS(node->m_pos.x - pos->x);
// float dx; // 70 float dy = ABS(node->m_pos.y - pos->y);
// float dy; // 71 float dz = ABS(node->m_pos.z - pos->z);
// float dz; // 72
// } if (dx < tolerance && dy < tolerance && dz < tolerance)
// } return node;
// } }
return NULL;
} }
// Return true if this node is bidirectionally linked to
// another node in the given direction
/* <4f7af2> ../game_shared/bot/nav_node.cpp:86 */ /* <4f7af2> ../game_shared/bot/nav_node.cpp:86 */
BOOL CNavNode::IsBiLinked(NavDirType dir) const BOOL CNavNode::IsBiLinked(NavDirType dir) const
{ {
if (m_to[ dir ] && m_to[ dir ]->m_to[ Opposite[dir] ] == this)
return true;
return false;
} }
// Return true if this node is the NW corner of a quad of nodes
// that are all bidirectionally linked
/* <4f7b1c> ../game_shared/bot/nav_node.cpp:100 */ /* <4f7b1c> ../game_shared/bot/nav_node.cpp:100 */
BOOL CNavNode::IsClosedCell(void) const BOOL CNavNode::IsClosedCell(void) const
{ {
// IsBiLinked(const class CNavNode *const this, if (IsBiLinked( SOUTH ) && IsBiLinked( EAST ) && m_to[ EAST ]->IsBiLinked( SOUTH ) && m_to[ SOUTH ]->IsBiLinked( EAST )
// enum NavDirType dir); // 102 && m_to[ EAST ]->m_to[ SOUTH ] == m_to[ SOUTH ]->m_to[ EAST ])
// IsBiLinked(const class CNavNode *const this, return true;
// enum NavDirType dir); // 103
// IsBiLinked(const class CNavNode *const this, return false;
// enum NavDirType dir); // 104
// IsBiLinked(const class CNavNode *const this,
// enum NavDirType dir); // 105
} }

View File

@ -34,14 +34,11 @@
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
//#define Opposite (*pOpposite) #define Opposite (*pOpposite)
//#define m_list (*pm_list)
//#define NodeMapExtent (*pNodeMapExtent)
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
//extern NavDirType Opposite[ NUM_DIRECTIONS ]; extern NavDirType Opposite[ NUM_DIRECTIONS ];
//extern Extent NodeMapExtent;
class CNavNode class CNavNode
{ {

File diff suppressed because it is too large Load Diff

View File

@ -66,9 +66,9 @@ public:
return m_path[ m_segmentCount - 1 ].pos; return m_path[ m_segmentCount - 1 ].pos;
} }
bool IsAtEnd(const Vector &pos) const; // return true if position is at the end of the path bool IsAtEnd(const Vector &pos) const; // return true if position is at the end of the path
float GetLength(void) const; // return length of path from start to finish float GetLength(void) const; // return length of path from start to finish
bool GetPointAlongPath(float distAlong, Vector *pointOnPath) const; // return point a given distance along the path - if distance is out of path bounds, point is clamped to start/end NOXREF bool GetPointAlongPath(float distAlong, Vector *pointOnPath) const; // return point a given distance along the path - if distance is out of path bounds, point is clamped to start/end
/// return the node index closest to the given distance along the path without going over - returns (-1) if error /// return the node index closest to the given distance along the path without going over - returns (-1) if error
int GetSegmentIndexAlongPath(float distAlong) const; int GetSegmentIndexAlongPath(float distAlong) const;
@ -86,7 +86,7 @@ public:
void Draw(void); void Draw(void);
/// compute closest point on path to given point /// compute closest point on path to given point
bool FindClosestPointOnPath(const Vector *worldPos, int startIndex, int endIndex, Vector *close) const; NOXREF bool FindClosestPointOnPath(const Vector *worldPos, int startIndex, int endIndex, Vector *close) const;
void Optimize(void); void Optimize(void);
@ -176,16 +176,16 @@ private:
PathSegment m_path[ MAX_PATH_SEGMENTS ]; PathSegment m_path[ MAX_PATH_SEGMENTS ];
int m_segmentCount; int m_segmentCount;
// determine actual path positions
bool ComputePathPositions(void);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
public: public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
// determine actual path positions
bool ComputePathPositions(void);
// utility function for when start and goal are in the same area // utility function for when start and goal are in the same area
bool BuildTrivialPath(const Vector *start, const Vector *goal); bool BuildTrivialPath(const Vector *start, const Vector *goal);
// used by Optimize() // used by Optimize()
int FindNextOccludedNode(int anchor); int FindNextOccludedNode(int anchor_);
};/* size: 6148, cachelines: 97, members: 2 */ };/* size: 6148, cachelines: 97, members: 2 */
@ -263,7 +263,11 @@ public:
// adjust goal position if "feelers" are touched // adjust goal position if "feelers" are touched
void FeelerReflexAdjustment(Vector *goalPosition, float height = -1.0f); void FeelerReflexAdjustment(Vector *goalPosition, float height = -1.0f);
#ifdef HOOK_GAMEDLL
public:
#else
private: private:
#endif // HOOK_GAMEDLL
int FindOurPositionOnPath(Vector *close, bool local) const; // return the closest point to our current position on current path int FindOurPositionOnPath(Vector *close, bool local) const; // return the closest point to our current position on current path
int FindPathPoint(float aheadRange, Vector *point, int *prevIndex); // compute a point a fixed distance ahead along our path. int FindPathPoint(float aheadRange, Vector *point, int *prevIndex); // compute a point a fixed distance ahead along our path.

View File

@ -33,8 +33,9 @@
#endif #endif
// Encapsulation of a finite-state-machine state // Encapsulation of a finite-state-machine state
template<typename T>
/* <5c4388> ../game_shared/bot/simple_state_machine.h:21 */ /* <5c4388> ../game_shared/bot/simple_state_machine.h:21 */
template<typename T>
class SimpleState class SimpleState
{ {
public: public:
@ -57,14 +58,16 @@ public:
{ {
return m_parent; return m_parent;
} }
private: private:
// the parent state that contains this state // the parent state that contains this state
SimpleState<T> *m_parent; SimpleState<T> *m_parent;
}; };
// Encapsulation of a finite state machine // Encapsulation of a finite state machine
template<typename T, typename S>
/* <5c4bab> ../game_shared/bot/simple_state_machine.h:68 */ /* <5c4bab> ../game_shared/bot/simple_state_machine.h:68 */
template<typename T, typename S>
class SimpleStateMachine class SimpleStateMachine
{ {
public: public:

View File

@ -248,7 +248,7 @@ FunctionHook g_FunctionHooks[] =
{ 0x01D59250, "_ZN8CAirtank4SaveER5CSave", mfunc_ptr_cast(&CAirtank::Save_) }, { 0x01D59250, "_ZN8CAirtank4SaveER5CSave", mfunc_ptr_cast(&CAirtank::Save_) },
{ 0x01D59280, "_ZN8CAirtank7RestoreER8CRestore", mfunc_ptr_cast(&CAirtank::Restore_) }, { 0x01D59280, "_ZN8CAirtank7RestoreER8CRestore", mfunc_ptr_cast(&CAirtank::Restore_) },
{ 0x01D593C0, "_ZN8CAirtank6KilledEP9entvars_si", mfunc_ptr_cast(&CAirtank::Killed_) }, { 0x01D593C0, "_ZN8CAirtank6KilledEP9entvars_si", mfunc_ptr_cast(&CAirtank::Killed_) },
{ 0x01D59240, "_ZN8CAirtank10BloodColorEv", mfunc_ptr_cast(&CAirtank::BloodColor_) }, //{ 0x01D59240, "_ZN8CAirtank10BloodColorEv", mfunc_ptr_cast(&CAirtank::BloodColor_) }, // DEFAULT
//non-virtual func //non-virtual func
{ 0x01D59410, "_ZN8CAirtank9TankThinkEv", mfunc_ptr_cast(&CAirtank::TankThink) }, { 0x01D59410, "_ZN8CAirtank9TankThinkEv", mfunc_ptr_cast(&CAirtank::TankThink) },
{ 0x01D59430, "_ZN8CAirtank9TankTouchEP11CBaseEntity", mfunc_ptr_cast(&CAirtank::TankTouch) }, { 0x01D59430, "_ZN8CAirtank9TankTouchEP11CBaseEntity", mfunc_ptr_cast(&CAirtank::TankTouch) },
@ -840,7 +840,7 @@ FunctionHook g_FunctionHooks[] =
{ 0x01DA08D0, "_ZN8CWShield5SpawnEv", mfunc_ptr_cast(&CWShield::Spawn_) }, { 0x01DA08D0, "_ZN8CWShield5SpawnEv", mfunc_ptr_cast(&CWShield::Spawn_) },
{ 0x01DA0920, "_ZN8CWShield5TouchEP11CBaseEntity", mfunc_ptr_cast(&CWShield::Touch_) }, { 0x01DA0920, "_ZN8CWShield5TouchEP11CBaseEntity", mfunc_ptr_cast(&CWShield::Touch_) },
//non-virtual func //non-virtual func
//{ 0x0, "_ZN8CWShield23SetCantBePickedUpByUserEP11CBaseEntityf", mfunc_ptr_cast(&CWShield::SetCantBePickedUpByUser) } // NOXREF INLINEBODY //{ 0x0, "_ZN8CWShield23SetCantBePickedUpByUserEP11CBaseEntityf", mfunc_ptr_cast(&CWShield::SetCantBePickedUpByUser) } // NOXREF
//CSprayCan //CSprayCan
//virtual func //virtual func
@ -3104,7 +3104,7 @@ FunctionHook g_FunctionHooks[] =
{ 0x01D03120, "_ZN3CC411GetItemInfoEP8ItemInfo", mfunc_ptr_cast(&CC4::GetItemInfo_) }, { 0x01D03120, "_ZN3CC411GetItemInfoEP8ItemInfo", mfunc_ptr_cast(&CC4::GetItemInfo_) },
{ 0x01D03190, "_ZN3CC46DeployEv", mfunc_ptr_cast(&CC4::Deploy_) }, { 0x01D03190, "_ZN3CC46DeployEv", mfunc_ptr_cast(&CC4::Deploy_) },
{ 0x01D03200, "_ZN3CC47HolsterEi", mfunc_ptr_cast(&CC4::Holster_) }, { 0x01D03200, "_ZN3CC47HolsterEi", mfunc_ptr_cast(&CC4::Holster_) },
//{ 0x01D03A80, "_ZN3CC411GetMaxSpeedEv", mfunc_ptr_cast(&CC4::GetMaxSpeed_) }, // DEFAULT { 0x01D03A80, "_ZN3CC411GetMaxSpeedEv", mfunc_ptr_cast(&CC4::GetMaxSpeed_) },
//{ 0x01D03A70, "_ZN3CC49iItemSlotEv", mfunc_ptr_cast(&CC4::iItemSlot_) }, // DEFAULT //{ 0x01D03A70, "_ZN3CC49iItemSlotEv", mfunc_ptr_cast(&CC4::iItemSlot_) }, // DEFAULT
{ 0x01D03280, "_ZN3CC413PrimaryAttackEv", mfunc_ptr_cast(&CC4::PrimaryAttack_) }, { 0x01D03280, "_ZN3CC413PrimaryAttackEv", mfunc_ptr_cast(&CC4::PrimaryAttack_) },
{ 0x01D03750, "_ZN3CC410WeaponIdleEv", mfunc_ptr_cast(&CC4::WeaponIdle_) }, { 0x01D03750, "_ZN3CC410WeaponIdleEv", mfunc_ptr_cast(&CC4::WeaponIdle_) },
@ -3665,7 +3665,7 @@ FunctionHook g_FunctionHooks[] =
{ 0x01D34210, "_ZN11CBotManager10StartFrameEv", mfunc_ptr_cast(&CBotManager::StartFrame_) }, { 0x01D34210, "_ZN11CBotManager10StartFrameEv", mfunc_ptr_cast(&CBotManager::StartFrame_) },
{ 0x01D34540, "_ZN11CBotManager7OnEventE13GameEventTypeP11CBaseEntityS2_", mfunc_ptr_cast(&CBotManager::OnEvent_) }, { 0x01D34540, "_ZN11CBotManager7OnEventE13GameEventTypeP11CBaseEntityS2_", mfunc_ptr_cast(&CBotManager::OnEvent_) },
//non-virtual func //non-virtual func
////{ 0x0, "", mfunc_ptr_cast(&CBotManager::CBotManager) }, //{ 0x01D34170, "", mfunc_ptr_cast(&CBotManager::CBotManager) },
{ 0x01D34510, "_ZNK11CBotManager17GetNavMapFilenameEv", mfunc_ptr_cast(&CBotManager::GetNavMapFilename) }, { 0x01D34510, "_ZNK11CBotManager17GetNavMapFilenameEv", mfunc_ptr_cast(&CBotManager::GetNavMapFilename) },
{ 0x01D34650, "_ZN11CBotManager10AddGrenadeEiP8CGrenade", mfunc_ptr_cast(&CBotManager::AddGrenade) }, { 0x01D34650, "_ZN11CBotManager10AddGrenadeEiP8CGrenade", mfunc_ptr_cast(&CBotManager::AddGrenade) },
{ 0x01D346C0, "_ZN11CBotManager13RemoveGrenadeEP8CGrenade", mfunc_ptr_cast(&CBotManager::RemoveGrenade) }, { 0x01D346C0, "_ZN11CBotManager13RemoveGrenadeEP8CGrenade", mfunc_ptr_cast(&CBotManager::RemoveGrenade) },
@ -3674,9 +3674,10 @@ FunctionHook g_FunctionHooks[] =
{ 0x01D347A0, "_ZN11CBotManager18IsInsideSmokeCloudEPK6Vector", mfunc_ptr_cast(&CBotManager::IsInsideSmokeCloud) }, // FIXME!! { 0x01D347A0, "_ZN11CBotManager18IsInsideSmokeCloudEPK6Vector", mfunc_ptr_cast(&CBotManager::IsInsideSmokeCloud) }, // FIXME!!
{ 0x01D34850, "_ZN11CBotManager20IsLineBlockedBySmokeEPK6VectorS2_", mfunc_ptr_cast(&CBotManager::IsLineBlockedBySmoke) }, { 0x01D34850, "_ZN11CBotManager20IsLineBlockedBySmokeEPK6VectorS2_", mfunc_ptr_cast(&CBotManager::IsLineBlockedBySmoke) },
//non-class func //non-class func
//{ 0x0, "_Z15NameToGameEventPKc", (size_t)&NameToGameEvent }, { 0x01D34120, "_Z15NameToGameEventPKc", (size_t)&NameToGameEvent },
//CCSBotManager //CCSBotManager
//virtual func //virtual func
//{ 0x01D22D60, "", mfunc_ptr_cast(&CCSBotManager::CCSBotManager) },
{ 0x01D23770, "_ZN13CCSBotManager16ClientDisconnectEP11CBasePlayer", mfunc_ptr_cast(&CCSBotManager::ClientDisconnect_) }, { 0x01D23770, "_ZN13CCSBotManager16ClientDisconnectEP11CBasePlayer", mfunc_ptr_cast(&CCSBotManager::ClientDisconnect_) },
{ 0x01D24880, "_ZN13CCSBotManager13ClientCommandEP11CBasePlayerPKc", mfunc_ptr_cast(&CCSBotManager::ClientCommand_) }, { 0x01D24880, "_ZN13CCSBotManager13ClientCommandEP11CBasePlayerPKc", mfunc_ptr_cast(&CCSBotManager::ClientCommand_) },
{ 0x01D234D0, "_ZN13CCSBotManager14ServerActivateEv", mfunc_ptr_cast(&CCSBotManager::ServerActivate_) }, { 0x01D234D0, "_ZN13CCSBotManager14ServerActivateEv", mfunc_ptr_cast(&CCSBotManager::ServerActivate_) },
@ -3951,7 +3952,7 @@ FunctionHook g_FunctionHooks[] =
//{ 0x0, "_ZNK6CCSBot13IsPistolEmptyEv", mfunc_ptr_cast(&CCSBot::IsPistolEmpty) }, //{ 0x0, "_ZNK6CCSBot13IsPistolEmptyEv", mfunc_ptr_cast(&CCSBot::IsPistolEmpty) },
//{ 0x0, "_ZNK6CCSBot21GetHostageEscortCountEv", mfunc_ptr_cast(&CCSBot::GetHostageEscortCount) }, //{ 0x0, "_ZNK6CCSBot21GetHostageEscortCountEv", mfunc_ptr_cast(&CCSBot::GetHostageEscortCount) },
//{ 0x0, "_ZN6CCSBot26IncreaseHostageEscortCountEv", mfunc_ptr_cast(&CCSBot::IncreaseHostageEscortCount) }, //{ 0x0, "_ZN6CCSBot26IncreaseHostageEscortCountEv", mfunc_ptr_cast(&CCSBot::IncreaseHostageEscortCount) },
//{ 0x0, "_ZNK6CCSBot33GetRangeToFarthestEscortedHostageEv", mfunc_ptr_cast(&CCSBot::GetRangeToFarthestEscortedHostage) }, { 0x01D18B10, "_ZNK6CCSBot33GetRangeToFarthestEscortedHostageEv", mfunc_ptr_cast(&CCSBot::GetRangeToFarthestEscortedHostage) },
//{ 0x0, "_ZN6CCSBot27ResetWaitForHostagePatienceEv", mfunc_ptr_cast(&CCSBot::ResetWaitForHostagePatience) }, //{ 0x0, "_ZN6CCSBot27ResetWaitForHostagePatienceEv", mfunc_ptr_cast(&CCSBot::ResetWaitForHostagePatience) },
//{ 0x01D20AE0, "_ZN6CCSBot11ResetValuesEv", mfunc_ptr_cast(&CCSBot::ResetValues) }, //{ 0x01D20AE0, "_ZN6CCSBot11ResetValuesEv", mfunc_ptr_cast(&CCSBot::ResetValues) },
//{ 0x01D17950, "_ZN6CCSBot13BotDeathThinkEv", mfunc_ptr_cast(&CCSBot::BotDeathThink) }, // PURE //{ 0x01D17950, "_ZN6CCSBot13BotDeathThinkEv", mfunc_ptr_cast(&CCSBot::BotDeathThink) }, // PURE
@ -4191,8 +4192,8 @@ FunctionHook g_FunctionHooks[] =
//{ 0x0, "_ZN4CBot8SpawnBotEv", mfunc_ptr_cast(&CBot::SpawnBot) }, //{ 0x0, "_ZN4CBot8SpawnBotEv", mfunc_ptr_cast(&CBot::SpawnBot) },
//{ 0x0, "_ZN4CBot6UpkeepEv", mfunc_ptr_cast(&CBot::Upkeep) }, //{ 0x0, "_ZN4CBot6UpkeepEv", mfunc_ptr_cast(&CBot::Upkeep) },
//{ 0x0, "_ZN4CBot6UpdateEv", mfunc_ptr_cast(&CBot::Update) }, //{ 0x0, "_ZN4CBot6UpdateEv", mfunc_ptr_cast(&CBot::Update) },
//{ 0x0, "_ZN4CBot3RunEv", mfunc_ptr_cast(&CBot::Run) }, //{ 0x01D21110, "_ZN4CBot3RunEv", mfunc_ptr_cast(&CBot::Run) }, // DEFAULT
//{ 0x0, "_ZN4CBot4WalkEv", mfunc_ptr_cast(&CBot::Walk) }, //{ 0x01D34110, "_ZN4CBot4WalkEv", mfunc_ptr_cast(&CBot::Walk) }, // DEFAULT
//{ 0x0, "_ZN4CBot6CrouchEv", mfunc_ptr_cast(&CBot::Crouch_) }, //{ 0x0, "_ZN4CBot6CrouchEv", mfunc_ptr_cast(&CBot::Crouch_) },
//{ 0x0, "_ZN4CBot7StandUpEv", mfunc_ptr_cast(&CBot::StandUp_) }, //{ 0x0, "_ZN4CBot7StandUpEv", mfunc_ptr_cast(&CBot::StandUp_) },
//{ 0x0, "_ZN4CBot11MoveForwardEv", mfunc_ptr_cast(&CBot::MoveForward_) }, //{ 0x0, "_ZN4CBot11MoveForwardEv", mfunc_ptr_cast(&CBot::MoveForward_) },
@ -4790,6 +4791,7 @@ FunctionHook g_FunctionHooks[] =
{ 0x01D4EA30, "", mfunc_ptr_cast(&Vector::Normalize) }, { 0x01D4EA30, "", mfunc_ptr_cast(&Vector::Normalize) },
{ 0x01DCB800, "", mfunc_ptr_cast(&Vector::operator==) }, { 0x01DCB800, "", mfunc_ptr_cast(&Vector::operator==) },
{ 0x01D130D0, "", mfunc_ptr_cast(&Vector::IsLengthLessThan) }, { 0x01D130D0, "", mfunc_ptr_cast(&Vector::IsLengthLessThan) },
{ 0x01D34D90, "", mfunc_ptr_cast<float_precision (*)(const Vector &, const Vector &)>(&DotProduct) },
#endif // _WIN32 #endif // _WIN32
@ -4798,12 +4800,12 @@ FunctionHook g_FunctionHooks[] =
#ifndef Nav_Region #ifndef Nav_Region
//Nav_File //Nav_File
//{ 0x0, "_Z14GetBspFilenamePKc", (size_t)&GetBspFilename }, //{ 0x01D44E00, "_Z14GetBspFilenamePKc", (size_t)&GetBspFilename }, // NOXREF
//{ 0x0, "", (size_t)&COM_FixSlashes }, // NOXREF //{ 0x0, "", (size_t)&COM_FixSlashes }, // NOXREF
//{ 0x01D45CF0, "_Z17SaveNavigationMapPKc", (size_t)&SaveNavigationMap }, { 0x01D45CF0, "_Z17SaveNavigationMapPKc", (size_t)&SaveNavigationMap },
//{ 0x01D45F80, "_Z16LoadLocationFilePKc", (size_t)&LoadLocationFile }, { 0x01D45F80, "_Z16LoadLocationFilePKc", (size_t)&LoadLocationFile },
//{ 0x01D46170, "_Z24SanityCheckNavigationMapPKc", (size_t)&SanityCheckNavigationMap }, { 0x01D46170, "_Z24SanityCheckNavigationMapPKc", (size_t)&SanityCheckNavigationMap },
//{ 0x01D46310, "_Z17LoadNavigationMapv", (size_t)&LoadNavigationMap }, { 0x01D46310, "_Z17LoadNavigationMapv", (size_t)&LoadNavigationMap },
//IImprovEvent //IImprovEvent
//virtual func //virtual func
//{ 0x0, "_ZN12IImprovEvent15OnMoveToSuccessERK6Vector", mfunc_ptr_cast(&IImprovEvent::OnMoveToSuccess) }, //{ 0x0, "_ZN12IImprovEvent15OnMoveToSuccessERK6Vector", mfunc_ptr_cast(&IImprovEvent::OnMoveToSuccess) },
@ -4864,8 +4866,8 @@ FunctionHook g_FunctionHooks[] =
//{ 0x0, "_ZN7CImprov11OnGameEventE13GameEventTypeP11CBaseEntityS2_", mfunc_ptr_cast(&CImprov::OnGameEvent) }, //{ 0x0, "_ZN7CImprov11OnGameEventE13GameEventTypeP11CBaseEntityS2_", mfunc_ptr_cast(&CImprov::OnGameEvent) },
//{ 0x0, "_ZN7CImprov7OnTouchEP11CBaseEntity", mfunc_ptr_cast(&CImprov::OnTouch) }, //{ 0x0, "_ZN7CImprov7OnTouchEP11CBaseEntity", mfunc_ptr_cast(&CImprov::OnTouch) },
//CNavNode //CNavNode
//{ 0x0, "", mfunc_ptr_cast(&CNavNode::CNavNode) }, //{ 0x01D46F60, "_ZN8CNavNodeC2EPK6VectorS2_PS_", mfunc_ptr_cast(&CNavNode::CNavNode) },
//{ 0x0, "_ZN8CNavNode7GetNodeEPK6Vector", mfunc_ptr_cast(&CNavNode::GetNode) }, { 0x01D47000, "_ZN8CNavNode7GetNodeEPK6Vector", mfunc_ptr_cast(&CNavNode::GetNode) },
//{ 0x0, "_ZNK8CNavNode16GetConnectedNodeE10NavDirType", mfunc_ptr_cast(&CNavNode::GetConnectedNode) }, //{ 0x0, "_ZNK8CNavNode16GetConnectedNodeE10NavDirType", mfunc_ptr_cast(&CNavNode::GetConnectedNode) },
//{ 0x0, "_ZNK8CNavNode11GetPositionEv", mfunc_ptr_cast(&CNavNode::GetPosition) }, //{ 0x0, "_ZNK8CNavNode11GetPositionEv", mfunc_ptr_cast(&CNavNode::GetPosition) },
//{ 0x0, "_ZNK8CNavNode9GetNormalEv", mfunc_ptr_cast(&CNavNode::GetNormal) }, //{ 0x0, "_ZNK8CNavNode9GetNormalEv", mfunc_ptr_cast(&CNavNode::GetNormal) },
@ -4873,12 +4875,12 @@ FunctionHook g_FunctionHooks[] =
//{ 0x0, "_ZN8CNavNode8GetFirstEv", mfunc_ptr_cast(&CNavNode::GetFirst) }, //{ 0x0, "_ZN8CNavNode8GetFirstEv", mfunc_ptr_cast(&CNavNode::GetFirst) },
//{ 0x0, "_ZN8CNavNode13GetListLengthEv", mfunc_ptr_cast(&CNavNode::GetListLength) }, //{ 0x0, "_ZN8CNavNode13GetListLengthEv", mfunc_ptr_cast(&CNavNode::GetListLength) },
//{ 0x0, "_ZN8CNavNode7GetNextEv", mfunc_ptr_cast(&CNavNode::GetNext) }, //{ 0x0, "_ZN8CNavNode7GetNextEv", mfunc_ptr_cast(&CNavNode::GetNext) },
//{ 0x0, "_ZN8CNavNode9ConnectToEPS_10NavDirType", mfunc_ptr_cast(&CNavNode::ConnectTo) }, { 0x01D46FF0, "_ZN8CNavNode9ConnectToEPS_10NavDirType", mfunc_ptr_cast(&CNavNode::ConnectTo) },
//{ 0x0, "_ZNK8CNavNode9GetParentEv", mfunc_ptr_cast(&CNavNode::GetParent) }, //{ 0x0, "_ZNK8CNavNode9GetParentEv", mfunc_ptr_cast(&CNavNode::GetParent) },
//{ 0x0, "_ZN8CNavNode13MarkAsVisitedE10NavDirType", mfunc_ptr_cast(&CNavNode::MarkAsVisited) }, //{ 0x0, "_ZN8CNavNode13MarkAsVisitedE10NavDirType", mfunc_ptr_cast(&CNavNode::MarkAsVisited) },
//{ 0x0, "_ZN8CNavNode10HasVisitedE10NavDirType", mfunc_ptr_cast(&CNavNode::HasVisited) }, //{ 0x0, "_ZN8CNavNode10HasVisitedE10NavDirType", mfunc_ptr_cast(&CNavNode::HasVisited) },
//{ 0x0, "_ZNK8CNavNode10IsBiLinkedE10NavDirType", mfunc_ptr_cast(&CNavNode::IsBiLinked) }, //{ 0x01D470E0, "_ZNK8CNavNode10IsBiLinkedE10NavDirType", mfunc_ptr_cast(&CNavNode::IsBiLinked) }, // NOXREF
//{ 0x0, "_ZNK8CNavNode12IsClosedCellEv", mfunc_ptr_cast(&CNavNode::IsClosedCell) }, { 0x01D47110, "_ZNK8CNavNode12IsClosedCellEv", mfunc_ptr_cast(&CNavNode::IsClosedCell) },
//{ 0x0, "_ZN8CNavNode5CoverEv", mfunc_ptr_cast(&CNavNode::Cover) }, //{ 0x0, "_ZN8CNavNode5CoverEv", mfunc_ptr_cast(&CNavNode::Cover) },
//{ 0x0, "_ZNK8CNavNode9IsCoveredEv", mfunc_ptr_cast(&CNavNode::IsCovered) }, //{ 0x0, "_ZNK8CNavNode9IsCoveredEv", mfunc_ptr_cast(&CNavNode::IsCovered) },
//{ 0x0, "_ZN8CNavNode10AssignAreaEP8CNavArea", mfunc_ptr_cast(&CNavNode::AssignArea) }, //{ 0x0, "_ZN8CNavNode10AssignAreaEP8CNavArea", mfunc_ptr_cast(&CNavNode::AssignArea) },
@ -4890,54 +4892,61 @@ FunctionHook g_FunctionHooks[] =
//{ 0x0, "_ZN8CNavPathixEi", mfunc_ptr_cast(&CNavPath::operator[]) }, //{ 0x0, "_ZN8CNavPathixEi", mfunc_ptr_cast(&CNavPath::operator[]) },
//{ 0x0, "_ZNK8CNavPath15GetSegmentCountEv", mfunc_ptr_cast(&CNavPath::GetSegmentCount) }, //{ 0x0, "_ZNK8CNavPath15GetSegmentCountEv", mfunc_ptr_cast(&CNavPath::GetSegmentCount) },
//{ 0x0, "_ZNK8CNavPath11GetEndpointEv", mfunc_ptr_cast(&CNavPath::GetEndpoint) }, //{ 0x0, "_ZNK8CNavPath11GetEndpointEv", mfunc_ptr_cast(&CNavPath::GetEndpoint) },
//{ 0x0, "_ZNK8CNavPath7IsAtEndERK6Vector", mfunc_ptr_cast(&CNavPath::IsAtEnd) }, { 0x01D47570, "_ZNK8CNavPath7IsAtEndERK6Vector", mfunc_ptr_cast(&CNavPath::IsAtEnd) },
//{ 0x0, "_ZNK8CNavPath9GetLengthEv", mfunc_ptr_cast(&CNavPath::GetLength) }, { 0x01D475D0, "_ZNK8CNavPath9GetLengthEv", mfunc_ptr_cast(&CNavPath::GetLength) },
//{ 0x0, "_ZNK8CNavPath17GetPointAlongPathEfP6Vector", mfunc_ptr_cast(&CNavPath::GetPointAlongPath) }, //{ 0x01D47620, "_ZNK8CNavPath17GetPointAlongPathEfP6Vector", mfunc_ptr_cast(&CNavPath::GetPointAlongPath) }, // NOXREF
//{ 0x0, "_ZNK8CNavPath24GetSegmentIndexAlongPathEf", mfunc_ptr_cast(&CNavPath::GetSegmentIndexAlongPath) }, { 0x01D47760, "_ZNK8CNavPath24GetSegmentIndexAlongPathEf", mfunc_ptr_cast(&CNavPath::GetSegmentIndexAlongPath) },
//{ 0x0, "_ZNK8CNavPath7IsValidEv", mfunc_ptr_cast(&CNavPath::IsValid) }, //{ 0x0, "_ZNK8CNavPath7IsValidEv", mfunc_ptr_cast(&CNavPath::IsValid) },
//{ 0x0, "_ZN8CNavPath10InvalidateEv", mfunc_ptr_cast(&CNavPath::Invalidate) }, //{ 0x0, "_ZN8CNavPath10InvalidateEv", mfunc_ptr_cast(&CNavPath::Invalidate) },
//{ 0x0, "_ZN8CNavPath4DrawEv", mfunc_ptr_cast(&CNavPath::Draw) }, //{ 0x01D47AB0, "_ZN8CNavPath4DrawEv", mfunc_ptr_cast(&CNavPath::Draw) }, // NOXREF
//{ 0x0, "_ZNK8CNavPath22FindClosestPointOnPathEPK6VectoriiPS0_", mfunc_ptr_cast(&CNavPath::FindClosestPointOnPath) }, //{ 0x01D477F0, "_ZNK8CNavPath22FindClosestPointOnPathEPK6VectoriiPS0_", mfunc_ptr_cast(&CNavPath::FindClosestPointOnPath) }, // NOXREF
//{ 0x0, "_ZN8CNavPath8OptimizeEv", mfunc_ptr_cast(&CNavPath::Optimize) }, { 0x01D47E20, "_ZN8CNavPath8OptimizeEv", mfunc_ptr_cast(&CNavPath::Optimize) }, // PURE
//{ 0x0, "_ZN8CNavPath20ComputePathPositionsEv", mfunc_ptr_cast(&CNavPath::ComputePathPositions) }, { 0x01D47170, "_ZN8CNavPath20ComputePathPositionsEv", mfunc_ptr_cast(&CNavPath::ComputePathPositions) },
{ 0x01D47A00, "_ZN8CNavPath16BuildTrivialPathEPK6VectorS2_", mfunc_ptr_cast(&CNavPath::BuildTrivialPath) }, { 0x01D47A00, "_ZN8CNavPath16BuildTrivialPathEPK6VectorS2_", mfunc_ptr_cast(&CNavPath::BuildTrivialPath) },
//{ 0x0, "_ZN8CNavPath20FindNextOccludedNodeEi", mfunc_ptr_cast(&CNavPath::FindNextOccludedNode) }, //{ 0x01D47B40, "_ZN8CNavPath20FindNextOccludedNodeEi", mfunc_ptr_cast(&CNavPath::FindNextOccludedNode) }, // NOXREF
//CStuckMonitor //CStuckMonitor
//{ 0x0, "", mfunc_ptr_cast(&CStuckMonitor::CStuckMonitor) }, //{ 0x01D49B70, "", mfunc_ptr_cast(&CStuckMonitor::CStuckMonitor) },
//{ 0x0, "_ZN13CStuckMonitor5ResetEv", mfunc_ptr_cast(&CStuckMonitor::Reset) }, { 0x01D49B90, "_ZN13CStuckMonitor5ResetEv", mfunc_ptr_cast(&CStuckMonitor::Reset) },
//{ 0x0, "_ZN13CStuckMonitor6UpdateEP7CImprov", mfunc_ptr_cast(&CStuckMonitor::Update) }, { 0x01D49BA0, "_ZN13CStuckMonitor6UpdateEP7CImprov", mfunc_ptr_cast(&CStuckMonitor::Update) },
//{ 0x0, "_ZNK13CStuckMonitor7IsStuckEv", mfunc_ptr_cast(&CStuckMonitor::IsStuck) }, //{ 0x0, "_ZNK13CStuckMonitor7IsStuckEv", mfunc_ptr_cast(&CStuckMonitor::IsStuck) },
//{ 0x0, "_ZNK13CStuckMonitor11GetDurationEv", mfunc_ptr_cast(&CStuckMonitor::GetDuration) }, //{ 0x0, "_ZNK13CStuckMonitor11GetDurationEv", mfunc_ptr_cast(&CStuckMonitor::GetDuration) },
//CNavPathFollower //CNavPathFollower
//{ 0x0, "", mfunc_ptr_cast(&CNavPathFollower::CNavPathFollower) }, //{ 0x01D47E30, "", mfunc_ptr_cast(&CNavPathFollower::CNavPathFollower) },
//{ 0x0, "_ZN16CNavPathFollower9SetImprovEP7CImprov", mfunc_ptr_cast(&CNavPathFollower::SetImprov) }, //{ 0x0, "_ZN16CNavPathFollower9SetImprovEP7CImprov", mfunc_ptr_cast(&CNavPathFollower::SetImprov) },
//{ 0x0, "_ZN16CNavPathFollower7SetPathEP8CNavPath", mfunc_ptr_cast(&CNavPathFollower::SetPath) }, //{ 0x0, "_ZN16CNavPathFollower7SetPathEP8CNavPath", mfunc_ptr_cast(&CNavPathFollower::SetPath) },
//{ 0x0, "_ZN16CNavPathFollower5ResetEv", mfunc_ptr_cast(&CNavPathFollower::Reset) }, { 0x01D47E60, "_ZN16CNavPathFollower5ResetEv", mfunc_ptr_cast(&CNavPathFollower::Reset) },
//{ 0x0, "_ZN16CNavPathFollower6UpdateEfb", mfunc_ptr_cast(&CNavPathFollower::Update) }, { 0x01D47E80, "_ZN16CNavPathFollower6UpdateEfb", mfunc_ptr_cast(&CNavPathFollower::Update) },
//{ 0x0, "_ZN16CNavPathFollower5DebugEb", mfunc_ptr_cast(&CNavPathFollower::Debug) }, //{ 0x0, "_ZN16CNavPathFollower5DebugEb", mfunc_ptr_cast(&CNavPathFollower::Debug) },
//{ 0x0, "_ZNK16CNavPathFollower7IsStuckEv", mfunc_ptr_cast(&CNavPathFollower::IsStuck) }, //{ 0x0, "_ZNK16CNavPathFollower7IsStuckEv", mfunc_ptr_cast(&CNavPathFollower::IsStuck) },
//{ 0x0, "_ZN16CNavPathFollower10ResetStuckEv", mfunc_ptr_cast(&CNavPathFollower::ResetStuck) }, //{ 0x0, "_ZN16CNavPathFollower10ResetStuckEv", mfunc_ptr_cast(&CNavPathFollower::ResetStuck) },
//{ 0x0, "_ZNK16CNavPathFollower16GetStuckDurationEv", mfunc_ptr_cast(&CNavPathFollower::GetStuckDuration) }, //{ 0x0, "_ZNK16CNavPathFollower16GetStuckDurationEv", mfunc_ptr_cast(&CNavPathFollower::GetStuckDuration) },
//{ 0x0, "_ZN16CNavPathFollower22FeelerReflexAdjustmentEP6Vectorf", mfunc_ptr_cast(&CNavPathFollower::FeelerReflexAdjustment) }, { 0x01D49460, "_ZN16CNavPathFollower22FeelerReflexAdjustmentEP6Vectorf", mfunc_ptr_cast(&CNavPathFollower::FeelerReflexAdjustment) },
//{ 0x0, "_ZNK16CNavPathFollower21FindOurPositionOnPathEP6Vectorb", mfunc_ptr_cast(&CNavPathFollower::FindOurPositionOnPath) }, { 0x01D48450, "_ZNK16CNavPathFollower21FindOurPositionOnPathEP6Vectorb", mfunc_ptr_cast(&CNavPathFollower::FindOurPositionOnPath) },
//{ 0x0, "_ZN16CNavPathFollower13FindPathPointEfP6VectorPi", mfunc_ptr_cast(&CNavPathFollower::FindPathPoint) }, { 0x01D487B0, "_ZN16CNavPathFollower13FindPathPointEfP6VectorPi", mfunc_ptr_cast(&CNavPathFollower::FindPathPoint) },
//HidingSpot //HidingSpot
//{ 0x01D37DB0, "", mfunc_ptr_cast<HIDING_SPOT_VOID>(&HidingSpot::HidingSpot) }, //{ 0x01D37DB0, "", mfunc_ptr_cast<HIDING_SPOT_VOID>(&HidingSpot::HidingSpot) },
//{ 0x01D37E40, "", mfunc_ptr_cast<HIDING_SPOT_VECTOR>(&HidingSpot::HidingSpot) }, //{ 0x01D37E40, "", mfunc_ptr_cast<HIDING_SPOT_VECTOR>(&HidingSpot::HidingSpot) },
{ 0x01D37EC0, "_ZNK10HidingSpot4SaveEij", mfunc_ptr_cast(&HidingSpot::Save) }, { 0x01D37EC0, "_ZNK10HidingSpot4SaveEij", mfunc_ptr_cast(&HidingSpot::Save) },
{ 0x01D37F00, "_ZN10HidingSpot4LoadEP9SteamFilej", mfunc_ptr_cast(&HidingSpot::Load) }, { 0x01D37F00, "_ZN10HidingSpot4LoadEP9SteamFilej", mfunc_ptr_cast(&HidingSpot::Load) },
//SteamFile
//{ 0x0, "", mfunc_ptr_cast(&SteamFile::SteamFile) },
//{ 0x0, "", mfunc_ptr_cast(&SteamFile::~SteamFile) },
//{ 0x0, "_ZNK9SteamFile7IsValidEv", mfunc_ptr_cast(&SteamFile::IsValid) },
{ 0x01D46F00, "_ZN9SteamFile4ReadEPvi", mfunc_ptr_cast(&SteamFile::Read) },
//CNavArea //CNavArea
//{ 0x01D44F80, "_ZN8CNavArea4SaveEij", mfunc_ptr_cast<SAVE_FD>(&CNavArea::Save) }, //{ 0x01D45A50, "_ZNK14PlaceDirectory12EntryToPlaceEt", mfunc_ptr_cast(&PlaceDirectory::EntryToPlace) }, // NOTE: need hook LoadNavigationMap
//{ 0x0, "_ZNK8CNavArea4SaveEP8_IO_FILE", mfunc_ptr_cast<SAVE_FILE>(&CNavArea::Save) }, { 0x01D44F80, "_ZN8CNavArea4SaveEij", mfunc_ptr_cast<SAVE_FD>(&CNavArea::Save) },
{ 0x01D44E60, "_ZNK8CNavArea4SaveEP8_IO_FILE", mfunc_ptr_cast<SAVE_FILE>(&CNavArea::Save) },
{ 0x01D45330, "_ZN8CNavArea4LoadEP9SteamFilej", mfunc_ptr_cast(&CNavArea::Load) },
{ 0x01D45AA0, "_ZN8CNavArea8PostLoadEv", mfunc_ptr_cast(&CNavArea::PostLoad) },
//{ 0x01D38040, "", mfunc_ptr_cast<CNAV_AREA_VOID>(&CNavArea::CNavArea) }, //{ 0x01D38040, "", mfunc_ptr_cast<CNAV_AREA_VOID>(&CNavArea::CNavArea) },
//{ 0x0, "", mfunc_ptr_cast<CNAV_AREA_TWO_VECTOR>(&CNavArea::CNavArea) }, //{ 0x0, "", mfunc_ptr_cast<CNAV_AREA_TWO_VECTOR>(&CNavArea::CNavArea) },
//{ 0x0, "", mfunc_ptr_cast<CNAV_AREA_VECTOR>(&CNavArea::CNavArea) }, //{ 0x0, "", mfunc_ptr_cast<CNAV_AREA_VECTOR>(&CNavArea::CNavArea) },
//{ 0x0, "", mfunc_ptr_cast<CNAV_AREA_NAVNODE>(&CNavArea::CNavArea) }, //{ 0x0, "", mfunc_ptr_cast<CNAV_AREA_NAVNODE>(&CNavArea::CNavArea) },
//{ 0x01D386A0, "", mfunc_ptr_cast(&CNavArea::~CNavArea) }, //{ 0x01D386A0, "", mfunc_ptr_cast(&CNavArea::~CNavArea) },
//{ 0x01D37FE0, "_ZN8CNavArea10InitializeEv", mfunc_ptr_cast(&CNavArea::Initialize) }, // PRIVATE { 0x01D37FE0, "_ZN8CNavArea10InitializeEv", mfunc_ptr_cast(&CNavArea::Initialize) }, // PRIVATE
//{ 0x01D388A0, "_ZN8CNavArea15OnDestroyNotifyEPS_", mfunc_ptr_cast(&CNavArea::OnDestroyNotify) }, // NOXREF //{ 0x01D388A0, "_ZN8CNavArea15OnDestroyNotifyEPS_", mfunc_ptr_cast(&CNavArea::OnDestroyNotify) }, // NOXREF
//{ 0x01D38960, "_ZN8CNavArea9ConnectToEPS_10NavDirType", mfunc_ptr_cast(&CNavArea::ConnectTo) }, { 0x01D38960, "_ZN8CNavArea9ConnectToEPS_10NavDirType", mfunc_ptr_cast(&CNavArea::ConnectTo) },
//{ 0x01D389D0, "_ZN8CNavArea10DisconnectEPS_", mfunc_ptr_cast(&CNavArea::Disconnect) }, // NOXREF //{ 0x01D389D0, "_ZN8CNavArea10DisconnectEPS_", mfunc_ptr_cast(&CNavArea::Disconnect) }, // NOXREF
{ 0x01D38A40, "_ZN8CNavArea11FinishMergeEPS_", mfunc_ptr_cast(&CNavArea::FinishMerge) }, { 0x01D38A40, "_ZN8CNavArea11FinishMergeEPS_", mfunc_ptr_cast(&CNavArea::FinishMerge) },
{ 0x01D38B60, "_ZN8CNavArea24MergeAdjacentConnectionsEPS_", mfunc_ptr_cast(&CNavArea::MergeAdjacentConnections) }, { 0x01D38B60, "_ZN8CNavArea24MergeAdjacentConnectionsEPS_", mfunc_ptr_cast(&CNavArea::MergeAdjacentConnections) },
@ -4955,7 +4964,7 @@ FunctionHook g_FunctionHooks[] =
//{ 0x01D3C790, "_ZNK8CNavArea14IsOverlappingYEPKS_", mfunc_ptr_cast(&CNavArea::IsOverlappingY) }, // NOXREF //{ 0x01D3C790, "_ZNK8CNavArea14IsOverlappingYEPKS_", mfunc_ptr_cast(&CNavArea::IsOverlappingY) }, // NOXREF
{ 0x01D3C7C0, "_ZNK8CNavArea8ContainsEPK6Vector", mfunc_ptr_cast(&CNavArea::Contains) }, { 0x01D3C7C0, "_ZNK8CNavArea8ContainsEPK6Vector", mfunc_ptr_cast(&CNavArea::Contains) },
{ 0x01D3C8B0, "_ZNK8CNavArea10IsCoplanarEPKS_", mfunc_ptr_cast(&CNavArea::IsCoplanar) }, { 0x01D3C8B0, "_ZNK8CNavArea10IsCoplanarEPKS_", mfunc_ptr_cast(&CNavArea::IsCoplanar) },
//!@{ 0x01D3CA60, "_ZNK8CNavArea4GetZEPK6Vector", mfunc_ptr_cast<GETZ_VECTOR>(&CNavArea::GetZ) }, // Used refs { 0x01D3CA60, "_ZNK8CNavArea4GetZEPK6Vector", mfunc_ptr_cast<GETZ_VECTOR>(&CNavArea::GetZ) }, // NOTE: definitely need to hook CNavAreaGrid::GetNavArea!!
//{ 0x01D3CB50, "_ZNK8CNavArea4GetZEff", mfunc_ptr_cast<GETZ_TWO_FLOAT>(&CNavArea::GetZ) }, // NOXREF //{ 0x01D3CB50, "_ZNK8CNavArea4GetZEff", mfunc_ptr_cast<GETZ_TWO_FLOAT>(&CNavArea::GetZ) }, // NOXREF
{ 0x01D3CB80, "_ZNK8CNavArea21GetClosestPointOnAreaEPK6VectorPS0_", mfunc_ptr_cast(&CNavArea::GetClosestPointOnArea) }, { 0x01D3CB80, "_ZNK8CNavArea21GetClosestPointOnAreaEPK6VectorPS0_", mfunc_ptr_cast(&CNavArea::GetClosestPointOnArea) },
//{ 0x01D3CCD0, "_ZNK8CNavArea25GetDistanceSquaredToPointEPK6Vector", mfunc_ptr_cast(&CNavArea::GetDistanceSquaredToPoint) }, // NOXREF //{ 0x01D3CCD0, "_ZNK8CNavArea25GetDistanceSquaredToPointEPK6Vector", mfunc_ptr_cast(&CNavArea::GetDistanceSquaredToPoint) }, // NOXREF
@ -4993,9 +5002,9 @@ FunctionHook g_FunctionHooks[] =
{ 0x01D43360, "_ZN12CNavAreaGrid10InitializeEffff", mfunc_ptr_cast(&CNavAreaGrid::Initialize) }, { 0x01D43360, "_ZN12CNavAreaGrid10InitializeEffff", mfunc_ptr_cast(&CNavAreaGrid::Initialize) },
{ 0x01D43390, "_ZN12CNavAreaGrid10AddNavAreaEP8CNavArea", mfunc_ptr_cast(&CNavAreaGrid::AddNavArea) }, { 0x01D43390, "_ZN12CNavAreaGrid10AddNavAreaEP8CNavArea", mfunc_ptr_cast(&CNavAreaGrid::AddNavArea) },
{ 0x01D43560, "_ZN12CNavAreaGrid13RemoveNavAreaEP8CNavArea", mfunc_ptr_cast(&CNavAreaGrid::RemoveNavArea) }, { 0x01D43560, "_ZN12CNavAreaGrid13RemoveNavAreaEP8CNavArea", mfunc_ptr_cast(&CNavAreaGrid::RemoveNavArea) },
//!@{ 0x01D43710, "_ZNK12CNavAreaGrid10GetNavAreaEPK6Vectorf", mfunc_ptr_cast(&CNavAreaGrid::GetNavArea) }, // Used refs { 0x01D43710, "_ZNK12CNavAreaGrid10GetNavAreaEPK6Vectorf", mfunc_ptr_cast(&CNavAreaGrid::GetNavArea) }, // Used refs
//!@{ 0x01D43860, "_ZNK12CNavAreaGrid17GetNearestNavAreaEPK6Vectorb", mfunc_ptr_cast(&CNavAreaGrid::GetNearestNavArea) }, // Used refs { 0x01D43860, "_ZNK12CNavAreaGrid17GetNearestNavAreaEPK6Vectorb", mfunc_ptr_cast(&CNavAreaGrid::GetNearestNavArea) },
//{ 0x0, "_ZNK12CNavAreaGrid14GetNavAreaByIDEj", mfunc_ptr_cast(&CNavAreaGrid::GetNavAreaByID) }, { 0x01D439C0, "_ZNK12CNavAreaGrid14GetNavAreaByIDEj", mfunc_ptr_cast(&CNavAreaGrid::GetNavAreaByID) },
{ 0x01D439F0, "_ZNK12CNavAreaGrid8GetPlaceEPK6Vector", mfunc_ptr_cast(&CNavAreaGrid::GetPlace) }, { 0x01D439F0, "_ZNK12CNavAreaGrid8GetPlaceEPK6Vector", mfunc_ptr_cast(&CNavAreaGrid::GetPlace) },
{ 0x01D3E4F0, "_Z18ClassifySniperSpotP10HidingSpot", (size_t)&ClassifySniperSpot }, { 0x01D3E4F0, "_Z18ClassifySniperSpotP10HidingSpot", (size_t)&ClassifySniperSpot },
//{ 0x0, "", (size_t)&buildGoodSizedList }, // NOXREF //{ 0x0, "", (size_t)&buildGoodSizedList }, // NOXREF
@ -5011,8 +5020,9 @@ FunctionHook g_FunctionHooks[] =
{ 0x01D3F020, "_Z10DrawDangerv", (size_t)&DrawDanger }, { 0x01D3F020, "_Z10DrawDangerv", (size_t)&DrawDanger },
{ 0x01D3F1C0, "_Z14IsSpotOccupiedP11CBaseEntityPK6Vector", (size_t)&IsSpotOccupied }, { 0x01D3F1C0, "_Z14IsSpotOccupiedP11CBaseEntityPK6Vector", (size_t)&IsSpotOccupied },
{ 0x01D3F2A0, "_Z20FindNearbyHidingSpotP11CBaseEntityPK6VectorP8CNavAreafbb", (size_t)&FindNearbyHidingSpot }, { 0x01D3F2A0, "_Z20FindNearbyHidingSpotP11CBaseEntityPK6VectorP8CNavAreafbb", (size_t)&FindNearbyHidingSpot },
//{ 0x01D3F650, "_ZN25CollectHidingSpotsFunctorclEP8CNavArea", mfunc_ptr_cast<FIND_SPOT_CBASE>(&CollectHidingSpotsFunctor::operator()) },
{ 0x01D3FDE0, "_Z21FindNearbyRetreatSpotP11CBaseEntityPK6VectorP8CNavAreafib", mfunc_ptr_cast<FIND_SPOT_CBASE>(&FindNearbyRetreatSpot) }, { 0x01D3FDE0, "_Z21FindNearbyRetreatSpotP11CBaseEntityPK6VectorP8CNavAreafib", mfunc_ptr_cast<FIND_SPOT_CBASE>(&FindNearbyRetreatSpot) },
//{ 0x0, "_Z20IsCrossingLineOfFireRK6VectorS1_P11CBaseEntityi", (size_t)&IsCrossingLineOfFire }, { 0x01D3FAD0, "_Z20IsCrossingLineOfFireRK6VectorS1_P11CBaseEntityi", (size_t)&IsCrossingLineOfFire },
{ 0x01D3F850, "_Z20FindRandomHidingSpotP11CBaseEntityjb", (size_t)&FindRandomHidingSpot }, { 0x01D3F850, "_Z20FindRandomHidingSpotP11CBaseEntityjb", (size_t)&FindRandomHidingSpot },
{ 0x01D37FB0, "_Z17GetHidingSpotByIDj", (size_t)&GetHidingSpotByID }, { 0x01D37FB0, "_Z17GetHidingSpotByIDj", (size_t)&GetHidingSpotByID },
{ 0x01D39F30, "_Z24ApproachAreaAnalysisPrepv", (size_t)&ApproachAreaAnalysisPrep }, { 0x01D39F30, "_Z24ApproachAreaAnalysisPrepv", (size_t)&ApproachAreaAnalysisPrep },
@ -5020,23 +5030,25 @@ FunctionHook g_FunctionHooks[] =
//{ 0x01D3A010, "_Z14DestroyLaddersv", (size_t)&DestroyLadders }, // NOXREF //{ 0x01D3A010, "_Z14DestroyLaddersv", (size_t)&DestroyLadders }, // NOXREF
{ 0x01D3A060, "_Z20DestroyNavigationMapv", (size_t)&DestroyNavigationMap }, { 0x01D3A060, "_Z20DestroyNavigationMapv", (size_t)&DestroyNavigationMap },
{ 0x01D3A210, "_Z20StripNavigationAreasv", (size_t)&StripNavigationAreas }, { 0x01D3A210, "_Z20StripNavigationAreasv", (size_t)&StripNavigationAreas },
#ifdef _WIN32 #ifdef _WIN32
{ 0x01D3A870, "", (size_t)&FindFirstAreaInDirection }, { 0x01D3A870, "", (size_t)&FindFirstAreaInDirection },
{ 0x01D3A9E0, "", (size_t)&testJumpDown }, // NOXREF { 0x01D3AD20, "", (size_t)&IsAreaRoughlySquare },
{ 0x01D3AD20, "", (size_t)&IsAreaRoughlySquare }, // NOXREF { 0x01D2B030, "", (size_t)&IsEntityWalkable },
{ 0x01D2B0B0, "", (size_t)&IsWalkableTraceLineClear },
{ 0x01D3A9E0, "", (size_t)&testJumpDown },
#endif // _WIN32 #endif // _WIN32
//{ 0x0, "", (size_t)&findJumpDownArea }, // NOXREF //{ 0x0, "", (size_t)&findJumpDownArea }, // NOXREF
{ 0x01D3A330, "_Z21ConnectGeneratedAreasv", (size_t)&ConnectGeneratedAreas }, { 0x01D3A330, "_Z21ConnectGeneratedAreasv", (size_t)&ConnectGeneratedAreas },
{ 0x01D3AAF0, "_Z19MergeGeneratedAreasv", (size_t)&MergeGeneratedAreas }, { 0x01D3AAF0, "_Z19MergeGeneratedAreasv", (size_t)&MergeGeneratedAreas },
//{ 0x0, "_Z6SplitXP8CNavArea", (size_t)&SplitX }, { 0x01D3AE00, "_Z6SplitXP8CNavArea", (size_t)&SplitX },
//{ 0x0, "_Z6SplitYP8CNavArea", (size_t)&SplitY }, //{ 0x0, "_Z6SplitYP8CNavArea", (size_t)&SplitY }, // NOXREF
//{ 0x0, "_Z13SquareUpAreasv", (size_t)&SquareUpAreas }, { 0x01D3AEE0, "_Z13SquareUpAreasv", (size_t)&SquareUpAreas },
{ 0x01D3B100, "_Z8TestAreaP8CNavNodeii", (size_t)&TestArea }, { 0x01D3B100, "_Z8TestAreaP8CNavNodeii", (size_t)&TestArea },
{ 0x01D3B2E0, "_Z9BuildAreaP8CNavNodeii", (size_t)&BuildArea }, { 0x01D3B2E0, "_Z9BuildAreaP8CNavNodeii", (size_t)&BuildArea },
{ 0x01D3B3F0, "_Z12BuildLaddersv", (size_t)&BuildLadders }, { 0x01D3B3F0, "_Z12BuildLaddersv", (size_t)&BuildLadders },
{ 0x01D3C1B0, "_Z13MarkJumpAreasv", (size_t)&MarkJumpAreas }, { 0x01D3C1B0, "_Z13MarkJumpAreasv", (size_t)&MarkJumpAreas },
{ 0x01D3C280, "_Z26GenerateNavigationAreaMeshv", (size_t)&GenerateNavigationAreaMesh }, { 0x01D3C280, "_Z26GenerateNavigationAreaMeshv", (size_t)&GenerateNavigationAreaMesh },
#endif // Nav_Region #endif // Nav_Region
#ifndef Hostage_Region #ifndef Hostage_Region
@ -5053,25 +5065,25 @@ FunctionHook g_FunctionHooks[] =
{ 0x01D51270, "_ZN14CHostageImprov11ClearLookAtEv", mfunc_ptr_cast(&CHostageImprov::ClearLookAt_) }, { 0x01D51270, "_ZN14CHostageImprov11ClearLookAtEv", mfunc_ptr_cast(&CHostageImprov::ClearLookAt_) },
{ 0x01D51280, "_ZN14CHostageImprov6FaceToERK6Vector", mfunc_ptr_cast(&CHostageImprov::FaceTo_) }, { 0x01D51280, "_ZN14CHostageImprov6FaceToERK6Vector", mfunc_ptr_cast(&CHostageImprov::FaceTo_) },
{ 0x01D512B0, "_ZN14CHostageImprov11ClearFaceToEv", mfunc_ptr_cast(&CHostageImprov::ClearFaceTo_) }, { 0x01D512B0, "_ZN14CHostageImprov11ClearFaceToEv", mfunc_ptr_cast(&CHostageImprov::ClearFaceTo_) },
//{ 0x0, "_ZNK14CHostageImprov12IsAtMoveGoalEf", mfunc_ptr_cast(&CHostageImprov::IsAtMoveGoal_) }, { 0x01D51AC0, "_ZNK14CHostageImprov12IsAtMoveGoalEf", mfunc_ptr_cast(&CHostageImprov::IsAtMoveGoal_) },
//{ 0x0, "_ZNK14CHostageImprov9HasLookAtEv", mfunc_ptr_cast(&CHostageImprov::HasLookAt_) }, // DEFAULT //{ 0x0, "_ZNK14CHostageImprov9HasLookAtEv", mfunc_ptr_cast(&CHostageImprov::HasLookAt_) }, // DEFAULT
//{ 0x0, "_ZNK14CHostageImprov9HasFaceToEv", mfunc_ptr_cast(&CHostageImprov::HasFaceTo_) }, // DEFAULT //{ 0x0, "_ZNK14CHostageImprov9HasFaceToEv", mfunc_ptr_cast(&CHostageImprov::HasFaceTo_) }, // DEFAULT
//{ 0x0, "_ZNK14CHostageImprov12IsAtFaceGoalEv", mfunc_ptr_cast(&CHostageImprov::IsAtFaceGoal_) }, { 0x01D51B20, "_ZNK14CHostageImprov12IsAtFaceGoalEv", mfunc_ptr_cast(&CHostageImprov::IsAtFaceGoal_) },
//{ 0x0, "_ZNK14CHostageImprov16IsFriendInTheWayERK6Vector", mfunc_ptr_cast<IS_FRIEND_IN_THE_WAY_VECTOR>(&CHostageImprov::IsFriendInTheWay_) }, { 0x01D51B30, "_ZNK14CHostageImprov16IsFriendInTheWayERK6Vector", mfunc_ptr_cast<IS_FRIEND_IN_THE_WAY_VECTOR>(&CHostageImprov::IsFriendInTheWay_) },
//{ 0x0, "_ZNK14CHostageImprov16IsFriendInTheWayEP11CBaseEntityRK6Vector", mfunc_ptr_cast<IS_FRIEND_IN_THE_WAY_CBASE>(&CHostageImprov::IsFriendInTheWay_) }, { 0x01D51CB0, "_ZNK14CHostageImprov16IsFriendInTheWayEP11CBaseEntityRK6Vector", mfunc_ptr_cast<IS_FRIEND_IN_THE_WAY_CBASE>(&CHostageImprov::IsFriendInTheWay_) },
//{ 0x0, "_ZN14CHostageImprov11MoveForwardEv", mfunc_ptr_cast(&CHostageImprov::MoveForward_) }, // DEFAULT //{ 0x0, "_ZN14CHostageImprov11MoveForwardEv", mfunc_ptr_cast(&CHostageImprov::MoveForward_) }, // DEFAULT
//{ 0x0, "_ZN14CHostageImprov12MoveBackwardEv", mfunc_ptr_cast(&CHostageImprov::MoveBackward_) }, // DEFAULT //{ 0x0, "_ZN14CHostageImprov12MoveBackwardEv", mfunc_ptr_cast(&CHostageImprov::MoveBackward_) }, // DEFAULT
//{ 0x0, "_ZN14CHostageImprov10StrafeLeftEv", mfunc_ptr_cast(&CHostageImprov::StrafeLeft_) }, // DEFAULT //{ 0x0, "_ZN14CHostageImprov10StrafeLeftEv", mfunc_ptr_cast(&CHostageImprov::StrafeLeft_) }, // DEFAULT
//{ 0x0, "_ZN14CHostageImprov11StrafeRightEv", mfunc_ptr_cast(&CHostageImprov::StrafeRight_) }, //{ 0x0, "_ZN14CHostageImprov11StrafeRightEv", mfunc_ptr_cast(&CHostageImprov::StrafeRight_) },
//{ 0x0, "_ZN14CHostageImprov4JumpEv", mfunc_ptr_cast(&CHostageImprov::Jump_) }, { 0x01D52260, "_ZN14CHostageImprov4JumpEv", mfunc_ptr_cast(&CHostageImprov::Jump_) },
{ 0x01D56710, "_ZN14CHostageImprov6CrouchEv", mfunc_ptr_cast(&CHostageImprov::Crouch_) }, { 0x01D56710, "_ZN14CHostageImprov6CrouchEv", mfunc_ptr_cast(&CHostageImprov::Crouch_) },
{ 0x01D567A0, "_ZN14CHostageImprov7StandUpEv", mfunc_ptr_cast(&CHostageImprov::StandUp_) }, { 0x01D567A0, "_ZN14CHostageImprov7StandUpEv", mfunc_ptr_cast(&CHostageImprov::StandUp_) },
//{ 0x0, "_ZN14CHostageImprov9TrackPathERK6Vectorf", mfunc_ptr_cast(&CHostageImprov::TrackPath_) }, { 0x01D52D80, "_ZN14CHostageImprov9TrackPathERK6Vectorf", mfunc_ptr_cast(&CHostageImprov::TrackPath_) },
{ 0x01D530D0, "_ZN14CHostageImprov11StartLadderEPK10CNavLadder15NavTraverseTypePK6VectorS6_", mfunc_ptr_cast(&CHostageImprov::StartLadder_) }, { 0x01D530D0, "_ZN14CHostageImprov11StartLadderEPK10CNavLadder15NavTraverseTypePK6VectorS6_", mfunc_ptr_cast(&CHostageImprov::StartLadder_) },
//{ 0x01D530E0, "_ZN14CHostageImprov14TraverseLadderEPK10CNavLadder15NavTraverseTypePK6VectorS6_f", mfunc_ptr_cast(&CHostageImprov::TraverseLadder_) }, { 0x01D530E0, "_ZN14CHostageImprov14TraverseLadderEPK10CNavLadder15NavTraverseTypePK6VectorS6_f", mfunc_ptr_cast(&CHostageImprov::TraverseLadder_) },
{ 0x01D51150, "_ZN14CHostageImprov30GetSimpleGroundHeightWithFloorEPK6VectorPfPS0_", mfunc_ptr_cast(&CHostageImprov::GetSimpleGroundHeightWithFloor_) }, { 0x01D51150, "_ZN14CHostageImprov30GetSimpleGroundHeightWithFloorEPK6VectorPfPS0_", mfunc_ptr_cast(&CHostageImprov::GetSimpleGroundHeightWithFloor_) },
//{ 0x0, "_ZN14CHostageImprov3RunEv", mfunc_ptr_cast(&CHostageImprov::Run_) }, { 0x01D52350, "_ZN14CHostageImprov3RunEv", mfunc_ptr_cast(&CHostageImprov::Run_) },
//{ 0x0, "_ZN14CHostageImprov4WalkEv", mfunc_ptr_cast(&CHostageImprov::Walk_) }, { 0x01D52360, "_ZN14CHostageImprov4WalkEv", mfunc_ptr_cast(&CHostageImprov::Walk_) },
{ 0x01D52380, "_ZN14CHostageImprov4StopEv", mfunc_ptr_cast(&CHostageImprov::Stop_) }, { 0x01D52380, "_ZN14CHostageImprov4StopEv", mfunc_ptr_cast(&CHostageImprov::Stop_) },
//{ 0x0, "_ZNK14CHostageImprov12GetMoveAngleEv", mfunc_ptr_cast(&CHostageImprov::GetMoveAngle_) }, // DEFAULT //{ 0x0, "_ZNK14CHostageImprov12GetMoveAngleEv", mfunc_ptr_cast(&CHostageImprov::GetMoveAngle_) }, // DEFAULT
//{ 0x0, "_ZNK14CHostageImprov12GetFaceAngleEv", mfunc_ptr_cast(&CHostageImprov::GetFaceAngle_) }, // DEFAULT //{ 0x0, "_ZNK14CHostageImprov12GetFaceAngleEv", mfunc_ptr_cast(&CHostageImprov::GetFaceAngle_) }, // DEFAULT
@ -5081,27 +5093,30 @@ FunctionHook g_FunctionHooks[] =
//{ 0x0, "_ZNK14CHostageImprov9IsRunningEv", mfunc_ptr_cast(&CHostageImprov::IsRunning_) }, // DEFAULT //{ 0x0, "_ZNK14CHostageImprov9IsRunningEv", mfunc_ptr_cast(&CHostageImprov::IsRunning_) }, // DEFAULT
//{ 0x0, "_ZNK14CHostageImprov9IsWalkingEv", mfunc_ptr_cast(&CHostageImprov::IsWalking_) }, // DEFAULT //{ 0x0, "_ZNK14CHostageImprov9IsWalkingEv", mfunc_ptr_cast(&CHostageImprov::IsWalking_) }, // DEFAULT
//{ 0x01D56CC0, "_ZNK14CHostageImprov9IsStoppedEv", mfunc_ptr_cast(&CHostageImprov::IsStopped_) }, // DEFAULT //{ 0x01D56CC0, "_ZNK14CHostageImprov9IsStoppedEv", mfunc_ptr_cast(&CHostageImprov::IsStopped_) }, // DEFAULT
//{ 0x0, "_ZNK14CHostageImprov11IsCrouchingEv", mfunc_ptr_cast(&CHostageImprov::IsCrouching_) }, // DEFAULT //{ 0x01D56CD0, "_ZNK14CHostageImprov11IsCrouchingEv", mfunc_ptr_cast(&CHostageImprov::IsCrouching_) }, // DEFAULT
//{ 0x0, "_ZNK14CHostageImprov9IsJumpingEv", mfunc_ptr_cast(&CHostageImprov::IsJumping_) }, // DEFAULT //{ 0x01D56CE0, "_ZNK14CHostageImprov9IsJumpingEv", mfunc_ptr_cast(&CHostageImprov::IsJumping_) }, // DEFAULT
//{ 0x0, "_ZNK14CHostageImprov13IsUsingLadderEv", mfunc_ptr_cast(&CHostageImprov::IsUsingLadder_) }, // DEFAULT //{ 0x01D56D20, "_ZNK14CHostageImprov13IsUsingLadderEv", mfunc_ptr_cast(&CHostageImprov::IsUsingLadder_) }, // DEFAULT
//{ 0x0, "_ZNK14CHostageImprov10IsOnGroundEv", mfunc_ptr_cast(&CHostageImprov::IsOnGround_) }, { 0x01D52460, "_ZNK14CHostageImprov10IsOnGroundEv", mfunc_ptr_cast(&CHostageImprov::IsOnGround_) },
//{ 0x0, "_ZNK14CHostageImprov8IsMovingEv", mfunc_ptr_cast(&CHostageImprov::IsMoving_) }, { 0x01D52480, "_ZNK14CHostageImprov8IsMovingEv", mfunc_ptr_cast(&CHostageImprov::IsMoving_) },
//{ 0x0, "_ZNK14CHostageImprov6CanRunEv", mfunc_ptr_cast(&CHostageImprov::CanRun_) }, // DEFAULT //{ 0x0, "_ZNK14CHostageImprov6CanRunEv", mfunc_ptr_cast(&CHostageImprov::CanRun_) }, // DEFAULT
//{ 0x0, "_ZNK14CHostageImprov9CanCrouchEv", mfunc_ptr_cast(&CHostageImprov::CanCrouch_) }, // DEFAULT //{ 0x0, "_ZNK14CHostageImprov9CanCrouchEv", mfunc_ptr_cast(&CHostageImprov::CanCrouch_) }, // DEFAULT
//{ 0x0, "_ZNK14CHostageImprov7CanJumpEv", mfunc_ptr_cast(&CHostageImprov::CanJump_) }, // DEFAULT //{ 0x0, "_ZNK14CHostageImprov7CanJumpEv", mfunc_ptr_cast(&CHostageImprov::CanJump_) }, // DEFAULT
{ 0x01D524C0, "_ZNK14CHostageImprov9IsVisibleERK6Vectorb", mfunc_ptr_cast(&CHostageImprov::IsVisible_) }, { 0x01D524C0, "_ZNK14CHostageImprov9IsVisibleERK6Vectorb", mfunc_ptr_cast(&CHostageImprov::IsVisible_) },
//{ 0x0, "_ZNK14CHostageImprov19IsPlayerLookingAtMeEP11CBasePlayerf", mfunc_ptr_cast(&CHostageImprov::IsPlayerLookingAtMe_) }, { 0x01D52530, "_ZNK14CHostageImprov19IsPlayerLookingAtMeEP11CBasePlayerf", mfunc_ptr_cast(&CHostageImprov::IsPlayerLookingAtMe_) },
//{ 0x0, "_ZNK14CHostageImprov22IsAnyPlayerLookingAtMeEif", mfunc_ptr_cast(&CHostageImprov::IsAnyPlayerLookingAtMe_) }, { 0x01D526A0, "_ZNK14CHostageImprov22IsAnyPlayerLookingAtMeEif", mfunc_ptr_cast(&CHostageImprov::IsAnyPlayerLookingAtMe_) },
//{ 0x0, "_ZNK14CHostageImprov32GetClosestPlayerByTravelDistanceEiPf", mfunc_ptr_cast(&CHostageImprov::GetClosestPlayerByTravelDistance_) }, { 0x01D527B0, "_ZNK14CHostageImprov32GetClosestPlayerByTravelDistanceEiPf", mfunc_ptr_cast(&CHostageImprov::GetClosestPlayerByTravelDistance_) },
//{ 0x01D56D60, "_ZNK14CHostageImprov16GetLastKnownAreaEv", mfunc_ptr_cast(&CHostageImprov::GetLastKnownArea_) }, // DEFAULT //{ 0x01D56D60, "_ZNK14CHostageImprov16GetLastKnownAreaEv", mfunc_ptr_cast(&CHostageImprov::GetLastKnownArea_) }, // DEFAULT
//{ 0x0, "_ZN14CHostageImprov8OnUpdateEf", mfunc_ptr_cast(&CHostageImprov::OnUpdate_) }, { 0x01D54500, "_ZN14CHostageImprov8OnUpdateEf", mfunc_ptr_cast(&CHostageImprov::OnUpdate_) },
//{ 0x0, "_ZN14CHostageImprov8OnUpkeepEf", mfunc_ptr_cast(&CHostageImprov::OnUpkeep_) }, { 0x01D53FF0, "_ZN14CHostageImprov8OnUpkeepEf", mfunc_ptr_cast(&CHostageImprov::OnUpkeep_) },
{ 0x01D52A60, "_ZN14CHostageImprov7OnResetEv", mfunc_ptr_cast(&CHostageImprov::OnReset_) }, { 0x01D52A60, "_ZN14CHostageImprov7OnResetEv", mfunc_ptr_cast(&CHostageImprov::OnReset_) },
{ 0x01D54C10, "_ZN14CHostageImprov11OnGameEventE13GameEventTypeP11CBaseEntityS2_", mfunc_ptr_cast(&CHostageImprov::OnGameEvent_) }, { 0x01D54C10, "_ZN14CHostageImprov11OnGameEventE13GameEventTypeP11CBaseEntityS2_", mfunc_ptr_cast(&CHostageImprov::OnGameEvent_) },
{ 0x01D55280, "_ZN14CHostageImprov7OnTouchEP11CBaseEntity", mfunc_ptr_cast(&CHostageImprov::OnTouch_) }, { 0x01D55280, "_ZN14CHostageImprov7OnTouchEP11CBaseEntity", mfunc_ptr_cast(&CHostageImprov::OnTouch_) },
//non-virtual func //non-virtual func
//{ 0x01D51900, "_ZN14CHostageImprov12FaceOutwardsEv", mfunc_ptr_cast(&CHostageImprov::FaceOutwards) }, { 0x01D51900, "_ZN14CHostageImprov12FaceOutwardsEv", mfunc_ptr_cast(&CHostageImprov::FaceOutwards) },
//{ 0x0, "_ZNK14CHostageImprov16IsFriendInTheWayEv", mfunc_ptr_cast(&CHostageImprov::IsFriendInTheWay) }, { 0x01D51F80, "_ZNK14CHostageImprov16IsFriendInTheWayEv", mfunc_ptr_cast<IS_FRIEND_IN_THE_WAY>(&CHostageImprov::IsFriendInTheWay) },
//{ 0x01D52150, "_ZN10CheckAheadclEP11CBaseEntity", mfunc_ptr_cast(&CheckAhead::operator()) },
//{ 0x0, "_ZN15CheckWayFunctorclEP8CHostage", mfunc_ptr_cast(&CheckWayFunctor::operator()) },
{ 0x01D53E70, "_ZNK17KeepPersonalSpaceclEP11CBaseEntity", mfunc_ptr_cast(&KeepPersonalSpace::operator()) },
//{ 0x01D52EE0, "_ZN14CHostageImprov20SetKnownGoodPositionERK6Vector", mfunc_ptr_cast(&CHostageImprov::SetKnownGoodPosition) }, // NOXREF //{ 0x01D52EE0, "_ZN14CHostageImprov20SetKnownGoodPositionERK6Vector", mfunc_ptr_cast(&CHostageImprov::SetKnownGoodPosition) }, // NOXREF
//{ 0x0, "_ZNK14CHostageImprov20GetKnownGoodPositionEv", mfunc_ptr_cast(&CHostageImprov::GetKnownGoodPosition) }, //{ 0x0, "_ZNK14CHostageImprov20GetKnownGoodPositionEv", mfunc_ptr_cast(&CHostageImprov::GetKnownGoodPosition) },
{ 0x01D52F90, "_ZN14CHostageImprov24ResetToKnownGoodPositionEv", mfunc_ptr_cast(&CHostageImprov::ResetToKnownGoodPosition) }, { 0x01D52F90, "_ZN14CHostageImprov24ResetToKnownGoodPositionEv", mfunc_ptr_cast(&CHostageImprov::ResetToKnownGoodPosition) },
@ -5130,14 +5145,14 @@ FunctionHook g_FunctionHooks[] =
{ 0x01D54010, "_ZN14CHostageImprov17IsTerroristNearbyEv", mfunc_ptr_cast(&CHostageImprov::IsTerroristNearby) }, { 0x01D54010, "_ZN14CHostageImprov17IsTerroristNearbyEv", mfunc_ptr_cast(&CHostageImprov::IsTerroristNearby) },
{ 0x01D55C20, "_ZN14CHostageImprov8FrightenENS_9ScareTypeE", mfunc_ptr_cast(&CHostageImprov::Frighten) }, { 0x01D55C20, "_ZN14CHostageImprov8FrightenENS_9ScareTypeE", mfunc_ptr_cast(&CHostageImprov::Frighten) },
{ 0x01D55BF0, "_ZNK14CHostageImprov8IsScaredEv", mfunc_ptr_cast(&CHostageImprov::IsScared) }, { 0x01D55BF0, "_ZNK14CHostageImprov8IsScaredEv", mfunc_ptr_cast(&CHostageImprov::IsScared) },
//{ 0x0, "_ZNK14CHostageImprov17GetScareIntensityEv", mfunc_ptr_cast(&CHostageImprov::GetScareIntensity) }, //{ 0x0, "_ZNK14CHostageImprov17GetScareIntensityEv", mfunc_ptr_cast(&CHostageImprov::GetScareIntensity) }, // DEFAULT
//{ 0x0, "_ZNK14CHostageImprov20IsIgnoringTerroristsEv", mfunc_ptr_cast(&CHostageImprov::IsIgnoringTerrorists) }, //{ 0x0, "_ZNK14CHostageImprov20IsIgnoringTerroristsEv", mfunc_ptr_cast(&CHostageImprov::IsIgnoringTerrorists) }, // DEFAULT
//{ 0x0, "_ZNK14CHostageImprov13GetAggressionEv", mfunc_ptr_cast(&CHostageImprov::GetAggression) }, //{ 0x0, "_ZNK14CHostageImprov13GetAggressionEv", mfunc_ptr_cast(&CHostageImprov::GetAggression) }, // DEFAULT
{ 0x01D55ED0, "_ZN14CHostageImprov7ChatterE18HostageChatterTypeb", mfunc_ptr_cast(&CHostageImprov::Chatter) }, { 0x01D55ED0, "_ZN14CHostageImprov7ChatterE18HostageChatterTypeb", mfunc_ptr_cast(&CHostageImprov::Chatter) },
{ 0x01D55F80, "_ZN14CHostageImprov14DelayedChatterEf18HostageChatterTypeb", mfunc_ptr_cast(&CHostageImprov::DelayedChatter) }, { 0x01D55F80, "_ZN14CHostageImprov14DelayedChatterEf18HostageChatterTypeb", mfunc_ptr_cast(&CHostageImprov::DelayedChatter) },
//{ 0x01D55FE0, "_ZN14CHostageImprov20UpdateDelayedChatterEv", mfunc_ptr_cast(&CHostageImprov::UpdateDelayedChatter) }, // NOXREF //{ 0x01D55FE0, "_ZN14CHostageImprov20UpdateDelayedChatterEv", mfunc_ptr_cast(&CHostageImprov::UpdateDelayedChatter) }, // NOXREF
//{ 0x0, "_ZNK14CHostageImprov9IsTalkingEv", mfunc_ptr_cast(&CHostageImprov::IsTalking) }, //{ 0x0, "_ZNK14CHostageImprov9IsTalkingEv", mfunc_ptr_cast(&CHostageImprov::IsTalking) }, // DEFAULT
//{ 0x0, "_ZN14CHostageImprov22UpdateGrenadeReactionsEv", mfunc_ptr_cast(&CHostageImprov::UpdateGrenadeReactions) }, { 0x01D54150, "_ZN14CHostageImprov22UpdateGrenadeReactionsEv", mfunc_ptr_cast(&CHostageImprov::UpdateGrenadeReactions) },
{ 0x01D55D20, "_ZN14CHostageImprov6AfraidEv", mfunc_ptr_cast(&CHostageImprov::Afraid) }, { 0x01D55D20, "_ZN14CHostageImprov6AfraidEv", mfunc_ptr_cast(&CHostageImprov::Afraid) },
{ 0x01D56290, "_ZN14CHostageImprov4WaveEv", mfunc_ptr_cast(&CHostageImprov::Wave) }, { 0x01D56290, "_ZN14CHostageImprov4WaveEv", mfunc_ptr_cast(&CHostageImprov::Wave) },
{ 0x01D56210, "_ZN14CHostageImprov5AgreeEv", mfunc_ptr_cast(&CHostageImprov::Agree) }, { 0x01D56210, "_ZN14CHostageImprov5AgreeEv", mfunc_ptr_cast(&CHostageImprov::Agree) },
@ -5148,25 +5163,27 @@ FunctionHook g_FunctionHooks[] =
//{ 0x01D56910, "_ZN14CHostageImprov25UpdateStationaryAnimationEv", mfunc_ptr_cast(&CHostageImprov::UpdateStationaryAnimation) }, // NOXREF //{ 0x01D56910, "_ZN14CHostageImprov25UpdateStationaryAnimationEv", mfunc_ptr_cast(&CHostageImprov::UpdateStationaryAnimation) }, // NOXREF
//{ 0x0, "_ZNK14CHostageImprov9GetEntityEv", mfunc_ptr_cast(&CHostageImprov::GetEntity) }, //{ 0x0, "_ZNK14CHostageImprov9GetEntityEv", mfunc_ptr_cast(&CHostageImprov::GetEntity) },
//{ 0x01D540C0, "_ZN14CHostageImprov24CheckForNearbyTerroristsEv", mfunc_ptr_cast(&CHostageImprov::CheckForNearbyTerrorists) }, // NOXREF //{ 0x01D540C0, "_ZN14CHostageImprov24CheckForNearbyTerroristsEv", mfunc_ptr_cast(&CHostageImprov::CheckForNearbyTerrorists) }, // NOXREF
//{ 0x01D534F0, "_ZN14CHostageImprov14UpdatePositionEf", mfunc_ptr_cast(&CHostageImprov::UpdatePosition) }, { 0x01D534F0, "_ZN14CHostageImprov14UpdatePositionEf", mfunc_ptr_cast(&CHostageImprov::UpdatePosition) },
{ 0x01D512C0, "_ZN14CHostageImprov11MoveTowardsERK6Vectorf", mfunc_ptr_cast(&CHostageImprov::MoveTowards) }, { 0x01D512C0, "_ZN14CHostageImprov11MoveTowardsERK6Vectorf", mfunc_ptr_cast(&CHostageImprov::MoveTowards) },
//{ 0x01D517A0, "_ZN14CHostageImprov11FaceTowardsERK6Vectorf", mfunc_ptr_cast(&CHostageImprov::FaceTowards) }, { 0x01D517A0, "_ZN14CHostageImprov11FaceTowardsERK6Vectorf", mfunc_ptr_cast(&CHostageImprov::FaceTowards) },
//{ 0x0, "_ZN14CHostageImprov8GetSpeedEv", mfunc_ptr_cast(&CHostageImprov::GetSpeed) }, //{ 0x01D52250, "_ZN14CHostageImprov8GetSpeedEv", mfunc_ptr_cast(&CHostageImprov::GetSpeed) }, // NOXREF
//{ 0x0, "_ZN14CHostageImprov12SetMoveAngleEf", mfunc_ptr_cast(&CHostageImprov::SetMoveAngle) }, //{ 0x0, "_ZN14CHostageImprov12SetMoveAngleEf", mfunc_ptr_cast(&CHostageImprov::SetMoveAngle) },
{ 0x01D56300, "_ZN14CHostageImprov6WiggleEv", mfunc_ptr_cast(&CHostageImprov::Wiggle) }, { 0x01D56300, "_ZN14CHostageImprov6WiggleEv", mfunc_ptr_cast(&CHostageImprov::Wiggle) },
{ 0x01D564E0, "_ZN14CHostageImprov9ClearPathEv", mfunc_ptr_cast(&CHostageImprov::ClearPath) }, { 0x01D564E0, "_ZN14CHostageImprov9ClearPathEv", mfunc_ptr_cast(&CHostageImprov::ClearPath) },
{ 0x01D4A890, "_Z16NavAreaBuildPathI15HostagePathCostEbP8CNavAreaS2_PK6VectorRT_PS2_", (size_t)&NavAreaBuildPath__HostagePathCost__wrapper },
{ 0x01D15AD0, "_Z16NavAreaBuildPathI16ShortestPathCostEbP8CNavAreaS2_PK6VectorRT_PS2_", (size_t)&NavAreaBuildPath__ShortestPathCost__wrapper },
//{ 0x01D511C0, "_ZN14CHostageImprov17DiscontinuityJumpEfbb", mfunc_ptr_cast(&CHostageImprov::DiscontinuityJump) }, // NOXREF //{ 0x01D511C0, "_ZN14CHostageImprov17DiscontinuityJumpEfbb", mfunc_ptr_cast(&CHostageImprov::DiscontinuityJump) }, // NOXREF
//{ 0x0, "_ZN14CHostageImprov12UpdateVisionEv", mfunc_ptr_cast(&CHostageImprov::UpdateVision) }, { 0x01D52C00, "_ZN14CHostageImprov12UpdateVisionEv", mfunc_ptr_cast(&CHostageImprov::UpdateVision) },
//HostageState //HostageState
//virtual func //virtual func
//{ 0x0, "_ZN12HostageStateD0Ev", mfunc_ptr_cast(&HostageState::~HostageState) }, //{ 0x0, "_ZN12HostageStateD0Ev", mfunc_ptr_cast(&HostageState::~HostageState) },
//{ 0x0, "_ZN12HostageStateD2Ev", mfunc_ptr_cast(&HostageState::~HostageState) }, //{ 0x0, "_ZN12HostageStateD2Ev", mfunc_ptr_cast(&HostageState::~HostageState) },
//{ 0x0, "_ZN12HostageState25UpdateStationaryAnimationEP14CHostageImprov", mfunc_ptr_cast(&HostageState::UpdateStationaryAnimation) }, //{ 0x01D569C0, "_ZN12HostageState25UpdateStationaryAnimationEP14CHostageImprov", mfunc_ptr_cast(&HostageState::UpdateStationaryAnimation) },
//HostageIdleState //HostageIdleState
//virtual func //virtual func
{ 0x01D4B3A0, "_ZN16HostageIdleState7OnEnterEP14CHostageImprov", mfunc_ptr_cast(&HostageIdleState::OnEnter_) }, { 0x01D4B3A0, "_ZN16HostageIdleState7OnEnterEP14CHostageImprov", mfunc_ptr_cast(&HostageIdleState::OnEnter_) },
//{ 0x01D4B3C0, "_ZN16HostageIdleState8OnUpdateEP14CHostageImprov", mfunc_ptr_cast(&HostageIdleState::OnUpdate_) }, { 0x01D4B3C0, "_ZN16HostageIdleState8OnUpdateEP14CHostageImprov", mfunc_ptr_cast(&HostageIdleState::OnUpdate_) },
//{ 0x0, "_ZN16HostageIdleState6OnExitEP14CHostageImprov", mfunc_ptr_cast(&HostageIdleState::OnExit_) }, { 0x01D4BBB0, "_ZN16HostageIdleState6OnExitEP14CHostageImprov", mfunc_ptr_cast(&HostageIdleState::OnExit_) },
//{ 0x0, "_ZNK16HostageIdleState7GetNameEv", mfunc_ptr_cast(&HostageIdleState::GetName_) }, // DEFAULT //{ 0x0, "_ZNK16HostageIdleState7GetNameEv", mfunc_ptr_cast(&HostageIdleState::GetName_) }, // DEFAULT
{ 0x01D4BBD0, "_ZN16HostageIdleState25UpdateStationaryAnimationEP14CHostageImprov", mfunc_ptr_cast(&HostageIdleState::UpdateStationaryAnimation_) }, { 0x01D4BBD0, "_ZN16HostageIdleState25UpdateStationaryAnimationEP14CHostageImprov", mfunc_ptr_cast(&HostageIdleState::UpdateStationaryAnimation_) },
//{ 0x0, "_ZN16HostageIdleState15OnMoveToSuccessERK6Vector", mfunc_ptr_cast(&HostageIdleState::OnMoveToSuccess_) }, // DEFAULT //{ 0x0, "_ZN16HostageIdleState15OnMoveToSuccessERK6Vector", mfunc_ptr_cast(&HostageIdleState::OnMoveToSuccess_) }, // DEFAULT
@ -5181,42 +5198,42 @@ FunctionHook g_FunctionHooks[] =
//{ 0x0, "_ZN19HostageStateMachine25UpdateStationaryAnimationEP14CHostageImprov", mfunc_ptr_cast(&HostageStateMachine::UpdateStationaryAnimation) }, //{ 0x0, "_ZN19HostageStateMachine25UpdateStationaryAnimationEP14CHostageImprov", mfunc_ptr_cast(&HostageStateMachine::UpdateStationaryAnimation) },
//HostageEscapeToCoverState //HostageEscapeToCoverState
//virtual func //virtual func
//{ 0x0, "_ZN25HostageEscapeToCoverState7OnEnterEP14CHostageImprov", mfunc_ptr_cast(&HostageEscapeToCoverState::OnEnter) }, { 0x01D4A200, "_ZN25HostageEscapeToCoverState7OnEnterEP14CHostageImprov", mfunc_ptr_cast(&HostageEscapeToCoverState::OnEnter_) },
//{ 0x0, "_ZN25HostageEscapeToCoverState8OnUpdateEP14CHostageImprov", mfunc_ptr_cast(&HostageEscapeToCoverState::OnUpdate) }, { 0x01D4A4A0, "_ZN25HostageEscapeToCoverState8OnUpdateEP14CHostageImprov", mfunc_ptr_cast(&HostageEscapeToCoverState::OnUpdate_) },
//{ 0x0, "_ZN25HostageEscapeToCoverState6OnExitEP14CHostageImprov", mfunc_ptr_cast(&HostageEscapeToCoverState::OnExit) }, //{ 0x01D4A590, "_ZN25HostageEscapeToCoverState6OnExitEP14CHostageImprov", mfunc_ptr_cast(&HostageEscapeToCoverState::OnExit_) }, // PURE
//{ 0x0, "_ZNK25HostageEscapeToCoverState7GetNameEv", mfunc_ptr_cast(&HostageEscapeToCoverState::GetName) }, //{ 0x01D56B00, "_ZNK25HostageEscapeToCoverState7GetNameEv", mfunc_ptr_cast(&HostageEscapeToCoverState::GetName_) },
//{ 0x0, "_ZN25HostageEscapeToCoverState15OnMoveToFailureERK6VectorN12IImprovEvent17MoveToFailureTypeE", mfunc_ptr_cast(&HostageEscapeToCoverState::OnMoveToFailure) }, { 0x01D4A5A0, "_ZN25HostageEscapeToCoverState15OnMoveToFailureERK6VectorN12IImprovEvent17MoveToFailureTypeE", mfunc_ptr_cast(&HostageEscapeToCoverState::OnMoveToFailure_) },
//non-virtual func //non-virtual func
//{ 0x0, "_ZN25HostageEscapeToCoverState13SetRescueGoalERK6Vector", mfunc_ptr_cast(&HostageEscapeToCoverState::SetRescueGoal) }, //{ 0x0, "_ZN25HostageEscapeToCoverState13SetRescueGoalERK6Vector", mfunc_ptr_cast(&HostageEscapeToCoverState::SetRescueGoal) },
//HostageEscapeLookAroundState //HostageEscapeLookAroundState
//virtual func //virtual func
//{ 0x0, "_ZN28HostageEscapeLookAroundState7OnEnterEP14CHostageImprov", mfunc_ptr_cast(&HostageEscapeLookAroundState::OnEnter) }, { 0x01D4A5E0, "_ZN28HostageEscapeLookAroundState7OnEnterEP14CHostageImprov", mfunc_ptr_cast(&HostageEscapeLookAroundState::OnEnter_) },
//{ 0x0, "_ZN28HostageEscapeLookAroundState8OnUpdateEP14CHostageImprov", mfunc_ptr_cast(&HostageEscapeLookAroundState::OnUpdate) }, { 0x01D4A620, "_ZN28HostageEscapeLookAroundState8OnUpdateEP14CHostageImprov", mfunc_ptr_cast(&HostageEscapeLookAroundState::OnUpdate_) },
//{ 0x0, "_ZN28HostageEscapeLookAroundState6OnExitEP14CHostageImprov", mfunc_ptr_cast(&HostageEscapeLookAroundState::OnExit) }, { 0x01D4A680, "_ZN28HostageEscapeLookAroundState6OnExitEP14CHostageImprov", mfunc_ptr_cast(&HostageEscapeLookAroundState::OnExit_) },
//{ 0x0, "_ZNK28HostageEscapeLookAroundState7GetNameEv", mfunc_ptr_cast(&HostageEscapeLookAroundState::GetName) }, //{ 0x0, "_ZNK28HostageEscapeLookAroundState7GetNameEv", mfunc_ptr_cast(&HostageEscapeLookAroundState::GetName_) },
//HostageEscapeState //HostageEscapeState
//virtual func //virtual func
//{ 0x0, "_ZN18HostageEscapeState7OnEnterEP14CHostageImprov", mfunc_ptr_cast(&HostageEscapeState::OnEnter) }, { 0x01D4A690, "_ZN18HostageEscapeState7OnEnterEP14CHostageImprov", mfunc_ptr_cast(&HostageEscapeState::OnEnter_) },
//{ 0x0, "_ZN18HostageEscapeState8OnUpdateEP14CHostageImprov", mfunc_ptr_cast(&HostageEscapeState::OnUpdate) }, { 0x01D4A720, "_ZN18HostageEscapeState8OnUpdateEP14CHostageImprov", mfunc_ptr_cast(&HostageEscapeState::OnUpdate_) },
//{ 0x0, "_ZN18HostageEscapeState6OnExitEP14CHostageImprov", mfunc_ptr_cast(&HostageEscapeState::OnExit) }, { 0x01D4A880, "_ZN18HostageEscapeState6OnExitEP14CHostageImprov", mfunc_ptr_cast(&HostageEscapeState::OnExit_) },
//{ 0x0, "_ZNK18HostageEscapeState7GetNameEv", mfunc_ptr_cast(&HostageEscapeState::GetName) }, //{ 0x01D56A80, "_ZNK18HostageEscapeState7GetNameEv", mfunc_ptr_cast(&HostageEscapeState::GetName_) },
//{ 0x0, "_ZN18HostageEscapeState15OnMoveToFailureERK6VectorN12IImprovEvent17MoveToFailureTypeE", mfunc_ptr_cast(&HostageEscapeState::OnMoveToFailure) }, //{ 0x0, "_ZN18HostageEscapeState15OnMoveToFailureERK6VectorN12IImprovEvent17MoveToFailureTypeE", mfunc_ptr_cast(&HostageEscapeState::OnMoveToFailure_) }, // NOXREF
//non-virtual func //non-virtual func
//{ 0x0, "_ZN18HostageEscapeState7ToCoverEv", mfunc_ptr_cast(&HostageEscapeState::ToCover) }, //{ 0x0, "_ZN18HostageEscapeState7ToCoverEv", mfunc_ptr_cast(&HostageEscapeState::ToCover) },
//{ 0x0, "_ZN18HostageEscapeState10LookAroundEv", mfunc_ptr_cast(&HostageEscapeState::LookAround) }, //{ 0x0, "_ZN18HostageEscapeState10LookAroundEv", mfunc_ptr_cast(&HostageEscapeState::LookAround) },
//HostageRetreatState //HostageRetreatState
//virtual func //virtual func
//{ 0x01D4BC30, "_ZN19HostageRetreatState7OnEnterEP14CHostageImprov", mfunc_ptr_cast(&HostageRetreatState::OnEnter_) }, { 0x01D4BC30, "_ZN19HostageRetreatState7OnEnterEP14CHostageImprov", mfunc_ptr_cast(&HostageRetreatState::OnEnter_) },
{ 0x01D4BC50, "_ZN19HostageRetreatState8OnUpdateEP14CHostageImprov", mfunc_ptr_cast(&HostageRetreatState::OnUpdate_) }, { 0x01D4BC50, "_ZN19HostageRetreatState8OnUpdateEP14CHostageImprov", mfunc_ptr_cast(&HostageRetreatState::OnUpdate_) },
//{ 0x01D4BDB0, "_ZN19HostageRetreatState6OnExitEP14CHostageImprov", mfunc_ptr_cast(&HostageRetreatState::OnExit_) }, //{ 0x01D4BDB0, "_ZN19HostageRetreatState6OnExitEP14CHostageImprov", mfunc_ptr_cast(&HostageRetreatState::OnExit_) }, // PURE
//{ 0x01D56BD0, "_ZNK19HostageRetreatState7GetNameEv", mfunc_ptr_cast(&HostageRetreatState::GetName_) }, //{ 0x01D56BD0, "_ZNK19HostageRetreatState7GetNameEv", mfunc_ptr_cast(&HostageRetreatState::GetName_) },
//HostageFollowState //HostageFollowState
//virtual func //virtual func
//{ 0x0, "_ZN18HostageFollowState7OnEnterEP14CHostageImprov", mfunc_ptr_cast(&HostageFollowState::OnEnter) }, { 0x01D4AC70, "_ZN18HostageFollowState7OnEnterEP14CHostageImprov", mfunc_ptr_cast(&HostageFollowState::OnEnter_) },
//{ 0x0, "_ZN18HostageFollowState8OnUpdateEP14CHostageImprov", mfunc_ptr_cast(&HostageFollowState::OnUpdate) }, { 0x01D4ACF0, "_ZN18HostageFollowState8OnUpdateEP14CHostageImprov", mfunc_ptr_cast(&HostageFollowState::OnUpdate_) },
//{ 0x0, "_ZN18HostageFollowState6OnExitEP14CHostageImprov", mfunc_ptr_cast(&HostageFollowState::OnExit) }, { 0x01D4B320, "_ZN18HostageFollowState6OnExitEP14CHostageImprov", mfunc_ptr_cast(&HostageFollowState::OnExit_) },
//{ 0x0, "_ZNK18HostageFollowState7GetNameEv", mfunc_ptr_cast(&HostageFollowState::GetName) }, //{ 0x0, "_ZNK18HostageFollowState7GetNameEv", mfunc_ptr_cast(&HostageFollowState::GetName_) },
//{ 0x0, "_ZN18HostageFollowState25UpdateStationaryAnimationEP14CHostageImprov", mfunc_ptr_cast(&HostageFollowState::UpdateStationaryAnimation) }, { 0x01D4B330, "_ZN18HostageFollowState25UpdateStationaryAnimationEP14CHostageImprov", mfunc_ptr_cast(&HostageFollowState::UpdateStationaryAnimation_) },
//non-virtual func //non-virtual func
//{ 0x0, "_ZN18HostageFollowState9SetLeaderEP11CBaseEntity", mfunc_ptr_cast(&HostageFollowState::SetLeader) }, //{ 0x0, "_ZN18HostageFollowState9SetLeaderEP11CBaseEntity", mfunc_ptr_cast(&HostageFollowState::SetLeader) },
//{ 0x0, "_ZNK18HostageFollowState9GetLeaderEv", mfunc_ptr_cast(&HostageFollowState::GetLeader) }, //{ 0x0, "_ZNK18HostageFollowState9GetLeaderEv", mfunc_ptr_cast(&HostageFollowState::GetLeader) },
@ -5231,7 +5248,7 @@ FunctionHook g_FunctionHooks[] =
{ 0x01D49E10, "_ZN19HostageAnimateState11AddSequenceEP14CHostageImprovPKcff", mfunc_ptr_cast<ADD_SEQUENCE_NAME>(&HostageAnimateState::AddSequence) }, { 0x01D49E10, "_ZN19HostageAnimateState11AddSequenceEP14CHostageImprovPKcff", mfunc_ptr_cast<ADD_SEQUENCE_NAME>(&HostageAnimateState::AddSequence) },
{ 0x01D49F00, "_ZN19HostageAnimateState11AddSequenceEP14CHostageImproviff", mfunc_ptr_cast<ADD_SEQUENCE_NUMBER>(&HostageAnimateState::AddSequence) }, { 0x01D49F00, "_ZN19HostageAnimateState11AddSequenceEP14CHostageImproviff", mfunc_ptr_cast<ADD_SEQUENCE_NUMBER>(&HostageAnimateState::AddSequence) },
//{ 0x0, "_ZNK19HostageAnimateState6IsBusyEv", mfunc_ptr_cast(&HostageAnimateState::IsBusy) }, //{ 0x0, "_ZNK19HostageAnimateState6IsBusyEv", mfunc_ptr_cast(&HostageAnimateState::IsBusy) },
//{ 0x0, "_ZNK19HostageAnimateState9IsPlayingEP14CHostageImprovPKc", mfunc_ptr_cast(&HostageAnimateState::IsPlaying) }, //{ 0x01D4A1C0, "_ZNK19HostageAnimateState9IsPlayingEP14CHostageImprovPKc", mfunc_ptr_cast(&HostageAnimateState::IsPlaying) }, // NOXREF
//{ 0x0, "_ZN19HostageAnimateState20GetCurrentSequenceIDEv", mfunc_ptr_cast(&HostageAnimateState::GetCurrentSequenceID) }, // NOXREF //{ 0x0, "_ZN19HostageAnimateState20GetCurrentSequenceIDEv", mfunc_ptr_cast(&HostageAnimateState::GetCurrentSequenceID) }, // NOXREF
//{ 0x0, "_ZNK19HostageAnimateState14GetPerformanceEv", mfunc_ptr_cast(&HostageAnimateState::GetPerformance) }, //{ 0x0, "_ZNK19HostageAnimateState14GetPerformanceEv", mfunc_ptr_cast(&HostageAnimateState::GetPerformance) },
//{ 0x0, "_ZN19HostageAnimateState14SetPerformanceENS_15PerformanceTypeE", mfunc_ptr_cast(&HostageAnimateState::SetPerformance) }, //{ 0x0, "_ZN19HostageAnimateState14SetPerformanceENS_15PerformanceTypeE", mfunc_ptr_cast(&HostageAnimateState::SetPerformance) },
@ -5248,7 +5265,6 @@ FunctionHook g_FunctionHooks[] =
//{ 0x01D50D90, "_ZN8CHostage10BloodColorEv", mfunc_ptr_cast(&CHostage::BloodColor_) }, //{ 0x01D50D90, "_ZN8CHostage10BloodColorEv", mfunc_ptr_cast(&CHostage::BloodColor_) },
{ 0x01D4DB10, "_ZN8CHostage5TouchEP11CBaseEntity", mfunc_ptr_cast(&CHostage::Touch_) }, { 0x01D4DB10, "_ZN8CHostage5TouchEP11CBaseEntity", mfunc_ptr_cast(&CHostage::Touch_) },
{ 0x01D4D710, "_ZN8CHostage3UseEP11CBaseEntityS1_8USE_TYPEf", mfunc_ptr_cast(&CHostage::Use_) }, { 0x01D4D710, "_ZN8CHostage3UseEP11CBaseEntityS1_8USE_TYPEf", mfunc_ptr_cast(&CHostage::Use_) },
//non-virtual func //non-virtual func
//!!{ 0x01D4C450, "_ZN8CHostage9IdleThinkEv", mfunc_ptr_cast(&CHostage::IdleThink) }, // export func //!!{ 0x01D4C450, "_ZN8CHostage9IdleThinkEv", mfunc_ptr_cast(&CHostage::IdleThink) }, // export func
{ 0x01D4CBB0, "_ZN8CHostage6RemoveEv", mfunc_ptr_cast(&CHostage::Remove) }, { 0x01D4CBB0, "_ZN8CHostage6RemoveEv", mfunc_ptr_cast(&CHostage::Remove) },
@ -5279,7 +5295,6 @@ FunctionHook g_FunctionHooks[] =
//{ 0x0, "_ZN8CHostage6IsDeadEv", mfunc_ptr_cast(&CHostage::IsDead) }, // NOXREF //{ 0x0, "_ZN8CHostage6IsDeadEv", mfunc_ptr_cast(&CHostage::IsDead) }, // NOXREF
//{ 0x0, "_ZNK8CHostage8IsAtHomeEv", mfunc_ptr_cast(&CHostage::IsAtHome) }, // NOXREF //{ 0x0, "_ZNK8CHostage8IsAtHomeEv", mfunc_ptr_cast(&CHostage::IsAtHome) }, // NOXREF
//{ 0x0, "_ZNK8CHostage15GetHomePositionEv", mfunc_ptr_cast(&CHostage::GetHomePosition) }, // NOXREF //{ 0x0, "_ZNK8CHostage15GetHomePositionEv", mfunc_ptr_cast(&CHostage::GetHomePosition) }, // NOXREF
{ 0x01D4BDC0, "hostage_entity", (size_t)&hostage_entity }, { 0x01D4BDC0, "hostage_entity", (size_t)&hostage_entity },
{ 0x01D4BE10, "monster_scientist", (size_t)&monster_scientist }, { 0x01D4BE10, "monster_scientist", (size_t)&monster_scientist },
//CHostageManager //CHostageManager
@ -5394,6 +5409,7 @@ VirtualTableRef g_TableRefs[] =
{ 0x01DF6FE4, "HostageStateMachine", 4 }, { 0x01DF6FE4, "HostageStateMachine", 4 },
{ 0x01DF7180, "HostageEscapeToCoverState", 4 }, { 0x01DF7180, "HostageEscapeToCoverState", 4 },
{ 0x01DF6F18, "HostageAnimateState", 4 }, { 0x01DF6F18, "HostageAnimateState", 4 },
{ 0x01DF6F9C, "HostageEscapeState", 6 },
{ 0x01E00BBC, "CArmoury", CBASE_VIRTUAL_COUNT }, { 0x01E00BBC, "CArmoury", CBASE_VIRTUAL_COUNT },
{ 0x01DFE4E4, "CSoundEnt", CBASE_VIRTUAL_COUNT }, { 0x01DFE4E4, "CSoundEnt", CBASE_VIRTUAL_COUNT },
@ -5569,20 +5585,16 @@ AddressRef g_FunctionRefs[] =
{ {
#ifndef Function_References_Region #ifndef Function_References_Region
{ 0x01D3CA60, "_ZNK8CNavArea4GetZEPK6Vector", (size_t)&pGetZ__Vector }, //{ 0x01D3CA60, "_ZNK8CNavArea4GetZEPK6Vector", (size_t)&pGetZ__Vector },
{ 0x01D43860, "_ZNK12CNavAreaGrid17GetNearestNavAreaEPK6Vectorb", (size_t)&pGetNearestNavArea }, //{ 0x01D43860, "_ZNK12CNavAreaGrid17GetNearestNavAreaEPK6Vectorb", (size_t)&pGetNearestNavArea },
{ 0x01D43710, "_ZNK12CNavAreaGrid10GetNavAreaEPK6Vectorf", (size_t)&pGetNavArea }, //{ 0x01D43710, "_ZNK12CNavAreaGrid10GetNavAreaEPK6Vectorf", (size_t)&pGetNavArea },
{ 0x01D2EDD0, "_ZN6CCSBot16UpdateLookAnglesEv", (size_t)&pCCSBot__UpdateLookAngles }, { 0x01D2EDD0, "_ZN6CCSBot16UpdateLookAnglesEv", (size_t)&pCCSBot__UpdateLookAngles },
{ 0x01D2D9B0, "_ZN6CCSBot6UpdateEv", (size_t)&pCCSBot__Update }, { 0x01D2D9B0, "_ZN6CCSBot6UpdateEv", (size_t)&pCCSBot__Update },
{ 0x01D20AE0, "_ZN6CCSBot11ResetValuesEv", (size_t)&pCCSBot__ResetValues }, { 0x01D20AE0, "_ZN6CCSBot11ResetValuesEv", (size_t)&pCCSBot__ResetValues },
{ 0x01D46310, "_Z17LoadNavigationMapv", (size_t)&pLoadNavigationMap },
{ 0x01D19C70, "_ZN9BotPhrase9RandomizeEv", (size_t)&pBotPhrase__Randomize }, { 0x01D19C70, "_ZN9BotPhrase9RandomizeEv", (size_t)&pBotPhrase__Randomize },
{ 0x01D25270, "_ZN13CCSBotManager6AddBotEPK10BotProfile18BotProfileTeamType", (size_t)&pCCSBotManager__AddBot }, { 0x01D25270, "_ZN13CCSBotManager6AddBotEPK10BotProfile18BotProfileTeamType", (size_t)&pCCSBotManager__AddBot },
{ 0x01D80C90, "_Z16InstallGameRulesv", (size_t)&pInstallGameRules }, { 0x01D80C90, "_Z16InstallGameRulesv", (size_t)&pInstallGameRules },
{ 0x01D4C450, "_ZN8CHostage9IdleThinkEv", (size_t)&pCHostage__IdleThink }, { 0x01D4C450, "_ZN8CHostage9IdleThinkEv", (size_t)&pCHostage__IdleThink },
{ 0x01D517A0, "_ZN14CHostageImprov11FaceTowardsERK6Vectorf", (size_t)&pCHostageImprov__FaceTowards },
#endif // Function_References_Region #endif // Function_References_Region
@ -5595,7 +5607,8 @@ AddressRef g_DataRefs[] =
{ 0x01E61BD0, "g_engfuncs", (size_t)&pg_engfuncs }, { 0x01E61BD0, "g_engfuncs", (size_t)&pg_engfuncs },
{ 0x01E61E48, "gpGlobals", (size_t)&pgpGlobals }, { 0x01E61E48, "gpGlobals", (size_t)&pgpGlobals },
{ 0x01E10768, "GameEventName", (size_t)&pGameEventName },
{ 0x01E2A3F8, "_ZL14s_shared_token", (size_t)&ps_shared_token }, { 0x01E2A3F8, "_ZL14s_shared_token", (size_t)&ps_shared_token },
{ 0x01E13218, "_ZL14s_shared_quote", (size_t)&ps_shared_quote }, { 0x01E13218, "_ZL14s_shared_quote", (size_t)&ps_shared_quote },
@ -6024,7 +6037,7 @@ AddressRef g_DataRefs[] =
{ 0x01E23470, "cv_tutor_hint_interval_time", (size_t)&pcv_tutor_hint_interval_time }, { 0x01E23470, "cv_tutor_hint_interval_time", (size_t)&pcv_tutor_hint_interval_time },
{ 0x01E11EE4, "cv_hostage_debug", (size_t)&pcv_hostage_debug }, { 0x01E11EE4, "cv_hostage_debug", (size_t)&pcv_hostage_debug },
{ 0x01E11EF8, "cv_hostage_stop", (size_t)&pcv_hostage_stop }, { 0x01E11EF8, "cv_hostage_stop", (size_t)&pcv_hostage_stop },
//{ 0x0, "_ZL14placeDirectory", (size_t)&pplaceDirectory }, //{ 0x0, "_ZL14placeDirectory", (size_t)&pplaceDirectory }, // DONT USE - NOXREF
{ 0x01E2A0E4, "TheNavLadderList", (size_t)&pTheNavLadderList }, { 0x01E2A0E4, "TheNavLadderList", (size_t)&pTheNavLadderList },
{ 0x01E2A0F0, "TheHidingSpotList", (size_t)&pTheHidingSpotList }, { 0x01E2A0F0, "TheHidingSpotList", (size_t)&pTheHidingSpotList },
{ 0x01E14C5C, "sPlayerModelFiles", (size_t)&psPlayerModelFiles }, { 0x01E14C5C, "sPlayerModelFiles", (size_t)&psPlayerModelFiles },
@ -6046,6 +6059,8 @@ AddressRef g_DataRefs[] =
{ 0x01E29888, "TheNavAreaGrid", (size_t)&pTheNavAreaGrid }, { 0x01E29888, "TheNavAreaGrid", (size_t)&pTheNavAreaGrid },
{ 0x01E2A250, "_ZN8CNavNode6m_listE", mfunc_ptr_cast(&CNavNode::pm_list) }, { 0x01E2A250, "_ZN8CNavNode6m_listE", mfunc_ptr_cast(&CNavNode::pm_list) },
{ 0x01E2A254, "_ZN8CNavNode12m_listLengthE", mfunc_ptr_cast(&CNavNode::pm_listLength) }, { 0x01E2A254, "_ZN8CNavNode12m_listLengthE", mfunc_ptr_cast(&CNavNode::pm_listLength) },
{ 0x01E11E88, "Opposite", (size_t)&pOpposite },
//{ 0x0, "_ZN8CNavArea8m_nextIDE", mfunc_ptr_cast(&CNavArea::m_nextID) }, //{ 0x0, "_ZN8CNavArea8m_nextIDE", mfunc_ptr_cast(&CNavArea::m_nextID) },
{ 0x01E11584, "_ZN8CNavArea14m_masterMarkerE", mfunc_ptr_cast(&CNavArea::pm_masterMarker) }, { 0x01E11584, "_ZN8CNavArea14m_masterMarkerE", mfunc_ptr_cast(&CNavArea::pm_masterMarker) },
{ 0x01E11588, "_ZN10HidingSpot8m_nextIDE", mfunc_ptr_cast(&HidingSpot::pm_nextID) }, { 0x01E11588, "_ZN10HidingSpot8m_nextIDE", mfunc_ptr_cast(&HidingSpot::pm_nextID) },

View File

@ -740,7 +740,7 @@ bool HIDDEN HookFunction(Module *module, FunctionHook *hook)
//int seedad = pUTIL_SharedRandomLong(seed,low,high); //int seedad = pUTIL_SharedRandomLong(seed,low,high);
//memcpy(addr_orig,patchByte,5); //memcpy(addr_orig,patchByte,5);
if (strcmp(hook->symbolName,"_ZNK14CHostageImprov16IsFriendInTheWayEv")==0) if (strcmp(hook->symbolName,"_ZN25HostageEscapeToCoverState15OnMoveToFailureERK6VectorN12IImprovEvent17MoveToFailureTypeE")==0)
{ {
addr_orig = (void *)hook->originalAddress; addr_orig = (void *)hook->originalAddress;

View File

@ -236,7 +236,7 @@
static const bool __isLinux = true; static const bool __isLinux = true;
#endif #endif
#define EXT_FUNC FORCE_STACK_ALIGN #define EXT_FUNC /*FORCE_STACK_ALIGN*/
extern void regamedll_log(const char *fmt, ...); extern void regamedll_log(const char *fmt, ...);
extern void __declspec(noreturn) regamedll_syserror(const char *fmt, ...); extern void __declspec(noreturn) regamedll_syserror(const char *fmt, ...);

View File

@ -1132,7 +1132,7 @@
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>HOOK_GAMEDLL;REGAMEDLL_SELF;REGAMEDLL_CHECKS;CLIENT_WEAPONS;USE_BREAKPAD_HANDLER;DEDICATED;_CRT_SECURE_NO_WARNINGS;_DEBUG;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>PLAY_GAMEDLL;HOOK_GAMEDLL;REGAMEDLL_SELF;REGAMEDLL_CHECKS;CLIENT_WEAPONS;USE_BREAKPAD_HANDLER;DEDICATED;_CRT_SECURE_NO_WARNINGS;_DEBUG;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FloatingPointModel>Precise</FloatingPointModel> <FloatingPointModel>Precise</FloatingPointModel>
<AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
@ -1204,7 +1204,7 @@
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>REGAMEDLL_SELF;REGAMEDLL_CHECKS;CLIENT_WEAPONS;USE_BREAKPAD_HANDLER;DEDICATED;_CRT_SECURE_NO_WARNINGS;_DEBUG;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>REGAMEDLL_SELF;PLAY_GAMEDLL;REGAMEDLL_CHECKS;CLIENT_WEAPONS;USE_BREAKPAD_HANDLER;DEDICATED;_CRT_SECURE_NO_WARNINGS;_DEBUG;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FloatingPointModel>Precise</FloatingPointModel> <FloatingPointModel>Precise</FloatingPointModel>
<AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
@ -1317,7 +1317,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions> <IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>REGAMEDLL_SELF;HOOK_GAMEDLL;REGAMEDLL_CHECKS;CLIENT_WEAPONS;USE_BREAKPAD_HANDLER;DEDICATED;_CRT_SECURE_NO_WARNINGS;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>REGAMEDLL_SELF;PLAY_GAMEDLL;HOOK_GAMEDLL;REGAMEDLL_CHECKS;CLIENT_WEAPONS;USE_BREAKPAD_HANDLER;DEDICATED;_CRT_SECURE_NO_WARNINGS;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>
<PrecompiledHeader>Use</PrecompiledHeader> <PrecompiledHeader>Use</PrecompiledHeader>

View File

@ -32,8 +32,8 @@
#pragma once #pragma once
#endif #endif
#define PITCH 0 // up/down #define PITCH 0 // up/down
#define YAW 1 // left/right #define YAW 1 // left/right
#define ROLL 2 // fall over #define ROLL 2 // fall over
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -48,32 +48,32 @@ extern int nanmask;
#define IS_NAN(x) ((*reinterpret_cast<int *>(&(x)) & nanmask) == nanmask) #define IS_NAN(x) ((*reinterpret_cast<int *>(&(x)) & nanmask) == nanmask)
NOBODY float anglemod(float a); NOBODY float anglemod(float a);
void AngleVectors(const vec_t *angles, vec_t *forward, vec_t *right, vec_t *up); void AngleVectors(const vec_t *angles, vec_t *forward, vec_t *right, vec_t *up);
NOBODY void AngleVectorsTranspose(const vec_t *angles, vec_t *forward, vec_t *right, vec_t *up); NOBODY void AngleVectorsTranspose(const vec_t *angles, vec_t *forward, vec_t *right, vec_t *up);
void AngleMatrix(const vec_t *angles, float (*matrix)[4]); void AngleMatrix(const vec_t *angles, float (*matrix)[4]);
NOBODY void AngleIMatrix(const vec_t *angles, float (*matrix)[4]); NOBODY void AngleIMatrix(const vec_t *angles, float (*matrix)[4]);
NOBODY void NormalizeAngles(float *angles); NOBODY void NormalizeAngles(float *angles);
NOBODY void InterpolateAngles(float *start, float *end, float *output, float frac); NOBODY void InterpolateAngles(float *start, float *end, float *output, float frac);
NOBODY float AngleBetweenVectors(const vec_t *v1, const vec_t *v2); NOBODY float AngleBetweenVectors(const vec_t *v1, const vec_t *v2);
NOBODY void VectorTransform(const vec_t *in1, float *in2, vec_t *out); NOBODY void VectorTransform(const vec_t *in1, float *in2, vec_t *out);
int VectorCompare(const vec_t *v1, const vec_t *v2); int VectorCompare(const vec_t *v1, const vec_t *v2);
void VectorMA(const vec_t *veca, float scale, const vec_t *vecb, vec_t *vecc); void VectorMA(const vec_t *veca, float scale, const vec_t *vecb, vec_t *vecc);
float_precision _DotProduct(vec_t *v1, vec_t *v2); float_precision _DotProduct(vec_t *v1, vec_t *v2);
void _VectorSubtract(vec_t *veca, vec_t *vecb, vec_t *out); void _VectorSubtract(vec_t *veca, vec_t *vecb, vec_t *out);
void _VectorAdd(vec_t *veca, vec_t *vecb, vec_t *out); void _VectorAdd(vec_t *veca, vec_t *vecb, vec_t *out);
void _VectorCopy(vec_t *in, vec_t *out); void _VectorCopy(vec_t *in, vec_t *out);
void _CrossProduct(const vec_t *v1, const vec_t *v2, vec_t *cross); void _CrossProduct(const vec_t *v1, const vec_t *v2, vec_t *cross);
float_precision Length(const vec_t *v); float_precision Length(const vec_t *v);
NOBODY float Distance(const vec_t *v1, const vec_t *v2); NOBODY float Distance(const vec_t *v1, const vec_t *v2);
float_precision VectorNormalize(vec_t *v); float_precision VectorNormalize(vec_t *v);
NOBODY void VectorInverse(vec_t *v); NOBODY void VectorInverse(vec_t *v);
NOBODY void VectorScale(const vec_t *in, vec_t scale, vec_t *out); NOBODY void VectorScale(const vec_t *in, vec_t scale, vec_t *out);
NOBODY int Q_log2(int val); NOBODY int Q_log2(int val);
NOBODY void VectorMatrix(vec_t *forward, vec_t *right, vec_t *up); NOBODY void VectorMatrix(vec_t *forward, vec_t *right, vec_t *up);
NOBODY void VectorAngles(const vec_t *forward, vec_t *angles); NOBODY void VectorAngles(const vec_t *forward, vec_t *angles);
#endif // PM_MATH_H #endif // PM_MATH_H

View File

@ -2644,7 +2644,7 @@ void PM_DropPunchAngle(vec_t *punchangle)
len = VectorNormalize(punchangle); len = VectorNormalize(punchangle);
len -= (10.0 + len * 0.5) * pmove->frametime; len -= (10.0 + len * 0.5) * pmove->frametime;
#ifdef HOOK_GAMEDLL #ifdef PLAY_GAMEDLL
len = Q_max(len, 0.0); len = Q_max(len, 0.0);
#else #else
len = Q_max(len, 0.0f); len = Q_max(len, 0.0f);

View File

@ -99,6 +99,7 @@
#include "buttons.h" #include "buttons.h"
// CSBOT and Nav // CSBOT and Nav
#include "game_shared/GameEvent.h" // Game event enum used by career mode, tutor system, and bots
#include "game_shared/bot/bot_util.h" #include "game_shared/bot/bot_util.h"
#include "game_shared/bot/simple_state_machine.h" #include "game_shared/bot/simple_state_machine.h"