WIP: full of reversed basic part

This commit is contained in:
s1lentq 2015-09-17 02:19:21 +06:00
parent d4cf69b587
commit 625ef14d46
161 changed files with 31662 additions and 20525 deletions

View File

@ -209,8 +209,8 @@ class RegamedllSrc {
srcDirs "hookers"
include "**/*.cpp"
exclude "6153_hooker.cpp", "hooker.cpp", "main.cpp", "main_mp.cpp"
if (!GradleCppUtils.windows)
exclude "regamedll_debug.cpp"
// if (!GradleCppUtils.windows)
// exclude "regamedll_debug.cpp"
}
}
}
@ -289,7 +289,7 @@ model {
components {
regamedll_hooker_gamedll(NativeLibrarySpec) {
targetPlatform 'x86'
baseName 'FileSystem_Stdio'
baseName 'filesystem_stdio'
sources {
RegamedllSrc.regamedll_pch(it)
@ -337,7 +337,7 @@ model {
task buildRelease {
dependsOn binaries.withType(SharedLibraryBinarySpec).matching { SharedLibraryBinarySpec blib ->
blib.buildable && (blib.buildType.name == 'release'/* || blib.buildType.name == 'debug'*/) && !blib.name.contains('RegamedllFixes')
blib.buildable && (/*blib.buildType.name == 'release' || */blib.buildType.name == 'debug') && !blib.name.contains('RegamedllFixes')
}
}

View File

@ -67,23 +67,15 @@ typedef union DLONG_u
#define M_PI 3.14159265358979323846
//#ifndef max
//#define max(a,b) (((a) > (b)) ? (a) : (b))
//#endif
//
//#ifndef min
//#define min(a,b) (((a) < (b)) ? (a) : (b))
//#endif
#define clamp(val, x, y) (((val) > (y)) ? (y) : (((val) < (x)) ? (x) : (val)))
#ifndef _max
#define _max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef Q_max
#define Q_max(a,b) ((a) > (b) ? (a) : (b)) // std::max(a, b)
#endif // Q_max
#ifndef _min
#define _min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#define clamp(val, min, max) (((val) > (max)) ? (max) : (((val) < (min)) ? (min) : (val)))
#ifndef Q_min
#define Q_min(a,b) ((a) < (b) ? (a) : (b)) // std::min(a, b)
#endif // Q_min
#define VectorSubtract(a,b,c) {(c)[0]=(a)[0]-(b)[0];(c)[1]=(a)[1]-(b)[1];(c)[2]=(a)[2]-(b)[2];}
#define VectorAdd(a,b,c) {(c)[0]=(a)[0]+(b)[0];(c)[1]=(a)[1]+(b)[1];(c)[2]=(a)[2]+(b)[2];}

View File

@ -1,13 +1,34 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
/*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*
*/
#if !defined( R_STUDIOINT_H )
#ifndef R_STUDIOINT_H
#define R_STUDIOINT_H
#if defined( _WIN32 )
#ifdef _WIN32
#pragma once
#endif
@ -16,116 +37,148 @@
typedef struct engine_studio_api_s
{
// Allocate number*size bytes and zero it
void *( *Mem_Calloc ) ( int number, size_t size );
void *(*Mem_Calloc)(int number, size_t size);
// Check to see if pointer is in the cache
void *( *Cache_Check ) ( struct cache_user_s *c );
// Load file into cache ( can be swapped out on demand )
void ( *LoadCacheFile ) ( char *path, struct cache_user_s *cu );
void *(*Cache_Check)(struct cache_user_s *c);
// Load file into cache (can be swapped out on demand)
void (*LoadCacheFile)(char *path, struct cache_user_s *cu);
// Retrieve model pointer for the named model
struct model_s *( *Mod_ForName ) ( const char *name, int crash_if_missing );
struct model_s *(*Mod_ForName)(const char *name, int crash_if_missing);
// Retrieve pointer to studio model data block from a model
void *( *Mod_Extradata ) ( struct model_s *mod );
void *(*Mod_Extradata)(struct model_s *mod);
// Retrieve indexed model from client side model precache list
struct model_s *( *GetModelByIndex ) ( int index );
struct model_s *(*GetModelByIndex)(int index);
// Get entity that is set for rendering
struct cl_entity_s * ( *GetCurrentEntity ) ( void );
struct cl_entity_s * (*GetCurrentEntity)(void);
// Get referenced player_info_t
struct player_info_s *( *PlayerInfo ) ( int index );
struct player_info_s *(*PlayerInfo)(int index);
// Get most recently received player state data from network system
struct entity_state_s *( *GetPlayerState ) ( int index );
struct entity_state_s *(*GetPlayerState)(int index);
// Get viewentity
struct cl_entity_s * ( *GetViewEntity ) ( void );
struct cl_entity_s * (*GetViewEntity)(void);
// Get current frame count, and last two timestampes on client
void ( *GetTimes ) ( int *framecount, double *current, double *old );
void (*GetTimes)(int *framecount, double *current, double *old);
// Get a pointer to a cvar by name
struct cvar_s *( *GetCvar ) ( const char *name );
// Get current render origin and view vectors ( up, right and vpn )
void ( *GetViewInfo ) ( float *origin, float *upv, float *rightv, float *vpnv );
struct cvar_s *(*GetCvar)(const char *name);
// Get current render origin and view vectors (up, right and vpn)
void (*GetViewInfo)(float *origin, float *upv, float *rightv, float *vpnv);
// Get sprite model used for applying chrome effect
struct model_s *( *GetChromeSprite ) ( void );
struct model_s *(*GetChromeSprite)(void);
// Get model counters so we can incement instrumentation
void ( *GetModelCounters ) ( int **s, int **a );
void (*GetModelCounters)(int **s, int **a);
// Get software scaling coefficients
void ( *GetAliasScale ) ( float *x, float *y );
void (*GetAliasScale)(float *x, float *y);
// Get bone, light, alias, and rotation matrices
float ****( *StudioGetBoneTransform ) ( void );
float ****( *StudioGetLightTransform )( void );
float ***( *StudioGetAliasTransform ) ( void );
float ***( *StudioGetRotationMatrix ) ( void );
float ****(*StudioGetBoneTransform) (void);
float ****(*StudioGetLightTransform)(void);
float ***(*StudioGetAliasTransform) (void);
float ***(*StudioGetRotationMatrix) (void);
// Set up body part, and get submodel pointers
void ( *StudioSetupModel ) ( int bodypart, void **ppbodypart, void **ppsubmodel );
void (*StudioSetupModel)(int bodypart, void **ppbodypart, void **ppsubmodel);
// Check if entity's bbox is in the view frustum
int ( *StudioCheckBBox ) ( void );
int (*StudioCheckBBox)(void);
// Apply lighting effects to model
void ( *StudioDynamicLight ) ( struct cl_entity_s *ent, struct alight_s *plight );
void ( *StudioEntityLight ) ( struct alight_s *plight );
void ( *StudioSetupLighting ) ( struct alight_s *plighting );
void (*StudioDynamicLight)(struct cl_entity_s *ent, struct alight_s *plight);
void (*StudioEntityLight)(struct alight_s *plight);
void (*StudioSetupLighting)(struct alight_s *plighting);
// Draw mesh vertices
void ( *StudioDrawPoints ) ( void );
void (*StudioDrawPoints)(void);
// Draw hulls around bones
void ( *StudioDrawHulls ) ( void );
void (*StudioDrawHulls)(void);
// Draw bbox around studio models
void ( *StudioDrawAbsBBox ) ( void );
void (*StudioDrawAbsBBox)(void);
// Draws bones
void ( *StudioDrawBones ) ( void );
void (*StudioDrawBones)(void);
// Loads in appropriate texture for model
void ( *StudioSetupSkin ) ( void *ptexturehdr, int index );
void (*StudioSetupSkin)(void *ptexturehdr, int index);
// Sets up for remapped colors
void ( *StudioSetRemapColors ) ( int top, int bottom );
void (*StudioSetRemapColors)(int top, int bottom);
// Set's player model and returns model pointer
struct model_s *( *SetupPlayerModel ) ( int index );
struct model_s *(*SetupPlayerModel)(int index);
// Fires any events embedded in animation
void ( *StudioClientEvents ) ( void );
void (*StudioClientEvents)(void);
// Retrieve/set forced render effects flags
int ( *GetForceFaceFlags ) ( void );
void ( *SetForceFaceFlags ) ( int flags );
int (*GetForceFaceFlags)(void);
void (*SetForceFaceFlags)(int flags);
// Tell engine the value of the studio model header
void ( *StudioSetHeader ) ( void *header );
void (*StudioSetHeader)(void *header);
// Tell engine which model_t * is being renderered
void ( *SetRenderModel ) ( struct model_s *model );
void (*SetRenderModel)(struct model_s *model);
// Final state setup and restore for rendering
void ( *SetupRenderer ) ( int rendermode );
void ( *RestoreRenderer ) ( void );
void (*SetupRenderer)(int rendermode);
void (*RestoreRenderer)(void);
// Set render origin for applying chrome effect
void ( *SetChromeOrigin ) ( void );
void (*SetChromeOrigin)(void);
// True if using D3D/OpenGL
int ( *IsHardware ) ( void );
// Only called by hardware interface
void ( *GL_StudioDrawShadow ) ( void );
void ( *GL_SetRenderMode ) ( int mode );
int (*IsHardware)(void);
// Only called by hardware interface
void (*GL_StudioDrawShadow)(void);
void (*GL_SetRenderMode)(int mode);
void (*StudioSetRenderamt)(int iRenderamt); //!!!CZERO added for rendering glass on viewmodels
void (*StudioSetCullState)(int iCull);
void (*StudioRenderShadow)(int iSprite, float *p1, float *p2, float *p3, float *p4);
void ( *StudioSetRenderamt ) (int iRenderamt); //!!!CZERO added for rendering glass on viewmodels
void ( *StudioSetCullState ) ( int iCull );
void ( *StudioRenderShadow ) ( int iSprite, float *p1, float *p2, float *p3, float *p4 );
} engine_studio_api_t;
typedef struct server_studio_api_s
{
// Allocate number*size bytes and zero it
void *( *Mem_Calloc ) ( int number, size_t size );
void *(*Mem_Calloc)(int number, size_t size);
// Check to see if pointer is in the cache
void *( *Cache_Check ) ( struct cache_user_s *c );
// Load file into cache ( can be swapped out on demand )
void ( *LoadCacheFile ) ( char *path, struct cache_user_s *cu );
void *(*Cache_Check)(struct cache_user_s *c);
// Load file into cache (can be swapped out on demand)
void (*LoadCacheFile)(char *path, struct cache_user_s *cu);
// Retrieve pointer to studio model data block from a model
void *( *Mod_Extradata ) ( struct model_s *mod );
void *(*Mod_Extradata)(struct model_s *mod);
} server_studio_api_t;
// client blending
typedef struct r_studio_interface_s
{
int version;
int ( *StudioDrawModel ) ( int flags );
int ( *StudioDrawPlayer ) ( int flags, struct entity_state_s *pplayer );
int version;
int (*StudioDrawModel)(int flags);
int (*StudioDrawPlayer)(int flags, struct entity_state_s *pplayer);
} r_studio_interface_t;
extern r_studio_interface_t *pStudioAPI;
@ -135,17 +188,17 @@ extern r_studio_interface_t *pStudioAPI;
typedef struct sv_blending_interface_s
{
int version;
void ( *SV_StudioSetupBones )( struct model_s *pModel,
int version;
void (*SV_StudioSetupBones)(struct model_s *pModel,
float frame,
int sequence,
const vec3_t angles,
const vec3_t origin,
const vec_t *angles,
const vec_t *origin,
const byte *pcontroller,
const byte *pblending,
int iBone,
const edict_t *pEdict );
const edict_t *pEdict);
} sv_blending_interface_t;
#endif // R_STUDIOINT_H

View File

@ -90,16 +90,16 @@ activity_map_t activity_map[] =
_A(ACT_THREAT_DISPLAY),
_A(ACT_FEAR_DISPLAY),
_A(ACT_EXCITED),
_A( ACT_SPECIAL_ATTACK1),
_A( ACT_SPECIAL_ATTACK2),
_A( ACT_COMBAT_IDLE),
_A(ACT_SPECIAL_ATTACK1),
_A(ACT_SPECIAL_ATTACK2),
_A(ACT_COMBAT_IDLE),
_A(ACT_WALK_SCARED),
_A(ACT_RUN_SCARED),
_A( ACT_VICTORY_DANCE),
_A( ACT_DIE_HEADSHOT),
_A( ACT_DIE_CHESTSHOT),
_A( ACT_DIE_GUTSHOT),
_A( ACT_DIE_BACKSHOT),
_A(ACT_VICTORY_DANCE),
_A(ACT_DIE_HEADSHOT),
_A(ACT_DIE_CHESTSHOT),
_A(ACT_DIE_GUTSHOT),
_A(ACT_DIE_BACKSHOT),
_A(ACT_FLINCH_HEAD),
_A(ACT_FLINCH_CHEST),
_A(ACT_FLINCH_STOMACH),

View File

@ -12,7 +12,7 @@ TYPEDESCRIPTION CAirtank::m_SaveData[] =
#else
TYPEDESCRIPTION (*CAirtank::pm_SaveData)[1];
TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CAirtank, m_SaveData)[1];
#endif // HOOK_GAMEDLL

View File

@ -16,7 +16,7 @@ TYPEDESCRIPTION CBaseAnimating::m_SaveData[] =
#else
TYPEDESCRIPTION (*CBaseAnimating::pm_SaveData)[5];
TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CBaseAnimating, m_SaveData)[5];
#endif // HOOK_GAMEDLL
@ -187,7 +187,6 @@ NOXREF int CBaseAnimating::FindTransition(int iEndingSequence, int iGoalSequence
}
return ::FindTransition(pmodel, iEndingSequence, iGoalSequence, piDir);
}
/* <10a5d> ../cstrike/dlls/animating.cpp:234 */

File diff suppressed because it is too large Load Diff

View File

@ -42,10 +42,10 @@ NOXREF char *vstr(float *v);
class CBaseMonster: public CBaseToggle
{
public:
NOBODY virtual void KeyValue(KeyValueData *pkvd);
virtual void KeyValue(KeyValueData *pkvd);
virtual void TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType);
NOBODY virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
NOBODY virtual int TakeHealth(float flHealth, int bitsDamageType);
virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
virtual int TakeHealth(float flHealth, int bitsDamageType);
virtual void Killed(entvars_t *pevAttacker, int iGib);
virtual int BloodColor(void)
{
@ -58,20 +58,20 @@ public:
virtual float ChangeYaw(int speed);
virtual BOOL HasHumanGibs(void);
virtual BOOL HasAlienGibs(void);
NOBODY virtual void FadeMonster(void);
virtual void FadeMonster(void);
virtual void GibMonster(void);
NOBODY virtual Activity GetDeathActivity(void);
NOXREF virtual Activity GetDeathActivity(void);
virtual void BecomeDead(void);
virtual BOOL ShouldFadeOnDeath(void);
NOBODY virtual int IRelationship(CBaseEntity *pTarget);
virtual int IRelationship(CBaseEntity *pTarget);
virtual void PainSound(void) {}
NOBODY virtual void ResetMaxSpeed(void) {}
NOBODY virtual void ReportAIState(void) {}
virtual void ResetMaxSpeed(void) {}
virtual void ReportAIState(void) {}
virtual void MonsterInitDead(void);
NOBODY virtual void Look(int iDistance);
NOBODY virtual CBaseEntity *BestVisibleEnemy(void);
NOBODY virtual BOOL FInViewCone(CBaseEntity *pEntity);
NOBODY virtual BOOL FInViewCone(Vector *pOrigin);
virtual void Look(int iDistance);
virtual CBaseEntity *BestVisibleEnemy(void);
virtual BOOL FInViewCone(CBaseEntity *pEntity);
virtual BOOL FInViewCone(const Vector *pOrigin);
#ifdef HOOK_GAMEDLL
@ -101,13 +101,13 @@ public:
void Look_(int iDistance);
CBaseEntity *BestVisibleEnemy_(void);
BOOL FInViewCone_(CBaseEntity *pEntity);
BOOL FInViewCone_(Vector *pOrigin);
BOOL FInViewCone_(const Vector *pOrigin);
#endif // HOOK_GAMEDLL
public:
void MakeIdealYaw(Vector vecTarget);
NOBODY Activity GetSmallFlinchActivity(void);
NOXREF Activity GetSmallFlinchActivity(void);
BOOL ShouldGibMonster(int iGib);
void CallGibMonster(void);
BOOL FCheckAITrigger(void);
@ -171,8 +171,8 @@ public:
{
pev->framerate = 0.0;
}
NOBODY void CorpseFallThink(void);
NOBODY CBaseEntity *CheckTraceHullAttack(float flDist, int iDamage, int iDmgType);
NOXREF void CorpseFallThink(void);
NOXREF CBaseEntity *CheckTraceHullAttack(float flDist, int iDamage, int iDmgType);
NOXREF void MakeDamageBloodDecal(int cCount, float flNoise, TraceResult *ptr, Vector &vecDir);
void MonsterUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
@ -206,7 +206,7 @@ typedef void (CBaseMonster::*RADIUSDAMAGE_ENTVARS)(entvars_t *, entvars_t *, flo
typedef void (CBaseMonster::*RADIUSDAMAGE_VECTOR)(Vector, entvars_t *, entvars_t *, float, int, int);
typedef BOOL (CBaseMonster::*FINVIEWCONE_ENTITY)(CBaseEntity *);
typedef BOOL (CBaseMonster::*FINVIEWCONE_VECTOR)(Vector *);
typedef BOOL (CBaseMonster::*FINVIEWCONE_VECTOR)(const Vector *);
#endif // HOOK_GAMEDLL

File diff suppressed because it is too large Load Diff

View File

@ -32,10 +32,11 @@
#pragma once
#endif
#define SF_PENDULUM_SWING 2
#define SF_BRUSH_ACCDCC 16
#define SF_BRUSH_HURT 32
#define SF_ROTATING_NOT_SOLID 64
#define SF_PENDULUM_SWING 2 // spawnflag that makes a pendulum a rope swing.
#define SF_BRUSH_ACCDCC 16 // brush should accelerate and decelerate when toggled
#define SF_BRUSH_HURT 32 // rotating brush that inflicts pain based on rotation speed
#define SF_ROTATING_NOT_SOLID 64 // some special rotating objects are not solid.
#define SF_WALL_START_OFF 0x0001
@ -45,20 +46,25 @@
#define FANPITCHMIN 30
#define FANPITCHMAX 100
// covering cheesy noise1, noise2, & noise3 fields so they make more sense (for rotating fans)
#define noiseStart noise1
#define noiseStop noise2
#define noiseRunning noise3
// This is just a solid wall if not inhibited
/* <1c494> ../cstrike/dlls/bmodels.cpp:53 */
class CFuncWall: public CBaseEntity
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual int ObjectCaps(void)
virtual void Spawn(void);
// Bmodels don't go across transitions
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
@ -77,8 +83,8 @@ public:
class CFuncWallToggle: public CFuncWall
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Spawn(void);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
@ -88,9 +94,9 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY void TurnOff(void);
NOBODY void TurnOn(void);
NOBODY BOOL IsOn(void);
void TurnOff(void);
void TurnOn(void);
BOOL IsOn(void);
};/* size: 152, cachelines: 3, members: 1 */
@ -98,8 +104,8 @@ public:
class CFuncConveyor: public CFuncWall
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Spawn(void);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
@ -109,17 +115,19 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY void UpdateSpeed(float speed);
void UpdateSpeed(float speed);
};/* size: 152, cachelines: 3, members: 1 */
// A simple entity that looks solid but lets you walk through it.
/* <1c65b> ../cstrike/dlls/bmodels.cpp:208 */
class CFuncIllusionary: public CBaseToggle
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int ObjectCaps(void)
virtual void Spawn(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
@ -136,15 +144,25 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY void EXPORT SloshTouch(CBaseEntity *pOther);
void EXPORT SloshTouch(CBaseEntity *pOther);
};/* size: 312, cachelines: 5, members: 1 */
// Monster only clip brush
//
// This brush will be solid for any entity who has the FL_MONSTERCLIP flag set
// in pev->flags
//
// otherwise it will be invisible and not solid. This can be used to keep
// specific monsters out of certain areas
/* <1c6a8> ../cstrike/dlls/bmodels.cpp:255 */
class CFuncMonsterClip: public CFuncWall
{
public:
NOBODY virtual void Spawn(void);
virtual void Spawn(void);
// Clear out func_wall's use function
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
;
@ -163,16 +181,17 @@ public:
class CFuncRotating: public CBaseEntity
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void)
// basic functions
virtual void Spawn(void);
virtual void Precache(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
NOBODY virtual void Blocked(CBaseEntity *pOther);
virtual void Blocked(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
@ -190,12 +209,12 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY void EXPORT SpinUp(void);
NOBODY void EXPORT SpinDown(void);
NOBODY void EXPORT HurtTouch(CBaseEntity *pOther);
NOBODY void EXPORT RotatingUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
NOBODY void EXPORT Rotate(void);
NOBODY void RampPitchVol(int fUp);
void EXPORT SpinUp(void);
void EXPORT SpinDown(void);
void EXPORT HurtTouch(CBaseEntity *pOther);
void EXPORT RotatingUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void EXPORT Rotate(void);
void RampPitchVol(int fUp);
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[5];
@ -213,16 +232,16 @@ public:
class CPendulum: public CBaseEntity
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void)
virtual void Spawn(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
NOBODY virtual void Touch(CBaseEntity *pOther);
NOBODY virtual void Blocked(CBaseEntity *pOther);
virtual void Touch(CBaseEntity *pOther);
virtual void Blocked(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
@ -240,20 +259,23 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY void EXPORT Swing(void);
NOBODY void EXPORT PendulumUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
NOBODY void EXPORT Stop(void);
NOBODY void EXPORT RopeTouch(CBaseEntity *pOther);
void EXPORT Swing(void);
void EXPORT PendulumUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void EXPORT Stop(void);
// this touch func makes the pendulum a rope
void EXPORT RopeTouch(CBaseEntity *pOther);
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[8];
public:
float m_accel;
float m_accel; // Acceleration
float m_distance;
float m_time;
float m_damp;
float m_maxSpeed;
float m_dampSpeed;
Vector m_center;
Vector m_start;
@ -261,4 +283,13 @@ public:
Vector VecBModelOrigin(entvars_t *pevBModel);
// linked objects
C_DLLEXPORT void func_wall(entvars_t *pev);
C_DLLEXPORT void func_wall_toggle(entvars_t *pev);
C_DLLEXPORT void func_conveyor(entvars_t *pev);
C_DLLEXPORT void func_illusionary(entvars_t *pev);
C_DLLEXPORT void func_monsterclip(entvars_t *pev);
C_DLLEXPORT void func_rotating(entvars_t *pev);
C_DLLEXPORT void func_pendulum(entvars_t *pev);
#endif // BMODELS_H

View File

@ -1,482 +1,482 @@
#include "precompiled.h"
/* <2e85c8> ../cstrike/dlls/bot/cs_bot.cpp:24 */
NOBODY int GetBotFollowCount(CBasePlayer *leader)
{
// {
// int count; // 26
// {
// int i; // 28
// {
// class CBaseEntity *entity; // 30
// class CBasePlayer *player; // 41
// class CCSBot *bot; // 49
// FNullEnt(entvars_t *pev); // 35
// GetFollowLeader(CCSBot *const this); // 50
// }
// }
// }
/* <2e85c8> ../cstrike/dlls/bot/cs_bot.cpp:24 */
NOBODY int GetBotFollowCount(CBasePlayer *leader)
{
// {
// int count; // 26
// {
// int i; // 28
// {
// class CBaseEntity *entity; // 30
// class CBasePlayer *player; // 41
// class CCSBot *bot; // 49
// FNullEnt(entvars_t *pev); // 35
// GetFollowLeader(CCSBot *const this); // 50
// }
// }
// }
}
/* <2e86df> ../cstrike/dlls/bot/cs_bot.cpp:62 */
NOBODY void CCSBot::__MAKE_VHOOK(Walk)(void)
{
// IsElapsed(const class CountdownTimer *const this); // 64
// Walk(CBot *const this); // 66
}
/* <2e8732> ../cstrike/dlls/bot/cs_bot.cpp:80 */
NOBODY bool CCSBot::__MAKE_VHOOK(Jump)(bool mustJump)
{
/* <2e86df> ../cstrike/dlls/bot/cs_bot.cpp:62 */
NOBODY void CCSBot::__MAKE_VHOOK(Walk)(void)
{
// IsElapsed(const class CountdownTimer *const this); // 64
// Walk(CBot *const this); // 66
}
/* <2e8e39> ../cstrike/dlls/bot/cs_bot.cpp:97 */
NOBODY int CCSBot::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{
// {
// class CBaseEntity *attacker; // 99
// GetClassPtr<CBaseEntity>(CBaseEntity *a); // 99
// {
// class CBasePlayer *player; // 104
// }
// {
// class CBasePlayer *lastAttacker; // 113
// float lastAttackedTimestamp; // 114
// AdjustSafeTime(CCSBot *const this); // 121
// IsSurprised(const class CCSBot *const this); // 124
// {
// class CBasePlayer *enemy; // 126
// bool panic; // 127
// {
// float invSkill; // 148
// float panicChance; // 149
// }
// }
// }
// }
/* <2e8732> ../cstrike/dlls/bot/cs_bot.cpp:80 */
NOBODY bool CCSBot::__MAKE_VHOOK(Jump)(bool mustJump)
{
}
/* <2e8769> ../cstrike/dlls/bot/cs_bot.cpp:171 */
NOBODY void CCSBot::__MAKE_VHOOK(Killed)(entvars_t *pevAttacker, int iGib)
{
// {
// float const deathDanger; // 178
// float const deathDangerRadius; // 179
// }
/* <2e8e39> ../cstrike/dlls/bot/cs_bot.cpp:97 */
NOBODY int CCSBot::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{
// {
// class CBaseEntity *attacker; // 99
// GetClassPtr<CBaseEntity>(CBaseEntity *a); // 99
// {
// class CBasePlayer *player; // 104
// }
// {
// class CBasePlayer *lastAttacker; // 113
// float lastAttackedTimestamp; // 114
// AdjustSafeTime(CCSBot *const this); // 121
// IsSurprised(const class CCSBot *const this); // 124
// {
// class CBasePlayer *enemy; // 126
// bool panic; // 127
// {
// float invSkill; // 148
// float panicChance; // 149
// }
// }
// }
// }
}
/* <2e7c11> ../cstrike/dlls/bot/cs_bot.cpp:200 */
NOBODY inline bool IsIntersectingBox(const Vector *start, const Vector *end, const Vector *boxMin, const Vector *boxMax)
{
// {
// unsigned char startFlags; // 202
// unsigned char endFlags; // 203
// }
/* <2e8769> ../cstrike/dlls/bot/cs_bot.cpp:171 */
NOBODY void CCSBot::__MAKE_VHOOK(Killed)(entvars_t *pevAttacker, int iGib)
{
// {
// float const deathDanger; // 178
// float const deathDangerRadius; // 179
// }
}
/* <2e87d9> ../cstrike/dlls/bot/cs_bot.cpp:253 */
NOBODY void CCSBot::BotTouch(CBaseEntity *other)
{
// FStrEq(const char *sz1,
// const char *sz2); // 297
// {
// Vector center; // 299
// class Extent extent; // 301
// bool breakIt; // 307
// operator+(const Vector *const this,
// const Vector &v); // 299
// {
// Vector goal; // 312
// Vector(Vector *const this,
// const Vector &v); // 312
// IsIntersectingBox(const Vector *start,
// const Vector *end,
// const Vector *boxMin,
// const Vector *boxMax); // 314
// }
// operator/(const Vector *const this,
// float fl); // 299
// }
// {
// class CBasePlayer *player; // 269
// unsigned int otherPri; // 272
// unsigned int myPri; // 275
// {
// unsigned int avoidPri; // 284
// }
// }
}
/* <2e89e3> ../cstrike/dlls/bot/cs_bot.cpp:335 */
NOBODY bool CCSBot::IsBusy(void) const
{
}
/* <2e8a0c> ../cstrike/dlls/bot/cs_bot.cpp:351 */
NOBODY void CCSBot::BotDeathThink(void)
{
}
/* <2e8a34> ../cstrike/dlls/bot/cs_bot.cpp:358 */
NOBODY CBasePlayer *CCSBot::FindNearbyPlayer(void)
{
// {
// class CBaseEntity *pEntity; // 360
// Vector vecSrc; // 361
// float flRadius; // 362
// Vector(Vector *const this,
// const Vector &v); // 361
// }
}
/* <2e8abd> ../cstrike/dlls/bot/cs_bot.cpp:385 */
void CCSBot::SetEnemy(CBasePlayer *enemy)
{
if (m_enemy != enemy)
{
m_enemy = enemy;
m_currentEnemyAcquireTimestamp = gpGlobals->time;
}
}
/* <2e8af6> ../cstrike/dlls/bot/cs_bot.cpp:400 */
NOBODY bool CCSBot::StayOnNavMesh(void)
{
// {
// class CNavArea *goalArea; // 408
// {
// Vector pos; // 422
// Vector to; // 426
// float const stepInDist; // 429
// operator-(const Vector *const this,
// const Vector &v); // 426
// NormalizeInPlace(Vector *const this); // 427
// operator*(float fl,
// const Vector &v); // 430
// operator+(const Vector *const this,
// const Vector &v); // 430
// }
// }
}
/* <2e8c56> ../cstrike/dlls/bot/cs_bot.cpp:450 */
NOBODY void CCSBot::Panic(CBasePlayer *enemy)
{
// {
// class Vector2D dir; // 456
// class Vector2D perp; // 457
// Vector spot; // 459
// IsSurprised(const class CCSBot *const this); // 453
// {
// class Vector2D toEnemy; // 473
// float along; // 476
// float c45; // 477
// float size; // 478
// float shift; // 479
// NormalizeInPlace(Vector2D *const this); // 474
// DotProduct(const class Vector2D &a,
// const class Vector2D &b); // 476
// {
// float side; // 495
// DotProduct(const class Vector2D &a,
// const class Vector2D &b); // 495
// }
// }
// {
// float const offset; // 464
// float side; // 465
// }
// }
}
/* <2e9047> ../cstrike/dlls/bot/cs_bot.cpp:527 */
NOBODY bool CCSBot::IsDoingScenario(void)
{
}
/* <2e9070> ../cstrike/dlls/bot/cs_bot.cpp:544 */
NOBODY bool CCSBot::NoticeLooseBomb(void) const
{
// {
// class CCSBotManager *ctrl; // 546
// class CBaseEntity *bomb; // 551
// GetLooseBomb(CCSBotManager *const this); // 551
// }
}
/* <2e90d4> ../cstrike/dlls/bot/cs_bot.cpp:566 */
NOBODY bool CCSBot::CanSeeLooseBomb(void) const
{
// {
// class CCSBotManager *ctrl; // 568
// class CBaseEntity *bomb; // 573
// GetLooseBomb(CCSBotManager *const this); // 573
// }
}
/* <2e9140> ../cstrike/dlls/bot/cs_bot.cpp:588 */
NOBODY bool CCSBot::CanSeePlantedBomb(void) const
{
// {
// class CCSBotManager *ctrl; // 590
// const Vector *bombPos; // 598
// }
}
/* <2e918e> ../cstrike/dlls/bot/cs_bot.cpp:610 */
NOBODY CBasePlayer *CCSBot::GetAttacker(void)
{
}
/* <2e91b7> ../cstrike/dlls/bot/cs_bot.cpp:622 */
NOBODY void CCSBot::GetOffLadder(void)
{
// DestroyPath(CCSBot *const this); // 627
}
/* <2e91f1> ../cstrike/dlls/bot/cs_bot.cpp:637 */
NOBODY float CCSBot::GetHidingSpotCheckTimestamp(HidingSpot *spot)
{
// {
// int i; // 639
// }
}
/* <2e9240> ../cstrike/dlls/bot/cs_bot.cpp:651 */
NOBODY void CCSBot::SetHidingSpotCheckTimestamp(HidingSpot *spot)
{
// {
// int leastRecent; // 653
// float leastRecentTime; // 654
// {
// int i; // 656
// }
// }
}
/* <2e92b8> ../cstrike/dlls/bot/cs_bot.cpp:693 */
NOBODY void CCSBot::UpdateHostageEscortCount(void)
{
// {
// float const updateInterval; // 695
// {
// class CHostage *hostage; // 704
// IsValid(CHostage *const this); // 709
// IsFollowing(CHostage *const this,
// const class CBaseEntity *entity); // 713
// edict(CBaseEntity *const this); // 705
// FNullEnt(const edict_t *pent); // 705
// }
// }
}
/* <2e940d> ../cstrike/dlls/bot/cs_bot.cpp:722 */
NOBODY bool CCSBot::IsOutnumbered(void)
{
// GetNearbyFriendCount(const class CCSBot *const this); // 724
// GetNearbyEnemyCount(const class CCSBot *const this); // 724
}
/* <2e94a0> ../cstrike/dlls/bot/cs_bot.cpp:731 */
NOBODY int CCSBot::OutnumberedCount(void)
{
// IsOutnumbered(const class CCSBot *const this); // 733
// GetNearbyEnemyCount(const class CCSBot *const this); // 734
// GetNearbyFriendCount(const class CCSBot *const this); // 734
}
/* <2e95cb> ../cstrike/dlls/bot/cs_bot.cpp:744 */
NOBODY CBasePlayer *CCSBot::GetImportantEnemy(bool checkVisibility)
{
// {
// class CCSBotManager *ctrl; // 746
// class CBasePlayer *nearEnemy; // 747
// float nearDist; // 748
// {
// int i; // 750
// {
// class CBaseEntity *entity; // 752
// class CBasePlayer *player; // 767
// Vector d; // 782
// float distSq; // 783
// FNullEnt(entvars_t *pev); // 757
// operator-(const Vector *const this,
// const Vector &v); // 782
// }
// }
// }
}
/* <2e9719> ../cstrike/dlls/bot/cs_bot.cpp:801 */
NOBODY void CCSBot::SetDisposition(DispositionType disposition)
{
// Invalidate(CountdownTimer *const this); // 806
}
/* <2e9762> ../cstrike/dlls/bot/cs_bot.cpp:814 */
CCSBot::DispositionType CCSBot::GetDisposition(void) const
{
if (!m_ignoreEnemiesTimer.IsElapsed())
return IGNORE_ENEMIES;
return m_disposition;
}
/* <2e979b> ../cstrike/dlls/bot/cs_bot.cpp:826 */
NOBODY void CCSBot::IgnoreEnemies(float duration)
{
// Start(CountdownTimer *const this,
// float duration); // 828
}
/* <2e97fc> ../cstrike/dlls/bot/cs_bot.cpp:835 */
NOBODY void CCSBot::IncreaseMorale(void)
{
}
/* <2e9824> ../cstrike/dlls/bot/cs_bot.cpp:845 */
void CCSBot::DecreaseMorale(void)
{
if (m_morale > TERRIBLE)
{
m_morale = static_cast<MoraleType>(m_morale - 1);
}
}
/* <2e984c> ../cstrike/dlls/bot/cs_bot.cpp:857 */
NOBODY bool CCSBot::IsRogue(void) const
{
// {
// class CCSBotManager *ctrl; // 859
// AllowRogues(const class CCSBotManager *const this); // 860
// IsElapsed(const class CountdownTimer *const this); // 864
// {
// float const rogueChance; // 869
// Start(CountdownTimer *const this,
// float duration); // 866
// }
// }
}
/* <2e98f1> ../cstrike/dlls/bot/cs_bot.cpp:882 */
NOBODY bool CCSBot::IsHurrying(void) const
{
// {
// class CCSBotManager *ctrl; // 887
// IsElapsed(const class CountdownTimer *const this); // 884
// }
}
/* <2e9942> ../cstrike/dlls/bot/cs_bot.cpp:906 */
NOBODY bool CCSBot::IsSafe(void) const
{
// {
// class CCSBotManager *ctrl; // 908
// GetElapsedRoundTime(const class CCSBotManager *const this); // 910
// }
}
/* <2e9987> ../cstrike/dlls/bot/cs_bot.cpp:920 */
NOBODY bool CCSBot::IsWellPastSafe(void) const
{
// {
// class CCSBotManager *ctrl; // 922
// GetElapsedRoundTime(const class CCSBotManager *const this); // 924
// }
}
/* <2e99d8> ../cstrike/dlls/bot/cs_bot.cpp:934 */
NOBODY bool CCSBot::IsEndOfSafeTime(void) const
{
// IsSafe(const class CCSBot *const this); // 936
}
/* <2e9a3e> ../cstrike/dlls/bot/cs_bot.cpp:943 */
NOBODY float CCSBot::GetSafeTimeRemaining(void) const
{
// {
// class CCSBotManager *ctrl; // 945
// GetElapsedRoundTime(const class CCSBotManager *const this); // 947
// }
}
/* <2e9a8f> ../cstrike/dlls/bot/cs_bot.cpp:954 */
void CCSBot::AdjustSafeTime(void)
{
CCSBotManager *ctrl = TheCSBots();
// if we spotted an enemy sooner than we thought possible, adjust our notion of "safe" time
/* <2e7c11> ../cstrike/dlls/bot/cs_bot.cpp:200 */
NOBODY inline bool IsIntersectingBox(const Vector *start, const Vector *end, const Vector *boxMin, const Vector *boxMax)
{
// {
// unsigned char startFlags; // 202
// unsigned char endFlags; // 203
// }
}
/* <2e87d9> ../cstrike/dlls/bot/cs_bot.cpp:253 */
NOBODY void CCSBot::BotTouch(CBaseEntity *other)
{
// FStrEq(const char *sz1,
// const char *sz2); // 297
// {
// Vector center; // 299
// class Extent extent; // 301
// bool breakIt; // 307
// operator+(const Vector *const this,
// const Vector &v); // 299
// {
// Vector goal; // 312
// Vector(Vector *const this,
// const Vector &v); // 312
// IsIntersectingBox(const Vector *start,
// const Vector *end,
// const Vector *boxMin,
// const Vector *boxMax); // 314
// }
// operator/(const Vector *const this,
// float fl); // 299
// }
// {
// class CBasePlayer *player; // 269
// unsigned int otherPri; // 272
// unsigned int myPri; // 275
// {
// unsigned int avoidPri; // 284
// }
// }
}
/* <2e89e3> ../cstrike/dlls/bot/cs_bot.cpp:335 */
NOBODY bool CCSBot::IsBusy(void) const
{
}
/* <2e8a0c> ../cstrike/dlls/bot/cs_bot.cpp:351 */
NOBODY void CCSBot::BotDeathThink(void)
{
}
/* <2e8a34> ../cstrike/dlls/bot/cs_bot.cpp:358 */
NOBODY CBasePlayer *CCSBot::FindNearbyPlayer(void)
{
// {
// class CBaseEntity *pEntity; // 360
// Vector vecSrc; // 361
// float flRadius; // 362
// Vector(Vector *const this,
// const Vector &v); // 361
// }
}
/* <2e8abd> ../cstrike/dlls/bot/cs_bot.cpp:385 */
void CCSBot::SetEnemy(CBasePlayer *enemy)
{
if (m_enemy != enemy)
{
m_enemy = enemy;
m_currentEnemyAcquireTimestamp = gpGlobals->time;
}
}
/* <2e8af6> ../cstrike/dlls/bot/cs_bot.cpp:400 */
NOBODY bool CCSBot::StayOnNavMesh(void)
{
// {
// class CNavArea *goalArea; // 408
// {
// Vector pos; // 422
// Vector to; // 426
// float const stepInDist; // 429
// operator-(const Vector *const this,
// const Vector &v); // 426
// NormalizeInPlace(Vector *const this); // 427
// operator*(float fl,
// const Vector &v); // 430
// operator+(const Vector *const this,
// const Vector &v); // 430
// }
// }
}
/* <2e8c56> ../cstrike/dlls/bot/cs_bot.cpp:450 */
NOBODY void CCSBot::Panic(CBasePlayer *enemy)
{
// {
// class Vector2D dir; // 456
// class Vector2D perp; // 457
// Vector spot; // 459
// IsSurprised(const class CCSBot *const this); // 453
// {
// class Vector2D toEnemy; // 473
// float along; // 476
// float c45; // 477
// float size; // 478
// float shift; // 479
// NormalizeInPlace(Vector2D *const this); // 474
// DotProduct(const class Vector2D &a,
// const class Vector2D &b); // 476
// {
// float side; // 495
// DotProduct(const class Vector2D &a,
// const class Vector2D &b); // 495
// }
// }
// {
// float const offset; // 464
// float side; // 465
// }
// }
}
/* <2e9047> ../cstrike/dlls/bot/cs_bot.cpp:527 */
NOBODY bool CCSBot::IsDoingScenario(void)
{
}
/* <2e9070> ../cstrike/dlls/bot/cs_bot.cpp:544 */
NOBODY bool CCSBot::NoticeLooseBomb(void) const
{
// {
// class CCSBotManager *ctrl; // 546
// class CBaseEntity *bomb; // 551
// GetLooseBomb(CCSBotManager *const this); // 551
// }
}
/* <2e90d4> ../cstrike/dlls/bot/cs_bot.cpp:566 */
NOBODY bool CCSBot::CanSeeLooseBomb(void) const
{
// {
// class CCSBotManager *ctrl; // 568
// class CBaseEntity *bomb; // 573
// GetLooseBomb(CCSBotManager *const this); // 573
// }
}
/* <2e9140> ../cstrike/dlls/bot/cs_bot.cpp:588 */
NOBODY bool CCSBot::CanSeePlantedBomb(void) const
{
// {
// class CCSBotManager *ctrl; // 590
// const Vector *bombPos; // 598
// }
}
/* <2e918e> ../cstrike/dlls/bot/cs_bot.cpp:610 */
NOBODY CBasePlayer *CCSBot::GetAttacker(void)
{
}
/* <2e91b7> ../cstrike/dlls/bot/cs_bot.cpp:622 */
NOBODY void CCSBot::GetOffLadder(void)
{
// DestroyPath(CCSBot *const this); // 627
}
/* <2e91f1> ../cstrike/dlls/bot/cs_bot.cpp:637 */
NOBODY float CCSBot::GetHidingSpotCheckTimestamp(HidingSpot *spot)
{
// {
// int i; // 639
// }
}
/* <2e9240> ../cstrike/dlls/bot/cs_bot.cpp:651 */
NOBODY void CCSBot::SetHidingSpotCheckTimestamp(HidingSpot *spot)
{
// {
// int leastRecent; // 653
// float leastRecentTime; // 654
// {
// int i; // 656
// }
// }
}
/* <2e92b8> ../cstrike/dlls/bot/cs_bot.cpp:693 */
NOBODY void CCSBot::UpdateHostageEscortCount(void)
{
// {
// float const updateInterval; // 695
// {
// class CHostage *hostage; // 704
// IsValid(CHostage *const this); // 709
// IsFollowing(CHostage *const this,
// const class CBaseEntity *entity); // 713
// edict(CBaseEntity *const this); // 705
// FNullEnt(const edict_t *pent); // 705
// }
// }
}
/* <2e940d> ../cstrike/dlls/bot/cs_bot.cpp:722 */
NOBODY bool CCSBot::IsOutnumbered(void)
{
// GetNearbyFriendCount(const class CCSBot *const this); // 724
// GetNearbyEnemyCount(const class CCSBot *const this); // 724
}
/* <2e94a0> ../cstrike/dlls/bot/cs_bot.cpp:731 */
NOBODY int CCSBot::OutnumberedCount(void)
{
// IsOutnumbered(const class CCSBot *const this); // 733
// GetNearbyEnemyCount(const class CCSBot *const this); // 734
// GetNearbyFriendCount(const class CCSBot *const this); // 734
}
/* <2e95cb> ../cstrike/dlls/bot/cs_bot.cpp:744 */
NOBODY CBasePlayer *CCSBot::GetImportantEnemy(bool checkVisibility)
{
// {
// class CCSBotManager *ctrl; // 746
// class CBasePlayer *nearEnemy; // 747
// float nearDist; // 748
// {
// int i; // 750
// {
// class CBaseEntity *entity; // 752
// class CBasePlayer *player; // 767
// Vector d; // 782
// float distSq; // 783
// FNullEnt(entvars_t *pev); // 757
// operator-(const Vector *const this,
// const Vector &v); // 782
// }
// }
// }
}
/* <2e9719> ../cstrike/dlls/bot/cs_bot.cpp:801 */
NOBODY void CCSBot::SetDisposition(DispositionType disposition)
{
// Invalidate(CountdownTimer *const this); // 806
}
/* <2e9762> ../cstrike/dlls/bot/cs_bot.cpp:814 */
CCSBot::DispositionType CCSBot::GetDisposition(void) const
{
if (!m_ignoreEnemiesTimer.IsElapsed())
return IGNORE_ENEMIES;
return m_disposition;
}
/* <2e979b> ../cstrike/dlls/bot/cs_bot.cpp:826 */
NOBODY void CCSBot::IgnoreEnemies(float duration)
{
// Start(CountdownTimer *const this,
// float duration); // 828
}
/* <2e97fc> ../cstrike/dlls/bot/cs_bot.cpp:835 */
NOBODY void CCSBot::IncreaseMorale(void)
{
}
/* <2e9824> ../cstrike/dlls/bot/cs_bot.cpp:845 */
void CCSBot::DecreaseMorale(void)
{
if (m_morale > TERRIBLE)
{
m_morale = static_cast<MoraleType>(m_morale - 1);
}
}
/* <2e984c> ../cstrike/dlls/bot/cs_bot.cpp:857 */
NOBODY bool CCSBot::IsRogue(void) const
{
// {
// class CCSBotManager *ctrl; // 859
// AllowRogues(const class CCSBotManager *const this); // 860
// IsElapsed(const class CountdownTimer *const this); // 864
// {
// float const rogueChance; // 869
// Start(CountdownTimer *const this,
// float duration); // 866
// }
// }
}
/* <2e98f1> ../cstrike/dlls/bot/cs_bot.cpp:882 */
NOBODY bool CCSBot::IsHurrying(void) const
{
// {
// class CCSBotManager *ctrl; // 887
// IsElapsed(const class CountdownTimer *const this); // 884
// }
}
/* <2e9942> ../cstrike/dlls/bot/cs_bot.cpp:906 */
NOBODY bool CCSBot::IsSafe(void) const
{
// {
// class CCSBotManager *ctrl; // 908
// GetElapsedRoundTime(const class CCSBotManager *const this); // 910
// }
}
/* <2e9987> ../cstrike/dlls/bot/cs_bot.cpp:920 */
NOBODY bool CCSBot::IsWellPastSafe(void) const
{
// {
// class CCSBotManager *ctrl; // 922
// GetElapsedRoundTime(const class CCSBotManager *const this); // 924
// }
}
/* <2e99d8> ../cstrike/dlls/bot/cs_bot.cpp:934 */
NOBODY bool CCSBot::IsEndOfSafeTime(void) const
{
// IsSafe(const class CCSBot *const this); // 936
}
/* <2e9a3e> ../cstrike/dlls/bot/cs_bot.cpp:943 */
NOBODY float CCSBot::GetSafeTimeRemaining(void) const
{
// {
// class CCSBotManager *ctrl; // 945
// GetElapsedRoundTime(const class CCSBotManager *const this); // 947
// }
}
/* <2e9a8f> ../cstrike/dlls/bot/cs_bot.cpp:954 */
void CCSBot::AdjustSafeTime(void)
{
CCSBotManager *ctrl = TheCSBots();
// if we spotted an enemy sooner than we thought possible, adjust our notion of "safe" time
if (m_safeTime > ctrl->GetElapsedRoundTime())
{
{
// since right now is not safe, adjust safe time to be a few seconds ago
m_safeTime = ctrl->GetElapsedRoundTime() - 2.0f;
}
}
/* <2e9ad0> ../cstrike/dlls/bot/cs_bot.cpp:970 */
NOBODY bool CCSBot::HasNotSeenEnemyForLongTime(void) const
{
// {
// float const longTime; // 972
// GetTimeSinceLastSawEnemy(const class CCSBot *const this); // 973
// }
}
/* <2e9b26> ../cstrike/dlls/bot/cs_bot.cpp:980 */
NOBODY bool CCSBot::GuardRandomZone(float range)
{
// {
// class CCSBotManager *ctrl; // 982
// const class Zone *zone; // 984
// GetRandomZone(const class CCSBotManager *const this); // 984
// {
// class CNavArea *rescueArea; // 987
// }
// }
}
/* <2e9c1f> ../cstrike/dlls/bot/cs_bot.cpp:1066 */
NOBODY const Vector *FindNearbyRetreatSpot(CCSBot *me, float maxRange)
{
// {
// class CNavArea *area; // 1068
// class CollectRetreatSpotsFunctor collector; // 1073
// int which; // 1080
// SearchSurroundingAreas<CollectRetreatSpotsFunctor>(CNavArea *startArea,
// const Vector *startPos,
// class CollectRetreatSpotsFunctor &func,
// float maxRange); // 1074
// }
}
/* <2eaa1d> ../cstrike/dlls/bot/cs_bot.cpp:1116 */
NOBODY float CCSBot::GetRangeToFarthestEscortedHostage(void)
{
// {
// class FarthestHostage away; // 1118
// ForEachHostage<FarthestHostage>(const class CHostageManager *const this,
// class FarthestHostage &func); // 1120
// }
}
}
}
/* <2e9ad0> ../cstrike/dlls/bot/cs_bot.cpp:970 */
NOBODY bool CCSBot::HasNotSeenEnemyForLongTime(void) const
{
// {
// float const longTime; // 972
// GetTimeSinceLastSawEnemy(const class CCSBot *const this); // 973
// }
}
/* <2e9b26> ../cstrike/dlls/bot/cs_bot.cpp:980 */
NOBODY bool CCSBot::GuardRandomZone(float range)
{
// {
// class CCSBotManager *ctrl; // 982
// const class Zone *zone; // 984
// GetRandomZone(const class CCSBotManager *const this); // 984
// {
// class CNavArea *rescueArea; // 987
// }
// }
}
/* <2e9c1f> ../cstrike/dlls/bot/cs_bot.cpp:1066 */
NOBODY const Vector *FindNearbyRetreatSpot(CCSBot *me, float maxRange)
{
// {
// class CNavArea *area; // 1068
// class CollectRetreatSpotsFunctor collector; // 1073
// int which; // 1080
// SearchSurroundingAreas<CollectRetreatSpotsFunctor>(CNavArea *startArea,
// const Vector *startPos,
// class CollectRetreatSpotsFunctor &func,
// float maxRange); // 1074
// }
}
/* <2eaa1d> ../cstrike/dlls/bot/cs_bot.cpp:1116 */
NOBODY float CCSBot::GetRangeToFarthestEscortedHostage(void)
{
// {
// class FarthestHostage away; // 1118
// ForEachHostage<FarthestHostage>(const class CHostageManager *const this,
// class FarthestHostage &func); // 1120
// }
}
#ifdef HOOK_GAMEDLL
void CCSBot::Walk(void)
{
Walk_();
}
bool CCSBot::Jump(bool mustJump)
{
return Jump_(mustJump);
void CCSBot::Walk(void)
{
Walk_();
}
int CCSBot::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{
return TakeDamage_(pevInflictor, pevAttacker, flDamage, bitsDamageType);
}
void CCSBot::Killed(entvars_t *pevAttacker, int iGib)
{
Killed_(pevAttacker, iGib);
bool CCSBot::Jump(bool mustJump)
{
return Jump_(mustJump);
}
int CCSBot::TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{
return TakeDamage_(pevInflictor, pevAttacker, flDamage, bitsDamageType);
}
void CCSBot::Killed(entvars_t *pevAttacker, int iGib)
{
Killed_(pevAttacker, iGib);
}
#endif // HOOK_GAMEDLL

View File

@ -36,11 +36,11 @@
#include "bot/cs_bot_manager.h"
#include "bot/cs_bot_chatter.h"
#define CSBOT_VERSION_MAJOR 1
#define CSBOT_VERSION_MAJOR 1
#define CSBOT_VERSION_MINOR 50
#define FLAG_PROGRESS_DRAW 0x0 // draw status bar progress
#define FLAG_PROGRESS_START 0x1 // init status bar progress
#define FLAG_PROGRESS_DRAW 0x0 // draw status bar progress
#define FLAG_PROGRESS_START 0x1 // init status bar progress
#define FLAG_PROGRESS_HIDE 0x2 // hide status bar progress
#ifdef HOOK_GAMEDLL
@ -53,6 +53,9 @@
extern int _navAreaCount;
extern int _currentIndex;
class CCSBot;
class BotChatterInterface;
/* <3327a8> ../cstrike/dlls/bot/cs_bot.h:44 */
class BotState
{
@ -444,17 +447,17 @@ public:
void Disconnect(void);
float GetCombatRange(void) const
{
return m_combatRange;
return m_combatRange;
}
NOBODY bool IsRogue(void)const;
void SetRogue(bool rogue)
{
{
m_isRogue = rogue;
}
NOBODY bool IsHurrying(void) const;
void Hurry(float duration)
{
m_hurryTimer.Start(duration);
m_hurryTimer.Start(duration);
}
NOBODY bool IsSafe(void) const;
NOBODY bool IsWellPastSafe(void) const;
@ -685,7 +688,7 @@ public:
}
int GetNearbyEnemyCount(void) const
{
return _min(GetEnemiesRemaining(), m_nearbyEnemyCount);
return Q_min(GetEnemiesRemaining(), m_nearbyEnemyCount);
}
unsigned int GetEnemyPlace(void) const
{
@ -698,7 +701,7 @@ public:
}
int GetNearbyFriendCount(void) const
{
return _min(GetFriendsRemaining(), m_nearbyFriendCount);
return Q_min(GetFriendsRemaining(), m_nearbyFriendCount);
}
CBasePlayer *GetClosestVisibleFriend(void) const
{
@ -1061,9 +1064,7 @@ private:
float m_pathLadderDismountTimestamp;
float m_pathLadderEnd;
float m_pathLadderTimestamp;
CountdownTimer m_mustRunTimer;
class CountdownTimer m_mustRunTimer;
CSGameState m_gameState;
byte m_hostageEscortCount;
float m_hostageEscortCountTimestamp;
@ -1403,80 +1404,80 @@ private:
};/* size: 8, cachelines: 1, members: 2 */
/* <568fae> ../cstrike/dlls/bot/states/cs_bot_follow.cpp:95 */
class FollowTargetCollector
{
public:
FollowTargetCollector(CBasePlayer *player)
{
m_player = player;
Vector playerVel = player->pev->velocity;
m_forward.x = playerVel.x;
m_forward.y = playerVel.y;
float speed = m_forward.NormalizeInPlace();
Vector playerOrigin = player->pev->origin;
const float walkSpeed = 100.0f;
if (speed < walkSpeed)
{
m_cutoff.x = playerOrigin.x;
m_cutoff.y = playerOrigin.y;
m_forward.x = 0.0f;
m_forward.y = 0.0f;
}
else
{
const float k = 1.5f; // 2.0f;
float trimSpeed = (speed < 200.0f) ? speed : 200.0f;
m_cutoff.x = playerOrigin.x + k * trimSpeed * m_forward.x;
m_cutoff.y = playerOrigin.y + k * trimSpeed * m_forward.y;
}
m_targetAreaCount = 0;
}
enum { MAX_TARGET_AREAS = 128 };
/* <568dc3> ../cstrike/dlls/bot/states/cs_bot_follow.cpp:124 */
bool operator()(CNavArea *area)
{
if (m_targetAreaCount >= MAX_TARGET_AREAS)
return false;
// only use two-way connections
if (!area->GetParent() || area->IsConnected(area->GetParent(), NUM_DIRECTIONS))
{
if (m_forward.IsZero())
{
m_targetArea[ m_targetAreaCount++ ] = area;
}
else
{
// collect areas in the direction of the player's forward motion
Vector2D to(((*area->GetCenter()).x - m_cutoff.x), (*area->GetCenter()).y - m_cutoff.y);
to.NormalizeInPlace();
//if (DotProduct( to, m_forward ) > 0.7071f)
if ((to.x * m_forward.x + to.y * m_forward.y) > 0.7071f)
m_targetArea[ m_targetAreaCount++ ] = area;
}
}
return (m_targetAreaCount < MAX_TARGET_AREAS);
}
CBasePlayer *m_player;
Vector2D m_forward;
Vector2D m_cutoff;
CNavArea *m_targetArea[ MAX_TARGET_AREAS ];
int m_targetAreaCount;
/* <568fae> ../cstrike/dlls/bot/states/cs_bot_follow.cpp:95 */
class FollowTargetCollector
{
public:
FollowTargetCollector(CBasePlayer *player)
{
m_player = player;
Vector playerVel = player->pev->velocity;
m_forward.x = playerVel.x;
m_forward.y = playerVel.y;
float speed = m_forward.NormalizeInPlace();
Vector playerOrigin = player->pev->origin;
const float walkSpeed = 100.0f;
if (speed < walkSpeed)
{
m_cutoff.x = playerOrigin.x;
m_cutoff.y = playerOrigin.y;
m_forward.x = 0.0f;
m_forward.y = 0.0f;
}
else
{
const float k = 1.5f; // 2.0f;
float trimSpeed = (speed < 200.0f) ? speed : 200.0f;
m_cutoff.x = playerOrigin.x + k * trimSpeed * m_forward.x;
m_cutoff.y = playerOrigin.y + k * trimSpeed * m_forward.y;
}
m_targetAreaCount = 0;
}
enum { MAX_TARGET_AREAS = 128 };
/* <568dc3> ../cstrike/dlls/bot/states/cs_bot_follow.cpp:124 */
bool operator()(CNavArea *area)
{
if (m_targetAreaCount >= MAX_TARGET_AREAS)
return false;
// only use two-way connections
if (!area->GetParent() || area->IsConnected(area->GetParent(), NUM_DIRECTIONS))
{
if (m_forward.IsZero())
{
m_targetArea[ m_targetAreaCount++ ] = area;
}
else
{
// collect areas in the direction of the player's forward motion
Vector2D to(((*area->GetCenter()).x - m_cutoff.x), (*area->GetCenter()).y - m_cutoff.y);
to.NormalizeInPlace();
//if (DotProduct(to, m_forward) > 0.7071f)
if ((to.x * m_forward.x + to.y * m_forward.y) > 0.7071f)
m_targetArea[ m_targetAreaCount++ ] = area;
}
}
return (m_targetAreaCount < MAX_TARGET_AREAS);
}
CBasePlayer *m_player;
Vector2D m_forward;
Vector2D m_cutoff;
CNavArea *m_targetArea[ MAX_TARGET_AREAS ];
int m_targetAreaCount;
};/* size: 536, cachelines: 9, members: 5 */
#ifdef HOOK_GAMEDLL

View File

@ -225,7 +225,7 @@ char *BotPhrase::GetSpeakable(int bankIndex, float *duration) const
// check count criteria
// if this speakable has a count criteria, it must match to be used
// if this speakable does not have a count criteria, we dont care what the count is set to
if (speak->m_count == UNDEFINED_COUNT || speak->m_count == _min(m_countCriteria, COUNT_MANY))
if (speak->m_count == UNDEFINED_COUNT || speak->m_count == Q_min(m_countCriteria, (CountCriteria)COUNT_MANY))
{
if (duration)
*duration = speak->m_duration;
@ -270,7 +270,7 @@ NOBODY void __declspec(naked) BotPhrase::Randomize(void)
//
// BotSpeakable *firstElem = speakables->front();
// int nSize = speakables->size();
//
//
// for (unsigned int index = 1; index < nSize; index++)
// {
// // TODO: check it, need hook std rand
@ -398,58 +398,58 @@ NOBODY BotPhraseManager::~BotPhraseManager(void)
/* <3043ec> ../cstrike/dlls/bot/cs_bot_chatter.cpp:708 */
Place BotPhraseManager::NameToID(const char *name) const
{
for (BotPhraseList::const_iterator iter = m_placeList.begin(); iter != m_placeList.end(); ++iter)
{
const BotPhrase *phrase = *iter;
if (!Q_stricmp(phrase->m_name, name))
return phrase->m_id;
}
for (BotPhraseList::const_iterator iter = m_list.begin(); iter != m_list.end(); ++iter)
{
const BotPhrase *phrase = *iter;
if (!Q_stricmp(phrase->m_name, name))
return phrase->m_id;
}
{
for (BotPhraseList::const_iterator iter = m_placeList.begin(); iter != m_placeList.end(); ++iter)
{
const BotPhrase *phrase = *iter;
if (!Q_stricmp(phrase->m_name, name))
return phrase->m_id;
}
for (BotPhraseList::const_iterator iter = m_list.begin(); iter != m_list.end(); ++iter)
{
const BotPhrase *phrase = *iter;
if (!Q_stricmp(phrase->m_name, name))
return phrase->m_id;
}
return 0;
}
/* <3044b4> ../cstrike/dlls/bot/cs_bot_chatter.cpp:732 */
const char *BotPhraseManager::IDToName(Place id) const
{
for (BotPhraseList::const_iterator iter = m_placeList.begin(); iter != m_placeList.end(); ++iter)
{
const BotPhrase *phrase = *iter;
if (phrase->m_id == id)
return phrase->m_name;
}
for (BotPhraseList::const_iterator iter = m_list.begin(); iter != m_list.end(); ++iter)
{
const BotPhrase *phrase = *iter;
if (phrase->m_id == id)
return phrase->m_name;
}
{
for (BotPhraseList::const_iterator iter = m_placeList.begin(); iter != m_placeList.end(); ++iter)
{
const BotPhrase *phrase = *iter;
if (phrase->m_id == id)
return phrase->m_name;
}
for (BotPhraseList::const_iterator iter = m_list.begin(); iter != m_list.end(); ++iter)
{
const BotPhrase *phrase = *iter;
if (phrase->m_id == id)
return phrase->m_name;
}
return NULL;
}
/* <304597> ../cstrike/dlls/bot/cs_bot_chatter.cpp:758 */
NOBODY const BotPhrase *BotPhraseManager::GetPhrase(const char *name) const
{
for (BotPhraseList::const_iterator iter = m_list.begin(); iter != m_list.end(); ++iter)
{
const BotPhrase *phrase = *iter;
if (!Q_stricmp(phrase->m_name, name))
return phrase;
}
{
for (BotPhraseList::const_iterator iter = m_list.begin(); iter != m_list.end(); ++iter)
{
const BotPhrase *phrase = *iter;
if (!Q_stricmp(phrase->m_name, name))
return phrase;
}
return NULL;
}
@ -459,14 +459,14 @@ NOBODY const BotPhrase *BotPhraseManager::GetPlace(const char *name) const
if (name == NULL)
return NULL;
for (BotPhraseList::const_iterator iter = m_placeList.begin(); iter != m_placeList.end(); ++iter)
{
const BotPhrase *phrase = *iter;
if (!Q_stricmp(phrase->m_name, name))
return phrase;
}
for (BotPhraseList::const_iterator iter = m_placeList.begin(); iter != m_placeList.end(); ++iter)
{
const BotPhrase *phrase = *iter;
if (!Q_stricmp(phrase->m_name, name))
return phrase;
}
return NULL;
}
@ -476,14 +476,14 @@ NOBODY const BotPhrase *BotPhraseManager::GetPlace(PlaceCriteria place) const
if (place == UNDEFINED_PLACE)
return NULL;
for (BotPhraseList::const_iterator iter = m_placeList.begin(); iter != m_placeList.end(); ++iter)
{
const BotPhrase *phrase = *iter;
if (phrase->m_id == place)
return phrase;
}
for (BotPhraseList::const_iterator iter = m_placeList.begin(); iter != m_placeList.end(); ++iter)
{
const BotPhrase *phrase = *iter;
if (phrase->m_id == place)
return phrase;
}
return NULL;
}

File diff suppressed because it is too large Load Diff

View File

@ -114,4 +114,4 @@ void CCSBot::OnEvent(GameEventType event, CBaseEntity *entity, CBaseEntity *othe
OnEvent_(event, entity, other);
}
#endif // HOOK_GAMEDLL
#endif // HOOK_GAMEDLL

View File

@ -20,37 +20,37 @@ void Bot_ServerCommand(void)
/* <333cec> ../cstrike/dlls/bot/cs_bot_init.cpp:81 */
void Bot_RegisterCvars(void)
{
if (UTIL_IsGame("czero"))
{
CVAR_REGISTER(&cv_bot_traceview);
CVAR_REGISTER(&cv_bot_stop);
CVAR_REGISTER(&cv_bot_show_nav);
CVAR_REGISTER(&cv_bot_show_danger);
CVAR_REGISTER(&cv_bot_nav_edit);
CVAR_REGISTER(&cv_bot_nav_zdraw);
CVAR_REGISTER(&cv_bot_walk);
CVAR_REGISTER(&cv_bot_difficulty);
CVAR_REGISTER(&cv_bot_debug);
CVAR_REGISTER(&cv_bot_quicksave);
CVAR_REGISTER(&cv_bot_quota);
CVAR_REGISTER(&cv_bot_quota_match);
CVAR_REGISTER(&cv_bot_prefix);
CVAR_REGISTER(&cv_bot_allow_rogues);
CVAR_REGISTER(&cv_bot_allow_pistols);
CVAR_REGISTER(&cv_bot_allow_shotguns);
CVAR_REGISTER(&cv_bot_allow_sub_machine_guns);
CVAR_REGISTER(&cv_bot_allow_rifles);
CVAR_REGISTER(&cv_bot_allow_machine_guns);
CVAR_REGISTER(&cv_bot_allow_grenades);
CVAR_REGISTER(&cv_bot_allow_snipers);
CVAR_REGISTER(&cv_bot_allow_shield);
CVAR_REGISTER(&cv_bot_join_team);
CVAR_REGISTER(&cv_bot_join_after_player);
CVAR_REGISTER(&cv_bot_auto_vacate);
CVAR_REGISTER(&cv_bot_zombie);
CVAR_REGISTER(&cv_bot_defer_to_human);
CVAR_REGISTER(&cv_bot_chatter);
CVAR_REGISTER(&cv_bot_profile_db);
if (UTIL_IsGame("czero"))
{
CVAR_REGISTER(&cv_bot_traceview);
CVAR_REGISTER(&cv_bot_stop);
CVAR_REGISTER(&cv_bot_show_nav);
CVAR_REGISTER(&cv_bot_show_danger);
CVAR_REGISTER(&cv_bot_nav_edit);
CVAR_REGISTER(&cv_bot_nav_zdraw);
CVAR_REGISTER(&cv_bot_walk);
CVAR_REGISTER(&cv_bot_difficulty);
CVAR_REGISTER(&cv_bot_debug);
CVAR_REGISTER(&cv_bot_quicksave);
CVAR_REGISTER(&cv_bot_quota);
CVAR_REGISTER(&cv_bot_quota_match);
CVAR_REGISTER(&cv_bot_prefix);
CVAR_REGISTER(&cv_bot_allow_rogues);
CVAR_REGISTER(&cv_bot_allow_pistols);
CVAR_REGISTER(&cv_bot_allow_shotguns);
CVAR_REGISTER(&cv_bot_allow_sub_machine_guns);
CVAR_REGISTER(&cv_bot_allow_rifles);
CVAR_REGISTER(&cv_bot_allow_machine_guns);
CVAR_REGISTER(&cv_bot_allow_grenades);
CVAR_REGISTER(&cv_bot_allow_snipers);
CVAR_REGISTER(&cv_bot_allow_shield);
CVAR_REGISTER(&cv_bot_join_team);
CVAR_REGISTER(&cv_bot_join_after_player);
CVAR_REGISTER(&cv_bot_auto_vacate);
CVAR_REGISTER(&cv_bot_zombie);
CVAR_REGISTER(&cv_bot_defer_to_human);
CVAR_REGISTER(&cv_bot_chatter);
CVAR_REGISTER(&cv_bot_profile_db);
}
}
@ -129,7 +129,7 @@ NOBODY void CCSBot::ResetValues(void)
m_areaEnteredTimestamp = 0.0f;
m_currentArea = NULL;
m_lastKnownArea = NULL;
m_avoidFriendTimer.Invalidate();
m_isFriendInTheWay = false;
@ -146,10 +146,10 @@ NOBODY void CCSBot::ResetValues(void)
m_closestVisibleFriend = NULL;
m_closestVisibleHumanFriend = NULL;
for (int w = 0; w < ARRAYSIZE(m_watchInfo); w++)
{
m_watchInfo[w].timestamp = 0.0f;
m_watchInfo[w].isEnemy = false;
for (int w = 0; w < ARRAYSIZE(m_watchInfo); w++)
{
m_watchInfo[w].timestamp = 0.0f;
m_watchInfo[w].isEnemy = false;
}
m_isEnemyVisible = false;
@ -227,8 +227,8 @@ NOBODY void CCSBot::ResetValues(void)
m_taskEntity = NULL;
m_approachPointCount = 0;
m_approachPointViewPosition = Vector(0, 0, 0);
m_approachPointViewPosition = Vector(0, 0, 0);
m_checkedHidingSpotCount = 0;
m_isJumpCrouching = false;
@ -241,7 +241,7 @@ NOBODY void CCSBot::ResetValues(void)
m_huntState.ClearHuntArea();
// adjust morale - if we died, our morale decreased,
// adjust morale - if we died, our morale decreased,
// but if we live, no adjustement (round win/loss also adjusts morale
if (m_diedLastRound)
{
@ -284,27 +284,27 @@ void CCSBot::Disconnect(void)
if (m_processMode)
{
MESSAGE_BEGIN(MSG_ALL, gmsgBotProgress);
WRITE_BYTE(FLAG_PROGRESS_HIDE);
MESSAGE_BEGIN(MSG_ALL, gmsgBotProgress);
WRITE_BYTE(FLAG_PROGRESS_HIDE);
MESSAGE_END();
}
}
#ifdef HOOK_GAMEDLL
bool CCSBot::Initialize(const BotProfile *profile)
{
return Initialize_(profile);
}
void CCSBot::SpawnBot(void)
{
SpawnBot_();
bool CCSBot::Initialize(const BotProfile *profile)
{
return Initialize_(profile);
}
void CCSBot::RoundRespawn(void)
{
RoundRespawn_();
void CCSBot::SpawnBot(void)
{
SpawnBot_();
}
void CCSBot::RoundRespawn(void)
{
RoundRespawn_();
}
#endif // HOOK_GAMEDLL

View File

@ -4,193 +4,193 @@
* Globals initialization
*/
#ifndef HOOK_GAMEDLL
const float updateTimesliceDuration;
#else
#else
const float updateTimesliceDuration = 0.0;//TODO: what value?? check it.
#endif // HOOK_GAMEDLL
int _navAreaCount;
int _navAreaCount;
int _currentIndex;
/* <343cbe> ../cstrike/dlls/bot/cs_bot_learn.cpp:95 */
NOBODY inline class CNavNode *LadderEndSearch(CBaseEntity *entity, const Vector *pos, NavDirType mountDir)
{
// {
// Vector center; // 97
// {
// int d; // 103
// {
// Vector tryPos; // 105
// Vector tryNormal; // 118
// float const fudge; // 123
// TraceResult result; // 124
// }
// }
// }
/* <343cbe> ../cstrike/dlls/bot/cs_bot_learn.cpp:95 */
NOBODY inline class CNavNode *LadderEndSearch(CBaseEntity *entity, const Vector *pos, NavDirType mountDir)
{
// {
// Vector center; // 97
// {
// int d; // 103
// {
// Vector tryPos; // 105
// Vector tryNormal; // 118
// float const fudge; // 123
// TraceResult result; // 124
// }
// }
// }
}
/* <343a56> ../cstrike/dlls/bot/cs_bot_learn.cpp:30 */
NOBODY CNavNode *CCSBot::AddNode(const Vector *destPos, const Vector *normal, NavDirType dir, CNavNode *source)
{
// {
// class CNavNode *node; // 34
// bool useNew; // 37
// float const zTolerance; // 48
// TraceResult result; // 63
// Vector floor; // 64
// Vector ceiling; // 64
// bool crouch; // 65
// MarkAsVisited(CNavNode *const this,
// enum NavDirType dir); // 52
// {
// float y; // 66
// {
// float x; // 68
// }
// }
// SetAttributes(CNavNode *const this,
// unsigned char bits); // 89
// }
/* <343a56> ../cstrike/dlls/bot/cs_bot_learn.cpp:30 */
NOBODY CNavNode *CCSBot::AddNode(const Vector *destPos, const Vector *normal, NavDirType dir, CNavNode *source)
{
// {
// class CNavNode *node; // 34
// bool useNew; // 37
// float const zTolerance; // 48
// TraceResult result; // 63
// Vector floor; // 64
// Vector ceiling; // 64
// bool crouch; // 65
// MarkAsVisited(CNavNode *const this,
// enum NavDirType dir); // 52
// {
// float y; // 66
// {
// float x; // 68
// }
// }
// SetAttributes(CNavNode *const this,
// unsigned char bits); // 89
// }
}
/* <343b40> ../cstrike/dlls/bot/cs_bot_learn.cpp:150 */
NOXREF void drawProgressMeter(float progress, char *title)
{
/* <343b40> ../cstrike/dlls/bot/cs_bot_learn.cpp:150 */
NOXREF void drawProgressMeter(float progress, char *title)
{
MESSAGE_BEGIN(MSG_ALL, gmsgBotProgress);
WRITE_BYTE(FLAG_PROGRESS_DRAW);
WRITE_BYTE((int)progress);
WRITE_BYTE((int)progress);
WRITE_STRING(title);
MESSAGE_END();
}
MESSAGE_END();
}
/* <3435ce> ../cstrike/dlls/bot/cs_bot_learn.cpp:159 */
NOXREF void startProgressMeter(const char *title)
{
/* <3435ce> ../cstrike/dlls/bot/cs_bot_learn.cpp:159 */
NOXREF void startProgressMeter(const char *title)
{
MESSAGE_BEGIN(MSG_ALL, gmsgBotProgress);
WRITE_BYTE(FLAG_PROGRESS_START);
WRITE_STRING(title);
MESSAGE_END();
}
/* <3435a8> ../cstrike/dlls/bot/cs_bot_learn.cpp:167 */
NOXREF void hideProgressMeter(void)
{
MESSAGE_END();
}
/* <3435a8> ../cstrike/dlls/bot/cs_bot_learn.cpp:167 */
NOXREF void hideProgressMeter(void)
{
MESSAGE_BEGIN(MSG_ALL, gmsgBotProgress);
WRITE_BYTE(FLAG_PROGRESS_HIDE);
MESSAGE_END();
}
/* <343b63> ../cstrike/dlls/bot/cs_bot_learn.cpp:182 */
NOBODY void CCSBot::StartLearnProcess(void)
{
// {
// Vector pos; // 192
// Vector normal; // 195
// startProgressMeter(const char *title); // 184
// drawProgressMeter(float progress,
// char *title); // 185
// Vector(Vector *const this,
// const Vector &v); // 192
// SnapToGrid(Vector *pos); // 193
// StartNormalProcess(CCSBot *const this); // 199
// }
MESSAGE_END();
}
/* <343d37> ../cstrike/dlls/bot/cs_bot_learn.cpp:217 */
NOBODY bool CCSBot::LearnStep(void)
{
// {
// int dir; // 249
// {
// float feetOffset; // 256
// Vector pos; // 259
// int cx; // 262
// int cy; // 263
// TraceResult result; // 283
// Vector from; // 284
// Vector to; // 284
// Vector toNormal; // 289
// Vector fromOrigin; // 298
// Vector toOrigin; // 299
// bool walkable; // 303
// IsEntityWalkable(entvars_t *entity,
// unsigned int flags); // 362
// {
// float toGround; // 309
// float fromGround; // 310
// float epsilon; // 312
// {
// Vector delta; // 322
// float const inc; // 323
// float along; // 324
// bool done; // 325
// float ground; // 326
// Vector normal; // 327
// operator-(const Vector *const this,
// const Vector &v); // 322
// {
// Vector p; // 333
// operator*(const Vector *const this,
// float fl); // 343
// operator+(const Vector *const this,
// const Vector &v); // 343
// }
// }
// }
// VARS(edict_t *pent); // 362
// GetFeetZ(const class CCSBot *const this); // 256
// Vector(Vector *const this,
// const Vector &v); // 259
// MarkAsVisited(CNavNode *const this,
// enum NavDirType dir); // 280
// operator+(const Vector *const this,
// const Vector &v); // 294
// operator+(const Vector *const this,
// const Vector &v); // 298
// operator+(const Vector *const this,
// const Vector &v); // 299
// {
// class CNavNode *newNode; // 376
// AddNode(CCSBot *const this,
// const Vector *destPos,
// const Vector *normal,
// enum NavDirType dir,
// class CNavNode *source); // 376
// }
// }
// HasVisited(CNavNode *const this,
// enum NavDirType dir); // 251
// }
// {
// iterator iter; // 225
// {
// class CNavLadder *ladder; // 227
// LadderEndSearch(CBaseEntity *entity,
// const Vector *pos,
// enum NavDirType mountDir); // 230
// LadderEndSearch(CBaseEntity *entity,
// const Vector *pos,
// enum NavDirType mountDir); // 234
// }
// operator++(_List_iterator<CNavLadder*> *const this); // 225
// }
/* <343b63> ../cstrike/dlls/bot/cs_bot_learn.cpp:182 */
NOBODY void CCSBot::StartLearnProcess(void)
{
// {
// Vector pos; // 192
// Vector normal; // 195
// startProgressMeter(const char *title); // 184
// drawProgressMeter(float progress,
// char *title); // 185
// Vector(Vector *const this,
// const Vector &v); // 192
// SnapToGrid(Vector *pos); // 193
// StartNormalProcess(CCSBot *const this); // 199
// }
}
/* <34489e> ../cstrike/dlls/bot/cs_bot_learn.cpp:392 */
NOBODY void CCSBot::UpdateLearnProcess(void)
{
// {
// float startTime; // 394
// }
/* <343d37> ../cstrike/dlls/bot/cs_bot_learn.cpp:217 */
NOBODY bool CCSBot::LearnStep(void)
{
// {
// int dir; // 249
// {
// float feetOffset; // 256
// Vector pos; // 259
// int cx; // 262
// int cy; // 263
// TraceResult result; // 283
// Vector from; // 284
// Vector to; // 284
// Vector toNormal; // 289
// Vector fromOrigin; // 298
// Vector toOrigin; // 299
// bool walkable; // 303
// IsEntityWalkable(entvars_t *entity,
// unsigned int flags); // 362
// {
// float toGround; // 309
// float fromGround; // 310
// float epsilon; // 312
// {
// Vector delta; // 322
// float const inc; // 323
// float along; // 324
// bool done; // 325
// float ground; // 326
// Vector normal; // 327
// operator-(const Vector *const this,
// const Vector &v); // 322
// {
// Vector p; // 333
// operator*(const Vector *const this,
// float fl); // 343
// operator+(const Vector *const this,
// const Vector &v); // 343
// }
// }
// }
// VARS(edict_t *pent); // 362
// GetFeetZ(const class CCSBot *const this); // 256
// Vector(Vector *const this,
// const Vector &v); // 259
// MarkAsVisited(CNavNode *const this,
// enum NavDirType dir); // 280
// operator+(const Vector *const this,
// const Vector &v); // 294
// operator+(const Vector *const this,
// const Vector &v); // 298
// operator+(const Vector *const this,
// const Vector &v); // 299
// {
// class CNavNode *newNode; // 376
// AddNode(CCSBot *const this,
// const Vector *destPos,
// const Vector *normal,
// enum NavDirType dir,
// class CNavNode *source); // 376
// }
// }
// HasVisited(CNavNode *const this,
// enum NavDirType dir); // 251
// }
// {
// iterator iter; // 225
// {
// class CNavLadder *ladder; // 227
// LadderEndSearch(CBaseEntity *entity,
// const Vector *pos,
// enum NavDirType mountDir); // 230
// LadderEndSearch(CBaseEntity *entity,
// const Vector *pos,
// enum NavDirType mountDir); // 234
// }
// operator++(_List_iterator<CNavLadder*> *const this); // 225
// }
}
/* <344750> ../cstrike/dlls/bot/cs_bot_learn.cpp:409 */
void CCSBot::StartAnalyzeAlphaProcess(void)
{
/* <34489e> ../cstrike/dlls/bot/cs_bot_learn.cpp:392 */
NOBODY void CCSBot::UpdateLearnProcess(void)
{
// {
// float startTime; // 394
// }
}
/* <344750> ../cstrike/dlls/bot/cs_bot_learn.cpp:409 */
void CCSBot::StartAnalyzeAlphaProcess(void)
{
m_processMode = PROCESS_ANALYZE_ALPHA;
m_analyzeIter = TheNavAreaList.begin();
@ -201,80 +201,80 @@ void CCSBot::StartAnalyzeAlphaProcess(void)
DestroyHidingSpots();
startProgressMeter("#CZero_AnalyzingHidingSpots");
drawProgressMeter(0, "#CZero_AnalyzingHidingSpots");
drawProgressMeter(0, "#CZero_AnalyzingHidingSpots");
}
/* <34396c> ../cstrike/dlls/bot/cs_bot_learn.cpp:427 */
NOBODY inline bool CCSBot::AnalyzeAlphaStep(void)
{
// {
// class CNavArea *area; // 432
// }
/* <34396c> ../cstrike/dlls/bot/cs_bot_learn.cpp:427 */
NOBODY inline bool CCSBot::AnalyzeAlphaStep(void)
{
// {
// class CNavArea *area; // 432
// }
}
/* <3448de> ../cstrike/dlls/bot/cs_bot_learn.cpp:443 */
NOBODY void CCSBot::UpdateAnalyzeAlphaProcess(void)
{
// {
// float startTime; // 445
// float progress; // 462
// AnalyzeAlphaStep(CCSBot *const this); // 451
// drawProgressMeter(float progress,
// char *title); // 454
// StartAnalyzeBetaProcess(CCSBot *const this); // 456
// drawProgressMeter(float progress,
// char *title); // 463
// }
/* <3448de> ../cstrike/dlls/bot/cs_bot_learn.cpp:443 */
NOBODY void CCSBot::UpdateAnalyzeAlphaProcess(void)
{
// {
// float startTime; // 445
// float progress; // 462
// AnalyzeAlphaStep(CCSBot *const this); // 451
// drawProgressMeter(float progress,
// char *title); // 454
// StartAnalyzeBetaProcess(CCSBot *const this); // 456
// drawProgressMeter(float progress,
// char *title); // 463
// }
}
/* <344aed> ../cstrike/dlls/bot/cs_bot_learn.cpp:467 */
NOBODY void CCSBot::StartAnalyzeBetaProcess(void)
{
// size(const class list<CNavArea*, std::allocator<CNavArea*>> *const this); // 471
/* <344aed> ../cstrike/dlls/bot/cs_bot_learn.cpp:467 */
NOBODY void CCSBot::StartAnalyzeBetaProcess(void)
{
// size(const class list<CNavArea*, std::allocator<CNavArea*>> *const this); // 471
}
/* <3437c8> ../cstrike/dlls/bot/cs_bot_learn.cpp:479 */
NOBODY inline bool CCSBot::AnalyzeBetaStep(void)
{
// {
// class CNavArea *area; // 484
// }
/* <3437c8> ../cstrike/dlls/bot/cs_bot_learn.cpp:479 */
NOBODY inline bool CCSBot::AnalyzeBetaStep(void)
{
// {
// class CNavArea *area; // 484
// }
}
/* <344b8d> ../cstrike/dlls/bot/cs_bot_learn.cpp:495 */
NOBODY void CCSBot::UpdateAnalyzeBetaProcess(void)
{
// {
// float startTime; // 497
// float progress; // 512
// AnalyzeBetaStep(CCSBot *const this); // 503
// drawProgressMeter(float progress,
// char *title); // 506
// StartSaveProcess(CCSBot *const this); // 507
// drawProgressMeter(float progress,
// char *title); // 513
// }
/* <344b8d> ../cstrike/dlls/bot/cs_bot_learn.cpp:495 */
NOBODY void CCSBot::UpdateAnalyzeBetaProcess(void)
{
// {
// float startTime; // 497
// float progress; // 512
// AnalyzeBetaStep(CCSBot *const this); // 503
// drawProgressMeter(float progress,
// char *title); // 506
// StartSaveProcess(CCSBot *const this); // 507
// drawProgressMeter(float progress,
// char *title); // 513
// }
}
/* <344d1f> ../cstrike/dlls/bot/cs_bot_learn.cpp:517 */
NOBODY void CCSBot::StartSaveProcess(void)
{
}
/* <344d41> ../cstrike/dlls/bot/cs_bot_learn.cpp:527 */
NOBODY void CCSBot::UpdateSaveProcess(void)
{
// {
// char filename; // 530
// char msg; // 538
// char cmd; // 548
// hideProgressMeter(void); // 542
// StartNormalProcess(CCSBot *const this); // 545
// }
/* <344d1f> ../cstrike/dlls/bot/cs_bot_learn.cpp:517 */
NOBODY void CCSBot::StartSaveProcess(void)
{
}
/* <344e24> ../cstrike/dlls/bot/cs_bot_learn.cpp:554 */
void CCSBot::StartNormalProcess(void)
{
m_processMode = PROCESS_NORMAL;
}
/* <344d41> ../cstrike/dlls/bot/cs_bot_learn.cpp:527 */
NOBODY void CCSBot::UpdateSaveProcess(void)
{
// {
// char filename; // 530
// char msg; // 538
// char cmd; // 548
// hideProgressMeter(void); // 542
// StartNormalProcess(CCSBot *const this); // 545
// }
}
/* <344e24> ../cstrike/dlls/bot/cs_bot_learn.cpp:554 */
void CCSBot::StartNormalProcess(void)
{
m_processMode = PROCESS_NORMAL;
}

View File

@ -29,7 +29,7 @@ NOBODY bool CCSBot::ShouldInvestigateNoise(float *retNoiseDist)
}
/* <354c8d> ../cstrike/dlls/bot/cs_bot_listen.cpp:104 */
NOBODY bool CCSBot::CanHearNearbyEnemyGunfire( float range)
NOBODY bool CCSBot::CanHearNearbyEnemyGunfire(float range)
{
// {
// float gunfireDistSq; // 125

View File

@ -7,39 +7,39 @@
CBotManager *TheBots = NULL;
cvar_t cv_bot_traceview = { "bot_traceview", "0", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_stop = { "bot_stop", "0", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_show_nav = { "bot_show_nav", "0", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_show_danger = { "bot_show_danger", "0", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_nav_edit = { "bot_nav_edit", "0", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_nav_zdraw = { "bot_nav_zdraw", "4", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_walk = { "bot_walk", "0", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_difficulty = { "bot_difficulty", "0", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_debug = { "bot_debug", "0", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_quicksave = { "bot_quicksave", "0", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_quota = { "bot_quota", "0", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_quota_match = { "bot_quota_match", "0", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_prefix = { "bot_prefix", "", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_allow_rogues = { "bot_allow_rogues", "1", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_allow_pistols = { "bot_allow_pistols", "1", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_allow_shotguns = { "bot_allow_shotguns", "1", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_allow_sub_machine_guns = { "bot_allow_sub_machine_guns", "1", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_allow_rifles = { "bot_allow_rifles", "1", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_allow_machine_guns = { "bot_allow_machine_guns", "1", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_allow_grenades = { "bot_allow_grenades", "1", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_allow_snipers = { "bot_allow_snipers", "1", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_allow_shield = { "bot_allow_shield", "1", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_join_team = { "bot_join_team", "any", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_join_after_player = { &unk_1EF09A, "1", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_auto_vacate = { "bot_auto_vacate", "1", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_zombie = { "bot_zombie", "0", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_defer_to_human = { "bot_defer_to_human", "0", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_chatter = { "bot_chatter", "normal", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_traceview = { "bot_traceview", "0", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_stop = { "bot_stop", "0", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_show_nav = { "bot_show_nav", "0", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_show_danger = { "bot_show_danger", "0", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_nav_edit = { "bot_nav_edit", "0", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_nav_zdraw = { "bot_nav_zdraw", "4", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_walk = { "bot_walk", "0", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_difficulty = { "bot_difficulty", "0", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_debug = { "bot_debug", "0", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_quicksave = { "bot_quicksave", "0", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_quota = { "bot_quota", "0", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_quota_match = { "bot_quota_match", "0", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_prefix = { "bot_prefix", "", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_allow_rogues = { "bot_allow_rogues", "1", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_allow_pistols = { "bot_allow_pistols", "1", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_allow_shotguns = { "bot_allow_shotguns", "1", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_allow_sub_machine_guns = { "bot_allow_sub_machine_guns", "1", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_allow_rifles = { "bot_allow_rifles", "1", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_allow_machine_guns = { "bot_allow_machine_guns", "1", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_allow_grenades = { "bot_allow_grenades", "1", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_allow_snipers = { "bot_allow_snipers", "1", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_allow_shield = { "bot_allow_shield", "1", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_join_team = { "bot_join_team", "any", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_join_after_player = { &unk_1EF09A, "1", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_auto_vacate = { "bot_auto_vacate", "1", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_zombie = { "bot_zombie", "0", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_defer_to_human = { "bot_defer_to_human", "0", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_chatter = { "bot_chatter", "normal", FCVAR_SERVER, 0.0f, NULL };
cvar_t cv_bot_profile_db = { "bot_profile_db", "BotProfile.db", FCVAR_SERVER, 0.0f, NULL };
float CCSBotManager::m_flNextCVarCheck;
bool CCSBotManager::m_isMapDataLoaded;
bool CCSBotManager::m_isLearningMap;
float CCSBotManager::m_flNextCVarCheck;
bool CCSBotManager::m_isMapDataLoaded;
bool CCSBotManager::m_isLearningMap;
bool CCSBotManager::m_isAnalysisRequested;
NavEditCmdType CCSBotManager::m_editCmd;
@ -47,39 +47,39 @@ NavEditCmdType CCSBotManager::m_editCmd;
CBotManager *TheBots;
cvar_t cv_bot_traceview;
cvar_t cv_bot_stop;
cvar_t cv_bot_show_nav;
cvar_t cv_bot_show_danger;
cvar_t cv_bot_nav_edit;
cvar_t cv_bot_nav_zdraw;
cvar_t cv_bot_walk;
cvar_t cv_bot_difficulty;
cvar_t cv_bot_debug;
cvar_t cv_bot_quicksave;
cvar_t cv_bot_quota;
cvar_t cv_bot_quota_match;
cvar_t cv_bot_prefix;
cvar_t cv_bot_allow_rogues;
cvar_t cv_bot_allow_pistols;
cvar_t cv_bot_allow_shotguns;
cvar_t cv_bot_allow_sub_machine_guns;
cvar_t cv_bot_allow_rifles;
cvar_t cv_bot_allow_machine_guns;
cvar_t cv_bot_allow_grenades;
cvar_t cv_bot_allow_snipers;
cvar_t cv_bot_allow_shield;
cvar_t cv_bot_join_team;
cvar_t cv_bot_join_after_player;
cvar_t cv_bot_auto_vacate;
cvar_t cv_bot_zombie;
cvar_t cv_bot_defer_to_human;
cvar_t cv_bot_chatter;
cvar_t cv_bot_traceview;
cvar_t cv_bot_stop;
cvar_t cv_bot_show_nav;
cvar_t cv_bot_show_danger;
cvar_t cv_bot_nav_edit;
cvar_t cv_bot_nav_zdraw;
cvar_t cv_bot_walk;
cvar_t cv_bot_difficulty;
cvar_t cv_bot_debug;
cvar_t cv_bot_quicksave;
cvar_t cv_bot_quota;
cvar_t cv_bot_quota_match;
cvar_t cv_bot_prefix;
cvar_t cv_bot_allow_rogues;
cvar_t cv_bot_allow_pistols;
cvar_t cv_bot_allow_shotguns;
cvar_t cv_bot_allow_sub_machine_guns;
cvar_t cv_bot_allow_rifles;
cvar_t cv_bot_allow_machine_guns;
cvar_t cv_bot_allow_grenades;
cvar_t cv_bot_allow_snipers;
cvar_t cv_bot_allow_shield;
cvar_t cv_bot_join_team;
cvar_t cv_bot_join_after_player;
cvar_t cv_bot_auto_vacate;
cvar_t cv_bot_zombie;
cvar_t cv_bot_defer_to_human;
cvar_t cv_bot_chatter;
cvar_t cv_bot_profile_db;
float (*CCSBotManager::pm_flNextCVarCheck);
bool (*CCSBotManager::pm_isMapDataLoaded);
bool (*CCSBotManager::pm_isLearningMap);
float (*CCSBotManager::pm_flNextCVarCheck);
bool (*CCSBotManager::pm_isMapDataLoaded);
bool (*CCSBotManager::pm_isLearningMap);
bool (*CCSBotManager::pm_isAnalysisRequested);
NavEditCmdType (*CCSBotManager::pm_editCmd);
@ -114,27 +114,27 @@ NOBODY CCSBotManager::CCSBotManager(void)
/* <36b22a> ../cstrike/dlls/bot/cs_bot_manager.cpp:111 */
void CCSBotManager::__MAKE_VHOOK(RestartRound)(void)
{
// extend
CBotManager::RestartRound();
SetLooseBomb(NULL);
m_isBombPlanted = false;
m_bombDefuser = NULL;
m_earliestBombPlantTimestamp = gpGlobals->time + RANDOM_FLOAT(10, 30);
IMPLEMENT_ARRAY(m_editCmd) = EDIT_NONE;
ResetRadioMessageTimestamps();
m_lastSeenEnemyTimestamp = -9999.9f;
m_roundStartTimestamp = gpGlobals->time + CVAR_GET_FLOAT("mp_freezetime");
// randomly decide if defensive team wants to "rush" as a whole
const float defenseRushChance = 33.3f; // 25.0f;
m_isDefenseRushing = (RANDOM_FLOAT(0, 100) <= defenseRushChance) ? true : false;
TheBotPhrases->OnRoundRestart();
// extend
CBotManager::RestartRound();
SetLooseBomb(NULL);
m_isBombPlanted = false;
m_bombDefuser = NULL;
m_earliestBombPlantTimestamp = gpGlobals->time + RANDOM_FLOAT(10, 30);
IMPLEMENT_ARRAY(m_editCmd) = EDIT_NONE;
ResetRadioMessageTimestamps();
m_lastSeenEnemyTimestamp = -9999.9f;
m_roundStartTimestamp = gpGlobals->time + CVAR_GET_FLOAT("mp_freezetime");
// randomly decide if defensive team wants to "rush" as a whole
const float defenseRushChance = 33.3f; // 25.0f;
m_isDefenseRushing = (RANDOM_FLOAT(0, 100) <= defenseRushChance) ? true : false;
TheBotPhrases->OnRoundRestart();
m_isRoundOver = false;
m_isRespawnStarted = false;
m_canRespawn = true;
@ -176,17 +176,17 @@ bool CCSBotManager::IsWeaponUseable(CBasePlayerItem *item) const
{
int weaponClass = WeaponIDToWeaponClass(item->m_iId);
if ((!AllowShotguns() && weaponClass == WEAPONCLASS_SHOTGUN)
|| (!AllowMachineGuns() && weaponClass == WEAPONCLASS_MACHINEGUN)
|| (!AllowRifles() && weaponClass == WEAPONCLASS_RIFLE)
//|| (!AllowShotguns() && weaponClass == WEAPONCLASS_SHOTGUN) // TODO: already is checked shotguns!
|| (!AllowSnipers() && weaponClass == WEAPONCLASS_SNIPERRIFLE)
|| (!AllowSubMachineGuns() && weaponClass == WEAPONCLASS_SUBMACHINEGUN)
|| (!AllowTacticalShield() && item->m_iId == WEAPON_SHIELDGUN)
|| (!AllowPistols() && weaponClass == WEAPONCLASS_PISTOL)
|| (!AllowGrenades() && weaponClass == WEAPONCLASS_GRENADE))
{
return false;
if ((!AllowShotguns() && weaponClass == WEAPONCLASS_SHOTGUN)
|| (!AllowMachineGuns() && weaponClass == WEAPONCLASS_MACHINEGUN)
|| (!AllowRifles() && weaponClass == WEAPONCLASS_RIFLE)
//|| (!AllowShotguns() && weaponClass == WEAPONCLASS_SHOTGUN) // TODO: already is checked shotguns!
|| (!AllowSnipers() && weaponClass == WEAPONCLASS_SNIPERRIFLE)
|| (!AllowSubMachineGuns() && weaponClass == WEAPONCLASS_SUBMACHINEGUN)
|| (!AllowTacticalShield() && item->m_iId == WEAPON_SHIELDGUN)
|| (!AllowPistols() && weaponClass == WEAPONCLASS_PISTOL)
|| (!AllowGrenades() && weaponClass == WEAPONCLASS_GRENADE))
{
return false;
}
}
@ -248,46 +248,46 @@ void CCSBotManager::__MAKE_VHOOK(AddServerCommands)(void)
if (UTIL_IsGame("czero"))
{
AddServerCommand("bot_about");
AddServerCommand("bot_add");
AddServerCommand("bot_add_t");
AddServerCommand("bot_add_ct");
AddServerCommand("bot_kill");
AddServerCommand("bot_kick");
AddServerCommand("bot_knives_only");
AddServerCommand("bot_pistols_only");
AddServerCommand("bot_snipers_only");
AddServerCommand("bot_all_weapons");
AddServerCommand("entity_dump");
AddServerCommand("bot_nav_delete");
AddServerCommand("bot_nav_split");
AddServerCommand("bot_nav_merge");
AddServerCommand("bot_nav_mark");
AddServerCommand("bot_nav_begin_area");
AddServerCommand("bot_nav_end_area");
AddServerCommand("bot_nav_connect");
AddServerCommand("bot_nav_disconnect");
AddServerCommand("bot_nav_splice");
AddServerCommand("bot_nav_crouch");
AddServerCommand("bot_nav_jump");
AddServerCommand("bot_nav_precise");
AddServerCommand("bot_nav_no_jump");
AddServerCommand("bot_nav_analyze");
AddServerCommand("bot_nav_strip");
AddServerCommand("bot_nav_save");
AddServerCommand("bot_nav_load");
AddServerCommand("bot_nav_use_place");
AddServerCommand("bot_nav_place_floodfill");
AddServerCommand("bot_nav_place_pick");
AddServerCommand("bot_nav_toggle_place_mode");
AddServerCommand("bot_nav_toggle_place_painting");
AddServerCommand("bot_goto_mark");
AddServerCommand("bot_memory_usage");
AddServerCommand("bot_nav_mark_unnamed");
AddServerCommand("bot_nav_warp");
AddServerCommand("bot_nav_corner_select");
AddServerCommand("bot_nav_corner_raise");
AddServerCommand("bot_nav_corner_lower");
AddServerCommand("bot_about");
AddServerCommand("bot_add");
AddServerCommand("bot_add_t");
AddServerCommand("bot_add_ct");
AddServerCommand("bot_kill");
AddServerCommand("bot_kick");
AddServerCommand("bot_knives_only");
AddServerCommand("bot_pistols_only");
AddServerCommand("bot_snipers_only");
AddServerCommand("bot_all_weapons");
AddServerCommand("entity_dump");
AddServerCommand("bot_nav_delete");
AddServerCommand("bot_nav_split");
AddServerCommand("bot_nav_merge");
AddServerCommand("bot_nav_mark");
AddServerCommand("bot_nav_begin_area");
AddServerCommand("bot_nav_end_area");
AddServerCommand("bot_nav_connect");
AddServerCommand("bot_nav_disconnect");
AddServerCommand("bot_nav_splice");
AddServerCommand("bot_nav_crouch");
AddServerCommand("bot_nav_jump");
AddServerCommand("bot_nav_precise");
AddServerCommand("bot_nav_no_jump");
AddServerCommand("bot_nav_analyze");
AddServerCommand("bot_nav_strip");
AddServerCommand("bot_nav_save");
AddServerCommand("bot_nav_load");
AddServerCommand("bot_nav_use_place");
AddServerCommand("bot_nav_place_floodfill");
AddServerCommand("bot_nav_place_pick");
AddServerCommand("bot_nav_toggle_place_mode");
AddServerCommand("bot_nav_toggle_place_painting");
AddServerCommand("bot_goto_mark");
AddServerCommand("bot_memory_usage");
AddServerCommand("bot_nav_mark_unnamed");
AddServerCommand("bot_nav_warp");
AddServerCommand("bot_nav_corner_select");
AddServerCommand("bot_nav_corner_raise");
AddServerCommand("bot_nav_corner_lower");
AddServerCommand("bot_nav_check_consistency");
}
}
@ -300,22 +300,22 @@ void CCSBotManager::__MAKE_VHOOK(ServerDeactivate)(void)
/* <36b5fa> ../cstrike/dlls/bot/cs_bot_manager.cpp:415 */
void CCSBotManager::__MAKE_VHOOK(ClientDisconnect)(CBasePlayer *pPlayer)
{
{
if (!pPlayer || !pPlayer->IsBot())
return;
return;
CCSBot *pBot = static_cast<CCSBot *>(pPlayer);
entvars_t *temp = VARS(pPlayer->edict());
pBot->Disconnect();
if (pPlayer->pev->classname)
RemoveEntityHashValue(pPlayer->pev, STRING(pPlayer->pev->classname), CLASSNAME);
FREE_PRIVATE(pPlayer->edict());
CBasePlayer *player = GetClassPtr((CBasePlayer *)temp);
AddEntityHashValue(player->pev, STRING(player->pev->classname), CLASSNAME);
pBot->Disconnect();
if (pPlayer->pev->classname)
RemoveEntityHashValue(pPlayer->pev, STRING(pPlayer->pev->classname), CLASSNAME);
FREE_PRIVATE(pPlayer->edict());
CBasePlayer *player = GetClassPtr((CBasePlayer *)temp);
AddEntityHashValue(player->pev, STRING(player->pev->classname), CLASSNAME);
player->pev->flags = FL_DORMANT;
}
@ -328,7 +328,7 @@ void PrintAllEntities(void)
if (!edict || FStringNull(edict->v.classname))
continue;
CONSOLE_ECHO(" %s\n", STRING(edict->v.classname));
}
}
@ -478,61 +478,61 @@ void CCSBotManager::__MAKE_VHOOK(ServerCommand)(const char *pcmd)
{
PrintAllEntities();
}
else if (FStrEq(pcmd, "bot_nav_delete"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_DELETE;
}
else if (FStrEq(pcmd, "bot_nav_split"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_SPLIT;
}
else if (FStrEq(pcmd, "bot_nav_merge"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_MERGE;
}
else if (FStrEq(pcmd, "bot_nav_mark"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_MARK;
}
else if (FStrEq(pcmd, "bot_nav_begin_area"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_BEGIN_AREA;
}
else if (FStrEq(pcmd, "bot_nav_end_area"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_END_AREA;
}
else if (FStrEq(pcmd, "bot_nav_connect"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_CONNECT;
}
else if (FStrEq(pcmd, "bot_nav_disconnect"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_DISCONNECT;
}
else if (FStrEq(pcmd, "bot_nav_splice"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_SPLICE;
}
else if (FStrEq(pcmd, "bot_nav_crouch"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_ATTRIB_CROUCH;
}
else if (FStrEq(pcmd, "bot_nav_jump"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_ATTRIB_JUMP;
}
else if (FStrEq(pcmd, "bot_nav_precise"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_ATTRIB_PRECISE;
}
else if (FStrEq(pcmd, "bot_nav_no_jump"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_ATTRIB_NO_JUMP;
}
else if (FStrEq(pcmd, "bot_nav_analyze"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_isAnalysisRequested) = true;
else if (FStrEq(pcmd, "bot_nav_delete"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_DELETE;
}
else if (FStrEq(pcmd, "bot_nav_split"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_SPLIT;
}
else if (FStrEq(pcmd, "bot_nav_merge"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_MERGE;
}
else if (FStrEq(pcmd, "bot_nav_mark"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_MARK;
}
else if (FStrEq(pcmd, "bot_nav_begin_area"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_BEGIN_AREA;
}
else if (FStrEq(pcmd, "bot_nav_end_area"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_END_AREA;
}
else if (FStrEq(pcmd, "bot_nav_connect"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_CONNECT;
}
else if (FStrEq(pcmd, "bot_nav_disconnect"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_DISCONNECT;
}
else if (FStrEq(pcmd, "bot_nav_splice"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_SPLICE;
}
else if (FStrEq(pcmd, "bot_nav_crouch"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_ATTRIB_CROUCH;
}
else if (FStrEq(pcmd, "bot_nav_jump"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_ATTRIB_JUMP;
}
else if (FStrEq(pcmd, "bot_nav_precise"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_ATTRIB_PRECISE;
}
else if (FStrEq(pcmd, "bot_nav_no_jump"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_ATTRIB_NO_JUMP;
}
else if (FStrEq(pcmd, "bot_nav_analyze"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_isAnalysisRequested) = true;
}
else if (FStrEq(pcmd, "bot_nav_strip"))
{
@ -609,23 +609,23 @@ void CCSBotManager::__MAKE_VHOOK(ServerCommand)(const char *pcmd)
}
}
}
else if (FStrEq(pcmd, "bot_nav_toggle_place_mode"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_TOGGLE_PLACE_MODE;
}
else if (FStrEq(pcmd, "bot_nav_place_floodfill"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_PLACE_FLOODFILL;
}
else if (FStrEq(pcmd, "bot_nav_place_pick"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_PLACE_PICK;
}
else if (FStrEq(pcmd, "bot_nav_toggle_place_painting"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_TOGGLE_PLACE_PAINTING;
else if (FStrEq(pcmd, "bot_nav_toggle_place_mode"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_TOGGLE_PLACE_MODE;
}
else if (FStrEq(pcmd, "bot_goto_mark"))
else if (FStrEq(pcmd, "bot_nav_place_floodfill"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_PLACE_FLOODFILL;
}
else if (FStrEq(pcmd, "bot_nav_place_pick"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_PLACE_PICK;
}
else if (FStrEq(pcmd, "bot_nav_toggle_place_painting"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_TOGGLE_PLACE_PAINTING;
}
else if (FStrEq(pcmd, "bot_goto_mark"))
{
// tell the first bot we find to go to our marked area
CNavArea *area = GetMarkedArea();// TODO: reverse me
@ -651,7 +651,7 @@ void CCSBotManager::__MAKE_VHOOK(ServerCommand)(const char *pcmd)
}
}
}
else if (FStrEq(pcmd, "bot_memory_usage"))
else if (FStrEq(pcmd, "bot_memory_usage"))
{
CONSOLE_ECHO("Memory usage:\n");
CONSOLE_ECHO(" %d bytes per bot\b", sizeof(CCSBot));
@ -681,27 +681,27 @@ void CCSBotManager::__MAKE_VHOOK(ServerCommand)(const char *pcmd)
CONSOLE_ECHO(" Encounter Spot data = %d bytes\n", encounterMem);
}
else if (FStrEq(pcmd, "bot_nav_mark_unnamed"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_MARK_UNNAMED;
}
else if (FStrEq(pcmd, "bot_nav_warp"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_WARP_TO_MARK;
}
else if (FStrEq(pcmd, "bot_nav_corner_select"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_SELECT_CORNER;
}
else if (FStrEq(pcmd, "bot_nav_corner_raise"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_RAISE_CORNER;
}
else if (FStrEq(pcmd, "bot_nav_corner_lower"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_LOWER_CORNER;
else if (FStrEq(pcmd, "bot_nav_mark_unnamed"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_MARK_UNNAMED;
}
else if (FStrEq(pcmd, "bot_nav_check_consistency"))
else if (FStrEq(pcmd, "bot_nav_warp"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_WARP_TO_MARK;
}
else if (FStrEq(pcmd, "bot_nav_corner_select"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_SELECT_CORNER;
}
else if (FStrEq(pcmd, "bot_nav_corner_raise"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_RAISE_CORNER;
}
else if (FStrEq(pcmd, "bot_nav_corner_lower"))
{
IMPLEMENT_ARRAY_CLASS(CCSBotManager, m_editCmd) = EDIT_LOWER_CORNER;
}
else if (FStrEq(pcmd, "bot_nav_check_consistency"))
{
if (CMD_ARGC() != 2)
{
@ -721,17 +721,17 @@ NOBODY bool CCSBotManager::BotAddCommand(BotProfileTeamType team, bool isFromCon
const BotProfile *profile = NULL;
if (!isFromConsole || CMD_ARGC() < 2)
if (!isFromConsole || CMD_ARGC() < 2)
{
if (team == BOT_TEAM_ANY)
{
// if team not specified, check cv_bot_join_team cvar for preference
if (!Q_stricmp(cv_bot_join_team.string, "T"))
team = BOT_TEAM_T;
else if (!Q_stricmp(cv_bot_join_team.string, "CT"))
team = BOT_TEAM_CT;
else
if (!Q_stricmp(cv_bot_join_team.string, "T"))
team = BOT_TEAM_T;
else if (!Q_stricmp(cv_bot_join_team.string, "CT"))
team = BOT_TEAM_CT;
else
{
TeamName defaultTeam = SelectDefaultTeam();
@ -761,17 +761,17 @@ NOBODY bool CCSBotManager::BotAddCommand(BotProfileTeamType team, bool isFromCon
if (mp && mp->IsCareer())
ignoreHumans = true;
if (UTIL_IsNameTaken(CMD_ARGV(1), ignoreHumans))
if (UTIL_IsNameTaken(CMD_ARGV(1), ignoreHumans))
{
CONSOLE_ECHO("Error - %s is already in the game.\n", CMD_ARGV(1));
return true;
}
profile = TheBotProfiles->GetProfile(CMD_ARGV(1), team);
if (profile == NULL)
{
CONSOLE_ECHO("Error - no profile for '%s' exists.\n", CMD_ARGV(1));
return true;
profile = TheBotProfiles->GetProfile(CMD_ARGV(1), team);
if (profile == NULL)
{
CONSOLE_ECHO("Error - no profile for '%s' exists.\n", CMD_ARGV(1));
return true;
}
}
@ -834,7 +834,7 @@ void CCSBotManager::ValidateMapData(void)
m_zoneCount = 0;
m_gameScenario = SCENARIO_DEATHMATCH;
// Search all entities in the map and set the game type and
// Search all entities in the map and set the game type and
// store all zones (bomb target, etc).
CBaseEntity *entity = NULL;
@ -852,48 +852,48 @@ void CCSBotManager::ValidateMapData(void)
if (FClassnameIs(entity->pev, "func_bomb_target"))
{
found = true;
found = true;
isLegacy = false;
m_gameScenario = SCENARIO_DEFUSE_BOMB;
}
else if (FClassnameIs(entity->pev, "info_bomb_target"))
{
found = true;
found = true;
isLegacy = true;
m_gameScenario = SCENARIO_DEFUSE_BOMB;
}
else if (FClassnameIs(entity->pev, "func_hostage_rescue"))
{
found = true;
found = true;
isLegacy = false;
m_gameScenario = SCENARIO_RESCUE_HOSTAGES;
}
else if (FClassnameIs(entity->pev, "info_hostage_rescue"))
{
found = true;
found = true;
isLegacy = true;
m_gameScenario = SCENARIO_RESCUE_HOSTAGES;
}
else if (FClassnameIs(entity->pev, "hostage_entity"))
{
// some very old maps (ie: cs_assault) use info_player_start
// as rescue zones, so set the scenario if there are hostages
// some very old maps (ie: cs_assault) use info_player_start
// as rescue zones, so set the scenario if there are hostages
// in the map
m_gameScenario = SCENARIO_RESCUE_HOSTAGES;
}
else if (FClassnameIs(entity->pev, "func_vip_safetyzone"))
{
found = true;
found = true;
isLegacy = false;
m_gameScenario = SCENARIO_ESCORT_VIP;
}
if (found)
if (found)
{
if (m_zoneCount < MAX_ZONES)
{
@ -913,7 +913,7 @@ void CCSBotManager::ValidateMapData(void)
}
}
// If there are no zones and the scenario is hostage rescue,
// If there are no zones and the scenario is hostage rescue,
// use the info_player_start entities as rescue zones.
if (m_zoneCount == 0 && m_gameScenario == SCENARIO_RESCUE_HOSTAGES)
{
@ -939,20 +939,20 @@ void CCSBotManager::ValidateMapData(void)
}
// Collect nav areas that overlap each zone
for (i = 0; i < m_zoneCount; i++)
for (i = 0; i < m_zoneCount; i++)
{
Zone *zone = &m_zone[i];
if (zone->m_isLegacy)
if (zone->m_isLegacy)
{
const float legacyRange = 256.0f;
zone->m_extent.lo.x = zone->m_center.x - legacyRange;
zone->m_extent.lo.y = zone->m_center.y - legacyRange;
zone->m_extent.lo.z = zone->m_center.z - legacyRange;
zone->m_extent.hi.x = zone->m_center.x + legacyRange;
zone->m_extent.hi.y = zone->m_center.y + legacyRange;
const float legacyRange = 256.0f;
zone->m_extent.lo.x = zone->m_center.x - legacyRange;
zone->m_extent.lo.y = zone->m_center.y - legacyRange;
zone->m_extent.lo.z = zone->m_center.z - legacyRange;
zone->m_extent.hi.x = zone->m_center.x + legacyRange;
zone->m_extent.hi.y = zone->m_center.y + legacyRange;
zone->m_extent.hi.z = zone->m_center.z + legacyRange;
}
else
@ -961,11 +961,11 @@ void CCSBotManager::ValidateMapData(void)
zone->m_extent.hi = zone->m_entity->pev->absmax;
}
// ensure Z overlap
const float zFudge = 50.0f;
zone->m_areaCount = 0;
zone->m_extent.lo.z -= zFudge;
// ensure Z overlap
const float zFudge = 50.0f;
zone->m_areaCount = 0;
zone->m_extent.lo.z -= zFudge;
zone->m_extent.hi.z += zFudge;
// build a list of nav areas that overlap this zone
@ -974,17 +974,17 @@ void CCSBotManager::ValidateMapData(void)
CNavArea *area = (*iter);
const Extent *areaExtent = area->GetExtent();
if (areaExtent->hi.x >= zone->m_extent.lo.x && areaExtent->lo.x <= zone->m_extent.hi.x
&& areaExtent->hi.y >= zone->m_extent.lo.y && areaExtent->lo.y <= zone->m_extent.hi.y
&& areaExtent->hi.z >= zone->m_extent.lo.z && areaExtent->lo.z <= zone->m_extent.hi.z)
{
// area overlaps zone
zone->m_area[ zone->m_areaCount++ ] = area;
if (zone->m_areaCount == MAX_ZONE_NAV_AREAS)
{
break;
}
if (areaExtent->hi.x >= zone->m_extent.lo.x && areaExtent->lo.x <= zone->m_extent.hi.x
&& areaExtent->hi.y >= zone->m_extent.lo.y && areaExtent->lo.y <= zone->m_extent.hi.y
&& areaExtent->hi.z >= zone->m_extent.lo.z && areaExtent->lo.z <= zone->m_extent.hi.z)
{
// area overlaps zone
zone->m_area[ zone->m_areaCount++ ] = area;
if (zone->m_areaCount == MAX_ZONE_NAV_AREAS)
{
break;
}
}
}
}
@ -1010,10 +1010,10 @@ NOBODY bool __declspec(naked) CCSBotManager::AddBot(const BotProfile *profile, B
//if (team == BOT_TEAM_ANY)
//{
// // if team not specified, check cv_bot_join_team cvar for preference
// if (!Q_stricmp(cv_bot_join_team.string, "T"))
// nTeamSlot = TERRORIST;
// else if (!Q_stricmp(cv_bot_join_team.string, "CT"))
// if (!Q_stricmp(cv_bot_join_team.string, "T"))
// nTeamSlot = TERRORIST;
// else if (!Q_stricmp(cv_bot_join_team.string, "CT"))
// nTeamSlot = CT;
//}
//else if (team == BOT_TEAM_CT)
@ -1043,7 +1043,7 @@ NOBODY bool __declspec(naked) CCSBotManager::AddBot(const BotProfile *profile, B
//if (pBot == NULL)
//{
// return false;
//}
//}
////int nJoinedTeam;
//ClientPutInServer(pBot->edict());
@ -1162,6 +1162,7 @@ void CCSBotManager::__MAKE_VHOOK(OnEvent)(GameEventType event, CBaseEntity *enti
default:
break;
}
CBotManager::OnEvent(event, entity, other);
}
@ -1186,11 +1187,11 @@ NOBODY float CCSBotManager::GetBombTimeLeft(void) const
/* <36bddb> ../cstrike/dlls/bot/cs_bot_manager.cpp:1547 */
void CCSBotManager::SetLooseBomb(CBaseEntity *bomb)
{
m_looseBomb = bomb;
if (bomb)
m_looseBombArea = TheNavAreaGrid.GetNearestNavArea(&bomb->pev->origin);
else
m_looseBomb = bomb;
if (bomb)
m_looseBombArea = TheNavAreaGrid.GetNearestNavArea(&bomb->pev->origin);
else
m_looseBombArea = NULL;
}

File diff suppressed because it is too large Load Diff

View File

@ -68,7 +68,7 @@ void CCSBot::SetAimOffset(float accuracy)
}
// focusTime is the time it takes for a bot to "focus in" for very good aim, from 2 to 5 seconds
const float focusTime = _max(5.0f * (1.0f - accuracy), 2.0f);
const float focusTime = Q_max(5.0f * (1.0f - accuracy), 2.0f);
float focusInterval = gpGlobals->time - m_aimSpreadTimestamp;
float focusAccuracy = focusInterval / focusTime;
@ -79,7 +79,7 @@ void CCSBot::SetAimOffset(float accuracy)
if (focusAccuracy > maxFocusAccuracy)
focusAccuracy = maxFocusAccuracy;
accuracy = _max(accuracy, focusAccuracy);
accuracy = Q_max(accuracy, focusAccuracy);
}
PrintIfWatched("Accuracy = %4.3f\n", accuracy);

View File

@ -41,130 +41,130 @@ public:
CSGameState(void);
CSGameState(CCSBot *owner);
struct HostageInfo
{
CHostage *hostage;
Vector knownPos;
bool isValid;
bool isAlive;
bool isFree;
struct HostageInfo
{
CHostage *hostage;
Vector knownPos;
bool isValid;
bool isAlive;
bool isFree;
};/* size: 20, cachelines: 1, members: 5 */
NOBODY void Reset(void);
// Event handling
NOBODY void OnEvent(GameEventType event, CBaseEntity *entity, CBaseEntity *other);
// true if round has been won or lost (but not yet reset)
NOBODY bool IsRoundOver(void) const;
NOBODY void Reset(void);
// Event handling
NOBODY void OnEvent(GameEventType event, CBaseEntity *entity, CBaseEntity *other);
// true if round has been won or lost (but not yet reset)
NOBODY bool IsRoundOver(void) const;
enum BombState
{
MOVING, // being carried by a Terrorist
LOOSE, // loose on the ground somewhere
PLANTED, // planted and ticking
DEFUSED, // the bomb has been defused
EXPLODED, // the bomb has exploded
};
bool IsBombMoving(void) const
{
return (m_bombState == MOVING);
}
bool IsBombLoose(void) const
{
return (m_bombState == LOOSE);
}
bool IsBombPlanted(void) const
{
return (m_bombState == PLANTED);
}
bool IsBombDefused(void) const
{
return (m_bombState == DEFUSED);
}
bool IsBombExploded(void) const
{
return (m_bombState == EXPLODED);
}
// we see the loose bomb
NOBODY void UpdateLooseBomb(const Vector *pos);
// how long has is been since we saw the loose bomb
NOBODY float TimeSinceLastSawLooseBomb(void) const;
// do we know where the loose bomb is
NOBODY bool IsLooseBombLocationKnown(void) const;
// we see the bomber
NOBODY void UpdateBomber(const Vector *pos);
// how long has is been since we saw the bomber
NOBODY float TimeSinceLastSawBomber(void) const;
// we see the planted bomb
NOBODY void UpdatePlantedBomb(const Vector *pos);
// do we know where the bomb was planted
NOBODY bool IsPlantedBombLocationKnown(void) const;
// mark bombsite as the location of the planted bomb
NOBODY void MarkBombsiteAsPlanted(int zoneIndex);
enum { UNKNOWN = -1 };
// return the zone index of the planted bombsite, or UNKNOWN
NOBODY int GetPlantedBombsite(void) const;
// return true if we are currently in the bombsite where the bomb is planted
NOBODY bool IsAtPlantedBombsite(void) const;
// return the zone index of the next bombsite to search
NOBODY int GetNextBombsiteToSearch(void);
// return true if given bombsite has been cleared
NOBODY bool IsBombsiteClear(int zoneIndex) const;
// mark bombsite as clear
NOBODY void ClearBombsite(int zoneIndex);
// return where we think the bomb is, or NULL if we don't know
NOBODY const Vector *GetBombPosition(void) const;
NOBODY CHostage *GetNearestFreeHostage(Vector *knowPos);
NOBODY const Vector *GetRandomFreeHostagePosition(void);
NOBODY bool AreAllHostagesBeingRescued(void);
NOBODY bool AreAllHostagesGone(void);
NOBODY void AllHostagesGone(void);
bool HaveSomeHostagesBeenTaken(void)
{
return m_haveSomeHostagesBeenTaken;
}
void HostageWasTaken(void)
{
m_haveSomeHostagesBeenTaken = true;
}
NOBODY CHostage *GetNearestVisibleFreeHostage(void);
NOBODY unsigned char ValidateHostagePositions(void);
NOBODY void SetBombState(BombState state);
BombState GetBombState(void)
{
return m_bombState;
}
CBaseEntity *GetNearestHostage(void)
{
UNTESTED
// TODO: Not implemented
//CHostage *pHostage = g_pHostages->GetClosestHostage(m_owner->pev->origin);
//return GetClassPtr((CHostage *)pHostage->pev);
}
enum BombState
{
MOVING, // being carried by a Terrorist
LOOSE, // loose on the ground somewhere
PLANTED, // planted and ticking
DEFUSED, // the bomb has been defused
EXPLODED, // the bomb has exploded
};
bool IsBombMoving(void) const
{
return (m_bombState == MOVING);
}
bool IsBombLoose(void) const
{
return (m_bombState == LOOSE);
}
bool IsBombPlanted(void) const
{
return (m_bombState == PLANTED);
}
bool IsBombDefused(void) const
{
return (m_bombState == DEFUSED);
}
bool IsBombExploded(void) const
{
return (m_bombState == EXPLODED);
}
// we see the loose bomb
NOBODY void UpdateLooseBomb(const Vector *pos);
// how long has is been since we saw the loose bomb
NOBODY float TimeSinceLastSawLooseBomb(void) const;
// do we know where the loose bomb is
NOBODY bool IsLooseBombLocationKnown(void) const;
// we see the bomber
NOBODY void UpdateBomber(const Vector *pos);
// how long has is been since we saw the bomber
NOBODY float TimeSinceLastSawBomber(void) const;
// we see the planted bomb
NOBODY void UpdatePlantedBomb(const Vector *pos);
// do we know where the bomb was planted
NOBODY bool IsPlantedBombLocationKnown(void) const;
// mark bombsite as the location of the planted bomb
NOBODY void MarkBombsiteAsPlanted(int zoneIndex);
enum { UNKNOWN = -1 };
// return the zone index of the planted bombsite, or UNKNOWN
NOBODY int GetPlantedBombsite(void) const;
// return true if we are currently in the bombsite where the bomb is planted
NOBODY bool IsAtPlantedBombsite(void) const;
// return the zone index of the next bombsite to search
NOBODY int GetNextBombsiteToSearch(void);
// return true if given bombsite has been cleared
NOBODY bool IsBombsiteClear(int zoneIndex) const;
// mark bombsite as clear
NOBODY void ClearBombsite(int zoneIndex);
// return where we think the bomb is, or NULL if we don't know
NOBODY const Vector *GetBombPosition(void) const;
NOBODY CHostage *GetNearestFreeHostage(Vector *knowPos);
NOBODY const Vector *GetRandomFreeHostagePosition(void);
NOBODY bool AreAllHostagesBeingRescued(void);
NOBODY bool AreAllHostagesGone(void);
NOBODY void AllHostagesGone(void);
bool HaveSomeHostagesBeenTaken(void)
{
return m_haveSomeHostagesBeenTaken;
}
void HostageWasTaken(void)
{
m_haveSomeHostagesBeenTaken = true;
}
NOBODY CHostage *GetNearestVisibleFreeHostage(void);
NOBODY unsigned char ValidateHostagePositions(void);
NOBODY void SetBombState(BombState state);
BombState GetBombState(void)
{
return m_bombState;
}
CBaseEntity *GetNearestHostage(void)
{
UNTESTED
// TODO: Not implemented
//CHostage *pHostage = g_pHostages->GetClosestHostage(m_owner->pev->origin);
//return GetClassPtr((CHostage *)pHostage->pev);
}
NOBODY void InitializeHostageInfo(void);
private:
CCSBot *m_owner;
bool m_isRoundOver;
BombState m_bombState;
IntervalTimer m_lastSawBomber;
Vector m_bomberPos;
IntervalTimer m_lastSawLooseBomb;
Vector m_looseBombPos;
bool m_isBombsiteClear[4];
int m_bombsiteSearchOrder[4];
int m_bombsiteCount;
int m_bombsiteSearchIndex;
int m_plantedBombsite;
bool m_isPlantedBombPosKnown;
Vector m_plantedBombPos;
struct HostageInfo m_hostage[12];
int m_hostageCount;
CountdownTimer m_validateInterval;
bool m_allHostagesRescued;
CCSBot *m_owner;
bool m_isRoundOver;
BombState m_bombState;
IntervalTimer m_lastSawBomber;
Vector m_bomberPos;
IntervalTimer m_lastSawLooseBomb;
Vector m_looseBombPos;
bool m_isBombsiteClear[4];
int m_bombsiteSearchOrder[4];
int m_bombsiteCount;
int m_bombsiteSearchIndex;
int m_plantedBombsite;
bool m_isPlantedBombPosKnown;
Vector m_plantedBombPos;
struct HostageInfo m_hostage[12];
int m_hostageCount;
CountdownTimer m_validateInterval;
bool m_allHostagesRescued;
bool m_haveSomeHostagesBeenTaken;
};/* size: 348, cachelines: 6, members: 19 */
#endif // CS_GAMESTATE_H

File diff suppressed because it is too large Load Diff

View File

@ -32,15 +32,37 @@
#pragma once
#endif
#define SF_BUTTON_DONTMOVE 1
#define SF_ROTBUTTON_NOTSOLID 1
#define SF_BUTTON_TOGGLE 32 // button stays pushed until reactivated
#define SF_BUTTON_SPARK_IF_OFF 64 // button sparks in OFF state
#define SF_BUTTON_TOUCH_ONLY 256 // button only fires as a result of USE key.
#define SF_GLOBAL_SET 1 // Set global state to initial state on spawn
#define SF_MULTI_INIT 1
// Make this button behave like a door (HACKHACK)
// This will disable use and make the button solid
// rotating buttons were made SOLID_NOT by default since their were some
// collision problems with them...
#define SF_MOMENTARY_DOOR 0x0001
#define SF_SPARK_TOOGLE 32
#define SF_SPARK_IF_OFF 64
#define SF_BTARGET_USE 0x0001
#define SF_BTARGET_ON 0x0002
/* <249a3> ../cstrike/dlls/buttons.cpp:38 */
class CEnvGlobal: public CPointEntity
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Spawn(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
@ -66,10 +88,12 @@ public:
class CRotButton: public CBaseButton
{
public:
NOBODY virtual void Spawn(void);
virtual void Spawn(void);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
#endif // HOOK_GAMEDLL
};/* size: 368, cachelines: 6, members: 1 */
@ -78,12 +102,15 @@ public:
class CMomentaryRotButton: public CBaseToggle
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void);
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Spawn(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
@ -91,19 +118,29 @@ public:
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
int ObjectCaps_(void);
int ObjectCaps_(void)
{
int flags = CBaseToggle::ObjectCaps() & (~FCAP_ACROSS_TRANSITION);
if (pev->spawnflags & SF_MOMENTARY_DOOR)
{
return flags;
}
return (flags | FCAP_CONTINUOUS_USE);
}
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif // HOOK_GAMEDLL
public:
NOBODY void EXPORT Off(void);
NOBODY void EXPORT Return(void);
NOBODY void UpdateSelf(float value);
NOBODY void UpdateSelfReturn(float value);
NOBODY void UpdateAllButtons(float value, int start);
NOBODY void PlaySound(void);
NOBODY void UpdateTarget(float value);
void EXPORT Off(void);
void EXPORT Return(void);
void UpdateSelf(float value);
void UpdateSelfReturn(float value);
void UpdateAllButtons(float value, int start);
void PlaySound(void);
void UpdateTarget(float value);
public:
static CMomentaryRotButton *Instance(edict_t *pent)
{
@ -127,11 +164,11 @@ public:
class CEnvSpark: public CBaseEntity
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
virtual void Spawn(void);
virtual void Precache(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
#ifdef HOOK_GAMEDLL
@ -144,9 +181,9 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY void EXPORT SparkThink(void);
NOBODY void EXPORT SparkStart(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
NOBODY void EXPORT SparkStop(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void EXPORT SparkThink(void);
void EXPORT SparkStart(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void EXPORT SparkStop(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1];
@ -160,10 +197,10 @@ public:
class CButtonTarget: public CBaseEntity
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual int ObjectCaps(void);
NOBODY virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Spawn(void);
virtual int ObjectCaps(void);
virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
@ -176,7 +213,17 @@ public:
};/* size: 152, cachelines: 3, members: 1 */
NOBODY char *ButtonSound(int sound);
NOBODY void DoSpark(entvars_t *pev, const Vector &location);
char *ButtonSound(int sound);
void DoSpark(entvars_t *pev, const Vector &location);
// linked objects
C_DLLEXPORT void env_global(entvars_t *pev);
C_DLLEXPORT void multisource(entvars_t *pev);
C_DLLEXPORT void func_button(entvars_t *pev);
C_DLLEXPORT void func_rot_button(entvars_t *pev);
C_DLLEXPORT void momentary_rot_button(entvars_t *pev);
C_DLLEXPORT void env_spark(entvars_t *pev);
C_DLLEXPORT void env_debris(entvars_t *pev);
C_DLLEXPORT void button_target(entvars_t *pev);
#endif // BUTTON_H

File diff suppressed because it is too large Load Diff

View File

@ -38,7 +38,7 @@
class CCareerTask
{
public:
CCareerTask(void) { };
CCareerTask(void) {};
CCareerTask(const char *taskName, GameEventType event, const char *weaponName, int n, bool mustLive, bool crossRounds, int id, bool isComplete);
public:
virtual void OnEvent(GameEventType event, CBasePlayer *pAttacker, CBasePlayer *pVictim);
@ -82,7 +82,7 @@ public:
{
return m_weaponClassId;
}
bool IsValidFor(CBasePlayer *pPlayer)//!
bool IsValidFor(CBasePlayer *pPlayer)
{
return true;
}

File diff suppressed because it is too large Load Diff

View File

@ -39,9 +39,6 @@
#undef CREATE_NAMED_ENTITY
#undef REMOVE_ENTITY
//#define CAREER_MODE_DELETED_SCENE 1 // ??
#define CAREER_MODE_CAMPAIGN 2
#define FCAP_CUSTOMSAVE 0x00000001
#define FCAP_ACROSS_TRANSITION 0x00000002
#define FCAP_MUST_SPAWN 0x00000004
@ -222,6 +219,7 @@ typedef enum
USE_ON,
USE_SET,
USE_TOGGLE,
} USE_TYPE;
typedef enum
@ -298,37 +296,6 @@ private:
};/* size: 8, cachelines: 1, members: 2 */
typedef struct dynpitchvol
{
int preset;
int pitchrun;
int pitchstart;
int spinup;
int spindown;
int volrun;
int volstart;
int fadein;
int fadeout;
int lfotype;
int lforate;
int lfomodpitch;
int lfomodvol;
int cspinup;
int cspincount;
int pitch;
int spinupsav;
int spindownsav;
int pitchfrac;
int vol;
int fadeinsav;
int fadeoutsav;
int volfrac;
int lfofrac;
int lfomult;
} dynpitchvol_t;
/* size: 100, cachelines: 2, members: 25 */
/* <48e9c1> ../cstrike/dlls/cbase.h:166 */
class CBaseEntity
{
@ -340,8 +307,8 @@ public:
{
pkvd->fHandled = FALSE;
}
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return FCAP_ACROSS_TRANSITION;
@ -381,17 +348,17 @@ public:
{
return GetToggleState_();
}
virtual void AddPoints(int score, BOOL bAllowNegativeScore) {} // __stdcall
virtual void AddPointsToTeam(int score, BOOL bAllowNegativeScore) {} // __stdcall
virtual void AddPoints(int score, BOOL bAllowNegativeScore) {}
virtual void AddPointsToTeam(int score, BOOL bAllowNegativeScore) {}
virtual BOOL AddPlayerItem(CBasePlayerItem *pItem)
{
return FALSE;
}
virtual BOOL RemovePlayerItem(CBasePlayerItem *pItem) // __stdcall
virtual BOOL RemovePlayerItem(CBasePlayerItem *pItem)
{
return FALSE;
}
virtual int GiveAmmo(int iAmount, char *szName, int iMax) // __stdcall
virtual int GiveAmmo(int iAmount, char *szName, int iMax)
{
return -1;
}
@ -449,22 +416,30 @@ public:
virtual void Think(void)
{
if (m_pfnThink)
{
(this->*m_pfnThink)();
}
}
virtual void Touch(CBaseEntity *pOther)
{
if (m_pfnTouch)
{
(this->*m_pfnTouch)(pOther);
}
}
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType = USE_OFF, float value = 0.0f)
{
if (m_pfnUse)
{
(this->*m_pfnUse)(pActivator, pCaller, useType, value);
}
}
virtual void Blocked(CBaseEntity *pOther)
{
if (m_pfnBlocked)
{
(this->*m_pfnBlocked)(pOther);
}
}
virtual CBaseEntity *Respawn(void)
{
@ -496,15 +471,15 @@ public:
return GETENTITYILLUM(ENT(pev));
}
NOBODY virtual BOOL FVisible(CBaseEntity *pEntity);
NOBODY virtual BOOL FVisible(Vector &vecOrigin);
virtual BOOL FVisible(CBaseEntity *pEntity);
virtual BOOL FVisible(const Vector &vecOrigin);
#ifdef HOOK_GAMEDLL
int Save_(CSave &save);
int Restore_(CRestore &restore);
void SetObjectCollisionBox_(void);
void DeathNotice_(entvars_t *pevChild) { }
void DeathNotice_(entvars_t *pevChild) {}
void TraceAttack_(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType);
int TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
int TakeHealth_(float flHealth, int bitsDamageType);
@ -526,7 +501,7 @@ public:
return Center();
}
BOOL FVisible_(CBaseEntity *pEntity);
BOOL FVisible_(Vector &vecOrigin);
BOOL FVisible_(const Vector &vecOrigin);
#endif // HOOK_GAMEDLL
@ -548,8 +523,8 @@ public:
{
Use(this, this, USE_TOGGLE, 0);
}
NOBODY int ShouldToggle(USE_TYPE useType, BOOL currentState);
NOBODY void FireBullets(ULONG cShots, Vector vecSrc, Vector vecDirShooting, Vector vecSpread, float flDistance, int iBulletType, int iTracerFreq = 4, int iDamage = 0, entvars_t *pevAttacker = NULL);
int ShouldToggle(USE_TYPE useType, BOOL currentState);
void FireBullets(ULONG cShots, Vector vecSrc, Vector vecDirShooting, Vector vecSpread, float flDistance, int iBulletType, int iTracerFreq = 4, int iDamage = 0, entvars_t *pevAttacker = NULL);
Vector FireBullets3(Vector vecSrc, Vector vecDirShooting, float vecSpread, float flDistance, int iPenetration, int iBulletType, int iDamage, float flRangeModifier, entvars_t *pevAttacker, bool bPistol, int shared_rand = 0);
void SUB_UseTargets(CBaseEntity *pActivator, USE_TYPE useType, float value);
int Intersects(CBaseEntity *pOther);
@ -665,8 +640,8 @@ inline int FNullEnt(EHANDLE hent)
class CPointEntity: public CBaseEntity
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual int ObjectCaps(void)
virtual void Spawn(void);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
@ -687,16 +662,16 @@ public:
class CMultiSource: public CPointEntity
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
NOBODY virtual int ObjectCaps(void)
virtual void Spawn(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
NOBODY virtual BOOL IsTriggered(CBaseEntity *pActivator);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
virtual BOOL IsTriggered(CBaseEntity *pActivator);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
#ifdef HOOK_GAMEDLL
@ -714,7 +689,7 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY void EXPORT Register(void);
void EXPORT Register(void);
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[4];
@ -731,8 +706,8 @@ class CBaseDelay: public CBaseEntity
{
public:
virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
#ifdef HOOK_GAMEDLL
@ -757,8 +732,8 @@ public:
class CBaseAnimating: public CBaseDelay
{
public:
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual void HandleAnimEvent(MonsterEvent_t *pEvent) {}
#ifdef HOOK_GAMEDLL
@ -823,16 +798,16 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY void LinearMove(Vector vecDest, float flSpeed);
NOBODY void EXPORT LinearMoveDone(void);
NOBODY void AngularMove(Vector vecDestAngle, float flSpeed);
NOBODY void EXPORT AngularMoveDone(void);
NOBODY BOOL IsLockedByMaster(void);
void LinearMove(Vector vecDest, float flSpeed);
void EXPORT LinearMoveDone(void);
void AngularMove(Vector vecDestAngle, float flSpeed);
void EXPORT AngularMoveDone(void);
NOXREF BOOL IsLockedByMaster(void);
public:
NOBODY static float AxisValue(int flags, Vector &angles);
NOBODY static void AxisDir(entvars_t *pev);
NOBODY static float AxisDelta(int flags, Vector &angle1, Vector &angle2);
static float AxisValue(int flags, const Vector &angles);
static void AxisDir(entvars_t *pev);
static float AxisDelta(int flags, const Vector &angle1, const Vector &angle2);
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[19];
@ -856,10 +831,13 @@ public:
Vector m_vecFinalAngle;
int m_bitsDamageInflict;
string_t m_sMaster;
};/* size: 312, cachelines: 5, members: 21 */
#include "basemonster.h"
// Generic Button
/* <24b19> ../cstrike/dlls/cbase.h:745 */
class CBaseButton: public CBaseToggle
{
@ -871,12 +849,12 @@ class CBaseButton: public CBaseToggle
};
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
virtual void Spawn(void);
virtual void Precache(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
@ -893,7 +871,9 @@ public:
int ObjectCaps_(void)
{
if (pev->takedamage == DAMAGE_NO)
{
return FCAP_IMPULSE_USE;
}
return (CBaseToggle::ObjectCaps() & ~FCAP_ACROSS_TRANSITION);
}
@ -901,19 +881,19 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY void RotSpawn(void);
NOBODY void ButtonActivate(void);
NOBODY void SparkSoundCache(void);
NOXREF void RotSpawn(void);
void ButtonActivate(void);
NOXREF void SparkSoundCache(void);
NOBODY void EXPORT ButtonShot(void);
NOBODY void EXPORT ButtonTouch(CBaseEntity *pOther);
NOBODY void EXPORT ButtonSpark(void);
NOBODY void EXPORT TriggerAndWait(void);
NOBODY void EXPORT ButtonReturn(void);
NOBODY void EXPORT ButtonBackHome(void);
NOBODY void EXPORT ButtonUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
NOXREF void EXPORT ButtonShot(void);
void EXPORT ButtonTouch(CBaseEntity *pOther);
void EXPORT ButtonSpark(void);
void EXPORT TriggerAndWait(void);
void EXPORT ButtonReturn(void);
void EXPORT ButtonBackHome(void);
void EXPORT ButtonUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
NOBODY BUTTON_CODE ButtonResponseToTouch(void);
BUTTON_CODE ButtonResponseToTouch(void);
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[8];
@ -927,6 +907,7 @@ public:
BYTE m_bUnlockedSound;
BYTE m_bUnlockedSentence;
int m_sounds;
};/* size: 368, cachelines: 6, members: 11 */
/* <1da023> ../cstrike/dlls/cbase.h:861 */
@ -990,97 +971,9 @@ public:
};/* size: 152, cachelines: 3, members: 1 */
/* <170b59> ../cstrike/dlls/sound.cpp:117 */
class CAmbientGeneric: public CBaseEntity
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual void Restart(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION);
}
#ifdef HOOK_GAMEDLL
int Save_(CSave &save);
int Restore_(CRestore &restore);
#endif // HOOK_GAMEDLL
public:
NOBODY void EXPORT ToggleUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
NOBODY void EXPORT RampThink(void);
NOBODY void InitModulationParms(void);
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[4];
float m_flAttenuation;
dynpitchvol_t m_dpv;
BOOL m_fActive;
BOOL m_fLooping;
};/* size: 264, cachelines: 5, members: 6 */
/* <170bc2> ../cstrike/dlls/sound.cpp:875 */
class CEnvSound: public CPointEntity
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY virtual void Think(void);
#ifdef HOOK_GAMEDLL
int Save_(CSave &save);
int Restore_(CRestore &restore);
#endif // HOOK_GAMEDLL
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[2];
float m_flRadius;
float m_flRoomtype;
};/* size: 160, cachelines: 3, members: 4 */
/* <170ced> ../cstrike/dlls/sound.cpp:1867 */
class CSpeaker: public CBaseEntity
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION);
}
#ifdef HOOK_GAMEDLL
int Save_(CSave &save);
int Restore_(CRestore &restore);
#endif // HOOK_GAMEDLL
public:
NOBODY void EXPORT ToggleUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
NOBODY void EXPORT SpeakerThink(void);
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1];
int m_preset;
};/* size: 156, cachelines: 3, members: 3 */
template <class T>
T *GetClassPtr(T *a)
@ -1134,7 +1027,7 @@ void OnFreeEntPrivateData(edict_t *pEnt);
#ifdef HOOK_GAMEDLL
typedef BOOL (CBaseEntity::*FVISIBLE_ENTITY)(CBaseEntity *);
typedef BOOL (CBaseEntity::*FVISIBLE_VECTOR)(Vector &);
typedef BOOL (CBaseEntity::*FVISIBLE_VECTOR)(const Vector &);
typedef void (CGrenade::*EXPLODE_VECTOR)(Vector, Vector);
typedef void (CGrenade::*EXPLODE_TRACERESULT)(TraceResult *, int);
@ -1145,7 +1038,4 @@ typedef CBaseEntity *(CBaseEntity::*CBASE_ISTANCE_INT)(int);
#endif // HOOK_GAMEDLL
//Refs
extern void (*pCGib__SpawnHeadGib)(void);
#endif // CBASE_H

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -48,23 +48,23 @@
#define SF_DOOR_NOMONSTERS 512 // Monster can't open
#define SF_DOOR_SILENT 0x80000000
/* <6840f> ../cstrike/dlls/doors.cpp:34 */
/* <6840f> ../cstrike/dlls/doors.cpp:34 */
class CBaseDoor: public CBaseToggle
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual void Restart(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void)
virtual void Spawn(void);
virtual void Precache(void);
virtual void Restart(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
NOBODY virtual void SetToggleState(int state);
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
NOBODY virtual void Blocked(CBaseEntity *pOther);
virtual void SetToggleState(int state);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Blocked(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
@ -86,37 +86,43 @@ public:
void Blocked_(CBaseEntity *pOther);
#endif // HOOK_GAMEDLL
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[7];
public:
NOBODY void EXPORT DoorTouch(CBaseEntity *pOther);
NOBODY int DoorActivate(void);
NOBODY void EXPORT DoorGoUp(void);
NOBODY void EXPORT DoorGoDown(void);
NOBODY void EXPORT DoorHitTop(void);
NOBODY void EXPORT DoorHitBottom(void);
// used to selectivly override defaults
void EXPORT DoorTouch(CBaseEntity *pOther);
int DoorActivate(void);
void EXPORT DoorGoUp(void);
void EXPORT DoorGoDown(void);
void EXPORT DoorHitTop(void);
void EXPORT DoorHitBottom(void);
public:
BYTE m_bHealthValue;
BYTE m_bMoveSnd;
BYTE m_bStopSnd;
locksound_t m_ls;
BYTE m_bLockedSound;
BYTE m_bHealthValue; // some doors are medi-kit doors, they give players health
BYTE m_bMoveSnd; // sound a door makes while moving
BYTE m_bStopSnd; // sound a door makes when it stops
locksound_t m_ls; // door lock sounds
BYTE m_bLockedSound; // ordinals from entity selection
BYTE m_bLockedSentence;
BYTE m_bUnlockedSound;
BYTE m_bUnlockedSentence;
float m_lastBlockedTimestamp;
};/* size: 360, cachelines: 6, members: 11 */
};/* size: 360, cachelines: 6, members: 11 */
/* <684c0> ../cstrike/dlls/doors.cpp:935 */
/* <684c0> ../cstrike/dlls/doors.cpp:935 */
class CRotDoor: public CBaseDoor
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Restart(void);
NOBODY virtual void SetToggleState(int state);
virtual void Spawn(void);
virtual void Restart(void);
virtual void SetToggleState(int state);
#ifdef HOOK_GAMEDLL
@ -128,20 +134,20 @@ public:
};/* size: 360, cachelines: 6, members: 1 */
/* <68513> ../cstrike/dlls/doors.cpp:1039 */
/* <68513> ../cstrike/dlls/doors.cpp:1039 */
class CMomentaryDoor: public CBaseToggle
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void)
virtual void Spawn(void);
virtual void Precache(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
@ -162,11 +168,16 @@ public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1];
public:
BYTE m_bMoveSnd;
BYTE m_bMoveSnd; // sound a door makes while moving
};/* size: 316, cachelines: 5, members: 3 */
void PlayLockSounds(entvars_t *pev, locksound_t *pls, int flocked, int fbutton);
NOBODY void PlayLockSounds(entvars_t *pev, locksound_t *pls, int flocked, int fbutton);
// linked objects
C_DLLEXPORT void func_door(entvars_t *pev);
C_DLLEXPORT void func_water(entvars_t *pev);
C_DLLEXPORT void func_door_rotating(entvars_t *pev);
C_DLLEXPORT void momentary_door(entvars_t *pev);
#endif // DOORS_H

File diff suppressed because it is too large Load Diff

View File

@ -153,7 +153,7 @@ public:
{
pev->renderamt = brightness;
}
void AnimateAndDie(float framerate)
void AnimateAndDie(float_precision framerate)
{
SetThink(&CSprite::AnimateUntilDead);
pev->framerate = framerate;
@ -455,9 +455,9 @@ public:
/* <71e17> ../cstrike/dlls/effects.cpp:373 */
inline BOOL ServerSide(void)
{
if (!m_life && !(pev->spawnflags & SF_BEAM_RING))
return TRUE;
if (!m_life && !(pev->spawnflags & SF_BEAM_RING))
return TRUE;
return FALSE;
}
void BeamUpdateVars(void);
@ -482,7 +482,7 @@ public:
}; /* size: 204, cachelines: 4, members: 15 */
/* <7244f> ../cstrike/dlls/effects.cpp:1085 */
/* <7244f> ../cstrike/dlls/effects.cpp:1085 */
class CGlow: public CPointEntity
{
public:
@ -531,10 +531,10 @@ public:
};/* size: 172, cachelines: 3, members: 4 */
/* <72581> ../cstrike/dlls/effects.cpp:1413 */
class CGibShooter: public CBaseDelay
{
public:
/* <72581> ../cstrike/dlls/effects.cpp:1413 */
class CGibShooter: public CBaseDelay
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void KeyValue(KeyValueData *pkvd);
@ -568,8 +568,8 @@ public:
float m_flGibVelocity;
float m_flVariance;
float m_flGibLife;
float m_flGibLife;
};/* size: 188, cachelines: 3, members: 9 */
/* <725ef> ../cstrike/dlls/effects.cpp:1592 */
@ -616,13 +616,13 @@ public:
int m_iBeam;
CBeam *m_pBeam[ MAX_BEAM ];
float m_flBeamTime[ MAX_BEAM ];
float m_flStartTime;
};/* size: 364, cachelines: 6, members: 6 */
/* <72690> ../cstrike/dlls/effects.cpp:1769 */
/* <72690> ../cstrike/dlls/effects.cpp:1769 */
class CBlood: public CPointEntity
{
public:
@ -666,7 +666,7 @@ public:
};/* size: 152, cachelines: 3, members: 1 */
/* <726de> ../cstrike/dlls/effects.cpp:1886 */
/* <726de> ../cstrike/dlls/effects.cpp:1886 */
class CShake: public CPointEntity
{
public:
@ -726,7 +726,7 @@ public:
};/* size: 152, cachelines: 3, members: 1 */
/* <7272c> ../cstrike/dlls/effects.cpp:1964 */
/* <7272c> ../cstrike/dlls/effects.cpp:1964 */
class CFade: public CPointEntity
{
public:
@ -825,7 +825,7 @@ public:
};/* size: 160, cachelines: 3, members: 1 */
/* <72869> ../cstrike/dlls/effects.cpp:2258 */
/* <72869> ../cstrike/dlls/effects.cpp:2258 */
class CItemSoda: public CBaseEntity
{
public:
@ -850,22 +850,22 @@ int IsPointEntity(CBaseEntity *pEnt);
// linked objects
C_DLLEXPORT void info_target(entvars_t *pev);
C_DLLEXPORT void env_bubbles(entvars_t *pev);
C_DLLEXPORT void beam(entvars_t *pev);
C_DLLEXPORT void env_lightning(entvars_t *pev);
C_DLLEXPORT void env_beam(entvars_t *pev);
C_DLLEXPORT void env_laser(entvars_t *pev);
C_DLLEXPORT void env_glow(entvars_t *pev);
C_DLLEXPORT void env_bombglow(entvars_t *pev);
C_DLLEXPORT void env_sprite(entvars_t *pev);
C_DLLEXPORT void gibshooter(entvars_t *pev);
C_DLLEXPORT void env_shooter(entvars_t *pev);
C_DLLEXPORT void test_effect(entvars_t *pev);
C_DLLEXPORT void env_blood(entvars_t *pev);
C_DLLEXPORT void env_shake(entvars_t *pev);
C_DLLEXPORT void env_fade(entvars_t *pev);
C_DLLEXPORT void env_message(entvars_t *pev);
C_DLLEXPORT void env_funnel(entvars_t *pev);
C_DLLEXPORT void env_beverage(entvars_t *pev);
C_DLLEXPORT void beam(entvars_t *pev);
C_DLLEXPORT void env_lightning(entvars_t *pev);
C_DLLEXPORT void env_beam(entvars_t *pev);
C_DLLEXPORT void env_laser(entvars_t *pev);
C_DLLEXPORT void env_glow(entvars_t *pev);
C_DLLEXPORT void env_bombglow(entvars_t *pev);
C_DLLEXPORT void env_sprite(entvars_t *pev);
C_DLLEXPORT void gibshooter(entvars_t *pev);
C_DLLEXPORT void env_shooter(entvars_t *pev);
C_DLLEXPORT void test_effect(entvars_t *pev);
C_DLLEXPORT void env_blood(entvars_t *pev);
C_DLLEXPORT void env_shake(entvars_t *pev);
C_DLLEXPORT void env_fade(entvars_t *pev);
C_DLLEXPORT void env_message(entvars_t *pev);
C_DLLEXPORT void env_funnel(entvars_t *pev);
C_DLLEXPORT void env_beverage(entvars_t *pev);
C_DLLEXPORT void item_sodacan(entvars_t *pev);
#endif // EFFECTS_H

View File

@ -150,6 +150,7 @@ inline void *GET_PRIVATE(edict_t *pent)
#define SET_CROSSHAIRANGLE (*g_engfuncs.pfnCrosshairAngle)
#define LOAD_FILE_FOR_ME (*g_engfuncs.pfnLoadFileForMe)
#define FREE_FILE (*g_engfuncs.pfnFreeFile)
#define END_SECTION (*g_engfuncs.pfnEndSection)
#define COMPARE_FILE_TIME (*g_engfuncs.pfnCompareFileTime)
#define GET_GAME_DIR (*g_engfuncs.pfnGetGameDir)
#define SET_CLIENT_MAXSPEED (*g_engfuncs.pfnSetClientMaxspeed)

View File

@ -13,7 +13,7 @@ TYPEDESCRIPTION CEnvExplosion::m_SaveData[] =
#else // HOOK_GAMEDLL
TYPEDESCRIPTION (*CEnvExplosion::pm_SaveData)[2];
TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CEnvExplosion, m_SaveData)[2];
#endif // HOOK_GAMEDLL
@ -221,7 +221,7 @@ void CEnvExplosion::Smoke(void)
// HACKHACK -- create one of these and fake a keyvalue to get the right explosion setup
/* <7f7f4> ../cstrike/dlls/explode.cpp:258 */
void ExplosionCreate(Vector &center, Vector &angles, edict_t *pOwner, int magnitude, BOOL doDamage)
void ExplosionCreate(const Vector &center, Vector &angles, edict_t *pOwner, int magnitude, BOOL doDamage)
{
KeyValueData kvd;
char buf[128];

View File

@ -97,7 +97,7 @@ public:
};/* size: 412, cachelines: 7, members: 4 */
void ExplosionCreate(Vector &center, Vector &angles, edict_t *pOwner, int magnitude, BOOL doDamage);
void ExplosionCreate(const Vector &center, Vector &angles, edict_t *pOwner, int magnitude, BOOL doDamage);
// linked objects
C_DLLEXPORT void spark_shower(entvars_t *pev);

View File

@ -41,6 +41,7 @@
#include "archtypes.h"
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#define NOWINRES
#define NOSERVICE
@ -51,26 +52,11 @@
#include "winsani_out.h"
#undef PlaySound
#else
//#define FALSE 0
//#define TRUE 1
//typedef unsigned long ULONG;
//typedef unsigned char BYTE;
//typedef int BOOL;
//#define MAX_PATH PATH_MAX
#include <limits.h>
#include <stdarg.h>
#include <string.h>
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif // min
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#define _vsnprintf(a,b,c,d) vsnprintf(a,b,c,d)
#endif // max
#endif // _WIN32
// Misc C-runtime library headers

File diff suppressed because it is too large Load Diff

View File

@ -35,6 +35,15 @@
// this many shards spawned when breakable objects break;
#define NUM_SHARDS 6
// func breakable
#define SF_BREAK_TRIGGER_ONLY 1 // may only be broken by trigger
#define SF_BREAK_TOUCH 2 // can be 'crashed through' by running player (plate glass)
#define SF_BREAK_PRESSURE 4 // can be broken by a player standing on it
#define SF_BREAK_CROWBAR 256 // instant break if hit with crowbar
// func_pushable (it's also func_breakable, so don't collide with those flags)
#define SF_PUSH_BREAKABLE 128
typedef enum
{
expRandom = 0,
@ -75,25 +84,25 @@ class CBreakable: public CBaseDelay
{
public:
// basic functions
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual void Restart(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void)
virtual void Spawn(void);
virtual void Precache(void);
virtual void Restart(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
// To spark when hit
NOBODY virtual void TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType);
virtual void TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType);
// breakables use an overridden takedamage
NOBODY virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
NOBODY virtual int DamageDecal(int bitsDamageType);
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual int DamageDecal(int bitsDamageType);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
@ -115,14 +124,14 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY void EXPORT BreakTouch(CBaseEntity *pOther);
NOBODY void DamageSound(void);
void EXPORT BreakTouch(CBaseEntity *pOther);
void DamageSound(void);
NOBODY BOOL IsBreakable(void);
NOBODY BOOL SparkWhenHit(void);
BOOL IsBreakable(void);
NOXREF BOOL SparkWhenHit(void);
void EXPORT Die(void);
NOBODY void EXPORT Die(void);
inline BOOL Explodable(void)
{
return ExplosionMagnitude() > 0;
@ -160,23 +169,23 @@ public:
};/* size: 188, cachelines: 3, members: 15 */
/* <84da0> ../cstrike/dlls/func_break.cpp:851 */
/* <84da0> ../cstrike/dlls/func_break.cpp:851 */
class CPushable: public CBreakable
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void)
virtual void Spawn(void);
virtual void Precache(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
NOBODY virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
NOBODY virtual void Touch(CBaseEntity *pOther);
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
virtual void Touch(CBaseEntity *pOther);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
@ -195,8 +204,17 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY void Move(CBaseEntity *pMover, int push);
NOBODY void EXPORT StopSound(void);
void Move(CBaseEntity *pMover, int push);
void EXPORT StopSound(void)
{
#if 0
Vector dist = pev->oldorigin - pev->origin;
if (dist.Length() <= 0)
{
STOP_SOUND(ENT(pev), CHAN_WEAPON, m_soundNames[m_lastSound]);
}
#endif
}
inline float MaxSpeed(void)
{
return m_maxSpeed;
@ -214,4 +232,8 @@ public:
};/* size: 200, cachelines: 4, members: 6 */
// linked objects
C_DLLEXPORT void func_breakable(entvars_t *pev);
C_DLLEXPORT void func_pushable(entvars_t *pev);
#endif // FUNC_BREAK_H

File diff suppressed because it is too large Load Diff

View File

@ -40,36 +40,38 @@
#define SF_TANK_CANCONTROL 0x0020
#define SF_TANK_SOUNDON 0x8000
enum TANKBULLET
{
TANK_BULLET_NONE = 0,
TANK_BULLET_9MM,
TANK_BULLET_MP5,
TANK_BULLET_12MM,
enum TANKBULLET
{
TANK_BULLET_NONE = 0, // Custom damage
TANK_BULLET_9MM, // env_laser (duration is 0.5 rate of fire)
TANK_BULLET_MP5, // rockets
TANK_BULLET_12MM, // explosion?
};
/* <8c75e> ../cstrike/dlls/func_tank.cpp:46 */
/* <8c75e> ../cstrike/dlls/func_tank.cpp:46 */
class CFuncTank: public CBaseEntity
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void)
virtual void Spawn(void);
virtual void Precache(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
// Bmodels don't go across transitions
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
NOBODY virtual BOOL OnControls(entvars_t *pevTest);
NOBODY virtual void Think(void);
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
NOBODY virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
NOBODY virtual Vector UpdateTargetPosition(CBaseEntity *pTarget)
virtual BOOL OnControls(entvars_t *pevTest);
virtual void Think(void);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
virtual Vector UpdateTargetPosition(CBaseEntity *pTarget)
{
return UpdateTargetPosition_(pTarget);
return pTarget->BodyTarget(pev->origin);
}
#ifdef HOOK_GAMEDLL
void Spawn_(void);
@ -85,17 +87,13 @@ public:
void Think_(void);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void Fire_(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
Vector UpdateTargetPosition_(CBaseEntity *pTarget)
{
return pTarget->BodyTarget(pev->origin);
}
#endif // HOOK_GAMEDLL
public:
NOBODY void TrackTarget(void);
NOBODY void StartRotSound(void);
NOBODY void StopRotSound(void);
void TrackTarget(void);
void StartRotSound(void);
void StopRotSound(void);
inline BOOL IsActive(void)
{
@ -118,9 +116,11 @@ public:
return (gpGlobals->time - m_lastSightTime) < m_persist;
}
NOBODY BOOL InRange(float range);
NOBODY edict_t *FindTarget(edict_t *pPlayer);
NOBODY void TankTrace(const Vector &vecStart, const Vector &vecForward, const Vector &vecSpread, TraceResult &tr);
BOOL InRange(float range);
// Acquire a target. pPlayer is a player in the PVS
edict_t *FindTarget(edict_t *pPlayer);
void TankTrace(const Vector &vecStart, const Vector &vecForward, const Vector &vecSpread, TraceResult &tr);
Vector BarrelPosition(void)
{
@ -129,10 +129,10 @@ public:
return pev->origin + (forward * m_barrelPos.x) + (right * m_barrelPos.y) + (up * m_barrelPos.z);
}
NOBODY void AdjustAnglesForBarrel(Vector &angles, float distance);
NOBODY BOOL StartControl(CBasePlayer *pController);
NOBODY void StopControl(void);
NOBODY void ControllerPostFrame(void);
void AdjustAnglesForBarrel(Vector &angles, float distance);
BOOL StartControl(CBasePlayer *pController);
void StopControl(void);
void ControllerPostFrame(void);
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[26];
@ -141,55 +141,64 @@ protected:
CBasePlayer *m_pController;
float m_flNextAttack;
Vector m_vecControllerUsePos;
float m_yawCenter;
float m_yawRate;
float m_yawRange;
float m_yawTolerance;
float m_pitchCenter;
float m_pitchRate;
float m_pitchRange;
float m_pitchTolerance;
float m_fireLast;
float m_fireRate;
float m_lastSightTime;
float m_persist;
float m_minRange;
float m_maxRange;
Vector m_barrelPos;
float m_spriteScale;
float m_yawCenter; // "Center" yaw
float m_yawRate; // Max turn rate to track targets
float m_yawRange; // Range of turning motion (one-sided: 30 is +/- 30 degress from center)
// Zero is full rotation
float m_yawTolerance; // Tolerance angle
float m_pitchCenter; // "Center" pitch
float m_pitchRate; // Max turn rate on pitch
float m_pitchRange; // Range of pitch motion as above
float m_pitchTolerance; // Tolerance angle
float m_fireLast; // Last time I fired
float m_fireRate; // How many rounds/second
float m_lastSightTime; // Last time I saw target
float m_persist; // Persistence of firing (how long do I shoot when I can't see)
float m_minRange; // Minimum range to aim/track
float m_maxRange; // Max range to aim/track
Vector m_barrelPos; // Length of the freakin barrel
float m_spriteScale; // Scale of any sprites we shoot
int m_iszSpriteSmoke;
int m_iszSpriteFlash;
TANKBULLET m_bulletType;
int m_iBulletDamage;
Vector m_sightOrigin;
int m_spread;
int m_iszMaster;
TANKBULLET m_bulletType; // Bullet type
int m_iBulletDamage; // 0 means use Bullet type's default damage
Vector m_sightOrigin; // Last sight of target
int m_spread; // firing spread
int m_iszMaster; // Master entity (game_team_master or multisource)
};/* size: 280, cachelines: 5, members: 28 */
/* <8c79a> ../cstrike/dlls/func_tank.cpp:719 */
/* <8c79a> ../cstrike/dlls/func_tank.cpp:719 */
class CFuncTankGun: public CFuncTank
{
public:
NOBODY virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
#ifdef HOOK_GAMEDLL
void Fire_(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
#endif // HOOK_GAMEDLL
};/* size: 280, cachelines: 5, members: 1 */
/* <8c7e8> ../cstrike/dlls/func_tank.cpp:768 */
/* <8c7e8> ../cstrike/dlls/func_tank.cpp:768 */
class CFuncTankLaser: public CFuncTank
{
public:
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY virtual void Activate(void);
NOBODY virtual void Think(void);
NOBODY virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual void Activate(void);
virtual void Think(void);
virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
#ifdef HOOK_GAMEDLL
void KeyValue_(KeyValueData *pkvd);
@ -201,7 +210,7 @@ public:
#endif // HOOK_GAMEDLL
NOBODY CLaser *GetLaser(void);
CLaser *GetLaser(void);
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[2];
@ -212,12 +221,12 @@ private:
};/* size: 288, cachelines: 5, members: 4 */
/* <8c836> ../cstrike/dlls/func_tank.cpp:887 */
/* <8c836> ../cstrike/dlls/func_tank.cpp:887 */
class CFuncTankRocket: public CFuncTank
{
public:
NOBODY virtual void Precache(void);
NOBODY virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
virtual void Precache(void);
virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
#ifdef HOOK_GAMEDLL
@ -228,12 +237,12 @@ public:
};/* size: 280, cachelines: 5, members: 1 */
/* <8c884> ../cstrike/dlls/func_tank.cpp:924 */
/* <8c884> ../cstrike/dlls/func_tank.cpp:924 */
class CFuncTankMortar: public CFuncTank
{
public:
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
virtual void KeyValue(KeyValueData *pkvd);
virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
#ifdef HOOK_GAMEDLL
@ -244,20 +253,20 @@ public:
};/* size: 280, cachelines: 5, members: 1 */
/* <8c8d2> ../cstrike/dlls/func_tank.cpp:974 */
/* <8c8d2> ../cstrike/dlls/func_tank.cpp:974 */
class CFuncTankControls: public CBaseEntity
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void)
virtual void Spawn(void);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
NOBODY virtual void Think(void);
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Think(void);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
@ -280,4 +289,18 @@ public:
};/* size: 156, cachelines: 3, members: 3 */
#ifdef HOOK_GAMEDLL
#define gTankSpread (*pgTankSpread)
extern Vector gTankSpread[5];
#endif // HOOK_GAMEDLL
// linked objects
C_DLLEXPORT void func_tank(entvars_t *pev);
C_DLLEXPORT void func_tanklaser(entvars_t *pev);
C_DLLEXPORT void func_tankrocket(entvars_t *pev);
C_DLLEXPORT void func_tankmortar(entvars_t *pev);
C_DLLEXPORT void func_tankcontrols(entvars_t *pev);
#endif // FUNC_TANK_H

View File

@ -38,17 +38,17 @@ BOOL CGameRules::__MAKE_VHOOK(CanHaveAmmo)(CBasePlayer *pPlayer, const char *psz
/* <ad89d> ../cstrike/dlls/gamerules.cpp:59 */
edict_t *CGameRules::__MAKE_VHOOK(GetPlayerSpawnSpot)(CBasePlayer *pPlayer)
{
edict_t *pentSpawnSpot = EntSelectSpawnPoint(pPlayer);
pPlayer->pev->origin = VARS(pentSpawnSpot)->origin;// + Vector(0, 0, 1);
pPlayer->pev->origin.z += 1;
pPlayer->pev->v_angle = g_vecZero;
pPlayer->pev->velocity = g_vecZero;
pPlayer->pev->angles = VARS(pentSpawnSpot)->angles;
pPlayer->pev->punchangle = g_vecZero;
pPlayer->pev->fixangle = 1;
edict_t *pentSpawnSpot = EntSelectSpawnPoint(pPlayer);
pPlayer->pev->origin = VARS(pentSpawnSpot)->origin;// + Vector(0, 0, 1);
pPlayer->pev->origin.z += 1;
pPlayer->pev->v_angle = g_vecZero;
pPlayer->pev->velocity = g_vecZero;
pPlayer->pev->angles = VARS(pentSpawnSpot)->angles;
pPlayer->pev->punchangle = g_vecZero;
pPlayer->pev->fixangle = 1;
return pentSpawnSpot;
}
@ -68,28 +68,28 @@ BOOL CGameRules::__MAKE_VHOOK(CanHavePlayerItem)(CBasePlayer *pPlayer, CBasePlay
return FALSE;
}
if (pWeapon->pszAmmo1())
{
if (!CanHaveAmmo(pPlayer, pWeapon->pszAmmo1(), pWeapon->iMaxAmmo1()))
{
// we can't carry anymore ammo for this gun. We can only
// have the gun if we aren't already carrying one of this type
if (pPlayer->HasPlayerItem(pWeapon))
{
return FALSE;
}
}
}
else
{
// weapon doesn't use ammo, don't take another if you already have it.
if (pPlayer->HasPlayerItem(pWeapon))
{
return FALSE;
}
if (pWeapon->pszAmmo1())
{
if (!CanHaveAmmo(pPlayer, pWeapon->pszAmmo1(), pWeapon->iMaxAmmo1()))
{
// we can't carry anymore ammo for this gun. We can only
// have the gun if we aren't already carrying one of this type
if (pPlayer->HasPlayerItem(pWeapon))
{
return FALSE;
}
}
}
else
{
// weapon doesn't use ammo, don't take another if you already have it.
if (pPlayer->HasPlayerItem(pWeapon))
{
return FALSE;
}
}
// note: will fall through to here if GetItemInfo doesn't fill the struct!
// note: will fall through to here if GetItemInfo doesn't fill the struct!
return TRUE;
}
@ -143,21 +143,21 @@ NOBODY __declspec(naked) CGameRules *InstallGameRules(void)
void CGameRules::RefreshSkillData(void)
{
RefreshSkillData_();
}
edict_t *CGameRules::GetPlayerSpawnSpot(CBasePlayer *pPlayer)
{
return GetPlayerSpawnSpot_(pPlayer);
}
BOOL CGameRules::CanHavePlayerItem(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon)
{
return CanHavePlayerItem_(pPlayer, pWeapon);
}
BOOL CGameRules::CanHaveAmmo(CBasePlayer *pPlayer, const char *pszAmmoName, int iMaxCarry)
{
return CanHaveAmmo_(pPlayer, pszAmmoName, iMaxCarry);
}
}
edict_t *CGameRules::GetPlayerSpawnSpot(CBasePlayer *pPlayer)
{
return GetPlayerSpawnSpot_(pPlayer);
}
BOOL CGameRules::CanHavePlayerItem(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon)
{
return CanHavePlayerItem_(pPlayer, pWeapon);
}
BOOL CGameRules::CanHaveAmmo(CBasePlayer *pPlayer, const char *pszAmmoName, int iMaxCarry)
{
return CanHaveAmmo_(pPlayer, pszAmmoName, iMaxCarry);
}
#endif // HOOK_GAMEDLL

View File

@ -53,14 +53,14 @@
#define WEAPON_RESPAWN_TIME 20
#define AMMO_RESPAWN_TIME 20
// longest the intermission can last, in seconds
// longest the intermission can last, in seconds
#define MAX_INTERMISSION_TIME 120
// when we are within this close to running out of entities, items
// marked with the ITEM_FLAG_LIMITINWORLD will delay their respawn
// when we are within this close to running out of entities, items
// marked with the ITEM_FLAG_LIMITINWORLD will delay their respawn
#define ENTITY_INTOLERANCE 100
#define MAX_MOTD_CHUNK 60
#define MAX_MOTD_CHUNK 60
#define MAX_MOTD_LENGTH 1536 // (MAX_MOTD_CHUNK * 4)
// custom enum
@ -122,6 +122,7 @@ enum RewardAccount
REWARD_RESCUED_HOSTAGE = 750,
REWARD_KILLED_ENEMY = 300,
REWARD_KILLED_VIP = 2500,
REWARD_VIP_HAVE_SELF_RESCUED = 2500,
};
@ -137,33 +138,33 @@ enum InfoMapBuyParam
BUYING_EVERYONE = 0,
BUYING_ONLY_CTS,
BUYING_ONLY_TERRORISTS,
BUYING_NO_ONE,
BUYING_NO_ONE,
};
enum
{
GR_NONE = 0,
GR_WEAPON_RESPAWN_YES,
GR_WEAPON_RESPAWN_NO,
GR_AMMO_RESPAWN_YES,
GR_AMMO_RESPAWN_NO,
GR_ITEM_RESPAWN_YES,
GR_ITEM_RESPAWN_NO,
GR_PLR_DROP_GUN_ALL,
GR_PLR_DROP_GUN_ACTIVE,
GR_PLR_DROP_GUN_NO,
GR_PLR_DROP_AMMO_ALL,
GR_PLR_DROP_AMMO_ACTIVE,
GR_PLR_DROP_AMMO_NO,
enum
{
GR_NONE = 0,
GR_WEAPON_RESPAWN_YES,
GR_WEAPON_RESPAWN_NO,
GR_AMMO_RESPAWN_YES,
GR_AMMO_RESPAWN_NO,
GR_ITEM_RESPAWN_YES,
GR_ITEM_RESPAWN_NO,
GR_PLR_DROP_GUN_ALL,
GR_PLR_DROP_GUN_ACTIVE,
GR_PLR_DROP_GUN_NO,
GR_PLR_DROP_AMMO_ALL,
GR_PLR_DROP_AMMO_ACTIVE,
GR_PLR_DROP_AMMO_NO,
};
enum
{
GR_NOTTEAMMATE = 0,
GR_TEAMMATE,
GR_ENEMY,
GR_ALLY,
GR_NEUTRAL,
enum
{
GR_NOTTEAMMATE = 0,
GR_TEAMMATE,
GR_ENEMY,
GR_ALLY,
GR_NEUTRAL,
};
class CItem;
@ -192,7 +193,7 @@ public:
virtual BOOL ClientConnected(edict_t *pEntity, const char *pszName, const char *pszAddress, char *szRejectReason) = 0;
virtual void InitHUD(CBasePlayer *pl) = 0;
virtual void ClientDisconnected(edict_t *pClient) = 0;
virtual void UpdateGameMode(CBasePlayer *pPlayer) {}
virtual void UpdateGameMode(CBasePlayer *pPlayer) {};
virtual float FlPlayerFallDamage(CBasePlayer *pPlayer) = 0;
virtual BOOL FPlayerCanTakeDamage(CBasePlayer *pPlayer, CBaseEntity *pAttacker)
{
@ -219,7 +220,7 @@ public:
{
return ClientCommand_(pPlayer, pcmd);
}
virtual void ClientUserInfoChanged(CBasePlayer *pPlayer, char *infobuffer) {}
virtual void ClientUserInfoChanged(CBasePlayer *pPlayer, char *infobuffer) {};
virtual int IPointsForKill(CBasePlayer *pAttacker, CBasePlayer *pKilled) = 0;
virtual void PlayerKilled(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor) = 0;
virtual void DeathNotice(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pevInflictor) = 0;
@ -260,7 +261,7 @@ public:
{
return IsValidTeam_(pTeamName);
}
virtual void ChangePlayerTeam(CBasePlayer *pPlayer, const char *pTeamName, BOOL bKill, BOOL bGib) {}
virtual void ChangePlayerTeam(CBasePlayer *pPlayer, const char *pTeamName, BOOL bKill, BOOL bGib) {};
virtual const char *SetDefaultPlayerTeam(CBasePlayer *pPlayer)
{
return SetDefaultPlayerTeam_(pPlayer);
@ -270,76 +271,76 @@ public:
return PlayTextureSounds_();
}
virtual BOOL FAllowMonsters(void) = 0;
virtual void EndMultiplayerGame(void) {}
virtual void EndMultiplayerGame(void) {};
virtual BOOL IsFreezePeriod(void)
{
return IsFreezePeriod_();
}
virtual void ServerDeactivate(void) {}
virtual void CheckMapConditions(void) {}
virtual void ServerDeactivate(void) {};
virtual void CheckMapConditions(void) {};
#ifdef HOOK_GAMEDLL
void RefreshSkillData_(void);
BOOL IsTeamplay_(void)
{
return FALSE;
}
void RefreshSkillData_(void);
BOOL IsTeamplay_(void)
{
return FALSE;
}
const char *GetGameDescription_(void)
{
return "Counter-Strike";
}
BOOL FPlayerCanTakeDamage_(CBasePlayer *pPlayer, CBaseEntity *pAttacker)
{
return TRUE;
}
BOOL ShouldAutoAim_(CBasePlayer *pPlayer, edict_t *target)
{
return TRUE;
}
edict_t *GetPlayerSpawnSpot_(CBasePlayer *pPlayer);
BOOL AllowAutoTargetCrosshair_(void)
{
return TRUE;
}
BOOL ClientCommand_DeadOrAlive_(CBasePlayer *pPlayer, const char *pcmd)
{
return FALSE;
}
BOOL ClientCommand_(CBasePlayer *pPlayer, const char *pcmd)
{
return FALSE;
}
BOOL CanHavePlayerItem_(CBasePlayer *pPlayer, CBasePlayerItem *pItem);
BOOL CanHaveAmmo_(CBasePlayer *pPlayer, const char *pszAmmoName, int iMaxCarry);
}
BOOL FPlayerCanTakeDamage_(CBasePlayer *pPlayer, CBaseEntity *pAttacker)
{
return TRUE;
}
BOOL ShouldAutoAim_(CBasePlayer *pPlayer, edict_t *target)
{
return TRUE;
}
edict_t *GetPlayerSpawnSpot_(CBasePlayer *pPlayer);
BOOL AllowAutoTargetCrosshair_(void)
{
return TRUE;
}
BOOL ClientCommand_DeadOrAlive_(CBasePlayer *pPlayer, const char *pcmd)
{
return FALSE;
}
BOOL ClientCommand_(CBasePlayer *pPlayer, const char *pcmd)
{
return FALSE;
}
BOOL CanHavePlayerItem_(CBasePlayer *pPlayer, CBasePlayerItem *pItem);
BOOL CanHaveAmmo_(CBasePlayer *pPlayer, const char *pszAmmoName, int iMaxCarry);
float FlHEVChargerRechargeTime_(void)
{
return 0.0f;
}
}
int GetTeamIndex_(const char *pTeamName)
{
return -1;
}
}
const char *GetIndexedTeamName_(int teamIndex)
{
return "";
}
}
BOOL IsValidTeam_(const char *pTeamName)
{
return TRUE;
}
}
const char *SetDefaultPlayerTeam_(CBasePlayer *pPlayer)
{
return "";
}
}
BOOL PlayTextureSounds_(void)
{
return TRUE;
}
}
BOOL IsFreezePeriod_(void)
{
return m_bFreezePeriod;
}
}
#endif // HOOK_GAMEDLL
@ -405,52 +406,52 @@ public:
#ifdef HOOK_GAMEDLL
void Think_(void);
BOOL IsAllowedToSpawn_(CBaseEntity *pEntity);
BOOL FAllowFlashlight_(void)
{
return TRUE;
};
BOOL FShouldSwitchWeapon_(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon);
BOOL GetNextBestWeapon_(CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeapon);
BOOL IsMultiplayer_(void);
BOOL IsDeathmatch_(void);
BOOL IsCoOp_(void);
BOOL ClientConnected_(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[128]);
void InitHUD_(CBasePlayer *pl);
void ClientDisconnected_(edict_t *pClient);
float FlPlayerFallDamage_(CBasePlayer *pPlayer);
void PlayerSpawn_(CBasePlayer *pPlayer);
void PlayerThink_(CBasePlayer *pPlayer);
BOOL FPlayerCanRespawn_(CBasePlayer *pPlayer);
float FlPlayerSpawnTime_(CBasePlayer *pPlayer);
edict_t *GetPlayerSpawnSpot_(CBasePlayer *pPlayer);
BOOL AllowAutoTargetCrosshair_(void);
int IPointsForKill_(CBasePlayer *pAttacker, CBasePlayer *pKilled);
void PlayerKilled_(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor);
void DeathNotice_(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor);
void PlayerGotWeapon_(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon);
int WeaponShouldRespawn_(CBasePlayerItem *pWeapon);
float FlWeaponRespawnTime_(CBasePlayerItem *pWeapon);
float FlWeaponTryRespawn_(CBasePlayerItem *pWeapon);
Vector VecWeaponRespawnSpot_(CBasePlayerItem *pWeapon);
BOOL CanHaveItem_(CBasePlayer *pPlayer, CItem *pItem);
void PlayerGotItem_(CBasePlayer *pPlayer, CItem *pItem);
int ItemShouldRespawn_(CItem *pItem);
float FlItemRespawnTime_(CItem *pItem);
Vector VecItemRespawnSpot_(CItem *pItem);
void PlayerGotAmmo_(CBasePlayer *pPlayer, char *szName, int iCount);
int AmmoShouldRespawn_(CBasePlayerAmmo *pAmmo);
float FlAmmoRespawnTime_(CBasePlayerAmmo *pAmmo);
Vector VecAmmoRespawnSpot_(CBasePlayerAmmo *pAmmo);
float FlHealthChargerRechargeTime_(void);
int DeadPlayerWeapons_(CBasePlayer *pPlayer);
int DeadPlayerAmmo_(CBasePlayer *pPlayer);
const char *GetTeamID_(CBaseEntity *pEntity)
{
return "";
};
int PlayerRelationship_(CBasePlayer *pPlayer, CBaseEntity *pTarget);
void Think_(void);
BOOL IsAllowedToSpawn_(CBaseEntity *pEntity);
BOOL FAllowFlashlight_(void)
{
return TRUE;
};
BOOL FShouldSwitchWeapon_(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon);
BOOL GetNextBestWeapon_(CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeapon);
BOOL IsMultiplayer_(void);
BOOL IsDeathmatch_(void);
BOOL IsCoOp_(void);
BOOL ClientConnected_(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[128]);
void InitHUD_(CBasePlayer *pl);
void ClientDisconnected_(edict_t *pClient);
float FlPlayerFallDamage_(CBasePlayer *pPlayer);
void PlayerSpawn_(CBasePlayer *pPlayer);
void PlayerThink_(CBasePlayer *pPlayer);
BOOL FPlayerCanRespawn_(CBasePlayer *pPlayer);
float FlPlayerSpawnTime_(CBasePlayer *pPlayer);
edict_t *GetPlayerSpawnSpot_(CBasePlayer *pPlayer);
BOOL AllowAutoTargetCrosshair_(void);
int IPointsForKill_(CBasePlayer *pAttacker, CBasePlayer *pKilled);
void PlayerKilled_(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor);
void DeathNotice_(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor);
void PlayerGotWeapon_(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon);
int WeaponShouldRespawn_(CBasePlayerItem *pWeapon);
float FlWeaponRespawnTime_(CBasePlayerItem *pWeapon);
float FlWeaponTryRespawn_(CBasePlayerItem *pWeapon);
Vector VecWeaponRespawnSpot_(CBasePlayerItem *pWeapon);
BOOL CanHaveItem_(CBasePlayer *pPlayer, CItem *pItem);
void PlayerGotItem_(CBasePlayer *pPlayer, CItem *pItem);
int ItemShouldRespawn_(CItem *pItem);
float FlItemRespawnTime_(CItem *pItem);
Vector VecItemRespawnSpot_(CItem *pItem);
void PlayerGotAmmo_(CBasePlayer *pPlayer, char *szName, int iCount);
int AmmoShouldRespawn_(CBasePlayerAmmo *pAmmo);
float FlAmmoRespawnTime_(CBasePlayerAmmo *pAmmo);
Vector VecAmmoRespawnSpot_(CBasePlayerAmmo *pAmmo);
float FlHealthChargerRechargeTime_(void);
int DeadPlayerWeapons_(CBasePlayer *pPlayer);
int DeadPlayerAmmo_(CBasePlayer *pPlayer);
const char *GetTeamID_(CBaseEntity *pEntity)
{
return "";
};
int PlayerRelationship_(CBasePlayer *pPlayer, CBaseEntity *pTarget);
BOOL FAllowMonsters_(void);
#endif // HOOK_GAMEDLL
@ -532,78 +533,78 @@ public:
virtual void ChangeLevel(void);
virtual void GoToIntermission(void);
#ifdef HOOK_GAMEDLL
void RefreshSkillData_(void);
void Think_(void);
BOOL IsAllowedToSpawn_(CBaseEntity *pEntity);
BOOL FAllowFlashlight_(void);
BOOL FShouldSwitchWeapon_(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon);
BOOL GetNextBestWeapon_(CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeapon);
BOOL IsMultiplayer_(void);
BOOL IsDeathmatch_(void);
BOOL IsCoOp_(void);
BOOL ClientConnected_(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[128]);
void InitHUD_(CBasePlayer *pl);
void ClientDisconnected_(edict_t *pClient);
void UpdateGameMode_(CBasePlayer *pPlayer);
float FlPlayerFallDamage_(CBasePlayer *pPlayer);
BOOL FPlayerCanTakeDamage_(CBasePlayer *pPlayer, CBaseEntity *pAttacker);
void PlayerSpawn_(CBasePlayer *pPlayer);
void PlayerThink_(CBasePlayer *pPlayer);
BOOL FPlayerCanRespawn_(CBasePlayer *pPlayer);
float FlPlayerSpawnTime_(CBasePlayer *pPlayer);
edict_t *GetPlayerSpawnSpot_(CBasePlayer *pPlayer);
BOOL AllowAutoTargetCrosshair_(void);
BOOL ClientCommand_DeadOrAlive_(CBasePlayer *pPlayer, const char *pcmd);
BOOL ClientCommand_(CBasePlayer *pPlayer, const char *pcmd);
void ClientUserInfoChanged_(CBasePlayer *pPlayer, char *infobuffer);
int IPointsForKill_(CBasePlayer *pAttacker, CBasePlayer *pKilled);
void PlayerKilled_(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor);
void DeathNotice_(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor);
BOOL CanHavePlayerItem_(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon);
void PlayerGotWeapon_(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon);
int WeaponShouldRespawn_(CBasePlayerItem *pWeapon);
float FlWeaponRespawnTime_(CBasePlayerItem *pWeapon);
float FlWeaponTryRespawn_(CBasePlayerItem *pWeapon);
Vector VecWeaponRespawnSpot_(CBasePlayerItem *pWeapon);
BOOL CanHaveItem_(CBasePlayer *pPlayer, CItem *pItem);
void PlayerGotItem_(CBasePlayer *pPlayer, CItem *pItem);
int ItemShouldRespawn_(CItem *pItem);
float FlItemRespawnTime_(CItem *pItem);
Vector VecItemRespawnSpot_(CItem *pItem);
void PlayerGotAmmo_(CBasePlayer *pPlayer, char *szName, int iCount);
int AmmoShouldRespawn_(CBasePlayerAmmo *pAmmo);
float FlAmmoRespawnTime_(CBasePlayerAmmo *pAmmo);
Vector VecAmmoRespawnSpot_(CBasePlayerAmmo *pAmmo);
float FlHealthChargerRechargeTime_(void);
float FlHEVChargerRechargeTime_(void);
int DeadPlayerWeapons_(CBasePlayer *pPlayer);
int DeadPlayerAmmo_(CBasePlayer *pPlayer);
#ifdef HOOK_GAMEDLL
void RefreshSkillData_(void);
void Think_(void);
BOOL IsAllowedToSpawn_(CBaseEntity *pEntity);
BOOL FAllowFlashlight_(void);
BOOL FShouldSwitchWeapon_(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon);
BOOL GetNextBestWeapon_(CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeapon);
BOOL IsMultiplayer_(void);
BOOL IsDeathmatch_(void);
BOOL IsCoOp_(void);
BOOL ClientConnected_(edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[128]);
void InitHUD_(CBasePlayer *pl);
void ClientDisconnected_(edict_t *pClient);
void UpdateGameMode_(CBasePlayer *pPlayer);
float FlPlayerFallDamage_(CBasePlayer *pPlayer);
BOOL FPlayerCanTakeDamage_(CBasePlayer *pPlayer, CBaseEntity *pAttacker);
void PlayerSpawn_(CBasePlayer *pPlayer);
void PlayerThink_(CBasePlayer *pPlayer);
BOOL FPlayerCanRespawn_(CBasePlayer *pPlayer);
float FlPlayerSpawnTime_(CBasePlayer *pPlayer);
edict_t *GetPlayerSpawnSpot_(CBasePlayer *pPlayer);
BOOL AllowAutoTargetCrosshair_(void);
BOOL ClientCommand_DeadOrAlive_(CBasePlayer *pPlayer, const char *pcmd);
BOOL ClientCommand_(CBasePlayer *pPlayer, const char *pcmd);
void ClientUserInfoChanged_(CBasePlayer *pPlayer, char *infobuffer);
int IPointsForKill_(CBasePlayer *pAttacker, CBasePlayer *pKilled);
void PlayerKilled_(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor);
void DeathNotice_(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor);
BOOL CanHavePlayerItem_(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon);
void PlayerGotWeapon_(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon);
int WeaponShouldRespawn_(CBasePlayerItem *pWeapon);
float FlWeaponRespawnTime_(CBasePlayerItem *pWeapon);
float FlWeaponTryRespawn_(CBasePlayerItem *pWeapon);
Vector VecWeaponRespawnSpot_(CBasePlayerItem *pWeapon);
BOOL CanHaveItem_(CBasePlayer *pPlayer, CItem *pItem);
void PlayerGotItem_(CBasePlayer *pPlayer, CItem *pItem);
int ItemShouldRespawn_(CItem *pItem);
float FlItemRespawnTime_(CItem *pItem);
Vector VecItemRespawnSpot_(CItem *pItem);
void PlayerGotAmmo_(CBasePlayer *pPlayer, char *szName, int iCount);
int AmmoShouldRespawn_(CBasePlayerAmmo *pAmmo);
float FlAmmoRespawnTime_(CBasePlayerAmmo *pAmmo);
Vector VecAmmoRespawnSpot_(CBasePlayerAmmo *pAmmo);
float FlHealthChargerRechargeTime_(void);
float FlHEVChargerRechargeTime_(void);
int DeadPlayerWeapons_(CBasePlayer *pPlayer);
int DeadPlayerAmmo_(CBasePlayer *pPlayer);
const char *GetTeamID_(CBaseEntity *pEntity)
{
return "";
}
int PlayerRelationship_(CBasePlayer *pPlayer, CBaseEntity *pTarget);
}
int PlayerRelationship_(CBasePlayer *pPlayer, CBaseEntity *pTarget);
BOOL PlayTextureSounds_(void)
{
return FALSE;
}
BOOL FAllowMonsters_(void);
}
BOOL FAllowMonsters_(void);
void EndMultiplayerGame_(void)
{
GoToIntermission();
}
void ServerDeactivate_(void);
void CheckMapConditions_(void);
void CleanUpMap_(void);
void RestartRound_(void);
void CheckWinConditions_(void);
void RemoveGuns_(void);
void GiveC4_(void);
void ChangeLevel_(void);
void GoToIntermission_(void);
}
void ServerDeactivate_(void);
void CheckMapConditions_(void);
void CleanUpMap_(void);
void RestartRound_(void);
void CheckWinConditions_(void);
void RemoveGuns_(void);
void GiveC4_(void);
void ChangeLevel_(void);
void GoToIntermission_(void);
#endif // HOOK_GAMEDLL
public:
@ -773,18 +774,18 @@ public:
};/* size: 160, cachelines: 3, members: 3 */
/* <111732> ../cstrike/dlls/multiplay_gamerules.cpp:292 */
class CCStrikeGameMgrHelper: public IVoiceGameMgrHelper
{
public:
virtual bool CanPlayerHearPlayer(CBasePlayer *pListener, CBasePlayer *pSender);
#ifdef HOOK_GAMEDLL
bool CanPlayerHearPlayer_(CBasePlayer *pListener, CBasePlayer *pSender);
#endif // HOOK_GAMEDLL
/* <111732> ../cstrike/dlls/multiplay_gamerules.cpp:292 */
class CCStrikeGameMgrHelper: public IVoiceGameMgrHelper
{
public:
virtual bool CanPlayerHearPlayer(CBasePlayer *pListener, CBasePlayer *pSender);
#ifdef HOOK_GAMEDLL
bool CanPlayerHearPlayer_(CBasePlayer *pListener, CBasePlayer *pSender);
#endif // HOOK_GAMEDLL
};/* size: 4, cachelines: 1, members: 1 */
#ifdef HOOK_GAMEDLL
@ -809,26 +810,26 @@ CGameRules *InstallGameRules(void);
* Multiplay gamerules
*/
bool IsBotSpeaking(void);
void SV_Continue_f(void);
void SV_Tutor_Toggle_f(void);
void SV_Career_Restart_f(void);
void SV_Career_EndRound_f(void);
void SV_CareerAddTask_f(void);
void SV_CareerMatchLimit_f(void);
void Broadcast(const char *sentence);
char *GetTeam(int teamNo);
void EndRoundMessage(const char *sentence, int event);
void ReadMultiplayCvars(CHalfLifeMultiplay *mp);
void DestroyMapCycle(mapcycle_t *cycle);
char *MP_COM_GetToken(void);
char *MP_COM_Parse(char *data);
int MP_COM_TokenWaiting(char *buffer);
int ReloadMapCycleFile(char *filename, mapcycle_t *cycle);
int CountPlayers(void);
void ExtractCommandString(char *s, char *szCommand);
bool IsBotSpeaking(void);
void SV_Continue_f(void);
void SV_Tutor_Toggle_f(void);
void SV_Career_Restart_f(void);
void SV_Career_EndRound_f(void);
void SV_CareerAddTask_f(void);
void SV_CareerMatchLimit_f(void);
void Broadcast(const char *sentence);
char *GetTeam(int teamNo);
void EndRoundMessage(const char *sentence, int event);
void ReadMultiplayCvars(CHalfLifeMultiplay *mp);
void DestroyMapCycle(mapcycle_t *cycle);
char *MP_COM_GetToken(void);
char *MP_COM_Parse(char *data);
int MP_COM_TokenWaiting(char *buffer);
int ReloadMapCycleFile(char *filename, mapcycle_t *cycle);
int CountPlayers(void);
void ExtractCommandString(char *s, char *szCommand);
int GetMapCount(void);
// refs

View File

@ -26,7 +26,7 @@ TYPEDESCRIPTION CGrenade::m_SaveData[] =
#else // HOOK_GAMEDLL
TYPEDESCRIPTION (*CGrenade::pm_SaveData)[15];
TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CGrenade, m_SaveData)[15];
#endif // HOOK_GAMEDLL
@ -855,7 +855,9 @@ void CGrenade::__MAKE_VHOOK(Spawn)(void)
pev->movetype = MOVETYPE_BOUNCE;
if (pev->classname)
{
RemoveEntityHashValue(pev, STRING(pev->classname), CLASSNAME);
}
MAKE_STRING_CLASS("grenade", pev);
AddEntityHashValue(pev, STRING(pev->classname), CLASSNAME);
@ -864,7 +866,7 @@ void CGrenade::__MAKE_VHOOK(Spawn)(void)
pev->solid = SOLID_BBOX;
SET_MODEL(ENT(pev), "models/grenade.mdl");
UTIL_SetSize(pev, Vector( 0, 0, 0), Vector(0, 0, 0));
UTIL_SetSize(pev, Vector(0, 0, 0), Vector(0, 0, 0));
pev->dmg = 30;
m_fRegisteredSound = FALSE;
@ -1005,10 +1007,13 @@ void CGrenade::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller,
if (player->m_bHasDefuser)
{
UTIL_LogPrintf("\"%s<%i><%s><CT>\" triggered \"Begin_Bomb_Defuse_With_Kit\"\n",
UTIL_LogPrintf
(
"\"%s<%i><%s><CT>\" triggered \"Begin_Bomb_Defuse_With_Kit\"\n",
STRING(player->pev->netname),
GETPLAYERUSERID(player->edict()),
GETPLAYERAUTHID(player->edict()));
GETPLAYERAUTHID(player->edict())
);
ClientPrint(player->pev, HUD_PRINTCENTER, "#Defusing_Bomb_With_Defuse_Kit");
EMIT_SOUND(ENT(player->pev), CHAN_ITEM, "weapons/c4_disarm.wav", VOL_NORM, ATTN_NORM);

View File

@ -1,5 +1,8 @@
#include "precompiled.h"
#define NUM_LATERAL_CHECKS 13 // how many checks are made on each side of a monster looking for lateral cover
#define NUM_LATERAL_LOS_CHECKS 6 // how many checks are made on each side of a monster looking for lateral cover
/*
* Globals initialization
*/
@ -14,93 +17,165 @@ BOOL g_fDrawLines;
#endif // HOOK_GAMEDLL
/* <c08f4> ../cstrike/dlls/h_ai.cpp:47 */
NOBODY BOOL FBoxVisible(entvars_t *pevLooker, entvars_t *pevTarget, Vector &vecTargetOrigin, float flSize)
NOXREF BOOL FBoxVisible(entvars_t *pevLooker, entvars_t *pevTarget, Vector &vecTargetOrigin, float flSize)
{
// {
// TraceResult tr; // 54
// Vector vecLookerOrigin; // 55
// operator+(const Vector *const this,
// const Vector &v); // 55
// {
// int i; // 56
// {
// Vector vecTarget; // 58
// Vector(Vector *const this,
// const Vector &v); // 58
// }
// }
// }
// don't look through water
if ((pevLooker->waterlevel != 3 && pevTarget->waterlevel == 3) || (pevLooker->waterlevel == 3 && pevTarget->waterlevel == 0))
{
return FALSE;
}
TraceResult tr;
//look through the monster's 'eyes'
Vector vecLookerOrigin = pevLooker->origin + pevLooker->view_ofs;
for (int i = 0; i < 5; i++)
{
Vector vecTarget = pevTarget->origin;
vecTarget.x += RANDOM_FLOAT(pevTarget->mins.x + flSize, pevTarget->maxs.x - flSize);
vecTarget.y += RANDOM_FLOAT(pevTarget->mins.y + flSize, pevTarget->maxs.y - flSize);
vecTarget.z += RANDOM_FLOAT(pevTarget->mins.z + flSize, pevTarget->maxs.z - flSize);
UTIL_TraceLine(vecLookerOrigin, vecTarget, ignore_monsters, ignore_glass, ENT(pevLooker), &tr);
if (tr.flFraction == 1.0f)
{
vecTargetOrigin = vecTarget;
// line of sight is valid.
return TRUE;
}
}
// Line of sight is not established
return FALSE;
}
// VecCheckToss - returns the velocity at which an object should be lobbed from vecspot1 to land near vecspot2.
// returns g_vecZero if toss is not feasible.
/* <c0a19> ../cstrike/dlls/h_ai.cpp:78 */
NOBODY Vector VecCheckToss(entvars_t *pev, Vector &vecSpot1, Vector vecSpot2, float flGravityAdj)
NOXREF Vector VecCheckToss(entvars_t *pev, const Vector &vecSpot1, Vector vecSpot2, float flGravityAdj)
{
// {
// TraceResult tr; // 80
// Vector vecMidPoint; // 81
// Vector vecApex; // 82
// Vector vecScale; // 83
// Vector vecGrenadeVel; // 84
// Vector vecTemp; // 85
// float flGravity; // 86
// float distance1; // 119
// float distance2; // 120
// float time1; // 123
// float time2; // 124
// Vector(Vector *const this,
// const Vector &v); // 153
// operator*(const Vector *const this,
// float fl); // 97
// operator+(const Vector *const this,
// const Vector &v); // 97
// operator*(const Vector *const this,
// float fl); // 98
// operator+(const Vector *const this,
// const Vector &v); // 98
// operator-(const Vector *const this,
// const Vector &v); // 106
// operator+(const Vector *const this,
// const Vector &v); // 106
// operator*(const Vector *const this,
// float fl); // 106
// operator+(const Vector *const this,
// const Vector &v); // 107
// operator-(const Vector *const this,
// const Vector &v); // 133
// operator/(const Vector *const this,
// float fl); // 133
// operator*(const Vector *const this,
// float fl); // 138
// operator+(const Vector *const this,
// const Vector &v); // 138
// Vector(Vector *const this,
// const Vector &v); // 156
// }
TraceResult tr;
Vector vecMidPoint; // halfway point between Spot1 and Spot2
Vector vecApex; // highest point
Vector vecScale;
Vector vecGrenadeVel;
Vector vecTemp;
float flGravity = g_psv_gravity->value * flGravityAdj;
if (vecSpot2.z - vecSpot1.z > 500)
{
// to high, fail
return g_vecZero;
}
UTIL_MakeVectors(pev->angles);
// toss a little bit to the left or right, not right down on the enemy's bean (head).
vecSpot2 = vecSpot2 + gpGlobals->v_right * (RANDOM_FLOAT(-8, 8) + RANDOM_FLOAT(-16, 16));
vecSpot2 = vecSpot2 + gpGlobals->v_forward * (RANDOM_FLOAT(-8, 8) + RANDOM_FLOAT(-16, 16));
// calculate the midpoint and apex of the 'triangle'
// UNDONE: normalize any Z position differences between spot1 and spot2 so that triangle is always RIGHT
// How much time does it take to get there?
// get a rough idea of how high it can be thrown
vecMidPoint = vecSpot1 + (vecSpot2 - vecSpot1) * 0.5;
UTIL_TraceLine(vecMidPoint, vecMidPoint + Vector(0,0,500), ignore_monsters, ENT(pev), &tr);
vecMidPoint = tr.vecEndPos;
// (subtract 15 so the grenade doesn't hit the ceiling)
vecMidPoint.z -= 15;
if (vecMidPoint.z < vecSpot1.z || vecMidPoint.z < vecSpot2.z)
{
// to not enough space, fail
return g_vecZero;
}
// How high should the grenade travel to reach the apex
float distance1 = (vecMidPoint.z - vecSpot1.z);
float distance2 = (vecMidPoint.z - vecSpot2.z);
// How long will it take for the grenade to travel this distance
float time1 = sqrt(distance1 / (0.5 * flGravity));
float time2 = sqrt(distance2 / (0.5 * flGravity));
if (time1 < 0.1)
{
// too close
return g_vecZero;
}
// how hard to throw sideways to get there in time.
vecGrenadeVel = (vecSpot2 - vecSpot1) / (time1 + time2);
// how hard upwards to reach the apex at the right time.
vecGrenadeVel.z = flGravity * time1;
// find the apex
vecApex = vecSpot1 + vecGrenadeVel * time1;
vecApex.z = vecMidPoint.z;
UTIL_TraceLine(vecSpot1, vecApex, dont_ignore_monsters, ENT(pev), &tr);
if (tr.flFraction != 1.0f)
{
// fail!
return g_vecZero;
}
// UNDONE: either ignore monsters or change it to not care if we hit our enemy
UTIL_TraceLine(vecSpot2, vecApex, ignore_monsters, ENT(pev), &tr);
if (tr.flFraction != 1.0)
{
// fail!
return g_vecZero;
}
return vecGrenadeVel;
}
// VecCheckThrow - returns the velocity vector at which an object should be thrown from vecspot1 to hit vecspot2.
// returns g_vecZero if throw is not feasible.
/* <c0d21> ../cstrike/dlls/h_ai.cpp:164 */
NOBODY Vector VecCheckThrow(entvars_t *pev, Vector &vecSpot1, Vector vecSpot2, float flSpeed, float flGravityAdj)
NOXREF Vector VecCheckThrow(entvars_t *pev, const Vector &vecSpot1, Vector vecSpot2, float flSpeed, float flGravityAdj)
{
// {
// float flGravity; // 166
// Vector vecGrenadeVel; // 168
// float time; // 171
// Vector vecApex; // 177
// TraceResult tr; // 180
// operator-(const Vector *const this,
// const Vector &v); // 168
// Length(const Vector *const this); // 171
// operator-(const Vector *const this,
// const Vector &v); // 177
// operator*(const Vector *const this,
// float fl); // 177
// operator+(const Vector *const this,
// const Vector &v); // 177
// Vector(Vector *const this,
// const Vector &v); // 192
// operator*(const Vector *const this,
// float fl); // 172
// Vector(Vector *const this,
// const Vector &v); // 195
// }
float flGravity = g_psv_gravity->value * flGravityAdj;
Vector vecGrenadeVel = (vecSpot2 - vecSpot1);
// throw at a constant time
float time = vecGrenadeVel.Length() / flSpeed;
vecGrenadeVel = vecGrenadeVel * (1.0 / time);
// adjust upward toss to compensate for gravity loss
vecGrenadeVel.z += flGravity * time * 0.5;
Vector vecApex = vecSpot1 + (vecSpot2 - vecSpot1) * 0.5;
vecApex.z += 0.5 * flGravity * (time * 0.5) * (time * 0.5);
TraceResult tr;
UTIL_TraceLine(vecSpot1, vecApex, dont_ignore_monsters, ENT(pev), &tr);
if (tr.flFraction != 1.0f)
{
// fail!
return g_vecZero;
}
UTIL_TraceLine(vecSpot2, vecApex, ignore_monsters, ENT(pev), &tr);
if (tr.flFraction != 1.0f)
{
// fail!
return g_vecZero;
}
return vecGrenadeVel;
}

View File

@ -32,8 +32,8 @@
#pragma once
#endif
NOBODY BOOL FBoxVisible(entvars_t *pevLooker, entvars_t *pevTarget, Vector &vecTargetOrigin, float flSize);
NOBODY Vector VecCheckToss(entvars_t *pev, Vector &vecSpot1, Vector vecSpot2, float flGravityAdj);
NOBODY Vector VecCheckThrow(entvars_t *pev, Vector &vecSpot1, Vector vecSpot2, float flSpeed, float flGravityAdj);
NOXREF BOOL FBoxVisible(entvars_t *pevLooker, entvars_t *pevTarget, Vector &vecTargetOrigin, float flSize);
NOXREF Vector VecCheckToss(entvars_t *pev, const Vector &vecSpot1, Vector vecSpot2, float flGravityAdj);
NOXREF Vector VecCheckThrow(entvars_t *pev, const Vector &vecSpot1, Vector vecSpot2, float flSpeed, float flGravityAdj);
#endif // H_AI_H

View File

@ -16,7 +16,7 @@ TYPEDESCRIPTION CRecharge::m_SaveData[] =
#else
TYPEDESCRIPTION (*CRecharge::pm_SaveData)[5];
TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CRecharge, m_SaveData)[5];
#endif // HOOK_GAMEDLL
@ -54,7 +54,8 @@ void CRecharge::__MAKE_VHOOK(Spawn)(void)
pev->solid = SOLID_BSP;
pev->movetype = MOVETYPE_PUSH;
UTIL_SetOrigin(pev, pev->origin); // set size and link into world
// set size and link into world
UTIL_SetOrigin(pev, pev->origin);
UTIL_SetSize(pev, pev->mins, pev->maxs);
SET_MODEL(ENT(pev), STRING(pev->model));

View File

@ -24,9 +24,9 @@ TYPEDESCRIPTION CWreckage::m_SaveData[] =
#else
TYPEDESCRIPTION (*CCycler::pm_SaveData)[1];
TYPEDESCRIPTION (*CCyclerSprite::pm_SaveData)[3];
TYPEDESCRIPTION (*CWreckage::pm_SaveData)[1];
TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CCycler, m_SaveData)[1];
TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CCyclerSprite, m_SaveData)[3];
TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CWreckage, m_SaveData)[1];
#endif // HOOK_GAMEDLL
@ -36,17 +36,7 @@ IMPLEMENT_SAVERESTORE(CCycler, CBaseToggle);
/* <cd01f> ../cstrike/dlls/h_cycler.cpp:70 */
void CGenericCycler::__MAKE_VHOOK(Spawn)(void)
{
// Vector(Vector::Spawn(// float X,
// float Y,
// float Z); // 70
// Vector(Vector *const this,
// float X,
// float Y,
// float Z); // 70
// GenericCyclerSpawn(CCycler *const this,
// char *szModel,
// Vector vecMin,
// Vector vecMax); // 70
GenericCyclerSpawn((char *)STRING(pev->model), Vector(-16, -16, 0), Vector(16, 16, 72));
}
/* <cd2d2> ../cstrike/dlls/h_cycler.cpp:72 */
@ -58,52 +48,144 @@ LINK_ENTITY_TO_CLASS(cycler_prdroid, CCyclerProbe);
/* <cd16d> ../cstrike/dlls/h_cycler.cpp:86 */
void CCyclerProbe::__MAKE_VHOOK(Spawn)(void)
{
// Vector(Vector::Spawn(// float X,
// float Y,
// float Z); // 89
// operator+(const Vector *const this,
// const Vector &v); // 88
// Vector(Vector *const this,
// float X,
// float Y,
// float Z); // 89
pev->origin = pev->origin + Vector(0, 0, 16);
GenericCyclerSpawn("models/prdroid.mdl", Vector(-16, -16, -16), Vector(16, 16, 16));
}
// Cycler member functions
/* <cd466> ../cstrike/dlls/h_cycler.cpp:96 */
void CCycler::GenericCyclerSpawn(char *szModel, Vector vecMin, Vector vecMax)
{
// GenericCyclerSpawn(CCycler *const this,
// char *szModel,
// Vector vecMin,
// Vector vecMax); // 96
// MAKE_STRING_CLASS(const char *str,
// entvars_t *pev); // 105
if (!szModel || !*szModel)
{
ALERT(at_error, "cycler at %.0f %.0f %0.f missing modelname", pev->origin.x, pev->origin.y, pev->origin.z);
REMOVE_ENTITY(ENT(pev));
return;
}
if (pev->classname)
{
RemoveEntityHashValue(pev, STRING(pev->classname), CLASSNAME);
}
MAKE_STRING_CLASS("cycler", pev);
AddEntityHashValue(pev, STRING(pev->classname), CLASSNAME);
PRECACHE_MODEL(szModel);
SET_MODEL(ENT(pev), szModel);
CCycler::Spawn();
UTIL_SetSize(pev, vecMin, vecMax);
}
/* <ccc91> ../cstrike/dlls/h_cycler.cpp:115 */
void CCycler::__MAKE_VHOOK(Spawn)(void)
{
InitBoneControllers();
pev->solid = SOLID_SLIDEBOX;
pev->movetype = MOVETYPE_NONE;
pev->takedamage = DAMAGE_YES;
pev->effects = 0;
// no cycler should die
pev->health = 80000;
pev->yaw_speed = 5;
pev->ideal_yaw = pev->angles.y;
ChangeYaw(360);
m_flFrameRate = 75;
m_flGroundSpeed = 0;
pev->nextthink += 1.0;
ResetSequenceInfo();
if (pev->sequence != 0 || pev->frame != 0)
{
m_animate = 0;
pev->framerate = 0;
}
else
{
m_animate = 1;
}
}
// cycler think
/* <ccd3e> ../cstrike/dlls/h_cycler.cpp:151 */
void CCycler::__MAKE_VHOOK(Think)(void)
{
// Think(CCycler *const this); // 151
pev->nextthink = gpGlobals->time + 0.1f;
if (m_animate)
{
StudioFrameAdvance();
}
if (m_fSequenceFinished && !m_fSequenceLoops)
{
// ResetSequenceInfo();
// hack to avoid reloading model every frame
pev->animtime = gpGlobals->time;
pev->framerate = 1.0;
m_fSequenceFinished = FALSE;
m_flLastEventCheck = gpGlobals->time;
pev->frame = 0;
if (!m_animate)
{
// FIX: don't reset framerate
pev->framerate = 0.0;
}
}
}
// CyclerUse - starts a rotation trend
/* <cc8bf> ../cstrike/dlls/h_cycler.cpp:176 */
void CCycler::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
m_animate = !m_animate;
if (m_animate)
pev->framerate = 1.0;
else
pev->framerate = 0.0;
}
// CyclerPain , changes sequences when shot
/* <ccf43> ../cstrike/dlls/h_cycler.cpp:189 */
int CCycler::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{
// TakeDamage(CCycler *const this,
// entvars_t *pevInflictor,
// entvars_t *pevAttacker,
// float flDamage,
// int bitsDamageType); // 189
if (m_animate)
{
pev->sequence++;
ResetSequenceInfo();
if (m_flFrameRate == 0.0)
{
pev->sequence = 0;
ResetSequenceInfo();
}
pev->frame = 0;
}
else
{
pev->framerate = 1.0;
StudioFrameAdvance(0.1);
pev->framerate = 0;
ALERT(at_console, "sequence: %d, frame %.0f\n", pev->sequence, pev->frame);
}
return 0;
}
/* <cd4f8> ../cstrike/dlls/h_cycler.cpp:246 */
@ -112,47 +194,96 @@ LINK_ENTITY_TO_CLASS(cycler_sprite, CCyclerSprite);
/* <ccef7> ../cstrike/dlls/h_cycler.cpp:255 */
IMPLEMENT_SAVERESTORE(CCyclerSprite, CBaseEntity);
/* <cc982> ../cstrike/dlls/h_cycler.cpp:284 */
void CCyclerSprite::__MAKE_VHOOK(Restart)(void)
{
// {
// int i; // 300
// }
}
/* <cc943> ../cstrike/dlls/h_cycler.cpp:258 */
void CCyclerSprite::__MAKE_VHOOK(Spawn)(void)
{
// {
// int i; // 279
// }
pev->solid = SOLID_SLIDEBOX;
pev->movetype = MOVETYPE_NONE;
pev->takedamage = DAMAGE_YES;
pev->effects = 0;
pev->frame = 0;
pev->nextthink = gpGlobals->time + 0.1f;
m_animate = 1;
m_lastTime = gpGlobals->time;
PRECACHE_MODEL((char *)STRING(pev->model));
SET_MODEL(ENT(pev), STRING(pev->model));
m_maxFrame = (float)MODEL_FRAMES(pev->modelindex) - 1;
m_renderfx = pev->renderfx;
m_rendermode = pev->rendermode;
m_renderamt = pev->renderamt;
for (int i = 0; i < ARRAYSIZE(pev->rendercolor); i++)
{
pev->rendercolor[i] = m_rendercolor[i];
}
}
/* <cc982> ../cstrike/dlls/h_cycler.cpp:284 */
void CCyclerSprite::__MAKE_VHOOK(Restart)(void)
{
pev->solid = SOLID_SLIDEBOX;
pev->movetype = MOVETYPE_NONE;
pev->takedamage = DAMAGE_YES;
pev->effects = 0;
pev->frame = 0;
pev->nextthink = gpGlobals->time + 0.1f;
m_animate = 1;
m_lastTime = gpGlobals->time;
pev->renderfx = m_renderfx;
pev->rendermode = m_rendermode;
pev->renderamt = m_renderamt;
for (int i = 0; i < ARRAYSIZE(pev->rendercolor); i++)
{
pev->rendercolor[i] = m_rendercolor[i];
}
}
/* <cd0ef> ../cstrike/dlls/h_cycler.cpp:305 */
void CCyclerSprite::__MAKE_VHOOK(Think)(void)
{
// ShouldAnimate(CCyclerSprite *const this); // 307
// Animate(CCyclerSprite *const this,
// float frames); // 308
if (ShouldAnimate())
{
Animate(pev->framerate * (gpGlobals->time - m_lastTime));
}
pev->nextthink = gpGlobals->time + 0.1f;
m_lastTime = gpGlobals->time;
}
/* <cc9c1> ../cstrike/dlls/h_cycler.cpp:315 */
void CCyclerSprite::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
m_animate = !m_animate;
ALERT(at_console, "Sprite: %s\n", STRING(pev->model));
}
/* <cd228> ../cstrike/dlls/h_cycler.cpp:322 */
int CCyclerSprite::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{
// Animate(CCyclerSprite *const this,
// float frames); // 326
if (m_maxFrame > 1.0)
{
Animate(1.0);
}
return 1;
}
/* <cd5c2> ../cstrike/dlls/h_cycler.cpp:331 */
void CCyclerSprite::Animate(float frames)
{
// Animate(CCyclerSprite *const this,
// float frames); // 331
pev->frame += frames;
if (m_maxFrame > 0)
{
pev->frame = fmod((float_precision)pev->frame, (float_precision)m_maxFrame);
}
}
/* <cd610> ../cstrike/dlls/h_cycler.cpp:358 */
@ -161,38 +292,64 @@ LINK_ENTITY_TO_CLASS(cycler_weapon, CWeaponCycler);
/* <ccbf6> ../cstrike/dlls/h_cycler.cpp:361 */
void CWeaponCycler::__MAKE_VHOOK(Spawn)(void)
{
// Vector(Vector::Spawn(// float X,
// float Y,
// float Z); // 372
// Vector(Vector *const this,
// float X,
// float Y,
// float Z); // 372
pev->solid = SOLID_SLIDEBOX;
pev->movetype = MOVETYPE_NONE;
PRECACHE_MODEL((char *)STRING(pev->model));
SET_MODEL(ENT(pev), STRING(pev->model));
m_iszModel = pev->model;
m_iModel = pev->modelindex;
UTIL_SetOrigin(pev, pev->origin);
UTIL_SetSize(pev, Vector(-16, -16, 0), Vector(16, 16, 16));
SetTouch(&CWeaponCycler::DefaultTouch);
}
/* <cca7c> ../cstrike/dlls/h_cycler.cpp:378 */
BOOL CWeaponCycler::__MAKE_VHOOK(Deploy)(void)
{
m_pPlayer->pev->viewmodel = m_iszModel;
m_pPlayer->m_flNextAttack = WEAPON_TIMEBASED + 1.0;
SendWeaponAnim(0);
m_iClip = 0;
return TRUE;
}
/* <ccaa3> ../cstrike/dlls/h_cycler.cpp:388 */
void CWeaponCycler::__MAKE_VHOOK(Holster)(int skiplocal)
{
m_pPlayer->m_flNextAttack = WEAPON_TIMEBASED + 0.5;
}
/* <ccad8> ../cstrike/dlls/h_cycler.cpp:394 */
void CWeaponCycler::__MAKE_VHOOK(PrimaryAttack)(void)
{
SendWeaponAnim(pev->sequence);
m_flNextPrimaryAttack = gpGlobals->time + 0.3;
}
/* <ccb97> ../cstrike/dlls/h_cycler.cpp:403 */
void CWeaponCycler::__MAKE_VHOOK(SecondaryAttack)(void)
{
// {
// float flFrameRate; // 405
// float flGroundSpeed; // 405
// void *pmodel; // 410
// }
float flFrameRate, flGroundSpeed;
pev->sequence = (pev->sequence + 1) % 8;
pev->modelindex = m_iModel;
void *pmodel = GET_MODEL_PTR(ENT(pev));
GetSequenceInfo(pmodel, pev, &flFrameRate, &flGroundSpeed);
pev->modelindex = 0;
if (flFrameRate == 0.0)
{
pev->sequence = 0;
}
SendWeaponAnim(pev->sequence);
m_flNextSecondaryAttack = gpGlobals->time + 0.3;
}
/* <cce12> ../cstrike/dlls/h_cycler.cpp:443 */
@ -204,24 +361,67 @@ LINK_ENTITY_TO_CLASS(cycler_wreckage, CWreckage);
/* <ccaff> ../cstrike/dlls/h_cycler.cpp:448 */
void CWreckage::__MAKE_VHOOK(Spawn)(void)
{
pev->solid = SOLID_NOT;
pev->movetype = MOVETYPE_NONE;
pev->takedamage = DAMAGE_NO;
pev->effects = 0;
pev->frame = 0;
pev->nextthink = gpGlobals->time + 0.1f;
if (!FStringNull(pev->model))
{
PRECACHE_MODEL((char *)STRING(pev->model));
SET_MODEL(ENT(pev), STRING(pev->model));
}
// pev->scale = 5.0;
m_flStartTime = (int)gpGlobals->time;
}
/* <ccd07> ../cstrike/dlls/h_cycler.cpp:468 */
void CWreckage::__MAKE_VHOOK(Precache)(void)
{
// Precache(CWreckage *const this); // 468
if (!FStringNull(pev->model))
{
PRECACHE_MODEL((char *)STRING(pev->model));
}
}
/* <ccb26> ../cstrike/dlls/h_cycler.cpp:474 */
void CWreckage::__MAKE_VHOOK(Think)(void)
{
// {
// Vector VecSrc; // 492
// MESSAGE_BEGIN(int msg_dest,
// int msg_type,
// const float *pOrigin,
// edict_t *ed); // 498
// }
StudioFrameAdvance();
pev->nextthink = gpGlobals->time + 0.2;
if (pev->dmgtime)
{
if (pev->dmgtime < gpGlobals->time)
{
UTIL_Remove(this);
return;
}
else if (RANDOM_FLOAT(0, pev->dmgtime - m_flStartTime) > pev->dmgtime - gpGlobals->time)
{
return;
}
}
Vector VecSrc;
VecSrc.x = RANDOM_FLOAT(pev->absmin.x, pev->absmax.x);
VecSrc.y = RANDOM_FLOAT(pev->absmin.y, pev->absmax.y);
VecSrc.z = RANDOM_FLOAT(pev->absmin.z, pev->absmax.z);
MESSAGE_BEGIN(MSG_PVS, SVC_TEMPENTITY, VecSrc);
WRITE_BYTE(TE_SMOKE);
WRITE_COORD(VecSrc.x);
WRITE_COORD(VecSrc.y);
WRITE_COORD(VecSrc.z);
WRITE_SHORT(g_sModelIndexSmoke);
WRITE_BYTE(RANDOM_LONG(0, 49) + 50); // scale * 10
WRITE_BYTE(RANDOM_LONG(0, 3) + 8); // framerate
MESSAGE_END();
}
#ifdef HOOK_GAMEDLL

View File

@ -31,39 +31,122 @@
#ifdef _WIN32
#pragma once
#endif
class CCyclerSprite: public CBaseEntity
/* <cb93c> ../cstrike/dlls/h_cycler.cpp:35 */
class CCycler: public CBaseMonster
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Restart(void);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
virtual void Spawn(void);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return ((CBaseEntity::ObjectCaps()|FCAP_DONT_SAVE|FCAP_IMPULSE_USE));
return ObjectCaps_();
}
NOBODY virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
NOBODY virtual void Think(void);
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
// Don't treat as a live target
virtual BOOL IsAlive(void)
{
return FALSE;
}
virtual void Think(void);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
NOBODY void Spawn_(void);
NOBODY void Restart_(void);
NOBODY int Save_(CSave &save);
NOBODY int Restore_(CRestore &restore);
NOBODY int TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
NOBODY void Think_(void);
NOBODY void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void Spawn_(void);
int Save_(CSave &save);
int Restore_(CRestore &restore);
int ObjectCaps_(void)
{
return (CBaseEntity::ObjectCaps() | FCAP_IMPULSE_USE);
}
int TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
void Think_(void);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif // HOOK_GAMEDLL
public:
NOBODY void Animate(float frames);
void GenericCyclerSpawn(char *szModel, Vector vecMin, Vector vecMax);
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1];
int m_animate;
};/* size: 408, cachelines: 7, members: 3 */
// we should get rid of all the other cyclers and replace them with this.
/* <cb9b2> ../cstrike/dlls/h_cycler.cpp:67 */
class CGenericCycler: public CCycler
{
public:
virtual void Spawn(void);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
#endif // HOOK_GAMEDLL
};/* size: 408, cachelines: 7, members: 1 */
// Probe droid imported for tech demo compatibility
/* <cba04> ../cstrike/dlls/h_cycler.cpp:80 */
class CCyclerProbe: public CCycler
{
public:
virtual void Spawn(void);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
#endif // HOOK_GAMEDLL
};/* size: 408, cachelines: 7, members: 1 */
/* <cba56> ../cstrike/dlls/h_cycler.cpp:218 */
class CCyclerSprite: public CBaseEntity
{
public:
virtual void Spawn(void);
virtual void Restart(void);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
virtual void Think(void);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Restart_(void);
int Save_(CSave &save);
int Restore_(CRestore &restore);
int ObjectCaps_(void)
{
return (CBaseEntity::ObjectCaps() | FCAP_DONT_SAVE | FCAP_IMPULSE_USE);
}
int TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
void Think_(void);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif // HOOK_GAMEDLL
public:
void Animate(float frames);
inline int ShouldAnimate(void)
{
return m_animate && m_maxFrame > 1.0;
return (m_animate && m_maxFrame > 1.0);
}
public:
@ -79,97 +162,32 @@ public:
};/* size: 188, cachelines: 3, members: 9 */
class CCycler: public CBaseMonster
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return ((CBaseEntity::ObjectCaps()|FCAP_IMPULSE_USE));
}
NOBODY virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
virtual BOOL IsAlive(void)
{
return FALSE;
}
NOBODY virtual void Think(void);
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
NOBODY void Spawn_(void);
NOBODY int Save_(CSave &save);
NOBODY int Restore_(CRestore &restore);
NOBODY int TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
NOBODY void Think_(void);
NOBODY void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif // HOOK_GAMEDLL
public:
void GenericCyclerSpawn(char *szModel, Vector vecMin, Vector vecMax);
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1];
int m_animate;
};/* size: 408, cachelines: 7, members: 3 */
class CGenericCycler: public CCycler
{
public:
NOBODY virtual void Spawn(void);
#ifdef HOOK_GAMEDLL
NOBODY void Spawn_(void);
#endif // HOOK_GAMEDLL
};/* size: 408, cachelines: 7, members: 1 */
class CCyclerProbe: public CCycler
{
public:
NOBODY virtual void Spawn(void);
#ifdef HOOK_GAMEDLL
NOBODY void Spawn_(void);
#endif // HOOK_GAMEDLL
};/* size: 408, cachelines: 7, members: 1 */
//#include "weapons.h"
/* <cbbc0> ../cstrike/dlls/h_cycler.cpp:344 */
class CWeaponCycler: public CBasePlayerWeapon
{
public:
NOBODY virtual void Spawn(void);
virtual void Spawn(void);
virtual int GetItemInfo(ItemInfo *p)
{
return 0;
}
NOBODY virtual BOOL Deploy(void);
NOBODY virtual void Holster(int skiplocal = 0);
virtual BOOL Deploy(void);
virtual void Holster(int skiplocal = 0);
virtual int iItemSlot(void)
{
return 1;
}
NOBODY virtual void PrimaryAttack(void);
NOBODY virtual void SecondaryAttack(void);
virtual void PrimaryAttack(void);
virtual void SecondaryAttack(void);
#ifdef HOOK_GAMEDLL
NOBODY void Spawn_(void);
NOBODY BOOL Deploy_(void);
NOBODY void Holster_(int skiplocal = 0);
NOBODY void PrimaryAttack_(void);
NOBODY void SecondaryAttack_(void);
void Spawn_(void);
BOOL Deploy_(void);
void Holster_(int skiplocal = 0);
void PrimaryAttack_(void);
void SecondaryAttack_(void);
#endif // HOOK_GAMEDLL
@ -178,22 +196,26 @@ public:
int m_iModel;
};/* size: 344, cachelines: 6, members: 3 */
// Flaming Wreakage
/* <cbc13> ../cstrike/dlls/h_cycler.cpp:427 */
class CWreckage: public CBaseMonster
{
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY virtual void Think(void);
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual void Think(void);
#ifdef HOOK_GAMEDLL
NOBODY void Spawn_(void);
NOBODY void Precache_(void);
NOBODY int Save_(CSave &save);
NOBODY int Restore_(CRestore &restore);
NOBODY void Think_(void);
void Spawn_(void);
void Precache_(void);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Think_(void);
#endif // HOOK_GAMEDLL
@ -204,4 +226,11 @@ public:
};/* size: 408, cachelines: 7, members: 3 */
// linked objects
C_DLLEXPORT void cycler(entvars_t *pev);
C_DLLEXPORT void cycler_prdroid(entvars_t *pev);
C_DLLEXPORT void cycler_sprite(entvars_t *pev);
C_DLLEXPORT void cycler_weapon(entvars_t *pev);
C_DLLEXPORT void cycler_wreckage(entvars_t *pev);
#endif // H_CYCLER_H

View File

@ -9,7 +9,8 @@ C_DLLEXPORT void WINAPI GiveFnptrsToDll(enginefuncs_t *pEnginefuncsTable,globalv
Q_memcpy(&g_engfuncs, pEnginefuncsTable, sizeof(enginefuncs_t));
gpGlobals = pGlobals;
#if defined(_WIN32) && !defined(REGAMEDLL_UNIT_TESTS)
#if defined(HOOK_GAMEDLL) && !defined(REGAMEDLL_UNIT_TESTS)
Regamedll_Game_Init();
#endif // _WIN32 && REGAMEDLL_UNIT_TESTS
#endif // HOOK_GAMEDLL
}

View File

@ -16,60 +16,60 @@ TYPEDESCRIPTION CWallHealth::m_SaveData[] =
#else
TYPEDESCRIPTION (*CWallHealth::pm_SaveData)[5];
TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CWallHealth, m_SaveData)[5];
#endif // HOOK_GAMEDLL
/* <d637a> ../cstrike/dlls/healthkit.cpp:43 */
/* <d637a> ../cstrike/dlls/healthkit.cpp:43 */
LINK_ENTITY_TO_CLASS(item_healthkit, CHealthKit);
/* <d5e25> ../cstrike/dlls/healthkit.cpp:55 */
void CHealthKit::__MAKE_VHOOK(Spawn)(void)
{
Precache();
SET_MODEL(ENT(pev), "models/w_medkit.mdl");
CItem::Spawn();
/* <d5e25> ../cstrike/dlls/healthkit.cpp:55 */
void CHealthKit::__MAKE_VHOOK(Spawn)(void)
{
Precache();
SET_MODEL(ENT(pev), "models/w_medkit.mdl");
CItem::Spawn();
}
/* <d5d8a> ../cstrike/dlls/healthkit.cpp:63 */
void CHealthKit::__MAKE_VHOOK(Precache)(void)
{
PRECACHE_MODEL("models/w_medkit.mdl");
PRECACHE_SOUND("items/smallmedkit1.wav");
/* <d5d8a> ../cstrike/dlls/healthkit.cpp:63 */
void CHealthKit::__MAKE_VHOOK(Precache)(void)
{
PRECACHE_MODEL("models/w_medkit.mdl");
PRECACHE_SOUND("items/smallmedkit1.wav");
}
/* <d5fb9> ../cstrike/dlls/healthkit.cpp:69 */
BOOL CHealthKit::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer)
{
if (pPlayer->TakeHealth(gSkillData.healthkitCapacity, DMG_GENERIC))
{
MESSAGE_BEGIN(MSG_ONE, gmsgItemPickup, NULL, pPlayer->pev);
WRITE_STRING( STRING(pev->classname));
MESSAGE_END();
EMIT_SOUND(ENT(pPlayer->pev), CHAN_ITEM, "items/smallmedkit1.wav", VOL_NORM, ATTN_NORM);
if (g_pGameRules->ItemShouldRespawn(this))
Respawn();
else
UTIL_Remove(this);
return TRUE;
}
return FALSE;
/* <d5fb9> ../cstrike/dlls/healthkit.cpp:69 */
BOOL CHealthKit::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer)
{
if (pPlayer->TakeHealth(gSkillData.healthkitCapacity, DMG_GENERIC))
{
MESSAGE_BEGIN(MSG_ONE, gmsgItemPickup, NULL, pPlayer->pev);
WRITE_STRING(STRING(pev->classname));
MESSAGE_END();
EMIT_SOUND(ENT(pPlayer->pev), CHAN_ITEM, "items/smallmedkit1.wav", VOL_NORM, ATTN_NORM);
if (g_pGameRules->ItemShouldRespawn(this))
Respawn();
else
UTIL_Remove(this);
return TRUE;
}
return FALSE;
}
/* <d5e98> ../cstrike/dlls/healthkit.cpp:130 */
/* <d5e98> ../cstrike/dlls/healthkit.cpp:130 */
IMPLEMENT_SAVERESTORE(CWallHealth, CBaseEntity);
/* <d6444> ../cstrike/dlls/healthkit.cpp:132 */
/* <d6444> ../cstrike/dlls/healthkit.cpp:132 */
LINK_ENTITY_TO_CLASS(func_healthcharger, CWallHealth);
/* <d60ed> ../cstrike/dlls/healthkit.cpp:135 */
void CWallHealth::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{
/* <d60ed> ../cstrike/dlls/healthkit.cpp:135 */
void CWallHealth::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{
if (FStrEq(pkvd->szKeyName, "style") || FStrEq(pkvd->szKeyName, "height") || FStrEq(pkvd->szKeyName, "value1") || FStrEq(pkvd->szKeyName, "value2") || FStrEq(pkvd->szKeyName, "value3"))
{
pkvd->fHandled = TRUE;
@ -80,121 +80,121 @@ void CWallHealth::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
pkvd->fHandled = TRUE;
}
else
CBaseToggle::KeyValue(pkvd);
CBaseToggle::KeyValue(pkvd);
}
/* <d5dfe> ../cstrike/dlls/healthkit.cpp:154 */
void CWallHealth::__MAKE_VHOOK(Spawn)(void)
{
Precache();
pev->solid = SOLID_BSP;
pev->movetype = MOVETYPE_PUSH;
// set size and link into world
UTIL_SetOrigin(pev, pev->origin);
UTIL_SetSize(pev, pev->mins, pev->maxs);
SET_MODEL(ENT(pev), STRING(pev->model));
m_iJuice = (int)gSkillData.healthchargerCapacity;
pev->frame = 0.0f;
}
/* <d5dd7> ../cstrike/dlls/healthkit.cpp:169 */
void CWallHealth::__MAKE_VHOOK(Precache)(void)
{
PRECACHE_SOUND("items/medshot4.wav");
PRECACHE_SOUND("items/medshotno1.wav");
PRECACHE_SOUND("items/medcharge4.wav");
/* <d5dfe> ../cstrike/dlls/healthkit.cpp:154 */
void CWallHealth::__MAKE_VHOOK(Spawn)(void)
{
Precache();
pev->solid = SOLID_BSP;
pev->movetype = MOVETYPE_PUSH;
// set size and link into world
UTIL_SetOrigin(pev, pev->origin);
UTIL_SetSize(pev, pev->mins, pev->maxs);
SET_MODEL(ENT(pev), STRING(pev->model));
m_iJuice = (int)gSkillData.healthchargerCapacity;
pev->frame = 0.0f;
}
/* <d622e> ../cstrike/dlls/healthkit.cpp:177 */
void CWallHealth::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
// Make sure that we have a caller
if (!pActivator)
return;
// if it's not a player, ignore
if (!pActivator->IsPlayer())
return;
// if there is no juice left, turn it off
if (m_iJuice <= 0)
{
pev->frame = 1.0f;
Off();
}
// if the player doesn't have the suit, or there is no juice left, make the deny noise
if (m_iJuice <= 0 || !(pActivator->pev->weapons & (1 << WEAPON_SUIT)))
{
if (gpGlobals->time >= m_flSoundTime)
{
m_flSoundTime = gpGlobals->time + 0.62f;
EMIT_SOUND(ENT(pev), CHAN_ITEM, "items/medshotno1.wav", VOL_NORM, ATTN_NORM);
}
return;
}
pev->nextthink = pev->ltime + 0.25f;
SetThink(&CWallHealth::Off);
// Time to recharge yet?
if (m_flNextCharge >= gpGlobals->time)
return;
// Play the on sound or the looping charging sound
if (!m_iOn)
{
m_iOn++;
EMIT_SOUND(ENT(pev), CHAN_ITEM, "items/medshot4.wav", VOL_NORM, ATTN_NORM);
m_flSoundTime = gpGlobals->time + 0.56f;
}
if (m_iOn == 1 && gpGlobals->time >= m_flSoundTime)
{
m_iOn++;
EMIT_SOUND(ENT(pev), CHAN_STATIC, "items/medcharge4.wav", VOL_NORM, ATTN_NORM);
}
// charge the player
if (pActivator->TakeHealth(1, DMG_GENERIC))
m_iJuice--;
// govern the rate of charge
m_flNextCharge = gpGlobals->time + 0.1f;
/* <d5dd7> ../cstrike/dlls/healthkit.cpp:169 */
void CWallHealth::__MAKE_VHOOK(Precache)(void)
{
PRECACHE_SOUND("items/medshot4.wav");
PRECACHE_SOUND("items/medshotno1.wav");
PRECACHE_SOUND("items/medcharge4.wav");
}
/* <d5f4d> ../cstrike/dlls/healthkit.cpp:236 */
void CWallHealth::Recharge(void)
{
EMIT_SOUND(ENT(pev), CHAN_ITEM, "items/medshot4.wav", VOL_NORM, ATTN_NORM);
m_iJuice = gSkillData.healthchargerCapacity;
pev->frame = 0.0f;
SetThink(&CWallHealth::SUB_DoNothing);
/* <d622e> ../cstrike/dlls/healthkit.cpp:177 */
void CWallHealth::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
// Make sure that we have a caller
if (!pActivator)
return;
// if it's not a player, ignore
if (!pActivator->IsPlayer())
return;
// if there is no juice left, turn it off
if (m_iJuice <= 0)
{
pev->frame = 1.0f;
Off();
}
// if the player doesn't have the suit, or there is no juice left, make the deny noise
if (m_iJuice <= 0 || !(pActivator->pev->weapons & (1 << WEAPON_SUIT)))
{
if (gpGlobals->time >= m_flSoundTime)
{
m_flSoundTime = gpGlobals->time + 0.62f;
EMIT_SOUND(ENT(pev), CHAN_ITEM, "items/medshotno1.wav", VOL_NORM, ATTN_NORM);
}
return;
}
pev->nextthink = pev->ltime + 0.25f;
SetThink(&CWallHealth::Off);
// Time to recharge yet?
if (m_flNextCharge >= gpGlobals->time)
return;
// Play the on sound or the looping charging sound
if (!m_iOn)
{
m_iOn++;
EMIT_SOUND(ENT(pev), CHAN_ITEM, "items/medshot4.wav", VOL_NORM, ATTN_NORM);
m_flSoundTime = gpGlobals->time + 0.56f;
}
if (m_iOn == 1 && gpGlobals->time >= m_flSoundTime)
{
m_iOn++;
EMIT_SOUND(ENT(pev), CHAN_STATIC, "items/medcharge4.wav", VOL_NORM, ATTN_NORM);
}
// charge the player
if (pActivator->TakeHealth(1, DMG_GENERIC))
m_iJuice--;
// govern the rate of charge
m_flNextCharge = gpGlobals->time + 0.1f;
}
/* <d5ee4> ../cstrike/dlls/healthkit.cpp:244 */
void CWallHealth::Off(void)
{
// Stop looping sound.
if (m_iOn > 1)
STOP_SOUND(ENT(pev), CHAN_STATIC, "items/medcharge4.wav");
m_iOn = 0;
if (!m_iJuice && ((m_iReactivate = g_pGameRules->FlHealthChargerRechargeTime()) > 0))
{
pev->nextthink = pev->ltime + m_iReactivate;
SetThink(&CWallHealth::Recharge);
}
else
SetThink(&CWallHealth::SUB_DoNothing);
/* <d5f4d> ../cstrike/dlls/healthkit.cpp:236 */
void CWallHealth::Recharge(void)
{
EMIT_SOUND(ENT(pev), CHAN_ITEM, "items/medshot4.wav", VOL_NORM, ATTN_NORM);
m_iJuice = gSkillData.healthchargerCapacity;
pev->frame = 0.0f;
SetThink(&CWallHealth::SUB_DoNothing);
}
#ifdef HOOK_GAMEDLL
/* <d5ee4> ../cstrike/dlls/healthkit.cpp:244 */
void CWallHealth::Off(void)
{
// Stop looping sound.
if (m_iOn > 1)
STOP_SOUND(ENT(pev), CHAN_STATIC, "items/medcharge4.wav");
m_iOn = 0;
if (!m_iJuice && ((m_iReactivate = g_pGameRules->FlHealthChargerRechargeTime()) > 0))
{
pev->nextthink = pev->ltime + m_iReactivate;
SetThink(&CWallHealth::Recharge);
}
else
SetThink(&CWallHealth::SUB_DoNothing);
}
#ifdef HOOK_GAMEDLL
void CHealthKit::Spawn(void)
{
@ -240,5 +240,5 @@ void CWallHealth::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE us
{
Use_(pActivator, pCaller, useType, value);
}
#endif // HOOK_GAMEDLL
#endif // HOOK_GAMEDLL

View File

@ -63,7 +63,7 @@ public:
{
return ObjectCaps_();
}
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
@ -95,9 +95,4 @@ public:
};/* size: 332, cachelines: 6, members: 7 */
#endif // HEALTKIT_H

File diff suppressed because it is too large Load Diff

View File

@ -31,7 +31,7 @@
#ifdef _WIN32
#pragma once
#endif
#include "hostage/hostage_improv.h"
#define MAX_NODES 100
@ -50,30 +50,30 @@ class CLocalNav;
class CHostageImprov;
class CHostageManager;
enum HostageChatterType
{
HOSTAGE_CHATTER_START_FOLLOW = 0,
HOSTAGE_CHATTER_STOP_FOLLOW,
HOSTAGE_CHATTER_INTIMIDATED,
HOSTAGE_CHATTER_PAIN,
HOSTAGE_CHATTER_SCARED_OF_GUNFIRE,
HOSTAGE_CHATTER_SCARED_OF_MURDER,
HOSTAGE_CHATTER_LOOK_OUT,
HOSTAGE_CHATTER_PLEASE_RESCUE_ME,
HOSTAGE_CHATTER_SEE_RESCUE_ZONE,
HOSTAGE_CHATTER_IMPATIENT_FOR_RESCUE,
HOSTAGE_CHATTER_CTS_WIN ,
HOSTAGE_CHATTER_TERRORISTS_WIN,
HOSTAGE_CHATTER_RESCUED,
HOSTAGE_CHATTER_WARN_NEARBY,
HOSTAGE_CHATTER_WARN_SPOTTED,
HOSTAGE_CHATTER_CALL_TO_RESCUER,
HOSTAGE_CHATTER_RETREAT,
HOSTAGE_CHATTER_COUGH,
HOSTAGE_CHATTER_BLINDED,
HOSTAGE_CHATTER_SAW_HE_GRENADE,
HOSTAGE_CHATTER_DEATH_CRY,
NUM_HOSTAGE_CHATTER_TYPES,
enum HostageChatterType
{
HOSTAGE_CHATTER_START_FOLLOW = 0,
HOSTAGE_CHATTER_STOP_FOLLOW,
HOSTAGE_CHATTER_INTIMIDATED,
HOSTAGE_CHATTER_PAIN,
HOSTAGE_CHATTER_SCARED_OF_GUNFIRE,
HOSTAGE_CHATTER_SCARED_OF_MURDER,
HOSTAGE_CHATTER_LOOK_OUT,
HOSTAGE_CHATTER_PLEASE_RESCUE_ME,
HOSTAGE_CHATTER_SEE_RESCUE_ZONE,
HOSTAGE_CHATTER_IMPATIENT_FOR_RESCUE,
HOSTAGE_CHATTER_CTS_WIN ,
HOSTAGE_CHATTER_TERRORISTS_WIN,
HOSTAGE_CHATTER_RESCUED,
HOSTAGE_CHATTER_WARN_NEARBY,
HOSTAGE_CHATTER_WARN_SPOTTED,
HOSTAGE_CHATTER_CALL_TO_RESCUER,
HOSTAGE_CHATTER_RETREAT,
HOSTAGE_CHATTER_COUGH,
HOSTAGE_CHATTER_BLINDED,
HOSTAGE_CHATTER_SAW_HE_GRENADE,
HOSTAGE_CHATTER_DEATH_CRY,
NUM_HOSTAGE_CHATTER_TYPES,
};
#ifdef HOOK_GAMEDLL
@ -96,137 +96,137 @@ extern cvar_t cv_hostage_stop;
class CHostage: public CBaseMonster
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual int ObjectCaps(void);
virtual int Classify(void)
{
return CLASS_HUMAN_PASSIVE;
}
NOBODY virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
virtual int BloodColor(void)
{
return BLOOD_COLOR_RED;
}
NOBODY virtual void Touch(CBaseEntity *pOther);
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual int ObjectCaps(void);
virtual int Classify(void)
{
return CLASS_HUMAN_PASSIVE;
}
NOBODY virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
virtual int BloodColor(void)
{
return BLOOD_COLOR_RED;
}
NOBODY virtual void Touch(CBaseEntity *pOther);
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
public:
NOBODY void EXPORT IdleThink(void);
NOBODY void Remove(void);
void RePosition(void);
void SetActivity(int act);
NOBODY int GetActivity(void);
NOBODY float GetModifiedDamage(float flDamage, int nHitGroup);
NOBODY void SetFlinchActivity(void);
NOBODY void SetDeathActivity(void);
NOBODY void PlayPainSound(void);
NOBODY void PlayFollowRescueSound(void);
NOBODY void AnnounceDeath(CBasePlayer *pAttacker);
NOBODY void ApplyHostagePenalty(CBasePlayer *pAttacker);
NOBODY void GiveCTTouchBonus(CBasePlayer *pPlayer);
NOBODY void SendHostagePositionMsg(void);
NOBODY void SendHostageEventMsg(void);
NOBODY void DoFollow(void);
NOBODY BOOL IsOnLadder(void);
NOBODY void PointAt(const Vector &vecLoc);
NOBODY void MoveToward(const Vector &vecLoc);
void NavReady(void);
NOBODY void Wiggle(void);
void PreThink(void);
NOBODY bool IsFollowingSomeone(void)
{
UNTESTED
return m_improv->IsFollowing(NULL);
}
NOBODY CBaseEntity *GetLeader(void)
{
UNTESTED
if (m_improv != NULL)
{
return m_improv->GetFollowLeader();
}
return NULL;
}
NOBODY bool IsFollowing(const CBaseEntity *entity)
{
return (entity == m_hTargetEnt && m_State == FOLLOW);
}
NOBODY bool IsValid(void)
{
UNTESTED
return (pev->takedamage == DAMAGE_YES);
}
NOBODY bool IsDead(void)
{
UNTESTED
return (pev->deadflag == DEAD_DEAD);
}
NOBODY bool IsAtHome(void);//
NOBODY void EXPORT IdleThink(void);
NOBODY void Remove(void);
void RePosition(void);
void SetActivity(int act);
NOBODY int GetActivity(void);
NOBODY float GetModifiedDamage(float flDamage, int nHitGroup);
NOBODY void SetFlinchActivity(void);
NOBODY void SetDeathActivity(void);
NOBODY void PlayPainSound(void);
NOBODY void PlayFollowRescueSound(void);
NOBODY void AnnounceDeath(CBasePlayer *pAttacker);
NOBODY void ApplyHostagePenalty(CBasePlayer *pAttacker);
NOBODY void GiveCTTouchBonus(CBasePlayer *pPlayer);
NOBODY void SendHostagePositionMsg(void);
NOBODY void SendHostageEventMsg(void);
NOBODY void DoFollow(void);
NOBODY BOOL IsOnLadder(void);
NOBODY void PointAt(const Vector &vecLoc);
NOBODY void MoveToward(const Vector &vecLoc);
void NavReady(void);
NOBODY void Wiggle(void);
void PreThink(void);
NOBODY bool IsFollowingSomeone(void)
{
UNTESTED
return m_improv->IsFollowing(NULL);
}
NOBODY CBaseEntity *GetLeader(void)
{
UNTESTED
if (m_improv != NULL)
{
return m_improv->GetFollowLeader();
}
return NULL;
}
NOBODY bool IsFollowing(const CBaseEntity *entity)
{
return (entity == m_hTargetEnt && m_State == FOLLOW);
}
NOBODY bool IsValid(void)
{
UNTESTED
return (pev->takedamage == DAMAGE_YES);
}
NOBODY bool IsDead(void)
{
UNTESTED
return (pev->deadflag == DEAD_DEAD);
}
NOBODY bool IsAtHome(void);//
NOBODY const Vector *GetHomePosition(void);//
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
int ObjectCaps_(void);
int TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
void Touch_(CBaseEntity *pOther);
void Spawn_(void);
void Precache_(void);
int ObjectCaps_(void);
int TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
void Touch_(CBaseEntity *pOther);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif // HOOK_GAMEDLL
public:
enum state
{
FOLLOW = 0,
STAND,
DUCK,
SCARED,
IDLE,
FOLLOWPATH,
enum state
{
FOLLOW = 0,
STAND,
DUCK,
SCARED,
IDLE,
FOLLOWPATH,
};
enum ModelType
{
REGULAR_GUY = 0,
OLD_GUY,
BLACK_GUY,
GOOFY_GUY,
enum ModelType
{
REGULAR_GUY = 0,
OLD_GUY,
BLACK_GUY,
GOOFY_GUY,
};
int m_Activity;
BOOL m_bTouched;
BOOL m_bRescueMe;
float m_flFlinchTime;
float m_flNextChange;
float m_flMarkPosition;
int m_iModel;
int m_iSkin;
float m_flNextRadarTime;
state m_State;
Vector m_vStart;
Vector m_vStartAngles;
Vector m_vPathToFollow[20];
int m_iWaypoint;
CBasePlayer *m_target;
CLocalNav *m_LocalNav;
int nTargetNode;
Vector vecNodes[ MAX_NODES ];
EHANDLE m_hStoppedTargetEnt;
float m_flNextFullThink;
float m_flPathCheckInterval;
float m_flLastPathCheck;
int m_nPathNodes;
BOOL m_fHasPath;
float m_flPathAcquired;
Vector m_vOldPos;
int m_iHostageIndex;
BOOL m_bStuck;
float m_flStuckTime;
CHostageImprov *m_improv;
int m_Activity;
BOOL m_bTouched;
BOOL m_bRescueMe;
float m_flFlinchTime;
float m_flNextChange;
float m_flMarkPosition;
int m_iModel;
int m_iSkin;
float m_flNextRadarTime;
state m_State;
Vector m_vStart;
Vector m_vStartAngles;
Vector m_vPathToFollow[20];
int m_iWaypoint;
CBasePlayer *m_target;
CLocalNav *m_LocalNav;
int nTargetNode;
Vector vecNodes[ MAX_NODES ];
EHANDLE m_hStoppedTargetEnt;
float m_flNextFullThink;
float m_flPathCheckInterval;
float m_flLastPathCheck;
int m_nPathNodes;
BOOL m_fHasPath;
float m_flPathAcquired;
Vector m_vOldPos;
int m_iHostageIndex;
BOOL m_bStuck;
float m_flStuckTime;
CHostageImprov *m_improv;
ModelType m_whichModel;
};/* size: 1988, cachelines: 32, members: 32 */
@ -247,9 +247,9 @@ public:
struct ChatterSet
{
struct SoundFile file[32];
int count;
int index;
struct SoundFile file[32];
int count;
int index;
bool needsShuffle;
};/* size: 268, cachelines: 5, members: 4 */
@ -270,102 +270,102 @@ private:
};/* size: 5628, cachelines: 88, members: 1 */
/* <45b018> ../cstrike/dlls/hostage/hostage.h:247 */
class CHostageManager
{
public:
CHostageManager(void);
void ServerActivate(void);
void ServerDeactivate(void);
void RestartRound(void);
void AddHostage(CHostage *hostage);
SimpleChatter *GetChatter(void)
{
return &m_chatter;
}
NOBODY bool IsNearbyHostageTalking(CHostageImprov *improv);
NOBODY bool IsNearbyHostageJumping(CHostageImprov *improv);
NOBODY void OnEvent(GameEventType event, CBaseEntity *entity, CBaseEntity *other);
UNTESTED inline CHostage *GetClosestHostage(const Vector &pos, float *resultRange = NULL)
{
float closeRange = 100000000.0f;
CHostage *close = NULL;
for (int i = 0; i < m_hostageCount; i++)
{
float range = (m_hostage[ i ]->pev->origin - pos).Length();
if (range < closeRange)
{
closeRange = range;
close = m_hostage[ i ];
}
}
if (resultRange)
*resultRange = closeRange;
return close;
}
template<
typename T
>
bool ForEachHostage(T &func)
{
UNTESTED
for (int i = 0; i < m_hostageCount; i++)
{
CHostage *pHostage = m_hostage[ i ];
if (pHostage->deadflag != DEAD_NO || pHostage->takedamage != DAMAGE_YES)
continue;
if (!pHostage->m_improv)
break;
if (func(pHostage))
return true;
}
return false;
}
class CHostageManager
{
public:
CHostageManager(void);
void ServerActivate(void);
void ServerDeactivate(void);
void RestartRound(void);
void AddHostage(CHostage *hostage);
SimpleChatter *GetChatter(void)
{
return &m_chatter;
}
NOBODY bool IsNearbyHostageTalking(CHostageImprov *improv);
NOBODY bool IsNearbyHostageJumping(CHostageImprov *improv);
NOBODY void OnEvent(GameEventType event, CBaseEntity *entity, CBaseEntity *other);
UNTESTED inline CHostage *GetClosestHostage(const Vector &pos, float *resultRange = NULL)
{
float closeRange = 100000000.0f;
CHostage *close = NULL;
for (int i = 0; i < m_hostageCount; i++)
{
float range = (m_hostage[ i ]->pev->origin - pos).Length();
if (range < closeRange)
{
closeRange = range;
close = m_hostage[ i ];
}
}
if (resultRange)
*resultRange = closeRange;
return close;
}
template<
typename T
>
bool ForEachHostage(T &func)
{
UNTESTED
for (int i = 0; i < m_hostageCount; i++)
{
CHostage *pHostage = m_hostage[ i ];
if (pHostage->deadflag != DEAD_NO || pHostage->takedamage != DAMAGE_YES)
continue;
if (!pHostage->m_improv)
break;
if (func(pHostage))
return true;
}
return false;
}
private:
CHostage *m_hostage[ MAX_HOSTAGES ];
int m_hostageCount;
CHostage *m_hostage[ MAX_HOSTAGES ];
int m_hostageCount;
SimpleChatter m_chatter;
};/* size: 5680, cachelines: 89, members: 3 */
///* <470134> ../cstrike/dlls/hostage/hostage.h:293 */
//inline void CHostageManager::ForEachHostage<KeepPersonalSpace>(KeepPersonalSpace &func)
//{
//// {
//// int i; // 295
//// }
///* <470134> ../cstrike/dlls/hostage/hostage.h:293 */
//inline void CHostageManager::ForEachHostage<KeepPersonalSpace>(KeepPersonalSpace &func)
//{
//// {
//// int i; // 295
//// }
//}
//
///* <46fbe8> ../cstrike/dlls/hostage/hostage.h:293 */
//inline void CHostageManager::ForEachHostage<CheckAhead>(CheckAhead &func)
//{
//// {
//// int i; // 295
//// }
///* <46fbe8> ../cstrike/dlls/hostage/hostage.h:293 */
//inline void CHostageManager::ForEachHostage<CheckAhead>(CheckAhead &func)
//{
//// {
//// int i; // 295
//// }
//}
//
///* <46fb04> ../cstrike/dlls/hostage/hostage.h:293 */
//inline void CHostageManager::ForEachHostage<CheckWayFunctor>(CheckWayFunctor &func)
//{
//// {
//// int i; // 295
//// }
///* <46fb04> ../cstrike/dlls/hostage/hostage.h:293 */
//inline void CHostageManager::ForEachHostage<CheckWayFunctor>(CheckWayFunctor &func)
//{
//// {
//// int i; // 295
//// }
//}
void Hostage_RegisterCVars(void);
NOBODY void InstallHostageManager(void);
void Hostage_RegisterCVars(void);
NOBODY void InstallHostageManager(void);
// refs
extern void (*pCHostage__IdleThink)(void);

View File

@ -428,7 +428,7 @@ void CHostageImprov::__MAKE_VHOOK(OnReset)(void)
m_moveFlags = 0;
m_moveType = Stopped;
m_moveLimit = Running;
m_vel.x = 0;
m_vel.y = 0;
@ -1156,179 +1156,179 @@ NOBODY void CHostageImprov::UpdateStationaryAnimation(void)
#ifdef HOOK_GAMEDLL
void CHostageImprov::OnMoveToFailure(const Vector &goal, MoveToFailureType reason)
{
OnMoveToFailure_(goal, reason);
}
bool CHostageImprov::IsAlive(void) const
{
return IsAlive_();
}
void CHostageImprov::MoveTo(const Vector &goal)
{
MoveTo_(goal);
}
void CHostageImprov::LookAt(const Vector &target)
{
LookAt_(target);
}
void CHostageImprov::ClearLookAt(void)
{
ClearLookAt_();
}
void CHostageImprov::FaceTo(const Vector &goal)
{
FaceTo_(goal);
}
void CHostageImprov::ClearFaceTo(void)
{
ClearFaceTo_();
}
bool CHostageImprov::IsAtMoveGoal(float error) const
{
return IsAtMoveGoal_(error);
}
bool CHostageImprov::IsAtFaceGoal(void) const
{
return IsAtFaceGoal_();
}
bool CHostageImprov::IsFriendInTheWay(const Vector &goalPos) const
{
return IsFriendInTheWay_(goalPos);
}
bool CHostageImprov::IsFriendInTheWay(CBaseEntity *myFriend, const Vector &goalPos) const
{
return IsFriendInTheWay_(myFriend, goalPos);
}
bool CHostageImprov::Jump(void)
{
return Jump_();
}
void CHostageImprov::Crouch(void)
{
Crouch_();
}
void CHostageImprov::StandUp(void)
{
StandUp_();
}
void CHostageImprov::TrackPath(const Vector &pathGoal, float deltaT)
{
TrackPath_(pathGoal, deltaT);
}
void CHostageImprov::StartLadder(const CNavLadder *ladder, NavTraverseType how, const Vector *approachPos, const Vector *departPos)
{
StartLadder_(ladder, how, approachPos, departPos);
}
bool CHostageImprov::TraverseLadder(const CNavLadder *ladder, NavTraverseType how, const Vector *approachPos, const Vector *departPos, float deltaT)
{
return TraverseLadder_(ladder, how, approachPos, departPos, deltaT);
}
bool CHostageImprov::GetSimpleGroundHeightWithFloor(const Vector *pos, float *height, Vector *normal)
{
return GetSimpleGroundHeightWithFloor_(pos, height, normal);
}
void CHostageImprov::Run(void)
{
Run_();
}
void CHostageImprov::Walk(void)
{
Walk_();
}
void CHostageImprov::Stop(void)
{
Stop_();
}
const Vector &CHostageImprov::GetFeet(void) const
{
return GetFeet_();
}
const Vector &CHostageImprov::GetCentroid(void)
{
return GetCentroid_();
}
const Vector &CHostageImprov::GetEyes(void) const
{
return GetEyes_();
}
bool CHostageImprov::IsOnGround(void) const
{
return IsOnGround_();
}
bool CHostageImprov::IsMoving(void) const
{
return IsMoving_();
}
bool CHostageImprov::IsVisible(const Vector &pos, bool testFOV) const
{
return IsVisible_(pos, testFOV);
}
bool CHostageImprov::IsPlayerLookingAtMe(CBasePlayer *other, float cosTolerance) const
{
return IsPlayerLookingAtMe_(other, cosTolerance);
}
CBasePlayer *CHostageImprov::IsAnyPlayerLookingAtMe(int team, float cosTolerance) const
{
return IsAnyPlayerLookingAtMe_(team, cosTolerance);
}
CBasePlayer *CHostageImprov::GetClosestPlayerByTravelDistance(int team, float *range) const
{
return GetClosestPlayerByTravelDistance_(team, range);
}
void CHostageImprov::OnUpdate(float deltaT)
{
OnUpdate_(deltaT);
}
void CHostageImprov::OnUpkeep(float deltaT)
{
OnUpkeep_(deltaT);
}
void CHostageImprov::OnReset(void)
{
OnReset_();
}
void CHostageImprov::OnGameEvent(GameEventType event, CBaseEntity *entity, CBaseEntity *other)
{
OnGameEvent_(event, entity, other);
}
void CHostageImprov::OnTouch(CBaseEntity *other)
{
OnTouch_(other);
void CHostageImprov::OnMoveToFailure(const Vector &goal, MoveToFailureType reason)
{
OnMoveToFailure_(goal, reason);
}
bool CHostageImprov::IsAlive(void) const
{
return IsAlive_();
}
void CHostageImprov::MoveTo(const Vector &goal)
{
MoveTo_(goal);
}
void CHostageImprov::LookAt(const Vector &target)
{
LookAt_(target);
}
void CHostageImprov::ClearLookAt(void)
{
ClearLookAt_();
}
void CHostageImprov::FaceTo(const Vector &goal)
{
FaceTo_(goal);
}
void CHostageImprov::ClearFaceTo(void)
{
ClearFaceTo_();
}
bool CHostageImprov::IsAtMoveGoal(float error) const
{
return IsAtMoveGoal_(error);
}
bool CHostageImprov::IsAtFaceGoal(void) const
{
return IsAtFaceGoal_();
}
bool CHostageImprov::IsFriendInTheWay(const Vector &goalPos) const
{
return IsFriendInTheWay_(goalPos);
}
bool CHostageImprov::IsFriendInTheWay(CBaseEntity *myFriend, const Vector &goalPos) const
{
return IsFriendInTheWay_(myFriend, goalPos);
}
bool CHostageImprov::Jump(void)
{
return Jump_();
}
void CHostageImprov::Crouch(void)
{
Crouch_();
}
void CHostageImprov::StandUp(void)
{
StandUp_();
}
void CHostageImprov::TrackPath(const Vector &pathGoal, float deltaT)
{
TrackPath_(pathGoal, deltaT);
}
void CHostageImprov::StartLadder(const CNavLadder *ladder, NavTraverseType how, const Vector *approachPos, const Vector *departPos)
{
StartLadder_(ladder, how, approachPos, departPos);
}
bool CHostageImprov::TraverseLadder(const CNavLadder *ladder, NavTraverseType how, const Vector *approachPos, const Vector *departPos, float deltaT)
{
return TraverseLadder_(ladder, how, approachPos, departPos, deltaT);
}
bool CHostageImprov::GetSimpleGroundHeightWithFloor(const Vector *pos, float *height, Vector *normal)
{
return GetSimpleGroundHeightWithFloor_(pos, height, normal);
}
void CHostageImprov::Run(void)
{
Run_();
}
void CHostageImprov::Walk(void)
{
Walk_();
}
void CHostageImprov::Stop(void)
{
Stop_();
}
const Vector &CHostageImprov::GetFeet(void) const
{
return GetFeet_();
}
const Vector &CHostageImprov::GetCentroid(void)
{
return GetCentroid_();
}
const Vector &CHostageImprov::GetEyes(void) const
{
return GetEyes_();
}
bool CHostageImprov::IsOnGround(void) const
{
return IsOnGround_();
}
bool CHostageImprov::IsMoving(void) const
{
return IsMoving_();
}
bool CHostageImprov::IsVisible(const Vector &pos, bool testFOV) const
{
return IsVisible_(pos, testFOV);
}
bool CHostageImprov::IsPlayerLookingAtMe(CBasePlayer *other, float cosTolerance) const
{
return IsPlayerLookingAtMe_(other, cosTolerance);
}
CBasePlayer *CHostageImprov::IsAnyPlayerLookingAtMe(int team, float cosTolerance) const
{
return IsAnyPlayerLookingAtMe_(team, cosTolerance);
}
CBasePlayer *CHostageImprov::GetClosestPlayerByTravelDistance(int team, float *range) const
{
return GetClosestPlayerByTravelDistance_(team, range);
}
void CHostageImprov::OnUpdate(float deltaT)
{
OnUpdate_(deltaT);
}
void CHostageImprov::OnUpkeep(float deltaT)
{
OnUpkeep_(deltaT);
}
void CHostageImprov::OnReset(void)
{
OnReset_();
}
void CHostageImprov::OnGameEvent(GameEventType event, CBaseEntity *entity, CBaseEntity *other)
{
OnGameEvent_(event, entity, other);
}
void CHostageImprov::OnTouch(CBaseEntity *other)
{
OnTouch_(other);
}
#endif // HOOK_GAMEDLL

View File

@ -221,7 +221,7 @@ node_index_t CLocalNav::GetBestNode(Vector &vecOrigin, Vector &vecDest)
float flDistToDest;
float_precision flZDiff = -1.0;
flDistFromStart = LenghtSubtract
flDistFromStart = LengthSubtract
<float_precision, float_precision,
float_precision, float_precision>(vecDest, nodeCurrent->vecLoc);

View File

@ -38,9 +38,9 @@ class CHostageImprov;
class HostageState: public SimpleState<CHostageImprov *>, public IImprovEvent
{
public:
virtual ~HostageState(void) { };
virtual ~HostageState(void) {};
virtual void UpdateStationaryAnimation(CHostageImprov *improv) { };
virtual void UpdateStationaryAnimation(CHostageImprov *improv) {};
};/* size: 12, cachelines: 1, members: 2 */
@ -64,7 +64,7 @@ public:
Update();
}
void UpdateStationaryAnimation(CHostageImprov *improv) { };
void UpdateStationaryAnimation(CHostageImprov *improv) {};
};/* size: 16, cachelines: 1, members: 2 */
@ -72,7 +72,7 @@ public:
class HostageIdleState: public HostageState
{
public:
virtual ~HostageIdleState(void) { };
virtual ~HostageIdleState(void) {};
virtual void OnEnter(CHostageImprov *improv);
virtual void OnUpdate(CHostageImprov *improv);
@ -120,7 +120,7 @@ private:
class HostageEscapeToCoverState: public HostageState
{
public:
virtual ~HostageEscapeToCoverState(void) { };
virtual ~HostageEscapeToCoverState(void) {};
virtual void OnEnter(CHostageImprov *improv);
virtual void OnUpdate(CHostageImprov *improv);
@ -143,7 +143,7 @@ private:
class HostageEscapeLookAroundState: public HostageState
{
public:
virtual ~HostageEscapeLookAroundState(void) { };
virtual ~HostageEscapeLookAroundState(void) {};
virtual void OnEnter(CHostageImprov *improv);
virtual void OnUpdate(CHostageImprov *improv);
@ -162,7 +162,7 @@ private:
class HostageEscapeState: public HostageState
{
public:
virtual ~HostageEscapeState(void) { };
virtual ~HostageEscapeState(void) {};
virtual void OnEnter(CHostageImprov *improv);
virtual void OnUpdate(CHostageImprov *improv);
@ -193,7 +193,7 @@ private:
class HostageRetreatState: public HostageState
{
public:
virtual ~HostageRetreatState(void) { };
virtual ~HostageRetreatState(void) {};
virtual void OnEnter(CHostageImprov *improv);
virtual void OnUpdate(CHostageImprov *improv);
@ -209,7 +209,7 @@ public:
class HostageFollowState: public HostageState
{
public:
virtual ~HostageFollowState(void) { };
virtual ~HostageFollowState(void) {};
virtual void OnEnter(CHostageImprov *improv);
virtual void OnUpdate(CHostageImprov *improv);
@ -245,7 +245,7 @@ private:
class HostageAnimateState: public HostageState
{
public:
virtual ~HostageAnimateState(void) { }
virtual ~HostageAnimateState(void) {}
virtual void OnEnter(CHostageImprov *improv);
virtual void OnUpdate(CHostageImprov *improv);
@ -309,9 +309,7 @@ public:
bool IsDoneHolding(void);
private:
enum { MAX_SEQUENCES = 8 };
struct SeqInfo m_sequence[ MAX_SEQUENCES ];
int m_sequenceCount;
int m_currentSequence;

View File

@ -20,7 +20,7 @@ void CWorldItem::__MAKE_VHOOK(Spawn)(void)
{
CBaseEntity *pEntity = NULL;
switch (m_iType)
switch (m_iType)
{
case 41: // ITEM_HEALTHKIT
break;
@ -54,7 +54,7 @@ void CItem::__MAKE_VHOOK(Spawn)(void)
pev->movetype = MOVETYPE_TOSS;
pev->solid = SOLID_TRIGGER;
UTIL_SetOrigin( pev, pev->origin );
UTIL_SetOrigin(pev, pev->origin);
UTIL_SetSize(pev, Vector(-16, -16, 0), Vector(16, 16, 16));
SetTouch(&CItem::ItemTouch);
@ -179,7 +179,7 @@ BOOL CItemBattery::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer)
char szcharge[64];
pPlayer->pev->armorvalue += gSkillData.batteryCapacity;
pPlayer->pev->armorvalue = _min(pPlayer->pev->armorvalue, MAX_NORMAL_BATTERY);
pPlayer->pev->armorvalue = Q_min(pPlayer->pev->armorvalue, MAX_NORMAL_BATTERY);
EMIT_SOUND(pPlayer->edict(), CHAN_ITEM, "items/gunpickup2.wav", VOL_NORM, ATTN_NORM);
@ -194,11 +194,11 @@ BOOL CItemBattery::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer)
if (pct > 0)
pct--;
Q_sprintf(szcharge,"!HEV_%1dP", pct);
pPlayer->SetSuitUpdate(szcharge, FALSE, SUIT_NEXT_IN_30SEC);
return TRUE;
return TRUE;
}
return FALSE;
}

View File

@ -86,9 +86,9 @@ public:
class CItemSuit: public CItem
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual BOOL MyTouch(CBasePlayer *pPlayer);
virtual void Spawn(void);
virtual void Precache(void);
virtual BOOL MyTouch(CBasePlayer *pPlayer);
#ifdef HOOK_GAMEDLL
@ -104,9 +104,9 @@ public:
class CItemBattery: public CItem
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual BOOL MyTouch(CBasePlayer *pPlayer);
virtual void Spawn(void);
virtual void Precache(void);
virtual BOOL MyTouch(CBasePlayer *pPlayer);
#ifdef HOOK_GAMEDLL
@ -122,9 +122,9 @@ public:
class CItemAntidote: public CItem
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual BOOL MyTouch(CBasePlayer *pPlayer);
virtual void Spawn(void);
virtual void Precache(void);
virtual BOOL MyTouch(CBasePlayer *pPlayer);
#ifdef HOOK_GAMEDLL
@ -140,9 +140,9 @@ public:
class CItemSecurity: public CItem
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual BOOL MyTouch(CBasePlayer *pPlayer);
virtual void Spawn(void);
virtual void Precache(void);
virtual BOOL MyTouch(CBasePlayer *pPlayer);
#ifdef HOOK_GAMEDLL
@ -158,9 +158,9 @@ public:
class CItemLongJump: public CItem
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual BOOL MyTouch(CBasePlayer *pPlayer);
virtual void Spawn(void);
virtual void Precache(void);
virtual BOOL MyTouch(CBasePlayer *pPlayer);
#ifdef HOOK_GAMEDLL
@ -176,9 +176,9 @@ public:
class CItemKevlar: public CItem
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual BOOL MyTouch(CBasePlayer *pPlayer);
virtual void Spawn(void);
virtual void Precache(void);
virtual BOOL MyTouch(CBasePlayer *pPlayer);
#ifdef HOOK_GAMEDLL
@ -194,9 +194,9 @@ public:
class CItemAssaultSuit: public CItem
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual BOOL MyTouch(CBasePlayer *pPlayer);
virtual void Spawn(void);
virtual void Precache(void);
virtual BOOL MyTouch(CBasePlayer *pPlayer);
#ifdef HOOK_GAMEDLL
@ -212,9 +212,9 @@ public:
class CItemThighPack: public CItem
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual BOOL MyTouch(CBasePlayer *pPlayer);
virtual void Spawn(void);
virtual void Precache(void);
virtual BOOL MyTouch(CBasePlayer *pPlayer);
#ifdef HOOK_GAMEDLL

View File

@ -13,67 +13,67 @@ TYPEDESCRIPTION CLight::m_SaveData[] =
#else
TYPEDESCRIPTION (*CLight::pm_SaveData)[2];
TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CLight, m_SaveData)[2];
#endif // HOOK_GAMEDLL
/* <e7ded> ../cstrike/dlls/lights.cpp:48 */
LINK_ENTITY_TO_CLASS(light, CLight);
/* <e7ded> ../cstrike/dlls/lights.cpp:48 */
LINK_ENTITY_TO_CLASS(light, CLight);
/* <e7b2c> ../cstrike/dlls/lights.cpp:56 */
IMPLEMENT_SAVERESTORE(CLight, CPointEntity);
// Cache user-entity-field values until spawn is called.
/* <e7bef> ../cstrike/dlls/lights.cpp:62 */
void CLight::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{
if (FStrEq(pkvd->szKeyName, "style"))
{
m_iStyle = Q_atoi(pkvd->szValue);
pkvd->fHandled = TRUE;
}
else if (FStrEq(pkvd->szKeyName, "pitch"))
{
pev->angles.x = Q_atof(pkvd->szValue);
pkvd->fHandled = TRUE;
}
else if (FStrEq(pkvd->szKeyName, "pattern"))
{
m_iszPattern = ALLOC_STRING( pkvd->szValue );
pkvd->fHandled = TRUE;
}
else
CPointEntity::KeyValue( pkvd );
/* <e7b2c> ../cstrike/dlls/lights.cpp:56 */
IMPLEMENT_SAVERESTORE(CLight, CPointEntity);
// Cache user-entity-field values until spawn is called.
/* <e7bef> ../cstrike/dlls/lights.cpp:62 */
void CLight::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{
if (FStrEq(pkvd->szKeyName, "style"))
{
m_iStyle = Q_atoi(pkvd->szValue);
pkvd->fHandled = TRUE;
}
else if (FStrEq(pkvd->szKeyName, "pitch"))
{
pev->angles.x = Q_atof(pkvd->szValue);
pkvd->fHandled = TRUE;
}
else if (FStrEq(pkvd->szKeyName, "pattern"))
{
m_iszPattern = ALLOC_STRING(pkvd->szValue);
pkvd->fHandled = TRUE;
}
else
CPointEntity::KeyValue(pkvd);
}
/* <e7b78> ../cstrike/dlls/lights.cpp:92 */
void CLight::__MAKE_VHOOK(Spawn)(void)
{
// inert light
if (FStringNull(pev->targetname))
{
REMOVE_ENTITY(ENT(pev));
return;
}
m_iStartedOff = (pev->spawnflags & SF_LIGHT_START_OFF) != 0;
if (m_iStyle >= 32)
{
if (pev->spawnflags & SF_LIGHT_START_OFF)
LIGHT_STYLE(m_iStyle, "a");
else if (m_iszPattern)
LIGHT_STYLE(m_iStyle, (char *)STRING( m_iszPattern ));
else
LIGHT_STYLE(m_iStyle, "m");
}
/* <e7b78> ../cstrike/dlls/lights.cpp:92 */
void CLight::__MAKE_VHOOK(Spawn)(void)
{
// inert light
if (FStringNull(pev->targetname))
{
REMOVE_ENTITY(ENT(pev));
return;
}
m_iStartedOff = (pev->spawnflags & SF_LIGHT_START_OFF) != 0;
if (m_iStyle >= 32)
{
if (pev->spawnflags & SF_LIGHT_START_OFF)
LIGHT_STYLE(m_iStyle, "a");
else if (m_iszPattern)
LIGHT_STYLE(m_iStyle, (char *)STRING(m_iszPattern));
else
LIGHT_STYLE(m_iStyle, "m");
}
}
/* <e7a30> ../cstrike/dlls/lights.cpp:117 */
void CLight::__MAKE_VHOOK(Restart)(void)
{
/* <e7a30> ../cstrike/dlls/lights.cpp:117 */
void CLight::__MAKE_VHOOK(Restart)(void)
{
if (m_iStyle >= 32)
{
if (m_iStartedOff)
@ -90,12 +90,12 @@ void CLight::__MAKE_VHOOK(Restart)(void)
else
LIGHT_STYLE(m_iStyle, "m");
}
}
}
}
/* <e7a6b> ../cstrike/dlls/lights.cpp:139 */
void CLight::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
/* <e7a6b> ../cstrike/dlls/lights.cpp:139 */
void CLight::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
if (m_iStyle >= 32)
{
if (!ShouldToggle(useType, !(pev->spawnflags & SF_LIGHT_START_OFF)))
@ -115,18 +115,18 @@ void CLight::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, US
LIGHT_STYLE(m_iStyle, "a");
pev->spawnflags |= SF_LIGHT_START_OFF;
}
}
}
}
/* <e7eb7> ../cstrike/dlls/lights.cpp:165 */
LINK_ENTITY_TO_CLASS(light_spot, CLight);
/* <e7eb7> ../cstrike/dlls/lights.cpp:165 */
LINK_ENTITY_TO_CLASS(light_spot, CLight);
/* <e7f81> ../cstrike/dlls/lights.cpp:175 */
/* <e7f81> ../cstrike/dlls/lights.cpp:175 */
LINK_ENTITY_TO_CLASS(light_environment, CEnvLight);
/* <e7d08> ../cstrike/dlls/lights.cpp:177 */
void CEnvLight::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{
/* <e7d08> ../cstrike/dlls/lights.cpp:177 */
void CEnvLight::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{
if (FStrEq(pkvd->szKeyName, "_light"))
{
int r, g, b, v, j;
@ -143,9 +143,9 @@ void CEnvLight::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
}
// simulate qrad direct, ambient,and gamma adjustments, as well as engine scaling
r = pow( r / 114.0, 0.6 ) * 264;
g = pow( g / 114.0, 0.6 ) * 264;
b = pow( b / 114.0, 0.6 ) * 264;
r = pow(r / 114.0, 0.6) * 264;
g = pow(g / 114.0, 0.6) * 264;
b = pow(b / 114.0, 0.6) * 264;
pkvd->fHandled = TRUE;
@ -158,35 +158,35 @@ void CEnvLight::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CVAR_SET_STRING("sv_skycolor_b", szColor);
}
else
CLight::KeyValue(pkvd);
CLight::KeyValue(pkvd);
}
/* <e7bb3> ../cstrike/dlls/lights.cpp:215 */
void CEnvLight::__MAKE_VHOOK(Spawn)(void)
{
#if defined(HOOK_GAMEDLL)
// NOTE: fix negative the values for function sprintf from STD C++:
// expected - sv_skyvec_y "0.000000"
// with using sprintf from STD C++, got - sv_skyvec_y "-0.000000"
// If we not doing it then the test will be failed!
#define SPRINTF_OLD_STD_FIX + 0
#else
#define SPRINTF_OLD_STD_FIX
#endif // HOOK_GAMEDLL
char szVector[64];
UTIL_MakeAimVectors( pev->angles );
Q_sprintf(szVector, "%f", gpGlobals->v_forward.x SPRINTF_OLD_STD_FIX);
CVAR_SET_STRING("sv_skyvec_x", szVector);
Q_sprintf(szVector, "%f", gpGlobals->v_forward.y SPRINTF_OLD_STD_FIX);
CVAR_SET_STRING("sv_skyvec_y", szVector);
Q_sprintf(szVector, "%f", gpGlobals->v_forward.z SPRINTF_OLD_STD_FIX);
CVAR_SET_STRING("sv_skyvec_z", szVector);
CLight::Spawn();
/* <e7bb3> ../cstrike/dlls/lights.cpp:215 */
void CEnvLight::__MAKE_VHOOK(Spawn)(void)
{
#if defined(HOOK_GAMEDLL)
// NOTE: fix negative the values for function sprintf from STD C++:
// expected - sv_skyvec_y "0.000000"
// with using sprintf from STD C++, got - sv_skyvec_y "-0.000000"
// If we not doing it then the test will be failed!
#define SPRINTF_OLD_STD_FIX + 0
#else
#define SPRINTF_OLD_STD_FIX
#endif // HOOK_GAMEDLL
char szVector[64];
UTIL_MakeAimVectors(pev->angles);
Q_sprintf(szVector, "%f", gpGlobals->v_forward.x SPRINTF_OLD_STD_FIX);
CVAR_SET_STRING("sv_skyvec_x", szVector);
Q_sprintf(szVector, "%f", gpGlobals->v_forward.y SPRINTF_OLD_STD_FIX);
CVAR_SET_STRING("sv_skyvec_y", szVector);
Q_sprintf(szVector, "%f", gpGlobals->v_forward.z SPRINTF_OLD_STD_FIX);
CVAR_SET_STRING("sv_skyvec_z", szVector);
CLight::Spawn();
}
#ifdef HOOK_GAMEDLL

View File

@ -34,7 +34,7 @@
#define SF_LIGHT_START_OFF 1
/* <e70f6> ../cstrike/dlls/lights.cpp:29 */
/* <e70f6> ../cstrike/dlls/lights.cpp:29 */
class CLight: public CPointEntity
{
public:
@ -66,19 +66,20 @@ private:
};/* size: 164, cachelines: 3, members: 5 */
/* <e7111> ../cstrike/dlls/lights.cpp:168 */
/* <e7111> ../cstrike/dlls/lights.cpp:168 */
class CEnvLight: public CLight
{
public:
virtual void Spawn(void);
virtual void KeyValue(KeyValueData *pkvd);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void KeyValue_(KeyValueData *pkvd);
#endif // HOOK_GAMEDLL
};/* size: 164, cachelines: 3, members: 1 */
#endif // LIGHT_H

View File

@ -10,6 +10,8 @@ TYPEDESCRIPTION CRuleEntity::m_SaveData[] =
DEFINE_FIELD(CRuleEntity, m_iszMaster, FIELD_STRING),
};
// Save parms as a block. Will break save/restore if the structure changes, but this entity didn't ship with Half-Life, so
// it can't impact saved Half-Life games.
TYPEDESCRIPTION CGameText::m_SaveData[] =
{
DEFINE_ARRAY(CGameText, m_textParms, FIELD_CHARACTER, sizeof(hudtextparms_t)),
@ -25,9 +27,9 @@ TYPEDESCRIPTION CGamePlayerZone::m_SaveData[] =
#else
TYPEDESCRIPTION (*CRuleEntity::pm_SaveData)[1];
TYPEDESCRIPTION (*CGameText::pm_SaveData)[1];
TYPEDESCRIPTION (*CGamePlayerZone::pm_SaveData)[4];
TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CRuleEntity, m_SaveData)[1];
TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CGameText, m_SaveData)[1];
TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CGamePlayerZone, m_SaveData)[4];
#endif // HOOK_GAMEDLL
@ -35,370 +37,615 @@ TYPEDESCRIPTION (*CGamePlayerZone::pm_SaveData)[4];
IMPLEMENT_SAVERESTORE(CRuleEntity, CBaseEntity);
/* <eed18> ../cstrike/dlls/maprules.cpp:60 */
NOBODY void CRuleEntity::__MAKE_VHOOK(Spawn)(void)
void CRuleEntity::__MAKE_VHOOK(Spawn)(void)
{
pev->solid = SOLID_NOT;
pev->movetype = MOVETYPE_NONE;
pev->effects = EF_NODRAW;
}
/* <eeff6> ../cstrike/dlls/maprules.cpp:68 */
NOBODY void CRuleEntity::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
void CRuleEntity::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{
// FStrEq(const char *sz1,
// const char *sz2); // 70
// KeyValue(CBaseEntity *const this,
// KeyValueData *pkvd); // 76
// KeyValue(CRuleEntity *const this,
// KeyValueData *pkvd); // 68
if (FStrEq(pkvd->szKeyName, "master"))
{
SetMaster(ALLOC_STRING(pkvd->szValue));
pkvd->fHandled = TRUE;
}
else
CBaseEntity::KeyValue(pkvd);
}
/* <f0955> ../cstrike/dlls/maprules.cpp:79 */
NOBODY BOOL CRuleEntity::CanFireForActivator(CBaseEntity *pActivator)
BOOL CRuleEntity::CanFireForActivator(CBaseEntity *pActivator)
{
// CanFireForActivator(CRuleEntity *const this,
// class CBaseEntity *pActivator); // 79
if (!FStringNull(m_iszMaster))
{
if (UTIL_IsMasterTriggered(m_iszMaster, pActivator))
return TRUE;
else
return FALSE;
}
return TRUE;
}
/* <eed39> ../cstrike/dlls/maprules.cpp:101 */
NOBODY void CRulePointEntity::__MAKE_VHOOK(Spawn)(void)
void CRulePointEntity::__MAKE_VHOOK(Spawn)(void)
{
// Spawn(CRuleEntity *const this); // 103
CRuleEntity::Spawn();
pev->frame = 0;
pev->model = 0;
}
/* <eed72> ../cstrike/dlls/maprules.cpp:120 */
NOBODY void CRuleBrushEntity::__MAKE_VHOOK(Spawn)(void)
void CRuleBrushEntity::__MAKE_VHOOK(Spawn)(void)
{
// Spawn(CRuleEntity *const this); // 123
SET_MODEL(edict(), STRING(pev->model));
CRuleEntity::Spawn();
}
/* <f099d> ../cstrike/dlls/maprules.cpp:151 */
LINK_ENTITY_TO_CLASS(game_score, CGameScore);
/* <eedb1> ../cstrike/dlls/maprules.cpp:154 */
NOBODY void CGameScore::__MAKE_VHOOK(Spawn)(void)
void CGameScore::__MAKE_VHOOK(Spawn)(void)
{
// Spawn(CRulePointEntity *const this); // 156
CRulePointEntity::Spawn();
}
/* <efc68> ../cstrike/dlls/maprules.cpp:160 */
NOBODY void CGameScore::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
void CGameScore::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{
// FStrEq(const char *sz1,
// const char *sz2); // 162
// KeyValue(CRuleEntity *const this,
// KeyValueData *pkvd); // 168
// KeyValue(CGameScore *const this,
// KeyValueData *pkvd); // 160
if (FStrEq(pkvd->szKeyName, "points"))
{
SetPoints(Q_atoi(pkvd->szValue));
pkvd->fHandled = TRUE;
}
else
CRulePointEntity::KeyValue(pkvd);
}
/* <ef54c> ../cstrike/dlls/maprules.cpp:173 */
NOBODY void CGameScore::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
void CGameScore::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
// CanFireForActivator(CRuleEntity *const this,
// class CBaseEntity *pActivator); // 175
// Use(CGameScore *const this,
// class CBaseEntity *pActivator,
// class CBaseEntity *pCaller,
// USE_TYPE useType,
// float value); // 173
// AwardToTeam(CGameScore *const this); // 181
// AllowNegativeScore(CGameScore *const this); // 187
// Points(CGameScore *const this); // 187
if (!CanFireForActivator(pActivator))
return;
// Only players can use this
if (pActivator->IsPlayer())
{
if (AwardToTeam())
{
pActivator->AddPointsToTeam(Points(), AllowNegativeScore());
}
else
{
pActivator->AddPoints(Points(), AllowNegativeScore());
}
}
}
/* <f0a68> ../cstrike/dlls/maprules.cpp:202 */
LINK_ENTITY_TO_CLASS(game_end, CGameEnd);
/* <ef497> ../cstrike/dlls/maprules.cpp:205 */
void CGameEnd::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
if (!CanFireForActivator(pActivator))
return;
g_pGameRules->EndMultiplayerGame();
}
/* <f0b33> ../cstrike/dlls/maprules.cpp:242 */
LINK_ENTITY_TO_CLASS(game_text, CGameText);
/* <ef497> ../cstrike/dlls/maprules.cpp:205 */
NOBODY void CGameEnd::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
// CanFireForActivator(CRuleEntity *const this,
// class CBaseEntity *pActivator); // 207
// Use(CGameEnd *const this,
// class CBaseEntity *pActivator,
// class CBaseEntity *pCaller,
// USE_TYPE useType,
// float value); // 205
}
/* <ef252> ../cstrike/dlls/maprules.cpp:251 */
IMPLEMENT_SAVERESTORE(CGameText, CRulePointEntity);
/* <f00dd> ../cstrike/dlls/maprules.cpp:254 */
NOBODY void CGameText::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
void CGameText::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{
// {
// int color; // 278
// }
// {
// int color; // 288
// }
// FStrEq(const char *sz1,
// const char *sz2); // 256
// FStrEq(const char *sz1,
// const char *sz2); // 261
// atof(const char *__nptr); // 263
// atoi(const char *__nptr); // 258
// KeyValue(CGameText *const this,
// KeyValueData *pkvd); // 254
if (FStrEq(pkvd->szKeyName, "channel"))
{
m_textParms.channel = Q_atoi(pkvd->szValue);
pkvd->fHandled = TRUE;
}
else if (FStrEq(pkvd->szKeyName, "x"))
{
m_textParms.x = Q_atof(pkvd->szValue);
pkvd->fHandled = TRUE;
}
else if (FStrEq(pkvd->szKeyName, "y"))
{
m_textParms.y = Q_atof(pkvd->szValue);
pkvd->fHandled = TRUE;
}
else if (FStrEq(pkvd->szKeyName, "effect"))
{
m_textParms.effect = Q_atoi(pkvd->szValue);
pkvd->fHandled = TRUE;
}
else if (FStrEq(pkvd->szKeyName, "color"))
{
int color[4];
UTIL_StringToIntArray(color, ARRAYSIZE(color), pkvd->szValue);
m_textParms.r1 = color[0];
m_textParms.g1 = color[1];
m_textParms.b1 = color[2];
m_textParms.a1 = color[3];
pkvd->fHandled = TRUE;
}
else if (FStrEq(pkvd->szKeyName, "color2"))
{
int color[4];
UTIL_StringToIntArray(color, ARRAYSIZE(color), pkvd->szValue);
m_textParms.r2 = color[0];
m_textParms.g2 = color[1];
m_textParms.b2 = color[2];
m_textParms.a2 = color[3];
pkvd->fHandled = TRUE;
}
else if (FStrEq(pkvd->szKeyName, "fadein"))
{
m_textParms.fadeinTime = Q_atof(pkvd->szValue);
pkvd->fHandled = TRUE;
}
else if (FStrEq(pkvd->szKeyName, "fadeout"))
{
m_textParms.fadeoutTime = Q_atof(pkvd->szValue);
pkvd->fHandled = TRUE;
}
else if (FStrEq(pkvd->szKeyName, "holdtime"))
{
m_textParms.holdTime = Q_atof(pkvd->szValue);
pkvd->fHandled = TRUE;
}
else if (FStrEq(pkvd->szKeyName, "fxtime"))
{
m_textParms.fxTime = Q_atof(pkvd->szValue);
pkvd->fHandled = TRUE;
}
else
CRulePointEntity::KeyValue(pkvd);
}
/* <ef655> ../cstrike/dlls/maprules.cpp:321 */
NOBODY void CGameText::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
// CanFireForActivator(CRuleEntity *const this,
// class CBaseEntity *pActivator); // 323
// MessageGet(CGameText *const this); // 328
// Use(CGameText *const this,
// class CBaseEntity *pActivator,
// class CBaseEntity *pCaller,
// USE_TYPE useType,
// float value); // 321
/* <ef655> ../cstrike/dlls/maprules.cpp:321 */
void CGameText::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
if (!CanFireForActivator(pActivator))
return;
if (MessageToAll())
{
UTIL_HudMessageAll(m_textParms, MessageGet());
}
else
{
if (pActivator->IsNetClient())
{
UTIL_HudMessage(pActivator, m_textParms, MessageGet());
}
}
}
/* <f0bfe> ../cstrike/dlls/maprules.cpp:371 */
/* <f0bfe> ../cstrike/dlls/maprules.cpp:371 */
LINK_ENTITY_TO_CLASS(game_team_master, CGameTeamMaster);
/* <eff4f> ../cstrike/dlls/maprules.cpp:373 */
NOBODY void CGameTeamMaster::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{
// FStrEq(const char *sz1,
// const char *sz2); // 375
// FStrEq(const char *sz1,
// const char *sz2); // 380
// KeyValue(CRuleEntity *const this,
// KeyValueData *pkvd); // 398
// {
// int type; // 382
// atoi(const char *__nptr); // 382
// }
// KeyValue(CGameTeamMaster *const this,
// KeyValueData *pkvd); // 373
/* <eff4f> ../cstrike/dlls/maprules.cpp:373 */
void CGameTeamMaster::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{
if (FStrEq(pkvd->szKeyName, "teamindex"))
{
m_teamIndex = Q_atoi(pkvd->szValue);
pkvd->fHandled = TRUE;
}
else if (FStrEq(pkvd->szKeyName, "triggerstate"))
{
int type = Q_atoi(pkvd->szValue);
switch(type)
{
case 0:
triggerType = USE_OFF;
break;
case 2:
triggerType = USE_TOGGLE;
break;
default:
triggerType = USE_ON;
break;
}
pkvd->fHandled = TRUE;
}
else
CRulePointEntity::KeyValue(pkvd);
}
/* <f0474> ../cstrike/dlls/maprules.cpp:402 */
void CGameTeamMaster::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
// CanFireForActivator(CRuleEntity *const this,
// class CBaseEntity *pActivator); // 404
// TeamMatch(CGameTeamMaster *const this,
// class CBaseEntity *pActivator); // 420
// Use(CGameTeamMaster *const this,
// class CBaseEntity *pActivator,
// class CBaseEntity *pCaller,
// USE_TYPE useType,
// float value); // 402
/* <f0474> ../cstrike/dlls/maprules.cpp:402 */
void CGameTeamMaster::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
if (!CanFireForActivator(pActivator))
return;
if (useType == USE_SET)
{
if (value < 0)
{
m_teamIndex = -1;
}
else
{
m_teamIndex = g_pGameRules->GetTeamIndex(pActivator->TeamID());
}
return;
}
if (TeamMatch(pActivator))
{
SUB_UseTargets(pActivator, triggerType, value);
if (RemoveOnFire())
{
UTIL_Remove(this);
}
}
}
/* <ef2e0> ../cstrike/dlls/maprules.cpp:429 */
BOOL CGameTeamMaster::__MAKE_VHOOK(IsTriggered)(CBaseEntity *pActivator)
{
// TeamMatch(CGameTeamMaster *const this,
// class CBaseEntity *pActivator); // 431
/* <ef2e0> ../cstrike/dlls/maprules.cpp:429 */
BOOL CGameTeamMaster::__MAKE_VHOOK(IsTriggered)(CBaseEntity *pActivator)
{
return TeamMatch(pActivator);
}
/* <eeeaf> ../cstrike/dlls/maprules.cpp:435 */
const char *CGameTeamMaster::__MAKE_VHOOK(TeamID)(void)
{
// TeamID(CGameTeamMaster *const this); // 435
/* <eeeaf> ../cstrike/dlls/maprules.cpp:435 */
const char *CGameTeamMaster::__MAKE_VHOOK(TeamID)(void)
{
// Currently set to "no team"
if (m_teamIndex < 0)
{
return "";
}
// UNDONE: Fill this in with the team from the "teamlist"
return g_pGameRules->GetIndexedTeamName(m_teamIndex);
}
/* <f0ccd> ../cstrike/dlls/maprules.cpp:444 */
BOOL CGameTeamMaster::TeamMatch(CBaseEntity *pActivator)
{
// TeamMatch(CGameTeamMaster *const this,
// class CBaseEntity *pActivator); // 444
// AnyTeam(CGameTeamMaster *const this); // 446
/* <f0ccd> ../cstrike/dlls/maprules.cpp:444 */
BOOL CGameTeamMaster::TeamMatch(CBaseEntity *pActivator)
{
if (m_teamIndex < 0 && AnyTeam())
return TRUE;
if (!pActivator)
return FALSE;
return UTIL_TeamsMatch(pActivator->TeamID(), TeamID());
}
/* <f0d2e> ../cstrike/dlls/maprules.cpp:474 */
/* <f0d2e> ../cstrike/dlls/maprules.cpp:474 */
LINK_ENTITY_TO_CLASS(game_team_set, CGameTeamSet);
/* <ef735> ../cstrike/dlls/maprules.cpp:477 */
void CGameTeamSet::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
// CanFireForActivator(CRuleEntity *const this,
// class CBaseEntity *pActivator); // 479
// Use(CGameTeamSet *const this,
// class CBaseEntity *pActivator,
// class CBaseEntity *pCaller,
// USE_TYPE useType,
// float value); // 477
}
/* <f0dfd> ../cstrike/dlls/maprules.cpp:519 */
LINK_ENTITY_TO_CLASS(game_zone_player, CGamePlayerZone);
/* <ef0a2> ../cstrike/dlls/maprules.cpp:528 */
/* <ef735> ../cstrike/dlls/maprules.cpp:477 */
void CGameTeamSet::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
if (!CanFireForActivator(pActivator))
return;
if (ShouldClearTeam())
{
SUB_UseTargets(pActivator, USE_SET, -1);
}
else
{
SUB_UseTargets(pActivator, USE_SET, 0);
}
if (RemoveOnFire())
{
UTIL_Remove(this);
}
}
/* <f0dfd> ../cstrike/dlls/maprules.cpp:519 */
LINK_ENTITY_TO_CLASS(game_zone_player, CGamePlayerZone);
/* <ef0a2> ../cstrike/dlls/maprules.cpp:528 */
IMPLEMENT_SAVERESTORE(CGamePlayerZone, CRuleBrushEntity);
/* <efdbc> ../cstrike/dlls/maprules.cpp:530 */
void CGamePlayerZone::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{
// FStrEq(const char *sz1,
// const char *sz2); // 532
// FStrEq(const char *sz1,
// const char *sz2); // 537
// KeyValue(CGamePlayerZone *const this,
// KeyValueData *pkvd); // 530
/* <efdbc> ../cstrike/dlls/maprules.cpp:530 */
void CGamePlayerZone::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{
if (FStrEq(pkvd->szKeyName, "intarget"))
{
m_iszInTarget = ALLOC_STRING(pkvd->szValue);
pkvd->fHandled = TRUE;
}
else if (FStrEq(pkvd->szKeyName, "outtarget"))
{
m_iszOutTarget = ALLOC_STRING(pkvd->szValue);
pkvd->fHandled = TRUE;
}
else if (FStrEq(pkvd->szKeyName, "incount"))
{
m_iszInCount = ALLOC_STRING(pkvd->szValue);
pkvd->fHandled = TRUE;
}
else if (FStrEq(pkvd->szKeyName, "outcount"))
{
m_iszOutCount = ALLOC_STRING(pkvd->szValue);
pkvd->fHandled = TRUE;
}
else
CRuleBrushEntity::KeyValue(pkvd);
}
/* <ef36e> ../cstrike/dlls/maprules.cpp:556 */
void CGamePlayerZone::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
// {
// int playersInCount; // 558
// int playersOutCount; // 559
// class CBaseEntity *pPlayer; // 564
// {
// int i; // 566
// {
// TraceResult trace; // 571
// int hullNumber; // 572
// }
// }
// CanFireForActivator(CRuleEntity *const this,
// class CBaseEntity *pActivator); // 561
// }
// Use(CGamePlayerZone *const this,
// class CBaseEntity *pActivator,
// class CBaseEntity *pCaller,
// USE_TYPE useType,
// float value); // 556
/* <ef36e> ../cstrike/dlls/maprules.cpp:556 */
void CGamePlayerZone::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
int playersInCount = 0;
int playersOutCount = 0;
if (!CanFireForActivator(pActivator))
return;
CBaseEntity *pPlayer = NULL;
for (int i = 1; i <= gpGlobals->maxClients; i++)
{
pPlayer = reinterpret_cast<CBasePlayer *>(UTIL_PlayerByIndex(i));
if (pPlayer)
{
TraceResult trace;
int hullNumber;
hullNumber = human_hull;
if (pPlayer->pev->flags & FL_DUCKING)
{
hullNumber = head_hull;
}
UTIL_TraceModel(pPlayer->pev->origin, pPlayer->pev->origin, hullNumber, edict(), &trace);
if (trace.fStartSolid)
{
playersInCount++;
if (!FStringNull(m_iszInTarget))
{
FireTargets(STRING(m_iszInTarget), pPlayer, pActivator, useType, value);
}
}
else
{
playersOutCount++;
if (!FStringNull(m_iszOutTarget))
{
FireTargets(STRING(m_iszOutTarget), pPlayer, pActivator, useType, value);
}
}
}
}
if (!FStringNull(m_iszInCount))
{
FireTargets(STRING(m_iszInCount), pActivator, this, USE_SET, playersInCount);
}
if (!FStringNull(m_iszOutCount))
{
FireTargets(STRING(m_iszOutCount), pActivator, this, USE_SET, playersOutCount);
}
}
/* <f0ecc> ../cstrike/dlls/maprules.cpp:628 */
/* <f0ecc> ../cstrike/dlls/maprules.cpp:628 */
LINK_ENTITY_TO_CLASS(game_player_hurt, CGamePlayerHurt);
/* <ef815> ../cstrike/dlls/maprules.cpp:631 */
void CGamePlayerHurt::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
// CanFireForActivator(CRuleEntity *const this,
// class CBaseEntity *pActivator); // 633
// Use(CGamePlayerHurt *const this,
// class CBaseEntity *pActivator,
// class CBaseEntity *pCaller,
// USE_TYPE useType,
// float value); // 631
/* <ef815> ../cstrike/dlls/maprules.cpp:631 */
void CGamePlayerHurt::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
if (!CanFireForActivator(pActivator))
return;
if (pActivator->IsPlayer())
{
if (pev->dmg < 0)
pActivator->TakeHealth(-pev->dmg, DMG_GENERIC);
else
pActivator->TakeDamage(pev, pev, pev->dmg, DMG_GENERIC);
}
SUB_UseTargets(pActivator, useType, value);
if (RemoveOnFire())
{
UTIL_Remove(this);
}
}
/* <f0f9b> ../cstrike/dlls/maprules.cpp:684 */
LINK_ENTITY_TO_CLASS(game_counter, CGameCounter);
/* <f0f9b> ../cstrike/dlls/maprules.cpp:684 */
LINK_ENTITY_TO_CLASS(game_counter, CGameCounter);
/* <eee2d> ../cstrike/dlls/maprules.cpp:686 */
void CGameCounter::__MAKE_VHOOK(Spawn)(void)
{
// CountValue(CGameCounter *const this); // 689
// SetInitialValue(CGameCounter *const this,
// int value); // 689
// Spawn(CRulePointEntity *const this); // 690
/* <eee2d> ../cstrike/dlls/maprules.cpp:686 */
void CGameCounter::__MAKE_VHOOK(Spawn)(void)
{
// Save off the initial count
SetInitialValue(CountValue());
CRulePointEntity::Spawn();
}
/* <ef8ef> ../cstrike/dlls/maprules.cpp:694 */
void CGameCounter::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
// CanFireForActivator(CRuleEntity *const this,
// class CBaseEntity *pActivator); // 696
// Use(CGameCounter *const this,
// class CBaseEntity *pActivator,
// class CBaseEntity *pCaller,
// USE_TYPE useType,
// float value); // 694
}
/* <f106a> ../cstrike/dlls/maprules.cpp:747 */
LINK_ENTITY_TO_CLASS(game_counter_set, CGameCounterSet);
/* <ef8ef> ../cstrike/dlls/maprules.cpp:694 */
void CGameCounter::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
if (!CanFireForActivator(pActivator))
return;
/* <efa65> ../cstrike/dlls/maprules.cpp:750 */
void CGameCounterSet::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
// CanFireForActivator(CRuleEntity *const this,
// class CBaseEntity *pActivator); // 752
// Use(CGameCounterSet *const this,
// class CBaseEntity *pActivator,
// class CBaseEntity *pCaller,
// USE_TYPE useType,
// float value); // 750
}
/* <f1139> ../cstrike/dlls/maprules.cpp:788 */
LINK_ENTITY_TO_CLASS(game_player_equip, CGamePlayerEquip);
/* <ed81f> ../cstrike/dlls/maprules.cpp:791 */
void CGamePlayerEquip::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{
// {
// int i; // 797
// {
// char tmp; // 801
// }
// }
// KeyValue(CRuleEntity *const this,
// KeyValueData *pkvd); // 793
// KeyValue(CGamePlayerEquip *const this,
// KeyValueData *pkvd); // 791
switch (useType)
{
case USE_ON:
case USE_TOGGLE:
CountUp();
break;
case USE_OFF:
CountDown();
break;
case USE_SET:
SetCountValue((int)value);
break;
}
if (HitLimit())
{
SUB_UseTargets(pActivator, USE_TOGGLE, 0);
if (RemoveOnFire())
{
UTIL_Remove(this);
}
if (ResetOnFire())
{
ResetCount();
}
}
}
/* <f06ad> ../cstrike/dlls/maprules.cpp:816 */
void CGamePlayerEquip::__MAKE_VHOOK(Touch)(CBaseEntity *pOther)
{
// CanFireForActivator(CRuleEntity *const this,
// class CBaseEntity *pActivator); // 818
// Touch(CGamePlayerEquip *const this,
// class CBaseEntity *pOther); // 816
}
/* <f1208> ../cstrike/dlls/maprules.cpp:827 */
void CGamePlayerEquip::EquipPlayer(CBaseEntity *pEntity)
{
// {
// class CBasePlayer *pPlayer; // 829
// {
// int i; // 839
// {
// int j; // 843
// }
// }
// }
/* <f106a> ../cstrike/dlls/maprules.cpp:747 */
LINK_ENTITY_TO_CLASS(game_counter_set, CGameCounterSet);
/* <efa65> ../cstrike/dlls/maprules.cpp:750 */
void CGameCounterSet::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
if (!CanFireForActivator(pActivator))
return;
SUB_UseTargets(pActivator, USE_SET, pev->frags);
if (RemoveOnFire())
{
UTIL_Remove(this);
}
}
/* <f05f3> ../cstrike/dlls/maprules.cpp:851 */
void CGamePlayerEquip::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
// EquipPlayer(CGamePlayerEquip *const this,
// class CBaseEntity *pEntity); // 853
/* <f1139> ../cstrike/dlls/maprules.cpp:788 */
LINK_ENTITY_TO_CLASS(game_player_equip, CGamePlayerEquip);
/* <ed81f> ../cstrike/dlls/maprules.cpp:791 */
void CGamePlayerEquip::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{
CRulePointEntity::KeyValue(pkvd);
if (!pkvd->fHandled)
{
for (int i = 0; i < MAX_EQUIP; i++)
{
if (FStringNull(m_weaponNames[i]))
{
char tmp[128];
UTIL_StripToken(pkvd->szKeyName, tmp);
m_weaponNames[i] = ALLOC_STRING(tmp);
m_weaponCount[i] = Q_atoi(pkvd->szValue);
m_weaponCount[i] = Q_max(1, m_weaponCount[i]);
pkvd->fHandled = TRUE;
break;
}
}
}
}
/* <f1268> ../cstrike/dlls/maprules.cpp:881 */
/* <f06ad> ../cstrike/dlls/maprules.cpp:816 */
void CGamePlayerEquip::__MAKE_VHOOK(Touch)(CBaseEntity *pOther)
{
if (!CanFireForActivator(pOther))
return;
if (UseOnly())
return;
EquipPlayer(pOther);
}
/* <f1208> ../cstrike/dlls/maprules.cpp:827 */
void CGamePlayerEquip::EquipPlayer(CBaseEntity *pEntity)
{
CBasePlayer *pPlayer = NULL;
if (pEntity->IsPlayer())
{
pPlayer = reinterpret_cast<CBasePlayer *>(pEntity);
}
if (!pPlayer)
return;
for (int i = 0; i < MAX_EQUIP; i++)
{
if (FStringNull(m_weaponNames[i]))
break;
for (int j = 0; j < m_weaponCount[i]; j++)
{
pPlayer->GiveNamedItem(STRING(m_weaponNames[i]));
}
}
}
/* <f05f3> ../cstrike/dlls/maprules.cpp:851 */
void CGamePlayerEquip::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
EquipPlayer(pActivator);
}
/* <f1268> ../cstrike/dlls/maprules.cpp:881 */
LINK_ENTITY_TO_CLASS(game_player_team, CGamePlayerTeam);
/* <f1337> ../cstrike/dlls/maprules.cpp:884 */
const char *CGamePlayerTeam::TargetTeamName(const char *pszTargetName)
{
// {
// class CBaseEntity *pTeamEntity; // 886
// FClassnameIs(entvars_t *pev,
// const char *szClassname); // 890
// }
/* <f1337> ../cstrike/dlls/maprules.cpp:884 */
const char *CGamePlayerTeam::TargetTeamName(const char *pszTargetName)
{
CBaseEntity *pTeamEntity = NULL;
while ((pTeamEntity = UTIL_FindEntityByTargetname(pTeamEntity, pszTargetName)) != NULL)
{
if (FClassnameIs(pTeamEntity->pev, "game_team_master"))
return pTeamEntity->TeamID();
}
return NULL;
}
/* <f07df> ../cstrike/dlls/maprules.cpp:898 */
void CGamePlayerTeam::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
// {
// const char *pszTargetTeam; // 905
// {
// class CBasePlayer *pPlayer; // 908
// }
// }
// CanFireForActivator(CRuleEntity *const this,
// class CBaseEntity *pActivator); // 900
// Use(CGamePlayerTeam *const this,
// class CBaseEntity *pActivator,
// class CBaseEntity *pCaller,
// USE_TYPE useType,
// float value); // 898
/* <f07df> ../cstrike/dlls/maprules.cpp:898 */
void CGamePlayerTeam::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
if (!CanFireForActivator(pActivator))
return;
if (pActivator->IsPlayer())
{
const char *pszTargetTeam = TargetTeamName(STRING(pev->target));
if (pszTargetTeam != NULL)
{
CBasePlayer *pPlayer = reinterpret_cast<CBasePlayer *>(pActivator);
g_pGameRules->ChangePlayerTeam(pPlayer, pszTargetTeam, ShouldKillPlayer(), ShouldGibPlayer());
}
}
if (RemoveOnFire())
{
UTIL_Remove(this);
}
}
#ifdef HOOK_GAMEDLL
@ -492,10 +739,10 @@ void CGameTeamMaster::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP
{
Use_(pActivator, pCaller, useType, value);
}
void CGameTeamSet::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
void CGameTeamSet::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
Use_(pActivator, pCaller, useType, value);
}
void CGamePlayerZone::KeyValue(KeyValueData *pkvd)

View File

@ -61,10 +61,10 @@
class CRuleEntity: public CBaseEntity
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
virtual void Spawn(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
#ifdef HOOK_GAMEDLL
@ -90,11 +90,13 @@ private:
};/* size: 156, cachelines: 3, members: 3 */
// CRulePointEntity -- base class for all rule "point" entities (not brushes)
/* <ee010> ../cstrike/dlls/maprules.cpp:95 */
class CRulePointEntity: public CRuleEntity
{
public:
NOBODY virtual void Spawn(void);
virtual void Spawn(void);
#ifdef HOOK_GAMEDLL
@ -104,11 +106,14 @@ public:
};/* size: 156, cachelines: 3, members: 1 */
// CRuleBrushEntity -- base class for all rule "brush" entities (not brushes)
// Default behavior is to set up like a trigger, invisible, but keep the model for volume testing
/* <ee209> ../cstrike/dlls/maprules.cpp:112 */
class CRuleBrushEntity: public CRuleEntity
{
public:
NOBODY virtual void Spawn(void);
virtual void Spawn(void);
#ifdef HOOK_GAMEDLL
@ -118,13 +123,18 @@ public:
};/* size: 156, cachelines: 3, members: 1 */
// CGameScore / game_score -- award points to player / team
// Points +/- total
// Flag: Allow negative scores SF_SCORE_NEGATIVE
// Flag: Award points to team in teamplay SF_SCORE_TEAM
/* <ee086> ../cstrike/dlls/maprules.cpp:135 */
class CGameScore: public CRulePointEntity
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Spawn(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
@ -135,30 +145,32 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY inline int Points(void)
inline int Points(void)
{
return (int)(pev->frags);
}
NOBODY inline BOOL AllowNegativeScore(void)
inline BOOL AllowNegativeScore(void)
{
return pev->spawnflags & SF_SCORE_NEGATIVE;
}
NOBODY inline BOOL AwardToTeam(void)
inline BOOL AwardToTeam(void)
{
return pev->spawnflags & SF_SCORE_TEAM;
}
NOBODY inline void SetPoints(int points)
inline void SetPoints(int points)
{
pev->frags = points;
}
};/* size: 156, cachelines: 3, members: 1 */
// CGameEnd / game_end -- Ends the game in MP
/* <ee0d3> ../cstrike/dlls/maprules.cpp:195 */
class CGameEnd: public CRulePointEntity
{
public:
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
@ -168,14 +180,17 @@ public:
};/* size: 156, cachelines: 3, members: 1 */
// CGameText / game_text -- NON-Localized HUD Message (use env_message to display a titles.txt message)
// Flag: All players SF_ENVTEXT_ALLPLAYERS
/* <ee120> ../cstrike/dlls/maprules.cpp:223 */
class CGameText: public CRulePointEntity
{
public:
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
@ -187,15 +202,15 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY inline BOOL MessageToAll(void)
inline BOOL MessageToAll(void)
{
return (pev->spawnflags & SF_ENVTEXT_ALLPLAYERS) == SF_ENVTEXT_ALLPLAYERS;
}
NOBODY inline void MessageSet(const char *pMessage)
inline void MessageSet(const char *pMessage)
{
pev->message = ALLOC_STRING(pMessage);
}
NOBODY inline const char *MessageGet(void)
inline const char *MessageGet(void)
{
return STRING(pev->message);
}
@ -208,25 +223,32 @@ private:
};/* size: 196, cachelines: 4, members: 3 */
/* <ee16d> ../cstrike/dlls/maprules.cpp:352 */
// CGameTeamMaster / game_team_master -- "Masters" like multisource, but based on the team of the activator
// Only allows mastered entity to fire if the team matches my team
// team index (pulled from server team list "mp_teamlist"
// Flag: Remove on Fire
// Flag: Any team until set? -- Any team can use this until the team is set (otherwise no teams can use it)
/* <ee16d> ../cstrike/dlls/maprules.cpp:352 */
class CGameTeamMaster: public CRulePointEntity
{
public:
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int ObjectCaps(void)
virtual void KeyValue(KeyValueData *pkvd);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
NOBODY virtual BOOL IsTriggered(CBaseEntity *pActivator);
NOBODY virtual const char *TeamID(void);
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual BOOL IsTriggered(CBaseEntity *pActivator);
virtual const char *TeamID(void);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void KeyValue_(KeyValueData *pkvd);
int ObjectCaps_(void)
{
return CRulePointEntity::ObjectCaps() | FCAP_MASTER;
return (CRulePointEntity::ObjectCaps() | FCAP_MASTER);
}
BOOL IsTriggered_(CBaseEntity *pActivator);
const char *TeamID_(void);
@ -253,11 +275,15 @@ public:
};/* size: 164, cachelines: 3, members: 3 */
/* <ee1bb> ../cstrike/dlls/maprules.cpp:464 */
// CGameTeamSet / game_team_set -- Changes the team of the entity it targets to the activator's team
// Flag: Fire once
// Flag: Clear team -- Sets the team to "NONE" instead of activator
/* <ee1bb> ../cstrike/dlls/maprules.cpp:464 */
class CGameTeamSet: public CRulePointEntity
{
public:
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
@ -265,6 +291,7 @@ public:
#endif // HOOK_GAMEDLL
public:
inline BOOL RemoveOnFire(void)
{
return (pev->spawnflags & SF_TEAMSET_FIREONCE) == SF_TEAMSET_FIREONCE;
@ -276,14 +303,17 @@ public:
};/* size: 156, cachelines: 3, members: 1 */
/* <ee229> ../cstrike/dlls/maprules.cpp:502 */
// CGamePlayerZone / game_player_zone -- players in the zone fire my target when I'm fired
// Needs master?
/* <ee229> ../cstrike/dlls/maprules.cpp:502 */
class CGamePlayerZone: public CRuleBrushEntity
{
public:
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
@ -303,13 +333,16 @@ private:
string_t m_iszInCount;
string_t m_iszOutCount;
};/* size: 172, cachelines: 3, members: 6 */
};/* size: 172, cachelines: 3, members: 6 */
/* <ee277> ../cstrike/dlls/maprules.cpp:619 */
// CGamePlayerHurt / game_player_hurt -- Damages the player who fires it
// Flag: Fire once
/* <ee277> ../cstrike/dlls/maprules.cpp:619 */
class CGamePlayerHurt: public CRulePointEntity
{
public:
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
@ -325,12 +358,16 @@ public:
};/* size: 156, cachelines: 3, members: 1 */
/* <ee2c5> ../cstrike/dlls/maprules.cpp:662 */
// CGameCounter / game_counter -- Counts events and fires target
// Flag: Fire once
// Flag: Reset on Fire
/* <ee2c5> ../cstrike/dlls/maprules.cpp:662 */
class CGameCounter: public CRulePointEntity
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Spawn(void);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
@ -385,11 +422,14 @@ private:
};/* size: 156, cachelines: 3, members: 1 */
// CGameCounterSet / game_counter_set -- Sets the counter's value
// Flag: Fire once
/* <ee313> ../cstrike/dlls/maprules.cpp:738 */
class CGameCounterSet: public CRulePointEntity
{
public:
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
@ -405,13 +445,16 @@ public:
};/* size: 156, cachelines: 3, members: 1 */
/* <ee361> ../cstrike/dlls/maprules.cpp:771 */
// CGamePlayerEquip / game_playerequip -- Sets the default player equipment
// Flag: USE Only
/* <ee361> ../cstrike/dlls/maprules.cpp:771 */
class CGamePlayerEquip: public CRulePointEntity
{
public:
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual void Touch(CBaseEntity *pOther);
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void KeyValue(KeyValueData *pkvd);
virtual void Touch(CBaseEntity *pOther);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
@ -436,11 +479,16 @@ public:
};/* size: 412, cachelines: 7, members: 3 */
/* <ee3af> ../cstrike/dlls/maprules.cpp:867 */
// CGamePlayerTeam / game_player_team -- Changes the team of the player who fired it
// Flag: Fire once
// Flag: Kill Player
// Flag: Gib Player
/* <ee3af> ../cstrike/dlls/maprules.cpp:867 */
class CGamePlayerTeam: public CRulePointEntity
{
public:
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
@ -465,4 +513,17 @@ private:
};/* size: 156, cachelines: 3, members: 1 */
// linked objects
C_DLLEXPORT void game_score(entvars_t *pev);
C_DLLEXPORT void game_end(entvars_t *pev);
C_DLLEXPORT void game_text(entvars_t *pev);
C_DLLEXPORT void game_team_master(entvars_t *pev);
C_DLLEXPORT void game_team_set(entvars_t *pev);
C_DLLEXPORT void game_zone_player(entvars_t *pev);
C_DLLEXPORT void game_player_hurt(entvars_t *pev);
C_DLLEXPORT void game_counter(entvars_t *pev);
C_DLLEXPORT void game_counter_set(entvars_t *pev);
C_DLLEXPORT void game_player_equip(entvars_t *pev);
C_DLLEXPORT void game_player_team(entvars_t *pev);
#endif // MAPRULES_H

View File

@ -36,6 +36,7 @@ typedef struct
{
int event;
char *options;
} MonsterEvent_t;
#define EVENT_SPECIFIC 0

View File

@ -134,7 +134,7 @@ public:
public:
static void SpawnHeadGib(entvars_t *pevVictim);
static void SpawnRandomGibs(entvars_t *pevVictim, int cGibs, int human);
NOBODY static void SpawnStickyGibs(entvars_t *pevVictim, Vector vecOrigin, int cGibs);
NOXREF static void SpawnStickyGibs(entvars_t *pevVictim, Vector vecOrigin, int cGibs);
public:
int m_bloodColor;
int m_cBloodDecals;

View File

@ -17,7 +17,7 @@ TYPEDESCRIPTION CFuncMortarField::m_SaveData[] =
#else
TYPEDESCRIPTION (*CFuncMortarField::pm_SaveData)[6];
TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CFuncMortarField, m_SaveData)[6];
#endif // HOOK_GAMEDLL

View File

@ -63,12 +63,14 @@ void CBaseMonster::MakeIdealYaw(Vector vecTarget)
}
/* <fc5a6> ../cstrike/dlls/mpstubb.cpp:49 */
NOBODY void CBaseMonster::CorpseFallThink(void)
NOXREF void CBaseMonster::CorpseFallThink(void)
{
if (pev->flags & FL_ONGROUND)
{
SetThink(NULL);
SetSequenceBox();
// link into world.
UTIL_SetOrigin(pev, pev->origin);
}
else
@ -117,50 +119,165 @@ void CBaseMonster::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
}
/* <fc07d> ../cstrike/dlls/mpstubb.cpp:104 */
NOBODY int CBaseMonster::__MAKE_VHOOK(IRelationship)(CBaseEntity *pTarget)
int CBaseMonster::__MAKE_VHOOK(IRelationship)(CBaseEntity *pTarget)
{
// {
// int const iEnemy; // 106
// }
static int const iEnemy[14][14] =
{
// NONE MACH PLYR HPASS HMIL AMIL APASS AMONST APREY APRED INSECT PLRALY PBWPN ABWPN
{ R_NO, R_NO, R_NO, R_NO, R_NO, R_NO, R_NO, R_NO, R_NO, R_NO, R_NO, R_NO, R_NO, R_NO }, // NONE
{ R_NO, R_NO, R_DL, R_DL, R_NO, R_DL, R_DL, R_DL, R_DL, R_DL, R_NO, R_DL, R_DL, R_DL }, // MACHINE
{ R_NO, R_DL, R_NO, R_NO, R_DL, R_DL, R_DL, R_DL, R_DL, R_DL, R_NO, R_NO, R_DL, R_DL }, // PLAYER
{ R_NO, R_NO, R_AL, R_AL, R_HT, R_FR, R_NO, R_HT, R_DL, R_FR, R_NO, R_AL, R_NO, R_NO }, // HUMANPASSIVE
{ R_NO, R_NO, R_HT, R_DL, R_NO, R_HT, R_DL, R_DL, R_DL, R_DL, R_NO, R_HT, R_NO, R_NO }, // HUMANMILITAR
{ R_NO, R_DL, R_HT, R_DL, R_HT, R_NO, R_NO, R_NO, R_NO, R_NO, R_NO, R_DL, R_NO, R_NO }, // ALIENMILITAR
{ R_NO, R_NO, R_NO, R_NO, R_NO, R_NO, R_NO, R_NO, R_NO, R_NO, R_NO, R_NO, R_NO, R_NO }, // ALIENPASSIVE
{ R_NO, R_DL, R_DL, R_DL, R_DL, R_NO, R_NO, R_NO, R_NO, R_NO, R_NO, R_DL, R_NO, R_NO }, // ALIENMONSTER
{ R_NO, R_NO, R_DL, R_DL, R_DL, R_NO, R_NO, R_NO, R_NO, R_FR, R_NO, R_DL, R_NO, R_NO }, // ALIENPREY
{ R_NO, R_NO, R_DL, R_DL, R_DL, R_NO, R_NO, R_NO, R_HT, R_DL, R_NO, R_DL, R_NO, R_NO }, // ALIENPREDATO
{ R_FR, R_FR, R_FR, R_FR, R_FR, R_NO, R_FR, R_FR, R_FR, R_FR, R_NO, R_FR, R_NO, R_NO }, // INSECT
{ R_NO, R_DL, R_AL, R_AL, R_DL, R_DL, R_DL, R_DL, R_DL, R_DL, R_NO, R_NO, R_NO, R_NO }, // PLAYERALLY
{ R_NO, R_NO, R_DL, R_DL, R_DL, R_DL, R_DL, R_DL, R_DL, R_DL, R_NO, R_DL, R_NO, R_DL }, // PBIOWEAPON
{ R_NO, R_NO, R_DL, R_DL, R_DL, R_AL, R_NO, R_DL, R_DL, R_NO, R_NO, R_DL, R_DL, R_NO } // ABIOWEAPON
};
return iEnemy[ Classify() ][ pTarget->Classify() ];
}
// Look - Base class monster function to find enemies or
// food by sight. iDistance is distance (in units) that the
// monster can see.
//
// Sets the sight bits of the m_afConditions mask to indicate
// which types of entities were sighted.
// Function also sets the Looker's m_pLink
// to the head of a link list that contains all visible ents.
// (linked via each ent's m_pLink field)
/* <fc0e4> ../cstrike/dlls/mpstubb.cpp:140 */
NOBODY void CBaseMonster::__MAKE_VHOOK(Look)(int iDistance)
void CBaseMonster::__MAKE_VHOOK(Look)(int iDistance)
{
// {
// int iSighted; // 142
// class CBaseEntity *pSightEnt; // 149
// class CBaseEntity *pList; // 151
// Vector delta; // 153
// int count; // 156
// ClearConditions(CBaseMonster *const this,
// int iConditions); // 145
// operator+(const Vector *const this,
// const Vector &v); // 156
// operator-(const Vector *const this,
// const Vector &v); // 156
// {
// int i; // 157
// }
// SetConditions(CBaseMonster *const this,
// int iConditions); // 207
// }
int iSighted = 0;
// DON'T let visibility information from last frame sit around!
ClearConditions(bits_COND_SEE_HATE | bits_COND_SEE_DISLIKE | bits_COND_SEE_ENEMY | bits_COND_SEE_FEAR | bits_COND_SEE_NEMESIS | bits_COND_SEE_CLIENT);
m_pLink = NULL;
// the current visible entity that we're dealing with
CBaseEntity *pSightEnt = NULL;
CBaseEntity *pList[100];
Vector delta = Vector(iDistance, iDistance, iDistance);
// Find only monsters/clients in box, NOT limited to PVS
int count = UTIL_EntitiesInBox(pList, ARRAYSIZE(pList), pev->origin - delta, pev->origin + delta, (FL_CLIENT | FL_MONSTER));
for (int i = 0; i < count; i++)
{
pSightEnt = pList[i];
if (pSightEnt != this && pSightEnt->pev->health > 0)
{
// the looker will want to consider this entity
// don't check anything else about an entity that can't be seen, or an entity that you don't care about.
if (IRelationship(pSightEnt) != R_NO && FInViewCone(pSightEnt) && !(pSightEnt->pev->flags & FL_NOTARGET) && FVisible(pSightEnt))
{
if (pSightEnt->IsPlayer())
{
// if we see a client, remember that (mostly for scripted AI)
iSighted |= bits_COND_SEE_CLIENT;
}
pSightEnt->m_pLink = m_pLink;
m_pLink = pSightEnt;
if (pSightEnt == m_hEnemy)
{
// we know this ent is visible, so if it also happens to be our enemy, store that now.
iSighted |= bits_COND_SEE_ENEMY;
}
// don't add the Enemy's relationship to the conditions. We only want to worry about conditions when
// we see monsters other than the Enemy.
switch (IRelationship (pSightEnt))
{
case R_NM:
iSighted |= bits_COND_SEE_NEMESIS;
break;
case R_HT:
iSighted |= bits_COND_SEE_HATE;
break;
case R_DL:
iSighted |= bits_COND_SEE_DISLIKE;
break;
case R_FR:
iSighted |= bits_COND_SEE_FEAR;
break;
case R_AL:
break;
default:
ALERT(at_aiconsole, "%s can't assess %s\n", STRING(pev->classname), STRING(pSightEnt->pev->classname));
break;
}
}
}
}
SetConditions(iSighted);
}
// BestVisibleEnemy - this functions searches the link
// list whose head is the caller's m_pLink field, and returns
// a pointer to the enemy entity in that list that is nearest the
// caller.
//
// !!!UNDONE - currently, this only returns the closest enemy.
// we'll want to consider distance, relationship, attack types, back turned, etc.
/* <fc317> ../cstrike/dlls/mpstubb.cpp:220 */
NOBODY CBaseEntity *CBaseMonster::__MAKE_VHOOK(BestVisibleEnemy)(void)
CBaseEntity *CBaseMonster::__MAKE_VHOOK(BestVisibleEnemy)(void)
{
// {
// class CBaseEntity *pReturn; // 222
// class CBaseEntity *pNextEnt; // 223
// int iNearest; // 224
// int iDist; // 225
// int iBestRelationship; // 226
// operator-(const Vector *const this,
// const Vector &v); // 243
// Length(const Vector *const this); // 243
// operator-(const Vector *const this,
// const Vector &v); // 251
// Length(const Vector *const this); // 251
// }
CBaseEntity *pReturn;
CBaseEntity *pNextEnt;
int iNearest;
int iDist;
int iBestRelationship;
// so first visible entity will become the closest.
iNearest = 8192;
pNextEnt = m_pLink;
pReturn = NULL;
iBestRelationship = R_NO;
while (pNextEnt != NULL)
{
if (pNextEnt->IsAlive())
{
if (IRelationship(pNextEnt) > iBestRelationship)
{
// this entity is disliked MORE than the entity that we
// currently think is the best visible enemy. No need to do
// a distance check, just get mad at this one for now.
iBestRelationship = IRelationship(pNextEnt);
iNearest = (pNextEnt->pev->origin - pev->origin).Length();
pReturn = pNextEnt;
}
else if (IRelationship(pNextEnt) == iBestRelationship)
{
// this entity is disliked just as much as the entity that
// we currently think is the best visible enemy, so we only
// get mad at it if it is closer.
iDist = (pNextEnt->pev->origin - pev->origin).Length();
if (iDist <= iNearest)
{
iNearest = iDist;
iBestRelationship = IRelationship(pNextEnt);
pReturn = pNextEnt;
}
}
}
pNextEnt = pNextEnt->m_pLink;
}
return pReturn;
}

View File

@ -759,7 +759,7 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(GiveC4)(void)
for (int i = 1; i <= gpGlobals->maxClients; i++)
{
CBasePlayer *player = (CBasePlayer *)UTIL_PlayerByIndex(i);
if (!player || FNullEnt(player->edict()))
continue;
@ -1582,7 +1582,7 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(RestartRound)(void)
}
g_pGameRules->m_bBombDropped = FALSE;
MESSAGE_BEGIN(MSG_SPEC, gmsgHLTV);
WRITE_BYTE(0);
WRITE_BYTE(100 | DRC_FLAG_FACEPLAYER);
@ -1816,7 +1816,7 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(RestartRound)(void)
if (pPlayer->pev->flags == FL_DORMANT)
continue;
CBasePlayer *player = GetClassPtr((CBasePlayer *)pPlayer->pev);
player->m_iNumSpawns = 0;
@ -2293,7 +2293,7 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(Think)(void)
ALERT(at_console, "Changing maps...one team has won the specified number of rounds\n");
GoToIntermission();
return;
return;
}
}
}
@ -2317,7 +2317,7 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(Think)(void)
UTIL_LogPrintf("World triggered \"Round_Start\"\n");
m_bFreezePeriod = FALSE;
switch (RANDOM_LONG(0, 3))
{
case 0:
@ -2353,7 +2353,7 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(Think)(void)
m_iRoundTimeSecs = m_iRoundTime;
m_fRoundCount = gpGlobals->time;
bCTPlayed = false;
bTPlayed = false;
@ -2763,7 +2763,7 @@ void CHalfLifeMultiplay::CareerRestart(void)
{
m_fTeamCount = gpGlobals->time + 1.0f;
}
// for reset everything
m_bCompleteReset = true;
m_fCareerRoundMenuTime = 0;
@ -2936,7 +2936,7 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(InitHUD)(CBasePlayer *pl)
{
// FIXME: Probably don't need to cast this just to read m_iDeaths
CBasePlayer *plr = reinterpret_cast<CBasePlayer *>(UTIL_PlayerByIndex(i));
if (plr != NULL)
{
MESSAGE_BEGIN(MSG_ONE, gmsgScoreInfo, NULL, pl->edict());
@ -3042,7 +3042,7 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(ClientDisconnected)(edict_t *pClient)
if (pClient != NULL)
{
CBasePlayer *pPlayer = reinterpret_cast<CBasePlayer *>(CBaseEntity::Instance(pClient));
if (pPlayer != NULL)
{
pPlayer->has_disconnected = true;
@ -3312,7 +3312,7 @@ int CHalfLifeMultiplay::__MAKE_VHOOK(IPointsForKill)(CBasePlayer *pAttacker, CBa
void CHalfLifeMultiplay::__MAKE_VHOOK(PlayerKilled)(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor)
{
DeathNotice(pVictim, pKiller, pInflictor);
pVictim->m_afPhysicsFlags &= ~PFLAG_ONTRAIN;
pVictim->m_iDeaths++;
pVictim->m_bNotKilled = false;
@ -3383,7 +3383,7 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(PlayerKilled)(CBasePlayer *pVictim, entvar
{
// if a player dies in a deathmatch game and the killer is a client, award the killer some points
pKiller->frags += IPointsForKill(peKiller, pVictim);
if (pVictim->m_bIsVIP)
{
killer->HintMessage("#Hint_reward_for_killing_vip", TRUE);
@ -3439,7 +3439,7 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(PlayerKilled)(CBasePlayer *pVictim, entvar
if (ep && ep->Classify() == CLASS_PLAYER)
{
CBasePlayer *PK = reinterpret_cast<CBasePlayer *>(ep);
MESSAGE_BEGIN(MSG_ALL, gmsgScoreInfo);
WRITE_BYTE(ENTINDEX(PK->edict()));
WRITE_SHORT((int)PK->pev->frags);
@ -3470,14 +3470,14 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(DeathNotice)(CBasePlayer *pVictim, entvars
if (pKiller->flags & FL_CLIENT)
{
killer_index = ENTINDEX(ENT(pKiller));
if (pevInflictor)
{
if (pevInflictor == pKiller)
{
// If the inflictor is the killer, then it must be their current weapon doing the damage
CBasePlayer *pPlayer = reinterpret_cast<CBasePlayer*>(CBaseEntity::Instance(pKiller));
if (pPlayer && pPlayer->m_pActiveItem)
{
killer_weapon_name = pPlayer->m_pActiveItem->pszName();
@ -3523,7 +3523,7 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(DeathNotice)(CBasePlayer *pVictim, entvars
else if (!Q_strcmp(killer_weapon_name, "gauss"))
killer_weapon_name = tau;
if (pVictim->pev == pKiller)
{
// killed self
@ -3614,7 +3614,7 @@ float CHalfLifeMultiplay::__MAKE_VHOOK(FlWeaponRespawnTime)(CBasePlayerItem *pWe
return gpGlobals->time + WEAPON_RESPAWN_TIME;
}
// FlWeaponRespawnTime - Returns 0 if the weapon can respawn
// FlWeaponRespawnTime - Returns 0 if the weapon can respawn
// now, otherwise it returns the time at which it can try
// to spawn again.
@ -3895,7 +3895,7 @@ void DestroyMapCycle(mapcycle_t *cycle)
delete p;
p = n;
}
delete cycle->items;
}
@ -4065,16 +4065,16 @@ int ReloadMapCycleFile(char *filename, mapcycle_t *cycle)
if (s && s[0] != '\0')
{
item->minplayers = Q_atoi(s);
item->minplayers = _max(item->minplayers, 0);
item->minplayers = _min(item->minplayers, gpGlobals->maxClients);
item->minplayers = Q_max(item->minplayers, 0);
item->minplayers = Q_min(item->minplayers, gpGlobals->maxClients);
}
s = GET_KEY_VALUE(szBuffer, "maxplayers");
if (s && s[0] != '\0')
{
item->maxplayers = Q_atoi(s);
item->maxplayers = _max(item->maxplayers, 0);
item->maxplayers = _min(item->maxplayers, gpGlobals->maxClients);
item->maxplayers = Q_max(item->maxplayers, 0);
item->maxplayers = Q_min(item->maxplayers, gpGlobals->maxClients);
}
// Remove keys
@ -4157,7 +4157,7 @@ void ExtractCommandString(char *s, char *szCommand)
// work without stomping on each other
char *o;
if (*s == '\\')
s++;

View File

@ -25,7 +25,7 @@ CBaseEntity *CBasePlayer::Observer_IsValidTarget(int iPlayerIndex, bool bSameTea
return NULL;
CBaseEntity *pEnt = UTIL_PlayerByIndex(iPlayerIndex);
// Don't spec observers or players who haven't picked a class yet
if (!pEnt || pEnt == this || pEnt->has_disconnected || ((CBasePlayer *)pEnt)->IsObserver() || (pEnt->pev->effects & EF_NODRAW) || ((CBasePlayer *)pEnt)->m_iTeam == UNASSIGNED || (bSameTeam && ((CBasePlayer *)pEnt)->m_iTeam != m_iTeam))
return NULL;
@ -167,7 +167,7 @@ void CBasePlayer::Observer_FindNextPlayer(bool bReverse, const char *name)
if (!name)
break;
pPlayer = (CBasePlayer *)UTIL_PlayerByIndex( ENTINDEX(m_hObserverTarget->edict()) );
pPlayer = (CBasePlayer *)UTIL_PlayerByIndex(ENTINDEX(m_hObserverTarget->edict()));
if (!Q_strcmp(name, STRING(pPlayer->pev->netname)))
break;
@ -186,7 +186,7 @@ void CBasePlayer::Observer_FindNextPlayer(bool bReverse, const char *name)
MESSAGE_BEGIN(MSG_ONE, gmsgSpecHealth2, NULL, pev);
WRITE_BYTE((int)m_hObserverTarget->pev->health);
WRITE_BYTE( ENTINDEX(m_hObserverTarget->edict()) );
WRITE_BYTE(ENTINDEX(m_hObserverTarget->edict()));
MESSAGE_END();
// Store the target in pev so the physics DLL can get to it
@ -489,7 +489,7 @@ void CBasePlayer::Observer_SetMode(int iMode)
if (pev->iuser1 == OBS_ROAMING)
pev->iuser2 = 0;
else
pev->iuser2 = ENTINDEX( m_hObserverTarget->edict() );
pev->iuser2 = ENTINDEX(m_hObserverTarget->edict());
// clear second target from death cam
pev->iuser3 = 0;

View File

@ -19,10 +19,10 @@ TYPEDESCRIPTION CPathTrack::m_SaveData[] =
DEFINE_FIELD(CPathTrack, m_altName, FIELD_STRING),
};
#else // HOOK_GAMEDLL
TYPEDESCRIPTION (*CPathCorner::pm_SaveData)[1];
TYPEDESCRIPTION (*CPathTrack::pm_SaveData)[5];
#else
TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CPathCorner, m_SaveData)[1];
TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CPathTrack, m_SaveData)[5];
#endif // HOOK_GAMEDLL
@ -33,19 +33,21 @@ LINK_ENTITY_TO_CLASS(path_corner, CPathCorner);
IMPLEMENT_SAVERESTORE(CPathCorner, CPointEntity);
/* <122697> ../cstrike/dlls/pathcorner.cpp:54 */
NOBODY void CPathCorner::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
void CPathCorner::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{
// FStrEq(const char *sz1,
// const char *sz2); // 56
// KeyValue(CBaseEntity *const this,
// KeyValueData *pkvd); // 62
// KeyValue(CPathCorner *const this,
// KeyValueData *pkvd); // 54
if (FStrEq(pkvd->szKeyName, "wait"))
{
m_flWait = Q_atof(pkvd->szValue);
pkvd->fHandled = TRUE;
}
else
CPointEntity::KeyValue(pkvd);
}
/* <122325> ../cstrike/dlls/pathcorner.cpp:66 */
NOBODY void CPathCorner::__MAKE_VHOOK(Spawn)(void)
void CPathCorner::__MAKE_VHOOK(Spawn)(void)
{
assert(("path_corner without a targetname", !FStringNull(pev->targetname)));
}
/* <12256a> ../cstrike/dlls/pathcorner.cpp:80 */
@ -55,198 +57,326 @@ IMPLEMENT_SAVERESTORE(CPathTrack, CBaseEntity);
LINK_ENTITY_TO_CLASS(path_track, CPathTrack);
/* <122602> ../cstrike/dlls/pathcorner.cpp:86 */
NOBODY void CPathTrack::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
void CPathTrack::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{
// FStrEq(const char *sz1,
// const char *sz2); // 88
// KeyValue(CBaseEntity *const this,
// KeyValueData *pkvd); // 94
// KeyValue(CPathTrack *const this,
// KeyValueData *pkvd); // 86
if (FStrEq(pkvd->szKeyName, "altpath"))
{
m_altName = ALLOC_STRING(pkvd->szValue);
pkvd->fHandled = TRUE;
}
else
CPointEntity::KeyValue(pkvd);
}
/* <122433> ../cstrike/dlls/pathcorner.cpp:97 */
NOBODY void CPathTrack::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
void CPathTrack::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
// {
// int on; // 99
// }
// Use(CPathTrack *const this,
// class CBaseEntity *pActivator,
// class CBaseEntity *pCaller,
// USE_TYPE useType,
// float value); // 97
int on;
// Use toggles between two paths
if (m_paltpath)
{
on = !(pev->spawnflags & SF_PATH_ALTERNATE);
if (ShouldToggle(useType, on))
{
if (on)
pev->spawnflags |= SF_PATH_ALTERNATE;
else
pev->spawnflags &= ~SF_PATH_ALTERNATE;
}
}
else // Use toggles between enabled/disabled
{
on = !(pev->spawnflags & SF_PATH_DISABLED);
if (ShouldToggle(useType, on))
{
if (on)
pev->spawnflags |= SF_PATH_DISABLED;
else
pev->spawnflags &= ~SF_PATH_DISABLED;
}
}
}
/* <122a12> ../cstrike/dlls/pathcorner.cpp:128 */
NOBODY void CPathTrack::Link(void)
void CPathTrack::Link(void)
{
// {
// edict_t *pentTarget; // 130
// FIND_ENTITY_BY_TARGETNAME(edict_t *entStart,
// const char *pszName); // 151
// FNullEnt(const edict_t *pent); // 152
// Instance(edict_t *pent); // 154
// SetPrevious(CPathTrack *const this,
// class CPathTrack *pprev); // 158
// FIND_ENTITY_BY_TARGETNAME(edict_t *entStart,
// const char *pszName); // 134
// FNullEnt(const edict_t *pent); // 135
// Instance(edict_t *pent); // 137
// SetPrevious(CPathTrack *const this,
// class CPathTrack *pprev); // 141
// }
edict_t *pentTarget;
if (!FStringNull(pev->target))
{
pentTarget = FIND_ENTITY_BY_TARGETNAME(NULL, STRING(pev->target));
if (!FNullEnt(pentTarget))
{
m_pnext = CPathTrack::Instance(pentTarget);
// If no next pointer, this is the end of a path
if (m_pnext != NULL)
{
m_pnext->SetPrevious(this);
}
}
else
ALERT(at_console, "Dead end link %s\n", STRING(pev->target));
}
// Find "alternate" path
if (!FStringNull(m_altName))
{
pentTarget = FIND_ENTITY_BY_TARGETNAME(NULL, STRING(m_altName));
if (!FNullEnt(pentTarget))
{
m_paltpath = CPathTrack::Instance(pentTarget);
// If no next pointer, this is the end of a path
if (m_paltpath != NULL)
{
m_paltpath->SetPrevious(this);
}
}
}
}
/* <12239a> ../cstrike/dlls/pathcorner.cpp:165 */
NOBODY void CPathTrack::__MAKE_VHOOK(Spawn)(void)
void CPathTrack::__MAKE_VHOOK(Spawn)(void)
{
// Vector(Vector::Spawn(// float X,
// float Y,
// float Z); // 168
// Vector(Vector *const this,
// float X,
// float Y,
// float Z); // 168
pev->solid = SOLID_TRIGGER;
UTIL_SetSize(pev, Vector(-8, -8, -8), Vector(8, 8, 8));
m_pnext = NULL;
m_pprevious = NULL;
}
/* <122c76> ../cstrike/dlls/pathcorner.cpp:180 */
NOBODY void CPathTrack::__MAKE_VHOOK(Activate)(void)
void CPathTrack::__MAKE_VHOOK(Activate)(void)
{
// Link to next, and back-link
if (!FStringNull(pev->targetname))
{
Link();
}
}
/* <122c9c> ../cstrike/dlls/pathcorner.cpp:186 */
NOBODY CPathTrack *CPathTrack::ValidPath(CPathTrack *ppath, int testFlag)
CPathTrack *CPathTrack::ValidPath(CPathTrack *ppath, int testFlag)
{
if (!ppath)
return NULL;
if (testFlag && (ppath->pev->spawnflags & SF_PATH_DISABLED))
return NULL;
return ppath;
}
/* <122745> ../cstrike/dlls/pathcorner.cpp:198 */
NOBODY void CPathTrack::Project(CPathTrack *pstart, CPathTrack *pend, Vector *origin, float dist)
void CPathTrack::Project(CPathTrack *pstart, CPathTrack *pend, Vector *origin, float dist)
{
// {
// Vector dir; // 202
// operator-(const Vector *const this,
// const Vector &v); // 202
// Normalize(const Vector *const this); // 203
// operator*(const Vector *const this,
// float fl); // 204
// operator+(const Vector *const this,
// const Vector &v); // 204
// }
if (pstart && pend)
{
Vector dir = (pend->pev->origin - pstart->pev->origin);
dir = dir.Normalize();
*origin = pend->pev->origin + dir * dist;
}
}
/* <122d0f> ../cstrike/dlls/pathcorner.cpp:208 */
NOBODY CPathTrack *CPathTrack::GetNext(void)
CPathTrack *CPathTrack::GetNext(void)
{
if (m_paltpath && (pev->spawnflags & SF_PATH_ALTERNATE) && !(pev->spawnflags & SF_PATH_ALTREVERSE))
{
return m_paltpath;
}
return m_pnext;
}
/* <122d30> ../cstrike/dlls/pathcorner.cpp:218 */
NOBODY CPathTrack *CPathTrack::GetPrevious(void)
CPathTrack *CPathTrack::GetPrevious(void)
{
if (m_paltpath && (pev->spawnflags & SF_PATH_ALTERNATE) && (pev->spawnflags & SF_PATH_ALTREVERSE))
{
return m_paltpath;
}
return m_pprevious;
}
/* <122d51> ../cstrike/dlls/pathcorner.cpp:228 */
NOBODY void CPathTrack::SetPrevious(CPathTrack *pprev)
void CPathTrack::SetPrevious(CPathTrack *pprev)
{
// FStrEq(const char *sz1,
// const char *sz2); // 231
// Only set previous if this isn't my alternate path
if (pprev && !FStrEq(STRING(pprev->pev->targetname), STRING(m_altName)))
{
m_pprevious = pprev;
}
}
// Assumes this is ALWAYS enabled
/* <122d95> ../cstrike/dlls/pathcorner.cpp:237 */
NOBODY CPathTrack *CPathTrack::LookAhead(Vector *origin, float dist, int move)
CPathTrack *CPathTrack::LookAhead(Vector *origin, float dist, int move)
{
// {
// class CPathTrack *pcurrent; // 239
// float originalDist; // 240
// Vector currentPos; // 243
// Vector(Vector *const this,
// const Vector &v); // 243
// {
// Vector dir; // 291
// float length; // 292
// GetNext(CPathTrack *const this); // 285
// ValidPath(CPathTrack *const this,
// class CPathTrack *ppath,
// int testFlag); // 285
// GetNext(CPathTrack *const this); // 291
// operator-(const Vector *const this,
// const Vector &v); // 291
// Length(const Vector *const this); // 292
// GetNext(CPathTrack *const this); // 293
// GetNext(CPathTrack *const this); // 293
// ValidPath(CPathTrack *const this,
// class CPathTrack *ppath,
// int testFlag); // 293
// Project(CPathTrack *const this,
// class CPathTrack *pstart,
// class CPathTrack *pend,
// Vector *origin,
// float dist); // 288
// GetNext(CPathTrack *const this); // 307
// GetNext(CPathTrack *const this); // 308
// operator*(const Vector *const this,
// float fl); // 301
// operator+(const Vector *const this,
// const Vector &v); // 301
// GetPrevious(CPathTrack *const this); // 288
// }
// {
// Vector dir; // 250
// float length; // 251
// operator-(const Vector *const this,
// const Vector &v); // 250
// Length(const Vector *const this); // 251
// GetPrevious(CPathTrack *const this); // 254
// ValidPath(CPathTrack *const this,
// class CPathTrack *ppath,
// int testFlag); // 254
// GetPrevious(CPathTrack *const this); // 260
// GetPrevious(CPathTrack *const this); // 275
// GetPrevious(CPathTrack *const this); // 272
// ValidPath(CPathTrack *const this,
// class CPathTrack *ppath,
// int testFlag); // 272
// operator*(const Vector *const this,
// float fl); // 264
// operator+(const Vector *const this,
// const Vector &v); // 264
// GetNext(CPathTrack *const this); // 257
// Project(CPathTrack *const this,
// class CPathTrack *pstart,
// class CPathTrack *pend,
// Vector *origin,
// float dist); // 257
// }
// }
CPathTrack *pcurrent;
float originalDist = dist;
pcurrent = this;
Vector currentPos = *origin;
// Travelling backwards through path
if (dist < 0)
{
dist = -dist;
while (dist > 0)
{
Vector dir = pcurrent->pev->origin - currentPos;
float_precision length = dir.Length();
if (!length)
{
// If there is no previous node, or it's disabled, return now.
if (!ValidPath(pcurrent->GetPrevious(), move))
{
if (!move)
{
Project(pcurrent->GetNext(), pcurrent, origin, dist);
}
return NULL;
}
pcurrent = pcurrent->GetPrevious();
}
// enough left in this path to move
else if (length > dist)
{
*origin = currentPos + (dir * ((float)(dist / length)));
return pcurrent;
}
else
{
dist -= length;
currentPos = pcurrent->pev->origin;
*origin = currentPos;
// If there is no previous node, or it's disabled, return now.
if (!ValidPath(pcurrent->GetPrevious(), move))
{
return NULL;
}
pcurrent = pcurrent->GetPrevious();
}
}
*origin = currentPos;
return pcurrent;
}
else
{
// #96 line
while (dist > 0)
{
// If there is no next node, or it's disabled, return now.
if (!ValidPath(pcurrent->GetNext(), move))
{
if (!move)
{
Project(pcurrent->GetPrevious(), pcurrent, origin, dist);
}
return NULL;
}
Vector dir = pcurrent->GetNext()->pev->origin - currentPos;
float_precision length = dir.Length();
if (!length && !ValidPath(pcurrent->GetNext()->GetNext(), move))
{
// HACK -- up against a dead end
if (dist == originalDist)
return NULL;
return pcurrent;
}
// enough left in this path to move
if (length > dist)
{
*origin = currentPos + (dir * ((float)(dist / length)));
return pcurrent;
}
else
{
dist -= length;
currentPos = pcurrent->GetNext()->pev->origin;
pcurrent = pcurrent->GetNext();
*origin = currentPos;
}
}
*origin = currentPos;
}
return pcurrent;
}
// Assumes this is ALWAYS enabled
/* <123220> ../cstrike/dlls/pathcorner.cpp:320 */
NOBODY CPathTrack *CPathTrack::Nearest(Vector origin)
CPathTrack *CPathTrack::Nearest(Vector origin)
{
// {
// int deadCount; // 322
// float minDist; // 323
// float dist; // 323
// Vector delta; // 324
// class CPathTrack *ppath; // 325
// class CPathTrack *pnearest; // 325
// operator-(const Vector *const this,
// const Vector &v); // 328
// Length(const Vector *const this); // 330
// GetNext(CPathTrack *const this); // 332
// GetNext(CPathTrack *const this); // 352
// operator-(const Vector *const this,
// const Vector &v); // 344
// Length(const Vector *const this); // 346
// }
int deadCount;
float minDist, dist;
Vector delta;
CPathTrack *ppath, *pnearest;
delta = origin - pev->origin;
delta.z = 0;
minDist = delta.Length();
pnearest = this;
ppath = GetNext();
// Hey, I could use the old 2 racing pointers solution to this, but I'm lazy :)
deadCount = 0;
while (ppath != NULL && ppath != this)
{
deadCount++;
if (deadCount > 9999)
{
ALERT(at_error, "Bad sequence of path_tracks from %s", STRING(pev->targetname));
return NULL;
}
delta = origin - ppath->pev->origin;
delta.z = 0;
dist = delta.Length();
if (dist < minDist)
{
minDist = dist;
pnearest = ppath;
}
ppath = ppath->GetNext();
}
return pnearest;
}
/* <123375> ../cstrike/dlls/pathcorner.cpp:358 */
NOBODY CPathTrack *CPathTrack::Instance(edict_t *pent)
CPathTrack *CPathTrack::Instance(edict_t *pent)
{
// FClassnameIs(edict_t *pent,
// const char *szClassname); // 360
// GET_PRIVATE(edict_t *pent); // 361
if (FClassnameIs(pent, "path_track"))
{
return (CPathTrack *)GET_PRIVATE(pent);
}
return NULL;
}
#ifdef HOOK_GAMEDLL

View File

@ -36,14 +36,15 @@
class CPathCorner: public CPointEntity
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY float GetDelay(void)
virtual void Spawn(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
float GetDelay(void)
{
return GetDelay_();
}
#ifdef HOOK_GAMEDLL
void Spawn_(void);
@ -64,4 +65,7 @@ private:
};/* size: 156, cachelines: 3, members: 3 */
// linked objects
C_DLLEXPORT void path_corner(entvars_t *pev);
#endif // PATHCORNER_H

File diff suppressed because it is too large Load Diff

View File

@ -46,21 +46,21 @@
#define FGUNTARGET_START_ON 0x0001
/* <12c817> ../cstrike/dlls/plats.cpp:33 */
/* <12c817> ../cstrike/dlls/plats.cpp:33 */
class CBasePlatTrain: public CBaseToggle
{
public:
NOBODY virtual void Precache(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void)
virtual void Precache(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
// This is done to fix spawn flag collisions between this class and a derived class
NOBODY virtual BOOL IsTogglePlat(void)
virtual BOOL IsTogglePlat(void)
{
return IsTogglePlat_();
}
@ -92,17 +92,17 @@ public:
};/* size: 320, cachelines: 5, members: 5 */
/* <12c853> ../cstrike/dlls/plats.cpp:223 */
/* <12c853> ../cstrike/dlls/plats.cpp:223 */
class CFuncPlat: public CBasePlatTrain
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual void Blocked(CBaseEntity *pOther);
NOBODY virtual void GoUp(void);
NOBODY virtual void GoDown(void);
NOBODY virtual void HitTop(void);
NOBODY virtual void HitBottom(void);
virtual void Spawn(void);
virtual void Precache(void);
virtual void Blocked(CBaseEntity *pOther);
virtual void GoUp(void);
virtual void GoDown(void);
virtual void HitTop(void);
virtual void HitBottom(void);
#ifdef HOOK_GAMEDLL
@ -117,24 +117,23 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY void Setup(void);
NOBODY void EXPORT PlatUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
NOBODY void EXPORT CallGoDown(void);
NOBODY void EXPORT CallHitTop(void);
NOBODY void EXPORT CallHitBottom(void);
void Setup(void);
void EXPORT PlatUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void EXPORT CallGoDown(void);
void EXPORT CallHitTop(void);
void EXPORT CallHitBottom(void);
};/* size: 320, cachelines: 5, members: 1 */
/* <12c86e> ../cstrike/dlls/plats.cpp:248 */
/* <12c86e> ../cstrike/dlls/plats.cpp:248 */
class CPlatTrigger: public CBaseEntity
{
public:
NOBODY virtual int ObjectCaps(void)
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
NOBODY virtual void Touch(CBaseEntity *pOther);
virtual void Touch(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
@ -147,25 +146,25 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY void SpawnInsideTrigger(CFuncPlat *pPlatform);
void SpawnInsideTrigger(CFuncPlat *pPlatform);
public:
CFuncPlat *m_pPlatform;
};/* size: 156, cachelines: 3, members: 2 */
/* <12c8ee> ../cstrike/dlls/plats.cpp:515 */
/* <12c8ee> ../cstrike/dlls/plats.cpp:515 */
class CFuncPlatRot: public CFuncPlat
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
virtual void Spawn(void);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
NOBODY virtual void GoUp(void);
NOBODY virtual void GoDown(void);
NOBODY virtual void HitTop(void);
NOBODY virtual void HitBottom(void);
virtual void GoUp(void);
virtual void GoDown(void);
virtual void HitTop(void);
virtual void HitBottom(void);
#ifdef HOOK_GAMEDLL
@ -180,9 +179,9 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY void SetupRotation(void);
NOBODY void RotMove(Vector &destAngle, float time);
void SetupRotation(void);
void RotMove(Vector &destAngle, float time);
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[2];
@ -196,35 +195,35 @@ public:
class CFuncTrain: public CBasePlatTrain
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual void Restart(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY virtual void Activate(void);
NOBODY virtual void OverrideReset(void);
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
NOBODY virtual void Blocked(CBaseEntity *pOther);
virtual void Spawn(void);
virtual void Precache(void);
virtual void Restart(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual void Activate(void);
virtual void OverrideReset(void);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Blocked(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Restart_(void);
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Activate_(void);
void OverrideReset_(void);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void Spawn_(void);
void Precache_(void);
void Restart_(void);
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Activate_(void);
void OverrideReset_(void);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void Blocked_(CBaseEntity *pOther);
#endif // HOOK_GAMEDLL
public:
NOBODY void EXPORT Wait(void);
NOBODY void EXPORT Next(void);
void EXPORT Wait(void);
void EXPORT Next(void);
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[3];
@ -242,8 +241,8 @@ public:
class CFuncTrainControls: public CBaseEntity
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual int ObjectCaps(void)
virtual void Spawn(void);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
@ -251,7 +250,7 @@ public:
#ifdef HOOK_GAMEDLL
void Spawn_(void);
int ObjectCaps_(void)
int ObjectCaps_(void)
{
return CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION;
}
@ -259,7 +258,7 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY void EXPORT Find(void);
void EXPORT Find(void);
};/* size: 152, cachelines: 3, members: 1 */
@ -267,22 +266,22 @@ public:
class CFuncTrackChange: public CFuncPlatRot
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY virtual void OverrideReset(void);
NOBODY virtual void Touch(CBaseEntity *pOther);
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
NOBODY virtual BOOL IsTogglePlat(void);
virtual void Spawn(void);
virtual void Precache(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual void OverrideReset(void);
virtual void Touch(CBaseEntity *pOther);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual BOOL IsTogglePlat(void);
NOBODY virtual void EXPORT GoUp(void);
NOBODY virtual void EXPORT GoDown(void);
NOBODY virtual void HitBottom(void);
NOBODY virtual void HitTop(void);
NOBODY virtual void UpdateAutoTargets(int toggleState);
virtual void EXPORT GoUp(void);
virtual void EXPORT GoDown(void);
virtual void HitBottom(void);
virtual void HitTop(void);
virtual void UpdateAutoTargets(int toggleState);
#ifdef HOOK_GAMEDLL
@ -302,24 +301,24 @@ public:
void UpdateAutoTargets_(int toggleState);
#endif // HOOK_GAMEDLL
public:
NOBODY void EXPORT Find(void);
NOBODY TRAIN_CODE EvaluateTrain(CPathTrack *pcurrent);
NOBODY void UpdateTrain(Vector &dest);
void EXPORT Find(void);
TRAIN_CODE EvaluateTrain(CPathTrack *pcurrent);
void UpdateTrain(Vector &dest);
/* <12c515> ../cstrike/dlls/plats.cpp:1675 */
NOBODY void DisableUse(void)
void DisableUse(void)
{
m_use = 0;
}
/* <12c52e> ../cstrike/dlls/plats.cpp:1676 */
NOBODY void EnableUse(void)
void EnableUse(void)
{
m_use = 1;
}
/* <12c547> ../cstrike/dlls/plats.cpp:1677 */
NOBODY int UseEnabled(void)
int UseEnabled(void)
{
return m_use;
}
@ -346,8 +345,8 @@ public:
class CFuncTrackAuto: public CFuncTrackChange
{
public:
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
NOBODY virtual void UpdateAutoTargets(int toggleState);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void UpdateAutoTargets(int toggleState);
#ifdef HOOK_GAMEDLL
@ -363,25 +362,25 @@ public:
class CGunTarget: public CBaseMonster
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void)
virtual void Spawn(void);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
NOBODY virtual void Activate(void);
NOBODY virtual int Classify(void)
virtual void Activate(void);
virtual int Classify(void)
{
return Classify_();
}
NOBODY virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
NOBODY virtual int BloodColor(void)
virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
virtual int BloodColor(void)
{
return BloodColor_();
}
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
NOBODY virtual Vector BodyTarget(const Vector &posSrc)
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual Vector BodyTarget(const Vector &posSrc)
{
return BodyTarget_(posSrc);
}
@ -414,11 +413,10 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY void EXPORT Next(void);
NOBODY void EXPORT Start(void);
NOBODY void EXPORT Wait(void);
NOBODY void Stop(void);
void EXPORT Next(void);
void EXPORT Start(void);
void EXPORT Wait(void);
void Stop(void);
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1];
@ -428,8 +426,18 @@ private:
};/* size: 408, cachelines: 7, members: 3 */
NOBODY void PlatSpawnInsideTrigger(entvars_t *pevPlatform);
NOBODY float Fix(float angle);
NOBODY void FixupAngles(Vector &v);
void PlatSpawnInsideTrigger(entvars_t *pevPlatform);
//float Fix(float angle);
void FixupAngles(Vector &v);
// linked objects
C_DLLEXPORT void func_plat(entvars_t *pev);
C_DLLEXPORT void func_platrot(entvars_t *pev);
C_DLLEXPORT void func_train(entvars_t *pev);
C_DLLEXPORT void func_tracktrain(entvars_t *pev);
C_DLLEXPORT void func_traincontrols(entvars_t *pev);
C_DLLEXPORT void func_trackchange(entvars_t *pev);
C_DLLEXPORT void func_trackautochange(entvars_t *pev);
C_DLLEXPORT void func_guntarget(entvars_t *pev);
#endif // PLATS_H

File diff suppressed because it is too large Load Diff

View File

@ -123,6 +123,11 @@
#define CHAT_INTERVAL 1.0f
#define CSUITNOREPEAT 32
#define AUTOAIM_2DEGREES 0.0348994967025
#define AUTOAIM_5DEGREES 0.08715574274766
#define AUTOAIM_8DEGREES 0.1391731009601
#define AUTOAIM_10DEGREES 0.1736481776669
//#define SOUND_FLASHLIGHT_ON "items/flashlight1.wav"
//#define SOUND_FLASHLIGHT_OFF "items/flashlight1.wav"
@ -708,7 +713,7 @@ public:
void ResetAutoaim(void);
Vector AutoaimDeflection(Vector &vecSrc, float flDist, float flDelta);
void ForceClientDllUpdate(void);
void DeathMessage(entvars_t *pevAttacker) { };
void DeathMessage(entvars_t *pevAttacker) {};
void SetCustomDecalFrames(int nFrames);
int GetCustomDecalFrames(void);
void InitStatusBar(void);
@ -1169,8 +1174,8 @@ NOXREF CBaseEntity *FindZombieSpawn(CBaseEntity *player, bool forceSpawn);
edict_t *EntSelectSpawnPoint(CBaseEntity *pPlayer);
void SetScoreAttrib(CBasePlayer *dest, CBasePlayer *src);
CBaseEntity *FindEntityForward(CBaseEntity *pMe);
float GetPlayerPitch(const edict_t *pEdict);
float GetPlayerYaw(const edict_t *pEdict);
float_precision GetPlayerPitch(const edict_t *pEdict);
float_precision GetPlayerYaw(const edict_t *pEdict);
int GetPlayerGaitsequence(const edict_t *pEdict);
const char *GetBuyStringForWeaponClass(int weaponClass);
bool IsPrimaryWeaponClass(int classId);

View File

@ -220,9 +220,7 @@ public:
GLOBALESTATE EntityGetState(string_t globalname);
int EntityInTable(string_t globalname)
{
if (Find(globalname) != NULL)
return 1;
return 0;
return (Find(globalname) != NULL) ? 1 : 0;
}
int Save(CSave &save);
int Restore(CRestore &restore);

View File

@ -3,7 +3,7 @@
skilldata_t gSkillData;
// take the name of a cvar, tack a digit for the skill level
// on, and return the value.of that Cvar
// on, and return the value.of that Cvar
/* <16a558> ../cstrike/dlls/skill.cpp:30 */
NOXREF float GetSkillCvar(char *pName)

View File

@ -66,4 +66,4 @@ extern skilldata_t gSkillData;
NOXREF float GetSkillCvar(char *pName);
#endif // SKILL_H
#endif // SKILL_H

File diff suppressed because it is too large Load Diff

View File

@ -32,25 +32,200 @@
#pragma once
#endif
#define CSENTENCEG_MAX 200 // max number of sentence groups
#define CSENTENCE_LRU_MAX 32
#define CSENTENCEG_MAX 200 // max number of sentence groups
#define CSENTENCE_LRU_MAX 32 // max number of elements per sentence group
#define CDPVPRESETMAX 27
// spawnflags
#define AMBIENT_SOUND_STATIC 0 // medium radius attenuation
#define AMBIENT_SOUND_EVERYWHERE 1
#define AMBIENT_SOUND_SMALLRADIUS 2
#define AMBIENT_SOUND_MEDIUMRADIUS 4
#define AMBIENT_SOUND_LARGERADIUS 8
#define AMBIENT_SOUND_START_SILENT 16
#define AMBIENT_SOUND_NOT_LOOPING 32
#define ANNOUNCE_MINUTES_MIN 0.25
#define ANNOUNCE_MINUTES_MAX 2.25
#define SPEAKER_START_SILENT 1 // wait for trigger 'on' to start announcements
#define LFO_SQUARE 1 // square
#define LFO_TRIANGLE 2 // triangle
#define LFO_RANDOM 3 // random
// group of related sentences
typedef struct
{
char szgroupname[16];
int count;
unsigned char rgblru[ CSENTENCE_LRU_MAX ];
typedef struct
{
char szgroupname[16];
int count;
unsigned char rgblru[ CSENTENCE_LRU_MAX ];
} sentenceg;
/* size: 52, cachelines: 1, members: 3 */
NOBODY BOOL FEnvSoundInRange(entvars_t *pev, entvars_t *pevTarget, float *pflRange);
// runtime pitch shift and volume fadein/out structure
// NOTE: IF YOU CHANGE THIS STRUCT YOU MUST CHANGE THE SAVE/RESTORE VERSION NUMBER
// SEE BELOW (in the typedescription for the class)
typedef struct dynpitchvol
{
// NOTE: do not change the order of these parameters
// NOTE: unless you also change order of rgdpvpreset array elements!
int preset;
int pitchrun; // pitch shift % when sound is running 0 - 255
int pitchstart; // pitch shift % when sound stops or starts 0 - 255
int spinup; // spinup time 0 - 100
int spindown; // spindown time 0 - 100
int volrun; // volume change % when sound is running 0 - 10
int volstart; // volume change % when sound stops or starts 0 - 10
int fadein; // volume fade in time 0 - 100
int fadeout; // volume fade out time 0 - 100
// Low Frequency Oscillator
int lfotype; // 0) off 1) square 2) triangle 3) random
int lforate; // 0 - 1000, how fast lfo osciallates
int lfomodpitch; // 0-100 mod of current pitch. 0 is off.
int lfomodvol; // 0-100 mod of current volume. 0 is off.
int cspinup; // each trigger hit increments counter and spinup pitch
int cspincount;
int pitch;
int spinupsav;
int spindownsav;
int pitchfrac;
int vol;
int fadeinsav;
int fadeoutsav;
int volfrac;
int lfofrac;
int lfomult;
} dynpitchvol_t;
/* size: 100, cachelines: 2, members: 25 */
/* <170b59> ../cstrike/dlls/sound.cpp:117 */
class CAmbientGeneric: public CBaseEntity
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void Restart(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void Restart_(void);
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
int ObjectCaps_(void)
{
return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION);
}
#endif // HOOK_GAMEDLL
public:
void EXPORT ToggleUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void EXPORT RampThink(void);
void InitModulationParms(void);
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[4];
float m_flAttenuation; // attenuation value
dynpitchvol_t m_dpv;
BOOL m_fActive; // only TRUE when the entity is playing a looping sound
BOOL m_fLooping; // TRUE when the sound played will loop
};/* size: 264, cachelines: 5, members: 6 */
/* <170bc2> ../cstrike/dlls/sound.cpp:875 */
class CEnvSound: public CPointEntity
{
public:
virtual void Spawn(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual void Think(void);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Think_(void);
#endif // HOOK_GAMEDLL
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[2];
float m_flRadius;
float m_flRoomtype;
};/* size: 160, cachelines: 3, members: 4 */
/* <170ced> ../cstrike/dlls/sound.cpp:1867 */
class CSpeaker: public CBaseEntity
{
public:
virtual void Spawn(void);
virtual void Precache(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void Precache_(void);
void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
int ObjectCaps_(void)
{
return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION);
}
#endif // HOOK_GAMEDLL
public:
void EXPORT ToggleUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void EXPORT SpeakerThink(void);
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1];
int m_preset; // preset number
};/* size: 156, cachelines: 3, members: 3 */
BOOL FEnvSoundInRange(entvars_t *pev, entvars_t *pevTarget, float *pflRange);
void USENTENCEG_InitLRU(unsigned char *plru, int count);
int USENTENCEG_PickSequential(int isentenceg, char *szfound, int ipick, int freset);
int USENTENCEG_Pick(int isentenceg, char *szfound);
NOXREF int SENTENCEG_GetIndex(const char *szgroupname);
NOXREF int SENTENCEG_PlayRndI(edict_t *entity, int isentenceg, float volume, float attenuation, int flags, int pitch);
NOXREF int SENTENCEG_PlayRndSz(edict_t *entity, const char *szgroupname, float volume, float attenuation, int flags, int pitch);
int SENTENCEG_GetIndex(const char *szgroupname);
int SENTENCEG_PlayRndI(edict_t *entity, int isentenceg, float volume, float attenuation, int flags, int pitch);
int SENTENCEG_PlayRndSz(edict_t *entity, const char *szgroupname, float volume, float attenuation, int flags, int pitch);
int SENTENCEG_PlaySequentialSz(edict_t *entity, const char *szgroupname, float volume, float attenuation, int flags, int pitch, int ipick, int freset);
NOXREF void SENTENCEG_Stop(edict_t *entity, int isentenceg, int ipick);
void SENTENCEG_Init(void);
@ -60,9 +235,9 @@ void EMIT_SOUND_SUIT(edict_t *entity, const char *sample);
void EMIT_GROUPID_SUIT(edict_t *entity, int isentenceg);
NOXREF void EMIT_GROUPNAME_SUIT(edict_t *entity, const char *groupname);
char *memfgets(byte *pMemFile, int fileSize, int &filePos, char *pBuffer, int bufferSize);
NOBODY void TEXTURETYPE_Init(void);
void TEXTURETYPE_Init(void);
char TEXTURETYPE_Find(char *name);
NOBODY float TEXTURETYPE_PlaySound(TraceResult *ptr, Vector vecSrc, Vector vecEnd, int iBulletType);
float TEXTURETYPE_PlaySound(TraceResult *ptr, Vector vecSrc, Vector vecEnd, int iBulletType);
#ifdef HOOK_GAMEDLL
@ -70,6 +245,7 @@ NOBODY float TEXTURETYPE_PlaySound(TraceResult *ptr, Vector vecSrc, Vector vecEn
#define rgsentenceg (*prgsentenceg)
#define fSentencesInit (*pfSentencesInit)
#define gcallsentences (*pgcallsentences)
#define rgdpvpreset (*prgdpvpreset)
#endif // HOOK_GAMEDLL
@ -77,5 +253,15 @@ extern char gszallsentencenames[ CVOXFILESENTENCEMAX ][ CBSENTENCENAME_MAX ];
extern sentenceg rgsentenceg[ CSENTENCEG_MAX ];
extern int fSentencesInit;
extern int gcallsentences;
extern dynpitchvol_t rgdpvpreset[CDPVPRESETMAX];
#ifdef HOOK_GAMEDLL
// linked objects
C_DLLEXPORT void ambient_generic(entvars_t *pev);
C_DLLEXPORT void env_sound(entvars_t *pev);
C_DLLEXPORT void speaker(entvars_t *pev);
#endif // HOOK_GAMEDLL
#endif // SOUND_H

View File

@ -5,88 +5,194 @@ CSoundEnt *pSoundEnt;
/* <178ca4> ../cstrike/dlls/soundent.cpp:22 */
LINK_ENTITY_TO_CLASS(soundent, CSoundEnt);
// CSound - Clear - zeros all fields for a sound
/* <178d6e> ../cstrike/dlls/soundent.cpp:29 */
NOBODY void CSound::Clear(void)
void CSound::Clear(void)
{
m_vecOrigin = g_vecZero;
m_iType = 0;
m_iVolume = 0;
m_flExpireTime = 0;
m_iNext = SOUNDLIST_EMPTY;
m_iNextAudible = 0;
}
// Reset - clears the volume, origin, and type for a sound,
// but doesn't expire or unlink it.
// Reset - clears the volume, origin, and type for a sound,
// but doesn't expire or unlink it.
/* <178d8f> ../cstrike/dlls/soundent.cpp:43 */
void CSound::Reset(void)
{
m_vecOrigin = g_vecZero;
m_iNext = SOUNDLIST_EMPTY;
m_iType = 0;
m_vecOrigin = g_vecZero;
m_iNext = SOUNDLIST_EMPTY;
m_iType = 0;
m_iVolume = 0;
}
// FIsSound - returns TRUE if the sound is an Audible sound
/* <178db7> ../cstrike/dlls/soundent.cpp:54 */
NOBODY BOOL CSound::FIsSound(void)
NOXREF BOOL CSound::FIsSound(void)
{
if (m_iType & (bits_SOUND_COMBAT | bits_SOUND_WORLD | bits_SOUND_PLAYER | bits_SOUND_DANGER))
{
return TRUE;
}
return FALSE;
}
// FIsScent - returns TRUE if the sound is actually a scent
/* <178ddf> ../cstrike/dlls/soundent.cpp:67 */
NOBODY BOOL CSound::FIsScent(void)
NOXREF BOOL CSound::FIsScent(void)
{
if (m_iType & (bits_SOUND_CARCASS | bits_SOUND_MEAT | bits_SOUND_GARBAGE))
{
return TRUE;
}
return FALSE;
}
/* <17900a> ../cstrike/dlls/soundent.cpp:80 */
NOBODY void CSoundEnt::__MAKE_VHOOK(Spawn)(void)
void CSoundEnt::__MAKE_VHOOK(Spawn)(void)
{
pev->solid = SOLID_NOT;
Initialize();
pev->nextthink = gpGlobals->time + 1;
}
// Think - at interval, the entire active sound list is checked
// for sounds that have ExpireTimes less than or equal
// to the current world time, and these sounds are deallocated.
/* <178b0c> ../cstrike/dlls/soundent.cpp:93 */
NOBODY void CSoundEnt::__MAKE_VHOOK(Think)(void)
void CSoundEnt::__MAKE_VHOOK(Think)(void)
{
// {
// int iSound; // 95
// int iPreviousSound; // 96
// {
// int iNext; // 107
// FreeSound(int iSound,
// int iPrevious); // 110
// }
// }
// Think(CSoundEnt *const this); // 93
int iSound;
int iPreviousSound;
// how often to check the sound list.
pev->nextthink = gpGlobals->time + 0.3;
iPreviousSound = SOUNDLIST_EMPTY;
iSound = m_iActiveSound;
while (iSound != SOUNDLIST_EMPTY)
{
if (m_SoundPool[ iSound ].m_flExpireTime <= gpGlobals->time && m_SoundPool[ iSound ].m_flExpireTime != SOUND_NEVER_EXPIRE)
{
int iNext = m_SoundPool[ iSound ].m_iNext;
// move this sound back into the free list
FreeSound(iSound, iPreviousSound);
iSound = iNext;
}
else
{
iPreviousSound = iSound;
iSound = m_SoundPool[ iSound ].m_iNext;
}
}
if (m_fShowReport)
{
ALERT(at_aiconsole, "Soundlist: %d / %d (%d)\n", ISoundsInList(SOUNDLISTTYPE_ACTIVE), ISoundsInList(SOUNDLISTTYPE_FREE), ISoundsInList(SOUNDLISTTYPE_ACTIVE) - m_cLastActiveSounds);
m_cLastActiveSounds = ISoundsInList(SOUNDLISTTYPE_ACTIVE);
}
}
// Precache - dummy function
/* <178a76> ../cstrike/dlls/soundent.cpp:132 */
NOBODY void CSoundEnt::__MAKE_VHOOK(Precache)(void)
void CSoundEnt::__MAKE_VHOOK(Precache)(void)
{
;
}
// FreeSound - clears the passed active sound and moves it
// to the top of the free list. TAKE CARE to only call this
// function for sounds in the Active list!!
/* <178e07> ../cstrike/dlls/soundent.cpp:141 */
NOBODY void CSoundEnt::FreeSound(int iSound, int iPrevious)
void CSoundEnt::FreeSound(int iSound, int iPrevious)
{
if (!pSoundEnt)
{
// no sound ent!
return;
}
if (iPrevious != SOUNDLIST_EMPTY)
{
// iSound is not the head of the active list, so
// must fix the index for the Previous sound
// pSoundEnt->m_SoundPool[ iPrevious ].m_iNext = m_SoundPool[ iSound ].m_iNext;
pSoundEnt->m_SoundPool[ iPrevious ].m_iNext = pSoundEnt->m_SoundPool[ iSound ].m_iNext;
}
else
{
// the sound we're freeing IS the head of the active list.
pSoundEnt->m_iActiveSound = pSoundEnt->m_SoundPool[ iSound ].m_iNext;
}
// make iSound the head of the Free list.
pSoundEnt->m_SoundPool[ iSound ].m_iNext = pSoundEnt->m_iFreeSound;
pSoundEnt->m_iFreeSound = iSound;
}
// IAllocSound - moves a sound from the Free list to the
// Active list returns the index of the alloc'd sound
/* <178e2d> ../cstrike/dlls/soundent.cpp:171 */
int CSoundEnt::IAllocSound(void)
{
int iNewSound;
if (m_iFreeSound == SOUNDLIST_EMPTY)
{
// no free sound!
ALERT(at_console, "Free Sound List is full!\n");
return SOUNDLIST_EMPTY;
}
int iNewSound = m_iFreeSound;
// there is at least one sound available, so move it to the
// Active sound list, and return its SoundPool index.
// copy the index of the next free sound
iNewSound = m_iFreeSound;
// move the index down into the free list.
m_iFreeSound = m_SoundPool[ iNewSound ].m_iNext;
// point the new sound at the top of the active list.
m_SoundPool[ iNewSound ].m_iNext = m_iActiveSound;
// now make the new sound the top of the active list. You're done.
m_iActiveSound = iNewSound;
return iNewSound;
}
// InsertSound - Allocates a free sound and fills it with
// sound info.
/* <178e94> ../cstrike/dlls/soundent.cpp:200 */
void CSoundEnt::InsertSound(int iType, const Vector &vecOrigin, int iVolume, float flDuration)
{
if (!pSoundEnt)
return;
int iThisSound;
int iThisSound = pSoundEnt->IAllocSound();
if (!pSoundEnt)
{
// no sound ent!
return;
}
iThisSound = pSoundEnt->IAllocSound();
if (iThisSound == SOUNDLIST_EMPTY)
{
@ -100,65 +206,147 @@ void CSoundEnt::InsertSound(int iType, const Vector &vecOrigin, int iVolume, flo
pSoundEnt->m_SoundPool[ iThisSound ].m_flExpireTime = gpGlobals->time + flDuration;
}
// Initialize - clears all sounds and moves them into the
// free sound list.
/* <178f4e> ../cstrike/dlls/soundent.cpp:228 */
NOBODY void CSoundEnt::Initialize(void)
void CSoundEnt::Initialize(void)
{
// {
// int i; // 230
// int iSound; // 231
// Clear(CSound *const this); // 239
// IAllocSound(CSoundEnt *const this); // 249
// }
int i;
int iSound;
m_cLastActiveSounds = 0;
m_iFreeSound = 0;
m_iActiveSound = SOUNDLIST_EMPTY;
// clear all sounds, and link them into the free sound list.
for (i = 0; i < MAX_WORLD_SOUNDS; i++)
{
m_SoundPool[ i ].Clear();
m_SoundPool[ i ].m_iNext = i + 1;
}
// terminate the list here.
m_SoundPool[ i - 1 ].m_iNext = SOUNDLIST_EMPTY;
// now reserve enough sounds for each client
for (i = 0; i < gpGlobals->maxClients; i++)
{
iSound = pSoundEnt->IAllocSound();
if (iSound == SOUNDLIST_EMPTY)
{
ALERT(at_console, "Could not AllocSound() for Client Reserve! (DLL)\n");
return;
}
pSoundEnt->m_SoundPool[ iSound ].m_flExpireTime = SOUND_NEVER_EXPIRE;
}
if (CVAR_GET_FLOAT("displaysoundlist") == 1)
{
m_fShowReport = TRUE;
}
else
{
m_fShowReport = FALSE;
}
}
// ISoundsInList - returns the number of sounds in the desired
// sound list.
/* <179031> ../cstrike/dlls/soundent.cpp:274 */
NOBODY int CSoundEnt::ISoundsInList(int iListType)
int CSoundEnt::ISoundsInList(int iListType)
{
// {
// int i; // 276
// int iThisSound; // 277
// }
int i;
int iThisSound;
if (iListType == SOUNDLISTTYPE_FREE)
{
iThisSound = m_iFreeSound;
}
else if (iListType == SOUNDLISTTYPE_ACTIVE)
{
iThisSound = m_iActiveSound;
}
else
{
ALERT(at_console, "Unknown Sound List Type!\n");
}
if (iThisSound == SOUNDLIST_EMPTY)
{
return 0;
}
i = 0;
while (iThisSound != SOUNDLIST_EMPTY)
{
i++;
iThisSound = m_SoundPool[ iThisSound ].m_iNext;
}
return i;
}
// ActiveList - returns the head of the active sound list
/* <179073> ../cstrike/dlls/soundent.cpp:312 */
NOBODY int CSoundEnt::ActiveList(void)
NOXREF int CSoundEnt::ActiveList(void)
{
if (!pSoundEnt)
{
return SOUNDLIST_EMPTY;
}
return pSoundEnt->m_iActiveSound;
}
// FreeList - returns the head of the free sound list
/* <179083> ../cstrike/dlls/soundent.cpp:325 */
NOBODY int CSoundEnt::FreeList(void)
NOXREF int CSoundEnt::FreeList(void)
{
if (!pSoundEnt)
{
return SOUNDLIST_EMPTY;
}
return pSoundEnt->m_iFreeSound;
}
// SoundPointerForIndex - returns a pointer to the instance
// SoundPointerForIndex - returns a pointer to the instance
// of CSound at index's position in the sound pool.
/* <179093> ../cstrike/dlls/soundent.cpp:339 */
CSound *CSoundEnt::SoundPointerForIndex(int iIndex)
{
if (!pSoundEnt)
{
return NULL;
}
if (iIndex > (MAX_WORLD_SOUNDS - 1))
{
ALERT(at_console, "SoundPointerForIndex() - Index too large!\n");
return NULL;
}
if (iIndex < 0)
{
ALERT(at_console, "SoundPointerForIndex() - Index < 0!\n");
return NULL;
}
if (!pSoundEnt)
{
return NULL;
}
if (iIndex > (MAX_WORLD_SOUNDS - 1))
{
ALERT(at_console, "SoundPointerForIndex() - Index too large!\n");
return NULL;
}
if (iIndex < 0)
{
ALERT(at_console, "SoundPointerForIndex() - Index < 0!\n");
return NULL;
}
return &pSoundEnt->m_SoundPool[ iIndex ];
}
// Clients are numbered from 1 to MAXCLIENTS, but the client
// reserved sounds in the soundlist are from 0 to MAXCLIENTS - 1,
// so this function ensures that a client gets the proper index
// Clients are numbered from 1 to MAXCLIENTS, but the client
// reserved sounds in the soundlist are from 0 to MAXCLIENTS - 1,
// so this function ensures that a client gets the proper index
// to his reserved sound in the soundlist.
/* <1790b8> ../cstrike/dlls/soundent.cpp:367 */
@ -168,9 +356,9 @@ int CSoundEnt::ClientSoundIndex(edict_t *pClient)
#if defined(_DEBUG) && !defined(HOOK_GAMEDLL)
if (iReturn < 0 || iReturn > gpGlobals->maxClients)
{
ALERT(at_console, "** ClientSoundIndex returning a bogus value! **\n");
if (iReturn < 0 || iReturn > gpGlobals->maxClients)
{
ALERT(at_console, "** ClientSoundIndex returning a bogus value! **\n");
}
#endif // _DEBUG && !HOOK_GAMEDLL

View File

@ -60,11 +60,11 @@
class CSound
{
public:
NOBODY void Clear(void);
void Clear(void);
void Reset(void);
NOBODY BOOL FIsSound(void);
NOBODY BOOL FIsScent(void);
NOXREF BOOL FIsSound(void);
NOXREF BOOL FIsScent(void);
public:
Vector m_vecOrigin; // sound's location in space
@ -85,13 +85,13 @@ class CSoundEnt: public CBaseEntity
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual int ObjectCaps(void)
virtual void Spawn(void);
virtual void Precache(void);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
NOBODY virtual void Think(void);
virtual void Think(void);
#ifdef HOOK_GAMEDLL
@ -113,10 +113,10 @@ public:
static void FreeSound(int iSound, int iPrevious);
// return the head of the active list
static int ActiveList(void);
NOXREF static int ActiveList(void);
// return the head of the free list
static int FreeList(void);
NOXREF static int FreeList(void);
// return a pointer for this index in the sound list
static CSound *SoundPointerForIndex(int iIndex);
@ -147,4 +147,7 @@ private:
extern CSoundEnt *pSoundEnt;
// linked objects
C_DLLEXPORT void soundent(entvars_t *pev);
#endif // SOUNDENT_H

View File

@ -5,12 +5,14 @@
*/
#ifndef HOOK_GAMEDLL
// Global Savedata for Delay
TYPEDESCRIPTION CBaseDelay::m_SaveData[] =
{
DEFINE_FIELD(CBaseDelay, m_flDelay, FIELD_FLOAT),
DEFINE_FIELD(CBaseDelay, m_iszKillTarget, FIELD_STRING),
};
// Global Savedata for Toggle
TYPEDESCRIPTION CBaseToggle::m_SaveData[] =
{
DEFINE_FIELD(CBaseToggle, m_toggle_state, FIELD_INTEGER),
@ -22,8 +24,8 @@ TYPEDESCRIPTION CBaseToggle::m_SaveData[] =
DEFINE_FIELD(CBaseToggle, m_flTLength, FIELD_FLOAT),
DEFINE_FIELD(CBaseToggle, m_vecPosition1, FIELD_POSITION_VECTOR),
DEFINE_FIELD(CBaseToggle, m_vecPosition2, FIELD_POSITION_VECTOR),
DEFINE_FIELD(CBaseToggle, m_vecAngle1, FIELD_VECTOR),
DEFINE_FIELD(CBaseToggle, m_vecAngle2, FIELD_VECTOR),
DEFINE_FIELD(CBaseToggle, m_vecAngle1, FIELD_VECTOR), // UNDONE: Position could go through transition, but also angle?
DEFINE_FIELD(CBaseToggle, m_vecAngle2, FIELD_VECTOR), // UNDONE: Position could go through transition, but also angle?
DEFINE_FIELD(CBaseToggle, m_cTriggersLeft, FIELD_INTEGER),
DEFINE_FIELD(CBaseToggle, m_flHeight, FIELD_FLOAT),
DEFINE_FIELD(CBaseToggle, m_hActivator, FIELD_EHANDLE),
@ -31,29 +33,37 @@ TYPEDESCRIPTION CBaseToggle::m_SaveData[] =
DEFINE_FIELD(CBaseToggle, m_vecFinalDest, FIELD_POSITION_VECTOR),
DEFINE_FIELD(CBaseToggle, m_vecFinalAngle, FIELD_VECTOR),
DEFINE_FIELD(CBaseToggle, m_sMaster, FIELD_STRING),
DEFINE_FIELD(CBaseToggle, m_bitsDamageInflict, FIELD_INTEGER),
DEFINE_FIELD(CBaseToggle, m_bitsDamageInflict, FIELD_INTEGER), // damage type inflicted
};
#else // HOOK_GAMEDLL
TYPEDESCRIPTION (*CBaseDelay::pm_SaveData)[2];
TYPEDESCRIPTION (*CBaseToggle::pm_SaveData)[19];
TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CBaseDelay, m_SaveData)[2];
TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CBaseToggle, m_SaveData)[19];
#endif // HOOK_GAMEDLL
// Landmark class
/* <1832bc> ../cstrike/dlls/subs.cpp:38 */
NOBODY void CPointEntity::__MAKE_VHOOK(Spawn)(void)
void CPointEntity::__MAKE_VHOOK(Spawn)(void)
{
pev->solid = SOLID_NOT;
}
// Null Entity, remove on startup
/* <183417> ../cstrike/dlls/subs.cpp:53 */
NOBODY void CNullEntity::__MAKE_VHOOK(Spawn)(void)
void CNullEntity::__MAKE_VHOOK(Spawn)(void)
{
REMOVE_ENTITY(ENT(pev));
}
/* <1838f5> ../cstrike/dlls/subs.cpp:57 */
LINK_ENTITY_TO_CLASS(info_null, CNullEntity);
// These are the new entry points to entities.
/* <1839f1> ../cstrike/dlls/subs.cpp:69 */
LINK_ENTITY_TO_CLASS(info_player_deathmatch, CBaseDMStart);
@ -73,33 +83,43 @@ LINK_ENTITY_TO_CLASS(info_hostage_rescue, CPointEntity);
LINK_ENTITY_TO_CLASS(info_bomb_target, CPointEntity);
/* <183647> ../cstrike/dlls/subs.cpp:79 */
NOBODY void CBaseDMStart::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
void CBaseDMStart::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{
// FStrEq(const char *sz1,
// const char *sz2); // 81
// KeyValue(CBaseEntity *const this,
// KeyValueData *pkvd); // 87
// KeyValue(CBaseDMStart *const this,
// KeyValueData *pkvd); // 79
if (FStrEq(pkvd->szKeyName, "master"))
{
pev->netname = ALLOC_STRING(pkvd->szValue);
pkvd->fHandled = TRUE;
}
else
CPointEntity::KeyValue(pkvd);
}
/* <18331c> ../cstrike/dlls/subs.cpp:90 */
NOBODY BOOL CBaseDMStart::__MAKE_VHOOK(IsTriggered)(CBaseEntity *pEntity)
BOOL CBaseDMStart::__MAKE_VHOOK(IsTriggered)(CBaseEntity *pEntity)
{
// {
// BOOL master; // 92
// }
BOOL master = UTIL_IsMasterTriggered(pev->netname, pEntity);
return master;
}
// This updates global tables that need to know about entities being removed
/* <183f03> ../cstrike/dlls/subs.cpp:98 */
void CBaseEntity::UpdateOnRemove(void)
{
int i;
if (pev->flags & FL_GRAPHED)
{
for (int i = 0; i < WorldGraph.m_cLinks; i++)
// this entity was a LinkEnt in the world node graph, so we must remove it from
// the graph since we are removing it from the world.
for (i = 0; i < WorldGraph.m_cLinks; i++)
{
if (WorldGraph.m_pLinkPool[i].m_pLinkEnt == pev)
{
// if this link has a link ent which is the same ent that is removing itself, remove it!
WorldGraph.m_pLinkPool[i].m_pLinkEnt = NULL;
}
}
}
@ -109,12 +129,15 @@ void CBaseEntity::UpdateOnRemove(void)
}
}
// Convenient way to delay removing oneself
/* <183f38> ../cstrike/dlls/subs.cpp:120 */
void CBaseEntity::SUB_Remove(void)
{
UpdateOnRemove();
if (pev->health > 0)
{
// this situation can screw up monsters who can't tell their entity pointers are invalid.
pev->health = 0;
ALERT(at_aiconsole, "SUB_Remove called on entity with health > 0\n");
}
@ -122,6 +145,8 @@ void CBaseEntity::SUB_Remove(void)
REMOVE_ENTITY(ENT(pev));
}
// Convenient way to explicitly do nothing (passed to functions that require a method)
/* <183f8a> ../cstrike/dlls/subs.cpp:135 */
void CBaseEntity::SUB_DoNothing(void)
{
@ -148,11 +173,23 @@ void CBaseDelay::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CBaseEntity::KeyValue(pkvd);
}
// If self.delay is set, a DelayedUse entity will be created that will actually
// do the SUB_UseTargets after that many seconds have passed.
// Removes all entities with a targetname that match self.killtarget,
// and removes them, so some events can remove other triggers.
// Search for (string)targetname in all entities that
// match (string)self.target and call their .use function (if they have one)
/* <1840d5> ../cstrike/dlls/subs.cpp:183 */
void CBaseEntity::SUB_UseTargets(CBaseEntity *pActivator, USE_TYPE useType, float value)
{
// fire targets
if (!FStringNull(pev->target))
{
FireTargets(STRING(pev->target), pActivator, this, useType, value);
}
}
/* <183fb0> ../cstrike/dlls/subs.cpp:195 */
@ -163,13 +200,15 @@ void FireTargets(const char *targetName, CBaseEntity *pActivator, CBaseEntity *p
return;
ALERT(at_aiconsole, "Firing: (%s)\n", targetName);
while (1)
while (true)
{
pentTarget = FIND_ENTITY_BY_TARGETNAME(pentTarget, targetName);
if (FNullEnt(pentTarget))
break;
CBaseEntity *pTarget = CBaseEntity::Instance(pentTarget);
// Don't use dying ents
if (pTarget && !(pTarget->pev->flags & FL_KILLME))
{
ALERT(at_aiconsole, "Found: %s, firing (%s)\n", STRING(pTarget->pev->classname), targetName);
@ -184,62 +223,96 @@ LINK_ENTITY_TO_CLASS(DelayedUse, CBaseDelay);
/* <1844c2> ../cstrike/dlls/subs.cpp:252 */
void CBaseDelay::SUB_UseTargets(CBaseEntity *pActivator, USE_TYPE useType, float value)
{
if (!pev->target && !m_iszKillTarget)
// exit immediatly if we don't have a target or kill target
if (FStringNull(pev->target) && !m_iszKillTarget)
return;
if (!m_flDelay)
{
if (m_iszKillTarget)
{
ALERT(at_aiconsole, "KillTarget: %s\n", STRING(m_iszKillTarget));
edict_t *pentKillTarget = FIND_ENTITY_BY_TARGETNAME(NULL, STRING(m_iszKillTarget));
while (!FNullEnt(pentKillTarget))
{
UTIL_Remove(CBaseEntity::Instance(pentKillTarget));
ALERT(at_aiconsole, "killing %s\n", STRING(pentKillTarget->v.classname));
pentKillTarget = FIND_ENTITY_BY_TARGETNAME(pentKillTarget, STRING(m_iszKillTarget));
}
}
if (pev->target)
FireTargets(STRING(pev->target), pActivator, this, useType, value);
}
else
// check for a delay
if (m_flDelay != 0)
{
// create a temp object to fire at a later time
CBaseDelay *pTemp = GetClassPtr((CBaseDelay *)NULL);
if (pTemp->pev->classname)
{
RemoveEntityHashValue(pTemp->pev, STRING(pTemp->pev->classname), CLASSNAME);
}
MAKE_STRING_CLASS("DelayedUse", pTemp->pev);
AddEntityHashValue(pTemp->pev, STRING(pTemp->pev->classname), CLASSNAME);
pTemp->pev->nextthink = gpGlobals->time + m_flDelay;
pTemp->SetThink(&CBaseDelay::DelayThink);
// Save the useType
pTemp->pev->button = (int)useType;
pTemp->m_iszKillTarget = m_iszKillTarget;
pTemp->m_flDelay = 0.0f;
// prevent "recursion"
pTemp->m_flDelay = 0;
pTemp->pev->target = pev->target;
// HACKHACK
// This wasn't in the release build of Half-Life. We should have moved m_hActivator into this class
// but changing member variable hierarchy would break save/restore without some ugly code.
// This code is not as ugly as that code
// If a player activates, then save it
if (pActivator && pActivator->IsPlayer())
{
pTemp->pev->owner = pActivator->edict();
}
else
{
pTemp->pev->owner = NULL;
}
return;
}
// kill the killtargets
if (m_iszKillTarget)
{
edict_t *pentKillTarget = NULL;
ALERT(at_aiconsole, "KillTarget: %s\n", STRING(m_iszKillTarget));
pentKillTarget = FIND_ENTITY_BY_TARGETNAME(NULL, STRING(m_iszKillTarget));
while (!FNullEnt(pentKillTarget))
{
UTIL_Remove(CBaseEntity::Instance(pentKillTarget));
ALERT(at_aiconsole, "killing %s\n", STRING(pentKillTarget->v.classname));
pentKillTarget = FIND_ENTITY_BY_TARGETNAME(pentKillTarget, STRING(m_iszKillTarget));
}
}
// fire targets
if (!FStringNull(pev->target))
{
FireTargets(STRING(pev->target), pActivator, this, useType, value);
}
}
// QuakeEd only writes a single float for angles (bad idea), so up and down are
// just constant angles.
/* <1846d9> ../cstrike/dlls/subs.cpp:335 */
void SetMovedir(entvars_t *pev)
{
if (pev->angles == Vector(0, -1, 0))
{
pev->movedir = Vector(0, 0, 1);
}
else if (pev->angles == Vector(0, -2, 0))
{
pev->movedir = Vector(0, 0, -1);
}
else
{
UTIL_MakeVectors(pev->angles);
pev->movedir = gpGlobals->v_forward;
}
pev->angles = g_vecZero;
}
@ -247,10 +320,15 @@ void SetMovedir(entvars_t *pev)
void CBaseDelay::DelayThink(void)
{
CBaseEntity *pActivator = NULL;
if (pev->owner)
pActivator = CBaseEntity::Instance(pev->owner);
SUB_UseTargets(pActivator, (USE_TYPE)pev->button, 0.0f);
// A player activated this on delay
if (pev->owner != NULL)
{
pActivator = CBaseEntity::Instance(pev->owner);
}
// The use type is cached (and stashed) in pev->button
SUB_UseTargets(pActivator, (USE_TYPE)pev->button, 0);
REMOVE_ENTITY(ENT(pev));
}
@ -284,82 +362,177 @@ void CBaseToggle::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CBaseDelay::KeyValue(pkvd);
}
// calculate pev->velocity and pev->nextthink to reach vecDest from
// pev->origin traveling at flSpeed
/* <18474d> ../cstrike/dlls/subs.cpp:431 */
NOBODY void CBaseToggle::LinearMove(Vector vecDest, float flSpeed)
void CBaseToggle::LinearMove(Vector vecDest, float flSpeed)
{
// {
// class Vector vecDestDelta; // 446
// float flTravelTime; // 449
// operator==(const class Vector *const this,
// const class Vector &v); // 439
// operator-(const class Vector *const this,
// const class Vector &v); // 446
// Length(const class Vector *const this); // 449
// operator/(const class Vector *const this,
// float fl); // 456
// LinearMoveDone(CBaseToggle *const this); // 441
// }
assert(("LinearMove: no speed is defined!", flSpeed != 0));
//assert(("LinearMove: no post-move function defined", m_pfnCallWhenMoveDone != NULL));
m_vecFinalDest = vecDest;
// Already there?
if (vecDest == pev->origin)
{
LinearMoveDone();
return;
}
// set destdelta to the vector needed to move
Vector vecDestDelta = vecDest - pev->origin;
// divide vector length by speed to get time to reach dest
float_precision flTravelTime = vecDestDelta.Length() / flSpeed;
// set nextthink to trigger a call to LinearMoveDone when dest is reached
pev->nextthink = pev->ltime + flTravelTime;
SetThink(&CBaseToggle::LinearMoveDone);
// scale the destdelta vector by the time spent traveling to get velocity
pev->velocity = vecDestDelta * (float)(1 / flTravelTime);
}
// After moving, set origin to exact final destination, call "move done" function
/* <18337e> ../cstrike/dlls/subs.cpp:465 */
NOBODY void CBaseToggle::LinearMoveDone(void)
void CBaseToggle::LinearMoveDone(void)
{
UTIL_SetOrigin(pev, m_vecFinalDest);
pev->velocity = g_vecZero;
pev->nextthink = -1;
if (m_pfnCallWhenMoveDone)
{
(this->*m_pfnCallWhenMoveDone)();
}
}
/* <184855> ../cstrike/dlls/subs.cpp:474 */
NOBODY BOOL CBaseToggle::IsLockedByMaster(void)
NOXREF BOOL CBaseToggle::IsLockedByMaster(void)
{
if (!FStringNull(m_sMaster) && !UTIL_IsMasterTriggered(m_sMaster, m_hActivator))
return TRUE;
else
return FALSE;
}
// calculate pev->velocity and pev->nextthink to reach vecDest from
// pev->origin traveling at flSpeed
// Just like LinearMove, but rotational.
/* <18487c> ../cstrike/dlls/subs.cpp:491 */
NOBODY void CBaseToggle::AngularMove(Vector vecDestAngle, float flSpeed)
void CBaseToggle::AngularMove(Vector vecDestAngle, float flSpeed)
{
// {
// class Vector vecDestDelta; // 506
// float flTravelTime; // 509
// operator==(const class Vector *const this,
// const class Vector &v); // 499
// operator-(const class Vector *const this,
// const class Vector &v); // 506
// Length(const class Vector *const this); // 509
// operator/(const class Vector *const this,
// float fl); // 516
// AngularMoveDone(CBaseToggle *const this); // 501
// }
assert(("AngularMove: no speed is defined!", flSpeed != 0));
//assert(("AngularMove: no post-move function defined", m_pfnCallWhenMoveDone != NULL));
m_vecFinalAngle = vecDestAngle;
// Already there?
if (vecDestAngle == pev->angles)
{
AngularMoveDone();
return;
}
// set destdelta to the vector needed to move
Vector vecDestDelta = vecDestAngle - pev->angles;
// divide by speed to get time to reach dest
float_precision flTravelTime = vecDestDelta.Length() / flSpeed;
// set nextthink to trigger a call to AngularMoveDone when dest is reached
pev->nextthink = pev->ltime + flTravelTime;
SetThink(&CBaseToggle::AngularMoveDone);
// scale the destdelta vector by the time spent traveling to get velocity
pev->avelocity = vecDestDelta / flTravelTime;
}
// After rotating, set angle to exact final angle, call "move done" function
/* <1832fb> ../cstrike/dlls/subs.cpp:525 */
NOBODY void CBaseToggle::AngularMoveDone(void)
void CBaseToggle::AngularMoveDone(void)
{
pev->angles = m_vecFinalAngle;
pev->avelocity = g_vecZero;
pev->nextthink = -1;
if (m_pfnCallWhenMoveDone)
{
(this->*m_pfnCallWhenMoveDone)();
}
}
/* <184984> ../cstrike/dlls/subs.cpp:535 */
NOBODY float CBaseToggle::AxisValue(int flags, Vector &angles)
float CBaseToggle::AxisValue(int flags, const Vector &angles)
{
if (flags & SF_DOOR_ROTATE_Z)
return angles.z;
if (flags & SF_DOOR_ROTATE_X)
return angles.x;
return angles.y;
}
/* <1849bd> ../cstrike/dlls/subs.cpp:546 */
NOBODY void CBaseToggle::AxisDir(entvars_t *pev)
void CBaseToggle::AxisDir(entvars_t *pev)
{
if (pev->spawnflags & SF_DOOR_ROTATE_Z)
{
// around z-axis
pev->movedir = Vector(0, 0, 1);
}
else if (pev->spawnflags & SF_DOOR_ROTATE_X)
{
// around x-axis
pev->movedir = Vector(1, 0, 0);
}
else
{
// around y-axis
pev->movedir = Vector(0, 1, 0);
}
}
/* <1849e3> ../cstrike/dlls/subs.cpp:557 */
NOBODY float CBaseToggle::AxisDelta(int flags, Vector &angle1, Vector &angle2)
float CBaseToggle::AxisDelta(int flags, const Vector &angle1, const Vector &angle2)
{
if (flags & SF_DOOR_ROTATE_Z)
return angle1.z - angle2.z;
if (flags & SF_DOOR_ROTATE_X)
return angle1.x - angle2.x;
return angle1.y - angle2.y;
}
// returns TRUE if the passed entity is visible to caller, even if not infront ()
/* <184a30> ../cstrike/dlls/subs.cpp:577 */
NOBODY BOOL FEntIsVisible(entvars_t *pev, entvars_t *pevTarget)
NOXREF BOOL FEntIsVisible(entvars_t *pev, entvars_t *pevTarget)
{
// {
// class Vector vecSpot1; // 581
// class Vector vecSpot2; // 582
// TraceResult tr; // 583
// operator+(const class Vector *const this,
// const class Vector &v); // 581
// operator+(const class Vector *const this,
// const class Vector &v); // 582
// }
Vector vecSpot1 = pev->origin + pev->view_ofs;
Vector vecSpot2 = pevTarget->origin + pevTarget->view_ofs;
TraceResult tr;
UTIL_TraceLine(vecSpot1, vecSpot2, ignore_monsters, ENT(pev), &tr);
if (tr.fInOpen && tr.fInWater)
{
// sight line crossed contents
return FALSE;
}
if (tr.flFraction == 1.0f)
{
return TRUE;
}
return FALSE;
}
#ifdef HOOK_GAMEDLL

View File

@ -36,7 +36,7 @@
class CNullEntity: public CBaseEntity
{
public:
NOBODY virtual void Spawn(void);
virtual void Spawn(void);
#ifdef HOOK_GAMEDLL
@ -50,8 +50,8 @@ public:
class CBaseDMStart: public CPointEntity
{
public:
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual BOOL IsTriggered(CBaseEntity *pEntity);
virtual void KeyValue(KeyValueData *pkvd);
virtual BOOL IsTriggered(CBaseEntity *pEntity);
#ifdef HOOK_GAMEDLL
@ -64,6 +64,16 @@ public:
void FireTargets(const char *targetName, CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void SetMovedir(entvars_t *pev);
NOBODY BOOL FEntIsVisible(entvars_t *pev, entvars_t *pevTarget);
NOXREF BOOL FEntIsVisible(entvars_t *pev, entvars_t *pevTarget);
#endif // SUBS_H
// linked objects
C_DLLEXPORT void info_null(entvars_t *pev);
C_DLLEXPORT void info_player_deathmatch(entvars_t *pev);
C_DLLEXPORT void info_player_start(entvars_t *pev);
C_DLLEXPORT void info_vip_start(entvars_t *pev);
C_DLLEXPORT void info_landmark(entvars_t *pev);
C_DLLEXPORT void info_hostage_rescue(entvars_t *pev);
C_DLLEXPORT void info_bomb_target(entvars_t *pev);
C_DLLEXPORT void DelayedUse(entvars_t *pev);
#endif // SUBS_H

View File

@ -38,4 +38,4 @@ public:
static float g_talkWaitTime;
};
#endif // TALKMONSTER_H
#endif // TALKMONSTER_H

View File

@ -111,7 +111,7 @@ void CHalfLifeTraining::__MAKE_VHOOK(PlayerThink)(CBasePlayer *pPlayer)
pPlayer->m_iTeam = CT;
pPlayer->m_bCanShoot = true;
pPlayer->m_fLastMovement = gpGlobals->time;
if (pPlayer->m_pActiveItem)
pPlayer->m_iHideHUD &= ~HIDEHUD_WEAPONS;
else
@ -314,7 +314,7 @@ void CHalfLifeTraining::__MAKE_VHOOK(CheckWinConditions)(void)
CBaseEntity *pRescueArea;
CBaseEntity *pFirstRescueArea;
pFirstRescueArea = CBaseEntity::Instance(FIND_ENTITY_BY_CLASSNAME(NULL, "func_hostage_rescue"));
pRescueArea = pFirstRescueArea;
@ -675,4 +675,4 @@ void CHalfLifeTraining::CheckWinConditions(void)
CheckWinConditions_();
}
#endif // HOOK_GAMEDLL
#endif // HOOK_GAMEDLL

View File

@ -50,7 +50,7 @@ public:
virtual edict_t *GetPlayerSpawnSpot(CBasePlayer *pPlayer);
virtual void PlayerKilled(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor);
virtual int ItemShouldRespawn(CItem *pItem);
virtual void CheckMapConditions(void) { }
virtual void CheckMapConditions(void) {};
virtual void CheckWinConditions(void);
#ifdef HOOK_GAMEDLL

View File

@ -54,46 +54,46 @@
class CPathTrack: public CPointEntity
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData* pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY virtual void Activate(void);
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void KeyValue_(KeyValueData* pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Activate_(void);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif // HOOK_GAMEDLL
NOBODY void SetPrevious(CPathTrack *pprevious);
NOBODY void Link(void);
// Returns ppath if enabled, NULL otherwise
NOBODY CPathTrack *ValidPath(CPathTrack *ppath, int testFlag);
NOBODY void Project(CPathTrack *pstart, CPathTrack *pend, Vector *origin, float dist);
NOBODY static CPathTrack *Instance(edict_t *pent);
NOBODY CPathTrack *LookAhead(Vector *origin, float dist, int move);
NOBODY CPathTrack *Nearest(Vector origin);
NOBODY CPathTrack *GetNext(void);
NOBODY CPathTrack *GetPrevious(void);
virtual void Spawn(void);
virtual void KeyValue(KeyValueData* pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual void Activate(void);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[5];
float m_length;
string_t m_altName;
CPathTrack *m_pnext;
CPathTrack *m_pprevious;
#ifdef HOOK_GAMEDLL
void Spawn_(void);
void KeyValue_(KeyValueData* pkvd);
int Save_(CSave &save);
int Restore_(CRestore &restore);
void Activate_(void);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif // HOOK_GAMEDLL
void SetPrevious(CPathTrack *pprevious);
void Link(void);
// Returns ppath if enabled, NULL otherwise
CPathTrack *ValidPath(CPathTrack *ppath, int testFlag);
void Project(CPathTrack *pstart, CPathTrack *pend, Vector *origin, float dist);
static CPathTrack *Instance(edict_t *pent);
CPathTrack *LookAhead(Vector *origin, float dist, int move);
CPathTrack *Nearest(Vector origin);
CPathTrack *GetNext(void);
CPathTrack *GetPrevious(void);
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[5];
float m_length;
string_t m_altName;
CPathTrack *m_pnext;
CPathTrack *m_pprevious;
CPathTrack *m_paltpath;
};/* size: 172, cachelines: 3, members: 7 */
@ -102,20 +102,20 @@ public:
class CFuncTrackTrain: public CBaseEntity
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual void Restart(void);
NOBODY virtual void KeyValue(KeyValueData* pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void)
virtual void Spawn(void);
virtual void Precache(void);
virtual void Restart(void);
virtual void KeyValue(KeyValueData* pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
NOBODY virtual void OverrideReset(void);
NOBODY 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);
virtual void OverrideReset(void);
virtual BOOL OnControls(entvars_t *pev);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Blocked(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
@ -137,22 +137,21 @@ public:
#endif // HOOK_GAMEDLL
public:
void EXPORT Next(void);
void EXPORT Find(void);
void EXPORT NearestPath(void);
void EXPORT DeadEnd(void);
NOBODY void EXPORT Next(void);
NOBODY void EXPORT Find(void);
NOBODY void EXPORT NearestPath(void);
NOBODY void EXPORT DeadEnd(void);
NOBODY void NextThink(float thinkTime, BOOL alwaysThink);
void NextThink(float thinkTime, BOOL alwaysThink);
void SetTrack(CPathTrack *track)
{
m_ppath = track->Nearest(pev->origin);
}
NOBODY void SetControls(entvars_t *pevControls);
NOBODY void StopSound(void);
NOBODY void UpdateSound(void);
void SetControls(entvars_t *pevControls);
void StopSound(void);
void UpdateSound(void);
NOBODY static CFuncTrackTrain *Instance(edict_t *pent);
static CFuncTrackTrain *Instance(edict_t *pent);
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[12];
@ -180,24 +179,24 @@ private:
};/* size: 236, cachelines: 4, members: 19 */
/* <1ba5f9> ../cstrike/dlls/trains.h:134 */
class CFuncVehicle: public CBaseEntity
{
class CFuncVehicle: public CBaseEntity
{
public:
NOBODY virtual void Spawn(void);
virtual void Spawn(void);
virtual void Precache(void);
NOBODY virtual void Restart(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void)
virtual void Restart(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
virtual int Classify(void);
NOBODY virtual void OverrideReset(void);
virtual void OverrideReset(void);
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);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Blocked(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
@ -220,27 +219,27 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY void EXPORT Next(void);
NOBODY void EXPORT Find(void);
NOBODY void EXPORT NearestPath(void);
NOBODY void EXPORT DeadEnd(void);
void EXPORT Next(void);
void EXPORT Find(void);
void EXPORT NearestPath(void);
void EXPORT DeadEnd(void);
NOBODY void NextThink(float thinkTime, BOOL alwaysThink);
NOBODY void CollisionDetection(void);
NOBODY void TerrainFollowing(void);
NOBODY void CheckTurning(void);
void NextThink(float thinkTime, BOOL alwaysThink);
void CollisionDetection(void);
void TerrainFollowing(void);
void CheckTurning(void);
NOBODY void SetTrack(CPathTrack *track)
void SetTrack(CPathTrack *track)
{
m_ppath = track->Nearest(pev->origin);
}
NOBODY void SetControls(entvars_t *pevControls);
NOBODY void StopSound(void);
NOBODY void UpdateSound(void);
void SetControls(entvars_t *pevControls);
void StopSound(void);
void UpdateSound(void);
public:
NOBODY static CFuncVehicle *Instance(edict_t *pent);
static CFuncVehicle *Instance(edict_t *pent);
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[12];
@ -283,15 +282,7 @@ private:
};/* size: 364, cachelines: 6, members: 35 */
// linked objects
C_DLLEXPORT void path_track(entvars_t *pev);
#endif // TRAINS_H

File diff suppressed because it is too large Load Diff

View File

@ -38,15 +38,21 @@
#define MAX_ITEM_COUNTS 32
#define MAX_ENTITY 512 // We can only ever move 512 entities across a transition
#define SF_TRIGGER_PUSH_START_OFF 2
#define SF_TRIGGER_HURT_TARGETONCE 1
#define SF_TRIGGER_HURT_START_OFF 2
#define SF_TRIGGER_HURT_NO_CLIENTS 8
#define SF_TRIGGER_HURT_CLIENTONLYFIRE 16
#define SF_TRIGGER_HURT_CLIENTONLYTOUCH 32
// triggers
#define SF_TRIGGER_ALLOWMONSTERS 1 // monsters allowed to fire this trigger
#define SF_TRIGGER_NOCLIENTS 2 // players not allowed to fire this trigger
#define SF_TRIGGER_PUSHABLES 4 // only pushables can fire this trigger
#define SF_TRIGGER_PUSH_START_OFF 2 // spawnflag that makes trigger_push spawn turned OFF
#define SF_TRIGGER_HURT_TARGETONCE 1 // Only fire hurt target once
#define SF_TRIGGER_HURT_START_OFF 2 // spawnflag that makes trigger_push spawn turned OFF
#define SF_TRIGGER_HURT_NO_CLIENTS 8 // spawnflag that makes trigger_push spawn turned OFF
#define SF_TRIGGER_HURT_CLIENTONLYFIRE 16 // trigger hurt will only fire its target if it is hurting a client
#define SF_TRIGGER_HURT_CLIENTONLYTOUCH 32 // only clients may touch this trigger.
#define SF_AUTO_FIREONCE 0x0001
#define SF_RELAY_FIREONCE 0x0001
#define SF_ENDSECTION_USEONLY 0x0001
#define SF_MULTIMAN_CLONE 0x80000000
#define SF_MULTIMAN_THREAD 0x00000001
@ -56,14 +62,20 @@
#define SF_CAMERA_PLAYER_TARGET 2
#define SF_CAMERA_PLAYER_TAKECONTROL 4
// Flags to indicate masking off various render parameters that are normally copied to the targets
#define SF_RENDER_MASKFX (1<<0)
#define SF_RENDER_MASKAMT (1<<1)
#define SF_RENDER_MASKMODE (1<<2)
#define SF_RENDER_MASKCOLOR (1<<3)
class CFrictionModifier: public CBaseEntity
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void)
virtual void Spawn(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
@ -82,7 +94,7 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY void EXPORT ChangeFriction(CBaseEntity *pOther);
void EXPORT ChangeFriction(CBaseEntity *pOther);
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1];
@ -91,20 +103,23 @@ public:
};/* size: 156, cachelines: 3, members: 3 */
// This trigger will fire when the level spawns (or respawns if not fire once)
// It will check a global state before firing. It supports delay and killtargets
/* <19e39c> ../cstrike/dlls/triggers.cpp:108 */
class CAutoTrigger: public CBaseDelay
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void)
virtual void Spawn(void);
virtual void Precache(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
NOBODY virtual void Think(void);
virtual void Think(void);
#ifdef HOOK_GAMEDLL
@ -124,8 +139,8 @@ public:
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[2];
int m_globalstate; // 160
USE_TYPE triggerType; // 164
int m_globalstate;
USE_TYPE triggerType;
};/* size: 168, cachelines: 3, members: 4 */
@ -133,16 +148,15 @@ public:
class CTriggerRelay: public CBaseDelay
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void)
virtual void Spawn(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
public:
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
@ -165,21 +179,25 @@ public:
};/* size: 164, cachelines: 3, members: 3 */
// The Multimanager Entity - when fired, will fire up to 16 targets
// at specified times.
// FLAG: THREAD (create clones when triggered)
// FLAG: CLONE (this is a clone for a threaded execution)
/* <19e4d6> ../cstrike/dlls/triggers.cpp:264 */
class CMultiManager: public CBaseToggle
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Restart(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void)
virtual void Spawn(void);
virtual void Restart(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
NOBODY virtual BOOL HasTarget(string_t targetname);
public:
virtual BOOL HasTarget(string_t targetname);
#ifdef HOOK_GAMEDLL
@ -196,27 +214,37 @@ public:
#endif // HOOK_GAMEDLL
NOBODY void EXPORT ManagerThink(void);
NOBODY void EXPORT ManagerUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
public:
void EXPORT ManagerThink(void);
void EXPORT ManagerUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
private:
/* <19dfe1> ../cstrike/dlls/triggers.cpp:293 */
inline BOOL IsClone(void)
{
if (pev->spawnflags & SF_MULTIMAN_CLONE)
{
return TRUE;
}
return FALSE;
}
/* <19e4f3> ../cstrike/dlls/triggers.cpp:294 */
inline BOOL ShouldClone(void)
{
if (IsClone())
{
return FALSE;
}
if (pev->spawnflags & SF_MULTIMAN_THREAD)
{
return TRUE;
}
return FALSE;
}
NOBODY CMultiManager *Clone(void);
CMultiManager *Clone(void);
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[5];
@ -230,12 +258,17 @@ public:
};/* size: 452, cachelines: 8, members: 7 */
/* Linux - 452 | Windows - 432 */
// Render parameters trigger
//
// This entity will copy its render parameters (renderfx, rendermode, rendercolor, renderamt)
// to its targets when triggered.
/* <19e50c> ../cstrike/dlls/triggers.cpp:525 */
class CRenderFxManager: public CBaseEntity
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Spawn(void);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
@ -250,8 +283,8 @@ public:
class CBaseTrigger: public CBaseToggle
{
public:
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int ObjectCaps(void)
virtual void KeyValue(KeyValueData *pkvd);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
@ -267,23 +300,26 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY void EXPORT TeleportTouch(CBaseEntity *pOther);
NOBODY void EXPORT MultiTouch(CBaseEntity *pOther);
NOBODY void EXPORT HurtTouch(CBaseEntity *pOther);
NOXREF NOBODY void EXPORT CDAudioTouch(CBaseEntity *pOther);
NOBODY void ActivateMultiTrigger(CBaseEntity *pActivator);
NOBODY void EXPORT MultiWaitOver(void);
NOBODY void EXPORT CounterUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
NOBODY void EXPORT ToggleUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
NOBODY void InitTrigger(void);
void EXPORT TeleportTouch(CBaseEntity *pOther);
void EXPORT MultiTouch(CBaseEntity *pOther);
void EXPORT HurtTouch(CBaseEntity *pOther);
NOXREF void EXPORT CDAudioTouch(CBaseEntity *pOther);
void ActivateMultiTrigger(CBaseEntity *pActivator);
void EXPORT MultiWaitOver(void);
void EXPORT CounterUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void EXPORT ToggleUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void InitTrigger(void);
};/* size: 312, cachelines: 5, members: 1 */
// trigger_hurt - hurts anything that touches it. if the trigger has a targetname, firing it will toggle state
// int gfToggleState = 0; // used to determine when all radiation trigger hurts have called 'RadiationThink'
/* <19e5b2> ../cstrike/dlls/triggers.cpp:629 */
class CTriggerHurt: public CBaseTrigger
{
public:
NOBODY virtual void Spawn(void);
virtual void Spawn(void);
#ifdef HOOK_GAMEDLL
@ -291,7 +327,7 @@ public:
#endif // HOOK_GAMEDLL
NOBODY void EXPORT RadiationThink(void);
void EXPORT RadiationThink(void);
};/* size: 312, cachelines: 5, members: 1 */
@ -299,9 +335,9 @@ public:
class CTriggerMonsterJump: public CBaseTrigger
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Think(void);
NOBODY virtual void Touch(CBaseEntity *pOther);
virtual void Spawn(void);
virtual void Think(void);
virtual void Touch(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
@ -313,13 +349,15 @@ public:
};/* size: 312, cachelines: 5, members: 1 */
// trigger_cdaudio - starts/stops cd audio tracks
/* <19e65d> ../cstrike/dlls/triggers.cpp:705 */
class CTriggerCDAudio: public CBaseTrigger
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Touch(CBaseEntity *pOther);
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Spawn(void);
virtual void Touch(CBaseEntity *pOther);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
@ -330,18 +368,20 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY virtual void PlayTrack(void);
virtual void PlayTrack(void);
};/* size: 312, cachelines: 5, members: 1 */
// This plays a CD track when fired or when the player enters it's radius
/* <19e6d2> ../cstrike/dlls/triggers.cpp:783 */
class CTargetCDAudio: public CPointEntity
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual void Think(void);
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Spawn(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual void Think(void);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
@ -353,15 +393,30 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY void Play(void);
void Play(void);
};/* size: 152, cachelines: 3, members: 1 */
// QUAKED trigger_multiple (.5 .5 .5) ? notouch
// Variable sized repeatable trigger. Must be targeted at one or more entities.
// If "health" is set, the trigger must be killed to activate each time.
// If "delay" is set, the trigger waits some time after activating before firing.
// "wait" : Seconds between triggerings. (.2 default)
// If notouch is set, the trigger is only fired by other entities, not by touching.
// NOTOUCH has been obsoleted by trigger_relay!
// sounds
// 1) secret
// 2) beep beep
// 3) large switch
// 4)
// NEW
// if a trigger has a NETNAME, that NETNAME will become the TARGET of the triggered object.
/* <19e725> ../cstrike/dlls/triggers.cpp:1080 */
class CTriggerMultiple: public CBaseTrigger
{
public:
NOBODY virtual void Spawn(void);
virtual void Spawn(void);
#ifdef HOOK_GAMEDLL
@ -371,11 +426,23 @@ public:
};/* size: 312, cachelines: 5, members: 1 */
// QUAKED trigger_once (.5 .5 .5) ? notouch
// Variable sized trigger. Triggers once, then removes itself. You must set the key "target" to the name of another object in the level that has a matching
// "targetname". If "health" is set, the trigger must be killed to activate.
// If notouch is set, the trigger is only fired by other entities, not by touching.
// if "killtarget" is set, any objects that have a matching "target" will be removed when the trigger is fired.
// if "angle" is set, the trigger will only fire when someone is facing the direction of the angle. Use "360" for an angle of 0.
// sounds
// 1) secret
// 2) beep beep
// 3) large switch
// 4)
/* <19e77d> ../cstrike/dlls/triggers.cpp:1129 */
class CTriggerOnce: public CTriggerMultiple
{
public:
NOBODY virtual void Spawn(void);
virtual void Spawn(void);
#ifdef HOOK_GAMEDLL
@ -385,11 +452,17 @@ public:
};/* size: 312, cachelines: 5, members: 1 */
// QUAKED trigger_counter (.5 .5 .5) ? nomessage
// Acts as an intermediary for an action that takes multiple inputs.
// If nomessage is not set, it will print "1 more.. " etc when triggered and
// "sequence complete" when finished. After the counter has been triggered "cTriggersLeft"
// times (default 2), it will fire all of it's targets and remove itself.
/* <19e7d5> ../cstrike/dlls/triggers.cpp:1273 */
class CTriggerCounter: public CBaseTrigger
{
public:
NOBODY virtual void Spawn(void);
virtual void Spawn(void);
#ifdef HOOK_GAMEDLL
@ -399,11 +472,13 @@ public:
};/* size: 312, cachelines: 5, members: 1 */
// Derive from point entity so this doesn't move across levels
/* <19e82d> ../cstrike/dlls/triggers.cpp:1293 */
class CTriggerVolume: public CPointEntity
{
public:
NOBODY virtual void Spawn(void);
virtual void Spawn(void);
#ifdef HOOK_GAMEDLL
@ -413,17 +488,19 @@ public:
};/* size: 152, cachelines: 3, members: 1 */
// Fires a target after level transition and then dies
/* <19e885> ../cstrike/dlls/triggers.cpp:1313 */
class CFireAndDie: public CBaseDelay
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual int ObjectCaps(void)
virtual void Spawn(void);
virtual void Precache(void);
virtual int ObjectCaps(void) // Always go across transitions
{
return ObjectCaps_();
}
NOBODY virtual void Think(void);
virtual void Think(void);
#ifdef HOOK_GAMEDLL
@ -439,14 +516,17 @@ public:
};/* size: 160, cachelines: 3, members: 1 */
// QUAKED trigger_changelevel (0.5 0.5 0.5) ? NO_INTERMISSION
// When the player touches this, he gets sent to the map listed in the "map" variable. Unless the NO_INTERMISSION flag is set, the view will go to the info_intermission spot and display stats.
/* <19e906> ../cstrike/dlls/triggers.cpp:1345 */
class CChangeLevel: public CBaseTrigger
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
virtual void Spawn(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
#ifdef HOOK_GAMEDLL
@ -458,12 +538,11 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY void EXPORT UseChangeLevel(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
NOXREF NOBODY void EXPORT TriggerChangeLevel(void);
NOBODY void EXPORT ExecuteChangeLevel(void);
NOBODY void EXPORT TouchChangeLevel(CBaseEntity *pOther);
NOBODY void ChangeLevelNow(CBaseEntity *pActivator);
void EXPORT UseChangeLevel(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
NOXREF void EXPORT TriggerChangeLevel(void);
void EXPORT ExecuteChangeLevel(void);
void EXPORT TouchChangeLevel(CBaseEntity *pOther);
void ChangeLevelNow(CBaseEntity *pActivator);
static edict_t *FindLandmark(const char *pLandmarkName);
static int ChangeList(LEVELLIST *pLevelList, int maxList);
@ -473,8 +552,8 @@ public:
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[4];
char m_szMapName[ cchMapNameMost ];
char m_szLandmarkName[ cchMapNameMost ];
char m_szMapName[ cchMapNameMost ]; // trigger_changelevel only: next map
char m_szLandmarkName[ cchMapNameMost ]; // trigger_changelevel only: landmark on next map
int m_changeTarget;
float m_changeTargetDelay;
@ -484,9 +563,9 @@ public:
class CLadder: public CBaseTrigger
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void Precache(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
virtual void Spawn(void);
virtual void Precache(void);
virtual void KeyValue(KeyValueData *pkvd);
#ifdef HOOK_GAMEDLL
@ -502,9 +581,9 @@ public:
class CTriggerPush: public CBaseTrigger
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual void Touch(CBaseEntity *pOther);
virtual void Spawn(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual void Touch(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL
@ -520,7 +599,7 @@ public:
class CTriggerTeleport: public CBaseTrigger
{
public:
NOBODY virtual void Spawn(void);
virtual void Spawn(void);
#ifdef HOOK_GAMEDLL
@ -534,7 +613,7 @@ public:
class CBuyZone: public CBaseTrigger
{
public:
NOBODY virtual void Spawn(void);
virtual void Spawn(void);
#ifdef HOOK_GAMEDLL
@ -542,7 +621,7 @@ public:
#endif // HOOK_GAMEDLL
NOBODY void EXPORT BuyTouch(CBaseEntity *pOther);
void EXPORT BuyTouch(CBaseEntity *pOther);
};/* size: 312, cachelines: 5, members: 1 */
@ -550,7 +629,7 @@ public:
class CBombTarget: public CBaseTrigger
{
public:
NOBODY virtual void Spawn(void);
virtual void Spawn(void);
#ifdef HOOK_GAMEDLL
@ -559,8 +638,8 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY void EXPORT BombTargetTouch(CBaseEntity *pOther);
NOBODY void EXPORT BombTargetUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void EXPORT BombTargetTouch(CBaseEntity *pOther);
void EXPORT BombTargetUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
};/* size: 312, cachelines: 5, members: 1 */
@ -568,7 +647,7 @@ public:
class CHostageRescue: public CBaseTrigger
{
public:
NOBODY virtual void Spawn(void);
virtual void Spawn(void);
#ifdef HOOK_GAMEDLL
@ -577,7 +656,7 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY void EXPORT HostageRescueTouch(CBaseEntity *pOther);
void EXPORT HostageRescueTouch(CBaseEntity *pOther);
};/* size: 312, cachelines: 5, members: 1 */
@ -585,7 +664,7 @@ public:
class CEscapeZone: public CBaseTrigger
{
public:
NOBODY virtual void Spawn(void);
virtual void Spawn(void);
#ifdef HOOK_GAMEDLL
@ -593,7 +672,7 @@ public:
#endif // HOOK_GAMEDLL
NOBODY void EXPORT EscapeTouch(CBaseEntity *pOther);
void EXPORT EscapeTouch(CBaseEntity *pOther);
};/* size: 312, cachelines: 5, members: 1 */
@ -601,7 +680,7 @@ public:
class CVIP_SafetyZone: public CBaseTrigger
{
public:
NOBODY virtual void Spawn(void);
virtual void Spawn(void);
#ifdef HOOK_GAMEDLL
@ -609,7 +688,7 @@ public:
#endif // HOOK_GAMEDLL
NOBODY void EXPORT VIP_SafetyTouch(CBaseEntity *pOther);
void EXPORT VIP_SafetyTouch(CBaseEntity *pOther);
};/* size: 312, cachelines: 5, members: 1 */
@ -617,7 +696,7 @@ public:
class CTriggerSave: public CBaseTrigger
{
public:
NOBODY virtual void Spawn(void);
virtual void Spawn(void);
#ifdef HOOK_GAMEDLL
@ -625,7 +704,7 @@ public:
#endif // HOOK_GAMEDLL
NOBODY void EXPORT SaveTouch(CBaseEntity *pOther);
void EXPORT SaveTouch(CBaseEntity *pOther);
};/* size: 312, cachelines: 5, members: 1 */
@ -633,8 +712,8 @@ public:
class CTriggerEndSection: public CBaseTrigger
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
virtual void Spawn(void);
virtual void KeyValue(KeyValueData *pkvd);
#ifdef HOOK_GAMEDLL
@ -644,16 +723,16 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY void EXPORT EndSectionTouch(CBaseEntity *pOther);
NOBODY void EXPORT EndSectionUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
};/* size: 312, cachelines: 5, members: 1 */
void EXPORT EndSectionTouch(CBaseEntity *pOther);
void EXPORT EndSectionUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
};/* size: 312, cachelines: 5, members: 1 */
/* <19ed25> ../cstrike/dlls/triggers.cpp:2305 */
class CTriggerGravity: public CBaseTrigger
{
public:
NOBODY virtual void Spawn(void);
virtual void Spawn(void);
#ifdef HOOK_GAMEDLL
@ -661,23 +740,25 @@ public:
#endif // HOOK_GAMEDLL
NOBODY void EXPORT GravityTouch(CBaseEntity *pOther);
void EXPORT GravityTouch(CBaseEntity *pOther);
};/* size: 312, cachelines: 5, members: 1 */
// this is a really bad idea.
/* <19ed7d> ../cstrike/dlls/triggers.cpp:2335 */
class CTriggerChangeTarget: public CBaseDelay
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
virtual void Spawn(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return (CBaseDelay::ObjectCaps() & ~FCAP_ACROSS_TRANSITION);
return ObjectCaps_();
}
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
@ -705,15 +786,15 @@ private:
class CTriggerCamera: public CBaseDelay
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void)
virtual void Spawn(void);
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void)
{
return ObjectCaps_();
}
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
@ -730,8 +811,8 @@ public:
#endif // HOOK_GAMEDLL
public:
NOBODY void EXPORT FollowTarget(void);
NOBODY void Move(void);
void EXPORT FollowTarget(void);
void Move(void);
public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[13];
@ -756,16 +837,12 @@ public:
class CWeather: public CBaseTrigger
{
public:
NOBODY virtual void Spawn(void)
{
Spawn_();
}
virtual void Spawn(void);
#ifdef HOOK_GAMEDLL
void Spawn_(void)
{
InitTrigger();
}
void Spawn_(void);
#endif // HOOK_GAMEDLL
};/* size: 312, cachelines: 5, members: 1 */
@ -774,8 +851,8 @@ public:
class CClientFog: public CBaseEntity
{
public:
NOBODY virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd);
virtual void Spawn(void);
virtual void KeyValue(KeyValueData *pkvd);
#ifdef HOOK_GAMEDLL
@ -791,8 +868,59 @@ public:
};/* size: 164, cachelines: 3, members: 4 */
NOBODY void PlayCDTrack(int iTrack);
NOBODY int BuildChangeList(LEVELLIST * pLevelList, int maxList);
NOBODY void NextLevel(void);
#ifdef HOOK_GAMEDLL
#define st_szNextMap (*pst_szNextMap)
#define st_szNextSpot (*pst_szNextSpot)
#endif // HOOK_GAMEDLL
extern char st_szNextMap[cchMapNameMost];
extern char st_szNextSpot[cchMapNameMost];
void PlayCDTrack(int iTrack);
int BuildChangeList(LEVELLIST * pLevelList, int maxList);
NOXREF void NextLevel(void);
#ifdef HOOK_GAMEDLL
// linked objects
C_DLLEXPORT void func_friction(entvars_t *pev);
C_DLLEXPORT void trigger_auto(entvars_t *pev);
C_DLLEXPORT void trigger_relay(entvars_t *pev);
C_DLLEXPORT void multi_manager(entvars_t *pev);
C_DLLEXPORT void env_render(entvars_t *pev);
C_DLLEXPORT void trigger(entvars_t *pev);
C_DLLEXPORT void trigger_hurt(entvars_t *pev);
C_DLLEXPORT void trigger_monsterjump(entvars_t *pev);
C_DLLEXPORT void trigger_cdaudio(entvars_t *pev);
C_DLLEXPORT void target_cdaudio(entvars_t *pev);
C_DLLEXPORT void trigger_multiple(entvars_t *pev);
C_DLLEXPORT void trigger_once(entvars_t *pev);
C_DLLEXPORT void trigger_counter(entvars_t *pev);
C_DLLEXPORT void trigger_transition(entvars_t *pev);
C_DLLEXPORT void fireanddie(entvars_t *pev);
C_DLLEXPORT void trigger_changelevel(entvars_t *pev);
C_DLLEXPORT void func_ladder(entvars_t *pev);
C_DLLEXPORT void trigger_push(entvars_t *pev);
C_DLLEXPORT void trigger_teleport(entvars_t *pev);
C_DLLEXPORT void info_teleport_destination(entvars_t *pev);
C_DLLEXPORT void func_buyzone(entvars_t *pev);
C_DLLEXPORT void func_bomb_target(entvars_t *pev);
C_DLLEXPORT void func_hostage_rescue(entvars_t *pev);
C_DLLEXPORT void func_escapezone(entvars_t *pev);
C_DLLEXPORT void func_vip_safetyzone(entvars_t *pev);
C_DLLEXPORT void trigger_autosave(entvars_t *pev);
C_DLLEXPORT void trigger_endsection(entvars_t *pev);
C_DLLEXPORT void trigger_gravity(entvars_t *pev);
C_DLLEXPORT void trigger_changetarget(entvars_t *pev);
C_DLLEXPORT void trigger_camera(entvars_t *pev);
C_DLLEXPORT void env_snow(entvars_t *pev);
C_DLLEXPORT void func_snow(entvars_t *pev);
C_DLLEXPORT void env_rain(entvars_t *pev);
C_DLLEXPORT void func_rain(entvars_t *pev);
C_DLLEXPORT void env_fog(entvars_t *pev);
#endif // HOOK_GAMEDLL
#endif // TRIGGERS_H

View File

@ -55,15 +55,15 @@ void InstallTutor(bool start)
/* <1dfde7> ../cstrike/dlls/tutor.cpp:51 */
void Tutor_RegisterCVars(void)
{
CVAR_REGISTER(&cv_tutor_message_repeats);
CVAR_REGISTER(&cv_tutor_debug_level);
CVAR_REGISTER(&cv_tutor_view_distance);
CVAR_REGISTER(&cv_tutor_viewable_check_interval);
CVAR_REGISTER(&cv_tutor_look_distance);
CVAR_REGISTER(&cv_tutor_look_angle);
CVAR_REGISTER(&cv_tutor_examine_time);
CVAR_REGISTER(&cv_tutor_message_minimum_display_time);
CVAR_REGISTER(&cv_tutor_message_character_display_time_coefficient);
CVAR_REGISTER(&cv_tutor_message_repeats);
CVAR_REGISTER(&cv_tutor_debug_level);
CVAR_REGISTER(&cv_tutor_view_distance);
CVAR_REGISTER(&cv_tutor_viewable_check_interval);
CVAR_REGISTER(&cv_tutor_look_distance);
CVAR_REGISTER(&cv_tutor_look_angle);
CVAR_REGISTER(&cv_tutor_examine_time);
CVAR_REGISTER(&cv_tutor_message_minimum_display_time);
CVAR_REGISTER(&cv_tutor_message_character_display_time_coefficient);
CVAR_REGISTER(&cv_tutor_hint_interval_time);
}
@ -90,7 +90,7 @@ void MonitorTutorStatus(void)
}
else
tutor_enableCvarExists = false;
for (int i = 1; i <= gpGlobals->maxClients; i++)
{
CBasePlayer *pPlayer = reinterpret_cast<CBasePlayer *>(UTIL_PlayerByIndex(i));

View File

@ -38,7 +38,7 @@ public:
CBaseTutorState(void);
virtual ~CBaseTutorState(void);
virtual int CheckForStateTransition(GameEventType event, CBaseEntity *entity, CBaseEntity *other) = 0;
virtual int CheckForStateTransition(GameEventType event, CBaseEntity *entity, CBaseEntity *other) = 0;
virtual char *GetStateString(void) = 0;
public:
@ -51,15 +51,15 @@ protected:
class CBaseTutorStateSystem
{
public:
CBaseTutorStateSystem(void);
virtual ~CBaseTutorStateSystem(void);
virtual bool UpdateState(GameEventType event, CBaseEntity *entity, CBaseEntity *other) = 0;
virtual char *GetCurrentStateString(void) = 0;
virtual CBaseTutorState *ConstructNewState(int stateType) = 0;
public:
public:
CBaseTutorStateSystem(void);
virtual ~CBaseTutorStateSystem(void);
virtual bool UpdateState(GameEventType event, CBaseEntity *entity, CBaseEntity *other) = 0;
virtual char *GetCurrentStateString(void) = 0;
virtual CBaseTutorState *ConstructNewState(int stateType) = 0;
public:
int GetCurrentStateType(void);
protected:

View File

@ -5,7 +5,7 @@
*/
#ifndef HOOK_GAMEDLL
char *const g_TutorStateStrings[20] =
char *const g_TutorStateStrings[20] =
{
"#Cstrike_TutorState_Undefined",
"#Cstrike_TutorState_Looking_For_Hostage",
@ -260,51 +260,51 @@ int CCSTutorBuyMenuState::HandleRoundStart(CBaseEntity *entity, CBaseEntity *oth
return TUTOR_STATE_FLAG_1;
}
#ifdef HOOK_GAMEDLL
bool CCSTutorStateSystem::UpdateState(GameEventType event, CBaseEntity *entity, CBaseEntity *other)
{
return UpdateState_(event, entity, other);
}
char *CCSTutorStateSystem::GetCurrentStateString(void)
{
return GetCurrentStateString_();
}
CBaseTutorState *CCSTutorStateSystem::ConstructNewState(int stateType)
{
return ConstructNewState_(stateType);
}
int CCSTutorUndefinedState::CheckForStateTransition(GameEventType event, CBaseEntity *entity, CBaseEntity *other)
{
return CheckForStateTransition_(event, entity, other);
}
char *CCSTutorUndefinedState::GetStateString(void)
{
return GetStateString_();
}
int CCSTutorWaitingForStartState::CheckForStateTransition(GameEventType event, CBaseEntity *entity, CBaseEntity *other)
{
return CheckForStateTransition_(event, entity, other);
}
char *CCSTutorWaitingForStartState::GetStateString(void)
{
return GetStateString_();
}
int CCSTutorBuyMenuState::CheckForStateTransition(GameEventType event, CBaseEntity *entity, CBaseEntity *other)
{
return CheckForStateTransition_(event, entity, other);
}
char *CCSTutorBuyMenuState::GetStateString(void)
{
return GetStateString_();
}
#ifdef HOOK_GAMEDLL
bool CCSTutorStateSystem::UpdateState(GameEventType event, CBaseEntity *entity, CBaseEntity *other)
{
return UpdateState_(event, entity, other);
}
char *CCSTutorStateSystem::GetCurrentStateString(void)
{
return GetCurrentStateString_();
}
CBaseTutorState *CCSTutorStateSystem::ConstructNewState(int stateType)
{
return ConstructNewState_(stateType);
}
int CCSTutorUndefinedState::CheckForStateTransition(GameEventType event, CBaseEntity *entity, CBaseEntity *other)
{
return CheckForStateTransition_(event, entity, other);
}
char *CCSTutorUndefinedState::GetStateString(void)
{
return GetStateString_();
}
int CCSTutorWaitingForStartState::CheckForStateTransition(GameEventType event, CBaseEntity *entity, CBaseEntity *other)
{
return CheckForStateTransition_(event, entity, other);
}
char *CCSTutorWaitingForStartState::GetStateString(void)
{
return GetStateString_();
}
int CCSTutorBuyMenuState::CheckForStateTransition(GameEventType event, CBaseEntity *entity, CBaseEntity *other)
{
return CheckForStateTransition_(event, entity, other);
}
char *CCSTutorBuyMenuState::GetStateString(void)
{
return GetStateString_();
}
#endif // HOOK_GAMEDLL

View File

@ -70,21 +70,21 @@ public:
virtual ~CCSTutorStateSystem(void);
virtual bool UpdateState(GameEventType event, CBaseEntity *entity, CBaseEntity *other);
virtual char *GetCurrentStateString(void);
#ifdef HOOK_GAMEDLL
public:
bool UpdateState_(GameEventType event, CBaseEntity *entity, CBaseEntity *other);
char *GetCurrentStateString_(void);
CBaseTutorState *ConstructNewState_(int stateType);
#endif // HOOK_GAMEDLL
#ifndef HOOK_GAMEDLL
protected:
#endif // HOOK_GAMEDLL
virtual CBaseTutorState *ConstructNewState(int stateType);
#ifdef HOOK_GAMEDLL
public:
bool UpdateState_(GameEventType event, CBaseEntity *entity, CBaseEntity *other);
char *GetCurrentStateString_(void);
CBaseTutorState *ConstructNewState_(int stateType);
#endif // HOOK_GAMEDLL
virtual CBaseTutorState *ConstructNewState(int stateType);
};/* size: 8, cachelines: 1, members: 1 */

View File

@ -166,10 +166,6 @@ const char *TutorIdentifierList[ TUTOR_NUM_MESSAGES ];
#endif // HOOK_GAMEDLL
//#ifdef HOOK_GAMEDLL
//static TutorMessageMap m_messageMap_;
//#endif // HOOK_GAMEDLL
/* <212575> ../cstrike/dlls/tutor_cs_tutor.cpp:197 */
CCSTutor::CCSTutor(void)
{
@ -217,7 +213,6 @@ CCSTutor::~CCSTutor(void)
void ParseMessageParameters(char *&messageData, TutorMessage *ret)
{
char *token;
static int iNumP = 0;
while (true)
{
@ -423,10 +418,8 @@ void CCSTutor::ReadTutorMessageFile(void)
defaultMessage.m_minDisplayTimeOverride = 0;
defaultMessage.m_minRepeatInterval = 0;
int d = 0;
while (d < 200)
while (true)
{
d++;
messageData = MP_COM_Parse(messageData);
if (!messageData)
@ -1195,7 +1188,7 @@ void CCSTutor::UpdateCurrentMessage(TutorMessageEvent *event)
void CCSTutor::__MAKE_VHOOK(ShowTutorMessage)(TutorMessageEvent *event)
{
TutorMessageID mid = static_cast<TutorMessageID>(event->GetID());
if (mid < 0 || mid >= TUTOR_NUM_MESSAGES)
{
return;

View File

@ -33,7 +33,6 @@
#endif
#include <map>
#include <vector>
enum TutorMessageClass
{

View File

@ -1,6 +1,6 @@
#include "precompiled.h"
#if 0
#if 1
void *addr_orig;
char patchByte[5];
@ -314,7 +314,7 @@ int UTIL_EntitiesInBox(CBaseEntity **pList, int listMax, const Vector &mins, con
edict_t *pEdict = INDEXENT(1);
CBaseEntity *pEntity;
int count = 0;
if (!pEdict)
return 0;
@ -1003,17 +1003,17 @@ float UTIL_Approach(float target, float value, float speed)
value += speed;
else if (delta < -speed)
value -= speed;
else
else
value = target;
return value;
}
/* <1aedeb> ../cstrike/dlls/util.cpp:1190 */
float UTIL_ApproachAngle(float target, float value, float speed)
float_precision UTIL_ApproachAngle(float target, float value, float speed)
{
target = UTIL_AngleMod(target);
value = UTIL_AngleMod(target);
float delta = target - value;
if (speed < 0.0f)
speed = -speed;
@ -1027,13 +1027,13 @@ float UTIL_ApproachAngle(float target, float value, float speed)
value += speed;
else if (delta < -speed)
value -= speed;
else
else
value = target;
return value;
}
/* <1aeec5> ../cstrike/dlls/util.cpp:1217 */
float UTIL_AngleDistance(float next, float cur)
float_precision UTIL_AngleDistance(float next, float cur)
{
float_precision delta;
@ -1048,17 +1048,6 @@ float UTIL_AngleDistance(float next, float cur)
return delta;
}
/*float UTIL_AngleDistance(float next, float cur)
{
//TODO: variable need double, or will testdemo to crashed
double delta = (double)(next - cur);
if (delta < -180.0f)
delta += 360.0f;
else if ( delta > 180.0f)
delta -= 360.0f;
return (float)delta;
}*/
/* <1aef1c> ../cstrike/dlls/util.cpp:1230 */
float UTIL_SplineFraction(float value, float scale)
{
@ -1148,7 +1137,7 @@ void UTIL_BloodStream(const Vector &origin, const Vector &direction, int color,
WRITE_COORD(direction.y);
WRITE_COORD(direction.z);
WRITE_BYTE(color);
WRITE_BYTE(_min( amount, 255 ));
WRITE_BYTE(Q_min(amount, 255));
MESSAGE_END();
}
@ -1178,7 +1167,7 @@ void UTIL_BloodDrips(const Vector &origin, const Vector &direction, int color, i
WRITE_SHORT(g_sModelIndexBloodSpray);
WRITE_SHORT(g_sModelIndexBloodDrop);
WRITE_BYTE(color);
WRITE_BYTE(_min( _max( 3, amount / 10 ), 16 ));
WRITE_BYTE(Q_min(Q_max(3, amount / 10), 16));
MESSAGE_END();
}
@ -1704,7 +1693,7 @@ extern "C"
shift &= 0x1f;
while (shift--)
while (shift--)
{
lobit = num & 1;
num >>= 1;
@ -2433,28 +2422,35 @@ char UTIL_TextureHit(TraceResult *ptr, Vector vecSrc, Vector vecEnd)
NOXREF int GetPlayerTeam(int index)
{
CBasePlayer *pPlayer = (CBasePlayer *)UTIL_PlayerByIndex(index);
if (pPlayer)
if (pPlayer != NULL)
{
return pPlayer->m_iTeam;
}
return 0;
}
/* <1b5412> ../cstrike/dlls/util.cpp:2775 */
bool UTIL_IsGame(const char *gameName)
{
if (gameName)
if (gameName != NULL)
{
static char gameDir[256];
GET_GAME_DIR(gameDir);
return (Q_stricmp(gameDir, gameName) == 0);
}
return false;
}
/* <1b5470> ../cstrike/dlls/util.cpp:2802 */
float UTIL_GetPlayerGaitYaw(int playerIndex)
float_precision UTIL_GetPlayerGaitYaw(int playerIndex)
{
CBasePlayer *pPlayer = (CBasePlayer *)UTIL_PlayerByIndex(playerIndex);
if (pPlayer)
if (pPlayer != NULL)
{
return pPlayer->m_flGaityaw;
return 0.0f;
}
return 0;
}

View File

@ -64,7 +64,11 @@
#define CBSENTENCENAME_MAX 16
#define CVOXFILESENTENCEMAX 1536 // max number of sentences in game. NOTE: this must match CVOXFILESENTENCEMAX in engine\sound.h!!!
#ifdef CLIENT_WEAPONS
#define WEAPON_TIMEBASED 0.0f
#else
#define WEAPON_TIMEBASED gpGlobals->time
#endif // CLIENT_WEAPONS
#define GROUP_OP_AND 0
#define GROUP_OP_NAND 1
@ -102,6 +106,25 @@ extern globalvars_t *gpGlobals;
#define SVC_WEAPONANIM 35
#define SVC_ROOMTYPE 37
#define SVC_DIRECTOR 51
#define SF_TRIG_PUSH_ONCE 1
// func_rotating
#define SF_BRUSH_ROTATE_Y_AXIS 0
#define SF_BRUSH_ROTATE_INSTANT 1
#define SF_BRUSH_ROTATE_BACKWARDS 2
#define SF_BRUSH_ROTATE_Z_AXIS 4
#define SF_BRUSH_ROTATE_X_AXIS 8
#define SF_PENDULUM_AUTO_RETURN 16
#define SF_PENDULUM_PASSABLE 32
#define SF_BRUSH_ROTATE_SMALLRADIUS 128
#define SF_BRUSH_ROTATE_MEDIUMRADIUS 256
#define SF_BRUSH_ROTATE_LARGERADIUS 512
#define SPAWNFLAG_NOMESSAGE 1
#define SPAWNFLAG_NOTOUCH 1
#define SPAWNFLAG_DROIDONLY 4
#define VEC_HULL_MIN_Z Vector(0, 0, -36)
#define VEC_DUCK_HULL_MIN_Z Vector(0, 0, -18)
@ -417,8 +440,8 @@ float UTIL_VecToYaw(const Vector &vec);
void UTIL_SetOrigin(entvars_t *pev, const Vector &vecOrigin);
NOXREF void UTIL_ParticleEffect(const Vector &vecOrigin, const Vector &vecDirection, ULONG ulColor, ULONG ulCount);
float UTIL_Approach(float target, float value, float speed);
float UTIL_ApproachAngle(float target, float value, float speed);
float UTIL_AngleDistance(float next, float cur);
float_precision UTIL_ApproachAngle(float target, float value, float speed);
float_precision UTIL_AngleDistance(float next, float cur);
float UTIL_SplineFraction(float value, float scale);
char *UTIL_VarArgs(char *format, ...);
NOXREF Vector UTIL_GetAimVector(edict_t *pent, float flSpeed);
@ -451,7 +474,7 @@ void EntvarsKeyvalue(entvars_t *pev, KeyValueData *pkvd);
char UTIL_TextureHit(TraceResult *ptr, Vector vecSrc, Vector vecEnd);
NOXREF int GetPlayerTeam(int index);
bool UTIL_IsGame(const char *gameName);
float UTIL_GetPlayerGaitYaw(int playerIndex);
float_precision UTIL_GetPlayerGaitYaw(int playerIndex);
/*
* Declared for function overload
@ -478,7 +501,7 @@ typedef int (CSaveRestoreBuffer::*CSAVERESTOREBUFFER_POINTER)(const char *,const
#endif // HOOK_GAMEDLL
#if 0
#if 1
extern void *addr_orig;
extern char patchByte[5];
@ -486,8 +509,4 @@ extern char patchByteOriginal[5];
#endif
// Refs
extern Vector (*pFireBullets3)(Vector, Vector, float, float, int, int, int, float, entvars_t *, bool, int);
#endif // UTIL_H

View File

@ -95,7 +95,7 @@ public:
return Vector2D(0, 0);
flLen = 1 / flLen;
#ifdef HOOK_GAMEDLL
return Vector2D((vec_t)(x * flLen), (vec_t)(y * flLen));
#else
@ -130,6 +130,7 @@ public:
return (x > -tolerance && x < tolerance &&
y > -tolerance && y < tolerance);
}
};/* size: 8, cachelines: 1, members: 2 */
inline float DotProduct(const Vector2D &a, const Vector2D &b)
@ -227,7 +228,6 @@ public:
float_precision y1 = (float_precision)y;
float_precision z1 = (float_precision)z;
return sqrt(x1 * x1 + y1 * y1 + z1 * z1);
//return sqrt((float_precision)(x * x + y * y + z * z));
@ -250,8 +250,8 @@ public:
float flLen = Length();
if (flLen == 0)
return Vector(0, 0, 1);
flLen = 1 / flLen;
flLen = 1 / flLen;
return Vector(x * flLen, y * flLen, z * flLen);
}
#else
@ -260,8 +260,8 @@ public:
float_precision flLen = Length();
if (flLen == 0)
return Vector(0, 0, 1);
vec_t fTemp = (vec_t)(1 / flLen);
vec_t fTemp = (vec_t)(1 / flLen);
return Vector(x * fTemp, y * fTemp, z * fTemp);
}
// for out precision normalize
@ -273,8 +273,8 @@ public:
float_precision flLen = Length();
if (flLen == 0)
return Vector(0, 0, 1);
flLen = 1 / flLen;
flLen = 1 / flLen;
return Vector((vec_t)(x * flLen), (vec_t)(y * flLen), (vec_t)(z * flLen));
#endif // HOOK_GAMEDLL
}
@ -356,7 +356,7 @@ template<
typename Z,
typename LenType
>
inline LenType LenghtSubtract(Vector vecStart, Vector vecDest)
inline LenType LengthSubtract(Vector vecStart, Vector vecDest)
{
X floatX = (vecDest.x - vecStart.x);
Y floatY = (vecDest.y - vecStart.y);
@ -389,10 +389,10 @@ inline Vector NormalizeSubtract(Vector vecStart, Vector vecDest)
}
else
{
flLen = 1.0 / flLen;
dir.x = (vec_t)(floatX * flLen);
dir.y = (vec_t)(floatY * flLen);
flLen = 1.0 / flLen;
dir.x = (vec_t)(floatX * flLen);
dir.y = (vec_t)(floatY * flLen);
dir.z = (vec_t)(floatZ * flLen);
}
#else

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