mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-27 07:05:38 +03:00
WIP: full of reversed basic part
This commit is contained in:
parent
d4cf69b587
commit
625ef14d46
@ -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')
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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];}
|
||||
|
@ -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,107 +37,138 @@
|
||||
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 );
|
||||
int (*IsHardware)(void);
|
||||
|
||||
// Only called by hardware interface
|
||||
void ( *GL_StudioDrawShadow ) ( void );
|
||||
void ( *GL_SetRenderMode ) ( int mode );
|
||||
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;
|
||||
|
||||
|
||||
@ -124,8 +176,9 @@ typedef struct server_studio_api_s
|
||||
typedef struct r_studio_interface_s
|
||||
{
|
||||
int version;
|
||||
int ( *StudioDrawModel ) ( int flags );
|
||||
int ( *StudioDrawPlayer ) ( int flags, struct entity_state_s *pplayer );
|
||||
int (*StudioDrawModel)(int flags);
|
||||
int (*StudioDrawPlayer)(int flags, struct entity_state_s *pplayer);
|
||||
|
||||
} r_studio_interface_t;
|
||||
|
||||
extern r_studio_interface_t *pStudioAPI;
|
||||
@ -136,16 +189,16 @@ extern r_studio_interface_t *pStudioAPI;
|
||||
typedef struct sv_blending_interface_s
|
||||
{
|
||||
int version;
|
||||
|
||||
void ( *SV_StudioSetupBones )( struct model_s *pModel,
|
||||
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
|
||||
|
@ -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),
|
||||
|
@ -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
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -803,7 +803,7 @@ void StudioCalcBoneAdj(float dadt, float *adj, const byte *pcontroller1, const b
|
||||
|
||||
value = (1.0 - value) * pbonecontroller[j].start + value * pbonecontroller[j].end;
|
||||
}
|
||||
switch(pbonecontroller[j].type & STUDIO_TYPES)
|
||||
switch (pbonecontroller[j].type & STUDIO_TYPES)
|
||||
{
|
||||
case STUDIO_XR:
|
||||
case STUDIO_YR:
|
||||
|
@ -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
|
||||
|
||||
|
@ -28,11 +28,13 @@ TYPEDESCRIPTION CPendulum::m_SaveData[] =
|
||||
|
||||
#else
|
||||
|
||||
TYPEDESCRIPTION (*CFuncRotating::pm_SaveData)[5];
|
||||
TYPEDESCRIPTION (*CPendulum::pm_SaveData)[8];
|
||||
TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CFuncRotating, m_SaveData)[5];
|
||||
TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CPendulum, m_SaveData)[8];
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
// BModelOrigin - calculates origin of a bmodel from absmin/size because all bmodel origins are 0 0 0
|
||||
|
||||
/* <1c36f> ../cstrike/dlls/bmodels.cpp:43 */
|
||||
Vector VecBModelOrigin(entvars_t *pevBModel)
|
||||
{
|
||||
@ -43,107 +45,183 @@ Vector VecBModelOrigin(entvars_t *pevBModel)
|
||||
LINK_ENTITY_TO_CLASS(func_wall, CFuncWall);
|
||||
|
||||
/* <1d193> ../cstrike/dlls/bmodels.cpp:65 */
|
||||
NOBODY void CFuncWall::__MAKE_VHOOK(Spawn)(void)
|
||||
void CFuncWall::__MAKE_VHOOK(Spawn)(void)
|
||||
{
|
||||
pev->angles = g_vecZero;
|
||||
|
||||
// so it doesn't get pushed by anything
|
||||
pev->movetype = MOVETYPE_PUSH;
|
||||
pev->solid = SOLID_BSP;
|
||||
|
||||
SET_MODEL(ENT(pev), STRING(pev->model));
|
||||
|
||||
// If it can't move/go away, it's really part of the world
|
||||
pev->flags |= FL_WORLDBRUSH;
|
||||
}
|
||||
|
||||
/* <1d873> ../cstrike/dlls/bmodels.cpp:77 */
|
||||
NOBODY void CFuncWall::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
|
||||
void CFuncWall::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
|
||||
{
|
||||
// Use(CFuncWall *const this,
|
||||
// class CBaseEntity *pActivator,
|
||||
// class CBaseEntity *pCaller,
|
||||
// USE_TYPE useType,
|
||||
// float value); // 77
|
||||
if (ShouldToggle(useType, (int)(pev->frame)))
|
||||
{
|
||||
pev->frame = 1.0 - pev->frame;
|
||||
}
|
||||
}
|
||||
|
||||
/* <1e44e> ../cstrike/dlls/bmodels.cpp:96 */
|
||||
LINK_ENTITY_TO_CLASS(func_wall_toggle, CFuncWallToggle);
|
||||
|
||||
/* <1e28f> ../cstrike/dlls/bmodels.cpp:98 */
|
||||
NOBODY void CFuncWallToggle::__MAKE_VHOOK(Spawn)(void)
|
||||
void CFuncWallToggle::__MAKE_VHOOK(Spawn)(void)
|
||||
{
|
||||
// Spawn(CFuncWall *const this); // 100
|
||||
// TurnOff(CFuncWallToggle *const this); // 102
|
||||
CFuncWall::Spawn();
|
||||
|
||||
if (pev->spawnflags & SF_WALL_START_OFF)
|
||||
{
|
||||
TurnOff();
|
||||
}
|
||||
}
|
||||
|
||||
/* <1e518> ../cstrike/dlls/bmodels.cpp:106 */
|
||||
NOBODY void CFuncWallToggle::TurnOff(void)
|
||||
void CFuncWallToggle::TurnOff(void)
|
||||
{
|
||||
pev->solid = SOLID_NOT;
|
||||
pev->effects |= EF_NODRAW;
|
||||
UTIL_SetOrigin(pev, pev->origin);
|
||||
}
|
||||
|
||||
/* <1e53a> ../cstrike/dlls/bmodels.cpp:114 */
|
||||
NOBODY void CFuncWallToggle::TurnOn(void)
|
||||
void CFuncWallToggle::TurnOn(void)
|
||||
{
|
||||
pev->solid = SOLID_BSP;
|
||||
pev->effects &= ~EF_NODRAW;
|
||||
UTIL_SetOrigin(pev, pev->origin);
|
||||
}
|
||||
|
||||
/* <1e55c> ../cstrike/dlls/bmodels.cpp:122 */
|
||||
NOBODY BOOL CFuncWallToggle::IsOn(void)
|
||||
BOOL CFuncWallToggle::IsOn(void)
|
||||
{
|
||||
if (pev->solid == SOLID_NOT)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* <1e101> ../cstrike/dlls/bmodels.cpp:130 */
|
||||
NOBODY void CFuncWallToggle::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
|
||||
void CFuncWallToggle::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
|
||||
{
|
||||
// {
|
||||
// int status; // 132
|
||||
// IsOn(CFuncWallToggle *const this); // 132
|
||||
// TurnOff(CFuncWallToggle *const this); // 137
|
||||
// TurnOn(CFuncWallToggle *const this); // 139
|
||||
// }
|
||||
int status = IsOn();
|
||||
|
||||
if (ShouldToggle(useType, status))
|
||||
{
|
||||
if (status)
|
||||
TurnOff();
|
||||
else
|
||||
TurnOn();
|
||||
}
|
||||
}
|
||||
|
||||
/* <1e57d> ../cstrike/dlls/bmodels.cpp:155 */
|
||||
LINK_ENTITY_TO_CLASS(func_conveyor, CFuncConveyor);
|
||||
|
||||
/* <1e1c3> ../cstrike/dlls/bmodels.cpp:156 */
|
||||
NOBODY void CFuncConveyor::__MAKE_VHOOK(Spawn)(void)
|
||||
void CFuncConveyor::__MAKE_VHOOK(Spawn)(void)
|
||||
{
|
||||
// Spawn(CFuncWall *const this); // 159
|
||||
// UpdateSpeed(CFuncConveyor *const this,
|
||||
// float speed); // 174
|
||||
SetMovedir(pev);
|
||||
CFuncWall::Spawn();
|
||||
|
||||
if (!(pev->spawnflags & SF_CONVEYOR_VISUAL))
|
||||
{
|
||||
pev->flags |= FL_CONVEYOR;
|
||||
}
|
||||
|
||||
// HACKHACK - This is to allow for some special effects
|
||||
if (pev->spawnflags & SF_CONVEYOR_NOTSOLID)
|
||||
{
|
||||
// Don't want the engine thinking we've got special contents on this brush
|
||||
pev->solid = SOLID_NOT;
|
||||
pev->skin = 0;
|
||||
}
|
||||
|
||||
if (pev->speed == 0)
|
||||
pev->speed = 100;
|
||||
|
||||
UpdateSpeed(pev->speed);
|
||||
}
|
||||
|
||||
// HACKHACK -- This is ugly, but encode the speed in the rendercolor to avoid adding more data to the network stream
|
||||
|
||||
/* <1e647> ../cstrike/dlls/bmodels.cpp:179 */
|
||||
NOBODY void CFuncConveyor::UpdateSpeed(float speed)
|
||||
void CFuncConveyor::UpdateSpeed(float speed)
|
||||
{
|
||||
// {
|
||||
// int speedCode; // 182
|
||||
// fabs(double __x); // 182
|
||||
// }
|
||||
// Encode it as an integer with 4 fractional bits
|
||||
int speedCode = (int)(fabs((float_precision)speed) * 16.0);
|
||||
|
||||
if (speed < 0)
|
||||
pev->rendercolor.x = 1;
|
||||
else
|
||||
pev->rendercolor.x = 0;
|
||||
|
||||
pev->rendercolor.y = (speedCode >> 8);
|
||||
pev->rendercolor.z = (speedCode & 0xFF);
|
||||
}
|
||||
|
||||
/* <1e021> ../cstrike/dlls/bmodels.cpp:194 */
|
||||
NOBODY void CFuncConveyor::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
|
||||
void CFuncConveyor::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
|
||||
{
|
||||
// UpdateSpeed(CFuncConveyor *const this,
|
||||
// float speed); // 197
|
||||
pev->speed = -pev->speed;
|
||||
UpdateSpeed(pev->speed);
|
||||
}
|
||||
|
||||
/* <1e695> ../cstrike/dlls/bmodels.cpp:217 */
|
||||
LINK_ENTITY_TO_CLASS(func_illusionary, CFuncIllusionary);
|
||||
|
||||
/* <1ddc9> ../cstrike/dlls/bmodels.cpp:219 */
|
||||
NOBODY void CFuncIllusionary::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
|
||||
void CFuncIllusionary::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
|
||||
{
|
||||
// FStrEq(const char *sz1,
|
||||
// const char *sz2); // 221
|
||||
// KeyValue(CFuncIllusionary *const this,
|
||||
// KeyValueData *pkvd); // 219
|
||||
//skin is used for content type
|
||||
if (FStrEq(pkvd->szKeyName, "skin"))
|
||||
{
|
||||
pev->skin = (int)Q_atof(pkvd->szValue);
|
||||
pkvd->fHandled = TRUE;
|
||||
}
|
||||
else
|
||||
CBaseToggle::KeyValue(pkvd);
|
||||
}
|
||||
|
||||
/* <1d1db> ../cstrike/dlls/bmodels.cpp:230 */
|
||||
NOBODY void CFuncIllusionary::__MAKE_VHOOK(Spawn)(void)
|
||||
void CFuncIllusionary::__MAKE_VHOOK(Spawn)(void)
|
||||
{
|
||||
pev->angles = g_vecZero;
|
||||
pev->movetype = MOVETYPE_NONE;
|
||||
|
||||
// always solid_not
|
||||
pev->solid = SOLID_NOT;
|
||||
|
||||
SET_MODEL(ENT(pev), STRING(pev->model));
|
||||
|
||||
// I'd rather eat the network bandwidth of this than figure out how to save/restore
|
||||
// these entities after they have been moved to the client, or respawn them ala Quake
|
||||
// Perhaps we can do this in deathmatch only.
|
||||
// MAKE_STATIC(ENT(pev));
|
||||
}
|
||||
|
||||
/* <1e75f> ../cstrike/dlls/bmodels.cpp:262 */
|
||||
LINK_ENTITY_TO_CLASS(func_monsterclip, CFuncMonsterClip);
|
||||
|
||||
/* <1e24f> ../cstrike/dlls/bmodels.cpp:264 */
|
||||
NOBODY void CFuncMonsterClip::__MAKE_VHOOK(Spawn)(void)
|
||||
void CFuncMonsterClip::__MAKE_VHOOK(Spawn)(void)
|
||||
{
|
||||
// Spawn(CFuncWall *const this); // 266
|
||||
CFuncWall::Spawn();
|
||||
|
||||
if (CVAR_GET_FLOAT("showtriggers") == 0)
|
||||
{
|
||||
pev->effects = EF_NODRAW;
|
||||
}
|
||||
|
||||
pev->flags |= FL_MONSTERCLIP;
|
||||
}
|
||||
|
||||
/* <1e82c> ../cstrike/dlls/bmodels.cpp:313 */
|
||||
@ -153,122 +231,418 @@ LINK_ENTITY_TO_CLASS(func_rotating, CFuncRotating);
|
||||
IMPLEMENT_SAVERESTORE(CFuncRotating, CBaseEntity);
|
||||
|
||||
/* <1dc21> ../cstrike/dlls/bmodels.cpp:315 */
|
||||
NOBODY void CFuncRotating::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
|
||||
void CFuncRotating::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
|
||||
{
|
||||
// FStrEq(const char *sz1,
|
||||
// const char *sz2); // 317
|
||||
// FStrEq(const char *sz1,
|
||||
// const char *sz2); // 322
|
||||
// FStrEq(const char *sz1,
|
||||
// const char *sz2); // 332
|
||||
// FStrEq(const char *sz1,
|
||||
// const char *sz2); // 339
|
||||
// KeyValue(CBaseEntity *const this,
|
||||
// KeyValueData *pkvd); // 345
|
||||
// {
|
||||
// Vector tmp; // 334
|
||||
// operator!=(const Vector *const this,
|
||||
// const Vector &v); // 336
|
||||
// }
|
||||
// atoi(const char *__nptr); // 341
|
||||
// atof(const char *__nptr); // 324
|
||||
// atof(const char *__nptr); // 319
|
||||
if (FStrEq(pkvd->szKeyName, "fanfriction"))
|
||||
{
|
||||
m_flFanFriction = Q_atof(pkvd->szValue) / 100;
|
||||
pkvd->fHandled = TRUE;
|
||||
}
|
||||
else if (FStrEq(pkvd->szKeyName, "Volume"))
|
||||
{
|
||||
m_flVolume = Q_atof(pkvd->szValue) / 10.0;
|
||||
|
||||
if (m_flVolume > 1.0)
|
||||
m_flVolume = 1.0;
|
||||
|
||||
if (m_flVolume < 0.0)
|
||||
m_flVolume = 0.0;
|
||||
|
||||
pkvd->fHandled = TRUE;
|
||||
}
|
||||
else if (FStrEq(pkvd->szKeyName, "spawnorigin"))
|
||||
{
|
||||
Vector tmp;
|
||||
UTIL_StringToVector((float *)tmp, pkvd->szValue);
|
||||
|
||||
if (tmp != g_vecZero)
|
||||
{
|
||||
pev->origin = tmp;
|
||||
}
|
||||
}
|
||||
else if (FStrEq(pkvd->szKeyName, "sounds"))
|
||||
{
|
||||
m_sounds = Q_atoi(pkvd->szValue);
|
||||
pkvd->fHandled = TRUE;
|
||||
}
|
||||
else
|
||||
CBaseEntity::KeyValue(pkvd);
|
||||
}
|
||||
|
||||
// QUAKED func_rotating (0 .5 .8) ? START_ON REVERSE X_AXIS Y_AXIS
|
||||
// You need to have an origin brush as part of this entity. The
|
||||
// center of that brush will be
|
||||
// the point around which it is rotated. It will rotate around the Z
|
||||
// axis by default. You can
|
||||
// check either the X_AXIS or Y_AXIS box to change that.
|
||||
|
||||
// "speed" determines how fast it moves; default value is 100.
|
||||
// "dmg" damage to inflict when blocked (2 default)
|
||||
|
||||
// REVERSE will cause the it to rotate in the opposite direction.
|
||||
|
||||
/* <1d5c4> ../cstrike/dlls/bmodels.cpp:362 */
|
||||
NOBODY void CFuncRotating::__MAKE_VHOOK(Spawn)(void)
|
||||
void CFuncRotating::__MAKE_VHOOK(Spawn)(void)
|
||||
{
|
||||
// operator*(const Vector ::Spawn(// float fl); // 404
|
||||
// set final pitch. Must not be PITCH_NORM, since we
|
||||
// plan on pitch shifting later.
|
||||
m_pitch = PITCH_NORM - 1;
|
||||
|
||||
// maintain compatibility with previous maps
|
||||
if (m_flVolume == 0.0)
|
||||
m_flVolume = 1.0;
|
||||
|
||||
// if the designer didn't set a sound attenuation, default to one.
|
||||
m_flAttenuation = ATTN_NORM;
|
||||
|
||||
if (pev->spawnflags & SF_BRUSH_ROTATE_SMALLRADIUS)
|
||||
{
|
||||
m_flAttenuation = ATTN_IDLE;
|
||||
}
|
||||
else if (pev->spawnflags & SF_BRUSH_ROTATE_MEDIUMRADIUS)
|
||||
{
|
||||
m_flAttenuation = ATTN_STATIC;
|
||||
}
|
||||
else if (pev->spawnflags & SF_BRUSH_ROTATE_LARGERADIUS)
|
||||
{
|
||||
m_flAttenuation = ATTN_NORM;
|
||||
}
|
||||
|
||||
// prevent divide by zero if level designer forgets friction!
|
||||
if (m_flFanFriction == 0)
|
||||
{
|
||||
m_flFanFriction = 1;
|
||||
}
|
||||
|
||||
if (pev->spawnflags & SF_BRUSH_ROTATE_Z_AXIS)
|
||||
{
|
||||
pev->movedir = Vector(0, 0, 1);
|
||||
}
|
||||
else if (pev->spawnflags & SF_BRUSH_ROTATE_X_AXIS)
|
||||
{
|
||||
pev->movedir = Vector(1, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
// y-axis
|
||||
pev->movedir = Vector(0, 1, 0);
|
||||
}
|
||||
|
||||
// check for reverse rotation
|
||||
if (pev->spawnflags & SF_BRUSH_ROTATE_BACKWARDS)
|
||||
{
|
||||
pev->movedir = pev->movedir * -1;
|
||||
}
|
||||
|
||||
// some rotating objects like fake volumetric lights will not be solid.
|
||||
if (pev->spawnflags & SF_ROTATING_NOT_SOLID)
|
||||
{
|
||||
pev->solid = SOLID_NOT;
|
||||
pev->skin = CONTENTS_EMPTY;
|
||||
pev->movetype = MOVETYPE_PUSH;
|
||||
}
|
||||
else
|
||||
{
|
||||
pev->solid = SOLID_BSP;
|
||||
pev->movetype = MOVETYPE_PUSH;
|
||||
}
|
||||
|
||||
UTIL_SetOrigin(pev, pev->origin);
|
||||
SET_MODEL(ENT(pev), STRING(pev->model));
|
||||
|
||||
SetUse(&CFuncRotating::RotatingUse);
|
||||
|
||||
// did level designer forget to assign speed?
|
||||
if (pev->speed <= 0)
|
||||
{
|
||||
pev->speed = 0;
|
||||
}
|
||||
|
||||
// Removed this per level designers request. -- JAY
|
||||
// if (pev->dmg == 0)
|
||||
// pev->dmg = 2;
|
||||
|
||||
// instant-use brush?
|
||||
if (pev->spawnflags & SF_BRUSH_ROTATE_INSTANT)
|
||||
{
|
||||
SetThink(&CFuncRotating::SUB_CallUseToggle);
|
||||
|
||||
// leave a magic delay for client to start up
|
||||
pev->nextthink = pev->ltime + 1.5;
|
||||
}
|
||||
|
||||
// can this brush inflict pain?
|
||||
if (pev->spawnflags & SF_BRUSH_HURT)
|
||||
{
|
||||
SetTouch(&CFuncRotating::HurtTouch);
|
||||
}
|
||||
|
||||
Precache();
|
||||
}
|
||||
|
||||
/* <1d28a> ../cstrike/dlls/bmodels.cpp:447 */
|
||||
NOBODY void CFuncRotating::__MAKE_VHOOK(Precache)(void)
|
||||
void CFuncRotating::__MAKE_VHOOK(Precache)(void)
|
||||
{
|
||||
// {
|
||||
// char *szSoundFile; // 449
|
||||
// operator!=(const Vector *const this,
|
||||
// const Vector &v); // 502
|
||||
// }
|
||||
char *szSoundFile = (char *)STRING(pev->message);
|
||||
|
||||
// set up fan sounds
|
||||
if (!FStringNull(pev->message) && Q_strlen(szSoundFile) > 0)
|
||||
{
|
||||
// if a path is set for a wave, use it
|
||||
PRECACHE_SOUND(szSoundFile);
|
||||
pev->noiseRunning = ALLOC_STRING(szSoundFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
// otherwise use preset sound
|
||||
switch (m_sounds)
|
||||
{
|
||||
case 1:
|
||||
PRECACHE_SOUND("fans/fan1.wav");
|
||||
pev->noiseRunning = ALLOC_STRING("fans/fan1.wav");
|
||||
break;
|
||||
case 2:
|
||||
PRECACHE_SOUND("fans/fan2.wav");
|
||||
pev->noiseRunning = ALLOC_STRING("fans/fan2.wav");
|
||||
break;
|
||||
case 3:
|
||||
PRECACHE_SOUND("fans/fan3.wav");
|
||||
pev->noiseRunning = ALLOC_STRING("fans/fan3.wav");
|
||||
break;
|
||||
case 4:
|
||||
PRECACHE_SOUND("fans/fan4.wav");
|
||||
pev->noiseRunning = ALLOC_STRING("fans/fan4.wav");
|
||||
break;
|
||||
case 5:
|
||||
PRECACHE_SOUND("fans/fan5.wav");
|
||||
pev->noiseRunning = ALLOC_STRING("fans/fan5.wav");
|
||||
break;
|
||||
|
||||
case 0:
|
||||
default:
|
||||
if (!FStringNull(pev->message) && Q_strlen(szSoundFile) > 0)
|
||||
{
|
||||
PRECACHE_SOUND(szSoundFile);
|
||||
pev->noiseRunning = ALLOC_STRING(szSoundFile);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
pev->noiseRunning = ALLOC_STRING("common/null.wav");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pev->avelocity != g_vecZero)
|
||||
{
|
||||
// if fan was spinning, and we went through transition or save/restore,
|
||||
// make sure we restart the sound. 1.5 sec delay is magic number. KDB
|
||||
SetThink(&CFuncRotating::SpinUp);
|
||||
pev->nextthink = pev->ltime + 1.5;
|
||||
}
|
||||
}
|
||||
|
||||
// Touch - will hurt others based on how fast the brush is spinning
|
||||
|
||||
/* <1dea4> ../cstrike/dlls/bmodels.cpp:517 */
|
||||
NOBODY void CFuncRotating::HurtTouch(CBaseEntity *pOther)
|
||||
void CFuncRotating::HurtTouch(CBaseEntity *pOther)
|
||||
{
|
||||
// {
|
||||
// entvars_t *pevOther; // 519
|
||||
// Length(const Vector *const this); // 526
|
||||
// VecBModelOrigin(entvars_t *pevBModel); // 530
|
||||
// operator-(const Vector *const this,
|
||||
// const Vector &v); // 530
|
||||
// Normalize(const Vector *const this); // 530
|
||||
// operator*(const Vector *const this,
|
||||
// float fl); // 530
|
||||
// }
|
||||
entvars_t *pevOther = pOther->pev;
|
||||
|
||||
// we can't hurt this thing, so we're not concerned with it
|
||||
if (pevOther->takedamage == DAMAGE_NO)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// calculate damage based on rotation speed
|
||||
pev->dmg = pev->avelocity.Length() / 10;
|
||||
pOther->TakeDamage(pev, pev, pev->dmg, DMG_CRUSH);
|
||||
pevOther->velocity = (pevOther->origin - VecBModelOrigin(pev)).Normalize() * pev->dmg;
|
||||
}
|
||||
|
||||
// RampPitchVol - ramp pitch and volume up to final values, based on difference
|
||||
// between how fast we're going vs how fast we plan to go
|
||||
|
||||
/* <1e8f9> ../cstrike/dlls/bmodels.cpp:540 */
|
||||
NOBODY void CFuncRotating::RampPitchVol(int fUp)
|
||||
void CFuncRotating::RampPitchVol(int fUp)
|
||||
{
|
||||
// {
|
||||
// Vector vecAVel; // 543
|
||||
// vec_t vecCur; // 544
|
||||
// vec_t vecFinal; // 545
|
||||
// float fpct; // 546
|
||||
// float fvol; // 547
|
||||
// float fpitch; // 548
|
||||
// int pitch; // 549
|
||||
// Vector(Vector *const this,
|
||||
// const Vector &v); // 543
|
||||
// }
|
||||
Vector vecAVel = pev->avelocity;
|
||||
float_precision vecCur;
|
||||
float_precision vecFinal;
|
||||
float_precision fpct;
|
||||
float fvol;
|
||||
float fpitch;
|
||||
int pitch;
|
||||
|
||||
// get current angular velocity
|
||||
vecCur = abs((int)(vecAVel.x != 0 ? vecAVel.x : (vecAVel.y != 0 ? vecAVel.y : vecAVel.z)));
|
||||
|
||||
// get target angular velocity
|
||||
vecFinal = (pev->movedir.x != 0 ? pev->movedir.x : (pev->movedir.y != 0 ? pev->movedir.y : pev->movedir.z));
|
||||
vecFinal *= pev->speed;
|
||||
vecFinal = abs((int)vecFinal);
|
||||
|
||||
// calc volume and pitch as % of final vol and pitch
|
||||
fpct = vecCur / vecFinal;
|
||||
|
||||
//if (fUp)
|
||||
//{
|
||||
// // spinup volume ramps up from 50% max vol
|
||||
// fvol = m_flVolume * (0.5 + fpct/2.0);
|
||||
//}
|
||||
//else
|
||||
{
|
||||
// slowdown volume ramps down to 0
|
||||
fvol = m_flVolume * fpct;
|
||||
}
|
||||
|
||||
fpitch = FANPITCHMIN + (FANPITCHMAX - FANPITCHMIN) * fpct;
|
||||
|
||||
pitch = (int)fpitch;
|
||||
if (pitch == PITCH_NORM)
|
||||
{
|
||||
pitch = PITCH_NORM - 1;
|
||||
}
|
||||
|
||||
// change the fan's vol and pitch
|
||||
EMIT_SOUND_DYN(ENT(pev), CHAN_STATIC, (char *)STRING(pev->noiseRunning), fvol, m_flAttenuation, (SND_CHANGE_PITCH | SND_CHANGE_VOL), pitch);
|
||||
}
|
||||
|
||||
// SpinUp - accelerates a non-moving func_rotating up to it's speed
|
||||
|
||||
/* <1ea74> ../cstrike/dlls/bmodels.cpp:585 */
|
||||
NOBODY void CFuncRotating::SpinUp(void)
|
||||
void CFuncRotating::SpinUp(void)
|
||||
{
|
||||
// {
|
||||
// Vector vecAVel; // 587
|
||||
// operator*(const Vector *const this,
|
||||
// float fl); // 590
|
||||
// operator+(const Vector *const this,
|
||||
// const Vector &v); // 590
|
||||
// Rotate(CFuncRotating *const this); // 604
|
||||
// }
|
||||
//rotational velocity
|
||||
Vector vecAVel;
|
||||
|
||||
pev->nextthink = pev->ltime + 0.1;
|
||||
pev->avelocity = pev->avelocity + (pev->movedir * (pev->speed * m_flFanFriction));
|
||||
|
||||
// cache entity's rotational velocity
|
||||
vecAVel = pev->avelocity;
|
||||
|
||||
// if we've met or exceeded target speed, set target speed and stop thinking
|
||||
if (abs((int)vecAVel.x) >= abs((int)(pev->movedir.x * pev->speed))
|
||||
&& abs((int)vecAVel.y) >= abs((int)(pev->movedir.y * pev->speed))
|
||||
&& abs((int)vecAVel.z) >= abs((int)(pev->movedir.z * pev->speed)))
|
||||
{
|
||||
// set speed in case we overshot
|
||||
pev->avelocity = pev->movedir * pev->speed;
|
||||
EMIT_SOUND_DYN(ENT(pev), CHAN_STATIC, (char *)STRING(pev->noiseRunning), m_flVolume, m_flAttenuation, (SND_CHANGE_PITCH | SND_CHANGE_VOL), FANPITCHMAX);
|
||||
|
||||
SetThink(&CFuncRotating::Rotate);
|
||||
Rotate();
|
||||
}
|
||||
else
|
||||
{
|
||||
RampPitchVol(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
/* <1e9c3> ../cstrike/dlls/bmodels.cpp:615 */
|
||||
NOBODY void CFuncRotating::SpinDown(void)
|
||||
void CFuncRotating::SpinDown(void)
|
||||
{
|
||||
// {
|
||||
// Vector vecAVel; // 617
|
||||
// vec_t vecdir; // 618
|
||||
// operator*(const Vector *const this,
|
||||
// float fl); // 622
|
||||
// operator-(const Vector *const this,
|
||||
// const Vector &v); // 622
|
||||
// Rotate(CFuncRotating *const this); // 645
|
||||
// }
|
||||
//rotational velocity
|
||||
Vector vecAVel;
|
||||
vec_t vecdir;
|
||||
|
||||
pev->nextthink = pev->ltime + 0.1;
|
||||
|
||||
//spin down slower than spinup
|
||||
pev->avelocity = pev->avelocity - (pev->movedir * (pev->speed * m_flFanFriction));
|
||||
|
||||
// cache entity's rotational velocity
|
||||
vecAVel = pev->avelocity;
|
||||
|
||||
if (pev->movedir.x != 0)
|
||||
vecdir = pev->movedir.x;
|
||||
else if (pev->movedir.y != 0)
|
||||
vecdir = pev->movedir.y;
|
||||
else
|
||||
vecdir = pev->movedir.z;
|
||||
|
||||
// if we've met or exceeded target speed, set target speed and stop thinking
|
||||
// (note: must check for movedir > 0 or < 0)
|
||||
if (((vecdir > 0) && (vecAVel.x <= 0 && vecAVel.y <= 0 && vecAVel.z <= 0))
|
||||
|| ((vecdir < 0) && (vecAVel.x >= 0 && vecAVel.y >= 0 && vecAVel.z >= 0)))
|
||||
{
|
||||
// set speed in case we overshot
|
||||
pev->avelocity = g_vecZero;
|
||||
|
||||
// stop sound, we're done
|
||||
EMIT_SOUND_DYN(ENT(pev), CHAN_STATIC, (char *)STRING(pev->noiseRunning), 0, ATTN_NONE, SND_STOP, m_pitch);
|
||||
|
||||
SetThink(&CFuncRotating::Rotate);
|
||||
Rotate();
|
||||
}
|
||||
else
|
||||
{
|
||||
RampPitchVol(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
/* <1d304> ../cstrike/dlls/bmodels.cpp:653 */
|
||||
NOBODY void CFuncRotating::Rotate(void)
|
||||
void CFuncRotating::Rotate(void)
|
||||
{
|
||||
pev->nextthink = pev->ltime + 10;
|
||||
}
|
||||
|
||||
// Rotating Use - when a rotating brush is triggered
|
||||
|
||||
/* <1d60e> ../cstrike/dlls/bmodels.cpp:661 */
|
||||
NOBODY void CFuncRotating::RotatingUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
|
||||
void CFuncRotating::RotatingUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
|
||||
{
|
||||
// operator!=(const Vector *const this,
|
||||
// const Vector &v); // 667
|
||||
// operator!=(const Vector *const this,
|
||||
// const Vector &v); // 683
|
||||
// operator*(const Vector *const this,
|
||||
// float fl); // 694
|
||||
// Rotate(CFuncRotating *const this); // 697
|
||||
// is this a brush that should accelerate and decelerate when turned on/off (fan)?
|
||||
if (pev->spawnflags & SF_BRUSH_ACCDCC)
|
||||
{
|
||||
// fan is spinning, so stop it.
|
||||
if (pev->avelocity != g_vecZero)
|
||||
{
|
||||
SetThink(&CFuncRotating::SpinDown);
|
||||
|
||||
//EMIT_SOUND_DYN(ENT(pev), CHAN_WEAPON, (char *)STRING(pev->noiseStop), m_flVolume, m_flAttenuation, 0, m_pitch);
|
||||
pev->nextthink = pev->ltime + 0.1;
|
||||
}
|
||||
else // fan is not moving, so start it
|
||||
{
|
||||
SetThink(&CFuncRotating::SpinUp);
|
||||
EMIT_SOUND_DYN(ENT(pev), CHAN_STATIC, (char *)STRING(pev->noiseRunning), 0.01, m_flAttenuation, 0, FANPITCHMIN);
|
||||
|
||||
pev->nextthink = pev->ltime + 0.1;
|
||||
}
|
||||
}
|
||||
else if (!(pev->spawnflags & SF_BRUSH_ACCDCC)) // this is a normal start/stop brush.
|
||||
{
|
||||
if (pev->avelocity != g_vecZero)
|
||||
{
|
||||
// play stopping sound here
|
||||
SetThink(&CFuncRotating::SpinDown);
|
||||
|
||||
// EMIT_SOUND_DYN(ENT(pev), CHAN_WEAPON, (char *)STRING(pev->noiseStop), m_flVolume, m_flAttenuation, 0, m_pitch);
|
||||
|
||||
pev->nextthink = pev->ltime + 0.1;
|
||||
// pev->avelocity = g_vecZero;
|
||||
}
|
||||
else
|
||||
{
|
||||
EMIT_SOUND_DYN(ENT(pev), CHAN_STATIC, (char *)STRING(pev->noiseRunning), m_flVolume, m_flAttenuation, 0, FANPITCHMAX);
|
||||
pev->avelocity = pev->movedir * pev->speed;
|
||||
|
||||
SetThink(&CFuncRotating::Rotate);
|
||||
Rotate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// RotatingBlocked - An entity has blocked the brush
|
||||
|
||||
/* <1d325> ../cstrike/dlls/bmodels.cpp:706 */
|
||||
NOBODY void CFuncRotating::__MAKE_VHOOK(Blocked)(CBaseEntity *pOther)
|
||||
void CFuncRotating::__MAKE_VHOOK(Blocked)(CBaseEntity *pOther)
|
||||
{
|
||||
pOther->TakeDamage(pev, pev, pev->dmg, DMG_CRUSH);
|
||||
}
|
||||
|
||||
/* <1eb14> ../cstrike/dlls/bmodels.cpp:747 */
|
||||
@ -278,83 +652,212 @@ LINK_ENTITY_TO_CLASS(func_pendulum, CPendulum);
|
||||
IMPLEMENT_SAVERESTORE(CPendulum, CBaseEntity);
|
||||
|
||||
/* <1db2a> ../cstrike/dlls/bmodels.cpp:765 */
|
||||
NOBODY void CPendulum::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
|
||||
void CPendulum::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
|
||||
{
|
||||
// FStrEq(const char *sz1,
|
||||
// const char *sz2); // 767
|
||||
// FStrEq(const char *sz1,
|
||||
// const char *sz2); // 772
|
||||
// KeyValue(CBaseEntity *const this,
|
||||
// KeyValueData *pkvd); // 778
|
||||
// atof(const char *__nptr); // 769
|
||||
// KeyValue(CPendulum *const this,
|
||||
// KeyValueData *pkvd); // 765
|
||||
if (FStrEq(pkvd->szKeyName, "distance"))
|
||||
{
|
||||
m_distance = Q_atof(pkvd->szValue);
|
||||
pkvd->fHandled = TRUE;
|
||||
}
|
||||
else if (FStrEq(pkvd->szKeyName, "damp"))
|
||||
{
|
||||
m_damp = Q_atof(pkvd->szValue) * 0.001;
|
||||
pkvd->fHandled = TRUE;
|
||||
}
|
||||
else
|
||||
CBaseEntity::KeyValue(pkvd);
|
||||
}
|
||||
|
||||
/* <1d9c7> ../cstrike/dlls/bmodels.cpp:782 */
|
||||
NOBODY void CPendulum::__MAKE_VHOOK(Spawn)(void)
|
||||
void CPendulum::__MAKE_VHOOK(Spawn)(void)
|
||||
{
|
||||
// Spawn(CPendulum *const this); // 782
|
||||
// set the axis of rotation
|
||||
CBaseToggle::AxisDir(pev);
|
||||
|
||||
if (pev->spawnflags & SF_DOOR_PASSABLE)
|
||||
pev->solid = SOLID_NOT;
|
||||
else
|
||||
pev->solid = SOLID_BSP;
|
||||
|
||||
pev->movetype = MOVETYPE_PUSH;
|
||||
UTIL_SetOrigin(pev, pev->origin);
|
||||
SET_MODEL(ENT(pev), STRING(pev->model));
|
||||
|
||||
if (m_distance == 0)
|
||||
return;
|
||||
|
||||
if (pev->speed == 0)
|
||||
pev->speed = 100;
|
||||
|
||||
// Calculate constant acceleration from speed and distance
|
||||
m_accel = (pev->speed * pev->speed) / (2 * fabs((float_precision)m_distance));
|
||||
m_maxSpeed = pev->speed;
|
||||
m_start = pev->angles;
|
||||
m_center = pev->angles + (m_distance * 0.5) * pev->movedir;
|
||||
|
||||
if (pev->spawnflags & SF_BRUSH_ROTATE_INSTANT)
|
||||
{
|
||||
SetThink(&CPendulum::SUB_CallUseToggle);
|
||||
pev->nextthink = gpGlobals->time + 0.1f;
|
||||
}
|
||||
|
||||
pev->speed = 0;
|
||||
SetUse(&CPendulum::PendulumUse);
|
||||
|
||||
if (pev->spawnflags & SF_PENDULUM_SWING)
|
||||
{
|
||||
SetTouch (&CPendulum::RopeTouch);
|
||||
}
|
||||
}
|
||||
|
||||
/* <1d8ec> ../cstrike/dlls/bmodels.cpp:821 */
|
||||
NOBODY void CPendulum::PendulumUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
|
||||
void CPendulum::PendulumUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
|
||||
{
|
||||
// {
|
||||
// float delta; // 827
|
||||
// }
|
||||
// PendulumUse(CPendulum *const this,
|
||||
// class CBaseEntity *pActivator,
|
||||
// class CBaseEntity *pCaller,
|
||||
// USE_TYPE useType,
|
||||
// float value); // 821
|
||||
// Pendulum is moving, stop it and auto-return if necessary
|
||||
if (pev->speed)
|
||||
{
|
||||
if (pev->spawnflags & SF_PENDULUM_AUTO_RETURN)
|
||||
{
|
||||
float_precision delta;
|
||||
|
||||
delta = CBaseToggle::AxisDelta(pev->spawnflags, pev->angles, m_start);
|
||||
|
||||
pev->avelocity = m_maxSpeed * pev->movedir;
|
||||
pev->nextthink = pev->ltime + (delta / m_maxSpeed);
|
||||
SetThink(&CPendulum::Stop);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Dead stop
|
||||
pev->speed = 0;
|
||||
SetThink(NULL);
|
||||
pev->avelocity = g_vecZero;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Start the pendulum moving
|
||||
pev->nextthink = pev->ltime + 0.1f;
|
||||
|
||||
// Save time to calculate dt
|
||||
m_time = gpGlobals->time;
|
||||
SetThink(&CPendulum::Swing);
|
||||
m_dampSpeed = m_maxSpeed;
|
||||
}
|
||||
}
|
||||
|
||||
/* <1d381> ../cstrike/dlls/bmodels.cpp:852 */
|
||||
NOBODY void CPendulum::Stop(void)
|
||||
void CPendulum::Stop(void)
|
||||
{
|
||||
pev->angles = m_start;
|
||||
pev->speed = 0;
|
||||
SetThink(NULL);
|
||||
pev->avelocity = g_vecZero;
|
||||
}
|
||||
|
||||
/* <1d3a7> ../cstrike/dlls/bmodels.cpp:861 */
|
||||
NOBODY void CPendulum::__MAKE_VHOOK(Blocked)(CBaseEntity *pOther)
|
||||
void CPendulum::__MAKE_VHOOK(Blocked)(CBaseEntity *pOther)
|
||||
{
|
||||
m_time = gpGlobals->time;
|
||||
}
|
||||
|
||||
/* <1d533> ../cstrike/dlls/bmodels.cpp:867 */
|
||||
NOBODY void CPendulum::Swing(void)
|
||||
void CPendulum::Swing(void)
|
||||
{
|
||||
// {
|
||||
// float delta; // 869
|
||||
// float dt; // 869
|
||||
// operator*(float fl,
|
||||
// const Vector &v); // 885
|
||||
// }
|
||||
float delta, dt;
|
||||
|
||||
delta = CBaseToggle::AxisDelta(pev->spawnflags, pev->angles, m_center);
|
||||
|
||||
// How much time has passed?
|
||||
dt = gpGlobals->time - m_time;
|
||||
|
||||
// Remember the last time called
|
||||
m_time = gpGlobals->time;
|
||||
|
||||
if (delta > 0 && m_accel > 0)
|
||||
{
|
||||
// Integrate velocity
|
||||
pev->speed -= m_accel * dt;
|
||||
}
|
||||
else
|
||||
pev->speed += m_accel * dt;
|
||||
|
||||
if (pev->speed > m_maxSpeed)
|
||||
pev->speed = m_maxSpeed;
|
||||
|
||||
else if (pev->speed < -m_maxSpeed)
|
||||
pev->speed = -m_maxSpeed;
|
||||
|
||||
// scale the destdelta vector by the time spent traveling to get velocity
|
||||
pev->avelocity = pev->speed * pev->movedir;
|
||||
|
||||
// Call this again
|
||||
pev->nextthink = pev->ltime + 0.1;
|
||||
|
||||
if (m_damp)
|
||||
{
|
||||
m_dampSpeed -= m_damp * m_dampSpeed * dt;
|
||||
|
||||
if (m_dampSpeed < 30.0)
|
||||
{
|
||||
pev->angles = m_center;
|
||||
pev->speed = 0;
|
||||
SetThink(NULL);
|
||||
pev->avelocity = g_vecZero;
|
||||
}
|
||||
else if (pev->speed > m_dampSpeed)
|
||||
pev->speed = m_dampSpeed;
|
||||
|
||||
else if (pev->speed < -m_dampSpeed)
|
||||
pev->speed = -m_dampSpeed;
|
||||
}
|
||||
}
|
||||
|
||||
/* <1d3f5> ../cstrike/dlls/bmodels.cpp:909 */
|
||||
NOBODY void CPendulum::__MAKE_VHOOK(Touch)(CBaseEntity *pOther)
|
||||
void CPendulum::__MAKE_VHOOK(Touch)(CBaseEntity *pOther)
|
||||
{
|
||||
// {
|
||||
// entvars_t *pevOther; // 911
|
||||
// float damage; // 921
|
||||
// VecBModelOrigin(entvars_t *pevBModel); // 928
|
||||
// operator-(const Vector *const this,
|
||||
// const Vector &v); // 928
|
||||
// Normalize(const Vector *const this); // 928
|
||||
// operator*(const Vector *const this,
|
||||
// float fl); // 928
|
||||
// }
|
||||
entvars_t *pevOther = pOther->pev;
|
||||
|
||||
if (pev->dmg <= 0)
|
||||
return;
|
||||
|
||||
// we can't hurt this thing, so we're not concerned with it
|
||||
if (pevOther->takedamage == DAMAGE_NO)
|
||||
return;
|
||||
|
||||
// calculate damage based on rotation speed
|
||||
float damage = pev->dmg * pev->speed * 0.01;
|
||||
|
||||
if (damage < 0)
|
||||
{
|
||||
damage = -damage;
|
||||
}
|
||||
|
||||
pOther->TakeDamage(pev, pev, damage, DMG_CRUSH);
|
||||
pevOther->velocity = (pevOther->origin - VecBModelOrigin(pev)).Normalize() * damage;
|
||||
}
|
||||
|
||||
/* <1da85> ../cstrike/dlls/bmodels.cpp:931 */
|
||||
NOBODY void CPendulum::RopeTouch(CBaseEntity *pOther)
|
||||
void CPendulum::RopeTouch(CBaseEntity *pOther)
|
||||
{
|
||||
// {
|
||||
// entvars_t *pevOther; // 933
|
||||
// edict(CBaseEntity *const this); // 946
|
||||
// }
|
||||
// RopeTouch(CPendulum *const this,
|
||||
// class CBaseEntity *pOther); // 931
|
||||
entvars_t *pevOther = pOther->pev;
|
||||
|
||||
// not a player!
|
||||
if (!pOther->IsPlayer())
|
||||
{
|
||||
ALERT(at_console, "Not a client\n");
|
||||
return;
|
||||
}
|
||||
|
||||
// this player already on the rope.
|
||||
if (ENT(pevOther) == pev->enemy)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
pev->enemy = pOther->edict();
|
||||
pevOther->velocity = g_vecZero;
|
||||
pevOther->movetype = MOVETYPE_NONE;
|
||||
}
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
@ -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
|
||||
|
@ -53,6 +53,9 @@
|
||||
extern int _navAreaCount;
|
||||
extern int _currentIndex;
|
||||
|
||||
class CCSBot;
|
||||
class BotChatterInterface;
|
||||
|
||||
/* <3327a8> ../cstrike/dlls/bot/cs_bot.h:44 */
|
||||
class BotState
|
||||
{
|
||||
@ -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;
|
||||
@ -1462,7 +1463,7 @@ public:
|
||||
Vector2D to(((*area->GetCenter()).x - m_cutoff.x), (*area->GetCenter()).y - m_cutoff.y);
|
||||
to.NormalizeInPlace();
|
||||
|
||||
//if (DotProduct( to, m_forward ) > 0.7071f)
|
||||
//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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -278,7 +278,7 @@ inline void BotPhrase::SetPlaceCriteria(PlaceCriteria place) const
|
||||
}
|
||||
|
||||
/* <2fea52> ../cstrike/dlls/bot/cs_bot_chatter.h:250 */
|
||||
inline void BotPhrase::SetCountCriteria( CountCriteria count ) const
|
||||
inline void BotPhrase::SetCountCriteria(CountCriteria count) const
|
||||
{
|
||||
m_countCriteria = count;
|
||||
}
|
||||
@ -524,7 +524,7 @@ public:
|
||||
class BotChatterInterface
|
||||
{
|
||||
public:
|
||||
BotChatterInterface(void) { };
|
||||
BotChatterInterface(void) {};
|
||||
|
||||
NOBODY BotChatterInterface(CCSBot *me);
|
||||
NOBODY ~BotChatterInterface();
|
||||
|
@ -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
|
||||
|
@ -1162,6 +1162,7 @@ void CCSBotManager::__MAKE_VHOOK(OnEvent)(GameEventType event, CBaseEntity *enti
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
CBotManager::OnEvent(event, entity, other);
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
float StayOnLadderLine(CCSBot *me, const CNavLadder *ladder)
|
||||
{
|
||||
// determine our facing
|
||||
NavDirType faceDir = AngleToDirection( me->pev->v_angle.y );
|
||||
NavDirType faceDir = AngleToDirection(me->pev->v_angle.y);
|
||||
const float stiffness = 1.0f;
|
||||
|
||||
// move toward ladder mount point
|
||||
@ -61,11 +61,11 @@ void __declspec(naked) CCSBot::UpdateLookAngles(void)
|
||||
//{
|
||||
// NavDirType faceDir = m_pathLadder->m_dir;
|
||||
// Vector to = m_pathLadder->m_top - pev->origin;
|
||||
// float idealYaw = UTIL_VecToYaw( to );
|
||||
// float idealYaw = UTIL_VecToYaw(to);
|
||||
|
||||
// if (m_pathLadderFaceIn)
|
||||
// {
|
||||
// faceDir = OppositeDirection( faceDir );
|
||||
// faceDir = OppositeDirection(faceDir);
|
||||
// }
|
||||
|
||||
// switch (m_pathLadderState)
|
||||
@ -73,7 +73,7 @@ void __declspec(naked) CCSBot::UpdateLookAngles(void)
|
||||
// case APPROACH_ASCENDING_LADDER:
|
||||
// {
|
||||
// Vector to = m_goalPosition - pev->origin;
|
||||
// if (to.IsLengthLessThan( lookAlongLadderRange ))
|
||||
// if (to.IsLengthLessThan(lookAlongLadderRange))
|
||||
// usePitch = -ladderPitch;
|
||||
// useYaw = idealYaw;
|
||||
// break;
|
||||
@ -81,7 +81,7 @@ void __declspec(naked) CCSBot::UpdateLookAngles(void)
|
||||
// case APPROACH_DESCENDING_LADDER:
|
||||
// {
|
||||
// Vector to = m_goalPosition - pev->origin;
|
||||
// if (to.IsLengthLessThan( lookAlongLadderRange ))
|
||||
// if (to.IsLengthLessThan(lookAlongLadderRange))
|
||||
// usePitch = ladderPitch;
|
||||
// useYaw = idealYaw;
|
||||
// break;
|
||||
@ -101,21 +101,21 @@ void __declspec(naked) CCSBot::UpdateLookAngles(void)
|
||||
// case MOUNT_ASCENDING_LADDER:
|
||||
// case ASCEND_LADDER:
|
||||
// {
|
||||
// useYaw = DirectionToAngle( faceDir ) + StayOnLadderLine(this, m_pathLadder);
|
||||
// useYaw = DirectionToAngle(faceDir) + StayOnLadderLine(this, m_pathLadder);
|
||||
// usePitch = -ladderPitch;
|
||||
// break;
|
||||
// }
|
||||
// case MOUNT_DESCENDING_LADDER:
|
||||
// case DESCEND_LADDER:
|
||||
// {
|
||||
// useYaw = DirectionToAngle( faceDir ) + StayOnLadderLine(this, m_pathLadder);
|
||||
// useYaw = DirectionToAngle(faceDir) + StayOnLadderLine(this, m_pathLadder);
|
||||
// usePitch = ladderPitch;
|
||||
// break;
|
||||
// }
|
||||
// case DISMOUNT_ASCENDING_LADDER:
|
||||
// case DISMOUNT_DESCENDING_LADDER:
|
||||
// {
|
||||
// useYaw = DirectionToAngle( faceDir );
|
||||
// useYaw = DirectionToAngle(faceDir);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
@ -123,7 +123,7 @@ void __declspec(naked) CCSBot::UpdateLookAngles(void)
|
||||
|
||||
//// if almost at target angle, snap to it
|
||||
//const float onTargetTolerance = 1.0f;
|
||||
//float angleDiff = NormalizeAngle( useYaw - pev->v_angle.y );
|
||||
//float angleDiff = NormalizeAngle(useYaw - pev->v_angle.y);
|
||||
|
||||
//if (angleDiff < onTargetTolerance && angleDiff > -onTargetTolerance)
|
||||
//{
|
||||
@ -147,7 +147,7 @@ void __declspec(naked) CCSBot::UpdateLookAngles(void)
|
||||
// pev->v_angle.y += (deltaT * m_lookYawVel);
|
||||
//}
|
||||
|
||||
//angleDiff = NormalizeAngle( usePitch - pev->v_angle.x );
|
||||
//angleDiff = NormalizeAngle(usePitch - pev->v_angle.x);
|
||||
|
||||
//// simple angular spring/damper
|
||||
//// double the stiffness since pitch is only +/- 90 and yaw is +/- 180
|
||||
@ -216,7 +216,7 @@ bool CCSBot::__MAKE_VHOOK(IsEnemyPartVisible)(VisiblePartType part) const
|
||||
void CCSBot::UpdateLookAt(void)
|
||||
{
|
||||
Vector to = m_lookAtSpot - EyePosition();
|
||||
Vector idealAngle = UTIL_VecToAngles( to );
|
||||
Vector idealAngle = UTIL_VecToAngles(to);
|
||||
idealAngle.x = 360.0f - idealAngle.x;
|
||||
|
||||
SetLookAngles(idealAngle.y, idealAngle.x);
|
||||
@ -234,7 +234,7 @@ void CCSBot::SetLookAt(const char *desc, const Vector *pos, PriorityType pri, fl
|
||||
|
||||
// if already looking at this spot, just extend the time
|
||||
const float tolerance = 10.0f;
|
||||
if (m_lookAtSpotState != NOT_LOOKING_AT_SPOT && VectorsAreEqual( pos, &m_lookAtSpot, tolerance ))
|
||||
if (m_lookAtSpotState != NOT_LOOKING_AT_SPOT && VectorsAreEqual(pos, &m_lookAtSpot, tolerance))
|
||||
{
|
||||
m_lookAtSpotDuration = duration;
|
||||
|
||||
|
@ -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);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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
|
||||
|
@ -614,7 +614,7 @@ void CCareerTaskManager::HandleDeath(int team, CBasePlayer *pAttacker)
|
||||
|
||||
for (int i = 1; i <= gpGlobals->maxClients; i++)
|
||||
{
|
||||
CBasePlayer *pPlayer = (CBasePlayer *)UTIL_PlayerByIndex( i );
|
||||
CBasePlayer *pPlayer = (CBasePlayer *)UTIL_PlayerByIndex(i);
|
||||
|
||||
if (pPlayer && pPlayer->m_iTeam == enemyTeam && pPlayer->IsAlive())
|
||||
++numEnemies;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -967,7 +967,7 @@ void SetObjectCollisionBox(entvars_t *pev)
|
||||
int i;
|
||||
|
||||
max = 0;
|
||||
for (i = 0 ; i < 3 ; i++)
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
v = fabs((float_precision)((float *)pev->mins)[i]);
|
||||
if (v > max)
|
||||
@ -1082,6 +1082,7 @@ int CBaseEntity::ShouldToggle(USE_TYPE useType, BOOL currentState)
|
||||
if ((currentState && useType == USE_ON) || (!currentState && useType == USE_OFF))
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1189,7 +1190,7 @@ BOOL CBaseEntity::IsInWorld(void)
|
||||
|
||||
CBaseEntity *CBaseEntity::GetNextTarget(void)
|
||||
{
|
||||
return GetNextTarget();
|
||||
return GetNextTarget_();
|
||||
}
|
||||
|
||||
BOOL CBaseEntity::FVisible(CBaseEntity *pEntity)
|
||||
@ -1197,7 +1198,7 @@ BOOL CBaseEntity::FVisible(CBaseEntity *pEntity)
|
||||
return FVisible_(pEntity);
|
||||
}
|
||||
|
||||
BOOL CBaseEntity::FVisible(Vector &vecOrigin)
|
||||
BOOL CBaseEntity::FVisible(const Vector &vecOrigin)
|
||||
{
|
||||
return FVisible_(vecOrigin);
|
||||
}
|
||||
|
@ -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,23 +416,31 @@ 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)
|
||||
{
|
||||
return NULL;
|
||||
@ -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
|
||||
|
@ -857,19 +857,10 @@ void Host_Say(edict_t *pEntity, int teamonly)
|
||||
|
||||
if (CVAR_GET_FLOAT("mp_logmessages") != 0)
|
||||
{
|
||||
char *temp;
|
||||
const char *temp = teamonly ? "say_team" : "say";
|
||||
const char *deadText = (player->m_iTeam != SPECTATOR && bSenderDead) ? " (dead)" : "";
|
||||
|
||||
char *szTeam = GetTeam(player->m_iTeam);
|
||||
char *deadText = "";
|
||||
|
||||
if (teamonly)
|
||||
temp = "say_team";
|
||||
else
|
||||
temp = "say";
|
||||
|
||||
if (player->m_iTeam != SPECTATOR && bSenderDead)
|
||||
{
|
||||
deadText = " (dead)";
|
||||
}
|
||||
|
||||
UTIL_LogPrintf
|
||||
(
|
||||
@ -891,7 +882,9 @@ void DropSecondary(CBasePlayer *pPlayer)
|
||||
if (pPlayer->HasShield())
|
||||
{
|
||||
if (pPlayer->HasShield() && pPlayer->m_bShieldDrawn && pPlayer->m_pActiveItem != NULL)
|
||||
{
|
||||
((CBasePlayerWeapon *)pPlayer->m_pActiveItem)->SecondaryAttack();
|
||||
}
|
||||
|
||||
pPlayer->m_bShieldDrawn = false;
|
||||
}
|
||||
@ -1175,7 +1168,7 @@ void BuySubMachineGun(CBasePlayer *pPlayer, int iSlot)
|
||||
{
|
||||
iWeapon = WEAPON_UMP45;
|
||||
iWeaponPrice = UMP45_PRICE;
|
||||
pszWeapon = "weapon_mp5navy";
|
||||
pszWeapon = "weapon_ump45";
|
||||
break;
|
||||
}
|
||||
case 4:
|
||||
@ -4102,7 +4095,7 @@ void ClientPrecache(void)
|
||||
|
||||
for (i = FirstCustomSkin; i <= LastCustomSkin; i++)
|
||||
{
|
||||
const char *fname = TheBotProfiles->GetCustomSkinFname( i );
|
||||
const char *fname = TheBotProfiles->GetCustomSkinFname(i);
|
||||
|
||||
if (!fname)
|
||||
break;
|
||||
@ -4164,7 +4157,7 @@ void ClientPrecache(void)
|
||||
|
||||
for (i = FirstCustomSkin; i <= LastCustomSkin; i++)
|
||||
{
|
||||
const char *fname = TheBotProfiles->GetCustomSkinFname( i );
|
||||
const char *fname = TheBotProfiles->GetCustomSkinFname(i);
|
||||
|
||||
if (!fname)
|
||||
break;
|
||||
@ -4433,7 +4426,9 @@ void SpectatorConnect(edict_t *pEntity)
|
||||
CBaseSpectator *pPlayer = (CBaseSpectator *)GET_PRIVATE(pEntity);
|
||||
|
||||
if (pPlayer)
|
||||
{
|
||||
pPlayer->SpectatorConnect();
|
||||
}
|
||||
}
|
||||
|
||||
/* <4a83d> ../cstrike/dlls/client.cpp:5095 */
|
||||
@ -4442,7 +4437,9 @@ void SpectatorDisconnect(edict_t *pEntity)
|
||||
CBaseSpectator *pPlayer = (CBaseSpectator *)GET_PRIVATE(pEntity);
|
||||
|
||||
if (pPlayer)
|
||||
{
|
||||
pPlayer->SpectatorDisconnect();
|
||||
}
|
||||
}
|
||||
|
||||
/* <4a8b5> ../cstrike/dlls/client.cpp:5111 */
|
||||
@ -4451,7 +4448,9 @@ void SpectatorThink(edict_t *pEntity)
|
||||
CBaseSpectator *pPlayer = (CBaseSpectator *)GET_PRIVATE(pEntity);
|
||||
|
||||
if (pPlayer)
|
||||
{
|
||||
pPlayer->SpectatorThink();
|
||||
}
|
||||
}
|
||||
|
||||
/* <4a92d> ../cstrike/dlls/client.cpp:5160 */
|
||||
@ -4674,7 +4673,7 @@ int AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *ho
|
||||
{
|
||||
Q_memcpy(state->basevelocity, ent->v.basevelocity, sizeof(float) * 3);
|
||||
|
||||
state->weaponmodel = MODEL_INDEX( STRING(ent->v.weaponmodel) );
|
||||
state->weaponmodel = MODEL_INDEX(STRING(ent->v.weaponmodel));
|
||||
state->gaitsequence = ent->v.gaitsequence;
|
||||
|
||||
state->spectator = (ent->v.flags & FL_SPECTATOR) ? TRUE : FALSE;
|
||||
@ -4955,10 +4954,10 @@ int GetWeaponData(edict_s *player, struct weapon_data_s *info)
|
||||
|
||||
item->m_iId = II.iId;
|
||||
item->m_iClip = gun->m_iClip;
|
||||
item->m_flTimeWeaponIdle = _max(gun->m_flTimeWeaponIdle, -0.001);
|
||||
item->m_flNextPrimaryAttack = _max(gun->m_flNextPrimaryAttack, -0.001);
|
||||
item->m_flNextSecondaryAttack = _max(gun->m_flNextSecondaryAttack, -0.001);
|
||||
item->m_flNextReload = _max(gun->m_flNextReload, -0.001);
|
||||
item->m_flTimeWeaponIdle = Q_max(gun->m_flTimeWeaponIdle, -0.001f);
|
||||
item->m_flNextPrimaryAttack = Q_max(gun->m_flNextPrimaryAttack, -0.001f);
|
||||
item->m_flNextSecondaryAttack = Q_max(gun->m_flNextSecondaryAttack, -0.001f);
|
||||
item->m_flNextReload = Q_max(gun->m_flNextReload, -0.001f);
|
||||
item->m_fInReload = gun->m_fInReload;
|
||||
item->m_fInSpecialReload = gun->m_fInSpecialReload;
|
||||
item->m_fInZoom = gun->m_iShotsFired;
|
||||
@ -4998,7 +4997,7 @@ void UpdateClientData(const struct edict_s *ent, int sendweapons, struct clientd
|
||||
|
||||
cd->flags = pev->flags;
|
||||
cd->health = pev->health;
|
||||
cd->viewmodel = MODEL_INDEX( STRING(pev->viewmodel) );
|
||||
cd->viewmodel = MODEL_INDEX(STRING(pev->viewmodel));
|
||||
cd->waterlevel = pev->waterlevel;
|
||||
cd->watertype = pev->watertype;
|
||||
cd->weapons = pev->weapons;
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -52,19 +52,19 @@
|
||||
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
|
||||
|
||||
@ -91,21 +91,27 @@ 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 */
|
||||
@ -114,9 +120,9 @@ public:
|
||||
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
|
||||
|
||||
@ -132,16 +138,16 @@ public:
|
||||
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
|
||||
|
@ -327,13 +327,13 @@ void CBeam::RelinkBeam(void)
|
||||
const Vector &startPos = GetStartPos();
|
||||
const Vector &endPos = GetEndPos();
|
||||
|
||||
pev->mins.x = _min(startPos.x, endPos.x);
|
||||
pev->mins.y = _min(startPos.y, endPos.y);
|
||||
pev->mins.z = _min(startPos.z, endPos.z);
|
||||
pev->mins.x = Q_min(startPos.x, endPos.x);
|
||||
pev->mins.y = Q_min(startPos.y, endPos.y);
|
||||
pev->mins.z = Q_min(startPos.z, endPos.z);
|
||||
|
||||
pev->maxs.x = _max(startPos.x, endPos.x);
|
||||
pev->maxs.y = _max(startPos.y, endPos.y);
|
||||
pev->maxs.z = _max(startPos.z, endPos.z);
|
||||
pev->maxs.x = Q_max(startPos.x, endPos.x);
|
||||
pev->maxs.y = Q_max(startPos.y, endPos.y);
|
||||
pev->maxs.z = Q_max(startPos.z, endPos.z);
|
||||
|
||||
pev->mins = pev->mins - pev->origin;
|
||||
pev->maxs = pev->maxs - pev->origin;
|
||||
@ -1018,7 +1018,9 @@ void CLaser::TurnOff(void)
|
||||
pev->nextthink = 0;
|
||||
|
||||
if (m_pSprite)
|
||||
{
|
||||
m_pSprite->TurnOff();
|
||||
}
|
||||
}
|
||||
|
||||
/* <78804> ../cstrike/dlls/effects.cpp:1032 */
|
||||
@ -1027,7 +1029,9 @@ void CLaser::TurnOn(void)
|
||||
pev->effects &= ~EF_NODRAW;
|
||||
|
||||
if (m_pSprite)
|
||||
{
|
||||
m_pSprite->TurnOn();
|
||||
}
|
||||
|
||||
pev->dmgtime = gpGlobals->time;
|
||||
pev->nextthink = gpGlobals->time;
|
||||
@ -1533,7 +1537,7 @@ void CGibShooter::ShootThink(void)
|
||||
LINK_ENTITY_TO_CLASS(env_shooter, CEnvShooter);
|
||||
|
||||
/* <749e7> ../cstrike/dlls/effects.cpp:1602 */
|
||||
NOBODY void CEnvShooter::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
|
||||
void CEnvShooter::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
|
||||
{
|
||||
if (FStrEq(pkvd->szKeyName, "shootmodel"))
|
||||
{
|
||||
@ -1545,7 +1549,7 @@ NOBODY void CEnvShooter::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
|
||||
int iNoise = Q_atoi(pkvd->szValue);
|
||||
pkvd->fHandled = TRUE;
|
||||
|
||||
switch(iNoise)
|
||||
switch (iNoise)
|
||||
{
|
||||
case 0:
|
||||
m_iGibMaterial = matGlass;
|
||||
|
@ -153,7 +153,7 @@ public:
|
||||
{
|
||||
pev->renderamt = brightness;
|
||||
}
|
||||
void AnimateAndDie(float framerate)
|
||||
void AnimateAndDie(float_precision framerate)
|
||||
{
|
||||
SetThink(&CSprite::AnimateUntilDead);
|
||||
pev->framerate = framerate;
|
||||
|
@ -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)
|
||||
|
@ -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 ¢er, Vector &angles, edict_t *pOwner, int magnitude, BOOL doDamage)
|
||||
void ExplosionCreate(const Vector ¢er, Vector &angles, edict_t *pOwner, int magnitude, BOOL doDamage)
|
||||
{
|
||||
KeyValueData kvd;
|
||||
char buf[128];
|
||||
|
@ -97,7 +97,7 @@ public:
|
||||
|
||||
};/* size: 412, cachelines: 7, members: 4 */
|
||||
|
||||
void ExplosionCreate(Vector ¢er, Vector &angles, edict_t *pOwner, int magnitude, BOOL doDamage);
|
||||
void ExplosionCreate(const Vector ¢er, Vector &angles, edict_t *pOwner, int magnitude, BOOL doDamage);
|
||||
|
||||
// linked objects
|
||||
C_DLLEXPORT void spark_shower(entvars_t *pev);
|
||||
|
@ -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
@ -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,13 +124,13 @@ 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);
|
||||
|
||||
NOBODY void EXPORT Die(void);
|
||||
void EXPORT Die(void);
|
||||
|
||||
inline BOOL Explodable(void)
|
||||
{
|
||||
@ -164,18 +173,18 @@ public:
|
||||
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
|
||||
|
||||
@ -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
@ -42,32 +42,34 @@
|
||||
|
||||
enum TANKBULLET
|
||||
{
|
||||
TANK_BULLET_NONE = 0,
|
||||
TANK_BULLET_9MM,
|
||||
TANK_BULLET_MP5,
|
||||
TANK_BULLET_12MM,
|
||||
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 */
|
||||
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
|
||||
@ -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,29 +141,36 @@ 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 */
|
||||
|
||||
@ -171,10 +178,12 @@ protected:
|
||||
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 */
|
||||
@ -183,12 +192,12 @@ public:
|
||||
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
|
||||
|
||||
@ -201,7 +210,7 @@ public:
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
NOBODY CLaser *GetLaser(void);
|
||||
CLaser *GetLaser(void);
|
||||
|
||||
public:
|
||||
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[2];
|
||||
@ -216,8 +225,8 @@ private:
|
||||
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
|
||||
|
||||
@ -232,8 +241,8 @@ public:
|
||||
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
|
||||
|
||||
@ -248,15 +257,15 @@ public:
|
||||
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
|
||||
|
||||
@ -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
|
||||
|
@ -122,6 +122,7 @@ enum RewardAccount
|
||||
REWARD_RESCUED_HOSTAGE = 750,
|
||||
REWARD_KILLED_ENEMY = 300,
|
||||
REWARD_KILLED_VIP = 2500,
|
||||
REWARD_VIP_HAVE_SELF_RESCUED = 2500,
|
||||
|
||||
};
|
||||
|
||||
@ -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,13 +271,13 @@ 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
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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));
|
||||
|
||||
|
@ -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
|
||||
|
@ -32,38 +32,121 @@
|
||||
#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
|
||||
|
||||
@ -179,21 +197,25 @@ public:
|
||||
|
||||
};/* 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
|
||||
|
@ -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
|
||||
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ TYPEDESCRIPTION CWallHealth::m_SaveData[] =
|
||||
|
||||
#else
|
||||
|
||||
TYPEDESCRIPTION (*CWallHealth::pm_SaveData)[5];
|
||||
TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CWallHealth, m_SaveData)[5];
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
@ -45,7 +45,7 @@ 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));
|
||||
WRITE_STRING(STRING(pev->classname));
|
||||
MESSAGE_END();
|
||||
|
||||
EMIT_SOUND(ENT(pPlayer->pev), CHAN_ITEM, "items/smallmedkit1.wav", VOL_NORM, ATTN_NORM);
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -13,7 +13,7 @@ TYPEDESCRIPTION CLight::m_SaveData[] =
|
||||
|
||||
#else
|
||||
|
||||
TYPEDESCRIPTION (*CLight::pm_SaveData)[2];
|
||||
TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CLight, m_SaveData)[2];
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
@ -40,11 +40,11 @@ void CLight::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
|
||||
}
|
||||
else if (FStrEq(pkvd->szKeyName, "pattern"))
|
||||
{
|
||||
m_iszPattern = ALLOC_STRING( pkvd->szValue );
|
||||
m_iszPattern = ALLOC_STRING(pkvd->szValue);
|
||||
pkvd->fHandled = TRUE;
|
||||
}
|
||||
else
|
||||
CPointEntity::KeyValue( pkvd );
|
||||
CPointEntity::KeyValue(pkvd);
|
||||
}
|
||||
|
||||
/* <e7b78> ../cstrike/dlls/lights.cpp:92 */
|
||||
@ -65,7 +65,7 @@ void CLight::__MAKE_VHOOK(Spawn)(void)
|
||||
LIGHT_STYLE(m_iStyle, "a");
|
||||
|
||||
else if (m_iszPattern)
|
||||
LIGHT_STYLE(m_iStyle, (char *)STRING( m_iszPattern ));
|
||||
LIGHT_STYLE(m_iStyle, (char *)STRING(m_iszPattern));
|
||||
else
|
||||
LIGHT_STYLE(m_iStyle, "m");
|
||||
}
|
||||
@ -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;
|
||||
|
||||
@ -175,7 +175,7 @@ void CEnvLight::__MAKE_VHOOK(Spawn)(void)
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
char szVector[64];
|
||||
UTIL_MakeAimVectors( pev->angles );
|
||||
UTIL_MakeAimVectors(pev->angles);
|
||||
|
||||
Q_sprintf(szVector, "%f", gpGlobals->v_forward.x SPRINTF_OLD_STD_FIX);
|
||||
CVAR_SET_STRING("sv_skyvec_x", szVector);
|
||||
|
@ -79,6 +79,7 @@ public:
|
||||
void KeyValue_(KeyValueData *pkvd);
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
};/* size: 164, cachelines: 3, members: 1 */
|
||||
|
||||
#endif // LIGHT_H
|
||||
|
@ -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,181 +37,297 @@ 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)
|
||||
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
|
||||
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 */
|
||||
LINK_ENTITY_TO_CLASS(game_team_master, CGameTeamMaster);
|
||||
|
||||
/* <eff4f> ../cstrike/dlls/maprules.cpp:373 */
|
||||
NOBODY void CGameTeamMaster::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
|
||||
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
|
||||
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
|
||||
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
|
||||
return TeamMatch(pActivator);
|
||||
}
|
||||
|
||||
/* <eeeaf> ../cstrike/dlls/maprules.cpp:435 */
|
||||
const char *CGameTeamMaster::__MAKE_VHOOK(TeamID)(void)
|
||||
{
|
||||
// TeamID(CGameTeamMaster *const this); // 435
|
||||
// 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
|
||||
if (m_teamIndex < 0 && AnyTeam())
|
||||
return TRUE;
|
||||
|
||||
if (!pActivator)
|
||||
return FALSE;
|
||||
|
||||
return UTIL_TeamsMatch(pActivator->TeamID(), TeamID());
|
||||
}
|
||||
|
||||
/* <f0d2e> ../cstrike/dlls/maprules.cpp:474 */
|
||||
@ -218,13 +336,22 @@ 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
|
||||
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 */
|
||||
@ -236,36 +363,87 @@ 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
|
||||
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
|
||||
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 */
|
||||
@ -274,13 +452,23 @@ 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
|
||||
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 */
|
||||
@ -289,22 +477,47 @@ 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
|
||||
// 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
|
||||
if (!CanFireForActivator(pActivator))
|
||||
return;
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* <f106a> ../cstrike/dlls/maprules.cpp:747 */
|
||||
@ -313,13 +526,15 @@ 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)
|
||||
{
|
||||
// CanFireForActivator(CRuleEntity *const this,
|
||||
// class CBaseEntity *pActivator); // 752
|
||||
// Use(CGameCounterSet *const this,
|
||||
// class CBaseEntity *pActivator,
|
||||
// class CBaseEntity *pCaller,
|
||||
// USE_TYPE useType,
|
||||
// float value); // 750
|
||||
if (!CanFireForActivator(pActivator))
|
||||
return;
|
||||
|
||||
SUB_UseTargets(pActivator, USE_SET, pev->frags);
|
||||
|
||||
if (RemoveOnFire())
|
||||
{
|
||||
UTIL_Remove(this);
|
||||
}
|
||||
}
|
||||
|
||||
/* <f1139> ../cstrike/dlls/maprules.cpp:788 */
|
||||
@ -328,46 +543,69 @@ 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
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* <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
|
||||
if (!CanFireForActivator(pOther))
|
||||
return;
|
||||
|
||||
if (UseOnly())
|
||||
return;
|
||||
|
||||
EquipPlayer(pOther);
|
||||
}
|
||||
|
||||
/* <f1208> ../cstrike/dlls/maprules.cpp:827 */
|
||||
void CGamePlayerEquip::EquipPlayer(CBaseEntity *pEntity)
|
||||
{
|
||||
// {
|
||||
// class CBasePlayer *pPlayer; // 829
|
||||
// {
|
||||
// int i; // 839
|
||||
// {
|
||||
// int j; // 843
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
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(CGamePlayerEquip *const this,
|
||||
// class CBaseEntity *pEntity); // 853
|
||||
EquipPlayer(pActivator);
|
||||
}
|
||||
|
||||
/* <f1268> ../cstrike/dlls/maprules.cpp:881 */
|
||||
@ -376,29 +614,38 @@ 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
|
||||
// }
|
||||
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
|
||||
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
|
||||
|
@ -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 */
|
||||
|
||||
// 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 */
|
||||
|
||||
// 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 */
|
||||
|
||||
// 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
|
||||
|
||||
@ -305,11 +335,14 @@ private:
|
||||
|
||||
};/* size: 172, cachelines: 3, members: 6 */
|
||||
|
||||
// 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 */
|
||||
|
||||
// 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 */
|
||||
|
||||
// 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 */
|
||||
|
||||
// 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
|
||||
|
@ -36,6 +36,7 @@ typedef struct
|
||||
{
|
||||
int event;
|
||||
char *options;
|
||||
|
||||
} MonsterEvent_t;
|
||||
|
||||
#define EVENT_SPECIFIC 0
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -19,10 +19,10 @@ TYPEDESCRIPTION CPathTrack::m_SaveData[] =
|
||||
DEFINE_FIELD(CPathTrack, m_altName, FIELD_STRING),
|
||||
};
|
||||
|
||||
#else // HOOK_GAMEDLL
|
||||
#else
|
||||
|
||||
TYPEDESCRIPTION (*CPathCorner::pm_SaveData)[1];
|
||||
TYPEDESCRIPTION (*CPathTrack::pm_SaveData)[5];
|
||||
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
|
||||
|
@ -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
@ -50,17 +50,17 @@
|
||||
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_();
|
||||
}
|
||||
@ -96,13 +96,13 @@ public:
|
||||
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,12 +117,11 @@ 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 */
|
||||
|
||||
@ -130,11 +129,11 @@ public:
|
||||
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,7 +146,7 @@ public:
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
public:
|
||||
NOBODY void SpawnInsideTrigger(CFuncPlat *pPlatform);
|
||||
void SpawnInsideTrigger(CFuncPlat *pPlatform);
|
||||
|
||||
public:
|
||||
CFuncPlat *m_pPlatform;
|
||||
@ -158,14 +157,14 @@ public:
|
||||
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,8 +179,8 @@ 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,16 +195,16 @@ 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
|
||||
|
||||
@ -223,8 +222,8 @@ public:
|
||||
#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_();
|
||||
}
|
||||
@ -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);
|
||||
virtual void EXPORT GoUp(void);
|
||||
virtual void EXPORT GoDown(void);
|
||||
|
||||
NOBODY virtual void HitBottom(void);
|
||||
NOBODY virtual void HitTop(void);
|
||||
NOBODY virtual void UpdateAutoTargets(int toggleState);
|
||||
virtual void HitBottom(void);
|
||||
virtual void HitTop(void);
|
||||
virtual void UpdateAutoTargets(int toggleState);
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
||||
@ -304,22 +303,22 @@ public:
|
||||
#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
|
||||
|
@ -273,8 +273,8 @@ int gmsgShowTimer;
|
||||
BOOL gInitHUD;
|
||||
cvar_t *sv_aim;
|
||||
|
||||
TYPEDESCRIPTION (*CRevertSaved::pm_SaveData)[2];
|
||||
TYPEDESCRIPTION (*CBasePlayer::pm_playerSaveData)[40];
|
||||
TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CRevertSaved, m_SaveData)[2];
|
||||
TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CBasePlayer, m_playerSaveData)[40];
|
||||
WeaponStruct g_weaponStruct[ MAX_WEAPONS ];
|
||||
char *(*CDeadHEV::pm_szPoses)[4];
|
||||
|
||||
@ -673,7 +673,7 @@ void CBasePlayer::Radio(const char *msg_id, const char *msg_verbose, short pitch
|
||||
{
|
||||
// search the place name where is located the player
|
||||
const char *placeName = NULL;
|
||||
Place playerPlace = TheNavAreaGrid.GetPlace( &pev->origin );
|
||||
Place playerPlace = TheNavAreaGrid.GetPlace(&pev->origin);
|
||||
const BotPhraseList *placeList = TheBotPhrases->GetPlaceList();
|
||||
|
||||
for (BotPhraseList::const_iterator iter = placeList->begin(); iter != placeList->end(); ++iter)
|
||||
@ -792,6 +792,7 @@ int TrainSpeed(int iSpeed, int iMax)
|
||||
/* <153c8e> ../cstrike/dlls/player.cpp:902 */
|
||||
void CBasePlayer::DeathSound(void)
|
||||
{
|
||||
// temporarily using pain sounds for death sounds
|
||||
switch (RANDOM_LONG(1, 4))
|
||||
{
|
||||
case 1: EMIT_SOUND(ENT(pev), CHAN_VOICE, "player/die1.wav", VOL_NORM, ATTN_NORM); break;
|
||||
@ -801,6 +802,9 @@ void CBasePlayer::DeathSound(void)
|
||||
}
|
||||
}
|
||||
|
||||
// override takehealth
|
||||
// bitsDamageType indicates type of damage healed.
|
||||
|
||||
/* <151213> ../cstrike/dlls/player.cpp:937 */
|
||||
int CBasePlayer::__MAKE_VHOOK(TakeHealth)(float flHealth, int bitsDamageType)
|
||||
{
|
||||
@ -951,7 +955,7 @@ void CBasePlayer::__MAKE_VHOOK(TraceAttack)(entvars_t *pevAttacker, float flDama
|
||||
if (bShouldBleed)
|
||||
{
|
||||
BloodSplat(ptr->vecEndPos, vecDir, ptr->iHitgroup, flDamage * 5);
|
||||
SpawnBlood(ptr->vecEndPos, BloodColor(), flDamage);
|
||||
SpawnBlood(ptr->vecEndPos, BloodColor(), flDamage); // a little surface blood.
|
||||
TraceBleed(flDamage, vecDir, ptr, bitsDamageType);
|
||||
}
|
||||
else if (ptr->iHitgroup == HITGROUP_HEAD && bShouldSpark == true)
|
||||
@ -1174,7 +1178,7 @@ int CBasePlayer::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pe
|
||||
{
|
||||
for (int i = 1; i <= gpGlobals->maxClients; i++)
|
||||
{
|
||||
CBasePlayer *pPlayer = (CBasePlayer *)UTIL_PlayerByIndex( i );
|
||||
CBasePlayer *pPlayer = (CBasePlayer *)UTIL_PlayerByIndex(i);
|
||||
|
||||
if (!pPlayer)
|
||||
continue;
|
||||
@ -1209,7 +1213,7 @@ int CBasePlayer::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pe
|
||||
|
||||
MESSAGE_BEGIN(MSG_SPEC, gmsgHLTV);
|
||||
WRITE_BYTE(ENTINDEX(edict()));
|
||||
WRITE_BYTE((int)_max(pev->health, 0) | DRC_FLAG_FACEPLAYER);
|
||||
WRITE_BYTE((int)Q_max(pev->health, 0.0f) | DRC_FLAG_FACEPLAYER);
|
||||
MESSAGE_END();
|
||||
|
||||
for (int i = 1; i <= gpGlobals->maxClients; i++)
|
||||
@ -1220,7 +1224,7 @@ int CBasePlayer::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pe
|
||||
continue;
|
||||
|
||||
MESSAGE_BEGIN(MSG_ONE, gmsgSpecHealth, NULL, pPlayer->edict());
|
||||
WRITE_BYTE((int)_max(pev->health, 0));
|
||||
WRITE_BYTE((int)Q_max(pev->health, 0.0f));
|
||||
MESSAGE_END();
|
||||
}
|
||||
|
||||
@ -1396,7 +1400,7 @@ int CBasePlayer::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pe
|
||||
{
|
||||
for (int i = 1; i <= gpGlobals->maxClients; i++)
|
||||
{
|
||||
CBasePlayer *pPlayer = (CBasePlayer *)UTIL_PlayerByIndex( i );
|
||||
CBasePlayer *pPlayer = (CBasePlayer *)UTIL_PlayerByIndex(i);
|
||||
|
||||
if (!pPlayer)
|
||||
continue;
|
||||
@ -1431,12 +1435,12 @@ int CBasePlayer::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pe
|
||||
|
||||
MESSAGE_BEGIN(MSG_SPEC, gmsgHLTV);
|
||||
WRITE_BYTE(ENTINDEX(edict()));
|
||||
WRITE_BYTE((int)_max(pev->health, 0) | DRC_FLAG_FACEPLAYER);
|
||||
WRITE_BYTE((int)Q_max(pev->health, 0.0f) | DRC_FLAG_FACEPLAYER);
|
||||
MESSAGE_END();
|
||||
|
||||
for (int i = 1; i <= gpGlobals->maxClients; i++)
|
||||
{
|
||||
CBasePlayer *pPlayer = (CBasePlayer *)UTIL_PlayerByIndex( i );
|
||||
CBasePlayer *pPlayer = (CBasePlayer *)UTIL_PlayerByIndex(i);
|
||||
|
||||
if (!pPlayer)
|
||||
continue;
|
||||
@ -1444,7 +1448,7 @@ int CBasePlayer::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pe
|
||||
if (pPlayer->m_hObserverTarget == this)
|
||||
{
|
||||
MESSAGE_BEGIN(MSG_ONE, gmsgSpecHealth, NULL, pPlayer->edict());
|
||||
WRITE_BYTE((int)_max(pev->health, 0));
|
||||
WRITE_BYTE((int)Q_max(pev->health, 0.0f));
|
||||
MESSAGE_END();
|
||||
}
|
||||
}
|
||||
@ -4433,7 +4437,7 @@ void CBasePlayer::CheckTimeBasedDamage(void)
|
||||
{
|
||||
if (m_idrowndmg > m_idrownrestored)
|
||||
{
|
||||
int idif = _min(m_idrowndmg - m_idrownrestored, 10);
|
||||
int idif = Q_min(m_idrowndmg - m_idrownrestored, 10);
|
||||
TakeHealth(idif, DMG_GENERIC);
|
||||
m_idrownrestored += idif;
|
||||
}
|
||||
@ -4801,12 +4805,12 @@ void CBasePlayer::__MAKE_VHOOK(PostThink)(void)
|
||||
|
||||
if (gun && gun->UseDecrement())
|
||||
{
|
||||
gun->m_flNextPrimaryAttack = _max(gun->m_flNextPrimaryAttack - gpGlobals->frametime, -1.0);
|
||||
gun->m_flNextSecondaryAttack = _max(gun->m_flNextSecondaryAttack - gpGlobals->frametime, -0.001);
|
||||
gun->m_flNextPrimaryAttack = Q_max(gun->m_flNextPrimaryAttack - gpGlobals->frametime, -1.0f);
|
||||
gun->m_flNextSecondaryAttack = Q_max(gun->m_flNextSecondaryAttack - gpGlobals->frametime, -0.001f);
|
||||
|
||||
if (gun->m_flTimeWeaponIdle != 1000.0f)
|
||||
{
|
||||
gun->m_flTimeWeaponIdle = _max(gun->m_flTimeWeaponIdle - gpGlobals->frametime, -0.001);
|
||||
gun->m_flTimeWeaponIdle = Q_max(gun->m_flTimeWeaponIdle - gpGlobals->frametime, -0.001f);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4906,7 +4910,9 @@ edict_t *EntSelectSpawnPoint(CBaseEntity *pPlayer)
|
||||
|
||||
// skip over the null point
|
||||
if (FNullEnt(pSpot))
|
||||
{
|
||||
pSpot = UTIL_FindEntityByClassname(pSpot, "info_player_start");
|
||||
}
|
||||
|
||||
CBaseEntity *pFirstSpot = pSpot;
|
||||
|
||||
@ -6372,12 +6378,12 @@ int CBasePlayer::__MAKE_VHOOK(GiveAmmo)(int iCount, char *szName, int iMax)
|
||||
return -1;
|
||||
}
|
||||
|
||||
int i = GetAmmoIndex( szName );
|
||||
int i = GetAmmoIndex(szName);
|
||||
|
||||
if (i < 0 || i >= MAX_AMMO_SLOTS)
|
||||
return -1;
|
||||
|
||||
int iAdd = _min(iCount, iMax - m_rgAmmo[i]);
|
||||
int iAdd = Q_min(iCount, iMax - m_rgAmmo[i]);
|
||||
if (iAdd < 1)
|
||||
return i;
|
||||
|
||||
@ -6487,7 +6493,7 @@ void CBasePlayer::SendAmmoUpdate(void)
|
||||
// send "Ammo" update message
|
||||
MESSAGE_BEGIN(MSG_ONE, gmsgAmmoX, NULL, pev);
|
||||
WRITE_BYTE(i);
|
||||
WRITE_BYTE( _max( _min( m_rgAmmo[i], 254 ), 0 ) ); // clamp the value to one byte
|
||||
WRITE_BYTE(Q_max(Q_min(m_rgAmmo[i], 254), 0)); // clamp the value to one byte
|
||||
MESSAGE_END();
|
||||
}
|
||||
}
|
||||
@ -6593,6 +6599,8 @@ void CBasePlayer::__MAKE_VHOOK(UpdateClientData)(void)
|
||||
MESSAGE_BEGIN(MSG_ONE, gmsgResetHUD, NULL, pev);
|
||||
MESSAGE_END();
|
||||
|
||||
CHalfLifeMultiplay *mp = g_pGameRules;
|
||||
|
||||
if (!m_fGameHUDInitialized)
|
||||
{
|
||||
MESSAGE_BEGIN(MSG_ONE, gmsgInitHUD, NULL, pev);
|
||||
@ -6646,10 +6654,10 @@ void CBasePlayer::__MAKE_VHOOK(UpdateClientData)(void)
|
||||
MESSAGE_END();
|
||||
}
|
||||
|
||||
g_pGameRules->InitHUD(this);
|
||||
mp->InitHUD(this);
|
||||
m_fGameHUDInitialized = TRUE;
|
||||
|
||||
if (g_pGameRules->IsMultiplayer())
|
||||
if (mp->IsMultiplayer())
|
||||
{
|
||||
FireTargets("game_playerjoin", this, this, USE_TOGGLE, 0);
|
||||
}
|
||||
@ -6683,16 +6691,16 @@ void CBasePlayer::__MAKE_VHOOK(UpdateClientData)(void)
|
||||
SendHostagePos();
|
||||
SendWeatherInfo();
|
||||
|
||||
if (g_pGameRules->IsMultiplayer())
|
||||
if (mp->IsMultiplayer())
|
||||
{
|
||||
MESSAGE_BEGIN(MSG_ONE, gmsgTeamScore, NULL, pev);
|
||||
WRITE_STRING(GetTeam(CT));
|
||||
WRITE_SHORT(g_pGameRules->m_iNumCTWins);
|
||||
WRITE_SHORT(mp->m_iNumCTWins);
|
||||
MESSAGE_END();
|
||||
|
||||
MESSAGE_BEGIN(MSG_ONE, gmsgTeamScore, NULL, pev);
|
||||
WRITE_STRING(GetTeam(TERRORIST));
|
||||
WRITE_SHORT(g_pGameRules->m_iNumTerroristWins);
|
||||
WRITE_SHORT(mp->m_iNumTerroristWins);
|
||||
MESSAGE_END();
|
||||
}
|
||||
}
|
||||
@ -6873,7 +6881,7 @@ void CBasePlayer::__MAKE_VHOOK(UpdateClientData)(void)
|
||||
|
||||
if (!(w->iFlags() & ITEM_FLAG_EXHAUSTIBLE))
|
||||
{
|
||||
if (AmmoInventory( w->m_iPrimaryAmmoType ) < 1 && w->m_iClip == 0)
|
||||
if (AmmoInventory(w->m_iPrimaryAmmoType) < 1 && w->m_iClip == 0)
|
||||
{
|
||||
m_flDisplayHistory |= DHF_AMMO_EXHAUSTED;
|
||||
HintMessage("#Hint_out_of_ammo");
|
||||
@ -7150,7 +7158,7 @@ void CBasePlayer::UpdateStatusBar(void)
|
||||
{
|
||||
CBasePlayer *pTarget = (CBasePlayer *)pEntity;
|
||||
|
||||
newSBarState[ SBAR_ID_TARGETNAME ] = ENTINDEX( pTarget->edict() );
|
||||
newSBarState[ SBAR_ID_TARGETNAME ] = ENTINDEX(pTarget->edict());
|
||||
newSBarState[ SBAR_ID_TARGETTYPE ] = (pTarget->m_iTeam == m_iTeam) ? SBAR_TARGETTYPE_TEAMMATE : SBAR_TARGETTYPE_ENEMY;
|
||||
|
||||
if (pTarget->m_iTeam == m_iTeam || IsObserver())
|
||||
@ -7388,8 +7396,10 @@ void CBasePlayer::DropPlayerItem(const char *pszItemName)
|
||||
|
||||
const char *modelname = GetCSModelName(pWeapon->m_iId);
|
||||
|
||||
if (modelname)
|
||||
if (modelname != NULL)
|
||||
{
|
||||
SET_MODEL(ENT(pWeaponBox->pev), modelname);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
@ -7416,7 +7426,7 @@ BOOL CBasePlayer::HasNamedPlayerItem(const char *pszItemName)
|
||||
CBasePlayerItem *pItem;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAX_ITEM_TYPES ; i++)
|
||||
for (i = 0; i < MAX_ITEM_TYPES; i++)
|
||||
{
|
||||
pItem = m_rgpPlayerItems[ i ];
|
||||
|
||||
@ -7602,15 +7612,15 @@ void CBasePlayer::SwitchTeam(void)
|
||||
{
|
||||
bool kick = false;
|
||||
|
||||
if (m_iTeam == CT && !pProfile->IsValidForTeam( BOT_TEAM_CT ))
|
||||
if (m_iTeam == CT && !pProfile->IsValidForTeam(BOT_TEAM_CT))
|
||||
kick = true;
|
||||
|
||||
else if (m_iTeam == TERRORIST && !pProfile->IsValidForTeam( BOT_TEAM_T ))
|
||||
else if (m_iTeam == TERRORIST && !pProfile->IsValidForTeam(BOT_TEAM_T))
|
||||
kick = true;
|
||||
|
||||
if (kick)
|
||||
{
|
||||
SERVER_COMMAND( UTIL_VarArgs("kick \"%s\"\n", STRING(pev->netname)) );
|
||||
SERVER_COMMAND(UTIL_VarArgs("kick \"%s\"\n", STRING(pev->netname)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -8053,7 +8063,7 @@ void CBasePlayer::ResetStamina(void)
|
||||
}
|
||||
|
||||
/* <15a467> ../cstrike/dlls/player.cpp:9829 */
|
||||
float GetPlayerPitch(const edict_t *pEdict)
|
||||
float_precision GetPlayerPitch(const edict_t *pEdict)
|
||||
{
|
||||
entvars_t *pev = VARS((edict_t *)pEdict);
|
||||
CBasePlayer *pPlayer = reinterpret_cast<CBasePlayer *>(CBasePlayer::Instance(pev));
|
||||
@ -8065,7 +8075,7 @@ float GetPlayerPitch(const edict_t *pEdict)
|
||||
}
|
||||
|
||||
/* <15a530> ../cstrike/dlls/player.cpp:9846 */
|
||||
float GetPlayerYaw(const edict_t *pEdict)
|
||||
float_precision GetPlayerYaw(const edict_t *pEdict)
|
||||
{
|
||||
entvars_t *pev = VARS((edict_t *)pEdict);
|
||||
CBasePlayer *pPlayer = reinterpret_cast<CBasePlayer *>(CBasePlayer::Instance(pev));
|
||||
@ -8204,7 +8214,7 @@ void CBasePlayer::SetPrefsFromUserinfo(char *infobuffer)
|
||||
bool CBasePlayer::IsLookingAtPosition(Vector *pos, float angleTolerance)
|
||||
{
|
||||
Vector to = *pos - EyePosition();
|
||||
Vector idealAngle = UTIL_VecToAngles( to );
|
||||
Vector idealAngle = UTIL_VecToAngles(to);
|
||||
|
||||
idealAngle.x = 360.0 - idealAngle.x;
|
||||
|
||||
@ -8492,7 +8502,7 @@ void CBasePlayer::AutoBuy(void)
|
||||
}
|
||||
|
||||
if (TheTutor)
|
||||
TheTutor->OnEvent( EVENT_PLAYER_LEFT_BUY_ZONE );
|
||||
TheTutor->OnEvent(EVENT_PLAYER_LEFT_BUY_ZONE);
|
||||
}
|
||||
|
||||
/* <14ea4e> ../cstrike/dlls/player.cpp:10556 */
|
||||
@ -8505,7 +8515,7 @@ bool IsPrimaryWeaponClass(int classId)
|
||||
bool IsPrimaryWeaponId(int id)
|
||||
{
|
||||
int classId = WEAPONCLASS_NONE;
|
||||
const char *alias = WeaponIDToAlias( id );
|
||||
const char *alias = WeaponIDToAlias(id);
|
||||
|
||||
if (alias)
|
||||
{
|
||||
@ -8525,7 +8535,7 @@ bool IsSecondaryWeaponClass(int classId)
|
||||
bool IsSecondaryWeaponId(int id)
|
||||
{
|
||||
int classId = WEAPONCLASS_NONE;
|
||||
const char *alias = WeaponIDToAlias( id );
|
||||
const char *alias = WeaponIDToAlias(id);
|
||||
|
||||
if (alias)
|
||||
{
|
||||
@ -9133,7 +9143,7 @@ void CBasePlayer::UpdateLocation(bool forceUpdate)
|
||||
if (pev->deadflag == DEAD_NO && UTIL_IsGame("czero"))
|
||||
{
|
||||
// search the place name where is located the player
|
||||
Place playerPlace = TheNavAreaGrid.GetPlace( &pev->origin );
|
||||
Place playerPlace = TheNavAreaGrid.GetPlace(&pev->origin);
|
||||
const BotPhraseList *placeList = TheBotPhrases->GetPlaceList();
|
||||
|
||||
for (BotPhraseList::const_iterator iter = placeList->begin(); iter != placeList->end(); ++iter)
|
||||
@ -9156,7 +9166,7 @@ void CBasePlayer::UpdateLocation(bool forceUpdate)
|
||||
|
||||
for (int i = 1; i <= gpGlobals->maxClients; i++)
|
||||
{
|
||||
CBasePlayer *player = (CBasePlayer *)UTIL_PlayerByIndex( i );
|
||||
CBasePlayer *player = (CBasePlayer *)UTIL_PlayerByIndex(i);
|
||||
|
||||
if (!player)
|
||||
continue;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -33,8 +33,28 @@
|
||||
#endif
|
||||
|
||||
#define CSENTENCEG_MAX 200 // max number of sentence groups
|
||||
#define CSENTENCE_LRU_MAX 32
|
||||
#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];
|
||||
@ -44,13 +64,168 @@ typedef struct
|
||||
} 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
|
||||
|
@ -5,9 +5,17 @@ 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,
|
||||
@ -22,71 +30,169 @@ void CSound::Reset(void)
|
||||
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,34 +206,116 @@ 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
|
||||
|
@ -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
|
||||
|
@ -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,35 +83,45 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pev->globalname)
|
||||
{
|
||||
@ -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
|
||||
|
@ -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);
|
||||
|
||||
// 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
|
@ -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
|
||||
|
@ -54,12 +54,12 @@
|
||||
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);
|
||||
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);
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
||||
@ -72,20 +72,20 @@ public:
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
NOBODY void SetPrevious(CPathTrack *pprevious);
|
||||
NOBODY void Link(void);
|
||||
void SetPrevious(CPathTrack *pprevious);
|
||||
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);
|
||||
CPathTrack *ValidPath(CPathTrack *ppath, int testFlag);
|
||||
void Project(CPathTrack *pstart, CPathTrack *pend, Vector *origin, float dist);
|
||||
|
||||
NOBODY static CPathTrack *Instance(edict_t *pent);
|
||||
static CPathTrack *Instance(edict_t *pent);
|
||||
|
||||
NOBODY CPathTrack *LookAhead(Vector *origin, float dist, int move);
|
||||
NOBODY CPathTrack *Nearest(Vector origin);
|
||||
CPathTrack *LookAhead(Vector *origin, float dist, int move);
|
||||
CPathTrack *Nearest(Vector origin);
|
||||
|
||||
NOBODY CPathTrack *GetNext(void);
|
||||
NOBODY CPathTrack *GetPrevious(void);
|
||||
CPathTrack *GetNext(void);
|
||||
CPathTrack *GetPrevious(void);
|
||||
|
||||
public:
|
||||
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[5];
|
||||
@ -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];
|
||||
@ -183,21 +182,21 @@ private:
|
||||
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);
|
||||
void SetControls(entvars_t *pevControls);
|
||||
|
||||
NOBODY void StopSound(void);
|
||||
NOBODY void UpdateSound(void);
|
||||
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
@ -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);
|
||||
|
||||
if (pev->spawnflags & SF_MULTIMAN_THREAD)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
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
|
||||
|
@ -71,12 +71,6 @@ public:
|
||||
virtual bool UpdateState(GameEventType event, CBaseEntity *entity, CBaseEntity *other);
|
||||
virtual char *GetCurrentStateString(void);
|
||||
|
||||
#ifndef HOOK_GAMEDLL
|
||||
protected:
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
virtual CBaseTutorState *ConstructNewState(int stateType);
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
public:
|
||||
|
||||
@ -86,6 +80,12 @@ public:
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
#ifndef HOOK_GAMEDLL
|
||||
protected:
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
virtual CBaseTutorState *ConstructNewState(int stateType);
|
||||
|
||||
};/* size: 8, cachelines: 1, members: 1 */
|
||||
|
||||
/* <22bfcb> ../cstrike/dlls/tutor_cs_states.cpp:141 */
|
||||
|
@ -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)
|
||||
|
@ -33,7 +33,6 @@
|
||||
#endif
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
enum TutorMessageClass
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "precompiled.h"
|
||||
|
||||
#if 0
|
||||
#if 1
|
||||
|
||||
void *addr_orig;
|
||||
char patchByte[5];
|
||||
@ -1009,7 +1009,7 @@ float UTIL_Approach(float target, float value, float speed)
|
||||
}
|
||||
|
||||
/* <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);
|
||||
@ -1033,7 +1033,7 @@ float UTIL_ApproachAngle(float target, float value, float speed)
|
||||
}
|
||||
|
||||
/* <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();
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
@ -103,6 +107,25 @@ extern globalvars_t *gpGlobals;
|
||||
#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
|
||||
|
@ -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));
|
||||
@ -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);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -46,7 +46,6 @@
|
||||
#define VEHICLE_SPEED11_ACCELERATION 0.001444444444444444
|
||||
#define VEHICLE_SPEED12_ACCELERATION 0.001200000000000000
|
||||
#define VEHICLE_SPEED13_ACCELERATION 0.000916666666666666
|
||||
#define VEHICLE_SPEED14_ACCELERATION 0.001444444444444444
|
||||
|
||||
#define VEHICLE_STARTPITCH 60
|
||||
#define VEHICLE_MAXPITCH 200
|
||||
@ -56,8 +55,8 @@
|
||||
class CFuncVehicleControls: public CBaseEntity
|
||||
{
|
||||
public:
|
||||
NOBODY virtual void Spawn(void);
|
||||
NOBODY virtual int ObjectCaps(void)
|
||||
virtual void Spawn(void);
|
||||
virtual int ObjectCaps(void)
|
||||
{
|
||||
return ObjectCaps_();
|
||||
}
|
||||
@ -73,10 +72,15 @@ public:
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
public:
|
||||
NOBODY void EXPORT Find(void);
|
||||
void EXPORT Find(void);
|
||||
|
||||
};/* size: 152, cachelines: 3, members: 1 */
|
||||
|
||||
NOBODY void FixupAngles2(Vector &v);
|
||||
float_precision Fix2(float angle);
|
||||
void FixupAngles2(Vector &v);
|
||||
|
||||
// linked objects
|
||||
C_DLLEXPORT void func_vehicle(entvars_t *pev);
|
||||
C_DLLEXPORT void func_vehiclecontrols(entvars_t *pev);
|
||||
|
||||
#endif // VEHICLE_H
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -37,7 +37,7 @@
|
||||
class CBasePlayer;
|
||||
|
||||
#define MAX_WEAPONS 32
|
||||
#define MAX_NORMAL_BATTERY 100
|
||||
#define MAX_NORMAL_BATTERY 100.0f
|
||||
|
||||
#define ITEM_FLAG_SELECTONEMPTY 1
|
||||
#define ITEM_FLAG_NOAUTORELOAD 2
|
||||
@ -71,6 +71,30 @@ class CBasePlayer;
|
||||
// spawn flags
|
||||
#define SF_DETONATE 0x0001 // Grenades flagged with this will be triggered when the owner calls detonateSatchelCharges
|
||||
|
||||
// custom enum
|
||||
enum ArmouryItemPack
|
||||
{
|
||||
ARMOURY_MP5NAVY,
|
||||
ARMOURY_TMP,
|
||||
ARMOURY_P90,
|
||||
ARMOURY_MAC10,
|
||||
ARMOURY_AK47,
|
||||
ARMOURY_SG552,
|
||||
ARMOURY_M4A1,
|
||||
ARMOURY_AUG,
|
||||
ARMOURY_SCOUT,
|
||||
ARMOURY_G3SG1,
|
||||
ARMOURY_AWP,
|
||||
ARMOURY_M3,
|
||||
ARMOURY_XM1014,
|
||||
ARMOURY_M249,
|
||||
ARMOURY_FLASHBANG,
|
||||
ARMOURY_HEGRENADE,
|
||||
ARMOURY_KEVLAR,
|
||||
ARMOURY_ASSAULT,
|
||||
ARMOURY_SMOKEGRENADE,
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
WeaponType type;
|
||||
@ -118,17 +142,28 @@ typedef struct
|
||||
class CArmoury: public CBaseEntity
|
||||
{
|
||||
public:
|
||||
NOBODY virtual void Spawn(void);
|
||||
NOBODY virtual void Precache(void);
|
||||
NOBODY virtual void Restart(void);
|
||||
NOBODY virtual void KeyValue(KeyValueData *pkvd);
|
||||
virtual void Spawn(void);
|
||||
virtual void Precache(void);
|
||||
virtual void Restart(void);
|
||||
virtual void KeyValue(KeyValueData *pkvd);
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
||||
void Spawn_(void);
|
||||
void Precache_(void);
|
||||
void Restart_(void);
|
||||
void KeyValue_(KeyValueData *pkvd);
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
public:
|
||||
NOBODY void EXPORT ArmouryTouch(CBaseEntity *pOther);
|
||||
void EXPORT ArmouryTouch(CBaseEntity *pOther);
|
||||
public:
|
||||
int m_iItem;
|
||||
int m_iCount;
|
||||
int m_iInitialCount;
|
||||
bool m_bAlreadyCounted;
|
||||
|
||||
};/* size: 168, cachelines: 3, members: 5 */
|
||||
|
||||
/* <14ed46> ../cstrike/dlls/weapons.h:56 */
|
||||
@ -252,11 +287,11 @@ public:
|
||||
class CBasePlayerItem: public CBaseAnimating
|
||||
{
|
||||
public:
|
||||
NOBODY virtual int Save(CSave &save);
|
||||
NOBODY virtual int Restore(CRestore &restore);
|
||||
NOBODY virtual void SetObjectCollisionBox(void);
|
||||
NOBODY virtual CBaseEntity *Respawn(void);
|
||||
NOXREF virtual int AddToPlayer(CBasePlayer *pPlayer);
|
||||
virtual int Save(CSave &save);
|
||||
virtual int Restore(CRestore &restore);
|
||||
virtual void SetObjectCollisionBox(void);
|
||||
virtual CBaseEntity *Respawn(void);
|
||||
virtual int AddToPlayer(CBasePlayer *pPlayer);
|
||||
virtual int AddDuplicate(CBasePlayerItem *pItem)
|
||||
{
|
||||
return FALSE;
|
||||
@ -294,7 +329,7 @@ public:
|
||||
virtual void Drop(void);
|
||||
virtual void Kill(void);
|
||||
|
||||
NOBODY virtual void AttachToPlayer(CBasePlayer *pPlayer);
|
||||
virtual void AttachToPlayer(CBasePlayer *pPlayer);
|
||||
virtual int PrimaryAmmoIndex(void)
|
||||
{
|
||||
return -1;
|
||||
@ -351,11 +386,11 @@ public:
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
public:
|
||||
NOBODY void EXPORT DestroyItem(void);
|
||||
void EXPORT DestroyItem(void);
|
||||
void EXPORT DefaultTouch(CBaseEntity *pOther);
|
||||
void EXPORT FallThink(void);
|
||||
void EXPORT Materialize(void);
|
||||
NOBODY void EXPORT AttemptToMaterialize(void);
|
||||
void EXPORT AttemptToMaterialize(void);
|
||||
|
||||
void FallInit(void);
|
||||
void CheckRespawn(void);
|
||||
@ -412,21 +447,21 @@ public:
|
||||
class CBasePlayerWeapon: public CBasePlayerItem
|
||||
{
|
||||
public:
|
||||
NOBODY virtual int Save(CSave &save);
|
||||
NOBODY virtual int Restore(CRestore &restore);
|
||||
virtual int Save(CSave &save);
|
||||
virtual int Restore(CRestore &restore);
|
||||
|
||||
virtual int AddToPlayer(CBasePlayer *pPlayer);
|
||||
virtual int AddDuplicate(CBasePlayerItem *pItem);
|
||||
NOBODY virtual BOOL CanDeploy(void);
|
||||
virtual BOOL CanDeploy(void);
|
||||
virtual BOOL IsWeapon(void)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
NOBODY virtual void Holster(int skiplocal = 0);
|
||||
virtual void Holster(int skiplocal = 0);
|
||||
virtual void UpdateItemInfo(void) {};
|
||||
NOBODY virtual void ItemPostFrame(void);
|
||||
NOBODY virtual int PrimaryAmmoIndex(void);
|
||||
NOBODY virtual int SecondaryAmmoIndex(void);
|
||||
virtual void ItemPostFrame(void);
|
||||
virtual int PrimaryAmmoIndex(void);
|
||||
virtual int SecondaryAmmoIndex(void);
|
||||
virtual int UpdateClientData(CBasePlayer *pPlayer);
|
||||
virtual CBasePlayerItem *GetWeaponPtr(void)
|
||||
{
|
||||
@ -441,13 +476,13 @@ public:
|
||||
}
|
||||
virtual BOOL PlayEmptySound(void);
|
||||
virtual void ResetEmptySound(void);
|
||||
virtual void SendWeaponAnim(int iAnim,int skiplocal = 0);
|
||||
NOBODY virtual BOOL IsUseable(void);
|
||||
virtual void PrimaryAttack(void) {}
|
||||
virtual void SecondaryAttack(void) {}
|
||||
virtual void Reload(void) {}
|
||||
virtual void WeaponIdle(void) {}
|
||||
NOBODY virtual void RetireWeapon(void);
|
||||
virtual void SendWeaponAnim(int iAnim, int skiplocal = 0);
|
||||
virtual BOOL IsUseable(void);
|
||||
virtual void PrimaryAttack(void) {};
|
||||
virtual void SecondaryAttack(void) {};
|
||||
virtual void Reload(void) {};
|
||||
virtual void WeaponIdle(void) {};
|
||||
virtual void RetireWeapon(void);
|
||||
virtual BOOL ShouldWeaponIdle(void)
|
||||
{
|
||||
return FALSE;
|
||||
@ -473,26 +508,26 @@ public:
|
||||
int ExtractClipAmmo_(CBasePlayerWeapon *pWeapon);
|
||||
BOOL PlayEmptySound_(void);
|
||||
void ResetEmptySound_(void);
|
||||
void SendWeaponAnim_(int iAnim,int skiplocal = 0);
|
||||
void SendWeaponAnim_(int iAnim, int skiplocal = 0);
|
||||
BOOL IsUseable_(void);
|
||||
void RetireWeapon_(void);
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
public:
|
||||
BOOL AddPrimaryAmmo(int iCount,char *szName,int iMaxClip,int iMaxCarry);
|
||||
NOXREF BOOL AddSecondaryAmmo(int iCount,char *szName,int iMaxCarry);
|
||||
BOOL DefaultDeploy(char *szViewModel,char *szWeaponModel,int iAnim,char *szAnimExt,int skiplocal = 0);
|
||||
int DefaultReload(int iClipSize,int iAnim,float fDelay);
|
||||
NOBODY void FireRemaining(int &shotsFired,float &shootTime,BOOL isGlock18);
|
||||
NOBODY void KickBack(float up_base,float lateral_base,float up_modifier,float lateral_modifier,float up_max,float lateral_max,int direction_change);
|
||||
NOBODY void EjectBrassLate(void);
|
||||
NOBODY void MakeBeam(void);
|
||||
NOBODY void BeamUpdate(void);
|
||||
BOOL AddPrimaryAmmo(int iCount, char *szName, int iMaxClip, int iMaxCarry);
|
||||
BOOL AddSecondaryAmmo(int iCount, char *szName, int iMaxCarry);
|
||||
BOOL DefaultDeploy(char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal = 0);
|
||||
int DefaultReload(int iClipSize, int iAnim, float fDelay);
|
||||
void FireRemaining(int &shotsFired, float &shootTime, BOOL isGlock18);
|
||||
void KickBack(float up_base, float lateral_base, float up_modifier, float lateral_modifier, float up_max, float lateral_max, int direction_change);
|
||||
void EjectBrassLate(void);
|
||||
NOXREF void MakeBeam(void);
|
||||
NOXREF void BeamUpdate(void);
|
||||
void ReloadSound(void);
|
||||
float GetNextAttackDelay(float delay);
|
||||
float GetNextAttackDelay2(float delay);
|
||||
NOBODY bool HasSecondaryAttack(void);
|
||||
bool HasSecondaryAttack(void);
|
||||
BOOL IsPistol(void)
|
||||
{
|
||||
return FALSE;
|
||||
@ -502,7 +537,6 @@ public:
|
||||
bool ShieldSecondaryFire(int iUpAnim,int iDownAnim);
|
||||
|
||||
public:
|
||||
|
||||
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[7];
|
||||
|
||||
int m_iPlayEmptySound;
|
||||
@ -553,30 +587,29 @@ public:
|
||||
return TRUE;
|
||||
}
|
||||
virtual CBaseEntity *Respawn(void);
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
void Spawn_(void);
|
||||
CBaseEntity *Respawn_(void);
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
public:
|
||||
void EXPORT DefaultTouch(CBaseEntity *pOther);
|
||||
void EXPORT Materialize(void);
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
public:
|
||||
void Spawn_(void);
|
||||
//NOBODY BOOL AddAmmo_(CBaseEntity *pOther);
|
||||
CBaseEntity *Respawn_(void);
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
};/* size: 152, cachelines: 3, members: 1 */
|
||||
|
||||
/* <1d03c1> ../cstrike/dlls/weapons.h:508 */
|
||||
class CWeaponBox: 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 void SetObjectCollisionBox(void);
|
||||
NOBODY virtual void Touch(CBaseEntity *pOther);
|
||||
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 SetObjectCollisionBox(void);
|
||||
virtual void Touch(CBaseEntity *pOther);
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
||||
@ -617,7 +650,7 @@ class CUSP: public CBasePlayerWeapon
|
||||
{
|
||||
public:
|
||||
virtual void Spawn(void);
|
||||
NOBODY virtual void Precache(void);
|
||||
virtual void Precache(void);
|
||||
virtual int GetItemInfo(ItemInfo *p);
|
||||
virtual BOOL Deploy(void);
|
||||
virtual float GetMaxSpeed(void)
|
||||
@ -628,8 +661,8 @@ public:
|
||||
{
|
||||
return PISTOL_SLOT;
|
||||
}
|
||||
NOBODY virtual void PrimaryAttack(void);
|
||||
NOBODY virtual void SecondaryAttack(void);
|
||||
virtual void PrimaryAttack(void);
|
||||
virtual void SecondaryAttack(void);
|
||||
virtual void Reload(void);
|
||||
virtual void WeaponIdle(void);
|
||||
virtual BOOL UseDecrement(void)
|
||||
@ -640,9 +673,22 @@ public:
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
||||
void Spawn_(void);
|
||||
void Precache_(void);
|
||||
int GetItemInfo_(ItemInfo *p);
|
||||
BOOL Deploy_(void);
|
||||
void PrimaryAttack_(void);
|
||||
void SecondaryAttack_(void);
|
||||
void Reload_(void);
|
||||
void WeaponIdle_(void);
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
public:
|
||||
//TOOD: this func changed access to private?!
|
||||
UNTESTED void USPFire(float flSpread,float flCycleTime,BOOL fUseSemi);
|
||||
void USPFire(float flSpread,float flCycleTime,BOOL fUseSemi);
|
||||
NOXREF void MakeBeam(void);
|
||||
NOXREF void BeamUpdate(void);
|
||||
public:
|
||||
@ -650,34 +696,6 @@ public:
|
||||
private:
|
||||
unsigned short m_usFireUSP;
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
public:
|
||||
void Spawn_(void);
|
||||
void Precache_(void);
|
||||
int GetItemInfo_(ItemInfo *p);
|
||||
BOOL Deploy_(void);
|
||||
float GetMaxSpeed_(void)
|
||||
{
|
||||
return m_fMaxSpeed;
|
||||
}
|
||||
int iItemSlot_(void)
|
||||
{
|
||||
return PISTOL_SLOT;
|
||||
}
|
||||
NOBODY void PrimaryAttack_(void);
|
||||
NOBODY void SecondaryAttack_(void);
|
||||
void Reload_(void);
|
||||
void WeaponIdle_(void);
|
||||
BOOL UseDecrement_(void)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
BOOL IsPistol_(void)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
};/* size: 344, cachelines: 6, members: 3 */
|
||||
|
||||
/* <28adc9> ../cstrike/dlls/weapons.h:599 */
|
||||
@ -710,6 +728,7 @@ public:
|
||||
int iShellOn;
|
||||
private:
|
||||
unsigned short m_usFireMP5N;
|
||||
|
||||
};/* size: 348, cachelines: 6, members: 4 */
|
||||
|
||||
/* <2a553c> ../cstrike/dlls/weapons.h:624 */
|
||||
@ -766,6 +785,19 @@ public:
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
||||
void Spawn_(void);
|
||||
void Precache_(void);
|
||||
int GetItemInfo_(ItemInfo *p);
|
||||
BOOL Deploy_(void);
|
||||
void PrimaryAttack_(void);
|
||||
void SecondaryAttack_(void);
|
||||
void Reload_(void);
|
||||
void WeaponIdle_(void);
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
public:
|
||||
NOBODY void AK47Fire(float flSpread,float flCycleTime,BOOL fUseAutoAim);
|
||||
|
||||
@ -813,29 +845,59 @@ private:
|
||||
class CAWP: public CBasePlayerWeapon
|
||||
{
|
||||
public:
|
||||
NOBODY virtual void Spawn(void);
|
||||
NOBODY virtual void Precache(void);
|
||||
NOBODY virtual int GetItemInfo(ItemInfo *p);
|
||||
NOBODY virtual BOOL Deploy(void);
|
||||
NOBODY virtual float GetMaxSpeed(void);
|
||||
virtual void Spawn(void);
|
||||
virtual void Precache(void);
|
||||
virtual int GetItemInfo(ItemInfo *p);
|
||||
virtual BOOL Deploy(void);
|
||||
virtual float GetMaxSpeed(void);
|
||||
virtual int iItemSlot(void)
|
||||
{
|
||||
return PRIMARY_WEAPON_SLOT;
|
||||
}
|
||||
NOBODY virtual void PrimaryAttack(void);
|
||||
NOBODY virtual void SecondaryAttack(void);
|
||||
NOBODY virtual void Reload(void);
|
||||
NOBODY virtual void WeaponIdle(void);
|
||||
virtual void PrimaryAttack(void);
|
||||
virtual void SecondaryAttack(void);
|
||||
virtual void Reload(void);
|
||||
virtual void WeaponIdle(void);
|
||||
virtual BOOL UseDecrement(void)
|
||||
{
|
||||
#ifdef CLIENT_WEAPONS
|
||||
return TRUE;
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
||||
void Spawn_(void);
|
||||
void Precache_(void);
|
||||
int GetItemInfo_(ItemInfo *p);
|
||||
BOOL Deploy_(void);
|
||||
float GetMaxSpeed_(void);
|
||||
int iItemSlot_(void)
|
||||
{
|
||||
return PRIMARY_WEAPON_SLOT;
|
||||
}
|
||||
void PrimaryAttack_(void);
|
||||
void SecondaryAttack_(void);
|
||||
void Reload_(void);
|
||||
void WeaponIdle_(void);
|
||||
BOOL UseDecrement_(void)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
public:
|
||||
NOBODY void AWPFire(float flSpread,float flCycleTime,BOOL fUseAutoAim);
|
||||
void AWPFire(float flSpread,float flCycleTime,BOOL fUseAutoAim);
|
||||
|
||||
public:
|
||||
int m_iShell;
|
||||
|
||||
private:
|
||||
unsigned short m_usFireAWP;
|
||||
|
||||
};/* size: 344, cachelines: 6, members: 3 */
|
||||
|
||||
/* <245949> ../cstrike/dlls/weapons.h:721 */
|
||||
@ -1260,10 +1322,7 @@ public:
|
||||
NOBODY virtual void Precache(void);
|
||||
NOBODY virtual int GetItemInfo(ItemInfo *p);
|
||||
NOBODY virtual BOOL Deploy(void);
|
||||
virtual float GetMaxSpeed(void)
|
||||
{
|
||||
return 245.0f;
|
||||
}
|
||||
virtual float GetMaxSpeed(void);
|
||||
virtual int iItemSlot(void)
|
||||
{
|
||||
return PRIMARY_WEAPON_SLOT;
|
||||
@ -1275,6 +1334,20 @@ public:
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
||||
void Spawn_(void);
|
||||
void Precache_(void);
|
||||
int GetItemInfo_(ItemInfo *p);
|
||||
BOOL Deploy_(void);
|
||||
float GetMaxSpeed_(void);
|
||||
void PrimaryAttack_(void);
|
||||
void Reload_(void);
|
||||
void WeaponIdle_(void);
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
||||
public:
|
||||
NOBODY void P90Fire(float flSpread,float flCycleTime,BOOL fUseAutoAim);
|
||||
public:
|
||||
@ -1307,10 +1380,13 @@ public:
|
||||
}
|
||||
public:
|
||||
NOBODY void SCOUTFire(float flSpread,float flCycleTime,BOOL fUseAutoAim);
|
||||
|
||||
public:
|
||||
int m_iShell;
|
||||
|
||||
private:
|
||||
unsigned short m_usFireScout;
|
||||
|
||||
};/* size: 344, cachelines: 6, members: 3 */
|
||||
|
||||
/* <2aa3d5> ../cstrike/dlls/weapons.h:1089 */
|
||||
@ -1666,16 +1742,21 @@ void ApplyMultiDamage(entvars_t *pevInflictor, entvars_t *pevAttacker);
|
||||
void AddMultiDamage(entvars_t *pevInflictor, CBaseEntity *pEntity, float flDamage, int bitsDamageType);
|
||||
void SpawnBlood(Vector vecSpot, int bloodColor, float flDamage);
|
||||
NOXREF int DamageDecal(CBaseEntity *pEntity, int bitsDamageType);
|
||||
NOXREF void DecalGunshot(TraceResult *pTrace, int iBulletType, bool ClientOnly, entvars_t *pShooter, bool bHitMetal);
|
||||
NOBODY void EjectBrass(Vector &vecOrigin, Vector &vecLeft, Vector &vecVelocity, float rotation, int model, int soundtype, int entityIndex);
|
||||
NOBODY void EjectBrass2(Vector &vecOrigin, Vector &vecVelocity, float rotation, int model, int soundtype, entvars_t *pev);
|
||||
NOXREF void AddAmmoNameToAmmoRegistry(const char *szAmmoname);
|
||||
void DecalGunshot(TraceResult *pTrace, int iBulletType, bool ClientOnly, entvars_t *pShooter, bool bHitMetal);
|
||||
void EjectBrass(const Vector &vecOrigin, const Vector &vecLeft, const Vector &vecVelocity, float rotation, int model, int soundtype, int entityIndex);
|
||||
NOXREF void EjectBrass2(const Vector &vecOrigin, const Vector &vecVelocity, float rotation, int model, int soundtype, entvars_t *pev);
|
||||
void AddAmmoNameToAmmoRegistry(const char *szAmmoname);
|
||||
void UTIL_PrecacheOtherWeapon(const char *szClassname);
|
||||
NOXREF void UTIL_PrecacheOtherWeapon2(const char *szClassname);
|
||||
void W_Precache(void);
|
||||
NOXREF BOOL CanAttack(float attack_time, float curtime, BOOL isPredicted);
|
||||
BOOL CanAttack(float attack_time, float curtime, BOOL isPredicted);
|
||||
|
||||
// linked object
|
||||
C_DLLEXPORT void weapon_knife(entvars_t *pev);
|
||||
C_DLLEXPORT void weapon_usp(entvars_t *pev);
|
||||
C_DLLEXPORT void weapon_awp(entvars_t *pev);
|
||||
C_DLLEXPORT void armoury_entity(entvars_t *pev);
|
||||
C_DLLEXPORT void weaponbox(entvars_t *pev);
|
||||
C_DLLEXPORT void weapon_p90(entvars_t *pev);
|
||||
|
||||
#endif // WEAPONS_H
|
||||
|
@ -237,6 +237,7 @@ WeaponIdType AliasToWeaponID(const char *alias)
|
||||
return weaponAliasInfo[i].id;
|
||||
}
|
||||
}
|
||||
|
||||
return WEAPON_NONE;
|
||||
}
|
||||
|
||||
@ -254,6 +255,7 @@ const char *BuyAliasToWeaponID(const char *alias, WeaponIdType &id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
id = WEAPON_NONE;
|
||||
return NULL;
|
||||
}
|
||||
@ -266,6 +268,7 @@ const char *WeaponIDToAlias(int id)
|
||||
if (weaponAliasInfo[i].id == id)
|
||||
return weaponAliasInfo[i].alias;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -280,13 +283,14 @@ WeaponClassType AliasToWeaponClass(const char *alias)
|
||||
return weaponClassAliasInfo[i].id;
|
||||
}
|
||||
}
|
||||
|
||||
return WEAPONCLASS_NONE;
|
||||
}
|
||||
|
||||
/* <22ce5a> ../cstrike/dlls/weapontype.cpp:276 */
|
||||
WeaponClassType WeaponIDToWeaponClass(int id)
|
||||
{
|
||||
return AliasToWeaponClass( WeaponIDToAlias(id) );
|
||||
return AliasToWeaponClass(WeaponIDToAlias(id));
|
||||
}
|
||||
|
||||
/* <22cee3> ../cstrike/dlls/weapontype.cpp:285 */
|
||||
@ -313,19 +317,18 @@ bool IsPrimaryWeapon(int id)
|
||||
case WEAPON_AK47:
|
||||
case WEAPON_P90:
|
||||
case WEAPON_SHIELDGUN:
|
||||
{
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* <22cf19> ../cstrike/dlls/weapontype.cpp:318 */
|
||||
NOXREF bool IsSecondaryWeapon(int id)
|
||||
{
|
||||
switch(id)
|
||||
switch (id)
|
||||
{
|
||||
case WEAPON_P228:
|
||||
case WEAPON_ELITE:
|
||||
@ -337,6 +340,7 @@ NOXREF bool IsSecondaryWeapon(int id)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -348,6 +352,7 @@ WeaponInfoStruct *GetWeaponInfo(int weaponID)
|
||||
if (weaponInfo[i].id == weaponID)
|
||||
return &weaponInfo[i];
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -474,5 +479,6 @@ bool CanBuyWeaponByMaptype(int playerTeam, WeaponIdType weaponID, bool useAssasi
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -138,6 +138,41 @@ enum WeaponState
|
||||
WPNSTATE_SHIELD_DRAWN = (1 << 5),
|
||||
};
|
||||
|
||||
// custom enum
|
||||
// the default amount of ammo that comes with each gun when it spawns
|
||||
enum ClipGiveDefault
|
||||
{
|
||||
P228_DEFAULT_GIVE = 13,
|
||||
GLOCK18_DEFAULT_GIVE = 20,
|
||||
SCOUT_DEFAULT_GIVE = 10,
|
||||
HEGRENADE_DEFAULT_GIVE = 1,
|
||||
XM1014_DEFAULT_GIVE = 7,
|
||||
C4_DEFAULT_GIVE = 1,
|
||||
MAC10_DEFAULT_GIVE = 30,
|
||||
AUG_DEFAULT_GIVE = 30,
|
||||
SMOKEGRENADE_DEFAULT_GIVE = 1,
|
||||
ELITE_DEFAULT_GIVE = 30,
|
||||
FIVESEVEN_DEFAULT_GIVE = 20,
|
||||
UMP45_DEFAULT_GIVE = 25,
|
||||
SG550_DEFAULT_GIVE = 30,
|
||||
GALIL_DEFAULT_GIVE = 35,
|
||||
FAMAS_DEFAULT_GIVE = 25,
|
||||
USP_DEFAULT_GIVE = 12,
|
||||
AWP_DEFAULT_GIVE = 10,
|
||||
MP5N_DEFAULT_GIVE = 30,
|
||||
M249_DEFAULT_GIVE = 100,
|
||||
M3_DEFAULT_GIVE = 8,
|
||||
M4A1_DEFAULT_GIVE = 30,
|
||||
TMP_DEFAULT_GIVE = 30,
|
||||
G3SG1_DEFAULT_GIVE = 20,
|
||||
FLASHBANG_DEFAULT_GIVE = 1,
|
||||
DEAGLE_DEFAULT_GIVE = 7,
|
||||
SG552_DEFAULT_GIVE = 30,
|
||||
AK47_DEFAULT_GIVE = 30,
|
||||
/*KNIFE_DEFAULT_GIVE = 1,*/
|
||||
P90_DEFAULT_GIVE = 50,
|
||||
};
|
||||
|
||||
enum ClipSizeType
|
||||
{
|
||||
P228_MAX_CLIP = 13,
|
||||
@ -166,6 +201,39 @@ enum ClipSizeType
|
||||
P90_MAX_CLIP = 50,
|
||||
};
|
||||
|
||||
enum WeightWeapon
|
||||
{
|
||||
P228_WEIGHT = 5,
|
||||
GLOCK18_WEIGHT = 5,
|
||||
SCOUT_WEIGHT = 20,
|
||||
HEGRENADE_WEIGHT = 1,
|
||||
XM1014_WEIGHT = 20,
|
||||
C4_WEIGHT = 3,
|
||||
MAC10_WEIGHT = 25,
|
||||
AUG_WEIGHT = 25,
|
||||
SMOKEGRENADE_WEIGHT = 1,
|
||||
ELITE_WEIGHT = 5,
|
||||
FIVESEVEN_WEIGHT = 5,
|
||||
UMP45_WEIGHT = 25,
|
||||
SG550_WEIGHT = 20,
|
||||
GALIL_WEIGHT = 25,
|
||||
FAMAS_WEIGHT = 75,//
|
||||
USP_WEIGHT = 5,//
|
||||
AWP_WEIGHT = 30,//
|
||||
MP5N_WEIGHT = 25,
|
||||
M249_WEIGHT = 25,
|
||||
M3_WEIGHT = 20,
|
||||
M4A1_WEIGHT = 25,
|
||||
TMP_WEIGHT = 30,
|
||||
G3SG1_WEIGHT = 20,
|
||||
FLASHBANG_WEIGHT = 1,
|
||||
DEAGLE_WEIGHT = 7,
|
||||
SG552_WEIGHT = 25,
|
||||
AK47_WEIGHT = 25,
|
||||
P90_WEIGHT = 26,//
|
||||
KNIFE_WEIGHT = 0,
|
||||
};
|
||||
|
||||
enum MaxAmmoType
|
||||
{
|
||||
MAX_AMMO_BUCKSHOT = 32,
|
||||
|
@ -504,7 +504,7 @@ void CWorld::__MAKE_VHOOK(Precache)(void)
|
||||
//!!!UNDONE why is there so much Spawn code in the Precache function? I'll just keep it here
|
||||
|
||||
///!!!LATER - do we want a sound ent in deathmatch? (sjb)
|
||||
//pSoundEnt = CBaseEntity::Create( "soundent", g_vecZero, g_vecZero, edict() );
|
||||
//pSoundEnt = CBaseEntity::Create("soundent", g_vecZero, g_vecZero, edict());
|
||||
pSoundEnt = GetClassPtr((CSoundEnt *)NULL);
|
||||
pSoundEnt->Spawn();
|
||||
|
||||
|
@ -4,32 +4,32 @@
|
||||
LINK_ENTITY_TO_CLASS(weapon_ak47, CAK47);
|
||||
|
||||
/* <235327> ../cstrike/dlls/wpn_shared/wpn_ak47.cpp:52 */
|
||||
NOBODY void CAK47::Spawn(void)
|
||||
NOBODY void CAK47::__MAKE_VHOOK(Spawn)(void)
|
||||
{
|
||||
}
|
||||
|
||||
/* <235280> ../cstrike/dlls/wpn_shared/wpn_ak47.cpp:66 */
|
||||
NOBODY void CAK47::Precache(void)
|
||||
NOBODY void CAK47::__MAKE_VHOOK(Precache)(void)
|
||||
{
|
||||
}
|
||||
|
||||
/* <2352a7> ../cstrike/dlls/wpn_shared/wpn_ak47.cpp:82 */
|
||||
NOBODY int CAK47::GetItemInfo(ItemInfo *p)
|
||||
NOBODY int CAK47::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p)
|
||||
{
|
||||
}
|
||||
|
||||
/* <235300> ../cstrike/dlls/wpn_shared/wpn_ak47.cpp:99 */
|
||||
NOBODY BOOL CAK47::Deploy(void)
|
||||
NOBODY BOOL CAK47::__MAKE_VHOOK(Deploy)(void)
|
||||
{
|
||||
}
|
||||
|
||||
/* <2352da> ../cstrike/dlls/wpn_shared/wpn_ak47.cpp:108 */
|
||||
NOBODY void CAK47::SecondaryAttack(void)
|
||||
NOBODY void CAK47::__MAKE_VHOOK(SecondaryAttack)(void)
|
||||
{
|
||||
}
|
||||
|
||||
/* <235523> ../cstrike/dlls/wpn_shared/wpn_ak47.cpp:112 */
|
||||
NOBODY void CAK47::PrimaryAttack(void)
|
||||
NOBODY void CAK47::__MAKE_VHOOK(PrimaryAttack)(void)
|
||||
{
|
||||
// Length2D(const Vector *const this); // 116
|
||||
// PrimaryAttack(CAK47 *const this); // 112
|
||||
@ -54,13 +54,57 @@ NOBODY void CAK47::AK47Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim)
|
||||
}
|
||||
|
||||
/* <2353d8> ../cstrike/dlls/wpn_shared/wpn_ak47.cpp:204 */
|
||||
NOBODY void CAK47::Reload(void)
|
||||
NOBODY void CAK47::__MAKE_VHOOK(Reload)(void)
|
||||
{
|
||||
// Reload(CAK47 *const this); // 204
|
||||
}
|
||||
|
||||
/* <23539d> ../cstrike/dlls/wpn_shared/wpn_ak47.cpp:219 */
|
||||
NOBODY void CAK47::WeaponIdle(void)
|
||||
NOBODY void CAK47::__MAKE_VHOOK(WeaponIdle)(void)
|
||||
{
|
||||
// WeaponIdle(CAK47 *const this); // 219
|
||||
}
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
||||
void CAK47::Spawn(void)
|
||||
{
|
||||
Spawn_();
|
||||
}
|
||||
|
||||
void CAK47::Precache(void)
|
||||
{
|
||||
Precache_();
|
||||
}
|
||||
|
||||
int CAK47::GetItemInfo(ItemInfo *p)
|
||||
{
|
||||
return GetItemInfo_(p);
|
||||
}
|
||||
|
||||
BOOL CAK47::Deploy(void)
|
||||
{
|
||||
return Deploy_();
|
||||
}
|
||||
|
||||
void CAK47::PrimaryAttack(void)
|
||||
{
|
||||
PrimaryAttack_();
|
||||
}
|
||||
|
||||
void CAK47::SecondaryAttack(void)
|
||||
{
|
||||
SecondaryAttack_();
|
||||
}
|
||||
|
||||
void CAK47::Reload(void)
|
||||
{
|
||||
Reload_();
|
||||
}
|
||||
|
||||
void CAK47::WeaponIdle(void)
|
||||
{
|
||||
WeaponIdle_();
|
||||
}
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
@ -1,79 +1,327 @@
|
||||
#include "precompiled.h"
|
||||
|
||||
#define AWP_MAX_SPEED 210
|
||||
#define AWP_MAX_SPEED_ZOOM 150
|
||||
#define AWP_RELOAD_TIME 2.5
|
||||
|
||||
enum awp_e
|
||||
{
|
||||
AWP_IDLE,
|
||||
AWP_SHOOT,
|
||||
AWP_SHOOT2,
|
||||
AWP_SHOOT3,
|
||||
AWP_RELOAD,
|
||||
AWP_DRAW,
|
||||
};
|
||||
|
||||
/* <23fdac> ../cstrike/dlls/wpn_shared/wpn_awp.cpp:50 */
|
||||
LINK_ENTITY_TO_CLASS(weapon_awp, CAWP);
|
||||
|
||||
/* <23fb10> ../cstrike/dlls/wpn_shared/wpn_awp.cpp:52 */
|
||||
NOBODY void CAWP::Spawn(void)
|
||||
void CAWP::__MAKE_VHOOK(Spawn)(void)
|
||||
{
|
||||
Precache();
|
||||
m_iId = WEAPON_AWP;
|
||||
SET_MODEL(ENT(pev), "models/w_awp.mdl");
|
||||
|
||||
m_iDefaultAmmo = AWP_DEFAULT_GIVE;
|
||||
FallInit();
|
||||
}
|
||||
|
||||
/* <23fa2c> ../cstrike/dlls/wpn_shared/wpn_awp.cpp:64 */
|
||||
NOBODY void CAWP::Precache(void)
|
||||
void CAWP::__MAKE_VHOOK(Precache)(void)
|
||||
{
|
||||
PRECACHE_MODEL("models/v_awp.mdl");
|
||||
PRECACHE_MODEL("models/w_awp.mdl");
|
||||
|
||||
PRECACHE_SOUND("weapons/awp1.wav");
|
||||
PRECACHE_SOUND("weapons/boltpull1.wav");
|
||||
PRECACHE_SOUND("weapons/boltup.wav");
|
||||
PRECACHE_SOUND("weapons/boltdown.wav");
|
||||
PRECACHE_SOUND("weapons/zoom.wav");
|
||||
PRECACHE_SOUND("weapons/awp_deploy.wav");
|
||||
PRECACHE_SOUND("weapons/awp_clipin.wav");
|
||||
PRECACHE_SOUND("weapons/awp_clipout.wav");
|
||||
|
||||
m_iShell = PRECACHE_MODEL("models/rshell_big.mdl");
|
||||
m_iShellId = m_iShell;
|
||||
m_usFireAWP = PRECACHE_EVENT(1, "events/awp.sc");
|
||||
}
|
||||
|
||||
/* <23fa53> ../cstrike/dlls/wpn_shared/wpn_awp.cpp:83 */
|
||||
NOBODY int CAWP::GetItemInfo(ItemInfo *p)
|
||||
int CAWP::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p)
|
||||
{
|
||||
p->pszName = STRING(pev->classname);
|
||||
p->pszAmmo1 = "338Magnum";
|
||||
p->iMaxAmmo1 = MAX_AMMO_338MAGNUM;
|
||||
p->pszAmmo2 = NULL;
|
||||
p->iMaxAmmo2 = -1;
|
||||
p->iMaxClip = AWP_MAX_CLIP;
|
||||
p->iSlot = 0;
|
||||
p->iPosition = 2;
|
||||
|
||||
m_iId = WEAPON_AWP;
|
||||
p->iId = WEAPON_AWP;
|
||||
|
||||
p->iFlags = 0;
|
||||
p->iWeight = AWP_WEIGHT;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* <23fc19> ../cstrike/dlls/wpn_shared/wpn_awp.cpp:100 */
|
||||
NOBODY BOOL CAWP::Deploy(void)
|
||||
BOOL CAWP::__MAKE_VHOOK(Deploy)(void)
|
||||
{
|
||||
// Deploy(CAWP *const this); // 100
|
||||
if (DefaultDeploy("models/v_awp.mdl", "models/p_awp.mdl", AWP_DRAW, "rifle", UseDecrement() != FALSE))
|
||||
{
|
||||
m_pPlayer->m_flNextAttack = GetNextAttackDelay(1.45);
|
||||
m_flNextPrimaryAttack = m_pPlayer->m_flNextAttack;
|
||||
|
||||
m_flNextSecondaryAttack = WEAPON_TIMEBASED + 1.0;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* <23faac> ../cstrike/dlls/wpn_shared/wpn_awp.cpp:113 */
|
||||
NOBODY void CAWP::SecondaryAttack(void)
|
||||
void CAWP::__MAKE_VHOOK(SecondaryAttack)(void)
|
||||
{
|
||||
// EMIT_SOUND(edict_t *entity,
|
||||
// int channel,
|
||||
// const char *sample,
|
||||
// float volume,
|
||||
// float attenuation); // 139
|
||||
switch (m_pPlayer->m_iFOV)
|
||||
{
|
||||
case 90: m_pPlayer->m_iFOV = m_pPlayer->pev->fov = 40; break;
|
||||
case 40: m_pPlayer->m_iFOV = m_pPlayer->pev->fov = 10; break;
|
||||
default: m_pPlayer->m_iFOV = m_pPlayer->pev->fov = 90; break;
|
||||
}
|
||||
|
||||
if (TheBots != NULL)
|
||||
{
|
||||
TheBots->OnEvent(EVENT_WEAPON_ZOOMED, m_pPlayer);
|
||||
}
|
||||
|
||||
m_pPlayer->ResetMaxSpeed();
|
||||
EMIT_SOUND(m_pPlayer->edict(), CHAN_ITEM, "weapons/zoom.wav", 0.2, 2.4);
|
||||
|
||||
m_flNextSecondaryAttack = WEAPON_TIMEBASED + 0.3;
|
||||
}
|
||||
|
||||
/* <23fd53> ../cstrike/dlls/wpn_shared/wpn_awp.cpp:143 */
|
||||
NOBODY void CAWP::PrimaryAttack(void)
|
||||
void CAWP::__MAKE_VHOOK(PrimaryAttack)(void)
|
||||
{
|
||||
// Length2D(const Vector *const this); // 147
|
||||
// PrimaryAttack(CAWP *const this); // 143
|
||||
if (!(m_pPlayer->pev->flags & FL_ONGROUND))
|
||||
{
|
||||
AWPFire(0.85, 1.45, FALSE);
|
||||
}
|
||||
else if (m_pPlayer->pev->velocity.Length2D() > 140)
|
||||
{
|
||||
AWPFire(0.25, 1.45, FALSE);
|
||||
}
|
||||
else if (m_pPlayer->pev->velocity.Length2D() > 10)
|
||||
{
|
||||
AWPFire(0.1, 1.45, FALSE);
|
||||
}
|
||||
else if (m_pPlayer->pev->flags & FL_DUCKING)
|
||||
{
|
||||
AWPFire(0.0, 1.45, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
AWPFire(0.001, 1.45, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
/* <23fe76> ../cstrike/dlls/wpn_shared/wpn_awp.cpp:157 */
|
||||
NOBODY void CAWP::AWPFire(float flSpread, float flCycleTime, BOOL fUseAutoAim)
|
||||
void CAWP::AWPFire(float flSpread, float flCycleTime, BOOL fUseAutoAim)
|
||||
{
|
||||
// {
|
||||
// Vector vecAiming; // 205
|
||||
// Vector vecSrc; // 207
|
||||
// Vector vecDir; // 209
|
||||
// int flag; // 212
|
||||
// operator+(const Vector *const this,
|
||||
// const Vector &v); // 194
|
||||
// Vector(Vector *const this,
|
||||
// const Vector &v); // 210
|
||||
// Vector(Vector *const this,
|
||||
// const Vector &v); // 210
|
||||
// }
|
||||
Vector vecAiming;
|
||||
Vector vecSrc;
|
||||
Vector vecDir;
|
||||
int flag;
|
||||
|
||||
if (m_pPlayer->pev->fov != DEFAULT_FOV)
|
||||
{
|
||||
m_pPlayer->m_bResumeZoom = true;
|
||||
m_pPlayer->m_iLastZoom = m_pPlayer->m_iFOV;
|
||||
|
||||
// reset a fov
|
||||
m_pPlayer->m_iFOV = DEFAULT_FOV;
|
||||
m_pPlayer->pev->fov = DEFAULT_FOV;
|
||||
}
|
||||
else
|
||||
{
|
||||
flSpread += 0.08;
|
||||
}
|
||||
|
||||
if (m_iClip <= 0)
|
||||
{
|
||||
if (m_fFireOnEmpty)
|
||||
{
|
||||
PlayEmptySound();
|
||||
m_flNextPrimaryAttack = GetNextAttackDelay(0.2);
|
||||
}
|
||||
|
||||
if (TheBots != NULL)
|
||||
{
|
||||
TheBots->OnEvent(EVENT_WEAPON_FIRED_ON_EMPTY, m_pPlayer, 0);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
m_iClip--;
|
||||
|
||||
m_pPlayer->pev->effects |= EF_MUZZLEFLASH;
|
||||
m_pPlayer->SetAnimation(PLAYER_ATTACK1);
|
||||
|
||||
UTIL_MakeVectors(m_pPlayer->pev->v_angle + m_pPlayer->pev->punchangle);
|
||||
|
||||
m_pPlayer->m_flEjectBrass = gpGlobals->time + 0.55;
|
||||
m_pPlayer->m_iWeaponVolume = BIG_EXPLOSION_VOLUME;
|
||||
m_pPlayer->m_iWeaponFlash = NORMAL_GUN_FLASH;
|
||||
|
||||
vecSrc = m_pPlayer->GetGunPosition();
|
||||
vecDir = gpGlobals->v_forward;
|
||||
|
||||
vecAiming = m_pPlayer->FireBullets3
|
||||
(
|
||||
vecSrc,
|
||||
vecDir,
|
||||
flSpread,
|
||||
8192.0,
|
||||
3,
|
||||
BULLET_PLAYER_338MAG,
|
||||
115,
|
||||
0.99,
|
||||
m_pPlayer->pev,
|
||||
true,
|
||||
m_pPlayer->random_seed
|
||||
);
|
||||
|
||||
#ifdef CLIENT_WEAPONS
|
||||
flag = FEV_NOTHOST;
|
||||
#else
|
||||
flag = 0;
|
||||
#endif // CLIENT_WEAPONS
|
||||
|
||||
PLAYBACK_EVENT_FULL
|
||||
(
|
||||
flag,
|
||||
ENT(m_pPlayer->pev),
|
||||
m_usFireAWP,
|
||||
0,
|
||||
(float *)&g_vecZero,
|
||||
(float *)&g_vecZero,
|
||||
vecAiming.x,
|
||||
vecAiming.y,
|
||||
(int)(m_pPlayer->pev->punchangle.x * 100),
|
||||
(int)(m_pPlayer->pev->punchangle.x * 100),
|
||||
FALSE,
|
||||
FALSE
|
||||
);
|
||||
|
||||
m_flNextSecondaryAttack = GetNextAttackDelay(flCycleTime);
|
||||
m_flNextPrimaryAttack = m_flNextSecondaryAttack;
|
||||
|
||||
if (!m_iClip && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0)
|
||||
{
|
||||
m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0);
|
||||
}
|
||||
|
||||
m_flTimeWeaponIdle = WEAPON_TIMEBASED + 2.0;
|
||||
m_pPlayer->pev->punchangle.x -= 2;
|
||||
}
|
||||
|
||||
/* <23fbc1> ../cstrike/dlls/wpn_shared/wpn_awp.cpp:239 */
|
||||
NOBODY void CAWP::Reload(void)
|
||||
void CAWP::__MAKE_VHOOK(Reload)(void)
|
||||
{
|
||||
// {
|
||||
// int iResult; // 244
|
||||
// }
|
||||
// Reload(CAWP *const this); // 239
|
||||
int iResult;
|
||||
|
||||
if (m_pPlayer->ammo_338mag <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
iResult = DefaultReload(AWP_MAX_CLIP, AWP_RELOAD, AWP_RELOAD_TIME);
|
||||
|
||||
if (iResult)
|
||||
{
|
||||
m_pPlayer->SetAnimation(PLAYER_RELOAD);
|
||||
|
||||
if (m_pPlayer->pev->fov != DEFAULT_FOV)
|
||||
{
|
||||
m_pPlayer->m_iFOV = 10;
|
||||
m_pPlayer->pev->fov = 10;
|
||||
|
||||
SecondaryAttack();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* <23fb86> ../cstrike/dlls/wpn_shared/wpn_awp.cpp:265 */
|
||||
NOBODY void CAWP::WeaponIdle(void)
|
||||
void CAWP::__MAKE_VHOOK(WeaponIdle)(void)
|
||||
{
|
||||
// WeaponIdle(CAWP *const this); // 265
|
||||
ResetEmptySound();
|
||||
m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES);
|
||||
|
||||
if (m_flTimeWeaponIdle <= WEAPON_TIMEBASED && m_iClip)
|
||||
{
|
||||
m_flTimeWeaponIdle = WEAPON_TIMEBASED + 60;
|
||||
SendWeaponAnim(AWP_IDLE, UseDecrement() != FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
/* <23fa86> ../cstrike/dlls/wpn_shared/wpn_awp.cpp:283 */
|
||||
NOBODY float CAWP::GetMaxSpeed(void)
|
||||
float CAWP::__MAKE_VHOOK(GetMaxSpeed)(void)
|
||||
{
|
||||
return m_pPlayer->m_iFOV == DEFAULT_FOV ? AWP_MAX_SPEED : AWP_MAX_SPEED_ZOOM;
|
||||
}
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
||||
void CAWP::Spawn(void)
|
||||
{
|
||||
Spawn_();
|
||||
}
|
||||
|
||||
void CAWP::Precache(void)
|
||||
{
|
||||
Precache_();
|
||||
}
|
||||
|
||||
int CAWP::GetItemInfo(ItemInfo *p)
|
||||
{
|
||||
return GetItemInfo_(p);
|
||||
}
|
||||
|
||||
BOOL CAWP::Deploy(void)
|
||||
{
|
||||
return Deploy_();
|
||||
}
|
||||
|
||||
float CAWP::GetMaxSpeed(void)
|
||||
{
|
||||
return GetMaxSpeed_();
|
||||
}
|
||||
|
||||
void CAWP::PrimaryAttack(void)
|
||||
{
|
||||
PrimaryAttack_();
|
||||
}
|
||||
|
||||
void CAWP::SecondaryAttack(void)
|
||||
{
|
||||
SecondaryAttack_();
|
||||
}
|
||||
|
||||
void CAWP::Reload(void)
|
||||
{
|
||||
Reload_();
|
||||
}
|
||||
|
||||
void CAWP::WeaponIdle(void)
|
||||
{
|
||||
WeaponIdle_();
|
||||
}
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
@ -1,61 +1,289 @@
|
||||
#include "precompiled.h"
|
||||
|
||||
#define P90_MAX_SPEED 245
|
||||
#define P90_RELOAD_TIME 3.4
|
||||
|
||||
enum p90_e
|
||||
{
|
||||
P90_IDLE1,
|
||||
P90_RELOAD,
|
||||
P90_DRAW,
|
||||
P90_SHOOT1,
|
||||
P90_SHOOT2,
|
||||
P90_SHOOT3
|
||||
};
|
||||
|
||||
/* <29657d> ../cstrike/dlls/wpn_shared/wpn_p90.cpp:49 */
|
||||
LINK_ENTITY_TO_CLASS(weapon_p90, CP90);
|
||||
|
||||
/* <296337> ../cstrike/dlls/wpn_shared/wpn_p90.cpp:51 */
|
||||
NOBODY void CP90::Spawn(void)
|
||||
void CP90::__MAKE_VHOOK(Spawn)(void)
|
||||
{
|
||||
Precache();
|
||||
m_iId = WEAPON_P90;
|
||||
SET_MODEL(edict(), "models/w_p90.mdl");
|
||||
|
||||
m_iDefaultAmmo = P90_DEFAULT_GIVE;
|
||||
m_flAccuracy = 0.2;
|
||||
m_iShotsFired = 0;
|
||||
m_bDelayFire = false;
|
||||
|
||||
FallInit();
|
||||
}
|
||||
|
||||
/* <2962b6> ../cstrike/dlls/wpn_shared/wpn_p90.cpp:66 */
|
||||
NOBODY void CP90::Precache(void)
|
||||
void CP90::__MAKE_VHOOK(Precache)(void)
|
||||
{
|
||||
PRECACHE_MODEL("models/v_p90.mdl");
|
||||
PRECACHE_MODEL("models/w_p90.mdl");
|
||||
|
||||
PRECACHE_SOUND("weapons/p90-1.wav");
|
||||
PRECACHE_SOUND("weapons/p90_clipout.wav");
|
||||
PRECACHE_SOUND("weapons/p90_clipin.wav");
|
||||
PRECACHE_SOUND("weapons/p90_boltpull.wav");
|
||||
PRECACHE_SOUND("weapons/p90_cliprelease.wav");
|
||||
|
||||
m_iShell = PRECACHE_MODEL("models/rshell.mdl");
|
||||
m_usFireP90 = PRECACHE_EVENT(1, "events/p90.sc");
|
||||
}
|
||||
|
||||
/* <2962dd> ../cstrike/dlls/wpn_shared/wpn_p90.cpp:83 */
|
||||
NOBODY int CP90::GetItemInfo(ItemInfo *p)
|
||||
int CP90::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p)
|
||||
{
|
||||
p->pszName = STRING(pev->classname);
|
||||
p->pszAmmo1 = "57mm";
|
||||
p->iMaxAmmo1 = MAX_AMMO_57MM;
|
||||
p->pszAmmo2 = NULL;
|
||||
p->iMaxAmmo2 = -1;
|
||||
p->iMaxClip = P90_MAX_CLIP;
|
||||
p->iSlot = 0;
|
||||
p->iPosition = 8;
|
||||
|
||||
m_iId = WEAPON_P90;
|
||||
p->iId = WEAPON_P90;
|
||||
|
||||
p->iFlags = 0;
|
||||
p->iWeight = P90_WEIGHT;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* <296310> ../cstrike/dlls/wpn_shared/wpn_p90.cpp:100 */
|
||||
NOBODY BOOL CP90::Deploy(void)
|
||||
BOOL CP90::__MAKE_VHOOK(Deploy)(void)
|
||||
{
|
||||
m_iShotsFired = 0;
|
||||
m_bDelayFire = false;
|
||||
m_flAccuracy = 0.2;
|
||||
|
||||
iShellOn = 1;
|
||||
|
||||
return DefaultDeploy("models/v_p90.mdl", "models/p_p90.mdl", P90_DRAW, "carbine", UseDecrement() != FALSE);
|
||||
}
|
||||
|
||||
/* <296533> ../cstrike/dlls/wpn_shared/wpn_p90.cpp:110 */
|
||||
NOBODY void CP90::PrimaryAttack(void)
|
||||
void CP90::__MAKE_VHOOK(PrimaryAttack)(void)
|
||||
{
|
||||
// Length2D(const Vector *const this); // 114
|
||||
// PrimaryAttack(CP90 *const this); // 110
|
||||
if (!(m_pPlayer->pev->flags & FL_ONGROUND))
|
||||
{
|
||||
P90Fire(0.3 * m_flAccuracy, 0.066, FALSE);
|
||||
}
|
||||
else if (m_pPlayer->pev->velocity.Length2D() > 170)
|
||||
{
|
||||
P90Fire(0.115 * m_flAccuracy, 0.066, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
P90Fire(0.045 * m_flAccuracy, 0.066, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
/* <296647> ../cstrike/dlls/wpn_shared/wpn_p90.cpp:120 */
|
||||
NOBODY void CP90::P90Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim)
|
||||
void CP90::P90Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim)
|
||||
{
|
||||
// {
|
||||
// Vector vecAiming; // 161
|
||||
// Vector vecSrc; // 163
|
||||
// Vector vecDir; // 164
|
||||
// int flag; // 168
|
||||
// operator+(const Vector *const this,
|
||||
// const Vector &v); // 155
|
||||
// Vector(Vector *const this,
|
||||
// const Vector &v); // 165
|
||||
// Vector(Vector *const this,
|
||||
// const Vector &v); // 165
|
||||
// Length2D(const Vector *const this); // 193
|
||||
// }
|
||||
Vector vecAiming;
|
||||
Vector vecSrc;
|
||||
Vector vecDir;
|
||||
int flag;
|
||||
|
||||
m_bDelayFire = true;
|
||||
m_iShotsFired++;
|
||||
|
||||
m_flAccuracy = (m_iShotsFired * m_iShotsFired / 175) + 0.45;
|
||||
|
||||
if (m_flAccuracy > 1)
|
||||
m_flAccuracy = 1;
|
||||
|
||||
if (m_iClip <= 0)
|
||||
{
|
||||
if (m_fFireOnEmpty)
|
||||
{
|
||||
PlayEmptySound();
|
||||
m_flNextPrimaryAttack = GetNextAttackDelay(0.2);
|
||||
}
|
||||
|
||||
if (TheBots != NULL)
|
||||
{
|
||||
TheBots->OnEvent(EVENT_WEAPON_FIRED_ON_EMPTY, m_pPlayer);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
m_iClip--;
|
||||
|
||||
m_pPlayer->pev->effects |= EF_MUZZLEFLASH;
|
||||
m_pPlayer->SetAnimation(PLAYER_ATTACK1);
|
||||
|
||||
UTIL_MakeVectors(m_pPlayer->pev->v_angle + m_pPlayer->pev->punchangle);
|
||||
|
||||
m_pPlayer->m_iWeaponVolume = NORMAL_GUN_VOLUME;
|
||||
m_pPlayer->m_iWeaponFlash = DIM_GUN_FLASH;
|
||||
|
||||
vecSrc = m_pPlayer->GetGunPosition();
|
||||
vecDir = gpGlobals->v_forward;
|
||||
|
||||
vecAiming = m_pPlayer->FireBullets3
|
||||
(
|
||||
vecSrc,
|
||||
vecDir,
|
||||
flSpread,
|
||||
8192,
|
||||
1,
|
||||
BULLET_PLAYER_57MM,
|
||||
21,
|
||||
0.885,
|
||||
m_pPlayer->pev,
|
||||
false,
|
||||
m_pPlayer->random_seed
|
||||
);
|
||||
|
||||
#ifdef CLIENT_WEAPONS
|
||||
flag = FEV_NOTHOST;
|
||||
#else
|
||||
flag = 0;
|
||||
#endif // CLIENT_WEAPONS
|
||||
|
||||
PLAYBACK_EVENT_FULL
|
||||
(
|
||||
flag,
|
||||
m_pPlayer->edict(),
|
||||
m_usFireP90,
|
||||
0,
|
||||
(float *)&g_vecZero,
|
||||
(float *)&g_vecZero,
|
||||
vecAiming.x,
|
||||
vecAiming.y,
|
||||
(int)(m_pPlayer->pev->punchangle.x * 100),
|
||||
(int)(m_pPlayer->pev->punchangle.y * 100),
|
||||
5,
|
||||
FALSE
|
||||
);
|
||||
|
||||
m_flNextPrimaryAttack = m_flNextSecondaryAttack = GetNextAttackDelay(flCycleTime);
|
||||
|
||||
if (!m_iClip && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0)
|
||||
{
|
||||
m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0);
|
||||
}
|
||||
|
||||
m_flTimeWeaponIdle = WEAPON_TIMEBASED + 2.0;
|
||||
|
||||
if (!(m_pPlayer->pev->flags & FL_ONGROUND))
|
||||
{
|
||||
KickBack(0.9, 0.45, 0.35, 0.04, 5.25, 3.5, 4);
|
||||
}
|
||||
else if (m_pPlayer->pev->velocity.Length2D() > 0)
|
||||
{
|
||||
KickBack(0.45, 0.3, 0.2, 0.0275, 4.0, 2.25, 7);
|
||||
}
|
||||
else if (m_pPlayer->pev->flags & FL_DUCKING)
|
||||
{
|
||||
KickBack(0.275, 0.2, 0.125, 0.02, 3.0, 1.0, 9);
|
||||
}
|
||||
else
|
||||
{
|
||||
KickBack(0.3, 0.225, 0.125, 0.02, 3.25, 1.25, 8);
|
||||
}
|
||||
}
|
||||
|
||||
/* <2963e8> ../cstrike/dlls/wpn_shared/wpn_p90.cpp:202 */
|
||||
NOBODY void CP90::Reload(void)
|
||||
void CP90::__MAKE_VHOOK(Reload)(void)
|
||||
{
|
||||
// Reload(CP90 *const this); // 202
|
||||
if (m_pPlayer->ammo_57mm <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (DefaultReload(P90_MAX_CLIP, P90_RELOAD, P90_RELOAD_TIME))
|
||||
{
|
||||
m_pPlayer->SetAnimation(PLAYER_RELOAD);
|
||||
|
||||
m_flAccuracy = 0.2;
|
||||
m_iShotsFired = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* <2963ad> ../cstrike/dlls/wpn_shared/wpn_p90.cpp:216 */
|
||||
NOBODY void CP90::WeaponIdle(void)
|
||||
void CP90::__MAKE_VHOOK(WeaponIdle)(void)
|
||||
{
|
||||
// WeaponIdle(CP90 *const this); // 216
|
||||
ResetEmptySound();
|
||||
m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES);
|
||||
|
||||
if (m_flTimeWeaponIdle > WEAPON_TIMEBASED)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_flTimeWeaponIdle = WEAPON_TIMEBASED + 20.0;
|
||||
SendWeaponAnim(P90_IDLE1, UseDecrement() != FALSE);
|
||||
}
|
||||
|
||||
/* <29626a> ../cstrike/dlls/weapons.h:1052 */
|
||||
float CP90::__MAKE_VHOOK(GetMaxSpeed)(void)
|
||||
{
|
||||
return P90_MAX_SPEED;
|
||||
}
|
||||
|
||||
#ifdef HOOK_GAMEDLL
|
||||
|
||||
void CP90::Spawn(void)
|
||||
{
|
||||
Spawn_();
|
||||
}
|
||||
|
||||
void CP90::Precache(void)
|
||||
{
|
||||
Precache_();
|
||||
}
|
||||
|
||||
int CP90::GetItemInfo(ItemInfo *p)
|
||||
{
|
||||
return GetItemInfo_(p);
|
||||
}
|
||||
|
||||
BOOL CP90::Deploy(void)
|
||||
{
|
||||
return Deploy_();
|
||||
}
|
||||
|
||||
void CP90::PrimaryAttack(void)
|
||||
{
|
||||
PrimaryAttack_();
|
||||
}
|
||||
|
||||
void CP90::Reload(void)
|
||||
{
|
||||
Reload_();
|
||||
}
|
||||
|
||||
void CP90::WeaponIdle(void)
|
||||
{
|
||||
WeaponIdle_();
|
||||
}
|
||||
|
||||
float CP90::GetMaxSpeed(void)
|
||||
{
|
||||
return GetMaxSpeed_();
|
||||
}
|
||||
|
||||
#endif // HOOK_GAMEDLL
|
||||
|
@ -1,5 +1,8 @@
|
||||
#include "precompiled.h"
|
||||
|
||||
#define USP_MAX_SPEED 250
|
||||
#define USP_RELOAD_TIME 2.7
|
||||
|
||||
enum usp_e
|
||||
{
|
||||
USP_IDLE,
|
||||
@ -40,11 +43,14 @@ LINK_ENTITY_TO_CLASS(weapon_usp, CUSP);
|
||||
void CUSP::__MAKE_VHOOK(Spawn)(void)
|
||||
{
|
||||
Precache();
|
||||
|
||||
m_iId = WEAPON_USP;
|
||||
SET_MODEL(ENT(pev), "models/w_usp.mdl");
|
||||
|
||||
m_iWeaponState &= ~WPNSTATE_SHIELD_DRAWN;
|
||||
m_iDefaultAmmo = 12;//TODO: Default clip USP_MAX_CLIP
|
||||
m_iDefaultAmmo = USP_DEFAULT_GIVE;
|
||||
m_flAccuracy = 0.92f;
|
||||
|
||||
FallInit();
|
||||
}
|
||||
|
||||
@ -80,9 +86,11 @@ int CUSP::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p)
|
||||
p->iSlot = 1;
|
||||
p->iPosition = 4;
|
||||
p->iFlags = 0;
|
||||
|
||||
m_iId = WEAPON_USP;
|
||||
p->iId = WEAPON_USP;
|
||||
p->iWeight = 5;
|
||||
|
||||
p->iWeight = USP_WEIGHT;
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -92,57 +100,126 @@ BOOL CUSP::__MAKE_VHOOK(Deploy)(void)
|
||||
{
|
||||
m_iWeaponState &= ~WPNSTATE_SHIELD_DRAWN;
|
||||
m_flAccuracy = 0.92f;
|
||||
m_fMaxSpeed = 250.0f;
|
||||
m_fMaxSpeed = USP_MAX_SPEED;
|
||||
m_pPlayer->m_bShieldDrawn = false;
|
||||
|
||||
if (m_pPlayer->HasShield())
|
||||
{
|
||||
m_iWeaponState &= ~WPNSTATE_USP_SILENCED;
|
||||
return DefaultDeploy("models/shield/v_shield_usp.mdl", "models/shield/p_shield_usp.mdl", USP_SHIELD_DRAW, "shieldgun", UseDecrement() != FALSE);
|
||||
return DefaultDeploy("models/shield/v_shield_usp.mdl", "models/shield/p_shield_usp.mdl", USP_SHIELD_DRAW, "shieldgun", UseDecrement());
|
||||
}
|
||||
else if (m_iWeaponState & WPNSTATE_USP_SILENCED)
|
||||
return DefaultDeploy("models/v_usp.mdl", "models/p_usp.mdl", USP_DRAW, "onehanded", UseDecrement() != FALSE);
|
||||
return DefaultDeploy("models/v_usp.mdl", "models/p_usp.mdl", USP_UNSIL_DRAW, "onehanded", UseDecrement() != FALSE);
|
||||
{
|
||||
return DefaultDeploy("models/v_usp.mdl", "models/p_usp.mdl", USP_DRAW, "onehanded", UseDecrement());
|
||||
}
|
||||
|
||||
return DefaultDeploy("models/v_usp.mdl", "models/p_usp.mdl", USP_UNSIL_DRAW, "onehanded", UseDecrement());
|
||||
}
|
||||
|
||||
/* <2bae77> ../cstrike/dlls/wpn_shared/wpn_usp.cpp:147 */
|
||||
NOBODY void CUSP::__MAKE_VHOOK(SecondaryAttack)(void)
|
||||
void CUSP::__MAKE_VHOOK(SecondaryAttack)(void)
|
||||
{
|
||||
// SecondaryAttack(CUSP *const this); // 147
|
||||
if (ShieldSecondaryFire(USP_SHIELD_UP, USP_SHIELD_DOWN))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_iWeaponState & WPNSTATE_USP_SILENCED)
|
||||
{
|
||||
m_iWeaponState &= ~WPNSTATE_USP_SILENCED;
|
||||
|
||||
SendWeaponAnim(USP_DETACH_SILENCER, UseDecrement() != FALSE);
|
||||
Q_strcpy(m_pPlayer->m_szAnimExtention, "onehanded");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_iWeaponState |= WPNSTATE_USP_SILENCED;
|
||||
|
||||
SendWeaponAnim(USP_ATTACH_SILENCER, UseDecrement() != FALSE);
|
||||
Q_strcpy(m_pPlayer->m_szAnimExtention, "onehanded");
|
||||
}
|
||||
|
||||
m_flNextSecondaryAttack = WEAPON_TIMEBASED + 3.0;
|
||||
m_flTimeWeaponIdle = WEAPON_TIMEBASED + 3.0;
|
||||
|
||||
m_flNextPrimaryAttack = GetNextAttackDelay(3.0);
|
||||
}
|
||||
|
||||
/* <2bb000> ../cstrike/dlls/wpn_shared/wpn_usp.cpp:173 */
|
||||
NOBODY void CUSP::__MAKE_VHOOK(PrimaryAttack)(void)
|
||||
void CUSP::__MAKE_VHOOK(PrimaryAttack)(void)
|
||||
{
|
||||
// Length2D(const Vector *const this); // 179
|
||||
// Length2D(const Vector *const this); // 190
|
||||
if (m_iWeaponState & WPNSTATE_USP_SILENCED)
|
||||
{
|
||||
if (!(m_pPlayer->pev->flags & FL_ONGROUND))
|
||||
{
|
||||
USPFire(1.3 * (1 - m_flAccuracy), 0.225, FALSE);
|
||||
}
|
||||
else if (m_pPlayer->pev->velocity.Length2D() > 0)
|
||||
{
|
||||
USPFire(0.25 * (1 - m_flAccuracy), 0.225, FALSE);
|
||||
}
|
||||
else if (m_pPlayer->pev->flags & FL_DUCKING)
|
||||
{
|
||||
USPFire(0.125 * (1 - m_flAccuracy), 0.225, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
USPFire(0.15 * (1 - m_flAccuracy), 0.225, FALSE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(m_pPlayer->pev->flags & FL_ONGROUND))
|
||||
{
|
||||
USPFire(1.2 * (1 - m_flAccuracy), 0.225, FALSE);
|
||||
}
|
||||
else if (m_pPlayer->pev->velocity.Length2D() > 0)
|
||||
{
|
||||
USPFire(0.225 * (1 - m_flAccuracy), 0.225, FALSE);
|
||||
}
|
||||
else if (m_pPlayer->pev->flags & FL_DUCKING)
|
||||
{
|
||||
USPFire(0.08 * (1 - m_flAccuracy), 0.225, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
USPFire(0.1 * (1 - m_flAccuracy), 0.225, FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* <2bb10f> ../cstrike/dlls/wpn_shared/wpn_usp.cpp:200 */
|
||||
UNTESTED void CUSP::USPFire(float flSpread, float flCycleTime, BOOL fUseSemi)
|
||||
void CUSP::USPFire(float flSpread, float flCycleTime, BOOL fUseSemi)
|
||||
{
|
||||
int flag;
|
||||
//int iDamage;//unused
|
||||
//Vector vecAiming;//unused
|
||||
//Vector vecSrc;//unused
|
||||
int iDamage;
|
||||
Vector vecAiming;
|
||||
Vector vecSrc;
|
||||
Vector vecDir;
|
||||
|
||||
flCycleTime -= 0.075f;
|
||||
flCycleTime -= 0.075;
|
||||
|
||||
m_iShotsFired++;
|
||||
if (m_iShotsFired > 1)
|
||||
return;
|
||||
|
||||
if (m_flLastFire != 0.0f)
|
||||
if (++m_iShotsFired > 1)
|
||||
{
|
||||
m_flAccuracy -= (0.3f - (gpGlobals->time - m_flLastFire)) * 0.275f;
|
||||
if (m_flAccuracy > 0.92f)
|
||||
m_flAccuracy = 0.92f;
|
||||
else if (m_flAccuracy < 0.6f)
|
||||
m_flAccuracy = 0.6f;
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_flLastFire != 0.0)
|
||||
{
|
||||
m_flAccuracy -= (0.3 - (gpGlobals->time - m_flLastFire)) * 0.275;
|
||||
|
||||
if (m_flAccuracy > 0.92)
|
||||
{
|
||||
m_flAccuracy = 0.92;
|
||||
}
|
||||
else if (m_flAccuracy < 0.6)
|
||||
{
|
||||
m_flAccuracy = 0.6;
|
||||
}
|
||||
}
|
||||
|
||||
m_flLastFire = gpGlobals->time;
|
||||
|
||||
if (m_iClip <= 0)
|
||||
{
|
||||
if (m_fFireOnEmpty)
|
||||
@ -150,44 +227,81 @@ UNTESTED void CUSP::USPFire(float flSpread, float flCycleTime, BOOL fUseSemi)
|
||||
PlayEmptySound();
|
||||
m_flNextPrimaryAttack = GetNextAttackDelay(0.2);
|
||||
}
|
||||
|
||||
if (TheBots != NULL)
|
||||
{
|
||||
TheBots->OnEvent(EVENT_WEAPON_FIRED_ON_EMPTY, m_pPlayer, NULL);
|
||||
TheBots->OnEvent(EVENT_WEAPON_FIRED_ON_EMPTY, m_pPlayer);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
m_flNextSecondaryAttack = GetNextAttackDelay(flCycleTime);
|
||||
m_flNextPrimaryAttack = m_flNextSecondaryAttack;
|
||||
|
||||
m_iClip--;
|
||||
|
||||
SetPlayerShieldAnim();
|
||||
m_pPlayer->SetAnimation(PLAYER_ATTACK1);
|
||||
|
||||
m_pPlayer->SetAnimation(PLAYER_ATTACK1);
|
||||
m_pPlayer->m_iWeaponVolume = 2048;
|
||||
m_pPlayer->m_iWeaponFlash = 128;
|
||||
|
||||
UTIL_MakeVectors(m_pPlayer->pev->punchangle + m_pPlayer->pev->v_angle);
|
||||
UTIL_MakeVectors(m_pPlayer->pev->v_angle + m_pPlayer->pev->punchangle);
|
||||
|
||||
if (!(m_iWeaponState & WPNSTATE_USP_SILENCED))
|
||||
{
|
||||
m_pPlayer->pev->effects |= EF_MUZZLEFLASH;
|
||||
}
|
||||
|
||||
vecDir = FireBullets3(m_pPlayer->GetGunPosition(), gpGlobals->v_forward, flSpread, 4096, 1, BULLET_PLAYER_45ACP, (m_iWeaponState & WPNSTATE_USP_SILENCED) ? 30 : 34, 0.79f, m_pPlayer->pev, true, m_pPlayer->random_seed);
|
||||
vecSrc = m_pPlayer->GetGunPosition();
|
||||
vecDir = gpGlobals->v_forward;
|
||||
|
||||
iDamage = (m_iWeaponState & WPNSTATE_USP_SILENCED) ? 30 : 34;
|
||||
|
||||
vecAiming = m_pPlayer->FireBullets3
|
||||
(
|
||||
vecSrc,
|
||||
vecDir,
|
||||
flSpread,
|
||||
4096.0,
|
||||
1,
|
||||
BULLET_PLAYER_45ACP,
|
||||
iDamage,
|
||||
0.79,
|
||||
m_pPlayer->pev,
|
||||
true,
|
||||
m_pPlayer->random_seed
|
||||
);
|
||||
|
||||
#ifdef CLIENT_WEAPONS
|
||||
flag = FEV_NOTHOST;
|
||||
#else
|
||||
flag = 0;
|
||||
#endif
|
||||
PLAYBACK_EVENT_FULL(flag, m_pPlayer->edict(), m_usFireUSP, 0, (float *)&g_vecZero, (float *)&g_vecZero, vecDir.x, vecDir.y, (int)(m_pPlayer->pev->punchangle.x * 100.0f), 0, m_iClip == 0, (int)(m_iWeaponState & WPNSTATE_USP_SILENCED));
|
||||
#endif // CLIENT_WEAPONS
|
||||
|
||||
PLAYBACK_EVENT_FULL
|
||||
(
|
||||
flag,
|
||||
ENT(m_pPlayer->pev),
|
||||
m_usFireUSP,
|
||||
0,
|
||||
(float *)&g_vecZero,
|
||||
(float *)&g_vecZero,
|
||||
vecAiming.x,
|
||||
vecAiming.y,
|
||||
(int)(m_pPlayer->pev->punchangle.x * 100),
|
||||
0,
|
||||
m_iClip == 0,
|
||||
(m_iWeaponState & WPNSTATE_USP_SILENCED)
|
||||
);
|
||||
|
||||
if (!m_iClip && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0)
|
||||
{
|
||||
m_pPlayer->SetSuitUpdate("!HEV_AMO0", 0, 0);
|
||||
m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, FALSE);
|
||||
}
|
||||
|
||||
m_flTimeWeaponIdle = 2.0f;
|
||||
m_pPlayer->pev->punchangle.x -= 2.0f;
|
||||
m_flTimeWeaponIdle = WEAPON_TIMEBASED + 2;
|
||||
m_pPlayer->pev->punchangle.x -= 2;
|
||||
ResetPlayerShieldAnim();
|
||||
}
|
||||
|
||||
@ -195,15 +309,21 @@ UNTESTED void CUSP::USPFire(float flSpread, float flCycleTime, BOOL fUseSemi)
|
||||
void CUSP::__MAKE_VHOOK(Reload)(void)
|
||||
{
|
||||
if (m_pPlayer->ammo_45acp <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int iResult;
|
||||
if (m_pPlayer->HasShield())
|
||||
iResult = DefaultReload(USP_MAX_CLIP, USP_SHIELD_RELOAD, 2.7);
|
||||
{
|
||||
iResult = DefaultReload(USP_MAX_CLIP, USP_SHIELD_RELOAD, USP_RELOAD_TIME);
|
||||
}
|
||||
else if (m_iWeaponState & WPNSTATE_USP_SILENCED)
|
||||
iResult = DefaultReload(USP_MAX_CLIP, USP_RELOAD, 2.7);
|
||||
{
|
||||
iResult = DefaultReload(USP_MAX_CLIP, USP_RELOAD, USP_RELOAD_TIME);
|
||||
}
|
||||
else
|
||||
iResult = DefaultReload(USP_MAX_CLIP, USP_UNSIL_RELOAD, 2.7);
|
||||
iResult = DefaultReload(USP_MAX_CLIP, USP_UNSIL_RELOAD, USP_RELOAD_TIME);
|
||||
|
||||
if (iResult)
|
||||
{
|
||||
@ -216,23 +336,28 @@ void CUSP::__MAKE_VHOOK(Reload)(void)
|
||||
void CUSP::__MAKE_VHOOK(WeaponIdle)(void)
|
||||
{
|
||||
ResetEmptySound();
|
||||
m_pPlayer->GetAutoaimVector(0.173648);
|
||||
m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES);
|
||||
|
||||
if (m_flTimeWeaponIdle > 0.0f)
|
||||
if (m_flTimeWeaponIdle > 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_pPlayer->HasShield())
|
||||
{
|
||||
m_flTimeWeaponIdle = 20.0f;
|
||||
m_flTimeWeaponIdle = WEAPON_TIMEBASED + 20.0;
|
||||
|
||||
if (m_iWeaponState & WPNSTATE_SHIELD_DRAWN)
|
||||
SendWeaponAnim(USP_DRAW, UseDecrement() != FALSE);
|
||||
{
|
||||
SendWeaponAnim(USP_DRAW, UseDecrement());
|
||||
}
|
||||
}
|
||||
else if (m_iClip)
|
||||
{
|
||||
//int iAnim = USP_UNSIL_IDLE * (~m_iWeaponState & WPNSTATE_USP_SILENCED);
|
||||
int iAnim = (~m_iWeaponState & WPNSTATE_USP_SILENCED) ? USP_UNSIL_IDLE: USP_IDLE;// : USP_UNSIL_IDLE;
|
||||
m_flTimeWeaponIdle = 60.0f;
|
||||
SendWeaponAnim(iAnim, UseDecrement() != FALSE);
|
||||
int iAnim = (~m_iWeaponState & WPNSTATE_USP_SILENCED) ? USP_UNSIL_IDLE: USP_IDLE;
|
||||
|
||||
m_flTimeWeaponIdle = WEAPON_TIMEBASED + 60.0;
|
||||
SendWeaponAnim(iAnim, UseDecrement());
|
||||
}
|
||||
}
|
||||
|
||||
@ -242,30 +367,37 @@ void CUSP::Spawn(void)
|
||||
{
|
||||
Spawn_();
|
||||
}
|
||||
|
||||
void CUSP::Precache(void)
|
||||
{
|
||||
Precache_();
|
||||
}
|
||||
|
||||
int CUSP::GetItemInfo(ItemInfo *p)
|
||||
{
|
||||
return GetItemInfo_(p);
|
||||
}
|
||||
|
||||
BOOL CUSP::Deploy(void)
|
||||
{
|
||||
return Deploy_();
|
||||
}
|
||||
|
||||
void CUSP::SecondaryAttack(void)
|
||||
{
|
||||
SecondaryAttack_();
|
||||
}
|
||||
|
||||
void CUSP::PrimaryAttack(void)
|
||||
{
|
||||
PrimaryAttack_();
|
||||
}
|
||||
|
||||
void CUSP::Reload(void)
|
||||
{
|
||||
Reload_();
|
||||
}
|
||||
|
||||
void CUSP::WeaponIdle(void)
|
||||
{
|
||||
WeaponIdle_();
|
||||
|
@ -72,6 +72,7 @@ typedef struct lump_s
|
||||
{
|
||||
int fileofs;
|
||||
int filelen;
|
||||
|
||||
} lump_t;
|
||||
|
||||
/* <a22c> ../engine/bspfile.h:64 */
|
||||
@ -82,6 +83,7 @@ typedef struct dmodel_s
|
||||
int headnode[MAX_MAP_HULLS];
|
||||
int visleafs; // not including the solid leaf 0
|
||||
int firstface, numfaces;
|
||||
|
||||
} dmodel_t;
|
||||
|
||||
/* <a2c2> ../engine/bspfile.h:73 */
|
||||
@ -89,6 +91,7 @@ typedef struct dheader_s
|
||||
{
|
||||
int version;
|
||||
lump_t lumps[15];
|
||||
|
||||
} dheader_t;
|
||||
|
||||
/* <485b2> ../engine/bspfile.h:79 */
|
||||
@ -96,6 +99,7 @@ typedef struct dmiptexlump_s
|
||||
{
|
||||
int _nummiptex;
|
||||
int dataofs[4];
|
||||
|
||||
} dmiptexlump_t;
|
||||
|
||||
/* <1ce18> ../engine/bspfile.h:86 */
|
||||
@ -105,12 +109,14 @@ typedef struct miptex_s
|
||||
unsigned width;
|
||||
unsigned height;
|
||||
unsigned offsets[4];
|
||||
|
||||
} miptex_t;
|
||||
|
||||
/* <48652> ../engine/bspfile.h:94 */
|
||||
typedef struct dvertex_s
|
||||
{
|
||||
float point[3];
|
||||
|
||||
} dvertex_t;
|
||||
|
||||
/* <48674> ../engine/bspfile.h:110 */
|
||||
@ -119,6 +125,7 @@ typedef struct dplane_s
|
||||
float normal[3];
|
||||
float dist;
|
||||
int type;
|
||||
|
||||
} dplane_t;
|
||||
|
||||
/* <486b2> ../engine/bspfile.h:132 */
|
||||
@ -130,6 +137,7 @@ typedef struct dnode_s
|
||||
short maxs[3];
|
||||
unsigned short firstface;
|
||||
unsigned short numfaces;
|
||||
|
||||
} dnode_t;
|
||||
|
||||
/* <a332> ../engine/bspfile.h:142 */
|
||||
@ -137,6 +145,7 @@ typedef struct dclipnode_s
|
||||
{
|
||||
int planenum;
|
||||
short children[2]; // negative numbers are contents
|
||||
|
||||
} dclipnode_t;
|
||||
|
||||
/* <4876a> ../engine/bspfile.h:149 */
|
||||
@ -145,12 +154,14 @@ typedef struct texinfo_s
|
||||
float vecs[2][4];
|
||||
int _miptex;
|
||||
int flags;
|
||||
|
||||
} texinfo_t;
|
||||
|
||||
/* <487c2> ../engine/bspfile.h:159 */
|
||||
typedef struct dedge_s
|
||||
{
|
||||
unsigned short v[2];
|
||||
|
||||
} dedge_t;
|
||||
|
||||
/* <487f2> ../engine/bspfile.h:165 */
|
||||
@ -163,6 +174,7 @@ typedef struct dface_s
|
||||
short texinfo;
|
||||
byte styles[4];
|
||||
int lightofs;
|
||||
|
||||
} dface_t;
|
||||
|
||||
typedef struct dleaf_s
|
||||
@ -174,7 +186,7 @@ typedef struct dleaf_s
|
||||
unsigned short firstmarksurface;
|
||||
unsigned short nummarksurfaces;
|
||||
byte ambient_level[4];
|
||||
|
||||
} dleaf_t;
|
||||
|
||||
|
||||
#endif // BSPFILE_H
|
||||
|
@ -38,6 +38,7 @@ typedef struct
|
||||
unsigned short amplitude; // FIXED 4.12 amount of shake
|
||||
unsigned short duration; // FIXED 4.12 seconds duration
|
||||
unsigned short frequency; // FIXED 8.8 noise frequency (low frequency is a jerk,high frequency is a rumble)
|
||||
|
||||
} ScreenShake;
|
||||
|
||||
#define FFADE_IN 0x0000 // Just here so we don't pass 0 into the function
|
||||
@ -52,6 +53,7 @@ typedef struct
|
||||
unsigned short holdTime; // FIXED 4.12 seconds duration until reset (fade & hold)
|
||||
short fadeFlags; // flags
|
||||
byte r,g,b,a; // fade to color ( max alpha )
|
||||
|
||||
} ScreenFade;
|
||||
|
||||
#endif // SHAKE_H
|
||||
|
@ -136,7 +136,7 @@ inline void CBitVec<NUM_BITS>::Init(int val)
|
||||
template<int NUM_BITS>
|
||||
inline CBitVec<NUM_BITS> &CBitVec<NUM_BITS>::operator=(CBitVec<NUM_BITS> const &other)
|
||||
{
|
||||
memcpy(m_DWords, other.m_DWords, sizeof(m_DWords));
|
||||
Q_memcpy(m_DWords, other.m_DWords, sizeof(m_DWords));
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -153,8 +153,10 @@ template<int NUM_BITS>
|
||||
inline bool CBitVec<NUM_BITS>::operator==(CBitVec<NUM_BITS> const &other)
|
||||
{
|
||||
for (int i = 0; i < NUM_DWORDS; i++)
|
||||
{
|
||||
if (m_DWords[i] != other.m_DWords[i])
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -219,10 +219,12 @@ void CBot::ExecuteCommand_(void)
|
||||
m_flPreviousCommandTime = gpGlobals->time;
|
||||
|
||||
if (IsCrouching())
|
||||
{
|
||||
m_buttonFlags |= IN_DUCK;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
PLAYER_RUN_MOVE( edict(), pev->v_angle, m_forwardSpeed, m_strafeSpeed, m_verticalSpeed, m_buttonFlags, 0, adjustedMSec );
|
||||
PLAYER_RUN_MOVE(edict(), pev->v_angle, m_forwardSpeed, m_strafeSpeed, m_verticalSpeed, m_buttonFlags, 0, adjustedMSec);
|
||||
}
|
||||
|
||||
/* <4900fa> ../game_shared/bot/bot.cpp:362 */
|
||||
|
@ -57,7 +57,7 @@ T *CreateBot(const BotProfile *profile)
|
||||
edict_t *pentBot;
|
||||
if (UTIL_ClientsInGame() >= gpGlobals->maxClients)
|
||||
{
|
||||
CONSOLE_ECHO( "Unable to create bot: Server is full (%d/%d clients).\n", UTIL_ClientsInGame(), gpGlobals->maxClients);
|
||||
CONSOLE_ECHO("Unable to create bot: Server is full (%d/%d clients).\n", UTIL_ClientsInGame(), gpGlobals->maxClients);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ public:
|
||||
{
|
||||
CBasePlayer::Killed(pevAttacker, iGib);
|
||||
}
|
||||
NOBODY virtual void Think(void) { };
|
||||
NOBODY virtual void Think(void) {};
|
||||
virtual BOOL IsBot(void)
|
||||
{
|
||||
return true;
|
||||
@ -142,7 +142,7 @@ public:
|
||||
NOBODY virtual void Reload(void);
|
||||
|
||||
// invoked when event occurs in the game (some events have NULL entities)
|
||||
virtual void OnEvent(GameEventType event, CBaseEntity *entity = NULL, CBaseEntity *other = NULL) { };
|
||||
virtual void OnEvent(GameEventType event, CBaseEntity *entity = NULL, CBaseEntity *other = NULL) {};
|
||||
|
||||
// return true if we can see the point
|
||||
virtual bool IsVisible(const Vector *pos, bool testFOV = false) const = 0;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user