WIP: full of reversed basic part

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

View File

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

View File

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

View File

@ -1,13 +1,34 @@
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============ /*
// *
// Purpose: * 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
// $NoKeywords: $ * 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 #define R_STUDIOINT_H
#if defined( _WIN32 ) #ifdef _WIN32
#pragma once #pragma once
#endif #endif
@ -17,34 +38,49 @@ typedef struct engine_studio_api_s
{ {
// Allocate number*size bytes and zero it // 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 // Check to see if pointer is in the cache
void *(*Cache_Check)(struct cache_user_s *c); void *(*Cache_Check)(struct cache_user_s *c);
// Load file into cache (can be swapped out on demand) // Load file into cache (can be swapped out on demand)
void (*LoadCacheFile)(char *path, struct cache_user_s *cu); void (*LoadCacheFile)(char *path, struct cache_user_s *cu);
// Retrieve model pointer for the named model // 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 // 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 // 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 // Get entity that is set for rendering
struct cl_entity_s * (*GetCurrentEntity)(void); struct cl_entity_s * (*GetCurrentEntity)(void);
// Get referenced player_info_t // 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 // 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 // Get viewentity
struct cl_entity_s * (*GetViewEntity)(void); struct cl_entity_s * (*GetViewEntity)(void);
// Get current frame count, and last two timestampes on client // 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 // Get a pointer to a cvar by name
struct cvar_s *(*GetCvar)(const char *name); struct cvar_s *(*GetCvar)(const char *name);
// Get current render origin and view vectors (up, right and vpn) // Get current render origin and view vectors (up, right and vpn)
void (*GetViewInfo)(float *origin, float *upv, float *rightv, float *vpnv); void (*GetViewInfo)(float *origin, float *upv, float *rightv, float *vpnv);
// Get sprite model used for applying chrome effect // 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 // Get model counters so we can incement instrumentation
void (*GetModelCounters)(int **s, int **a); void (*GetModelCounters)(int **s, int **a);
// Get software scaling coefficients // Get software scaling coefficients
void (*GetAliasScale)(float *x, float *y); void (*GetAliasScale)(float *x, float *y);
@ -56,8 +92,10 @@ typedef struct engine_studio_api_s
// Set up body part, and get submodel pointers // 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 // Check if entity's bbox is in the view frustum
int (*StudioCheckBBox)(void); int (*StudioCheckBBox)(void);
// Apply lighting effects to model // Apply lighting effects to model
void (*StudioDynamicLight)(struct cl_entity_s *ent, struct alight_s *plight); void (*StudioDynamicLight)(struct cl_entity_s *ent, struct alight_s *plight);
void (*StudioEntityLight)(struct alight_s *plight); void (*StudioEntityLight)(struct alight_s *plight);
@ -68,23 +106,32 @@ typedef struct engine_studio_api_s
// Draw hulls around bones // Draw hulls around bones
void (*StudioDrawHulls)(void); void (*StudioDrawHulls)(void);
// Draw bbox around studio models // Draw bbox around studio models
void (*StudioDrawAbsBBox)(void); void (*StudioDrawAbsBBox)(void);
// Draws bones // Draws bones
void (*StudioDrawBones)(void); void (*StudioDrawBones)(void);
// Loads in appropriate texture for model // Loads in appropriate texture for model
void (*StudioSetupSkin)(void *ptexturehdr, int index); void (*StudioSetupSkin)(void *ptexturehdr, int index);
// Sets up for remapped colors // 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 // 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 // Fires any events embedded in animation
void (*StudioClientEvents)(void); void (*StudioClientEvents)(void);
// Retrieve/set forced render effects flags // Retrieve/set forced render effects flags
int (*GetForceFaceFlags)(void); int (*GetForceFaceFlags)(void);
void (*SetForceFaceFlags)(int flags); void (*SetForceFaceFlags)(int flags);
// Tell engine the value of the studio model header // 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 // Tell engine which model_t * is being renderered
void (*SetRenderModel)(struct model_s *model); void (*SetRenderModel)(struct model_s *model);
@ -105,18 +152,23 @@ typedef struct engine_studio_api_s
void (*StudioSetRenderamt)(int iRenderamt); //!!!CZERO added for rendering glass on viewmodels void (*StudioSetRenderamt)(int iRenderamt); //!!!CZERO added for rendering glass on viewmodels
void (*StudioSetCullState)(int iCull); void (*StudioSetCullState)(int iCull);
void (*StudioRenderShadow)(int iSprite, float *p1, float *p2, float *p3, float *p4); void (*StudioRenderShadow)(int iSprite, float *p1, float *p2, float *p3, float *p4);
} engine_studio_api_t; } engine_studio_api_t;
typedef struct server_studio_api_s typedef struct server_studio_api_s
{ {
// Allocate number*size bytes and zero it // 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 // Check to see if pointer is in the cache
void *(*Cache_Check)(struct cache_user_s *c); void *(*Cache_Check)(struct cache_user_s *c);
// Load file into cache (can be swapped out on demand) // Load file into cache (can be swapped out on demand)
void (*LoadCacheFile)(char *path, struct cache_user_s *cu); void (*LoadCacheFile)(char *path, struct cache_user_s *cu);
// Retrieve pointer to studio model data block from a model // 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; } server_studio_api_t;
@ -126,6 +178,7 @@ typedef struct r_studio_interface_s
int version; int version;
int (*StudioDrawModel)(int flags); int (*StudioDrawModel)(int flags);
int (*StudioDrawPlayer)(int flags, struct entity_state_s *pplayer); int (*StudioDrawPlayer)(int flags, struct entity_state_s *pplayer);
} r_studio_interface_t; } r_studio_interface_t;
extern r_studio_interface_t *pStudioAPI; extern r_studio_interface_t *pStudioAPI;
@ -136,16 +189,16 @@ extern r_studio_interface_t *pStudioAPI;
typedef struct sv_blending_interface_s typedef struct sv_blending_interface_s
{ {
int version; int version;
void (*SV_StudioSetupBones)(struct model_s *pModel, void (*SV_StudioSetupBones)(struct model_s *pModel,
float frame, float frame,
int sequence, int sequence,
const vec3_t angles, const vec_t *angles,
const vec3_t origin, const vec_t *origin,
const byte *pcontroller, const byte *pcontroller,
const byte *pblending, const byte *pblending,
int iBone, int iBone,
const edict_t *pEdict); const edict_t *pEdict);
} sv_blending_interface_t; } sv_blending_interface_t;
#endif // R_STUDIOINT_H #endif // R_STUDIOINT_H

View File

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

View File

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

View File

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

View File

@ -28,11 +28,13 @@ TYPEDESCRIPTION CPendulum::m_SaveData[] =
#else #else
TYPEDESCRIPTION (*CFuncRotating::pm_SaveData)[5]; TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CFuncRotating, m_SaveData)[5];
TYPEDESCRIPTION (*CPendulum::pm_SaveData)[8]; TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CPendulum, m_SaveData)[8];
#endif // HOOK_GAMEDLL #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 */ /* <1c36f> ../cstrike/dlls/bmodels.cpp:43 */
Vector VecBModelOrigin(entvars_t *pevBModel) Vector VecBModelOrigin(entvars_t *pevBModel)
{ {
@ -43,107 +45,183 @@ Vector VecBModelOrigin(entvars_t *pevBModel)
LINK_ENTITY_TO_CLASS(func_wall, CFuncWall); LINK_ENTITY_TO_CLASS(func_wall, CFuncWall);
/* <1d193> ../cstrike/dlls/bmodels.cpp:65 */ /* <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 */ /* <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, if (ShouldToggle(useType, (int)(pev->frame)))
// class CBaseEntity *pActivator, {
// class CBaseEntity *pCaller, pev->frame = 1.0 - pev->frame;
// USE_TYPE useType, }
// float value); // 77
} }
/* <1e44e> ../cstrike/dlls/bmodels.cpp:96 */ /* <1e44e> ../cstrike/dlls/bmodels.cpp:96 */
LINK_ENTITY_TO_CLASS(func_wall_toggle, CFuncWallToggle); LINK_ENTITY_TO_CLASS(func_wall_toggle, CFuncWallToggle);
/* <1e28f> ../cstrike/dlls/bmodels.cpp:98 */ /* <1e28f> ../cstrike/dlls/bmodels.cpp:98 */
NOBODY void CFuncWallToggle::__MAKE_VHOOK(Spawn)(void) void CFuncWallToggle::__MAKE_VHOOK(Spawn)(void)
{ {
// Spawn(CFuncWall *const this); // 100 CFuncWall::Spawn();
// TurnOff(CFuncWallToggle *const this); // 102
if (pev->spawnflags & SF_WALL_START_OFF)
{
TurnOff();
}
} }
/* <1e518> ../cstrike/dlls/bmodels.cpp:106 */ /* <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 */ /* <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 */ /* <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 */ /* <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 = IsOn();
// int status; // 132
// IsOn(CFuncWallToggle *const this); // 132 if (ShouldToggle(useType, status))
// TurnOff(CFuncWallToggle *const this); // 137 {
// TurnOn(CFuncWallToggle *const this); // 139 if (status)
// } TurnOff();
else
TurnOn();
}
} }
/* <1e57d> ../cstrike/dlls/bmodels.cpp:155 */ /* <1e57d> ../cstrike/dlls/bmodels.cpp:155 */
LINK_ENTITY_TO_CLASS(func_conveyor, CFuncConveyor); LINK_ENTITY_TO_CLASS(func_conveyor, CFuncConveyor);
/* <1e1c3> ../cstrike/dlls/bmodels.cpp:156 */ /* <1e1c3> ../cstrike/dlls/bmodels.cpp:156 */
NOBODY void CFuncConveyor::__MAKE_VHOOK(Spawn)(void) void CFuncConveyor::__MAKE_VHOOK(Spawn)(void)
{ {
// Spawn(CFuncWall *const this); // 159 SetMovedir(pev);
// UpdateSpeed(CFuncConveyor *const this, CFuncWall::Spawn();
// float speed); // 174
if (!(pev->spawnflags & SF_CONVEYOR_VISUAL))
{
pev->flags |= FL_CONVEYOR;
} }
/* <1e647> ../cstrike/dlls/bmodels.cpp:179 */ // HACKHACK - This is to allow for some special effects
NOBODY void CFuncConveyor::UpdateSpeed(float speed) if (pev->spawnflags & SF_CONVEYOR_NOTSOLID)
{ {
// { // Don't want the engine thinking we've got special contents on this brush
// int speedCode; // 182 pev->solid = SOLID_NOT;
// fabs(double __x); // 182 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 */
void CFuncConveyor::UpdateSpeed(float speed)
{
// 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 */ /* <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, pev->speed = -pev->speed;
// float speed); // 197 UpdateSpeed(pev->speed);
} }
/* <1e695> ../cstrike/dlls/bmodels.cpp:217 */ /* <1e695> ../cstrike/dlls/bmodels.cpp:217 */
LINK_ENTITY_TO_CLASS(func_illusionary, CFuncIllusionary); LINK_ENTITY_TO_CLASS(func_illusionary, CFuncIllusionary);
/* <1ddc9> ../cstrike/dlls/bmodels.cpp:219 */ /* <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, //skin is used for content type
// const char *sz2); // 221 if (FStrEq(pkvd->szKeyName, "skin"))
// KeyValue(CFuncIllusionary *const this, {
// KeyValueData *pkvd); // 219 pev->skin = (int)Q_atof(pkvd->szValue);
pkvd->fHandled = TRUE;
}
else
CBaseToggle::KeyValue(pkvd);
} }
/* <1d1db> ../cstrike/dlls/bmodels.cpp:230 */ /* <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 */ /* <1e75f> ../cstrike/dlls/bmodels.cpp:262 */
LINK_ENTITY_TO_CLASS(func_monsterclip, CFuncMonsterClip); LINK_ENTITY_TO_CLASS(func_monsterclip, CFuncMonsterClip);
/* <1e24f> ../cstrike/dlls/bmodels.cpp:264 */ /* <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 */ /* <1e82c> ../cstrike/dlls/bmodels.cpp:313 */
@ -153,122 +231,418 @@ LINK_ENTITY_TO_CLASS(func_rotating, CFuncRotating);
IMPLEMENT_SAVERESTORE(CFuncRotating, CBaseEntity); IMPLEMENT_SAVERESTORE(CFuncRotating, CBaseEntity);
/* <1dc21> ../cstrike/dlls/bmodels.cpp:315 */ /* <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, if (FStrEq(pkvd->szKeyName, "fanfriction"))
// const char *sz2); // 317 {
// FStrEq(const char *sz1, m_flFanFriction = Q_atof(pkvd->szValue) / 100;
// const char *sz2); // 322 pkvd->fHandled = TRUE;
// FStrEq(const char *sz1, }
// const char *sz2); // 332 else if (FStrEq(pkvd->szKeyName, "Volume"))
// FStrEq(const char *sz1, {
// const char *sz2); // 339 m_flVolume = Q_atof(pkvd->szValue) / 10.0;
// KeyValue(CBaseEntity *const this,
// KeyValueData *pkvd); // 345 if (m_flVolume > 1.0)
// { m_flVolume = 1.0;
// Vector tmp; // 334
// operator!=(const Vector *const this, if (m_flVolume < 0.0)
// const Vector &v); // 336 m_flVolume = 0.0;
// }
// atoi(const char *__nptr); // 341 pkvd->fHandled = TRUE;
// atof(const char *__nptr); // 324 }
// atof(const char *__nptr); // 319 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 */ /* <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 */ /* <1d28a> ../cstrike/dlls/bmodels.cpp:447 */
NOBODY void CFuncRotating::__MAKE_VHOOK(Precache)(void) void CFuncRotating::__MAKE_VHOOK(Precache)(void)
{ {
// { char *szSoundFile = (char *)STRING(pev->message);
// char *szSoundFile; // 449
// operator!=(const Vector *const this, // set up fan sounds
// const Vector &v); // 502 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 */ /* <1dea4> ../cstrike/dlls/bmodels.cpp:517 */
NOBODY void CFuncRotating::HurtTouch(CBaseEntity *pOther) void CFuncRotating::HurtTouch(CBaseEntity *pOther)
{ {
// { entvars_t *pevOther = pOther->pev;
// entvars_t *pevOther; // 519
// Length(const Vector *const this); // 526 // we can't hurt this thing, so we're not concerned with it
// VecBModelOrigin(entvars_t *pevBModel); // 530 if (pevOther->takedamage == DAMAGE_NO)
// operator-(const Vector *const this, {
// const Vector &v); // 530 return;
// Normalize(const Vector *const this); // 530
// operator*(const Vector *const this,
// float fl); // 530
// }
} }
// 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 */ /* <1e8f9> ../cstrike/dlls/bmodels.cpp:540 */
NOBODY void CFuncRotating::RampPitchVol(int fUp) void CFuncRotating::RampPitchVol(int fUp)
{ {
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)
//{ //{
// Vector vecAVel; // 543 // // spinup volume ramps up from 50% max vol
// vec_t vecCur; // 544 // fvol = m_flVolume * (0.5 + fpct/2.0);
// vec_t vecFinal; // 545
// float fpct; // 546
// float fvol; // 547
// float fpitch; // 548
// int pitch; // 549
// Vector(Vector *const this,
// const Vector &v); // 543
//} //}
//else
{
// slowdown volume ramps down to 0
fvol = m_flVolume * fpct;
} }
/* <1ea74> ../cstrike/dlls/bmodels.cpp:585 */ fpitch = FANPITCHMIN + (FANPITCHMAX - FANPITCHMIN) * fpct;
NOBODY void CFuncRotating::SpinUp(void)
pitch = (int)fpitch;
if (pitch == PITCH_NORM)
{ {
// { pitch = PITCH_NORM - 1;
// Vector vecAVel; // 587 }
// operator*(const Vector *const this,
// float fl); // 590 // change the fan's vol and pitch
// operator+(const Vector *const this, EMIT_SOUND_DYN(ENT(pev), CHAN_STATIC, (char *)STRING(pev->noiseRunning), fvol, m_flAttenuation, (SND_CHANGE_PITCH | SND_CHANGE_VOL), pitch);
// const Vector &v); // 590 }
// Rotate(CFuncRotating *const this); // 604
// } // SpinUp - accelerates a non-moving func_rotating up to it's speed
/* <1ea74> ../cstrike/dlls/bmodels.cpp:585 */
void CFuncRotating::SpinUp(void)
{
//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 */ /* <1e9c3> ../cstrike/dlls/bmodels.cpp:615 */
NOBODY void CFuncRotating::SpinDown(void) void CFuncRotating::SpinDown(void)
{ {
// { //rotational velocity
// Vector vecAVel; // 617 Vector vecAVel;
// vec_t vecdir; // 618 vec_t vecdir;
// operator*(const Vector *const this,
// float fl); // 622 pev->nextthink = pev->ltime + 0.1;
// operator-(const Vector *const this,
// const Vector &v); // 622 //spin down slower than spinup
// Rotate(CFuncRotating *const this); // 645 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 */ /* <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 */ /* <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, // is this a brush that should accelerate and decelerate when turned on/off (fan)?
// const Vector &v); // 667 if (pev->spawnflags & SF_BRUSH_ACCDCC)
// operator!=(const Vector *const this, {
// const Vector &v); // 683 // fan is spinning, so stop it.
// operator*(const Vector *const this, if (pev->avelocity != g_vecZero)
// float fl); // 694 {
// Rotate(CFuncRotating *const this); // 697 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 */ /* <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 */ /* <1eb14> ../cstrike/dlls/bmodels.cpp:747 */
@ -278,83 +652,212 @@ LINK_ENTITY_TO_CLASS(func_pendulum, CPendulum);
IMPLEMENT_SAVERESTORE(CPendulum, CBaseEntity); IMPLEMENT_SAVERESTORE(CPendulum, CBaseEntity);
/* <1db2a> ../cstrike/dlls/bmodels.cpp:765 */ /* <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, if (FStrEq(pkvd->szKeyName, "distance"))
// const char *sz2); // 767 {
// FStrEq(const char *sz1, m_distance = Q_atof(pkvd->szValue);
// const char *sz2); // 772 pkvd->fHandled = TRUE;
// KeyValue(CBaseEntity *const this, }
// KeyValueData *pkvd); // 778 else if (FStrEq(pkvd->szKeyName, "damp"))
// atof(const char *__nptr); // 769 {
// KeyValue(CPendulum *const this, m_damp = Q_atof(pkvd->szValue) * 0.001;
// KeyValueData *pkvd); // 765 pkvd->fHandled = TRUE;
}
else
CBaseEntity::KeyValue(pkvd);
} }
/* <1d9c7> ../cstrike/dlls/bmodels.cpp:782 */ /* <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 */ /* <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)
{ {
// { // Pendulum is moving, stop it and auto-return if necessary
// float delta; // 827 if (pev->speed)
// } {
// PendulumUse(CPendulum *const this, if (pev->spawnflags & SF_PENDULUM_AUTO_RETURN)
// class CBaseEntity *pActivator, {
// class CBaseEntity *pCaller, float_precision delta;
// USE_TYPE useType,
// float value); // 821 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 */ /* <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 */ /* <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 */ /* <1d533> ../cstrike/dlls/bmodels.cpp:867 */
NOBODY void CPendulum::Swing(void) void CPendulum::Swing(void)
{ {
// { float delta, dt;
// float delta; // 869
// float dt; // 869 delta = CBaseToggle::AxisDelta(pev->spawnflags, pev->angles, m_center);
// operator*(float fl,
// const Vector &v); // 885 // 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 */ /* <1d3f5> ../cstrike/dlls/bmodels.cpp:909 */
NOBODY void CPendulum::__MAKE_VHOOK(Touch)(CBaseEntity *pOther) void CPendulum::__MAKE_VHOOK(Touch)(CBaseEntity *pOther)
{ {
// { entvars_t *pevOther = pOther->pev;
// entvars_t *pevOther; // 911
// float damage; // 921 if (pev->dmg <= 0)
// VecBModelOrigin(entvars_t *pevBModel); // 928 return;
// operator-(const Vector *const this,
// const Vector &v); // 928 // we can't hurt this thing, so we're not concerned with it
// Normalize(const Vector *const this); // 928 if (pevOther->takedamage == DAMAGE_NO)
// operator*(const Vector *const this, return;
// float fl); // 928
// } // 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 */ /* <1da85> ../cstrike/dlls/bmodels.cpp:931 */
NOBODY void CPendulum::RopeTouch(CBaseEntity *pOther) void CPendulum::RopeTouch(CBaseEntity *pOther)
{ {
// { entvars_t *pevOther = pOther->pev;
// entvars_t *pevOther; // 933
// edict(CBaseEntity *const this); // 946 // not a player!
// } if (!pOther->IsPlayer())
// RopeTouch(CPendulum *const this, {
// class CBaseEntity *pOther); // 931 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 #ifdef HOOK_GAMEDLL

View File

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

View File

@ -53,6 +53,9 @@
extern int _navAreaCount; extern int _navAreaCount;
extern int _currentIndex; extern int _currentIndex;
class CCSBot;
class BotChatterInterface;
/* <3327a8> ../cstrike/dlls/bot/cs_bot.h:44 */ /* <3327a8> ../cstrike/dlls/bot/cs_bot.h:44 */
class BotState class BotState
{ {
@ -685,7 +688,7 @@ public:
} }
int GetNearbyEnemyCount(void) const int GetNearbyEnemyCount(void) const
{ {
return _min(GetEnemiesRemaining(), m_nearbyEnemyCount); return Q_min(GetEnemiesRemaining(), m_nearbyEnemyCount);
} }
unsigned int GetEnemyPlace(void) const unsigned int GetEnemyPlace(void) const
{ {
@ -698,7 +701,7 @@ public:
} }
int GetNearbyFriendCount(void) const int GetNearbyFriendCount(void) const
{ {
return _min(GetFriendsRemaining(), m_nearbyFriendCount); return Q_min(GetFriendsRemaining(), m_nearbyFriendCount);
} }
CBasePlayer *GetClosestVisibleFriend(void) const CBasePlayer *GetClosestVisibleFriend(void) const
{ {
@ -1061,9 +1064,7 @@ private:
float m_pathLadderDismountTimestamp; float m_pathLadderDismountTimestamp;
float m_pathLadderEnd; float m_pathLadderEnd;
float m_pathLadderTimestamp; float m_pathLadderTimestamp;
class CountdownTimer m_mustRunTimer;
CountdownTimer m_mustRunTimer;
CSGameState m_gameState; CSGameState m_gameState;
byte m_hostageEscortCount; byte m_hostageEscortCount;
float m_hostageEscortCountTimestamp; float m_hostageEscortCountTimestamp;

View File

@ -225,7 +225,7 @@ char *BotPhrase::GetSpeakable(int bankIndex, float *duration) const
// check count criteria // check count criteria
// if this speakable has a count criteria, it must match to be used // 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 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) if (duration)
*duration = speak->m_duration; *duration = speak->m_duration;

View File

@ -1162,6 +1162,7 @@ void CCSBotManager::__MAKE_VHOOK(OnEvent)(GameEventType event, CBaseEntity *enti
default: default:
break; break;
} }
CBotManager::OnEvent(event, entity, other); CBotManager::OnEvent(event, entity, other);
} }

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -32,15 +32,37 @@
#pragma once #pragma once
#endif #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 */ /* <249a3> ../cstrike/dlls/buttons.cpp:38 */
class CEnvGlobal: public CPointEntity class CEnvGlobal: public CPointEntity
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
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 #ifdef HOOK_GAMEDLL
@ -66,10 +88,12 @@ public:
class CRotButton: public CBaseButton class CRotButton: public CBaseButton
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
void Spawn_(void); void Spawn_(void);
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
};/* size: 368, cachelines: 6, members: 1 */ };/* size: 368, cachelines: 6, members: 1 */
@ -78,12 +102,15 @@ public:
class CMomentaryRotButton: public CBaseToggle class CMomentaryRotButton: public CBaseToggle
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void); virtual int ObjectCaps(void)
NOBODY virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); {
return ObjectCaps_();
}
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -91,19 +118,29 @@ public:
void KeyValue_(KeyValueData *pkvd); void KeyValue_(KeyValueData *pkvd);
int Save_(CSave &save); int Save_(CSave &save);
int Restore_(CRestore &restore); 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); void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
NOBODY void EXPORT Off(void); void EXPORT Off(void);
NOBODY void EXPORT Return(void); void EXPORT Return(void);
NOBODY void UpdateSelf(float value); void UpdateSelf(float value);
NOBODY void UpdateSelfReturn(float value); void UpdateSelfReturn(float value);
NOBODY void UpdateAllButtons(float value, int start); void UpdateAllButtons(float value, int start);
NOBODY void PlaySound(void); void PlaySound(void);
NOBODY void UpdateTarget(float value); void UpdateTarget(float value);
public: public:
static CMomentaryRotButton *Instance(edict_t *pent) static CMomentaryRotButton *Instance(edict_t *pent)
{ {
@ -127,11 +164,11 @@ public:
class CEnvSpark: public CBaseEntity class CEnvSpark: public CBaseEntity
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void Precache(void); virtual void Precache(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -144,9 +181,9 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
NOBODY void EXPORT SparkThink(void); void EXPORT SparkThink(void);
NOBODY void EXPORT SparkStart(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); 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 SparkStop(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
public: public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1]; static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1];
@ -160,10 +197,10 @@ public:
class CButtonTarget: public CBaseEntity class CButtonTarget: public CBaseEntity
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual int ObjectCaps(void); virtual int ObjectCaps(void);
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 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 #ifdef HOOK_GAMEDLL
@ -176,7 +213,17 @@ public:
};/* size: 152, cachelines: 3, members: 1 */ };/* size: 152, cachelines: 3, members: 1 */
NOBODY char *ButtonSound(int sound); char *ButtonSound(int sound);
NOBODY void DoSpark(entvars_t *pev, const Vector &location); 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 #endif // BUTTON_H

View File

@ -82,7 +82,7 @@ public:
{ {
return m_weaponClassId; return m_weaponClassId;
} }
bool IsValidFor(CBasePlayer *pPlayer)//! bool IsValidFor(CBasePlayer *pPlayer)
{ {
return true; return true;
} }

View File

@ -1082,6 +1082,7 @@ int CBaseEntity::ShouldToggle(USE_TYPE useType, BOOL currentState)
if ((currentState && useType == USE_ON) || (!currentState && useType == USE_OFF)) if ((currentState && useType == USE_ON) || (!currentState && useType == USE_OFF))
return 0; return 0;
} }
return 1; return 1;
} }
@ -1189,7 +1190,7 @@ BOOL CBaseEntity::IsInWorld(void)
CBaseEntity *CBaseEntity::GetNextTarget(void) CBaseEntity *CBaseEntity::GetNextTarget(void)
{ {
return GetNextTarget(); return GetNextTarget_();
} }
BOOL CBaseEntity::FVisible(CBaseEntity *pEntity) BOOL CBaseEntity::FVisible(CBaseEntity *pEntity)
@ -1197,7 +1198,7 @@ BOOL CBaseEntity::FVisible(CBaseEntity *pEntity)
return FVisible_(pEntity); return FVisible_(pEntity);
} }
BOOL CBaseEntity::FVisible(Vector &vecOrigin) BOOL CBaseEntity::FVisible(const Vector &vecOrigin)
{ {
return FVisible_(vecOrigin); return FVisible_(vecOrigin);
} }

View File

@ -39,9 +39,6 @@
#undef CREATE_NAMED_ENTITY #undef CREATE_NAMED_ENTITY
#undef REMOVE_ENTITY #undef REMOVE_ENTITY
//#define CAREER_MODE_DELETED_SCENE 1 // ??
#define CAREER_MODE_CAMPAIGN 2
#define FCAP_CUSTOMSAVE 0x00000001 #define FCAP_CUSTOMSAVE 0x00000001
#define FCAP_ACROSS_TRANSITION 0x00000002 #define FCAP_ACROSS_TRANSITION 0x00000002
#define FCAP_MUST_SPAWN 0x00000004 #define FCAP_MUST_SPAWN 0x00000004
@ -222,6 +219,7 @@ typedef enum
USE_ON, USE_ON,
USE_SET, USE_SET,
USE_TOGGLE, USE_TOGGLE,
} USE_TYPE; } USE_TYPE;
typedef enum typedef enum
@ -298,37 +296,6 @@ private:
};/* size: 8, cachelines: 1, members: 2 */ };/* 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 */ /* <48e9c1> ../cstrike/dlls/cbase.h:166 */
class CBaseEntity class CBaseEntity
{ {
@ -340,8 +307,8 @@ public:
{ {
pkvd->fHandled = FALSE; pkvd->fHandled = FALSE;
} }
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void) virtual int ObjectCaps(void)
{ {
return FCAP_ACROSS_TRANSITION; return FCAP_ACROSS_TRANSITION;
@ -381,17 +348,17 @@ public:
{ {
return GetToggleState_(); return GetToggleState_();
} }
virtual void AddPoints(int score, BOOL bAllowNegativeScore) {} // __stdcall virtual void AddPoints(int score, BOOL bAllowNegativeScore) {}
virtual void AddPointsToTeam(int score, BOOL bAllowNegativeScore) {} // __stdcall virtual void AddPointsToTeam(int score, BOOL bAllowNegativeScore) {}
virtual BOOL AddPlayerItem(CBasePlayerItem *pItem) virtual BOOL AddPlayerItem(CBasePlayerItem *pItem)
{ {
return FALSE; return FALSE;
} }
virtual BOOL RemovePlayerItem(CBasePlayerItem *pItem) // __stdcall virtual BOOL RemovePlayerItem(CBasePlayerItem *pItem)
{ {
return FALSE; return FALSE;
} }
virtual int GiveAmmo(int iAmount, char *szName, int iMax) // __stdcall virtual int GiveAmmo(int iAmount, char *szName, int iMax)
{ {
return -1; return -1;
} }
@ -449,23 +416,31 @@ public:
virtual void Think(void) virtual void Think(void)
{ {
if (m_pfnThink) if (m_pfnThink)
{
(this->*m_pfnThink)(); (this->*m_pfnThink)();
} }
}
virtual void Touch(CBaseEntity *pOther) virtual void Touch(CBaseEntity *pOther)
{ {
if (m_pfnTouch) if (m_pfnTouch)
{
(this->*m_pfnTouch)(pOther); (this->*m_pfnTouch)(pOther);
} }
}
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType = USE_OFF, float value = 0.0f) virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType = USE_OFF, float value = 0.0f)
{ {
if (m_pfnUse) if (m_pfnUse)
{
(this->*m_pfnUse)(pActivator, pCaller, useType, value); (this->*m_pfnUse)(pActivator, pCaller, useType, value);
} }
}
virtual void Blocked(CBaseEntity *pOther) virtual void Blocked(CBaseEntity *pOther)
{ {
if (m_pfnBlocked) if (m_pfnBlocked)
{
(this->*m_pfnBlocked)(pOther); (this->*m_pfnBlocked)(pOther);
} }
}
virtual CBaseEntity *Respawn(void) virtual CBaseEntity *Respawn(void)
{ {
return NULL; return NULL;
@ -496,8 +471,8 @@ public:
return GETENTITYILLUM(ENT(pev)); return GETENTITYILLUM(ENT(pev));
} }
NOBODY virtual BOOL FVisible(CBaseEntity *pEntity); virtual BOOL FVisible(CBaseEntity *pEntity);
NOBODY virtual BOOL FVisible(Vector &vecOrigin); virtual BOOL FVisible(const Vector &vecOrigin);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -526,7 +501,7 @@ public:
return Center(); return Center();
} }
BOOL FVisible_(CBaseEntity *pEntity); BOOL FVisible_(CBaseEntity *pEntity);
BOOL FVisible_(Vector &vecOrigin); BOOL FVisible_(const Vector &vecOrigin);
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
@ -548,8 +523,8 @@ public:
{ {
Use(this, this, USE_TOGGLE, 0); Use(this, this, USE_TOGGLE, 0);
} }
NOBODY int ShouldToggle(USE_TYPE useType, BOOL currentState); 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); 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); 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); void SUB_UseTargets(CBaseEntity *pActivator, USE_TYPE useType, float value);
int Intersects(CBaseEntity *pOther); int Intersects(CBaseEntity *pOther);
@ -665,8 +640,8 @@ inline int FNullEnt(EHANDLE hent)
class CPointEntity: public CBaseEntity class CPointEntity: public CBaseEntity
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual int ObjectCaps(void) virtual int ObjectCaps(void)
{ {
return ObjectCaps_(); return ObjectCaps_();
} }
@ -687,16 +662,16 @@ public:
class CMultiSource: public CPointEntity class CMultiSource: public CPointEntity
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
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);
NOBODY virtual int ObjectCaps(void) virtual int ObjectCaps(void)
{ {
return ObjectCaps_(); return ObjectCaps_();
} }
NOBODY virtual BOOL IsTriggered(CBaseEntity *pActivator); virtual BOOL IsTriggered(CBaseEntity *pActivator);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -714,7 +689,7 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
NOBODY void EXPORT Register(void); void EXPORT Register(void);
public: public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[4]; static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[4];
@ -731,8 +706,8 @@ class CBaseDelay: public CBaseEntity
{ {
public: public:
virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -757,8 +732,8 @@ public:
class CBaseAnimating: public CBaseDelay class CBaseAnimating: public CBaseDelay
{ {
public: public:
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
virtual void HandleAnimEvent(MonsterEvent_t *pEvent) {} virtual void HandleAnimEvent(MonsterEvent_t *pEvent) {}
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -823,16 +798,16 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
NOBODY void LinearMove(Vector vecDest, float flSpeed); void LinearMove(Vector vecDest, float flSpeed);
NOBODY void EXPORT LinearMoveDone(void); void EXPORT LinearMoveDone(void);
NOBODY void AngularMove(Vector vecDestAngle, float flSpeed); void AngularMove(Vector vecDestAngle, float flSpeed);
NOBODY void EXPORT AngularMoveDone(void); void EXPORT AngularMoveDone(void);
NOBODY BOOL IsLockedByMaster(void); NOXREF BOOL IsLockedByMaster(void);
public: public:
NOBODY static float AxisValue(int flags, Vector &angles); static float AxisValue(int flags, const Vector &angles);
NOBODY static void AxisDir(entvars_t *pev); static void AxisDir(entvars_t *pev);
NOBODY static float AxisDelta(int flags, Vector &angle1, Vector &angle2); static float AxisDelta(int flags, const Vector &angle1, const Vector &angle2);
public: public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[19]; static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[19];
@ -856,10 +831,13 @@ public:
Vector m_vecFinalAngle; Vector m_vecFinalAngle;
int m_bitsDamageInflict; int m_bitsDamageInflict;
string_t m_sMaster; string_t m_sMaster;
};/* size: 312, cachelines: 5, members: 21 */ };/* size: 312, cachelines: 5, members: 21 */
#include "basemonster.h" #include "basemonster.h"
// Generic Button
/* <24b19> ../cstrike/dlls/cbase.h:745 */ /* <24b19> ../cstrike/dlls/cbase.h:745 */
class CBaseButton: public CBaseToggle class CBaseButton: public CBaseToggle
{ {
@ -871,12 +849,12 @@ class CBaseButton: public CBaseToggle
}; };
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void Precache(void); virtual void Precache(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
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 Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void) virtual int ObjectCaps(void)
{ {
return ObjectCaps_(); return ObjectCaps_();
@ -893,7 +871,9 @@ public:
int ObjectCaps_(void) int ObjectCaps_(void)
{ {
if (pev->takedamage == DAMAGE_NO) if (pev->takedamage == DAMAGE_NO)
{
return FCAP_IMPULSE_USE; return FCAP_IMPULSE_USE;
}
return (CBaseToggle::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); return (CBaseToggle::ObjectCaps() & ~FCAP_ACROSS_TRANSITION);
} }
@ -901,19 +881,19 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
NOBODY void RotSpawn(void); NOXREF void RotSpawn(void);
NOBODY void ButtonActivate(void); void ButtonActivate(void);
NOBODY void SparkSoundCache(void); NOXREF void SparkSoundCache(void);
NOBODY void EXPORT ButtonShot(void); NOXREF void EXPORT ButtonShot(void);
NOBODY void EXPORT ButtonTouch(CBaseEntity *pOther); void EXPORT ButtonTouch(CBaseEntity *pOther);
NOBODY void EXPORT ButtonSpark(void); void EXPORT ButtonSpark(void);
NOBODY void EXPORT TriggerAndWait(void); void EXPORT TriggerAndWait(void);
NOBODY void EXPORT ButtonReturn(void); void EXPORT ButtonReturn(void);
NOBODY void EXPORT ButtonBackHome(void); void EXPORT ButtonBackHome(void);
NOBODY void EXPORT ButtonUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); void EXPORT ButtonUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
NOBODY BUTTON_CODE ButtonResponseToTouch(void); BUTTON_CODE ButtonResponseToTouch(void);
public: public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[8]; static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[8];
@ -927,6 +907,7 @@ public:
BYTE m_bUnlockedSound; BYTE m_bUnlockedSound;
BYTE m_bUnlockedSentence; BYTE m_bUnlockedSentence;
int m_sounds; int m_sounds;
};/* size: 368, cachelines: 6, members: 11 */ };/* size: 368, cachelines: 6, members: 11 */
/* <1da023> ../cstrike/dlls/cbase.h:861 */ /* <1da023> ../cstrike/dlls/cbase.h:861 */
@ -990,97 +971,9 @@ public:
};/* size: 152, cachelines: 3, members: 1 */ };/* 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> template <class T>
T *GetClassPtr(T *a) T *GetClassPtr(T *a)
@ -1134,7 +1027,7 @@ void OnFreeEntPrivateData(edict_t *pEnt);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
typedef BOOL (CBaseEntity::*FVISIBLE_ENTITY)(CBaseEntity *); 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_VECTOR)(Vector, Vector);
typedef void (CGrenade::*EXPLODE_TRACERESULT)(TraceResult *, int); typedef void (CGrenade::*EXPLODE_TRACERESULT)(TraceResult *, int);
@ -1145,7 +1038,4 @@ typedef CBaseEntity *(CBaseEntity::*CBASE_ISTANCE_INT)(int);
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
//Refs
extern void (*pCGib__SpawnHeadGib)(void);
#endif // CBASE_H #endif // CBASE_H

View File

@ -857,19 +857,10 @@ void Host_Say(edict_t *pEntity, int teamonly)
if (CVAR_GET_FLOAT("mp_logmessages") != 0) 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 *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 UTIL_LogPrintf
( (
@ -891,7 +882,9 @@ void DropSecondary(CBasePlayer *pPlayer)
if (pPlayer->HasShield()) if (pPlayer->HasShield())
{ {
if (pPlayer->HasShield() && pPlayer->m_bShieldDrawn && pPlayer->m_pActiveItem != NULL) if (pPlayer->HasShield() && pPlayer->m_bShieldDrawn && pPlayer->m_pActiveItem != NULL)
{
((CBasePlayerWeapon *)pPlayer->m_pActiveItem)->SecondaryAttack(); ((CBasePlayerWeapon *)pPlayer->m_pActiveItem)->SecondaryAttack();
}
pPlayer->m_bShieldDrawn = false; pPlayer->m_bShieldDrawn = false;
} }
@ -1175,7 +1168,7 @@ void BuySubMachineGun(CBasePlayer *pPlayer, int iSlot)
{ {
iWeapon = WEAPON_UMP45; iWeapon = WEAPON_UMP45;
iWeaponPrice = UMP45_PRICE; iWeaponPrice = UMP45_PRICE;
pszWeapon = "weapon_mp5navy"; pszWeapon = "weapon_ump45";
break; break;
} }
case 4: case 4:
@ -4433,8 +4426,10 @@ void SpectatorConnect(edict_t *pEntity)
CBaseSpectator *pPlayer = (CBaseSpectator *)GET_PRIVATE(pEntity); CBaseSpectator *pPlayer = (CBaseSpectator *)GET_PRIVATE(pEntity);
if (pPlayer) if (pPlayer)
{
pPlayer->SpectatorConnect(); pPlayer->SpectatorConnect();
} }
}
/* <4a83d> ../cstrike/dlls/client.cpp:5095 */ /* <4a83d> ../cstrike/dlls/client.cpp:5095 */
void SpectatorDisconnect(edict_t *pEntity) void SpectatorDisconnect(edict_t *pEntity)
@ -4442,8 +4437,10 @@ void SpectatorDisconnect(edict_t *pEntity)
CBaseSpectator *pPlayer = (CBaseSpectator *)GET_PRIVATE(pEntity); CBaseSpectator *pPlayer = (CBaseSpectator *)GET_PRIVATE(pEntity);
if (pPlayer) if (pPlayer)
{
pPlayer->SpectatorDisconnect(); pPlayer->SpectatorDisconnect();
} }
}
/* <4a8b5> ../cstrike/dlls/client.cpp:5111 */ /* <4a8b5> ../cstrike/dlls/client.cpp:5111 */
void SpectatorThink(edict_t *pEntity) void SpectatorThink(edict_t *pEntity)
@ -4451,8 +4448,10 @@ void SpectatorThink(edict_t *pEntity)
CBaseSpectator *pPlayer = (CBaseSpectator *)GET_PRIVATE(pEntity); CBaseSpectator *pPlayer = (CBaseSpectator *)GET_PRIVATE(pEntity);
if (pPlayer) if (pPlayer)
{
pPlayer->SpectatorThink(); pPlayer->SpectatorThink();
} }
}
/* <4a92d> ../cstrike/dlls/client.cpp:5160 */ /* <4a92d> ../cstrike/dlls/client.cpp:5160 */
void SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas) void SetupVisibility(edict_t *pViewEntity, edict_t *pClient, unsigned char **pvs, unsigned char **pas)
@ -4955,10 +4954,10 @@ int GetWeaponData(edict_s *player, struct weapon_data_s *info)
item->m_iId = II.iId; item->m_iId = II.iId;
item->m_iClip = gun->m_iClip; item->m_iClip = gun->m_iClip;
item->m_flTimeWeaponIdle = _max(gun->m_flTimeWeaponIdle, -0.001); item->m_flTimeWeaponIdle = Q_max(gun->m_flTimeWeaponIdle, -0.001f);
item->m_flNextPrimaryAttack = _max(gun->m_flNextPrimaryAttack, -0.001); item->m_flNextPrimaryAttack = Q_max(gun->m_flNextPrimaryAttack, -0.001f);
item->m_flNextSecondaryAttack = _max(gun->m_flNextSecondaryAttack, -0.001); item->m_flNextSecondaryAttack = Q_max(gun->m_flNextSecondaryAttack, -0.001f);
item->m_flNextReload = _max(gun->m_flNextReload, -0.001); item->m_flNextReload = Q_max(gun->m_flNextReload, -0.001f);
item->m_fInReload = gun->m_fInReload; item->m_fInReload = gun->m_fInReload;
item->m_fInSpecialReload = gun->m_fInSpecialReload; item->m_fInSpecialReload = gun->m_fInSpecialReload;
item->m_fInZoom = gun->m_iShotsFired; item->m_fInZoom = gun->m_iShotsFired;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -52,19 +52,19 @@
class CBaseDoor: public CBaseToggle class CBaseDoor: public CBaseToggle
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void Precache(void); virtual void Precache(void);
NOBODY virtual void Restart(void); virtual void Restart(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void) virtual int ObjectCaps(void)
{ {
return ObjectCaps_(); return ObjectCaps_();
} }
NOBODY virtual void SetToggleState(int state); virtual void SetToggleState(int state);
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);
NOBODY virtual void Blocked(CBaseEntity *pOther); virtual void Blocked(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -91,21 +91,27 @@ public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[7]; static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[7];
public: public:
NOBODY void EXPORT DoorTouch(CBaseEntity *pOther); // used to selectivly override defaults
NOBODY int DoorActivate(void); void EXPORT DoorTouch(CBaseEntity *pOther);
NOBODY void EXPORT DoorGoUp(void); int DoorActivate(void);
NOBODY void EXPORT DoorGoDown(void); void EXPORT DoorGoUp(void);
NOBODY void EXPORT DoorHitTop(void); void EXPORT DoorGoDown(void);
NOBODY void EXPORT DoorHitBottom(void); void EXPORT DoorHitTop(void);
void EXPORT DoorHitBottom(void);
public: public:
BYTE m_bHealthValue; BYTE m_bHealthValue; // some doors are medi-kit doors, they give players health
BYTE m_bMoveSnd;
BYTE m_bStopSnd; BYTE m_bMoveSnd; // sound a door makes while moving
locksound_t m_ls; BYTE m_bStopSnd; // sound a door makes when it stops
BYTE m_bLockedSound;
locksound_t m_ls; // door lock sounds
BYTE m_bLockedSound; // ordinals from entity selection
BYTE m_bLockedSentence; BYTE m_bLockedSentence;
BYTE m_bUnlockedSound; BYTE m_bUnlockedSound;
BYTE m_bUnlockedSentence; BYTE m_bUnlockedSentence;
float m_lastBlockedTimestamp; float m_lastBlockedTimestamp;
};/* size: 360, cachelines: 6, members: 11 */ };/* size: 360, cachelines: 6, members: 11 */
@ -114,9 +120,9 @@ public:
class CRotDoor: public CBaseDoor class CRotDoor: public CBaseDoor
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void Restart(void); virtual void Restart(void);
NOBODY virtual void SetToggleState(int state); virtual void SetToggleState(int state);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -132,16 +138,16 @@ public:
class CMomentaryDoor: public CBaseToggle class CMomentaryDoor: public CBaseToggle
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void Precache(void); virtual void Precache(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void) virtual int ObjectCaps(void)
{ {
return ObjectCaps_(); 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 #ifdef HOOK_GAMEDLL
@ -162,11 +168,16 @@ public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1]; static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1];
public: public:
BYTE m_bMoveSnd; BYTE m_bMoveSnd; // sound a door makes while moving
};/* size: 316, cachelines: 5, members: 3 */ };/* 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 #endif // DOORS_H

View File

@ -327,13 +327,13 @@ void CBeam::RelinkBeam(void)
const Vector &startPos = GetStartPos(); const Vector &startPos = GetStartPos();
const Vector &endPos = GetEndPos(); const Vector &endPos = GetEndPos();
pev->mins.x = _min(startPos.x, endPos.x); pev->mins.x = Q_min(startPos.x, endPos.x);
pev->mins.y = _min(startPos.y, endPos.y); pev->mins.y = Q_min(startPos.y, endPos.y);
pev->mins.z = _min(startPos.z, endPos.z); pev->mins.z = Q_min(startPos.z, endPos.z);
pev->maxs.x = _max(startPos.x, endPos.x); pev->maxs.x = Q_max(startPos.x, endPos.x);
pev->maxs.y = _max(startPos.y, endPos.y); pev->maxs.y = Q_max(startPos.y, endPos.y);
pev->maxs.z = _max(startPos.z, endPos.z); pev->maxs.z = Q_max(startPos.z, endPos.z);
pev->mins = pev->mins - pev->origin; pev->mins = pev->mins - pev->origin;
pev->maxs = pev->maxs - pev->origin; pev->maxs = pev->maxs - pev->origin;
@ -1018,8 +1018,10 @@ void CLaser::TurnOff(void)
pev->nextthink = 0; pev->nextthink = 0;
if (m_pSprite) if (m_pSprite)
{
m_pSprite->TurnOff(); m_pSprite->TurnOff();
} }
}
/* <78804> ../cstrike/dlls/effects.cpp:1032 */ /* <78804> ../cstrike/dlls/effects.cpp:1032 */
void CLaser::TurnOn(void) void CLaser::TurnOn(void)
@ -1027,7 +1029,9 @@ void CLaser::TurnOn(void)
pev->effects &= ~EF_NODRAW; pev->effects &= ~EF_NODRAW;
if (m_pSprite) if (m_pSprite)
{
m_pSprite->TurnOn(); m_pSprite->TurnOn();
}
pev->dmgtime = gpGlobals->time; pev->dmgtime = gpGlobals->time;
pev->nextthink = gpGlobals->time; pev->nextthink = gpGlobals->time;
@ -1533,7 +1537,7 @@ void CGibShooter::ShootThink(void)
LINK_ENTITY_TO_CLASS(env_shooter, CEnvShooter); LINK_ENTITY_TO_CLASS(env_shooter, CEnvShooter);
/* <749e7> ../cstrike/dlls/effects.cpp:1602 */ /* <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")) if (FStrEq(pkvd->szKeyName, "shootmodel"))
{ {

View File

@ -153,7 +153,7 @@ public:
{ {
pev->renderamt = brightness; pev->renderamt = brightness;
} }
void AnimateAndDie(float framerate) void AnimateAndDie(float_precision framerate)
{ {
SetThink(&CSprite::AnimateUntilDead); SetThink(&CSprite::AnimateUntilDead);
pev->framerate = framerate; pev->framerate = framerate;

View File

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

View File

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

View File

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

View File

@ -41,6 +41,7 @@
#include "archtypes.h" #include "archtypes.h"
#ifdef _WIN32 #ifdef _WIN32
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#define NOWINRES #define NOWINRES
#define NOSERVICE #define NOSERVICE
@ -51,26 +52,11 @@
#include "winsani_out.h" #include "winsani_out.h"
#undef PlaySound #undef PlaySound
#else #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 <limits.h>
#include <stdarg.h> #include <stdarg.h>
#include <string.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 #endif // _WIN32
// Misc C-runtime library headers // Misc C-runtime library headers

File diff suppressed because it is too large Load Diff

View File

@ -35,6 +35,15 @@
// this many shards spawned when breakable objects break; // this many shards spawned when breakable objects break;
#define NUM_SHARDS 6 #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 typedef enum
{ {
expRandom = 0, expRandom = 0,
@ -75,25 +84,25 @@ class CBreakable: public CBaseDelay
{ {
public: public:
// basic functions // basic functions
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void Precache(void); virtual void Precache(void);
NOBODY virtual void Restart(void); virtual void Restart(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void) virtual int ObjectCaps(void)
{ {
return ObjectCaps_(); return ObjectCaps_();
} }
// To spark when hit // 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 // 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); virtual int DamageDecal(int bitsDamageType);
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 #ifdef HOOK_GAMEDLL
@ -115,13 +124,13 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
NOBODY void EXPORT BreakTouch(CBaseEntity *pOther); void EXPORT BreakTouch(CBaseEntity *pOther);
NOBODY void DamageSound(void); void DamageSound(void);
NOBODY BOOL IsBreakable(void); BOOL IsBreakable(void);
NOBODY BOOL SparkWhenHit(void); NOXREF BOOL SparkWhenHit(void);
NOBODY void EXPORT Die(void); void EXPORT Die(void);
inline BOOL Explodable(void) inline BOOL Explodable(void)
{ {
@ -164,18 +173,18 @@ public:
class CPushable: public CBreakable class CPushable: public CBreakable
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void Precache(void); virtual void Precache(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void) virtual int ObjectCaps(void)
{ {
return ObjectCaps_(); return ObjectCaps_();
} }
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 void Touch(CBaseEntity *pOther); virtual void Touch(CBaseEntity *pOther);
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 #ifdef HOOK_GAMEDLL
@ -195,8 +204,17 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
NOBODY void Move(CBaseEntity *pMover, int push); void Move(CBaseEntity *pMover, int push);
NOBODY void EXPORT StopSound(void); 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) inline float MaxSpeed(void)
{ {
return m_maxSpeed; return m_maxSpeed;
@ -214,4 +232,8 @@ public:
};/* size: 200, cachelines: 4, members: 6 */ };/* 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 #endif // FUNC_BREAK_H

File diff suppressed because it is too large Load Diff

View File

@ -42,32 +42,34 @@
enum TANKBULLET enum TANKBULLET
{ {
TANK_BULLET_NONE = 0, TANK_BULLET_NONE = 0, // Custom damage
TANK_BULLET_9MM, TANK_BULLET_9MM, // env_laser (duration is 0.5 rate of fire)
TANK_BULLET_MP5, TANK_BULLET_MP5, // rockets
TANK_BULLET_12MM, TANK_BULLET_12MM, // explosion?
}; };
/* <8c75e> ../cstrike/dlls/func_tank.cpp:46 */ /* <8c75e> ../cstrike/dlls/func_tank.cpp:46 */
class CFuncTank: public CBaseEntity class CFuncTank: public CBaseEntity
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void Precache(void); virtual void Precache(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void)
// Bmodels don't go across transitions
virtual int ObjectCaps(void)
{ {
return ObjectCaps_(); return ObjectCaps_();
} }
NOBODY virtual BOOL OnControls(entvars_t *pevTest); virtual BOOL OnControls(entvars_t *pevTest);
NOBODY virtual void Think(void); virtual void Think(void);
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);
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);
NOBODY virtual Vector UpdateTargetPosition(CBaseEntity *pTarget) virtual Vector UpdateTargetPosition(CBaseEntity *pTarget)
{ {
return UpdateTargetPosition_(pTarget); return pTarget->BodyTarget(pev->origin);
} }
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -85,17 +87,13 @@ public:
void Think_(void); void Think_(void);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void Fire_(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker); void Fire_(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
Vector UpdateTargetPosition_(CBaseEntity *pTarget)
{
return pTarget->BodyTarget(pev->origin);
}
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
NOBODY void TrackTarget(void); void TrackTarget(void);
NOBODY void StartRotSound(void); void StartRotSound(void);
NOBODY void StopRotSound(void); void StopRotSound(void);
inline BOOL IsActive(void) inline BOOL IsActive(void)
{ {
@ -118,9 +116,11 @@ public:
return (gpGlobals->time - m_lastSightTime) < m_persist; return (gpGlobals->time - m_lastSightTime) < m_persist;
} }
NOBODY BOOL InRange(float range); 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); // 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) Vector BarrelPosition(void)
{ {
@ -129,10 +129,10 @@ public:
return pev->origin + (forward * m_barrelPos.x) + (right * m_barrelPos.y) + (up * m_barrelPos.z); return pev->origin + (forward * m_barrelPos.x) + (right * m_barrelPos.y) + (up * m_barrelPos.z);
} }
NOBODY void AdjustAnglesForBarrel(Vector &angles, float distance); void AdjustAnglesForBarrel(Vector &angles, float distance);
NOBODY BOOL StartControl(CBasePlayer *pController); BOOL StartControl(CBasePlayer *pController);
NOBODY void StopControl(void); void StopControl(void);
NOBODY void ControllerPostFrame(void); void ControllerPostFrame(void);
public: public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[26]; static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[26];
@ -141,29 +141,36 @@ protected:
CBasePlayer *m_pController; CBasePlayer *m_pController;
float m_flNextAttack; float m_flNextAttack;
Vector m_vecControllerUsePos; Vector m_vecControllerUsePos;
float m_yawCenter;
float m_yawRate; float m_yawCenter; // "Center" yaw
float m_yawRange; float m_yawRate; // Max turn rate to track targets
float m_yawTolerance; float m_yawRange; // Range of turning motion (one-sided: 30 is +/- 30 degress from center)
float m_pitchCenter; // Zero is full rotation
float m_pitchRate;
float m_pitchRange; float m_yawTolerance; // Tolerance angle
float m_pitchTolerance;
float m_fireLast; float m_pitchCenter; // "Center" pitch
float m_fireRate; float m_pitchRate; // Max turn rate on pitch
float m_lastSightTime; float m_pitchRange; // Range of pitch motion as above
float m_persist; float m_pitchTolerance; // Tolerance angle
float m_minRange;
float m_maxRange; float m_fireLast; // Last time I fired
Vector m_barrelPos; float m_fireRate; // How many rounds/second
float m_spriteScale; 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_iszSpriteSmoke;
int m_iszSpriteFlash; int m_iszSpriteFlash;
TANKBULLET m_bulletType; TANKBULLET m_bulletType; // Bullet type
int m_iBulletDamage; int m_iBulletDamage; // 0 means use Bullet type's default damage
Vector m_sightOrigin;
int m_spread; Vector m_sightOrigin; // Last sight of target
int m_iszMaster; int m_spread; // firing spread
int m_iszMaster; // Master entity (game_team_master or multisource)
};/* size: 280, cachelines: 5, members: 28 */ };/* size: 280, cachelines: 5, members: 28 */
@ -171,10 +178,12 @@ protected:
class CFuncTankGun: public CFuncTank class CFuncTankGun: public CFuncTank
{ {
public: 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 #ifdef HOOK_GAMEDLL
void Fire_(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker); void Fire_(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
};/* size: 280, cachelines: 5, members: 1 */ };/* size: 280, cachelines: 5, members: 1 */
@ -183,12 +192,12 @@ public:
class CFuncTankLaser: public CFuncTank class CFuncTankLaser: public CFuncTank
{ {
public: public:
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
NOBODY virtual void Activate(void); virtual void Activate(void);
NOBODY virtual void Think(void); virtual void Think(void);
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 #ifdef HOOK_GAMEDLL
@ -201,7 +210,7 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
NOBODY CLaser *GetLaser(void); CLaser *GetLaser(void);
public: public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[2]; static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[2];
@ -216,8 +225,8 @@ private:
class CFuncTankRocket: public CFuncTank class CFuncTankRocket: public CFuncTank
{ {
public: public:
NOBODY virtual void Precache(void); virtual void Precache(void);
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 #ifdef HOOK_GAMEDLL
@ -232,8 +241,8 @@ public:
class CFuncTankMortar: public CFuncTank class CFuncTankMortar: public CFuncTank
{ {
public: public:
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
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 #ifdef HOOK_GAMEDLL
@ -248,15 +257,15 @@ public:
class CFuncTankControls: public CBaseEntity class CFuncTankControls: public CBaseEntity
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void) virtual int ObjectCaps(void)
{ {
return ObjectCaps_(); return ObjectCaps_();
} }
NOBODY virtual void Think(void); virtual void Think(void);
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 #ifdef HOOK_GAMEDLL
@ -280,4 +289,18 @@ public:
};/* size: 156, cachelines: 3, members: 3 */ };/* 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 #endif // FUNC_TANK_H

View File

@ -122,6 +122,7 @@ enum RewardAccount
REWARD_RESCUED_HOSTAGE = 750, REWARD_RESCUED_HOSTAGE = 750,
REWARD_KILLED_ENEMY = 300, REWARD_KILLED_ENEMY = 300,
REWARD_KILLED_VIP = 2500, 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 BOOL ClientConnected(edict_t *pEntity, const char *pszName, const char *pszAddress, char *szRejectReason) = 0;
virtual void InitHUD(CBasePlayer *pl) = 0; virtual void InitHUD(CBasePlayer *pl) = 0;
virtual void ClientDisconnected(edict_t *pClient) = 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 float FlPlayerFallDamage(CBasePlayer *pPlayer) = 0;
virtual BOOL FPlayerCanTakeDamage(CBasePlayer *pPlayer, CBaseEntity *pAttacker) virtual BOOL FPlayerCanTakeDamage(CBasePlayer *pPlayer, CBaseEntity *pAttacker)
{ {
@ -219,7 +220,7 @@ public:
{ {
return ClientCommand_(pPlayer, pcmd); 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 int IPointsForKill(CBasePlayer *pAttacker, CBasePlayer *pKilled) = 0;
virtual void PlayerKilled(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor) = 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; virtual void DeathNotice(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pevInflictor) = 0;
@ -260,7 +261,7 @@ public:
{ {
return IsValidTeam_(pTeamName); 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) virtual const char *SetDefaultPlayerTeam(CBasePlayer *pPlayer)
{ {
return SetDefaultPlayerTeam_(pPlayer); return SetDefaultPlayerTeam_(pPlayer);
@ -270,13 +271,13 @@ public:
return PlayTextureSounds_(); return PlayTextureSounds_();
} }
virtual BOOL FAllowMonsters(void) = 0; virtual BOOL FAllowMonsters(void) = 0;
virtual void EndMultiplayerGame(void) {} virtual void EndMultiplayerGame(void) {};
virtual BOOL IsFreezePeriod(void) virtual BOOL IsFreezePeriod(void)
{ {
return IsFreezePeriod_(); return IsFreezePeriod_();
} }
virtual void ServerDeactivate(void) {} virtual void ServerDeactivate(void) {};
virtual void CheckMapConditions(void) {} virtual void CheckMapConditions(void) {};
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL

View File

@ -26,7 +26,7 @@ TYPEDESCRIPTION CGrenade::m_SaveData[] =
#else // HOOK_GAMEDLL #else // HOOK_GAMEDLL
TYPEDESCRIPTION (*CGrenade::pm_SaveData)[15]; TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CGrenade, m_SaveData)[15];
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
@ -855,7 +855,9 @@ void CGrenade::__MAKE_VHOOK(Spawn)(void)
pev->movetype = MOVETYPE_BOUNCE; pev->movetype = MOVETYPE_BOUNCE;
if (pev->classname) if (pev->classname)
{
RemoveEntityHashValue(pev, STRING(pev->classname), CLASSNAME); RemoveEntityHashValue(pev, STRING(pev->classname), CLASSNAME);
}
MAKE_STRING_CLASS("grenade", pev); MAKE_STRING_CLASS("grenade", pev);
AddEntityHashValue(pev, STRING(pev->classname), CLASSNAME); AddEntityHashValue(pev, STRING(pev->classname), CLASSNAME);
@ -1005,10 +1007,13 @@ void CGrenade::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller,
if (player->m_bHasDefuser) 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), STRING(player->pev->netname),
GETPLAYERUSERID(player->edict()), GETPLAYERUSERID(player->edict()),
GETPLAYERAUTHID(player->edict())); GETPLAYERAUTHID(player->edict())
);
ClientPrint(player->pev, HUD_PRINTCENTER, "#Defusing_Bomb_With_Defuse_Kit"); 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); EMIT_SOUND(ENT(player->pev), CHAN_ITEM, "weapons/c4_disarm.wav", VOL_NORM, ATTN_NORM);

View File

@ -1,5 +1,8 @@
#include "precompiled.h" #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 * Globals initialization
*/ */
@ -14,93 +17,165 @@ BOOL g_fDrawLines;
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
/* <c08f4> ../cstrike/dlls/h_ai.cpp:47 */ /* <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)
{ {
// { // don't look through water
// TraceResult tr; // 54 if ((pevLooker->waterlevel != 3 && pevTarget->waterlevel == 3) || (pevLooker->waterlevel == 3 && pevTarget->waterlevel == 0))
// Vector vecLookerOrigin; // 55 {
// operator+(const Vector *const this, return FALSE;
// const Vector &v); // 55
// {
// int i; // 56
// {
// Vector vecTarget; // 58
// Vector(Vector *const this,
// const Vector &v); // 58
// }
// }
// }
} }
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 */ /* <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;
// TraceResult tr; // 80 Vector vecMidPoint; // halfway point between Spot1 and Spot2
// Vector vecMidPoint; // 81 Vector vecApex; // highest point
// Vector vecApex; // 82 Vector vecScale;
// Vector vecScale; // 83 Vector vecGrenadeVel;
// Vector vecGrenadeVel; // 84 Vector vecTemp;
// Vector vecTemp; // 85 float flGravity = g_psv_gravity->value * flGravityAdj;
// float flGravity; // 86
// float distance1; // 119 if (vecSpot2.z - vecSpot1.z > 500)
// float distance2; // 120 {
// float time1; // 123 // to high, fail
// float time2; // 124 return g_vecZero;
// 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
// }
} }
/* <c0d21> ../cstrike/dlls/h_ai.cpp:164 */ UTIL_MakeVectors(pev->angles);
NOBODY Vector VecCheckThrow(entvars_t *pev, Vector &vecSpot1, Vector vecSpot2, float flSpeed, float flGravityAdj)
// 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
// float flGravity; // 166 return g_vecZero;
// Vector vecGrenadeVel; // 168 }
// float time; // 171
// Vector vecApex; // 177 // How high should the grenade travel to reach the apex
// TraceResult tr; // 180 float distance1 = (vecMidPoint.z - vecSpot1.z);
// operator-(const Vector *const this, float distance2 = (vecMidPoint.z - vecSpot2.z);
// const Vector &v); // 168
// Length(const Vector *const this); // 171 // How long will it take for the grenade to travel this distance
// operator-(const Vector *const this, float time1 = sqrt(distance1 / (0.5 * flGravity));
// const Vector &v); // 177 float time2 = sqrt(distance2 / (0.5 * flGravity));
// operator*(const Vector *const this,
// float fl); // 177 if (time1 < 0.1)
// operator+(const Vector *const this, {
// const Vector &v); // 177 // too close
// Vector(Vector *const this, return g_vecZero;
// const Vector &v); // 192 }
// operator*(const Vector *const this,
// float fl); // 172 // how hard to throw sideways to get there in time.
// Vector(Vector *const this, vecGrenadeVel = (vecSpot2 - vecSpot1) / (time1 + time2);
// const Vector &v); // 195
// } // 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 */
NOXREF Vector VecCheckThrow(entvars_t *pev, const Vector &vecSpot1, Vector vecSpot2, float flSpeed, float flGravityAdj)
{
float flGravity = g_psv_gravity->value * flGravityAdj;
Vector vecGrenadeVel = (vecSpot2 - vecSpot1);
// throw at a constant time
float time = vecGrenadeVel.Length() / flSpeed;
vecGrenadeVel = vecGrenadeVel * (1.0 / time);
// adjust upward toss to compensate for gravity loss
vecGrenadeVel.z += flGravity * time * 0.5;
Vector vecApex = vecSpot1 + (vecSpot2 - vecSpot1) * 0.5;
vecApex.z += 0.5 * flGravity * (time * 0.5) * (time * 0.5);
TraceResult tr;
UTIL_TraceLine(vecSpot1, vecApex, dont_ignore_monsters, ENT(pev), &tr);
if (tr.flFraction != 1.0f)
{
// fail!
return g_vecZero;
}
UTIL_TraceLine(vecSpot2, vecApex, ignore_monsters, ENT(pev), &tr);
if (tr.flFraction != 1.0f)
{
// fail!
return g_vecZero;
}
return vecGrenadeVel;
} }

View File

@ -32,8 +32,8 @@
#pragma once #pragma once
#endif #endif
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);
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);
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);
#endif // H_AI_H #endif // H_AI_H

View File

@ -16,7 +16,7 @@ TYPEDESCRIPTION CRecharge::m_SaveData[] =
#else #else
TYPEDESCRIPTION (*CRecharge::pm_SaveData)[5]; TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CRecharge, m_SaveData)[5];
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
@ -54,7 +54,8 @@ void CRecharge::__MAKE_VHOOK(Spawn)(void)
pev->solid = SOLID_BSP; pev->solid = SOLID_BSP;
pev->movetype = MOVETYPE_PUSH; 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); UTIL_SetSize(pev, pev->mins, pev->maxs);
SET_MODEL(ENT(pev), STRING(pev->model)); SET_MODEL(ENT(pev), STRING(pev->model));

View File

@ -24,9 +24,9 @@ TYPEDESCRIPTION CWreckage::m_SaveData[] =
#else #else
TYPEDESCRIPTION (*CCycler::pm_SaveData)[1]; TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CCycler, m_SaveData)[1];
TYPEDESCRIPTION (*CCyclerSprite::pm_SaveData)[3]; TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CCyclerSprite, m_SaveData)[3];
TYPEDESCRIPTION (*CWreckage::pm_SaveData)[1]; TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CWreckage, m_SaveData)[1];
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
@ -36,17 +36,7 @@ IMPLEMENT_SAVERESTORE(CCycler, CBaseToggle);
/* <cd01f> ../cstrike/dlls/h_cycler.cpp:70 */ /* <cd01f> ../cstrike/dlls/h_cycler.cpp:70 */
void CGenericCycler::__MAKE_VHOOK(Spawn)(void) void CGenericCycler::__MAKE_VHOOK(Spawn)(void)
{ {
// Vector(Vector::Spawn(// float X, GenericCyclerSpawn((char *)STRING(pev->model), Vector(-16, -16, 0), Vector(16, 16, 72));
// 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
} }
/* <cd2d2> ../cstrike/dlls/h_cycler.cpp: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 */ /* <cd16d> ../cstrike/dlls/h_cycler.cpp:86 */
void CCyclerProbe::__MAKE_VHOOK(Spawn)(void) void CCyclerProbe::__MAKE_VHOOK(Spawn)(void)
{ {
// Vector(Vector::Spawn(// float X, pev->origin = pev->origin + Vector(0, 0, 16);
// float Y, GenericCyclerSpawn("models/prdroid.mdl", Vector(-16, -16, -16), Vector(16, 16, 16));
// float Z); // 89
// operator+(const Vector *const this,
// const Vector &v); // 88
// Vector(Vector *const this,
// float X,
// float Y,
// float Z); // 89
} }
// Cycler member functions
/* <cd466> ../cstrike/dlls/h_cycler.cpp:96 */ /* <cd466> ../cstrike/dlls/h_cycler.cpp:96 */
void CCycler::GenericCyclerSpawn(char *szModel, Vector vecMin, Vector vecMax) void CCycler::GenericCyclerSpawn(char *szModel, Vector vecMin, Vector vecMax)
{ {
// GenericCyclerSpawn(CCycler *const this, if (!szModel || !*szModel)
// char *szModel, {
// Vector vecMin, ALERT(at_error, "cycler at %.0f %.0f %0.f missing modelname", pev->origin.x, pev->origin.y, pev->origin.z);
// Vector vecMax); // 96 REMOVE_ENTITY(ENT(pev));
// MAKE_STRING_CLASS(const char *str, return;
// entvars_t *pev); // 105 }
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 */ /* <ccc91> ../cstrike/dlls/h_cycler.cpp:115 */
void CCycler::__MAKE_VHOOK(Spawn)(void) 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 */ /* <ccd3e> ../cstrike/dlls/h_cycler.cpp:151 */
void CCycler::__MAKE_VHOOK(Think)(void) 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 */ /* <cc8bf> ../cstrike/dlls/h_cycler.cpp:176 */
void CCycler::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) 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 */ /* <ccf43> ../cstrike/dlls/h_cycler.cpp:189 */
int CCycler::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) int CCycler::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{ {
// TakeDamage(CCycler *const this, if (m_animate)
// entvars_t *pevInflictor, {
// entvars_t *pevAttacker, pev->sequence++;
// float flDamage, ResetSequenceInfo();
// int bitsDamageType); // 189
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 */ /* <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 */ /* <ccef7> ../cstrike/dlls/h_cycler.cpp:255 */
IMPLEMENT_SAVERESTORE(CCyclerSprite, CBaseEntity); 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 */ /* <cc943> ../cstrike/dlls/h_cycler.cpp:258 */
void CCyclerSprite::__MAKE_VHOOK(Spawn)(void) void CCyclerSprite::__MAKE_VHOOK(Spawn)(void)
{ {
// { pev->solid = SOLID_SLIDEBOX;
// int i; // 279 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 */ /* <cd0ef> ../cstrike/dlls/h_cycler.cpp:305 */
void CCyclerSprite::__MAKE_VHOOK(Think)(void) void CCyclerSprite::__MAKE_VHOOK(Think)(void)
{ {
// ShouldAnimate(CCyclerSprite *const this); // 307 if (ShouldAnimate())
// Animate(CCyclerSprite *const this, {
// float frames); // 308 Animate(pev->framerate * (gpGlobals->time - m_lastTime));
}
pev->nextthink = gpGlobals->time + 0.1f;
m_lastTime = gpGlobals->time;
} }
/* <cc9c1> ../cstrike/dlls/h_cycler.cpp:315 */ /* <cc9c1> ../cstrike/dlls/h_cycler.cpp:315 */
void CCyclerSprite::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) 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 */ /* <cd228> ../cstrike/dlls/h_cycler.cpp:322 */
int CCyclerSprite::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) int CCyclerSprite::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{ {
// Animate(CCyclerSprite *const this, if (m_maxFrame > 1.0)
// float frames); // 326 {
Animate(1.0);
}
return 1;
} }
/* <cd5c2> ../cstrike/dlls/h_cycler.cpp:331 */ /* <cd5c2> ../cstrike/dlls/h_cycler.cpp:331 */
void CCyclerSprite::Animate(float frames) void CCyclerSprite::Animate(float frames)
{ {
// Animate(CCyclerSprite *const this, pev->frame += frames;
// float frames); // 331
if (m_maxFrame > 0)
{
pev->frame = fmod((float_precision)pev->frame, (float_precision)m_maxFrame);
}
} }
/* <cd610> ../cstrike/dlls/h_cycler.cpp:358 */ /* <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 */ /* <ccbf6> ../cstrike/dlls/h_cycler.cpp:361 */
void CWeaponCycler::__MAKE_VHOOK(Spawn)(void) void CWeaponCycler::__MAKE_VHOOK(Spawn)(void)
{ {
// Vector(Vector::Spawn(// float X, pev->solid = SOLID_SLIDEBOX;
// float Y, pev->movetype = MOVETYPE_NONE;
// float Z); // 372
// Vector(Vector *const this, PRECACHE_MODEL((char *)STRING(pev->model));
// float X, SET_MODEL(ENT(pev), STRING(pev->model));
// float Y,
// float Z); // 372 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 */ /* <cca7c> ../cstrike/dlls/h_cycler.cpp:378 */
BOOL CWeaponCycler::__MAKE_VHOOK(Deploy)(void) 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 */ /* <ccaa3> ../cstrike/dlls/h_cycler.cpp:388 */
void CWeaponCycler::__MAKE_VHOOK(Holster)(int skiplocal) void CWeaponCycler::__MAKE_VHOOK(Holster)(int skiplocal)
{ {
m_pPlayer->m_flNextAttack = WEAPON_TIMEBASED + 0.5;
} }
/* <ccad8> ../cstrike/dlls/h_cycler.cpp:394 */ /* <ccad8> ../cstrike/dlls/h_cycler.cpp:394 */
void CWeaponCycler::__MAKE_VHOOK(PrimaryAttack)(void) void CWeaponCycler::__MAKE_VHOOK(PrimaryAttack)(void)
{ {
SendWeaponAnim(pev->sequence);
m_flNextPrimaryAttack = gpGlobals->time + 0.3;
} }
/* <ccb97> ../cstrike/dlls/h_cycler.cpp:403 */ /* <ccb97> ../cstrike/dlls/h_cycler.cpp:403 */
void CWeaponCycler::__MAKE_VHOOK(SecondaryAttack)(void) void CWeaponCycler::__MAKE_VHOOK(SecondaryAttack)(void)
{ {
// { float flFrameRate, flGroundSpeed;
// float flFrameRate; // 405
// float flGroundSpeed; // 405 pev->sequence = (pev->sequence + 1) % 8;
// void *pmodel; // 410
// } 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 */ /* <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 */ /* <ccaff> ../cstrike/dlls/h_cycler.cpp:448 */
void CWreckage::__MAKE_VHOOK(Spawn)(void) 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 */ /* <ccd07> ../cstrike/dlls/h_cycler.cpp:468 */
void CWreckage::__MAKE_VHOOK(Precache)(void) 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 */ /* <ccb26> ../cstrike/dlls/h_cycler.cpp:474 */
void CWreckage::__MAKE_VHOOK(Think)(void) void CWreckage::__MAKE_VHOOK(Think)(void)
{ {
// { StudioFrameAdvance();
// Vector VecSrc; // 492 pev->nextthink = gpGlobals->time + 0.2;
// MESSAGE_BEGIN(int msg_dest,
// int msg_type, if (pev->dmgtime)
// const float *pOrigin, {
// edict_t *ed); // 498 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 #ifdef HOOK_GAMEDLL

View File

@ -32,38 +32,121 @@
#pragma once #pragma once
#endif #endif
class CCyclerSprite: public CBaseEntity /* <cb93c> ../cstrike/dlls/h_cycler.cpp:35 */
class CCycler: public CBaseMonster
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void Restart(void); virtual int Save(CSave &save);
NOBODY virtual int Save(CSave &save); virtual int Restore(CRestore &restore);
NOBODY virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void) 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); 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); // 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 #ifdef HOOK_GAMEDLL
NOBODY void Spawn_(void); void Spawn_(void);
NOBODY void Restart_(void); int Save_(CSave &save);
NOBODY int Save_(CSave &save); int Restore_(CRestore &restore);
NOBODY int Restore_(CRestore &restore); int ObjectCaps_(void)
NOBODY int TakeDamage_(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType); {
NOBODY void Think_(void); return (CBaseEntity::ObjectCaps() | FCAP_IMPULSE_USE);
NOBODY void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); }
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 #endif // HOOK_GAMEDLL
public: 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) inline int ShouldAnimate(void)
{ {
return m_animate && m_maxFrame > 1.0; return (m_animate && m_maxFrame > 1.0);
} }
public: public:
@ -79,97 +162,32 @@ public:
};/* size: 188, cachelines: 3, members: 9 */ };/* 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 class CWeaponCycler: public CBasePlayerWeapon
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
virtual int GetItemInfo(ItemInfo *p) virtual int GetItemInfo(ItemInfo *p)
{ {
return 0; return 0;
} }
NOBODY virtual BOOL Deploy(void); virtual BOOL Deploy(void);
NOBODY virtual void Holster(int skiplocal = 0); virtual void Holster(int skiplocal = 0);
virtual int iItemSlot(void) virtual int iItemSlot(void)
{ {
return 1; return 1;
} }
NOBODY virtual void PrimaryAttack(void); virtual void PrimaryAttack(void);
NOBODY virtual void SecondaryAttack(void); virtual void SecondaryAttack(void);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
NOBODY void Spawn_(void); void Spawn_(void);
NOBODY BOOL Deploy_(void); BOOL Deploy_(void);
NOBODY void Holster_(int skiplocal = 0); void Holster_(int skiplocal = 0);
NOBODY void PrimaryAttack_(void); void PrimaryAttack_(void);
NOBODY void SecondaryAttack_(void); void SecondaryAttack_(void);
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
@ -179,21 +197,25 @@ public:
};/* size: 344, cachelines: 6, members: 3 */ };/* size: 344, cachelines: 6, members: 3 */
// Flaming Wreakage
/* <cbc13> ../cstrike/dlls/h_cycler.cpp:427 */
class CWreckage: public CBaseMonster class CWreckage: public CBaseMonster
{ {
NOBODY virtual void Spawn(void); public:
NOBODY virtual void Precache(void); virtual void Spawn(void);
NOBODY virtual int Save(CSave &save); virtual void Precache(void);
NOBODY virtual int Restore(CRestore &restore); virtual int Save(CSave &save);
NOBODY virtual void Think(void); virtual int Restore(CRestore &restore);
virtual void Think(void);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
NOBODY void Spawn_(void); void Spawn_(void);
NOBODY void Precache_(void); void Precache_(void);
NOBODY int Save_(CSave &save); int Save_(CSave &save);
NOBODY int Restore_(CRestore &restore); int Restore_(CRestore &restore);
NOBODY void Think_(void); void Think_(void);
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
@ -204,4 +226,11 @@ public:
};/* size: 408, cachelines: 7, members: 3 */ };/* 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 #endif // H_CYCLER_H

View File

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

View File

@ -16,7 +16,7 @@ TYPEDESCRIPTION CWallHealth::m_SaveData[] =
#else #else
TYPEDESCRIPTION (*CWallHealth::pm_SaveData)[5]; TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CWallHealth, m_SaveData)[5];
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL

View File

@ -63,7 +63,7 @@ public:
{ {
return ObjectCaps_(); 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 #ifdef HOOK_GAMEDLL
@ -95,9 +95,4 @@ public:
};/* size: 332, cachelines: 6, members: 7 */ };/* size: 332, cachelines: 6, members: 7 */
#endif // HEALTKIT_H #endif // HEALTKIT_H

View File

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

View File

@ -309,9 +309,7 @@ public:
bool IsDoneHolding(void); bool IsDoneHolding(void);
private: private:
enum { MAX_SEQUENCES = 8 }; enum { MAX_SEQUENCES = 8 };
struct SeqInfo m_sequence[ MAX_SEQUENCES ]; struct SeqInfo m_sequence[ MAX_SEQUENCES ];
int m_sequenceCount; int m_sequenceCount;
int m_currentSequence; int m_currentSequence;

View File

@ -179,7 +179,7 @@ BOOL CItemBattery::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer)
char szcharge[64]; char szcharge[64];
pPlayer->pev->armorvalue += gSkillData.batteryCapacity; 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); EMIT_SOUND(pPlayer->edict(), CHAN_ITEM, "items/gunpickup2.wav", VOL_NORM, ATTN_NORM);

View File

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

View File

@ -13,7 +13,7 @@ TYPEDESCRIPTION CLight::m_SaveData[] =
#else #else
TYPEDESCRIPTION (*CLight::pm_SaveData)[2]; TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CLight, m_SaveData)[2];
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL

View File

@ -79,6 +79,7 @@ public:
void KeyValue_(KeyValueData *pkvd); void KeyValue_(KeyValueData *pkvd);
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
};/* size: 164, cachelines: 3, members: 1 */ };/* size: 164, cachelines: 3, members: 1 */
#endif // LIGHT_H #endif // LIGHT_H

View File

@ -10,6 +10,8 @@ TYPEDESCRIPTION CRuleEntity::m_SaveData[] =
DEFINE_FIELD(CRuleEntity, m_iszMaster, FIELD_STRING), 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[] = TYPEDESCRIPTION CGameText::m_SaveData[] =
{ {
DEFINE_ARRAY(CGameText, m_textParms, FIELD_CHARACTER, sizeof(hudtextparms_t)), DEFINE_ARRAY(CGameText, m_textParms, FIELD_CHARACTER, sizeof(hudtextparms_t)),
@ -25,9 +27,9 @@ TYPEDESCRIPTION CGamePlayerZone::m_SaveData[] =
#else #else
TYPEDESCRIPTION (*CRuleEntity::pm_SaveData)[1]; TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CRuleEntity, m_SaveData)[1];
TYPEDESCRIPTION (*CGameText::pm_SaveData)[1]; TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CGameText, m_SaveData)[1];
TYPEDESCRIPTION (*CGamePlayerZone::pm_SaveData)[4]; TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CGamePlayerZone, m_SaveData)[4];
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
@ -35,181 +37,297 @@ TYPEDESCRIPTION (*CGamePlayerZone::pm_SaveData)[4];
IMPLEMENT_SAVERESTORE(CRuleEntity, CBaseEntity); IMPLEMENT_SAVERESTORE(CRuleEntity, CBaseEntity);
/* <eed18> ../cstrike/dlls/maprules.cpp:60 */ /* <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 */ /* <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, if (FStrEq(pkvd->szKeyName, "master"))
// const char *sz2); // 70 {
// KeyValue(CBaseEntity *const this, SetMaster(ALLOC_STRING(pkvd->szValue));
// KeyValueData *pkvd); // 76 pkvd->fHandled = TRUE;
// KeyValue(CRuleEntity *const this, }
// KeyValueData *pkvd); // 68 else
CBaseEntity::KeyValue(pkvd);
} }
/* <f0955> ../cstrike/dlls/maprules.cpp:79 */ /* <f0955> ../cstrike/dlls/maprules.cpp:79 */
NOBODY BOOL CRuleEntity::CanFireForActivator(CBaseEntity *pActivator) BOOL CRuleEntity::CanFireForActivator(CBaseEntity *pActivator)
{ {
// CanFireForActivator(CRuleEntity *const this, if (!FStringNull(m_iszMaster))
// class CBaseEntity *pActivator); // 79 {
if (UTIL_IsMasterTriggered(m_iszMaster, pActivator))
return TRUE;
else
return FALSE;
}
return TRUE;
} }
/* <eed39> ../cstrike/dlls/maprules.cpp:101 */ /* <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 */ /* <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 */ /* <f099d> ../cstrike/dlls/maprules.cpp:151 */
LINK_ENTITY_TO_CLASS(game_score, CGameScore); LINK_ENTITY_TO_CLASS(game_score, CGameScore);
/* <eedb1> ../cstrike/dlls/maprules.cpp:154 */ /* <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 */ /* <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, if (FStrEq(pkvd->szKeyName, "points"))
// const char *sz2); // 162 {
// KeyValue(CRuleEntity *const this, SetPoints(Q_atoi(pkvd->szValue));
// KeyValueData *pkvd); // 168 pkvd->fHandled = TRUE;
// KeyValue(CGameScore *const this, }
// KeyValueData *pkvd); // 160 else
CRulePointEntity::KeyValue(pkvd);
} }
/* <ef54c> ../cstrike/dlls/maprules.cpp:173 */ /* <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, if (!CanFireForActivator(pActivator))
// class CBaseEntity *pActivator); // 175 return;
// Use(CGameScore *const this,
// class CBaseEntity *pActivator, // Only players can use this
// class CBaseEntity *pCaller, if (pActivator->IsPlayer())
// USE_TYPE useType, {
// float value); // 173 if (AwardToTeam())
// AwardToTeam(CGameScore *const this); // 181 {
// AllowNegativeScore(CGameScore *const this); // 187 pActivator->AddPointsToTeam(Points(), AllowNegativeScore());
// Points(CGameScore *const this); // 187 }
else
{
pActivator->AddPoints(Points(), AllowNegativeScore());
}
}
} }
/* <f0a68> ../cstrike/dlls/maprules.cpp:202 */ /* <f0a68> ../cstrike/dlls/maprules.cpp:202 */
LINK_ENTITY_TO_CLASS(game_end, CGameEnd); 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 */ /* <f0b33> ../cstrike/dlls/maprules.cpp:242 */
LINK_ENTITY_TO_CLASS(game_text, CGameText); 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 */ /* <ef252> ../cstrike/dlls/maprules.cpp:251 */
IMPLEMENT_SAVERESTORE(CGameText, CRulePointEntity); IMPLEMENT_SAVERESTORE(CGameText, CRulePointEntity);
/* <f00dd> ../cstrike/dlls/maprules.cpp:254 */ /* <f00dd> ../cstrike/dlls/maprules.cpp:254 */
NOBODY void CGameText::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CGameText::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{ {
// { if (FStrEq(pkvd->szKeyName, "channel"))
// int color; // 278 {
// } m_textParms.channel = Q_atoi(pkvd->szValue);
// { pkvd->fHandled = TRUE;
// int color; // 288 }
// } else if (FStrEq(pkvd->szKeyName, "x"))
// FStrEq(const char *sz1, {
// const char *sz2); // 256 m_textParms.x = Q_atof(pkvd->szValue);
// FStrEq(const char *sz1, pkvd->fHandled = TRUE;
// const char *sz2); // 261 }
// atof(const char *__nptr); // 263 else if (FStrEq(pkvd->szKeyName, "y"))
// atoi(const char *__nptr); // 258 {
// KeyValue(CGameText *const this, m_textParms.y = Q_atof(pkvd->szValue);
// KeyValueData *pkvd); // 254 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 */ /* <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, if (!CanFireForActivator(pActivator))
// class CBaseEntity *pActivator); // 323 return;
// MessageGet(CGameText *const this); // 328
// Use(CGameText *const this, if (MessageToAll())
// class CBaseEntity *pActivator, {
// class CBaseEntity *pCaller, UTIL_HudMessageAll(m_textParms, MessageGet());
// USE_TYPE useType, }
// float value); // 321 else
{
if (pActivator->IsNetClient())
{
UTIL_HudMessage(pActivator, m_textParms, MessageGet());
}
}
} }
/* <f0bfe> ../cstrike/dlls/maprules.cpp:371 */ /* <f0bfe> ../cstrike/dlls/maprules.cpp:371 */
LINK_ENTITY_TO_CLASS(game_team_master, CGameTeamMaster); LINK_ENTITY_TO_CLASS(game_team_master, CGameTeamMaster);
/* <eff4f> ../cstrike/dlls/maprules.cpp:373 */ /* <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, if (FStrEq(pkvd->szKeyName, "teamindex"))
// const char *sz2); // 375 {
// FStrEq(const char *sz1, m_teamIndex = Q_atoi(pkvd->szValue);
// const char *sz2); // 380 pkvd->fHandled = TRUE;
// KeyValue(CRuleEntity *const this, }
// KeyValueData *pkvd); // 398 else if (FStrEq(pkvd->szKeyName, "triggerstate"))
// { {
// int type; // 382 int type = Q_atoi(pkvd->szValue);
// atoi(const char *__nptr); // 382
// } switch(type)
// KeyValue(CGameTeamMaster *const this, {
// KeyValueData *pkvd); // 373 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 */ /* <f0474> ../cstrike/dlls/maprules.cpp:402 */
void CGameTeamMaster::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CGameTeamMaster::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
// CanFireForActivator(CRuleEntity *const this, if (!CanFireForActivator(pActivator))
// class CBaseEntity *pActivator); // 404 return;
// TeamMatch(CGameTeamMaster *const this,
// class CBaseEntity *pActivator); // 420 if (useType == USE_SET)
// Use(CGameTeamMaster *const this, {
// class CBaseEntity *pActivator, if (value < 0)
// class CBaseEntity *pCaller, {
// USE_TYPE useType, m_teamIndex = -1;
// float value); // 402 }
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 */ /* <ef2e0> ../cstrike/dlls/maprules.cpp:429 */
BOOL CGameTeamMaster::__MAKE_VHOOK(IsTriggered)(CBaseEntity *pActivator) BOOL CGameTeamMaster::__MAKE_VHOOK(IsTriggered)(CBaseEntity *pActivator)
{ {
// TeamMatch(CGameTeamMaster *const this, return TeamMatch(pActivator);
// class CBaseEntity *pActivator); // 431
} }
/* <eeeaf> ../cstrike/dlls/maprules.cpp:435 */ /* <eeeaf> ../cstrike/dlls/maprules.cpp:435 */
const char *CGameTeamMaster::__MAKE_VHOOK(TeamID)(void) 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 */ /* <f0ccd> ../cstrike/dlls/maprules.cpp:444 */
BOOL CGameTeamMaster::TeamMatch(CBaseEntity *pActivator) BOOL CGameTeamMaster::TeamMatch(CBaseEntity *pActivator)
{ {
// TeamMatch(CGameTeamMaster *const this, if (m_teamIndex < 0 && AnyTeam())
// class CBaseEntity *pActivator); // 444 return TRUE;
// AnyTeam(CGameTeamMaster *const this); // 446
if (!pActivator)
return FALSE;
return UTIL_TeamsMatch(pActivator->TeamID(), TeamID());
} }
/* <f0d2e> ../cstrike/dlls/maprules.cpp:474 */ /* <f0d2e> ../cstrike/dlls/maprules.cpp:474 */
@ -218,13 +336,22 @@ LINK_ENTITY_TO_CLASS(game_team_set, CGameTeamSet);
/* <ef735> ../cstrike/dlls/maprules.cpp:477 */ /* <ef735> ../cstrike/dlls/maprules.cpp:477 */
void CGameTeamSet::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CGameTeamSet::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
// CanFireForActivator(CRuleEntity *const this, if (!CanFireForActivator(pActivator))
// class CBaseEntity *pActivator); // 479 return;
// Use(CGameTeamSet *const this,
// class CBaseEntity *pActivator, if (ShouldClearTeam())
// class CBaseEntity *pCaller, {
// USE_TYPE useType, SUB_UseTargets(pActivator, USE_SET, -1);
// float value); // 477 }
else
{
SUB_UseTargets(pActivator, USE_SET, 0);
}
if (RemoveOnFire())
{
UTIL_Remove(this);
}
} }
/* <f0dfd> ../cstrike/dlls/maprules.cpp:519 */ /* <f0dfd> ../cstrike/dlls/maprules.cpp:519 */
@ -236,36 +363,87 @@ IMPLEMENT_SAVERESTORE(CGamePlayerZone, CRuleBrushEntity);
/* <efdbc> ../cstrike/dlls/maprules.cpp:530 */ /* <efdbc> ../cstrike/dlls/maprules.cpp:530 */
void CGamePlayerZone::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CGamePlayerZone::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{ {
// FStrEq(const char *sz1, if (FStrEq(pkvd->szKeyName, "intarget"))
// const char *sz2); // 532 {
// FStrEq(const char *sz1, m_iszInTarget = ALLOC_STRING(pkvd->szValue);
// const char *sz2); // 537 pkvd->fHandled = TRUE;
// KeyValue(CGamePlayerZone *const this, }
// KeyValueData *pkvd); // 530 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 */ /* <ef36e> ../cstrike/dlls/maprules.cpp:556 */
void CGamePlayerZone::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CGamePlayerZone::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
// { int playersInCount = 0;
// int playersInCount; // 558 int playersOutCount = 0;
// int playersOutCount; // 559
// class CBaseEntity *pPlayer; // 564 if (!CanFireForActivator(pActivator))
// { return;
// int i; // 566
// { CBaseEntity *pPlayer = NULL;
// TraceResult trace; // 571
// int hullNumber; // 572 for (int i = 1; i <= gpGlobals->maxClients; i++)
// } {
// } pPlayer = reinterpret_cast<CBasePlayer *>(UTIL_PlayerByIndex(i));
// CanFireForActivator(CRuleEntity *const this,
// class CBaseEntity *pActivator); // 561 if (pPlayer)
// } {
// Use(CGamePlayerZone *const this, TraceResult trace;
// class CBaseEntity *pActivator, int hullNumber;
// class CBaseEntity *pCaller,
// USE_TYPE useType, hullNumber = human_hull;
// float value); // 556 if (pPlayer->pev->flags & FL_DUCKING)
{
hullNumber = head_hull;
}
UTIL_TraceModel(pPlayer->pev->origin, pPlayer->pev->origin, hullNumber, edict(), &trace);
if (trace.fStartSolid)
{
playersInCount++;
if (!FStringNull(m_iszInTarget))
{
FireTargets(STRING(m_iszInTarget), pPlayer, pActivator, useType, value);
}
}
else
{
playersOutCount++;
if (!FStringNull(m_iszOutTarget))
{
FireTargets(STRING(m_iszOutTarget), pPlayer, pActivator, useType, value);
}
}
}
}
if (!FStringNull(m_iszInCount))
{
FireTargets(STRING(m_iszInCount), pActivator, this, USE_SET, playersInCount);
}
if (!FStringNull(m_iszOutCount))
{
FireTargets(STRING(m_iszOutCount), pActivator, this, USE_SET, playersOutCount);
}
} }
/* <f0ecc> ../cstrike/dlls/maprules.cpp:628 */ /* <f0ecc> ../cstrike/dlls/maprules.cpp:628 */
@ -274,13 +452,23 @@ LINK_ENTITY_TO_CLASS(game_player_hurt, CGamePlayerHurt);
/* <ef815> ../cstrike/dlls/maprules.cpp:631 */ /* <ef815> ../cstrike/dlls/maprules.cpp:631 */
void CGamePlayerHurt::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CGamePlayerHurt::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
// CanFireForActivator(CRuleEntity *const this, if (!CanFireForActivator(pActivator))
// class CBaseEntity *pActivator); // 633 return;
// Use(CGamePlayerHurt *const this,
// class CBaseEntity *pActivator, if (pActivator->IsPlayer())
// class CBaseEntity *pCaller, {
// USE_TYPE useType, if (pev->dmg < 0)
// float value); // 631 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 */ /* <f0f9b> ../cstrike/dlls/maprules.cpp:684 */
@ -289,22 +477,47 @@ LINK_ENTITY_TO_CLASS(game_counter, CGameCounter);
/* <eee2d> ../cstrike/dlls/maprules.cpp:686 */ /* <eee2d> ../cstrike/dlls/maprules.cpp:686 */
void CGameCounter::__MAKE_VHOOK(Spawn)(void) void CGameCounter::__MAKE_VHOOK(Spawn)(void)
{ {
// CountValue(CGameCounter *const this); // 689 // Save off the initial count
// SetInitialValue(CGameCounter *const this, SetInitialValue(CountValue());
// int value); // 689 CRulePointEntity::Spawn();
// Spawn(CRulePointEntity *const this); // 690
} }
/* <ef8ef> ../cstrike/dlls/maprules.cpp:694 */ /* <ef8ef> ../cstrike/dlls/maprules.cpp:694 */
void CGameCounter::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CGameCounter::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
// CanFireForActivator(CRuleEntity *const this, if (!CanFireForActivator(pActivator))
// class CBaseEntity *pActivator); // 696 return;
// Use(CGameCounter *const this,
// class CBaseEntity *pActivator, switch (useType)
// class CBaseEntity *pCaller, {
// USE_TYPE useType, case USE_ON:
// float value); // 694 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 */ /* <f106a> ../cstrike/dlls/maprules.cpp:747 */
@ -313,13 +526,15 @@ LINK_ENTITY_TO_CLASS(game_counter_set, CGameCounterSet);
/* <efa65> ../cstrike/dlls/maprules.cpp:750 */ /* <efa65> ../cstrike/dlls/maprules.cpp:750 */
void CGameCounterSet::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CGameCounterSet::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
// CanFireForActivator(CRuleEntity *const this, if (!CanFireForActivator(pActivator))
// class CBaseEntity *pActivator); // 752 return;
// Use(CGameCounterSet *const this,
// class CBaseEntity *pActivator, SUB_UseTargets(pActivator, USE_SET, pev->frags);
// class CBaseEntity *pCaller,
// USE_TYPE useType, if (RemoveOnFire())
// float value); // 750 {
UTIL_Remove(this);
}
} }
/* <f1139> ../cstrike/dlls/maprules.cpp:788 */ /* <f1139> ../cstrike/dlls/maprules.cpp:788 */
@ -328,46 +543,69 @@ LINK_ENTITY_TO_CLASS(game_player_equip, CGamePlayerEquip);
/* <ed81f> ../cstrike/dlls/maprules.cpp:791 */ /* <ed81f> ../cstrike/dlls/maprules.cpp:791 */
void CGamePlayerEquip::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CGamePlayerEquip::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{ {
// { CRulePointEntity::KeyValue(pkvd);
// int i; // 797
// { if (!pkvd->fHandled)
// char tmp; // 801 {
// } for (int i = 0; i < MAX_EQUIP; i++)
// } {
// KeyValue(CRuleEntity *const this, if (FStringNull(m_weaponNames[i]))
// KeyValueData *pkvd); // 793 {
// KeyValue(CGamePlayerEquip *const this, char tmp[128];
// KeyValueData *pkvd); // 791 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 */ /* <f06ad> ../cstrike/dlls/maprules.cpp:816 */
void CGamePlayerEquip::__MAKE_VHOOK(Touch)(CBaseEntity *pOther) void CGamePlayerEquip::__MAKE_VHOOK(Touch)(CBaseEntity *pOther)
{ {
// CanFireForActivator(CRuleEntity *const this, if (!CanFireForActivator(pOther))
// class CBaseEntity *pActivator); // 818 return;
// Touch(CGamePlayerEquip *const this,
// class CBaseEntity *pOther); // 816 if (UseOnly())
return;
EquipPlayer(pOther);
} }
/* <f1208> ../cstrike/dlls/maprules.cpp:827 */ /* <f1208> ../cstrike/dlls/maprules.cpp:827 */
void CGamePlayerEquip::EquipPlayer(CBaseEntity *pEntity) void CGamePlayerEquip::EquipPlayer(CBaseEntity *pEntity)
{ {
// { CBasePlayer *pPlayer = NULL;
// class CBasePlayer *pPlayer; // 829
// { if (pEntity->IsPlayer())
// int i; // 839 {
// { pPlayer = reinterpret_cast<CBasePlayer *>(pEntity);
// int j; // 843 }
// }
// } 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 */ /* <f05f3> ../cstrike/dlls/maprules.cpp:851 */
void CGamePlayerEquip::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CGamePlayerEquip::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
// EquipPlayer(CGamePlayerEquip *const this, EquipPlayer(pActivator);
// class CBaseEntity *pEntity); // 853
} }
/* <f1268> ../cstrike/dlls/maprules.cpp:881 */ /* <f1268> ../cstrike/dlls/maprules.cpp:881 */
@ -376,29 +614,38 @@ LINK_ENTITY_TO_CLASS(game_player_team, CGamePlayerTeam);
/* <f1337> ../cstrike/dlls/maprules.cpp:884 */ /* <f1337> ../cstrike/dlls/maprules.cpp:884 */
const char *CGamePlayerTeam::TargetTeamName(const char *pszTargetName) const char *CGamePlayerTeam::TargetTeamName(const char *pszTargetName)
{ {
// { CBaseEntity *pTeamEntity = NULL;
// class CBaseEntity *pTeamEntity; // 886
// FClassnameIs(entvars_t *pev, while ((pTeamEntity = UTIL_FindEntityByTargetname(pTeamEntity, pszTargetName)) != NULL)
// const char *szClassname); // 890 {
// } if (FClassnameIs(pTeamEntity->pev, "game_team_master"))
return pTeamEntity->TeamID();
}
return NULL;
} }
/* <f07df> ../cstrike/dlls/maprules.cpp:898 */ /* <f07df> ../cstrike/dlls/maprules.cpp:898 */
void CGamePlayerTeam::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void CGamePlayerTeam::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{ {
// { if (!CanFireForActivator(pActivator))
// const char *pszTargetTeam; // 905 return;
// {
// class CBasePlayer *pPlayer; // 908 if (pActivator->IsPlayer())
// } {
// } const char *pszTargetTeam = TargetTeamName(STRING(pev->target));
// CanFireForActivator(CRuleEntity *const this,
// class CBaseEntity *pActivator); // 900 if (pszTargetTeam != NULL)
// Use(CGamePlayerTeam *const this, {
// class CBaseEntity *pActivator, CBasePlayer *pPlayer = reinterpret_cast<CBasePlayer *>(pActivator);
// class CBaseEntity *pCaller, g_pGameRules->ChangePlayerTeam(pPlayer, pszTargetTeam, ShouldKillPlayer(), ShouldGibPlayer());
// USE_TYPE useType, }
// float value); // 898 }
if (RemoveOnFire())
{
UTIL_Remove(this);
}
} }
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL

View File

@ -61,10 +61,10 @@
class CRuleEntity: public CBaseEntity class CRuleEntity: public CBaseEntity
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -90,11 +90,13 @@ private:
};/* size: 156, cachelines: 3, members: 3 */ };/* size: 156, cachelines: 3, members: 3 */
// CRulePointEntity -- base class for all rule "point" entities (not brushes)
/* <ee010> ../cstrike/dlls/maprules.cpp:95 */ /* <ee010> ../cstrike/dlls/maprules.cpp:95 */
class CRulePointEntity: public CRuleEntity class CRulePointEntity: public CRuleEntity
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -104,11 +106,14 @@ public:
};/* size: 156, cachelines: 3, members: 1 */ };/* 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 */ /* <ee209> ../cstrike/dlls/maprules.cpp:112 */
class CRuleBrushEntity: public CRuleEntity class CRuleBrushEntity: public CRuleEntity
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -118,13 +123,18 @@ public:
};/* size: 156, cachelines: 3, members: 1 */ };/* 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 */ /* <ee086> ../cstrike/dlls/maprules.cpp:135 */
class CGameScore: public CRulePointEntity class CGameScore: public CRulePointEntity
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
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 #ifdef HOOK_GAMEDLL
@ -135,30 +145,32 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
NOBODY inline int Points(void) inline int Points(void)
{ {
return (int)(pev->frags); return (int)(pev->frags);
} }
NOBODY inline BOOL AllowNegativeScore(void) inline BOOL AllowNegativeScore(void)
{ {
return pev->spawnflags & SF_SCORE_NEGATIVE; return pev->spawnflags & SF_SCORE_NEGATIVE;
} }
NOBODY inline BOOL AwardToTeam(void) inline BOOL AwardToTeam(void)
{ {
return pev->spawnflags & SF_SCORE_TEAM; return pev->spawnflags & SF_SCORE_TEAM;
} }
NOBODY inline void SetPoints(int points) inline void SetPoints(int points)
{ {
pev->frags = points; pev->frags = points;
} }
};/* size: 156, cachelines: 3, members: 1 */ };/* size: 156, cachelines: 3, members: 1 */
// CGameEnd / game_end -- Ends the game in MP
/* <ee0d3> ../cstrike/dlls/maprules.cpp:195 */ /* <ee0d3> ../cstrike/dlls/maprules.cpp:195 */
class CGameEnd: public CRulePointEntity class CGameEnd: public CRulePointEntity
{ {
public: 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 #ifdef HOOK_GAMEDLL
@ -168,14 +180,17 @@ public:
};/* size: 156, cachelines: 3, members: 1 */ };/* 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 */ /* <ee120> ../cstrike/dlls/maprules.cpp:223 */
class CGameText: public CRulePointEntity class CGameText: public CRulePointEntity
{ {
public: public:
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
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 #ifdef HOOK_GAMEDLL
@ -187,15 +202,15 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
NOBODY inline BOOL MessageToAll(void) inline BOOL MessageToAll(void)
{ {
return (pev->spawnflags & SF_ENVTEXT_ALLPLAYERS) == SF_ENVTEXT_ALLPLAYERS; 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); pev->message = ALLOC_STRING(pMessage);
} }
NOBODY inline const char *MessageGet(void) inline const char *MessageGet(void)
{ {
return STRING(pev->message); return STRING(pev->message);
} }
@ -208,25 +223,32 @@ private:
};/* size: 196, cachelines: 4, members: 3 */ };/* 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 */ /* <ee16d> ../cstrike/dlls/maprules.cpp:352 */
class CGameTeamMaster: public CRulePointEntity class CGameTeamMaster: public CRulePointEntity
{ {
public: public:
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int ObjectCaps(void) virtual int ObjectCaps(void)
{ {
return ObjectCaps_(); return ObjectCaps_();
} }
NOBODY virtual BOOL IsTriggered(CBaseEntity *pActivator); virtual BOOL IsTriggered(CBaseEntity *pActivator);
NOBODY virtual const char *TeamID(void); virtual const char *TeamID(void);
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 #ifdef HOOK_GAMEDLL
void KeyValue_(KeyValueData *pkvd); void KeyValue_(KeyValueData *pkvd);
int ObjectCaps_(void) int ObjectCaps_(void)
{ {
return CRulePointEntity::ObjectCaps() | FCAP_MASTER; return (CRulePointEntity::ObjectCaps() | FCAP_MASTER);
} }
BOOL IsTriggered_(CBaseEntity *pActivator); BOOL IsTriggered_(CBaseEntity *pActivator);
const char *TeamID_(void); const char *TeamID_(void);
@ -253,11 +275,15 @@ public:
};/* size: 164, cachelines: 3, members: 3 */ };/* 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 */ /* <ee1bb> ../cstrike/dlls/maprules.cpp:464 */
class CGameTeamSet: public CRulePointEntity class CGameTeamSet: public CRulePointEntity
{ {
public: 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 #ifdef HOOK_GAMEDLL
@ -265,6 +291,7 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public:
inline BOOL RemoveOnFire(void) inline BOOL RemoveOnFire(void)
{ {
return (pev->spawnflags & SF_TEAMSET_FIREONCE) == SF_TEAMSET_FIREONCE; return (pev->spawnflags & SF_TEAMSET_FIREONCE) == SF_TEAMSET_FIREONCE;
@ -276,14 +303,17 @@ public:
};/* size: 156, cachelines: 3, members: 1 */ };/* 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 */ /* <ee229> ../cstrike/dlls/maprules.cpp:502 */
class CGamePlayerZone: public CRuleBrushEntity class CGamePlayerZone: public CRuleBrushEntity
{ {
public: public:
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
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 #ifdef HOOK_GAMEDLL
@ -305,11 +335,14 @@ private:
};/* size: 172, cachelines: 3, members: 6 */ };/* 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 */ /* <ee277> ../cstrike/dlls/maprules.cpp:619 */
class CGamePlayerHurt: public CRulePointEntity class CGamePlayerHurt: public CRulePointEntity
{ {
public: 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 #ifdef HOOK_GAMEDLL
@ -325,12 +358,16 @@ public:
};/* size: 156, cachelines: 3, members: 1 */ };/* 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 */ /* <ee2c5> ../cstrike/dlls/maprules.cpp:662 */
class CGameCounter: public CRulePointEntity class CGameCounter: public CRulePointEntity
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
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 #ifdef HOOK_GAMEDLL
@ -385,11 +422,14 @@ private:
};/* size: 156, cachelines: 3, members: 1 */ };/* size: 156, cachelines: 3, members: 1 */
// CGameCounterSet / game_counter_set -- Sets the counter's value
// Flag: Fire once
/* <ee313> ../cstrike/dlls/maprules.cpp:738 */ /* <ee313> ../cstrike/dlls/maprules.cpp:738 */
class CGameCounterSet: public CRulePointEntity class CGameCounterSet: public CRulePointEntity
{ {
public: 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 #ifdef HOOK_GAMEDLL
@ -405,13 +445,16 @@ public:
};/* size: 156, cachelines: 3, members: 1 */ };/* size: 156, cachelines: 3, members: 1 */
// CGamePlayerEquip / game_playerequip -- Sets the default player equipment
// Flag: USE Only
/* <ee361> ../cstrike/dlls/maprules.cpp:771 */ /* <ee361> ../cstrike/dlls/maprules.cpp:771 */
class CGamePlayerEquip: public CRulePointEntity class CGamePlayerEquip: public CRulePointEntity
{ {
public: public:
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual void Touch(CBaseEntity *pOther); virtual void Touch(CBaseEntity *pOther);
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 #ifdef HOOK_GAMEDLL
@ -436,11 +479,16 @@ public:
};/* size: 412, cachelines: 7, members: 3 */ };/* 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 */ /* <ee3af> ../cstrike/dlls/maprules.cpp:867 */
class CGamePlayerTeam: public CRulePointEntity class CGamePlayerTeam: public CRulePointEntity
{ {
public: 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 #ifdef HOOK_GAMEDLL
@ -465,4 +513,17 @@ private:
};/* size: 156, cachelines: 3, members: 1 */ };/* 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 #endif // MAPRULES_H

View File

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

View File

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

View File

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

View File

@ -63,12 +63,14 @@ void CBaseMonster::MakeIdealYaw(Vector vecTarget)
} }
/* <fc5a6> ../cstrike/dlls/mpstubb.cpp:49 */ /* <fc5a6> ../cstrike/dlls/mpstubb.cpp:49 */
NOBODY void CBaseMonster::CorpseFallThink(void) NOXREF void CBaseMonster::CorpseFallThink(void)
{ {
if (pev->flags & FL_ONGROUND) if (pev->flags & FL_ONGROUND)
{ {
SetThink(NULL); SetThink(NULL);
SetSequenceBox(); SetSequenceBox();
// link into world.
UTIL_SetOrigin(pev, pev->origin); UTIL_SetOrigin(pev, pev->origin);
} }
else else
@ -117,50 +119,165 @@ void CBaseMonster::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
} }
/* <fc07d> ../cstrike/dlls/mpstubb.cpp:104 */ /* <fc07d> ../cstrike/dlls/mpstubb.cpp:104 */
NOBODY int CBaseMonster::__MAKE_VHOOK(IRelationship)(CBaseEntity *pTarget) int CBaseMonster::__MAKE_VHOOK(IRelationship)(CBaseEntity *pTarget)
{ {
// { static int const iEnemy[14][14] =
// int const iEnemy; // 106 {
// } // 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 */ /* <fc0e4> ../cstrike/dlls/mpstubb.cpp:140 */
NOBODY void CBaseMonster::__MAKE_VHOOK(Look)(int iDistance) void CBaseMonster::__MAKE_VHOOK(Look)(int iDistance)
{ {
// { int iSighted = 0;
// int iSighted; // 142
// class CBaseEntity *pSightEnt; // 149 // DON'T let visibility information from last frame sit around!
// class CBaseEntity *pList; // 151 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);
// Vector delta; // 153
// int count; // 156 m_pLink = NULL;
// ClearConditions(CBaseMonster *const this,
// int iConditions); // 145 // the current visible entity that we're dealing with
// operator+(const Vector *const this, CBaseEntity *pSightEnt = NULL;
// const Vector &v); // 156 CBaseEntity *pList[100];
// operator-(const Vector *const this,
// const Vector &v); // 156 Vector delta = Vector(iDistance, iDistance, iDistance);
// {
// int i; // 157 // 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));
// SetConditions(CBaseMonster *const this, for (int i = 0; i < count; i++)
// int iConditions); // 207 {
// } 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;
} }
/* <fc317> ../cstrike/dlls/mpstubb.cpp:220 */ pSightEnt->m_pLink = m_pLink;
NOBODY CBaseEntity *CBaseMonster::__MAKE_VHOOK(BestVisibleEnemy)(void) 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.
// class CBaseEntity *pReturn; // 222 iSighted |= bits_COND_SEE_ENEMY;
// class CBaseEntity *pNextEnt; // 223 }
// int iNearest; // 224
// int iDist; // 225 // don't add the Enemy's relationship to the conditions. We only want to worry about conditions when
// int iBestRelationship; // 226 // we see monsters other than the Enemy.
// operator-(const Vector *const this, switch (IRelationship (pSightEnt))
// const Vector &v); // 243 {
// Length(const Vector *const this); // 243 case R_NM:
// operator-(const Vector *const this, iSighted |= bits_COND_SEE_NEMESIS;
// const Vector &v); // 251 break;
// Length(const Vector *const this); // 251 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 */
CBaseEntity *CBaseMonster::__MAKE_VHOOK(BestVisibleEnemy)(void)
{
CBaseEntity *pReturn;
CBaseEntity *pNextEnt;
int iNearest;
int iDist;
int iBestRelationship;
// so first visible entity will become the closest.
iNearest = 8192;
pNextEnt = m_pLink;
pReturn = NULL;
iBestRelationship = R_NO;
while (pNextEnt != NULL)
{
if (pNextEnt->IsAlive())
{
if (IRelationship(pNextEnt) > iBestRelationship)
{
// this entity is disliked MORE than the entity that we
// currently think is the best visible enemy. No need to do
// a distance check, just get mad at this one for now.
iBestRelationship = IRelationship(pNextEnt);
iNearest = (pNextEnt->pev->origin - pev->origin).Length();
pReturn = pNextEnt;
}
else if (IRelationship(pNextEnt) == iBestRelationship)
{
// this entity is disliked just as much as the entity that
// we currently think is the best visible enemy, so we only
// get mad at it if it is closer.
iDist = (pNextEnt->pev->origin - pev->origin).Length();
if (iDist <= iNearest)
{
iNearest = iDist;
iBestRelationship = IRelationship(pNextEnt);
pReturn = pNextEnt;
}
}
}
pNextEnt = pNextEnt->m_pLink;
}
return pReturn;
} }

View File

@ -4065,16 +4065,16 @@ int ReloadMapCycleFile(char *filename, mapcycle_t *cycle)
if (s && s[0] != '\0') if (s && s[0] != '\0')
{ {
item->minplayers = Q_atoi(s); item->minplayers = Q_atoi(s);
item->minplayers = _max(item->minplayers, 0); item->minplayers = Q_max(item->minplayers, 0);
item->minplayers = _min(item->minplayers, gpGlobals->maxClients); item->minplayers = Q_min(item->minplayers, gpGlobals->maxClients);
} }
s = GET_KEY_VALUE(szBuffer, "maxplayers"); s = GET_KEY_VALUE(szBuffer, "maxplayers");
if (s && s[0] != '\0') if (s && s[0] != '\0')
{ {
item->maxplayers = Q_atoi(s); item->maxplayers = Q_atoi(s);
item->maxplayers = _max(item->maxplayers, 0); item->maxplayers = Q_max(item->maxplayers, 0);
item->maxplayers = _min(item->maxplayers, gpGlobals->maxClients); item->maxplayers = Q_min(item->maxplayers, gpGlobals->maxClients);
} }
// Remove keys // Remove keys

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -50,17 +50,17 @@
class CBasePlatTrain: public CBaseToggle class CBasePlatTrain: public CBaseToggle
{ {
public: public:
NOBODY virtual void Precache(void); virtual void Precache(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void) virtual int ObjectCaps(void)
{ {
return ObjectCaps_(); return ObjectCaps_();
} }
// This is done to fix spawn flag collisions between this class and a derived class // 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_(); return IsTogglePlat_();
} }
@ -96,13 +96,13 @@ public:
class CFuncPlat: public CBasePlatTrain class CFuncPlat: public CBasePlatTrain
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void Precache(void); virtual void Precache(void);
NOBODY virtual void Blocked(CBaseEntity *pOther); virtual void Blocked(CBaseEntity *pOther);
NOBODY virtual void GoUp(void); virtual void GoUp(void);
NOBODY virtual void GoDown(void); virtual void GoDown(void);
NOBODY virtual void HitTop(void); virtual void HitTop(void);
NOBODY virtual void HitBottom(void); virtual void HitBottom(void);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -117,12 +117,11 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
NOBODY void Setup(void); void Setup(void);
void EXPORT PlatUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
NOBODY void EXPORT PlatUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); void EXPORT CallGoDown(void);
NOBODY void EXPORT CallGoDown(void); void EXPORT CallHitTop(void);
NOBODY void EXPORT CallHitTop(void); void EXPORT CallHitBottom(void);
NOBODY void EXPORT CallHitBottom(void);
};/* size: 320, cachelines: 5, members: 1 */ };/* size: 320, cachelines: 5, members: 1 */
@ -130,11 +129,11 @@ public:
class CPlatTrigger: public CBaseEntity class CPlatTrigger: public CBaseEntity
{ {
public: public:
NOBODY virtual int ObjectCaps(void) virtual int ObjectCaps(void)
{ {
return ObjectCaps_(); return ObjectCaps_();
} }
NOBODY virtual void Touch(CBaseEntity *pOther); virtual void Touch(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -147,7 +146,7 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
NOBODY void SpawnInsideTrigger(CFuncPlat *pPlatform); void SpawnInsideTrigger(CFuncPlat *pPlatform);
public: public:
CFuncPlat *m_pPlatform; CFuncPlat *m_pPlatform;
@ -158,14 +157,14 @@ public:
class CFuncPlatRot: public CFuncPlat class CFuncPlatRot: public CFuncPlat
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
NOBODY virtual void GoUp(void); virtual void GoUp(void);
NOBODY virtual void GoDown(void); virtual void GoDown(void);
NOBODY virtual void HitTop(void); virtual void HitTop(void);
NOBODY virtual void HitBottom(void); virtual void HitBottom(void);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -180,8 +179,8 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
NOBODY void SetupRotation(void); void SetupRotation(void);
NOBODY void RotMove(Vector &destAngle, float time); void RotMove(Vector &destAngle, float time);
public: public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[2]; static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[2];
@ -196,16 +195,16 @@ public:
class CFuncTrain: public CBasePlatTrain class CFuncTrain: public CBasePlatTrain
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void Precache(void); virtual void Precache(void);
NOBODY virtual void Restart(void); virtual void Restart(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
NOBODY virtual void Activate(void); virtual void Activate(void);
NOBODY virtual void OverrideReset(void); virtual void OverrideReset(void);
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);
NOBODY virtual void Blocked(CBaseEntity *pOther); virtual void Blocked(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -223,8 +222,8 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
NOBODY void EXPORT Wait(void); void EXPORT Wait(void);
NOBODY void EXPORT Next(void); void EXPORT Next(void);
public: public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[3]; static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[3];
@ -242,8 +241,8 @@ public:
class CFuncTrainControls: public CBaseEntity class CFuncTrainControls: public CBaseEntity
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual int ObjectCaps(void) virtual int ObjectCaps(void)
{ {
return ObjectCaps_(); return ObjectCaps_();
} }
@ -259,7 +258,7 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
NOBODY void EXPORT Find(void); void EXPORT Find(void);
};/* size: 152, cachelines: 3, members: 1 */ };/* size: 152, cachelines: 3, members: 1 */
@ -267,22 +266,22 @@ public:
class CFuncTrackChange: public CFuncPlatRot class CFuncTrackChange: public CFuncPlatRot
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void Precache(void); virtual void Precache(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
NOBODY virtual void OverrideReset(void); virtual void OverrideReset(void);
NOBODY virtual void Touch(CBaseEntity *pOther); virtual void Touch(CBaseEntity *pOther);
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);
NOBODY virtual BOOL IsTogglePlat(void); virtual BOOL IsTogglePlat(void);
NOBODY virtual void EXPORT GoUp(void); virtual void EXPORT GoUp(void);
NOBODY virtual void EXPORT GoDown(void); virtual void EXPORT GoDown(void);
NOBODY virtual void HitBottom(void); virtual void HitBottom(void);
NOBODY virtual void HitTop(void); virtual void HitTop(void);
NOBODY virtual void UpdateAutoTargets(int toggleState); virtual void UpdateAutoTargets(int toggleState);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -304,22 +303,22 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
NOBODY void EXPORT Find(void); void EXPORT Find(void);
NOBODY TRAIN_CODE EvaluateTrain(CPathTrack *pcurrent); TRAIN_CODE EvaluateTrain(CPathTrack *pcurrent);
NOBODY void UpdateTrain(Vector &dest); void UpdateTrain(Vector &dest);
/* <12c515> ../cstrike/dlls/plats.cpp:1675 */ /* <12c515> ../cstrike/dlls/plats.cpp:1675 */
NOBODY void DisableUse(void) void DisableUse(void)
{ {
m_use = 0; m_use = 0;
} }
/* <12c52e> ../cstrike/dlls/plats.cpp:1676 */ /* <12c52e> ../cstrike/dlls/plats.cpp:1676 */
NOBODY void EnableUse(void) void EnableUse(void)
{ {
m_use = 1; m_use = 1;
} }
/* <12c547> ../cstrike/dlls/plats.cpp:1677 */ /* <12c547> ../cstrike/dlls/plats.cpp:1677 */
NOBODY int UseEnabled(void) int UseEnabled(void)
{ {
return m_use; return m_use;
} }
@ -346,8 +345,8 @@ public:
class CFuncTrackAuto: public CFuncTrackChange class CFuncTrackAuto: public CFuncTrackChange
{ {
public: 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);
NOBODY virtual void UpdateAutoTargets(int toggleState); virtual void UpdateAutoTargets(int toggleState);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -363,25 +362,25 @@ public:
class CGunTarget: public CBaseMonster class CGunTarget: public CBaseMonster
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void) virtual int ObjectCaps(void)
{ {
return ObjectCaps_(); return ObjectCaps_();
} }
NOBODY virtual void Activate(void); virtual void Activate(void);
NOBODY virtual int Classify(void) virtual int Classify(void)
{ {
return Classify_(); return Classify_();
} }
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 BloodColor(void) virtual int BloodColor(void)
{ {
return BloodColor_(); return BloodColor_();
} }
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);
NOBODY virtual Vector BodyTarget(const Vector &posSrc) virtual Vector BodyTarget(const Vector &posSrc)
{ {
return BodyTarget_(posSrc); return BodyTarget_(posSrc);
} }
@ -414,11 +413,10 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
void EXPORT Next(void);
NOBODY void EXPORT Next(void); void EXPORT Start(void);
NOBODY void EXPORT Start(void); void EXPORT Wait(void);
NOBODY void EXPORT Wait(void); void Stop(void);
NOBODY void Stop(void);
public: public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1]; static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1];
@ -428,8 +426,18 @@ private:
};/* size: 408, cachelines: 7, members: 3 */ };/* size: 408, cachelines: 7, members: 3 */
NOBODY void PlatSpawnInsideTrigger(entvars_t *pevPlatform); void PlatSpawnInsideTrigger(entvars_t *pevPlatform);
NOBODY float Fix(float angle); //float Fix(float angle);
NOBODY void FixupAngles(Vector &v); 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 #endif // PLATS_H

View File

@ -273,8 +273,8 @@ int gmsgShowTimer;
BOOL gInitHUD; BOOL gInitHUD;
cvar_t *sv_aim; cvar_t *sv_aim;
TYPEDESCRIPTION (*CRevertSaved::pm_SaveData)[2]; TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CRevertSaved, m_SaveData)[2];
TYPEDESCRIPTION (*CBasePlayer::pm_playerSaveData)[40]; TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CBasePlayer, m_playerSaveData)[40];
WeaponStruct g_weaponStruct[ MAX_WEAPONS ]; WeaponStruct g_weaponStruct[ MAX_WEAPONS ];
char *(*CDeadHEV::pm_szPoses)[4]; char *(*CDeadHEV::pm_szPoses)[4];
@ -792,6 +792,7 @@ int TrainSpeed(int iSpeed, int iMax)
/* <153c8e> ../cstrike/dlls/player.cpp:902 */ /* <153c8e> ../cstrike/dlls/player.cpp:902 */
void CBasePlayer::DeathSound(void) void CBasePlayer::DeathSound(void)
{ {
// temporarily using pain sounds for death sounds
switch (RANDOM_LONG(1, 4)) switch (RANDOM_LONG(1, 4))
{ {
case 1: EMIT_SOUND(ENT(pev), CHAN_VOICE, "player/die1.wav", VOL_NORM, ATTN_NORM); break; 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 */ /* <151213> ../cstrike/dlls/player.cpp:937 */
int CBasePlayer::__MAKE_VHOOK(TakeHealth)(float flHealth, int bitsDamageType) 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) if (bShouldBleed)
{ {
BloodSplat(ptr->vecEndPos, vecDir, ptr->iHitgroup, flDamage * 5); 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); TraceBleed(flDamage, vecDir, ptr, bitsDamageType);
} }
else if (ptr->iHitgroup == HITGROUP_HEAD && bShouldSpark == true) else if (ptr->iHitgroup == HITGROUP_HEAD && bShouldSpark == true)
@ -1209,7 +1213,7 @@ int CBasePlayer::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pe
MESSAGE_BEGIN(MSG_SPEC, gmsgHLTV); MESSAGE_BEGIN(MSG_SPEC, gmsgHLTV);
WRITE_BYTE(ENTINDEX(edict())); 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(); MESSAGE_END();
for (int i = 1; i <= gpGlobals->maxClients; i++) for (int i = 1; i <= gpGlobals->maxClients; i++)
@ -1220,7 +1224,7 @@ int CBasePlayer::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pe
continue; continue;
MESSAGE_BEGIN(MSG_ONE, gmsgSpecHealth, NULL, pPlayer->edict()); 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(); MESSAGE_END();
} }
@ -1431,7 +1435,7 @@ int CBasePlayer::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pe
MESSAGE_BEGIN(MSG_SPEC, gmsgHLTV); MESSAGE_BEGIN(MSG_SPEC, gmsgHLTV);
WRITE_BYTE(ENTINDEX(edict())); 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(); MESSAGE_END();
for (int i = 1; i <= gpGlobals->maxClients; i++) for (int i = 1; i <= gpGlobals->maxClients; i++)
@ -1444,7 +1448,7 @@ int CBasePlayer::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pe
if (pPlayer->m_hObserverTarget == this) if (pPlayer->m_hObserverTarget == this)
{ {
MESSAGE_BEGIN(MSG_ONE, gmsgSpecHealth, NULL, pPlayer->edict()); 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(); MESSAGE_END();
} }
} }
@ -4433,7 +4437,7 @@ void CBasePlayer::CheckTimeBasedDamage(void)
{ {
if (m_idrowndmg > m_idrownrestored) 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); TakeHealth(idif, DMG_GENERIC);
m_idrownrestored += idif; m_idrownrestored += idif;
} }
@ -4801,12 +4805,12 @@ void CBasePlayer::__MAKE_VHOOK(PostThink)(void)
if (gun && gun->UseDecrement()) if (gun && gun->UseDecrement())
{ {
gun->m_flNextPrimaryAttack = _max(gun->m_flNextPrimaryAttack - gpGlobals->frametime, -1.0); gun->m_flNextPrimaryAttack = Q_max(gun->m_flNextPrimaryAttack - gpGlobals->frametime, -1.0f);
gun->m_flNextSecondaryAttack = _max(gun->m_flNextSecondaryAttack - gpGlobals->frametime, -0.001); gun->m_flNextSecondaryAttack = Q_max(gun->m_flNextSecondaryAttack - gpGlobals->frametime, -0.001f);
if (gun->m_flTimeWeaponIdle != 1000.0f) 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 // skip over the null point
if (FNullEnt(pSpot)) if (FNullEnt(pSpot))
{
pSpot = UTIL_FindEntityByClassname(pSpot, "info_player_start"); pSpot = UTIL_FindEntityByClassname(pSpot, "info_player_start");
}
CBaseEntity *pFirstSpot = pSpot; CBaseEntity *pFirstSpot = pSpot;
@ -6377,7 +6383,7 @@ int CBasePlayer::__MAKE_VHOOK(GiveAmmo)(int iCount, char *szName, int iMax)
if (i < 0 || i >= MAX_AMMO_SLOTS) if (i < 0 || i >= MAX_AMMO_SLOTS)
return -1; return -1;
int iAdd = _min(iCount, iMax - m_rgAmmo[i]); int iAdd = Q_min(iCount, iMax - m_rgAmmo[i]);
if (iAdd < 1) if (iAdd < 1)
return i; return i;
@ -6487,7 +6493,7 @@ void CBasePlayer::SendAmmoUpdate(void)
// send "Ammo" update message // send "Ammo" update message
MESSAGE_BEGIN(MSG_ONE, gmsgAmmoX, NULL, pev); MESSAGE_BEGIN(MSG_ONE, gmsgAmmoX, NULL, pev);
WRITE_BYTE(i); 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(); MESSAGE_END();
} }
} }
@ -6593,6 +6599,8 @@ void CBasePlayer::__MAKE_VHOOK(UpdateClientData)(void)
MESSAGE_BEGIN(MSG_ONE, gmsgResetHUD, NULL, pev); MESSAGE_BEGIN(MSG_ONE, gmsgResetHUD, NULL, pev);
MESSAGE_END(); MESSAGE_END();
CHalfLifeMultiplay *mp = g_pGameRules;
if (!m_fGameHUDInitialized) if (!m_fGameHUDInitialized)
{ {
MESSAGE_BEGIN(MSG_ONE, gmsgInitHUD, NULL, pev); MESSAGE_BEGIN(MSG_ONE, gmsgInitHUD, NULL, pev);
@ -6646,10 +6654,10 @@ void CBasePlayer::__MAKE_VHOOK(UpdateClientData)(void)
MESSAGE_END(); MESSAGE_END();
} }
g_pGameRules->InitHUD(this); mp->InitHUD(this);
m_fGameHUDInitialized = TRUE; m_fGameHUDInitialized = TRUE;
if (g_pGameRules->IsMultiplayer()) if (mp->IsMultiplayer())
{ {
FireTargets("game_playerjoin", this, this, USE_TOGGLE, 0); FireTargets("game_playerjoin", this, this, USE_TOGGLE, 0);
} }
@ -6683,16 +6691,16 @@ void CBasePlayer::__MAKE_VHOOK(UpdateClientData)(void)
SendHostagePos(); SendHostagePos();
SendWeatherInfo(); SendWeatherInfo();
if (g_pGameRules->IsMultiplayer()) if (mp->IsMultiplayer())
{ {
MESSAGE_BEGIN(MSG_ONE, gmsgTeamScore, NULL, pev); MESSAGE_BEGIN(MSG_ONE, gmsgTeamScore, NULL, pev);
WRITE_STRING(GetTeam(CT)); WRITE_STRING(GetTeam(CT));
WRITE_SHORT(g_pGameRules->m_iNumCTWins); WRITE_SHORT(mp->m_iNumCTWins);
MESSAGE_END(); MESSAGE_END();
MESSAGE_BEGIN(MSG_ONE, gmsgTeamScore, NULL, pev); MESSAGE_BEGIN(MSG_ONE, gmsgTeamScore, NULL, pev);
WRITE_STRING(GetTeam(TERRORIST)); WRITE_STRING(GetTeam(TERRORIST));
WRITE_SHORT(g_pGameRules->m_iNumTerroristWins); WRITE_SHORT(mp->m_iNumTerroristWins);
MESSAGE_END(); MESSAGE_END();
} }
} }
@ -7388,8 +7396,10 @@ void CBasePlayer::DropPlayerItem(const char *pszItemName)
const char *modelname = GetCSModelName(pWeapon->m_iId); const char *modelname = GetCSModelName(pWeapon->m_iId);
if (modelname) if (modelname != NULL)
{
SET_MODEL(ENT(pWeaponBox->pev), modelname); SET_MODEL(ENT(pWeaponBox->pev), modelname);
}
return; return;
} }
@ -8053,7 +8063,7 @@ void CBasePlayer::ResetStamina(void)
} }
/* <15a467> ../cstrike/dlls/player.cpp:9829 */ /* <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); entvars_t *pev = VARS((edict_t *)pEdict);
CBasePlayer *pPlayer = reinterpret_cast<CBasePlayer *>(CBasePlayer::Instance(pev)); CBasePlayer *pPlayer = reinterpret_cast<CBasePlayer *>(CBasePlayer::Instance(pev));
@ -8065,7 +8075,7 @@ float GetPlayerPitch(const edict_t *pEdict)
} }
/* <15a530> ../cstrike/dlls/player.cpp:9846 */ /* <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); entvars_t *pev = VARS((edict_t *)pEdict);
CBasePlayer *pPlayer = reinterpret_cast<CBasePlayer *>(CBasePlayer::Instance(pev)); CBasePlayer *pPlayer = reinterpret_cast<CBasePlayer *>(CBasePlayer::Instance(pev));

View File

@ -123,6 +123,11 @@
#define CHAT_INTERVAL 1.0f #define CHAT_INTERVAL 1.0f
#define CSUITNOREPEAT 32 #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_ON "items/flashlight1.wav"
//#define SOUND_FLASHLIGHT_OFF "items/flashlight1.wav" //#define SOUND_FLASHLIGHT_OFF "items/flashlight1.wav"
@ -1169,8 +1174,8 @@ NOXREF CBaseEntity *FindZombieSpawn(CBaseEntity *player, bool forceSpawn);
edict_t *EntSelectSpawnPoint(CBaseEntity *pPlayer); edict_t *EntSelectSpawnPoint(CBaseEntity *pPlayer);
void SetScoreAttrib(CBasePlayer *dest, CBasePlayer *src); void SetScoreAttrib(CBasePlayer *dest, CBasePlayer *src);
CBaseEntity *FindEntityForward(CBaseEntity *pMe); CBaseEntity *FindEntityForward(CBaseEntity *pMe);
float GetPlayerPitch(const edict_t *pEdict); float_precision GetPlayerPitch(const edict_t *pEdict);
float GetPlayerYaw(const edict_t *pEdict); float_precision GetPlayerYaw(const edict_t *pEdict);
int GetPlayerGaitsequence(const edict_t *pEdict); int GetPlayerGaitsequence(const edict_t *pEdict);
const char *GetBuyStringForWeaponClass(int weaponClass); const char *GetBuyStringForWeaponClass(int weaponClass);
bool IsPrimaryWeaponClass(int classId); bool IsPrimaryWeaponClass(int classId);

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -33,8 +33,28 @@
#endif #endif
#define CSENTENCEG_MAX 200 // max number of sentence groups #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 typedef struct
{ {
char szgroupname[16]; char szgroupname[16];
@ -44,13 +64,168 @@ typedef struct
} sentenceg; } sentenceg;
/* size: 52, cachelines: 1, members: 3 */ /* 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); void USENTENCEG_InitLRU(unsigned char *plru, int count);
int USENTENCEG_PickSequential(int isentenceg, char *szfound, int ipick, int freset); int USENTENCEG_PickSequential(int isentenceg, char *szfound, int ipick, int freset);
int USENTENCEG_Pick(int isentenceg, char *szfound); int USENTENCEG_Pick(int isentenceg, char *szfound);
NOXREF int SENTENCEG_GetIndex(const char *szgroupname); int SENTENCEG_GetIndex(const char *szgroupname);
NOXREF int SENTENCEG_PlayRndI(edict_t *entity, int isentenceg, float volume, float attenuation, int flags, int pitch); 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_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); 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); NOXREF void SENTENCEG_Stop(edict_t *entity, int isentenceg, int ipick);
void SENTENCEG_Init(void); 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); void EMIT_GROUPID_SUIT(edict_t *entity, int isentenceg);
NOXREF void EMIT_GROUPNAME_SUIT(edict_t *entity, const char *groupname); NOXREF void EMIT_GROUPNAME_SUIT(edict_t *entity, const char *groupname);
char *memfgets(byte *pMemFile, int fileSize, int &filePos, char *pBuffer, int bufferSize); 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); 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 #ifdef HOOK_GAMEDLL
@ -70,6 +245,7 @@ NOBODY float TEXTURETYPE_PlaySound(TraceResult *ptr, Vector vecSrc, Vector vecEn
#define rgsentenceg (*prgsentenceg) #define rgsentenceg (*prgsentenceg)
#define fSentencesInit (*pfSentencesInit) #define fSentencesInit (*pfSentencesInit)
#define gcallsentences (*pgcallsentences) #define gcallsentences (*pgcallsentences)
#define rgdpvpreset (*prgdpvpreset)
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
@ -77,5 +253,15 @@ extern char gszallsentencenames[ CVOXFILESENTENCEMAX ][ CBSENTENCENAME_MAX ];
extern sentenceg rgsentenceg[ CSENTENCEG_MAX ]; extern sentenceg rgsentenceg[ CSENTENCEG_MAX ];
extern int fSentencesInit; extern int fSentencesInit;
extern int gcallsentences; 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 #endif // SOUND_H

View File

@ -5,9 +5,17 @@ CSoundEnt *pSoundEnt;
/* <178ca4> ../cstrike/dlls/soundent.cpp:22 */ /* <178ca4> ../cstrike/dlls/soundent.cpp:22 */
LINK_ENTITY_TO_CLASS(soundent, CSoundEnt); LINK_ENTITY_TO_CLASS(soundent, CSoundEnt);
// CSound - Clear - zeros all fields for a sound
/* <178d6e> ../cstrike/dlls/soundent.cpp:29 */ /* <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, // Reset - clears the volume, origin, and type for a sound,
@ -22,71 +30,169 @@ void CSound::Reset(void)
m_iVolume = 0; m_iVolume = 0;
} }
// FIsSound - returns TRUE if the sound is an Audible sound
/* <178db7> ../cstrike/dlls/soundent.cpp:54 */ /* <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 */ /* <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 */ /* <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 */ /* <178b0c> ../cstrike/dlls/soundent.cpp:93 */
NOBODY void CSoundEnt::__MAKE_VHOOK(Think)(void) void CSoundEnt::__MAKE_VHOOK(Think)(void)
{ {
// { int iSound;
// int iSound; // 95 int iPreviousSound;
// int iPreviousSound; // 96
// { // how often to check the sound list.
// int iNext; // 107 pev->nextthink = gpGlobals->time + 0.3;
// FreeSound(int iSound,
// int iPrevious); // 110 iPreviousSound = SOUNDLIST_EMPTY;
// } iSound = m_iActiveSound;
// }
// Think(CSoundEnt *const this); // 93 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 */ /* <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 */ /* <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 */ /* <178e2d> ../cstrike/dlls/soundent.cpp:171 */
int CSoundEnt::IAllocSound(void) int CSoundEnt::IAllocSound(void)
{ {
int iNewSound;
if (m_iFreeSound == SOUNDLIST_EMPTY) if (m_iFreeSound == SOUNDLIST_EMPTY)
{ {
// no free sound!
ALERT(at_console, "Free Sound List is full!\n"); ALERT(at_console, "Free Sound List is full!\n");
return SOUNDLIST_EMPTY; 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; 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; m_SoundPool[ iNewSound ].m_iNext = m_iActiveSound;
// now make the new sound the top of the active list. You're done.
m_iActiveSound = iNewSound; m_iActiveSound = iNewSound;
return iNewSound; return iNewSound;
} }
// InsertSound - Allocates a free sound and fills it with
// sound info.
/* <178e94> ../cstrike/dlls/soundent.cpp:200 */ /* <178e94> ../cstrike/dlls/soundent.cpp:200 */
void CSoundEnt::InsertSound(int iType, const Vector &vecOrigin, int iVolume, float flDuration) void CSoundEnt::InsertSound(int iType, const Vector &vecOrigin, int iVolume, float flDuration)
{ {
if (!pSoundEnt) int iThisSound;
return;
int iThisSound = pSoundEnt->IAllocSound(); if (!pSoundEnt)
{
// no sound ent!
return;
}
iThisSound = pSoundEnt->IAllocSound();
if (iThisSound == SOUNDLIST_EMPTY) 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; 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 */ /* <178f4e> ../cstrike/dlls/soundent.cpp:228 */
NOBODY void CSoundEnt::Initialize(void) void CSoundEnt::Initialize(void)
{ {
// { int i;
// int i; // 230 int iSound;
// int iSound; // 231
// Clear(CSound *const this); // 239 m_cLastActiveSounds = 0;
// IAllocSound(CSoundEnt *const this); // 249 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 */ /* <179031> ../cstrike/dlls/soundent.cpp:274 */
NOBODY int CSoundEnt::ISoundsInList(int iListType) int CSoundEnt::ISoundsInList(int iListType)
{ {
// { int i;
// int i; // 276 int iThisSound;
// int iThisSound; // 277
// } 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 */ /* <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 */ /* <179083> ../cstrike/dlls/soundent.cpp:325 */
NOBODY int CSoundEnt::FreeList(void) NOXREF int CSoundEnt::FreeList(void)
{ {
if (!pSoundEnt)
{
return SOUNDLIST_EMPTY;
}
return pSoundEnt->m_iFreeSound;
} }
// SoundPointerForIndex - returns a pointer to the instance // SoundPointerForIndex - returns a pointer to the instance

View File

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

View File

@ -5,12 +5,14 @@
*/ */
#ifndef HOOK_GAMEDLL #ifndef HOOK_GAMEDLL
// Global Savedata for Delay
TYPEDESCRIPTION CBaseDelay::m_SaveData[] = TYPEDESCRIPTION CBaseDelay::m_SaveData[] =
{ {
DEFINE_FIELD(CBaseDelay, m_flDelay, FIELD_FLOAT), DEFINE_FIELD(CBaseDelay, m_flDelay, FIELD_FLOAT),
DEFINE_FIELD(CBaseDelay, m_iszKillTarget, FIELD_STRING), DEFINE_FIELD(CBaseDelay, m_iszKillTarget, FIELD_STRING),
}; };
// Global Savedata for Toggle
TYPEDESCRIPTION CBaseToggle::m_SaveData[] = TYPEDESCRIPTION CBaseToggle::m_SaveData[] =
{ {
DEFINE_FIELD(CBaseToggle, m_toggle_state, FIELD_INTEGER), 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_flTLength, FIELD_FLOAT),
DEFINE_FIELD(CBaseToggle, m_vecPosition1, FIELD_POSITION_VECTOR), DEFINE_FIELD(CBaseToggle, m_vecPosition1, FIELD_POSITION_VECTOR),
DEFINE_FIELD(CBaseToggle, m_vecPosition2, FIELD_POSITION_VECTOR), DEFINE_FIELD(CBaseToggle, m_vecPosition2, FIELD_POSITION_VECTOR),
DEFINE_FIELD(CBaseToggle, m_vecAngle1, 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), 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_cTriggersLeft, FIELD_INTEGER),
DEFINE_FIELD(CBaseToggle, m_flHeight, FIELD_FLOAT), DEFINE_FIELD(CBaseToggle, m_flHeight, FIELD_FLOAT),
DEFINE_FIELD(CBaseToggle, m_hActivator, FIELD_EHANDLE), 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_vecFinalDest, FIELD_POSITION_VECTOR),
DEFINE_FIELD(CBaseToggle, m_vecFinalAngle, FIELD_VECTOR), DEFINE_FIELD(CBaseToggle, m_vecFinalAngle, FIELD_VECTOR),
DEFINE_FIELD(CBaseToggle, m_sMaster, FIELD_STRING), 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 #else // HOOK_GAMEDLL
TYPEDESCRIPTION (*CBaseDelay::pm_SaveData)[2]; TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CBaseDelay, m_SaveData)[2];
TYPEDESCRIPTION (*CBaseToggle::pm_SaveData)[19]; TYPEDESCRIPTION IMPLEMENT_ARRAY_CLASS(CBaseToggle, m_SaveData)[19];
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
// Landmark class
/* <1832bc> ../cstrike/dlls/subs.cpp:38 */ /* <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 */ /* <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 */ /* <1838f5> ../cstrike/dlls/subs.cpp:57 */
LINK_ENTITY_TO_CLASS(info_null, CNullEntity); LINK_ENTITY_TO_CLASS(info_null, CNullEntity);
// These are the new entry points to entities.
/* <1839f1> ../cstrike/dlls/subs.cpp:69 */ /* <1839f1> ../cstrike/dlls/subs.cpp:69 */
LINK_ENTITY_TO_CLASS(info_player_deathmatch, CBaseDMStart); 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); LINK_ENTITY_TO_CLASS(info_bomb_target, CPointEntity);
/* <183647> ../cstrike/dlls/subs.cpp:79 */ /* <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, if (FStrEq(pkvd->szKeyName, "master"))
// const char *sz2); // 81 {
// KeyValue(CBaseEntity *const this, pev->netname = ALLOC_STRING(pkvd->szValue);
// KeyValueData *pkvd); // 87 pkvd->fHandled = TRUE;
// KeyValue(CBaseDMStart *const this, }
// KeyValueData *pkvd); // 79 else
CPointEntity::KeyValue(pkvd);
} }
/* <18331c> ../cstrike/dlls/subs.cpp:90 */ /* <18331c> ../cstrike/dlls/subs.cpp:90 */
NOBODY BOOL CBaseDMStart::__MAKE_VHOOK(IsTriggered)(CBaseEntity *pEntity) BOOL CBaseDMStart::__MAKE_VHOOK(IsTriggered)(CBaseEntity *pEntity)
{ {
// { BOOL master = UTIL_IsMasterTriggered(pev->netname, pEntity);
// BOOL master; // 92
// } return master;
} }
// This updates global tables that need to know about entities being removed
/* <183f03> ../cstrike/dlls/subs.cpp:98 */ /* <183f03> ../cstrike/dlls/subs.cpp:98 */
void CBaseEntity::UpdateOnRemove(void) void CBaseEntity::UpdateOnRemove(void)
{ {
int i;
if (pev->flags & FL_GRAPHED) 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 (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; WorldGraph.m_pLinkPool[i].m_pLinkEnt = NULL;
} }
} }
}
if (pev->globalname) if (pev->globalname)
{ {
@ -109,12 +129,15 @@ void CBaseEntity::UpdateOnRemove(void)
} }
} }
// Convenient way to delay removing oneself
/* <183f38> ../cstrike/dlls/subs.cpp:120 */ /* <183f38> ../cstrike/dlls/subs.cpp:120 */
void CBaseEntity::SUB_Remove(void) void CBaseEntity::SUB_Remove(void)
{ {
UpdateOnRemove(); UpdateOnRemove();
if (pev->health > 0) if (pev->health > 0)
{ {
// this situation can screw up monsters who can't tell their entity pointers are invalid.
pev->health = 0; pev->health = 0;
ALERT(at_aiconsole, "SUB_Remove called on entity with health > 0\n"); 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)); REMOVE_ENTITY(ENT(pev));
} }
// Convenient way to explicitly do nothing (passed to functions that require a method)
/* <183f8a> ../cstrike/dlls/subs.cpp:135 */ /* <183f8a> ../cstrike/dlls/subs.cpp:135 */
void CBaseEntity::SUB_DoNothing(void) void CBaseEntity::SUB_DoNothing(void)
{ {
@ -148,12 +173,24 @@ void CBaseDelay::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CBaseEntity::KeyValue(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 */ /* <1840d5> ../cstrike/dlls/subs.cpp:183 */
void CBaseEntity::SUB_UseTargets(CBaseEntity *pActivator, USE_TYPE useType, float value) void CBaseEntity::SUB_UseTargets(CBaseEntity *pActivator, USE_TYPE useType, float value)
{ {
// fire targets
if (!FStringNull(pev->target)) if (!FStringNull(pev->target))
{
FireTargets(STRING(pev->target), pActivator, this, useType, value); FireTargets(STRING(pev->target), pActivator, this, useType, value);
} }
}
/* <183fb0> ../cstrike/dlls/subs.cpp:195 */ /* <183fb0> ../cstrike/dlls/subs.cpp:195 */
void FireTargets(const char *targetName, CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) void FireTargets(const char *targetName, CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
@ -163,13 +200,15 @@ void FireTargets(const char *targetName, CBaseEntity *pActivator, CBaseEntity *p
return; return;
ALERT(at_aiconsole, "Firing: (%s)\n", targetName); ALERT(at_aiconsole, "Firing: (%s)\n", targetName);
while (1) while (true)
{ {
pentTarget = FIND_ENTITY_BY_TARGETNAME(pentTarget, targetName); pentTarget = FIND_ENTITY_BY_TARGETNAME(pentTarget, targetName);
if (FNullEnt(pentTarget)) if (FNullEnt(pentTarget))
break; break;
CBaseEntity *pTarget = CBaseEntity::Instance(pentTarget); CBaseEntity *pTarget = CBaseEntity::Instance(pentTarget);
// Don't use dying ents
if (pTarget && !(pTarget->pev->flags & FL_KILLME)) if (pTarget && !(pTarget->pev->flags & FL_KILLME))
{ {
ALERT(at_aiconsole, "Found: %s, firing (%s)\n", STRING(pTarget->pev->classname), targetName); 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 */ /* <1844c2> ../cstrike/dlls/subs.cpp:252 */
void CBaseDelay::SUB_UseTargets(CBaseEntity *pActivator, USE_TYPE useType, float value) 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; return;
if (!m_flDelay) // check for a delay
{ if (m_flDelay != 0)
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
{ {
// create a temp object to fire at a later time
CBaseDelay *pTemp = GetClassPtr((CBaseDelay *)NULL); CBaseDelay *pTemp = GetClassPtr((CBaseDelay *)NULL);
if (pTemp->pev->classname) if (pTemp->pev->classname)
{
RemoveEntityHashValue(pTemp->pev, STRING(pTemp->pev->classname), CLASSNAME); RemoveEntityHashValue(pTemp->pev, STRING(pTemp->pev->classname), CLASSNAME);
}
MAKE_STRING_CLASS("DelayedUse", pTemp->pev); MAKE_STRING_CLASS("DelayedUse", pTemp->pev);
AddEntityHashValue(pTemp->pev, STRING(pTemp->pev->classname), CLASSNAME); AddEntityHashValue(pTemp->pev, STRING(pTemp->pev->classname), CLASSNAME);
pTemp->pev->nextthink = gpGlobals->time + m_flDelay; pTemp->pev->nextthink = gpGlobals->time + m_flDelay;
pTemp->SetThink(&CBaseDelay::DelayThink); pTemp->SetThink(&CBaseDelay::DelayThink);
// Save the useType
pTemp->pev->button = (int)useType; pTemp->pev->button = (int)useType;
pTemp->m_iszKillTarget = m_iszKillTarget; pTemp->m_iszKillTarget = m_iszKillTarget;
pTemp->m_flDelay = 0.0f;
// prevent "recursion"
pTemp->m_flDelay = 0;
pTemp->pev->target = pev->target; 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()) if (pActivator && pActivator->IsPlayer())
{
pTemp->pev->owner = pActivator->edict(); pTemp->pev->owner = pActivator->edict();
}
else else
{
pTemp->pev->owner = NULL; 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 */ /* <1846d9> ../cstrike/dlls/subs.cpp:335 */
void SetMovedir(entvars_t *pev) void SetMovedir(entvars_t *pev)
{ {
if (pev->angles == Vector(0, -1, 0)) if (pev->angles == Vector(0, -1, 0))
{
pev->movedir = Vector(0, 0, 1); pev->movedir = Vector(0, 0, 1);
}
else if (pev->angles == Vector(0, -2, 0)) else if (pev->angles == Vector(0, -2, 0))
{
pev->movedir = Vector(0, 0, -1); pev->movedir = Vector(0, 0, -1);
}
else else
{ {
UTIL_MakeVectors(pev->angles); UTIL_MakeVectors(pev->angles);
pev->movedir = gpGlobals->v_forward; pev->movedir = gpGlobals->v_forward;
} }
pev->angles = g_vecZero; pev->angles = g_vecZero;
} }
@ -247,10 +320,15 @@ void SetMovedir(entvars_t *pev)
void CBaseDelay::DelayThink(void) void CBaseDelay::DelayThink(void)
{ {
CBaseEntity *pActivator = NULL; 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)); REMOVE_ENTITY(ENT(pev));
} }
@ -284,82 +362,177 @@ void CBaseToggle::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
CBaseDelay::KeyValue(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 */ /* <18474d> ../cstrike/dlls/subs.cpp:431 */
NOBODY void CBaseToggle::LinearMove(Vector vecDest, float flSpeed) void CBaseToggle::LinearMove(Vector vecDest, float flSpeed)
{ {
// { assert(("LinearMove: no speed is defined!", flSpeed != 0));
// class Vector vecDestDelta; // 446 //assert(("LinearMove: no post-move function defined", m_pfnCallWhenMoveDone != NULL));
// float flTravelTime; // 449
// operator==(const class Vector *const this, m_vecFinalDest = vecDest;
// const class Vector &v); // 439
// operator-(const class Vector *const this, // Already there?
// const class Vector &v); // 446 if (vecDest == pev->origin)
// Length(const class Vector *const this); // 449 {
// operator/(const class Vector *const this, LinearMoveDone();
// float fl); // 456 return;
// LinearMoveDone(CBaseToggle *const this); // 441
// }
} }
// 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 */ /* <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 */ /* <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 */ /* <18487c> ../cstrike/dlls/subs.cpp:491 */
NOBODY void CBaseToggle::AngularMove(Vector vecDestAngle, float flSpeed) void CBaseToggle::AngularMove(Vector vecDestAngle, float flSpeed)
{ {
// { assert(("AngularMove: no speed is defined!", flSpeed != 0));
// class Vector vecDestDelta; // 506 //assert(("AngularMove: no post-move function defined", m_pfnCallWhenMoveDone != NULL));
// float flTravelTime; // 509
// operator==(const class Vector *const this, m_vecFinalAngle = vecDestAngle;
// const class Vector &v); // 499
// operator-(const class Vector *const this, // Already there?
// const class Vector &v); // 506 if (vecDestAngle == pev->angles)
// Length(const class Vector *const this); // 509 {
// operator/(const class Vector *const this, AngularMoveDone();
// float fl); // 516 return;
// AngularMoveDone(CBaseToggle *const this); // 501
// }
} }
// 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 */ /* <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 */ /* <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 */ /* <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 */ /* <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 */ /* <184a30> ../cstrike/dlls/subs.cpp:577 */
NOBODY BOOL FEntIsVisible(entvars_t *pev, entvars_t *pevTarget) NOXREF BOOL FEntIsVisible(entvars_t *pev, entvars_t *pevTarget)
{ {
// { Vector vecSpot1 = pev->origin + pev->view_ofs;
// class Vector vecSpot1; // 581 Vector vecSpot2 = pevTarget->origin + pevTarget->view_ofs;
// class Vector vecSpot2; // 582 TraceResult tr;
// TraceResult tr; // 583
// operator+(const class Vector *const this, UTIL_TraceLine(vecSpot1, vecSpot2, ignore_monsters, ENT(pev), &tr);
// const class Vector &v); // 581
// operator+(const class Vector *const this, if (tr.fInOpen && tr.fInWater)
// const class Vector &v); // 582 {
// } // sight line crossed contents
return FALSE;
}
if (tr.flFraction == 1.0f)
{
return TRUE;
}
return FALSE;
} }
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL

View File

@ -36,7 +36,7 @@
class CNullEntity: public CBaseEntity class CNullEntity: public CBaseEntity
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -50,8 +50,8 @@ public:
class CBaseDMStart: public CPointEntity class CBaseDMStart: public CPointEntity
{ {
public: public:
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual BOOL IsTriggered(CBaseEntity *pEntity); virtual BOOL IsTriggered(CBaseEntity *pEntity);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -64,6 +64,16 @@ public:
void FireTargets(const char *targetName, CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); void FireTargets(const char *targetName, CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
void SetMovedir(entvars_t *pev); 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 #endif // SUBS_H

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -38,15 +38,21 @@
#define MAX_ITEM_COUNTS 32 #define MAX_ITEM_COUNTS 32
#define MAX_ENTITY 512 // We can only ever move 512 entities across a transition #define MAX_ENTITY 512 // We can only ever move 512 entities across a transition
#define SF_TRIGGER_PUSH_START_OFF 2 // triggers
#define SF_TRIGGER_HURT_TARGETONCE 1 #define SF_TRIGGER_ALLOWMONSTERS 1 // monsters allowed to fire this trigger
#define SF_TRIGGER_HURT_START_OFF 2 #define SF_TRIGGER_NOCLIENTS 2 // players not allowed to fire this trigger
#define SF_TRIGGER_HURT_NO_CLIENTS 8 #define SF_TRIGGER_PUSHABLES 4 // only pushables can fire this trigger
#define SF_TRIGGER_HURT_CLIENTONLYFIRE 16
#define SF_TRIGGER_HURT_CLIENTONLYTOUCH 32 #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_AUTO_FIREONCE 0x0001
#define SF_RELAY_FIREONCE 0x0001 #define SF_RELAY_FIREONCE 0x0001
#define SF_ENDSECTION_USEONLY 0x0001
#define SF_MULTIMAN_CLONE 0x80000000 #define SF_MULTIMAN_CLONE 0x80000000
#define SF_MULTIMAN_THREAD 0x00000001 #define SF_MULTIMAN_THREAD 0x00000001
@ -56,14 +62,20 @@
#define SF_CAMERA_PLAYER_TARGET 2 #define SF_CAMERA_PLAYER_TARGET 2
#define SF_CAMERA_PLAYER_TAKECONTROL 4 #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 class CFrictionModifier: public CBaseEntity
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void) virtual int ObjectCaps(void)
{ {
return ObjectCaps_(); return ObjectCaps_();
} }
@ -82,7 +94,7 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
NOBODY void EXPORT ChangeFriction(CBaseEntity *pOther); void EXPORT ChangeFriction(CBaseEntity *pOther);
public: public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1]; static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[1];
@ -91,20 +103,23 @@ public:
};/* size: 156, cachelines: 3, members: 3 */ };/* 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 */ /* <19e39c> ../cstrike/dlls/triggers.cpp:108 */
class CAutoTrigger: public CBaseDelay class CAutoTrigger: public CBaseDelay
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void Precache(void); virtual void Precache(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void) virtual int ObjectCaps(void)
{ {
return ObjectCaps_(); return ObjectCaps_();
} }
NOBODY virtual void Think(void); virtual void Think(void);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -124,8 +139,8 @@ public:
public: public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[2]; static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[2];
int m_globalstate; // 160 int m_globalstate;
USE_TYPE triggerType; // 164 USE_TYPE triggerType;
};/* size: 168, cachelines: 3, members: 4 */ };/* size: 168, cachelines: 3, members: 4 */
@ -133,16 +148,15 @@ public:
class CTriggerRelay: public CBaseDelay class CTriggerRelay: public CBaseDelay
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void) virtual int ObjectCaps(void)
{ {
return ObjectCaps_(); 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);
public:
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -165,21 +179,25 @@ public:
};/* size: 164, cachelines: 3, members: 3 */ };/* 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 */ /* <19e4d6> ../cstrike/dlls/triggers.cpp:264 */
class CMultiManager: public CBaseToggle class CMultiManager: public CBaseToggle
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void Restart(void); virtual void Restart(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void) virtual int ObjectCaps(void)
{ {
return ObjectCaps_(); return ObjectCaps_();
} }
NOBODY virtual BOOL HasTarget(string_t targetname); virtual BOOL HasTarget(string_t targetname);
public:
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -196,27 +214,37 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
NOBODY void EXPORT ManagerThink(void); public:
NOBODY void EXPORT ManagerUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); void EXPORT ManagerThink(void);
void EXPORT ManagerUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
private: private:
/* <19dfe1> ../cstrike/dlls/triggers.cpp:293 */ /* <19dfe1> ../cstrike/dlls/triggers.cpp:293 */
inline BOOL IsClone(void) inline BOOL IsClone(void)
{ {
if (pev->spawnflags & SF_MULTIMAN_CLONE) if (pev->spawnflags & SF_MULTIMAN_CLONE)
{
return TRUE; return TRUE;
}
return FALSE; return FALSE;
} }
/* <19e4f3> ../cstrike/dlls/triggers.cpp:294 */ /* <19e4f3> ../cstrike/dlls/triggers.cpp:294 */
inline BOOL ShouldClone(void) inline BOOL ShouldClone(void)
{ {
if (IsClone()) if (IsClone())
return FALSE; {
if (pev->spawnflags & SF_MULTIMAN_THREAD)
return TRUE;
return FALSE; return FALSE;
} }
NOBODY CMultiManager *Clone(void);
if (pev->spawnflags & SF_MULTIMAN_THREAD)
{
return TRUE;
}
return FALSE;
}
CMultiManager *Clone(void);
public: public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[5]; static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[5];
@ -230,12 +258,17 @@ public:
};/* size: 452, cachelines: 8, members: 7 */ };/* size: 452, cachelines: 8, members: 7 */
/* Linux - 452 | Windows - 432 */ /* 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 */ /* <19e50c> ../cstrike/dlls/triggers.cpp:525 */
class CRenderFxManager: public CBaseEntity class CRenderFxManager: public CBaseEntity
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
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 #ifdef HOOK_GAMEDLL
@ -250,8 +283,8 @@ public:
class CBaseTrigger: public CBaseToggle class CBaseTrigger: public CBaseToggle
{ {
public: public:
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int ObjectCaps(void) virtual int ObjectCaps(void)
{ {
return ObjectCaps_(); return ObjectCaps_();
} }
@ -267,23 +300,26 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
NOBODY void EXPORT TeleportTouch(CBaseEntity *pOther); void EXPORT TeleportTouch(CBaseEntity *pOther);
NOBODY void EXPORT MultiTouch(CBaseEntity *pOther); void EXPORT MultiTouch(CBaseEntity *pOther);
NOBODY void EXPORT HurtTouch(CBaseEntity *pOther); void EXPORT HurtTouch(CBaseEntity *pOther);
NOXREF NOBODY void EXPORT CDAudioTouch(CBaseEntity *pOther); NOXREF void EXPORT CDAudioTouch(CBaseEntity *pOther);
NOBODY void ActivateMultiTrigger(CBaseEntity *pActivator); void ActivateMultiTrigger(CBaseEntity *pActivator);
NOBODY void EXPORT MultiWaitOver(void); void EXPORT MultiWaitOver(void);
NOBODY void EXPORT CounterUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); 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); void EXPORT ToggleUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
NOBODY void InitTrigger(void); void InitTrigger(void);
};/* size: 312, cachelines: 5, members: 1 */ };/* 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 */ /* <19e5b2> ../cstrike/dlls/triggers.cpp:629 */
class CTriggerHurt: public CBaseTrigger class CTriggerHurt: public CBaseTrigger
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -291,7 +327,7 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
NOBODY void EXPORT RadiationThink(void); void EXPORT RadiationThink(void);
};/* size: 312, cachelines: 5, members: 1 */ };/* size: 312, cachelines: 5, members: 1 */
@ -299,9 +335,9 @@ public:
class CTriggerMonsterJump: public CBaseTrigger class CTriggerMonsterJump: public CBaseTrigger
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void Think(void); virtual void Think(void);
NOBODY virtual void Touch(CBaseEntity *pOther); virtual void Touch(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -313,13 +349,15 @@ public:
};/* size: 312, cachelines: 5, members: 1 */ };/* size: 312, cachelines: 5, members: 1 */
// trigger_cdaudio - starts/stops cd audio tracks
/* <19e65d> ../cstrike/dlls/triggers.cpp:705 */ /* <19e65d> ../cstrike/dlls/triggers.cpp:705 */
class CTriggerCDAudio: public CBaseTrigger class CTriggerCDAudio: public CBaseTrigger
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void Touch(CBaseEntity *pOther); virtual void Touch(CBaseEntity *pOther);
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 #ifdef HOOK_GAMEDLL
@ -330,18 +368,20 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
NOBODY virtual void PlayTrack(void); virtual void PlayTrack(void);
};/* size: 312, cachelines: 5, members: 1 */ };/* 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 */ /* <19e6d2> ../cstrike/dlls/triggers.cpp:783 */
class CTargetCDAudio: public CPointEntity class CTargetCDAudio: public CPointEntity
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual void Think(void); virtual void Think(void);
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 #ifdef HOOK_GAMEDLL
@ -353,15 +393,30 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
NOBODY void Play(void); void Play(void);
};/* size: 152, cachelines: 3, members: 1 */ };/* 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 */ /* <19e725> ../cstrike/dlls/triggers.cpp:1080 */
class CTriggerMultiple: public CBaseTrigger class CTriggerMultiple: public CBaseTrigger
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -371,11 +426,23 @@ public:
};/* size: 312, cachelines: 5, members: 1 */ };/* 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 */ /* <19e77d> ../cstrike/dlls/triggers.cpp:1129 */
class CTriggerOnce: public CTriggerMultiple class CTriggerOnce: public CTriggerMultiple
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -385,11 +452,17 @@ public:
};/* size: 312, cachelines: 5, members: 1 */ };/* 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 */ /* <19e7d5> ../cstrike/dlls/triggers.cpp:1273 */
class CTriggerCounter: public CBaseTrigger class CTriggerCounter: public CBaseTrigger
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -399,11 +472,13 @@ public:
};/* size: 312, cachelines: 5, members: 1 */ };/* size: 312, cachelines: 5, members: 1 */
// Derive from point entity so this doesn't move across levels
/* <19e82d> ../cstrike/dlls/triggers.cpp:1293 */ /* <19e82d> ../cstrike/dlls/triggers.cpp:1293 */
class CTriggerVolume: public CPointEntity class CTriggerVolume: public CPointEntity
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -413,17 +488,19 @@ public:
};/* size: 152, cachelines: 3, members: 1 */ };/* size: 152, cachelines: 3, members: 1 */
// Fires a target after level transition and then dies
/* <19e885> ../cstrike/dlls/triggers.cpp:1313 */ /* <19e885> ../cstrike/dlls/triggers.cpp:1313 */
class CFireAndDie: public CBaseDelay class CFireAndDie: public CBaseDelay
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void Precache(void); virtual void Precache(void);
NOBODY virtual int ObjectCaps(void) virtual int ObjectCaps(void) // Always go across transitions
{ {
return ObjectCaps_(); return ObjectCaps_();
} }
NOBODY virtual void Think(void); virtual void Think(void);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -439,14 +516,17 @@ public:
};/* size: 160, cachelines: 3, members: 1 */ };/* 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 */ /* <19e906> ../cstrike/dlls/triggers.cpp:1345 */
class CChangeLevel: public CBaseTrigger class CChangeLevel: public CBaseTrigger
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -458,12 +538,11 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
NOBODY void EXPORT UseChangeLevel(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); void EXPORT UseChangeLevel(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
NOXREF NOBODY void EXPORT TriggerChangeLevel(void); NOXREF void EXPORT TriggerChangeLevel(void);
NOBODY void EXPORT ExecuteChangeLevel(void); void EXPORT ExecuteChangeLevel(void);
NOBODY void EXPORT TouchChangeLevel(CBaseEntity *pOther); void EXPORT TouchChangeLevel(CBaseEntity *pOther);
void ChangeLevelNow(CBaseEntity *pActivator);
NOBODY void ChangeLevelNow(CBaseEntity *pActivator);
static edict_t *FindLandmark(const char *pLandmarkName); static edict_t *FindLandmark(const char *pLandmarkName);
static int ChangeList(LEVELLIST *pLevelList, int maxList); static int ChangeList(LEVELLIST *pLevelList, int maxList);
@ -473,8 +552,8 @@ public:
public: public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[4]; static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[4];
char m_szMapName[ cchMapNameMost ]; char m_szMapName[ cchMapNameMost ]; // trigger_changelevel only: next map
char m_szLandmarkName[ cchMapNameMost ]; char m_szLandmarkName[ cchMapNameMost ]; // trigger_changelevel only: landmark on next map
int m_changeTarget; int m_changeTarget;
float m_changeTargetDelay; float m_changeTargetDelay;
@ -484,9 +563,9 @@ public:
class CLadder: public CBaseTrigger class CLadder: public CBaseTrigger
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void Precache(void); virtual void Precache(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -502,9 +581,9 @@ public:
class CTriggerPush: public CBaseTrigger class CTriggerPush: public CBaseTrigger
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual void Touch(CBaseEntity *pOther); virtual void Touch(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -520,7 +599,7 @@ public:
class CTriggerTeleport: public CBaseTrigger class CTriggerTeleport: public CBaseTrigger
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -534,7 +613,7 @@ public:
class CBuyZone: public CBaseTrigger class CBuyZone: public CBaseTrigger
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -542,7 +621,7 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
NOBODY void EXPORT BuyTouch(CBaseEntity *pOther); void EXPORT BuyTouch(CBaseEntity *pOther);
};/* size: 312, cachelines: 5, members: 1 */ };/* size: 312, cachelines: 5, members: 1 */
@ -550,7 +629,7 @@ public:
class CBombTarget: public CBaseTrigger class CBombTarget: public CBaseTrigger
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -559,8 +638,8 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
NOBODY void EXPORT BombTargetTouch(CBaseEntity *pOther); void EXPORT BombTargetTouch(CBaseEntity *pOther);
NOBODY void EXPORT BombTargetUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); void EXPORT BombTargetUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
};/* size: 312, cachelines: 5, members: 1 */ };/* size: 312, cachelines: 5, members: 1 */
@ -568,7 +647,7 @@ public:
class CHostageRescue: public CBaseTrigger class CHostageRescue: public CBaseTrigger
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -577,7 +656,7 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
NOBODY void EXPORT HostageRescueTouch(CBaseEntity *pOther); void EXPORT HostageRescueTouch(CBaseEntity *pOther);
};/* size: 312, cachelines: 5, members: 1 */ };/* size: 312, cachelines: 5, members: 1 */
@ -585,7 +664,7 @@ public:
class CEscapeZone: public CBaseTrigger class CEscapeZone: public CBaseTrigger
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -593,7 +672,7 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
NOBODY void EXPORT EscapeTouch(CBaseEntity *pOther); void EXPORT EscapeTouch(CBaseEntity *pOther);
};/* size: 312, cachelines: 5, members: 1 */ };/* size: 312, cachelines: 5, members: 1 */
@ -601,7 +680,7 @@ public:
class CVIP_SafetyZone: public CBaseTrigger class CVIP_SafetyZone: public CBaseTrigger
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -609,7 +688,7 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
NOBODY void EXPORT VIP_SafetyTouch(CBaseEntity *pOther); void EXPORT VIP_SafetyTouch(CBaseEntity *pOther);
};/* size: 312, cachelines: 5, members: 1 */ };/* size: 312, cachelines: 5, members: 1 */
@ -617,7 +696,7 @@ public:
class CTriggerSave: public CBaseTrigger class CTriggerSave: public CBaseTrigger
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -625,7 +704,7 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
NOBODY void EXPORT SaveTouch(CBaseEntity *pOther); void EXPORT SaveTouch(CBaseEntity *pOther);
};/* size: 312, cachelines: 5, members: 1 */ };/* size: 312, cachelines: 5, members: 1 */
@ -633,8 +712,8 @@ public:
class CTriggerEndSection: public CBaseTrigger class CTriggerEndSection: public CBaseTrigger
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -644,16 +723,16 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
NOBODY void EXPORT EndSectionTouch(CBaseEntity *pOther); void EXPORT EndSectionTouch(CBaseEntity *pOther);
NOBODY void EXPORT EndSectionUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); void EXPORT EndSectionUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
};/* size: 312, cachelines: 5, members: 1 */
};/* size: 312, cachelines: 5, members: 1 */
/* <19ed25> ../cstrike/dlls/triggers.cpp:2305 */ /* <19ed25> ../cstrike/dlls/triggers.cpp:2305 */
class CTriggerGravity: public CBaseTrigger class CTriggerGravity: public CBaseTrigger
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -661,23 +740,25 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
NOBODY void EXPORT GravityTouch(CBaseEntity *pOther); void EXPORT GravityTouch(CBaseEntity *pOther);
};/* size: 312, cachelines: 5, members: 1 */ };/* size: 312, cachelines: 5, members: 1 */
// this is a really bad idea.
/* <19ed7d> ../cstrike/dlls/triggers.cpp:2335 */ /* <19ed7d> ../cstrike/dlls/triggers.cpp:2335 */
class CTriggerChangeTarget: public CBaseDelay class CTriggerChangeTarget: public CBaseDelay
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
virtual int ObjectCaps(void) 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 #ifdef HOOK_GAMEDLL
@ -705,15 +786,15 @@ private:
class CTriggerCamera: public CBaseDelay class CTriggerCamera: public CBaseDelay
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
NOBODY virtual int ObjectCaps(void) virtual int ObjectCaps(void)
{ {
return ObjectCaps_(); 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 #ifdef HOOK_GAMEDLL
@ -730,8 +811,8 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
NOBODY void EXPORT FollowTarget(void); void EXPORT FollowTarget(void);
NOBODY void Move(void); void Move(void);
public: public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[13]; static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[13];
@ -756,16 +837,12 @@ public:
class CWeather: public CBaseTrigger class CWeather: public CBaseTrigger
{ {
public: public:
NOBODY virtual void Spawn(void) virtual void Spawn(void);
{
Spawn_();
}
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
void Spawn_(void)
{ void Spawn_(void);
InitTrigger();
}
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
};/* size: 312, cachelines: 5, members: 1 */ };/* size: 312, cachelines: 5, members: 1 */
@ -774,8 +851,8 @@ public:
class CClientFog: public CBaseEntity class CClientFog: public CBaseEntity
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -791,8 +868,59 @@ public:
};/* size: 164, cachelines: 3, members: 4 */ };/* size: 164, cachelines: 3, members: 4 */
NOBODY void PlayCDTrack(int iTrack); #ifdef HOOK_GAMEDLL
NOBODY int BuildChangeList(LEVELLIST * pLevelList, int maxList);
NOBODY void NextLevel(void); #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 #endif // TRIGGERS_H

View File

@ -71,12 +71,6 @@ public:
virtual bool UpdateState(GameEventType event, CBaseEntity *entity, CBaseEntity *other); virtual bool UpdateState(GameEventType event, CBaseEntity *entity, CBaseEntity *other);
virtual char *GetCurrentStateString(void); virtual char *GetCurrentStateString(void);
#ifndef HOOK_GAMEDLL
protected:
#endif // HOOK_GAMEDLL
virtual CBaseTutorState *ConstructNewState(int stateType);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
public: public:
@ -86,6 +80,12 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
#ifndef HOOK_GAMEDLL
protected:
#endif // HOOK_GAMEDLL
virtual CBaseTutorState *ConstructNewState(int stateType);
};/* size: 8, cachelines: 1, members: 1 */ };/* size: 8, cachelines: 1, members: 1 */
/* <22bfcb> ../cstrike/dlls/tutor_cs_states.cpp:141 */ /* <22bfcb> ../cstrike/dlls/tutor_cs_states.cpp:141 */

View File

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

View File

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

View File

@ -1,6 +1,6 @@
#include "precompiled.h" #include "precompiled.h"
#if 0 #if 1
void *addr_orig; void *addr_orig;
char patchByte[5]; char patchByte[5];
@ -1009,7 +1009,7 @@ float UTIL_Approach(float target, float value, float speed)
} }
/* <1aedeb> ../cstrike/dlls/util.cpp:1190 */ /* <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); target = UTIL_AngleMod(target);
value = 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 */ /* <1aeec5> ../cstrike/dlls/util.cpp:1217 */
float UTIL_AngleDistance(float next, float cur) float_precision UTIL_AngleDistance(float next, float cur)
{ {
float_precision delta; float_precision delta;
@ -1048,17 +1048,6 @@ float UTIL_AngleDistance(float next, float cur)
return delta; 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 */ /* <1aef1c> ../cstrike/dlls/util.cpp:1230 */
float UTIL_SplineFraction(float value, float scale) 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.y);
WRITE_COORD(direction.z); WRITE_COORD(direction.z);
WRITE_BYTE(color); WRITE_BYTE(color);
WRITE_BYTE(_min( amount, 255 )); WRITE_BYTE(Q_min(amount, 255));
MESSAGE_END(); 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_sModelIndexBloodSpray);
WRITE_SHORT(g_sModelIndexBloodDrop); WRITE_SHORT(g_sModelIndexBloodDrop);
WRITE_BYTE(color); WRITE_BYTE(color);
WRITE_BYTE(_min( _max( 3, amount / 10 ), 16 )); WRITE_BYTE(Q_min(Q_max(3, amount / 10), 16));
MESSAGE_END(); MESSAGE_END();
} }
@ -2433,28 +2422,35 @@ char UTIL_TextureHit(TraceResult *ptr, Vector vecSrc, Vector vecEnd)
NOXREF int GetPlayerTeam(int index) NOXREF int GetPlayerTeam(int index)
{ {
CBasePlayer *pPlayer = (CBasePlayer *)UTIL_PlayerByIndex(index); CBasePlayer *pPlayer = (CBasePlayer *)UTIL_PlayerByIndex(index);
if (pPlayer) if (pPlayer != NULL)
{
return pPlayer->m_iTeam; return pPlayer->m_iTeam;
}
return 0; return 0;
} }
/* <1b5412> ../cstrike/dlls/util.cpp:2775 */ /* <1b5412> ../cstrike/dlls/util.cpp:2775 */
bool UTIL_IsGame(const char *gameName) bool UTIL_IsGame(const char *gameName)
{ {
if (gameName) if (gameName != NULL)
{ {
static char gameDir[256]; static char gameDir[256];
GET_GAME_DIR(gameDir); GET_GAME_DIR(gameDir);
return (Q_stricmp(gameDir, gameName) == 0); return (Q_stricmp(gameDir, gameName) == 0);
} }
return false; return false;
} }
/* <1b5470> ../cstrike/dlls/util.cpp:2802 */ /* <1b5470> ../cstrike/dlls/util.cpp:2802 */
float UTIL_GetPlayerGaitYaw(int playerIndex) float_precision UTIL_GetPlayerGaitYaw(int playerIndex)
{ {
CBasePlayer *pPlayer = (CBasePlayer *)UTIL_PlayerByIndex(playerIndex); CBasePlayer *pPlayer = (CBasePlayer *)UTIL_PlayerByIndex(playerIndex);
if (pPlayer) if (pPlayer != NULL)
{
return pPlayer->m_flGaityaw; return pPlayer->m_flGaityaw;
return 0.0f; }
return 0;
} }

View File

@ -64,7 +64,11 @@
#define CBSENTENCENAME_MAX 16 #define CBSENTENCENAME_MAX 16
#define CVOXFILESENTENCEMAX 1536 // max number of sentences in game. NOTE: this must match CVOXFILESENTENCEMAX in engine\sound.h!!! #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 #define WEAPON_TIMEBASED 0.0f
#else
#define WEAPON_TIMEBASED gpGlobals->time
#endif // CLIENT_WEAPONS
#define GROUP_OP_AND 0 #define GROUP_OP_AND 0
#define GROUP_OP_NAND 1 #define GROUP_OP_NAND 1
@ -103,6 +107,25 @@ extern globalvars_t *gpGlobals;
#define SVC_ROOMTYPE 37 #define SVC_ROOMTYPE 37
#define SVC_DIRECTOR 51 #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_HULL_MIN_Z Vector(0, 0, -36)
#define VEC_DUCK_HULL_MIN_Z Vector(0, 0, -18) #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); void UTIL_SetOrigin(entvars_t *pev, const Vector &vecOrigin);
NOXREF void UTIL_ParticleEffect(const Vector &vecOrigin, const Vector &vecDirection, ULONG ulColor, ULONG ulCount); 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_Approach(float target, float value, float speed);
float UTIL_ApproachAngle(float target, float value, float speed); float_precision UTIL_ApproachAngle(float target, float value, float speed);
float UTIL_AngleDistance(float next, float cur); float_precision UTIL_AngleDistance(float next, float cur);
float UTIL_SplineFraction(float value, float scale); float UTIL_SplineFraction(float value, float scale);
char *UTIL_VarArgs(char *format, ...); char *UTIL_VarArgs(char *format, ...);
NOXREF Vector UTIL_GetAimVector(edict_t *pent, float flSpeed); 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); char UTIL_TextureHit(TraceResult *ptr, Vector vecSrc, Vector vecEnd);
NOXREF int GetPlayerTeam(int index); NOXREF int GetPlayerTeam(int index);
bool UTIL_IsGame(const char *gameName); bool UTIL_IsGame(const char *gameName);
float UTIL_GetPlayerGaitYaw(int playerIndex); float_precision UTIL_GetPlayerGaitYaw(int playerIndex);
/* /*
* Declared for function overload * Declared for function overload
@ -478,7 +501,7 @@ typedef int (CSaveRestoreBuffer::*CSAVERESTOREBUFFER_POINTER)(const char *,const
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
#if 0 #if 1
extern void *addr_orig; extern void *addr_orig;
extern char patchByte[5]; extern char patchByte[5];
@ -486,8 +509,4 @@ extern char patchByteOriginal[5];
#endif #endif
// Refs
extern Vector (*pFireBullets3)(Vector, Vector, float, float, int, int, int, float, entvars_t *, bool, int);
#endif // UTIL_H #endif // UTIL_H

View File

@ -130,6 +130,7 @@ public:
return (x > -tolerance && x < tolerance && return (x > -tolerance && x < tolerance &&
y > -tolerance && y < tolerance); y > -tolerance && y < tolerance);
} }
};/* size: 8, cachelines: 1, members: 2 */ };/* size: 8, cachelines: 1, members: 2 */
inline float DotProduct(const Vector2D &a, const Vector2D &b) inline float DotProduct(const Vector2D &a, const Vector2D &b)
@ -227,7 +228,6 @@ public:
float_precision y1 = (float_precision)y; float_precision y1 = (float_precision)y;
float_precision z1 = (float_precision)z; float_precision z1 = (float_precision)z;
return sqrt(x1 * x1 + y1 * y1 + z1 * z1); return sqrt(x1 * x1 + y1 * y1 + z1 * z1);
//return sqrt((float_precision)(x * x + y * y + z * z)); //return sqrt((float_precision)(x * x + y * y + z * z));
@ -356,7 +356,7 @@ template<
typename Z, typename Z,
typename LenType typename LenType
> >
inline LenType LenghtSubtract(Vector vecStart, Vector vecDest) inline LenType LengthSubtract(Vector vecStart, Vector vecDest)
{ {
X floatX = (vecDest.x - vecStart.x); X floatX = (vecDest.x - vecStart.x);
Y floatY = (vecDest.y - vecStart.y); Y floatY = (vecDest.y - vecStart.y);

File diff suppressed because it is too large Load Diff

View File

@ -46,7 +46,6 @@
#define VEHICLE_SPEED11_ACCELERATION 0.001444444444444444 #define VEHICLE_SPEED11_ACCELERATION 0.001444444444444444
#define VEHICLE_SPEED12_ACCELERATION 0.001200000000000000 #define VEHICLE_SPEED12_ACCELERATION 0.001200000000000000
#define VEHICLE_SPEED13_ACCELERATION 0.000916666666666666 #define VEHICLE_SPEED13_ACCELERATION 0.000916666666666666
#define VEHICLE_SPEED14_ACCELERATION 0.001444444444444444
#define VEHICLE_STARTPITCH 60 #define VEHICLE_STARTPITCH 60
#define VEHICLE_MAXPITCH 200 #define VEHICLE_MAXPITCH 200
@ -56,8 +55,8 @@
class CFuncVehicleControls: public CBaseEntity class CFuncVehicleControls: public CBaseEntity
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual int ObjectCaps(void) virtual int ObjectCaps(void)
{ {
return ObjectCaps_(); return ObjectCaps_();
} }
@ -73,10 +72,15 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
NOBODY void EXPORT Find(void); void EXPORT Find(void);
};/* size: 152, cachelines: 3, members: 1 */ };/* 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 #endif // VEHICLE_H

File diff suppressed because it is too large Load Diff

View File

@ -37,7 +37,7 @@
class CBasePlayer; class CBasePlayer;
#define MAX_WEAPONS 32 #define MAX_WEAPONS 32
#define MAX_NORMAL_BATTERY 100 #define MAX_NORMAL_BATTERY 100.0f
#define ITEM_FLAG_SELECTONEMPTY 1 #define ITEM_FLAG_SELECTONEMPTY 1
#define ITEM_FLAG_NOAUTORELOAD 2 #define ITEM_FLAG_NOAUTORELOAD 2
@ -71,6 +71,30 @@ class CBasePlayer;
// spawn flags // spawn flags
#define SF_DETONATE 0x0001 // Grenades flagged with this will be triggered when the owner calls detonateSatchelCharges #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 typedef struct
{ {
WeaponType type; WeaponType type;
@ -118,17 +142,28 @@ typedef struct
class CArmoury: public CBaseEntity class CArmoury: public CBaseEntity
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void Precache(void); virtual void Precache(void);
NOBODY virtual void Restart(void); virtual void Restart(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); 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: public:
NOBODY void EXPORT ArmouryTouch(CBaseEntity *pOther); void EXPORT ArmouryTouch(CBaseEntity *pOther);
public: public:
int m_iItem; int m_iItem;
int m_iCount; int m_iCount;
int m_iInitialCount; int m_iInitialCount;
bool m_bAlreadyCounted; bool m_bAlreadyCounted;
};/* size: 168, cachelines: 3, members: 5 */ };/* size: 168, cachelines: 3, members: 5 */
/* <14ed46> ../cstrike/dlls/weapons.h:56 */ /* <14ed46> ../cstrike/dlls/weapons.h:56 */
@ -252,11 +287,11 @@ public:
class CBasePlayerItem: public CBaseAnimating class CBasePlayerItem: public CBaseAnimating
{ {
public: public:
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
NOBODY virtual void SetObjectCollisionBox(void); virtual void SetObjectCollisionBox(void);
NOBODY virtual CBaseEntity *Respawn(void); virtual CBaseEntity *Respawn(void);
NOXREF virtual int AddToPlayer(CBasePlayer *pPlayer); virtual int AddToPlayer(CBasePlayer *pPlayer);
virtual int AddDuplicate(CBasePlayerItem *pItem) virtual int AddDuplicate(CBasePlayerItem *pItem)
{ {
return FALSE; return FALSE;
@ -294,7 +329,7 @@ public:
virtual void Drop(void); virtual void Drop(void);
virtual void Kill(void); virtual void Kill(void);
NOBODY virtual void AttachToPlayer(CBasePlayer *pPlayer); virtual void AttachToPlayer(CBasePlayer *pPlayer);
virtual int PrimaryAmmoIndex(void) virtual int PrimaryAmmoIndex(void)
{ {
return -1; return -1;
@ -351,11 +386,11 @@ public:
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
public: public:
NOBODY void EXPORT DestroyItem(void); void EXPORT DestroyItem(void);
void EXPORT DefaultTouch(CBaseEntity *pOther); void EXPORT DefaultTouch(CBaseEntity *pOther);
void EXPORT FallThink(void); void EXPORT FallThink(void);
void EXPORT Materialize(void); void EXPORT Materialize(void);
NOBODY void EXPORT AttemptToMaterialize(void); void EXPORT AttemptToMaterialize(void);
void FallInit(void); void FallInit(void);
void CheckRespawn(void); void CheckRespawn(void);
@ -412,21 +447,21 @@ public:
class CBasePlayerWeapon: public CBasePlayerItem class CBasePlayerWeapon: public CBasePlayerItem
{ {
public: public:
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
virtual int AddToPlayer(CBasePlayer *pPlayer); virtual int AddToPlayer(CBasePlayer *pPlayer);
virtual int AddDuplicate(CBasePlayerItem *pItem); virtual int AddDuplicate(CBasePlayerItem *pItem);
NOBODY virtual BOOL CanDeploy(void); virtual BOOL CanDeploy(void);
virtual BOOL IsWeapon(void) virtual BOOL IsWeapon(void)
{ {
return TRUE; return TRUE;
} }
NOBODY virtual void Holster(int skiplocal = 0); virtual void Holster(int skiplocal = 0);
virtual void UpdateItemInfo(void) {}; virtual void UpdateItemInfo(void) {};
NOBODY virtual void ItemPostFrame(void); virtual void ItemPostFrame(void);
NOBODY virtual int PrimaryAmmoIndex(void); virtual int PrimaryAmmoIndex(void);
NOBODY virtual int SecondaryAmmoIndex(void); virtual int SecondaryAmmoIndex(void);
virtual int UpdateClientData(CBasePlayer *pPlayer); virtual int UpdateClientData(CBasePlayer *pPlayer);
virtual CBasePlayerItem *GetWeaponPtr(void) virtual CBasePlayerItem *GetWeaponPtr(void)
{ {
@ -442,12 +477,12 @@ public:
virtual BOOL PlayEmptySound(void); virtual BOOL PlayEmptySound(void);
virtual void ResetEmptySound(void); virtual void ResetEmptySound(void);
virtual void SendWeaponAnim(int iAnim, int skiplocal = 0); virtual void SendWeaponAnim(int iAnim, int skiplocal = 0);
NOBODY virtual BOOL IsUseable(void); virtual BOOL IsUseable(void);
virtual void PrimaryAttack(void) {} virtual void PrimaryAttack(void) {};
virtual void SecondaryAttack(void) {} virtual void SecondaryAttack(void) {};
virtual void Reload(void) {} virtual void Reload(void) {};
virtual void WeaponIdle(void) {} virtual void WeaponIdle(void) {};
NOBODY virtual void RetireWeapon(void); virtual void RetireWeapon(void);
virtual BOOL ShouldWeaponIdle(void) virtual BOOL ShouldWeaponIdle(void)
{ {
return FALSE; return FALSE;
@ -481,18 +516,18 @@ public:
public: public:
BOOL AddPrimaryAmmo(int iCount, char *szName, int iMaxClip, int iMaxCarry); BOOL AddPrimaryAmmo(int iCount, char *szName, int iMaxClip, int iMaxCarry);
NOXREF BOOL AddSecondaryAmmo(int iCount,char *szName,int iMaxCarry); BOOL AddSecondaryAmmo(int iCount, char *szName, int iMaxCarry);
BOOL DefaultDeploy(char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal = 0); BOOL DefaultDeploy(char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal = 0);
int DefaultReload(int iClipSize, int iAnim, float fDelay); int DefaultReload(int iClipSize, int iAnim, float fDelay);
NOBODY void FireRemaining(int &shotsFired,float &shootTime,BOOL isGlock18); 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); 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); void EjectBrassLate(void);
NOBODY void MakeBeam(void); NOXREF void MakeBeam(void);
NOBODY void BeamUpdate(void); NOXREF void BeamUpdate(void);
void ReloadSound(void); void ReloadSound(void);
float GetNextAttackDelay(float delay); float GetNextAttackDelay(float delay);
float GetNextAttackDelay2(float delay); float GetNextAttackDelay2(float delay);
NOBODY bool HasSecondaryAttack(void); bool HasSecondaryAttack(void);
BOOL IsPistol(void) BOOL IsPistol(void)
{ {
return FALSE; return FALSE;
@ -502,7 +537,6 @@ public:
bool ShieldSecondaryFire(int iUpAnim,int iDownAnim); bool ShieldSecondaryFire(int iUpAnim,int iDownAnim);
public: public:
static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[7]; static TYPEDESCRIPTION IMPLEMENT_ARRAY(m_SaveData)[7];
int m_iPlayEmptySound; int m_iPlayEmptySound;
@ -553,30 +587,29 @@ public:
return TRUE; return TRUE;
} }
virtual CBaseEntity *Respawn(void); virtual CBaseEntity *Respawn(void);
#ifdef HOOK_GAMEDLL
void Spawn_(void);
CBaseEntity *Respawn_(void);
#endif // HOOK_GAMEDLL
public: public:
void EXPORT DefaultTouch(CBaseEntity *pOther); void EXPORT DefaultTouch(CBaseEntity *pOther);
void EXPORT Materialize(void); 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 */ };/* size: 152, cachelines: 3, members: 1 */
/* <1d03c1> ../cstrike/dlls/weapons.h:508 */ /* <1d03c1> ../cstrike/dlls/weapons.h:508 */
class CWeaponBox: public CBaseEntity class CWeaponBox: public CBaseEntity
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void Precache(void); virtual void Precache(void);
NOBODY virtual void KeyValue(KeyValueData *pkvd); virtual void KeyValue(KeyValueData *pkvd);
NOBODY virtual int Save(CSave &save); virtual int Save(CSave &save);
NOBODY virtual int Restore(CRestore &restore); virtual int Restore(CRestore &restore);
NOBODY virtual void SetObjectCollisionBox(void); virtual void SetObjectCollisionBox(void);
NOBODY virtual void Touch(CBaseEntity *pOther); virtual void Touch(CBaseEntity *pOther);
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
@ -617,7 +650,7 @@ class CUSP: public CBasePlayerWeapon
{ {
public: public:
virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void Precache(void); virtual void Precache(void);
virtual int GetItemInfo(ItemInfo *p); virtual int GetItemInfo(ItemInfo *p);
virtual BOOL Deploy(void); virtual BOOL Deploy(void);
virtual float GetMaxSpeed(void) virtual float GetMaxSpeed(void)
@ -628,8 +661,8 @@ public:
{ {
return PISTOL_SLOT; return PISTOL_SLOT;
} }
NOBODY virtual void PrimaryAttack(void); virtual void PrimaryAttack(void);
NOBODY virtual void SecondaryAttack(void); virtual void SecondaryAttack(void);
virtual void Reload(void); virtual void Reload(void);
virtual void WeaponIdle(void); virtual void WeaponIdle(void);
virtual BOOL UseDecrement(void) virtual BOOL UseDecrement(void)
@ -640,9 +673,22 @@ public:
{ {
return TRUE; 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: public:
//TOOD: this func changed access to private?! void USPFire(float flSpread,float flCycleTime,BOOL fUseSemi);
UNTESTED void USPFire(float flSpread,float flCycleTime,BOOL fUseSemi);
NOXREF void MakeBeam(void); NOXREF void MakeBeam(void);
NOXREF void BeamUpdate(void); NOXREF void BeamUpdate(void);
public: public:
@ -650,34 +696,6 @@ public:
private: private:
unsigned short m_usFireUSP; 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 */ };/* size: 344, cachelines: 6, members: 3 */
/* <28adc9> ../cstrike/dlls/weapons.h:599 */ /* <28adc9> ../cstrike/dlls/weapons.h:599 */
@ -710,6 +728,7 @@ public:
int iShellOn; int iShellOn;
private: private:
unsigned short m_usFireMP5N; unsigned short m_usFireMP5N;
};/* size: 348, cachelines: 6, members: 4 */ };/* size: 348, cachelines: 6, members: 4 */
/* <2a553c> ../cstrike/dlls/weapons.h:624 */ /* <2a553c> ../cstrike/dlls/weapons.h:624 */
@ -766,6 +785,19 @@ public:
{ {
return TRUE; 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: public:
NOBODY void AK47Fire(float flSpread,float flCycleTime,BOOL fUseAutoAim); NOBODY void AK47Fire(float flSpread,float flCycleTime,BOOL fUseAutoAim);
@ -813,29 +845,59 @@ private:
class CAWP: public CBasePlayerWeapon class CAWP: public CBasePlayerWeapon
{ {
public: public:
NOBODY virtual void Spawn(void); virtual void Spawn(void);
NOBODY virtual void Precache(void); virtual void Precache(void);
NOBODY virtual int GetItemInfo(ItemInfo *p); virtual int GetItemInfo(ItemInfo *p);
NOBODY virtual BOOL Deploy(void); virtual BOOL Deploy(void);
NOBODY virtual float GetMaxSpeed(void); virtual float GetMaxSpeed(void);
virtual int iItemSlot(void) virtual int iItemSlot(void)
{ {
return PRIMARY_WEAPON_SLOT; return PRIMARY_WEAPON_SLOT;
} }
NOBODY virtual void PrimaryAttack(void); virtual void PrimaryAttack(void);
NOBODY virtual void SecondaryAttack(void); virtual void SecondaryAttack(void);
NOBODY virtual void Reload(void); virtual void Reload(void);
NOBODY virtual void WeaponIdle(void); virtual void WeaponIdle(void);
virtual BOOL UseDecrement(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; return TRUE;
} }
#endif // HOOK_GAMEDLL
public: public:
NOBODY void AWPFire(float flSpread,float flCycleTime,BOOL fUseAutoAim); void AWPFire(float flSpread,float flCycleTime,BOOL fUseAutoAim);
public: public:
int m_iShell; int m_iShell;
private: private:
unsigned short m_usFireAWP; unsigned short m_usFireAWP;
};/* size: 344, cachelines: 6, members: 3 */ };/* size: 344, cachelines: 6, members: 3 */
/* <245949> ../cstrike/dlls/weapons.h:721 */ /* <245949> ../cstrike/dlls/weapons.h:721 */
@ -1260,10 +1322,7 @@ public:
NOBODY virtual void Precache(void); NOBODY virtual void Precache(void);
NOBODY virtual int GetItemInfo(ItemInfo *p); NOBODY virtual int GetItemInfo(ItemInfo *p);
NOBODY virtual BOOL Deploy(void); NOBODY virtual BOOL Deploy(void);
virtual float GetMaxSpeed(void) virtual float GetMaxSpeed(void);
{
return 245.0f;
}
virtual int iItemSlot(void) virtual int iItemSlot(void)
{ {
return PRIMARY_WEAPON_SLOT; return PRIMARY_WEAPON_SLOT;
@ -1275,6 +1334,20 @@ public:
{ {
return TRUE; 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: public:
NOBODY void P90Fire(float flSpread,float flCycleTime,BOOL fUseAutoAim); NOBODY void P90Fire(float flSpread,float flCycleTime,BOOL fUseAutoAim);
public: public:
@ -1307,10 +1380,13 @@ public:
} }
public: public:
NOBODY void SCOUTFire(float flSpread,float flCycleTime,BOOL fUseAutoAim); NOBODY void SCOUTFire(float flSpread,float flCycleTime,BOOL fUseAutoAim);
public: public:
int m_iShell; int m_iShell;
private: private:
unsigned short m_usFireScout; unsigned short m_usFireScout;
};/* size: 344, cachelines: 6, members: 3 */ };/* size: 344, cachelines: 6, members: 3 */
/* <2aa3d5> ../cstrike/dlls/weapons.h:1089 */ /* <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 AddMultiDamage(entvars_t *pevInflictor, CBaseEntity *pEntity, float flDamage, int bitsDamageType);
void SpawnBlood(Vector vecSpot, int bloodColor, float flDamage); void SpawnBlood(Vector vecSpot, int bloodColor, float flDamage);
NOXREF int DamageDecal(CBaseEntity *pEntity, int bitsDamageType); NOXREF int DamageDecal(CBaseEntity *pEntity, int bitsDamageType);
NOXREF void DecalGunshot(TraceResult *pTrace, int iBulletType, bool ClientOnly, entvars_t *pShooter, bool bHitMetal); 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); void EjectBrass(const Vector &vecOrigin, const Vector &vecLeft, const 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 EjectBrass2(const Vector &vecOrigin, const Vector &vecVelocity, float rotation, int model, int soundtype, entvars_t *pev);
NOXREF void AddAmmoNameToAmmoRegistry(const char *szAmmoname); void AddAmmoNameToAmmoRegistry(const char *szAmmoname);
void UTIL_PrecacheOtherWeapon(const char *szClassname); void UTIL_PrecacheOtherWeapon(const char *szClassname);
NOXREF void UTIL_PrecacheOtherWeapon2(const char *szClassname); NOXREF void UTIL_PrecacheOtherWeapon2(const char *szClassname);
void W_Precache(void); 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 // linked object
C_DLLEXPORT void weapon_knife(entvars_t *pev);
C_DLLEXPORT void weapon_usp(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 #endif // WEAPONS_H

View File

@ -237,6 +237,7 @@ WeaponIdType AliasToWeaponID(const char *alias)
return weaponAliasInfo[i].id; return weaponAliasInfo[i].id;
} }
} }
return WEAPON_NONE; return WEAPON_NONE;
} }
@ -254,6 +255,7 @@ const char *BuyAliasToWeaponID(const char *alias, WeaponIdType &id)
} }
} }
} }
id = WEAPON_NONE; id = WEAPON_NONE;
return NULL; return NULL;
} }
@ -266,6 +268,7 @@ const char *WeaponIDToAlias(int id)
if (weaponAliasInfo[i].id == id) if (weaponAliasInfo[i].id == id)
return weaponAliasInfo[i].alias; return weaponAliasInfo[i].alias;
} }
return NULL; return NULL;
} }
@ -280,6 +283,7 @@ WeaponClassType AliasToWeaponClass(const char *alias)
return weaponClassAliasInfo[i].id; return weaponClassAliasInfo[i].id;
} }
} }
return WEAPONCLASS_NONE; return WEAPONCLASS_NONE;
} }
@ -313,12 +317,11 @@ bool IsPrimaryWeapon(int id)
case WEAPON_AK47: case WEAPON_AK47:
case WEAPON_P90: case WEAPON_P90:
case WEAPON_SHIELDGUN: case WEAPON_SHIELDGUN:
{
return true; return true;
}
default: default:
break; break;
} }
return false; return false;
} }
@ -337,6 +340,7 @@ NOXREF bool IsSecondaryWeapon(int id)
default: default:
break; break;
} }
return false; return false;
} }
@ -348,6 +352,7 @@ WeaponInfoStruct *GetWeaponInfo(int weaponID)
if (weaponInfo[i].id == weaponID) if (weaponInfo[i].id == weaponID)
return &weaponInfo[i]; return &weaponInfo[i];
} }
return NULL; return NULL;
} }
@ -474,5 +479,6 @@ bool CanBuyWeaponByMaptype(int playerTeam, WeaponIdType weaponID, bool useAssasi
} }
} }
} }
return false; return false;
} }

View File

@ -138,6 +138,41 @@ enum WeaponState
WPNSTATE_SHIELD_DRAWN = (1 << 5), 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 enum ClipSizeType
{ {
P228_MAX_CLIP = 13, P228_MAX_CLIP = 13,
@ -166,6 +201,39 @@ enum ClipSizeType
P90_MAX_CLIP = 50, 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 enum MaxAmmoType
{ {
MAX_AMMO_BUCKSHOT = 32, MAX_AMMO_BUCKSHOT = 32,

View File

@ -4,32 +4,32 @@
LINK_ENTITY_TO_CLASS(weapon_ak47, CAK47); LINK_ENTITY_TO_CLASS(weapon_ak47, CAK47);
/* <235327> ../cstrike/dlls/wpn_shared/wpn_ak47.cpp:52 */ /* <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 */ /* <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 */ /* <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 */ /* <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 */ /* <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 */ /* <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 // Length2D(const Vector *const this); // 116
// PrimaryAttack(CAK47 *const this); // 112 // 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 */ /* <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 // Reload(CAK47 *const this); // 204
} }
/* <23539d> ../cstrike/dlls/wpn_shared/wpn_ak47.cpp:219 */ /* <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 // 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

View File

@ -1,79 +1,327 @@
#include "precompiled.h" #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 */ /* <23fdac> ../cstrike/dlls/wpn_shared/wpn_awp.cpp:50 */
LINK_ENTITY_TO_CLASS(weapon_awp, CAWP); LINK_ENTITY_TO_CLASS(weapon_awp, CAWP);
/* <23fb10> ../cstrike/dlls/wpn_shared/wpn_awp.cpp:52 */ /* <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 */ /* <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 */ /* <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 */ /* <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 */ /* <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, switch (m_pPlayer->m_iFOV)
// int channel, {
// const char *sample, case 90: m_pPlayer->m_iFOV = m_pPlayer->pev->fov = 40; break;
// float volume, case 40: m_pPlayer->m_iFOV = m_pPlayer->pev->fov = 10; break;
// float attenuation); // 139 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 */ /* <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 if (!(m_pPlayer->pev->flags & FL_ONGROUND))
// PrimaryAttack(CAWP *const this); // 143 {
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 */ /* <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;
// Vector vecAiming; // 205 Vector vecSrc;
// Vector vecSrc; // 207 Vector vecDir;
// Vector vecDir; // 209 int flag;
// int flag; // 212
// operator+(const Vector *const this, if (m_pPlayer->pev->fov != DEFAULT_FOV)
// const Vector &v); // 194 {
// Vector(Vector *const this, m_pPlayer->m_bResumeZoom = true;
// const Vector &v); // 210 m_pPlayer->m_iLastZoom = m_pPlayer->m_iFOV;
// Vector(Vector *const this,
// const Vector &v); // 210 // 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 */ /* <23fbc1> ../cstrike/dlls/wpn_shared/wpn_awp.cpp:239 */
NOBODY void CAWP::Reload(void) void CAWP::__MAKE_VHOOK(Reload)(void)
{ {
// { int iResult;
// int iResult; // 244
// } if (m_pPlayer->ammo_338mag <= 0)
// Reload(CAWP *const this); // 239 {
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 */ /* <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 */ /* <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

View File

@ -1,61 +1,289 @@
#include "precompiled.h" #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 */ /* <29657d> ../cstrike/dlls/wpn_shared/wpn_p90.cpp:49 */
LINK_ENTITY_TO_CLASS(weapon_p90, CP90); LINK_ENTITY_TO_CLASS(weapon_p90, CP90);
/* <296337> ../cstrike/dlls/wpn_shared/wpn_p90.cpp:51 */ /* <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 */ /* <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 */ /* <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 */ /* <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 */ /* <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 if (!(m_pPlayer->pev->flags & FL_ONGROUND))
// PrimaryAttack(CP90 *const this); // 110 {
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 */ /* <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;
// Vector vecAiming; // 161 Vector vecSrc;
// Vector vecSrc; // 163 Vector vecDir;
// Vector vecDir; // 164 int flag;
// int flag; // 168
// operator+(const Vector *const this, m_bDelayFire = true;
// const Vector &v); // 155 m_iShotsFired++;
// Vector(Vector *const this,
// const Vector &v); // 165 m_flAccuracy = (m_iShotsFired * m_iShotsFired / 175) + 0.45;
// Vector(Vector *const this,
// const Vector &v); // 165 if (m_flAccuracy > 1)
// Length2D(const Vector *const this); // 193 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 */ /* <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 */ /* <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

View File

@ -1,5 +1,8 @@
#include "precompiled.h" #include "precompiled.h"
#define USP_MAX_SPEED 250
#define USP_RELOAD_TIME 2.7
enum usp_e enum usp_e
{ {
USP_IDLE, USP_IDLE,
@ -40,11 +43,14 @@ LINK_ENTITY_TO_CLASS(weapon_usp, CUSP);
void CUSP::__MAKE_VHOOK(Spawn)(void) void CUSP::__MAKE_VHOOK(Spawn)(void)
{ {
Precache(); Precache();
m_iId = WEAPON_USP; m_iId = WEAPON_USP;
SET_MODEL(ENT(pev), "models/w_usp.mdl"); SET_MODEL(ENT(pev), "models/w_usp.mdl");
m_iWeaponState &= ~WPNSTATE_SHIELD_DRAWN; m_iWeaponState &= ~WPNSTATE_SHIELD_DRAWN;
m_iDefaultAmmo = 12;//TODO: Default clip USP_MAX_CLIP m_iDefaultAmmo = USP_DEFAULT_GIVE;
m_flAccuracy = 0.92f; m_flAccuracy = 0.92f;
FallInit(); FallInit();
} }
@ -80,9 +86,11 @@ int CUSP::__MAKE_VHOOK(GetItemInfo)(ItemInfo *p)
p->iSlot = 1; p->iSlot = 1;
p->iPosition = 4; p->iPosition = 4;
p->iFlags = 0; p->iFlags = 0;
m_iId = WEAPON_USP; m_iId = WEAPON_USP;
p->iId = WEAPON_USP; p->iId = WEAPON_USP;
p->iWeight = 5;
p->iWeight = USP_WEIGHT;
return 1; return 1;
} }
@ -92,57 +100,126 @@ BOOL CUSP::__MAKE_VHOOK(Deploy)(void)
{ {
m_iWeaponState &= ~WPNSTATE_SHIELD_DRAWN; m_iWeaponState &= ~WPNSTATE_SHIELD_DRAWN;
m_flAccuracy = 0.92f; m_flAccuracy = 0.92f;
m_fMaxSpeed = 250.0f; m_fMaxSpeed = USP_MAX_SPEED;
m_pPlayer->m_bShieldDrawn = false; m_pPlayer->m_bShieldDrawn = false;
if (m_pPlayer->HasShield()) if (m_pPlayer->HasShield())
{ {
m_iWeaponState &= ~WPNSTATE_USP_SILENCED; 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) 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 */ /* <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 */ /* <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 if (m_iWeaponState & WPNSTATE_USP_SILENCED)
// Length2D(const Vector *const this); // 190 {
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 */ /* <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 flag;
//int iDamage;//unused int iDamage;
//Vector vecAiming;//unused Vector vecAiming;
//Vector vecSrc;//unused Vector vecSrc;
Vector vecDir; Vector vecDir;
flCycleTime -= 0.075f; flCycleTime -= 0.075;
m_iShotsFired++; if (++m_iShotsFired > 1)
if (m_iShotsFired > 1)
return;
if (m_flLastFire != 0.0f)
{ {
m_flAccuracy -= (0.3f - (gpGlobals->time - m_flLastFire)) * 0.275f; return;
if (m_flAccuracy > 0.92f) }
m_flAccuracy = 0.92f;
else if (m_flAccuracy < 0.6f) if (m_flLastFire != 0.0)
m_flAccuracy = 0.6f; {
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; m_flLastFire = gpGlobals->time;
if (m_iClip <= 0) if (m_iClip <= 0)
{ {
if (m_fFireOnEmpty) if (m_fFireOnEmpty)
@ -150,44 +227,81 @@ UNTESTED void CUSP::USPFire(float flSpread, float flCycleTime, BOOL fUseSemi)
PlayEmptySound(); PlayEmptySound();
m_flNextPrimaryAttack = GetNextAttackDelay(0.2); m_flNextPrimaryAttack = GetNextAttackDelay(0.2);
} }
if (TheBots != NULL) if (TheBots != NULL)
{ {
TheBots->OnEvent(EVENT_WEAPON_FIRED_ON_EMPTY, m_pPlayer, NULL); TheBots->OnEvent(EVENT_WEAPON_FIRED_ON_EMPTY, m_pPlayer);
} }
return; return;
} }
m_flNextSecondaryAttack = GetNextAttackDelay(flCycleTime); m_flNextSecondaryAttack = GetNextAttackDelay(flCycleTime);
m_flNextPrimaryAttack = m_flNextSecondaryAttack; m_flNextPrimaryAttack = m_flNextSecondaryAttack;
m_iClip--; m_iClip--;
SetPlayerShieldAnim(); SetPlayerShieldAnim();
m_pPlayer->SetAnimation(PLAYER_ATTACK1);
m_pPlayer->SetAnimation(PLAYER_ATTACK1);
m_pPlayer->m_iWeaponVolume = 2048; m_pPlayer->m_iWeaponVolume = 2048;
m_pPlayer->m_iWeaponFlash = 128; 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)) if (!(m_iWeaponState & WPNSTATE_USP_SILENCED))
{
m_pPlayer->pev->effects |= EF_MUZZLEFLASH; 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 #ifdef CLIENT_WEAPONS
flag = FEV_NOTHOST; flag = FEV_NOTHOST;
#else #else
flag = 0; flag = 0;
#endif #endif // CLIENT_WEAPONS
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));
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) 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_flTimeWeaponIdle = WEAPON_TIMEBASED + 2;
m_pPlayer->pev->punchangle.x -= 2.0f; m_pPlayer->pev->punchangle.x -= 2;
ResetPlayerShieldAnim(); ResetPlayerShieldAnim();
} }
@ -195,15 +309,21 @@ UNTESTED void CUSP::USPFire(float flSpread, float flCycleTime, BOOL fUseSemi)
void CUSP::__MAKE_VHOOK(Reload)(void) void CUSP::__MAKE_VHOOK(Reload)(void)
{ {
if (m_pPlayer->ammo_45acp <= 0) if (m_pPlayer->ammo_45acp <= 0)
{
return; return;
}
int iResult; int iResult;
if (m_pPlayer->HasShield()) 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) 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 else
iResult = DefaultReload(USP_MAX_CLIP, USP_UNSIL_RELOAD, 2.7); iResult = DefaultReload(USP_MAX_CLIP, USP_UNSIL_RELOAD, USP_RELOAD_TIME);
if (iResult) if (iResult)
{ {
@ -216,23 +336,28 @@ void CUSP::__MAKE_VHOOK(Reload)(void)
void CUSP::__MAKE_VHOOK(WeaponIdle)(void) void CUSP::__MAKE_VHOOK(WeaponIdle)(void)
{ {
ResetEmptySound(); ResetEmptySound();
m_pPlayer->GetAutoaimVector(0.173648); m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES);
if (m_flTimeWeaponIdle > 0.0f) if (m_flTimeWeaponIdle > 0)
{
return; return;
}
if (m_pPlayer->HasShield()) if (m_pPlayer->HasShield())
{ {
m_flTimeWeaponIdle = 20.0f; m_flTimeWeaponIdle = WEAPON_TIMEBASED + 20.0;
if (m_iWeaponState & WPNSTATE_SHIELD_DRAWN) if (m_iWeaponState & WPNSTATE_SHIELD_DRAWN)
SendWeaponAnim(USP_DRAW, UseDecrement() != FALSE); {
SendWeaponAnim(USP_DRAW, UseDecrement());
}
} }
else if (m_iClip) 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;
int iAnim = (~m_iWeaponState & WPNSTATE_USP_SILENCED) ? USP_UNSIL_IDLE: USP_IDLE;// : USP_UNSIL_IDLE;
m_flTimeWeaponIdle = 60.0f; m_flTimeWeaponIdle = WEAPON_TIMEBASED + 60.0;
SendWeaponAnim(iAnim, UseDecrement() != FALSE); SendWeaponAnim(iAnim, UseDecrement());
} }
} }
@ -242,30 +367,37 @@ void CUSP::Spawn(void)
{ {
Spawn_(); Spawn_();
} }
void CUSP::Precache(void) void CUSP::Precache(void)
{ {
Precache_(); Precache_();
} }
int CUSP::GetItemInfo(ItemInfo *p) int CUSP::GetItemInfo(ItemInfo *p)
{ {
return GetItemInfo_(p); return GetItemInfo_(p);
} }
BOOL CUSP::Deploy(void) BOOL CUSP::Deploy(void)
{ {
return Deploy_(); return Deploy_();
} }
void CUSP::SecondaryAttack(void) void CUSP::SecondaryAttack(void)
{ {
SecondaryAttack_(); SecondaryAttack_();
} }
void CUSP::PrimaryAttack(void) void CUSP::PrimaryAttack(void)
{ {
PrimaryAttack_(); PrimaryAttack_();
} }
void CUSP::Reload(void) void CUSP::Reload(void)
{ {
Reload_(); Reload_();
} }
void CUSP::WeaponIdle(void) void CUSP::WeaponIdle(void)
{ {
WeaponIdle_(); WeaponIdle_();

View File

@ -72,6 +72,7 @@ typedef struct lump_s
{ {
int fileofs; int fileofs;
int filelen; int filelen;
} lump_t; } lump_t;
/* <a22c> ../engine/bspfile.h:64 */ /* <a22c> ../engine/bspfile.h:64 */
@ -82,6 +83,7 @@ typedef struct dmodel_s
int headnode[MAX_MAP_HULLS]; int headnode[MAX_MAP_HULLS];
int visleafs; // not including the solid leaf 0 int visleafs; // not including the solid leaf 0
int firstface, numfaces; int firstface, numfaces;
} dmodel_t; } dmodel_t;
/* <a2c2> ../engine/bspfile.h:73 */ /* <a2c2> ../engine/bspfile.h:73 */
@ -89,6 +91,7 @@ typedef struct dheader_s
{ {
int version; int version;
lump_t lumps[15]; lump_t lumps[15];
} dheader_t; } dheader_t;
/* <485b2> ../engine/bspfile.h:79 */ /* <485b2> ../engine/bspfile.h:79 */
@ -96,6 +99,7 @@ typedef struct dmiptexlump_s
{ {
int _nummiptex; int _nummiptex;
int dataofs[4]; int dataofs[4];
} dmiptexlump_t; } dmiptexlump_t;
/* <1ce18> ../engine/bspfile.h:86 */ /* <1ce18> ../engine/bspfile.h:86 */
@ -105,12 +109,14 @@ typedef struct miptex_s
unsigned width; unsigned width;
unsigned height; unsigned height;
unsigned offsets[4]; unsigned offsets[4];
} miptex_t; } miptex_t;
/* <48652> ../engine/bspfile.h:94 */ /* <48652> ../engine/bspfile.h:94 */
typedef struct dvertex_s typedef struct dvertex_s
{ {
float point[3]; float point[3];
} dvertex_t; } dvertex_t;
/* <48674> ../engine/bspfile.h:110 */ /* <48674> ../engine/bspfile.h:110 */
@ -119,6 +125,7 @@ typedef struct dplane_s
float normal[3]; float normal[3];
float dist; float dist;
int type; int type;
} dplane_t; } dplane_t;
/* <486b2> ../engine/bspfile.h:132 */ /* <486b2> ../engine/bspfile.h:132 */
@ -130,6 +137,7 @@ typedef struct dnode_s
short maxs[3]; short maxs[3];
unsigned short firstface; unsigned short firstface;
unsigned short numfaces; unsigned short numfaces;
} dnode_t; } dnode_t;
/* <a332> ../engine/bspfile.h:142 */ /* <a332> ../engine/bspfile.h:142 */
@ -137,6 +145,7 @@ typedef struct dclipnode_s
{ {
int planenum; int planenum;
short children[2]; // negative numbers are contents short children[2]; // negative numbers are contents
} dclipnode_t; } dclipnode_t;
/* <4876a> ../engine/bspfile.h:149 */ /* <4876a> ../engine/bspfile.h:149 */
@ -145,12 +154,14 @@ typedef struct texinfo_s
float vecs[2][4]; float vecs[2][4];
int _miptex; int _miptex;
int flags; int flags;
} texinfo_t; } texinfo_t;
/* <487c2> ../engine/bspfile.h:159 */ /* <487c2> ../engine/bspfile.h:159 */
typedef struct dedge_s typedef struct dedge_s
{ {
unsigned short v[2]; unsigned short v[2];
} dedge_t; } dedge_t;
/* <487f2> ../engine/bspfile.h:165 */ /* <487f2> ../engine/bspfile.h:165 */
@ -163,6 +174,7 @@ typedef struct dface_s
short texinfo; short texinfo;
byte styles[4]; byte styles[4];
int lightofs; int lightofs;
} dface_t; } dface_t;
typedef struct dleaf_s typedef struct dleaf_s
@ -174,7 +186,7 @@ typedef struct dleaf_s
unsigned short firstmarksurface; unsigned short firstmarksurface;
unsigned short nummarksurfaces; unsigned short nummarksurfaces;
byte ambient_level[4]; byte ambient_level[4];
} dleaf_t; } dleaf_t;
#endif // BSPFILE_H #endif // BSPFILE_H

View File

@ -38,6 +38,7 @@ typedef struct
unsigned short amplitude; // FIXED 4.12 amount of shake unsigned short amplitude; // FIXED 4.12 amount of shake
unsigned short duration; // FIXED 4.12 seconds duration 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) unsigned short frequency; // FIXED 8.8 noise frequency (low frequency is a jerk,high frequency is a rumble)
} ScreenShake; } ScreenShake;
#define FFADE_IN 0x0000 // Just here so we don't pass 0 into the function #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) unsigned short holdTime; // FIXED 4.12 seconds duration until reset (fade & hold)
short fadeFlags; // flags short fadeFlags; // flags
byte r,g,b,a; // fade to color ( max alpha ) byte r,g,b,a; // fade to color ( max alpha )
} ScreenFade; } ScreenFade;
#endif // SHAKE_H #endif // SHAKE_H

View File

@ -136,7 +136,7 @@ inline void CBitVec<NUM_BITS>::Init(int val)
template<int NUM_BITS> template<int NUM_BITS>
inline CBitVec<NUM_BITS> &CBitVec<NUM_BITS>::operator=(CBitVec<NUM_BITS> const &other) 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; return *this;
} }
@ -153,8 +153,10 @@ template<int NUM_BITS>
inline bool CBitVec<NUM_BITS>::operator==(CBitVec<NUM_BITS> const &other) inline bool CBitVec<NUM_BITS>::operator==(CBitVec<NUM_BITS> const &other)
{ {
for (int i = 0; i < NUM_DWORDS; i++) for (int i = 0; i < NUM_DWORDS; i++)
{
if (m_DWords[i] != other.m_DWords[i]) if (m_DWords[i] != other.m_DWords[i])
return false; return false;
}
return true; return true;
} }

View File

@ -219,7 +219,9 @@ void CBot::ExecuteCommand_(void)
m_flPreviousCommandTime = gpGlobals->time; m_flPreviousCommandTime = gpGlobals->time;
if (IsCrouching()) if (IsCrouching())
{
m_buttonFlags |= IN_DUCK; m_buttonFlags |= IN_DUCK;
}
// Run the command // 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);

View File

@ -51,7 +51,12 @@ enum BotDifficultyType
char *BotDifficultyName[] = char *BotDifficultyName[] =
{ {
"EASY", "NORMAL", "HARD", "EXPERT", NULL "EASY",
"NORMAL",
"HARD",
"EXPERT",
NULL
}; };
#else #else
@ -60,5 +65,4 @@ enum BotDifficultyType
#endif // DEFINE_DIFFICULTY_NAMES #endif // DEFINE_DIFFICULTY_NAMES
#endif // BOT_CONSTANTS_H #endif // BOT_CONSTANTS_H

View File

@ -1,6 +1,7 @@
#include "precompiled.h" #include "precompiled.h"
#pragma warning(disable : 4530) // STL uses exceptions, but we are not compiling with them - ignore warning // STL uses exceptions, but we are not compiling with them - ignore warning
#pragma warning(disable : 4530)
//#define DEFINE_EVENT_NAMES //#define DEFINE_EVENT_NAMES
@ -157,11 +158,15 @@ void CBotManager::OnEvent_(GameEventType event, CBaseEntity *entity, CBaseEntity
} }
if (TheTutor) if (TheTutor)
{
TheTutor->OnEvent(event, entity, other); TheTutor->OnEvent(event, entity, other);
}
if (g_pHostages) if (g_pHostages)
{
g_pHostages->OnEvent(event, entity, other); g_pHostages->OnEvent(event, entity, other);
} }
}
/* <49f7ff> ../game_shared/bot/bot_manager.cpp:257 */ /* <49f7ff> ../game_shared/bot/bot_manager.cpp:257 */
void CBotManager::AddGrenade(int type, CGrenade *grenade) void CBotManager::AddGrenade(int type, CGrenade *grenade)

View File

@ -32,6 +32,7 @@
#pragma once #pragma once
#endif #endif
// STL uses exceptions, but we are not compiling with them - ignore warning
#pragma warning(disable : 4530) #pragma warning(disable : 4530)
#include <list> #include <list>

View File

@ -32,7 +32,8 @@
#pragma once #pragma once
#endif #endif
#pragma warning(disable : 4786) // long STL names get truncated in browse info. // long STL names get truncated in browse info.
#pragma warning(disable : 4786)
#ifndef _WIN32 #ifndef _WIN32
#include <strings.h> #include <strings.h>

View File

@ -39,7 +39,7 @@ class CNavLadder;
class IImprovEvent class IImprovEvent
{ {
public: public:
virtual void OnMoveToSuccess(const Vector &goal) { } virtual void OnMoveToSuccess(const Vector &goal) {};
enum MoveToFailureType enum MoveToFailureType
{ {
@ -48,15 +48,15 @@ public:
FAIL_FELL_OFF, FAIL_FELL_OFF,
}; };
virtual void OnMoveToFailure(const Vector &goal, MoveToFailureType reason) { } virtual void OnMoveToFailure(const Vector &goal, MoveToFailureType reason) {};
virtual void OnInjury(float amount) { } virtual void OnInjury(float amount) {};
};/* size: 4, cachelines: 1, members: 1 */ };/* size: 4, cachelines: 1, members: 1 */
class CImprov: public IImprovEvent class CImprov: public IImprovEvent
{ {
public: public:
virtual ~CImprov(void) { } virtual ~CImprov(void) {};
virtual bool IsAlive(void) const = 0; virtual bool IsAlive(void) const = 0;

View File

@ -1,5 +1,25 @@
#include "precompiled.h" #include "precompiled.h"
// STL uses exceptions, but we are not compiling with them - ignore warning
#pragma warning(disable : 4530)
// long STL names get truncated in browse info.
#pragma warning(disable : 4786)
#include <list>
#include <vector>
#include <algorithm>
#include <fcntl.h>
#include <sys/stat.h>
#include <assert.h>
#ifdef _WIN32
#include <io.h>
#else
#include <unistd.h>
#endif // _WIN32
/* /*
* Globals initialization * Globals initialization
*/ */
@ -2667,6 +2687,7 @@ bool GetGroundHeight(const Vector *pos, float *height, Vector *normal)
{ {
float ground; float ground;
Vector normal; Vector normal;
} layer[MAX_GROUND_LAYERS]; } layer[MAX_GROUND_LAYERS];
int layerCount = 0; int layerCount = 0;
@ -2710,8 +2731,11 @@ bool GetGroundHeight(const Vector *pos, float *height, Vector *normal)
} }
*height = layer[i].ground; *height = layer[i].ground;
if (normal) if (normal)
{
*normal = layer[i].normal; *normal = layer[i].normal;
}
return true; return true;
} }

View File

@ -33,7 +33,6 @@
#endif #endif
#include <list> #include <list>
//#include "nav.h"
class CNavArea; class CNavArea;

View File

@ -1,7 +1,27 @@
#include "precompiled.h" #include "precompiled.h"
#pragma warning(disable : 4530) // STL uses exceptions, but we are not compiling with them - ignore warning // STL uses exceptions, but we are not compiling with them - ignore warning
#pragma warning(disable : 4786) // long STL names get truncated in browse info. #pragma warning(disable : 4530)
// long STL names get truncated in browse info.
#pragma warning(disable : 4786)
#undef min
#undef max
#include <list>
#include <vector>
#include <algorithm>
#include <fcntl.h>
#include <sys/stat.h>
#include <assert.h>
#ifndef _WIN32
#include <unistd.h>
#endif // _WIN32
/* /*
* Globals initialization * Globals initialization
@ -42,6 +62,7 @@ PlaceDirectory::EntryType PlaceDirectory::GetEntry(Place place) const
assert(false && "PlaceDirectory::GetEntry failure"); assert(false && "PlaceDirectory::GetEntry failure");
return 0; return 0;
} }
return 1 + (it - m_directory.begin()); return 1 + (it - m_directory.begin());
} }

View File

@ -32,23 +32,6 @@
#pragma once #pragma once
#endif #endif
#undef min
#undef max
#include <list>
#include <vector>
#include <algorithm>
#include <fcntl.h>
#include <sys/stat.h>
#include <assert.h>
#ifndef _WIN32
#include <unistd.h>
#endif // _WIN32
// The 'place directory' is used to save and load places from // The 'place directory' is used to save and load places from
// nav files in a size-efficient manner that also allows for the // nav files in a size-efficient manner that also allows for the
// order of the place ID's to change without invalidating the // order of the place ID's to change without invalidating the
@ -78,7 +61,9 @@ private:
}; };
#ifdef HOOK_GAMEDLL #ifdef HOOK_GAMEDLL
#define placeDirectory (*pplaceDirectory) #define placeDirectory (*pplaceDirectory)
#endif // HOOK_GAMEDLL #endif // HOOK_GAMEDLL
extern PlaceDirectory placeDirectory; extern PlaceDirectory placeDirectory;

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