diff --git a/regamedll/build.gradle b/regamedll/build.gradle index 26299cc4..cf8ecae0 100644 --- a/regamedll/build.gradle +++ b/regamedll/build.gradle @@ -127,7 +127,7 @@ void setupToolchain(NativeBinarySpec b) { } b.lib LazyNativeDepSet.create(dep_bzip2, 'bzip2', b.buildType.name, true) - cfg.singleDefines 'USE_BREAKPAD_HANDLER', 'DEDICATED', 'REGAMEDLL_SELF', 'HOOK_GAMEDLL', 'BUILD_GRADLE' + cfg.singleDefines 'USE_BREAKPAD_HANDLER', 'DEDICATED', 'REGAMEDLL_SELF', 'HOOK_GAMEDLL', 'CLIENT_WEAPONS' if (cfg instanceof MsvcToolchainConfig) { diff --git a/regamedll/dlls/bmodels.cpp b/regamedll/dlls/bmodels.cpp index b26ef3a3..76cf8096 100644 --- a/regamedll/dlls/bmodels.cpp +++ b/regamedll/dlls/bmodels.cpp @@ -34,8 +34,9 @@ TYPEDESCRIPTION (*CPendulum::pm_SaveData)[8]; #endif // HOOK_GAMEDLL /* <1c36f> ../cstrike/dlls/bmodels.cpp:43 */ -NOBODY Vector VecBModelOrigin(entvars_t *pevBModel) -{ +Vector VecBModelOrigin(entvars_t *pevBModel) +{ + return pevBModel->absmin + (pevBModel->size * 0.5); } /* <1e384> ../cstrike/dlls/bmodels.cpp:63 */ diff --git a/regamedll/dlls/bmodels.h b/regamedll/dlls/bmodels.h index e0942a5e..1e73f212 100644 --- a/regamedll/dlls/bmodels.h +++ b/regamedll/dlls/bmodels.h @@ -259,6 +259,6 @@ public: };/* size: 200, cachelines: 4, members: 10 */ -NOBODY Vector VecBModelOrigin(entvars_t *pevBModel); +Vector VecBModelOrigin(entvars_t *pevBModel); #endif // BMODELS_H diff --git a/regamedll/dlls/cbase.h b/regamedll/dlls/cbase.h index 3bd47675..438ba8c7 100644 --- a/regamedll/dlls/cbase.h +++ b/regamedll/dlls/cbase.h @@ -511,8 +511,8 @@ public: void UpdateOnRemove(void); void EXPORT SUB_Remove(void); void EXPORT SUB_DoNothing(void); - NOBODY void EXPORT SUB_StartFadeOut(void); - NOBODY void EXPORT SUB_FadeOut(void); + void EXPORT SUB_StartFadeOut(void); + void EXPORT SUB_FadeOut(void); NOBODY void EXPORT SUB_CallUseToggle(void) { Use(this,this,USE_TOGGLE,0); @@ -1094,6 +1094,10 @@ typedef BOOL (CBaseEntity::*FVISIBLE_VECTOR)(Vector &); typedef void (CGrenade::*EXPLODE_VECTOR)(Vector, Vector); typedef void (CGrenade::*EXPLODE_TRACERESULT)(TraceResult *, int); +typedef CBaseEntity *(CBaseEntity::*CBASE_ISTANCE_EDICT)(edict_t *); +typedef CBaseEntity *(CBaseEntity::*CBASE_ISTANCE_ENTVARS)(entvars_t *); +typedef CBaseEntity *(CBaseEntity::*CBASE_ISTANCE_INT)(int); + #endif // HOOK_GAMEDLL //Refs diff --git a/regamedll/dlls/combat.cpp b/regamedll/dlls/combat.cpp index 801f4832..c0a88379 100644 --- a/regamedll/dlls/combat.cpp +++ b/regamedll/dlls/combat.cpp @@ -1,13 +1,21 @@ #include "precompiled.h" +#define GERMAN_GIB_COUNT 4 +#define HUMAN_GIB_COUNT 6 +#define ALIEN_GIB_COUNT 4 + /* <5f4cb> ../cstrike/dlls/combat.cpp:52 */ -NOBODY void CGib::LimitVelocity(void) +void CGib::LimitVelocity(void) { -// { -// float length; // 54 -// Length(const Vector *const this); // 54 -// } -// LimitVelocity(CGib *const this); // 52 + float length = pev->velocity.Length(); + + // ceiling at 1500. The gib velocity equation is not bounded properly. Rather than tune it + // in 3 separate places again, I'll just limit it here. + if (length > 1500.0) + { + // This should really be sv_maxvelocity * 0.75 or something + pev->velocity = pev->velocity.Normalize() * 1500; + } } /* <60320> ../cstrike/dlls/combat.cpp:63 */ @@ -73,36 +81,16 @@ NOBODY void CGib::SpawnHeadGib(entvars_t *pevVictim) // } } +void (*pCGib__SpawnRandomGibs)(entvars_t *pevVictim, int cGibs, int human); + /* <606c8> ../cstrike/dlls/combat.cpp:190 */ -NOBODY void CGib::SpawnRandomGibs(entvars_t *pevVictim, int human, int cGibs) +NOBODY void __declspec(naked) CGib::SpawnRandomGibs(entvars_t *pevVictim, int cGibs, int human) { -// { -// int cSplat; // 192 -// { -// class CGib *pGib; // 196 -// operator*(const Vector *const this, -// float fl); // 227 -// operator*(const Vector *const this, -// float fl); // 234 -// Instance(entvars_t *pev); // 240 -// operator*(const Vector *const this, -// float fl); // 244 -// operator*(const Vector *const this, -// float fl); // 252 -// Vector(Vector *const this, -// float X, -// float Y, -// float Z); // 256 -// Vector(Vector *const this, -// float X, -// float Y, -// float Z); // 256 -// LimitVelocity(CGib *const this); // 258 -// GetClassPtr(CGib *a); // 196 -// operator*(const Vector *const this, -// float fl); // 248 -// } -// } + // TODO: Reverse me! + __asm + { + jmp pCGib__SpawnRandomGibs + } } /* <5f58a> ../cstrike/dlls/combat.cpp:263 */ @@ -234,34 +222,88 @@ NOBODY void CBaseMonster::Killed_(entvars_t *pevAttacker, int iGib) } /* <5e84e> ../cstrike/dlls/combat.cpp:652 */ -NOBODY void CBaseEntity::SUB_StartFadeOut(void) +void CBaseEntity::SUB_StartFadeOut(void) { + if (pev->rendermode == kRenderNormal) + { + pev->renderamt = 255.0f; + pev->rendermode = kRenderTransTexture; + } + + pev->solid = SOLID_NOT; + pev->avelocity = g_vecZero; + pev->nextthink = gpGlobals->time + 0.1f; + + SetThink(&CBaseEntity::SUB_FadeOut); } /* <5ea72> ../cstrike/dlls/combat.cpp:667 */ -NOBODY void CBaseEntity::SUB_FadeOut(void) +void CBaseEntity::SUB_FadeOut(void) { -// SUB_FadeOut(CBaseEntity *const this); // 667 + if (pev->renderamt > 7) + { + pev->renderamt -= 7.0f; + pev->nextthink = gpGlobals->time + 0.1f; + } + else + { + pev->renderamt = 0.0f; + pev->nextthink = gpGlobals->time + 0.2f; + SetThink(&CBaseEntity::SUB_Remove); + } } /* <5eab1> ../cstrike/dlls/combat.cpp:688 */ -NOBODY void CGib::WaitTillLand(void) +void CGib::WaitTillLand(void) { -// operator==(const Vector ::WaitTillLand(// const Vector &v); // 696 -// WaitTillLand(CGib *const this); // 688 + if (!IsInWorld()) + { + UTIL_Remove(this); + return; + } + + if (pev->velocity == g_vecZero) + { + SetThink(&CBaseEntity::SUB_StartFadeOut); + pev->nextthink = gpGlobals->time + m_lifeTime; + + if (m_bloodColor != DONT_BLEED) + CSoundEnt::InsertSound(bits_SOUND_MEAT, pev->origin, 384, 25); + } + else + pev->nextthink = gpGlobals->time + 0.5f; } /* <5eee0> ../cstrike/dlls/combat.cpp:718 */ -NOBODY void CGib::BounceGibTouch(CBaseEntity *pOther) +void CGib::BounceGibTouch(CBaseEntity *pOther) { -// { -// class Vector vecSpot; // 720 -// TraceResult tr; // 721 -// operator*(const Vector *const this, -// float fl); // 728 -// } -// BounceGibTouch(CGib *const this, -// class CBaseEntity *pOther); // 718 + if (pev->flags & FL_ONGROUND) + { + pev->velocity = pev->velocity * 0.9; + pev->angles.x = 0; + pev->angles.z = 0; + pev->avelocity.x = 0; + pev->avelocity.z = 0; + } + else + { + if (g_Language != LANGUAGE_GERMAN && m_cBloodDecals > 0 && m_bloodColor != DONT_BLEED) + { + TraceResult tr; + Vector vecSpot = pev->origin + Vector(0, 0, 8); + UTIL_TraceLine(vecSpot, vecSpot + Vector(0, 0, -24), ignore_monsters, ENT(pev), &tr); + UTIL_BloodDecalTrace(&tr, m_bloodColor); + m_cBloodDecals--; + } + + if (m_material != matNone && !RANDOM_LONG(0, 2)) + { + float zvel = fabs(pev->velocity.z); + float volume = 0.8 * min(1, zvel / 450); + + CBreakable::MaterialSoundRandom(edict(), (Materials)m_material, volume); + } + } } /* <5ed6d> ../cstrike/dlls/combat.cpp:761 */ @@ -278,18 +320,41 @@ NOBODY void CGib::StickyGibTouch(CBaseEntity *pOther) } /* <5fb0b> ../cstrike/dlls/combat.cpp:789 */ -NOBODY void CGib::Spawn(const char *szGibModel) +void CGib::Spawn(const char *szGibModel) { -// MAKE_STRING_CLASS(const char *str, -// entvars_t *pev); // 800 -// Vector(Vector *const this, -// float X, -// float Y, -// float Z); // 803 -// Vector(Vector *const this, -// float X, -// float Y, -// float Z); // 803 + pev->movetype = MOVETYPE_BOUNCE; + + // deading the bounce a bit + pev->friction = 0.55; + + // sometimes an entity inherits the edict from a former piece of glass, + // and will spawn using the same render FX or rendermode! bad! + pev->renderamt = 255.0; + pev->rendermode = kRenderNormal; + pev->renderfx = kRenderFxNone; + + /// hopefully this will fix the VELOCITY TOO LOW crap + pev->solid = SOLID_SLIDEBOX; + + if (pev->classname) + RemoveEntityHashValue(pev, STRING(pev->classname), CLASSNAME); + + MAKE_STRING_CLASS("gib", pev); + AddEntityHashValue(pev, STRING(pev->classname), CLASSNAME); + + SET_MODEL(ENT(pev), szGibModel); + UTIL_SetSize(pev, Vector(0, 0, 0), Vector(0, 0, 0)); + + pev->nextthink = gpGlobals->time + 4.0f; + m_lifeTime = 25.0f; + + SetThink(&CGib::WaitTillLand); + SetTouch(&CGib::BounceGibTouch); + + m_material = matNone; + + // how many blood decals this gib can place (1 per bounce until none remain). + m_cBloodDecals = 5; } /* <60aea> ../cstrike/dlls/combat.cpp:815 */ diff --git a/regamedll/dlls/func_break.cpp b/regamedll/dlls/func_break.cpp index 1339df12..32fc73af 100644 --- a/regamedll/dlls/func_break.cpp +++ b/regamedll/dlls/func_break.cpp @@ -168,11 +168,53 @@ NOBODY void CBreakable::Restart_(void) } /* <864f1> ../cstrike/dlls/func_break.cpp:260 */ -NOBODY const char **CBreakable::MaterialSoundList(Materials precacheMaterial, int &soundCount) +const char **CBreakable::MaterialSoundList(Materials precacheMaterial, int &soundCount) { -// { -// const char ** pSoundList; // 262 -// } + const char **pSoundList = NULL; + + switch (precacheMaterial) + { + case matWood: + { + pSoundList = pSoundsWood; + soundCount = ARRAYSIZE(pSoundsWood); + const int dad = ARRAYSIZE(pSoundsConcrete); + break; + } + case matFlesh: + { + pSoundList = pSoundsFlesh; + soundCount = ARRAYSIZE(pSoundsFlesh); + break; + } + case matComputer: + case matUnbreakableGlass: + case matGlass: + { + pSoundList = pSoundsGlass; + soundCount = ARRAYSIZE(pSoundsGlass); + break; + } + case matMetal: + { + pSoundList = pSoundsMetal; + soundCount = ARRAYSIZE(pSoundsMetal); + break; + } + case matCinderBlock: + case matRocks: + { + pSoundList = pSoundsConcrete; + soundCount = ARRAYSIZE(pSoundsConcrete); + break; + } + case matCeilingTile: + case matNone: + default: + soundCount = 0; + break; + } + return pSoundList; } /* <86526> ../cstrike/dlls/func_break.cpp:303 */ @@ -188,19 +230,13 @@ NOBODY void CBreakable::MaterialSoundPrecache(Materials precacheMaterial) } /* <86598> ../cstrike/dlls/func_break.cpp:316 */ -NOBODY void CBreakable::MaterialSoundRandom(edict_t *pEdict, Materials soundMaterial, float volume) +void CBreakable::MaterialSoundRandom(edict_t *pEdict, Materials soundMaterial, float volume) { -// { -// const char ** pSoundList; // 318 -// int soundCount; // 319 -// MaterialSoundList(Materials precacheMaterial, -// int &soundCount); // 321 -// EMIT_SOUND(edict_t *entity, -// int channel, -// const char *sample, -// float volume, -// float attenuation); // 324 -// } + int soundCount = 0; + const char **pSoundList = MaterialSoundList(soundMaterial, soundCount); + + if (soundCount) + EMIT_SOUND(pEdict, CHAN_BODY, pSoundList[ RANDOM_LONG(0, soundCount - 1) ], volume, 1.0); } /* <8634b> ../cstrike/dlls/func_break.cpp:328 */ diff --git a/regamedll/dlls/func_break.h b/regamedll/dlls/func_break.h index 3b95cbe4..5ae09bf5 100644 --- a/regamedll/dlls/func_break.h +++ b/regamedll/dlls/func_break.h @@ -137,8 +137,8 @@ public: } NOBODY static void MaterialSoundPrecache(Materials precacheMaterial); - NOBODY static void MaterialSoundRandom(edict_t *pEdict, Materials soundMaterial, float volume); - NOBODY static const char **MaterialSoundList(Materials precacheMaterial, int &soundCount); + static void MaterialSoundRandom(edict_t *pEdict, Materials soundMaterial, float volume); + static const char **MaterialSoundList(Materials precacheMaterial, int &soundCount); static const char *pSoundsWood[3]; static const char *pSoundsFlesh[6]; diff --git a/regamedll/dlls/game.h b/regamedll/dlls/game.h index feaf664a..ed368ca9 100644 --- a/regamedll/dlls/game.h +++ b/regamedll/dlls/game.h @@ -35,6 +35,15 @@ #define LOG_ENEMYATTACK 1 #define LOG_TEAMMATEATTACK 2 +// playerid +#define PLAYERID_MODE_EVERYONE 0 +#define PLAYERID_MODE_TEAMONLY 1 +#define PLAYERID_MODE_OFF 2 + +#define PLAYERID_EVERYONE 0 +#define PLAYERID_TEAMONLY 1 +#define PLAYERID_OFF 2 + #ifdef HOOK_GAMEDLL #define g_psv_gravity (*pg_psv_gravity) diff --git a/regamedll/dlls/monsters.h b/regamedll/dlls/monsters.h index 5034f27c..d7940280 100644 --- a/regamedll/dlls/monsters.h +++ b/regamedll/dlls/monsters.h @@ -126,14 +126,14 @@ public: #endif // HOOK_GAMEDLL public: - NOBODY void Spawn(const char *szGibModel); - NOBODY void EXPORT BounceGibTouch(CBaseEntity *pOther); + void Spawn(const char *szGibModel); + void EXPORT BounceGibTouch(CBaseEntity *pOther); NOBODY void EXPORT StickyGibTouch(CBaseEntity *pOther); - NOBODY void EXPORT WaitTillLand(void); - NOBODY void LimitVelocity(void); + void EXPORT WaitTillLand(void); + void LimitVelocity(void); public: NOBODY static void SpawnHeadGib(entvars_t *pevVictim); - NOBODY static void SpawnRandomGibs(entvars_t *pevVictim, int cGibs, int human); + static void SpawnRandomGibs(entvars_t *pevVictim, int cGibs, int human); NOBODY static void SpawnStickyGibs(entvars_t *pevVictim, Vector vecOrigin, int cGibs); public: int m_bloodColor; @@ -158,5 +158,7 @@ public: return baseClass::ScheduleFromName(pName);\ return pSchedule;\ } +// refs +extern void (*pCGib__SpawnRandomGibs)(entvars_t *pevVictim, int cGibs, int human); #endif // MONSTERS_H diff --git a/regamedll/dlls/mpstubb.cpp b/regamedll/dlls/mpstubb.cpp index 25edde09..5e6d50c8 100644 --- a/regamedll/dlls/mpstubb.cpp +++ b/regamedll/dlls/mpstubb.cpp @@ -35,11 +35,13 @@ void CGraph::ShowNodeConnections(int iNode) /* ../cstrike/dlls/mpstubb.cpp:38 */ int CGraph::FindNearestNode(const Vector &vecOrigin, int afNodeTypes) { + return 0; } /* ../cstrike/dlls/mpstubb.cpp:38 */ int CGraph::FindNearestNode(const Vector &vecOrigin, CBaseEntity *pEntity) { + return 0; } /* ../cstrike/dlls/mpstubb.cpp:45 */ diff --git a/regamedll/dlls/nodes.h b/regamedll/dlls/nodes.h index c4488038..4b846245 100644 --- a/regamedll/dlls/nodes.h +++ b/regamedll/dlls/nodes.h @@ -32,6 +32,11 @@ #pragma once #endif +#define bits_NODE_LAND ( 1 << 0 ) // Land node, so nudge if necessary. +#define bits_NODE_AIR ( 1 << 1 ) // Air node, don't nudge. +#define bits_NODE_WATER ( 1 << 2 ) // Water node, don't nudge. +#define bits_NODE_GROUP_REALM (bits_NODE_LAND | bits_NODE_AIR | bits_NODE_WATER) + class CBaseEntity; class CLink @@ -49,7 +54,7 @@ public: NOBODY int CheckNODFile(char *szMapName); NOBODY int FLoadGraph(char *szMapName); NOBODY int FSetGraphPointers(void); - NOBODY void ShowNodeConnections(int iNode); + void ShowNodeConnections(int iNode); NOBODY int FindNearestNode(const Vector &vecOrigin, CBaseEntity *pEntity); NOBODY int FindNearestNode(const Vector &vecOrigin, int afNodeTypes); public: diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index f7c6099b..e38f7ede 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -213,9 +213,9 @@ int gmsgCurWeapon; //int gmsgDamage; //int gmsgBattery; //int gmsgTrain; -//int gmsgLogo; +int gmsgLogo; int gmsgWeaponList; -//int gmsgAmmoX; +int gmsgAmmoX; //int gmsgDeathMsg; int gmsgScoreAttrib; int gmsgScoreInfo; @@ -236,8 +236,8 @@ int gmsgRoundTime; int gmsgMoney; int gmsgBlinkAcct; int gmsgArmorType; -//int gmsgStatusValue; -//int gmsgStatusText; +int gmsgStatusValue; +int gmsgStatusText; int gmsgStatusIcon; int gmsgBarTime; int gmsgReloadSound; @@ -257,7 +257,7 @@ int gmsgTutorClose; //int gmsgAllowSpec; int gmsgBombDrop; //int gmsgBombPickup; -//int gmsgHostagePos; +int gmsgHostagePos; //int gmsgHostageK; int gmsgGeigerRange; int gmsgSendCorpse; @@ -265,7 +265,7 @@ int gmsgSendCorpse; //int gmsgSpecHealth; //int gmsgForceCam; //int gmsgADStop; -//int gmsgReceiveW; +int gmsgReceiveW; int gmsgScenarioIcon; int gmsgBotVoice; int gmsgBuyClose; @@ -577,7 +577,9 @@ NOXREF CBasePlayer *CBasePlayer::GetNextRadioRecipient(CBasePlayer *pStartPlayer } else if (pPlayer) { - if (pPlayer->pev->iuser1 != OBS_CHASE_LOCKED && pPlayer->pev->iuser1 != OBS_CHASE_FREE && pPlayer->pev->iuser1 != OBS_IN_EYE) + int iSpecMode = IsObserver(); + + if (iSpecMode != OBS_CHASE_LOCKED && iSpecMode != OBS_CHASE_FREE && iSpecMode != OBS_IN_EYE) continue; if (!FNullEnt(m_hObserverTarget)) @@ -624,7 +626,9 @@ void CBasePlayer::Radio(const char *msg_id, const char *msg_verbose, short pitch } else if (pPlayer) { - if (pPlayer->pev->iuser1 != OBS_CHASE_LOCKED && pPlayer->pev->iuser1 != OBS_CHASE_FREE && pPlayer->pev->iuser1 != OBS_IN_EYE) + int iSpecMode = IsObserver(); + + if (iSpecMode != OBS_CHASE_LOCKED && iSpecMode != OBS_CHASE_FREE && iSpecMode != OBS_IN_EYE) continue; if (!FNullEnt(m_hObserverTarget)) @@ -648,7 +652,6 @@ void CBasePlayer::Radio(const char *msg_id, const char *msg_verbose, short pitch if (msg_verbose) { // search the place name where is located the player - const char *placeName = NULL; Place playerPlace = TheNavAreaGrid.GetPlace( &pev->origin ); const BotPhraseList *placeList = TheBotPhrases->GetPlaceList(); @@ -756,20 +759,20 @@ Vector VecVelocityForDamage(float flDamage) /* <14edfb> ../cstrike/dlls/player.cpp:878 */ int TrainSpeed(int iSpeed, int iMax) -{ +{ + float fMax; + float fSpeed; int iRet = 0; - //float fMax = iMax; // unused? - float fSpeed = iSpeed; + + fMax = (float)iMax; + fSpeed = iSpeed / fMax; if (iSpeed < 0) iRet = TRAIN_BACK; - else if (iSpeed == 0) iRet = TRAIN_NEUTRAL; - else if (fSpeed < 0.33) iRet = TRAIN_SLOW; - else if (fSpeed < 0.66) iRet = TRAIN_MEDIUM; else @@ -1021,21 +1024,25 @@ void LogAttack(CBasePlayer *pAttacker, class CBasePlayer *pVictim, int teamAttac return; if ((teamAttack && (detail & LOG_TEAMMATEATTACK)) || (!teamAttack && (detail & LOG_ENEMYATTACK))) - UTIL_LogPrintf("\"%s<%i><%s><%s>\" attacked \"%s<%i><%s><%s>\" with \"%s\" (damage \"%d\") (damage_armor \"%d\") (health \"%d\") (armor \"%d\")\n", - STRING(pAttacker->pev->netname), - GETPLAYERUSERID(pAttacker->edict()), - GETPLAYERAUTHID(pAttacker->edict()), - GetTeam(pAttacker->m_iTeam), - STRING(pVictim->pev->netname), - GETPLAYERUSERID(pVictim->edict()), - GETPLAYERAUTHID(pVictim->edict()), - GetTeam(pVictim->m_iTeam), - killer_weapon_name, - healthHit, - armorHit, - newHealth, - newArmor - ); + { + UTIL_LogPrintf + ( + "\"%s<%i><%s><%s>\" attacked \"%s<%i><%s><%s>\" with \"%s\" (damage \"%d\") (damage_armor \"%d\") (health \"%d\") (armor \"%d\")\n", + STRING(pAttacker->pev->netname), + GETPLAYERUSERID(pAttacker->edict()), + GETPLAYERAUTHID(pAttacker->edict()), + GetTeam(pAttacker->m_iTeam), + STRING(pVictim->pev->netname), + GETPLAYERUSERID(pVictim->edict()), + GETPLAYERAUTHID(pVictim->edict()), + GetTeam(pVictim->m_iTeam), + killer_weapon_name, + healthHit, + armorHit, + newHealth, + newArmor + ); + } } /* <15dff9> ../cstrike/dlls/player.cpp:1241 */ @@ -1422,143 +1429,6 @@ void CBasePlayer::SetBombIcon(BOOL bFlash) SetScoreboardAttributes(); } -void (*CBasePlayer__UpdateClientData)(void); - -//TODO: lost? dwarf conflicted by name -/* <0> (null):0 */ -NOBODY void __declspec(naked) CBasePlayer::UpdateClientData_(void) -{ - __asm - { - jmp CBasePlayer__UpdateClientData - } -// { -// int i; -// MESSAGE_BEGIN(int msg_dest, -// int msg_type, -// const float * pOrigin, -// entvars_t * ent); -// Update(class CUnifiedSignals *const this); -// MESSAGE_BEGIN(int msg_dest, -// int msg_type, -// const float * pOrigin, -// entvars_t * ent); -// { -// class CBaseEntity * pEntity; -// { -// class CClientFog * pFog; -// int r; -// int g; -// int b; -// union density; -// MESSAGE_BEGIN(int msg_dest, -// int msg_type, -// const float * pOrigin, -// entvars_t * ent); -// } -// } -// MESSAGE_BEGIN(int msg_dest, -// int msg_type, -// const float * pOrigin, -// entvars_t * ent); -// MESSAGE_BEGIN(int msg_dest, -// int msg_type, -// const float * pOrigin, -// entvars_t * ent); -// MESSAGE_BEGIN(int msg_dest, -// int msg_type, -// const float * pOrigin, -// entvars_t * ent); -// MESSAGE_BEGIN(int msg_dest, -// int msg_type, -// const float * pOrigin, -// entvars_t * ent); -// MESSAGE_BEGIN(int msg_dest, -// int msg_type, -// const float * pOrigin, -// entvars_t * ent); -// MESSAGE_BEGIN(int msg_dest, -// int msg_type, -// const float * pOrigin, -// edict_t * ed); -// MESSAGE_BEGIN(int msg_dest, -// int msg_type, -// const float * pOrigin, -// entvars_t * ent); -// edict(class CBaseEntity *const this); -// ENTINDEX(edict_t * pEdict); -// { -// int iHealth; -// MESSAGE_BEGIN(int msg_dest, -// int msg_type, -// const float * pOrigin, -// entvars_t * ent); -// } -// MESSAGE_BEGIN(int msg_dest, -// int msg_type, -// const float * pOrigin, -// entvars_t * ent); -// { -// class Vector damageOrigin; -// edict_t * other; -// int visibleDamageBits; -// Vector(class Vector *const this, -// const class Vector &const v); -// { -// class CBaseEntity * pEntity; -// Instance(edict_t * pent); -// } -// MESSAGE_BEGIN(int msg_dest, -// int msg_type, -// const float * pOrigin, -// entvars_t * ent); -// } -// SendAmmoUpdate(class CBasePlayer *const this); -// { -// int weapon_id; -// } -// { -// class CBasePlayerWeapon * w; -// iFlags(class CBasePlayerItem *const this); -// AmmoInventory(class CBasePlayer *const this, -// int iAmmoIndex); -// HintMessage(class CBasePlayer *const this, -// const char * pMessage, -// BOOL bDisplayIfPlayerDead, -// BOOL bOverride); -// } -// operator-(const class Vector *const this, -// const class Vector &const v); -// Length(const class Vector *const this); -// { -// class CBaseEntity * pPlayer; -// entindex(class CBaseEntity *const this); -// { -// class CBasePlayer * player; -// MESSAGE_BEGIN(int msg_dest, -// int msg_type, -// const float * pOrigin, -// entvars_t * ent); -// entindex(class CBaseEntity *const this); -// } -// } -// FlashlightIsOn(class CBasePlayer *const this); -// MESSAGE_BEGIN(int msg_dest, -// int msg_type, -// const float * pOrigin, -// entvars_t * ent); -// MESSAGE_BEGIN(int msg_dest, -// int msg_type, -// const float * pOrigin, -// entvars_t * ent); -// MESSAGE_BEGIN(int msg_dest, -// int msg_type, -// const float * pOrigin, -// entvars_t * ent); -// FlashlightTurnOff(class CBasePlayer *const this); -// } -} - /* <15f2ab> ../cstrike/dlls/player.cpp:1985 */ void CBasePlayer::SetProgressBarTime(int time) { @@ -1587,7 +1457,7 @@ void CBasePlayer::SetProgressBarTime(int time) CBasePlayer *player = GetClassPtr((CBasePlayer *)pPlayer->pev); - if (player->pev->iuser1 == OBS_IN_EYE && player->pev->iuser2 == myIndex) + if (player->IsObserver() == OBS_IN_EYE && player->pev->iuser2 == myIndex) { MESSAGE_BEGIN(MSG_ONE, gmsgBarTime, NULL, player->pev); WRITE_SHORT(time); @@ -1628,7 +1498,7 @@ void CBasePlayer::SetProgressBarTime2(int time, float timeElapsed) CBasePlayer *player = GetClassPtr((CBasePlayer *)pPlayer->pev); - if (player->pev->iuser1 == OBS_IN_EYE && player->pev->iuser2 == myIndex) + if (player->IsObserver() == OBS_IN_EYE && player->pev->iuser2 == myIndex) { MESSAGE_BEGIN(MSG_ONE, gmsgBarTime, NULL, player->pev); WRITE_SHORT(time); @@ -1641,41 +1511,96 @@ void CBasePlayer::SetProgressBarTime2(int time, float timeElapsed) /* <14e0e9> ../cstrike/dlls/player.cpp:2073 */ void BuyZoneIcon_Set(CBasePlayer *player) { - player->m_signals.Signal(SIGNAL_BUY); + MESSAGE_BEGIN(MSG_ONE, gmsgStatusIcon, NULL, player->pev); + WRITE_BYTE(STATUSICON_SHOW); + WRITE_STRING("buyzone"); + WRITE_BYTE(0); + WRITE_BYTE(160); + WRITE_BYTE(0); + MESSAGE_END(); } /* <14e106> ../cstrike/dlls/player.cpp:2086 */ -NOBODY void BuyZoneIcon_Clear(CBasePlayer *player) +void BuyZoneIcon_Clear(CBasePlayer *player) { - player->m_signals.Signal(player->m_signals.GetState() & ~SIGNAL_BUY); - - //int signalSave = m_signals.GetSignal(); - //int signalChanged = m_signals.GetState() ^ m_signals.GetSignal(); - //m_signals.Update(); + MESSAGE_BEGIN(MSG_ONE, gmsgStatusIcon, NULL, player->pev); + WRITE_BYTE(STATUSICON_HIDE); + WRITE_STRING("buyzone"); + MESSAGE_END(); + + if (player->m_iMenu >= Menu_Buy) + { + if (player->m_iMenu <= Menu_BuyItem) + { + CLIENT_COMMAND(ENT(player->pev), "slot10\n"); + } + else if (player->m_iMenu == Menu_ClientBuy) + { + MESSAGE_BEGIN(MSG_ONE, gmsgBuyClose, NULL, player->pev); + MESSAGE_END(); + } + } } /* <14e62c> ../cstrike/dlls/player.cpp:2115 */ -NOBODY void BombTargetFlash_Set(CBasePlayer *player) +void BombTargetFlash_Set(CBasePlayer *player) { + if (player->m_bHasC4 && !(player->m_flDisplayHistory & DHF_IN_TARGET_ZONE)) + { + player->m_flDisplayHistory |= DHF_IN_TARGET_ZONE; + player->HintMessage("#Hint_you_are_in_targetzone"); + } + player->SetBombIcon(TRUE); } /* <14e649> ../cstrike/dlls/player.cpp:2129 */ -NOBODY void BombTargetFlash_Clear(CBasePlayer *player) +void BombTargetFlash_Clear(CBasePlayer *player) { + player->SetBombIcon(FALSE); } /* <158292> ../cstrike/dlls/player.cpp:2136 */ -NOBODY void RescueZoneIcon_Set(CBasePlayer *player) +void RescueZoneIcon_Set(CBasePlayer *player) { + MESSAGE_BEGIN(MSG_ONE, gmsgStatusIcon, NULL, player->pev); + WRITE_BYTE(STATUSICON_SHOW); + WRITE_STRING("rescue"); + WRITE_BYTE(0); + WRITE_BYTE(160); + WRITE_BYTE(0); + MESSAGE_END(); + + if (player->m_iTeam == CT && !(player->m_flDisplayHistory & DHF_IN_RESCUE_ZONE)) + { + player->m_flDisplayHistory |= DHF_IN_RESCUE_ZONE; + player->HintMessage("#Hint_hostage_rescue_zone"); + } } /* <14e666> ../cstrike/dlls/player.cpp:2156 */ -NOBODY void RescueZoneIcon_Clear(CBasePlayer *player) +void RescueZoneIcon_Clear(CBasePlayer *player) { + MESSAGE_BEGIN(MSG_ONE, gmsgStatusIcon, NULL, player->pev); + WRITE_BYTE(STATUSICON_HIDE); + WRITE_STRING("rescue"); + MESSAGE_END(); + + if (player->m_iMenu >= Menu_Buy) + { + if (player->m_iMenu <= Menu_BuyItem) + { + CLIENT_COMMAND(ENT(player->pev), "slot10\n"); + } + else if (player->m_iMenu == Menu_ClientBuy) + { + MESSAGE_BEGIN(MSG_ONE, gmsgBuyClose, NULL, player->pev); + MESSAGE_END(); + } + } } /* <1582af> ../cstrike/dlls/player.cpp:2185 */ -NOXREF void EscapeZoneIcon_Set(CBasePlayer *player) +void EscapeZoneIcon_Set(CBasePlayer *player) { MESSAGE_BEGIN(MSG_ONE, gmsgStatusIcon, NULL, player->pev); WRITE_BYTE(STATUSICON_SHOW); @@ -1696,7 +1621,7 @@ NOXREF void EscapeZoneIcon_Set(CBasePlayer *player) } /* <14e683> ../cstrike/dlls/player.cpp:2203 */ -NOXREF void EscapeZoneIcon_Clear(CBasePlayer *player) +void EscapeZoneIcon_Clear(CBasePlayer *player) { MESSAGE_BEGIN(MSG_ONE, gmsgStatusIcon, NULL, player->pev); WRITE_BYTE(STATUSICON_HIDE); @@ -1718,7 +1643,7 @@ NOXREF void EscapeZoneIcon_Clear(CBasePlayer *player) } /* <1582cc> ../cstrike/dlls/player.cpp:2231 */ -NOXREF void VIP_SafetyZoneIcon_Set(CBasePlayer *player) +void VIP_SafetyZoneIcon_Set(CBasePlayer *player) { MESSAGE_BEGIN(MSG_ONE, gmsgStatusIcon, NULL, player->pev); WRITE_BYTE(STATUSICON_SHOW); @@ -3046,12 +2971,12 @@ NOBODY void CBasePlayer::StartObserver(Vector vecPosition, Vector vecViewAngle) if (iFirstTime && mp && mp->IsCareer() && !IsBot()) { - Observer_SetMode(OBS_CHASE_LOCKED);// + Observer_SetMode(OBS_CHASE_LOCKED); CLIENT_COMMAND(edict(), "spec_autodirector_internal 1\n"); iFirstTime = 0; } else - Observer_SetMode(m_iObserverLastMode);// + Observer_SetMode(m_iObserverLastMode); ResetMaxSpeed(); @@ -3062,109 +2987,197 @@ NOBODY void CBasePlayer::StartObserver(Vector vecPosition, Vector vecViewAngle) MESSAGE_END(); } -/* <1526e0> ../cstrike/dlls/player.cpp:4272 */ -NOBODY bool CanSeeUseable(void) +/* <14d785> ../cstrike/dlls/player.cpp:4272 */ +bool CanSeeUseable(CBasePlayer *me, CBaseEntity *entity) { -// { -// Vector eye; // 4274 -// FClassnameIs(entvars_t *pev, -// const char *szClassname); // 4276 -// { -// TraceResult result; // 4279 -// Vector head; // 4280 -// Vector chest; // 4281 -// Vector knees; // 4282 -// operator+(const Vector *const this, -// const Vector &v); // 4280 -// operator+(const Vector *const this, -// const Vector &v); // 4281 -// operator+(const Vector *const this, -// const Vector &v); // 4282 -// } -// operator+(const Vector *const this, -// const Vector &v); // 4274 -// } + TraceResult result; + Vector eye = me->pev->origin + me->pev->view_ofs; + + if (FClassnameIs(entity->pev, "hostage_entity")) + { + Vector chest = entity->pev->origin + Vector(0, 0, 36); + Vector head = entity->pev->origin + Vector(0, 0, 72 * 0.9); + Vector knees = entity->pev->origin + Vector(0, 0, 18); + + UTIL_TraceLine(eye, chest, ignore_monsters, ignore_glass, me->edict(), &result); + if (result.flFraction < 1.0f) + { + UTIL_TraceLine(eye, head, ignore_monsters, ignore_glass, entity->edict(), &result); + if (result.flFraction < 1.0f) + { + UTIL_TraceLine(eye, knees, ignore_monsters, ignore_glass, entity->edict(), &result); + if (result.flFraction < 1.0f) + { + return false; + } + } + } + } + + return true; } /* <155815> ../cstrike/dlls/player.cpp:4307 */ -NOBODY void CBasePlayer::PlayerUse(void) +void CBasePlayer::PlayerUse(void) { -// { -// bool useNewHostages; // 4309 -// class CBaseEntity *pObject; // 4359 -// class CBaseEntity *pClosest; // 4360 -// Vector vecLOS; // 4361 -// float flMaxDot; // 4362 -// float flDot; // 4363 -// empty(const class list > *const this); // 4309 -// { -// class CBaseEntity *pTrain; // 4339 -// Instance(edict_t *pent); // 4339 -// TrainSpeed(int iSpeed, -// int iMax); // 4344 -// EMIT_SOUND(edict_t *entity, -// int channel, -// const char *sample, -// float volume, -// float attenuation); // 4348 -// EMIT_SOUND(edict_t *entity, -// int channel, -// const char *sample, -// float volume, -// float attenuation); // 4352 -// } -// { -// class CBaseEntity *pTrain; // 4332 -// Instance(edict_t *pent); // 4332 -// } -// { -// float const useHostageRange; // 4373 -// TraceResult result; // 4378 -// operator+(const Vector *const this, -// const Vector &v); // 4381 -// operator*(float fl, -// const Vector &v); // 4381 -// operator+(const Vector *const this, -// const Vector &v); // 4381 -// operator+(const Vector *const this, -// const Vector &v); // 4381 -// { -// class CBaseEntity *hit; // 4385 -// Instance(edict_t *pent); // 4385 -// FClassnameIs(entvars_t *pev, -// const char *szClassname); // 4387 -// } -// FClassnameIs(entvars_t *pev, -// const char *szClassname); // 4403 -// operator+(const Vector *const this, -// const Vector &v); // 4405 -// operator-(const Vector *const this, -// const Vector &v); // 4405 -// NormalizeInPlace(Vector *const this); // 4406 -// DotProduct(Vector &a, -// const Vector &b); // 4408 -// } -// operator+(const Vector *const this, -// const Vector &v); // 4433 -// operator-(const Vector *const this, -// const Vector &v); // 4433 -// NormalizeInPlace(Vector *const this); // 4434 -// DotProduct(Vector &a, -// const Vector &b); // 4436 -// { -// int caps; // 4455 -// EMIT_SOUND(edict_t *entity, -// int channel, -// const char *sample, -// float volume, -// float attenuation); // 4458 -// } -// EMIT_SOUND(edict_t *entity, -// int channel, -// const char *sample, -// float volume, -// float attenuation); // 4480 -// } + // Was use pressed or released? + if (!((pev->button | m_afButtonPressed | m_afButtonReleased) & IN_USE)) + return; + + // Hit Use on a train? + if (m_afButtonPressed & IN_USE) + { + if (m_pTank != NULL) + { + // Stop controlling the tank + // TODO: Send HUD Update + m_pTank->Use(this, this, USE_OFF, 0); + m_pTank = NULL; + return; + } + + if (m_afPhysicsFlags & PFLAG_ONTRAIN) + { + m_iTrain = (TRAIN_NEW | TRAIN_OFF); + m_afPhysicsFlags &= ~PFLAG_ONTRAIN; + + CBaseEntity *pTrain = Instance(pev->groundentity); + if (pTrain && pTrain->Classify() == CLASS_VEHICLE) + { + ((CFuncVehicle *)pTrain)->m_pDriver = NULL; + } + return; + } + else + { + // Start controlling the train! + CBaseEntity *pTrain = Instance(pev->groundentity); + + if (pTrain && !(pev->button & IN_JUMP) && (pev->flags & FL_ONGROUND) && (pTrain->ObjectCaps() & FCAP_DIRECTIONAL_USE) && pTrain->OnControls(pev)) + { + m_afPhysicsFlags |= PFLAG_ONTRAIN; + + m_iTrain = TrainSpeed(pTrain->pev->speed, pTrain->pev->impulse); + m_iTrain |= (TRAIN_NEW | TRAIN_OFF); + + if (pTrain->Classify() == CLASS_VEHICLE) + { + EMIT_SOUND(ENT(pev), CHAN_ITEM, "plats/vehicle_ignition.wav", 0.8, ATTN_NORM); + ((CFuncVehicle *)pTrain)->m_pDriver = this; + } + else + EMIT_SOUND(ENT(pev), CHAN_ITEM, "plats/train_use1.wav", 0.8, ATTN_NORM); + + return; + } + } + } + + bool useNewHostages = !TheNavAreaList.empty(); + CBaseEntity *pObject = NULL; + CBaseEntity *pClosest = NULL; + Vector vecLOS; + float flMaxDot = VIEW_FIELD_NARROW; + float flDot; + + // so we know which way we are facing + UTIL_MakeVectors(pev->v_angle); + + if (useNewHostages) + { + TraceResult result; + const float useHostageRange = 1000.0f; + + Vector vecStart = pev->origin + pev->view_ofs; + Vector vecEnd = vecStart + gpGlobals->v_forward * useHostageRange; + + UTIL_TraceLine(vecStart, vecEnd, dont_ignore_monsters, edict(), &result); + + if (result.flFraction < 1.0f) + { + CBaseEntity *hit = Instance(result.pHit); + if (hit != NULL && FClassnameIs(hit->pev, "hostage_entity") && CanSeeUseable(this, hit)) + pClosest = hit; + } + + if (!pClosest) + { + while ((pObject = UTIL_FindEntityInSphere(pObject, pev->origin, useHostageRange)) != NULL) + { + if (!FClassnameIs(pObject->pev, "hostage_entity")) + continue; + + vecLOS = VecBModelOrigin(pObject->pev) - vecStart; + vecLOS.NormalizeInPlace(); + + flDot = DotProduct(vecLOS, gpGlobals->v_forward); + + if (flDot > flMaxDot && CanSeeUseable(this, pObject)) + { + pClosest = pObject; + flMaxDot = flDot; + } + } + } + } + + if (!pClosest) + { + while ((pObject = UTIL_FindEntityInSphere(pObject, pev->origin, PLAYER_SEARCH_RADIUS)) != NULL) + { + if (pObject->ObjectCaps() & (FCAP_IMPULSE_USE | FCAP_CONTINUOUS_USE | FCAP_ONOFF_USE)) + { + // !!!PERFORMANCE- should this check be done on a per case basis AFTER we've determined that + // this object is actually usable? This dot is being done for every object within PLAYER_SEARCH_RADIUS + // when player hits the use key. How many objects can be in that area, anyway? (sjb) + vecLOS = (VecBModelOrigin(pObject->pev) - (pev->origin + pev->view_ofs)); + vecLOS.NormalizeInPlace(); + + flDot = DotProduct(vecLOS, gpGlobals->v_forward); + + // only if the item is in front of the user + if (flDot > flMaxDot) + { + flMaxDot = flDot; + pClosest = pObject; + } + } + } + } + + pObject = pClosest; + + // Found an object + if (pObject != NULL) + { + if (!useNewHostages || CanSeeUseable(this, pObject)) + { + int caps = pObject->ObjectCaps(); + + if (m_afButtonPressed & IN_USE) + EMIT_SOUND(ENT(pev), CHAN_ITEM, "common/wpn_select.wav", 0.4, ATTN_NORM); + + if (((pev->button & IN_USE) && (caps & FCAP_CONTINUOUS_USE)) + || ((m_afButtonPressed & IN_USE) && (caps & (FCAP_IMPULSE_USE | FCAP_ONOFF_USE)))) + { + if (caps & FCAP_CONTINUOUS_USE) + m_afPhysicsFlags |= PFLAG_USING; + + pObject->Use(this, this, USE_SET, 1); + } + // UNDONE: Send different USE codes for ON/OFF. Cache last ONOFF_USE object to send 'off' if you turn away + // BUGBUG This is an "off" use + else if ((m_afButtonReleased & IN_USE) && (pObject->ObjectCaps() & FCAP_ONOFF_USE)) + { + pObject->Use(this, this, USE_SET, 0); + } + } + } + else + { + if (m_afButtonPressed & IN_USE) + EMIT_SOUND(ENT(pev), CHAN_ITEM, "common/wpn_denyselect.wav", 0.4, ATTN_NORM); + } } /* <155f41> ../cstrike/dlls/player.cpp:4486 */ @@ -3738,6 +3751,8 @@ void CBasePlayer::SelectLastItem(void) ResetMaxSpeed(); } +// HasWeapons - do I have any weapons at all? + /* <15733a> ../cstrike/dlls/player.cpp:6967 */ NOXREF BOOL CBasePlayer::HasWeapons(void) { @@ -3750,62 +3765,96 @@ NOXREF BOOL CBasePlayer::HasWeapons(void) } /* <157372> ../cstrike/dlls/player.cpp:6982 */ -NOBODY void CBasePlayer::SelectPrevItem(int iItem) +NOXREF void CBasePlayer::SelectPrevItem(int iItem) { + } /* <15106c> ../cstrike/dlls/player.cpp:6987 */ -NOBODY const char *CBasePlayer::TeamID_(void) +const char *CBasePlayer::TeamID_(void) { + // Not fully connected yet + if (pev == NULL) + return ""; + + // return their team name + return m_szTeamName; } /* <1573aa> ../cstrike/dlls/player.cpp:7010 */ -NOBODY void CSprayCan::Spawn(entvars_t *pevOwner) +void CSprayCan::Spawn(entvars_t *pevOwner) { -// operator+(const Vector *const this, -// const Vector &v); // 7012 -// EMIT_SOUND(edict_t *entity, -// int channel, -// const char *sample, -// float volume, -// float attenuation); // 7018 + pev->origin = pevOwner->origin + Vector(0, 0, 32); + pev->angles = pevOwner->v_angle; + pev->owner = ENT(pevOwner); + pev->frame = 0; + + pev->nextthink = gpGlobals->time + 0.1; + EMIT_SOUND(ENT(pev), CHAN_VOICE, "player/sprayer.wav", VOL_NORM, ATTN_NORM); } /* <151815> ../cstrike/dlls/player.cpp:7021 */ NOBODY void CSprayCan::Think_(void) { -// { -// TraceResult tr; // 7023 -// int playernum; // 7024 -// int nFrames; // 7025 -// class CBasePlayer *pPlayer; // 7026 -// GET_PRIVATE(edict_t *pent); // 7028 -// GetCustomDecalFrames(CBasePlayer *const this); // 7031 -// ENTINDEX(edict_t *pEdict); // 7035 -// operator*(const Vector *const this, -// float fl); // 7038 -// operator+(const Vector *const this, -// const Vector &v); // 7038 -// } + TraceResult tr; + int playernum; + int nFrames; + CBasePlayer *pPlayer; + + pPlayer = (CBasePlayer *)GET_PRIVATE(pev->owner); + + if (pPlayer) + nFrames = pPlayer->GetCustomDecalFrames(); + else + nFrames = -1; + + playernum = ENTINDEX(pev->owner); + + UTIL_MakeVectors(pev->angles); + UTIL_TraceLine(pev->origin, pev->origin + gpGlobals->v_forward * 128, ignore_monsters, pev->owner, &tr); + + // No customization present. + if (nFrames == -1) + { + UTIL_DecalTrace(&tr, DECAL_LAMBDA6); + UTIL_Remove(this); + } + else + { + UTIL_PlayerDecalTrace(&tr, playernum, pev->frame, TRUE); + + // Just painted last custom frame. + if (pev->frame++ >= (nFrames - 1)) + UTIL_Remove(this); + } + + pev->nextthink = gpGlobals->time + 0.1; } /* <157481> ../cstrike/dlls/player.cpp:7064 */ -NOBODY void CBloodSplat::Spawn(entvars_t *pevOwner) +NOXREF void CBloodSplat::Spawn(entvars_t *pevOwner) { -// operator+(const Vector *const this, -// const Vector &v); // 7066 + pev->origin = pevOwner->origin + Vector(0, 0, 32); + pev->angles = pevOwner->v_angle; + pev->owner = ENT(pevOwner); + + SetThink(&CBloodSplat::Spray); + pev->nextthink = gpGlobals->time + 0.1; } /* <151758> ../cstrike/dlls/player.cpp:7074 */ -NOBODY void CBloodSplat::Spray(void) +NOXREF void CBloodSplat::Spray(void) { -// { -// TraceResult tr; // 7076 -// operator*(const Vector *const this, -// float fl); // 7081 -// operator+(const Vector *const this, -// const Vector &v); // 7081 -// } + TraceResult tr; + if (g_Language != LANGUAGE_GERMAN) + { + UTIL_MakeVectors(pev->angles); + UTIL_TraceLine(pev->origin, pev->origin + gpGlobals->v_forward * 128, ignore_monsters, pev->owner, &tr); + UTIL_BloodDecalTrace(&tr, BLOOD_COLOR_RED); + } + + SetThink(&CBloodSplat::SUB_Remove); + pev->nextthink = gpGlobals->time + 0.1; } /* <1574d3> ../cstrike/dlls/player.cpp:7093 */ @@ -3828,29 +3877,23 @@ void CBasePlayer::GiveNamedItem(const char *pszName) } /* <157568> ../cstrike/dlls/player.cpp:7114 */ -CBaseEntity *FindEntityForward(CBaseEntity *pMe) +NOXREF CBaseEntity *FindEntityForward(CBaseEntity *pMe) { -// { -// TraceResult tr; // 7116 -// edict(CBaseEntity *const this); // 7119 -// operator+(const Vector *const this, -// const Vector &v); // 7119 -// operator*(const Vector *const this, -// float fl); // 7119 -// operator+(const Vector *const this, -// const Vector &v); // 7119 -// operator+(const Vector *const this, -// const Vector &v); // 7119 -// FNullEnt(const edict_t *pent); // 7120 -// { -// class CBaseEntity *pHit; // 7122 -// Instance(edict_t *pent); // 7122 -// } -// } + TraceResult tr; + + UTIL_MakeVectors(pMe->pev->v_angle); + UTIL_TraceLine(pMe->pev->origin + pMe->pev->view_ofs, pMe->pev->origin + pMe->pev->view_ofs + gpGlobals->v_forward * 8192, dont_ignore_monsters, pMe->edict(), &tr); + + if (tr.flFraction != 1.0 && !FNullEnt(tr.pHit)) + { + CBaseEntity *pHit = CBaseEntity::Instance(tr.pHit); + return pHit; + } + return NULL; } /* <15777b> ../cstrike/dlls/player.cpp:7129 */ -NOXREF BOOL CBasePlayer::FlashlightIsOn(void) +BOOL CBasePlayer::FlashlightIsOn(void) { return pev->effects & EF_DIMLIGHT; } @@ -3861,8 +3904,6 @@ void CBasePlayer::FlashlightTurnOn(void) if (!g_pGameRules->FAllowFlashlight()) return; - //TODO: check it - //if (pev->weapons < 0) if (pev->weapons & (1 << WEAPON_SUIT)) { EMIT_SOUND(ENT(pev), CHAN_ITEM, "items/flashlight1.wav", VOL_NORM, ATTN_NORM); @@ -3879,177 +3920,390 @@ void CBasePlayer::FlashlightTurnOn(void) } /* <157816> ../cstrike/dlls/player.cpp:7157 */ -NOBODY void CBasePlayer::FlashlightTurnOff(void) +void CBasePlayer::FlashlightTurnOff(void) { -// MESSAGE_BEGIN(int msg_dest, -// int msg_type, -// const float *pOrigin, -// entvars_t *ent); // 7161 + EMIT_SOUND(ENT(pev), CHAN_ITEM, "items/flashlight1.wav", VOL_NORM, ATTN_NORM); + + pev->effects &= ~EF_DIMLIGHT; + MESSAGE_BEGIN(MSG_ONE, gmsgFlashlight, NULL, pev); + WRITE_BYTE(0); + WRITE_BYTE(m_iFlashBattery); + MESSAGE_END(); + + m_flFlashLightTime = gpGlobals->time + 0.2; } /* <158ae7> ../cstrike/dlls/player.cpp:7179 */ NOBODY void CBasePlayer::ForceClientDllUpdate(void) { + m_fInitHUD = TRUE; + m_iClientHealth = -1; + m_iClientBattery = -1; + m_iTrain |= TRAIN_NEW; + m_fWeapon = FALSE; + + UpdateClientData(); + HandleSignals();// TODO: Reverse me! } /* <157f8d> ../cstrike/dlls/player.cpp:7202 */ NOBODY void CBasePlayer::ImpulseCommands_(void) -{ -// { -// TraceResult tr; // 7204 -// int iImpulse; // 7209 -// { -// int iOn; // 7215 -// MESSAGE_BEGIN(int msg_dest, -// int msg_type, -// const float *pOrigin, -// entvars_t *ent); // 7229 -// } -// operator+(const Vector *const this, -// const Vector &v); // 7258 -// operator*(const Vector *const this, -// float fl); // 7258 -// operator+(const Vector *const this, -// const Vector &v); // 7258 -// operator+(const Vector *const this, -// const Vector &v); // 7258 -// { -// class CSprayCan *pCan; // 7263 -// GetClassPtr(CSprayCan *a); // 7263 -// } -// FlashlightTurnOff(CBasePlayer *const this); // 7241 -// } +{ + TraceResult tr; + + // Handle use events + PlayerUse(); + + int iImpulse = pev->impulse; + + switch (iImpulse) + { + case 99: + { + int iOn; + + if (!gmsgLogo) + { + iOn = 1; + gmsgLogo = REG_USER_MSG("Logo", 1); + } + else + iOn = 0; + + assert(gmsgLogo > 0); + + MESSAGE_BEGIN(MSG_ONE, gmsgLogo, NULL, pev); + WRITE_BYTE(iOn); + MESSAGE_END(); + + if (!iOn) + gmsgLogo = 0; + + break; + } + case 100: + { + // temporary flashlight for level designers + if (FlashlightIsOn()) + FlashlightTurnOff(); + else + FlashlightTurnOn(); + + break; + } + case 201: + { + // paint decal + if (gpGlobals->time < m_flNextDecalTime) + { + // too early! + break; + } + + UTIL_MakeVectors(pev->v_angle); + UTIL_TraceLine(pev->origin + pev->view_ofs, pev->origin + pev->view_ofs + gpGlobals->v_forward * 128, ignore_monsters, edict(), &tr); + + if (tr.flFraction != 1.0f) + { + // line hit something, so paint a decal + m_flNextDecalTime = gpGlobals->time + CVAR_GET_FLOAT("decalfrequency"); + CSprayCan *pCan = GetClassPtr((CSprayCan *)NULL); + pCan->Spawn(pev); + } + break; + } + default: + // check all of the cheat impulse commands now + CheatImpulseCommands(iImpulse); + } + + pev->impulse = 0; } /* <15786e> ../cstrike/dlls/player.cpp:7280 */ -NOBODY void CBasePlayer::CheatImpulseCommands(int iImpulse) -{ -// { -// class CBaseEntity *pEntity; // 7288 -// TraceResult tr; // 7289 -// { -// TraceResult tr; // 7438 -// Vector dir; // 7439 -// Vector(Vector *const this, -// float X, -// float Y, -// float Z); // 7436 -// { -// int r; // 7440 -// { -// float bloodRange; // 7442 -// { -// int i; // 7444 -// NormalizeInPlace(Vector *const this); // 7456 -// operator+(const Vector *const this, -// const Vector &v); // 7459 -// operator*(const Vector *const this, -// float fl); // 7459 -// operator+(const Vector *const this, -// const Vector &v); // 7459 -// operator+(const Vector *const this, -// const Vector &v); // 7459 -// } -// } -// } -// AddAccount(CBasePlayer *const this, -// int amount, -// bool bTrackChange); // 7314 -// { -// TraceResult tr; // 7381 -// edict_t *pWorld; // 7383 -// Vector start; // 7385 -// Vector end; // 7386 -// const char *pTextureName; // 7390 -// operator+(const Vector *const this, -// const Vector &v); // 7385 -// operator*(const Vector *const this, -// float fl); // 7386 -// operator+(const Vector *const this, -// const Vector &v); // 7386 -// } -// { -// class CBaseMonster *pMonster; // 7331 -// } -// operator+(const Vector *const this, -// const Vector &v); // 7418 -// operator*(const Vector *const this, -// float fl); // 7418 -// operator+(const Vector *const this, -// const Vector &v); // 7418 -// operator+(const Vector *const this, -// const Vector &v); // 7418 -// { -// class CBloodSplat *pBlood; // 7422 -// GetClassPtr(CBloodSplat *a); // 7422 -// Spawn(CBloodSplat *const this, -// entvars_t *pevOwner); // 7423 -// } -// Vector(Vector *const this, -// float X, -// float Y, -// float Z); // 7302 -// operator*(const Vector *const this, -// float fl); // 7303 -// operator+(const Vector *const this, -// const Vector &v); // 7303 -// } -// } +void CBasePlayer::CheatImpulseCommands(int iImpulse) +{ + if (!g_flWeaponCheat) + return; + + CBaseEntity *pEntity; + TraceResult tr; + + switch (iImpulse) + { + case 76: + if (!giPrecacheGrunt) + { + giPrecacheGrunt = 1; + ALERT(at_console, "You must now restart to use Grunt-o-matic.\n"); + } + else + { + UTIL_MakeVectors(Vector(0, pev->v_angle.y, 0)); + Create("monster_human_grunt", pev->origin + gpGlobals->v_forward * 128, pev->angles); + } + break; + case 101: + gEvilImpulse101 = TRUE; + AddAccount(16000); + ALERT(at_console, "Crediting %s with $16000\n", STRING(pev->netname)); + break; + case 102: + //TODO: Fix me! + CGib::SpawnRandomGibs(pev, 1, 1); + break; + case 103: + { + // What the hell are you doing? + pEntity = FindEntityForward(this); + + if (pEntity) + { + CBaseMonster *pMonster = pEntity->MyMonsterPointer(); + + if (pMonster) + pMonster->ReportAIState(); + } + break; + } + case 104: + // Dump all of the global state varaibles (and global entity names) + gGlobalState.DumpGlobals(); + break; + case 105: + { + // player makes no sound for monsters to hear. + if (m_fNoPlayerSound) + { + ALERT(at_console, "Player is audible\n"); + m_fNoPlayerSound = FALSE; + } + else + { + ALERT(at_console, "Player is silent\n"); + m_fNoPlayerSound = TRUE; + } + break; + } + case 106: + { + // Give me the classname and targetname of this entity. + pEntity = FindEntityForward(this); + + if (pEntity) + { + ALERT(at_console, "Classname: %s", STRING(pEntity->pev->classname)); + + if (!FStringNull(pEntity->pev->targetname)) + ALERT(at_console, " - Targetname: %s\n", STRING(pEntity->pev->targetname)); + else + ALERT(at_console, " - TargetName: No Targetname\n"); + + ALERT(at_console, "Model: %s\n", STRING(pEntity->pev->model)); + + if (pEntity->pev->globalname) + ALERT(at_console, "Globalname: %s\n", STRING(pEntity->pev->globalname)); + } + break; + } + case 107: + { + TraceResult tr; + edict_t *pWorld = INDEXENT(0); + + Vector start = pev->origin + pev->view_ofs; + Vector end = start + gpGlobals->v_forward * 1024; + UTIL_TraceLine(start, end, ignore_monsters, edict(), &tr); + + if (tr.pHit) + pWorld = tr.pHit; + + const char *pszTextureName = TRACE_TEXTURE(pWorld, start, end); + + if (pszTextureName) + ALERT(at_console, "Texture: %s\n", pszTextureName); + + break; + } + case 195: + // show shortest paths for entire level to nearest node + Create("node_viewer_fly", pev->origin, pev->angles); + break; + case 196: + // show shortest paths for entire level to nearest node + Create("node_viewer_large", pev->origin, pev->angles); + break; + case 197: + // show shortest paths for entire level to nearest node + Create("node_viewer_human", pev->origin, pev->angles); + break; + case 199: + // show nearest node and all connections + ALERT(at_console, "%d\n", WorldGraph.FindNearestNode(pev->origin, bits_NODE_LAND)); + WorldGraph.ShowNodeConnections(WorldGraph.FindNearestNode(pev->origin, bits_NODE_LAND)); + break; + case 202: + { + // Random blood splatter + UTIL_MakeVectors(pev->v_angle); + UTIL_TraceLine(pev->origin + pev->view_ofs, pev->origin + pev->view_ofs + gpGlobals->v_forward * 128, ignore_monsters, edict(), &tr); + + if (tr.flFraction != 1.0f) + { + // line hit something, so paint a decal + CBloodSplat *pBlood = GetClassPtr((CBloodSplat *)NULL); + pBlood->Spawn(pev); + } + break; + } + case 203: + { + // remove creature. + pEntity = FindEntityForward(this); + + if (pEntity && pEntity->pev->takedamage != DAMAGE_NO) + pEntity->SetThink(&CBaseEntity::SUB_Remove); + + break; + } + case 204: + { + TraceResult tr; + Vector dir = Vector(0, 0, 1); + + UTIL_BloodDrips(pev->origin, dir, BLOOD_COLOR_RED, 2000); + + for (int r = 1; r < 4; r++) + { + float bloodRange = r * 50.0f; + + for (int i = 0; i < 50; i++) + { + dir.x = RANDOM_FLOAT(-1, 1); + dir.y = RANDOM_FLOAT(-1, 1); + dir.z = RANDOM_FLOAT(-1, 1); + + if (dir.x || dir.y || dir.z) + dir.NormalizeInPlace(); + else + dir.z = -1.0f; + + UTIL_TraceLine(EyePosition(), EyePosition() + dir * bloodRange, ignore_monsters, pev->pContainingEntity, &tr); + + if (tr.flFraction < 1.0f) + UTIL_BloodDecalTrace(&tr, BLOOD_COLOR_RED); + } + } + break; + } + } } /* <158256> ../cstrike/dlls/player.cpp:7474 */ -NOBODY void OLD_CheckBuyZone(CBasePlayer *player) -{ -// { -// const char *pszSpawnClass; // 7476 -// { -// class CBaseEntity *pSpot; // 7497 -// } -// } +void OLD_CheckBuyZone(CBasePlayer *player) +{ + const char *pszSpawnClass = NULL; + + if (player->m_iTeam == TERRORIST) + pszSpawnClass = "info_player_deathmatch"; + + else if (player->m_iTeam == CT) + pszSpawnClass = "info_player_start"; + + if (pszSpawnClass != NULL) + { + CBaseEntity *pSpot = NULL; + while ((pSpot = UTIL_FindEntityByClassname(pSpot, pszSpawnClass)) != NULL) + { + if ((pSpot->pev->origin - player->pev->origin).Length() < 200.0f) + player->m_signals.Signal(SIGNAL_BUY); + } + } } /* <14e5a9> ../cstrike/dlls/player.cpp:7514 */ -NOBODY void OLD_CheckBombTarget(CBasePlayer *player) -{ -// { -// class CBaseEntity *pSpot; // 7516 -// } +void OLD_CheckBombTarget(CBasePlayer *player) +{ + CBaseEntity *pSpot = NULL; + while ((pSpot = UTIL_FindEntityByClassname(pSpot, "info_bomb_target")) != NULL) + { + if ((pSpot->pev->origin - player->pev->origin).Length() <= 256.0f) + player->m_signals.Signal(SIGNAL_BOMB); + } } /* <14e5d5> ../cstrike/dlls/player.cpp:7532 */ -NOBODY void OLD_CheckRescueZone(CBasePlayer *player) -{ -// { -// class CBaseEntity *pSpot; // 7534 -// } +void OLD_CheckRescueZone(CBasePlayer *player) +{ + CBaseEntity *pSpot = NULL; + while ((pSpot = UTIL_FindEntityByClassname(pSpot, "info_hostage_rescue")) != NULL) + { + if ((pSpot->pev->origin - player->pev->origin).Length() <= 256) + player->m_signals.Signal(SIGNAL_RESCUE); + } } /* <1582e9> ../cstrike/dlls/player.cpp:7553 */ -NOBODY void CBasePlayer::HandleSignals(void) +void CBasePlayer::HandleSignals(void) { -// { -// int changed; // 7576 -// int state; // 7577 -// { -// class CHalfLifeMultiplay *mp; // 7563 -// OLD_CheckRescueZone(CBasePlayer *player); // 7572 -// OLD_CheckBuyZone(CBasePlayer *player); // 7566 -// OLD_CheckBombTarget(CBasePlayer *player); // 7569 -// } -// Update(CUnifiedSignals *const this); // 7576 -// BuyZoneIcon_Set(CBasePlayer *player); // 7582 -// BombTargetFlash_Set(CBasePlayer *player); // 7590 -// RescueZoneIcon_Set(CBasePlayer *player); // 7598 -// EscapeZoneIcon_Set(CBasePlayer *player); // 7606 -// VIP_SafetyZoneIcon_Set(CBasePlayer *player); // 7614 -// VIP_SafetyZoneIcon_Clear(CBasePlayer *player); // 7616 -// BuyZoneIcon_Clear(CBasePlayer *player); // 7584 -// EscapeZoneIcon_Clear(CBasePlayer *player); // 7608 -// RescueZoneIcon_Clear(CBasePlayer *player); // 7600 -// BombTargetFlash_Clear(CBasePlayer *player); // 7592 -// } + CHalfLifeMultiplay *mp = g_pGameRules; + + if (mp->IsMultiplayer()) + { + if (!mp->m_bMapHasBuyZone) + OLD_CheckBuyZone(this); + + if (!mp->m_bMapHasBombZone) + OLD_CheckBombTarget(this); + + if (!mp->m_bMapHasRescueZone) + OLD_CheckRescueZone(this); + } + + int state = m_signals.GetSignal(); + int changed = m_signals.GetState() ^ state; + + m_signals.Update(); + + if (changed & SIGNAL_BUY) + { + if (state & SIGNAL_BUY) + BuyZoneIcon_Set(this); + else + BuyZoneIcon_Clear(this); + } + if (changed & SIGNAL_BOMB) + { + if (state & SIGNAL_BOMB) + BombTargetFlash_Set(this); + else + BombTargetFlash_Clear(this); + } + if (changed & SIGNAL_RESCUE) + { + if (state & SIGNAL_RESCUE) + RescueZoneIcon_Set(this); + else + RescueZoneIcon_Clear(this); + } + if (changed & SIGNAL_ESCAPE) + { + if (state & SIGNAL_ESCAPE) + EscapeZoneIcon_Set(this); + else + EscapeZoneIcon_Clear(this); + } + if (changed & SIGNAL_VIPSAFETY) + { + if (state & SIGNAL_VIPSAFETY) + VIP_SafetyZoneIcon_Set(this); + else + VIP_SafetyZoneIcon_Clear(this); + } } +// Add a weapon to the player (Item == Weapon == Selectable Object) + /* <15325f> ../cstrike/dlls/player.cpp:7625 */ BOOL CBasePlayer::AddPlayerItem_(CBasePlayerItem *pItem) { @@ -4062,6 +4316,8 @@ BOOL CBasePlayer::AddPlayerItem_(CBasePlayerItem *pItem) { g_pGameRules->PlayerGotWeapon(this, pItem); pItem->CheckRespawn(); + + // ugly hack to update clip w/o an update clip message pItem->UpdateItemInfo(); if (m_pActiveItem) @@ -4091,6 +4347,7 @@ BOOL CBasePlayer::AddPlayerItem_(CBasePlayerItem *pItem) if (HasShield()) pev->gamestate = 0; + // should we switch to this item? if (g_pGameRules->FShouldSwitchWeapon(this, pItem)) { if (!m_bShieldDrawn) @@ -4139,13 +4396,28 @@ BOOL CBasePlayer::RemovePlayerItem_(CBasePlayerItem *pItem) return FALSE; } +// Returns the unique ID for the ammo, or -1 if error + /* <15997b> ../cstrike/dlls/player.cpp:7731 */ int CBasePlayer::GiveAmmo_(int iCount, char *szName, int iMax) { - if (pev->flags & FL_SPECTATOR || !szName || !g_pGameRules->CanHaveAmmo(this, szName, iMax)) + if (pev->flags & FL_SPECTATOR) + return -1; + + if (!szName) + { + // no ammo. return -1; + } + + if (!g_pGameRules->CanHaveAmmo(this, szName, iMax)) + { + // game rules say I can't have any more of this ammo type. + return -1; + } + + int i = GetAmmoIndex( szName ); - int i = GetAmmoIndex(szName); if (i < 0 || i >= MAX_AMMO_SLOTS) return -1; @@ -4154,28 +4426,76 @@ int CBasePlayer::GiveAmmo_(int iCount, char *szName, int iMax) return i; m_rgAmmo[i] += iAdd; + + // make sure the ammo messages have been linked first if (gmsgAmmoPickup) { + // Send the message that ammo has been picked up MESSAGE_BEGIN(MSG_ONE, gmsgAmmoPickup, NULL, pev); - WRITE_BYTE(GetAmmoIndex(szName)); - WRITE_BYTE(iAdd); + WRITE_BYTE(GetAmmoIndex(szName)); // ammo ID + WRITE_BYTE(iAdd); // amount MESSAGE_END(); } TabulateAmmo(); + return i; } +// Called every frame by the player PreThink + /* <158b10> ../cstrike/dlls/player.cpp:7784 */ -NOBODY void CBasePlayer::ItemPreFrame(void) +NOXREF void CBasePlayer::ItemPreFrame(void) { +#ifdef CLIENT_WEAPONS + if (m_flNextAttack > 0) + return; +#else + if (gpGlobals->time < m_flNextAttack) + return; +#endif // CLIENT_WEAPONS + + if (!m_pActiveItem) + return; + + m_pActiveItem->ItemPreFrame(); } +// Called every frame by the player PostThink + /* <158b33> ../cstrike/dlls/player.cpp:7805 */ -NOBODY void CBasePlayer::ItemPostFrame(void) +NOXREF void CBasePlayer::ItemPostFrame(void) { -// { -// int fInSelect; // 7807 -// } + static int fInSelect = FALSE; + + // check if the player is using a tank + if (m_pTank != NULL) + return; + + if (m_pActiveItem != NULL) + { + if (HasShield() && IsReloading()) + { + if (pev->button & IN_ATTACK2) + m_flNextAttack = 0; + } + } + +#ifdef CLIENT_WEAPONS + if (m_flNextAttack > 0) +#else + if (gpGlobals->time < m_flNextAttack) +#endif // CLIENT_WEAPONS + { + return; + } + + // TODO: Reverse me! + ImpulseCommands(); + + if (!m_pActiveItem) + return; + + m_pActiveItem->ItemPostFrame(); } /* <158b71> ../cstrike/dlls/player.cpp:7834 */ @@ -4205,27 +4525,40 @@ int CBasePlayer::GetAmmoIndex(const char *psz) } /* <158bf7> ../cstrike/dlls/player.cpp:7865 */ -NOBODY void CBasePlayer::SendAmmoUpdate(void) +void CBasePlayer::SendAmmoUpdate(void) { -// { -// int i; // 7867 -// MESSAGE_BEGIN(int msg_dest, -// int msg_type, -// const float *pOrigin, -// entvars_t *ent); // 7877 -// } + for (int i = 0; i < MAX_AMMO_SLOTS; i++) + { + if (m_rgAmmo[i] != m_rgAmmoLast[i]) + { + m_rgAmmoLast[i] = m_rgAmmo[i]; + + // send "Ammo" update message + MESSAGE_BEGIN(MSG_ONE, gmsgAmmoX, NULL, pev); + WRITE_BYTE(i); + WRITE_BYTE( max( min( m_rgAmmo[i], 254 ), 0 ) ); // clamp the value to one byte + MESSAGE_END(); + } + } } /* <158d4b> ../cstrike/dlls/player.cpp:7885 */ -NOBODY void CBasePlayer::SendHostagePos(void) -{ -// { -// class CBaseEntity *pHostage; // 7887 -// MESSAGE_BEGIN(int msg_dest, -// int msg_type, -// const float *pOrigin, -// entvars_t *ent); // 7894 -// } +NOXREF void CBasePlayer::SendHostagePos(void) +{ + CHostage *pHostage = NULL; + + while ((pHostage = (CHostage *)UTIL_FindEntityByClassname(pHostage, "hostage_entity")) != NULL) + { + MESSAGE_BEGIN(MSG_ONE, gmsgHostagePos, NULL, pev); + WRITE_BYTE(1); + WRITE_BYTE(pHostage->m_iHostageIndex); + WRITE_COORD(pHostage->pev->origin.x); + WRITE_COORD(pHostage->pev->origin.y); + WRITE_COORD(pHostage->pev->origin.z); + MESSAGE_END(); + } + + SendHostageIcons(); } /* <158c66> ../cstrike/dlls/player.cpp:7908 */ @@ -4235,80 +4568,245 @@ void CBasePlayer::SendHostageIcons(void) int numHostages = 0; char buf[16]; - if (UTIL_IsGame("czero")) + if (!UTIL_IsGame("czero")) + return; + + while ((pHostage = UTIL_FindEntityByClassname(pHostage, "hostage_entity")) != NULL) { - while ((pHostage = UTIL_FindEntityByClassname(pHostage, "hostage_entity")) != NULL) - { - if (pHostage && pHostage->pev->deadflag == DEAD_NO) - numHostages++; - } + if (pHostage && pHostage->pev->deadflag == DEAD_NO) + numHostages++; + } - if (numHostages > 4) - numHostages = 4; + if (numHostages > 4) + numHostages = 4; - Q_snprintf(buf, ARRAYSIZE(buf), "hostage%d", numHostages); + Q_snprintf(buf, ARRAYSIZE(buf), "hostage%d", numHostages); - if(numHostages) - { - MESSAGE_BEGIN(MSG_ONE, gmsgScenarioIcon, NULL, pev); - WRITE_BYTE(1); - WRITE_STRING(buf); - WRITE_BYTE(0); - MESSAGE_END(); - } - else - { - MESSAGE_BEGIN(MSG_ONE, gmsgScenarioIcon, NULL, pev); - WRITE_BYTE(0); - MESSAGE_END(); - } + if(numHostages) + { + MESSAGE_BEGIN(MSG_ONE, gmsgScenarioIcon, NULL, pev); + WRITE_BYTE(1); + WRITE_STRING(buf); + WRITE_BYTE(0); + MESSAGE_END(); + } + else + { + MESSAGE_BEGIN(MSG_ONE, gmsgScenarioIcon, NULL, pev); + WRITE_BYTE(0); + MESSAGE_END(); } } /* <158dc6> ../cstrike/dlls/player.cpp:7949 */ -NOBODY void CBasePlayer::SendWeatherInfo(void) +void CBasePlayer::SendWeatherInfo(void) { + CBaseEntity *pPoint = UTIL_FindEntityByClassname(NULL, "env_rain"); + CBaseEntity *pPoint2 = UTIL_FindEntityByClassname(NULL, "func_rain"); + + if (pPoint != NULL || pPoint2 != NULL) + { + MESSAGE_BEGIN(MSG_ONE, gmsgReceiveW, NULL, pev); + WRITE_BYTE(1); + MESSAGE_END(); + } + else + { + pPoint = UTIL_FindEntityByClassname(NULL, "env_snow"); + pPoint2 = UTIL_FindEntityByClassname(NULL, "func_snow"); + + if (pPoint != NULL || pPoint2 != NULL) + { + MESSAGE_BEGIN(MSG_ONE, gmsgReceiveW, NULL, pev); + WRITE_BYTE(2); + MESSAGE_END(); + } + } +} + +void (*CBasePlayer__UpdateClientData)(void); + +// resends any changed player HUD info to the client. +// Called every frame by PlayerPreThink +// Also called at start of demo recording and playback by +// ForceClientDllUpdate to ensure the demo gets messages +// reflecting all of the HUD state info. + +/* <159d3c> ../cstrike/dlls/player.cpp:7963 */ +NOBODY void __declspec(naked) CBasePlayer::UpdateClientData_(void) +{ + __asm + { + jmp CBasePlayer__UpdateClientData + } // { -// class CBaseEntity *pPoint; // 7956 -// class CBaseEntity *pPoint2; // 7957 +// int i; // MESSAGE_BEGIN(int msg_dest, // int msg_type, -// const float *pOrigin, -// entvars_t *ent); // 7964 +// const float * pOrigin, +// entvars_t * ent); +// Update(class CUnifiedSignals *const this); // MESSAGE_BEGIN(int msg_dest, // int msg_type, -// const float *pOrigin, -// entvars_t *ent); // 7978 +// const float * pOrigin, +// entvars_t * ent); +// { +// class CBaseEntity * pEntity; +// { +// class CClientFog * pFog; +// int r; +// int g; +// int b; +// union density; +// MESSAGE_BEGIN(int msg_dest, +// int msg_type, +// const float * pOrigin, +// entvars_t * ent); +// } +// } +// MESSAGE_BEGIN(int msg_dest, +// int msg_type, +// const float * pOrigin, +// entvars_t * ent); +// MESSAGE_BEGIN(int msg_dest, +// int msg_type, +// const float * pOrigin, +// entvars_t * ent); +// MESSAGE_BEGIN(int msg_dest, +// int msg_type, +// const float * pOrigin, +// entvars_t * ent); +// MESSAGE_BEGIN(int msg_dest, +// int msg_type, +// const float * pOrigin, +// entvars_t * ent); +// MESSAGE_BEGIN(int msg_dest, +// int msg_type, +// const float * pOrigin, +// entvars_t * ent); +// MESSAGE_BEGIN(int msg_dest, +// int msg_type, +// const float * pOrigin, +// edict_t * ed); +// MESSAGE_BEGIN(int msg_dest, +// int msg_type, +// const float * pOrigin, +// entvars_t * ent); +// edict(class CBaseEntity *const this); +// ENTINDEX(edict_t * pEdict); +// { +// int iHealth; +// MESSAGE_BEGIN(int msg_dest, +// int msg_type, +// const float * pOrigin, +// entvars_t * ent); +// } +// MESSAGE_BEGIN(int msg_dest, +// int msg_type, +// const float * pOrigin, +// entvars_t * ent); +// { +// class Vector damageOrigin; +// edict_t * other; +// int visibleDamageBits; +// Vector(class Vector *const this, +// const class Vector &const v); +// { +// class CBaseEntity * pEntity; +// Instance(edict_t * pent); +// } +// MESSAGE_BEGIN(int msg_dest, +// int msg_type, +// const float * pOrigin, +// entvars_t * ent); +// } +// SendAmmoUpdate(class CBasePlayer *const this); +// { +// int weapon_id; +// } +// { +// class CBasePlayerWeapon * w; +// iFlags(class CBasePlayerItem *const this); +// AmmoInventory(class CBasePlayer *const this, +// int iAmmoIndex); +// HintMessage(class CBasePlayer *const this, +// const char * pMessage, +// BOOL bDisplayIfPlayerDead, +// BOOL bOverride); +// } +// operator-(const class Vector *const this, +// const class Vector &const v); +// Length(const class Vector *const this); +// { +// class CBaseEntity * pPlayer; +// entindex(class CBaseEntity *const this); +// { +// class CBasePlayer * player; +// MESSAGE_BEGIN(int msg_dest, +// int msg_type, +// const float * pOrigin, +// entvars_t * ent); +// entindex(class CBaseEntity *const this); +// } +// } +// FlashlightIsOn(class CBasePlayer *const this); +// MESSAGE_BEGIN(int msg_dest, +// int msg_type, +// const float * pOrigin, +// entvars_t * ent); +// MESSAGE_BEGIN(int msg_dest, +// int msg_type, +// const float * pOrigin, +// entvars_t * ent); +// MESSAGE_BEGIN(int msg_dest, +// int msg_type, +// const float * pOrigin, +// entvars_t * ent); +// FlashlightTurnOff(class CBasePlayer *const this); // } } /* <1510bc> ../cstrike/dlls/player.cpp:8330 */ -NOBODY BOOL CBasePlayer::FBecomeProne_(void) +BOOL CBasePlayer::FBecomeProne_(void) { + m_afPhysicsFlags |= PFLAG_ONBARNACLE; + return TRUE; } /* <158e8a> ../cstrike/dlls/player.cpp:8341 */ -NOBODY void CBasePlayer::BarnacleVictimBitten(entvars_t *pevBarnacle) +NOXREF void CBasePlayer::BarnacleVictimBitten(entvars_t *pevBarnacle) { + TakeDamage(pevBarnacle, pevBarnacle, pev->armorvalue + pev->health, DMG_SLASH | DMG_ALWAYSGIB); } /* <158ec3> ../cstrike/dlls/player.cpp:8350 */ -NOBODY void CBasePlayer::BarnacleVictimReleased(void) +NOXREF void CBasePlayer::BarnacleVictimReleased(void) { + m_afPhysicsFlags &= ~PFLAG_ONBARNACLE; } +// return player light level plus virtual muzzle flash + /* <1510e4> ../cstrike/dlls/player.cpp:8360 */ -NOBODY int CBasePlayer::Illumination_(void) +int CBasePlayer::Illumination_(void) { -// { -// int iIllum; // 8362 -// Illumination(CBaseEntity *const this); // 8362 -// } + int iIllum = CBaseEntity::Illumination(); + + iIllum += m_iWeaponFlash; + + if (iIllum > 255) + return 255; + + return iIllum; } /* <158eeb> ../cstrike/dlls/player.cpp:8371 */ -NOBODY void CBasePlayer::EnableControl(BOOL fControl) +void CBasePlayer::EnableControl(BOOL fControl) { + if (!fControl) + pev->flags |= FL_FROZEN; + else + pev->flags &= ~FL_FROZEN; } /* <151142> ../cstrike/dlls/player.cpp:8387 */ @@ -4438,76 +4936,162 @@ void CBasePlayer::SetCustomDecalFrames(int nFrames) m_nCustomSprayFrames = -1; } +// Returns the # of custom frames this player's custom clan logo contains. + /* <15902e> ../cstrike/dlls/player.cpp:8720 */ -NOBODY int CBasePlayer::GetCustomDecalFrames(void) +NOXREF int CBasePlayer::GetCustomDecalFrames(void) { + return m_nCustomSprayFrames; } /* <151183> ../cstrike/dlls/player.cpp:8731 */ -NOBODY void CBasePlayer::Blind_(float duration, float holdTime, float fadeTime, int alpha) +void CBasePlayer::Blind_(float duration, float holdTime, float fadeTime, int alpha) { + m_blindUntilTime = gpGlobals->time + duration; + m_blindStartTime = gpGlobals->time; + + m_blindHoldTime = holdTime; + m_blindFadeTime = fadeTime; + m_blindAlpha = alpha; } /* <159051> ../cstrike/dlls/player.cpp:8741 */ -NOBODY void CBasePlayer::InitStatusBar(void) +NOXREF void CBasePlayer::InitStatusBar(void) { + m_flStatusBarDisappearDelay = 0.0f; + m_SbarString0[0] = '\0'; } /* <159079> ../cstrike/dlls/player.cpp:8749 */ -NOBODY void CBasePlayer::UpdateStatusBar(void) +void CBasePlayer::UpdateStatusBar(void) { -// { -// int newSBarState; // 8751 -// char sbuf0; // 8752 -// TraceResult tr; // 8758 -// Vector vecSrc; // 8762 -// Vector vecEnd; // 8763 -// BOOL bForceResend; // 8890 -// operator+(const Vector *const this, -// const Vector &v); // 8760 -// operator*(const Vector *const this, -// float fl); // 8763 -// operator+(const Vector *const this, -// const Vector &v); // 8763 -// FNullEnt(const edict_t *pent); // 8769 -// { -// class CBaseEntity *pEntity; // 8771 -// bool isVisiblePlayer; // 8773 -// Instance(edict_t *pent); // 8771 -// edict(CBaseEntity *const this); // 8787 -// ENTINDEX(edict_t *pEdict); // 8787 -// IsObserver(CBasePlayer *const this); // 8798 -// IsObserver(CBasePlayer *const this); // 8800 -// HintMessage(CBasePlayer *const this, -// const char *pMessage, -// BOOL bDisplayIfPlayerDead, -// BOOL bOverride); // 8815 -// HintMessage(CBasePlayer *const this, -// const char *pMessage, -// BOOL bDisplayIfPlayerDead, -// BOOL bOverride); // 8833 -// IsObserver(CBasePlayer *const this); // 8840 -// HintMessage(CBasePlayer *const this, -// const char *pMessage, -// BOOL bDisplayIfPlayerDead, -// BOOL bOverride); // 8865 -// HintMessage(CBasePlayer *const this, -// const char *pMessage, -// BOOL bDisplayIfPlayerDead, -// BOOL bOverride); // 8861 -// } -// { -// int i; // 8906 -// MESSAGE_BEGIN(int msg_dest, -// int msg_type, -// const float *pOrigin, -// entvars_t *ent); // 8910 -// } -// MESSAGE_BEGIN(int msg_dest, -// int msg_type, -// const float *pOrigin, -// entvars_t *ent); // 8894 -// } + int newSBarState[ SBAR_END ]; + char sbuf0[ SBAR_STRING_SIZE ]; + + Q_memset(newSBarState, 0, sizeof(newSBarState)); + Q_strcpy(sbuf0, m_SbarString0); + + // Find an ID Target + TraceResult tr; + UTIL_MakeVectors(pev->v_angle + pev->punchangle); + + Vector vecSrc = EyePosition(); + Vector vecEnd = vecSrc + (gpGlobals->v_forward * ((pev->flags & FL_SPECTATOR) != 0 ? MAX_SPECTATOR_ID_RANGE : MAX_ID_RANGE)); + + UTIL_TraceLine(vecSrc, vecEnd, dont_ignore_monsters, edict(), &tr); + + if (tr.flFraction != 1.0f) + { + if (!FNullEnt(tr.pHit)) + { + CBaseEntity *pEntity = CBaseEntity::Instance(tr.pHit); + bool isVisiblePlayer = (!TheBots->IsLineBlockedBySmoke(&pev->origin, &pEntity->pev->origin) && pEntity->Classify() == CLASS_PLAYER); + + if (gpGlobals->time >= m_blindUntilTime && isVisiblePlayer) + { + CBasePlayer *pTarget = (CBasePlayer *)pEntity; + + newSBarState[ SBAR_ID_TARGETNAME ] = ENTINDEX( pTarget->edict() ); + newSBarState[ SBAR_ID_TARGETTYPE ] = (pTarget->m_iTeam == m_iTeam) ? SBAR_TARGETTYPE_TEAMMATE : SBAR_TARGETTYPE_ENEMY; + + if (pTarget->m_iTeam == m_iTeam || IsObserver()) + { + if (playerid.value != PLAYERID_MODE_OFF || IsObserver()) + Q_strcpy(sbuf0, "1 %c1: %p2\n2 %h: %i3%%"); + else + Q_strcpy(sbuf0, " "); + + newSBarState[ SBAR_ID_TARGETHEALTH ] = (int)((pEntity->pev->health / pEntity->pev->max_health) * 100); + + if (!(m_flDisplayHistory & DHF_FRIEND_SEEN) && !(pev->flags & FL_SPECTATOR)) + { + m_flDisplayHistory |= DHF_FRIEND_SEEN; + HintMessage("#Hint_spotted_a_friend"); + } + } + else if (!IsObserver()) + { + if (playerid.value != PLAYERID_MODE_TEAMONLY && playerid.value != PLAYERID_MODE_OFF) + Q_strcpy(sbuf0, "1 %c1: %p2"); + else + Q_strcpy(sbuf0, " "); + + if (!(m_flDisplayHistory & DHF_ENEMY_SEEN)) + { + m_flDisplayHistory |= DHF_ENEMY_SEEN; + HintMessage("#Hint_spotted_an_enemy"); + } + } + + m_flStatusBarDisappearDelay = gpGlobals->time + 2.0f; + } + else if (pEntity->Classify() == CLASS_HUMAN_PASSIVE) + { + if (playerid.value != PLAYERID_MODE_OFF || IsObserver()) + Q_strcpy(sbuf0, "1 %c1 %h: %i3%%"); + else + Q_strcpy(sbuf0, " "); + + newSBarState[ SBAR_ID_TARGETTYPE ] = SBAR_TARGETTYPE_HOSTAGE; + newSBarState[ SBAR_ID_TARGETHEALTH ] = (int)((pEntity->pev->health / pEntity->pev->max_health) * 100); + + if (!(m_flDisplayHistory & DHF_HOSTAGE_SEEN_FAR) && tr.flFraction > 0.1f) + { + m_flDisplayHistory |= DHF_HOSTAGE_SEEN_FAR; + + if (m_iTeam == TERRORIST) + HintMessage("#Hint_prevent_hostage_rescue", TRUE); + + else if (m_iTeam == CT) + HintMessage("#Hint_rescue_the_hostages", TRUE); + } + else if (m_iTeam == CT && !(m_flDisplayHistory & DHF_HOSTAGE_SEEN_NEAR) && tr.flFraction <= 0.1f) + { + m_flDisplayHistory |= (DHF_HOSTAGE_SEEN_NEAR | DHF_HOSTAGE_SEEN_FAR); + HintMessage("#Hint_press_use_so_hostage_will_follow"); + } + + m_flStatusBarDisappearDelay = gpGlobals->time + 2.0f; + } + } + } + else if (m_flStatusBarDisappearDelay > gpGlobals->time) + { + // hold the values for a short amount of time after viewing the object + + newSBarState[ SBAR_ID_TARGETTYPE ] = m_izSBarState[ SBAR_ID_TARGETTYPE ]; + newSBarState[ SBAR_ID_TARGETNAME ] = m_izSBarState[ SBAR_ID_TARGETNAME ]; + newSBarState[ SBAR_ID_TARGETHEALTH ] = m_izSBarState[ SBAR_ID_TARGETHEALTH ]; + } + + BOOL bForceResend = FALSE; + + if (Q_strcmp(sbuf0, m_SbarString0)) + { + MESSAGE_BEGIN(MSG_ONE, gmsgStatusText, NULL, pev); + WRITE_BYTE(0); + WRITE_STRING(sbuf0); + MESSAGE_END(); + + Q_strcpy(m_SbarString0, sbuf0); + + // make sure everything's resent + bForceResend = TRUE; + } + + // Check values and send if they don't match + for (int i = 1; i < SBAR_END; i++) + { + if (newSBarState[ i ] != m_izSBarState[ i ] || bForceResend) + { + MESSAGE_BEGIN(MSG_ONE, gmsgStatusValue, NULL, pev); + WRITE_BYTE(i); + WRITE_SHORT(newSBarState[ i ]); + MESSAGE_END(); + + m_izSBarState[ i ] = newSBarState[ i ]; + } + } } /* <1603f0> ../cstrike/dlls/player.cpp:8926 */ @@ -4656,8 +5240,8 @@ void CBasePlayer::DropPlayerItem(const char *pszItemName) /* <1594a2> ../cstrike/dlls/player.cpp:9094 */ BOOL CBasePlayer::HasPlayerItem(CBasePlayerItem *pCheckItem) { - CBasePlayerItem *pItem = m_rgpPlayerItems[pCheckItem->iItemSlot()]; - while (pItem) + CBasePlayerItem *pItem = m_rgpPlayerItems[ pCheckItem->iItemSlot() ]; + while (pItem != NULL) { if (FClassnameIs(pItem->pev, STRING(pCheckItem->pev->classname))) return TRUE; @@ -4668,66 +5252,209 @@ BOOL CBasePlayer::HasPlayerItem(CBasePlayerItem *pCheckItem) } /* <159534> ../cstrike/dlls/player.cpp:9113 */ -NOBODY BOOL CBasePlayer::HasNamedPlayerItem(const char *pszItemName) +BOOL CBasePlayer::HasNamedPlayerItem(const char *pszItemName) { -// { -// class CBasePlayerItem *pItem; // 9115 -// int i; // 9116 -// } + CBasePlayerItem *pItem; + int i; + + for (i = 0; i < MAX_ITEM_TYPES ; i++) + { + pItem = m_rgpPlayerItems[ i ]; + + while (pItem != NULL) + { + if (!Q_strcmp(pszItemName, STRING(pItem->pev->classname))) + return TRUE; + + pItem = pItem->m_pNext; + } + } + + return FALSE; } /* <1619fd> ../cstrike/dlls/player.cpp:9137 */ -NOBODY void CBasePlayer::SwitchTeam(void) +void CBasePlayer::SwitchTeam(void) { -// { -// int oldTeam; // 9139 -// char *szOldTeam; // 9269 -// char *szNewTeam; // 9270 -// MESSAGE_BEGIN(int msg_dest, -// int msg_type, -// const float *pOrigin, -// edict_t *ed); // 9216 -// entindex(CBaseEntity *const this); // 9217 -// { -// int i; // 9253 -// MESSAGE_BEGIN(int msg_dest, -// int msg_type, -// const float *pOrigin, -// entvars_t *ent); // 9245 -// SendItemStatus(CBasePlayer *pPlayer); // 9249 -// } -// edict(CBaseEntity *const this); // 9277 -// edict(CBaseEntity *const this); // 9277 -// { -// class CCSBot *pBot; // 9282 -// { -// const class BotProfile *pProfile; // 9285 -// { -// bool kick; // 9288 -// } -// } -// } -// edict(CBaseEntity *const this); // 9173 -// entindex(CBaseEntity *const this); // 9173 -// edict(CBaseEntity *const this); // 9210 -// entindex(CBaseEntity *const this); // 9210 -// edict(CBaseEntity *const this); // 9166 -// entindex(CBaseEntity *const this); // 9166 -// edict(CBaseEntity *const this); // 9148 -// entindex(CBaseEntity *const this); // 9148 -// edict(CBaseEntity *const this); // 9156 -// entindex(CBaseEntity *const this); // 9156 -// edict(CBaseEntity *const this); // 9160 -// entindex(CBaseEntity *const this); // 9160 -// edict(CBaseEntity *const this); // 9189 -// entindex(CBaseEntity *const this); // 9189 -// edict(CBaseEntity *const this); // 9203 -// entindex(CBaseEntity *const this); // 9203 -// edict(CBaseEntity *const this); // 9197 -// entindex(CBaseEntity *const this); // 9197 -// edict(CBaseEntity *const this); // 9193 -// entindex(CBaseEntity *const this); // 9193 -// } + int oldTeam; + char *szOldTeam; + char *szNewTeam; + const char *szName; + + oldTeam = m_iTeam; + + if (m_iTeam == CT) + { + m_iTeam = TERRORIST; + + switch (m_iModelName) + { + case MODEL_URBAN: + m_iModelName = MODEL_LEET; + SET_CLIENT_KEY_VALUE(entindex(), GET_INFO_BUFFER(edict()), "model", "leet"); + break; + case MODEL_GIGN: + m_iModelName = MODEL_GUERILLA; + SET_CLIENT_KEY_VALUE(entindex(), GET_INFO_BUFFER(edict()), "model", "guerilla"); + break; + case MODEL_SAS: + m_iModelName = MODEL_ARCTIC; + SET_CLIENT_KEY_VALUE(entindex(), GET_INFO_BUFFER(edict()), "model", "arctic"); + break; + case MODEL_SPETSNAZ: + if (UTIL_IsGame("czero")) + { + m_iModelName = MODEL_MILITIA; + SET_CLIENT_KEY_VALUE(entindex(), GET_INFO_BUFFER(edict()), "model", "militia"); + break; + } + default: + if (m_iModelName == MODEL_GSG9 || !IsBot() || !TheBotProfiles->GetCustomSkinModelname(m_iModelName)) + { + m_iModelName = MODEL_TERROR; + SET_CLIENT_KEY_VALUE(entindex(), GET_INFO_BUFFER(edict()), "model", "terror"); + } + break; + } + } + else if (m_iTeam == TERRORIST) + { + m_iTeam = CT; + + switch (m_iModelName) + { + case MODEL_TERROR: + m_iModelName = MODEL_GSG9; + SET_CLIENT_KEY_VALUE(entindex(), GET_INFO_BUFFER(edict()), "model", "gsg9"); + break; + + case MODEL_ARCTIC: + m_iModelName = MODEL_SAS; + SET_CLIENT_KEY_VALUE(entindex(), GET_INFO_BUFFER(edict()), "model", "sas"); + break; + + case MODEL_GUERILLA: + m_iModelName = MODEL_GIGN; + SET_CLIENT_KEY_VALUE(entindex(), GET_INFO_BUFFER(edict()), "model", "gign"); + break; + + case MODEL_MILITIA: + if (UTIL_IsGame("czero")) + { + m_iModelName = MODEL_SPETSNAZ; + SET_CLIENT_KEY_VALUE(entindex(), GET_INFO_BUFFER(edict()), "model", "spetsnaz"); + break; + } + default: + if (m_iModelName == MODEL_LEET || !IsBot() || !TheBotProfiles->GetCustomSkinModelname(m_iModelName)) + { + m_iModelName = MODEL_URBAN; + SET_CLIENT_KEY_VALUE(entindex(), GET_INFO_BUFFER(edict()), "model", "urban"); + } + break; + } + } + + MESSAGE_BEGIN(MSG_ALL, gmsgTeamInfo); + WRITE_BYTE(entindex()); + switch (m_iTeam) + { + 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(); + + TheBots->OnEvent(EVENT_PLAYER_CHANGED_TEAM, this); + + UpdateLocation(TRUE); + + if (m_iTeam) + { + SetScoreboardAttributes(); + } + + if (pev->netname) + { + szName = STRING(pev->netname); + + if (!szName[0]) + szName = ""; + } + else + szName = ""; + + UTIL_ClientPrintAll(HUD_PRINTNOTIFY, (m_iTeam == TERRORIST) ? "#Game_join_terrorist_auto" : "#Game_join_ct_auto", szName); + + if (m_bHasDefuser) + { + m_bHasDefuser = false; + pev->body = 0; + + MESSAGE_BEGIN(MSG_ONE, gmsgStatusIcon, NULL, pev); + WRITE_BYTE(STATUSICON_HIDE); + WRITE_STRING("defuser"); + MESSAGE_END(); + + SendItemStatus(this); + SetProgressBarTime(0); + + for (int i = 0; i < MAX_ITEM_TYPES; i++) + { + m_pActiveItem = m_rgpPlayerItems[ i ]; + + if (m_pActiveItem && FClassnameIs(m_pActiveItem->pev, "item_thighpack")) + { + m_pActiveItem->Drop(); + m_rgpPlayerItems[i] = NULL; + } + } + } + + szOldTeam = GetTeam(oldTeam); + szNewTeam = GetTeam(m_iTeam); + + UTIL_LogPrintf + ( + "\"%s<%i><%s><%s>\" joined team \"%s\" (auto)\n", + STRING(pev->netname), + GETPLAYERUSERID(edict()), + GETPLAYERAUTHID(edict()), + szOldTeam, + szNewTeam + ); + + CCSBot *pBot = reinterpret_cast(this); + + if (pBot->IsBot()) + { + const BotProfile *pProfile = pBot->GetProfile(); + + if (pProfile != NULL) + { + bool kick = false; + + if (m_iTeam == CT && !pProfile->IsValidForTeam( BOT_TEAM_CT )) + kick = true; + + else if (m_iTeam == TERRORIST && !pProfile->IsValidForTeam( BOT_TEAM_T )) + kick = true; + + if (kick) + { + SERVER_COMMAND( UTIL_VarArgs("kick \"%s\"\n", STRING(pev->netname)) ); + } + } + } } /* <159594> ../cstrike/dlls/player.cpp:9302 */ @@ -5462,7 +6189,7 @@ bool CBasePlayer::NeedsGrenade(void) } /* <15aeab> ../cstrike/dlls/player.cpp:10381 */ -NOBODY void CBasePlayer::ClientCommand(const char *cmd, const char *arg1, const char *arg2, const char *arg3) +void CBasePlayer::ClientCommand(const char *cmd, const char *arg1, const char *arg2, const char *arg3) { BotArgs[0] = cmd; BotArgs[1] = arg1; @@ -5766,7 +6493,6 @@ NOXREF const char *CBasePlayer::PickFlashKillWeaponString(void) return "flash flash"; return NULL; - } /* <15baa1> ../cstrike/dlls/player.cpp:10787 */ @@ -6208,7 +6934,7 @@ bool CBasePlayer::IsObservingPlayer(CBasePlayer *pPlayer) if (FNullEnt(pPlayer)) return false; - return (pev->iuser1 == OBS_IN_EYE && pev->iuser2 == pPlayer->entindex()) != 0; + return (IsObserver() == OBS_IN_EYE && pev->iuser2 == pPlayer->entindex()) != 0; } /* <15d049> ../cstrike/dlls/player.cpp:11380 */ diff --git a/regamedll/dlls/player.h b/regamedll/dlls/player.h index 4676d6ee..04063603 100644 --- a/regamedll/dlls/player.h +++ b/regamedll/dlls/player.h @@ -46,6 +46,7 @@ #define PLAYER_FATAL_FALL_SPEED 1100.0f #define PLAYER_MAX_SAFE_FALL_SPEED 500.0f +#define PLAYER_SEARCH_RADIUS 64.0f // damage per unit per second. #define DAMAGE_FOR_FALL_SPEED 100.0f / (PLAYER_FATAL_FALL_SPEED - PLAYER_MAX_SAFE_FALL_SPEED) @@ -296,9 +297,9 @@ struct WeaponStruct //#define gmsgDamage (*pgmsgDamage) //#define gmsgBattery (*pgmsgBattery) //#define gmsgTrain (*pgmsgTrain) -//#define gmsgLogo (*pgmsgLogo) +#define gmsgLogo (*pgmsgLogo) #define gmsgWeaponList (*pgmsgWeaponList) -//#define gmsgAmmoX (*pgmsgAmmoX) +#define gmsgAmmoX (*pgmsgAmmoX) //#define gmsgDeathMsg (*pgmsgDeathMsg) #define gmsgScoreAttrib (*pgmsgScoreAttrib) #define gmsgScoreInfo (*pgmsgScoreInfo) @@ -319,8 +320,8 @@ struct WeaponStruct #define gmsgMoney (*pgmsgMoney) #define gmsgBlinkAcct (*pgmsgBlinkAcct) #define gmsgArmorType (*pgmsgArmorType) -//#define gmsgStatusValue (*pgmsgStatusValue) -//#define gmsgStatusText (*pgmsgStatusText) +#define gmsgStatusValue (*pgmsgStatusValue) +#define gmsgStatusText (*pgmsgStatusText) #define gmsgStatusIcon (*pgmsgStatusIcon) #define gmsgBarTime (*pgmsgBarTime) #define gmsgReloadSound (*pgmsgReloadSound) @@ -340,7 +341,7 @@ struct WeaponStruct //#define gmsgAllowSpec (*pgmsgAllowSpec) #define gmsgBombDrop (*pgmsgBombDrop) //#define gmsgBombPickup (*pgmsgBombPickup) -//#define gmsgHostagePos (*pgmsgHostagePos) +#define gmsgHostagePos (*pgmsgHostagePos) //#define gmsgHostageK (*pgmsgHostageK) #define gmsgGeigerRange (*pgmsgGeigerRange) #define gmsgSendCorpse (*pgmsgSendCorpse) @@ -348,7 +349,7 @@ struct WeaponStruct //#define gmsgSpecHealth (*pgmsgSpecHealth) //#define gmsgForceCam (*pgmsgForceCam) //#define gmsgADStop (*pgmsgADStop) -//#define gmsgReceiveW (*pgmsgReceiveW) +#define gmsgReceiveW (*pgmsgReceiveW) #define gmsgScenarioIcon (*pgmsgScenarioIcon) #define gmsgBotVoice (*pgmsgBotVoice) #define gmsgBuyClose (*pgmsgBuyClose) @@ -420,8 +421,8 @@ public: class CSprayCan: public CBaseEntity { public: - NOBODY virtual void Think(void); - NOBODY virtual int ObjectCaps(void) + virtual void Think(void); + virtual int ObjectCaps(void) { return ObjectCaps_(); } @@ -445,8 +446,8 @@ public: class CBloodSplat: public CBaseEntity { public: - NOBODY void Spawn(entvars_t *pevOwner); - NOBODY void Spray(void); + void Spawn(entvars_t *pevOwner); + void Spray(void); };/* size: 152, cachelines: 3, members: 1 */ @@ -498,13 +499,13 @@ public: { return IsNetClient_(); } - NOBODY virtual const char *TeamID(void); - NOBODY virtual BOOL FBecomeProne(void); + virtual const char *TeamID(void); + virtual BOOL FBecomeProne(void); NOBODY virtual Vector BodyTarget(const Vector &posSrc) { return BodyTarget_(posSrc); } - NOBODY virtual int Illumination(void); + virtual int Illumination(void); NOBODY virtual BOOL ShouldFadeOnDeath(void) { return ShouldFadeOnDeath_(); @@ -523,7 +524,7 @@ public: NOBODY virtual void ImpulseCommands(void); virtual void RoundRespawn(void); virtual Vector GetAutoaimVector(float flDelta); - NOBODY virtual void Blind(float flUntilTime, float flHoldTime, float flFadeTime, int iAlpha); + virtual void Blind(float flUntilTime, float flHoldTime, float flFadeTime, int iAlpha); NOBODY virtual void OnTouchingWeapon(CWeaponBox *pWeapon) { OnTouchingWeapon_(pWeapon); @@ -628,7 +629,7 @@ public: NOBODY void Disappear(void); void MakeVIP(void); NOBODY bool CanPlayerBuy(bool display); - NOBODY void SwitchTeam(void); + void SwitchTeam(void); void TabulateAmmo(void); void Pain(int m_LastHitGroup, bool HasArmour); BOOL IsBombGuy(void); @@ -658,35 +659,35 @@ public: bool NeedsDefuseKit(void); bool NeedsGrenade(void); BOOL IsOnLadder(void); - NOXREF BOOL FlashlightIsOn(void); + BOOL FlashlightIsOn(void); void FlashlightTurnOn(void); - NOBODY void FlashlightTurnOff(void); + void FlashlightTurnOff(void); NOBODY void UpdatePlayerSound(void); NOXREF void DeathSound(void); void SetAnimation(PLAYER_ANIM playerAnim); NOBODY void SetWeaponAnimType(const char *szExtention); - NOBODY void CheatImpulseCommands(int iImpulse); + void CheatImpulseCommands(int iImpulse); NOXREF void StartDeathCam(void); NOBODY void StartObserver(Vector vecPosition, Vector vecViewAngle); NOBODY void HandleSignals(void); void DropPlayerItem(const char *pszItemName); BOOL HasPlayerItem(CBasePlayerItem *pCheckItem); - NOBODY BOOL HasNamedPlayerItem(const char *pszItemName); + BOOL HasNamedPlayerItem(const char *pszItemName); NOXREF BOOL HasWeapons(void); - NOBODY void SelectPrevItem(int iItem); + NOXREF void SelectPrevItem(int iItem); NOBODY void SelectNextItem(int iItem); void SelectLastItem(void); NOBODY void SelectItem(const char *pstr); - NOBODY void ItemPreFrame(void); - NOBODY void ItemPostFrame(void); + NOXREF void ItemPreFrame(void); + NOXREF void ItemPostFrame(void); void GiveNamedItem(const char *pszName); - NOBODY void EnableControl(BOOL fControl); + void EnableControl(BOOL fControl); NOBODY bool HintMessage(const char *pMessage, BOOL bDisplayIfPlayerDead = FALSE, BOOL bOverride = FALSE); - NOBODY void SendAmmoUpdate(void); + void SendAmmoUpdate(void); NOXREF void SendFOV(int fov); NOBODY void WaterMove(void); NOBODY void EXPORT PlayerDeathThink(void); - NOBODY void PlayerUse(void); + void PlayerUse(void); NOBODY void HostageUsed(void); NOBODY void JoiningThink(void); NOBODY void RemoveLevelText(void); @@ -697,8 +698,8 @@ public: void SetSuitUpdate(char *name = NULL, int fgroup = 0, int iNoRepeatTime = 0); NOXREF void UpdateGeigerCounter(void); NOBODY void CheckTimeBasedDamage(void); - NOBODY void BarnacleVictimBitten(entvars_t *pevBarnacle); - NOBODY void BarnacleVictimReleased(void); + NOXREF void BarnacleVictimBitten(entvars_t *pevBarnacle); + NOXREF void BarnacleVictimReleased(void); static int GetAmmoIndex(const char *psz); int AmmoInventory(int iAmmoIndex); NOBODY void ResetAutoaim(void); @@ -706,21 +707,21 @@ public: NOBODY void ForceClientDllUpdate(void); void DeathMessage(entvars_t *pevAttacker) { }; void SetCustomDecalFrames(int); - NOBODY int GetCustomDecalFrames(void); - NOBODY void InitStatusBar(void); - NOBODY void UpdateStatusBar(void); + NOXREF int GetCustomDecalFrames(void); + NOXREF void InitStatusBar(void); + void UpdateStatusBar(void); void StudioEstimateGait(void); NOXREF void StudioPlayerBlend(int *pBlend, float *pPitch); NOXREF void CalculatePitchBlend(void); void CalculateYawBlend(void); void StudioProcessGait(void); - NOBODY void SendHostagePos(void); + NOXREF void SendHostagePos(void); void SendHostageIcons(void); NOXREF void ResetStamina(void); NOXREF BOOL IsArmored(int nHitGroup); NOXREF BOOL ShouldDoLargeFlinch(int nHitGroup, int nGunType); void SetPrefsFromUserinfo(char *infobuffer); - NOBODY void SendWeatherInfo(void); + void SendWeatherInfo(void); void UpdateShieldCrosshair(bool); bool HasShield(void); bool IsProtectedByShield(void) @@ -1027,9 +1028,9 @@ extern int gmsgCurWeapon; //extern int gmsgDamage; //extern int gmsgBattery; //extern int gmsgTrain; -//extern int gmsgLogo; +extern int gmsgLogo; extern int gmsgWeaponList; -//extern int gmsgAmmoX; +extern int gmsgAmmoX; //extern int gmsgDeathMsg; extern int gmsgScoreAttrib; extern int gmsgScoreInfo; @@ -1050,8 +1051,8 @@ extern int gmsgRoundTime; extern int gmsgMoney; extern int gmsgBlinkAcct; extern int gmsgArmorType; -//extern int gmsgStatusValue; -//extern int gmsgStatusText; +extern int gmsgStatusValue; +extern int gmsgStatusText; extern int gmsgStatusIcon; extern int gmsgBarTime; extern int gmsgReloadSound; @@ -1071,7 +1072,7 @@ extern int gmsgTutorClose; //extern int gmsgAllowSpec; extern int gmsgBombDrop; //extern int gmsgBombPickup; -//extern int gmsgHostagePos; +extern int gmsgHostagePos; //extern int gmsgHostageK; extern int gmsgGeigerRange; extern int gmsgSendCorpse; @@ -1079,7 +1080,7 @@ extern int gmsgSendCorpse; //extern int gmsgSpecHealth; //extern int gmsgForceCam; //extern int gmsgADStop; -//extern int gmsgReceiveW; +extern int gmsgReceiveW; extern int gmsgScenarioIcon; extern int gmsgBotVoice; extern int gmsgBuyClose; @@ -1099,16 +1100,22 @@ extern int gmsgBotProgress; //NOBODY void player_weaponstrip(entvars_t *pev); //NOBODY void monster_hevsuit_dead(entvars_t *pev); -NOBODY void BuyZoneIcon_Set(CBasePlayer *player); -NOBODY void BuyZoneIcon_Clear(CBasePlayer *player); -NOBODY void BombTargetFlash_Set(CBasePlayer *player); -NOBODY void BombTargetFlash_Clear(CBasePlayer *player); -NOBODY void RescueZoneIcon_Set(CBasePlayer *player); -NOBODY void RescueZoneIcon_Clear(CBasePlayer *player); +void OLD_CheckBuyZone(CBasePlayer *player); +void OLD_CheckBombTarget(CBasePlayer *player); +void OLD_CheckRescueZone(CBasePlayer *player); -NOXREF void EscapeZoneIcon_Set(CBasePlayer *player); -NOXREF void EscapeZoneIcon_Clear(CBasePlayer *player); -NOXREF void VIP_SafetyZoneIcon_Set(CBasePlayer *player); +void BuyZoneIcon_Set(CBasePlayer *player); +void BuyZoneIcon_Clear(CBasePlayer *player); +void BombTargetFlash_Set(CBasePlayer *player); +void BombTargetFlash_Clear(CBasePlayer *player); +void RescueZoneIcon_Set(CBasePlayer *player); +void RescueZoneIcon_Clear(CBasePlayer *player); +void EscapeZoneIcon_Set(CBasePlayer *player); +void EscapeZoneIcon_Clear(CBasePlayer *player); +void EscapeZoneIcon_Set(CBasePlayer *player); +void EscapeZoneIcon_Clear(CBasePlayer *player); +void VIP_SafetyZoneIcon_Set(CBasePlayer *player); +void VIP_SafetyZoneIcon_Clear(CBasePlayer *player); NOBODY void LinkUserMessages(void); void WriteSigonMessages(void); @@ -1119,14 +1126,14 @@ int TrainSpeed(int iSpeed, int iMax); 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); -NOBODY bool CanSeeUseable(void); +bool CanSeeUseable(CBasePlayer *me, CBaseEntity *entity); NOBODY void FixPlayerCrouchStuck(edict_t *pPlayer); NOXREF BOOL IsSpawnPointValid(CBaseEntity *pPlayer, CBaseEntity *pSpot); NOBODY void InitZombieSpawns(void); NOBODY CBaseEntity *FindZombieSpawn(CBaseEntity *player, bool forceSpawn); NOBODY edict_t *EntSelectSpawnPoint(CBaseEntity *pPlayer); void SetScoreAttrib(CBasePlayer *dest, CBasePlayer *src); -NOBODY CBaseEntity *FindEntityForward(CBaseEntity *pMe); +NOXREF CBaseEntity *FindEntityForward(CBaseEntity *pMe); float GetPlayerPitch(const edict_t *pEdict); float GetPlayerYaw(const edict_t *pEdict); int GetPlayerGaitsequence(edict_t *pEdict); diff --git a/regamedll/dlls/saverestore.h b/regamedll/dlls/saverestore.h index 144f0fa1..41ca3f8b 100644 --- a/regamedll/dlls/saverestore.h +++ b/regamedll/dlls/saverestore.h @@ -234,7 +234,7 @@ public: } NOBODY int Save(CSave &save); NOBODY int Restore(CRestore &restore); - NOBODY void DumpGlobals(void); + void DumpGlobals(void); static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1]; diff --git a/regamedll/dlls/soundent.cpp b/regamedll/dlls/soundent.cpp index 667b92aa..5ff8dea7 100644 --- a/regamedll/dlls/soundent.cpp +++ b/regamedll/dlls/soundent.cpp @@ -56,21 +56,41 @@ NOBODY void CSoundEnt::FreeSound(int iSound, int iPrevious) } /* <178e2d> ../cstrike/dlls/soundent.cpp:171 */ -NOBODY int CSoundEnt::IAllocSound(void) +int CSoundEnt::IAllocSound(void) { -// { -// int iNewSound; // 173 -// } -// IAllocSound(CSoundEnt *const this); // 171 + if (m_iFreeSound == SOUNDLIST_EMPTY) + { + ALERT(at_console, "Free Sound List is full!\n"); + return SOUNDLIST_EMPTY; + } + + int iNewSound = m_iFreeSound; + + m_iFreeSound = m_SoundPool[ iNewSound ].m_iNext; + m_SoundPool[ iNewSound ].m_iNext = m_iActiveSound; + m_iActiveSound = iNewSound; + + return iNewSound; } /* <178e94> ../cstrike/dlls/soundent.cpp:200 */ -NOBODY void CSoundEnt::InsertSound(int iType, const Vector &vecOrigin, int iVolume, float flDuration) +void CSoundEnt::InsertSound(int iType, const Vector &vecOrigin, int iVolume, float flDuration) { -// { -// int iThisSound; // 202 -// IAllocSound(CSoundEnt *const this); // 210 -// } + if (!pSoundEnt) + return; + + int iThisSound = pSoundEnt->IAllocSound(); + + if (iThisSound == SOUNDLIST_EMPTY) + { + ALERT(at_console, "Could not AllocSound() for InsertSound() (DLL)\n"); + return; + } + + pSoundEnt->m_SoundPool[ iThisSound ].m_vecOrigin = vecOrigin; + pSoundEnt->m_SoundPool[ iThisSound ].m_iType = iType; + pSoundEnt->m_SoundPool[ iThisSound ].m_iVolume = iVolume; + pSoundEnt->m_SoundPool[ iThisSound ].m_flExpireTime = gpGlobals->time + flDuration; } /* <178f4e> ../cstrike/dlls/soundent.cpp:228 */ diff --git a/regamedll/dlls/trains.h b/regamedll/dlls/trains.h index c5f44f9b..678e653b 100644 --- a/regamedll/dlls/trains.h +++ b/regamedll/dlls/trains.h @@ -184,7 +184,7 @@ class CFuncVehicle: public CBaseEntity { public: NOBODY virtual void Spawn(void); - NOBODY virtual void Precache(void); + virtual void Precache(void); NOBODY virtual void Restart(void); NOBODY virtual void KeyValue(KeyValueData *pkvd); NOBODY virtual int Save(CSave &save); @@ -193,9 +193,9 @@ public: { return ObjectCaps_(); } - NOBODY virtual int Classify(void); + virtual int Classify(void); NOBODY virtual void OverrideReset(void); - NOBODY virtual BOOL OnControls(entvars_t *pev); + virtual BOOL OnControls(entvars_t *pev); NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); NOBODY virtual void Blocked(CBaseEntity *pOther); diff --git a/regamedll/dlls/util.h b/regamedll/dlls/util.h index 79fc0044..69743b12 100644 --- a/regamedll/dlls/util.h +++ b/regamedll/dlls/util.h @@ -35,8 +35,8 @@ #include "activity.h" #define _LOG_TRACE\ - static int iNum = 0;\ - printf2(__FUNCTION__":: iNum - %d", iNum++); + static int iNumPassed = 0;\ + printf2(__FUNCTION__":: iNumPassed - %d", iNumPassed++); // Makes these more explicit, and easier to find #ifdef HOOK_GAMEDLL @@ -66,6 +66,13 @@ extern globalvars_t *gpGlobals; #define STRING(offset) ((const char *)(gpGlobals->pStringBase + (unsigned int)(offset))) #define MAKE_STRING(str) ((uint64_t)(str) - (uint64_t)(STRING(0))) +// Dot products for view cone checking + +#define VIEW_FIELD_FULL -1.0 // +-180 degrees +#define VIEW_FIELD_WIDE -0.7 // +-135 degrees 0.1 // +-85 degrees, used for full FOV checks +#define VIEW_FIELD_NARROW 0.7 // +-45 degrees, more narrow check used to set up ranged attacks +#define VIEW_FIELD_ULTRA_NARROW 0.9 // +-25 degrees, more narrow check used to set up ranged attacks + #define SND_SPAWNING (1<<8) // duplicated in protocol.h we're spawing, used in some cases for ambients #define SND_STOP (1<<5) // duplicated in protocol.h stop sound #define SND_CHANGE_VOL (1<<6) // duplicated in protocol.h change sound vol diff --git a/regamedll/dlls/vehicle.cpp b/regamedll/dlls/vehicle.cpp index 3f10be63..dd4e9ff8 100644 --- a/regamedll/dlls/vehicle.cpp +++ b/regamedll/dlls/vehicle.cpp @@ -358,20 +358,22 @@ NOBODY void CFuncVehicle::SetControls(entvars_t *pevControls) } /* <1bb1b2> ../cstrike/dlls/vehicle.cpp:819 */ -NOBODY BOOL CFuncVehicle::OnControls_(entvars_t *pevTest) +BOOL CFuncVehicle::OnControls_(entvars_t *pevTest) { -// { -// Vector offset; // 821 -// Vector local; // 828 -// operator-(const Vector *const this, -// const Vector &v); // 821 -// DotProduct(Vector &a, -// const Vector &b); // 829 -// DotProduct(Vector &a, -// const Vector &b); // 830 -// DotProduct(Vector &a, -// const Vector &b); // 831 -// } + Vector offset = pevTest->origin - pev->origin; + + if (pev->spawnflags & SF_TRACKTRAIN_NOCONTROL) + return FALSE; + + UTIL_MakeVectors(pev->angles); + + Vector local; + local.x = DotProduct(offset, gpGlobals->v_forward); + local.y = -DotProduct(offset, gpGlobals->v_right); + local.z = DotProduct(offset, gpGlobals->v_up); + + return (local.x >= m_controlMins.x && local.y >= m_controlMins.y && local.z >= m_controlMins.z + && local.x <= m_controlMaxs.x && local.y <= m_controlMaxs.y && local.z <= m_controlMaxs.z); } /* <1bb676> ../cstrike/dlls/vehicle.cpp:841 */ @@ -438,8 +440,9 @@ NOBODY CFuncVehicle *CFuncVehicle::Instance(edict_t *pent) } /* <1bb055> ../cstrike/dlls/vehicle.cpp:951 */ -NOBODY int CFuncVehicle::Classify_(void) +int CFuncVehicle::Classify_(void) { + return CLASS_VEHICLE; } /* <1bb0ef> ../cstrike/dlls/vehicle.cpp:956 */ @@ -461,8 +464,43 @@ NOBODY void CFuncVehicle::Restart_(void) } /* <1bb07b> ../cstrike/dlls/vehicle.cpp:1032 */ -NOBODY void CFuncVehicle::Precache_(void) +void CFuncVehicle::Precache_(void) { + if (m_flVolume == 0.0f) + m_flVolume = 1.0f; + + switch (m_sounds) + { + case 1: + PRECACHE_SOUND("plats/vehicle1.wav"); + pev->noise = MAKE_STRING("plats/vehicle1.wav"); + break; + case 2: + PRECACHE_SOUND("plats/vehicle2.wav"); + pev->noise = MAKE_STRING("plats/vehicle2.wav"); + break; + case 3: + PRECACHE_SOUND("plats/vehicle3.wav"); + pev->noise = MAKE_STRING("plats/vehicle3.wav"); + break; + case 4: + PRECACHE_SOUND("plats/vehicle4.wav"); + pev->noise = MAKE_STRING("plats/vehicle4.wav"); + break; + case 5: + PRECACHE_SOUND("plats/vehicle6.wav"); + pev->noise = MAKE_STRING("plats/vehicle6.wav"); + break; + case 6: + PRECACHE_SOUND("plats/vehicle7.wav"); + pev->noise = MAKE_STRING("plats/vehicle7.wav"); + break; + } + + PRECACHE_SOUND("plats/vehicle_brake1.wav"); + PRECACHE_SOUND("plats/vehicle_start1.wav"); + + m_usAdjustPitch = PRECACHE_EVENT(1, "events/vehicle.sc"); } /* <1bd23c> ../cstrike/dlls/vehicle.cpp:1064 */ diff --git a/regamedll/dlls/weapons.cpp b/regamedll/dlls/weapons.cpp index 2c0ad8c6..75bc66ca 100644 --- a/regamedll/dlls/weapons.cpp +++ b/regamedll/dlls/weapons.cpp @@ -1093,37 +1093,42 @@ NOBODY void CBasePlayerWeapon::RetireWeapon_(void) } +// GetNextAttackDelay - An accurate way of calcualting the next attack time. + /* <1d3f76> ../cstrike/dlls/weapons.cpp:1580 */ float CBasePlayerWeapon::GetNextAttackDelay(float delay) { - float flNextAttack; - if (m_flLastFireTime == 0.0f || m_flNextPrimaryAttack == -1.0f) { + // At this point, we are assuming that the client has stopped firing + // and we are going to reset our book keeping variables. m_flPrevPrimaryAttack = delay; m_flLastFireTime = gpGlobals->time; } #ifdef REGAMEDLL_BUILD_6153 - float flCreep; - float flTimeBetweenFires; // TODO: Build 6xxx // at build 6153 beta this removed // maybe it was initiated due to the delay of the shot - flCreep = gpGlobals->time - m_flLastFireTime; - if (flCreep > 0.0f) - flTimeBetweenFires = flCreep - m_flPrevPrimaryAttack; - else - flTimeBetweenFires = 0.0f; + // calculate the time between this shot and the previous + float flTimeBetweenFires = gpGlobals->time - m_flLastFireTime; + float flCreep = 0.0f; - flNextAttack = delay - flTimeBetweenFires + 0.0f; + if (flTimeBetweenFires > 0.0f) + flCreep = flTimeBetweenFires - m_flPrevPrimaryAttack; + + float flNextAttack = delay - flCreep + 0.0f; #else - flNextAttack = delay + 0.0f; -#endif + float flNextAttack = delay + 0.0f; +#endif // REGAMEDLL_BUILD_6153 + // save the last fire time m_flLastFireTime = gpGlobals->time; + + // we need to remember what the m_flNextPrimaryAttack time is set to for each shot, + // store it as m_flPrevPrimaryAttack. m_flPrevPrimaryAttack = flNextAttack; return flNextAttack; diff --git a/regamedll/dlls/world.cpp b/regamedll/dlls/world.cpp index b4755ad7..54242f60 100644 --- a/regamedll/dlls/world.cpp +++ b/regamedll/dlls/world.cpp @@ -182,13 +182,22 @@ globalentity_t *CGlobalState::Find(string_t globalname) return pTest; } +// This is available all the time now on impulse 104, remove later + /* <1db703> ../cstrike/dlls/world.cpp:329 */ -NOBODY void CGlobalState::DumpGlobals(void) +void CGlobalState::DumpGlobals(void) { -// { -// char *const estates; // 331 -// globalentity_t *pTest; // 332 -// } + static char *estates[] = { "Off", "On", "Dead" }; + globalentity_t *pTest; + + ALERT(at_console, "-- Globals --\n"); + pTest = m_pList; + + while (pTest != NULL) + { + ALERT(at_console, "%s: %s (%s)\n", pTest->name, pTest->levelName, estates[ pTest->state ]); + pTest = pTest->pNext; + } } /* <1db76a> ../cstrike/dlls/world.cpp:345 */ diff --git a/regamedll/game_shared/bot/bot.cpp b/regamedll/game_shared/bot/bot.cpp index e9a58fed..69b18870 100644 --- a/regamedll/game_shared/bot/bot.cpp +++ b/regamedll/game_shared/bot/bot.cpp @@ -370,13 +370,13 @@ void CBot::PrintIfWatched(char *format, ...) const Q_sprintf(buffer, "%s: ", (name != NULL) ? name : "(NULL netname)"); SERVER_PRINT( buffer ); - _logf(buffer); + //_logf(buffer); va_start(varg, format); Q_vsnprintf(buffer, ARRAYSIZE(buffer), format, varg); va_end(varg); - _logf(buffer); + //_logf(buffer); SERVER_PRINT( buffer ); } diff --git a/regamedll/game_shared/bot/bot_util.cpp b/regamedll/game_shared/bot/bot_util.cpp index 6f9a5229..78462f03 100644 --- a/regamedll/game_shared/bot/bot_util.cpp +++ b/regamedll/game_shared/bot/bot_util.cpp @@ -6,12 +6,12 @@ #ifndef HOOK_GAMEDLL static short s_iBeamSprite = 0; -static float cosTable[COS_TABLE_SIZE]; +static float cosTable[ COS_TABLE_SIZE ]; #else short s_iBeamSprite; -float cosTable[COS_TABLE_SIZE]; +float cosTable[ COS_TABLE_SIZE ]; #endif // HOOK_GAMEDLL diff --git a/regamedll/hookers/6153_hooker.cpp b/regamedll/hookers/6153_hooker.cpp index f8ea65fc..56b4464a 100644 --- a/regamedll/hookers/6153_hooker.cpp +++ b/regamedll/hookers/6153_hooker.cpp @@ -227,11 +227,11 @@ FunctionHook g_FunctionHooks[] = //virtual func { 0x01D70C90, "_ZN4CGib10ObjectCapsEv", mfunc_ptr_cast(&CGib::ObjectCaps_) }, //non-virtual func - //{ 0x01D6FFE0, "_ZN4CGib5SpawnEPKc", mfunc_ptr_cast(&CGib::Spawn) }, - //{ 0x01D6FCA0, "_ZN4CGib14BounceGibTouchEP11CBaseEntity", mfunc_ptr_cast(&CGib::BounceGibTouch) }, + { 0x01D6FFE0, "_ZN4CGib5SpawnEPKc", mfunc_ptr_cast(&CGib::Spawn) }, + { 0x01D6FCA0, "_ZN4CGib14BounceGibTouchEP11CBaseEntity", mfunc_ptr_cast(&CGib::BounceGibTouch) }, //{ 0x01D6FE40, "_ZN4CGib14StickyGibTouchEP11CBaseEntity", mfunc_ptr_cast(&CGib::StickyGibTouch) }, - //{ 0x01D6FBF0, "_ZN4CGib12WaitTillLandEv", mfunc_ptr_cast(&CGib::WaitTillLand) }, - //{ 0x01D6E550, "_ZN4CGib13LimitVelocityEv", mfunc_ptr_cast(&CGib::LimitVelocity) }, + { 0x01D6FBF0, "_ZN4CGib12WaitTillLandEv", mfunc_ptr_cast(&CGib::WaitTillLand) }, + { 0x01D6E550, "_ZN4CGib13LimitVelocityEv", mfunc_ptr_cast(&CGib::LimitVelocity) }, //{ 0x01D6EAB0, "_ZN4CGib12SpawnHeadGibEP9entvars_s", mfunc_ptr_cast(&CGib::SpawnHeadGib) }, //{ 0x01D6EEB0, "_ZN4CGib15SpawnRandomGibsEP9entvars_sii", mfunc_ptr_cast(&CGib::SpawnRandomGibs) }, //{ 0x01D6E640, "_ZN4CGib15SpawnStickyGibsEP9entvars_s6Vectori", mfunc_ptr_cast(&CGib::SpawnStickyGibs) }, // NOXREF @@ -380,10 +380,7 @@ FunctionHook g_FunctionHooks[] = ////{ 0x0, "_ZN11CBaseEntity5SpawnEv", mfunc_ptr_cast(&CBaseEntity::Spawn) }, ////{ 0x0, "_ZN11CBaseEntity8PrecacheEv", mfunc_ptr_cast(&CBaseEntity::Precache) }, ////{ 0x0, "_ZN11CBaseEntity7RestartEv", mfunc_ptr_cast(&CBaseEntity::Restart) }, - ////{ 0x0, "_ZN11CBaseEntity8KeyValueEP14KeyValueData_s", mfunc_ptr_cast(&CBaseEntity::KeyValue_) }, - //sub_1D185B0 - - + ////{ 0x01D185B0, "_ZN11CBaseEntity8KeyValueEP14KeyValueData_s", mfunc_ptr_cast(&CBaseEntity::KeyValue_) }, //{ 0x01D635D0, "_ZN11CBaseEntity4SaveER5CSave", mfunc_ptr_cast(&CBaseEntity::Save_) }, //{ 0x01D63610, "_ZN11CBaseEntity7RestoreER8CRestore", mfunc_ptr_cast(&CBaseEntity::Restore_) }, ////{ 0x0, "_ZN11CBaseEntity10ObjectCapsEv", mfunc_ptr_cast(&CBaseEntity::ObjectCaps) }, @@ -392,10 +389,10 @@ FunctionHook g_FunctionHooks[] = ////{ 0x0, "_ZN11CBaseEntity8ClassifyEv", mfunc_ptr_cast(&CBaseEntity::Classify) }, ////{ 0x0, "_ZN11CBaseEntity11DeathNoticeEP9entvars_s", mfunc_ptr_cast(&CBaseEntity::DeathNotice) }, //{ 0x01D719D0, "_ZN11CBaseEntity11TraceAttackEP9entvars_sf6VectorP11TraceResulti", mfunc_ptr_cast(&CBaseEntity::TraceAttack_) }, - //{ 0x0, "_ZN11CBaseEntity10TakeDamageEP9entvars_sS1_fi", mfunc_ptr_cast(&CBaseEntity::TakeDamage_) }, + //{ 0x01D63210, "_ZN11CBaseEntity10TakeDamageEP9entvars_sS1_fi", mfunc_ptr_cast(&CBaseEntity::TakeDamage_) }, { 0x01D63190, "_ZN11CBaseEntity10TakeHealthEfi", mfunc_ptr_cast(&CBaseEntity::TakeHealth_) }, //{ 0x0, "_ZN11CBaseEntity6KilledEP9entvars_si", mfunc_ptr_cast(&CBaseEntity::Killed_) }, - ////{ 0x0, "_ZN11CBaseEntity10BloodColorEv", mfunc_ptr_cast(&CBaseEntity::BloodColor) }, + //{ 0x01D01BE0, "_ZN11CBaseEntity10BloodColorEv", mfunc_ptr_cast(&CBaseEntity::BloodColor) }, { 0x01D72EE0, "_ZN11CBaseEntity10TraceBleedEf6VectorP11TraceResulti", mfunc_ptr_cast(&CBaseEntity::TraceBleed_) }, ////{ 0x0, "_ZN11CBaseEntity11IsTriggeredEPS_", mfunc_ptr_cast(&CBaseEntity::IsTriggered) }, ////{ 0x0, "_ZN11CBaseEntity16MyMonsterPointerEv", mfunc_ptr_cast(&CBaseEntity::MyMonsterPointer) }, @@ -435,15 +432,16 @@ FunctionHook g_FunctionHooks[] = ////{ 0x0, "_ZN11CBaseEntity11EyePositionEv", mfunc_ptr_cast(&CBaseEntity::EyePosition) }, ////{ 0x0, "_ZN11CBaseEntity11EarPositionEv", mfunc_ptr_cast(&CBaseEntity::EarPosition) }, ////{ 0x0, "_ZN11CBaseEntity10BodyTargetERK6Vector", mfunc_ptr_cast(&CBaseEntity::BodyTarget) }, - ////{ 0x0, "_ZN11CBaseEntity12IlluminationEv", mfunc_ptr_cast(&CBaseEntity::Illumination) }, + ////{ 0x01D01FC0, "_ZN11CBaseEntity12IlluminationEv", mfunc_ptr_cast(&CBaseEntity::Illumination) }, //{ 0x01D71840, "_ZN11CBaseEntity8FVisibleEPS_", mfunc_ptr_cast(&CBaseEntity::FVisible_) }, //{ 0x01D71950, "_ZN11CBaseEntity8FVisibleERK6Vector", mfunc_ptr_cast(&CBaseEntity::FVisible_) }, //non-virtual func + //{ 0x01DA7FD0, "", mfunc_ptr_cast(&CBaseEntity::Instance) }, { 0x01DBAF90, "_ZN11CBaseEntity14UpdateOnRemoveEv", mfunc_ptr_cast(&CBaseEntity::UpdateOnRemove) }, { 0x01DBAFF0, "_ZN11CBaseEntity10SUB_RemoveEv", mfunc_ptr_cast(&CBaseEntity::SUB_Remove) }, { 0x01DBB0A0, "_ZN11CBaseEntity13SUB_DoNothingEv", mfunc_ptr_cast(&CBaseEntity::SUB_DoNothing) }, - //{ 0x01D6FB10, "_ZN11CBaseEntity16SUB_StartFadeOutEv", mfunc_ptr_cast(&CBaseEntity::SUB_StartFadeOut) }, - //{ 0x01D6FB80, "_ZN11CBaseEntity11SUB_FadeOutEv", mfunc_ptr_cast(&CBaseEntity::SUB_FadeOut) }, + { 0x01D6FB10, "_ZN11CBaseEntity16SUB_StartFadeOutEv", mfunc_ptr_cast(&CBaseEntity::SUB_StartFadeOut) }, + { 0x01D6FB80, "_ZN11CBaseEntity11SUB_FadeOutEv", mfunc_ptr_cast(&CBaseEntity::SUB_FadeOut) }, //{ 0x0, "_ZN11CBaseEntity17SUB_CallUseToggleEv", mfunc_ptr_cast(&CBaseEntity::SUB_CallUseToggle) }, { 0x01D63AC0, "_ZN11CBaseEntity12ShouldToggleE8USE_TYPEi", mfunc_ptr_cast(&CBaseEntity::ShouldToggle) }, //{ 0x01D71BC0, "_ZN11CBaseEntity11FireBulletsEj6VectorS0_S0_fiiiP9entvars_s", mfunc_ptr_cast(&CBaseEntity::FireBullets) }, @@ -455,10 +453,6 @@ FunctionHook g_FunctionHooks[] = { 0x01D639B0, "_ZN11CBaseEntity9IsDormantEv", mfunc_ptr_cast(&CBaseEntity::IsDormant) }, //{ 0x0, "_ZN11CBaseEntity16IsLockedByMasterEv", mfunc_ptr_cast(&CBaseEntity::IsLockedByMaster) }, // NOXREF { 0x01D63B20, "_ZN11CBaseEntity6CreateEPcRK6VectorS3_P7edict_s", mfunc_ptr_cast(&CBaseEntity::Create) }, - - - - //CPointEntity //{ 0x01DBACC0, "_ZN12CPointEntity5SpawnEv", mfunc_ptr_cast(&CPointEntity::Spawn) }, //{ 0x0, "_ZN12CPointEntity10ObjectCapsEv", mfunc_ptr_cast(&CPointEntity::ObjectCaps) }, @@ -616,10 +610,10 @@ FunctionHook g_FunctionHooks[] = { 0x01D21030, "_ZN11CBasePlayer7IsAliveEv", mfunc_ptr_cast(&CBasePlayer::IsAlive_) }, //{ 0x0, "_ZN11CBasePlayer8IsPlayerEv", mfunc_ptr_cast(&CBasePlayer::IsPlayer_) }, //{ 0x0, "_ZN11CBasePlayer11IsNetClientEv", mfunc_ptr_cast(&CBasePlayer::IsNetClient_) }, - //{ 0x01DA6950, "_ZN11CBasePlayer6TeamIDEv", mfunc_ptr_cast(&CBasePlayer::TeamID_) }, - //{ 0x01DA9BF0, "_ZN11CBasePlayer12FBecomeProneEv", mfunc_ptr_cast(&CBasePlayer::FBecomeProne_) }, + { 0x01DA6950, "_ZN11CBasePlayer6TeamIDEv", mfunc_ptr_cast(&CBasePlayer::TeamID_) }, + { 0x01DA9BF0, "_ZN11CBasePlayer12FBecomeProneEv", mfunc_ptr_cast(&CBasePlayer::FBecomeProne_) }, //{ 0x01D20F60, "_ZN11CBasePlayer10BodyTargetERK6Vector", mfunc_ptr_cast(&CBasePlayer::BodyTarget_) }, - //{ 0x0, "_ZN11CBasePlayer12IlluminationEv", mfunc_ptr_cast(&CBasePlayer::Illumination_) }, + { 0x01DA9C50, "_ZN11CBasePlayer12IlluminationEv", mfunc_ptr_cast(&CBasePlayer::Illumination_) }, //{ 0x01D21060, "_ZN11CBasePlayer17ShouldFadeOnDeathEv", mfunc_ptr_cast(&CBasePlayer::ShouldFadeOnDeath_) }, { 0x01DA9CB0, "_ZN11CBasePlayer13ResetMaxSpeedEv", mfunc_ptr_cast(&CBasePlayer::ResetMaxSpeed_) }, //{ 0x0, "_ZN11CBasePlayer4JumpEv", mfunc_ptr_cast(&CBasePlayer::Jump_) }, @@ -629,10 +623,10 @@ FunctionHook g_FunctionHooks[] = { 0x01D9BD80, "_ZN11CBasePlayer14GetGunPositionEv", mfunc_ptr_cast(&CBasePlayer::GetGunPosition_) }, //{ 0x0, "_ZN11CBasePlayer5IsBotEv", mfunc_ptr_cast(&CBasePlayer::IsBot_) }, //{ 0x01DA8F90, "_ZN11CBasePlayer16UpdateClientDataEv", mfunc_ptr_cast(&CBasePlayer::UpdateClientData_) }, - //{ 0x0, "_ZN11CBasePlayer15ImpulseCommandsEv", mfunc_ptr_cast(&CBasePlayer::ImpulseCommands_) }, + //{ 0x01DA7020, "_ZN11CBasePlayer15ImpulseCommandsEv", mfunc_ptr_cast(&CBasePlayer::ImpulseCommands_) }, // NOXREF { 0x01DA2490, "_ZN11CBasePlayer12RoundRespawnEv", mfunc_ptr_cast(&CBasePlayer::RoundRespawn_) }, { 0x01DA9DC0, "_ZN11CBasePlayer16GetAutoaimVectorEf", mfunc_ptr_cast(&CBasePlayer::GetAutoaimVector_) }, - //{ 0x0, "_ZN11CBasePlayer5BlindEfffi", mfunc_ptr_cast(&CBasePlayer::Blind_) }, + { 0x01DAA220, "_ZN11CBasePlayer5BlindEfffi", mfunc_ptr_cast(&CBasePlayer::Blind_) }, //{ 0x0, "_ZN11CBasePlayer16OnTouchingWeaponEP10CWeaponBox", mfunc_ptr_cast(&CBasePlayer::OnTouchingWeapon_) }, //non-virtual func { 0x01DAC8D0, "_ZN11CBasePlayer21SpawnClientSideCorpseEv", mfunc_ptr_cast(&CBasePlayer::SpawnClientSideCorpse) }, @@ -653,7 +647,7 @@ FunctionHook g_FunctionHooks[] = //{ 0x0, "_ZN11CBasePlayer9DisappearEv", mfunc_ptr_cast(&CBasePlayer::Disappear) }, { 0x01DA15B0, "_ZN11CBasePlayer7MakeVIPEv", mfunc_ptr_cast(&CBasePlayer::MakeVIP) }, //{ 0x0, "_ZN11CBasePlayer12CanPlayerBuyEb", mfunc_ptr_cast(&CBasePlayer::CanPlayerBuy) }, - //{ 0x01DAB070, "_ZN11CBasePlayer10SwitchTeamEv", mfunc_ptr_cast(&CBasePlayer::SwitchTeam) }, + { 0x01DAB070, "_ZN11CBasePlayer10SwitchTeamEv", mfunc_ptr_cast(&CBasePlayer::SwitchTeam) }, { 0x01DAB820, "_ZN11CBasePlayer12TabulateAmmoEv", mfunc_ptr_cast(&CBasePlayer::TabulateAmmo) }, { 0x01D9B9B0, "_ZN11CBasePlayer4PainEib", mfunc_ptr_cast(&CBasePlayer::Pain) }, { 0x01D9F410, "_ZN11CBasePlayer9IsBombGuyEv", mfunc_ptr_cast(&CBasePlayer::IsBombGuy) }, @@ -670,19 +664,23 @@ FunctionHook g_FunctionHooks[] = //{ 0x01D93690, "_Z14GetForceCamerav", (size_t)&GetForceCamera }, // NOXREF { 0x01D93A00, "_ZL19UpdateClientEffectsP11CBasePlayeri", (size_t)&UpdateClientEffects }, // TODO: Reverse me + //{ 0x0, "", (size_t)&OLD_CheckBuyZone }, // NOXREF + //{ 0x0, "", (size_t)&OLD_CheckBombTarget }, // NOXREF + //{ 0x0, "", (size_t)&OLD_CheckRescueZone }, // NOXREF + #ifdef _WIN32 //{ 0x0, "", (size_t)&BuyZoneIcon_Set }, - //{ 0x0, "", (size_t)&BuyZoneIcon_Clear }, + //{ 0x0, "", (size_t)&BuyZoneIcon_Clear }, // NOXREF //{ 0x0, "", (size_t)&BombTargetFlash_Set }, - //{ 0x0, "", (size_t)&BombTargetFlash_Clear }, + //{ 0x0, "", (size_t)&BombTargetFlash_Clear }, // NOXREF //{ 0x0, "", (size_t)&RescueZoneIcon_Set }, - //{ 0x0, "", (size_t)&RescueZoneIcon_Clear }, + //{ 0x0, "", (size_t)&RescueZoneIcon_Clear }, // NOXREF - //#@{ 0x01DA8410, "", (size_t)&EscapeZoneIcon_Set }, - //#@{ 0x01DA84C0, "", (size_t)&EscapeZoneIcon_Clear }, - //#@{ 0x01DA8550, "", (size_t)&VIP_SafetyZoneIcon_Set }, - //#@{ 0x01DA8630, "", (size_t)&VIP_SafetyZoneIcon_Clear }, + { 0x01DA8410, "", (size_t)&EscapeZoneIcon_Set }, + { 0x01DA84C0, "", (size_t)&EscapeZoneIcon_Clear }, + { 0x01DA8550, "", (size_t)&VIP_SafetyZoneIcon_Set }, + { 0x01DA8630, "", (size_t)&VIP_SafetyZoneIcon_Clear }, #endif // _WIN32 @@ -709,28 +707,28 @@ FunctionHook g_FunctionHooks[] = //{ 0x01D9BCA0, "_ZN11CBasePlayer10DeathSoundEv", mfunc_ptr_cast(&CBasePlayer::DeathSound) }, // NOXREF { 0x01D9F430, "_ZN11CBasePlayer12SetAnimationE11PLAYER_ANIM", mfunc_ptr_cast(&CBasePlayer::SetAnimation) }, //{ 0x0, "_ZN11CBasePlayer17SetWeaponAnimTypeEPKc", mfunc_ptr_cast(&CBasePlayer::SetWeaponAnimType) }, - //{ 0x0, "_ZN11CBasePlayer20CheatImpulseCommandsEi", mfunc_ptr_cast(&CBasePlayer::CheatImpulseCommands) }, + { 0x01DA73C0, "_ZN11CBasePlayer20CheatImpulseCommandsEi", mfunc_ptr_cast(&CBasePlayer::CheatImpulseCommands) }, //{ 0x01DA2640, "_ZN11CBasePlayer13StartDeathCamEv", mfunc_ptr_cast(&CBasePlayer::StartDeathCam) }, // NOXREF //{ 0x01DA26D0, "_ZN11CBasePlayer13StartObserverE6VectorS0_", mfunc_ptr_cast(&CBasePlayer::StartObserver) }, - //{ 0x01DA6FD0, "_ZN11CBasePlayer13HandleSignalsEv", mfunc_ptr_cast(&CBasePlayer::HandleSignals) }, + { 0x01DA7FF0, "_ZN11CBasePlayer13HandleSignalsEv", mfunc_ptr_cast(&CBasePlayer::HandleSignals) }, { 0x01DAA850, "_ZN11CBasePlayer14DropPlayerItemEPKc", mfunc_ptr_cast(&CBasePlayer::DropPlayerItem) }, { 0x01DAAF30, "_ZN11CBasePlayer13HasPlayerItemEP15CBasePlayerItem", mfunc_ptr_cast(&CBasePlayer::HasPlayerItem) }, - //{ 0x0, "_ZN11CBasePlayer18HasNamedPlayerItemEPKc", mfunc_ptr_cast(&CBasePlayer::HasNamedPlayerItem) }, + { 0x01DAAFC0, "_ZN11CBasePlayer18HasNamedPlayerItemEPKc", mfunc_ptr_cast(&CBasePlayer::HasNamedPlayerItem) }, //{ 0x01DA6920, "_ZN11CBasePlayer10HasWeaponsEv", mfunc_ptr_cast(&CBasePlayer::HasWeapons) }, // NOXREF - //{ 0x0, "_ZN11CBasePlayer14SelectPrevItemEi", mfunc_ptr_cast(&CBasePlayer::SelectPrevItem) }, + //{ 0x01DA6940, "_ZN11CBasePlayer14SelectPrevItemEi", mfunc_ptr_cast(&CBasePlayer::SelectPrevItem) }, // NOXREF //{ 0x01DA6470, "_ZN11CBasePlayer14SelectNextItemEi", mfunc_ptr_cast(&CBasePlayer::SelectNextItem) }, // NOXREF //{ 0x01DA65E0, "_ZN11CBasePlayer10SelectItemEPKc", mfunc_ptr_cast(&CBasePlayer::SelectItem) }, { 0x01DA67A0, "_ZN11CBasePlayer14SelectLastItemEv", mfunc_ptr_cast(&CBasePlayer::SelectLastItem) }, //{ 0x01DA8BB0, "_ZN11CBasePlayer12ItemPreFrameEv", mfunc_ptr_cast(&CBasePlayer::ItemPreFrame) }, // NOXREF - //{ 0x0, "_ZN11CBasePlayer13ItemPostFrameEv", mfunc_ptr_cast(&CBasePlayer::ItemPostFrame) }, + //{ 0x01DA8BE0, "_ZN11CBasePlayer13ItemPostFrameEv", mfunc_ptr_cast(&CBasePlayer::ItemPostFrame) }, // NOXREF { 0x01DA6CC0, "_ZN11CBasePlayer13GiveNamedItemEPKc", mfunc_ptr_cast(&CBasePlayer::GiveNamedItem) }, - //{ 0x0, "_ZN11CBasePlayer13EnableControlEi", mfunc_ptr_cast(&CBasePlayer::EnableControl) }, + { 0x01DA9C80, "_ZN11CBasePlayer13EnableControlEi", mfunc_ptr_cast(&CBasePlayer::EnableControl) }, { 0x01DA9D50, "_ZN11CBasePlayer11HintMessageEPKcii", mfunc_ptr_cast(&CBasePlayer::HintMessage) }, - //{ 0x0, "_ZN11CBasePlayer14SendAmmoUpdateEv", mfunc_ptr_cast(&CBasePlayer::SendAmmoUpdate) }, + { 0x01DA8CC0, "_ZN11CBasePlayer14SendAmmoUpdateEv", mfunc_ptr_cast(&CBasePlayer::SendAmmoUpdate) }, //{ 0x01D9E4F0, "_ZN11CBasePlayer7SendFOVEi", mfunc_ptr_cast(&CBasePlayer::SendFOV) }, // NOXREF //{ 0x01DA0390, "_ZN11CBasePlayer9WaterMoveEv", mfunc_ptr_cast(&CBasePlayer::WaterMove) }, //{ 0x01DA2140, "_ZN11CBasePlayer16PlayerDeathThinkEv", mfunc_ptr_cast(&CBasePlayer::PlayerDeathThink) }, - //{ 0x01DA29A0, "_ZN11CBasePlayer9PlayerUseEv", mfunc_ptr_cast(&CBasePlayer::PlayerUse) }, + { 0x01DA29A0, "_ZN11CBasePlayer9PlayerUseEv", mfunc_ptr_cast(&CBasePlayer::PlayerUse) }, //{ 0x0, "_ZN11CBasePlayer11HostageUsedEv", mfunc_ptr_cast(&CBasePlayer::HostageUsed) }, //{ 0x0, "_ZN11CBasePlayer12JoiningThinkEv", mfunc_ptr_cast(&CBasePlayer::JoiningThink) }, //{ 0x01DA1480, "_ZN11CBasePlayer15RemoveLevelTextEv", mfunc_ptr_cast(&CBasePlayer::RemoveLevelText) }, // NOXREF @@ -747,24 +745,24 @@ FunctionHook g_FunctionHooks[] = { 0x01DA8C60, "_ZN11CBasePlayer13AmmoInventoryEi", mfunc_ptr_cast(&CBasePlayer::AmmoInventory) }, //{ 0x01DAA150, "_ZN11CBasePlayer12ResetAutoaimEv", mfunc_ptr_cast(&CBasePlayer::ResetAutoaim) }, // NOXREF //{ 0x01DAA120, "_ZN11CBasePlayer17AutoaimDeflectionER6Vectorff", mfunc_ptr_cast(&CBasePlayer::AutoaimDeflection) }, // NOXREF - //{ 0x0, "_ZN11CBasePlayer20ForceClientDllUpdateEv", mfunc_ptr_cast(&CBasePlayer::ForceClientDllUpdate) }, + //{ 0x01DA6FD0, "_ZN11CBasePlayer20ForceClientDllUpdateEv", mfunc_ptr_cast(&CBasePlayer::ForceClientDllUpdate) }, //{ 0x0, "_ZN11CBasePlayer12DeathMessageEP9entvars_s", mfunc_ptr_cast(&CBasePlayer::DeathMessage) }, { 0x01DAA1E0, "_ZN11CBasePlayer20SetCustomDecalFramesEi", mfunc_ptr_cast(&CBasePlayer::SetCustomDecalFrames) }, - //{ 0x0, "_ZN11CBasePlayer20GetCustomDecalFramesEv", mfunc_ptr_cast(&CBasePlayer::GetCustomDecalFrames) }, - //{ 0x0, "_ZN11CBasePlayer13InitStatusBarEv", mfunc_ptr_cast(&CBasePlayer::InitStatusBar) }, - //{ 0x01DAA270, "_ZN11CBasePlayer15UpdateStatusBarEv", mfunc_ptr_cast(&CBasePlayer::UpdateStatusBar) }, + //{ 0x01DAA210, "_ZN11CBasePlayer20GetCustomDecalFramesEv", mfunc_ptr_cast(&CBasePlayer::GetCustomDecalFrames) }, // NOXREF + //{ 0x01DAA260, "_ZN11CBasePlayer13InitStatusBarEv", mfunc_ptr_cast(&CBasePlayer::InitStatusBar) }, // NOXREF + { 0x01DAA270, "_ZN11CBasePlayer15UpdateStatusBarEv", mfunc_ptr_cast(&CBasePlayer::UpdateStatusBar) }, { 0x01DAC0F0, "_ZN11CBasePlayer18StudioEstimateGaitEv", mfunc_ptr_cast(&CBasePlayer::StudioEstimateGait) }, //{ 0x01DAC400, "_ZN11CBasePlayer17StudioPlayerBlendEPiPf", mfunc_ptr_cast(&CBasePlayer::StudioPlayerBlend) }, // NOXREF //{ 0x01DAC490, "_ZN11CBasePlayer19CalculatePitchBlendEv", mfunc_ptr_cast(&CBasePlayer::CalculatePitchBlend) }, // NOXREF { 0x01DAC510, "_ZN11CBasePlayer17CalculateYawBlendEv", mfunc_ptr_cast(&CBasePlayer::CalculateYawBlend) }, { 0x01DAC640, "_ZN11CBasePlayer17StudioProcessGaitEv", mfunc_ptr_cast(&CBasePlayer::StudioProcessGait) }, - //{ 0x0, "_ZN11CBasePlayer14SendHostagePosEv", mfunc_ptr_cast(&CBasePlayer::SendHostagePos) }, + //{ 0x01DA8D40, "_ZN11CBasePlayer14SendHostagePosEv", mfunc_ptr_cast(&CBasePlayer::SendHostagePos) }, // NOXREF { 0x01DA8DE0, "_ZN11CBasePlayer16SendHostageIconsEv", mfunc_ptr_cast(&CBasePlayer::SendHostageIcons) }, //{ 0x01DAC7C0, "_ZN11CBasePlayer12ResetStaminaEv", mfunc_ptr_cast(&CBasePlayer::ResetStamina) }, // NOXREF //{ 0x01DACA10, "_ZN11CBasePlayer9IsArmoredEi", mfunc_ptr_cast(&CBasePlayer::IsArmored) }, // NOXREF //{ 0x01DACA60, "_ZN11CBasePlayer19ShouldDoLargeFlinchEii", mfunc_ptr_cast(&CBasePlayer::ShouldDoLargeFlinch) }, // NOXREF { 0x01DACAD0, "_ZN11CBasePlayer20SetPrefsFromUserinfoEPc", mfunc_ptr_cast(&CBasePlayer::SetPrefsFromUserinfo) }, - //{ 0x0, "_ZN11CBasePlayer15SendWeatherInfoEv", mfunc_ptr_cast(&CBasePlayer::SendWeatherInfo) }, + { 0x01DA8EE0, "_ZN11CBasePlayer15SendWeatherInfoEv", mfunc_ptr_cast(&CBasePlayer::SendWeatherInfo) }, { 0x01DAB6F0, "_ZN11CBasePlayer21UpdateShieldCrosshairEb", mfunc_ptr_cast(&CBasePlayer::UpdateShieldCrosshair) }, { 0x01DA0DA0, "_ZN11CBasePlayer9HasShieldEv", mfunc_ptr_cast(&CBasePlayer::HasShield) }, //{ 0x0, "_ZN11CBasePlayer19IsProtectedByShieldEv", mfunc_ptr_cast(&CBasePlayer::IsProtectedByShield) }, @@ -780,7 +778,7 @@ FunctionHook g_FunctionHooks[] = //{ 0x01DAD180, "_ZN11CBasePlayer16ClearAutoBuyDataEv", mfunc_ptr_cast(&CBasePlayer::ClearAutoBuyData) }, { 0x01DAD190, "_ZN11CBasePlayer14AddAutoBuyDataEPKc", mfunc_ptr_cast(&CBasePlayer::AddAutoBuyData) }, //{ 0x01DAD280, "_ZN11CBasePlayer7AutoBuyEv", mfunc_ptr_cast(&CBasePlayer::AutoBuy) }, - //{ 0x01DAD0D0, "_ZN11CBasePlayer13ClientCommandEPKcS1_S1_S1_", mfunc_ptr_cast(&CBasePlayer::ClientCommand) }, + { 0x01DAD0D0, "_ZN11CBasePlayer13ClientCommandEPKcS1_S1_S1_", mfunc_ptr_cast(&CBasePlayer::ClientCommand) }, { 0x01DADD00, "_ZN11CBasePlayer23PrioritizeAutoBuyStringEPcPKc", mfunc_ptr_cast(&CBasePlayer::PrioritizeAutoBuyString) }, //{ 0x01DAD590, "_ZN11CBasePlayer27PickPrimaryCareerTaskWeaponEv", mfunc_ptr_cast(&CBasePlayer::PickPrimaryCareerTaskWeapon) }, //{ 0x01DAD930, "_ZN11CBasePlayer29PickSecondaryCareerTaskWeaponEv", mfunc_ptr_cast(&CBasePlayer::PickSecondaryCareerTaskWeapon) }, @@ -818,7 +816,7 @@ FunctionHook g_FunctionHooks[] = { 0x01D9C2B0, "_Z13GetWeaponNameP9entvars_sS0_", (size_t)&GetWeaponName }, { 0x01D9C3C0, "_Z9LogAttackP11CBasePlayerS0_iiiiiPKc", (size_t)&LogAttack }, { 0x01D9D770, "_ZL14packPlayerItemP11CBasePlayerP15CBasePlayerItemb", (size_t)&packPlayerItem }, - //{ 0x0, "_ZL13CanSeeUseableP11CBasePlayerP11CBaseEntity_isra_13", (size_t)&CanSeeUseable }, + { 0x01DA3110, "_ZL13CanSeeUseableP11CBasePlayerP11CBaseEntity_isra_13", (size_t)&CanSeeUseable }, //{ 0x01DA34E0, "_Z20FixPlayerCrouchStuckP7edict_s", (size_t)&FixPlayerCrouchStuck }, //{ 0x01DA4A90, "_Z17IsSpawnPointValidP11CBaseEntityS0_", (size_t)&IsSpawnPointValid }, // NOXREF //{ 0x01DA4B10, "_Z16InitZombieSpawnsv", (size_t)&InitZombieSpawns }, // NOXREF @@ -849,10 +847,10 @@ FunctionHook g_FunctionHooks[] = //CSprayCan //virtual func - //{ 0x0, "_ZN9CSprayCan5ThinkEv", mfunc_ptr_cast(&CSprayCan::Think_) }, - //{ 0x0, "_ZN9CSprayCan10ObjectCapsEv", mfunc_ptr_cast(&CSprayCan::ObjectCaps_) }, + { 0x01DA6A30, "_ZN9CSprayCan5ThinkEv", mfunc_ptr_cast(&CSprayCan::Think_) }, + { 0x01DA73B0, "_ZN9CSprayCan10ObjectCapsEv", mfunc_ptr_cast(&CSprayCan::ObjectCaps_) }, //non-virtual func - //{ 0x0, "_ZN9CSprayCan5SpawnEP9entvars_s", mfunc_ptr_cast(&CSprayCan::Spawn) }, + { 0x01DA6970, "_ZN9CSprayCan5SpawnEP9entvars_s", mfunc_ptr_cast(&CSprayCan::Spawn) }, // NOXREF //CBloodSplat //{ 0x01DA6B70, "_ZN11CBloodSplat5SpawnEP9entvars_s", mfunc_ptr_cast(&CBloodSplat::Spawn) }, // NOXREF //{ 0x01DA6C00, "_ZN11CBloodSplat5SprayEv", mfunc_ptr_cast(&CBloodSplat::Spray) }, // NOXREF @@ -1272,18 +1270,18 @@ FunctionHook g_FunctionHooks[] = //CFuncVehicle //virtual func - //{ 0x0, "_ZN12CFuncVehicle5SpawnEv", mfunc_ptr_cast(&CFuncVehicle::Spawn) }, - //{ 0x0, "_ZN12CFuncVehicle8PrecacheEv", mfunc_ptr_cast(&CFuncVehicle::Precache) }, - //{ 0x0, "_ZN12CFuncVehicle7RestartEv", mfunc_ptr_cast(&CFuncVehicle::Restart) }, - //{ 0x0, "_ZN12CFuncVehicle8KeyValueEP14KeyValueData_s", mfunc_ptr_cast(&CFuncVehicle::KeyValue) }, - //{ 0x0, "_ZN12CFuncVehicle4SaveER5CSave", mfunc_ptr_cast(&CFuncVehicle::Save) }, - //{ 0x0, "_ZN12CFuncVehicle7RestoreER8CRestore", mfunc_ptr_cast(&CFuncVehicle::Restore) }, - //{ 0x0, "_ZN12CFuncVehicle10ObjectCapsEv", mfunc_ptr_cast(&CFuncVehicle::ObjectCaps) }, - //{ 0x0, "_ZN12CFuncVehicle8ClassifyEv", mfunc_ptr_cast(&CFuncVehicle::Classify) }, - //{ 0x0, "_ZN12CFuncVehicle13OverrideResetEv", mfunc_ptr_cast(&CFuncVehicle::OverrideReset) }, - //{ 0x0, "_ZN12CFuncVehicle10OnControlsEP9entvars_s", mfunc_ptr_cast(&CFuncVehicle::OnControls) }, - //{ 0x0, "_ZN12CFuncVehicle3UseEP11CBaseEntityS1_8USE_TYPEf", mfunc_ptr_cast(&CFuncVehicle::Use) }, - //{ 0x0, "_ZN12CFuncVehicle7BlockedEP11CBaseEntity", mfunc_ptr_cast(&CFuncVehicle::Blocked) }, + //{ 0x0, "_ZN12CFuncVehicle5SpawnEv", mfunc_ptr_cast(&CFuncVehicle::Spawn_) }, + { 0x01DCC310, "_ZN12CFuncVehicle8PrecacheEv", mfunc_ptr_cast(&CFuncVehicle::Precache_) }, + //{ 0x0, "_ZN12CFuncVehicle7RestartEv", mfunc_ptr_cast(&CFuncVehicle::Restart_) }, + //{ 0x0, "_ZN12CFuncVehicle8KeyValueEP14KeyValueData_s", mfunc_ptr_cast(&CFuncVehicle::KeyValue_) }, + //{ 0x0, "_ZN12CFuncVehicle4SaveER5CSave", mfunc_ptr_cast(&CFuncVehicle::Save_) }, + //{ 0x0, "_ZN12CFuncVehicle7RestoreER8CRestore", mfunc_ptr_cast(&CFuncVehicle::Restore_) }, + //{ 0x0, "_ZN12CFuncVehicle10ObjectCapsEv", mfunc_ptr_cast(&CFuncVehicle::ObjectCaps_) }, + { 0x01DCBFB0, "_ZN12CFuncVehicle8ClassifyEv", mfunc_ptr_cast(&CFuncVehicle::Classify_) }, + //{ 0x0, "_ZN12CFuncVehicle13OverrideResetEv", mfunc_ptr_cast(&CFuncVehicle::OverrideReset_) }, + { 0x01DCBA30, "_ZN12CFuncVehicle10OnControlsEP9entvars_s", mfunc_ptr_cast(&CFuncVehicle::OnControls_) }, + //{ 0x0, "_ZN12CFuncVehicle3UseEP11CBaseEntityS1_8USE_TYPEf", mfunc_ptr_cast(&CFuncVehicle::Use_) }, + //{ 0x0, "_ZN12CFuncVehicle7BlockedEP11CBaseEntity", mfunc_ptr_cast(&CFuncVehicle::Blocked_) }, //non-virtual func //{ 0x0, "_ZN12CFuncVehicle4NextEv", mfunc_ptr_cast(&CFuncVehicle::Next) }, //{ 0x0, "_ZN12CFuncVehicle4FindEv", mfunc_ptr_cast(&CFuncVehicle::Find) }, @@ -1293,11 +1291,11 @@ FunctionHook g_FunctionHooks[] = //{ 0x0, "_ZN12CFuncVehicle18CollisionDetectionEv", mfunc_ptr_cast(&CFuncVehicle::CollisionDetection) }, //{ 0x0, "_ZN12CFuncVehicle16TerrainFollowingEv", mfunc_ptr_cast(&CFuncVehicle::TerrainFollowing) }, //{ 0x0, "_ZN12CFuncVehicle12CheckTurningEv", mfunc_ptr_cast(&CFuncVehicle::CheckTurning) }, - //{ 0x0, "_ZN12CFuncVehicle8SetTrackEP10CPathTrack", mfunc_ptr_cast(&CFuncVehicle::SetTrack) },// NOXREF - //{ 0x0, "_ZN12CFuncVehicle11SetControlsEP9entvars_s", mfunc_ptr_cast(&CFuncVehicle::SetControls) }, + //{ 0x0, "_ZN12CFuncVehicle8SetTrackEP10CPathTrack", mfunc_ptr_cast(&CFuncVehicle::SetTrack) }, // NOXREF + //{ 0x01DCB980, "_ZN12CFuncVehicle11SetControlsEP9entvars_s", mfunc_ptr_cast(&CFuncVehicle::SetControls) }, // NOXREF //{ 0x0, "_ZN12CFuncVehicle9StopSoundEv", mfunc_ptr_cast(&CFuncVehicle::StopSound) }, //{ 0x0, "_ZN12CFuncVehicle11UpdateSoundEv", mfunc_ptr_cast(&CFuncVehicle::UpdateSound) }, - //{ 0x0, "_ZN12CFuncVehicle8InstanceEP7edict_s", mfunc_ptr_cast(&CFuncVehicle::Instance) }, + //{ 0x01DCBF60, "_ZN12CFuncVehicle8InstanceEP7edict_s", mfunc_ptr_cast(&CFuncVehicle::Instance) }, // NOXREF //{ 0x0, "", (size_t)&FixupAngles2 }, // NOXREF //CFuncVehicleControls //virtual func @@ -1396,8 +1394,8 @@ FunctionHook g_FunctionHooks[] = //{ 0x0, "_ZN10CBreakable18ExplosionMagnitudeEv", mfunc_ptr_cast(&CBreakable::ExplosionMagnitude) }, // NOXREF //{ 0x0, "_ZN10CBreakable21ExplosionSetMagnitudeEi", mfunc_ptr_cast(&CBreakable::ExplosionSetMagnitude) }, // NOXREF //{ 0x0, "_ZN10CBreakable21MaterialSoundPrecacheE9Materials", mfunc_ptr_cast(&CBreakable::MaterialSoundPrecache) }, - //{ 0x01D7C710, "_ZN10CBreakable19MaterialSoundRandomEP7edict_s9Materialsf", mfunc_ptr_cast(&CBreakable::MaterialSoundRandom) }, - //{ 0x0, "_ZN10CBreakable17MaterialSoundListE9MaterialsRi", mfunc_ptr_cast(&CBreakable::MaterialSoundList) }, + { 0x01D7C710, "_ZN10CBreakable19MaterialSoundRandomEP7edict_s9Materialsf", mfunc_ptr_cast(&CBreakable::MaterialSoundRandom) }, + //{ 0x01D7C5D0, "_ZN10CBreakable17MaterialSoundListE9MaterialsRi", mfunc_ptr_cast(&CBreakable::MaterialSoundList) }, // NOXREF //CPushable //virtual func //{ 0x0, "_ZN9CPushable5SpawnEv", mfunc_ptr_cast(&CPushable::Spawn_) }, @@ -1515,6 +1513,8 @@ FunctionHook g_FunctionHooks[] = //{ 0x0, "_ZN9CPendulum4StopEv", mfunc_ptr_cast(&CPendulum::Stop) }, //{ 0x0, "_ZN9CPendulum9RopeTouchEP11CBaseEntity", mfunc_ptr_cast(&CPendulum::RopeTouch) }, + { 0x01D5CF20, "_Z15VecBModelOriginP9entvars_s", (size_t)&VecBModelOrigin }, + #endif // BModels_Region #ifndef Button_Region @@ -2146,7 +2146,7 @@ FunctionHook g_FunctionHooks[] = //{ 0x0, "_ZN12CGlobalState5ResetEv", mfunc_ptr_cast(&CGlobalState::Reset) }, { 0x01DD17A0, "_ZN12CGlobalState4FindEj", mfunc_ptr_cast(&CGlobalState::Find) }, - //{ 0x0, "_ZN12CGlobalState11DumpGlobalsEv", mfunc_ptr_cast(&CGlobalState::DumpGlobals) }, + { 0x01DD1810, "_ZN12CGlobalState11DumpGlobalsEv", mfunc_ptr_cast(&CGlobalState::DumpGlobals) }, //{ 0x01DD1860, "_ZN12CGlobalState9EntityAddEjj12GLOBALESTATE", mfunc_ptr_cast(&CGlobalState::EntityAdd) }, { 0x01DD18D0, "_ZN12CGlobalState14EntitySetStateEj12GLOBALESTATE", mfunc_ptr_cast(&CGlobalState::EntitySetState) }, //{ 0x01DD1950, "_ZN12CGlobalState15EntityFromTableEj", mfunc_ptr_cast(&CGlobalState::EntityFromTable) }, @@ -2173,9 +2173,9 @@ FunctionHook g_FunctionHooks[] = //{ 0x0, "_ZN6CGraph12CheckNODFileEPc", mfunc_ptr_cast(&CGraph::CheckNODFile) }, //{ 0x0, "_ZN6CGraph10FLoadGraphEPc", mfunc_ptr_cast(&CGraph::FLoadGraph) }, //{ 0x01D8ABB0, "_ZN6CGraph17FSetGraphPointersEv", mfunc_ptr_cast(&CGraph::FSetGraphPointers) }, - //{ 0x0, "_ZN6CGraph19ShowNodeConnectionsEi", mfunc_ptr_cast(&CGraph::ShowNodeConnections) }, - //{ 0x0, "_ZN6CGraph15FindNearestNodeERK6VectorP11CBaseEntity", mfunc_ptr_cast(&CGraph::FindNearestNode) }, - //{ 0x0, "_ZN6CGraph15FindNearestNodeERK6Vectori", mfunc_ptr_cast(&CGraph::FindNearestNode) }, + //{ 0x01D8ABC0, "_ZN6CGraph19ShowNodeConnectionsEi", mfunc_ptr_cast(&CGraph::ShowNodeConnections) }, // NOXREF + //{ 0x01D8ABE0, "_ZN6CGraph15FindNearestNodeERK6VectorP11CBaseEntity", mfunc_ptr_cast(&CGraph::FindNearestNode) }, // NOXREF + //{ 0x01D8ABD0, "_ZN6CGraph15FindNearestNodeERK6Vectori", mfunc_ptr_cast(&CGraph::FindNearestNode) }, // PURE #endif // Graph_Region @@ -2195,7 +2195,7 @@ FunctionHook g_FunctionHooks[] = //{ 0x0, "_ZN9CSoundEnt5ThinkEv", mfunc_ptr_cast(&CSoundEnt::Think_) }, //non-virtual func //{ 0x0, "_ZN9CSoundEnt10InitializeEv", mfunc_ptr_cast(&CSoundEnt::Initialize) }, - //{ 0x0, "_ZN9CSoundEnt11InsertSoundEiRK6Vectorif", mfunc_ptr_cast(&CSoundEnt::InsertSound) }, + { 0x01DBA820, "_ZN9CSoundEnt11InsertSoundEiRK6Vectorif", mfunc_ptr_cast(&CSoundEnt::InsertSound) }, //{ 0x0, "_ZN9CSoundEnt9FreeSoundEii", mfunc_ptr_cast(&CSoundEnt::FreeSound) }, //{ 0x0, "_ZN9CSoundEnt10ActiveListEv", mfunc_ptr_cast(&CSoundEnt::ActiveList) }, //{ 0x0, "_ZN9CSoundEnt8FreeListEv", mfunc_ptr_cast(&CSoundEnt::FreeList) }, @@ -2203,7 +2203,7 @@ FunctionHook g_FunctionHooks[] = //{ 0x0, "_ZN9CSoundEnt16ClientSoundIndexEP7edict_s", mfunc_ptr_cast(&CSoundEnt::ClientSoundIndex) }, //{ 0x0, "_ZN9CSoundEnt7IsEmptyEv", mfunc_ptr_cast(&CSoundEnt::IsEmpty) }, // NOXREF //{ 0x0, "_ZN9CSoundEnt13ISoundsInListEi", mfunc_ptr_cast(&CSoundEnt::ISoundsInList) }, - //{ 0x0, "_ZN9CSoundEnt11IAllocSoundEv", mfunc_ptr_cast(&CSoundEnt::IAllocSound) }, + //{ 0x01DBA7D0, "_ZN9CSoundEnt11IAllocSoundEv", mfunc_ptr_cast(&CSoundEnt::IAllocSound) }, // NOXREF #endif // SoundEnt_Region @@ -4630,6 +4630,9 @@ FunctionHook g_FunctionHooks[] = #ifndef Vector_Region { 0x01D71160, "_ZN8Vector2D16NormalizeInPlaceEv", mfunc_ptr_cast(&Vector2D::NormalizeInPlace) }, +#ifdef _WIN32 + { 0x01D12570, "", mfunc_ptr_cast(&Vector::Length) }, +#endif // _WIN32 #endif // Vector_Region @@ -5172,6 +5175,8 @@ AddressRef g_FunctionRefs[] = { 0x01D68840, "_Z13ClientCommandP7edict_s", (size_t)&pClientCommand }, + { 0x01D6EEB0, "_ZN4CGib15SpawnRandomGibsEP9entvars_sii", (size_t)&pCGib__SpawnRandomGibs }, + #endif // Function_References_Region { NULL, NULL, NULL } }; @@ -5257,7 +5262,7 @@ AddressRef g_DataRefs[] = { 0x01E75D00, "g_groupop", (size_t)&pg_groupop }, { 0x01E21EF8, "gSizes", (size_t)&pgSizes }, - //{ 0x0, "pSoundEnt", (size_t)&ppSoundEnt }, + { 0x01E75490, "pSoundEnt", (size_t)&ppSoundEnt }, { 0x01E75CF8, "glSeed", (size_t)&pglSeed }, { 0x01E21598, "seed_table", (size_t)&pseed_table }, { 0x01E21998, "gEntvarsDescription", (size_t)&pgEntvarsDescription }, @@ -5285,9 +5290,9 @@ AddressRef g_DataRefs[] = //{ 0x0, "gmsgDamage", (size_t)&pgmsgDamage }, //{ 0x0, "gmsgBattery", (size_t)&pgmsgBattery }, //{ 0x0, "gmsgTrain", (size_t)&pgmsgTrain }, - //{ 0x0, "gmsgLogo", (size_t)&pgmsgLogo }, + { 0x01E635D4, "gmsgLogo", (size_t)&pgmsgLogo }, { 0x01E635D8, "gmsgWeaponList", (size_t)&pgmsgWeaponList }, - //{ 0x01E635DC, "gmsgAmmoX", (size_t)&pgmsgAmmoX }, + { 0x01E635DC, "gmsgAmmoX", (size_t)&pgmsgAmmoX }, //{ 0x0, "gmsgDeathMsg", (size_t)&pgmsgDeathMsg }, { 0x01E635EC, "gmsgScoreAttrib", (size_t)&pgmsgScoreAttrib }, { 0x01E635F0, "gmsgScoreInfo", (size_t)&pgmsgScoreInfo }, @@ -5308,8 +5313,8 @@ AddressRef g_DataRefs[] = { 0x01E63630, "gmsgMoney", (size_t)&pgmsgMoney }, { 0x01E63634, "gmsgBlinkAcct", (size_t)&pgmsgBlinkAcct }, { 0x01E63638, "gmsgArmorType", (size_t)&pgmsgArmorType }, - //{ 0x0, "gmsgStatusValue", (size_t)&pgmsgStatusValue }, - //{ 0x0, "gmsgStatusText", (size_t)&pgmsgStatusText }, + { 0x01E6363C, "gmsgStatusValue", (size_t)&pgmsgStatusValue }, + { 0x01E63640, "gmsgStatusText", (size_t)&pgmsgStatusText }, { 0x01E63644, "gmsgStatusIcon", (size_t)&pgmsgStatusIcon }, { 0x01E63648, "gmsgBarTime", (size_t)&pgmsgBarTime }, { 0x01E6364C, "gmsgReloadSound", (size_t)&pgmsgReloadSound }, @@ -5329,7 +5334,7 @@ AddressRef g_DataRefs[] = //{ 0x0, "gmsgAllowSpec", (size_t)&pgmsgAllowSpec }, { 0x01E63688, "gmsgBombDrop", (size_t)&pgmsgBombDrop }, //{ 0x0, "gmsgBombPickup", (size_t)&pgmsgBombPickup }, - //{ 0x0, "gmsgHostagePos", (size_t)&pgmsgHostagePos }, + { 0x01E63690, "gmsgHostagePos", (size_t)&pgmsgHostagePos }, //{ 0x0, "gmsgHostageK", (size_t)&pgmsgHostageK }, { 0x01E63698, "gmsgGeigerRange", (size_t)&pgmsgGeigerRange }, { 0x01E6369C, "gmsgSendCorpse", (size_t)&pgmsgSendCorpse }, @@ -5337,7 +5342,7 @@ AddressRef g_DataRefs[] = //{ 0x0, "gmsgSpecHealth", (size_t)&pgmsgSpecHealth }, //{ 0x0, "gmsgForceCam", (size_t)&pgmsgForceCam }, //{ 0x0, "gmsgADStop", (size_t)&pgmsgADStop }, - //{ 0x0, "gmsgReceiveW", (size_t)&pgmsgReceiveW }, + { 0x01E636B0, "gmsgReceiveW", (size_t)&pgmsgReceiveW }, { 0x01E636B4, "gmsgScenarioIcon", (size_t)&pgmsgScenarioIcon }, { 0x01E636B8, "gmsgBotVoice", (size_t)&pgmsgBotVoice }, { 0x01E636BC, "gmsgBuyClose", (size_t)&pgmsgBuyClose }, diff --git a/regamedll/hookers/memory.cpp b/regamedll/hookers/memory.cpp index 7bd2dab7..aeb16390 100644 --- a/regamedll/hookers/memory.cpp +++ b/regamedll/hookers/memory.cpp @@ -726,7 +726,7 @@ bool HIDDEN HookFunction(Module *module, FunctionHook *hook) patch[0] = 0xE9; #if 1 - if(strcmp(hook->symbolName,"_ZN11CBasePlayer18StudioEstimateGaitEv")==0) + if(strcmp(hook->symbolName,"_ZN11CBasePlayer10SwitchTeamEv")==0) { addr_orig = (void *)hook->originalAddress; diff --git a/regamedll/unittests/struct_offsets_tests.cpp b/regamedll/unittests/struct_offsets_tests.cpp index 8a1aaf1b..b86e85d1 100644 --- a/regamedll/unittests/struct_offsets_tests.cpp +++ b/regamedll/unittests/struct_offsets_tests.cpp @@ -49,6 +49,7 @@ TEST(StructOffsets, ReversingChecks, 5000) REPEAT_SIZEOF_PRINT(CHalfLifeMultiplay); REPEAT_SIZEOF_PRINT(CHalfLifeTraining); REPEAT_SIZEOF_PRINT(CGib); + REPEAT_SIZEOF_PRINT(CSprayCan); // offset the members REPEAT_OFFSETOF_PRINT(CBaseEntity, pev); @@ -64,6 +65,7 @@ TEST(StructOffsets, ReversingChecks, 5000) CHECK_CLASS_SIZE(CHalfLifeMultiplay, 0x2D0u, 0x2C4u); CHECK_CLASS_SIZE(CHalfLifeTraining, 0x2E8u, 0x2D8u); CHECK_CLASS_SIZE(CGib, 0x98, 0xA8); + CHECK_CLASS_SIZE(CSprayCan, 0x88, 0x98); //CHECK_CLASS_SIZE(CBotManager, 12u, 12); //CHECK_CLASS_SIZE(CCSBotManager, 740, 0x2E0u);//0x2E4u | 0x2E0u