mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-03-03 17:25:24 +03:00
Added a new reverse the functions.
Implemented recovery a virtual table in GetClassPtr<BasClass> after linking of self class.
This commit is contained in:
parent
d1d017e2b5
commit
5bf6b21649
@ -168,11 +168,6 @@ void setupToolchain(NativeBinarySpec b) {
|
||||
cfg.extraLibs 'dl', 'm', 'stdc++', 'steam_api'
|
||||
}
|
||||
|
||||
// TODO: check it
|
||||
//if (!unitTestExecutable && !mpLib) {
|
||||
// cfg.singleDefines 'HOOK_GAMEDLL'
|
||||
//}
|
||||
|
||||
if (unitTestExecutable) {
|
||||
cfg.singleDefines 'REGAMEDLL_UNIT_TESTS'
|
||||
}
|
||||
|
80
regamedll/common/hltv.h
Normal file
80
regamedll/common/hltv.h
Normal file
@ -0,0 +1,80 @@
|
||||
/*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* In addition, as a special exception, the author gives permission to
|
||||
* link the code of this program with the Half-Life Game Engine ("HL
|
||||
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
|
||||
* L.L.C ("Valve"). You must obey the GNU General Public License in all
|
||||
* respects for all of the code used other than the HL Engine and MODs
|
||||
* from Valve. If you modify this file, you may extend this exception
|
||||
* to your version of the file, but you are not obligated to do so. If
|
||||
* you do not wish to do so, delete this exception statement from your
|
||||
* version.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HLTV_H
|
||||
#define HLTV_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#define TYPE_CLIENT 0 // client is a normal HL client (default)
|
||||
#define TYPE_PROXY 1 // client is another proxy
|
||||
#define TYPE_COMMENTATOR 3 // client is a commentator
|
||||
#define TYPE_DEMO 4 // client is a demo file
|
||||
|
||||
// sub commands of svc_hltv:
|
||||
#define HLTV_ACTIVE 0 // tells client that he's an spectator and will get director commands
|
||||
#define HLTV_STATUS 1 // send status infos about proxy
|
||||
#define HLTV_LISTEN 2 // tell client to listen to a multicast stream
|
||||
|
||||
// director command types:
|
||||
#define DRC_CMD_NONE 0 // NULL director command
|
||||
#define DRC_CMD_START 1 // start director mode
|
||||
#define DRC_CMD_EVENT 2 // informs about director command
|
||||
#define DRC_CMD_MODE 3 // switches camera modes
|
||||
#define DRC_CMD_CAMERA 4 // set fixed camera
|
||||
#define DRC_CMD_TIMESCALE 5 // sets time scale
|
||||
#define DRC_CMD_MESSAGE 6 // send HUD centerprint
|
||||
#define DRC_CMD_SOUND 7 // plays a particular sound
|
||||
#define DRC_CMD_STATUS 8 // HLTV broadcast status
|
||||
#define DRC_CMD_BANNER 9 // set GUI banner
|
||||
#define DRC_CMD_STUFFTEXT 10 // like the normal svc_stufftext but as director command
|
||||
#define DRC_CMD_CHASE 11 // chase a certain player
|
||||
#define DRC_CMD_INEYE 12 // view player through own eyes
|
||||
#define DRC_CMD_MAP 13 // show overview map
|
||||
#define DRC_CMD_CAMPATH 14 // define camera waypoint
|
||||
#define DRC_CMD_WAYPOINTS 15 // start moving camera, inetranl message
|
||||
|
||||
#define DRC_CMD_LAST 15
|
||||
|
||||
// DRC_CMD_EVENT event flags
|
||||
#define DRC_FLAG_PRIO_MASK 0x0F // priorities between 0 and 15 (15 most important)
|
||||
#define DRC_FLAG_SIDE (1<<4) //
|
||||
#define DRC_FLAG_DRAMATIC (1<<5) // is a dramatic scene
|
||||
#define DRC_FLAG_SLOWMOTION (1<<6) // would look good in SloMo
|
||||
#define DRC_FLAG_FACEPLAYER (1<<7) // player is doning something (reload/defuse bomb etc)
|
||||
#define DRC_FLAG_INTRO (1<<8) // is a introduction scene
|
||||
#define DRC_FLAG_FINAL (1<<9) // is a final scene
|
||||
#define DRC_FLAG_NO_RANDOM (1<<10) // don't randomize event data
|
||||
|
||||
// DRC_CMD_WAYPOINT flags
|
||||
#define DRC_FLAG_STARTPATH 1 // end with speed 0.0
|
||||
#define DRC_FLAG_SLOWSTART 2 // start with speed 0.0
|
||||
#define DRC_FLAG_SLOWEND 4 // end with speed 0.0
|
||||
|
||||
#endif // HLTV_H
|
@ -22,18 +22,38 @@ TYPEDESCRIPTION (*CBaseAnimating::pm_SaveData)[5];
|
||||
|
||||
/* <10583> ../cstrike/dlls/animating.cpp:38 */
|
||||
IMPLEMENT_SAVERESTORE(CBaseAnimating, CBaseDelay);
|
||||
//NOBODY int CBaseAnimating::Save(CSave &save)
|
||||
//{
|
||||
//}
|
||||
|
||||
/* <10537> ../cstrike/dlls/animating.cpp:38 */
|
||||
//NOBODY int CBaseAnimating::Restore(CRestore &restore)
|
||||
//{
|
||||
//}
|
||||
|
||||
/* <105cf> ../cstrike/dlls/animating.cpp:45 */
|
||||
NOBODY float CBaseAnimating::StudioFrameAdvance(float flInterval)
|
||||
float CBaseAnimating::StudioFrameAdvance(float flInterval)
|
||||
{
|
||||
if (flInterval == 0.0f)
|
||||
{
|
||||
flInterval = gpGlobals->time - pev->animtime;
|
||||
|
||||
if (flInterval <= 0.001)
|
||||
{
|
||||
pev->animtime = gpGlobals->time;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (pev->animtime == 0.0f)
|
||||
flInterval = 0;
|
||||
|
||||
pev->frame += flInterval * m_flFrameRate * pev->framerate;
|
||||
pev->animtime = gpGlobals->time;
|
||||
|
||||
if (pev->frame < 0.0 || pev->frame >= 256.0)
|
||||
{
|
||||
if (m_fSequenceLoops)
|
||||
pev->frame -= (int)(pev->frame / 256.0) * 256.0;
|
||||
else
|
||||
pev->frame = (pev->frame < 0) ? 0 : 255;
|
||||
|
||||
m_fSequenceFinished = TRUE;
|
||||
}
|
||||
|
||||
return flInterval;
|
||||
}
|
||||
|
||||
/* <10605> ../cstrike/dlls/animating.cpp:77 */
|
||||
@ -119,12 +139,12 @@ NOBODY float CBaseAnimating::SetBlending(int iBlender, float flValue)
|
||||
}
|
||||
|
||||
/* <1092f> ../cstrike/dlls/animating.cpp:201 */
|
||||
NOBODY void CBaseAnimating::GetBonePosition(int iBone, class Vector &origin, class Vector &angles)
|
||||
NOBODY void CBaseAnimating::GetBonePosition(int iBone, Vector &origin, Vector &angles)
|
||||
{
|
||||
}
|
||||
|
||||
/* <10984> ../cstrike/dlls/animating.cpp:208 */
|
||||
NOBODY void CBaseAnimating::GetAttachment(int iAttachment, class Vector &origin, class Vector &angles)
|
||||
NOBODY void CBaseAnimating::GetAttachment(int iAttachment, Vector &origin, Vector &angles)
|
||||
{
|
||||
}
|
||||
|
||||
@ -141,7 +161,7 @@ NOBODY int CBaseAnimating::FindTransition(int iEndingSequence, int iGoalSequence
|
||||
}
|
||||
|
||||
/* <10a5d> ../cstrike/dlls/animating.cpp:234 */
|
||||
NOXREF void CBaseAnimating::GetAutomovement(Vector &origin, class Vector &angles, float flInterval)
|
||||
NOXREF void CBaseAnimating::GetAutomovement(Vector &origin, Vector &angles, float flInterval)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -364,34 +364,32 @@ void AngleQuaternion(vec_t *angles, vec_t *quaternion)
|
||||
#else // REGAMEDLL_FIXES
|
||||
void AngleQuaternion(vec_t *angles, vec_t *quaternion)
|
||||
{
|
||||
long double sy; // st7@1
|
||||
long double cy; // st6@1
|
||||
double sp_; // qt1@1
|
||||
long double cp; // st4@1
|
||||
float sr; // ST08_4@1
|
||||
float cr; // ST04_4@1
|
||||
float ftmp0; // ST00_4@1
|
||||
float ftmp1; // [sp+10h] [bp+4h]@1
|
||||
float ftmp2; // [sp+10h] [bp+4h]@1
|
||||
float_precision sy, cy, sp_, cp;
|
||||
float_precision angle;
|
||||
float sr, cr;
|
||||
|
||||
long double angle;
|
||||
float ftmp0;
|
||||
float ftmp1;
|
||||
float ftmp2;
|
||||
|
||||
angle = angles[2] * 0.5;
|
||||
angle = angles[ROLL] * 0.5;
|
||||
sy = sin(angle);
|
||||
cy = cos(angle);
|
||||
|
||||
angle = angles[1] * 0.5;
|
||||
angle = angles[YAW] * 0.5;
|
||||
sp_ = sin(angle);
|
||||
cp = cos(angle);
|
||||
|
||||
angle = angles[0] * 0.5;
|
||||
angle = angles[PITCH] * 0.5;
|
||||
sr = sin(angle);
|
||||
cr = cos(angle);
|
||||
|
||||
ftmp0 = sr * cp;
|
||||
ftmp1 = cr * sp_;
|
||||
|
||||
*quaternion = ftmp0 * cy - ftmp1 * sy;
|
||||
quaternion[1] = ftmp1 * cy + ftmp0 * sy;
|
||||
|
||||
ftmp2 = cr * cp;
|
||||
quaternion[2] = ftmp2 * sy - sp_ * sr * cy;
|
||||
quaternion[3] = sp_ * sr * sy + ftmp2 * cy;
|
||||
@ -429,7 +427,7 @@ void QuaternionSlerp(vec_t *p, vec_t *q, float t, vec_t *qt)
|
||||
sinom = sin(cosomega);
|
||||
|
||||
sclp = sin((1.0 - t) * omega) / sinom;
|
||||
sclq = sin(omega * t) / sinom;
|
||||
sclq = sin((float_precision)(omega * t)) / sinom;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -32,40 +32,52 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
void RadiusFlash(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int iClassIgnore = 0, int bitsDamageType = 0);
|
||||
float GetAmountOfPlayerVisible(Vector vecSrc, CBaseEntity *entity);
|
||||
void RadiusDamage(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, float flRadius, int iClassIgnore, int bitsDamageType);
|
||||
void RadiusDamage2(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, float flRadius, int iClassIgnore, int bitsDamageType);
|
||||
NOXREF char *vstr(float *v);
|
||||
|
||||
/* <48ecff> ../cstrike/dlls/basemonster.h:18 */
|
||||
class CBaseMonster: public CBaseToggle
|
||||
{
|
||||
public:
|
||||
NOBODY virtual void KeyValue(KeyValueData *pkvd);
|
||||
NOBODY virtual void TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType);
|
||||
virtual void TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType);
|
||||
NOBODY virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
|
||||
NOBODY virtual int TakeHealth(float flHealth, int bitsDamageType);
|
||||
NOBODY virtual void Killed(entvars_t *pevAttacker, int iGib);
|
||||
virtual void Killed(entvars_t *pevAttacker, int iGib);
|
||||
virtual int BloodColor(void)
|
||||
{
|
||||
return m_bloodColor;
|
||||
return BloodColor_();
|
||||
}
|
||||
virtual BOOL IsAlive(void)
|
||||
{
|
||||
return (pev->deadflag != DEAD_DEAD);
|
||||
return IsAlive_();
|
||||
}
|
||||
NOBODY virtual float ChangeYaw(int speed);
|
||||
NOBODY virtual BOOL HasHumanGibs(void);
|
||||
NOBODY virtual BOOL HasAlienGibs(void);
|
||||
virtual float ChangeYaw(int speed);
|
||||
virtual BOOL HasHumanGibs(void);
|
||||
virtual BOOL HasAlienGibs(void);
|
||||
NOBODY virtual void FadeMonster(void);
|
||||
NOBODY virtual void GibMonster(void);
|
||||
virtual void GibMonster(void);
|
||||
NOBODY virtual Activity GetDeathActivity(void);
|
||||
virtual void BecomeDead(void);
|
||||
NOBODY virtual BOOL ShouldFadeOnDeath(void);
|
||||
virtual BOOL ShouldFadeOnDeath(void);
|
||||
NOBODY virtual int IRelationship(CBaseEntity *pTarget);
|
||||
NOBODY virtual void PainSound(void) {};
|
||||
NOBODY virtual void ResetMaxSpeed(void) {};
|
||||
NOBODY virtual void ReportAIState(void) {};
|
||||
virtual void PainSound(void) {}
|
||||
NOBODY virtual void ResetMaxSpeed(void) {}
|
||||
NOBODY virtual void ReportAIState(void) {}
|
||||
virtual void MonsterInitDead(void);
|
||||
NOBODY virtual void Look(int iDistance);
|
||||
NOBODY virtual CBaseEntity *BestVisibleEnemy(void);
|
||||
|
||||
#ifdef _WIN32
|
||||
NOBODY virtual BOOL FInViewCone(Vector *pOrigin);
|
||||
NOBODY virtual BOOL FInViewCone(CBaseEntity *pEntity);
|
||||
#else
|
||||
NOBODY virtual BOOL FInViewCone(CBaseEntity *pEntity);
|
||||
NOBODY virtual BOOL FInViewCone(Vector *pOrigin);
|
||||
#endif // _WIN32
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
||||
@ -74,6 +86,14 @@ public:
|
||||
int TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
|
||||
int TakeHealth_(float flHealth, int bitsDamageType);
|
||||
void Killed_(entvars_t *pevAttacker, int iGib);
|
||||
int BloodColor_(void)
|
||||
{
|
||||
return m_bloodColor;
|
||||
}
|
||||
BOOL IsAlive_(void)
|
||||
{
|
||||
return (pev->deadflag != DEAD_DEAD);
|
||||
}
|
||||
float ChangeYaw_(int speed);
|
||||
BOOL HasHumanGibs_(void);
|
||||
BOOL HasAlienGibs_(void);
|
||||
@ -92,14 +112,14 @@ public:
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
public:
|
||||
NOBODY void MakeIdealYaw(Vector vecTarget);
|
||||
void MakeIdealYaw(Vector vecTarget);
|
||||
NOBODY Activity GetSmallFlinchActivity(void);
|
||||
NOBODY BOOL ShouldGibMonster(int iGib);
|
||||
NOBODY void CallGibMonster(void);
|
||||
NOBODY BOOL FCheckAITrigger(void);
|
||||
NOBODY int DeadTakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
|
||||
NOBODY float DamageForce(float damage);
|
||||
NOBODY void RadiusDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int iClassIgnore, int bitsDamageType);
|
||||
BOOL ShouldGibMonster(int iGib);
|
||||
void CallGibMonster(void);
|
||||
BOOL FCheckAITrigger(void);
|
||||
int DeadTakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
|
||||
float DamageForce(float damage);
|
||||
void RadiusDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int iClassIgnore, int bitsDamageType);
|
||||
NOXREF void RadiusDamage(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int iClassIgnore, int bitsDamageType);
|
||||
void RadiusDamage2(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int iClassIgnore, int bitsDamageType)
|
||||
{
|
||||
|
@ -335,8 +335,12 @@ NOBODY void CCSBot::IncreaseMorale(void)
|
||||
}
|
||||
|
||||
/* <2e9824> ../cstrike/dlls/bot/cs_bot.cpp:845 */
|
||||
NOBODY void CCSBot::DecreaseMorale(void)
|
||||
void CCSBot::DecreaseMorale(void)
|
||||
{
|
||||
if (m_morale > TERRIBLE)
|
||||
{
|
||||
m_morale = static_cast<MoraleType>(m_morale - 1);
|
||||
}
|
||||
}
|
||||
|
||||
/* <2e984c> ../cstrike/dlls/bot/cs_bot.cpp:857 */
|
||||
|
@ -36,6 +36,9 @@
|
||||
#include "bot/cs_bot_manager.h"
|
||||
#include "bot/cs_bot_chatter.h"
|
||||
|
||||
#define CSBOT_VERSION_MAJOR 1
|
||||
#define CSBOT_VERSION_MINOR 50
|
||||
|
||||
#define FLAG_PROGRESS_DRAW 0x0 // draw status bar progress
|
||||
#define FLAG_PROGRESS_START 0x1 // init status bar progress
|
||||
#define FLAG_PROGRESS_HIDE 0x2 // hide status bar progress
|
||||
@ -121,6 +124,7 @@ protected:
|
||||
JUMP,
|
||||
NUM_ATTACK_STATES
|
||||
} m_dodgeState;
|
||||
|
||||
float m_nextDodgeStateTimestamp;
|
||||
CountdownTimer m_repathTimer;
|
||||
float m_scopeTimestamp;
|
||||
@ -402,7 +406,7 @@ public:
|
||||
NOBODY virtual bool Initialize(const BotProfile *profile);
|
||||
|
||||
NOBODY virtual void SpawnBot(void);
|
||||
NOBODY virtual void Upkeep(void);
|
||||
virtual void Upkeep(void);
|
||||
|
||||
NOBODY virtual void Update(void);
|
||||
NOBODY virtual void Walk(void);
|
||||
@ -415,6 +419,7 @@ public:
|
||||
NOBODY virtual bool IsVisible(CBasePlayer *player, bool testFOV = false, unsigned char *visParts = NULL) const;
|
||||
|
||||
virtual bool IsEnemyPartVisible(VisiblePartType part) const;
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
||||
bool Initialize_(const BotProfile *profile);
|
||||
@ -436,7 +441,7 @@ public:
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
public:
|
||||
NOBODY void Disconnect(void);
|
||||
void Disconnect(void);
|
||||
float GetCombatRange(void) const
|
||||
{
|
||||
return m_combatRange;
|
||||
@ -630,7 +635,7 @@ public:
|
||||
return m_morale;
|
||||
}
|
||||
NOBODY void IncreaseMorale(void);
|
||||
NOBODY void DecreaseMorale(void);
|
||||
void DecreaseMorale(void);
|
||||
bool IsNoiseHeard(void) const
|
||||
{
|
||||
if (m_noiseTimestamp <= 0.0f)
|
||||
@ -950,7 +955,7 @@ public:
|
||||
NOBODY CBasePlayer *FindMostDangerousThreat(void);
|
||||
NOBODY void RespondToRadioCommands(void);
|
||||
NOBODY bool IsRadioCommand(GameEventType event);
|
||||
NOBODY void EndVoiceFeedback(bool force);
|
||||
void EndVoiceFeedback(bool force = true);
|
||||
NOBODY CNavNode *AddNode(const Vector *destPos, const Vector *normal, NavDirType dir, CNavNode *source);
|
||||
NOBODY void StartLearnProcess(void);
|
||||
NOBODY void UpdateLearnProcess(void);
|
||||
@ -963,7 +968,7 @@ public:
|
||||
NOBODY bool AnalyzeBetaStep(void);
|
||||
NOBODY void StartSaveProcess(void);
|
||||
NOBODY void UpdateSaveProcess(void);
|
||||
NOBODY void StartNormalProcess(void);
|
||||
void StartNormalProcess(void);
|
||||
NOBODY void BotTouch(CBaseEntity *other);
|
||||
private:
|
||||
friend class CCSBotManager;
|
||||
@ -1488,7 +1493,7 @@ typedef CSGameState *(CCSBot::*GETGAMESTATE_NOTCONST)(void);
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
NOBODY void InstallBotControl(void);
|
||||
NOBODY void Bot_ServerCommand(void);
|
||||
void Bot_ServerCommand(void);
|
||||
void Bot_RegisterCvars(void);
|
||||
NOBODY int GetBotFollowCount(CBasePlayer *leader);
|
||||
NOBODY const Vector *FindNearbyRetreatSpot(CCSBot *me, float maxRange);
|
||||
|
@ -188,18 +188,99 @@ NOBODY void BotPhrase::InitVoiceBank(int bankIndex)
|
||||
}
|
||||
|
||||
/* <303917> ../cstrike/dlls/bot/cs_bot_chatter.cpp:340 */
|
||||
NOBODY char *BotPhrase::GetSpeakable(int bankIndex, float *duration) const
|
||||
char *BotPhrase::GetSpeakable(int bankIndex, float *duration) const
|
||||
{
|
||||
// {
|
||||
// int start; // 351
|
||||
// }
|
||||
if (bankIndex < 0 || bankIndex >= m_numVoiceBanks || m_count[bankIndex] == 0)
|
||||
{
|
||||
if (duration)
|
||||
*duration = 0.0f;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* <30395a> ../cstrike/dlls/bot/cs_bot_chatter.cpp:395 */
|
||||
NOBODY void BotPhrase::Randomize(void)
|
||||
// find phrase that meets the current criteria
|
||||
int start = m_index[bankIndex];
|
||||
while (true)
|
||||
{
|
||||
BotSpeakableVector *speakables = m_voiceBank[bankIndex];
|
||||
int &index = m_index[bankIndex];
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
// TODO: temporary fix of std::vector padding
|
||||
*(byte *)&speakables += 4;
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
const BotSpeakable *speak = (*speakables)[index++];
|
||||
|
||||
if (m_index[bankIndex] >= m_count[bankIndex])
|
||||
m_index[bankIndex] = 0;
|
||||
|
||||
// check place criteria
|
||||
// if this speakable has a place criteria, it must match to be used
|
||||
// speakables with Place of ANY will match any place
|
||||
// speakables with a specific Place will only be used if Place matches
|
||||
// speakables with Place of UNDEFINED only match Place of UNDEFINED
|
||||
if (speak->m_place == ANY_PLACE || speak->m_place == m_placeCriteria)
|
||||
{
|
||||
// check count criteria
|
||||
// if this speakable has a count criteria, it must match to be used
|
||||
// if this speakable does not have a count criteria, we dont care what the count is set to
|
||||
if (speak->m_count == UNDEFINED_COUNT || speak->m_count == min(m_countCriteria, COUNT_MANY))
|
||||
{
|
||||
if (duration)
|
||||
*duration = speak->m_duration;
|
||||
|
||||
return speak->m_phrase;
|
||||
}
|
||||
}
|
||||
|
||||
// check if we exhausted all speakables
|
||||
if (m_index[bankIndex] == start)
|
||||
{
|
||||
if (duration)
|
||||
*duration = 0.0f;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void (*pBotPhrase__Randomize)(void);
|
||||
|
||||
/* <30395a> ../cstrike/dlls/bot/cs_bot_chatter.cpp:395 */
|
||||
NOBODY void __declspec(naked) BotPhrase::Randomize(void)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
jmp pBotPhrase__Randomize
|
||||
}
|
||||
|
||||
// UNTESTED
|
||||
//
|
||||
// for (unsigned int i = 0; i < m_voiceBank.size(); i++)
|
||||
// {
|
||||
// int i; // 397
|
||||
// BotSpeakableVector *speakables = m_voiceBank[i];
|
||||
//
|
||||
//#ifdef HOOK_GAMEDLL
|
||||
// // TODO: temporary fix of std::vector padding
|
||||
// *(byte *)&speakables += 4;
|
||||
//#endif // HOOK_GAMEDLL
|
||||
//
|
||||
// BotSpeakable *firstElem = speakables->front();
|
||||
// int nSize = speakables->size();
|
||||
//
|
||||
// for (unsigned int index = 1; index < nSize; index++)
|
||||
// {
|
||||
// // TODO: check it, need hook std rand
|
||||
// int randIndex = (rand() % nSize);
|
||||
//
|
||||
// BotSpeakable *speakable = (*speakables)[ randIndex ];
|
||||
//
|
||||
// (*speakables)[ randIndex ] = (*speakables)[ index ];
|
||||
// (*speakables)[ index ] = speakable;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
@ -217,16 +298,22 @@ NOBODY void BotPhraseManager::OnMapChange(void)
|
||||
}
|
||||
|
||||
/* <303c70> ../cstrike/dlls/bot/cs_bot_chatter.cpp:425 */
|
||||
NOBODY void BotPhraseManager::OnRoundRestart(void)
|
||||
void BotPhraseManager::OnRoundRestart(void)
|
||||
{
|
||||
// {
|
||||
// const_iterator iter; // 431
|
||||
// end(list<BotPhrase*, std::allocator<BotPhrase*>> *const this); // 433
|
||||
// Randomize(BotPhrase *const this); // 434
|
||||
// operator++(_List_const_iterator<BotPhrase*> *const this); // 433
|
||||
// Randomize(BotPhrase *const this); // 437
|
||||
// operator++(_List_const_iterator<BotPhrase*> *const this); // 436
|
||||
// }
|
||||
// effectively reset all interval timers
|
||||
m_placeCount = 0;
|
||||
BotPhraseList::const_iterator iter;
|
||||
|
||||
// shuffle all the speakables
|
||||
for (iter = m_placeList.begin(); iter != m_placeList.end(); ++iter)
|
||||
{
|
||||
(*iter)->Randomize();
|
||||
}
|
||||
|
||||
for (iter = m_list.begin(); iter != m_list.end(); ++iter)
|
||||
{
|
||||
(*iter)->Randomize();
|
||||
}
|
||||
}
|
||||
|
||||
/* <30c1fc> ../cstrike/dlls/bot/cs_bot_chatter.cpp:443 */
|
||||
|
@ -35,6 +35,7 @@
|
||||
#define UNDEFINED_COUNT 0xFFFF
|
||||
#define MAX_PLACES_PER_MAP 64
|
||||
#define UNDEFINED_SUBJECT (-1)
|
||||
#define COUNT_MANY 4
|
||||
|
||||
class CCSBot;
|
||||
class BotChatterInterface;
|
||||
@ -200,7 +201,7 @@ public:
|
||||
NOBODY ~BotPhrase(void);
|
||||
|
||||
NOBODY void InitVoiceBank(int bankIndex);
|
||||
NOBODY char *GetSpeakable(int bankIndex, float *duration = NULL) const;
|
||||
char *GetSpeakable(int bankIndex, float *duration = NULL) const;
|
||||
|
||||
void ClearCriteria(void) const;
|
||||
void SetPlaceCriteria(PlaceCriteria place) const;
|
||||
@ -227,7 +228,8 @@ public:
|
||||
return m_isPlace;
|
||||
}
|
||||
NOBODY void Randomize(void);
|
||||
private:
|
||||
//private:
|
||||
public:
|
||||
friend class BotPhraseManager;
|
||||
|
||||
char *m_name;
|
||||
@ -236,8 +238,22 @@ private:
|
||||
GameEventType m_radioEvent;
|
||||
bool m_isImportant;
|
||||
|
||||
#if defined(_WIN32) && defined(HOOK_GAMEDLL)
|
||||
int unknown_padding;
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
mutable BotVoiceBankVector m_voiceBank;
|
||||
|
||||
#if defined(_WIN32) && defined(HOOK_GAMEDLL)
|
||||
int unknown_padding2;
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
std::vector< int > m_count;
|
||||
|
||||
#if defined(_WIN32) && defined(HOOK_GAMEDLL)
|
||||
int unknown_padding3;
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
mutable std::vector< int > m_index;
|
||||
|
||||
int m_numVoiceBanks;
|
||||
@ -278,7 +294,7 @@ public:
|
||||
NOBODY bool Initialize(const char *filename, int bankIndex);
|
||||
|
||||
// invoked when round resets
|
||||
NOBODY void OnRoundRestart(void);
|
||||
void OnRoundRestart(void);
|
||||
|
||||
// invoked when map changes
|
||||
NOBODY void OnMapChange(void);
|
||||
@ -682,4 +698,7 @@ typedef const BotPhraseManager *(BotPhraseManager::*GET_PLACE_PLACE)(PlaceCriter
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
// refs
|
||||
extern void (*pBotPhrase__Randomize)(void);
|
||||
|
||||
#endif // CS_BOT_CHATTER_H
|
||||
|
@ -8,7 +8,7 @@ NOBODY void InstallBotControl(void)
|
||||
}
|
||||
|
||||
/* <333cb3> ../cstrike/dlls/bot/cs_bot_init.cpp:68 */
|
||||
NOBODY void Bot_ServerCommand(void)
|
||||
void Bot_ServerCommand(void)
|
||||
{
|
||||
if (TheBots != NULL)
|
||||
{
|
||||
@ -90,23 +90,177 @@ void Bot_RegisterCvars(void)
|
||||
/* <3342ac> ../cstrike/dlls/bot/cs_bot_init.cpp:137 */
|
||||
NOBODY bool CCSBot::Initialize_(const BotProfile *profile)
|
||||
{
|
||||
CBot::Initialize(profile);
|
||||
|
||||
m_diedLastRound = false;
|
||||
m_morale = POSITIVE;
|
||||
m_navNodeList = NULL;
|
||||
m_currentNode = NULL;
|
||||
|
||||
m_combatRange = RANDOM_FLOAT(325, 425);
|
||||
m_name[0] = '\0';
|
||||
m_safeTime = m_profile->GetAggression() * 5 + 15;
|
||||
|
||||
ResetValues();
|
||||
StartNormalProcess();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* <3341dc> ../cstrike/dlls/bot/cs_bot_init.cpp:167 */
|
||||
NOBODY void CCSBot::ResetValues(void)
|
||||
{
|
||||
// {
|
||||
// class CCSBotManager *ctrl; // 304
|
||||
// Invalidate(CountdownTimer *const this); // 175
|
||||
// Invalidate(CountdownTimer *const this); // 188
|
||||
// {
|
||||
// int w; // 206
|
||||
// }
|
||||
// Invalidate(IntervalTimer *const this); // 224
|
||||
// ClearHuntArea(HuntState *const this); // 294
|
||||
// Invalidate(CountdownTimer *const this); // 289
|
||||
// Invalidate(CountdownTimer *const this); // 292
|
||||
// }
|
||||
m_chatter.Reset();//TODO: Reverse me
|
||||
m_gameState.Reset();//TODO: Reverse me
|
||||
|
||||
m_avoid = NULL;
|
||||
m_avoidTimestamp = 0.0f;
|
||||
|
||||
m_hurryTimer.Invalidate();
|
||||
|
||||
m_isStuck = false;
|
||||
m_stuckTimestamp = 0.0f;
|
||||
m_wiggleTimestamp = 0.0f;
|
||||
m_stuckJumpTimestamp = 0.0f;
|
||||
|
||||
m_pathLength = 0;
|
||||
m_pathIndex = 0;
|
||||
|
||||
m_areaEnteredTimestamp = 0.0f;
|
||||
m_currentArea = NULL;
|
||||
m_lastKnownArea = NULL;
|
||||
|
||||
m_avoidFriendTimer.Invalidate();
|
||||
|
||||
m_isFriendInTheWay = false;
|
||||
m_isWaitingBehindFriend = false;
|
||||
m_disposition = ENGAGE_AND_INVESTIGATE;
|
||||
|
||||
m_enemy = NULL;
|
||||
m_isWaitingToTossGrenade = false;
|
||||
m_wasSafe = true;
|
||||
m_nearbyEnemyCount = 0;
|
||||
m_enemyPlace = 0;
|
||||
m_nearbyFriendCount = 0;
|
||||
|
||||
m_closestVisibleFriend = NULL;
|
||||
m_closestVisibleHumanFriend = NULL;
|
||||
|
||||
for (int w = 0; w < ARRAYSIZE(m_watchInfo); w++)
|
||||
{
|
||||
m_watchInfo[w].timestamp = 0.0f;
|
||||
m_watchInfo[w].isEnemy = false;
|
||||
}
|
||||
|
||||
m_isEnemyVisible = false;
|
||||
m_visibleEnemyParts = NONE;
|
||||
|
||||
m_lastSawEnemyTimestamp = 0.0f;
|
||||
m_firstSawEnemyTimestamp = 0.0f;
|
||||
m_currentEnemyAcquireTimestamp = 0.0f;
|
||||
|
||||
m_isLastEnemyDead = true;
|
||||
|
||||
m_attacker = NULL;
|
||||
m_attackedTimestamp = 0.0f;
|
||||
m_enemyDeathTimestamp = 0.0f;
|
||||
m_lastVictimID = 0;
|
||||
m_isAimingAtEnemy = false;
|
||||
|
||||
m_fireWeaponTimestamp = 0.0f;
|
||||
m_equipTimer.Invalidate();
|
||||
m_isFollowing = false;
|
||||
m_leader = NULL;
|
||||
|
||||
m_followTimestamp = 0.0f;
|
||||
m_allowAutoFollowTime = 0.0f;
|
||||
|
||||
m_enemyQueueIndex = 0;
|
||||
m_enemyQueueCount = 0;
|
||||
m_enemyQueueAttendIndex = 0;
|
||||
m_bomber = NULL;
|
||||
|
||||
m_lookAroundStateTimestamp = 0.0f;
|
||||
m_inhibitLookAroundTimestamp = 0.0f;
|
||||
m_lookPitch = 0.0f;
|
||||
m_lookPitchVel = 0.0f;
|
||||
m_lookYaw = 0.0f;
|
||||
m_lookYawVel = 0.0f;
|
||||
m_aimOffsetTimestamp = 0.0f;
|
||||
m_aimSpreadTimestamp = 0.0f;
|
||||
|
||||
m_lookAtSpotState = NOT_LOOKING_AT_SPOT;
|
||||
m_spotEncounter = NULL;
|
||||
|
||||
m_spotCheckTimestamp = 0.0f;
|
||||
m_peripheralTimestamp = 0.0f;
|
||||
|
||||
m_avgVelIndex = 0;
|
||||
m_avgVelCount = 0;
|
||||
|
||||
if (pev)
|
||||
{
|
||||
m_lastOrigin = pev->origin;
|
||||
}
|
||||
else
|
||||
m_lastOrigin = Vector(0, 0, 0);
|
||||
|
||||
m_lastRadioCommand = EVENT_INVALID;
|
||||
|
||||
m_lastRadioRecievedTimestamp = 0.0f;
|
||||
m_lastRadioSentTimestamp = 0.0f;
|
||||
m_radioSubject = NULL;
|
||||
|
||||
m_noisePosition = Vector(0, 0, 0);
|
||||
m_noiseTimestamp = 0.0f;
|
||||
m_noiseCheckTimestamp = 0.0f;
|
||||
|
||||
m_voiceFeedbackEndTimestamp = 0.0f;
|
||||
|
||||
m_hostageEscortCount = 0;
|
||||
m_hostageEscortCountTimestamp = 0.0f;
|
||||
|
||||
m_isNoiseTravelRangeChecked = false;
|
||||
m_stateTimestamp = 0.0f;
|
||||
|
||||
m_task = SEEK_AND_DESTROY;
|
||||
m_taskEntity = NULL;
|
||||
|
||||
m_approachPointCount = 0;
|
||||
m_approachPointViewPosition = Vector(0, 0, 0);
|
||||
|
||||
m_checkedHidingSpotCount = 0;
|
||||
m_isJumpCrouching = false;
|
||||
|
||||
StandUp();
|
||||
Run();
|
||||
|
||||
m_pathLadder = NULL;
|
||||
m_mustRunTimer.Invalidate();
|
||||
m_repathTimer.Invalidate();
|
||||
|
||||
m_huntState.ClearHuntArea();
|
||||
|
||||
// adjust morale - if we died, our morale decreased,
|
||||
// but if we live, no adjustement (round win/loss also adjusts morale
|
||||
if (m_diedLastRound)
|
||||
{
|
||||
DecreaseMorale();
|
||||
}
|
||||
|
||||
m_diedLastRound = false;
|
||||
m_isRogue = false;
|
||||
|
||||
m_surpriseDelay = 0.0f;
|
||||
m_surpriseTimestamp = 0.0f;
|
||||
|
||||
m_goalEntity = NULL;
|
||||
m_avoid = NULL;
|
||||
m_enemy = NULL;
|
||||
|
||||
// start in idle state
|
||||
StopAttacking();//TODO: Reverse me
|
||||
Idle();//TODO: Reverse me
|
||||
}
|
||||
|
||||
/* <3342e4> ../cstrike/dlls/bot/cs_bot_init.cpp:336 */
|
||||
@ -124,12 +278,16 @@ NOBODY void CCSBot::RoundRespawn_(void)
|
||||
}
|
||||
|
||||
/* <334332> ../cstrike/dlls/bot/cs_bot_init.cpp:378 */
|
||||
NOBODY void CCSBot::Disconnect(void)
|
||||
void CCSBot::Disconnect(void)
|
||||
{
|
||||
// MESSAGE_BEGIN(int msg_dest,
|
||||
// int msg_type,
|
||||
// const float *pOrigin,
|
||||
// edict_t *ed); // 386
|
||||
EndVoiceFeedback();
|
||||
|
||||
if (m_processMode)
|
||||
{
|
||||
MESSAGE_BEGIN(MSG_ALL, gmsgBotProgress);
|
||||
WRITE_BYTE(FLAG_PROGRESS_HIDE);
|
||||
MESSAGE_END();
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
@ -274,6 +274,7 @@ NOBODY void CCSBot::UpdateSaveProcess(void)
|
||||
}
|
||||
|
||||
/* <344e24> ../cstrike/dlls/bot/cs_bot_learn.cpp:554 */
|
||||
NOBODY void CCSBot::StartNormalProcess(void)
|
||||
void CCSBot::StartNormalProcess(void)
|
||||
{
|
||||
m_processMode = PROCESS_NORMAL;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -66,11 +66,12 @@
|
||||
#define cv_bot_chatter (*pcv_bot_chatter)
|
||||
#define cv_bot_profile_db (*pcv_bot_profile_db)
|
||||
|
||||
#define m_flNextCVarCheck (*pm_flNextCVarCheck)
|
||||
#define m_isMapDataLoaded (*pm_isMapDataLoaded)
|
||||
//#define m_flNextCVarCheck (*pm_flNextCVarCheck)
|
||||
//#define m_isMapDataLoaded (*pm_isMapDataLoaded)
|
||||
//#define m_editCmd (*pm_editCmd)
|
||||
|
||||
#define m_isLearningMap (*pm_isLearningMap)
|
||||
#define m_isAnalysisRequested (*pm_isAnalysisRequested)
|
||||
//#define m_isLearningMap (*pm_isLearningMap)
|
||||
//#define m_isAnalysisRequested (*pm_isAnalysisRequested)
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
@ -111,20 +112,20 @@ class CCSBotManager: public CBotManager
|
||||
public:
|
||||
CCSBotManager(void);
|
||||
public:
|
||||
NOBODY virtual void ClientDisconnect(CBasePlayer *pPlayer);
|
||||
virtual void ClientDisconnect(CBasePlayer *pPlayer);
|
||||
NOBODY virtual BOOL ClientCommand(CBasePlayer *pPlayer, const char *pcmd);
|
||||
|
||||
NOBODY virtual void ServerActivate(void);
|
||||
NOBODY virtual void ServerDeactivate(void);
|
||||
virtual void ServerActivate(void);
|
||||
virtual void ServerDeactivate(void);
|
||||
|
||||
NOBODY virtual void ServerCommand(const char *pcmd);
|
||||
NOBODY virtual void AddServerCommand(const char *cmd);
|
||||
NOBODY virtual void AddServerCommands(void);
|
||||
virtual void AddServerCommand(const char *cmd);
|
||||
virtual void AddServerCommands(void);
|
||||
|
||||
NOBODY virtual void RestartRound(void);
|
||||
virtual void RestartRound(void);
|
||||
NOBODY virtual void StartFrame(void);
|
||||
|
||||
virtual void OnEvent(GameEventType event, CBaseEntity *entity, CBaseEntity *other);
|
||||
virtual void OnEvent(GameEventType event, CBaseEntity *entity = NULL, CBaseEntity *other = NULL);
|
||||
NOBODY virtual unsigned int GetPlayerPriority(CBasePlayer *player) const;
|
||||
NOBODY virtual bool IsImportantPlayer(CBasePlayer *player);
|
||||
|
||||
@ -145,28 +146,28 @@ public:
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
public:
|
||||
NOBODY void ValidateMapData(void);
|
||||
void ValidateMapData(void);
|
||||
bool IsLearningMap(void)
|
||||
{
|
||||
return m_isLearningMap;
|
||||
return IMPLEMENT_ARRAY(m_isLearningMap);
|
||||
}
|
||||
void SetLearningMapFlag(void)
|
||||
{
|
||||
m_isLearningMap = true;
|
||||
IMPLEMENT_ARRAY(m_isLearningMap) = true;
|
||||
}
|
||||
bool IsAnalysisRequested(void)
|
||||
{
|
||||
return m_isAnalysisRequested;
|
||||
return IMPLEMENT_ARRAY(m_isAnalysisRequested);
|
||||
}
|
||||
void RequestAnalysis(void)
|
||||
{
|
||||
m_isAnalysisRequested = true;
|
||||
IMPLEMENT_ARRAY(m_isAnalysisRequested) = true;
|
||||
}
|
||||
void AckAnalysisRequest(void)
|
||||
{
|
||||
m_isAnalysisRequested = false;
|
||||
IMPLEMENT_ARRAY(m_isAnalysisRequested) = false;
|
||||
}
|
||||
BotDifficultyType GetDifficultyLevel(void)
|
||||
static BotDifficultyType GetDifficultyLevel(void)
|
||||
{
|
||||
if (cv_bot_difficulty.value < 0.9f)
|
||||
return BOT_EASY;
|
||||
@ -202,6 +203,7 @@ public:
|
||||
bool m_isLegacy;
|
||||
int m_index;
|
||||
Extent m_extent;
|
||||
|
||||
};/* size: 116, cachelines: 2, members: 7 */
|
||||
|
||||
const Zone *GetZone(int i) const
|
||||
@ -295,7 +297,7 @@ public:
|
||||
NOBODY float GetRadioMessageTimestamp(GameEventType event, int teamID);
|
||||
NOBODY float GetRadioMessageInterval(GameEventType event, int teamID);
|
||||
NOBODY void SetRadioMessageTimestamp(GameEventType event, int teamID);
|
||||
NOBODY void ResetRadioMessageTimestamps(void);
|
||||
void ResetRadioMessageTimestamps(void);
|
||||
|
||||
// return the last time anyone has seen an enemy
|
||||
float GetLastSeenEnemyTimestamp(void) const
|
||||
@ -386,18 +388,18 @@ public:
|
||||
|
||||
NOBODY static void MonitorBotCVars(void);
|
||||
NOBODY static void MaintainBotQuota(void);
|
||||
NOBODY static bool AddBot(BotProfile *profile, BotProfileTeamType team);
|
||||
NOBODY static bool BotAddCommand(BotProfileTeamType team, bool isFromConsole);
|
||||
NOBODY static bool AddBot(const BotProfile *profile, BotProfileTeamType team);
|
||||
NOBODY static bool BotAddCommand(BotProfileTeamType team, bool isFromConsole = true);
|
||||
|
||||
#ifndef HOOK_GAMEDLL
|
||||
private:
|
||||
#else
|
||||
public:
|
||||
#endif // HOOK_GAMEDLL
|
||||
static float m_flNextCVarCheck;
|
||||
static bool m_isMapDataLoaded;
|
||||
static bool m_isLearningMap;
|
||||
static bool m_isAnalysisRequested;
|
||||
static float IMPLEMENT_ARRAY(m_flNextCVarCheck);
|
||||
static bool IMPLEMENT_ARRAY(m_isMapDataLoaded);
|
||||
static bool IMPLEMENT_ARRAY(m_isLearningMap);
|
||||
static bool IMPLEMENT_ARRAY(m_isAnalysisRequested);
|
||||
#ifdef HOOK_GAMEDLL
|
||||
private:
|
||||
#endif // HOOK_GAMEDLL
|
||||
@ -417,7 +419,15 @@ private:
|
||||
float m_roundStartTimestamp;
|
||||
bool m_isDefenseRushing;
|
||||
|
||||
static NavEditCmdType m_editCmd;
|
||||
#ifndef HOOK_GAMEDLL
|
||||
private:
|
||||
#else
|
||||
public:
|
||||
#endif // HOOK_GAMEDLL
|
||||
static NavEditCmdType IMPLEMENT_ARRAY(m_editCmd);
|
||||
#ifdef HOOK_GAMEDLL
|
||||
private:
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
unsigned int m_navPlace;
|
||||
CountdownTimer m_respawnTimer;
|
||||
@ -439,7 +449,7 @@ inline CCSBotManager *TheCSBots(void)
|
||||
return reinterpret_cast<CCSBotManager *>(TheBots);
|
||||
}
|
||||
|
||||
NOBODY void PrintAllEntities(void);
|
||||
void PrintAllEntities(void);
|
||||
NOBODY void UTIL_DrawBox(Extent *extent, int lifetime, int red, int green, int blue);
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
@ -449,4 +459,7 @@ typedef const CCSBotManager::Zone *(CCSBotManager::*GET_ZONE_VECTOR)(const Vecto
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
// refs
|
||||
extern void (*pCCSBotManager__AddBot)(void);
|
||||
|
||||
#endif // CS_BOT_MANAGER_H
|
||||
|
@ -15,14 +15,17 @@ NOBODY void CCSBot::StartVoiceFeedback(float duration)
|
||||
}
|
||||
|
||||
/* <3a3a32> ../cstrike/dlls/bot/cs_bot_radio.cpp:241 */
|
||||
NOBODY void CCSBot::EndVoiceFeedback(bool force)
|
||||
void CCSBot::EndVoiceFeedback(bool force)
|
||||
{
|
||||
// MESSAGE_BEGIN(int msg_dest,
|
||||
// int msg_type,
|
||||
// const float *pOrigin,
|
||||
// edict_t *ed); // 249
|
||||
// edict(CBaseEntity *const this); // 251
|
||||
// ENTINDEX(edict_t *pEdict); // 251
|
||||
if (!force && !m_voiceFeedbackEndTimestamp)
|
||||
return;
|
||||
|
||||
m_voiceFeedbackEndTimestamp = 0;
|
||||
|
||||
MESSAGE_BEGIN(MSG_ALL, gmsgBotVoice);
|
||||
WRITE_BYTE(0);
|
||||
WRITE_BYTE(ENTINDEX(edict()));
|
||||
MESSAGE_END();
|
||||
}
|
||||
|
||||
/* <3a3bcd> ../cstrike/dlls/bot/cs_bot_radio.cpp:259 */
|
||||
|
@ -3,14 +3,29 @@
|
||||
/* <3b3a2a> ../cstrike/dlls/bot/cs_bot_statemachine.cpp:16 */
|
||||
NOBODY void CCSBot::SetState(BotState *state)
|
||||
{
|
||||
// StopAttacking(CCSBot *const this); // 22
|
||||
PrintIfWatched("SetState: %s -> %s\n", (m_state != NULL) ? m_state->GetName() : "NULL", state->GetName());
|
||||
|
||||
if (m_isAttacking)
|
||||
{
|
||||
StopAttacking();
|
||||
}
|
||||
|
||||
if (m_state)
|
||||
{
|
||||
m_state->OnExit(this);
|
||||
}
|
||||
|
||||
state->OnEnter(this);
|
||||
|
||||
m_state = state;
|
||||
m_stateTimestamp = gpGlobals->time;
|
||||
}
|
||||
|
||||
/* <3b3ab4> ../cstrike/dlls/bot/cs_bot_statemachine.cpp:34 */
|
||||
NOBODY void CCSBot::Idle(void)
|
||||
{
|
||||
// SetTask(CCSBot::Idle(// enum TaskType task,
|
||||
// class CBaseEntity *entity); // 36
|
||||
SetTask(SEEK_AND_DESTROY);
|
||||
SetState(&m_idleState);
|
||||
}
|
||||
|
||||
/* <3b3afa> ../cstrike/dlls/bot/cs_bot_statemachine.cpp:41 */
|
||||
@ -208,7 +223,15 @@ NOBODY void CCSBot::Attack(CBasePlayer *victim)
|
||||
/* <3b4416> ../cstrike/dlls/bot/cs_bot_statemachine.cpp:366 */
|
||||
NOBODY void CCSBot::StopAttacking(void)
|
||||
{
|
||||
// Idle(CCSBot *const this); // 374
|
||||
PrintIfWatched("ATTACK END\n");
|
||||
m_attackState.OnExit(this);//TODO: Reverse me
|
||||
m_isAttacking = false;
|
||||
|
||||
// if we are following someone, go to the Idle state after the attack to decide whether we still want to follow
|
||||
if (IsFollowing())
|
||||
{
|
||||
Idle();
|
||||
}
|
||||
}
|
||||
|
||||
/* <3b447d> ../cstrike/dlls/bot/cs_bot_statemachine.cpp:378 */
|
||||
|
@ -339,59 +339,3 @@ void CCSBot::Update(void)
|
||||
}
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//m_aimSpot = m_enemy->pev->origin;
|
||||
|
||||
//if (GetProfile()->GetSkill() > 0.5f)
|
||||
//{
|
||||
// const float k = 3.0f;
|
||||
// m_aimSpot = (m_enemy->pev->velocity - pev->velocity) * g_flBotCommandInterval * k + m_enemy->pev->origin;
|
||||
// //printf2(__FUNCTION__":: iNum - %d | %f", iNum++, GetProfile()->GetSkill());
|
||||
//}
|
||||
|
||||
//if (IsUsingAWP() || IsUsingShotgun() || IsUsingMachinegun() || GetProfile()->GetSkill() < 0.8f || (IsActiveWeaponRecoilHigh() && !IsUsingPistol() && !IsUsingSniperRifle()))
|
||||
//{
|
||||
// if (IsEnemyPartVisible( CHEST ))
|
||||
// {
|
||||
// m_aimSpot.z -= feetOffset * 0.25f;
|
||||
// goto LABEL_41;
|
||||
// }
|
||||
//}
|
||||
|
||||
//if (IsEnemyPartVisible( CHEST ))
|
||||
//{
|
||||
// m_aimSpot.z -= feetOffset * 0.5f;
|
||||
//}
|
||||
//else if (IsEnemyPartVisible( HEAD ))
|
||||
//{
|
||||
// //goto LABEL_41;
|
||||
//}
|
||||
//else if (IsEnemyPartVisible( LEFT_SIDE ))
|
||||
//{
|
||||
// Vector2D to = (m_enemy->pev->origin - pev->origin).Make2D();
|
||||
// to.NormalizeInPlace();
|
||||
|
||||
// m_aimSpot.x -= to.y * 16.0f;
|
||||
// m_aimSpot.y += to.x * 16.0f;
|
||||
// m_aimSpot.z -= feetOffset * 0.5f;
|
||||
//}
|
||||
//else if (IsEnemyPartVisible( RIGHT_SIDE ))
|
||||
//{
|
||||
// Vector2D to = (m_enemy->pev->origin - pev->origin).Make2D();
|
||||
// to.NormalizeInPlace();
|
||||
|
||||
// m_aimSpot.x += to.y * 16.0f;
|
||||
// m_aimSpot.y -= to.x * 16.0f;
|
||||
// m_aimSpot.z -= feetOffset * 0.5f;
|
||||
//}
|
||||
//else // FEET
|
||||
// m_aimSpot.z -= (feetOffset + feetOffset);
|
@ -7,182 +7,474 @@
|
||||
|
||||
CCareerTaskManager *TheCareerTasks = NULL;
|
||||
|
||||
#else
|
||||
const TaskInfo taskInfo[] =
|
||||
{
|
||||
{ "defuse", EVENT_BOMB_DEFUSED, &CCareerTask::NewTask },
|
||||
{ "plant", EVENT_BOMB_PLANTED, &CCareerTask::NewTask },
|
||||
{ "rescue", EVENT_HOSTAGE_RESCUED, &CCareerTask::NewTask },
|
||||
{ "killall", EVENT_KILL_ALL, &CCareerTask::NewTask },
|
||||
{ "kill", EVENT_KILL, &CCareerTask::NewTask },
|
||||
{ "killwith", EVENT_KILL, &CCareerTask::NewTask },
|
||||
{ "killblind", EVENT_KILL_FLASHBANGED, &CCareerTask::NewTask },
|
||||
{ "killvip", EVENT_KILL, &CCareerTask::NewTask },
|
||||
{ "headshot", EVENT_HEADSHOT, &CCareerTask::NewTask },
|
||||
{ "headshotwith", EVENT_HEADSHOT, &CCareerTask::NewTask },
|
||||
{ "winfast", EVENT_ROUND_WIN, &CCareerTask::NewTask },
|
||||
{ "rescue", EVENT_HOSTAGE_RESCUED, &CCareerTask::NewTask },
|
||||
{ "rescueall", EVENT_ALL_HOSTAGES_RESCUED, &CCareerTask::NewTask },
|
||||
{ "injure", EVENT_PLAYER_TOOK_DAMAGE, &CCareerTask::NewTask },
|
||||
{ "injurewith", EVENT_PLAYER_TOOK_DAMAGE, &CCareerTask::NewTask },
|
||||
{ "killdefuser", EVENT_KILL, &CCareerTask::NewTask },
|
||||
{ "stoprescue", EVENT_KILL, &CCareerTask::NewTask },
|
||||
{ "defendhostages", EVENT_ROUND_WIN, &CCareerTask::NewTask },
|
||||
{ "hostagessurvive", EVENT_ROUND_WIN, &CCareerTask::NewTask },
|
||||
{ "preventdefuse", EVENT_ROUND_WIN, &CPreventDefuseTask::NewTask },
|
||||
{ NULL, EVENT_INVALID, &CCareerTask::NewTask }
|
||||
};
|
||||
|
||||
#else // HOOK_GAMEDLL
|
||||
|
||||
CCareerTaskManager *TheCareerTasks;
|
||||
const TaskInfo taskInfo[21];
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
/* <1ef647> ../cstrike/dlls/career_tasks.cpp:133 */
|
||||
NOBODY CCareerTask *CPreventDefuseTask::NewTask(const char *taskName, GameEventType event, const char *weaponName, int n, bool mustLive, bool crossRounds, int id, bool isComplete)
|
||||
CCareerTask *CPreventDefuseTask::NewTask(const char *taskName, GameEventType event, const char *weaponName, int n, bool mustLive, bool crossRounds, int id, bool isComplete)
|
||||
{
|
||||
// CPreventDefuseTask(// const char *taskName,
|
||||
// enum GameEventType event,
|
||||
// const char *weaponName,
|
||||
// int n,
|
||||
// bool mustLive,
|
||||
// bool crossRounds,
|
||||
// int id,
|
||||
// bool isComplete); // 135
|
||||
CPreventDefuseTask *pNewTask = new CPreventDefuseTask(taskName, event, weaponName, n, mustLive, crossRounds, id, isComplete);
|
||||
|
||||
pNewTask->m_bombPlantedThisRound = false;
|
||||
pNewTask->m_defuseStartedThisRound = false;
|
||||
|
||||
return (CCareerTask *)pNewTask;
|
||||
}
|
||||
|
||||
/* <1ef5db> ../cstrike/dlls/career_tasks.cpp:139 */
|
||||
NOBODY CPreventDefuseTask::CPreventDefuseTask(const char *taskName, GameEventType event, const char *weaponName, int n, bool mustLive, bool crossRounds, int id, bool isComplete)
|
||||
CPreventDefuseTask::CPreventDefuseTask(const char *taskName, GameEventType event, const char *weaponName, int n, bool mustLive, bool crossRounds, int id, bool isComplete)
|
||||
{
|
||||
//CCareerTask(taskName, event, weaponName, n, mustLive, crossRounds, id, isComplete);
|
||||
CCareerTask(taskName, event, weaponName, n, mustLive, crossRounds, id, isComplete);
|
||||
|
||||
m_bombPlantedThisRound = false;
|
||||
m_defuseStartedThisRound = false;
|
||||
}
|
||||
|
||||
/* <1ef296> ../cstrike/dlls/career_tasks.cpp:147 */
|
||||
NOBODY void CPreventDefuseTask::Reset(void)
|
||||
void CPreventDefuseTask::Reset_(void)
|
||||
{
|
||||
m_bombPlantedThisRound = false;
|
||||
m_defuseStartedThisRound = false;
|
||||
|
||||
CCareerTask::Reset();
|
||||
}
|
||||
|
||||
/* <1efbf8> ../cstrike/dlls/career_tasks.cpp:156 */
|
||||
NOBODY void CPreventDefuseTask::OnEvent(GameEventType event, CBasePlayer *pAttacker, CBasePlayer *pVictim)
|
||||
void CPreventDefuseTask::OnEvent_(GameEventType event, CBasePlayer *pAttacker, CBasePlayer *pVictim)
|
||||
{
|
||||
// OnEvent(CPreventDefuseTask *const this,
|
||||
// enum GameEventType event,
|
||||
// class CBasePlayer *pAttacker,
|
||||
// class CBasePlayer *pVictim); // 156
|
||||
if (IsComplete())
|
||||
return;
|
||||
|
||||
if (event == EVENT_BOMB_PLANTED)
|
||||
{
|
||||
m_bombPlantedThisRound = true;
|
||||
}
|
||||
else if (event == EVENT_BOMB_DEFUSING)
|
||||
{
|
||||
m_defuseStartedThisRound = true;
|
||||
}
|
||||
|
||||
CCareerTask::OnEvent(event, pAttacker, pVictim);
|
||||
|
||||
if (event >= EVENT_ROUND_DRAW && event <= EVENT_ROUND_LOSS)
|
||||
{
|
||||
m_bombPlantedThisRound = false;
|
||||
m_defuseStartedThisRound = false;
|
||||
}
|
||||
}
|
||||
|
||||
/* <1ef4e1> ../cstrike/dlls/career_tasks.cpp:186 */
|
||||
NOBODY CCareerTask *CCareerTask::NewTask(const char *taskName, GameEventType event, const char *weaponName, int n, bool mustLive, bool crossRounds, int id, bool isComplete)
|
||||
CCareerTask *CCareerTask::NewTask(const char *taskName, GameEventType event, const char *weaponName, int n, bool mustLive, bool crossRounds, int id, bool isComplete)
|
||||
{
|
||||
CCareerTask *pTask = new CCareerTask(taskName, event, weaponName, n, mustLive, crossRounds, id, isComplete);
|
||||
return pTask;
|
||||
}
|
||||
|
||||
/* <1ef43f> ../cstrike/dlls/career_tasks.cpp:192 */
|
||||
NOBODY CCareerTask::CCareerTask(const char *taskName, GameEventType event, const char *weaponName, int n, bool mustLive, bool crossRounds, int id, bool isComplete)
|
||||
CCareerTask::CCareerTask(const char *taskName, GameEventType event, const char *weaponName, int n, bool mustLive, bool crossRounds, int id, bool isComplete)
|
||||
{
|
||||
// MESSAGE_BEGIN(int msg_dest,
|
||||
// int msg_type,
|
||||
// const float *pOrigin,
|
||||
// edict_t *ed); // 217
|
||||
m_isComplete = isComplete;
|
||||
m_event = event;
|
||||
m_eventsNeeded = n;
|
||||
|
||||
m_name = taskName;
|
||||
m_eventsSeen = 0;
|
||||
m_mustLive = mustLive;
|
||||
m_crossRounds = crossRounds;
|
||||
m_diedThisRound = false;
|
||||
m_id = id;
|
||||
m_weaponId = AliasToWeaponID(weaponName);
|
||||
m_weaponClassId = AliasToWeaponClass(weaponName);
|
||||
|
||||
m_rescuer = (Q_stricmp(taskName, "stoprescue") == 0);
|
||||
m_defuser = (Q_stricmp(taskName, "killdefuser") == 0);
|
||||
m_vip = (Q_stricmp(taskName, "killvip") == 0);
|
||||
|
||||
if (event == EVENT_ALL_HOSTAGES_RESCUED)
|
||||
{
|
||||
m_mustLive = true;
|
||||
m_crossRounds = false;
|
||||
}
|
||||
|
||||
if (m_isComplete)
|
||||
{
|
||||
MESSAGE_BEGIN(MSG_ALL, gmsgCZCareer);
|
||||
WRITE_STRING("TASKDONE");
|
||||
WRITE_BYTE(m_id);
|
||||
MESSAGE_END();
|
||||
}
|
||||
}
|
||||
|
||||
/* <1ef211> ../cstrike/dlls/career_tasks.cpp:240 */
|
||||
NOBODY void CCareerTask::Reset(void)
|
||||
void CCareerTask::Reset_(void)
|
||||
{
|
||||
// MESSAGE_BEGIN(int msg_dest,
|
||||
// int msg_type,
|
||||
// const float *pOrigin,
|
||||
// edict_t *ed); // 244
|
||||
// MESSAGE_BEGIN(int msg_dest,
|
||||
// int msg_type,
|
||||
// const float *pOrigin,
|
||||
// edict_t *ed); // 248
|
||||
m_eventsSeen = 0;
|
||||
m_isComplete = false;
|
||||
|
||||
MESSAGE_BEGIN(MSG_ALL, gmsgCZCareer);
|
||||
WRITE_STRING("TASKUNDONE");
|
||||
WRITE_BYTE(m_id);
|
||||
MESSAGE_END();
|
||||
|
||||
MESSAGE_BEGIN(MSG_ALL, gmsgCZCareer);
|
||||
WRITE_STRING("TASKPART");
|
||||
WRITE_BYTE(m_id);
|
||||
WRITE_SHORT(m_eventsSeen);
|
||||
MESSAGE_END();
|
||||
}
|
||||
|
||||
/* <1ef74c> ../cstrike/dlls/career_tasks.cpp:256 */
|
||||
NOBODY void CCareerTask::SendPartialNotification(void)
|
||||
void CCareerTask::SendPartialNotification(void)
|
||||
{
|
||||
// MESSAGE_BEGIN(int msg_dest,
|
||||
// int msg_type,
|
||||
// const float *pOrigin,
|
||||
// edict_t *ed); // 258
|
||||
MESSAGE_BEGIN(MSG_ALL, gmsgCZCareer);
|
||||
WRITE_STRING("TASKPART");
|
||||
WRITE_BYTE(m_id);
|
||||
WRITE_SHORT(m_eventsSeen);
|
||||
MESSAGE_END();
|
||||
|
||||
UTIL_LogPrintf("Career Task Partial %d %d\n", m_id, m_eventsSeen);
|
||||
}
|
||||
|
||||
/* <1efc6c> ../cstrike/dlls/career_tasks.cpp:268 */
|
||||
NOBODY void CCareerTask::OnWeaponKill(int weaponId, int weaponClassId, bool headshot, bool killerHasShield, CBasePlayer *pAttacker, CBasePlayer *pVictim)
|
||||
void CCareerTask::OnWeaponKill(int weaponId, int weaponClassId, bool headshot, bool killerHasShield, CBasePlayer *pAttacker, CBasePlayer *pVictim)
|
||||
{
|
||||
// {
|
||||
// int hostages; // 298
|
||||
// class CBaseEntity *hostageEntity; // 299
|
||||
// {
|
||||
// class CHostage *hostage; // 303
|
||||
// IsFollowingSomeone(CHostage *const this); // 304
|
||||
// IsValid(CHostage *const this); // 306
|
||||
// }
|
||||
// }
|
||||
// SendPartialNotification(CCareerTask *const this); // 341
|
||||
if (m_isComplete || m_event != EVENT_KILL && (m_event != EVENT_HEADSHOT || !headshot))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!pVictim || (m_defuser && !pVictim->m_bIsDefusing) || (m_vip && !pVictim->m_bIsVIP))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_rescuer)
|
||||
{
|
||||
int hostages_ = 0;
|
||||
CBaseEntity *hostageEntity = NULL;
|
||||
|
||||
while ((hostageEntity = UTIL_FindEntityByClassname(hostageEntity, "hostage_entity")) != NULL)
|
||||
{
|
||||
CHostage *hostage = (CHostage *)hostageEntity;
|
||||
|
||||
if (!hostage || hostage->pev->takedamage != DAMAGE_YES)
|
||||
continue;
|
||||
|
||||
if (hostage->m_improv)
|
||||
{
|
||||
if (!hostage->IsFollowingSomeone())
|
||||
continue;
|
||||
}
|
||||
else if (!hostage->m_hTargetEnt || hostage->m_State != CHostage::FOLLOW)
|
||||
continue;
|
||||
|
||||
if (hostage->IsValid() && hostage->m_target == pAttacker)
|
||||
++hostages_;
|
||||
}
|
||||
|
||||
if (!hostages_)
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_weaponId == WEAPON_SHIELDGUN)
|
||||
{
|
||||
if (!killerHasShield)
|
||||
return;
|
||||
}
|
||||
else if (m_weaponId)
|
||||
{
|
||||
if (m_weaponId != weaponId)
|
||||
return;
|
||||
}
|
||||
else if (m_weaponClassId)
|
||||
{
|
||||
if (m_weaponClassId != weaponClassId)
|
||||
return;
|
||||
}
|
||||
|
||||
++m_eventsSeen;
|
||||
SendPartialNotification();
|
||||
}
|
||||
|
||||
/* <1efe16> ../cstrike/dlls/career_tasks.cpp:348 */
|
||||
NOBODY void CCareerTask::OnWeaponInjury(int weaponId, int weaponClassId, bool attackerHasShield, CBasePlayer *pAttacker)
|
||||
void CCareerTask::OnWeaponInjury(int weaponId, int weaponClassId, bool attackerHasShield, CBasePlayer *pAttacker)
|
||||
{
|
||||
// SendPartialNotification(CCareerTask *const this); // 379
|
||||
if (m_isComplete || m_event != EVENT_PLAYER_TOOK_DAMAGE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_weaponId == WEAPON_SHIELDGUN)
|
||||
{
|
||||
if (!attackerHasShield)
|
||||
return;
|
||||
}
|
||||
else if (m_weaponId)
|
||||
{
|
||||
if (m_weaponId != weaponId)
|
||||
return;
|
||||
}
|
||||
else if (m_weaponClassId)
|
||||
{
|
||||
if (m_weaponClassId != weaponClassId)
|
||||
return;
|
||||
}
|
||||
|
||||
++m_eventsSeen;
|
||||
SendPartialNotification();
|
||||
}
|
||||
|
||||
/* <1ef79d> ../cstrike/dlls/career_tasks.cpp:385 */
|
||||
NOBODY void CCareerTask::OnEvent(GameEventType event, CBasePlayer *pVictim, CBasePlayer *pAttacker)
|
||||
void CCareerTask::OnEvent_(GameEventType event, CBasePlayer *pVictim, CBasePlayer *pAttacker)
|
||||
{
|
||||
// {
|
||||
// int hostages; // 411
|
||||
// class CBaseEntity *hostageEntity; // 412
|
||||
// {
|
||||
// class CHostage *hostage; // 416
|
||||
// IsFollowingSomeone(CHostage *const this); // 417
|
||||
// IsValid(CHostage *const this); // 419
|
||||
// }
|
||||
// }
|
||||
// GetRoundElapsedTime(CCareerTaskManager *const this); // 515
|
||||
// {
|
||||
// int hostages; // 494
|
||||
// class CBaseEntity *hostageEntity; // 495
|
||||
// {
|
||||
// class CHostage *hostage; // 499
|
||||
// IsDead(CHostage *const this); // 500
|
||||
// }
|
||||
// }
|
||||
// {
|
||||
// int hostages; // 460
|
||||
// class CBaseEntity *hostageEntity; // 461
|
||||
// {
|
||||
// class CHostage *hostage; // 465
|
||||
// IsValid(CHostage *const this); // 466
|
||||
// }
|
||||
// SendPartialNotification(CCareerTask *const this); // 476
|
||||
// }
|
||||
// SendPartialNotification(CCareerTask *const this); // 535
|
||||
// SendPartialNotification(CCareerTask *const this); // 611
|
||||
// MESSAGE_BEGIN(int msg_dest,
|
||||
// int msg_type,
|
||||
// const float *pOrigin,
|
||||
// edict_t *ed); // 545
|
||||
// GetRoundElapsedTime(CCareerTaskManager *const this); // 559
|
||||
// SetFinishedTaskTime(CCareerTaskManager *const this,
|
||||
// int val); // 559
|
||||
// SendPartialNotification(CCareerTask *const this); // 571
|
||||
// MESSAGE_BEGIN(int msg_dest,
|
||||
// int msg_type,
|
||||
// const float *pOrigin,
|
||||
// edict_t *ed); // 587
|
||||
// GetRoundElapsedTime(CCareerTaskManager *const this); // 596
|
||||
// SetFinishedTaskTime(CCareerTaskManager *const this,
|
||||
// int val); // 596
|
||||
if (m_isComplete)
|
||||
return;
|
||||
|
||||
if (event == m_event)
|
||||
{
|
||||
if ((m_defuser && !pAttacker->m_bIsDefusing) || (m_vip && !pAttacker->m_bIsVIP))
|
||||
return;
|
||||
|
||||
if (m_rescuer)
|
||||
{
|
||||
int hostages_ = 0;
|
||||
CBaseEntity *hostageEntity = NULL;
|
||||
|
||||
while ((hostageEntity = UTIL_FindEntityByClassname(hostageEntity, "hostage_entity")) != NULL)
|
||||
{
|
||||
CHostage *hostage = (CHostage *)hostageEntity;
|
||||
|
||||
if (!hostage || hostage->pev->takedamage != DAMAGE_YES)
|
||||
continue;
|
||||
|
||||
if (hostage->m_improv)
|
||||
{
|
||||
if (!hostage->IsFollowingSomeone())
|
||||
continue;
|
||||
}
|
||||
else if (!hostage->m_hTargetEnt || hostage->m_State != CHostage::FOLLOW)
|
||||
continue;
|
||||
|
||||
if (hostage->IsValid() && hostage->m_target == pAttacker)
|
||||
++hostages_;
|
||||
}
|
||||
|
||||
if (!hostages_)
|
||||
return;
|
||||
}
|
||||
|
||||
if ((m_event != EVENT_KILL || (!m_weaponId && !m_weaponClassId))
|
||||
&& (m_event != EVENT_HEADSHOT || (!m_weaponId && !m_weaponClassId))
|
||||
&& (m_event != EVENT_PLAYER_TOOK_DAMAGE || (!m_weaponId && !m_weaponClassId)))
|
||||
{
|
||||
|
||||
if (m_event == EVENT_ROUND_WIN)
|
||||
{
|
||||
if (!Q_strcmp(m_name, "defendhostages"))
|
||||
{
|
||||
int hostages_ = 0;
|
||||
CBaseEntity *hostageEntity = NULL;
|
||||
|
||||
while ((hostageEntity = UTIL_FindEntityByClassname(hostageEntity, "hostage_entity")) != NULL)
|
||||
{
|
||||
CHostage *hostage = (CHostage *)hostageEntity;
|
||||
|
||||
if (!hostage || hostage->IsValid())
|
||||
continue;
|
||||
|
||||
if (hostage->pev->deadflag != DEAD_DEAD)
|
||||
++hostages_;
|
||||
}
|
||||
|
||||
if (!hostages_)
|
||||
{
|
||||
++m_eventsSeen;
|
||||
SendPartialNotification();
|
||||
}
|
||||
}
|
||||
else if (!Q_strcmp(m_name, "hostagessurvive"))
|
||||
{
|
||||
int hostages_ = 0;
|
||||
CBaseEntity *hostageEntity = NULL;
|
||||
|
||||
while ((hostageEntity = UTIL_FindEntityByClassname(hostageEntity, "hostage_entity")) != NULL)
|
||||
{
|
||||
CHostage *hostage = (CHostage *)hostageEntity;
|
||||
|
||||
if (hostage && hostage->IsDead())
|
||||
++hostages_;
|
||||
}
|
||||
|
||||
if (!hostages_)
|
||||
{
|
||||
++m_eventsSeen;
|
||||
SendPartialNotification();
|
||||
}
|
||||
}
|
||||
else if (!Q_strcmp(m_name, "winfast"))
|
||||
{
|
||||
if (m_eventsNeeded >= (int)TheCareerTasks->GetRoundElapsedTime())
|
||||
{
|
||||
m_eventsSeen = m_eventsNeeded;
|
||||
SendPartialNotification();
|
||||
}
|
||||
}
|
||||
else if (IsTaskCompletableThisRound())
|
||||
SendPartialNotification();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (event == m_event && !m_mustLive && (m_eventsSeen >= m_eventsNeeded) && IsTaskCompletableThisRound())
|
||||
{
|
||||
CBasePlayer *player = UTIL_GetLocalPlayer();
|
||||
EMIT_SOUND(ENT(player->pev), CHAN_VOICE, "events/task_complete.wav", VOL_NORM, ATTN_NORM);
|
||||
m_isComplete = true;
|
||||
|
||||
MESSAGE_BEGIN(MSG_ALL, gmsgCZCareer);
|
||||
WRITE_STRING("TASKDONE");
|
||||
WRITE_BYTE(m_id);
|
||||
MESSAGE_END();
|
||||
|
||||
if (TheTutor)
|
||||
TheTutor->OnEvent(EVENT_CAREER_TASK_DONE);
|
||||
|
||||
UTIL_LogPrintf("Career Task Done %d\n", m_id);
|
||||
|
||||
if (m_event == EVENT_ROUND_WIN && !Q_strcmp(m_name, "winfast"))
|
||||
{
|
||||
TheCareerTasks->SetFinishedTaskTime( TheCareerTasks->GetRoundElapsedTime() );
|
||||
player->SyncRoundTimer();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
else if (event >= EVENT_ROUND_DRAW)
|
||||
{
|
||||
if (event > EVENT_ROUND_LOSS)
|
||||
{
|
||||
if (event == EVENT_DIE && (m_mustLive || m_crossRounds))
|
||||
{
|
||||
m_eventsSeen = 0;
|
||||
SendPartialNotification();
|
||||
m_diedThisRound = true;
|
||||
}
|
||||
}
|
||||
else if (m_mustLive)
|
||||
{
|
||||
CBasePlayer *player = UTIL_GetLocalPlayer();
|
||||
|
||||
if (m_eventsSeen >= m_eventsNeeded && !m_diedThisRound && IsTaskCompletableThisRound())
|
||||
{
|
||||
EMIT_SOUND(ENT(player->pev), CHAN_VOICE, "events/task_complete.wav", VOL_NORM, ATTN_NORM);
|
||||
|
||||
m_isComplete = true;
|
||||
MESSAGE_BEGIN(MSG_ALL, gmsgCZCareer);
|
||||
WRITE_STRING("TASKDONE");
|
||||
WRITE_BYTE(m_id);
|
||||
MESSAGE_END();
|
||||
|
||||
UTIL_LogPrintf("Career Task Done %d\n", m_id);
|
||||
|
||||
if (m_event == EVENT_ROUND_WIN && !Q_strcmp(m_name, "winfast"))
|
||||
{
|
||||
TheCareerTasks->SetFinishedTaskTime( TheCareerTasks->GetRoundElapsedTime() );
|
||||
player->SyncRoundTimer();
|
||||
}
|
||||
|
||||
if (TheTutor)
|
||||
TheTutor->OnEvent(EVENT_CAREER_TASK_DONE);
|
||||
}
|
||||
|
||||
m_diedThisRound = false;
|
||||
if (m_mustLive)
|
||||
{
|
||||
m_eventsSeen = 0;
|
||||
SendPartialNotification();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* <1efeed> ../cstrike/dlls/career_tasks.cpp:623 */
|
||||
NOBODY void CCareerTaskManager::Create(void)
|
||||
void CCareerTaskManager::Create(void)
|
||||
{
|
||||
// CCareerTaskManager(CCareerTaskManager *const this); // 631
|
||||
if (TheCareerTasks != NULL)
|
||||
{
|
||||
TheCareerTasks->Reset();
|
||||
return;
|
||||
}
|
||||
|
||||
TheCareerTasks = new CCareerTaskManager;
|
||||
}
|
||||
|
||||
/* <1eff77> ../cstrike/dlls/career_tasks.cpp:636 */
|
||||
NOBODY CCareerTaskManager::CCareerTaskManager(void)
|
||||
CCareerTaskManager::CCareerTaskManager(void)
|
||||
{
|
||||
// list(list<CCareerTask*, std::allocator<CCareerTask*>> *const this); // 636
|
||||
m_taskTime = 0;
|
||||
Reset();
|
||||
}
|
||||
|
||||
/* <1effeb> ../cstrike/dlls/career_tasks.cpp:643 */
|
||||
NOBODY void CCareerTaskManager::Reset(bool deleteTasks)
|
||||
void CCareerTaskManager::Reset(bool deleteTasks)
|
||||
{
|
||||
// {
|
||||
// CareerTaskListIt it; // 647
|
||||
// operator++(_List_iterator<CCareerTask*> *const this); // 647
|
||||
// }
|
||||
// clear(list<CCareerTask*, std::allocator<CCareerTask*>> *const this); // 651
|
||||
// {
|
||||
// CareerTaskListIt it; // 656
|
||||
// {
|
||||
// class CCareerTask *pTask; // 658
|
||||
// }
|
||||
// operator++(_List_iterator<CCareerTask*> *const this); // 656
|
||||
// }
|
||||
if (deleteTasks)
|
||||
{
|
||||
for (CareerTaskListIt it = m_tasks.begin(); it != m_tasks.end(); ++it)
|
||||
{
|
||||
delete (*it);
|
||||
}
|
||||
|
||||
m_tasks.clear();
|
||||
m_nextId = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (CareerTaskListIt it = m_tasks.begin(); it != m_tasks.end(); ++it)
|
||||
{
|
||||
CCareerTask *pTask = (*it);
|
||||
pTask->Reset();
|
||||
}
|
||||
}
|
||||
|
||||
m_finishedTaskTime = 0;
|
||||
m_finishedTaskRound = 0;
|
||||
m_shouldLatchRoundEndMessage = false;
|
||||
|
||||
m_roundStartTime = gpGlobals->time + CVAR_GET_FLOAT("mp_freezetime");
|
||||
}
|
||||
|
||||
/* <1f014e> ../cstrike/dlls/career_tasks.cpp:671 */
|
||||
NOBODY void CCareerTaskManager::SetFinishedTaskTime(int val)
|
||||
void CCareerTaskManager::SetFinishedTaskTime(int val)
|
||||
{
|
||||
CHalfLifeMultiplay *mp = g_pGameRules;
|
||||
|
||||
@ -191,139 +483,198 @@ NOBODY void CCareerTaskManager::SetFinishedTaskTime(int val)
|
||||
}
|
||||
|
||||
/* <1f018b> ../cstrike/dlls/career_tasks.cpp:679 */
|
||||
NOBODY void CCareerTaskManager::AddTask(const char *taskName, const char *weaponName, int eventCount, bool mustLive, bool crossRounds, bool isComplete)
|
||||
void CCareerTaskManager::AddTask(const char *taskName, const char *weaponName, int eventCount, bool mustLive, bool crossRounds, bool isComplete)
|
||||
{
|
||||
// {
|
||||
// int i; // 683
|
||||
// push_back(list<CCareerTask*, std::allocator<CCareerTask*>> *const this,
|
||||
// const value_type &__x); // 696
|
||||
// }
|
||||
// MESSAGE_BEGIN(int msg_dest,
|
||||
// int msg_type,
|
||||
// const float *pOrigin,
|
||||
// edict_t *ed); // 714
|
||||
++m_nextId;
|
||||
|
||||
for (int i = 0; i < ARRAYSIZE(taskInfo); i++)
|
||||
{
|
||||
const TaskInfo *pTaskInfo = &taskInfo[ i ];
|
||||
|
||||
if (pTaskInfo->taskName != NULL)
|
||||
{
|
||||
if (!Q_stricmp(pTaskInfo->taskName, taskName))
|
||||
{
|
||||
CCareerTask *newTask = pTaskInfo->factory
|
||||
(
|
||||
pTaskInfo->taskName,
|
||||
pTaskInfo->event,
|
||||
weaponName,
|
||||
eventCount,
|
||||
mustLive,
|
||||
crossRounds,
|
||||
m_nextId,
|
||||
isComplete
|
||||
);
|
||||
|
||||
m_tasks.push_back(newTask);
|
||||
|
||||
if (pTaskInfo->event == EVENT_ROUND_WIN && Q_strcmp(taskName, "winfast"))
|
||||
{
|
||||
m_taskTime = eventCount;
|
||||
|
||||
if (isComplete)
|
||||
m_finishedTaskTime = eventCount;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MESSAGE_BEGIN(MSG_ALL, gmsgCZCareer);
|
||||
WRITE_STRING("TASKDONE");
|
||||
WRITE_BYTE(m_nextId);
|
||||
MESSAGE_END();
|
||||
}
|
||||
|
||||
/* <1f0381> ../cstrike/dlls/career_tasks.cpp:721 */
|
||||
NOBODY void CCareerTaskManager::HandleEvent(GameEventType event, CBasePlayer *pAttacker, CBasePlayer *pVictim)
|
||||
void CCareerTaskManager::HandleEvent(GameEventType event, CBasePlayer *pAttacker, CBasePlayer *pVictim)
|
||||
{
|
||||
// {
|
||||
// CareerTaskListIt it; // 741
|
||||
// operator++(_List_iterator<CCareerTask*> *const this); // 741
|
||||
// }
|
||||
if (event == EVENT_ROUND_START)
|
||||
m_roundStartTime = gpGlobals->time;
|
||||
|
||||
else if ((event <= EVENT_ROUND_LOSS && event >= EVENT_ROUND_DRAW) && m_shouldLatchRoundEndMessage)
|
||||
{
|
||||
m_roundEndMessage = event;
|
||||
return;
|
||||
}
|
||||
|
||||
for (CareerTaskListIt it = m_tasks.begin(); it != m_tasks.end(); ++it)
|
||||
{
|
||||
(*it)->OnEvent(event, pAttacker, pVictim);
|
||||
}
|
||||
}
|
||||
|
||||
/* <1f0462> ../cstrike/dlls/career_tasks.cpp:748 */
|
||||
NOBODY void CCareerTaskManager::HandleWeaponKill(int weaponId, int weaponClassId, bool headshot, bool killerHasShield, CBasePlayer *pAttacker, CBasePlayer *pVictim)
|
||||
void CCareerTaskManager::HandleWeaponKill(int weaponId, int weaponClassId, bool headshot, bool killerHasShield, CBasePlayer *pAttacker, CBasePlayer *pVictim)
|
||||
{
|
||||
// {
|
||||
// CareerTaskListIt it; // 750
|
||||
// operator++(_List_iterator<CCareerTask*> *const this); // 750
|
||||
// }
|
||||
for (CareerTaskListIt it = m_tasks.begin(); it != m_tasks.end(); ++it)
|
||||
{
|
||||
(*it)->OnWeaponKill(weaponId, weaponClassId, headshot, killerHasShield, pAttacker, pVictim);
|
||||
}
|
||||
}
|
||||
|
||||
/* <1f04ed> ../cstrike/dlls/career_tasks.cpp:757 */
|
||||
NOBODY void CCareerTaskManager::HandleEnemyKill(bool wasBlind, const char *weaponName, bool headshot, bool killerHasShield, CBasePlayer *pAttacker, CBasePlayer *pVictim)
|
||||
void CCareerTaskManager::HandleEnemyKill(bool wasBlind, const char *weaponName, bool headshot, bool killerHasShield, CBasePlayer *pAttacker, CBasePlayer *pVictim)
|
||||
{
|
||||
// HandleWeaponKill(CCareerTaskManager *const this,
|
||||
// int weaponId,
|
||||
// int weaponClassId,
|
||||
// bool headshot,
|
||||
// bool killerHasShield,
|
||||
// class CBasePlayer *pAttacker,
|
||||
// class CBasePlayer *pVictim); // 759
|
||||
// HandleEvent(CCareerTaskManager *const this,
|
||||
// enum GameEventType event,
|
||||
// class CBasePlayer *pAttacker,
|
||||
// class CBasePlayer *pVictim); // 760
|
||||
// HandleEvent(CCareerTaskManager *const this,
|
||||
// enum GameEventType event,
|
||||
// class CBasePlayer *pAttacker,
|
||||
// class CBasePlayer *pVictim); // 764
|
||||
// HandleEvent(CCareerTaskManager *const this,
|
||||
// enum GameEventType event,
|
||||
// class CBasePlayer *pAttacker,
|
||||
// class CBasePlayer *pVictim); // 762
|
||||
HandleWeaponKill(AliasToWeaponID(weaponName), AliasToWeaponClass(weaponName), headshot, killerHasShield, pAttacker, pVictim);
|
||||
|
||||
HandleEvent(EVENT_KILL, pAttacker, pVictim);
|
||||
|
||||
if (headshot)
|
||||
{
|
||||
HandleEvent(EVENT_HEADSHOT, pAttacker, pVictim);
|
||||
}
|
||||
if (wasBlind)
|
||||
{
|
||||
HandleEvent(EVENT_KILL_FLASHBANGED, pAttacker, pVictim);
|
||||
}
|
||||
}
|
||||
|
||||
/* <1f079c> ../cstrike/dlls/career_tasks.cpp:768 */
|
||||
NOBODY void CCareerTaskManager::HandleWeaponInjury(int weaponId, int weaponClassId, bool attackerHasShield, CBasePlayer *pAttacker)
|
||||
void CCareerTaskManager::HandleWeaponInjury(int weaponId, int weaponClassId, bool attackerHasShield, CBasePlayer *pAttacker)
|
||||
{
|
||||
// {
|
||||
// CareerTaskListIt it; // 770
|
||||
// operator++(_List_iterator<CCareerTask*> *const this); // 770
|
||||
// }
|
||||
for (CareerTaskListIt it = m_tasks.begin(); it != m_tasks.end(); ++it)
|
||||
{
|
||||
(*it)->OnWeaponInjury(weaponId, weaponClassId, attackerHasShield, pAttacker);
|
||||
}
|
||||
}
|
||||
|
||||
/* <1f0815> ../cstrike/dlls/career_tasks.cpp:777 */
|
||||
NOBODY void CCareerTaskManager::HandleEnemyInjury(const char *weaponName, bool attackerHasShield, CBasePlayer *pAttacker)
|
||||
void CCareerTaskManager::HandleEnemyInjury(const char *weaponName, bool attackerHasShield, CBasePlayer *pAttacker)
|
||||
{
|
||||
// HandleWeaponInjury(CCareerTaskManager *const this,
|
||||
// int weaponId,
|
||||
// int weaponClassId,
|
||||
// bool attackerHasShield,
|
||||
// class CBasePlayer *pAttacker); // 779
|
||||
// HandleEvent(CCareerTaskManager *const this,
|
||||
// enum GameEventType event,
|
||||
// class CBasePlayer *pAttacker,
|
||||
// class CBasePlayer *pVictim); // 780
|
||||
HandleWeaponInjury(AliasToWeaponID(weaponName), AliasToWeaponClass(weaponName), attackerHasShield, pAttacker);
|
||||
HandleEvent(EVENT_PLAYER_TOOK_DAMAGE);
|
||||
}
|
||||
|
||||
/* <1f094e> ../cstrike/dlls/career_tasks.cpp:784 */
|
||||
NOBODY void CCareerTaskManager::HandleDeath(int team, CBasePlayer *pAttacker)
|
||||
void CCareerTaskManager::HandleDeath(int team, CBasePlayer *pAttacker)
|
||||
{
|
||||
// {
|
||||
// int enemyTeam; // 786
|
||||
// int numEnemies; // 790
|
||||
// {
|
||||
// int i; // 791
|
||||
// {
|
||||
// class CBasePlayer *pPlayer; // 793
|
||||
// }
|
||||
// }
|
||||
// HandleEvent(CCareerTaskManager *const this,
|
||||
// enum GameEventType event,
|
||||
// class CBasePlayer *pAttacker,
|
||||
// class CBasePlayer *pVictim); // 801
|
||||
// }
|
||||
int enemyTeam = (Q_strcmp(humans_join_team.string, "CT") != 0) ? CT : TERRORIST;
|
||||
int numEnemies = 0;
|
||||
|
||||
if (enemyTeam != team)
|
||||
return;
|
||||
|
||||
for (int i = 1; i <= gpGlobals->maxClients; i++)
|
||||
{
|
||||
CBasePlayer *pPlayer = (CBasePlayer *)UTIL_PlayerByIndex( i );
|
||||
|
||||
if (pPlayer && pPlayer->m_iTeam == enemyTeam && pPlayer->IsAlive())
|
||||
++numEnemies;
|
||||
}
|
||||
|
||||
if (!numEnemies)
|
||||
{
|
||||
HandleEvent(EVENT_KILL_ALL);
|
||||
}
|
||||
}
|
||||
|
||||
/* <1f0a5d> ../cstrike/dlls/career_tasks.cpp:805 */
|
||||
NOBODY bool CCareerTaskManager::AreAllTasksComplete(void)
|
||||
bool CCareerTaskManager::AreAllTasksComplete(void)
|
||||
{
|
||||
// {
|
||||
// CareerTaskListIt it; // 807
|
||||
// operator++(_List_iterator<CCareerTask*> *const this); // 807
|
||||
// }
|
||||
for (CareerTaskListIt it = m_tasks.begin(); it != m_tasks.end(); ++it)
|
||||
{
|
||||
if (!(*it)->IsComplete())
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* <1f0abc> ../cstrike/dlls/career_tasks.cpp:818 */
|
||||
NOBODY int CCareerTaskManager::GetNumRemainingTasks(void)
|
||||
int CCareerTaskManager::GetNumRemainingTasks(void)
|
||||
{
|
||||
// {
|
||||
// int ret; // 820
|
||||
// {
|
||||
// CareerTaskListIt it; // 821
|
||||
// operator++(_List_iterator<CCareerTask*> *const this); // 821
|
||||
// }
|
||||
// }
|
||||
int ret = 0;
|
||||
for (CareerTaskListIt it = m_tasks.begin(); it != m_tasks.end(); ++it)
|
||||
{
|
||||
if (!(*it)->IsComplete())
|
||||
ret++;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* <1f0b33> ../cstrike/dlls/career_tasks.cpp:832 */
|
||||
float CCareerTaskManager::GetRoundElapsedTime(void)
|
||||
{
|
||||
return gpGlobals->time - m_roundStartTime;
|
||||
return (gpGlobals->time - m_roundStartTime);
|
||||
}
|
||||
|
||||
/* <1f0b56> ../cstrike/dlls/career_tasks.cpp:838 */
|
||||
NOBODY void CCareerTaskManager::LatchRoundEndMessage(void)
|
||||
void CCareerTaskManager::LatchRoundEndMessage(void)
|
||||
{
|
||||
m_shouldLatchRoundEndMessage = true;
|
||||
}
|
||||
|
||||
/* <1f0b81> ../cstrike/dlls/career_tasks.cpp:844 */
|
||||
NOBODY void CCareerTaskManager::UnlatchRoundEndMessage(void)
|
||||
void CCareerTaskManager::UnlatchRoundEndMessage(void)
|
||||
{
|
||||
// HandleEvent(CCareerTaskManager::UnlatchRoundEndMessage(// enum GameEventType event,
|
||||
// class CBasePlayer *pAttacker,
|
||||
// class CBasePlayer *pVictim); // 847
|
||||
m_shouldLatchRoundEndMessage = false;
|
||||
HandleEvent(m_roundEndMessage);
|
||||
}
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
||||
void CCareerTask::OnEvent(GameEventType event, CBasePlayer *pAttacker, CBasePlayer *pVictim)
|
||||
{
|
||||
OnEvent_(event, pAttacker, pVictim);
|
||||
}
|
||||
|
||||
void CCareerTask::Reset(void)
|
||||
{
|
||||
Reset_();
|
||||
}
|
||||
|
||||
void CPreventDefuseTask::OnEvent(GameEventType event, CBasePlayer *pAttacker, CBasePlayer *pVictim)
|
||||
{
|
||||
OnEvent_(event, pAttacker, pVictim);
|
||||
}
|
||||
|
||||
void CPreventDefuseTask::Reset(void)
|
||||
{
|
||||
Reset_();
|
||||
}
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
@ -44,9 +44,21 @@ public:
|
||||
virtual void OnEvent(GameEventType event, CBasePlayer *pAttacker, CBasePlayer *pVictim);
|
||||
virtual void Reset(void);
|
||||
virtual bool IsTaskCompletableThisRound(void)
|
||||
{
|
||||
return IsTaskCompletableThisRound_();
|
||||
}
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
||||
void OnEvent_(GameEventType event, CBasePlayer *pAttacker, CBasePlayer *pVictim);
|
||||
void Reset_(void);
|
||||
bool IsTaskCompletableThisRound_(void)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
public:
|
||||
|
||||
static CCareerTask *NewTask(const char *taskName, GameEventType event, const char *weaponName, int n, bool mustLive, bool crossRounds, int id, bool isComplete);
|
||||
@ -70,7 +82,10 @@ public:
|
||||
{
|
||||
return m_weaponClassId;
|
||||
}
|
||||
bool IsValidFor(CBasePlayer *pPlayer);
|
||||
bool IsValidFor(CBasePlayer *pPlayer)//!
|
||||
{
|
||||
return true;
|
||||
}
|
||||
void SendPartialNotification(void);
|
||||
|
||||
private:
|
||||
@ -105,13 +120,13 @@ public:
|
||||
public:
|
||||
static void Create(void);
|
||||
|
||||
void Reset(bool deleteTasks);
|
||||
void Reset(bool deleteTasks = true);
|
||||
void AddTask(const char *taskName, const char *weaponName, int eventCount, bool mustLive, bool crossRounds, bool isComplete);
|
||||
|
||||
void HandleEvent(GameEventType event, class CBasePlayer *pAttacker, CBasePlayer *pVictim);
|
||||
void HandleEvent(GameEventType event, CBasePlayer *pAttacker = NULL, CBasePlayer *pVictim = NULL);
|
||||
void HandleEnemyKill(bool wasBlind, const char *weaponName, bool headshot, bool killerHasShield, CBasePlayer *pAttacker, CBasePlayer *pVictim);
|
||||
void HandleWeaponKill(int weaponId, int weaponClassId, bool headshot, bool killerHasShield, CBasePlayer *pAttacker, CBasePlayer *pVictim);
|
||||
void HandleDeath(int team, CBasePlayer *pAttacker);
|
||||
void HandleDeath(int team, CBasePlayer *pAttacker = NULL);
|
||||
void HandleWeaponInjury(int weaponId, int weaponClassId, bool attackerHasShield, CBasePlayer *pAttacker);
|
||||
void HandleEnemyInjury(const char *weaponName, bool attackerHasShield, CBasePlayer *pAttacker);
|
||||
|
||||
@ -123,7 +138,6 @@ public:
|
||||
return m_taskTime;
|
||||
}
|
||||
void SetFinishedTaskTime(int val);
|
||||
|
||||
int GetFinishedTaskTime(void)
|
||||
{
|
||||
return m_finishedTaskTime;
|
||||
@ -136,7 +150,6 @@ public:
|
||||
{
|
||||
return &m_tasks;
|
||||
}
|
||||
|
||||
void LatchRoundEndMessage(void);
|
||||
void UnlatchRoundEndMessage(void);
|
||||
|
||||
@ -159,7 +172,7 @@ private:
|
||||
|
||||
};/* size: 36, cachelines: 1, members: 8 */
|
||||
|
||||
typedef CCareerTask *(*TaskFactoryFunction)(const char *, GameEventType, const char *, int, bool, bool, int, bool);
|
||||
typedef CCareerTask *(*TaskFactoryFunction)(const char *taskName, GameEventType event, const char *weaponName, int eventCount, bool mustLive, bool crossRounds, int nextId, bool isComplete);
|
||||
|
||||
struct TaskInfo
|
||||
{
|
||||
@ -178,10 +191,21 @@ public:
|
||||
virtual void OnEvent(GameEventType event, CBasePlayer *pAttacker, CBasePlayer *pVictim);
|
||||
virtual void Reset(void);
|
||||
virtual bool IsTaskCompletableThisRound(void)
|
||||
{
|
||||
return IsTaskCompletableThisRound_();
|
||||
}
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
||||
void OnEvent_(GameEventType event, CBasePlayer *pAttacker, CBasePlayer *pVictim);
|
||||
void Reset_(void);
|
||||
bool IsTaskCompletableThisRound_(void)
|
||||
{
|
||||
return m_bombPlantedThisRound && !m_defuseStartedThisRound;
|
||||
}
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
public:
|
||||
static CCareerTask *NewTask(const char *taskName, GameEventType event, const char *weaponName, int n, bool mustLive, bool crossRounds, int id, bool isComplete);
|
||||
|
||||
@ -194,9 +218,11 @@ protected:
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
||||
#define TheCareerTasks (*pTheCareerTasks)
|
||||
#define taskInfo (*ptaskInfo)
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
extern CCareerTaskManager *TheCareerTasks;
|
||||
extern const TaskInfo taskInfo[21];
|
||||
|
||||
#endif // CAREER_TASK_H
|
||||
|
@ -744,11 +744,30 @@ NOBODY int CBaseEntity::IsDormant(void)
|
||||
}
|
||||
|
||||
/* <30221> ../cstrike/dlls/cbase.cpp:1069 */
|
||||
NOBODY BOOL CBaseEntity::IsInWorld_(void)
|
||||
BOOL CBaseEntity::IsInWorld_(void)
|
||||
{
|
||||
// position
|
||||
if (pev->origin.x >= 4096.0 || pev->origin.y >= 4096.0 || pev->origin.z >= 4096.0)
|
||||
{
|
||||
// IsInWorld(CBaseEntity *const this); // 1069
|
||||
return FALSE;
|
||||
}
|
||||
if (pev->origin.x <= -4096.0 || pev->origin.y <= -4096.0 || pev->origin.z <= -4096.0)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// speed
|
||||
if (pev->velocity.x >= 2000.0 || pev->velocity.y >= 2000.0 || pev->velocity.z >= 2000.0)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (pev->velocity.x <= -2000.0 || pev->velocity.y <= -2000.0 || pev->velocity.z <= -2000.0)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* <31c8c> ../cstrike/dlls/cbase.cpp:1089 */
|
||||
int CBaseEntity::ShouldToggle(USE_TYPE useType, BOOL currentState)
|
||||
|
@ -137,8 +137,9 @@
|
||||
|
||||
#define SF_NORESPAWN (1 << 30)
|
||||
|
||||
#define PARALYZE_DURATION 2
|
||||
#define PARALYZE_DAMAGE 1.0f
|
||||
#define AIRTIME 12 // lung full of air lasts this many seconds
|
||||
#define PARALYZE_DURATION 2 // number of 2 second intervals to take damage
|
||||
#define PARALYZE_DAMAGE 1.0f // damage to take each 2 second interval
|
||||
|
||||
#define NERVEGAS_DURATION 2
|
||||
#define NERVEGAS_DAMAGE 5.0f
|
||||
@ -349,8 +350,11 @@ public:
|
||||
{
|
||||
return CLASS_NONE;
|
||||
}
|
||||
virtual void DeathNotice(entvars_t *pevChild) {}
|
||||
NOBODY virtual void TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType);
|
||||
virtual void DeathNotice(entvars_t *pevChild)
|
||||
{
|
||||
return DeathNotice_(pevChild);
|
||||
}
|
||||
virtual void TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType);
|
||||
NOBODY virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
|
||||
virtual int TakeHealth(float flHealth, int bitsDamageType);
|
||||
NOBODY virtual void Killed(entvars_t *pevAttacker, int iGib);
|
||||
@ -373,25 +377,25 @@ public:
|
||||
}
|
||||
virtual int GetToggleState(void)
|
||||
{
|
||||
return TS_AT_TOP;
|
||||
return GetToggleState_();
|
||||
}
|
||||
virtual void AddPoints(int score, BOOL bAllowNegativeScore) {}
|
||||
virtual void AddPointsToTeam(int score, BOOL bAllowNegativeScore) {}
|
||||
virtual void AddPoints(int score, BOOL bAllowNegativeScore) {} // __stdcall
|
||||
virtual void AddPointsToTeam(int score, BOOL bAllowNegativeScore) {} // __stdcall
|
||||
virtual BOOL AddPlayerItem(CBasePlayerItem *pItem)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
virtual BOOL RemovePlayerItem(CBasePlayerItem *pItem)
|
||||
virtual BOOL RemovePlayerItem(CBasePlayerItem *pItem) // __stdcall
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
virtual int GiveAmmo(int iAmount, char *szName, int iMax)
|
||||
virtual int GiveAmmo(int iAmount, char *szName, int iMax) // __stdcall
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
virtual float GetDelay(void)
|
||||
{
|
||||
return 0.0f;
|
||||
return GetDelay_();
|
||||
}
|
||||
virtual int IsMoving(void)
|
||||
{
|
||||
@ -426,7 +430,7 @@ public:
|
||||
{
|
||||
return FStrEq(STRING(targetname),STRING(pev->targetname));
|
||||
}
|
||||
NOBODY virtual BOOL IsInWorld(void);
|
||||
virtual BOOL IsInWorld(void);
|
||||
virtual BOOL IsPlayer(void)
|
||||
{
|
||||
return FALSE;
|
||||
@ -483,19 +487,48 @@ public:
|
||||
}
|
||||
virtual Vector BodyTarget(const Vector &posSrc)
|
||||
{
|
||||
return Center();
|
||||
return BodyTarget_(posSrc);
|
||||
}
|
||||
virtual int Illumination(void)
|
||||
{
|
||||
return GETENTITYILLUM(ENT(pev));
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
NOBODY virtual BOOL FVisible(Vector &vecOrigin);
|
||||
NOBODY virtual BOOL FVisible(CBaseEntity *pEntity);
|
||||
#else
|
||||
NOBODY virtual BOOL FVisible(CBaseEntity *pEntity);
|
||||
NOBODY virtual BOOL FVisible(Vector &vecOrigin);
|
||||
#endif // _WIN32
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
||||
int Save_(CSave &save);
|
||||
int Restore_(CRestore &restore);
|
||||
void DeathNotice_(entvars_t *pevChild) { }
|
||||
void TraceAttack_(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType);
|
||||
int TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
|
||||
int TakeHealth_(float flHealth, int bitsDamageType);
|
||||
void Killed_(entvars_t *pevAttacker, int iGib);
|
||||
void TraceBleed_(float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType);
|
||||
int GetToggleState_(void)
|
||||
{
|
||||
return TS_AT_TOP;
|
||||
}
|
||||
float GetDelay_(void)
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
int DamageDecal_(int bitsDamageType);
|
||||
BOOL IsInWorld_(void);
|
||||
CBaseEntity *GetNextTarget_(void);
|
||||
Vector BodyTarget_(const Vector &posSrc)
|
||||
{
|
||||
return Center();
|
||||
}
|
||||
BOOL FVisible_(CBaseEntity *pEntity);
|
||||
BOOL FVisible_(Vector &vecOrigin);
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
@ -533,9 +566,9 @@ public:
|
||||
{
|
||||
return (CBaseEntity *)GET_PRIVATE(pent ? pent : ENT(0));
|
||||
}
|
||||
static CBaseEntity *Instance(entvars_t *pevit)
|
||||
static CBaseEntity *Instance(entvars_t *pev)
|
||||
{
|
||||
return Instance(ENT(pevit));
|
||||
return Instance(ENT(pev));
|
||||
}
|
||||
static CBaseEntity *Instance(int offset)
|
||||
{
|
||||
@ -614,21 +647,6 @@ public:
|
||||
int m_iSwing;
|
||||
bool has_disconnected;
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
||||
void TraceAttack_(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType);
|
||||
int TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
|
||||
int TakeHealth_(float flHealth, int bitsDamageType);
|
||||
void Killed_(entvars_t *pevAttacker, int iGib);
|
||||
void TraceBleed_(float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType);
|
||||
int DamageDecal_(int bitsDamageType);
|
||||
BOOL IsInWorld_(void);
|
||||
CBaseEntity *GetNextTarget_(void);
|
||||
BOOL FVisible_(CBaseEntity *pEntity);
|
||||
BOOL FVisible_(Vector &vecOrigin);
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
};/* size: 152, cachelines: 3, members: 35 */
|
||||
|
||||
/* <48d2a5> ../cstrike/dlls/cbase.h:273 */
|
||||
@ -752,7 +770,7 @@ public:
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
public:
|
||||
NOBODY float StudioFrameAdvance(float flInterval = 0.0f);
|
||||
float StudioFrameAdvance(float flInterval = 0.0f);
|
||||
BOOL GetSequenceFlags(void);
|
||||
int LookupActivity(int activity);
|
||||
NOBODY int LookupActivityHeaviest(int activity);
|
||||
@ -1041,10 +1059,13 @@ public:
|
||||
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1];
|
||||
|
||||
int m_preset;
|
||||
|
||||
};/* size: 156, cachelines: 3, members: 3 */
|
||||
|
||||
template <class T> T *GetClassPtr(T *a)
|
||||
template <class T>
|
||||
T *GetClassPtr(T *a)
|
||||
{
|
||||
T *backup = a;
|
||||
entvars_t *pev = (entvars_t *)a;
|
||||
if (!pev)
|
||||
pev = VARS(CREATE_ENTITY());
|
||||
@ -1053,6 +1074,11 @@ template <class T> T *GetClassPtr(T *a)
|
||||
{
|
||||
a = new(pev) T;
|
||||
a->pev = pev;
|
||||
|
||||
#if defined(_WIN32) && !defined(REGAMEDLL_UNIT_TESTS)
|
||||
VirtualTableInit((void *)a, stripClass(typeid(T).name()));
|
||||
#endif // _WIN32 && HOOK_GAMEDLL
|
||||
|
||||
}
|
||||
return a;
|
||||
}
|
||||
@ -1102,5 +1128,6 @@ typedef CBaseEntity *(CBaseEntity::*CBASE_ISTANCE_INT)(int);
|
||||
|
||||
//Refs
|
||||
extern int (*pDispatchSpawn)(edict_t *);
|
||||
extern void (*pCGib__SpawnHeadGib)(void);
|
||||
|
||||
#endif // CBASE_H
|
||||
|
@ -78,6 +78,18 @@
|
||||
#define DATA_IUSER3_INBOMBZONE (1<<2)
|
||||
#define DATA_IUSER3_HOLDINGSHIELD (1<<3)
|
||||
|
||||
#define VGUI_MENU_TEAM 2
|
||||
#define VGUI_MENU_MAPBRIEFING 4
|
||||
#define VGUI_MENU_CLASS_T 26
|
||||
#define VGUI_MENU_CLASS_CT 27
|
||||
#define VGUI_MENU_BUY 28
|
||||
#define VGUI_MENU_BUY_PISTOL 29
|
||||
#define VGUI_MENU_BUY_SHOTGUN 30
|
||||
#define VGUI_MENU_BUY_RIFLE 31
|
||||
#define VGUI_MENU_BUY_SUBMACHINEGUN 32
|
||||
#define VGUI_MENU_BUY_MACHINEGUN 33
|
||||
#define VGUI_MENU_BUY_ITEM 34
|
||||
|
||||
#define MAX_AMMO_TYPES 32 // ???
|
||||
#define MAX_AMMO_SLOTS 32 // not really slots
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
//float g_flTimeLimit = 0;
|
||||
//float g_flResetTime = 0;
|
||||
//bool g_bClientPrintEnable = true;
|
||||
bool g_bClientPrintEnable = true;
|
||||
|
||||
char *sPlayerModelFiles[] =
|
||||
{
|
||||
@ -58,11 +58,13 @@ static entity_field_alias_t custom_entity_field_alias[] =
|
||||
{ "animtime", 0 },
|
||||
}
|
||||
|
||||
static int g_serveractive = 0;
|
||||
|
||||
#else
|
||||
|
||||
//float g_flTimeLimit;
|
||||
//float g_flResetTime;
|
||||
//bool g_bClientPrintEnable;
|
||||
bool g_bClientPrintEnable;
|
||||
|
||||
char *sPlayerModelFiles[12];
|
||||
bool g_skipCareerInitialSpawn;
|
||||
@ -70,6 +72,7 @@ bool g_skipCareerInitialSpawn;
|
||||
entity_field_alias_t entity_field_alias[6];
|
||||
entity_field_alias_t player_field_alias[3];
|
||||
entity_field_alias_t custom_entity_field_alias[9];
|
||||
int g_serveractive;
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
@ -78,51 +81,120 @@ unsigned short m_usResetDecals;
|
||||
unsigned short g_iShadowSprite;
|
||||
|
||||
/* <47b45> ../cstrike/dlls/client.cpp:76 */
|
||||
NOBODY int CMD_ARGC_(void)
|
||||
NOXREF int CMD_ARGC_(void)
|
||||
{
|
||||
// {
|
||||
// int i; // 80
|
||||
// }
|
||||
UNTESTED
|
||||
|
||||
if (!UseBotArgs)
|
||||
return CMD_ARGC();
|
||||
|
||||
int i = 0;
|
||||
|
||||
while (BotArgs[i])
|
||||
i++;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
/* <47b84> ../cstrike/dlls/client.cpp:90 */
|
||||
NOBODY const char *CMD_ARGV_(int i)
|
||||
NOXREF const char *CMD_ARGV_(int i)
|
||||
{
|
||||
UNTESTED
|
||||
|
||||
if (!UseBotArgs)
|
||||
return CMD_ARGV(i);
|
||||
|
||||
if (i < 4)
|
||||
return BotArgs[i];
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* <47eac> ../cstrike/dlls/client.cpp:180 */
|
||||
NOBODY void set_suicide_frame(entvars_t *pev)
|
||||
NOXREF void set_suicide_frame(entvars_t *pev)
|
||||
{
|
||||
// FStrEq(const char *sz1,
|
||||
// const char *sz2); // 182
|
||||
if (!FStrEq(STRING(pev->model), "models/player.mdl"))
|
||||
return;
|
||||
|
||||
pev->solid = SOLID_NOT;
|
||||
pev->movetype = MOVETYPE_TOSS;
|
||||
pev->deadflag = DEAD_DEAD;
|
||||
pev->nextthink = -1;
|
||||
}
|
||||
|
||||
/* <47a58> ../cstrike/dlls/client.cpp:192 */
|
||||
NOBODY inline void TeamChangeUpdate(CBasePlayer *player, int team_id)
|
||||
NOXREF void TeamChangeUpdate(CBasePlayer *player, int team_id)
|
||||
{
|
||||
UNTESTED
|
||||
|
||||
// {
|
||||
// int t; // 194
|
||||
// }
|
||||
MESSAGE_BEGIN(MSG_ALL, gmsgTeamInfo);
|
||||
WRITE_BYTE(player->entindex());
|
||||
switch (team_id)
|
||||
{
|
||||
case CT:
|
||||
WRITE_STRING("CT");
|
||||
break;
|
||||
case TERRORIST:
|
||||
WRITE_STRING("TERRORIST");
|
||||
break;
|
||||
case SPECTATOR:
|
||||
WRITE_STRING("SPECTATOR");
|
||||
break;
|
||||
default:
|
||||
WRITE_STRING("UNASSIGNED");
|
||||
break;
|
||||
}
|
||||
MESSAGE_END();
|
||||
|
||||
if (team_id != UNASSIGNED)
|
||||
player->SetScoreboardAttributes();
|
||||
}
|
||||
|
||||
/* <4731f> ../cstrike/dlls/client.cpp:222 */
|
||||
NOBODY inline void BlinkAccount(CBasePlayer *player, int numBlinks)
|
||||
NOXREF void BlinkAccount(CBasePlayer *player, int numBlinks)
|
||||
{
|
||||
MESSAGE_BEGIN(MSG_ONE, gmsgBlinkAcct, NULL, player->pev);
|
||||
WRITE_BYTE(numBlinks);
|
||||
MESSAGE_END();
|
||||
}
|
||||
|
||||
/* <47efd> ../cstrike/dlls/client.cpp:236 */
|
||||
NOBODY BOOL ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char *szRejectReason)
|
||||
BOOL ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char *szRejectReason)
|
||||
{
|
||||
return g_pGameRules->ClientConnected(pEntity, pszName, pszAddress, szRejectReason);
|
||||
}
|
||||
|
||||
/* <47f5b> ../cstrike/dlls/client.cpp:255 */
|
||||
NOBODY void ClientDisconnect(edict_t *pEntity)
|
||||
void ClientDisconnect(edict_t *pEntity)
|
||||
{
|
||||
// {
|
||||
// class CBasePlayer *pPlayer; // 257
|
||||
// class CSound *pSound; // 276
|
||||
// Instance(edict_t *pent); // 257
|
||||
// }
|
||||
CBasePlayer *pPlayer = (CBasePlayer *)CBaseEntity::Instance(pEntity);
|
||||
|
||||
if (!g_fGameOver)
|
||||
{
|
||||
UTIL_ClientPrintAll(HUD_PRINTNOTIFY, "#Game_disconnected", STRING(pEntity->v.netname));
|
||||
CSound *pSound = CSoundEnt::SoundPointerForIndex(CSoundEnt::ClientSoundIndex(pEntity));
|
||||
|
||||
if (pSound)
|
||||
pSound->Reset();
|
||||
|
||||
pEntity->v.takedamage = DAMAGE_NO;
|
||||
pEntity->v.solid = SOLID_NOT;
|
||||
pEntity->v.flags = FL_DORMANT;
|
||||
|
||||
if (pPlayer)
|
||||
pPlayer->SetThink(NULL);
|
||||
|
||||
UTIL_SetOrigin(&pEntity->v, pEntity->v.origin);
|
||||
g_pGameRules->ClientDisconnected(pEntity);
|
||||
}
|
||||
|
||||
if (pPlayer && pPlayer->IsBot())
|
||||
{
|
||||
TheBots->ClientDisconnect(pPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
/* <4c477> ../cstrike/dlls/client.cpp:306 */
|
||||
@ -148,90 +220,240 @@ void respawn(entvars_t *pev, BOOL fCopyCorpse)
|
||||
}
|
||||
|
||||
/* <48013> ../cstrike/dlls/client.cpp:347 */
|
||||
NOBODY void ClientKill(edict_t *pEntity)
|
||||
void ClientKill(edict_t *pEntity)
|
||||
{
|
||||
// {
|
||||
// entvars_t *pev; // 349
|
||||
// class CHalfLifeMultiplay *mp; // 350
|
||||
// class CBasePlayer *pl; // 352
|
||||
// Instance(entvars_t *pev); // 352
|
||||
// IsObserver(CBasePlayer *const this); // 354
|
||||
// }
|
||||
entvars_t *pev = &pEntity->v;
|
||||
CHalfLifeMultiplay *mp = g_pGameRules;
|
||||
CBasePlayer *pl = (CBasePlayer *)CBasePlayer::Instance(pev);
|
||||
|
||||
if (pl->IsObserver())
|
||||
return;
|
||||
|
||||
if (pl->m_iJoiningState != JOINED)
|
||||
return;
|
||||
|
||||
if (gpGlobals->time >= pl->m_fNextSuicideTime)
|
||||
{
|
||||
pl->m_LastHitGroup = 0;
|
||||
pl->m_fNextSuicideTime = gpGlobals->time + 1;
|
||||
pEntity->v.health = 0;
|
||||
pl->Killed(pev, GIB_NEVER);
|
||||
|
||||
if (mp->m_pVIP == pl)
|
||||
mp->m_iConsecutiveVIP = 10;
|
||||
}
|
||||
}
|
||||
|
||||
/* <47a8a> ../cstrike/dlls/client.cpp:379 */
|
||||
NOBODY void ShowMenu(CBasePlayer *pPlayer, int bitsValidSlots, int nDisplayTime, BOOL fNeedMore, char *pszText)
|
||||
void ShowMenu(CBasePlayer *pPlayer, int bitsValidSlots, int nDisplayTime, BOOL fNeedMore, char *pszText)
|
||||
{
|
||||
MESSAGE_BEGIN(MSG_ONE, gmsgShowMenu, NULL, pPlayer->pev);
|
||||
WRITE_SHORT(bitsValidSlots);
|
||||
WRITE_CHAR(nDisplayTime);
|
||||
WRITE_BYTE(fNeedMore);
|
||||
WRITE_STRING(pszText);
|
||||
MESSAGE_END();
|
||||
}
|
||||
|
||||
/* <4735f> ../cstrike/dlls/client.cpp:390 */
|
||||
NOBODY void ShowVGUIMenu(CBasePlayer *pPlayer, int MenuType, int BitMask, char *szOldMenu)
|
||||
void ShowVGUIMenu(CBasePlayer *pPlayer, int MenuType, int BitMask, char *szOldMenu)
|
||||
{
|
||||
if (pPlayer->m_bVGUIMenus || MenuType > VGUI_MENU_BUY_ITEM)
|
||||
{
|
||||
MESSAGE_BEGIN(MSG_ONE, gmsgVGUIMenu, NULL, pPlayer->pev);
|
||||
WRITE_BYTE(MenuType);
|
||||
WRITE_SHORT(BitMask);
|
||||
WRITE_CHAR(-1);
|
||||
WRITE_BYTE(0);
|
||||
WRITE_STRING(" ");
|
||||
MESSAGE_END();
|
||||
}
|
||||
else
|
||||
ShowMenu(pPlayer, BitMask, -1, 0, szOldMenu);
|
||||
}
|
||||
|
||||
/* <4c3c5> ../cstrike/dlls/client.cpp:414 */
|
||||
NOBODY int CountTeams(void)
|
||||
NOXREF int CountTeams(void)
|
||||
{
|
||||
// {
|
||||
// int iNumCT; // 416
|
||||
// int iNumTerrorist; // 416
|
||||
// class CBaseEntity *pPlayer; // 421
|
||||
// class CBasePlayer *player; // 422
|
||||
// edict(CBaseEntity *const this); // 425
|
||||
// FNullEnt(const edict_t *pent); // 425
|
||||
// }
|
||||
int iNumCT = 0, iNumTerrorist = 0;
|
||||
CBaseEntity *pPlayer = NULL;
|
||||
|
||||
while ((pPlayer = UTIL_FindEntityByClassname(pPlayer, "player")) != NULL)
|
||||
{
|
||||
if (FNullEnt(pPlayer->edict()))
|
||||
break;
|
||||
|
||||
CBasePlayer *player = GetClassPtr((CBasePlayer *)pPlayer->pev);
|
||||
|
||||
if (player->m_iTeam == UNASSIGNED)
|
||||
continue;
|
||||
|
||||
if (player->pev->flags & FL_DORMANT)
|
||||
continue;
|
||||
|
||||
if (player->m_iTeam == SPECTATOR)
|
||||
continue;
|
||||
|
||||
if (player->m_iTeam == CT)
|
||||
iNumCT++;
|
||||
|
||||
else if (player->m_iTeam == TERRORIST)
|
||||
iNumTerrorist++;
|
||||
}
|
||||
|
||||
return iNumCT - iNumTerrorist;
|
||||
}
|
||||
|
||||
/* <4c2be> ../cstrike/dlls/client.cpp:443 */
|
||||
NOBODY void ListPlayers(CBasePlayer *current)
|
||||
void ListPlayers(CBasePlayer *current)
|
||||
{
|
||||
// {
|
||||
// class CBaseEntity *pPlayer; // 445
|
||||
// class CBasePlayer *player; // 446
|
||||
// char message; // 447
|
||||
// char cNumber; // 448
|
||||
// int iUserID; // 449
|
||||
// edict(CBaseEntity *const this); // 454
|
||||
// FNullEnt(const edict_t *pent); // 454
|
||||
// edict(CBaseEntity *const this); // 460
|
||||
// }
|
||||
char message[120], cNumber[12];
|
||||
Q_strcpy(message, "");
|
||||
|
||||
CBaseEntity *pPlayer = NULL;
|
||||
while ((pPlayer = UTIL_FindEntityByClassname(pPlayer, "player")) != NULL)
|
||||
{
|
||||
if (FNullEnt(pPlayer->edict()))
|
||||
break;
|
||||
|
||||
if (pPlayer->pev->flags & FL_DORMANT)
|
||||
continue;
|
||||
|
||||
CBasePlayer *player = GetClassPtr((CBasePlayer *)pPlayer->pev);
|
||||
int iUserID = GETPLAYERUSERID(ENT(player->pev));
|
||||
|
||||
Q_sprintf(cNumber, "%d", iUserID);
|
||||
Q_strcpy(message, "\n");
|
||||
Q_strcat(message, cNumber);
|
||||
Q_strcat(message, " : ");
|
||||
Q_strcat(message, STRING(player->pev->netname));
|
||||
|
||||
ClientPrint(current->pev, HUD_PRINTCONSOLE, message);
|
||||
}
|
||||
|
||||
ClientPrint(current->pev, HUD_PRINTCONSOLE, "\n");
|
||||
}
|
||||
|
||||
/* <4c200> ../cstrike/dlls/client.cpp:475 */
|
||||
NOBODY int CountTeamPlayers(int iTeam)
|
||||
int CountTeamPlayers(int iTeam)
|
||||
{
|
||||
// {
|
||||
// class CBaseEntity *pPlayer; // 477
|
||||
// int i; // 478
|
||||
// }
|
||||
CBaseEntity *pPlayer = NULL;
|
||||
int i = 0;
|
||||
|
||||
while ((pPlayer = UTIL_FindEntityByClassname(pPlayer, "player")) != NULL)
|
||||
{
|
||||
if (FNullEnt(pPlayer->edict()))
|
||||
break;
|
||||
|
||||
if (pPlayer->pev->flags & FL_DORMANT)
|
||||
continue;
|
||||
|
||||
if (GetClassPtr((CBasePlayer *)pPlayer->pev)->m_iTeam == iTeam)
|
||||
i++;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
/* <4c4ef> ../cstrike/dlls/client.cpp:494 */
|
||||
NOBODY void ProcessKickVote(CBasePlayer *pVotingPlayer, CBasePlayer *pKickPlayer)
|
||||
void ProcessKickVote(CBasePlayer *pVotingPlayer, CBasePlayer *pKickPlayer)
|
||||
{
|
||||
// {
|
||||
// class CBaseEntity *pTempEntity; // 500
|
||||
// class CBasePlayer *pTempPlayer; // 501
|
||||
// int iValidVotes; // 502
|
||||
// int iVoteID; // 503
|
||||
// int iVotesNeeded; // 504
|
||||
// float fKickPercent; // 505
|
||||
// int iTeamCount; // 507
|
||||
// CountTeamPlayers(int iTeam); // 507
|
||||
// edict(CBaseEntity *const this); // 560
|
||||
// FNullEnt(const edict_t *pent); // 560
|
||||
// edict(CBaseEntity *const this); // 517
|
||||
// FNullEnt(const edict_t *pent); // 517
|
||||
// }
|
||||
CBaseEntity *pTempEntity;
|
||||
CBasePlayer *pTempPlayer;
|
||||
int iValidVotes;
|
||||
int iVoteID;
|
||||
int iVotesNeeded;
|
||||
float fKickPercent;
|
||||
|
||||
if (!pVotingPlayer || !pKickPlayer)
|
||||
return;
|
||||
|
||||
int iTeamCount = CountTeamPlayers(pVotingPlayer->m_iTeam);
|
||||
|
||||
if (iTeamCount < 3)
|
||||
return;
|
||||
|
||||
iValidVotes = 0;
|
||||
pTempEntity = NULL;
|
||||
iVoteID = pVotingPlayer->m_iCurrentKickVote;
|
||||
|
||||
while ((pTempEntity = UTIL_FindEntityByClassname(pTempEntity, "player")) != NULL)
|
||||
{
|
||||
if (FNullEnt(pTempEntity->edict()))
|
||||
break;
|
||||
|
||||
pTempPlayer = GetClassPtr((CBasePlayer *)pTempEntity->pev);
|
||||
|
||||
if (!pTempPlayer || pTempPlayer->m_iTeam == UNASSIGNED)
|
||||
continue;
|
||||
|
||||
if (pTempPlayer->m_iTeam == pVotingPlayer->m_iTeam && pTempPlayer->m_iCurrentKickVote == iVoteID)
|
||||
iValidVotes++;
|
||||
}
|
||||
|
||||
if (kick_percent.value < 0)
|
||||
CVAR_SET_STRING("mp_kickpercent", "0.0");
|
||||
|
||||
else if (kick_percent.value > 1)
|
||||
CVAR_SET_STRING("mp_kickpercent", "1.0");
|
||||
|
||||
iVotesNeeded = iValidVotes;
|
||||
fKickPercent = (iTeamCount * kick_percent.value + 0.5);
|
||||
|
||||
if (iVotesNeeded >= (int)fKickPercent)
|
||||
{
|
||||
UTIL_ClientPrintAll(HUD_PRINTCENTER, "#Game_kicked", STRING(pKickPlayer->pev->netname));
|
||||
SERVER_COMMAND(UTIL_VarArgs("kick # %d\n", iVoteID));
|
||||
pTempEntity = NULL;
|
||||
|
||||
while ((pTempEntity = UTIL_FindEntityByClassname(pTempEntity, "player")) != NULL)
|
||||
{
|
||||
if (FNullEnt(pTempEntity->edict()))
|
||||
break;
|
||||
|
||||
pTempPlayer = GetClassPtr((CBasePlayer *)pTempEntity->pev);
|
||||
|
||||
if (!pTempPlayer || pTempPlayer->m_iTeam == UNASSIGNED)
|
||||
continue;
|
||||
|
||||
if (pTempPlayer->m_iTeam == pVotingPlayer->m_iTeam && pTempPlayer->m_iCurrentKickVote == iVoteID)
|
||||
pTempPlayer->m_iCurrentKickVote = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* <48298> ../cstrike/dlls/client.cpp:580 */
|
||||
NOBODY TeamName SelectDefaultTeam(void)
|
||||
TeamName SelectDefaultTeam(void)
|
||||
{
|
||||
// {
|
||||
// enum TeamName team; // 582
|
||||
// class CHalfLifeMultiplay *mp; // 583
|
||||
// }
|
||||
TeamName team = UNASSIGNED;
|
||||
CHalfLifeMultiplay *mp = g_pGameRules;
|
||||
|
||||
if (mp->m_iNumTerrorist < mp->m_iNumCT)
|
||||
team = TERRORIST;
|
||||
else if (mp->m_iNumTerrorist > mp->m_iNumCT)
|
||||
team = CT;
|
||||
|
||||
else if (mp->m_iNumCTWins > mp->m_iNumTerroristWins)
|
||||
team = TERRORIST;
|
||||
|
||||
else if (mp->m_iNumCTWins < mp->m_iNumTerroristWins)
|
||||
team = CT;
|
||||
else
|
||||
team = RANDOM_LONG(0, 1) ? TERRORIST : CT;
|
||||
|
||||
if (mp->TeamFull(team))
|
||||
{
|
||||
if (team == TERRORIST)
|
||||
team = CT;
|
||||
else
|
||||
team = TERRORIST;
|
||||
|
||||
if (mp->TeamFull(team))
|
||||
return UNASSIGNED;
|
||||
}
|
||||
|
||||
return team;
|
||||
|
||||
}
|
||||
|
||||
/* <473a3> ../cstrike/dlls/client.cpp:638 */
|
||||
@ -246,31 +468,123 @@ void CheckStartMoney(void)
|
||||
}
|
||||
|
||||
/* <4c084> ../cstrike/dlls/client.cpp:661 */
|
||||
NOBODY void ClientPutInServer(edict_t *pEntity)
|
||||
void ClientPutInServer(edict_t *pEntity)
|
||||
{
|
||||
// {
|
||||
// class CBasePlayer *pPlayer; // 663
|
||||
// class CBaseEntity *Target; // 664
|
||||
// Vector CamAngles; // 665
|
||||
// class CHalfLifeMultiplay *mp; // 666
|
||||
// entvars_t *pev; // 668
|
||||
// char sName; // 777
|
||||
// CheckStartMoney(void); // 696
|
||||
// {
|
||||
// char *pApersand; // 781
|
||||
// }
|
||||
// operator-(const Vector *const this,
|
||||
// const Vector &v); // 761
|
||||
// Normalize(const Vector *const this); // 762
|
||||
// }
|
||||
entvars_t *pev = &pEntity->v;
|
||||
CBasePlayer *pPlayer = GetClassPtr((CBasePlayer *)pev);
|
||||
CHalfLifeMultiplay *mp = g_pGameRules;
|
||||
|
||||
pPlayer->SetCustomDecalFrames(-1);
|
||||
pPlayer->SetPrefsFromUserinfo(GET_INFO_BUFFER(pEntity));
|
||||
|
||||
if (!mp->IsMultiplayer())
|
||||
{
|
||||
pPlayer->Spawn();
|
||||
return;
|
||||
}
|
||||
|
||||
pPlayer->m_bNotKilled = true;
|
||||
pPlayer->m_iIgnoreGlobalChat = IGNOREMSG_NONE;
|
||||
pPlayer->m_iTeamKills = 0;
|
||||
pPlayer->m_bJustConnected = true;
|
||||
pPlayer->Spawn();
|
||||
pPlayer->m_bTeamChanged = false;
|
||||
pPlayer->m_iNumSpawns = 0;
|
||||
|
||||
CheckStartMoney();
|
||||
|
||||
pPlayer->m_iAccount = (int)startmoney.value;
|
||||
pPlayer->m_fGameHUDInitialized = FALSE;
|
||||
pPlayer->m_flDisplayHistory &= ~DHF_ROUND_STARTED;
|
||||
pPlayer->pev->flags |= FL_SPECTATOR;
|
||||
pPlayer->pev->solid = SOLID_NOT;
|
||||
pPlayer->pev->movetype = MOVETYPE_NOCLIP;
|
||||
pPlayer->pev->effects = EF_NODRAW;
|
||||
pPlayer->pev->effects |= EF_NOINTERP;
|
||||
pPlayer->pev->takedamage = DAMAGE_NO;
|
||||
pPlayer->pev->deadflag = DEAD_DEAD;
|
||||
pPlayer->pev->velocity = g_vecZero;
|
||||
pPlayer->pev->punchangle = g_vecZero;
|
||||
pPlayer->m_iJoiningState = READINGLTEXT;
|
||||
pPlayer->m_iTeam = UNASSIGNED;
|
||||
pPlayer->pev->fixangle = 1;
|
||||
pPlayer->m_iModelName = MODEL_URBAN;
|
||||
pPlayer->m_bContextHelp = true;
|
||||
pPlayer->m_bHasNightVision = false;
|
||||
pPlayer->m_iHostagesKilled = 0;
|
||||
pPlayer->m_iMapVote = 0;
|
||||
pPlayer->m_iCurrentKickVote = 0;
|
||||
pPlayer->m_fDeadTime = 0;
|
||||
pPlayer->has_disconnected = false;
|
||||
pPlayer->m_iMenu = Menu_OFF;
|
||||
pPlayer->ClearAutoBuyData();
|
||||
pPlayer->m_rebuyString = NULL;
|
||||
|
||||
SET_CLIENT_MAXSPEED(ENT(pPlayer->pev), 1);
|
||||
SET_MODEL(ENT(pPlayer->pev), "models/player.mdl");
|
||||
|
||||
pPlayer->SetThink(NULL);
|
||||
|
||||
CBaseEntity *Target = UTIL_FindEntityByClassname(NULL, "trigger_camera");
|
||||
pPlayer->m_pIntroCamera = Target;
|
||||
|
||||
if (mp && mp->m_bMapHasCameras == 2)
|
||||
mp->m_bMapHasCameras = (Target != NULL);
|
||||
|
||||
if (pPlayer->m_pIntroCamera)
|
||||
Target = UTIL_FindEntityByTargetname(NULL, STRING(pPlayer->m_pIntroCamera->pev->target));
|
||||
|
||||
if (pPlayer->m_pIntroCamera && Target)
|
||||
{
|
||||
Vector CamAngles = UTIL_VecToAngles((Target->pev->origin - pPlayer->m_pIntroCamera->pev->origin).Normalize());
|
||||
CamAngles.x = -CamAngles.x;
|
||||
|
||||
UTIL_SetOrigin(pPlayer->pev, pPlayer->m_pIntroCamera->pev->origin);
|
||||
|
||||
pPlayer->pev->angles = CamAngles;
|
||||
pPlayer->pev->v_angle = pPlayer->pev->angles;
|
||||
|
||||
pPlayer->m_fIntroCamTime = gpGlobals->time + 6;
|
||||
pPlayer->pev->view_ofs = g_vecZero;
|
||||
}
|
||||
else
|
||||
{
|
||||
pPlayer->m_iTeam = CT;
|
||||
|
||||
if (mp)
|
||||
{
|
||||
mp->GetPlayerSpawnSpot(pPlayer);
|
||||
}
|
||||
|
||||
pPlayer->m_iTeam = UNASSIGNED;
|
||||
pPlayer->pev->v_angle = g_vecZero;
|
||||
pPlayer->pev->angles = gpGlobals->v_forward;
|
||||
}
|
||||
|
||||
TheBots->OnEvent(EVENT_PLAYER_CHANGED_TEAM, (CBaseEntity *)pPlayer);
|
||||
pPlayer->m_iJoiningState = SHOWLTEXT;
|
||||
|
||||
static char sName[128];
|
||||
Q_strcpy(sName, STRING(pPlayer->pev->netname));
|
||||
|
||||
for (char *pApersand = sName; pApersand && *pApersand != '\0'; pApersand++)
|
||||
{
|
||||
if (*pApersand == '%')
|
||||
*pApersand = ' ';
|
||||
}
|
||||
|
||||
UTIL_ClientPrintAll(HUD_PRINTNOTIFY, "#Game_connected", (sName[0] != '\0') ? sName : "<unconnected>");
|
||||
}
|
||||
|
||||
/* <478f7> ../cstrike/dlls/client.cpp:792 */
|
||||
NOBODY int Q_strlen_(const char *str)
|
||||
int Q_strlen_(const char *str)
|
||||
{
|
||||
// {
|
||||
// int count; // 794
|
||||
// }
|
||||
int count = 0;
|
||||
if (str && *str)
|
||||
{
|
||||
while (str[count++ + 1]);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
/* <4bbff> ../cstrike/dlls/client.cpp:814 */
|
||||
@ -337,14 +651,37 @@ NOBODY void Host_Say(edict_t *pEntity, int teamonly)
|
||||
/* <4865e> ../cstrike/dlls/client.cpp:1160 */
|
||||
NOBODY inline void DropSecondary(CBasePlayer *pPlayer)
|
||||
{
|
||||
// {
|
||||
// class CBasePlayerWeapon *pWeapon; // 1166
|
||||
// }
|
||||
UNTESTED
|
||||
|
||||
if (pPlayer->HasShield())
|
||||
{
|
||||
// TODO: check out
|
||||
if (pPlayer->HasShield() && pPlayer->m_bShieldDrawn && pPlayer->m_pActiveItem != NULL)
|
||||
((CBasePlayerWeapon *)pPlayer->m_pActiveItem)->SecondaryAttack();
|
||||
|
||||
pPlayer->m_bShieldDrawn = false;
|
||||
}
|
||||
|
||||
CBasePlayerWeapon *pWeapon = (CBasePlayerWeapon *)pPlayer->m_rgpPlayerItems[ PISTOL_SLOT ];
|
||||
|
||||
if (pWeapon != NULL)
|
||||
{
|
||||
pPlayer->DropPlayerItem(STRING(pWeapon->pev->classname));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* <473db> ../cstrike/dlls/client.cpp:1182 */
|
||||
NOBODY void DropPrimary(CBasePlayer *pPlayer)
|
||||
void DropPrimary(CBasePlayer *pPlayer)
|
||||
{
|
||||
if (pPlayer->HasShield())
|
||||
{
|
||||
pPlayer->DropShield();
|
||||
return;
|
||||
}
|
||||
|
||||
if (pPlayer->m_rgpPlayerItems[ PRIMARY_WEAPON_SLOT ])
|
||||
pPlayer->DropPlayerItem(STRING(pPlayer->m_rgpPlayerItems[ PRIMARY_WEAPON_SLOT ]->pev->classname));
|
||||
}
|
||||
|
||||
/* <483a2> ../cstrike/dlls/client.cpp:1197 */
|
||||
@ -449,9 +786,15 @@ NOBODY void BuyItem(CBasePlayer *pPlayer, int iSlot)
|
||||
// }
|
||||
}
|
||||
|
||||
void (*pHandleMenu_ChooseAppearance)(void);
|
||||
|
||||
/* <48d40> ../cstrike/dlls/client.cpp:1998 */
|
||||
NOBODY void HandleMenu_ChooseAppearance(CBasePlayer *player, int slot)
|
||||
NOBODY void __declspec(naked) HandleMenu_ChooseAppearance(CBasePlayer *player, int slot)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
jmp pHandleMenu_ChooseAppearance
|
||||
}
|
||||
// {
|
||||
// class CHalfLifeMultiplay *mp; // 2000
|
||||
// class appearance; // 2007
|
||||
@ -461,9 +804,15 @@ NOBODY void HandleMenu_ChooseAppearance(CBasePlayer *player, int slot)
|
||||
// }
|
||||
}
|
||||
|
||||
void (*pHandleMenu_ChooseTeam)(void);
|
||||
|
||||
/* <48e4b> ../cstrike/dlls/client.cpp:2214 */
|
||||
NOBODY BOOL HandleMenu_ChooseTeam(CBasePlayer *player, int slot)
|
||||
NOBODY BOOL __declspec(naked) HandleMenu_ChooseTeam(CBasePlayer *player, int slot)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
jmp pHandleMenu_ChooseTeam
|
||||
}
|
||||
// {
|
||||
// class CHalfLifeMultiplay *mp; // 2216
|
||||
// enum TeamName team; // 2217
|
||||
@ -927,31 +1276,91 @@ NOBODY void ClientUserInfoChanged(edict_t *pEntity, char *infobuffer)
|
||||
}
|
||||
|
||||
/* <4a378> ../cstrike/dlls/client.cpp:4362 */
|
||||
NOBODY void ServerDeactivate(void)
|
||||
void ServerDeactivate(void)
|
||||
{
|
||||
// It's possible that the engine will call this function more times than is necessary
|
||||
// Therefore, only run it one time for each call to ServerActivate
|
||||
if (g_serveractive != 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
g_serveractive = 0;
|
||||
|
||||
// Peform any shutdown operations here...
|
||||
g_pGameRules->ServerDeactivate();
|
||||
CLocalNav::Reset();
|
||||
TheBots->ServerDeactivate();
|
||||
|
||||
if (g_pHostages)
|
||||
{
|
||||
g_pHostages->ServerDeactivate();
|
||||
}
|
||||
}
|
||||
|
||||
/* <4a392> ../cstrike/dlls/client.cpp:4400 */
|
||||
NOBODY void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax)
|
||||
void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax)
|
||||
{
|
||||
// {
|
||||
// int i; // 4402
|
||||
// class CBaseEntity *pClass; // 4403
|
||||
// }
|
||||
int i;
|
||||
CBaseEntity *pClass;
|
||||
|
||||
// Every call to ServerActivate should be matched by a call to ServerDeactivate
|
||||
g_serveractive = 1;
|
||||
EmptyEntityHashTable();
|
||||
|
||||
// Clients have not been initialized yet
|
||||
for (i = 0; i < edictCount; i++)
|
||||
{
|
||||
edict_t *pEdict = &pEdictList[i];
|
||||
|
||||
if (pEdict->free)
|
||||
continue;
|
||||
|
||||
// Clients aren't necessarily initialized until ClientPutInServer()
|
||||
if (i < clientMax || !pEdict->pvPrivateData)
|
||||
continue;
|
||||
|
||||
pClass = CBaseEntity::Instance(pEdict);
|
||||
|
||||
// Activate this entity if it's got a class & isn't dormant
|
||||
if (pClass && !(pClass->pev->flags & FL_DORMANT))
|
||||
{
|
||||
AddEntityHashValue(&pEdict->v, STRING(pEdict->v.classname), CLASSNAME);
|
||||
pClass->Activate();
|
||||
}
|
||||
else
|
||||
ALERT(at_console, "Can't instance %s\n", STRING(pEdict->v.classname));
|
||||
}
|
||||
|
||||
// Link user messages here to make sure first client can get them...
|
||||
LinkUserMessages();
|
||||
WriteSigonMessages();
|
||||
|
||||
if (g_pGameRules)
|
||||
{
|
||||
g_pGameRules->CheckMapConditions();
|
||||
}
|
||||
|
||||
TheBots->ServerActivate();
|
||||
|
||||
if (g_pHostages)
|
||||
{
|
||||
g_pHostages->ServerActivate();
|
||||
}
|
||||
}
|
||||
|
||||
/* <4a404> ../cstrike/dlls/client.cpp:4459 */
|
||||
NOBODY void PlayerPreThink(edict_t *pEntity)
|
||||
void PlayerPreThink(edict_t *pEntity)
|
||||
{
|
||||
// {
|
||||
// entvars_t *pev; // 4461
|
||||
// class CBasePlayer *pPlayer; // 4462
|
||||
// GET_PRIVATE(edict_t *pent); // 4462
|
||||
// }
|
||||
entvars_t *pev = &pEntity->v;
|
||||
CBasePlayer *pPlayer = (CBasePlayer *)GET_PRIVATE(pEntity);
|
||||
|
||||
if (pPlayer)
|
||||
pPlayer->PreThink();
|
||||
}
|
||||
|
||||
/* <4a47c> ../cstrike/dlls/client.cpp:4475 */
|
||||
NOBODY void PlayerPostThink(edict_t *pEntity)
|
||||
void PlayerPostThink(edict_t *pEntity)
|
||||
{
|
||||
entvars_t *pev = &pEntity->v;
|
||||
CBasePlayer *pPlayer = (CBasePlayer *)GET_PRIVATE(pEntity);
|
||||
@ -1529,10 +1938,10 @@ NOXREF void ResetPlayerPVS(edict_t *client, int clientnum)
|
||||
{
|
||||
PLAYERPVSSTATUS *pvs = &g_PVSStatus[clientnum];
|
||||
|
||||
memset(pvs, 0, sizeof(*pvs));
|
||||
Q_memset(pvs, 0, sizeof(*pvs));
|
||||
pvs->headnode = client->headnode;
|
||||
pvs->num_leafs = client->num_leafs;
|
||||
memcpy(pvs->leafnums, client->leafnums, sizeof(pvs->leafnums));
|
||||
Q_memcpy(pvs->leafnums, client->leafnums, sizeof(pvs->leafnums));
|
||||
}
|
||||
|
||||
/* <4aae8> ../cstrike/dlls/client.cpp:5240 */
|
||||
@ -1636,7 +2045,7 @@ int AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *ho
|
||||
UTIL_UnsetGroupTrace();
|
||||
}
|
||||
|
||||
memset(state, 0, sizeof(*state));
|
||||
Q_memset(state, 0, sizeof(*state));
|
||||
|
||||
state->number = e;
|
||||
state->entityType = ENTITY_NORMAL;
|
||||
@ -1646,12 +2055,12 @@ int AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *ho
|
||||
|
||||
state->animtime = (int)(1000.0 * ent->v.animtime) / 1000.0;
|
||||
|
||||
memcpy(state->origin, ent->v.origin, sizeof(float) * 3);
|
||||
memcpy(state->angles, ent->v.angles, sizeof(float) * 3);
|
||||
memcpy(state->mins, ent->v.mins, sizeof(float) * 3);
|
||||
memcpy(state->maxs, ent->v.maxs, sizeof(float) * 3);
|
||||
memcpy(state->startpos, ent->v.startpos, sizeof(float) * 3);
|
||||
memcpy(state->endpos, ent->v.endpos, sizeof(float) * 3);
|
||||
Q_memcpy(state->origin, ent->v.origin, sizeof(float) * 3);
|
||||
Q_memcpy(state->angles, ent->v.angles, sizeof(float) * 3);
|
||||
Q_memcpy(state->mins, ent->v.mins, sizeof(float) * 3);
|
||||
Q_memcpy(state->maxs, ent->v.maxs, sizeof(float) * 3);
|
||||
Q_memcpy(state->startpos, ent->v.startpos, sizeof(float) * 3);
|
||||
Q_memcpy(state->endpos, ent->v.endpos, sizeof(float) * 3);
|
||||
|
||||
state->impacttime = ent->v.impacttime;
|
||||
state->starttime = ent->v.starttime;
|
||||
@ -1700,7 +2109,7 @@ int AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *ho
|
||||
|
||||
if (player)
|
||||
{
|
||||
memcpy(state->basevelocity, ent->v.basevelocity, sizeof(float) * 3);
|
||||
Q_memcpy(state->basevelocity, ent->v.basevelocity, sizeof(float) * 3);
|
||||
|
||||
state->weaponmodel = MODEL_INDEX( STRING(ent->v.weaponmodel) );
|
||||
state->gaitsequence = ent->v.gaitsequence;
|
||||
@ -1956,7 +2365,7 @@ int GetWeaponData(edict_s *player, struct weapon_data_s *info)
|
||||
entvars_t *pev = &player->v;
|
||||
CBasePlayer *pl = reinterpret_cast< CBasePlayer * >(CBasePlayer::Instance( pev ));
|
||||
|
||||
memset(info, 0, sizeof(weapon_data_t) * MAX_WEAPONS);
|
||||
Q_memset(info, 0, sizeof(weapon_data_t) * MAX_WEAPONS);
|
||||
|
||||
if (!pl)
|
||||
return 1;
|
||||
@ -1972,7 +2381,7 @@ int GetWeaponData(edict_s *player, struct weapon_data_s *info)
|
||||
if (gun && gun->UseDecrement())
|
||||
{
|
||||
ItemInfo II;
|
||||
memset(&II, 0, sizeof(II));
|
||||
Q_memset(&II, 0, sizeof(II));
|
||||
gun->GetItemInfo(&II);
|
||||
|
||||
if (II.iId >= 0 && II.iId < MAX_WEAPONS)
|
||||
@ -2099,7 +2508,7 @@ void UpdateClientData(const struct edict_s *ent, int sendweapons, struct clientd
|
||||
if (pl->m_pActiveItem != NULL)
|
||||
{
|
||||
ItemInfo II;
|
||||
memset(&II, 0, sizeof(II));
|
||||
Q_memset(&II, 0, sizeof(II));
|
||||
|
||||
CBasePlayerWeapon *gun = reinterpret_cast< CBasePlayerWeapon * >(pl->m_pActiveItem->GetWeaponPtr());
|
||||
|
||||
@ -2183,7 +2592,7 @@ void CreateInstancedBaselines(void)
|
||||
int iret = 0;
|
||||
entity_state_t state;
|
||||
|
||||
memset(&state, 0, sizeof( state ));
|
||||
Q_memset(&state, 0, sizeof( state ));
|
||||
|
||||
// Create any additional baselines here for things like grendates, etc.
|
||||
// iret = ENGINE_INSTANCE_BASELINE( pc->pev->classname, &state );
|
||||
|
@ -78,7 +78,7 @@ typedef struct
|
||||
|
||||
//#define g_flTimeLimit (*pg_flTimeLimit)
|
||||
//#define g_flResetTime (*pg_flResetTime)
|
||||
//#define g_bClientPrintEnable (*pg_bClientPrintEnable)
|
||||
#define g_bClientPrintEnable (*pg_bClientPrintEnable)
|
||||
|
||||
#define g_PVSStatus (*pg_PVSStatus)
|
||||
#define m_usResetDecals (*pm_usResetDecals)
|
||||
@ -88,6 +88,7 @@ typedef struct
|
||||
#define entity_field_alias (*pentity_field_alias)
|
||||
#define player_field_alias (*pplayer_field_alias)
|
||||
#define custom_entity_field_alias (*pcustom_entity_field_alias)
|
||||
#define g_serveractive (*pg_serveractive)
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
@ -105,29 +106,32 @@ extern bool g_skipCareerInitialSpawn;
|
||||
extern entity_field_alias_t entity_field_alias[6];
|
||||
extern entity_field_alias_t player_field_alias[3];
|
||||
extern entity_field_alias_t custom_entity_field_alias[9];
|
||||
extern int g_serveractive;
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
extern unsigned short m_usResetDecals;
|
||||
extern unsigned short g_iShadowSprite;
|
||||
|
||||
NOBODY int CMD_ARGC_(void);
|
||||
NOBODY const char *CMD_ARGV_(int i);
|
||||
NOBODY void set_suicide_frame(entvars_t *pev);
|
||||
NOBODY BOOL ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char *szRejectReason);
|
||||
NOBODY void ClientDisconnect(edict_t *pEntity);
|
||||
NOXREF int CMD_ARGC_(void);
|
||||
NOXREF const char *CMD_ARGV_(int i);
|
||||
NOXREF void set_suicide_frame(entvars_t *pev);
|
||||
NOXREF void TeamChangeUpdate(CBasePlayer *player, int team_id);
|
||||
NOXREF void BlinkAccount(CBasePlayer *player, int numBlinks);
|
||||
BOOL ClientConnect(edict_t *pEntity, const char *pszName, const char *pszAddress, char *szRejectReason);
|
||||
void ClientDisconnect(edict_t *pEntity);
|
||||
void respawn(entvars_t *pev, BOOL fCopyCorpse = FALSE);
|
||||
NOBODY void ClientKill(edict_t *pEntity);
|
||||
NOBODY void ShowMenu(CBasePlayer *pPlayer, int bitsValidSlots, int nDisplayTime, BOOL fNeedMore, char *pszText);
|
||||
NOBODY void ShowVGUIMenu(CBasePlayer *pPlayer, int MenuType, int BitMask, char *szOldMenu);
|
||||
NOBODY int CountTeams(void);
|
||||
void ClientKill(edict_t *pEntity);
|
||||
void ShowMenu(CBasePlayer *pPlayer, int bitsValidSlots, int nDisplayTime, BOOL fNeedMore, char *pszText);
|
||||
void ShowVGUIMenu(CBasePlayer *pPlayer, int MenuType, int BitMask, char *szOldMenu);
|
||||
NOXREF C_DLLEXPORT int CountTeams(void);
|
||||
NOBODY void ListPlayers(CBasePlayer *current);
|
||||
NOBODY int CountTeamPlayers(int iTeam);
|
||||
NOBODY void ProcessKickVote(CBasePlayer *pVotingPlayer, CBasePlayer *pKickPlayer);
|
||||
NOBODY TeamName SelectDefaultTeam(void);
|
||||
C_DLLEXPORT int CountTeamPlayers(int iTeam);
|
||||
void ProcessKickVote(CBasePlayer *pVotingPlayer, CBasePlayer *pKickPlayer);
|
||||
TeamName SelectDefaultTeam(void);
|
||||
void CheckStartMoney(void);
|
||||
NOBODY void ClientPutInServer(edict_t *pEntity);
|
||||
NOBODY int Q_strlen_(const char *str);
|
||||
void ClientPutInServer(edict_t *pEntity);
|
||||
int Q_strlen_(const char *str);
|
||||
NOBODY void Host_Say(edict_t *pEntity, int teamonly);
|
||||
NOBODY void DropPrimary(CBasePlayer *pPlayer);
|
||||
NOBODY bool CanBuyThis(CBasePlayer *pPlayer, int iWeapon);
|
||||
@ -152,9 +156,9 @@ NOBODY BOOL HandleRadioAliasCommands(CBasePlayer *pPlayer, const char *pszComman
|
||||
NOBODY void ClientCommand(edict_t *pEntity);
|
||||
NOBODY void ClientUserInfoChanged(edict_t *pEntity, char *infobuffer);
|
||||
NOBODY void ServerDeactivate(void);
|
||||
NOBODY void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax);
|
||||
NOBODY void PlayerPreThink(edict_t *pEntity);
|
||||
NOBODY void PlayerPostThink(edict_t *pEntity);
|
||||
void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax);
|
||||
void PlayerPreThink(edict_t *pEntity);
|
||||
void PlayerPostThink(edict_t *pEntity);
|
||||
void ParmsNewLevel(void);
|
||||
NOBODY void ParmsChangeLevel(void);
|
||||
NOBODY void StartFrame(void);
|
||||
@ -191,5 +195,7 @@ int AllowLagCompensation(void);
|
||||
|
||||
// refs
|
||||
extern void (*pClientCommand)(edict_t *pEntity);
|
||||
extern void (*pHandleMenu_ChooseAppearance)(void);
|
||||
extern void (*pHandleMenu_ChooseTeam)(void);
|
||||
|
||||
#endif // CLIENT_H
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -85,7 +85,9 @@ extern enginefuncs_t g_engfuncs;
|
||||
#define ADD_SERVER_COMMAND (*g_engfuncs.pfnAddServerCommand)
|
||||
#define SET_CLIENT_LISTENING (*g_engfuncs.pfnVoice_SetClientListening)
|
||||
#define GETPLAYERAUTHID (*g_engfuncs.pfnGetPlayerAuthId)
|
||||
#define GET_APPROX_WAVE_PLAY_LEN (*g_engfuncs.pfnGetApproxWavePlayLen)
|
||||
#define IS_CAREER_MATCH (*g_engfuncs.pfnIsCareerMatch)
|
||||
#define ENG_CHECK_PARM (*g_engfuncs.pfnEngCheckParm)
|
||||
|
||||
/* <472a4> ../cstrike/dlls/enginecallback.h:77 */
|
||||
inline void MESSAGE_BEGIN(int msg_dest, int msg_type, const float *pOrigin = NULL, edict_t *ed = NULL)
|
||||
@ -146,6 +148,8 @@ inline void *GET_PRIVATE(edict_t *pent)
|
||||
#define FREE_FILE (*g_engfuncs.pfnFreeFile)
|
||||
#define COMPARE_FILE_TIME (*g_engfuncs.pfnCompareFileTime)
|
||||
#define GET_GAME_DIR (*g_engfuncs.pfnGetGameDir)
|
||||
#define SET_CLIENT_MAXSPEED (*g_engfuncs.pfnSetClientMaxspeed)
|
||||
#define CREATE_FAKE_CLIENT (*g_engfuncs.pfnCreateFakeClient)
|
||||
#define PLAYER_RUN_MOVE (*g_engfuncs.pfnRunPlayerMove)
|
||||
#define NUMBER_OF_ENTITIES (*g_engfuncs.pfnNumberOfEntities)
|
||||
#define GET_INFO_BUFFER (*g_engfuncs.pfnGetInfoKeyBuffer)
|
||||
|
@ -555,10 +555,10 @@ void CFuncTank::Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *
|
||||
Fire_(barrelEnd, forward, pevAttacker);
|
||||
}
|
||||
|
||||
//void CFuncTank::Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker)
|
||||
//{
|
||||
// Fire_(barrelEnd, forward, pevAttacker);
|
||||
//}
|
||||
void CFuncTankGun::Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker)
|
||||
{
|
||||
Fire_(barrelEnd, forward, pevAttacker);
|
||||
}
|
||||
|
||||
void CFuncTankLaser::KeyValue(KeyValueData *pkvd)
|
||||
{
|
||||
|
@ -272,7 +272,7 @@ public:
|
||||
NOBODY virtual void InitHUD(CBasePlayer *pl);
|
||||
NOBODY virtual void ClientDisconnected(edict_t *pClient);
|
||||
NOBODY virtual void UpdateGameMode(CBasePlayer *pPlayer);
|
||||
NOBODY virtual float FlPlayerFallDamage(CBasePlayer *pPlayer);
|
||||
virtual float FlPlayerFallDamage(CBasePlayer *pPlayer);
|
||||
NOBODY virtual BOOL FPlayerCanTakeDamage(CBasePlayer *pPlayer, CBaseEntity *pAttacker);
|
||||
NOBODY virtual void PlayerSpawn(CBasePlayer *pPlayer);
|
||||
NOBODY virtual void PlayerThink(CBasePlayer *pPlayer);
|
||||
@ -411,7 +411,7 @@ public:
|
||||
return m_iRoundTimeSecs - gpGlobals->time + m_fRoundCount;
|
||||
}
|
||||
NOBODY BOOL TeamFull(int team_id);
|
||||
NOBODY BOOL TeamStacked(int newTeam_id, int curTeam_id);
|
||||
BOOL TeamStacked(int newTeam_id, int curTeam_id);
|
||||
NOBODY bool IsVIPQueueEmpty(void);
|
||||
NOBODY bool AddToVIPQueue(CBasePlayer *toAdd);
|
||||
NOBODY void PickNextVIP(void);
|
||||
@ -423,8 +423,8 @@ public:
|
||||
NOBODY void DisplayMaps(CBasePlayer *player, int iVote);
|
||||
NOBODY void ResetAllMapVotes(void);
|
||||
NOBODY void ProcessMapVote(CBasePlayer *player, int iVote);
|
||||
NOBODY BOOL IsThereABomber(void);
|
||||
NOBODY BOOL IsThereABomb(void);
|
||||
BOOL IsThereABomber(void);
|
||||
BOOL IsThereABomb(void);
|
||||
NOBODY bool IsMatchStarted(void);
|
||||
NOBODY void SendMOTDToClient(edict_t *client);
|
||||
private:
|
||||
@ -624,7 +624,7 @@ NOBODY void SV_Career_Restart_f(void);
|
||||
NOBODY void SV_Career_EndRound_f(void);
|
||||
NOBODY void SV_CareerAddTask_f(void);
|
||||
NOBODY void SV_CareerMatchLimit_f(void);
|
||||
NOBODY void Broadcast(void);
|
||||
void Broadcast(const char *sentence);
|
||||
char *GetTeam(int teamNo);
|
||||
NOBODY void EndRoundMessage(const char *sentence, int event);
|
||||
NOBODY void ReadMultiplayCvars(CHalfLifeMultiplay *mp);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -8,4 +8,8 @@ C_DLLEXPORT void WINAPI GiveFnptrsToDll(enginefuncs_t *pEnginefuncsTable,globalv
|
||||
{
|
||||
memcpy(&g_engfuncs, pEnginefuncsTable, sizeof(enginefuncs_t));
|
||||
gpGlobals = pGlobals;
|
||||
|
||||
#if defined(_WIN32) && !defined(REGAMEDLL_UNIT_TESTS)
|
||||
Regamedll_Game_Init();
|
||||
#endif // _WIN32 && REGAMEDLL_UNIT_TESTS
|
||||
}
|
||||
|
@ -32,6 +32,30 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#define DHF_ROUND_STARTED (1<<1)
|
||||
#define DHF_HOSTAGE_SEEN_FAR (1<<2)
|
||||
#define DHF_HOSTAGE_SEEN_NEAR (1<<3)
|
||||
#define DHF_HOSTAGE_USED (1<<4)
|
||||
#define DHF_HOSTAGE_INJURED (1<<5)
|
||||
#define DHF_HOSTAGE_KILLED (1<<6)
|
||||
#define DHF_FRIEND_SEEN (1<<7)
|
||||
#define DHF_ENEMY_SEEN (1<<8)
|
||||
#define DHF_FRIEND_INJURED (1<<9)
|
||||
#define DHF_FRIEND_KILLED (1<<10)
|
||||
#define DHF_ENEMY_KILLED (1<<11)
|
||||
#define DHF_BOMB_RETRIEVED (1<<12)
|
||||
#define DHF_AMMO_EXHAUSTED (1<<15)
|
||||
#define DHF_IN_TARGET_ZONE (1<<16)
|
||||
#define DHF_IN_RESCUE_ZONE (1<<17)
|
||||
#define DHF_IN_ESCAPE_ZONE (1<<18)
|
||||
#define DHF_IN_VIPSAFETY_ZONE (1<<19)
|
||||
#define DHF_NIGHTVISION (1<<20)
|
||||
#define DHF_HOSTAGE_CTMOVE (1<<21)
|
||||
#define DHF_SPEC_DUCK (1<<22)
|
||||
|
||||
#define DHM_ROUND_CLEAR (DHF_ROUND_STARTED | DHF_HOSTAGE_KILLED | DHF_FRIEND_KILLED | DHF_BOMB_RETRIEVED)
|
||||
#define DHM_CONNECT_CLEAR (DHF_HOSTAGE_SEEN_FAR | DHF_HOSTAGE_SEEN_NEAR | DHF_HOSTAGE_USED | DHF_HOSTAGE_INJURED | DHF_FRIEND_SEEN | DHF_ENEMY_SEEN | DHF_FRIEND_INJURED | DHF_ENEMY_KILLED | DHF_AMMO_EXHAUSTED | DHF_IN_TARGET_ZONE | DHF_IN_RESCUE_ZONE | DHF_IN_ESCAPE_ZONE | DHF_IN_VIPSAFETY_ZONE | DHF_HOSTAGE_CTMOVE | DHF_SPEC_DUCK)
|
||||
|
||||
class CHintMessage
|
||||
{
|
||||
public:
|
||||
|
@ -625,9 +625,155 @@ NOBODY CHostageManager::CHostageManager(void)
|
||||
}
|
||||
|
||||
/* <45e39b> ../cstrike/dlls/hostage/hostage.cpp:1456 */
|
||||
NOBODY void CHostageManager::ServerActivate(void)
|
||||
void CHostageManager::ServerActivate(void)
|
||||
{
|
||||
m_hostageCount = 0;
|
||||
|
||||
CBaseEntity *pEntity = NULL;
|
||||
while ((pEntity = UTIL_FindEntityByClassname(pEntity, "hostage_entity")) != NULL)
|
||||
{
|
||||
AddHostage((CHostage *)pEntity);
|
||||
}
|
||||
|
||||
if (UTIL_IsGame("czero"))
|
||||
{
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_START_FOLLOW, "hostage/huse/getouttahere.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_START_FOLLOW, "hostage/huse/illfollow.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_START_FOLLOW, "hostage/huse/letsdoit.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_START_FOLLOW, "hostage/huse/letsgo.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_START_FOLLOW, "hostage/huse/letshurry.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_START_FOLLOW, "hostage/huse/letsmove.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_START_FOLLOW, "hostage/huse/okletsgo.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_START_FOLLOW, "hostage/huse/youlead.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_STOP_FOLLOW, "hostage/hunuse/comeback.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_STOP_FOLLOW, "hostage/hunuse/dontleaveme.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_STOP_FOLLOW, "hostage/hunuse/illstayhere.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_STOP_FOLLOW, "hostage/hunuse/notleaveme.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_STOP_FOLLOW, "hostage/hunuse/yeahillstay.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_INTIMIDATED, "hostage/hseenbyt/donthurtme1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_INTIMIDATED, "hostage/hseenbyt/donthurtme2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_INTIMIDATED, "hostage/hseenbyt/dontkill.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_INTIMIDATED, "hostage/hseenbyt/endpeace.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_INTIMIDATED, "hostage/hseenbyt/nevernegotiate.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_INTIMIDATED, "hostage/hseenbyt/nottellanything.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_INTIMIDATED, "hostage/hseenbyt/surrender.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_INTIMIDATED, "hostage/hseenbyt/whatdoyou.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_INTIMIDATED, "hostage/hseenbyt/whyareyou.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_RETREAT, "hostage/hseenbyt/donthurtme1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_RETREAT, "hostage/hseenbyt/donthurtme2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_RETREAT, "hostage/hseenbyt/dontkill.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_RETREAT, "hostage/hseenbyt/dontkill.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_RETREAT, "hostage/hretreat/illgoback1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_RETREAT, "hostage/hretreat/illgoback2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_RETREAT, "hostage/hretreat/okokgoing.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_RETREAT, "hostage/hretreat/okokgoing2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_RETREAT, "hostage/hretreat/sorry1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_RETREAT, "hostage/hretreat/sorry2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_RETREAT, "hostage/hretreat/sorry3.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_PAIN, "hostage/hpain/hpain1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_PAIN, "hostage/hpain/hpain2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_PAIN, "hostage/hpain/hpain3.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_PAIN, "hostage/hpain/hpain4.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_PAIN, "hostage/hpain/hpain5.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_PAIN, "hostage/hpain/hpain6.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SCARED_OF_GUNFIRE, "hostage/hreactions/awwcrap1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SCARED_OF_GUNFIRE, "hostage/hreactions/awwcrap2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SCARED_OF_GUNFIRE, "hostage/hreactions/getdown1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SCARED_OF_GUNFIRE, "hostage/hreactions/getdown2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SCARED_OF_GUNFIRE, "hostage/hreactions/getdown3.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SCARED_OF_GUNFIRE, "hostage/hreactions/lookout1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SCARED_OF_GUNFIRE, "hostage/hreactions/lookout2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SCARED_OF_GUNFIRE, "hostage/hreactions/lookshooting1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SCARED_OF_GUNFIRE, "hostage/hreactions/lookshooting2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SCARED_OF_GUNFIRE, "hostage/hreactions/lookshooting3.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SCARED_OF_GUNFIRE, "hostage/hreactions/ohgod1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SCARED_OF_GUNFIRE, "hostage/hreactions/ohgod2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SCARED_OF_MURDER, "hostage/hreactions/awwcrap1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SCARED_OF_MURDER, "hostage/hreactions/awwcrap2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SCARED_OF_MURDER, "hostage/hreactions/deargod1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SCARED_OF_MURDER, "hostage/hreactions/deargod2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SCARED_OF_MURDER, "hostage/hreactions/deargod3.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SCARED_OF_MURDER, "hostage/hreactions/ohgod1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SCARED_OF_MURDER, "hostage/hreactions/ohgod2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SCARED_OF_MURDER, "hostage/hreactions/ohno1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SCARED_OF_MURDER, "hostage/hreactions/ohno2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SCARED_OF_MURDER, "hostage/hreactions/awww2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SCARED_OF_MURDER, "hostage/hreactions/awww4.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_LOOK_OUT, "hostage/hreactions/awwcrap1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_LOOK_OUT, "hostage/hreactions/awwcrap2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_LOOK_OUT, "hostage/hreactions/lookout1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_LOOK_OUT, "hostage/hreactions/lookout2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_PLEASE_RESCUE_ME, "hostage/hseenbyct/areyousave.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_PLEASE_RESCUE_ME, "hostage/hseenbyct/getmeoutta1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_PLEASE_RESCUE_ME, "hostage/hseenbyct/getmeoutta2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_PLEASE_RESCUE_ME, "hostage/hseenbyct/imahostage.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_PLEASE_RESCUE_ME, "hostage/hseenbyct/rescueme1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_PLEASE_RESCUE_ME, "hostage/hseenbyct/rescueme2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_PLEASE_RESCUE_ME, "hostage/hseenbyct/theyregonna.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_IMPATIENT_FOR_RESCUE, "hostage/hseenbyct/areyousave.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_IMPATIENT_FOR_RESCUE, "hostage/hseenbyct/getmeoutta1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_IMPATIENT_FOR_RESCUE, "hostage/hseenbyct/getmeoutta2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_IMPATIENT_FOR_RESCUE, "hostage/hseenbyct/rescueme1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_IMPATIENT_FOR_RESCUE, "hostage/hseenbyct/rescueme2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SEE_RESCUE_ZONE, "hostage/hseezone/almostouttahere.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SEE_RESCUE_ZONE, "hostage/hseezone/almostthere.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SEE_RESCUE_ZONE, "hostage/hseezone/keepgoing.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SEE_RESCUE_ZONE, "hostage/hseezone/notfar.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_CTS_WIN, "hostage/hctwin/alldead.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_CTS_WIN, "hostage/hctwin/goodnews.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_CTS_WIN, "hostage/hctwin/outtahere.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_CTS_WIN, "hostage/hctwin/over1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_CTS_WIN, "hostage/hctwin/over2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_CTS_WIN, "hostage/hctwin/over3.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_CTS_WIN, "hostage/hctwin/over4.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_CTS_WIN, "hostage/hctwin/over5.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_CTS_WIN, "hostage/hctwin/relief.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_TERRORISTS_WIN, "hostage/htwin/doomed.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_TERRORISTS_WIN, "hostage/htwin/godno.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_TERRORISTS_WIN, "hostage/htwin/nowwhat.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_TERRORISTS_WIN, "hostage/htwin/ohman.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_TERRORISTS_WIN, "hostage/htwin/ohno.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_RESCUED, "hostage/hrescued/finally.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_RESCUED, "hostage/hrescued/finallysafe.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_RESCUED, "hostage/hrescued/thankyou.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_RESCUED, "hostage/hrescued/wemadeit1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_RESCUED, "hostage/hrescued/wemadeit2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_RESCUED, "hostage/hrescued/wemadeit3.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_WARN_NEARBY, "hostage/hwarn/becareful1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_WARN_NEARBY, "hostage/hwarn/becareful2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_WARN_NEARBY, "hostage/hwarn/stillaround1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_WARN_NEARBY, "hostage/hwarn/stillaround2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_WARN_SPOTTED, "hostage/hwarn/lookout1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_WARN_SPOTTED, "hostage/hwarn/lookout2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_WARN_SPOTTED, "hostage/hwarn/overthere1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_WARN_SPOTTED, "hostage/hwarn/overthere2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_CALL_TO_RESCUER, "hostage/hwavect/helpme1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_CALL_TO_RESCUER, "hostage/hwavect/helpme2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_CALL_TO_RESCUER, "hostage/hwavect/hey1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_CALL_TO_RESCUER, "hostage/hwavect/hey2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_CALL_TO_RESCUER, "hostage/hwavect/overhere1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_COUGH, "hostage/hsmoke/cough1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_COUGH, "hostage/hsmoke/cough2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_COUGH, "hostage/hsmoke/cough3.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_COUGH, "hostage/hsmoke/cough4.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_COUGH, "hostage/hsmoke/cough5.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_COUGH, "hostage/hsmoke/cough6.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_BLINDED, "hostage/hflash/cantsee.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_BLINDED, "hostage/hflash/myeyes.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SAW_HE_GRENADE, "hostage/hgrenade/grenade1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SAW_HE_GRENADE, "hostage/hgrenade/grenade2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SAW_HE_GRENADE, "hostage/hgrenade/run.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_SAW_HE_GRENADE, "hostage/hgrenade/watchout.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_DEATH_CRY, "hostage/hdie/hdeath1.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_DEATH_CRY, "hostage/hdie/hdeath2.wav");
|
||||
m_chatter.AddSound(HOSTAGE_CHATTER_DEATH_CRY, "hostage/hdie/hdeath3.wav");
|
||||
}
|
||||
}
|
||||
|
||||
/* <45e3a2> ../cstrike/dlls/hostage/hostage.cpp:1624 */
|
||||
void CHostageManager::ServerDeactivate(void)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
/* <45e3f7> ../cstrike/dlls/hostage/hostage.cpp:1631 */
|
||||
@ -639,11 +785,25 @@ NOBODY void CHostageManager::RestartRound(void)
|
||||
}
|
||||
|
||||
/* <45e43d> ../cstrike/dlls/hostage/hostage.cpp:1640 */
|
||||
NOBODY void CHostageManager::AddHostage(CHostage *hostage)
|
||||
void CHostageManager::AddHostage(CHostage *hostage)
|
||||
{
|
||||
// {
|
||||
// int i; // 1646
|
||||
// }
|
||||
if (m_hostageCount >= MAX_HOSTAGES)
|
||||
return;
|
||||
|
||||
int i;
|
||||
for (i = 0; i < m_hostageCount; i++)
|
||||
{
|
||||
if (m_hostage[i] == hostage)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == m_hostageCount)
|
||||
{
|
||||
m_hostage[m_hostageCount] = hostage;
|
||||
m_hostageCount++;
|
||||
}
|
||||
}
|
||||
|
||||
/* <45e47f> ../cstrike/dlls/hostage/hostage.cpp:1657 */
|
||||
@ -692,32 +852,48 @@ void CHostageManager::OnEvent(GameEventType event, CBaseEntity *entity, CBaseEnt
|
||||
}
|
||||
|
||||
/* <45e6b8> ../cstrike/dlls/hostage/hostage.cpp:1726 */
|
||||
NOBODY SimpleChatter::SimpleChatter(void)
|
||||
SimpleChatter::SimpleChatter(void)
|
||||
{
|
||||
// {
|
||||
// int i; // 1728
|
||||
// }
|
||||
for (int i = 0; i < ARRAYSIZE(m_chatter); i++)
|
||||
{
|
||||
m_chatter[i].count = 0;
|
||||
m_chatter[i].index = 0;
|
||||
m_chatter[i].needsShuffle = false;
|
||||
}
|
||||
}
|
||||
|
||||
/* <45e6f0> ../cstrike/dlls/hostage/hostage.cpp:1737 */
|
||||
NOBODY SimpleChatter::~SimpleChatter(void)
|
||||
SimpleChatter::~SimpleChatter(void)
|
||||
{
|
||||
// {
|
||||
// int i; // 1739
|
||||
// {
|
||||
// int f; // 1741
|
||||
// }
|
||||
// }
|
||||
for (int i = 0; i < ARRAYSIZE(m_chatter); i++)
|
||||
{
|
||||
for (int f = 0; f < m_chatter[i].count; f++)
|
||||
{
|
||||
if (m_chatter[i].file[f].filename)
|
||||
{
|
||||
delete[] m_chatter[i].file[f].filename;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* <45e736> ../cstrike/dlls/hostage/hostage.cpp:1752 */
|
||||
NOBODY void SimpleChatter::AddSound(HostageChatterType type, char *filename)
|
||||
void SimpleChatter::AddSound(HostageChatterType type, char *filename)
|
||||
{
|
||||
// {
|
||||
// class ChatterSet *chatter; // 1754
|
||||
// char actualFilename; // 1758
|
||||
// CloneString(const char *str); // 1756
|
||||
// }
|
||||
ChatterSet *chatter;
|
||||
char actualFilename[128];
|
||||
|
||||
chatter = &m_chatter[ type ];
|
||||
|
||||
Q_snprintf(actualFilename, sizeof(actualFilename), "sound\\%s", filename);
|
||||
|
||||
chatter->file[ chatter->count ].filename = CloneString(filename);
|
||||
chatter->file[ chatter->count ].duration = (double)GET_APPROX_WAVE_PLAY_LEN(actualFilename) / 1000.0;
|
||||
|
||||
chatter->needsShuffle = true;
|
||||
chatter->count++;
|
||||
|
||||
PRECACHE_SOUND(filename);
|
||||
}
|
||||
|
||||
/* <45e8c7> ../cstrike/dlls/hostage/hostage.cpp:1773 */
|
||||
|
@ -32,14 +32,18 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "hostage/hostage_improv.h"
|
||||
|
||||
#define MAX_NODES 100
|
||||
#define MAX_HOSTAGES 20
|
||||
#define MAX_HOSTAGES 12
|
||||
#define MAX_HOSTAGES_NAV 20
|
||||
|
||||
#define HOSTAGE_STEPSIZE 26.0
|
||||
|
||||
class CHostage;
|
||||
class CLocalNav;
|
||||
class CHostageImprov;
|
||||
class CHostageManager;
|
||||
|
||||
enum HostageChatterType
|
||||
{
|
||||
@ -67,6 +71,22 @@ enum HostageChatterType
|
||||
NUM_HOSTAGE_CHATTER_TYPES,
|
||||
};
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
||||
#define g_pHostages (*pg_pHostages)
|
||||
#define g_iHostageNumber (*pg_iHostageNumber)
|
||||
|
||||
#define cv_hostage_debug (*pcv_hostage_debug)
|
||||
#define cv_hostage_stop (*pcv_hostage_stop)
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
extern CHostageManager *g_pHostages;
|
||||
extern int g_iHostageNumber;
|
||||
|
||||
extern cvar_t cv_hostage_debug;
|
||||
extern cvar_t cv_hostage_stop;
|
||||
|
||||
/* <4858e5> ../cstrike/dlls/hostage/hostage.h:32 */
|
||||
class CHostage: public CBaseMonster
|
||||
{
|
||||
@ -109,14 +129,26 @@ public:
|
||||
NOBODY void Wiggle(void);
|
||||
void PreThink(void);
|
||||
|
||||
NOBODY bool IsFollowingSomeone(void);//
|
||||
NOBODY bool IsFollowingSomeone(void)
|
||||
{
|
||||
UNTESTED
|
||||
return ((CHostageImprov *)m_improv)->IsFollowing();
|
||||
}
|
||||
NOBODY CBaseEntity *GetLeader(void);//
|
||||
NOBODY bool IsFollowing(const CBaseEntity *entity)
|
||||
{
|
||||
return (entity == m_hTargetEnt && m_State == FOLLOW);
|
||||
}
|
||||
NOBODY bool IsValid(void);//
|
||||
NOBODY bool IsDead(void);//
|
||||
NOBODY bool IsValid(void)
|
||||
{
|
||||
UNTESTED
|
||||
return (pev->takedamage == DAMAGE_YES);
|
||||
}
|
||||
NOBODY bool IsDead(void)
|
||||
{
|
||||
UNTESTED
|
||||
return (pev->deadflag == DEAD_DEAD);
|
||||
}
|
||||
NOBODY bool IsAtHome(void);//
|
||||
NOBODY const Vector *GetHomePosition(void);//
|
||||
|
||||
@ -162,7 +194,7 @@ public:
|
||||
state m_State;
|
||||
Vector m_vStart;
|
||||
Vector m_vStartAngles;
|
||||
Vector m_vPathToFollow[ MAX_HOSTAGES ];
|
||||
Vector m_vPathToFollow[20];
|
||||
int m_iWaypoint;
|
||||
CBasePlayer *m_target;
|
||||
CLocalNav *m_LocalNav;
|
||||
@ -222,16 +254,17 @@ private:
|
||||
|
||||
};/* size: 5628, cachelines: 88, members: 1 */
|
||||
|
||||
/* <45b018> ../cstrike/dlls/hostage/hostage.h:247 */
|
||||
class CHostageManager
|
||||
{
|
||||
public:
|
||||
CHostageManager(void);
|
||||
|
||||
NOBODY void ServerActivate(void);
|
||||
void ServerDeactivate(void) { };
|
||||
void ServerActivate(void);
|
||||
void ServerDeactivate(void);
|
||||
|
||||
NOBODY void RestartRound(void);
|
||||
NOBODY void AddHostage(CHostage *hostage);
|
||||
void AddHostage(CHostage *hostage);
|
||||
SimpleChatter *GetChatter(void)
|
||||
{
|
||||
return &m_chatter;
|
||||
@ -261,28 +294,60 @@ public:
|
||||
return close;
|
||||
}
|
||||
|
||||
template<
|
||||
typename T
|
||||
>
|
||||
bool ForEachHostage(T &func)
|
||||
{
|
||||
UNTESTED
|
||||
|
||||
for (int i = 0; i < m_hostageCount; i++)
|
||||
{
|
||||
CHostage *pHostage = m_hostage[ i ];
|
||||
|
||||
if (pHostage->deadflag != DEAD_NO || pHostage->takedamage != DAMAGE_YES)
|
||||
continue;
|
||||
|
||||
if (!pHostage->m_improv)
|
||||
break;
|
||||
|
||||
if (func(pHostage))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
CHostage *m_hostage[12];
|
||||
CHostage *m_hostage[ MAX_HOSTAGES ];
|
||||
int m_hostageCount;
|
||||
SimpleChatter m_chatter;
|
||||
|
||||
};/* size: 5680, cachelines: 89, members: 3 */
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
||||
#define g_pHostages (*pg_pHostages)
|
||||
#define g_iHostageNumber (*pg_iHostageNumber)
|
||||
|
||||
#define cv_hostage_debug (*pcv_hostage_debug)
|
||||
#define cv_hostage_stop (*pcv_hostage_stop)
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
extern CHostageManager *g_pHostages;
|
||||
extern int g_iHostageNumber;
|
||||
|
||||
extern cvar_t cv_hostage_debug;
|
||||
extern cvar_t cv_hostage_stop;
|
||||
///* <470134> ../cstrike/dlls/hostage/hostage.h:293 */
|
||||
//inline void CHostageManager::ForEachHostage<KeepPersonalSpace>(KeepPersonalSpace &func)
|
||||
//{
|
||||
//// {
|
||||
//// int i; // 295
|
||||
//// }
|
||||
//}
|
||||
//
|
||||
///* <46fbe8> ../cstrike/dlls/hostage/hostage.h:293 */
|
||||
//inline void CHostageManager::ForEachHostage<CheckAhead>(CheckAhead &func)
|
||||
//{
|
||||
//// {
|
||||
//// int i; // 295
|
||||
//// }
|
||||
//}
|
||||
//
|
||||
///* <46fb04> ../cstrike/dlls/hostage/hostage.h:293 */
|
||||
//inline void CHostageManager::ForEachHostage<CheckWayFunctor>(CheckWayFunctor &func)
|
||||
//{
|
||||
//// {
|
||||
//// int i; // 295
|
||||
//// }
|
||||
//}
|
||||
|
||||
void Hostage_RegisterCVars(void);
|
||||
NOBODY void InstallHostageManager(void);
|
||||
|
@ -32,6 +32,11 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "hostage/hostage_states.h"
|
||||
|
||||
class CHostage;
|
||||
enum HostageChatterType;
|
||||
|
||||
class CHostageImprov: public CImprov
|
||||
{
|
||||
public:
|
||||
@ -46,6 +51,17 @@ public:
|
||||
//~CImprov(); // 49
|
||||
};
|
||||
|
||||
virtual void OnMoveToSuccess(const Vector &goal)
|
||||
{
|
||||
//if (m_behavior.IsState(NULL))
|
||||
// IImprovEvent::OnMoveToSuccess(goal);
|
||||
}
|
||||
virtual void OnMoveToFailure(const Vector &goal, MoveToFailureType reason);
|
||||
virtual void OnInjury(float amount)
|
||||
{
|
||||
//m_behavior.Update();
|
||||
//m_lastInjuryTimer.Start();
|
||||
}
|
||||
virtual bool IsAlive(void) const;
|
||||
virtual void MoveTo(const Vector &goal);
|
||||
virtual void LookAt(const Vector &target);
|
||||
@ -151,18 +167,7 @@ public:
|
||||
virtual void OnUpdate(float deltaT);
|
||||
virtual void OnUpkeep(float deltaT);
|
||||
virtual void OnReset(void);
|
||||
virtual void OnMoveToSuccess(const Vector &goal)
|
||||
{
|
||||
//if (m_behavior.IsState(NULL))
|
||||
// IImprovEvent::OnMoveToSuccess(goal);
|
||||
}
|
||||
virtual void OnMoveToFailure(const Vector &goal, MoveToFailureType reason);
|
||||
virtual void OnInjury(float amount)
|
||||
{
|
||||
//m_behavior.Update();
|
||||
//m_lastInjuryTimer.Start();
|
||||
}
|
||||
virtual void OnGameEvent(GameEventType event, CBaseEntity *entity, CBaseEntity *other);
|
||||
virtual void OnGameEvent(GameEventType event, CBaseEntity *entity = NULL, CBaseEntity *other = NULL);
|
||||
virtual void OnTouch(CBaseEntity *other);
|
||||
public:
|
||||
|
||||
@ -179,7 +184,10 @@ public:
|
||||
SCARED,
|
||||
TERRIFIED,
|
||||
};
|
||||
|
||||
//{
|
||||
// UNTESTED
|
||||
// return m_behavior.IsState(&m_followState);
|
||||
//}
|
||||
void FaceOutwards(void);
|
||||
bool IsFriendInTheWay(void);
|
||||
void SetKnownGoodPosition(const Vector &pos);
|
||||
@ -199,9 +207,17 @@ public:
|
||||
CNavPath *GetPath(void);
|
||||
CNavPathFollower *GetPathFollower(void);
|
||||
void Idle(void);
|
||||
bool IsIdle(void);
|
||||
bool IsIdle(void)
|
||||
{
|
||||
UNTESTED
|
||||
return m_behavior.IsState(&m_idleState);
|
||||
}
|
||||
void Follow(CBasePlayer *leader);
|
||||
bool IsFollowing(const CBaseEntity *leader);
|
||||
bool IsFollowing(const CBaseEntity *leader = NULL)
|
||||
{
|
||||
UNTESTED
|
||||
return m_behavior.IsState(&m_followState);
|
||||
}
|
||||
void Escape(void);
|
||||
bool IsEscaping(void);
|
||||
void Retreat(void);
|
||||
@ -370,9 +386,12 @@ class CheckAhead
|
||||
{
|
||||
public:
|
||||
/* <47046f> ../cstrike/dlls/hostage/hostage_improv.cpp:525 */
|
||||
bool operator()(class CheckAhead *, class CBaseEntity *)
|
||||
bool operator()(CBaseEntity *entity)
|
||||
{
|
||||
|
||||
// Vector to; // 530
|
||||
// float range; // 531
|
||||
// float const closeRange; // 533
|
||||
// float const aheadTolerance; // 537
|
||||
}
|
||||
/* <46f597> ../cstrike/dlls/hostage/hostage_improv.cpp:546 */
|
||||
bool IsBlocked(void)
|
||||
|
@ -7,24 +7,24 @@
|
||||
|
||||
float CLocalNav::s_flStepSize;
|
||||
int CLocalNav::qptr;
|
||||
EHANDLE CLocalNav::_queue[ MAX_HOSTAGES ];
|
||||
EHANDLE CLocalNav::_queue[ MAX_HOSTAGES_NAV ];
|
||||
int CLocalNav::tot_inqueue;
|
||||
float CLocalNav::nodeval;
|
||||
float CLocalNav::flNextCvarCheck;
|
||||
float CLocalNav::flLastThinkTime;
|
||||
EHANDLE CLocalNav::hostages[ MAX_HOSTAGES ];
|
||||
EHANDLE CLocalNav::hostages[ MAX_HOSTAGES_NAV ];
|
||||
int CLocalNav::tot_hostages;
|
||||
|
||||
#else
|
||||
|
||||
float (*CLocalNav::ps_flStepSize);
|
||||
int (*CLocalNav::pqptr);
|
||||
EHANDLE (*CLocalNav::pqueue)[ MAX_HOSTAGES ];
|
||||
EHANDLE (*CLocalNav::pqueue)[ MAX_HOSTAGES_NAV ];
|
||||
int (*CLocalNav::ptot_inqueue);
|
||||
float (*CLocalNav::pnodeval);
|
||||
float (*CLocalNav::pflNextCvarCheck);
|
||||
float (*CLocalNav::pflLastThinkTime);
|
||||
EHANDLE (*CLocalNav::phostages)[ MAX_HOSTAGES ];
|
||||
EHANDLE (*CLocalNav::phostages)[ MAX_HOSTAGES_NAV ];
|
||||
int (*CLocalNav::ptot_hostages);
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
@ -749,7 +749,7 @@ void CLocalNav::Think(void)
|
||||
{
|
||||
while (tot_inqueue > 0)
|
||||
{
|
||||
if (++qptr == MAX_HOSTAGES)
|
||||
if (++qptr == MAX_HOSTAGES_NAV)
|
||||
qptr = 0;
|
||||
|
||||
tot_inqueue--;
|
||||
@ -770,7 +770,7 @@ void CLocalNav::Think(void)
|
||||
{
|
||||
CHostage *pHostage = GetClassPtr((CHostage *)hostage->pev);
|
||||
|
||||
if (++qptr == MAX_HOSTAGES)
|
||||
if (++qptr == MAX_HOSTAGES_NAV)
|
||||
qptr = 0;
|
||||
|
||||
tot_inqueue--;
|
||||
|
@ -48,6 +48,7 @@ typedef struct localnode_s
|
||||
byte bDepth;
|
||||
BOOL fSearched;
|
||||
node_index_t nindexParent;
|
||||
|
||||
} localnode_t;
|
||||
/* size: 32, cachelines: 1, members: 6 */
|
||||
|
||||
@ -113,13 +114,13 @@ private:
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
static float s_flStepSize;
|
||||
static EHANDLE _queue[ MAX_HOSTAGES ];
|
||||
static EHANDLE _queue[ MAX_HOSTAGES_NAV ];
|
||||
static int qptr;
|
||||
static int tot_inqueue;
|
||||
static float nodeval;
|
||||
static float flNextCvarCheck;
|
||||
static float flLastThinkTime;
|
||||
static EHANDLE hostages[ MAX_HOSTAGES ];
|
||||
static EHANDLE hostages[ MAX_HOSTAGES_NAV ];
|
||||
static int tot_hostages;
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
@ -32,6 +32,8 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
class CHostageImprov;
|
||||
|
||||
/* <46f85d> ../cstrike/dlls/hostage/hostage_states.h:16 */
|
||||
class HostageState: public SimpleState<CHostageImprov *>, public IImprovEvent
|
||||
{
|
||||
@ -63,8 +65,8 @@ public:
|
||||
}
|
||||
|
||||
void UpdateStationaryAnimation(CHostageImprov *improv) { };
|
||||
};/* size: 16, cachelines: 1, members: 2 */
|
||||
|
||||
};/* size: 16, cachelines: 1, members: 2 */
|
||||
|
||||
/* <46fccf> ../cstrike/dlls/hostage/hostage_states.h:38 */
|
||||
class HostageIdleState: public HostageState
|
||||
|
@ -128,11 +128,11 @@ public:
|
||||
public:
|
||||
void Spawn(const char *szGibModel);
|
||||
void EXPORT BounceGibTouch(CBaseEntity *pOther);
|
||||
NOBODY void EXPORT StickyGibTouch(CBaseEntity *pOther);
|
||||
void EXPORT StickyGibTouch(CBaseEntity *pOther);
|
||||
void EXPORT WaitTillLand(void);
|
||||
void LimitVelocity(void);
|
||||
public:
|
||||
NOBODY static void SpawnHeadGib(entvars_t *pevVictim);
|
||||
static void SpawnHeadGib(entvars_t *pevVictim);
|
||||
static void SpawnRandomGibs(entvars_t *pevVictim, int cGibs, int human);
|
||||
NOBODY static void SpawnStickyGibs(entvars_t *pevVictim, Vector vecOrigin, int cGibs);
|
||||
public:
|
||||
@ -158,7 +158,5 @@ public:
|
||||
return baseClass::ScheduleFromName(pName);\
|
||||
return pSchedule;\
|
||||
}
|
||||
// refs
|
||||
extern void (*pCGib__SpawnRandomGibs)(entvars_t *pevVictim, int cGibs, int human);
|
||||
|
||||
#endif // MONSTERS_H
|
||||
|
@ -47,16 +47,26 @@ int CGraph::FindNearestNode(const Vector &vecOrigin, CBaseEntity *pEntity)
|
||||
/* <fc023> ../cstrike/dlls/mpstubb.cpp:45 */
|
||||
float CBaseMonster::ChangeYaw_(int speed)
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
/* <fc571> ../cstrike/dlls/mpstubb.cpp:46 */
|
||||
void CBaseMonster::MakeIdealYaw(Vector vecTarget)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
/* <fc5a6> ../cstrike/dlls/mpstubb.cpp:49 */
|
||||
void CBaseMonster::CorpseFallThink(void)
|
||||
NOBODY void CBaseMonster::CorpseFallThink(void)
|
||||
{
|
||||
if (pev->flags & FL_ONGROUND)
|
||||
{
|
||||
SetThink(NULL);
|
||||
SetSequenceBox();
|
||||
UTIL_SetOrigin(pev, pev->origin);
|
||||
}
|
||||
else
|
||||
pev->nextthink = gpGlobals->time + 0.1;
|
||||
}
|
||||
|
||||
/* <fc2a1> ../cstrike/dlls/mpstubb.cpp:62 */
|
||||
@ -85,20 +95,23 @@ void CBaseMonster::MonsterInitDead_(void)
|
||||
/* <fc057> ../cstrike/dlls/mpstubb.cpp:89 */
|
||||
BOOL CBaseMonster::ShouldFadeOnDeath_(void)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* <fc5cd> ../cstrike/dlls/mpstubb.cpp:94 */
|
||||
BOOL CBaseMonster::FCheckAITrigger(void)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* <fc26d> ../cstrike/dlls/mpstubb.cpp:99 */
|
||||
void CBaseMonster::KeyValue_(KeyValueData *pkvd)
|
||||
{
|
||||
CBaseToggle::KeyValue(pkvd);
|
||||
}
|
||||
|
||||
/* <fc07d> ../cstrike/dlls/mpstubb.cpp:104 */
|
||||
int CBaseMonster::IRelationship_(CBaseEntity *pTarget)
|
||||
NOBODY int CBaseMonster::IRelationship_(CBaseEntity *pTarget)
|
||||
{
|
||||
// {
|
||||
// int const iEnemy; // 106
|
||||
@ -106,7 +119,7 @@ int CBaseMonster::IRelationship_(CBaseEntity *pTarget)
|
||||
}
|
||||
|
||||
/* <fc0e4> ../cstrike/dlls/mpstubb.cpp:140 */
|
||||
void CBaseMonster::Look_(int iDistance)
|
||||
NOBODY void CBaseMonster::Look_(int iDistance)
|
||||
{
|
||||
// {
|
||||
// int iSighted; // 142
|
||||
@ -129,7 +142,7 @@ void CBaseMonster::Look_(int iDistance)
|
||||
}
|
||||
|
||||
/* <fc317> ../cstrike/dlls/mpstubb.cpp:220 */
|
||||
CBaseEntity *CBaseMonster::BestVisibleEnemy_(void)
|
||||
NOBODY CBaseEntity *CBaseMonster::BestVisibleEnemy_(void)
|
||||
{
|
||||
// {
|
||||
// class CBaseEntity *pReturn; // 222
|
||||
|
@ -145,17 +145,24 @@ NOBODY void CMapInfo::Spawn_(void)
|
||||
}
|
||||
|
||||
/* <114673> ../cstrike/dlls/multiplay_gamerules.cpp:288 */
|
||||
//void info_map_parameters(entvars_t *pev)
|
||||
//{
|
||||
// GetClassPtr<CMapInfo>(CMapInfo *a); // 288
|
||||
//}
|
||||
LINK_ENTITY_TO_CLASS(info_map_parameters, CMapInfo);
|
||||
|
||||
/* <11474f> ../cstrike/dlls/multiplay_gamerules.cpp:331 */
|
||||
NOBODY void Broadcast(const char *sentence)
|
||||
void Broadcast(const char *sentence)
|
||||
{
|
||||
// {
|
||||
// char text; // 333
|
||||
// }
|
||||
char text[32];
|
||||
|
||||
if (!sentence)
|
||||
return;
|
||||
|
||||
Q_strcpy(text, "%!MRAD_");
|
||||
Q_strcat(text, UTIL_VarArgs("%s", sentence));
|
||||
|
||||
MESSAGE_BEGIN(MSG_BROADCAST, gmsgSendAudio);
|
||||
WRITE_BYTE(0);
|
||||
WRITE_STRING(text);
|
||||
WRITE_SHORT(100);
|
||||
MESSAGE_END();
|
||||
}
|
||||
|
||||
/* <111767> ../cstrike/dlls/multiplay_gamerules.cpp:348 */
|
||||
@ -651,34 +658,94 @@ NOBODY void CHalfLifeMultiplay::RestartRound_(void)
|
||||
// }
|
||||
}
|
||||
|
||||
/* <114d20> ../cstrike/dlls/multiplay_gamerules.cpp:2097 */
|
||||
NOBODY BOOL CHalfLifeMultiplay::IsThereABomb(void)
|
||||
/* <114ca3> ../cstrike/dlls/multiplay_gamerules.cpp:2073 */
|
||||
BOOL CHalfLifeMultiplay::IsThereABomber(void)
|
||||
{
|
||||
// {
|
||||
// class CGrenade *pC4; // 2099
|
||||
// class CBaseEntity *pWeaponC4; // 2100
|
||||
// BOOL bFoundBomb; // 2101
|
||||
// }
|
||||
CBasePlayer *pPlayer = NULL;
|
||||
|
||||
while ((pPlayer = (CBasePlayer *)UTIL_FindEntityByClassname(pPlayer, "player")) != NULL)
|
||||
{
|
||||
if (FNullEnt(pPlayer->edict()))
|
||||
break;
|
||||
|
||||
if (pPlayer->m_iTeam != CT && pPlayer->IsBombGuy())
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* <114ca3> ../cstrike/dlls/multiplay_gamerules.cpp:2073 */
|
||||
NOBODY BOOL CHalfLifeMultiplay::IsThereABomber(void)
|
||||
return FALSE;
|
||||
|
||||
}
|
||||
|
||||
/* <114d20> ../cstrike/dlls/multiplay_gamerules.cpp:2097 */
|
||||
BOOL CHalfLifeMultiplay::IsThereABomb(void)
|
||||
{
|
||||
// {
|
||||
// class CBasePlayer *pPlayer; // 2075
|
||||
// edict(CBaseEntity *const this); // 2079
|
||||
// FNullEnt(const edict_t *pent); // 2079
|
||||
// }
|
||||
CGrenade *pC4 = NULL;
|
||||
CBaseEntity *pWeaponC4 = NULL;
|
||||
BOOL bFoundBomb = FALSE;
|
||||
|
||||
while ((pWeaponC4 = UTIL_FindEntityByClassname(pWeaponC4, "grenade")) != NULL)
|
||||
{
|
||||
if (!pWeaponC4)
|
||||
continue;
|
||||
|
||||
pC4 = (CGrenade *)pWeaponC4;
|
||||
|
||||
if (pC4->m_bIsC4)
|
||||
{
|
||||
bFoundBomb = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (bFoundBomb || (UTIL_FindEntityByClassname(NULL, "weapon_c4")) != NULL)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
|
||||
}
|
||||
|
||||
/* <114d83> ../cstrike/dlls/multiplay_gamerules.cpp:2129 */
|
||||
NOBODY BOOL CHalfLifeMultiplay::TeamFull(int team_id)
|
||||
BOOL CHalfLifeMultiplay::TeamFull(int team_id)
|
||||
{
|
||||
switch (team_id)
|
||||
{
|
||||
case TERRORIST:
|
||||
return (m_iNumTerrorist >= m_iSpawnPointCount_Terrorist);
|
||||
case CT:
|
||||
return (m_iNumCT >= m_iSpawnPointCount_CT);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* <114dbb> ../cstrike/dlls/multiplay_gamerules.cpp:2144 */
|
||||
NOBODY BOOL CHalfLifeMultiplay::TeamStacked(int newTeam_id, int curTeam_id)
|
||||
BOOL CHalfLifeMultiplay::TeamStacked(int newTeam_id, int curTeam_id)
|
||||
{
|
||||
if (newTeam_id == curTeam_id)
|
||||
return FALSE;
|
||||
|
||||
if (!m_iLimitTeams)
|
||||
return FALSE;
|
||||
|
||||
switch (newTeam_id)
|
||||
{
|
||||
case TERRORIST:
|
||||
{
|
||||
if (curTeam_id != UNASSIGNED && curTeam_id != SPECTATOR)
|
||||
return ((m_iNumTerrorist + 1) > (m_iNumCT + m_iLimitTeams - 1));
|
||||
else
|
||||
return ((m_iNumTerrorist + 1) > (m_iNumCT + m_iLimitTeams));
|
||||
}
|
||||
case CT:
|
||||
{
|
||||
if (curTeam_id != UNASSIGNED && curTeam_id != SPECTATOR)
|
||||
return ((m_iNumCT + 1) > (m_iNumTerrorist + m_iLimitTeams - 1));
|
||||
else
|
||||
return ((m_iNumCT + 1) > (m_iNumTerrorist + m_iLimitTeams));
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* <114e2b> ../cstrike/dlls/multiplay_gamerules.cpp:2214 */
|
||||
@ -1101,8 +1168,10 @@ NOBODY void CHalfLifeMultiplay::ClientDisconnected_(edict_t *pClient)
|
||||
}
|
||||
|
||||
/* <112a05> ../cstrike/dlls/multiplay_gamerules.cpp:3428 */
|
||||
NOBODY float CHalfLifeMultiplay::FlPlayerFallDamage_(CBasePlayer *pPlayer)
|
||||
float CHalfLifeMultiplay::FlPlayerFallDamage_(CBasePlayer *pPlayer)
|
||||
{
|
||||
pPlayer->m_flFallVelocity -= PLAYER_MAX_SAFE_FALL_SPEED;
|
||||
return pPlayer->m_flFallVelocity * DAMAGE_FOR_FALL_SPEED * 1.25;
|
||||
}
|
||||
|
||||
/* <112a3d> ../cstrike/dlls/multiplay_gamerules.cpp:3436 */
|
||||
@ -1256,7 +1325,7 @@ NOBODY void CHalfLifeMultiplay::DeathNotice_(CBasePlayer *pVictim, entvars_t *pK
|
||||
}
|
||||
|
||||
/* <112b2e> ../cstrike/dlls/multiplay_gamerules.cpp:3916 */
|
||||
void CHalfLifeMultiplay::PlayerGotWeapon_(CBasePlayer *pPlayer, class CBasePlayerItem *pWeapon)
|
||||
void CHalfLifeMultiplay::PlayerGotWeapon_(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ NOBODY CPathTrack *CPathTrack::ValidPath(CPathTrack *ppath, int testFlag)
|
||||
}
|
||||
|
||||
/* <122745> ../cstrike/dlls/pathcorner.cpp:198 */
|
||||
NOBODY void CPathTrack::Project(CPathTrack *pstart, class CPathTrack *pend, Vector *origin, float dist)
|
||||
NOBODY void CPathTrack::Project(CPathTrack *pstart, CPathTrack *pend, Vector *origin, float dist)
|
||||
{
|
||||
// {
|
||||
// Vector dir; // 202
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -51,6 +51,12 @@
|
||||
#define PLAYER_MAX_SAFE_FALL_SPEED 500.0f
|
||||
#define PLAYER_SEARCH_RADIUS 64.0f
|
||||
|
||||
#define ARMOR_RATIO 0.5 // Armor Takes 50% of the damage
|
||||
#define ARMOR_BONUS 0.5 // Each Point of Armor is work 1/x points of health
|
||||
|
||||
#define FLASH_DRAIN_TIME 1.2 // 100 units/3 minutes
|
||||
#define FLASH_CHARGE_TIME 0.2 // 100 units/20 seconds (seconds per unit)
|
||||
|
||||
// damage per unit per second.
|
||||
#define DAMAGE_FOR_FALL_SPEED 100.0f / (PLAYER_FATAL_FALL_SPEED - PLAYER_MAX_SAFE_FALL_SPEED)
|
||||
#define PLAYER_MIN_BOUNCE_SPEED 350.0f
|
||||
@ -80,30 +86,6 @@
|
||||
#define TRAIN_ACTIVE 0x80
|
||||
#define TRAIN_NEW 0xc0
|
||||
|
||||
#define DHF_ROUND_STARTED (1<<1)
|
||||
#define DHF_HOSTAGE_SEEN_FAR (1<<2)
|
||||
#define DHF_HOSTAGE_SEEN_NEAR (1<<3)
|
||||
#define DHF_HOSTAGE_USED (1<<4)
|
||||
#define DHF_HOSTAGE_INJURED (1<<5)
|
||||
#define DHF_HOSTAGE_KILLED (1<<6)
|
||||
#define DHF_FRIEND_SEEN (1<<7)
|
||||
#define DHF_ENEMY_SEEN (1<<8)
|
||||
#define DHF_FRIEND_INJURED (1<<9)
|
||||
#define DHF_FRIEND_KILLED (1<<10)
|
||||
#define DHF_ENEMY_KILLED (1<<11)
|
||||
#define DHF_BOMB_RETRIEVED (1<<12)
|
||||
#define DHF_AMMO_EXHAUSTED (1<<15)
|
||||
#define DHF_IN_TARGET_ZONE (1<<16)
|
||||
#define DHF_IN_RESCUE_ZONE (1<<17)
|
||||
#define DHF_IN_ESCAPE_ZONE (1<<18)
|
||||
#define DHF_IN_VIPSAFETY_ZONE (1<<19)
|
||||
#define DHF_NIGHTVISION (1<<20)
|
||||
#define DHF_HOSTAGE_CTMOVE (1<<21)
|
||||
#define DHF_SPEC_DUCK (1<<22)
|
||||
|
||||
#define DHM_ROUND_CLEAR (DHF_ROUND_STARTED | DHF_HOSTAGE_KILLED | DHF_FRIEND_KILLED | DHF_BOMB_RETRIEVED)
|
||||
#define DHM_CONNECT_CLEAR (DHF_HOSTAGE_SEEN_FAR | DHF_HOSTAGE_SEEN_NEAR | DHF_HOSTAGE_USED | DHF_HOSTAGE_INJURED | DHF_FRIEND_SEEN | DHF_ENEMY_SEEN | DHF_FRIEND_INJURED | DHF_ENEMY_KILLED | DHF_AMMO_EXHAUSTED | DHF_IN_TARGET_ZONE | DHF_IN_RESCUE_ZONE | DHF_IN_ESCAPE_ZONE | DHF_IN_VIPSAFETY_ZONE | DHF_HOSTAGE_CTMOVE | DHF_SPEC_DUCK)
|
||||
|
||||
#define SIGNAL_BUY (1<<0)
|
||||
#define SIGNAL_BOMB (1<<1)
|
||||
#define SIGNAL_RESCUE (1<<2)
|
||||
@ -157,6 +139,7 @@ typedef enum
|
||||
PLAYER_LARGE_FLINCH,
|
||||
PLAYER_RELOAD,
|
||||
PLAYER_HOLDBOMB
|
||||
|
||||
} PLAYER_ANIM;
|
||||
|
||||
typedef enum
|
||||
@ -176,6 +159,7 @@ typedef enum
|
||||
Menu_Radio2,
|
||||
Menu_Radio3,
|
||||
Menu_ClientBuy
|
||||
|
||||
} _Menu;
|
||||
|
||||
typedef enum
|
||||
@ -184,6 +168,7 @@ typedef enum
|
||||
TERRORIST,
|
||||
CT,
|
||||
SPECTATOR,
|
||||
|
||||
} TeamName;
|
||||
|
||||
typedef enum
|
||||
@ -200,6 +185,7 @@ typedef enum
|
||||
MODEL_VIP,
|
||||
MODEL_MILITIA,
|
||||
MODEL_SPETSNAZ
|
||||
|
||||
} ModelName;
|
||||
|
||||
typedef enum
|
||||
@ -210,6 +196,7 @@ typedef enum
|
||||
SHOWTEAMSELECT,
|
||||
PICKINGTEAM,
|
||||
GETINTOGAME
|
||||
|
||||
} JoinState;
|
||||
|
||||
typedef enum
|
||||
@ -223,6 +210,7 @@ typedef enum
|
||||
CMD_LISTPLAYERS,
|
||||
CMD_NIGHTVISION,
|
||||
COMMANDS_TO_TRACK,
|
||||
|
||||
} TrackCommands;
|
||||
|
||||
typedef struct
|
||||
@ -237,6 +225,7 @@ typedef struct
|
||||
int m_defuser;
|
||||
int m_nightVision;
|
||||
int m_armor;
|
||||
|
||||
} RebuyStruct;
|
||||
|
||||
typedef enum
|
||||
@ -248,6 +237,7 @@ typedef enum
|
||||
THROW_BOMB,
|
||||
THROW_GRENADE,
|
||||
THROW_HITVEL_MINUS_AIRVEL
|
||||
|
||||
} ThrowDirection;
|
||||
|
||||
enum sbar_data
|
||||
@ -263,6 +253,7 @@ typedef enum
|
||||
SILENT,
|
||||
CALM,
|
||||
INTENSE
|
||||
|
||||
} MusicState;
|
||||
|
||||
struct WeaponStruct
|
||||
@ -281,6 +272,7 @@ struct WeaponStruct
|
||||
#define g_weaponStruct (*pg_weaponStruct)
|
||||
#define gEvilImpulse101 (*pgEvilImpulse101)
|
||||
#define g_szMapBriefingText (*pg_szMapBriefingText)
|
||||
#define g_pevLastInflictor (*pg_pevLastInflictor)
|
||||
#define g_pLastSpawn (*pg_pLastSpawn)
|
||||
#define g_pLastCTSpawn (*pg_pLastCTSpawn)
|
||||
#define g_pLastTerroristSpawn (*pg_pLastTerroristSpawn)
|
||||
@ -464,9 +456,8 @@ public:
|
||||
class CBasePlayer: public CBaseMonster
|
||||
{
|
||||
public:
|
||||
enum { MaxLocationLen = 32 };
|
||||
|
||||
NOBODY virtual void Spawn(void);
|
||||
virtual void Spawn(void);
|
||||
virtual void Precache(void);
|
||||
virtual int Save(CSave &save);
|
||||
virtual int Restore(CRestore &restore);
|
||||
@ -476,65 +467,65 @@ public:
|
||||
}
|
||||
virtual int Classify(void);
|
||||
virtual void TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType);
|
||||
NOBODY virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
|
||||
NOBODY virtual int TakeHealth(float flHealth, int bitsDamageType);
|
||||
NOBODY virtual void Killed(entvars_t *pevAttacker, int iGib);
|
||||
virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
|
||||
virtual int TakeHealth(float flHealth, int bitsDamageType);
|
||||
virtual void Killed(entvars_t *pevAttacker, int iGib);
|
||||
virtual void AddPoints(int score, BOOL bAllowNegativeScore);
|
||||
NOBODY virtual void AddPointsToTeam(int score, BOOL bAllowNegativeScore);
|
||||
virtual void AddPointsToTeam(int score, BOOL bAllowNegativeScore);
|
||||
virtual BOOL AddPlayerItem(CBasePlayerItem *pItem);
|
||||
virtual BOOL RemovePlayerItem(CBasePlayerItem *pItem);
|
||||
virtual int GiveAmmo(int iAmount, char *szName, int iMax);
|
||||
NOBODY virtual void StartSneaking(void)
|
||||
virtual void StartSneaking(void)
|
||||
{
|
||||
StartSneaking_();
|
||||
}
|
||||
NOBODY virtual void StopSneaking(void)
|
||||
virtual void StopSneaking(void)
|
||||
{
|
||||
StopSneaking_();
|
||||
}
|
||||
NOBODY virtual BOOL IsSneaking(void)
|
||||
virtual BOOL IsSneaking(void)
|
||||
{
|
||||
return IsSneaking_();
|
||||
}
|
||||
NOBODY virtual BOOL IsAlive(void)
|
||||
virtual BOOL IsAlive(void)
|
||||
{
|
||||
return IsAlive_();
|
||||
}
|
||||
NOBODY virtual BOOL IsPlayer(void)
|
||||
virtual BOOL IsPlayer(void)
|
||||
{
|
||||
return IsPlayer_();
|
||||
}
|
||||
NOBODY virtual BOOL IsNetClient(void)
|
||||
virtual BOOL IsNetClient(void)
|
||||
{
|
||||
return IsNetClient_();
|
||||
}
|
||||
virtual const char *TeamID(void);
|
||||
virtual BOOL FBecomeProne(void);
|
||||
NOBODY virtual Vector BodyTarget(const Vector &posSrc)
|
||||
virtual Vector BodyTarget(const Vector &posSrc)
|
||||
{
|
||||
return BodyTarget_(posSrc);
|
||||
}
|
||||
virtual int Illumination(void);
|
||||
NOBODY virtual BOOL ShouldFadeOnDeath(void)
|
||||
virtual BOOL ShouldFadeOnDeath(void)
|
||||
{
|
||||
return ShouldFadeOnDeath_();
|
||||
}
|
||||
virtual void ResetMaxSpeed(void);
|
||||
NOBODY virtual void Jump(void);
|
||||
NOBODY virtual void Duck(void);
|
||||
NOBODY virtual void PreThink(void);
|
||||
NOBODY virtual void PostThink(void);
|
||||
NOBODY virtual Vector GetGunPosition(void);
|
||||
NOBODY virtual BOOL IsBot(void)
|
||||
virtual void Jump(void);
|
||||
virtual void Duck(void);
|
||||
virtual void PreThink(void);
|
||||
virtual void PostThink(void);
|
||||
virtual Vector GetGunPosition(void);
|
||||
virtual BOOL IsBot(void)
|
||||
{
|
||||
return IsBot_();
|
||||
}
|
||||
NOBODY virtual void UpdateClientData(void);
|
||||
virtual void UpdateClientData(void);
|
||||
virtual void ImpulseCommands(void);
|
||||
virtual void RoundRespawn(void);
|
||||
virtual Vector GetAutoaimVector(float flDelta);
|
||||
virtual void Blind(float flUntilTime, float flHoldTime, float flFadeTime, int iAlpha);
|
||||
NOBODY virtual void OnTouchingWeapon(CWeaponBox *pWeapon)
|
||||
virtual void OnTouchingWeapon(CWeaponBox *pWeapon)
|
||||
{
|
||||
OnTouchingWeapon_(pWeapon);
|
||||
}
|
||||
@ -628,16 +619,16 @@ public:
|
||||
{
|
||||
return pev->iuser1;
|
||||
}
|
||||
NOBODY void PlantC4(void);
|
||||
NOXREF void PlantC4(void);
|
||||
void Radio(const char *msg_id, const char *msg_verbose, short pitch = 100, bool showIcon = true);
|
||||
NOXREF CBasePlayer *GetNextRadioRecipient(CBasePlayer *pStartPlayer);
|
||||
void SmartRadio(void);
|
||||
NOXREF void ThrowWeapon(char *pszItemName);
|
||||
NOXREF void ThrowPrimary(void);
|
||||
void AddAccount(int amount, bool bTrackChange = true);
|
||||
NOBODY void Disappear(void);
|
||||
void Disappear(void);
|
||||
void MakeVIP(void);
|
||||
NOBODY bool CanPlayerBuy(bool display);
|
||||
bool CanPlayerBuy(bool display = false);
|
||||
void SwitchTeam(void);
|
||||
void TabulateAmmo(void);
|
||||
void Pain(int m_LastHitGroup, bool HasArmour);
|
||||
@ -649,13 +640,13 @@ public:
|
||||
void PackDeadPlayerItems(void);
|
||||
void GiveDefaultItems(void);
|
||||
void RemoveAllItems(BOOL removeSuit);
|
||||
void SetBombIcon(BOOL bFlash);
|
||||
void SetBombIcon(BOOL bFlash = FALSE);
|
||||
void SetProgressBarTime(int time);
|
||||
void SetProgressBarTime2(int time, float timeElapsed);
|
||||
void SetPlayerModel(BOOL HasC4);
|
||||
void SetNewPlayerModel(const char *modelName);
|
||||
BOOL SwitchWeapon(CBasePlayerItem *pWeapon);
|
||||
NOXREF void CheckPowerups(entvars_t *pev);
|
||||
void CheckPowerups(entvars_t *pev);
|
||||
bool CanAffordPrimary(void);
|
||||
bool CanAffordPrimaryAmmo(void);
|
||||
bool CanAffordSecondaryAmmo(void);
|
||||
@ -671,64 +662,67 @@ public:
|
||||
BOOL FlashlightIsOn(void);
|
||||
void FlashlightTurnOn(void);
|
||||
void FlashlightTurnOff(void);
|
||||
NOBODY void UpdatePlayerSound(void);
|
||||
NOXREF void DeathSound(void);
|
||||
void UpdatePlayerSound(void);
|
||||
void DeathSound(void);
|
||||
void SetAnimation(PLAYER_ANIM playerAnim);
|
||||
NOBODY void SetWeaponAnimType(const char *szExtention);
|
||||
NOXREF void SetWeaponAnimType(const char *szExtention)
|
||||
{
|
||||
Q_strcpy(m_szAnimExtention, szExtention);
|
||||
}
|
||||
void CheatImpulseCommands(int iImpulse);
|
||||
NOXREF void StartDeathCam(void);
|
||||
NOBODY void StartObserver(Vector vecPosition, Vector vecViewAngle);
|
||||
void StartDeathCam(void);
|
||||
void StartObserver(Vector vecPosition, Vector vecViewAngle);
|
||||
void HandleSignals(void);
|
||||
void DropPlayerItem(const char *pszItemName);
|
||||
BOOL HasPlayerItem(CBasePlayerItem *pCheckItem);
|
||||
BOOL HasNamedPlayerItem(const char *pszItemName);
|
||||
NOXREF BOOL HasWeapons(void);
|
||||
BOOL HasWeapons(void);
|
||||
NOXREF void SelectPrevItem(int iItem);
|
||||
NOXREF void SelectNextItem(int iItem);
|
||||
void SelectLastItem(void);
|
||||
void SelectItem(const char *pstr);
|
||||
NOXREF void ItemPreFrame(void);
|
||||
NOXREF void ItemPostFrame(void);
|
||||
void ItemPreFrame(void);
|
||||
void ItemPostFrame(void);
|
||||
void GiveNamedItem(const char *pszName);
|
||||
void EnableControl(BOOL fControl);
|
||||
bool HintMessage(const char *pMessage, BOOL bDisplayIfPlayerDead = FALSE, BOOL bOverride = FALSE);
|
||||
void SendAmmoUpdate(void);
|
||||
NOXREF void SendFOV(int fov);
|
||||
NOBODY void WaterMove(void);
|
||||
NOBODY void EXPORT PlayerDeathThink(void);
|
||||
void SendFOV(int fov);
|
||||
void WaterMove(void);
|
||||
void EXPORT PlayerDeathThink(void);
|
||||
void PlayerUse(void);
|
||||
NOBODY void HostageUsed(void);
|
||||
NOBODY void JoiningThink(void);
|
||||
NOBODY void RemoveLevelText(void);
|
||||
void HostageUsed(void);
|
||||
void JoiningThink(void);
|
||||
void RemoveLevelText(void);
|
||||
void WINAPI_HOOK MenuPrint(const char *msg);
|
||||
void ResetMenu(void);
|
||||
void SyncRoundTimer(void);
|
||||
NOXREF void CheckSuitUpdate(void);
|
||||
void CheckSuitUpdate(void);
|
||||
void SetSuitUpdate(char *name = NULL, int fgroup = 0, int iNoRepeatTime = 0);
|
||||
NOXREF void UpdateGeigerCounter(void);
|
||||
NOBODY void CheckTimeBasedDamage(void);
|
||||
void UpdateGeigerCounter(void);
|
||||
void CheckTimeBasedDamage(void);
|
||||
NOXREF void BarnacleVictimBitten(entvars_t *pevBarnacle);
|
||||
NOXREF void BarnacleVictimReleased(void);
|
||||
static int GetAmmoIndex(const char *psz);
|
||||
int AmmoInventory(int iAmmoIndex);
|
||||
void ResetAutoaim(void);
|
||||
Vector AutoaimDeflection(class Vector &vecSrc, float flDist, float flDelta);
|
||||
Vector AutoaimDeflection(Vector &vecSrc, float flDist, float flDelta);
|
||||
void ForceClientDllUpdate(void);
|
||||
void DeathMessage(entvars_t *pevAttacker) { };
|
||||
void SetCustomDecalFrames(int);
|
||||
NOXREF int GetCustomDecalFrames(void);
|
||||
NOXREF void InitStatusBar(void);
|
||||
void SetCustomDecalFrames(int nFrames);
|
||||
int GetCustomDecalFrames(void);
|
||||
void InitStatusBar(void);
|
||||
void UpdateStatusBar(void);
|
||||
void StudioEstimateGait(void);
|
||||
NOXREF void StudioPlayerBlend(int *pBlend, float *pPitch);
|
||||
NOXREF void CalculatePitchBlend(void);
|
||||
void StudioPlayerBlend(int *pBlend, float *pPitch);
|
||||
void CalculatePitchBlend(void);
|
||||
void CalculateYawBlend(void);
|
||||
void StudioProcessGait(void);
|
||||
NOXREF void SendHostagePos(void);
|
||||
void SendHostagePos(void);
|
||||
void SendHostageIcons(void);
|
||||
NOXREF void ResetStamina(void);
|
||||
NOXREF BOOL IsArmored(int nHitGroup);
|
||||
NOXREF BOOL ShouldDoLargeFlinch(int nHitGroup, int nGunType);
|
||||
void ResetStamina(void);
|
||||
BOOL IsArmored(int nHitGroup);
|
||||
BOOL ShouldDoLargeFlinch(int nHitGroup, int nGunType);
|
||||
void SetPrefsFromUserinfo(char *infobuffer);
|
||||
void SendWeatherInfo(void);
|
||||
void UpdateShieldCrosshair(bool);
|
||||
@ -738,8 +732,8 @@ public:
|
||||
return HasShield() && m_bShieldDrawn;
|
||||
}
|
||||
void RemoveShield(void);
|
||||
void DropShield(bool);
|
||||
NOBODY void GiveShield(bool);
|
||||
void DropShield(bool bDeploy = true);
|
||||
void GiveShield(bool bDeploy = true);
|
||||
bool IsHittingShield(Vector &vecDirection, TraceResult *ptr);
|
||||
bool IsReloading(void)
|
||||
{
|
||||
@ -750,7 +744,7 @@ public:
|
||||
}
|
||||
bool IsBlind(void)
|
||||
{
|
||||
return (gpGlobals->time > m_blindUntilTime);
|
||||
return (m_blindUntilTime > gpGlobals->time);
|
||||
}
|
||||
bool IsAutoFollowAllowed(void)
|
||||
{
|
||||
@ -766,7 +760,7 @@ public:
|
||||
}
|
||||
void ClearAutoBuyData(void);
|
||||
void AddAutoBuyData(const char *str);
|
||||
NOBODY void AutoBuy(void);
|
||||
void AutoBuy(void);
|
||||
void ClientCommand(const char *cmd, const char *arg1 = NULL, const char *arg2 = NULL, const char *arg3 = NULL);
|
||||
void PrioritizeAutoBuyString(char *autobuyString, const char *priorityString);
|
||||
NOBODY const char *PickPrimaryCareerTaskWeapon(void);
|
||||
@ -790,7 +784,7 @@ public:
|
||||
void RebuyDefuser(void);
|
||||
void RebuyNightVision(void);
|
||||
void RebuyArmor(void);
|
||||
void UpdateLocation(bool forceUpdate);
|
||||
void UpdateLocation(bool forceUpdate = false);
|
||||
void SetObserverAutoDirector(bool val)
|
||||
{
|
||||
m_bObserverAutoDirector = val;
|
||||
@ -800,13 +794,16 @@ public:
|
||||
{
|
||||
return m_canSwitchObserverModes;
|
||||
}
|
||||
NOBODY void Intense(void)
|
||||
NOXREF void Intense(void)
|
||||
{
|
||||
//m_musicState = INTENSE;
|
||||
//m_intenseTimestamp = gpGlobals->time;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
enum { MaxLocationLen = 32 };
|
||||
|
||||
int random_seed;
|
||||
unsigned short m_usPlayerBleed;
|
||||
EHANDLE m_hObserverTarget;
|
||||
@ -1004,14 +1001,21 @@ public:
|
||||
float m_flLastCommandTime[8];
|
||||
|
||||
};/* size: 2500, cachelines: 40, members: 190 */
|
||||
/* Line - 2500 | Windows - 2480 */
|
||||
|
||||
/* <14ed87> ../cstrike/dlls/player.cpp:3407 */
|
||||
class CWShield: public CBaseEntity
|
||||
{
|
||||
public:
|
||||
NOBODY virtual void Spawn(void);
|
||||
NOBODY virtual void EXPORT Touch(CBaseEntity *pOther);
|
||||
virtual void Spawn(void);
|
||||
virtual void EXPORT Touch(CBaseEntity *pOther);
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
||||
void Spawn_(void);
|
||||
void Touch_(CBaseEntity *pOther);
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
public:
|
||||
/* <14e77d> ../cstrike/dlls/player.cpp:3410 */
|
||||
void SetCantBePickedUpByUser(CBaseEntity *pEntity, float time)
|
||||
@ -1019,9 +1023,11 @@ public:
|
||||
m_hEntToIgnoreTouchesFrom = pEntity;
|
||||
m_flTimeToIgnoreTouches = gpGlobals->time + time;
|
||||
}
|
||||
|
||||
public:
|
||||
EHANDLE m_hEntToIgnoreTouchesFrom;
|
||||
float m_flTimeToIgnoreTouches;
|
||||
|
||||
};/* size: 164, cachelines: 3, members: 3 */
|
||||
|
||||
extern char *m_szPoses[4];
|
||||
@ -1029,6 +1035,7 @@ extern WeaponStruct g_weaponStruct[MAX_WEAPONS];
|
||||
|
||||
extern int gEvilImpulse101;
|
||||
extern char g_szMapBriefingText[512];
|
||||
extern entvars_t *g_pevLastInflictor;
|
||||
extern CBaseEntity *g_pLastSpawn;
|
||||
extern CBaseEntity *g_pLastCTSpawn;
|
||||
extern CBaseEntity *g_pLastTerroristSpawn;
|
||||
@ -1120,12 +1127,13 @@ extern int gmsgBrass;
|
||||
extern int gmsgFog;
|
||||
extern int gmsgShowTimer;
|
||||
|
||||
//NOBODY void player(entvars_t *pev);
|
||||
//NOBODY void weapon_shield(entvars_t *pev);
|
||||
//NOBODY void info_intermission(entvars_t *pev);
|
||||
//NOBODY void player_loadsaved(entvars_t *pev);
|
||||
//NOBODY void player_weaponstrip(entvars_t *pev);
|
||||
//NOBODY void monster_hevsuit_dead(entvars_t *pev);
|
||||
// linked objects
|
||||
C_DLLEXPORT void player(entvars_t *pev);
|
||||
C_DLLEXPORT void weapon_shield(entvars_t *pev);
|
||||
C_DLLEXPORT void info_intermission(entvars_t *pev);
|
||||
C_DLLEXPORT void player_loadsaved(entvars_t *pev);
|
||||
C_DLLEXPORT void player_weaponstrip(entvars_t *pev);
|
||||
C_DLLEXPORT void monster_hevsuit_dead(entvars_t *pev);
|
||||
|
||||
void OLD_CheckBuyZone(CBasePlayer *player);
|
||||
void OLD_CheckBombTarget(CBasePlayer *player);
|
||||
@ -1144,7 +1152,7 @@ void EscapeZoneIcon_Clear(CBasePlayer *player);
|
||||
void VIP_SafetyZoneIcon_Set(CBasePlayer *player);
|
||||
void VIP_SafetyZoneIcon_Clear(CBasePlayer *player);
|
||||
|
||||
NOBODY void LinkUserMessages(void);
|
||||
void LinkUserMessages(void);
|
||||
void WriteSigonMessages(void);
|
||||
void SendItemStatus(CBasePlayer *pPlayer);
|
||||
const char *GetCSModelName(int item_id);
|
||||
@ -1154,7 +1162,7 @@ const char *GetWeaponName(entvars_t *pevInflictor, entvars_t *pKiller);
|
||||
void LogAttack(CBasePlayer *pAttacker, CBasePlayer *pVictim, int teamAttack, int healthHit, int armorHit, int newHealth, int newArmor, const char *killer_weapon_name);
|
||||
void packPlayerItem(CBasePlayer *pPlayer, CBasePlayerItem *pItem, bool packAmmo);
|
||||
bool CanSeeUseable(CBasePlayer *me, CBaseEntity *entity);
|
||||
NOBODY void FixPlayerCrouchStuck(edict_t *pPlayer);
|
||||
NOXREF void FixPlayerCrouchStuck(edict_t *pPlayer);
|
||||
BOOL IsSpawnPointValid(CBaseEntity *pPlayer, CBaseEntity *pSpot);
|
||||
NOXREF void InitZombieSpawns(void);
|
||||
NOXREF CBaseEntity *FindZombieSpawn(CBaseEntity *player, bool forceSpawn);
|
||||
@ -1173,6 +1181,7 @@ NOXREF const char *GetWeaponAliasFromName(const char *weaponName);
|
||||
NOXREF bool CurrentWeaponSatisfies(CBasePlayerWeapon *pWeapon, int id, int classId);
|
||||
|
||||
// refs
|
||||
extern void (*CBasePlayer__UpdateClientData)(void);
|
||||
extern void (*pCBasePlayer__PickPrimaryCareerTaskWeapon)(void);
|
||||
extern void (*pCBasePlayer__PickSecondaryCareerTaskWeapon)(void);
|
||||
|
||||
#endif // PLAYER_H
|
||||
|
@ -42,20 +42,6 @@
|
||||
#define IMPLEMENT_ARRAY_CLASS(baseClass,var)\
|
||||
baseClass::var
|
||||
|
||||
#define IMPLEMENT_SAVERESTORE(derivedClass,baseClass)\
|
||||
int derivedClass::Save(CSave &save)\
|
||||
{\
|
||||
if (!baseClass::Save(save))\
|
||||
return 0;\
|
||||
return save.WriteFields(#derivedClass, this, m_SaveData, ARRAYSIZE(m_SaveData));\
|
||||
}\
|
||||
int derivedClass::Restore(CRestore &restore)\
|
||||
{\
|
||||
if (!baseClass::Restore(restore))\
|
||||
return 0;\
|
||||
return restore.ReadFields(#derivedClass, this, m_SaveData, ARRAYSIZE(m_SaveData));\
|
||||
}
|
||||
|
||||
#else // HOOK_GAMEDLL
|
||||
|
||||
#define IMPLEMENT_ARRAY(var)\
|
||||
@ -64,22 +50,22 @@
|
||||
#define IMPLEMENT_ARRAY_CLASS(baseClass,var)\
|
||||
(*baseClass::p##var)
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
#define IMPLEMENT_SAVERESTORE(derivedClass, baseClass)\
|
||||
int derivedClass::Save_(CSave &save)\
|
||||
{\
|
||||
if (!baseClass::Save(save))\
|
||||
return 0;\
|
||||
return save.WriteFields(#derivedClass, this, (*pm_SaveData), ARRAYSIZE(*pm_SaveData));\
|
||||
return save.WriteFields(#derivedClass, this, IMPLEMENT_ARRAY(m_SaveData), ARRAYSIZE(IMPLEMENT_ARRAY(m_SaveData)));\
|
||||
}\
|
||||
int derivedClass::Restore_(CRestore &restore)\
|
||||
{\
|
||||
if (!baseClass::Restore(restore))\
|
||||
return 0;\
|
||||
return restore.ReadFields(#derivedClass, this, (*pm_SaveData), ARRAYSIZE(*pm_SaveData));\
|
||||
return restore.ReadFields(#derivedClass, this, IMPLEMENT_ARRAY(m_SaveData), ARRAYSIZE(IMPLEMENT_ARRAY(m_SaveData)));\
|
||||
}
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GLOBAL_OFF,
|
||||
|
296
regamedll/dlls/schedule.h
Normal file
296
regamedll/dlls/schedule.h
Normal file
@ -0,0 +1,296 @@
|
||||
/*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* In addition, as a special exception, the author gives permission to
|
||||
* link the code of this program with the Half-Life Game Engine ("HL
|
||||
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
|
||||
* L.L.C ("Valve"). You must obey the GNU General Public License in all
|
||||
* respects for all of the code used other than the HL Engine and MODs
|
||||
* from Valve. If you modify this file, you may extend this exception
|
||||
* to your version of the file, but you are not obligated to do so. If
|
||||
* you do not wish to do so, delete this exception statement from your
|
||||
* version.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SCHEDULE_H
|
||||
#define SCHEDULE_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
// these MoveFlag values are assigned to a WayPoint's TYPE in order to demonstrate the
|
||||
// type of movement the monster should use to get there.
|
||||
#define bits_MF_TO_TARGETENT (1 << 0) // local move to targetent.
|
||||
#define bits_MF_TO_ENEMY (1 << 1) // local move to enemy
|
||||
#define bits_MF_TO_COVER (1 << 2) // local move to a hiding place
|
||||
#define bits_MF_TO_DETOUR (1 << 3) // local move to detour point.
|
||||
#define bits_MF_TO_PATHCORNER (1 << 4) // local move to a path corner
|
||||
#define bits_MF_TO_NODE (1 << 5) // local move to a node
|
||||
#define bits_MF_TO_LOCATION (1 << 6) // local move to an arbitrary point
|
||||
#define bits_MF_IS_GOAL (1 << 7) // this waypoint is the goal of the whole move.
|
||||
#define bits_MF_DONT_SIMPLIFY (1 << 8) // Don't let the route code simplify this waypoint
|
||||
|
||||
// If you define any flags that aren't _TO_ flags, add them here so we can mask
|
||||
// them off when doing compares.
|
||||
#define bits_MF_NOT_TO_MASK (bits_MF_IS_GOAL | bits_MF_DONT_SIMPLIFY)
|
||||
|
||||
#define MOVEGOAL_NONE (0)
|
||||
#define MOVEGOAL_TARGETENT (bits_MF_TO_TARGETENT)
|
||||
#define MOVEGOAL_ENEMY (bits_MF_TO_ENEMY)
|
||||
#define MOVEGOAL_PATHCORNER (bits_MF_TO_PATHCORNER)
|
||||
#define MOVEGOAL_LOCATION (bits_MF_TO_LOCATION)
|
||||
#define MOVEGOAL_NODE (bits_MF_TO_NODE)
|
||||
|
||||
// these bits represent conditions that may befall the monster, of which some are allowed
|
||||
// to interrupt certain schedules.
|
||||
#define bits_COND_NO_AMMO_LOADED (1 << 0) // weapon needs to be reloaded!
|
||||
#define bits_COND_SEE_HATE (1 << 1) // see something that you hate
|
||||
#define bits_COND_SEE_FEAR (1 << 2) // see something that you are afraid of
|
||||
#define bits_COND_SEE_DISLIKE (1 << 3) // see something that you dislike
|
||||
#define bits_COND_SEE_ENEMY (1 << 4) // target entity is in full view.
|
||||
#define bits_COND_ENEMY_OCCLUDED (1 << 5) // target entity occluded by the world
|
||||
#define bits_COND_SMELL_FOOD (1 << 6)
|
||||
#define bits_COND_ENEMY_TOOFAR (1 << 7)
|
||||
#define bits_COND_LIGHT_DAMAGE (1 << 8) // hurt a little
|
||||
#define bits_COND_HEAVY_DAMAGE (1 << 9) // hurt a lot
|
||||
#define bits_COND_CAN_RANGE_ATTACK1 (1 << 10)
|
||||
#define bits_COND_CAN_MELEE_ATTACK1 (1 << 11)
|
||||
#define bits_COND_CAN_RANGE_ATTACK2 (1 << 12)
|
||||
#define bits_COND_CAN_MELEE_ATTACK2 (1 << 13)
|
||||
//#define bits_COND_CAN_RANGE_ATTACK3 (1 << 14)
|
||||
|
||||
#define bits_COND_PROVOKED (1 << 15)
|
||||
#define bits_COND_NEW_ENEMY (1 << 16)
|
||||
#define bits_COND_HEAR_SOUND (1 << 17) // there is an interesting sound
|
||||
#define bits_COND_SMELL (1 << 18) // there is an interesting scent
|
||||
#define bits_COND_ENEMY_FACING_ME (1 << 19) // enemy is facing me
|
||||
#define bits_COND_ENEMY_DEAD (1 << 20) // enemy was killed. If you get this in combat, try to find another enemy. If you get it in alert, victory dance.
|
||||
#define bits_COND_SEE_CLIENT (1 << 21) // see a client
|
||||
#define bits_COND_SEE_NEMESIS (1 << 22) // see my nemesis
|
||||
|
||||
#define bits_COND_SPECIAL1 (1 << 28) // Defined by individual monster
|
||||
#define bits_COND_SPECIAL2 (1 << 29) // Defined by individual monster
|
||||
|
||||
#define bits_COND_TASK_FAILED (1 << 30)
|
||||
#define bits_COND_SCHEDULE_DONE (1 << 31)
|
||||
|
||||
#define bits_COND_ALL_SPECIAL (bits_COND_SPECIAL1 | bits_COND_SPECIAL2)
|
||||
#define bits_COND_CAN_ATTACK (bits_COND_CAN_RANGE_ATTACK1 | bits_COND_CAN_MELEE_ATTACK1 | bits_COND_CAN_RANGE_ATTACK2 | bits_COND_CAN_MELEE_ATTACK2)
|
||||
|
||||
#define TASKSTATUS_NEW 0 // Just started
|
||||
#define TASKSTATUS_RUNNING 1 // Running task & movement
|
||||
#define TASKSTATUS_RUNNING_MOVEMENT 2 // Just running movement
|
||||
#define TASKSTATUS_RUNNING_TASK 3 // Just running task
|
||||
#define TASKSTATUS_COMPLETE 4 // Completed, get next task
|
||||
|
||||
// These are the schedule types
|
||||
typedef enum
|
||||
{
|
||||
SCHED_NONE = 0,
|
||||
SCHED_IDLE_STAND,
|
||||
SCHED_IDLE_WALK,
|
||||
SCHED_WAKE_ANGRY,
|
||||
SCHED_WAKE_CALLED,
|
||||
SCHED_ALERT_FACE,
|
||||
SCHED_ALERT_SMALL_FLINCH,
|
||||
SCHED_ALERT_BIG_FLINCH,
|
||||
SCHED_ALERT_STAND,
|
||||
SCHED_INVESTIGATE_SOUND,
|
||||
SCHED_COMBAT_FACE,
|
||||
SCHED_COMBAT_STAND,
|
||||
SCHED_CHASE_ENEMY,
|
||||
SCHED_CHASE_ENEMY_FAILED,
|
||||
SCHED_VICTORY_DANCE,
|
||||
SCHED_TARGET_FACE,
|
||||
SCHED_TARGET_CHASE,
|
||||
SCHED_SMALL_FLINCH,
|
||||
SCHED_TAKE_COVER_FROM_ENEMY,
|
||||
SCHED_TAKE_COVER_FROM_BEST_SOUND,
|
||||
SCHED_TAKE_COVER_FROM_ORIGIN,
|
||||
SCHED_COWER, // usually a last resort!
|
||||
SCHED_MELEE_ATTACK1,
|
||||
SCHED_MELEE_ATTACK2,
|
||||
SCHED_RANGE_ATTACK1,
|
||||
SCHED_RANGE_ATTACK2,
|
||||
SCHED_SPECIAL_ATTACK1,
|
||||
SCHED_SPECIAL_ATTACK2,
|
||||
SCHED_STANDOFF,
|
||||
SCHED_ARM_WEAPON,
|
||||
SCHED_RELOAD,
|
||||
SCHED_GUARD,
|
||||
SCHED_AMBUSH,
|
||||
SCHED_DIE,
|
||||
SCHED_WAIT_TRIGGER,
|
||||
SCHED_FOLLOW,
|
||||
SCHED_SLEEP,
|
||||
SCHED_WAKE,
|
||||
SCHED_BARNACLE_VICTIM_GRAB,
|
||||
SCHED_BARNACLE_VICTIM_CHOMP,
|
||||
SCHED_AISCRIPT,
|
||||
SCHED_FAIL,
|
||||
|
||||
LAST_COMMON_SCHEDULE // Leave this at the bottom
|
||||
|
||||
} SCHEDULE_TYPE;
|
||||
|
||||
// These are the shared tasks
|
||||
typedef enum
|
||||
{
|
||||
TASK_INVALID = 0,
|
||||
TASK_WAIT,
|
||||
TASK_WAIT_FACE_ENEMY,
|
||||
TASK_WAIT_PVS,
|
||||
TASK_SUGGEST_STATE,
|
||||
TASK_WALK_TO_TARGET,
|
||||
TASK_RUN_TO_TARGET,
|
||||
TASK_MOVE_TO_TARGET_RANGE,
|
||||
TASK_GET_PATH_TO_ENEMY,
|
||||
TASK_GET_PATH_TO_ENEMY_LKP,
|
||||
TASK_GET_PATH_TO_ENEMY_CORPSE,
|
||||
TASK_GET_PATH_TO_LEADER,
|
||||
TASK_GET_PATH_TO_SPOT,
|
||||
TASK_GET_PATH_TO_TARGET,
|
||||
TASK_GET_PATH_TO_HINTNODE,
|
||||
TASK_GET_PATH_TO_LASTPOSITION,
|
||||
TASK_GET_PATH_TO_BESTSOUND,
|
||||
TASK_GET_PATH_TO_BESTSCENT,
|
||||
TASK_RUN_PATH,
|
||||
TASK_WALK_PATH,
|
||||
TASK_STRAFE_PATH,
|
||||
TASK_CLEAR_MOVE_WAIT,
|
||||
TASK_STORE_LASTPOSITION,
|
||||
TASK_CLEAR_LASTPOSITION,
|
||||
TASK_PLAY_ACTIVE_IDLE,
|
||||
TASK_FIND_HINTNODE,
|
||||
TASK_CLEAR_HINTNODE,
|
||||
TASK_SMALL_FLINCH,
|
||||
TASK_FACE_IDEAL,
|
||||
TASK_FACE_ROUTE,
|
||||
TASK_FACE_ENEMY,
|
||||
TASK_FACE_HINTNODE,
|
||||
TASK_FACE_TARGET,
|
||||
TASK_FACE_LASTPOSITION,
|
||||
TASK_RANGE_ATTACK1,
|
||||
TASK_RANGE_ATTACK2,
|
||||
TASK_MELEE_ATTACK1,
|
||||
TASK_MELEE_ATTACK2,
|
||||
TASK_RELOAD,
|
||||
TASK_RANGE_ATTACK1_NOTURN,
|
||||
TASK_RANGE_ATTACK2_NOTURN,
|
||||
TASK_MELEE_ATTACK1_NOTURN,
|
||||
TASK_MELEE_ATTACK2_NOTURN,
|
||||
TASK_RELOAD_NOTURN,
|
||||
TASK_SPECIAL_ATTACK1,
|
||||
TASK_SPECIAL_ATTACK2,
|
||||
TASK_CROUCH,
|
||||
TASK_STAND,
|
||||
TASK_GUARD,
|
||||
TASK_STEP_LEFT,
|
||||
TASK_STEP_RIGHT,
|
||||
TASK_STEP_FORWARD,
|
||||
TASK_STEP_BACK,
|
||||
TASK_DODGE_LEFT,
|
||||
TASK_DODGE_RIGHT,
|
||||
TASK_SOUND_ANGRY,
|
||||
TASK_SOUND_DEATH,
|
||||
TASK_SET_ACTIVITY,
|
||||
TASK_SET_SCHEDULE,
|
||||
TASK_SET_FAIL_SCHEDULE,
|
||||
TASK_CLEAR_FAIL_SCHEDULE,
|
||||
TASK_PLAY_SEQUENCE,
|
||||
TASK_PLAY_SEQUENCE_FACE_ENEMY,
|
||||
TASK_PLAY_SEQUENCE_FACE_TARGET,
|
||||
TASK_SOUND_IDLE,
|
||||
TASK_SOUND_WAKE,
|
||||
TASK_SOUND_PAIN,
|
||||
TASK_SOUND_DIE,
|
||||
TASK_FIND_COVER_FROM_BEST_SOUND, // tries lateral cover first, then node cover
|
||||
TASK_FIND_COVER_FROM_ENEMY, // tries lateral cover first, then node cover
|
||||
TASK_FIND_LATERAL_COVER_FROM_ENEMY,
|
||||
TASK_FIND_NODE_COVER_FROM_ENEMY,
|
||||
TASK_FIND_NEAR_NODE_COVER_FROM_ENEMY, // data for this one is the MAXIMUM acceptable distance to the cover.
|
||||
TASK_FIND_FAR_NODE_COVER_FROM_ENEMY, // data for this one is there MINIMUM aceptable distance to the cover.
|
||||
TASK_FIND_COVER_FROM_ORIGIN,
|
||||
TASK_EAT,
|
||||
TASK_DIE,
|
||||
TASK_WAIT_FOR_SCRIPT,
|
||||
TASK_PLAY_SCRIPT,
|
||||
TASK_ENABLE_SCRIPT,
|
||||
TASK_PLANT_ON_SCRIPT,
|
||||
TASK_FACE_SCRIPT,
|
||||
TASK_WAIT_RANDOM,
|
||||
TASK_WAIT_INDEFINITE,
|
||||
TASK_STOP_MOVING,
|
||||
TASK_TURN_LEFT,
|
||||
TASK_TURN_RIGHT,
|
||||
TASK_REMEMBER,
|
||||
TASK_FORGET,
|
||||
TASK_WAIT_FOR_MOVEMENT, // wait until MovementIsComplete()
|
||||
LAST_COMMON_TASK, // LEAVE THIS AT THE BOTTOM!! (sjb)
|
||||
|
||||
} SHARED_TASKS;
|
||||
|
||||
// These go in the flData member of the TASK_WALK_TO_TARGET, TASK_RUN_TO_TARGET
|
||||
enum
|
||||
{
|
||||
TARGET_MOVE_NORMAL = 0,
|
||||
TARGET_MOVE_SCRIPTED = 1,
|
||||
};
|
||||
|
||||
// A goal should be used for a task that requires several schedules to complete.
|
||||
// The goal index should indicate which schedule (ordinally) the monster is running.
|
||||
// That way, when tasks fail, the AI can make decisions based on the context of the
|
||||
// current goal and sequence rather than just the current schedule.
|
||||
enum
|
||||
{
|
||||
GOAL_ATTACK_ENEMY,
|
||||
GOAL_MOVE,
|
||||
GOAL_TAKE_COVER,
|
||||
GOAL_MOVE_TARGET,
|
||||
GOAL_EAT,
|
||||
};
|
||||
|
||||
// an array of tasks is a task list
|
||||
// an array of schedules is a schedule list
|
||||
struct Task_t
|
||||
{
|
||||
int iTask;
|
||||
float flData;
|
||||
};
|
||||
|
||||
struct Schedule_t
|
||||
{
|
||||
|
||||
Task_t *pTasklist;
|
||||
int cTasks;
|
||||
int iInterruptMask;// a bit mask of conditions that can interrupt this schedule
|
||||
|
||||
// a more specific mask that indicates which TYPES of sounds will interrupt the schedule in the
|
||||
// event that the schedule is broken by COND_HEAR_SOUND
|
||||
int iSoundMask;
|
||||
const char *pName;
|
||||
};
|
||||
|
||||
// an array of waypoints makes up the monster's route.
|
||||
// !!!LATER- this declaration doesn't belong in this file.
|
||||
struct WayPoint_t
|
||||
{
|
||||
Vector vecLocation;
|
||||
int iType;
|
||||
};
|
||||
|
||||
#endif // SCHEDULE_H
|
@ -10,9 +10,16 @@ NOBODY void CSound::Clear(void)
|
||||
{
|
||||
}
|
||||
|
||||
// Reset - clears the volume, origin, and type for a sound,
|
||||
// but doesn't expire or unlink it.
|
||||
|
||||
/* <178d8f> ../cstrike/dlls/soundent.cpp:43 */
|
||||
NOBODY void CSound::Reset(void)
|
||||
void CSound::Reset(void)
|
||||
{
|
||||
m_vecOrigin = g_vecZero;
|
||||
m_iNext = SOUNDLIST_EMPTY;
|
||||
m_iType = 0;
|
||||
m_iVolume = 0;
|
||||
}
|
||||
|
||||
/* <178db7> ../cstrike/dlls/soundent.cpp:54 */
|
||||
@ -123,18 +130,52 @@ NOBODY int CSoundEnt::FreeList(void)
|
||||
{
|
||||
}
|
||||
|
||||
// SoundPointerForIndex - returns a pointer to the instance
|
||||
// of CSound at index's position in the sound pool.
|
||||
|
||||
/* <179093> ../cstrike/dlls/soundent.cpp:339 */
|
||||
NOBODY CSound *CSoundEnt::SoundPointerForIndex(int iIndex)
|
||||
CSound *CSoundEnt::SoundPointerForIndex(int iIndex)
|
||||
{
|
||||
if (!pSoundEnt)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* <1790b8> ../cstrike/dlls/soundent.cpp:367 */
|
||||
NOBODY int CSoundEnt::ClientSoundIndex(edict_t *pClient)
|
||||
if (iIndex > (MAX_WORLD_SOUNDS - 1))
|
||||
{
|
||||
// {
|
||||
// int iReturn; // 369
|
||||
// ENTINDEX(edict_t *pEdict); // 369
|
||||
// }
|
||||
ALERT(at_console, "SoundPointerForIndex() - Index too large!\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (iIndex < 0)
|
||||
{
|
||||
ALERT(at_console, "SoundPointerForIndex() - Index < 0!\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return &pSoundEnt->m_SoundPool[ iIndex ];
|
||||
}
|
||||
|
||||
// Clients are numbered from 1 to MAXCLIENTS, but the client
|
||||
// reserved sounds in the soundlist are from 0 to MAXCLIENTS - 1,
|
||||
// so this function ensures that a client gets the proper index
|
||||
// to his reserved sound in the soundlist.
|
||||
|
||||
/* <1790b8> ../cstrike/dlls/soundent.cpp:367 */
|
||||
int CSoundEnt::ClientSoundIndex(edict_t *pClient)
|
||||
{
|
||||
int iReturn = ENTINDEX(pClient) - 1;
|
||||
|
||||
#if defined(_DEBUG) && !defined(HOOK_GAMEDLL)
|
||||
|
||||
if (iReturn < 0 || iReturn > gpGlobals->maxClients)
|
||||
{
|
||||
ALERT(at_console, "** ClientSoundIndex returning a bogus value! **\n");
|
||||
}
|
||||
|
||||
#endif // _DEBUG && !HOOK_GAMEDLL
|
||||
|
||||
return iReturn;
|
||||
}
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
@ -61,7 +61,7 @@ class CSound
|
||||
{
|
||||
public:
|
||||
NOBODY void Clear(void);
|
||||
NOBODY void Reset(void);
|
||||
void Reset(void);
|
||||
|
||||
NOBODY BOOL FIsSound(void);
|
||||
NOBODY BOOL FIsScent(void);
|
||||
|
@ -144,8 +144,9 @@ NOBODY BOOL CHalfLifeTraining::FPlayerCanRespawn_(CBasePlayer *pPlayer)
|
||||
}
|
||||
|
||||
/* <18bd40> ../cstrike/dlls/training_gamerules.cpp:190 */
|
||||
NOBODY bool CHalfLifeTraining::PlayerCanBuy(CBasePlayer *pPlayer)
|
||||
bool CHalfLifeTraining::PlayerCanBuy(CBasePlayer *pPlayer)
|
||||
{
|
||||
return pPlayer->m_signals.GetState() & SIGNAL_BUY;
|
||||
}
|
||||
|
||||
/* <18afa5> ../cstrike/dlls/training_gamerules.cpp:195 */
|
||||
|
@ -71,13 +71,14 @@ public:
|
||||
|
||||
public:
|
||||
static void HostageDied(void);
|
||||
NOBODY static bool PlayerCanBuy(CBasePlayer *pPlayer);
|
||||
static bool PlayerCanBuy(CBasePlayer *pPlayer);
|
||||
private:
|
||||
float FillAccountTime;
|
||||
float ServerRestartTime;
|
||||
BOOL fInBuyArea;
|
||||
BOOL fVisitedBuyArea;
|
||||
bool fVGUIMenus;
|
||||
|
||||
};/* size: 728, cachelines: 12, members: 6 */
|
||||
|
||||
/* <18a1d5> ../cstrike/dlls/training_gamerules.cpp:252 */
|
||||
|
@ -991,7 +991,7 @@ NOBODY void CTriggerChangeTarget::Spawn_(void)
|
||||
}
|
||||
|
||||
/* <1a010d> ../cstrike/dlls/triggers.cpp:2376 */
|
||||
NOBODY void CTriggerChangeTarget::Use_(CBaseEntity *pActivator, class CBaseEntity *pCaller, USE_TYPE useType, float value)
|
||||
NOBODY void CTriggerChangeTarget::Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
|
||||
{
|
||||
// {
|
||||
// class CBaseEntity *pTarget; // 2378
|
||||
@ -1361,6 +1361,21 @@ void CTriggerPush::Touch(CBaseEntity *pOther)
|
||||
Touch_(pOther);
|
||||
}
|
||||
|
||||
void CTriggerTeleport::Spawn(void)
|
||||
{
|
||||
Spawn_();
|
||||
}
|
||||
|
||||
void CBuyZone::Spawn(void)
|
||||
{
|
||||
Spawn_();
|
||||
}
|
||||
|
||||
void CBombTarget::Spawn(void)
|
||||
{
|
||||
Spawn_();
|
||||
}
|
||||
|
||||
void CHostageRescue::Spawn(void)
|
||||
{
|
||||
Spawn_();
|
||||
|
@ -44,10 +44,10 @@ public:
|
||||
public:
|
||||
void Update(void)
|
||||
{
|
||||
// int old; // 46
|
||||
int old = m_flSignal;
|
||||
|
||||
m_flState = m_flSignal;
|
||||
m_flSignal = 0;
|
||||
m_flState = old;
|
||||
}
|
||||
void Signal(int flags)
|
||||
{
|
||||
|
@ -570,6 +570,8 @@ void UTIL_MakeInvVectors(const Vector &vec, globalvars_t *pgv)
|
||||
{
|
||||
MAKE_VECTORS(vec);
|
||||
|
||||
pgv->v_right = pgv->v_right * -1;
|
||||
|
||||
SWAP(pgv->v_forward.y, pgv->v_right.x);
|
||||
SWAP(pgv->v_forward.z, pgv->v_up.x);
|
||||
SWAP(pgv->v_right.z, pgv->v_up.y);
|
||||
@ -1374,10 +1376,6 @@ void UTIL_StringToIntArray(int *pVector, int count, const char *pString)
|
||||
|
||||
Q_strcpy(tempString, pString);
|
||||
|
||||
#ifdef GAMEDLL_FIXES
|
||||
tempString[127] = 0;
|
||||
#endif // GAMEDLL_FIXES
|
||||
|
||||
pstr = tempString;
|
||||
pfront = tempString;
|
||||
|
||||
|
@ -38,6 +38,11 @@
|
||||
static int iNumPassed = 0;\
|
||||
printf2(__FUNCTION__":: iNumPassed - %d", iNumPassed++);
|
||||
|
||||
#define _LOG_TRACE2\
|
||||
static int iNumPassedt = 0;\
|
||||
printf2(__FUNCTION__":: iNumPassed - %d", iNumPassedt++);\
|
||||
_logf(__FUNCTION__":: iNumPassed - %d", iNumPassedt++);
|
||||
|
||||
// Makes these more explicit, and easier to find
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
||||
@ -51,6 +56,9 @@
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
#define eoNullEntity 0 // Testing the three types of "entity" for nullity
|
||||
#define iStringNull 0 // Testing strings for nullity
|
||||
|
||||
#define cchMapNameMost 32
|
||||
|
||||
#define CBSENTENCENAME_MAX 16
|
||||
@ -101,36 +109,32 @@ extern globalvars_t *gpGlobals;
|
||||
#define VEC_HULL_MIN Vector(-16, -16, -36)
|
||||
#define VEC_HULL_MAX Vector(16, 16, 36)
|
||||
|
||||
#define VEC_VIEW Vector(0, 0, 17)
|
||||
|
||||
#define VEC_DUCK_HULL_MIN Vector(-16, -16, -18)
|
||||
#define VEC_DUCK_HULL_MAX Vector(16, 16, 32)
|
||||
#define VEC_DUCK_VIEW Vector(0, 0, 12)
|
||||
|
||||
#ifndef HOOK_GAMEDLL
|
||||
|
||||
#define LINK_ENTITY_TO_CLASS(mapClassName, DLLClassName)\
|
||||
C_DLLEXPORT void mapClassName(entvars_t *pev);\
|
||||
void mapClassName(entvars_t *pev)\
|
||||
{\
|
||||
GetClassPtr((DLLClassName *)pev);\
|
||||
}
|
||||
#else // HOOK_GAMEDLL
|
||||
|
||||
// NOTE: There is no need to link the objects with HOOK_GAMEDLL
|
||||
#define LINK_ENTITY_TO_CLASS(mapClassName, DLLClassName)
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ignore_monsters = 1,
|
||||
dont_ignore_monsters = 0,
|
||||
missile = 2
|
||||
|
||||
} IGNORE_MONSTERS;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ignore_glass = 1,
|
||||
dont_ignore_glass = 0
|
||||
|
||||
} IGNORE_GLASS;
|
||||
|
||||
enum
|
||||
@ -152,6 +156,7 @@ typedef enum
|
||||
MONSTERSTATE_SCRIPT,
|
||||
MONSTERSTATE_PLAYDEAD,
|
||||
MONSTERSTATE_DEAD
|
||||
|
||||
} MONSTERSTATE;
|
||||
|
||||
typedef struct hudtextparms_s
|
||||
@ -166,6 +171,7 @@ typedef struct hudtextparms_s
|
||||
float holdTime;
|
||||
float fxTime;
|
||||
int channel;
|
||||
|
||||
} hudtextparms_t;
|
||||
/* size: 40, cachelines: 1, members: 16 */
|
||||
|
||||
@ -177,6 +183,7 @@ public:
|
||||
private:
|
||||
int m_oldgroupmask;
|
||||
int m_oldgroupop;
|
||||
|
||||
};/* size: 8, cachelines: 1, members: 2 */
|
||||
|
||||
/* <5da42> ../cstrike/dlls/util.h:67 */
|
||||
@ -275,7 +282,7 @@ inline BOOL FNullEnt(const edict_t *pent)
|
||||
/* <1c1cb> ../cstrike/dlls/util.h:203 */
|
||||
inline BOOL FStringNull(int iString)
|
||||
{
|
||||
return (iString == 0);
|
||||
return (iString == iStringNull);
|
||||
}
|
||||
|
||||
/* <42e8> ../cstrike/dlls/util.h:246 */
|
||||
@ -336,6 +343,8 @@ extern int g_groupmask;
|
||||
extern int g_groupop;
|
||||
extern const int gSizes[18];
|
||||
|
||||
unsigned int U_Random(void);
|
||||
void U_Srand(unsigned int seed);
|
||||
int UTIL_SharedRandomLong(unsigned int seed, int low, int high);
|
||||
float UTIL_SharedRandomFloat(unsigned int seed, float low, float high);
|
||||
NOXREF void UTIL_ParametricRocket(entvars_t *pev, Vector vecOrigin, Vector vecAngles, edict_t *owner);
|
||||
@ -426,13 +435,6 @@ NOXREF int GetPlayerTeam(int index);
|
||||
bool UTIL_IsGame(const char *gameName);
|
||||
float UTIL_GetPlayerGaitYaw(int playerIndex);
|
||||
|
||||
// combat.cpp
|
||||
NOBODY void RadiusFlash(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int iClassIgnore, int bitsDamageType);
|
||||
NOBODY void GetAmountOfPlayerVisible(Vector vecSrc, CBaseEntity *entity);
|
||||
NOBODY void RadiusDamage(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, float flRadius, int iClassIgnore, int bitsDamageType);
|
||||
NOBODY void RadiusDamage2(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, float flRadius, int iClassIgnore, int bitsDamageType);
|
||||
NOXREF char *vstr(float *v);
|
||||
|
||||
/*
|
||||
* Declared for function overload
|
||||
*/
|
||||
|
@ -50,7 +50,6 @@ class Vector2D
|
||||
{
|
||||
public:
|
||||
vec_t x, y;
|
||||
|
||||
inline Vector2D(void) : x(0.0), y(0.0)
|
||||
{
|
||||
}
|
||||
@ -67,6 +66,20 @@ public:
|
||||
{
|
||||
return Vector2D(x - v.x, y - v.y);
|
||||
}
|
||||
#ifdef HOOK_GAMEDLL
|
||||
inline Vector2D operator*(float_precision fl) const
|
||||
{
|
||||
return Vector2D((vec_t)(x * fl), (vec_t)(y * fl));
|
||||
}
|
||||
inline Vector2D operator/(float_precision fl) const
|
||||
{
|
||||
return Vector2D((vec_t)(x / fl), (vec_t)(y / fl));
|
||||
}
|
||||
inline Vector2D operator/=(float_precision fl) const
|
||||
{
|
||||
return Vector2D((vec_t)(x / fl), (vec_t)(y / fl));
|
||||
}
|
||||
#else
|
||||
inline Vector2D operator*(float fl) const
|
||||
{
|
||||
return Vector2D(x * fl, y * fl);
|
||||
@ -79,36 +92,26 @@ public:
|
||||
{
|
||||
return Vector2D(x / fl, y / fl);
|
||||
}
|
||||
#ifdef HOOK_GAMEDLL
|
||||
#endif // HOOK_GAMEDLL
|
||||
inline double Length(void) const
|
||||
{
|
||||
return sqrt((double)(x * x + y * y));
|
||||
return sqrt((float_precision)(x * x + y * y));
|
||||
}
|
||||
#else
|
||||
inline float Length(void) const
|
||||
{
|
||||
return sqrt(x * x + y * y);
|
||||
}
|
||||
#endif // HOOK_GAMEDLL
|
||||
inline float LengthSquared(void) const
|
||||
{
|
||||
return (x * x + y * y);
|
||||
}
|
||||
inline Vector2D Normalize(void) const
|
||||
{
|
||||
float_precision flLength = Length();
|
||||
if (!flLength)
|
||||
return Vector2D(0, 0);
|
||||
|
||||
flLength = 1 / flLength;
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
double flLength = Length();
|
||||
if (!flLength)
|
||||
return Vector2D(0, 0);
|
||||
|
||||
flLength = 1 / flLength;
|
||||
return Vector2D((float)(x * flLength), (float)(y * flLength));
|
||||
return Vector2D((vec_t)(x * flLength), (vec_t)(y * flLength));
|
||||
#else
|
||||
float flLength = Length();
|
||||
if (!flLength)
|
||||
return Vector2D(0, 0);
|
||||
|
||||
flLength = 1 / flLength;
|
||||
return Vector2D(x * flLength, y * flLength);
|
||||
#endif // HOOK_GAMEDLL
|
||||
}
|
||||
@ -197,6 +200,20 @@ public:
|
||||
{
|
||||
return Vector(x - v.x, y - v.y, z - v.z);
|
||||
}
|
||||
#ifdef HOOK_GAMEDLL
|
||||
inline Vector operator*(float_precision fl) const
|
||||
{
|
||||
return Vector((vec_t)(x * fl), (vec_t)(y * fl), (vec_t)(z * fl));
|
||||
}
|
||||
inline Vector operator/(float_precision fl) const
|
||||
{
|
||||
return Vector((vec_t)(x / fl), (vec_t)(y / fl), (vec_t)(z / fl));
|
||||
}
|
||||
inline Vector operator/=(float_precision fl) const
|
||||
{
|
||||
return Vector((vec_t)(x / fl), (vec_t)(y / fl), (vec_t)(z / fl));
|
||||
}
|
||||
#else
|
||||
inline Vector operator*(float fl) const
|
||||
{
|
||||
return Vector(x * fl, y * fl, z * fl);
|
||||
@ -209,23 +226,18 @@ public:
|
||||
{
|
||||
return Vector(x / fl, y / fl, z / fl);
|
||||
}
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
inline void CopyToArray(float *rgfl) const
|
||||
{
|
||||
rgfl[0] = x;
|
||||
rgfl[1] = y;
|
||||
rgfl[2] = z;
|
||||
}
|
||||
#ifdef HOOK_GAMEDLL
|
||||
inline double Length(void) const
|
||||
{
|
||||
return sqrt((double)(x * x + y * y + z * z));
|
||||
return sqrt((float_precision)(x * x + y * y + z * z));
|
||||
}
|
||||
#else
|
||||
inline float Length(void) const
|
||||
{
|
||||
return sqrt(x * x + y * y + z * z);
|
||||
}
|
||||
#endif // HOOK_GAMEDLL
|
||||
inline float LengthSquared(void) const
|
||||
{
|
||||
return (x * x + y * y + z * z);
|
||||
@ -240,17 +252,16 @@ public:
|
||||
}
|
||||
inline Vector Normalize(void) const
|
||||
{
|
||||
#ifdef HOOK_GAMEDLL
|
||||
double flLength = Length();
|
||||
#else
|
||||
float flLength = Length();
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
float_precision flLength = Length();
|
||||
if (!flLength)
|
||||
return Vector(0, 0, 1);
|
||||
|
||||
flLength = 1 / flLength;
|
||||
return Vector((float)(x * flLength), (float)(y * flLength), (float)(z * flLength));
|
||||
#ifdef HOOK_GAMEDLL
|
||||
return Vector((vec_t)(x * flLength), (vec_t)(y * flLength), (vec_t)(z * flLength));
|
||||
#else
|
||||
return Vector(x * flLength, y * flLength, z * flLength);
|
||||
#endif // HOOK_GAMEDLL
|
||||
}
|
||||
inline Vector2D Make2D(void) const
|
||||
{
|
||||
@ -259,17 +270,10 @@ public:
|
||||
Vec2.y = y;
|
||||
return Vec2;
|
||||
}
|
||||
#ifdef HOOK_GAMEDLL
|
||||
inline double Length2D(void) const
|
||||
{
|
||||
return sqrt((double)(x * x + y * y));
|
||||
return sqrt((float_precision)(x * x + y * y));
|
||||
}
|
||||
#else
|
||||
inline double Length2D(void) const
|
||||
{
|
||||
return sqrt(x * x + y * y);
|
||||
}
|
||||
#endif // HOOK_GAMEDLL
|
||||
inline bool IsLengthLessThan(float length) const
|
||||
{
|
||||
return (LengthSquared() < length * length);
|
||||
|
@ -586,4 +586,9 @@ void CFuncVehicle::Blocked(CBaseEntity *pOther)
|
||||
Blocked_(pOther);
|
||||
}
|
||||
|
||||
void CFuncVehicleControls::Spawn(void)
|
||||
{
|
||||
Spawn_();
|
||||
}
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
@ -54,6 +54,23 @@ class CBasePlayer;
|
||||
// the maximum amount of ammo each weapon's clip can hold
|
||||
#define WEAPON_NOCLIP -1
|
||||
|
||||
#define LOUD_GUN_VOLUME 1000
|
||||
#define NORMAL_GUN_VOLUME 600
|
||||
#define QUIET_GUN_VOLUME 200
|
||||
|
||||
#define BRIGHT_GUN_FLASH 512
|
||||
#define NORMAL_GUN_FLASH 256
|
||||
#define DIM_GUN_FLASH 128
|
||||
|
||||
#define BIG_EXPLOSION_VOLUME 2048
|
||||
#define NORMAL_EXPLOSION_VOLUME 1024
|
||||
#define SMALL_EXPLOSION_VOLUME 512
|
||||
|
||||
#define WEAPON_ACTIVITY_VOLUME 64
|
||||
|
||||
// spawn flags
|
||||
#define SF_DETONATE 0x0001 // Grenades flagged with this will be triggered when the owner calls detonateSatchelCharges
|
||||
|
||||
typedef struct
|
||||
{
|
||||
WeaponType type;
|
||||
@ -118,20 +135,20 @@ public:
|
||||
class CGrenade: public CBaseMonster
|
||||
{
|
||||
public:
|
||||
NOBODY virtual void Spawn(void);
|
||||
NOBODY virtual int Save(CSave &save);
|
||||
NOBODY virtual int Restore(CRestore &restore);
|
||||
NOBODY virtual int ObjectCaps(void)
|
||||
virtual void Spawn(void);
|
||||
virtual int Save(CSave &save);
|
||||
virtual int Restore(CRestore &restore);
|
||||
virtual int ObjectCaps(void)
|
||||
{
|
||||
return ObjectCaps_();
|
||||
}
|
||||
NOBODY virtual void Killed(entvars_t *pevAttacker,int iGib);
|
||||
NOBODY virtual int BloodColor(void)
|
||||
virtual void Killed(entvars_t *pevAttacker,int iGib);
|
||||
virtual int BloodColor(void)
|
||||
{
|
||||
return BloodColor_();
|
||||
}
|
||||
NOBODY virtual void Use(CBaseEntity *pActivator,CBaseEntity *pCaller,USE_TYPE useType,float value);
|
||||
NOBODY virtual void BounceSound(void);
|
||||
virtual void Use(CBaseEntity *pActivator,CBaseEntity *pCaller,USE_TYPE useType,float value);
|
||||
virtual void BounceSound(void);
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
||||
@ -157,41 +174,42 @@ public:
|
||||
{
|
||||
SATCHEL_DETONATE,
|
||||
SATCHEL_RELEASE
|
||||
|
||||
} SATCHELCODE;
|
||||
public:
|
||||
NOBODY static CGrenade *ShootTimed(entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time);
|
||||
NOBODY static CGrenade *ShootTimed2(entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time, int iTeam, unsigned short usEvent);
|
||||
NOBODY static CGrenade *ShootContact(entvars_t *pevOwner, Vector vecStart, Vector vecVelocity);
|
||||
NOBODY static CGrenade *ShootSmokeGrenade(entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time, unsigned short usEvent);
|
||||
NOBODY static CGrenade *ShootSatchelCharge(entvars_t *pevOwner, Vector vecStart, Vector vecVelocity);
|
||||
NOBODY static void UseSatchelCharges(entvars_t *pevOwner, SATCHELCODE code);
|
||||
static CGrenade *ShootTimed(entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time);
|
||||
static CGrenade *ShootTimed2(entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time, int iTeam, unsigned short usEvent);
|
||||
NOXREF static CGrenade *ShootContact(entvars_t *pevOwner, Vector vecStart, Vector vecVelocity);
|
||||
static CGrenade *ShootSmokeGrenade(entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time, unsigned short usEvent);
|
||||
static CGrenade *ShootSatchelCharge(entvars_t *pevOwner, Vector vecStart, Vector vecVelocity);
|
||||
NOXREF static void UseSatchelCharges(entvars_t *pevOwner, SATCHELCODE code);
|
||||
public:
|
||||
NOBODY void Explode(Vector vecSrc, Vector vecAim);
|
||||
NOBODY void Explode(TraceResult *pTrace, int bitsDamageType);
|
||||
NOBODY void Explode2(TraceResult *pTrace, int bitsDamageType);
|
||||
NOBODY void Explode3(TraceResult *pTrace, int bitsDamageType);
|
||||
NOBODY void SG_Explode(TraceResult *pTrace, int bitsDamageType);
|
||||
void Explode(Vector vecSrc, Vector vecAim);
|
||||
void Explode(TraceResult *pTrace, int bitsDamageType);
|
||||
void Explode2(TraceResult *pTrace, int bitsDamageType);
|
||||
void Explode3(TraceResult *pTrace, int bitsDamageType);
|
||||
NOXREF void SG_Explode(TraceResult *pTrace, int bitsDamageType);
|
||||
|
||||
NOBODY void EXPORT Smoke(void);
|
||||
NOBODY void EXPORT Smoke2(void);
|
||||
NOBODY void EXPORT Smoke3_A(void);
|
||||
NOBODY void EXPORT Smoke3_B(void);
|
||||
NOBODY void EXPORT Smoke3_C(void);
|
||||
NOBODY void EXPORT SG_Smoke(void);
|
||||
NOBODY void EXPORT BounceTouch(CBaseEntity *pOther);
|
||||
NOBODY void EXPORT SlideTouch(CBaseEntity *pOther);
|
||||
void EXPORT Smoke(void);
|
||||
void EXPORT Smoke2(void);
|
||||
void EXPORT Smoke3_A(void);
|
||||
void EXPORT Smoke3_B(void);
|
||||
void EXPORT Smoke3_C(void);
|
||||
void EXPORT SG_Smoke(void);
|
||||
void EXPORT BounceTouch(CBaseEntity *pOther);
|
||||
void EXPORT SlideTouch(CBaseEntity *pOther);
|
||||
void EXPORT C4Touch(CBaseEntity *pOther);
|
||||
NOBODY void EXPORT ExplodeTouch(CBaseEntity *pOther);
|
||||
NOBODY void EXPORT DangerSoundThink(void);
|
||||
NOBODY void EXPORT PreDetonate(void);
|
||||
NOBODY void EXPORT Detonate(void);
|
||||
NOBODY void EXPORT SG_Detonate(void);
|
||||
NOBODY void EXPORT Detonate2(void);
|
||||
NOBODY void EXPORT Detonate3(void);
|
||||
NOBODY void EXPORT DetonateUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
|
||||
NOBODY void EXPORT TumbleThink(void);
|
||||
NOBODY void EXPORT SG_TumbleThink(void);
|
||||
NOBODY void EXPORT C4Think(void);
|
||||
void EXPORT ExplodeTouch(CBaseEntity *pOther);
|
||||
void EXPORT DangerSoundThink(void);
|
||||
void EXPORT PreDetonate(void);
|
||||
void EXPORT Detonate(void);
|
||||
void EXPORT SG_Detonate(void);
|
||||
void EXPORT Detonate2(void);
|
||||
void EXPORT Detonate3(void);
|
||||
void EXPORT DetonateUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
|
||||
void EXPORT TumbleThink(void);
|
||||
void EXPORT SG_TumbleThink(void);
|
||||
void EXPORT C4Think(void);
|
||||
|
||||
public:
|
||||
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[15];
|
||||
@ -1640,6 +1658,7 @@ extern short g_sModelIndexRadio;
|
||||
extern MULTIDAMAGE gMultiDamage;
|
||||
|
||||
NOBODY void FindHullIntersection(Vector &vecSrc, TraceResult &tr, float *mins, float *maxs, edict_t *pEntity);
|
||||
void AnnounceFlashInterval(float interval, float offset = 0);
|
||||
|
||||
int MaxAmmoCarry(int iszName);
|
||||
void ClearMultiDamage(void);
|
||||
@ -1656,4 +1675,6 @@ NOXREF void UTIL_PrecacheOtherWeapon2(const char *szClassname);
|
||||
void W_Precache(void);
|
||||
NOXREF BOOL CanAttack(float attack_time, float curtime, BOOL isPredicted);
|
||||
|
||||
C_DLLEXPORT void weapon_usp(entvars_t *pev);
|
||||
|
||||
#endif // WEAPONS_H
|
||||
|
@ -1,4 +1,4 @@
|
||||
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
|
||||
//========= Copyright 1996-2002, Valve LLC, All rights reserved. ============
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
|
@ -34,8 +34,10 @@ NOBODY CBot::CBot(void)
|
||||
}
|
||||
|
||||
/* <48f6ef> ../game_shared/bot/bot.cpp:50 */
|
||||
NOBODY bool CBot::Initialize_(const BotProfile *profile)
|
||||
bool CBot::Initialize_(const BotProfile *profile)
|
||||
{
|
||||
m_profile = profile;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* <48fbbd> ../game_shared/bot/bot.cpp:57 */
|
||||
|
@ -51,7 +51,8 @@ extern bool UseBotArgs;
|
||||
class BotProfile;
|
||||
|
||||
/* <36c175> ../game_shared/bot/bot.h:36 */
|
||||
template <class T>T *CreateBot(const BotProfile *profile)
|
||||
template <class T>
|
||||
T *CreateBot(const BotProfile *profile)
|
||||
{
|
||||
edict_t *pentBot;
|
||||
if (UTIL_ClientsInGame() >= gpGlobals->maxClients)
|
||||
@ -61,8 +62,8 @@ template <class T>T *CreateBot(const BotProfile *profile)
|
||||
}
|
||||
|
||||
char netname[64];
|
||||
UTIL_ConstructBotNetName(netname, 64, profile);
|
||||
pentBot = CREATE_FAK_CLIENT( netname );
|
||||
UTIL_ConstructBotNetName(netname, sizeof(netname), profile);
|
||||
pentBot = CREATE_FAKE_CLIENT(netname);
|
||||
|
||||
if (FNullEnt(pentBot))
|
||||
{
|
||||
@ -75,6 +76,7 @@ template <class T>T *CreateBot(const BotProfile *profile)
|
||||
FREE_PRIVATE(pentBot);
|
||||
pBot = GetClassPtr((T *)VARS(pentBot));
|
||||
pBot->Initialize(profile);
|
||||
|
||||
return pBot;
|
||||
}
|
||||
}
|
||||
@ -327,7 +329,7 @@ private:
|
||||
/* <48f61d> ../game_shared/bot/bot.h:253 */
|
||||
inline void CBot::SetModel(const char *modelName)
|
||||
{
|
||||
SET_CLIENT_KEY_VALUE(entindex(), GET_USERINFO(edict()), "model", (char *)modelName);
|
||||
SET_CLIENT_KEY_VALUE(entindex(), GET_INFO_BUFFER(edict()), "model", (char *)modelName);
|
||||
}
|
||||
|
||||
/* <48e98a> ../game_shared/bot/bot.h:259 */
|
||||
|
@ -121,11 +121,11 @@ void CBotManager::StartFrame_(void)
|
||||
}
|
||||
|
||||
/* <49f7a6> ../game_shared/bot/bot_manager.cpp:205 */
|
||||
NOBODY const char *CBotManager::GetNavMapFilename(void) const
|
||||
const char *CBotManager::GetNavMapFilename(void) const
|
||||
{
|
||||
//static char filename[256];
|
||||
//Q_sprintf(filename, "maps\\%s.nav", STRING(gpGlobals->mapname));
|
||||
//return filename;
|
||||
static char filename[256];
|
||||
Q_sprintf(filename, "maps\\%s.nav", STRING(gpGlobals->mapname));
|
||||
return filename;
|
||||
}
|
||||
|
||||
/* <49f17b> ../game_shared/bot/bot_manager.cpp:219 */
|
||||
|
@ -88,15 +88,15 @@ class CBotManager
|
||||
public:
|
||||
CBotManager(void);
|
||||
|
||||
NOBODY virtual void ClientDisconnect(CBasePlayer *pPlayer) = 0;
|
||||
NOBODY virtual BOOL ClientCommand(CBasePlayer *pPlayer, const char *pcmd) = 0;
|
||||
virtual void ClientDisconnect(CBasePlayer *pPlayer) = 0;
|
||||
virtual BOOL ClientCommand(CBasePlayer *pPlayer, const char *pcmd) = 0;
|
||||
|
||||
NOBODY virtual void ServerActivate(void) = 0;
|
||||
NOBODY virtual void ServerDeactivate(void) = 0;
|
||||
virtual void ServerActivate(void) = 0;
|
||||
virtual void ServerDeactivate(void) = 0;
|
||||
|
||||
NOBODY virtual void ServerCommand(const char *pcmd) = 0;
|
||||
NOBODY virtual void AddServerCommand(const char *cmd) = 0;
|
||||
NOBODY virtual void AddServerCommands(void) = 0;
|
||||
virtual void ServerCommand(const char *pcmd) = 0;
|
||||
virtual void AddServerCommand(const char *cmd) = 0;
|
||||
virtual void AddServerCommands(void) = 0;
|
||||
|
||||
virtual void RestartRound(void);
|
||||
virtual void StartFrame(void);
|
||||
@ -106,20 +106,20 @@ public:
|
||||
virtual void OnEvent(GameEventType event, CBaseEntity *entity = NULL, CBaseEntity *other = NULL);
|
||||
|
||||
// return priority of player (0 = max pri)
|
||||
NOBODY virtual unsigned int GetPlayerPriority(CBasePlayer *player) const = 0;
|
||||
virtual unsigned int GetPlayerPriority(CBasePlayer *player) const = 0;
|
||||
|
||||
// return the filename for this map's "nav" file
|
||||
NOBODY const char *GetNavMapFilename(void) const;
|
||||
const char *GetNavMapFilename(void) const;
|
||||
|
||||
// add an active grenade to the bot's awareness
|
||||
NOBODY void AddGrenade(int type, CGrenade *grenade);
|
||||
void AddGrenade(int type, CGrenade *grenade);
|
||||
|
||||
// the grenade entity in the world is going away
|
||||
NOBODY void RemoveGrenade(CGrenade *grenade);
|
||||
void RemoveGrenade(CGrenade *grenade);
|
||||
|
||||
// destroy any invalid active grenades
|
||||
NOXREF void ValidateActiveGrenades(void);
|
||||
NOBODY void DestroyAllGrenades(void);
|
||||
void DestroyAllGrenades(void);
|
||||
|
||||
// return true if line intersects smoke volume
|
||||
bool IsLineBlockedBySmoke(const Vector *from, const Vector *to);
|
||||
|
@ -235,27 +235,36 @@ NOBODY int BotProfileManager::FindVoiceBankIndex(const char *filename)
|
||||
}
|
||||
|
||||
/* <4a8177> ../game_shared/bot/bot_profile.cpp:669 */
|
||||
NOBODY const BotProfile *BotProfileManager::GetRandomProfile(BotDifficultyType difficulty, BotProfileTeamType team) const
|
||||
const BotProfile *BotProfileManager::GetRandomProfile(BotDifficultyType difficulty, BotProfileTeamType team) const
|
||||
{
|
||||
// {
|
||||
// const_iterator iter; // 674
|
||||
// int validCount; // 677
|
||||
// int which; // 690
|
||||
// operator++(_List_const_iterator<BotProfile*> *const this); // 678
|
||||
// {
|
||||
// const class BotProfile *profile; // 680
|
||||
// IsDifficulty(const class BotProfile *const this,
|
||||
// enum BotDifficultyType diff); // 682
|
||||
// IsValidForTeam(const class BotProfile *const this,
|
||||
// enum BotProfileTeamType team); // 682
|
||||
// }
|
||||
// operator++(_List_const_iterator<BotProfile*> *const this); // 691
|
||||
// {
|
||||
// const class BotProfile *profile; // 693
|
||||
// IsDifficulty(const class BotProfile *const this,
|
||||
// enum BotDifficultyType diff); // 695
|
||||
// IsValidForTeam(const class BotProfile *const this,
|
||||
// enum BotProfileTeamType team); // 695
|
||||
// }
|
||||
// }
|
||||
BotProfileList::const_iterator iter;
|
||||
|
||||
// count up valid profiles
|
||||
int validCount = 0;
|
||||
for (iter = m_profileList.begin(); iter != m_profileList.end(); ++iter)
|
||||
{
|
||||
const BotProfile *profile = (*iter);
|
||||
|
||||
if (profile->IsDifficulty(difficulty) && !UTIL_IsNameTaken(profile->GetName()) && profile->IsValidForTeam(team))
|
||||
++validCount;
|
||||
}
|
||||
|
||||
if (validCount == 0)
|
||||
return NULL;
|
||||
|
||||
// select one at random
|
||||
int which = RANDOM_LONG(0, validCount - 1);
|
||||
|
||||
for (iter = m_profileList.begin(); iter != m_profileList.end(); ++iter)
|
||||
{
|
||||
const BotProfile *profile = (*iter);
|
||||
|
||||
if (profile->IsDifficulty(difficulty) && !UTIL_IsNameTaken(profile->GetName()) && profile->IsValidForTeam(team))
|
||||
{
|
||||
if (which-- == 0)
|
||||
return profile;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ float cosTable[ COS_TABLE_SIZE ];
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
/* <4ad1c6> ../game_shared/bot/bot_util.cpp:26 */
|
||||
NOBODY bool UTIL_IsNameTaken(const char *name, bool ignoreHumans)
|
||||
bool UTIL_IsNameTaken(const char *name, bool ignoreHumans)
|
||||
{
|
||||
for (int i = 1; i <= gpGlobals->maxClients; ++i)
|
||||
{
|
||||
@ -33,7 +33,9 @@ NOBODY bool UTIL_IsNameTaken(const char *name, bool ignoreHumans)
|
||||
|
||||
if (player->IsPlayer() && (((CBasePlayer *)player)->IsBot() == TRUE))
|
||||
{
|
||||
CBot *bot = (CBot *)player;
|
||||
// bots can have prefixes so we need to check the name
|
||||
// against the profile name instead.
|
||||
CBot *bot = reinterpret_cast<CBot *>(player);
|
||||
if (FStrEq(name, bot->GetProfile()->GetName()))
|
||||
{
|
||||
return true;
|
||||
@ -52,7 +54,7 @@ NOBODY bool UTIL_IsNameTaken(const char *name, bool ignoreHumans)
|
||||
}
|
||||
|
||||
/* <4ad2da> ../game_shared/bot/bot_util.cpp:66 */
|
||||
NOBODY int UTIL_ClientsInGame(void)
|
||||
int UTIL_ClientsInGame(void)
|
||||
{
|
||||
int iCount = 0;
|
||||
for (int iIndex = 1; iIndex <= gpGlobals->maxClients; iIndex++)
|
||||
@ -269,7 +271,7 @@ NOBODY bool UTIL_IsTeamAllBots(int team)
|
||||
if (FStrEq(STRING(player->pev->netname), ""))
|
||||
continue;
|
||||
|
||||
if (!FBitSet(player->pev->flags, FL_FAKECLIENT))
|
||||
if (!(player->pev->flags & FL_FAKECLIENT))
|
||||
return false;
|
||||
|
||||
++botCount;
|
||||
@ -341,24 +343,27 @@ NOBODY extern CBasePlayer *UTIL_GetClosestPlayer(const Vector *pos, int team, fl
|
||||
}
|
||||
|
||||
/* <4ad0de> ../game_shared/bot/bot_util.cpp:411 */
|
||||
NOBODY const char *UTIL_GetBotPrefix()
|
||||
const char *UTIL_GetBotPrefix()
|
||||
{
|
||||
return cv_bot_prefix.string;
|
||||
}
|
||||
|
||||
/* <4adb11> ../game_shared/bot/bot_util.cpp:418 */
|
||||
NOBODY void UTIL_ConstructBotNetName(char *name, int nameLength, const BotProfile *profile)
|
||||
void UTIL_ConstructBotNetName(char *name, int nameLength, const BotProfile *profile)
|
||||
{
|
||||
if (profile == NULL)
|
||||
{
|
||||
name[0] = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
// if there is no bot prefix just use the profile name.
|
||||
if ((UTIL_GetBotPrefix() == NULL) || (Q_strlen(UTIL_GetBotPrefix()) == 0))
|
||||
{
|
||||
Q_strncpy(name, profile->GetName(), nameLength);
|
||||
return;
|
||||
}
|
||||
|
||||
Q_snprintf(name, nameLength, "%s %s", UTIL_GetBotPrefix(), profile->GetName());
|
||||
}
|
||||
|
||||
@ -694,23 +699,27 @@ NOBODY bool IsGameEventAudible(GameEventType event, CBaseEntity *entity, CBaseEn
|
||||
}
|
||||
|
||||
/* <4ae3c1> ../game_shared/bot/bot_util.cpp:838 */
|
||||
NOBODY void HintMessageToAllPlayers(const char *message)
|
||||
void HintMessageToAllPlayers(const char *message)
|
||||
{
|
||||
hudtextparms_t textParms;
|
||||
|
||||
textParms.x = -1.0f;
|
||||
textParms.y = -1.0f;
|
||||
textParms.fadeinTime = 1.0f;
|
||||
textParms.fadeoutTime = 5.0f;
|
||||
textParms.holdTime = 5.0f;
|
||||
textParms.fxTime = 0.0f;
|
||||
textParms.r1 = 100;
|
||||
textParms.g1 = 255;
|
||||
textParms.b1 = 100;
|
||||
textParms.r2 = 255;
|
||||
textParms.g2 = 255;
|
||||
textParms.b2 = 255;
|
||||
textParms.x = -1;
|
||||
textParms.y = -1;
|
||||
textParms.effect = 0;
|
||||
|
||||
textParms.r1 = 100;
|
||||
textParms.g1 = -1;
|
||||
textParms.b1 = 100;
|
||||
|
||||
textParms.r2 = -1;
|
||||
textParms.g2 = -1;
|
||||
textParms.b2 = -1;
|
||||
|
||||
textParms.fadeinTime = 1;
|
||||
textParms.fadeoutTime = 5;
|
||||
textParms.holdTime = 5;
|
||||
textParms.fxTime = 0;
|
||||
|
||||
textParms.channel = 0;
|
||||
|
||||
UTIL_HudMessageAll(textParms, message);
|
||||
|
@ -34,11 +34,6 @@
|
||||
|
||||
#define COS_TABLE_SIZE 256
|
||||
|
||||
#define CREATE_FAKE_CLIENT (*g_engfuncs.pfnCreateFakeClient)
|
||||
#define GET_USERINFO (*g_engfuncs.pfnGetInfoKeyBuffer)
|
||||
#define SET_KEY_VALUE (*g_engfuncs.pfnSetKeyValue)
|
||||
#define SET_CLIENT_KEY_VALUE (*g_engfuncs.pfnSetClientKeyValue)
|
||||
|
||||
class CBasePlayer;
|
||||
class BotProfile;
|
||||
|
||||
@ -233,8 +228,8 @@ inline bool IsZombieGame(void)
|
||||
extern short s_iBeamSprite;
|
||||
extern float cosTable[COS_TABLE_SIZE];
|
||||
|
||||
NOBODY bool UTIL_IsNameTaken(const char *name, bool ignoreHumans = false);
|
||||
NOBODY int UTIL_ClientsInGame(void);
|
||||
bool UTIL_IsNameTaken(const char *name, bool ignoreHumans = false);
|
||||
int UTIL_ClientsInGame(void);
|
||||
NOBODY int UTIL_ActivePlayersInGame(void);
|
||||
NOBODY int UTIL_HumansInGame(bool ignoreSpectators);
|
||||
NOBODY int UTIL_HumansOnTeam(int teamID, bool isAlive = false);
|
||||
@ -243,8 +238,8 @@ NOBODY bool UTIL_KickBotFromTeam(TeamName kickTeam);
|
||||
NOBODY bool UTIL_IsTeamAllBots(int team);
|
||||
NOBODY CBasePlayer *UTIL_GetClosestPlayer(const Vector *pos, float *distance = NULL);
|
||||
NOBODY CBasePlayer *UTIL_GetClosestPlayer(const Vector *pos, int team, float *distance = NULL);
|
||||
NOBODY const char *UTIL_GetBotPrefix();
|
||||
NOBODY void UTIL_ConstructBotNetName(char *name, int nameLength, const BotProfile *profile);
|
||||
const char *UTIL_GetBotPrefix();
|
||||
void UTIL_ConstructBotNetName(char *name, int nameLength, const BotProfile *profile);
|
||||
NOBODY bool UTIL_IsVisibleToTeam(const Vector &spot, int team, float maxRange = -1.0f);
|
||||
CBasePlayer *UTIL_GetLocalPlayer(void);
|
||||
NOBODY Vector UTIL_ComputeOrigin(entvars_t *pevVars);
|
||||
|
@ -33,34 +33,38 @@ FILE_GLOBAL Vector anchor;
|
||||
FILE_GLOBAL bool isPlaceMode = false;
|
||||
FILE_GLOBAL bool isPlacePainting = false;
|
||||
|
||||
FILE_GLOBAL float editTimestamp = 0.0f;
|
||||
|
||||
FILE_GLOBAL unsigned int BlockedID[ MAX_BLOCKED_AREAS ];
|
||||
FILE_GLOBAL int BlockedIDCount = 0;
|
||||
|
||||
#else // HOOK_GAMEDLL
|
||||
|
||||
unsigned int (*CNavArea::m_nextID);
|
||||
unsigned int (*CNavArea::m_masterMarker);
|
||||
unsigned int IMPLEMENT_ARRAY_CLASS(CNavArea, m_nextID);
|
||||
unsigned int IMPLEMENT_ARRAY_CLASS(CNavArea, m_masterMarker);
|
||||
|
||||
unsigned int (*HidingSpot::m_nextID);
|
||||
unsigned int (*HidingSpot::m_masterMarker);
|
||||
unsigned int IMPLEMENT_ARRAY_CLASS(HidingSpot, m_nextID);
|
||||
unsigned int IMPLEMENT_ARRAY_CLASS(HidingSpot, m_masterMarker);
|
||||
|
||||
//NavLadderList TheNavLadderList;
|
||||
NavLadderList TheNavLadderList;
|
||||
HidingSpotList TheHidingSpotList;
|
||||
NavAreaList TheNavAreaList;
|
||||
CNavAreaGrid TheNavAreaGrid;
|
||||
CNavArea *(*CNavArea::m_openList);
|
||||
bool (*CNavArea::m_isReset);
|
||||
CNavArea *IMPLEMENT_ARRAY_CLASS(CNavArea, m_openList);
|
||||
bool IMPLEMENT_ARRAY_CLASS(CNavArea, m_isReset);
|
||||
|
||||
//float lastDrawTimestamp;
|
||||
float lastDrawTimestamp;
|
||||
NavAreaList goodSizedAreaList;
|
||||
//CNavArea *markedArea;
|
||||
//CNavArea *lastSelectedArea;
|
||||
CNavArea *markedArea;
|
||||
CNavArea *lastSelectedArea;
|
||||
NavCornerType markedCorner;
|
||||
//bool isCreatingNavArea;
|
||||
bool isCreatingNavArea;
|
||||
//bool isAnchored;
|
||||
//Vector anchor;
|
||||
//bool isPlaceMode;
|
||||
//bool isPlacePainting;
|
||||
bool isPlacePainting;
|
||||
float editTimestamp;
|
||||
|
||||
unsigned int BlockedID[ MAX_BLOCKED_AREAS ];
|
||||
int BlockedIDCount;
|
||||
|
||||
@ -95,11 +99,7 @@ void DestroyHidingSpots(void)
|
||||
area->m_hidingSpotList.clear();
|
||||
}
|
||||
|
||||
#ifndef HOOK_GAMEDLL
|
||||
HidingSpot::m_nextID = 0;
|
||||
#else
|
||||
(*HidingSpot::m_nextID) = 0;
|
||||
#endif // HOOK_GAMEDLL
|
||||
IMPLEMENT_ARRAY_CLASS(HidingSpot, m_nextID) = 0;
|
||||
|
||||
// free all the HidingSpots
|
||||
for (HidingSpotList::iterator iter = TheHidingSpotList.begin(); iter != TheHidingSpotList.end(); iter++)
|
||||
@ -209,11 +209,7 @@ NOBODY CNavArea::CNavArea(CNavNode *nwNode, class CNavNode *neNode, class CNavNo
|
||||
/* <4d58d7> ../game_shared/bot/nav_area.cpp:295 */
|
||||
NOBODY CNavArea::~CNavArea(void)
|
||||
{
|
||||
#ifndef HOOK_GAMEDLL
|
||||
if (m_isReset)
|
||||
#else
|
||||
if (*m_isReset)
|
||||
#endif // HOOK_GAMEDLL
|
||||
if (IMPLEMENT_ARRAY(m_isReset))
|
||||
{
|
||||
//m_overlapList.~list();
|
||||
//m_ladder->~list();
|
||||
@ -592,26 +588,49 @@ void CleanupApproachAreaAnalysisPrep(void)
|
||||
}
|
||||
|
||||
/* <4c7b18> ../game_shared/bot/nav_area.cpp:980 */
|
||||
NOBODY void DestroyLadders(void)
|
||||
void DestroyLadders(void)
|
||||
{
|
||||
// {
|
||||
// class CNavLadder *ladder; // 984
|
||||
// }
|
||||
while (!TheNavLadderList.empty())
|
||||
{
|
||||
CNavLadder *ladder = TheNavLadderList.front();
|
||||
TheNavLadderList.pop_front();
|
||||
delete ladder;
|
||||
}
|
||||
}
|
||||
|
||||
/* <4d6733> ../game_shared/bot/nav_area.cpp:994 */
|
||||
NOBODY void DestroyNavigationMap(void)
|
||||
void DestroyNavigationMap(void)
|
||||
{
|
||||
// {
|
||||
// class CNavNode *node; // 1015
|
||||
// class CNavNode *next; // 1015
|
||||
// empty(const class list<CNavArea*, std::allocator<CNavArea*>> *const this); // 999
|
||||
// {
|
||||
// class CNavArea *area; // 1001
|
||||
// pop_front(list<CNavArea*, std::allocator<CNavArea*>> *const this); // 1002
|
||||
// }
|
||||
// DestroyLadders(void); // 1009
|
||||
// }
|
||||
IMPLEMENT_ARRAY_CLASS(CNavArea, m_isReset) = true;
|
||||
|
||||
// remove each element of the list and delete them
|
||||
while (!TheNavAreaList.empty())
|
||||
{
|
||||
CNavArea *area = TheNavAreaList.front();
|
||||
TheNavAreaList.pop_front();
|
||||
delete area;
|
||||
}
|
||||
|
||||
IMPLEMENT_ARRAY_CLASS(CNavArea, m_isReset) = false;
|
||||
|
||||
// destroy ladder representations
|
||||
DestroyLadders();
|
||||
|
||||
// destroy all hiding spots
|
||||
DestroyHidingSpots();
|
||||
|
||||
// destroy navigation nodes created during map learning
|
||||
CNavNode *node, *next;
|
||||
for (node = IMPLEMENT_ARRAY_CLASS(CNavNode, m_list); node; node = next)
|
||||
{
|
||||
next = node->m_next;
|
||||
delete node;
|
||||
}
|
||||
|
||||
IMPLEMENT_ARRAY_CLASS(CNavNode, m_list) = NULL;
|
||||
|
||||
// reset the grid
|
||||
TheNavAreaGrid.Reset();
|
||||
}
|
||||
|
||||
/* <4c7e9a> ../game_shared/bot/nav_area.cpp:1046 */
|
||||
@ -1509,7 +1528,7 @@ NOBODY void CNavArea::RemoveFromOpenList(void)
|
||||
if (m_prevOpen)
|
||||
m_prevOpen->m_nextOpen = m_nextOpen;
|
||||
else
|
||||
(*m_openList) = m_nextOpen;
|
||||
IMPLEMENT_ARRAY(m_openList) = m_nextOpen;
|
||||
|
||||
if (m_nextOpen)
|
||||
m_nextOpen->m_prevOpen = m_prevOpen;
|
||||
@ -1522,11 +1541,7 @@ NOBODY void CNavArea::RemoveFromOpenList(void)
|
||||
NOBODY void CNavArea::ClearSearchLists(void)
|
||||
{
|
||||
CNavArea::MakeNewMarker();
|
||||
#ifndef HOOK_GAMEDLL
|
||||
m_openList = NULL;
|
||||
#else
|
||||
(*m_openList) = NULL;
|
||||
#endif // HOOK_GAMEDLL
|
||||
IMPLEMENT_ARRAY(m_openList) = NULL;
|
||||
}
|
||||
|
||||
/* <4cbe06> ../game_shared/bot/nav_area.cpp:2744 */
|
||||
@ -2198,13 +2213,21 @@ NOBODY int CNavArea::GetPlayerCount(int teamID, CBasePlayer *ignore) const
|
||||
}
|
||||
|
||||
/* <4cea33> ../game_shared/bot/nav_area.cpp:3749 */
|
||||
NOBODY CNavArea *GetMarkedArea(void)
|
||||
CNavArea *GetMarkedArea(void)
|
||||
{
|
||||
return markedArea;
|
||||
}
|
||||
|
||||
/* <4c2a8c> ../game_shared/bot/nav_area.cpp:3757 */
|
||||
NOBODY void EditNavAreasReset(void)
|
||||
void EditNavAreasReset(void)
|
||||
{
|
||||
markedArea = NULL;
|
||||
lastSelectedArea = NULL;
|
||||
isCreatingNavArea = false;
|
||||
isPlacePainting = false;
|
||||
|
||||
editTimestamp = 0.0f;
|
||||
lastDrawTimestamp = 0.0f;
|
||||
}
|
||||
|
||||
/* <4cea61> ../game_shared/bot/nav_area.cpp:3767 */
|
||||
@ -2754,13 +2777,23 @@ NOBODY CNavAreaGrid::~CNavAreaGrid(void)
|
||||
}
|
||||
|
||||
/* <4cf837> ../game_shared/bot/nav_area.cpp:4962 */
|
||||
NOBODY void CNavAreaGrid::Reset(void)
|
||||
void CNavAreaGrid::Reset(void)
|
||||
{
|
||||
// ~list(list<CNavArea*, std::allocator<CNavArea*>>::Reset(// int const __in_chrg); // 4965
|
||||
// {
|
||||
// int i; // 4972
|
||||
// }
|
||||
// EditNavAreasReset(void); // 4977
|
||||
if (m_grid)
|
||||
delete[] m_grid;
|
||||
|
||||
m_grid = NULL;
|
||||
m_gridSizeX = 0;
|
||||
m_gridSizeY = 0;
|
||||
|
||||
// clear the hash table
|
||||
for(int i = 0; i < HASH_TABLE_SIZE; i++)
|
||||
m_hashTable[i] = NULL;
|
||||
|
||||
m_areaCount = 0;
|
||||
|
||||
// reset static vars
|
||||
EditNavAreasReset();
|
||||
}
|
||||
|
||||
/* <4cf984> ../game_shared/bot/nav_area.cpp:4983 */
|
||||
|
@ -207,27 +207,15 @@ public:
|
||||
}
|
||||
void Mark(void)
|
||||
{
|
||||
#ifndef HOOK_GAMEDLL
|
||||
m_marker = m_masterMarker;
|
||||
#else
|
||||
m_marker = (*m_masterMarker);
|
||||
#endif // HOOK_GAMEDLL
|
||||
m_marker = IMPLEMENT_ARRAY(m_masterMarker);
|
||||
}
|
||||
bool IsMarked(void) const
|
||||
{
|
||||
#ifndef HOOK_GAMEDLL
|
||||
return (m_marker == m_masterMarker) ? true : false;
|
||||
#else
|
||||
return (m_marker == (*m_masterMarker)) ? true : false;
|
||||
#endif // HOOK_GAMEDLL
|
||||
return (m_marker == IMPLEMENT_ARRAY(m_masterMarker)) ? true : false;
|
||||
}
|
||||
static void ChangeMasterMarker(void)
|
||||
{
|
||||
#ifndef HOOK_GAMEDLL
|
||||
++m_masterMarker;
|
||||
#else
|
||||
++(*m_masterMarker);
|
||||
#endif // HOOK_GAMEDLL
|
||||
IMPLEMENT_ARRAY(m_masterMarker)++;
|
||||
}
|
||||
|
||||
private:
|
||||
@ -238,14 +226,11 @@ private:
|
||||
unsigned int m_marker;
|
||||
unsigned char m_flags;
|
||||
|
||||
#ifndef HOOK_GAMEDLL
|
||||
static unsigned int m_nextID;
|
||||
static unsigned int m_masterMarker;
|
||||
#else
|
||||
#ifdef HOOK_GAMEDLL
|
||||
public:
|
||||
static unsigned int (*m_nextID);
|
||||
static unsigned int (*m_masterMarker);
|
||||
#endif // HOOK_GAMEDLL
|
||||
static unsigned int IMPLEMENT_ARRAY(m_nextID);
|
||||
static unsigned int IMPLEMENT_ARRAY(m_masterMarker);
|
||||
|
||||
};/* size: 24, cachelines: 1, members: 6 */
|
||||
|
||||
@ -260,6 +245,7 @@ struct SpotOrder
|
||||
HidingSpot *spot;
|
||||
unsigned int id;
|
||||
};
|
||||
|
||||
};/* size: 8, cachelines: 1, members: 2 */
|
||||
|
||||
typedef std::list<SpotOrder> SpotOrderList;
|
||||
@ -273,6 +259,7 @@ struct SpotEncounter
|
||||
NavDirType toDir;
|
||||
Ray path;
|
||||
SpotOrderList spotList;
|
||||
|
||||
};/* size: 48, cachelines: 1, members: 6 */
|
||||
|
||||
typedef std::list<SpotEncounter> SpotEncounterList;
|
||||
@ -414,31 +401,17 @@ public:
|
||||
void ComputeApproachAreas(void);
|
||||
static void MakeNewMarker(void)
|
||||
{
|
||||
#ifndef HOOK_GAMEDLL
|
||||
++m_masterMarker;
|
||||
if (m_masterMarker == 0)
|
||||
m_masterMarker = 1;
|
||||
#else
|
||||
++(*m_masterMarker);
|
||||
if ((*m_masterMarker) == 0)
|
||||
(*m_masterMarker) = 1;
|
||||
#endif // HOOK_GAMEDLL
|
||||
IMPLEMENT_ARRAY(m_masterMarker)++;
|
||||
if (IMPLEMENT_ARRAY(m_masterMarker) == 0)
|
||||
IMPLEMENT_ARRAY(m_masterMarker) = 1;
|
||||
}
|
||||
void Mark(void)
|
||||
{
|
||||
#ifndef HOOK_GAMEDLL
|
||||
m_marker = m_masterMarker;
|
||||
#else
|
||||
m_marker = (*m_masterMarker);
|
||||
#endif // HOOK_GAMEDLL
|
||||
m_marker = IMPLEMENT_ARRAY(m_masterMarker);
|
||||
}
|
||||
BOOL IsMarked(void) const
|
||||
{
|
||||
#ifndef HOOK_GAMEDLL
|
||||
return (m_marker == m_masterMarker) ? true : false;
|
||||
#else
|
||||
return (m_marker == (*m_masterMarker)) ? true : false;
|
||||
#endif // HOOK_GAMEDLL
|
||||
return (m_marker == IMPLEMENT_ARRAY(m_masterMarker)) ? true : false;
|
||||
}
|
||||
void SetParent(CNavArea *parent, NavTraverseType how = NUM_TRAVERSE_TYPES)
|
||||
{
|
||||
@ -525,13 +498,13 @@ private:
|
||||
|
||||
void Initialize(void);
|
||||
|
||||
#ifndef HOOK_GAMEDLL
|
||||
static bool m_isReset;
|
||||
static unsigned int m_nextID;
|
||||
#else
|
||||
#ifdef HOOK_GAMEDLL
|
||||
public:
|
||||
static bool (*m_isReset);
|
||||
static unsigned int (*m_nextID);
|
||||
#endif // HOOK_GAMEDLL
|
||||
static bool IMPLEMENT_ARRAY(m_isReset);
|
||||
static unsigned int IMPLEMENT_ARRAY(m_nextID);
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
private:
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
@ -559,19 +532,22 @@ private:
|
||||
#if defined(_WIN32) && defined(HOOK_GAMEDLL)
|
||||
int unknown_padding2;
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
public:
|
||||
#endif // HOOK_GAMEDLL
|
||||
SpotEncounterList m_spotEncounterList;
|
||||
|
||||
enum { MAX_APPROACH_AREAS = 16 };
|
||||
|
||||
ApproachInfo m_approach[MAX_APPROACH_AREAS];
|
||||
ApproachInfo m_approach[MAX_APPROACH_AREAS];//104
|
||||
unsigned char m_approachCount;
|
||||
|
||||
#ifndef HOOK_GAMEDLL
|
||||
static unsigned int m_masterMarker;
|
||||
#else
|
||||
#ifdef HOOK_GAMEDLL
|
||||
public:
|
||||
static unsigned int (*m_masterMarker);
|
||||
#endif // HOOK_GAMEDLL
|
||||
static unsigned int IMPLEMENT_ARRAY(m_masterMarker);
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
private:
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
@ -581,11 +557,12 @@ private:
|
||||
float m_totalCost;
|
||||
float m_costSoFar;
|
||||
|
||||
#ifndef HOOK_GAMEDLL
|
||||
static CNavArea *m_openList;
|
||||
#else
|
||||
#ifdef HOOK_GAMEDLL
|
||||
public:
|
||||
static CNavArea *(*m_openList);
|
||||
#endif // HOOK_GAMEDLL
|
||||
static CNavArea *IMPLEMENT_ARRAY(m_openList);
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
private:
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
@ -650,21 +627,13 @@ inline CNavArea *CNavArea::GetAdjacentArea(NavDirType dir, int i) const
|
||||
/* <5a01dc> ../game_shared/bot/nav_area.h:435 */
|
||||
inline bool CNavArea::IsOpen(void) const
|
||||
{
|
||||
#ifndef HOOK_GAMEDLL
|
||||
return (m_openMarker == m_masterMarker) ? true : false;
|
||||
#else
|
||||
return (m_openMarker == (*m_masterMarker)) ? true : false;
|
||||
#endif // HOOK_GAMEDLL
|
||||
return (m_openMarker == IMPLEMENT_ARRAY(m_masterMarker)) ? true : false;
|
||||
}
|
||||
|
||||
/* <5a0a62> ../game_shared/bot/nav_area.h:440 */
|
||||
inline bool CNavArea::IsOpenListEmpty(void)
|
||||
{
|
||||
#ifndef HOOK_GAMEDLL
|
||||
return (m_openList != NULL) ? false : true;
|
||||
#else
|
||||
return ((*m_openList) != NULL) ? false : true;
|
||||
#endif // HOOK_GAMEDLL
|
||||
return (IMPLEMENT_ARRAY(m_openList) != NULL) ? false : true;
|
||||
}
|
||||
|
||||
/* <5a1483> ../game_shared/bot/nav_area.h:445 */
|
||||
@ -678,9 +647,9 @@ inline CNavArea *CNavArea::PopOpenList(void)
|
||||
return area;
|
||||
}
|
||||
#else
|
||||
if ((*m_openList))
|
||||
if (IMPLEMENT_ARRAY(m_openList))
|
||||
{
|
||||
CNavArea *area = (*m_openList);
|
||||
CNavArea *area = IMPLEMENT_ARRAY(m_openList);
|
||||
area->RemoveFromOpenList();
|
||||
return area;
|
||||
}
|
||||
@ -1260,40 +1229,44 @@ typedef void (HidingSpot::*CNAV_AREA_NAVNODE)(CNavNode *nwNode, class CNavNode *
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
||||
//#define TheNavLadderList (*pTheNavLadderList)
|
||||
#define TheNavLadderList (*pTheNavLadderList)
|
||||
#define TheHidingSpotList (*pTheHidingSpotList)
|
||||
#define TheNavAreaList (*pTheNavAreaList)
|
||||
#define TheNavAreaGrid (*pTheNavAreaGrid)
|
||||
|
||||
//#define lastDrawTimestamp (*plastDrawTimestamp)
|
||||
#define lastDrawTimestamp (*plastDrawTimestamp)
|
||||
#define goodSizedAreaList (*pgoodSizedAreaList)
|
||||
//#define markedArea (*pmarkedArea)
|
||||
//#define lastSelectedArea (*plastSelectedArea)
|
||||
#define markedArea (*pmarkedArea)
|
||||
#define lastSelectedArea (*plastSelectedArea)
|
||||
#define markedCorner (*pmarkedCorner)
|
||||
//#define isCreatingNavArea (*pisCreatingNavArea)
|
||||
#define isCreatingNavArea (*pisCreatingNavArea)
|
||||
//#define isAnchored (*pisAnchored)
|
||||
//#define anchor (*panchor)
|
||||
//#define isPlaceMode (*pisPlaceMode)
|
||||
//#define isPlacePainting (*pisPlacePainting)
|
||||
#define isPlacePainting (*pisPlacePainting)
|
||||
#define editTimestamp (*peditTimestamp)
|
||||
|
||||
#define BlockedID (*pBlockedID)
|
||||
#define BlockedIDCount (*pBlockedIDCount)
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
//extern NavLadderList TheNavLadderList;
|
||||
extern NavLadderList TheNavLadderList;
|
||||
extern HidingSpotList TheHidingSpotList;
|
||||
extern NavAreaList TheNavAreaList;
|
||||
extern CNavAreaGrid TheNavAreaGrid;
|
||||
//extern float lastDrawTimestamp;
|
||||
extern float lastDrawTimestamp;
|
||||
extern NavAreaList goodSizedAreaList;
|
||||
//extern CNavArea *markedArea;
|
||||
//extern CNavArea *lastSelectedArea;
|
||||
extern CNavArea *markedArea;
|
||||
extern CNavArea *lastSelectedArea;
|
||||
extern NavCornerType markedCorner;
|
||||
//extern bool isCreatingNavArea;
|
||||
extern bool isCreatingNavArea;
|
||||
//extern bool isAnchored;
|
||||
//extern Vector anchor;
|
||||
//extern bool isPlaceMode;
|
||||
//extern bool isPlacePainting;
|
||||
extern bool isPlacePainting;
|
||||
extern float editTimestamp;
|
||||
|
||||
extern unsigned int BlockedID[ MAX_BLOCKED_AREAS ];
|
||||
extern int BlockedIDCount;
|
||||
|
||||
@ -1311,7 +1284,7 @@ bool GetGroundHeight(const Vector *pos, float *height, Vector *normal = NULL);
|
||||
NOBODY bool GetSimpleGroundHeight(const Vector *pos, float *height, Vector *normal = NULL);
|
||||
NOBODY inline bool IsAreaVisible(const Vector *pos, const CNavArea *area);
|
||||
NOBODY CNavArea *GetMarkedArea(void);
|
||||
NOBODY void EditNavAreasReset(void);
|
||||
void EditNavAreasReset(void);
|
||||
NOBODY void DrawHidingSpots(const CNavArea *area);
|
||||
NOBODY void IncreaseDangerNearby(int teamID, float amount, CNavArea *startArea, const Vector *pos, float maxRadius);
|
||||
NOBODY void DrawDanger(void);
|
||||
@ -1323,7 +1296,7 @@ NOBODY const Vector *FindRandomHidingSpot(CBaseEntity *me, Place place, bool isS
|
||||
NOBODY HidingSpot *GetHidingSpotByID(unsigned int id);
|
||||
void ApproachAreaAnalysisPrep(void);
|
||||
void CleanupApproachAreaAnalysisPrep(void);
|
||||
NOBODY void DestroyLadders(void);
|
||||
void DestroyLadders(void);
|
||||
NOBODY void DestroyNavigationMap(void);
|
||||
NOBODY void StripNavigationAreas(void);
|
||||
NOBODY inline CNavArea *FindFirstAreaInDirection(const Vector *start, NavDirType dir, float range, float beneathLimit, CBaseEntity *traceIgnore, Vector *closePos);
|
||||
|
@ -537,9 +537,15 @@ NOBODY void SanityCheckNavigationMap(const char *mapName)
|
||||
// }
|
||||
}
|
||||
|
||||
void (*pLoadNavigationMap)(void);
|
||||
|
||||
/* <4f19c7> ../game_shared/bot/nav_file.cpp:947 */
|
||||
NOBODY NavErrorType LoadNavigationMap(void)
|
||||
NOBODY NavErrorType __declspec(naked) LoadNavigationMap(void)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
jmp pLoadNavigationMap
|
||||
}
|
||||
// {
|
||||
// char filename; // 955
|
||||
// class SteamFile navFile; // 965
|
||||
|
@ -69,4 +69,6 @@ NOBODY void LoadLocationFile(const char *filename);
|
||||
NOBODY void SanityCheckNavigationMap(const char *mapName);
|
||||
NOBODY NavErrorType LoadNavigationMap(void);
|
||||
|
||||
extern void (*pLoadNavigationMap)(void);
|
||||
|
||||
#endif // NAV_FILE_H
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
//NavDirType Opposite[ NUM_DIRECTIONS ] = { SOUTH, WEST, NORTH, EAST };
|
||||
|
||||
//CNavNode *CNavNode::m_list = NULL;
|
||||
CNavNode *CNavNode::m_list = NULL;
|
||||
//unsigned int CNavNode::m_listLength = 0;
|
||||
|
||||
//Extent NodeMapExtent;
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
//NavDirType Opposite[ NUM_DIRECTIONS ];
|
||||
|
||||
//CNavNode *CNavNode::m_list;
|
||||
CNavNode *IMPLEMENT_ARRAY_CLASS(CNavNode, m_list);
|
||||
//unsigned int CNavNode::m_listLength;
|
||||
|
||||
//Extent NodeMapExtent;
|
||||
|
@ -54,7 +54,7 @@ public:
|
||||
|
||||
static CNavNode *GetFirst(void)
|
||||
{
|
||||
return m_list;
|
||||
return IMPLEMENT_ARRAY(m_list);
|
||||
}
|
||||
static unsigned int GetListLength(void)
|
||||
{
|
||||
@ -109,9 +109,14 @@ private:
|
||||
unsigned int m_id; // unique ID of this node
|
||||
unsigned char m_attributeFlags; // set of attribute bit flags (see NavAttributeType)
|
||||
|
||||
static CNavNode *m_list; // the master list of all nodes for this map
|
||||
#ifdef HOOK_GAMEDLL
|
||||
public:
|
||||
#endif // HOOK_GAMEDLL
|
||||
static CNavNode *IMPLEMENT_ARRAY(m_list); // the master list of all nodes for this map
|
||||
static unsigned int m_listLength;
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
private:
|
||||
#endif // HOOK_GAMEDLL
|
||||
CNavNode *m_next; // next link in master list
|
||||
|
||||
// below are only needed when generating
|
||||
|
@ -56,7 +56,13 @@ NOBODY bool SharedTokenWaiting(const char *buffer);
|
||||
/* <db469> ../game_shared/shared_util.h:46 */
|
||||
inline char *CloneString(const char *str)
|
||||
{
|
||||
char *cloneStr = new char [strlen(str) + 1];
|
||||
if (!str)
|
||||
{
|
||||
char *cloneStr = new char[1];
|
||||
cloneStr[0] = '\0';
|
||||
return cloneStr;
|
||||
}
|
||||
char *cloneStr = new char [Q_strlen(str) + 1];
|
||||
Q_strcpy(cloneStr, str);
|
||||
return cloneStr;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -33,9 +33,50 @@ HIDDEN Module g_EngineModule = { NULL, NULL, NULL, NULL };
|
||||
|
||||
extern const size_t g_BaseOffset;
|
||||
extern FunctionHook g_FunctionHooks[];
|
||||
extern VirtualTableRef g_TableRefs[];
|
||||
extern AddressRef g_FunctionRefs[];
|
||||
extern AddressRef g_DataRefs[];
|
||||
|
||||
VirtualTableRef *GetVirtualTableRefAddr(const char *szClassName)
|
||||
{
|
||||
VirtualTableRef *refData = g_TableRefs;
|
||||
while (refData->symbolName != NULL)
|
||||
{
|
||||
if (!strcmp(refData->symbolName, szClassName))
|
||||
{
|
||||
if (refData->originalAddress != NULL)
|
||||
{
|
||||
return refData;
|
||||
}
|
||||
}
|
||||
refData++;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool GetAddressUsingHook(size_t addr)
|
||||
{
|
||||
for (FunctionHook *cfh = &g_FunctionHooks[0]; cfh->symbolName; cfh++)
|
||||
{
|
||||
if (addr == cfh->originalAddress)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t OffsetToRebase(size_t addr)
|
||||
{
|
||||
return (addr - g_GameDLLModule.base + g_BaseOffset);
|
||||
}
|
||||
|
||||
void *GetFunctionEntity(const char *szClassName)
|
||||
{
|
||||
return Sys_GetProcAddress((HMODULE)g_GameDLLModule.base, szClassName);
|
||||
}
|
||||
|
||||
void printAddrRebase(size_t addr,const char *funcName)
|
||||
{
|
||||
static int inum = 0;
|
||||
@ -100,6 +141,8 @@ void *GetFuncRefAddrOrDefault(const char *funcName, void *def)
|
||||
return def;
|
||||
}
|
||||
|
||||
int nCountHook = 0;
|
||||
|
||||
int HookGameDLL(size_t gameAddr, size_t engAddr)
|
||||
{
|
||||
if (gameAddr == NULL
|
||||
@ -131,7 +174,7 @@ int HookGameDLL(size_t gameAddr, size_t engAddr)
|
||||
if (!GetAddress(&g_GameDLLModule, (Address *)refFunc, g_BaseOffset))
|
||||
{
|
||||
#if _DEBUG
|
||||
printf(__FUNCTION__ ": symbol not found \"%s\", symbol index: %i\n", refData->symbolName, refData->symbolIndex);
|
||||
printf(__FUNCTION__ ": symbol not found \"%s\", symbol index: %i\n", refFunc->symbolName, refFunc->symbolIndex);
|
||||
success = false;
|
||||
#endif // _DEBUG
|
||||
}
|
||||
@ -144,13 +187,26 @@ int HookGameDLL(size_t gameAddr, size_t engAddr)
|
||||
if (!GetAddress(&g_GameDLLModule, (Address*)hookFunc, g_BaseOffset))
|
||||
{
|
||||
#if _DEBUG
|
||||
printf(__FUNCTION__ ": symbol not found \"%s\", symbol index: %i\n", refData->symbolName, refData->symbolIndex);
|
||||
printf(__FUNCTION__ ": symbol not found \"%s\", symbol index: %i\n", hookFunc->symbolName, hookFunc->symbolIndex);
|
||||
success = false;
|
||||
#endif // _DEBUG
|
||||
}
|
||||
hookFunc++;
|
||||
}
|
||||
|
||||
VirtualTableRef *refVtbl = g_TableRefs;
|
||||
while (refVtbl->symbolName != NULL)
|
||||
{
|
||||
if (!GetAddress(&g_GameDLLModule, (Address *)refVtbl, g_BaseOffset))
|
||||
{
|
||||
#if _DEBUG
|
||||
printf(__FUNCTION__ ": symbol not found \"%s\"\n", refVtbl->symbolName);
|
||||
success = false;
|
||||
#endif // _DEBUG
|
||||
}
|
||||
refVtbl++;
|
||||
}
|
||||
|
||||
if (!success)
|
||||
{
|
||||
#if _DEBUG
|
||||
@ -192,7 +248,9 @@ int HookGameDLL(size_t gameAddr, size_t engAddr)
|
||||
{
|
||||
if (!HookFunction(&g_GameDLLModule, hookFunc))
|
||||
return (FALSE);
|
||||
|
||||
hookFunc++;
|
||||
nCountHook++;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,10 @@
|
||||
|
||||
#include "osconfig.h"
|
||||
|
||||
extern size_t OffsetToRebase(size_t addr);
|
||||
extern bool GetAddressUsingHook(size_t addr);
|
||||
extern VirtualTableRef *GetVirtualTableRefAddr(const char *szClassName);
|
||||
extern void *GetFunctionEntity(const char *szClassName);
|
||||
extern void printAddrRebase(size_t addr,const char *funcName);
|
||||
extern FunctionHook *GetFunctionPtrByName(const char *funcName);
|
||||
extern void *GetOriginalFuncAddrOrDie(const char *funcName);
|
||||
|
@ -726,7 +726,7 @@ bool HIDDEN HookFunction(Module *module, FunctionHook *hook)
|
||||
patch[0] = 0xE9;
|
||||
|
||||
#if 1
|
||||
if (strcmp(hook->symbolName,"_ZN11CBasePlayer10SwitchTeamEv")==0)
|
||||
if (strcmp(hook->symbolName,"_ZNK9BotPhrase12GetSpeakableEiPf")==0)
|
||||
{
|
||||
addr_orig = (void *)hook->originalAddress;
|
||||
|
||||
@ -778,3 +778,103 @@ void FindAllCalls(Section* section, CFuncAddr** calls, uint32_t findRefsTo)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
template<typename T>
|
||||
size_t vtable_size(const T &t)
|
||||
{
|
||||
typedef void Function();
|
||||
Function *const *const vtable = reinterpret_cast<Function *const *const&>(t);
|
||||
size_t size = 0;
|
||||
|
||||
byte first_addr_byte = '\x2A';
|
||||
|
||||
while (vtable[size])
|
||||
{
|
||||
byte addr_byte = *((byte *)(&vtable[size]) + 3);
|
||||
|
||||
if (first_addr_byte == '\x2A')
|
||||
first_addr_byte = addr_byte;
|
||||
|
||||
if (addr_byte != first_addr_byte)
|
||||
break;
|
||||
|
||||
++size;
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
const char *stripClass(const char *str)
|
||||
{
|
||||
const int BufLen = 256;
|
||||
static char string[ BufLen ];
|
||||
const char pattern[] = "class ";
|
||||
|
||||
int curlen = Q_strlen(str);
|
||||
|
||||
Q_strncpy(string, str, curlen);
|
||||
string[ curlen ] = '\0';
|
||||
|
||||
curlen = (Q_strstr(string, pattern) != NULL) ? Q_strlen(pattern) : 0;
|
||||
|
||||
return &string[ curlen ];
|
||||
}
|
||||
|
||||
#if defined(_WIN32) && !defined(REGAMEDLL_UNIT_TESTS)
|
||||
|
||||
void VirtualTableInit(void *ptr, const char *baseClass)
|
||||
{
|
||||
if (!baseClass || *baseClass == '\0')
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
VirtualTableRef *refsVtbl = GetVirtualTableRefAddr(baseClass);
|
||||
if (!refsVtbl)
|
||||
{
|
||||
regamedll_syserror(__FUNCTION__": Missing vtable for \"%s\"", baseClass);
|
||||
}
|
||||
|
||||
/*
|
||||
int nCount = vtable_size(refsVtbl->originalAddress);
|
||||
|
||||
if (nCount != refsVtbl->size)
|
||||
regamedll_syserror(__FUNCTION__": Invalid size virtual table, expected [%d], got [%d]", nCount, refsVtbl->size);
|
||||
*/
|
||||
|
||||
int **ivtable = *(int ***)ptr;
|
||||
int **ivtable_orig = (int **)refsVtbl->originalAddress;
|
||||
|
||||
for (size_t i = 0; i < refsVtbl->size; i++)
|
||||
{
|
||||
if (!GetAddressUsingHook((size_t)ivtable_orig[i]))
|
||||
{
|
||||
EnablePageWrite((size_t)&ivtable[i], 5);
|
||||
ivtable[i] = ivtable_orig[i];
|
||||
RestorePageProtection((size_t)&ivtable[i], 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void HIDDEN GetAddressVtableByClassname(const char *szClassName, const int iOffset)
|
||||
{
|
||||
edict_t *pObject = CREATE_ENTITY();
|
||||
|
||||
void *addr = GetFunctionEntity(szClassName);
|
||||
|
||||
if (addr == NULL)
|
||||
{
|
||||
REMOVE_ENTITY(pObject);
|
||||
return;
|
||||
}
|
||||
|
||||
// call link to class GetClassPtr<BaseClass>(pev);
|
||||
reinterpret_cast<void (*)(entvars_t *)>(addr)(&pObject->v);
|
||||
|
||||
void *vtable = *(void **)pObject->pvPrivateData;
|
||||
printf2(__FUNCTION__ "* ADDRESS VTABLE: %p | ADDRESS VIRTUAL FUNC: %p",
|
||||
OffsetToRebase((size_t)vtable),
|
||||
OffsetToRebase(*(((size_t **)&vtable)[ iOffset ])));
|
||||
}
|
||||
|
||||
#endif // _WIN32 && REGAMEDLL_UNIT_TESTS
|
@ -79,6 +79,13 @@ struct FunctionHook
|
||||
bool bIsHooked;
|
||||
};
|
||||
|
||||
struct VirtualTableRef
|
||||
{
|
||||
size_t originalAddress;
|
||||
const char *symbolName;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
struct AddressRef
|
||||
{
|
||||
// Keeps offset for SWDS on application start; during HookEngine() an real address is written here.
|
||||
@ -137,4 +144,12 @@ bool HIDDEN FindDataRef(Module *module, AddressRef *ref);
|
||||
void FindAllCalls(Section* section, CFuncAddr** calls, uint32_t findRefsTo);
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && !defined(REGAMEDLL_UNIT_TESTS)
|
||||
|
||||
const char *stripClass(const char *str);
|
||||
void VirtualTableInit(void *ptr, const char *baseClass = NULL);
|
||||
void HIDDEN GetAddressVtableByClassname(const char *szClassName, const int iOffset = 0);
|
||||
|
||||
#endif // _WIN32 && REGAMEDLL_UNIT_TESTS
|
||||
|
||||
#endif // _MEMORY_H
|
||||
|
@ -65,6 +65,18 @@ void Regamedll_Debug_logStrDup(const char *s, void *ptr)
|
||||
g_ReGameDLLDebugLog.flush();
|
||||
}
|
||||
|
||||
#if defined(_WIN32) && !defined(REGAMEDLL_UNIT_TESTS)
|
||||
|
||||
extern int nCountHook;
|
||||
|
||||
void Regamedll_Game_Init(void)
|
||||
{
|
||||
if (!g_ReGameDLLRuntimeConfig.disableAllHooks)
|
||||
printf2("[Hooker]: The total number hooks of functions is - %d", nCountHook);
|
||||
}
|
||||
|
||||
#endif // _WIN32 && REGAMEDLL_UNIT_TESTS
|
||||
|
||||
void Regamedll_Debug_Init(void)
|
||||
{
|
||||
//g_ReGameDLLDebugLog.exceptions(std::ios::badbit | std::ios::failbit);
|
||||
|
@ -12,6 +12,10 @@ extern void Regamedll_Debug_logFree(void *ptr);
|
||||
extern void Regamedll_Debug_logStrDup(const char *s, void *ptr);
|
||||
extern void Regamedll_Debug_Init(void);
|
||||
|
||||
#if defined(_WIN32) && !defined(REGAMEDLL_UNIT_TESTS)
|
||||
extern void Regamedll_Game_Init(void);
|
||||
#endif // _WIN32 && REGAMEDLL_UNIT_TESTS
|
||||
|
||||
extern void _printf2(const char *fmt, ...);
|
||||
extern void _print_chat(class CBasePlayer *pPlayer, const char *fmt, ...);
|
||||
|
||||
|
@ -34,17 +34,24 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Play|Win32'">false</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\dlls\bot\cs_bot_chatter.cpp" />
|
||||
<ClCompile Include="..\dlls\bot\cs_bot_chatter.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">
|
||||
</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\dlls\bot\cs_bot_event.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Play|Win32'">false</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\dlls\bot\cs_bot_init.cpp" />
|
||||
<ClCompile Include="..\dlls\bot\cs_bot_init.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">
|
||||
</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\dlls\bot\cs_bot_learn.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">
|
||||
</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Play|Win32'">false</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
@ -54,7 +61,10 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Play|Win32'">false</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\dlls\bot\cs_bot_manager.cpp" />
|
||||
<ClCompile Include="..\dlls\bot\cs_bot_manager.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">
|
||||
</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\dlls\bot\cs_bot_nav.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">false</ExcludedFromBuild>
|
||||
@ -69,25 +79,34 @@
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\dlls\bot\cs_bot_radio.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">
|
||||
</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Play|Win32'">false</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\dlls\bot\cs_bot_statemachine.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">
|
||||
</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Play|Win32'">false</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\dlls\bot\cs_bot_update.cpp" />
|
||||
<ClCompile Include="..\dlls\bot\cs_bot_vision.cpp" />
|
||||
<ClCompile Include="..\dlls\bot\cs_bot_update.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">
|
||||
</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\dlls\bot\cs_bot_vision.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">false</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\dlls\bot\cs_bot_weapon.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release Play|Win32'">false</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\dlls\bot\cs_gamestate.cpp" />
|
||||
<ClCompile Include="..\dlls\bot\cs_gamestate.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">false</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\dlls\bot\states\cs_bot_attack.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">false</ExcludedFromBuild>
|
||||
@ -185,35 +204,35 @@
|
||||
<ClCompile Include="..\dlls\hintmessage.cpp" />
|
||||
<ClCompile Include="..\dlls\hostage\hostage.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">false</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\dlls\hostage\hostage_improv.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">false</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\dlls\hostage\hostage_localnav.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">false</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\dlls\hostage\states\hostage_animate.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">false</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\dlls\hostage\states\hostage_escape.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">false</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\dlls\hostage\states\hostage_follow.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">false</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\dlls\hostage\states\hostage_idle.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">false</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\dlls\hostage\states\hostage_retreat.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">false</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\dlls\h_ai.cpp" />
|
||||
<ClCompile Include="..\dlls\h_battery.cpp" />
|
||||
@ -499,6 +518,7 @@
|
||||
<ClInclude Include="..\common\cvardef.h" />
|
||||
<ClInclude Include="..\common\entity_state.h" />
|
||||
<ClInclude Include="..\common\event_flags.h" />
|
||||
<ClInclude Include="..\common\hltv.h" />
|
||||
<ClInclude Include="..\common\in_buttons.h" />
|
||||
<ClInclude Include="..\common\mathlib.h" />
|
||||
<ClInclude Include="..\common\netadr.h" />
|
||||
@ -517,10 +537,21 @@
|
||||
<ClInclude Include="..\dlls\animation.h" />
|
||||
<ClInclude Include="..\dlls\basemonster.h" />
|
||||
<ClInclude Include="..\dlls\bmodels.h" />
|
||||
<ClInclude Include="..\dlls\bot\cs_bot.h" />
|
||||
<ClInclude Include="..\dlls\bot\cs_bot_chatter.h" />
|
||||
<ClInclude Include="..\dlls\bot\cs_bot_manager.h" />
|
||||
<ClInclude Include="..\dlls\bot\cs_gamestate.h" />
|
||||
<ClInclude Include="..\dlls\bot\cs_bot.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">
|
||||
</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\dlls\bot\cs_bot_chatter.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">
|
||||
</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\dlls\bot\cs_bot_manager.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">
|
||||
</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\dlls\bot\cs_gamestate.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug Play|Win32'">false</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\dlls\buttons.h" />
|
||||
<ClInclude Include="..\dlls\career_tasks.h" />
|
||||
<ClInclude Include="..\dlls\cbase.h" />
|
||||
@ -561,6 +592,7 @@
|
||||
<ClInclude Include="..\dlls\plats.h" />
|
||||
<ClInclude Include="..\dlls\player.h" />
|
||||
<ClInclude Include="..\dlls\saverestore.h" />
|
||||
<ClInclude Include="..\dlls\schedule.h" />
|
||||
<ClInclude Include="..\dlls\skill.h" />
|
||||
<ClInclude Include="..\dlls\sound.h" />
|
||||
<ClInclude Include="..\dlls\soundent.h" />
|
||||
@ -813,6 +845,7 @@
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>precompiled.h</PrecompiledHeaderFile>
|
||||
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
@ -961,6 +994,7 @@
|
||||
<AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>precompiled.h</PrecompiledHeaderFile>
|
||||
<FloatingPointModel>Precise</FloatingPointModel>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
|
@ -1106,6 +1106,12 @@
|
||||
<ClInclude Include="..\dlls\world.h">
|
||||
<Filter>dlls</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\common\hltv.h">
|
||||
<Filter>dlls\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\dlls\schedule.h">
|
||||
<Filter>dlls</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\linux\appversion.sh">
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "extdll.h"
|
||||
|
||||
#include "h_export.h"
|
||||
//#include "schedule.h"
|
||||
#include "schedule.h"
|
||||
#include "archtypes.h"
|
||||
#include "enginecallback.h"
|
||||
//#include "entity_state.h"
|
||||
@ -61,6 +61,7 @@
|
||||
#include "shake.h"
|
||||
#include "util.h"
|
||||
#include "decals.h"
|
||||
#include "hltv.h"
|
||||
#include "cbase.h"
|
||||
#include "world.h"
|
||||
|
||||
@ -116,8 +117,6 @@
|
||||
// Hostage
|
||||
#include "hostage/hostage.h"
|
||||
#include "hostage/hostage_localnav.h"
|
||||
#include "hostage/hostage_states.h"
|
||||
#include "hostage/hostage_improv.h"
|
||||
|
||||
#include "airtank.h"
|
||||
#include "h_ai.h"
|
||||
|
@ -48,6 +48,10 @@ void regamedll_syserror(const char *fmt, ...)
|
||||
fprintf(fl, "%s\n", string);
|
||||
fclose(fl);
|
||||
|
||||
#ifdef _WIN32
|
||||
printf2(__FUNCTION__ ":: demo failed");
|
||||
#endif // _WIN32
|
||||
|
||||
//TerminateProcess(GetCurrentProcess(), 1);
|
||||
|
||||
*((int *)NULL) = 0;
|
||||
|
@ -18,13 +18,13 @@
|
||||
#include "MemPool.h"
|
||||
#include "engine.h"
|
||||
|
||||
#include "dlls.h"
|
||||
#include "basetypes.h"
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
#include "hooker.h"
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
#include "dlls.h"
|
||||
#include "basetypes.h"
|
||||
|
||||
//valve libs stuff
|
||||
#include "tier0/platform.h"
|
||||
#include "tier0/dbg.h"
|
||||
|
@ -40,6 +40,7 @@ TEST(StructOffsets, ReversingChecks, 5000)
|
||||
REPEAT_SIZEOF_PRINT(CBotManager);
|
||||
REPEAT_SIZEOF_PRINT(CCSBotManager);
|
||||
REPEAT_SIZEOF_PRINT(BotPhraseManager);
|
||||
REPEAT_SIZEOF_PRINT(BotPhrase);
|
||||
REPEAT_SIZEOF_PRINT(CBasePlayer);
|
||||
REPEAT_SIZEOF_PRINT(ActiveGrenade);
|
||||
|
||||
@ -51,10 +52,15 @@ TEST(StructOffsets, ReversingChecks, 5000)
|
||||
REPEAT_SIZEOF_PRINT(CGib);
|
||||
REPEAT_SIZEOF_PRINT(CSprayCan);
|
||||
REPEAT_SIZEOF_PRINT(CountdownTimer);
|
||||
REPEAT_SIZEOF_PRINT(CCareerTaskManager);
|
||||
REPEAT_SIZEOF_PRINT(CCareerTask);
|
||||
REPEAT_SIZEOF_PRINT(CPreventDefuseTask);
|
||||
|
||||
// offset the members
|
||||
REPEAT_OFFSETOF_PRINT(CBaseEntity, pev);
|
||||
REPEAT_OFFSETOF_PRINT(CBaseEntity, has_disconnected);
|
||||
//REPEAT_OFFSETOF_PRINT(CPreventDefuseTask, m_bombPlantedThisRound);
|
||||
//REPEAT_OFFSETOF_PRINT(CPreventDefuseTask, m_defuseStartedThisRound);
|
||||
|
||||
// assert
|
||||
CHECK_CLASS_SIZE(CNavArea, 0x238u, 0x214u);
|
||||
@ -62,14 +68,21 @@ TEST(StructOffsets, ReversingChecks, 5000)
|
||||
CHECK_CLASS_SIZE(CBasePlayer, 0x9B0, 0x9C4);
|
||||
CHECK_CLASS_SIZE(CHostageImprov, 0x1C8Cu, 0x1C8Cu);
|
||||
CHECK_CLASS_SIZE(BotPhraseManager, 0x21Cu, 0x214u);
|
||||
CHECK_CLASS_SIZE(BotPhrase, 0x50, 0x44);
|
||||
|
||||
CHECK_CLASS_SIZE(CHalfLifeMultiplay, 0x2D0u, 0x2C4u);
|
||||
CHECK_CLASS_SIZE(CHalfLifeTraining, 0x2E8u, 0x2D8u);
|
||||
CHECK_CLASS_SIZE(CGib, 0x98, 0xA8);
|
||||
CHECK_CLASS_SIZE(CSprayCan, 0x88, 0x98);
|
||||
CHECK_CLASS_SIZE(CBaseEntity, 0x88, 0x98);
|
||||
CHECK_CLASS_SIZE(CGrenade, 0x1E0, 0x1F4);
|
||||
//CHECK_CLASS_SIZE(CountdownTimer, 0xC, 0x8);
|
||||
CHECK_CLASS_SIZE(CCareerTaskManager, 0x28, 0x24);
|
||||
CHECK_CLASS_SIZE(CCareerTask, 0x2C, 0x2C);
|
||||
CHECK_CLASS_SIZE(CPreventDefuseTask, 0x30, 0x30);
|
||||
|
||||
//CHECK_CLASS_SIZE(CBotManager, 12u, 12);
|
||||
CHECK_CLASS_SIZE(CCSBot, 11404, 11424);
|
||||
//CHECK_CLASS_SIZE(CCSBotManager, 740, 0x2E0u);//0x2E4u | 0x2E0u
|
||||
|
||||
//CHECK_CLASS_SIZE(HostageStateMachine, 0x10, 0x10);
|
||||
|
Loading…
x
Reference in New Issue
Block a user