diff --git a/AccuracyFix/include/cssdk/common/const.h b/AccuracyFix/include/cssdk/common/const.h index 8350e8a..a88b48e 100644 --- a/AccuracyFix/include/cssdk/common/const.h +++ b/AccuracyFix/include/cssdk/common/const.h @@ -1,30 +1,17 @@ -/* +/*** * -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at -* your option) any later version. +* Copyright (c) 1996-2002, Valve LLC. All rights reserved. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* All Rights Reserved. * -* 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. +* Use, distribution, and modification of this source code and/or resulting +* object code is restricted to non-commercial enhancements to products from +* Valve LLC. All other use, distribution, or modification is prohibited +* without written permission from Valve LLC. * -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software Foundation, -* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -* In addition, as a special exception, the author gives permission to -* link the code of this program with the Half-Life Game Engine ("HL -* Engine") and Modified Game Libraries ("MODs") developed by Valve, -* L.L.C ("Valve"). You must obey the GNU General Public License in all -* respects for all of the code used other than the HL Engine and MODs -* from Valve. If you modify this file, you may extend this exception -* to your version of the file, but you are not obligated to do so. If -* you do not wish to do so, delete this exception statement from your -* version. -* -*/ +****/ #ifndef CONST_H #define CONST_H @@ -33,424 +20,423 @@ #endif // Max # of clients allowed in a server. -#define MAX_CLIENTS 32 +#define MAX_CLIENTS 32 // How many bits to use to encode an edict. -#define MAX_EDICT_BITS 11 // # of bits needed to represent max edicts - +#define MAX_EDICT_BITS 11 // # of bits needed to represent max edicts // Max # of edicts in a level (2048) -#define MAX_EDICTS BIT(MAX_EDICT_BITS) +#define MAX_EDICTS (1<flags -#define FL_FLY BIT(0) // Changes the SV_Movestep() behavior to not need to be on ground -#define FL_SWIM BIT(1) // Changes the SV_Movestep() behavior to not need to be on ground (but stay in water) -#define FL_CONVEYOR BIT(2) -#define FL_CLIENT BIT(3) -#define FL_INWATER BIT(4) -#define FL_MONSTER BIT(5) -#define FL_GODMODE BIT(6) -#define FL_NOTARGET BIT(7) -#define FL_SKIPLOCALHOST BIT(8) // Don't send entity to local host, it's predicting this entity itself -#define FL_ONGROUND BIT(9) // At rest / on the ground -#define FL_PARTIALGROUND BIT(10) // not all corners are valid -#define FL_WATERJUMP BIT(11) // player jumping out of water -#define FL_FROZEN BIT(12) // Player is frozen for 3rd person camera -#define FL_FAKECLIENT BIT(13) // JAC: fake client, simulated server side; don't send network messages to them -#define FL_DUCKING BIT(14) // Player flag -- Player is fully crouched -#define FL_FLOAT BIT(15) // Apply floating force to this entity when in water -#define FL_GRAPHED BIT(16) // worldgraph has this ent listed as something that blocks a connection +#define FL_FLY (1<<0) // Changes the SV_Movestep() behavior to not need to be on ground +#define FL_SWIM (1<<1) // Changes the SV_Movestep() behavior to not need to be on ground (but stay in water) +#define FL_CONVEYOR (1<<2) +#define FL_CLIENT (1<<3) +#define FL_INWATER (1<<4) +#define FL_MONSTER (1<<5) +#define FL_GODMODE (1<<6) +#define FL_NOTARGET (1<<7) +#define FL_SKIPLOCALHOST (1<<8) // Don't send entity to local host, it's predicting this entity itself +#define FL_ONGROUND (1<<9) // At rest / on the ground +#define FL_PARTIALGROUND (1<<10) // not all corners are valid +#define FL_WATERJUMP (1<<11) // player jumping out of water +#define FL_FROZEN (1<<12) // Player is frozen for 3rd person camera +#define FL_FAKECLIENT (1<<13) // JAC: fake client, simulated server side; don't send network messages to them +#define FL_DUCKING (1<<14) // Player flag -- Player is fully crouched +#define FL_FLOAT (1<<15) // Apply floating force to this entity when in water +#define FL_GRAPHED (1<<16) // worldgraph has this ent listed as something that blocks a connection // UNDONE: Do we need these? -#define FL_IMMUNE_WATER BIT(17) -#define FL_IMMUNE_SLIME BIT(18) -#define FL_IMMUNE_LAVA BIT(19) - -#define FL_PROXY BIT(20) // This is a spectator proxy -#define FL_ALWAYSTHINK BIT(21) // Brush model flag -- call think every frame regardless of nextthink - ltime (for constantly changing velocity/path) -#define FL_BASEVELOCITY BIT(22) // Base velocity has been applied this frame (used to convert base velocity into momentum) -#define FL_MONSTERCLIP BIT(23) // Only collide in with monsters who have FL_MONSTERCLIP set -#define FL_ONTRAIN BIT(24) // Player is _controlling_ a train, so movement commands should be ignored on client during prediction. -#define FL_WORLDBRUSH BIT(25) // Not moveable/removeable brush entity (really part of the world, but represented as an entity for transparency or something) -#define FL_SPECTATOR BIT(26) // This client is a spectator, don't run touch functions, etc. -#define FL_CUSTOMENTITY BIT(29) // This is a custom entity -#define FL_KILLME BIT(30) // This entity is marked for death -- This allows the engine to kill ents at the appropriate time -#define FL_DORMANT BIT(31) // Entity is dormant, no updates to client +#define FL_IMMUNE_WATER (1<<17) +#define FL_IMMUNE_SLIME (1<<18) +#define FL_IMMUNE_LAVA (1<<19) + +#define FL_PROXY (1<<20) // This is a spectator proxy +#define FL_ALWAYSTHINK (1<<21) // Brush model flag -- call think every frame regardless of nextthink - ltime (for constantly changing velocity/path) +#define FL_BASEVELOCITY (1<<22) // Base velocity has been applied this frame (used to convert base velocity into momentum) +#define FL_MONSTERCLIP (1<<23) // Only collide in with monsters who have FL_MONSTERCLIP set +#define FL_ONTRAIN (1<<24) // Player is _controlling_ a train, so movement commands should be ignored on client during prediction. +#define FL_WORLDBRUSH (1<<25) // Not moveable/removeable brush entity (really part of the world, but represented as an entity for transparency or something) +#define FL_SPECTATOR (1<<26) // This client is a spectator, don't run touch functions, etc. +#define FL_CUSTOMENTITY (1<<29) // This is a custom entity +#define FL_KILLME (1<<30) // This entity is marked for death -- This allows the engine to kill ents at the appropriate time +#define FL_DORMANT (1<<31) // Entity is dormant, no updates to client // SV_EmitSound2 flags -#define SND_EMIT2_NOPAS BIT(0) // never to do check PAS -#define SND_EMIT2_INVOKER BIT(1) // do not send to the client invoker +#define SND_EMIT2_NOPAS (1<<0) // never to do check PAS +#define SND_EMIT2_INVOKER (1<<1) // do not send to the client invoker // Engine edict->spawnflags -#define SF_NOTINDEATHMATCH BIT(11) // Do not spawn when deathmatch and loading entities from a file +#define SF_NOTINDEATHMATCH 0x0800 // Do not spawn when deathmatch and loading entities from a file + // Goes into globalvars_t.trace_flags -#define FTRACE_SIMPLEBOX BIT(0) // Traceline with a simple box +#define FTRACE_SIMPLEBOX (1<<0) // Traceline with a simple box + // walkmove modes -#define WALKMOVE_NORMAL 0 // normal walkmove -#define WALKMOVE_WORLDONLY 1 // doesn't hit ANY entities, no matter what the solid type -#define WALKMOVE_CHECKONLY 2 // move, but don't touch triggers +#define WALKMOVE_NORMAL 0 // normal walkmove +#define WALKMOVE_WORLDONLY 1 // doesn't hit ANY entities, no matter what the solid type +#define WALKMOVE_CHECKONLY 2 // move, but don't touch triggers // edict->movetype values -#define MOVETYPE_NONE 0 // never moves -//#define MOVETYPE_ANGLENOCLIP 1 -//#define MOVETYPE_ANGLECLIP 2 -#define MOVETYPE_WALK 3 // Player only - moving on the ground -#define MOVETYPE_STEP 4 // gravity, special edge handling -- monsters use this -#define MOVETYPE_FLY 5 // No gravity, but still collides with stuff -#define MOVETYPE_TOSS 6 // gravity/collisions -#define MOVETYPE_PUSH 7 // no clip to world, push and crush -#define MOVETYPE_NOCLIP 8 // No gravity, no collisions, still do velocity/avelocity -#define MOVETYPE_FLYMISSILE 9 // extra size to monsters -#define MOVETYPE_BOUNCE 10 // Just like Toss, but reflect velocity when contacting surfaces -#define MOVETYPE_BOUNCEMISSILE 11 // bounce w/o gravity -#define MOVETYPE_FOLLOW 12 // track movement of aiment -#define MOVETYPE_PUSHSTEP 13 // BSP model that needs physics/world collisions (uses nearest hull for world collision) +#define MOVETYPE_NONE 0 // never moves +//#define MOVETYPE_ANGLENOCLIP 1 +//#define MOVETYPE_ANGLECLIP 2 +#define MOVETYPE_WALK 3 // Player only - moving on the ground +#define MOVETYPE_STEP 4 // gravity, special edge handling -- monsters use this +#define MOVETYPE_FLY 5 // No gravity, but still collides with stuff +#define MOVETYPE_TOSS 6 // gravity/collisions +#define MOVETYPE_PUSH 7 // no clip to world, push and crush +#define MOVETYPE_NOCLIP 8 // No gravity, no collisions, still do velocity/avelocity +#define MOVETYPE_FLYMISSILE 9 // extra size to monsters +#define MOVETYPE_BOUNCE 10 // Just like Toss, but reflect velocity when contacting surfaces +#define MOVETYPE_BOUNCEMISSILE 11 // bounce w/o gravity +#define MOVETYPE_FOLLOW 12 // track movement of aiment +#define MOVETYPE_PUSHSTEP 13 // BSP model that needs physics/world collisions (uses nearest hull for world collision) // edict->solid values // NOTE: Some movetypes will cause collisions independent of SOLID_NOT/SOLID_TRIGGER when the entity moves // SOLID only effects OTHER entities colliding with this one when they move - UGH! -#define SOLID_NOT 0 // no interaction with other objects -#define SOLID_TRIGGER 1 // touch on edge, but not blocking -#define SOLID_BBOX 2 // touch on edge, block -#define SOLID_SLIDEBOX 3 // touch on edge, but not an onground -#define SOLID_BSP 4 // bsp clip, touch on edge, block +#define SOLID_NOT 0 // no interaction with other objects +#define SOLID_TRIGGER 1 // touch on edge, but not blocking +#define SOLID_BBOX 2 // touch on edge, block +#define SOLID_SLIDEBOX 3 // touch on edge, but not an onground +#define SOLID_BSP 4 // bsp clip, touch on edge, block // edict->deadflag values -#define DEAD_NO 0 // alive -#define DEAD_DYING 1 // playing death animation or still falling off of a ledge waiting to hit ground -#define DEAD_DEAD 2 // dead. lying still. -#define DEAD_RESPAWNABLE 3 // do respawn the entity -#define DEAD_DISCARDBODY 4 - -#define DAMAGE_NO 0 -#define DAMAGE_YES 1 -#define DAMAGE_AIM 2 - -// edict->effects values -#define EF_BRIGHTFIELD BIT(0) // swirling cloud of particles -#define EF_MUZZLEFLASH BIT(1) // single frame ELIGHT on entity attachment 0 -#define EF_BRIGHTLIGHT BIT(2) // DLIGHT centered at entity origin -#define EF_DIMLIGHT BIT(3) // player flashlight -#define EF_INVLIGHT BIT(4) // get lighting from ceiling -#define EF_NOINTERP BIT(5) // don't interpolate the next frame -#define EF_LIGHT BIT(6) // rocket flare glow sprite -#define EF_NODRAW BIT(7) // don't draw entity -#define EF_NIGHTVISION BIT(8) // player nightvision -#define EF_SNIPERLASER BIT(9) // sniper laser effect -#define EF_FIBERCAMERA BIT(10) // fiber camera -#define EF_FORCEVISIBILITY BIT(11) // force visibility -#define EF_OWNER_VISIBILITY BIT(12) // visibility for owner -#define EF_OWNER_NO_VISIBILITY BIT(13) // no visibility for owner - -// state->eflags values -#define EFLAG_SLERP 1 // do studio interpolation of this entity - +#define DEAD_NO 0 // alive +#define DEAD_DYING 1 // playing death animation or still falling off of a ledge waiting to hit ground +#define DEAD_DEAD 2 // dead. lying still. +#define DEAD_RESPAWNABLE 3 +#define DEAD_DISCARDBODY 4 + +#define DAMAGE_NO 0 +#define DAMAGE_YES 1 +#define DAMAGE_AIM 2 + +// entity effects +#define EF_BRIGHTFIELD 1 // swirling cloud of particles +#define EF_MUZZLEFLASH 2 // single frame ELIGHT on entity attachment 0 +#define EF_BRIGHTLIGHT 4 // DLIGHT centered at entity origin +#define EF_DIMLIGHT 8 // player flashlight +#define EF_INVLIGHT 16 // get lighting from ceiling +#define EF_NOINTERP 32 // don't interpolate the next frame +#define EF_LIGHT 64 // rocket flare glow sprite +#define EF_NODRAW 128 // don't draw entity +#define EF_NIGHTVISION 256 // player nightvision +#define EF_SNIPERLASER 512 // sniper laser effect +#define EF_FIBERCAMERA 1024// fiber camera + + +// entity flags +#define EFLAG_SLERP 1 // do studio interpolation of this entity + // // temp entity events // -#define TE_BEAMPOINTS 0 // beam effect between two points -// coord coord coord (start position) -// coord coord coord (end position) -// short (sprite index) -// byte (starting frame) -// byte (frame rate in 0.1's) -// byte (life in 0.1's) -// byte (line width in 0.1's) -// byte (noise amplitude in 0.01's) +#define TE_BEAMPOINTS 0 // beam effect between two points +// coord coord coord (start position) +// coord coord coord (end position) +// short (sprite index) +// byte (starting frame) +// byte (frame rate in 0.1's) +// byte (life in 0.1's) +// byte (line width in 0.1's) +// byte (noise amplitude in 0.01's) // byte,byte,byte (color) // byte (brightness) // byte (scroll speed in 0.1's) -#define TE_BEAMENTPOINT 1 // beam effect between point and entity -// short (start entity) -// coord coord coord (end position) -// short (sprite index) -// byte (starting frame) -// byte (frame rate in 0.1's) -// byte (life in 0.1's) -// byte (line width in 0.1's) -// byte (noise amplitude in 0.01's) +#define TE_BEAMENTPOINT 1 // beam effect between point and entity +// short (start entity) +// coord coord coord (end position) +// short (sprite index) +// byte (starting frame) +// byte (frame rate in 0.1's) +// byte (life in 0.1's) +// byte (line width in 0.1's) +// byte (noise amplitude in 0.01's) // byte,byte,byte (color) // byte (brightness) // byte (scroll speed in 0.1's) -#define TE_GUNSHOT 2 // particle effect plus ricochet sound -// coord coord coord (position) +#define TE_GUNSHOT 2 // particle effect plus ricochet sound +// coord coord coord (position) -#define TE_EXPLOSION 3 // additive sprite, 2 dynamic lights, flickering particles, explosion sound, move vertically 8 pps -// coord coord coord (position) +#define TE_EXPLOSION 3 // additive sprite, 2 dynamic lights, flickering particles, explosion sound, move vertically 8 pps +// coord coord coord (position) // short (sprite index) // byte (scale in 0.1's) // byte (framerate) // byte (flags) // // The Explosion effect has some flags to control performance/aesthetic features: -#define TE_EXPLFLAG_NONE 0 // all flags clear makes default Half-Life explosion -#define TE_EXPLFLAG_NOADDITIVE 1 // sprite will be drawn opaque (ensure that the sprite you send is a non-additive sprite) -#define TE_EXPLFLAG_NODLIGHTS 2 // do not render dynamic lights -#define TE_EXPLFLAG_NOSOUND 4 // do not play client explosion sound -#define TE_EXPLFLAG_NOPARTICLES 8 // do not draw particles +#define TE_EXPLFLAG_NONE 0 // all flags clear makes default Half-Life explosion +#define TE_EXPLFLAG_NOADDITIVE 1 // sprite will be drawn opaque (ensure that the sprite you send is a non-additive sprite) +#define TE_EXPLFLAG_NODLIGHTS 2 // do not render dynamic lights +#define TE_EXPLFLAG_NOSOUND 4 // do not play client explosion sound +#define TE_EXPLFLAG_NOPARTICLES 8 // do not draw particles -#define TE_TAREXPLOSION 4 // Quake1 "tarbaby" explosion with sound -// coord coord coord (position) -#define TE_SMOKE 5 // alphablend sprite, move vertically 30 pps -// coord coord coord (position) +#define TE_TAREXPLOSION 4 // Quake1 "tarbaby" explosion with sound +// coord coord coord (position) + +#define TE_SMOKE 5 // alphablend sprite, move vertically 30 pps +// coord coord coord (position) // short (sprite index) // byte (scale in 0.1's) // byte (framerate) -#define TE_TRACER 6 // tracer effect from point to point -// coord, coord, coord (start) +#define TE_TRACER 6 // tracer effect from point to point +// coord, coord, coord (start) // coord, coord, coord (end) -#define TE_LIGHTNING 7 // TE_BEAMPOINTS with simplified parameters -// coord, coord, coord (start) -// coord, coord, coord (end) -// byte (life in 0.1's) -// byte (width in 0.1's) +#define TE_LIGHTNING 7 // TE_BEAMPOINTS with simplified parameters +// coord, coord, coord (start) +// coord, coord, coord (end) +// byte (life in 0.1's) +// byte (width in 0.1's) // byte (amplitude in 0.01's) // short (sprite model index) -#define TE_BEAMENTS 8 -// short (start entity) -// short (end entity) -// short (sprite index) -// byte (starting frame) -// byte (frame rate in 0.1's) -// byte (life in 0.1's) -// byte (line width in 0.1's) -// byte (noise amplitude in 0.01's) +#define TE_BEAMENTS 8 +// short (start entity) +// short (end entity) +// short (sprite index) +// byte (starting frame) +// byte (frame rate in 0.1's) +// byte (life in 0.1's) +// byte (line width in 0.1's) +// byte (noise amplitude in 0.01's) // byte,byte,byte (color) // byte (brightness) // byte (scroll speed in 0.1's) -#define TE_SPARKS 9 // 8 random tracers with gravity, ricochet sprite -// coord coord coord (position) +#define TE_SPARKS 9 // 8 random tracers with gravity, ricochet sprite +// coord coord coord (position) -#define TE_LAVASPLASH 10 // Quake1 lava splash -// coord coord coord (position) +#define TE_LAVASPLASH 10 // Quake1 lava splash +// coord coord coord (position) -#define TE_TELEPORT 11 // Quake1 teleport splash -// coord coord coord (position) +#define TE_TELEPORT 11 // Quake1 teleport splash +// coord coord coord (position) -#define TE_EXPLOSION2 12 // Quake1 colormaped (base palette) particle explosion with sound -// coord coord coord (position) +#define TE_EXPLOSION2 12 // Quake1 colormaped (base palette) particle explosion with sound +// coord coord coord (position) // byte (starting color) // byte (num colors) -#define TE_BSPDECAL 13 // Decal from the .BSP file +#define TE_BSPDECAL 13 // Decal from the .BSP file // coord, coord, coord (x,y,z), decal position (center of texture in world) // short (texture index of precached decal texture name) // short (entity index) // [optional - only included if previous short is non-zero (not the world)] short (index of model of above entity) -#define TE_IMPLOSION 14 // tracers moving toward a point +#define TE_IMPLOSION 14 // tracers moving toward a point // coord, coord, coord (position) // byte (radius) // byte (count) -// byte (life in 0.1's) +// byte (life in 0.1's) -#define TE_SPRITETRAIL 15 // line of moving glow sprites with gravity, fadeout, and collisions -// coord, coord, coord (start) -// coord, coord, coord (end) +#define TE_SPRITETRAIL 15 // line of moving glow sprites with gravity, fadeout, and collisions +// coord, coord, coord (start) +// coord, coord, coord (end) // short (sprite index) // byte (count) -// byte (life in 0.1's) -// byte (scale in 0.1's) +// byte (life in 0.1's) +// byte (scale in 0.1's) // byte (velocity along vector in 10's) // byte (randomness of velocity in 10's) -#define TE_BEAM 16 // obsolete +#define TE_BEAM 16 // obsolete -#define TE_SPRITE 17 // additive sprite, plays 1 cycle -// coord, coord, coord (position) -// short (sprite index) -// byte (scale in 0.1's) +#define TE_SPRITE 17 // additive sprite, plays 1 cycle +// coord, coord, coord (position) +// short (sprite index) +// byte (scale in 0.1's) // byte (brightness) -#define TE_BEAMSPRITE 18 // A beam with a sprite at the end -// coord, coord, coord (start position) -// coord, coord, coord (end position) -// short (beam sprite index) -// short (end sprite index) - -#define TE_BEAMTORUS 19 // screen aligned beam ring, expands to max radius over lifetime -// coord coord coord (center position) -// coord coord coord (axis and radius) -// short (sprite index) -// byte (starting frame) -// byte (frame rate in 0.1's) -// byte (life in 0.1's) -// byte (line width in 0.1's) -// byte (noise amplitude in 0.01's) +#define TE_BEAMSPRITE 18 // A beam with a sprite at the end +// coord, coord, coord (start position) +// coord, coord, coord (end position) +// short (beam sprite index) +// short (end sprite index) + +#define TE_BEAMTORUS 19 // screen aligned beam ring, expands to max radius over lifetime +// coord coord coord (center position) +// coord coord coord (axis and radius) +// short (sprite index) +// byte (starting frame) +// byte (frame rate in 0.1's) +// byte (life in 0.1's) +// byte (line width in 0.1's) +// byte (noise amplitude in 0.01's) // byte,byte,byte (color) // byte (brightness) // byte (scroll speed in 0.1's) -#define TE_BEAMDISK 20 // disk that expands to max radius over lifetime -// coord coord coord (center position) -// coord coord coord (axis and radius) -// short (sprite index) -// byte (starting frame) -// byte (frame rate in 0.1's) -// byte (life in 0.1's) -// byte (line width in 0.1's) -// byte (noise amplitude in 0.01's) +#define TE_BEAMDISK 20 // disk that expands to max radius over lifetime +// coord coord coord (center position) +// coord coord coord (axis and radius) +// short (sprite index) +// byte (starting frame) +// byte (frame rate in 0.1's) +// byte (life in 0.1's) +// byte (line width in 0.1's) +// byte (noise amplitude in 0.01's) // byte,byte,byte (color) // byte (brightness) // byte (scroll speed in 0.1's) -#define TE_BEAMCYLINDER 21 // cylinder that expands to max radius over lifetime -// coord coord coord (center position) -// coord coord coord (axis and radius) -// short (sprite index) -// byte (starting frame) -// byte (frame rate in 0.1's) -// byte (life in 0.1's) -// byte (line width in 0.1's) -// byte (noise amplitude in 0.01's) +#define TE_BEAMCYLINDER 21 // cylinder that expands to max radius over lifetime +// coord coord coord (center position) +// coord coord coord (axis and radius) +// short (sprite index) +// byte (starting frame) +// byte (frame rate in 0.1's) +// byte (life in 0.1's) +// byte (line width in 0.1's) +// byte (noise amplitude in 0.01's) // byte,byte,byte (color) // byte (brightness) // byte (scroll speed in 0.1's) -#define TE_BEAMFOLLOW 22 // create a line of decaying beam segments until entity stops moving +#define TE_BEAMFOLLOW 22 // create a line of decaying beam segments until entity stops moving // short (entity:attachment to follow) // short (sprite index) -// byte (life in 0.1's) -// byte (line width in 0.1's) +// byte (life in 0.1's) +// byte (line width in 0.1's) // byte,byte,byte (color) // byte (brightness) -#define TE_GLOWSPRITE 23 +#define TE_GLOWSPRITE 23 // coord, coord, coord (pos) short (model index) byte (scale / 10) -#define TE_BEAMRING 24 // connect a beam ring to two entities -// short (start entity) -// short (end entity) -// short (sprite index) -// byte (starting frame) -// byte (frame rate in 0.1's) -// byte (life in 0.1's) -// byte (line width in 0.1's) -// byte (noise amplitude in 0.01's) +#define TE_BEAMRING 24 // connect a beam ring to two entities +// short (start entity) +// short (end entity) +// short (sprite index) +// byte (starting frame) +// byte (frame rate in 0.1's) +// byte (life in 0.1's) +// byte (line width in 0.1's) +// byte (noise amplitude in 0.01's) // byte,byte,byte (color) // byte (brightness) // byte (scroll speed in 0.1's) -#define TE_STREAK_SPLASH 25 // oriented shower of tracers -// coord coord coord (start position) -// coord coord coord (direction vector) +#define TE_STREAK_SPLASH 25 // oriented shower of tracers +// coord coord coord (start position) +// coord coord coord (direction vector) // byte (color) // short (count) // short (base speed) // short (ramdon velocity) -#define TE_BEAMHOSE 26 // obsolete +#define TE_BEAMHOSE 26 // obsolete -#define TE_DLIGHT 27 // dynamic light, effect world, minor entity effect -// coord, coord, coord (pos) -// byte (radius in 10's) +#define TE_DLIGHT 27 // dynamic light, effect world, minor entity effect +// coord, coord, coord (pos) +// byte (radius in 10's) // byte byte byte (color) // byte (brightness) // byte (life in 10's) // byte (decay rate in 10's) -#define TE_ELIGHT 28 // point entity light, no world effect +#define TE_ELIGHT 28 // point entity light, no world effect // short (entity:attachment to follow) -// coord coord coord (initial position) +// coord coord coord (initial position) // coord (radius) // byte byte byte (color) // byte (life in 0.1's) // coord (decay rate) -#define TE_TEXTMESSAGE 29 +#define TE_TEXTMESSAGE 29 // short 1.2.13 x (-1 = center) // short 1.2.13 y (-1 = center) // byte Effect 0 = fade in/fade out -// 1 is flickery credits -// 2 is write out (training room) + // 1 is flickery credits + // 2 is write out (training room) -// 4 bytes r,g,b,a color1 (text color) -// 4 bytes r,g,b,a color2 (effect color) +// 4 bytes r,g,b,a color1 (text color) +// 4 bytes r,g,b,a color2 (effect color) // ushort 8.8 fadein time // ushort 8.8 fadeout time // ushort 8.8 hold time -// optional ushort 8.8 fxtime (time the highlight lags behing the leading text in effect 2) -// string text message (512 chars max sz string) -#define TE_LINE 30 -// coord, coord, coord (startpos) -// coord, coord, coord (endpos) +// optional ushort 8.8 fxtime (time the highlight lags behing the leading text in effect 2) +// string text message (512 chars max sz string) +#define TE_LINE 30 +// coord, coord, coord startpos +// coord, coord, coord endpos // short life in 0.1 s // 3 bytes r, g, b -#define TE_BOX 31 -// coord, coord, coord (boxmins) -// coord, coord, coord (boxmaxs) +#define TE_BOX 31 +// coord, coord, coord boxmins +// coord, coord, coord boxmaxs // short life in 0.1 s // 3 bytes r, g, b -#define TE_KILLBEAM 99 // kill all beams attached to entity +#define TE_KILLBEAM 99 // kill all beams attached to entity // short (entity) -#define TE_LARGEFUNNEL 100 +#define TE_LARGEFUNNEL 100 // coord coord coord (funnel position) -// short (sprite index) -// short (flags) +// short (sprite index) +// short (flags) -#define TE_BLOODSTREAM 101 // particle spray +#define TE_BLOODSTREAM 101 // particle spray // coord coord coord (start position) // coord coord coord (spray vector) // byte (color) // byte (speed) -#define TE_SHOWLINE 102 // line of particles every 5 units, dies in 30 seconds +#define TE_SHOWLINE 102 // line of particles every 5 units, dies in 30 seconds // coord coord coord (start position) // coord coord coord (end position) -#define TE_BLOOD 103 // particle spray +#define TE_BLOOD 103 // particle spray // coord coord coord (start position) // coord coord coord (spray vector) // byte (color) // byte (speed) -#define TE_DECAL 104 // Decal applied to a brush entity (not the world) +#define TE_DECAL 104 // Decal applied to a brush entity (not the world) // coord, coord, coord (x,y,z), decal position (center of texture in world) // byte (texture index of precached decal texture name) // short (entity index) -#define TE_FIZZ 105 // create alpha sprites inside of entity, float upwards +#define TE_FIZZ 105 // create alpha sprites inside of entity, float upwards // short (entity) // short (sprite index) // byte (density) -#define TE_MODEL 106 // create a moving model that bounces and makes a sound when it hits -// coord, coord, coord (position) +#define TE_MODEL 106 // create a moving model that bounces and makes a sound when it hits +// coord, coord, coord (position) // coord, coord, coord (velocity) // angle (initial yaw) // short (model index) // byte (bounce sound type) // byte (life in 0.1's) -#define TE_EXPLODEMODEL 107 // spherical shower of models, picks from set +#define TE_EXPLODEMODEL 107 // spherical shower of models, picks from set // coord, coord, coord (origin) // coord (velocity) // short (model index) // short (count) // byte (life in 0.1's) -#define TE_BREAKMODEL 108 // box of models or sprites +#define TE_BREAKMODEL 108 // box of models or sprites // coord, coord, coord (position) // coord, coord, coord (size) // coord, coord, coord (velocity) @@ -460,12 +446,12 @@ // byte (life in 0.1 secs) // byte (flags) -#define TE_GUNSHOTDECAL 109 // decal and ricochet sound +#define TE_GUNSHOTDECAL 109 // decal and ricochet sound // coord, coord, coord (position) // short (entity index???) // byte (decal???) -#define TE_SPRITE_SPRAY 110 // spay of alpha sprites +#define TE_SPRITE_SPRAY 110 // spay of alpha sprites // coord, coord, coord (position) // coord, coord, coord (velocity) // short (sprite index) @@ -473,18 +459,18 @@ // byte (speed) // byte (noise) -#define TE_ARMOR_RICOCHET 111 // quick spark sprite, client ricochet sound. +#define TE_ARMOR_RICOCHET 111 // quick spark sprite, client ricochet sound. // coord, coord, coord (position) // byte (scale in 0.1's) -#define TE_PLAYERDECAL 112 // ??? +#define TE_PLAYERDECAL 112 // ??? // byte (playerindex) // coord, coord, coord (position) // short (entity???) // byte (decal number???) // [optional] short (model index???) -#define TE_BUBBLES 113 // create alpha sprites inside of box, float upwards +#define TE_BUBBLES 113 // create alpha sprites inside of box, float upwards // coord, coord, coord (min start position) // coord, coord, coord (max start position) // coord (float height) @@ -492,7 +478,7 @@ // byte (count) // coord (speed) -#define TE_BUBBLETRAIL 114 // create alpha sprites along a line, float upwards +#define TE_BUBBLETRAIL 114 // create alpha sprites along a line, float upwards // coord, coord, coord (min start position) // coord, coord, coord (max start position) // coord (float height) @@ -500,34 +486,34 @@ // byte (count) // coord (speed) -#define TE_BLOODSPRITE 115 // spray of opaque sprite1's that fall, single sprite2 for 1..2 secs (this is a high-priority tent) +#define TE_BLOODSPRITE 115 // spray of opaque sprite1's that fall, single sprite2 for 1..2 secs (this is a high-priority tent) // coord, coord, coord (position) // short (sprite1 index) // short (sprite2 index) // byte (color) // byte (scale) -#define TE_WORLDDECAL 116 // Decal applied to the world brush +#define TE_WORLDDECAL 116 // Decal applied to the world brush // coord, coord, coord (x,y,z), decal position (center of texture in world) // byte (texture index of precached decal texture name) -#define TE_WORLDDECALHIGH 117 // Decal (with texture index > 256) applied to world brush +#define TE_WORLDDECALHIGH 117 // Decal (with texture index > 256) applied to world brush // coord, coord, coord (x,y,z), decal position (center of texture in world) // byte (texture index of precached decal texture name - 256) -#define TE_DECALHIGH 118 // Same as TE_DECAL, but the texture index was greater than 256 +#define TE_DECALHIGH 118 // Same as TE_DECAL, but the texture index was greater than 256 // coord, coord, coord (x,y,z), decal position (center of texture in world) // byte (texture index of precached decal texture name - 256) // short (entity index) -#define TE_PROJECTILE 119 // Makes a projectile (like a nail) (this is a high-priority tent) +#define TE_PROJECTILE 119 // Makes a projectile (like a nail) (this is a high-priority tent) // coord, coord, coord (position) // coord, coord, coord (velocity) // short (modelindex) // byte (life) // byte (owner) projectile won't collide with owner (if owner == 0, projectile will hit any client). -#define TE_SPRAY 120 // Throws a shower of sprites or models +#define TE_SPRAY 120 // Throws a shower of sprites or models // coord, coord, coord (position) // coord, coord, coord (direction) // short (modelindex) @@ -536,19 +522,19 @@ // byte (noise) // byte (rendermode) -#define TE_PLAYERSPRITES 121 // sprites emit from a player's bounding box (ONLY use for players!) +#define TE_PLAYERSPRITES 121 // sprites emit from a player's bounding box (ONLY use for players!) // byte (playernum) // short (sprite modelindex) // byte (count) // byte (variance) (0 = no variance in size) (10 = 10% variance in size) -#define TE_PARTICLEBURST 122 // very similar to lavasplash. +#define TE_PARTICLEBURST 122 // very similar to lavasplash. // coord (origin) // short (radius) // byte (particle color) // byte (duration * 10) (will be randomized a bit) -#define TE_FIREFIELD 123 // makes a field of fire. +#define TE_FIREFIELD 123 // makes a field of fire. // coord (origin) // short (radius) (fire is made in a square around origin. -radius, -radius to radius, radius) // short (modelindex) @@ -557,29 +543,29 @@ // byte (duration (in seconds) * 10) (will be randomized a bit) // // to keep network traffic low, this message has associated flags that fit into a byte: -#define TEFIRE_FLAG_ALLFLOAT 1 // all sprites will drift upwards as they animate -#define TEFIRE_FLAG_SOMEFLOAT 2 // some of the sprites will drift upwards. (50% chance) -#define TEFIRE_FLAG_LOOP 4 // if set, sprite plays at 15 fps, otherwise plays at whatever rate stretches the animation over the sprite's duration. -#define TEFIRE_FLAG_ALPHA 8 // if set, sprite is rendered alpha blended at 50% else, opaque -#define TEFIRE_FLAG_PLANAR 16 // if set, all fire sprites have same initial Z instead of randomly filling a cube. -#define TEFIRE_FLAG_ADDITIVE 32 // if set, sprite is rendered non-opaque with additive - -#define TE_PLAYERATTACHMENT 124 // attaches a TENT to a player (this is a high-priority tent) +#define TEFIRE_FLAG_ALLFLOAT 1 // all sprites will drift upwards as they animate +#define TEFIRE_FLAG_SOMEFLOAT 2 // some of the sprites will drift upwards. (50% chance) +#define TEFIRE_FLAG_LOOP 4 // if set, sprite plays at 15 fps, otherwise plays at whatever rate stretches the animation over the sprite's duration. +#define TEFIRE_FLAG_ALPHA 8 // if set, sprite is rendered alpha blended at 50% else, opaque +#define TEFIRE_FLAG_PLANAR 16 // if set, all fire sprites have same initial Z instead of randomly filling a cube. +#define TEFIRE_FLAG_ADDITIVE 32 // if set, sprite is rendered non-opaque with additive + +#define TE_PLAYERATTACHMENT 124 // attaches a TENT to a player (this is a high-priority tent) // byte (entity index of player) -// coord (vertical offset) (attachment origin.z = player origin.z + vertical offset) +// coord (vertical offset) ( attachment origin.z = player origin.z + vertical offset ) // short (model index) -// short (life * 10) +// short (life * 10 ); -#define TE_KILLPLAYERATTACHMENTS 125 // will expire all TENTS attached to a player. +#define TE_KILLPLAYERATTACHMENTS 125 // will expire all TENTS attached to a player. // byte (entity index of player) -#define TE_MULTIGUNSHOT 126 // much more compact shotgun message +#define TE_MULTIGUNSHOT 126 // much more compact shotgun message // This message is used to make a client approximate a 'spray' of gunfire. // Any weapon that fires more than one bullet per frame and fires in a bit of a spread is // a good candidate for MULTIGUNSHOT use. (shotguns) // // NOTE: This effect makes the client do traces for each bullet, these client traces ignore -// entities that have studio models.Traces are 4096 long. +// entities that have studio models.Traces are 4096 long. // // coord (origin) // coord (origin) @@ -592,74 +578,87 @@ // byte (count) // byte (bullethole decal texture index) -#define TE_USERTRACER 127 // larger message than the standard tracer, but allows some customization. +#define TE_USERTRACER 127 // larger message than the standard tracer, but allows some customization. // coord (origin) // coord (origin) // coord (origin) // coord (velocity) // coord (velocity) // coord (velocity) -// byte (life * 10) -// byte (color) this is an index into an array of color vectors in the engine. (0 -) -// byte (length * 10) - -#define MSG_BROADCAST 0 // unreliable to all -#define MSG_ONE 1 // reliable to one (msg_entity) -#define MSG_ALL 2 // reliable to all -#define MSG_INIT 3 // write to the init string -#define MSG_PVS 4 // Ents in PVS of org -#define MSG_PAS 5 // Ents in PAS of org -#define MSG_PVS_R 6 // Reliable to PVS -#define MSG_PAS_R 7 // Reliable to PAS -#define MSG_ONE_UNRELIABLE 8 // Send to one client, but don't put in reliable stream, put in unreliable datagram ( could be dropped ) -#define MSG_SPEC 9 // Sends to all spectator proxies +// byte ( life * 10 ) +// byte ( color ) this is an index into an array of color vectors in the engine. (0 - ) +// byte ( length * 10 ) + + + +#define MSG_BROADCAST 0 // unreliable to all +#define MSG_ONE 1 // reliable to one (msg_entity) +#define MSG_ALL 2 // reliable to all +#define MSG_INIT 3 // write to the init string +#define MSG_PVS 4 // Ents in PVS of org +#define MSG_PAS 5 // Ents in PAS of org +#define MSG_PVS_R 6 // Reliable to PVS +#define MSG_PAS_R 7 // Reliable to PAS +#define MSG_ONE_UNRELIABLE 8 // Send to one client, but don't put in reliable stream, put in unreliable datagram ( could be dropped ) +#define MSG_SPEC 9 // Sends to all spectator proxies // contents of a spot in the world -#define CONTENTS_EMPTY -1 -#define CONTENTS_SOLID -2 -#define CONTENTS_WATER 3 -#define CONTENTS_SLIME -4 -#define CONTENTS_LAVA -5 -#define CONTENTS_SKY -6 - -#define CONTENTS_LADDER -16 - -#define CONTENT_FLYFIELD -17 -#define CONTENT_GRAVITY_FLYFIELD -18 -#define CONTENT_FOG -19 - -#define CONTENT_EMPTY -1 -#define CONTENT_SOLID -2 -#define CONTENT_WATER -3 -#define CONTENT_SLIME -4 -#define CONTENT_LAVA -5 -#define CONTENT_SKY -6 +#define CONTENTS_EMPTY -1 +#define CONTENTS_SOLID -2 +#define CONTENTS_WATER -3 +#define CONTENTS_SLIME -4 +#define CONTENTS_LAVA -5 +#define CONTENTS_SKY -6 +/* These additional contents constants are defined in bspfile.h +#define CONTENTS_ORIGIN -7 // removed at csg time +#define CONTENTS_CLIP -8 // changed to contents_solid +#define CONTENTS_CURRENT_0 -9 +#define CONTENTS_CURRENT_90 -10 +#define CONTENTS_CURRENT_180 -11 +#define CONTENTS_CURRENT_270 -12 +#define CONTENTS_CURRENT_UP -13 +#define CONTENTS_CURRENT_DOWN -14 + +#define CONTENTS_TRANSLUCENT -15 +*/ +#define CONTENTS_LADDER -16 + +#define CONTENT_FLYFIELD -17 +#define CONTENT_GRAVITY_FLYFIELD -18 +#define CONTENT_FOG -19 + +#define CONTENT_EMPTY -1 +#define CONTENT_SOLID -2 +#define CONTENT_WATER -3 +#define CONTENT_SLIME -4 +#define CONTENT_LAVA -5 +#define CONTENT_SKY -6 // channels -#define CHAN_AUTO 0 -#define CHAN_WEAPON 1 -#define CHAN_VOICE 2 -#define CHAN_ITEM 3 -#define CHAN_BODY 4 -#define CHAN_STREAM 5 // allocate stream channel from the static or dynamic area -#define CHAN_STATIC 6 // allocate channel from the static area -#define CHAN_NETWORKVOICE_BASE 7 // voice data coming across the network -#define CHAN_NETWORKVOICE_END 500 // network voice data reserves slots (CHAN_NETWORKVOICE_BASE through CHAN_NETWORKVOICE_END). -#define CHAN_BOT 501 // channel used for bot chatter. +#define CHAN_AUTO 0 +#define CHAN_WEAPON 1 +#define CHAN_VOICE 2 +#define CHAN_ITEM 3 +#define CHAN_BODY 4 +#define CHAN_STREAM 5 // allocate stream channel from the static or dynamic area +#define CHAN_STATIC 6 // allocate channel from the static area +#define CHAN_NETWORKVOICE_BASE 7 // voice data coming across the network +#define CHAN_NETWORKVOICE_END 500 // network voice data reserves slots (CHAN_NETWORKVOICE_BASE through CHAN_NETWORKVOICE_END). +#define CHAN_BOT 501 // channel used for bot chatter. // attenuation values -#define ATTN_NONE 0 -#define ATTN_NORM 0.8f -#define ATTN_IDLE 2.0f -#define ATTN_STATIC 1.25f +#define ATTN_NONE 0 +#define ATTN_NORM (float)0.8 +#define ATTN_IDLE (float)2 +#define ATTN_STATIC (float)1.25 // pitch values -#define PITCH_NORM 100 // non-pitch shifted -#define PITCH_LOW 95 // other values are possible - 0-255, where 255 is very high -#define PITCH_HIGH 120 +#define PITCH_NORM 100 // non-pitch shifted +#define PITCH_LOW 95 // other values are possible - 0-255, where 255 is very high +#define PITCH_HIGH 120 // volume values -#define VOL_NORM 1.0f +#define VOL_NORM 1.0 // buttons #ifndef IN_BUTTONS_H @@ -667,69 +666,88 @@ #endif // Break Model Defines -#define BREAK_TYPEMASK 0x4F -#define BREAK_GLASS 0x01 -#define BREAK_METAL 0x02 -#define BREAK_FLESH 0x04 -#define BREAK_WOOD 0x08 -#define BREAK_SMOKE 0x10 -#define BREAK_TRANS 0x20 -#define BREAK_CONCRETE 0x40 -#define BREAK_2 0x80 +#define BREAK_TYPEMASK 0x4F +#define BREAK_GLASS 0x01 +#define BREAK_METAL 0x02 +#define BREAK_FLESH 0x04 +#define BREAK_WOOD 0x08 + +#define BREAK_SMOKE 0x10 +#define BREAK_TRANS 0x20 +#define BREAK_CONCRETE 0x40 +#define BREAK_2 0x80 // Colliding temp entity sounds -#define BOUNCE_GLASS BREAK_GLASS -#define BOUNCE_METAL BREAK_METAL -#define BOUNCE_FLESH BREAK_FLESH -#define BOUNCE_WOOD BREAK_WOOD -#define BOUNCE_SHRAP 0x10 -#define BOUNCE_SHELL 0x20 -#define BOUNCE_CONCRETE BREAK_CONCRETE -#define BOUNCE_SHOTSHELL 0x80 + +#define BOUNCE_GLASS BREAK_GLASS +#define BOUNCE_METAL BREAK_METAL +#define BOUNCE_FLESH BREAK_FLESH +#define BOUNCE_WOOD BREAK_WOOD +#define BOUNCE_SHRAP 0x10 +#define BOUNCE_SHELL 0x20 +#define BOUNCE_CONCRETE BREAK_CONCRETE +#define BOUNCE_SHOTSHELL 0x80 // Temp entity bounce sound types -#define TE_BOUNCE_NULL 0 -#define TE_BOUNCE_SHELL 1 -#define TE_BOUNCE_SHOTSHELL 2 +#define TE_BOUNCE_NULL 0 +#define TE_BOUNCE_SHELL 1 +#define TE_BOUNCE_SHOTSHELL 2 // Rendering constants -enum -{ - kRenderNormal, // src - kRenderTransColor, // c*a+dest*(1-a) - kRenderTransTexture, // src*a+dest*(1-a) - kRenderGlow, // src*a+dest -- No Z buffer checks - kRenderTransAlpha, // src*srca+dest*(1-srca) - kRenderTransAdd, // src*a+dest +enum +{ + kRenderNormal, // src + kRenderTransColor, // c*a+dest*(1-a) + kRenderTransTexture, // src*a+dest*(1-a) + kRenderGlow, // src*a+dest -- No Z buffer checks + kRenderTransAlpha, // src*srca+dest*(1-srca) + kRenderTransAdd, // src*a+dest }; -enum -{ - kRenderFxNone = 0, - kRenderFxPulseSlow, - kRenderFxPulseFast, - kRenderFxPulseSlowWide, - kRenderFxPulseFastWide, - kRenderFxFadeSlow, - kRenderFxFadeFast, - kRenderFxSolidSlow, - kRenderFxSolidFast, - kRenderFxStrobeSlow, - kRenderFxStrobeFast, - kRenderFxStrobeFaster, - kRenderFxFlickerSlow, +enum +{ + kRenderFxNone = 0, + kRenderFxPulseSlow, + kRenderFxPulseFast, + kRenderFxPulseSlowWide, + kRenderFxPulseFastWide, + kRenderFxFadeSlow, + kRenderFxFadeFast, + kRenderFxSolidSlow, + kRenderFxSolidFast, + kRenderFxStrobeSlow, + kRenderFxStrobeFast, + kRenderFxStrobeFaster, + kRenderFxFlickerSlow, kRenderFxFlickerFast, kRenderFxNoDissipation, - kRenderFxDistort, // Distort/scale/translate flicker - kRenderFxHologram, // kRenderFxDistort + distance fade - kRenderFxDeadPlayer, // kRenderAmt is the player index - kRenderFxExplode, // Scale up really big! - kRenderFxGlowShell, // Glowing Shell - kRenderFxClampMinScale, // Keep this sprite from getting very small (SPRITES only!) - kRenderFxLightMultiplier, // CTM !!!CZERO added to tell the studiorender that the value in iuser2 is a lightmultiplier + kRenderFxDistort, // Distort/scale/translate flicker + kRenderFxHologram, // kRenderFxDistort + distance fade + kRenderFxDeadPlayer, // kRenderAmt is the player index + kRenderFxExplode, // Scale up really big! + kRenderFxGlowShell, // Glowing Shell + kRenderFxClampMinScale, // Keep this sprite from getting very small (SPRITES only!) + kRenderFxLightMultiplier, //CTM !!!CZERO added to tell the studiorender that the value in iuser2 is a lightmultiplier }; + +typedef unsigned int func_t; +typedef unsigned int string_t; + +typedef unsigned char byte; +typedef unsigned short word; +#define _DEF_BYTE_ + +#undef true +#undef false + +#ifndef __cplusplus +typedef enum {false, true} qboolean; +#else +typedef int qboolean; +#endif + typedef struct { byte r, g, b; @@ -741,7 +759,7 @@ typedef struct } colorVec; #ifdef _WIN32 -#pragma pack(push, 2) +#pragma pack(push,2) #endif typedef struct @@ -752,30 +770,29 @@ typedef struct #ifdef _WIN32 #pragma pack(pop) #endif - typedef struct link_s { - struct link_s *prev, *next; + struct link_s *prev, *next; } link_t; typedef struct edict_s edict_t; typedef struct { - vec3_t normal; - float dist; + vec3_t normal; + float dist; } plane_t; typedef struct { - qboolean allsolid; // if true, plane is not valid - qboolean startsolid; // if true, the initial point was in a solid area - qboolean inopen, inwater; - float fraction; // time completed, 1.0 = didn't hit anything - vec3_t endpos; // final position - plane_t plane; // surface normal at impact - edict_t *ent; // entity the surface is on - int hitgroup; // 0 == generic, non zero is specific body part + qboolean allsolid; // if true, plane is not valid + qboolean startsolid; // if true, the initial point was in a solid area + qboolean inopen, inwater; + float fraction; // time completed, 1.0 = didn't hit anything + vec3_t endpos; // final position + plane_t plane; // surface normal at impact + edict_t * ent; // entity the surface is on + int hitgroup; // 0 == generic, non zero is specific body part } trace_t; #endif // CONST_H diff --git a/AccuracyFix/include/cssdk/common/mathlib.h b/AccuracyFix/include/cssdk/common/mathlib.h index d1dbdc9..c3c9256 100644 --- a/AccuracyFix/include/cssdk/common/mathlib.h +++ b/AccuracyFix/include/cssdk/common/mathlib.h @@ -106,19 +106,64 @@ inline T& operator&= (T& a, T b) { return (T&)((type&)a &= (type)b); } template::type> inline T& operator^= (T& a, T b) { return (T&)((type&)a ^= (type)b); } -inline double M_sqrt(int value) { - return sqrt(value); -} - inline float M_sqrt(float value) { return _mm_cvtss_f32(_mm_sqrt_ss(_mm_load_ss(&value))); } inline double M_sqrt(double value) { - double ret; auto v = _mm_load_sd(&value); - _mm_store_sd(&ret, _mm_sqrt_sd(v, v)); - return ret; + return _mm_cvtsd_f64(_mm_sqrt_sd(v, v)); +} + +template +inline double M_sqrt(T value) { + return sqrt(value); +} + +inline float M_min(float a, float b) { + return _mm_cvtss_f32(_mm_min_ss(_mm_load_ss(&a), _mm_load_ss(&b))); +} + +inline double M_min(double a, double b) { + return _mm_cvtsd_f64(_mm_min_sd(_mm_load_sd(&a), _mm_load_sd(&b))); +} + +template +inline T M_min(T a, T b) { + return min(a, b); +} + +inline float M_max(float a, float b) { + return _mm_cvtss_f32(_mm_max_ss(_mm_load_ss(&a), _mm_load_ss(&b))); +} + +inline double M_max(double a, double b) { + return _mm_cvtsd_f64(_mm_max_sd(_mm_load_sd(&a), _mm_load_sd(&b))); +} + +template +inline T M_max(T a, T b) { + return max(a, b); +} + +inline float M_clamp(float a, float min, float max) { + return _mm_cvtss_f32(_mm_min_ss(_mm_max_ss(_mm_load_ss(&a), _mm_load_ss(&min)), _mm_load_ss(&max))); +} + +inline double M_clamp(double a, double min, double max) { + return _mm_cvtsd_f64(_mm_min_sd(_mm_max_sd(_mm_load_sd(&a), _mm_load_sd(&min)), _mm_load_sd(&max))); +} + +template +inline T M_clamp(T a, T min, T max) { + return clamp(a, min, max); +} + +template +inline void SWAP(T &first, T &second) { + T temp = first; + first = second; + second = temp; } #define VectorSubtract(a,b,c) {(c)[0]=(a)[0]-(b)[0];(c)[1]=(a)[1]-(b)[1];(c)[2]=(a)[2]-(b)[2];} diff --git a/AccuracyFix/include/cssdk/dlls/API/CSEntity.h b/AccuracyFix/include/cssdk/dlls/API/CSEntity.h deleted file mode 100644 index aa8de82..0000000 --- a/AccuracyFix/include/cssdk/dlls/API/CSEntity.h +++ /dev/null @@ -1,129 +0,0 @@ -/* -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at -* your option) any later version. -* -* This program is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software Foundation, -* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -* In addition, as a special exception, the author gives permission to -* link the code of this program with the Half-Life Game Engine ("HL -* Engine") and Modified Game Libraries ("MODs") developed by Valve, -* L.L.C ("Valve"). You must obey the GNU General Public License in all -* respects for all of the code used other than the HL Engine and MODs -* from Valve. If you modify this file, you may extend this exception -* to your version of the file, but you are not obligated to do so. If -* you do not wish to do so, delete this exception statement from your -* version. -* -*/ - -#pragma once - -class CBaseEntity; -class CCSEntity -{ - DECLARE_CLASS_TYPES(CCSEntity, CCSEntity); -public: - CCSEntity() : - m_pContainingEntity(nullptr) - { - m_ucDmgPenetrationLevel = 0; - } - - virtual ~CCSEntity() {} - virtual void FireBullets(int iShots, Vector &vecSrc, Vector &vecDirShooting, Vector &vecSpread, float flDistance, int iBulletType, int iTracerFreq, int iDamage, entvars_t *pevAttacker) = 0; - virtual void FireBuckshots(ULONG cShots, Vector &vecSrc, Vector &vecDirShooting, Vector &vecSpread, float flDistance, int iTracerFreq, int iDamage, entvars_t *pevAttacker) = 0; - virtual 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; - -public: - CBaseEntity *m_pContainingEntity; - unsigned char m_ucDmgPenetrationLevel; // penetration level of the damage caused by the inflictor - entvars_t *m_pevLastInflictor; - -private: -#if defined(_MSC_VER) -#pragma region reserve_data_Region -#endif - char CCSEntity_Reserve[0x3FF7]; - - virtual void func_reserve1() {}; - virtual void func_reserve2() {}; - virtual void func_reserve3() {}; - virtual void func_reserve4() {}; - virtual void func_reserve5() {}; - virtual void func_reserve6() {}; - virtual void func_reserve7() {}; - virtual void func_reserve8() {}; - virtual void func_reserve9() {}; - virtual void func_reserve10() {}; - virtual void func_reserve11() {}; - virtual void func_reserve12() {}; - virtual void func_reserve13() {}; - virtual void func_reserve14() {}; - virtual void func_reserve15() {}; - virtual void func_reserve16() {}; - virtual void func_reserve17() {}; - virtual void func_reserve18() {}; - virtual void func_reserve19() {}; - virtual void func_reserve20() {}; - virtual void func_reserve21() {}; - virtual void func_reserve22() {}; - virtual void func_reserve23() {}; - virtual void func_reserve24() {}; - virtual void func_reserve25() {}; - virtual void func_reserve26() {}; - virtual void func_reserve27() {}; - virtual void func_reserve28() {}; - virtual void func_reserve29() {}; - virtual void func_reserve30() {}; -#if defined(_MSC_VER) -#pragma endregion -#endif -}; - -class CCSDelay: public CCSEntity -{ - DECLARE_CLASS_TYPES(CCSDelay, CCSEntity); -public: - -private: - int CCSDelay_Reserve[0x100]; -}; - -class CCSAnimating: public CCSDelay -{ - DECLARE_CLASS_TYPES(CCSAnimating, CCSDelay); -public: - -private: - int CCSAnimating_Reserve[0x100]; -}; - -class CCSToggle: public CCSAnimating -{ - DECLARE_CLASS_TYPES(CCSToggle, CCSAnimating); -public: - -private: - int CCSToggle_Reserve[0x100]; -}; - -class CCSMonster: public CCSToggle -{ - DECLARE_CLASS_TYPES(CCSMonster, CCSToggle); -public: - -private: - int CCSMonster_Reserve[0x100]; -}; - -#define CSENTITY_API_INTERFACE_VERSION "CSENTITY_API_INTERFACE_VERSION003" diff --git a/AccuracyFix/include/cssdk/dlls/API/CSPlayer.h b/AccuracyFix/include/cssdk/dlls/API/CSPlayer.h deleted file mode 100644 index 3495ee2..0000000 --- a/AccuracyFix/include/cssdk/dlls/API/CSPlayer.h +++ /dev/null @@ -1,186 +0,0 @@ -/* -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at -* your option) any later version. -* -* This program is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software Foundation, -* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -* In addition, as a special exception, the author gives permission to -* link the code of this program with the Half-Life Game Engine ("HL -* Engine") and Modified Game Libraries ("MODs") developed by Valve, -* L.L.C ("Valve"). You must obey the GNU General Public License in all -* respects for all of the code used other than the HL Engine and MODs -* from Valve. If you modify this file, you may extend this exception -* to your version of the file, but you are not obligated to do so. If -* you do not wish to do so, delete this exception statement from your -* version. -* -*/ - -#pragma once - -#include -#include -#include - -enum WeaponInfiniteAmmoMode -{ - WPNMODE_INFINITE_CLIP = 1, - WPNMODE_INFINITE_BPAMMO -}; - -class CCSPlayer: public CCSMonster -{ - DECLARE_CLASS_TYPES(CCSPlayer, CCSMonster); -public: - CCSPlayer() : - m_bForceShowMenu(false), - m_flRespawnPending(0), - m_flSpawnProtectionEndTime(0), - m_iWeaponInfiniteAmmo(0), - m_iWeaponInfiniteIds(0), - m_bCanShootOverride(false), - m_bGameForcingRespawn(false), - m_bAutoBunnyHopping(false), - m_bMegaBunnyJumping(false), - m_bPlantC4Anywhere(false), - m_bSpawnProtectionEffects(false), - m_flJumpHeight(0), - m_flLongJumpHeight(0), - m_flLongJumpForce(0), - m_flDuckSpeedMultiplier(0), - m_iUserID(-1) - { - m_szModel[0] = '\0'; - - // Resets the kill history for this player - for (int i = 0; i < MAX_CLIENTS; i++) - { - m_iNumKilledByUnanswered[i] = 0; - m_bPlayerDominated[i] = false; - } - } - - virtual bool IsConnected() const = 0; - virtual void SetAnimation(PLAYER_ANIM playerAnim) = 0; - virtual void AddAccount(int amount, RewardType type = RT_NONE, bool bTrackChange = true) = 0; - virtual CBaseEntity *GiveNamedItem(const char *pszName) = 0; - virtual CBaseEntity *GiveNamedItemEx(const char *pszName) = 0; - virtual void GiveDefaultItems() = 0; - virtual void GiveShield(bool bDeploy = true) = 0; - virtual CBaseEntity *DropShield(bool bDeploy = true) = 0; - virtual CBaseEntity *DropPlayerItem(const char *pszItemName) = 0; - virtual bool RemoveShield() = 0; - virtual void RemoveAllItems(bool bRemoveSuit) = 0; - virtual bool RemovePlayerItem(const char* pszItemName) = 0; - virtual void SetPlayerModel(bool bHasC4) = 0; - virtual void SetPlayerModelEx(const char *modelName) = 0; - virtual void SetNewPlayerModel(const char *modelName) = 0; - virtual void ClientCommand(const char *cmd, const char *arg1 = nullptr, const char *arg2 = nullptr, const char *arg3 = nullptr) = 0; - virtual void SetProgressBarTime(int time) = 0; - virtual void SetProgressBarTime2(int time, float timeElapsed) = 0; - virtual struct edict_s *EntSelectSpawnPoint() = 0; - virtual void SetBombIcon(bool bFlash = false) = 0; - virtual void SetScoreAttrib(CBasePlayer *dest) = 0; - virtual void SendItemStatus() = 0; - virtual void ReloadWeapons(CBasePlayerItem *pWeapon = nullptr, bool bForceReload = false, bool bForceRefill = false) = 0; - virtual void Observer_SetMode(int iMode) = 0; - virtual bool SelectSpawnSpot(const char *pEntClassName, CBaseEntity* &pSpot) = 0; - virtual bool SwitchWeapon(CBasePlayerItem *pWeapon) = 0; - virtual void SwitchTeam() = 0; - virtual bool JoinTeam(TeamName team) = 0; - virtual void StartObserver(Vector& vecPosition, Vector& vecViewAngle) = 0; - virtual void TeamChangeUpdate() = 0; - virtual void DropSecondary() = 0; - virtual void DropPrimary() = 0; - virtual bool HasPlayerItem(CBasePlayerItem *pCheckItem) = 0; - virtual bool HasNamedPlayerItem(const char *pszItemName) = 0; - virtual CBasePlayerItem *GetItemById(WeaponIdType weaponID) = 0; - virtual CBasePlayerItem *GetItemByName(const char *itemName) = 0; - virtual void Disappear() = 0; - virtual void MakeVIP() = 0; - virtual bool MakeBomber() = 0; - virtual void ResetSequenceInfo() = 0; - virtual void StartDeathCam() = 0; - virtual bool RemovePlayerItemEx(const char* pszItemName, bool bRemoveAmmo) = 0; - virtual void SetSpawnProtection(float flProtectionTime) = 0; - virtual void RemoveSpawnProtection() = 0; - virtual bool HintMessageEx(const char *pMessage, float duration = 6.0f, bool bDisplayIfPlayerDead = false, bool bOverride = false) = 0; - virtual void Reset() = 0; - virtual void OnSpawnEquip(bool addDefault = true, bool equipGame = true) = 0; - virtual void SetScoreboardAttributes(CBasePlayer *destination = nullptr) = 0; - - CBasePlayer *BasePlayer() const; - -public: - enum EProtectionState - { - ProtectionSt_NoSet, - ProtectionSt_Active, - ProtectionSt_Expired, - }; - - EProtectionState GetProtectionState() const; - bool CheckActivityInGame(); - -public: - char m_szModel[32]; - bool m_bForceShowMenu; - float m_flRespawnPending; - float m_flSpawnProtectionEndTime; - Vector m_vecOldvAngle; - int m_iWeaponInfiniteAmmo; - int m_iWeaponInfiniteIds; - bool m_bCanShootOverride; - bool m_bGameForcingRespawn; - bool m_bAutoBunnyHopping; - bool m_bMegaBunnyJumping; - bool m_bPlantC4Anywhere; - bool m_bSpawnProtectionEffects; - double m_flJumpHeight; - double m_flLongJumpHeight; - double m_flLongJumpForce; - double m_flDuckSpeedMultiplier; - - int m_iUserID; - struct CDamageRecord_t - { - float flDamage = 0.0f; - float flFlashDurationTime = 0.0f; - int userId = -1; - }; - using DamageList_t = CUtlArray; - DamageList_t m_DamageList; // A unified array of recorded damage that includes giver and taker in each entry - DamageList_t &GetDamageList() { return m_DamageList; } - int m_iNumKilledByUnanswered[MAX_CLIENTS]; // [0-31] how many unanswered kills this player has been dealt by each other player - bool m_bPlayerDominated[MAX_CLIENTS]; // [0-31] array of state per other player whether player is dominating other players -}; - -// Inlines -inline CBasePlayer *CCSPlayer::BasePlayer() const -{ - return reinterpret_cast(this->m_pContainingEntity); -} - -inline CCSPlayer::EProtectionState CCSPlayer::GetProtectionState() const -{ - // no protection set - if (m_flSpawnProtectionEndTime <= 0.0f) - return ProtectionSt_NoSet; - - // check if end time of protection isn't expired yet - if (m_flSpawnProtectionEndTime >= gpGlobals->time) - return ProtectionSt_Active; - - // has expired - return ProtectionSt_Expired; -} diff --git a/AccuracyFix/include/cssdk/dlls/API/CSPlayerItem.h b/AccuracyFix/include/cssdk/dlls/API/CSPlayerItem.h deleted file mode 100644 index e4bec45..0000000 --- a/AccuracyFix/include/cssdk/dlls/API/CSPlayerItem.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at -* your option) any later version. -* -* This program is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software Foundation, -* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -* In addition, as a special exception, the author gives permission to -* link the code of this program with the Half-Life Game Engine ("HL -* Engine") and Modified Game Libraries ("MODs") developed by Valve, -* L.L.C ("Valve"). You must obey the GNU General Public License in all -* respects for all of the code used other than the HL Engine and MODs -* from Valve. If you modify this file, you may extend this exception -* to your version of the file, but you are not obligated to do so. If -* you do not wish to do so, delete this exception statement from your -* version. -* -*/ - -#pragma once - -class CBasePlayerItem; -class CCSPlayerItem: public CCSAnimating -{ - DECLARE_CLASS_TYPES(CCSPlayerItem, CCSAnimating); -public: - CCSPlayerItem() - { - Q_memset(&m_ItemInfo, 0, sizeof(m_ItemInfo)); - } - - virtual void SetItemInfo(ItemInfo *pInfo) = 0; - virtual int GetItemInfo(ItemInfo *pInfo) = 0; - - CBasePlayerItem *BasePlayerItem() const; - -public: - ItemInfo m_ItemInfo; -}; - -// Inlines -inline CBasePlayerItem *CCSPlayerItem::BasePlayerItem() const -{ - return reinterpret_cast(this->m_pContainingEntity); -} diff --git a/AccuracyFix/include/cssdk/dlls/API/CSPlayerWeapon.h b/AccuracyFix/include/cssdk/dlls/API/CSPlayerWeapon.h deleted file mode 100644 index 837347c..0000000 --- a/AccuracyFix/include/cssdk/dlls/API/CSPlayerWeapon.h +++ /dev/null @@ -1,65 +0,0 @@ -/* -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at -* your option) any later version. -* -* This program is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software Foundation, -* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -* In addition, as a special exception, the author gives permission to -* link the code of this program with the Half-Life Game Engine ("HL -* Engine") and Modified Game Libraries ("MODs") developed by Valve, -* L.L.C ("Valve"). You must obey the GNU General Public License in all -* respects for all of the code used other than the HL Engine and MODs -* from Valve. If you modify this file, you may extend this exception -* to your version of the file, but you are not obligated to do so. If -* you do not wish to do so, delete this exception statement from your -* version. -* -*/ - -#pragma once - -enum SecondaryAtkState : uint8_t -{ - WEAPON_SECONDARY_ATTACK_NONE = 0, - WEAPON_SECONDARY_ATTACK_SET, - WEAPON_SECONDARY_ATTACK_BLOCK -}; - -class CBasePlayerWeapon; -class CCSPlayerWeapon: public CCSPlayerItem -{ - DECLARE_CLASS_TYPES(CCSPlayerWeapon, CCSPlayerItem); -public: - CCSPlayerWeapon() : - m_iStateSecondaryAttack(WEAPON_SECONDARY_ATTACK_NONE) - { - } - - virtual BOOL DefaultDeploy(char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal = 0) = 0; - virtual int DefaultReload(int iClipSize, int iAnim, float fDelay) = 0; - virtual bool DefaultShotgunReload(int iAnim, int iStartAnim, float fDelay, float fStartDelay, const char *pszReloadSound1 = nullptr, const char *pszReloadSound2 = nullptr) = 0; - virtual void KickBack(float up_base, float lateral_base, float up_modifier, float lateral_modifier, float up_max, float lateral_max, int direction_change) = 0; - virtual void SendWeaponAnim(int iAnim, int skiplocal = 0) = 0; - - CBasePlayerWeapon *BasePlayerWeapon() const; - -public: - SecondaryAtkState m_iStateSecondaryAttack; - float m_flBaseDamage; -}; - -// Inlines -inline CBasePlayerWeapon *CCSPlayerWeapon::BasePlayerWeapon() const -{ - return reinterpret_cast(this->m_pContainingEntity); -} diff --git a/AccuracyFix/include/cssdk/dlls/activity.h b/AccuracyFix/include/cssdk/dlls/activity.h index a34b76a..d854e9a 100644 --- a/AccuracyFix/include/cssdk/dlls/activity.h +++ b/AccuracyFix/include/cssdk/dlls/activity.h @@ -25,6 +25,7 @@ * version. * */ + #pragma once typedef enum Activity_s @@ -36,21 +37,21 @@ typedef enum Activity_s ACT_GUARD, ACT_WALK, ACT_RUN, - ACT_FLY, + ACT_FLY, // Fly (and flap if appropriate) ACT_SWIM, - ACT_HOP, - ACT_LEAP, + ACT_HOP, // vertical jump + ACT_LEAP, // long forward jump ACT_FALL, ACT_LAND, ACT_STRAFE_LEFT, ACT_STRAFE_RIGHT, - ACT_ROLL_LEFT, - ACT_ROLL_RIGHT, - ACT_TURN_LEFT, - ACT_TURN_RIGHT, - ACT_CROUCH, - ACT_CROUCHIDLE, - ACT_STAND, + ACT_ROLL_LEFT, // tuck and roll, left + ACT_ROLL_RIGHT, // tuck and roll, right + ACT_TURN_LEFT, // turn quickly left (stationary) + ACT_TURN_RIGHT, // turn quickly right (stationary) + ACT_CROUCH, // the act of crouching down from a standing position + ACT_CROUCHIDLE, // holding body in crouched position (loops) + ACT_STAND, // the act of standing from a crouched position ACT_USE, ACT_SIGNAL1, ACT_SIGNAL2, @@ -64,43 +65,43 @@ typedef enum Activity_s ACT_MELEE_ATTACK1, ACT_MELEE_ATTACK2, ACT_RELOAD, - ACT_ARM, - ACT_DISARM, - ACT_EAT, + ACT_ARM, // pull out gun, for instance + ACT_DISARM, // reholster gun + ACT_EAT, // monster chowing on a large food item (loop) ACT_DIESIMPLE, ACT_DIEBACKWARD, ACT_DIEFORWARD, ACT_DIEVIOLENT, - ACT_BARNACLE_HIT, - ACT_BARNACLE_PULL, - ACT_BARNACLE_CHOMP, - ACT_BARNACLE_CHEW, + ACT_BARNACLE_HIT, // barnacle tongue hits a monster + ACT_BARNACLE_PULL, // barnacle is lifting the monster ( loop ) + ACT_BARNACLE_CHOMP, // barnacle latches on to the monster + ACT_BARNACLE_CHEW, // barnacle is holding the monster in its mouth ( loop ) ACT_SLEEP, - ACT_INSPECT_FLOOR, - ACT_INSPECT_WALL, - ACT_IDLE_ANGRY, - ACT_WALK_HURT, - ACT_RUN_HURT, - ACT_HOVER, - ACT_GLIDE, - ACT_FLY_LEFT, - ACT_FLY_RIGHT, - ACT_DETECT_SCENT, - ACT_SNIFF, - ACT_BITE, - ACT_THREAT_DISPLAY, - ACT_FEAR_DISPLAY, - ACT_EXCITED, - ACT_SPECIAL_ATTACK1, + ACT_INSPECT_FLOOR, // for active idles, look at something on or near the floor + ACT_INSPECT_WALL, // for active idles, look at something directly ahead of you ( doesn't HAVE to be a wall or on a wall ) + ACT_IDLE_ANGRY, // alternate idle animation in which the monster is clearly agitated. (loop) + ACT_WALK_HURT, // limp (loop) + ACT_RUN_HURT, // limp (loop) + ACT_HOVER, // Idle while in flight + ACT_GLIDE, // Fly (don't flap) + ACT_FLY_LEFT, // Turn left in flight + ACT_FLY_RIGHT, // Turn right in flight + ACT_DETECT_SCENT, // this means the monster smells a scent carried by the air + ACT_SNIFF, // this is the act of actually sniffing an item in front of the monster + ACT_BITE, // some large monsters can eat small things in one bite. This plays one time, EAT loops. + ACT_THREAT_DISPLAY, // without attacking, monster demonstrates that it is angry. (Yell, stick out chest, etc ) + ACT_FEAR_DISPLAY, // monster just saw something that it is afraid of + ACT_EXCITED, // for some reason, monster is excited. Sees something he really likes to eat, or whatever. + ACT_SPECIAL_ATTACK1, // very monster specific special attacks. ACT_SPECIAL_ATTACK2, - ACT_COMBAT_IDLE, + ACT_COMBAT_IDLE, // agitated idle. ACT_WALK_SCARED, ACT_RUN_SCARED, - ACT_VICTORY_DANCE, - ACT_DIE_HEADSHOT, - ACT_DIE_CHESTSHOT, - ACT_DIE_GUTSHOT, - ACT_DIE_BACKSHOT, + ACT_VICTORY_DANCE, // killed a player, do a victory dance. + ACT_DIE_HEADSHOT, // die, hit in head. + ACT_DIE_CHESTSHOT, // die, hit in chest + ACT_DIE_GUTSHOT, // die, hit in gut + ACT_DIE_BACKSHOT, // die, hit in back ACT_FLINCH_HEAD, ACT_FLINCH_CHEST, ACT_FLINCH_STOMACH, diff --git a/AccuracyFix/include/cssdk/dlls/activitymap.h b/AccuracyFix/include/cssdk/dlls/activitymap.h index cf5ddfc..17e5be2 100644 --- a/AccuracyFix/include/cssdk/dlls/activitymap.h +++ b/AccuracyFix/include/cssdk/dlls/activitymap.h @@ -107,5 +107,5 @@ activity_map_t activity_map[] = _A(ACT_FLINCH_RIGHTARM), _A(ACT_FLINCH_LEFTLEG), _A(ACT_FLINCH_RIGHTLEG), - 0, NULL + 0, nullptr }; diff --git a/AccuracyFix/include/cssdk/dlls/airtank.h b/AccuracyFix/include/cssdk/dlls/airtank.h index 717dbf8..90de064 100644 --- a/AccuracyFix/include/cssdk/dlls/airtank.h +++ b/AccuracyFix/include/cssdk/dlls/airtank.h @@ -25,11 +25,10 @@ * version. * */ + #pragma once -class CAirtank: public CGrenade -{ - DECLARE_CLASS_TYPES(CAirtank, CGrenade); +class CAirtank: public CGrenade { public: virtual void Spawn() = 0; virtual void Precache() = 0; diff --git a/AccuracyFix/include/cssdk/dlls/ammo.h b/AccuracyFix/include/cssdk/dlls/ammo.h index de116b0..8c41ff6 100644 --- a/AccuracyFix/include/cssdk/dlls/ammo.h +++ b/AccuracyFix/include/cssdk/dlls/ammo.h @@ -25,92 +25,73 @@ * version. * */ + #pragma once -class C9MMAmmo: public CBasePlayerAmmo -{ - DECLARE_CLASS_TYPES(C9MMAmmo, CBasePlayerAmmo); +class C9MMAmmo: public CBasePlayerAmmo { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual BOOL AddAmmo(CBaseEntity *pOther) = 0; }; -class CBuckShotAmmo: public CBasePlayerAmmo -{ - DECLARE_CLASS_TYPES(CBuckShotAmmo, CBasePlayerAmmo); +class CBuckShotAmmo: public CBasePlayerAmmo { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual BOOL AddAmmo(CBaseEntity *pOther) = 0; }; -class C556NatoAmmo: public CBasePlayerAmmo -{ - DECLARE_CLASS_TYPES(C556NatoAmmo, CBasePlayerAmmo); +class C556NatoAmmo: public CBasePlayerAmmo { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual BOOL AddAmmo(CBaseEntity *pOther) = 0; }; -class C556NatoBoxAmmo: public CBasePlayerAmmo -{ - DECLARE_CLASS_TYPES(C556NatoBoxAmmo, CBasePlayerAmmo); +class C556NatoBoxAmmo: public CBasePlayerAmmo { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual BOOL AddAmmo(CBaseEntity *pOther) = 0; }; -class C762NatoAmmo: public CBasePlayerAmmo -{ - DECLARE_CLASS_TYPES(C762NatoAmmo, CBasePlayerAmmo); +class C762NatoAmmo: public CBasePlayerAmmo { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual BOOL AddAmmo(CBaseEntity *pOther) = 0; }; -class C45ACPAmmo: public CBasePlayerAmmo -{ - DECLARE_CLASS_TYPES(C45ACPAmmo, CBasePlayerAmmo); +class C45ACPAmmo: public CBasePlayerAmmo { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual BOOL AddAmmo(CBaseEntity *pOther) = 0; }; -class C50AEAmmo: public CBasePlayerAmmo -{ - DECLARE_CLASS_TYPES(C50AEAmmo, CBasePlayerAmmo); +class C50AEAmmo: public CBasePlayerAmmo { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual BOOL AddAmmo(CBaseEntity *pOther) = 0; }; -class C338MagnumAmmo: public CBasePlayerAmmo -{ - DECLARE_CLASS_TYPES(C338MagnumAmmo, CBasePlayerAmmo); +class C338MagnumAmmo: public CBasePlayerAmmo { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual BOOL AddAmmo(CBaseEntity *pOther) = 0; }; -class C57MMAmmo: public CBasePlayerAmmo -{ - DECLARE_CLASS_TYPES(C57MMAmmo, CBasePlayerAmmo); +class C57MMAmmo: public CBasePlayerAmmo { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual BOOL AddAmmo(CBaseEntity *pOther) = 0; }; -class C357SIGAmmo: public CBasePlayerAmmo -{ - DECLARE_CLASS_TYPES(C357SIGAmmo, CBasePlayerAmmo); +class C357SIGAmmo: public CBasePlayerAmmo { public: virtual void Spawn() = 0; virtual void Precache() = 0; diff --git a/AccuracyFix/include/cssdk/dlls/basemonster.h b/AccuracyFix/include/cssdk/dlls/basemonster.h index d40008e..c26746e 100644 --- a/AccuracyFix/include/cssdk/dlls/basemonster.h +++ b/AccuracyFix/include/cssdk/dlls/basemonster.h @@ -25,11 +25,24 @@ * version. * */ + #pragma once +#include "gib.h" #include "activity.h" -class EHANDLE; +enum +{ + ITBD_PARALLYZE = 0, + ITBD_NERVE_GAS, + ITBD_POISON, + ITBD_RADIATION, + ITBD_DROWN_RECOVER, + ITBD_ACID, + ITBD_SLOW_BURN, + ITBD_SLOW_FREEZE, + ITBD_END +}; enum MONSTERSTATE { @@ -45,9 +58,7 @@ enum MONSTERSTATE }; class CBaseToggle; -class CBaseMonster: public CBaseToggle -{ - DECLARE_CLASS_TYPES(CBaseMonster, CBaseToggle); +class CBaseMonster: public CBaseToggle { public: virtual void KeyValue(KeyValueData *pkvd) = 0; virtual void TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType) = 0; @@ -88,20 +99,20 @@ class CBaseMonster: public CBaseToggle public: Activity m_Activity; // what the monster is doing (animation) Activity m_IdealActivity; // monster should switch to this activity - int m_LastHitGroup; // the last body region that took damage + int m_LastHitGroup; // the last body region that took damage int m_bitsDamageType; // what types of damage has monster (player) taken - byte m_rgbTimeBasedDamage[8]; + byte m_rgbTimeBasedDamage[ITBD_END]; MONSTERSTATE m_MonsterState; // monster's current state MONSTERSTATE m_IdealMonsterState; // monster should change to this state int m_afConditions; int m_afMemory; - float m_flNextAttack; // cannot attack again until this time - EHANDLE m_hEnemy; // the entity that the monster is fighting. - EHANDLE m_hTargetEnt; // the entity that the monster is trying to reach - float m_flFieldOfView; // width of monster's field of view ( dot product ) - int m_bloodColor; // color of blood particless - Vector m_HackedGunPos; // HACK until we can query end of gun - Vector m_vecEnemyLKP; // last known position of enemy. (enemy's origin) + float m_flNextAttack; // cannot attack again until this time + EHANDLE m_hEnemy; // the entity that the monster is fighting. + EHANDLE m_hTargetEnt; // the entity that the monster is trying to reach + float m_flFieldOfView; // width of monster's field of view (dot product) + int m_bloodColor; // color of blood particless + Vector m_HackedGunPos; // HACK until we can query end of gun + Vector m_vecEnemyLKP; // last known position of enemy. (enemy's origin) }; diff --git a/AccuracyFix/include/cssdk/dlls/bmodels.h b/AccuracyFix/include/cssdk/dlls/bmodels.h index 6e9b565..2908ab7 100644 --- a/AccuracyFix/include/cssdk/dlls/bmodels.h +++ b/AccuracyFix/include/cssdk/dlls/bmodels.h @@ -25,43 +25,16 @@ * version. * */ -#pragma once - -// 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_BRUSH_ACCDCC 16 // brush should accelerate and decelerate when toggled -#define SF_BRUSH_HURT 32 // rotating brush that inflicts pain based on rotation speed - -#define SF_ROTATING_NOT_SOLID 64 // some special rotating objects are not solid. - -#define SF_BRUSH_ROTATE_SMALLRADIUS 128 -#define SF_BRUSH_ROTATE_MEDIUMRADIUS 256 -#define SF_BRUSH_ROTATE_LARGERADIUS 512 - -#define FANPITCHMIN 30 -#define FANPITCHMAX 100 - -// func_pendulum -#define SF_PENDULUM_SWING 2 // spawnflag that makes a pendulum a rope swing. -#define SF_PENDULUM_AUTO_RETURN 16 -#define SF_PENDULUM_PASSABLE 32 -// func_wall_toggle -#define SF_WALL_START_OFF 0x0001 +#pragma once -// func_conveyor -#define SF_CONVEYOR_VISUAL 0x0001 -#define SF_CONVEYOR_NOTSOLID 0x0002 +// covering cheesy noise1, noise2, & noise3 fields so they make more sense (for rotating fans) +#define noiseStart noise1 +#define noiseStop noise2 +#define noiseRunning noise3 // This is just a solid wall if not inhibited -class CFuncWall: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CFuncWall, CBaseEntity); +class CFuncWall: public CBaseEntity { public: virtual void Spawn() = 0; @@ -70,26 +43,28 @@ class CFuncWall: public CBaseEntity virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class CFuncWallToggle: public CFuncWall -{ - DECLARE_CLASS_TYPES(CFuncWallToggle, CFuncWall); +#define SF_WALL_TOOGLE_START_OFF BIT(0) +#define SF_WALL_TOOGLE_NOTSOLID BIT(3) + +class CFuncWallToggle: public CFuncWall { public: virtual void Spawn() = 0; + virtual void Restart() = 0; + virtual int ObjectCaps() = 0; virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class CFuncConveyor: public CFuncWall -{ - DECLARE_CLASS_TYPES(CFuncConveyor, CFuncWall); +#define SF_CONVEYOR_VISUAL BIT(0) +#define SF_CONVEYOR_NOTSOLID BIT(1) + +class CFuncConveyor: public CFuncWall { public: virtual void Spawn() = 0; virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; }; // A simple entity that looks solid but lets you walk through it. -class CFuncIllusionary: public CBaseToggle -{ - DECLARE_CLASS_TYPES(CFuncIllusionary, CBaseToggle); +class CFuncIllusionary: public CBaseToggle { public: virtual void Spawn() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; @@ -103,9 +78,7 @@ class CFuncIllusionary: public CBaseToggle // // otherwise it will be invisible and not solid. This can be used to keep // specific monsters out of certain areas -class CFuncMonsterClip: public CFuncWall -{ - DECLARE_CLASS_TYPES(CFuncMonsterClip, CFuncWall); +class CFuncMonsterClip: public CFuncWall { public: virtual void Spawn() = 0; @@ -113,9 +86,21 @@ class CFuncMonsterClip: public CFuncWall virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class CFuncRotating: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CFuncRotating, CBaseEntity); +#define SF_BRUSH_ROTATE_START_ON BIT(0) +#define SF_BRUSH_ROTATE_BACKWARDS BIT(1) +#define SF_BRUSH_ROTATE_Z_AXIS BIT(2) +#define SF_BRUSH_ROTATE_X_AXIS BIT(3) +#define SF_BRUSH_ACCDCC BIT(4) // brush should accelerate and decelerate when toggled +#define SF_BRUSH_HURT BIT(5) // rotating brush that inflicts pain based on rotation speed +#define SF_BRUSH_ROTATE_NOT_SOLID BIT(6) // some special rotating objects are not solid. +#define SF_BRUSH_ROTATE_SMALLRADIUS BIT(7) +#define SF_BRUSH_ROTATE_MEDIUMRADIUS BIT(8) +#define SF_BRUSH_ROTATE_LARGERADIUS BIT(9) + +const int MAX_FANPITCH = 100; +const int MIN_FANPITCH = 30; + +class CFuncRotating: public CBaseEntity { public: // basic functions virtual void Spawn() = 0; @@ -137,9 +122,12 @@ class CFuncRotating: public CBaseEntity Vector m_angles; }; -class CPendulum: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CPendulum, CBaseEntity); +#define SF_PENDULUM_START_ON BIT(0) +#define SF_PENDULUM_SWING BIT(1) // spawnflag that makes a pendulum a rope swing +#define SF_PENDULUM_PASSABLE BIT(3) +#define SF_PENDULUM_AUTO_RETURN BIT(4) + +class CPendulum: public CBaseEntity { public: virtual void Spawn() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; diff --git a/AccuracyFix/include/cssdk/dlls/bot/cs_bot.h b/AccuracyFix/include/cssdk/dlls/bot/cs_bot.h index f9f30aa..87f800e 100644 --- a/AccuracyFix/include/cssdk/dlls/bot/cs_bot.h +++ b/AccuracyFix/include/cssdk/dlls/bot/cs_bot.h @@ -25,34 +25,34 @@ * version. * */ + #pragma once #include "bot/cs_gamestate.h" #include "bot/cs_bot_manager.h" #include "bot/cs_bot_chatter.h" -#define PRIMARY_WEAPON_BUY_COUNT 13 -#define SECONDARY_WEAPON_BUY_COUNT 3 +const int CSBOT_VERSION_MAJOR = 1; +const int CSBOT_VERSION_MINOR = 50; -#define FLAG_PROGRESS_DRAW 0x0 // draw status bar progress -#define FLAG_PROGRESS_START 0x1 // init status bar progress -#define FLAG_PROGRESS_HIDE 0x2 // hide status bar progress +const int MAX_BUY_WEAPON_PRIMARY = 13; +const int MAX_BUY_WEAPON_SECONDARY = 3; -#define HI_X 0x01 -#define LO_X 0x02 -#define HI_Y 0x04 -#define LO_Y 0x08 -#define HI_Z 0x10 -#define LO_Z 0x20 +enum +{ + BOT_PROGGRESS_DRAW = 0, // draw status bar progress + BOT_PROGGRESS_START, // init status bar progress + BOT_PROGGRESS_HIDE, // hide status bar progress +}; extern int _navAreaCount; extern int _currentIndex; -extern struct BuyInfo primaryWeaponBuyInfoCT[PRIMARY_WEAPON_BUY_COUNT]; -extern struct BuyInfo secondaryWeaponBuyInfoCT[SECONDARY_WEAPON_BUY_COUNT]; +extern struct BuyInfo primaryWeaponBuyInfoCT[MAX_BUY_WEAPON_PRIMARY]; +extern struct BuyInfo secondaryWeaponBuyInfoCT[MAX_BUY_WEAPON_SECONDARY]; -extern struct BuyInfo primaryWeaponBuyInfoT[PRIMARY_WEAPON_BUY_COUNT]; -extern struct BuyInfo secondaryWeaponBuyInfoT[SECONDARY_WEAPON_BUY_COUNT]; +extern struct BuyInfo primaryWeaponBuyInfoT[MAX_BUY_WEAPON_PRIMARY]; +extern struct BuyInfo secondaryWeaponBuyInfoT[MAX_BUY_WEAPON_SECONDARY]; class CCSBot; class BotChatterInterface; @@ -235,10 +235,10 @@ class FollowState: public BotState virtual void OnExit(CCSBot *me) {} virtual const char *GetName() const { return "Follow"; } - void SetLeader(CBaseEntity *leader) { m_leader = leader; } + void SetLeader(CBasePlayer *leader) { m_leader = leader; } public: - EHANDLE m_leader; + EntityHandle m_leader; Vector m_lastLeaderPos; bool m_isStopped; float m_stoppedTimestamp; @@ -275,34 +275,35 @@ class UseEntityState: public BotState { void SetEntity(CBaseEntity *entity) { m_entity = entity; } private: - EHANDLE m_entity; + EntityHandle m_entity; }; // The Counter-strike Bot class CCSBot: public CBot { public: - virtual BOOL TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) = 0; // invoked when injured by something (EXTEND) - returns the amount of damage inflicted - virtual void Killed(entvars_t *pevAttacker, int iGib) = 0; // invoked when killed (EXTEND) + virtual BOOL TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) = 0; // invoked when injured by something (EXTEND) - returns the amount of damage inflicted + virtual void Killed(entvars_t *pevAttacker, int iGib) = 0; // invoked when killed (EXTEND) virtual void RoundRespawn() = 0; - virtual void Blind(float duration, float holdTime, float fadeTime, int alpha = 255) = 0; // player blinded by a flashbang - virtual void OnTouchingWeapon(CWeaponBox *box) = 0; // invoked when in contact with a CWeaponBox + virtual void Blind(float duration, float holdTime, float fadeTime, int alpha = 255) = 0; // player blinded by a flashbang + virtual void OnTouchingWeapon(CWeaponBox *box) = 0; // invoked when in contact with a CWeaponBox - virtual bool Initialize(const BotProfile *profile) = 0; // (EXTEND) prepare bot for action + virtual bool Initialize(const BotProfile *profile) = 0; // (EXTEND) prepare bot for action virtual void SpawnBot() = 0; // (EXTEND) spawn the bot into the game virtual void Upkeep() = 0; // lightweight maintenance, invoked frequently virtual void Update() = 0; // heavyweight algorithms, invoked less often virtual void Walk() = 0; - virtual bool Jump(bool mustJump = false) = 0; // returns true if jump was started + virtual bool Jump(bool mustJump = false) = 0; // returns true if jump was started virtual void OnEvent(GameEventType event, CBaseEntity *entity = NULL, CBaseEntity *other = NULL) = 0; // invoked when event occurs in the game (some events have NULL entity) #define CHECK_FOV true - virtual bool IsVisible(const Vector *pos, bool testFOV = false) const = 0; // return true if we can see the point - virtual bool IsVisible(CBasePlayer *player, bool testFOV = false, unsigned char *visParts = NULL) const = 0; // return true if we can see any part of the player + virtual bool IsVisible(const Vector *pos, bool testFOV = false) const = 0; // return true if we can see the point + virtual bool IsVisible(CBasePlayer *player, bool testFOV = false, unsigned char *visParts = NULL) const = 0; // return true if we can see any part of the player + + virtual bool IsEnemyPartVisible(VisiblePartType part) const = 0; // if enemy is visible, return the part we see for our current enemy - virtual bool IsEnemyPartVisible(VisiblePartType part) const = 0; // if enemy is visible, return the part we see for our current enemy public: const Vector &GetEyePosition() const @@ -317,7 +318,7 @@ class CCSBot: public CBot { friend class AttackState; friend class BuyState; - char m_name[64]; // copied from STRING(pev->netname) for debugging + char m_name[64]; // copied from STRING(pev->netname) for debugging // behavior properties float m_combatRange; // desired distance between us and them during gunplay @@ -337,21 +338,21 @@ class CCSBot: public CBot { MoraleType m_morale; // our current morale, based on our win/loss history bool m_diedLastRound; // true if we died last round - float m_safeTime; // duration at the beginning of the round where we feel "safe" - bool m_wasSafe; // true if we were in the safe time last update - NavRelativeDirType m_blindMoveDir; // which way to move when we're blind - bool m_blindFire; // if true, fire weapon while blinded + float m_safeTime; // duration at the beginning of the round where we feel "safe" + bool m_wasSafe; // true if we were in the safe time last update + NavRelativeDirType m_blindMoveDir; // which way to move when we're blind + bool m_blindFire; // if true, fire weapon while blinded // TODO: implement through CountdownTimer float m_surpriseDelay; // when we were surprised float m_surpriseTimestamp; - bool m_isFollowing; // true if we are following someone - EHANDLE m_leader; // the ID of who we are following + bool m_isFollowing; // true if we are following someone + EHANDLE m_leader; // the ID of who we are following float m_followTimestamp; // when we started following - float m_allowAutoFollowTime; // time when we can auto follow + float m_allowAutoFollowTime; // time when we can auto follow - CountdownTimer m_hurryTimer; // if valid, bot is in a hurry + CountdownTimer m_hurryTimer; // if valid, bot is in a hurry // instances of each possible behavior state, to avoid dynamic memory allocation during runtime IdleState m_idleState; @@ -370,7 +371,7 @@ class CCSBot: public CBot { // TODO: Allow multiple simultaneous state machines (look around, etc) BotState *m_state; // current behavior state - float m_stateTimestamp; // time state was entered + float m_stateTimestamp; // time state was entered bool m_isAttacking; // if true, special Attack state is overriding the state machine // high-level tasks @@ -400,15 +401,15 @@ class CCSBot: public CBot { NUM_TASKS }; TaskType m_task; // our current task - EHANDLE m_taskEntity; // an entity used for our task + EntityHandle m_taskEntity; // an entity used for our task // navigation Vector m_goalPosition; - EHANDLE m_goalEntity; + EHandle m_goalEntity; - CNavArea *m_currentArea; // the nav area we are standing on - CNavArea *m_lastKnownArea; // the last area we were in - EHANDLE m_avoid; // higher priority player we need to make way for + CNavArea *m_currentArea; // the nav area we are standing on + CNavArea *m_lastKnownArea; // the last area we were in + EntityHandle m_avoid; // higher priority player we need to make way for float m_avoidTimestamp; bool m_isJumpCrouching; bool m_isJumpCrouched; @@ -418,9 +419,9 @@ class CCSBot: public CBot { enum { _MAX_PATH_LENGTH = 256 }; struct ConnectInfo { - CNavArea *area; // the area along the path + CNavArea *area; // the area along the path NavTraverseType how; // how to enter this area from the previous one - Vector pos; // our movement goal position at this point in the path + Vector pos; // our movement goal position at this point in the path const CNavLadder *ladder; // if "how" refers to a ladder, this is it } m_path[_MAX_PATH_LENGTH]; @@ -428,9 +429,9 @@ class CCSBot: public CBot { int m_pathIndex; float m_areaEnteredTimestamp; - CountdownTimer m_repathTimer; // must have elapsed before bot can pathfind again + CountdownTimer m_repathTimer; // must have elapsed before bot can pathfind again - mutable CountdownTimer m_avoidFriendTimer; // used to throttle how often we check for friends in our path + mutable CountdownTimer m_avoidFriendTimer; // used to throttle how often we check for friends in our path mutable bool m_isFriendInTheWay; // true if a friend is blocking our path CountdownTimer m_politeTimer; // we'll wait for friend to move until this runs out bool m_isWaitingBehindFriend; // true if we are waiting for a friend to move @@ -443,21 +444,21 @@ class CCSBot: public CBot { FACE_DESCENDING_LADDER, MOUNT_ASCENDING_LADDER, // move toward ladder until "on" it MOUNT_DESCENDING_LADDER, // move toward ladder until "on" it - ASCEND_LADDER, // go up the ladder - DESCEND_LADDER, // go down the ladder + ASCEND_LADDER, // go up the ladder + DESCEND_LADDER, // go down the ladder DISMOUNT_ASCENDING_LADDER, // get off of the ladder DISMOUNT_DESCENDING_LADDER, // get off of the ladder MOVE_TO_DESTINATION, // dismount ladder and move to destination area } m_pathLadderState; - bool m_pathLadderFaceIn; // if true, face towards ladder, otherwise face away - const CNavLadder *m_pathLadder; // the ladder we need to use to reach the next area + bool m_pathLadderFaceIn; // if true, face towards ladder, otherwise face away + const CNavLadder *m_pathLadder; // the ladder we need to use to reach the next area NavRelativeDirType m_pathLadderDismountDir; // which way to dismount float m_pathLadderDismountTimestamp; // time when dismount started - float m_pathLadderEnd; // if ascending, z of top, if descending z of bottom - float m_pathLadderTimestamp; // time when we started using ladder - for timeout check + float m_pathLadderEnd; // if ascending, z of top, if descending z of bottom + float m_pathLadderTimestamp; // time when we started using ladder - for timeout check - CountdownTimer m_mustRunTimer; // if nonzero, bot cannot walk + CountdownTimer m_mustRunTimer; // if nonzero, bot cannot walk // game scenario mechanisms CSGameState m_gameState; @@ -474,40 +475,40 @@ class CCSBot: public CBot { float m_noiseTimestamp; // when we heard it (can get zeroed) CNavArea *m_noiseArea; // the nav area containing the noise float m_noiseCheckTimestamp; - PriorityType m_noisePriority; // priority of currently heard noise + PriorityType m_noisePriority; // priority of currently heard noise bool m_isNoiseTravelRangeChecked; // "looking around" mechanism - float m_lookAroundStateTimestamp; // time of next state change + float m_lookAroundStateTimestamp; // time of next state change float m_lookAheadAngle; // our desired forward look angle float m_forwardAngle; // our current forward facing direction - float m_inhibitLookAroundTimestamp; // time when we can look around again + float m_inhibitLookAroundTimestamp; // time when we can look around again enum LookAtSpotState { NOT_LOOKING_AT_SPOT, // not currently looking at a point in space - LOOK_TOWARDS_SPOT, // in the process of aiming at m_lookAtSpot - LOOK_AT_SPOT, // looking at m_lookAtSpot + LOOK_TOWARDS_SPOT, // in the process of aiming at m_lookAtSpot + LOOK_AT_SPOT, // looking at m_lookAtSpot NUM_LOOK_AT_SPOT_STATES } m_lookAtSpotState; Vector m_lookAtSpot; // the spot we're currently looking at PriorityType m_lookAtSpotPriority; float m_lookAtSpotDuration; // how long we need to look at the spot - float m_lookAtSpotTimestamp; // when we actually began looking at the spot - float m_lookAtSpotAngleTolerance; // how exactly we must look at the spot - bool m_lookAtSpotClearIfClose; // if true, the look at spot is cleared if it gets close to us + float m_lookAtSpotTimestamp; // when we actually began looking at the spot + float m_lookAtSpotAngleTolerance; // how exactly we must look at the spot + bool m_lookAtSpotClearIfClose; // if true, the look at spot is cleared if it gets close to us const char *m_lookAtDesc; // for debugging float m_peripheralTimestamp; enum { MAX_APPROACH_POINTS = 16 }; Vector m_approachPoint[MAX_APPROACH_POINTS]; unsigned char m_approachPointCount; - Vector m_approachPointViewPosition; // the position used when computing current approachPoint set - bool m_isWaitingToTossGrenade; // lining up throw - CountdownTimer m_tossGrenadeTimer; // timeout timer for grenade tossing + Vector m_approachPointViewPosition; // the position used when computing current approachPoint set + bool m_isWaitingToTossGrenade; // lining up throw + CountdownTimer m_tossGrenadeTimer; // timeout timer for grenade tossing - SpotEncounter *m_spotEncounter; // the spots we will encounter as we move thru our current area + SpotEncounter *m_spotEncounter; // the spots we will encounter as we move thru our current area float m_spotCheckTimestamp; // when to check next encounter spot // TODO: Add timestamp for each possible client to hiding spots @@ -529,9 +530,9 @@ class CCSBot: public CBot { // aim angle mechanism mutable Vector m_eyePos; Vector m_aimOffset; // current error added to victim's position to get actual aim spot - Vector m_aimOffsetGoal; // desired aim offset - float m_aimOffsetTimestamp; // time of next offset adjustment - float m_aimSpreadTimestamp; // time used to determine max spread as it begins to tighten up + Vector m_aimOffsetGoal; // desired aim offset + float m_aimOffsetTimestamp; // time of next offset adjustment + float m_aimSpreadTimestamp; // time used to determine max spread as it begins to tighten up Vector m_aimSpot; // the spot we are currently aiming to fire at // attack state data @@ -539,22 +540,22 @@ class CCSBot: public CBot { enum DispositionType { ENGAGE_AND_INVESTIGATE, // engage enemies on sight and investigate enemy noises - OPPORTUNITY_FIRE, // engage enemies on sight, but only look towards enemy noises, dont investigate - SELF_DEFENSE, // only engage if fired on, or very close to enemy - IGNORE_ENEMIES, // ignore all enemies - useful for ducking around corners, running away, etc + OPPORTUNITY_FIRE, // engage enemies on sight, but only look towards enemy noises, dont investigate + SELF_DEFENSE, // only engage if fired on, or very close to enemy + IGNORE_ENEMIES, // ignore all enemies - useful for ducking around corners, running away, etc NUM_DISPOSITIONS }; DispositionType m_disposition; // how we will react to enemies - CountdownTimer m_ignoreEnemiesTimer; // how long will we ignore enemies - mutable EHANDLE m_enemy; // our current enemy - bool m_isEnemyVisible; // result of last visibility test on enemy + CountdownTimer m_ignoreEnemiesTimer; // how long will we ignore enemies + mutable EntityHandle m_enemy; // our current enemy + bool m_isEnemyVisible; // result of last visibility test on enemy unsigned char m_visibleEnemyParts; // which parts of the visible enemy do we see - Vector m_lastEnemyPosition; // last place we saw the enemy + Vector m_lastEnemyPosition; // last place we saw the enemy float m_lastSawEnemyTimestamp; float m_firstSawEnemyTimestamp; float m_currentEnemyAcquireTimestamp; - float m_enemyDeathTimestamp; // if m_enemy is dead, this is when he died + float m_enemyDeathTimestamp; // if m_enemy is dead, this is when he died bool m_isLastEnemyDead; // true if we killed or saw our last enemy die int m_nearbyEnemyCount; // max number of enemies we've seen recently unsigned int m_enemyPlace; // the location where we saw most of our enemies @@ -565,19 +566,19 @@ class CCSBot: public CBot { bool isEnemy; } m_watchInfo[MAX_CLIENTS]; - mutable EHANDLE m_bomber; // points to bomber if we can see him + mutable EntityHandle m_bomber; // points to bomber if we can see him - int m_nearbyFriendCount; // number of nearby teammates - mutable EHANDLE m_closestVisibleFriend; // the closest friend we can see - mutable EHANDLE m_closestVisibleHumanFriend; // the closest human friend we can see + int m_nearbyFriendCount; // number of nearby teammates + mutable EntityHandle m_closestVisibleFriend; // the closest friend we can see + mutable EntityHandle m_closestVisibleHumanFriend; // the closest human friend we can see - CBasePlayer *m_attacker; // last enemy that hurt us (may not be same as m_enemy) - float m_attackedTimestamp; // when we were hurt by the m_attacker + CBasePlayer *m_attacker; // last enemy that hurt us (may not be same as m_enemy) + float m_attackedTimestamp; // when we were hurt by the m_attacker int m_lastVictimID; // the entindex of the last victim we killed, or zero - bool m_isAimingAtEnemy; // if true, we are trying to aim at our enemy - bool m_isRapidFiring; // if true, RunUpkeep() will toggle our primary attack as fast as it can - IntervalTimer m_equipTimer; // how long have we had our current weapon equipped + bool m_isAimingAtEnemy; // if true, we are trying to aim at our enemy + bool m_isRapidFiring; // if true, RunUpkeep() will toggle our primary attack as fast as it can + IntervalTimer m_equipTimer; // how long have we had our current weapon equipped float m_fireWeaponTimestamp; // reaction time system @@ -585,20 +586,20 @@ class CCSBot: public CBot { struct ReactionState { // NOTE: player position & orientation is not currently stored separately - EHANDLE player; + EntityHandle player; bool isReloading; bool isProtectedByShield; } - m_enemyQueue[MAX_ENEMY_QUEUE]; // round-robin queue for simulating reaction times + m_enemyQueue[MAX_ENEMY_QUEUE]; // round-robin queue for simulating reaction times byte m_enemyQueueIndex; byte m_enemyQueueCount; - byte m_enemyQueueAttendIndex; // index of the timeframe we are "conscious" of + byte m_enemyQueueAttendIndex; // index of the timeframe we are "conscious" of // stuck detection bool m_isStuck; float m_stuckTimestamp; // time when we got stuck - Vector m_stuckSpot; // the location where we became stuck + Vector m_stuckSpot; // the location where we became stuck NavRelativeDirType m_wiggleDirection; float m_wiggleTimestamp; float m_stuckJumpTimestamp; // time for next jump when stuck @@ -614,8 +615,8 @@ class CCSBot: public CBot { float m_lastRadioRecievedTimestamp; // time we recieved a radio message float m_lastRadioSentTimestamp; // time when we send a radio message - EHANDLE m_radioSubject; // who issued the radio message - Vector m_radioPosition; // position referred to in radio message + EntityHandle m_radioSubject; // who issued the radio message + Vector m_radioPosition; // position referred to in radio message float m_voiceFeedbackStartTimestamp; float m_voiceFeedbackEndTimestamp; // new-style "voice" chatter gets voice feedback BotChatterInterface m_chatter; diff --git a/AccuracyFix/include/cssdk/dlls/bot/cs_bot_chatter.h b/AccuracyFix/include/cssdk/dlls/bot/cs_bot_chatter.h index 4f56b96..2e62a33 100644 --- a/AccuracyFix/include/cssdk/dlls/bot/cs_bot_chatter.h +++ b/AccuracyFix/include/cssdk/dlls/bot/cs_bot_chatter.h @@ -27,10 +27,10 @@ */ #pragma once -#define UNDEFINED_COUNT 0xFFFF -#define MAX_PLACES_PER_MAP 64 -#define UNDEFINED_SUBJECT (-1) -#define COUNT_MANY 4 // equal to or greater than this is "many" +#define UNDEFINED_COUNT 0xFFFF +#define MAX_PLACES_PER_MAP 64 +#define UNDEFINED_SUBJECT (-1) +#define COUNT_MANY 4 // equal to or greater than this is "many" class CCSBot; class BotChatterInterface; @@ -58,6 +58,7 @@ class BotHostageBeingTakenMeme: public BotMeme { class BotHelpMeme: public BotMeme { public: virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme + public: Place m_place; }; @@ -65,9 +66,10 @@ class BotHelpMeme: public BotMeme { class BotBombsiteStatusMeme: public BotMeme { public: virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme + public: enum StatusType { CLEAR, PLANTED }; - int m_zoneIndex; // the bombsite + int m_zoneIndex; // the bombsite StatusType m_status; // whether it is cleared or the bomb is there (planted) }; @@ -87,7 +89,8 @@ class BotFollowMeme: public BotMeme { class BotDefendHereMeme: public BotMeme { public: - virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme + virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme + public: Vector m_pos; }; @@ -115,7 +118,7 @@ enum BotStatementType REPORT_MY_PLAN, REPORT_INFORMATION, REPORT_EMOTE, - REPORT_ACKNOWLEDGE, // affirmative or negative + REPORT_ACKNOWLEDGE, // affirmative or negative REPORT_ENEMIES_REMAINING, REPORT_FRIENDLY_FIRE, REPORT_KILLED_FRIEND, @@ -145,18 +148,19 @@ class BotPhrase { GameEventType GetRadioEquivalent() const { return m_radioEvent; } bool IsImportant() const { return m_isImportant; } // return true if this phrase is part of an important statement bool IsPlace() const { return m_isPlace; } + public: friend class BotPhraseManager; char *m_name; Place m_id; - bool m_isPlace; // true if this is a Place phrase + bool m_isPlace; // true if this is a Place phrase GameEventType m_radioEvent; - bool m_isImportant; // mission-critical statement + bool m_isImportant; // mission-critical statement - mutable BotVoiceBankVector m_voiceBank; // array of voice banks (arrays of speakables) - std::vector m_count; // number of speakables + mutable BotVoiceBankVector m_voiceBank; // array of voice banks (arrays of speakables) + std::vector m_count; // number of speakables mutable std::vector< int > m_index; // index of next speakable to return - int m_numVoiceBanks; // number of voice banks that have been initialized + int m_numVoiceBanks; // number of voice banks that have been initialized mutable PlaceCriteria m_placeCriteria; mutable CountCriteria m_countCriteria; @@ -244,11 +248,11 @@ class BotStatement { BotChatterInterface *GetChatter() const { return m_chatter; } BotStatementType GetType() const { return m_type; } // return the type of statement this is bool HasSubject() const { return (m_subject != UNDEFINED_SUBJECT); } - void SetSubject(int playerID) { m_subject = playerID; } // who this statement is about + void SetSubject(int playerID) { m_subject = playerID; } // who this statement is about int GetSubject() const { return m_subject; } // who this statement is about void SetPlace(Place where) { m_place = where; } // explicitly set place - void SetStartTime(float timestamp) { m_startTime = timestamp; } // define the earliest time this statement can be spoken + void SetStartTime(float timestamp) { m_startTime = timestamp; } // define the earliest time this statement can be spoken float GetStartTime() const { return m_startTime; } bool IsSpeaking() const { return m_isSpeaking; } // return true if this statement is currently being spoken float GetTimestamp() const { return m_timestamp; } // get time statement was created (but not necessarily started talking) @@ -256,10 +260,9 @@ class BotStatement { public: friend class BotChatterInterface; - BotChatterInterface *m_chatter; // the chatter system this statement is part of - BotStatement *m_next, *m_prev; // linked list hooks - - BotStatementType m_type; // what kind of statement this is + BotChatterInterface *m_chatter; // the chatter system this statement is part of + BotStatement *m_next, *m_prev; // linked list hooks + BotStatementType m_type; // what kind of statement this is int m_subject; // who this subject is about Place m_place; // explicit place - note some phrases have implicit places as well BotMeme *m_meme; // a statement can only have a single meme for now @@ -267,7 +270,7 @@ class BotStatement { float m_timestamp; // time when message was created float m_startTime; // the earliest time this statement can be spoken float m_expireTime; // time when this statement is no longer valid - float m_speakTimestamp; // time when message began being spoken + float m_speakTimestamp; // time when message began being spoken bool m_isSpeaking; // true if this statement is current being spoken float m_nextTime; // time for next phrase to begin @@ -315,15 +318,14 @@ class BotChatterInterface { CCSBot *GetOwner() const { return m_me; } int GetPitch() const { return m_pitch; } bool SeesAtLeastOneEnemy() const { return m_seeAtLeastOneEnemy; } + public: - BotStatement *m_statementList; // list of all active/pending messages for this bot - void ReportEnemies(); // track nearby enemy count and generate enemy activity statements - bool ShouldSpeak() const; // return true if we speaking makes sense now + BotStatement *m_statementList; // list of all active/pending messages for this bot CCSBot *m_me; // the bot this chatter is for bool m_seeAtLeastOneEnemy; float m_timeWhenSawFirstEnemy; bool m_reportedEnemies; - bool m_requestedBombLocation; // true if we already asked where the bomb has been planted + bool m_requestedBombLocation; // true if we already asked where the bomb has been planted int m_pitch; IntervalTimer m_needBackupInterval; IntervalTimer m_spottedBomberInterval; diff --git a/AccuracyFix/include/cssdk/dlls/buttons.h b/AccuracyFix/include/cssdk/dlls/buttons.h index 9c525d3..65a72b8 100644 --- a/AccuracyFix/include/cssdk/dlls/buttons.h +++ b/AccuracyFix/include/cssdk/dlls/buttons.h @@ -25,33 +25,12 @@ * version. * */ -#pragma once - -#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 +#pragma once -#define SF_BTARGET_USE 0x0001 -#define SF_BTARGET_ON 0x0002 +#define SF_GLOBAL_SET BIT(0) // Set global state to initial state on spawn -class CEnvGlobal: public CPointEntity -{ - DECLARE_CLASS_TYPES(CEnvGlobal, CPointEntity); +class CEnvGlobal: public CPointEntity { public: virtual void Spawn() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; @@ -64,16 +43,26 @@ class CEnvGlobal: public CPointEntity int m_initialstate; }; -class CRotButton: public CBaseButton -{ - DECLARE_CLASS_TYPES(CRotButton, CBaseButton); +#define SF_ROTBUTTON_NOTSOLID BIT(0) +#define SF_ROTBUTTON_BACKWARDS BIT(1) + +class CRotButton: public CBaseButton { public: virtual void Spawn() = 0; + virtual void Restart() = 0; + virtual int Save(CSave &save) = 0; + virtual int Restore(CRestore &restore) = 0; +public: + Vector m_vecSpawn; }; -class CMomentaryRotButton: public CBaseToggle -{ - DECLARE_CLASS_TYPES(CMomentaryRotButton, CBaseToggle); +// 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 BIT(0) + +class CMomentaryRotButton: public CBaseToggle { public: virtual void Spawn() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; @@ -90,9 +79,10 @@ class CMomentaryRotButton: public CBaseToggle int m_sounds; }; -class CEnvSpark: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CEnvSpark, CBaseEntity); +#define SF_SPARK_TOOGLE BIT(5) +#define SF_SPARK_IF_OFF BIT(6) + +class CEnvSpark: public CBaseEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -103,9 +93,10 @@ class CEnvSpark: public CBaseEntity float m_flDelay; }; -class CButtonTarget: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CButtonTarget, CBaseEntity); +#define SF_BTARGET_USE BIT(0) +#define SF_BTARGET_ON BIT(1) + +class CButtonTarget: public CBaseEntity { public: virtual void Spawn() = 0; virtual int ObjectCaps() = 0; diff --git a/AccuracyFix/include/cssdk/dlls/cbase.h b/AccuracyFix/include/cssdk/dlls/cbase.h index 96731bb..1ca3520 100644 --- a/AccuracyFix/include/cssdk/dlls/cbase.h +++ b/AccuracyFix/include/cssdk/dlls/cbase.h @@ -30,6 +30,8 @@ #include "util.h" #include "schedule.h" +#include "saverestore.h" +#include "scriptevent.h" #include "monsterevent.h" class CSave; @@ -41,18 +43,23 @@ class CBasePlayerItem; class CSquadMonster; class CCSEntity; -#define DECLARE_CLASS_TYPES(className, baseClassName)\ -public: \ - using BaseClass = baseClassName; \ - using ThisClass = className; \ +#define SetThink(a)\ + m_pfnThink = static_cast(a) +#define SetTouch(a)\ + m_pfnTouch = static_cast(a) +#define SetUse(a)\ + m_pfnUse = static_cast(a) +#define SetBlocked(a)\ + m_pfnBlocked = static_cast(a) -class CBaseEntity -{ - DECLARE_CLASS_TYPES(CBaseEntity, CBaseEntity); +#define SetMoveDone(a)\ + m_pfnCallWhenMoveDone = static_cast(a) + +class CBaseEntity { public: - // Constructor. Set engine to use C/C++ callback functions + // Constructor. Set engine to use C/C++ callback functions // pointers to engine data - entvars_t *pev; // Don't need to save/restore this pointer, the engine resets it + entvars_t *pev; // Don't need to save/restore this pointer, the engine resets it // path corners CBaseEntity *m_pGoalEnt; // path corner we are heading towards @@ -90,7 +97,7 @@ class CBaseEntity virtual void AddPointsToTeam(int score, BOOL bAllowNegativeScore) = 0; virtual BOOL AddPlayerItem(CBasePlayerItem *pItem) = 0; virtual BOOL RemovePlayerItem(CBasePlayerItem *pItem) = 0; - virtual int GiveAmmo(int iAmount, char *szName, int iMax = -1) = 0; + virtual int GiveAmmo(int iAmount, const char *szName, int iMax = -1) = 0; virtual float GetDelay() = 0; virtual int IsMoving() = 0; virtual void OverrideReset() = 0; @@ -119,31 +126,6 @@ class CBaseEntity void (CBaseEntity::*m_pfnUse)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); void (CBaseEntity::*m_pfnBlocked)(CBaseEntity *pOther); - void EXT_FUNC DLLEXPORT SUB_Think(); - void EXT_FUNC DLLEXPORT SUB_Touch(CBaseEntity *pOther); - void EXT_FUNC DLLEXPORT SUB_Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value); - void EXT_FUNC DLLEXPORT SUB_Blocked(CBaseEntity *pOther); - - using thinkfn_t = decltype(m_pfnThink); - template - void SetThink(void (T::*pfn)()); - void SetThink(std::nullptr_t); - - using touchfn_t = decltype(m_pfnTouch); - template - void SetTouch(void (T::*pfn)(CBaseEntity *pOther)); - void SetTouch(std::nullptr_t); - - using usefn_t = decltype(m_pfnUse); - template - void SetUse(void (T::*pfn)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)); - void SetUse(std::nullptr_t); - - using blockedfn_t = decltype(m_pfnBlocked); - template - void SetBlocked(void (T::*pfn)(CBaseEntity *pOther)); - void SetBlocked(std::nullptr_t); - virtual void Think() = 0; virtual void Touch(CBaseEntity *pOther) = 0; virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType = USE_OFF, float value = 0.0f) = 0; @@ -153,9 +135,9 @@ class CBaseEntity virtual void UpdateOwner() = 0; virtual BOOL FBecomeProne() = 0; - virtual Vector Center() = 0; // center point of entity - virtual Vector EyePosition() = 0; // position of eyes - virtual Vector EarPosition() = 0; // position of ears + virtual Vector Center() = 0; // center point of entity + virtual Vector EyePosition() = 0; // position of eyes + virtual Vector EarPosition() = 0; // position of ears virtual Vector BodyTarget(const Vector &posSrc) = 0; // position to shoot at virtual int Illumination() = 0; @@ -166,14 +148,35 @@ class CBaseEntity static CBaseEntity *Instance(entvars_t *pev) { return Instance(ENT(pev)); } static CBaseEntity *Instance(int offset) { return Instance(ENT(offset)); } - edict_t *edict() { return ENT(pev); } - EOFFSET eoffset() { return OFFSET(pev); } - int entindex() { return ENTINDEX(edict()); } - int IsDormant() { return (pev->flags & FL_DORMANT) == FL_DORMANT; } + edict_t *edict(); + EOFFSET eoffset(); + int entindex(); + int IsDormant(); + + bool Intersects(CBaseEntity *pOther); + bool Intersects(const Vector &mins, const Vector &maxs); + + // Exports func's, useful method's for SetThink + void EXPORT SUB_CallUseToggle(); + { + Use(this, this, USE_TOGGLE, 0); + } + + void EXPORT SUB_Remove() + { + if (pev->health > 0) + { + // this situation can screw up monsters who can't tell their entity pointers are invalid. + pev->health = 0; + ALERT(at_aiconsole, "SUB_Remove called on entity with health > 0\n"); + } + + REMOVE_ENTITY(ENT(pev)); + } public: - CCSEntity *m_pEntity; // NOTE: it was replaced on member "int *current_ammo" because it is useless. - CCSEntity *CSEntity() const; + // NOTE: it was replaced on member "int *current_ammo" because it is useless. + CCSEntity *m_pEntity; // We use this variables to store each ammo count. float currentammo; @@ -210,90 +213,35 @@ class CBaseEntity // Inlines inline BOOL FNullEnt(CBaseEntity *ent) { return (ent == NULL || FNullEnt(ent->edict())); } -template -inline void CBaseEntity::SetThink(void (T::*pfn)()) -{ - m_pfnThink = static_cast(pfn); -} - -inline void CBaseEntity::SetThink(std::nullptr_t) -{ - m_pfnThink = nullptr; -} - -template -inline void CBaseEntity::SetTouch(void (T::*pfn)(CBaseEntity *pOther)) -{ - m_pfnTouch = static_cast(pfn); -} - -inline void CBaseEntity::SetTouch(std::nullptr_t) -{ - m_pfnTouch = nullptr; -} - -template -inline void CBaseEntity::SetUse(void (T::*pfn)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)) -{ - m_pfnUse = static_cast(pfn); -} - -inline void CBaseEntity::SetUse(std::nullptr_t) -{ - m_pfnUse = nullptr; -} - -template -inline void CBaseEntity::SetBlocked(void (T::*pfn)(CBaseEntity *pOther)) -{ - m_pfnBlocked = static_cast(pfn); -} - -inline void CBaseEntity::SetBlocked(std::nullptr_t) -{ - m_pfnBlocked = nullptr; -} - -inline CCSEntity *CBaseEntity::CSEntity() const -{ - return m_pEntity; -} - -class CPointEntity: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CPointEntity, CBaseEntity); +class CPointEntity: public CBaseEntity { public: virtual void Spawn() = 0; virtual int ObjectCaps() = 0; }; // generic Delay entity -class CBaseDelay: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CBaseDelay, CBaseEntity); +class CBaseDelay: public CBaseEntity { public: virtual void KeyValue(KeyValueData *pkvd) = 0; virtual int Save(CSave &save) = 0; virtual int Restore(CRestore &restore) = 0; public: float m_flDelay; - int m_iszKillTarget; + string_t m_iszKillTarget; }; -class CBaseAnimating: public CBaseDelay -{ - DECLARE_CLASS_TYPES(CBaseAnimating, CBaseDelay); +class CBaseAnimating: public CBaseDelay { public: virtual int Save(CSave &save) = 0; virtual int Restore(CRestore &restore) = 0; virtual void HandleAnimEvent(MonsterEvent_t *pEvent) = 0; public: // animation needs - float m_flFrameRate; // computed FPS for current sequence - float m_flGroundSpeed; // computed linear movement rate for current sequence - float m_flLastEventCheck; // last time the event list was checked - BOOL m_fSequenceFinished; // flag set when StudioAdvanceFrame moves across a frame boundry - BOOL m_fSequenceLoops; // true if the sequence loops + float m_flFrameRate; // computed FPS for current sequence + float m_flGroundSpeed; // computed linear movement rate for current sequence + float m_flLastEventCheck; // last time the event list was checked + BOOL m_fSequenceFinished; // flag set when StudioAdvanceFrame moves across a frame boundry + BOOL m_fSequenceLoops; // true if the sequence loops }; // EHANDLE. Safe way to point to CBaseEntities who may die between frames @@ -315,25 +263,21 @@ class EHANDLE { }; // generic Toggle entity. -class CBaseToggle: public CBaseAnimating -{ - DECLARE_CLASS_TYPES(CBaseToggle, CBaseAnimating); +class CBaseToggle: public CBaseAnimating { public: virtual void KeyValue(KeyValueData *pkvd) = 0; virtual int Save(CSave &save) = 0; virtual int Restore(CRestore &restore) = 0; virtual int GetToggleState() = 0; virtual float GetDelay() = 0; - - void EXT_FUNC DLLEXPORT SUB_MoveDone(); public: TOGGLE_STATE m_toggle_state; float m_flActivateFinished; // like attack_finished, but for doors float m_flMoveDistance; // how far a door should slide or rotate float m_flWait; float m_flLip; - float m_flTWidth; // for plats - float m_flTLength; // for plats + float m_flTWidth; // for plats + float m_flTLength; // for plats Vector m_vecPosition1; Vector m_vecPosition2; @@ -344,12 +288,6 @@ class CBaseToggle: public CBaseAnimating float m_flHeight; EHANDLE m_hActivator; void (CBaseToggle::*m_pfnCallWhenMoveDone)(); - - using movedonefn_t = decltype(m_pfnCallWhenMoveDone); - template - void SetMoveDone(void (T::*pfn)()); - void SetMoveDone(std::nullptr_t); - Vector m_vecFinalDest; Vector m_vecFinalAngle; @@ -362,24 +300,17 @@ class CBaseToggle: public CBaseAnimating // deactivated. }; -template -inline void CBaseToggle::SetMoveDone(void (T::*pfn)()) -{ - m_pfnCallWhenMoveDone = static_cast(pfn); -} - -inline void CBaseToggle::SetMoveDone(std::nullptr_t) -{ - m_pfnCallWhenMoveDone = nullptr; -} - +#include "world.h" #include "basemonster.h" #include "player.h" +#define SF_BUTTON_DONTMOVE BIT(0) +#define SF_BUTTON_TOGGLE BIT(5) // button stays pushed until reactivated +#define SF_BUTTON_SPARK_IF_OFF BIT(6) // button sparks in OFF state +#define SF_BUTTON_TOUCH_ONLY BIT(8) // button only fires as a result of USE key. + // Generic Button -class CBaseButton: public CBaseToggle -{ - DECLARE_CLASS_TYPES(CBaseButton, CBaseToggle); +class CBaseButton: public CBaseToggle { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -388,16 +319,16 @@ class CBaseButton: public CBaseToggle virtual BOOL TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) = 0; virtual int Save(CSave &save) = 0; virtual int Restore(CRestore &restore) = 0; - virtual int ObjectCaps() = 0; // Buttons that don't take damage can be IMPULSE used + virtual int ObjectCaps() = 0; // Buttons that don't take damage can be IMPULSE used public: - BOOL m_fStayPushed; // button stays pushed in until touched again? - BOOL m_fRotating; // a rotating button? default is a sliding button. + BOOL m_fStayPushed; // button stays pushed in until touched again? + BOOL m_fRotating; // a rotating button? default is a sliding button. string_t m_strChangeTarget; // if this field is not null, this is an index into the engine string array. - // when this button is touched, it's target entity's TARGET field will be set - // to the button's ChangeTarget. This allows you to make a func_train switch paths, etc. + // when this button is touched, it's target entity's TARGET field will be set + // to the button's ChangeTarget. This allows you to make a func_train switch paths, etc. - locksound_t m_ls; // door lock sounds + locksound_t m_ls; // door lock sounds byte m_bLockedSound; // ordinals from entity selection byte m_bLockedSentence; @@ -407,13 +338,10 @@ class CBaseButton: public CBaseToggle }; // MultiSouce +#define MAX_MS_TARGETS 32 // maximum number of targets a single multisource entity may be assigned. +#define SF_MULTI_INIT BIT(0) -#define MAX_MULTI_TARGETS 16 // maximum number of targets a single multi_manager entity may be assigned. -#define MS_MAX_TARGETS 32 - -class CMultiSource: public CPointEntity -{ - DECLARE_CLASS_TYPES(CMultiSource, CPointEntity); +class CMultiSource: public CPointEntity { public: virtual void Spawn() = 0; virtual void Restart() = 0; @@ -424,32 +352,94 @@ class CMultiSource: public CPointEntity virtual BOOL IsTriggered(CBaseEntity *pActivator) = 0; virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; public: - EHANDLE m_rgEntities[MS_MAX_TARGETS]; - int m_rgTriggered[MS_MAX_TARGETS]; + EHANDLE m_rgEntities[MAX_MS_TARGETS]; + int m_rgTriggered[MAX_MS_TARGETS]; int m_iTotal; string_t m_globalstate; }; -#define SF_WORLD_DARK 0x0001 // Fade from black at startup -#define SF_WORLD_TITLE 0x0002 // Display game title at startup -#define SF_WORLD_FORCETEAM 0x0004 // Force teams +#define SF_WORLD_DARK BIT(0) // Fade from black at startup +#define SF_WORLD_TITLE BIT(1) // Display game title at startup +#define SF_WORLD_FORCETEAM BIT(2) // Force teams // This spawns first when each level begins. -class CWorld: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CWorld, CBaseEntity); +class CWorld: public CBaseEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; }; +// Converts a entvars_t * to a class pointer +// It will allocate the class and entity if necessary +template +T *GetClassPtr(T *a) +{ + entvars_t *pev = (entvars_t *)a; + + // allocate entity if necessary + if (pev == nullptr) + pev = VARS(CREATE_ENTITY()); + + // get the private data + a = (T *)GET_PRIVATE(ENT(pev)); + + if (a == nullptr) + { + // allocate private data + a = new(pev) T; + a->pev = pev; + } + + return a; +} + // Inlines +inline edict_t *CBaseEntity::edict() +{ + return ENT(pev); +} + +inline EOFFSET CBaseEntity::eoffset() +{ + return OFFSET(pev); +} + +inline int CBaseEntity::entindex() +{ + return ENTINDEX(edict()); +} + +inline int CBaseEntity::IsDormant() +{ + return (pev->flags & FL_DORMANT) == FL_DORMANT; +} + +inline bool CBaseEntity::Intersects(CBaseEntity *pOther) +{ + return Intersects(pOther->pev->absmin, pOther->pev->absmax); +} + +inline bool CBaseEntity::Intersects(const Vector &mins, const Vector &maxs) +{ + if (mins.x > pev->absmax.x + || mins.y > pev->absmax.y + || mins.z > pev->absmax.z + || maxs.x < pev->absmin.x + || maxs.y < pev->absmin.y + || maxs.z < pev->absmin.z) + { + return false; + } + + return true; +} + inline edict_t *EHANDLE::Get() { if (!m_pent || m_pent->serialnumber != m_serialnumber) - return NULL; + return nullptr; return m_pent; } @@ -465,7 +455,7 @@ inline edict_t *EHANDLE::Set(edict_t *pent) inline EHANDLE::operator int() { - return Get() != NULL; + return Get() != nullptr; } inline EHANDLE::operator CBaseEntity *() @@ -480,7 +470,7 @@ inline EHANDLE::operator CBasePlayer *() inline CBaseEntity *EHANDLE::operator=(CBaseEntity *pEntity) { - if (pEntity != NULL) + if (pEntity) { m_pent = ENT(pEntity->pev); if (m_pent) @@ -488,7 +478,7 @@ inline CBaseEntity *EHANDLE::operator=(CBaseEntity *pEntity) } else { - m_pent = NULL; + m_pent = nullptr; m_serialnumber = 0; } diff --git a/AccuracyFix/include/cssdk/dlls/cdll_dll.h b/AccuracyFix/include/cssdk/dlls/cdll_dll.h index 1589a00..5bc2a9d 100644 --- a/AccuracyFix/include/cssdk/dlls/cdll_dll.h +++ b/AccuracyFix/include/cssdk/dlls/cdll_dll.h @@ -60,20 +60,15 @@ const int DEFAULT_FOV = 90; // the default field of view #define ITEM_STATUS_NIGHTVISION BIT(0) #define ITEM_STATUS_DEFUSER BIT(1) -#define SCORE_STATUS_NONE 0 -#define SCORE_STATUS_DEAD BIT(0) -#define SCORE_STATUS_BOMB BIT(1) -#define SCORE_STATUS_VIP BIT(2) -#define SCORE_STATUS_DEFKIT BIT(3) +#define SCORE_STATUS_DEAD BIT(0) +#define SCORE_STATUS_BOMB BIT(1) +#define SCORE_STATUS_VIP BIT(2) // player data iuser3 #define PLAYER_CAN_SHOOT BIT(0) #define PLAYER_FREEZE_TIME_OVER BIT(1) #define PLAYER_IN_BOMB_ZONE BIT(2) #define PLAYER_HOLDING_SHIELD BIT(3) -#define PLAYER_PREVENT_DUCK BIT(4) -#define PLAYER_PREVENT_CLIMB BIT(5) // The player can't climb ladder -#define PLAYER_PREVENT_JUMP BIT(6) #define MENU_KEY_1 BIT(0) #define MENU_KEY_2 BIT(1) @@ -86,6 +81,11 @@ const int DEFAULT_FOV = 90; // the default field of view #define MENU_KEY_9 BIT(8) #define MENU_KEY_0 BIT(9) +#define HUD_PRINTNOTIFY 1 +#define HUD_PRINTCONSOLE 2 +#define HUD_PRINTTALK 3 +#define HUD_PRINTCENTER 4 + #define WEAPON_SUIT 31 #define WEAPON_ALLWEAPONS (~(1<skin = ENTINDEX(pEntity); pev->body = attachment; @@ -114,9 +81,18 @@ class CSprite: public CPointEntity float m_maxFrame; }; -class CBeam: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CBeam, CBaseEntity); +#define SF_BEAM_STARTON BIT(0) +#define SF_BEAM_TOGGLE BIT(1) +#define SF_BEAM_RANDOM BIT(2) +#define SF_BEAM_RING BIT(3) +#define SF_BEAM_SPARKSTART BIT(4) +#define SF_BEAM_SPARKEND BIT(5) +#define SF_BEAM_DECALS BIT(6) +#define SF_BEAM_SHADEIN BIT(7) +#define SF_BEAM_SHADEOUT BIT(8) +#define SF_BEAM_TEMPORARY BIT(15) + +class CBeam: public CBaseEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -168,9 +144,7 @@ class CBeam: public CBaseEntity } }; -class CLaser: public CBeam -{ - DECLARE_CLASS_TYPES(CLaser, CBeam); +class CLaser: public CBeam { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -184,9 +158,9 @@ class CLaser: public CBeam Vector m_firePosition; }; -class CBubbling: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CBubbling, CBaseEntity); +#define SF_BUBBLES_STARTOFF BIT(0) + +class CBubbling: public CBaseEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -202,9 +176,7 @@ class CBubbling: public CBaseEntity int m_state; }; -class CLightning: public CBeam -{ - DECLARE_CLASS_TYPES(CLightning, CBeam); +class CLightning: public CBeam { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -236,9 +208,7 @@ class CLightning: public CBeam float m_radius; }; -class CGlow: public CPointEntity -{ - DECLARE_CLASS_TYPES(CGlow, CPointEntity); +class CGlow: public CPointEntity { public: virtual void Spawn() = 0; virtual int Save(CSave &save) = 0; @@ -249,9 +219,7 @@ class CGlow: public CPointEntity float m_maxFrame; }; -class CBombGlow: public CSprite -{ - DECLARE_CLASS_TYPES(CBombGlow, CSprite); +class CBombGlow: public CSprite { public: virtual void Spawn() = 0; virtual void Think() = 0; @@ -261,9 +229,9 @@ class CBombGlow: public CSprite bool m_bSetModel; }; -class CGibShooter: public CBaseDelay -{ - DECLARE_CLASS_TYPES(CGibShooter, CBaseDelay); +#define SF_GIBSHOOTER_REPEATABLE BIT(0) // Allows a gibshooter to be refired + +class CGibShooter: public CBaseDelay { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -283,20 +251,16 @@ class CGibShooter: public CBaseDelay float m_flGibLife; }; -class CEnvShooter: public CGibShooter -{ - DECLARE_CLASS_TYPES(CEnvShooter, CGibShooter); +class CEnvShooter: public CGibShooter { public: virtual void Precache() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; virtual CGib *CreateGib() = 0; }; -#define MAX_BEAM 24 +const int MAX_BEAM = 24; -class CTestEffect: public CBaseDelay -{ - DECLARE_CLASS_TYPES(CTestEffect, CBaseDelay); +class CTestEffect: public CBaseDelay { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -311,9 +275,12 @@ class CTestEffect: public CBaseDelay float m_flStartTime; }; -class CBlood: public CPointEntity -{ - DECLARE_CLASS_TYPES(CBlood, CPointEntity); +#define SF_BLOOD_RANDOM BIT(0) +#define SF_BLOOD_STREAM BIT(1) +#define SF_BLOOD_PLAYER BIT(2) +#define SF_BLOOD_DECAL BIT(3) + +class CBlood: public CPointEntity { public: virtual void Spawn() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; @@ -327,9 +294,11 @@ class CBlood: public CPointEntity void SetBloodAmount(float amount) { pev->dmg = amount; } }; -class CShake: public CPointEntity -{ - DECLARE_CLASS_TYPES(CShake, CPointEntity); +#define SF_SHAKE_EVERYONE BIT(0) // Don't check radius +#define SF_SHAKE_DISRUPT BIT(1) // Disrupt controls +#define SF_SHAKE_INAIR BIT(2) // Shake players in air + +class CShake: public CPointEntity { public: virtual void Spawn() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; @@ -346,9 +315,11 @@ class CShake: public CPointEntity void SetRadius(float radius) { pev->dmg = radius; } }; -class CFade: public CPointEntity -{ - DECLARE_CLASS_TYPES(CFade, CPointEntity); +#define SF_FADE_IN BIT(0) // Fade in, not out +#define SF_FADE_MODULATE BIT(1) // Modulate, don't blend +#define SF_FADE_ONLYONE BIT(2) + +class CFade: public CPointEntity { public: virtual void Spawn() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; @@ -361,9 +332,10 @@ class CFade: public CPointEntity void SetHoldTime(float hold) { pev->dmg_save = hold; } }; -class CMessage: public CPointEntity -{ - DECLARE_CLASS_TYPES(CMessage, CPointEntity); +#define SF_MESSAGE_ONCE BIT(0) // Fade in, not out +#define SF_MESSAGE_ALL BIT(1) // Send to all clients + +class CMessage: public CPointEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -371,9 +343,9 @@ class CMessage: public CPointEntity virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class CEnvFunnel: public CBaseDelay -{ - DECLARE_CLASS_TYPES(CEnvFunnel, CBaseDelay); +#define SF_FUNNEL_REVERSE BIT(0) // Funnel effect repels particles instead of attracting them + +class CEnvFunnel: public CBaseDelay { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -382,18 +354,14 @@ class CEnvFunnel: public CBaseDelay int m_iSprite; }; -class CEnvBeverage: public CBaseDelay -{ - DECLARE_CLASS_TYPES(CEnvBeverage, CBaseDelay); +class CEnvBeverage: public CBaseDelay { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class CItemSoda: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CItemSoda, CBaseEntity); +class CItemSoda: public CBaseEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -432,7 +400,7 @@ inline const Vector &CBeam::GetEndPos() } edict_t *pent = INDEXENT(GetEndEntity()); - if (pent != NULL) + if (pent) { return pent->v.origin; } diff --git a/AccuracyFix/include/cssdk/dlls/ehandle.h b/AccuracyFix/include/cssdk/dlls/ehandle.h new file mode 100644 index 0000000..4664472 --- /dev/null +++ b/AccuracyFix/include/cssdk/dlls/ehandle.h @@ -0,0 +1,204 @@ +/* +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by the +* Free Software Foundation; either version 2 of the License, or (at +* your option) any later version. +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +* +* In addition, as a special exception, the author gives permission to +* link the code of this program with the Half-Life Game Engine ("HL +* Engine") and Modified Game Libraries ("MODs") developed by Valve, +* L.L.C ("Valve"). You must obey the GNU General Public License in all +* respects for all of the code used other than the HL Engine and MODs +* from Valve. If you modify this file, you may extend this exception +* to your version of the file, but you are not obligated to do so. If +* you do not wish to do so, delete this exception statement from your +* version. +* +*/ + +#pragma once + +// Safe way to point to CBaseEntities who may die between frames. +template +class EntityHandle +{ +public: + EntityHandle() : m_edict(nullptr), m_serialnumber(0) {} + EntityHandle(const EntityHandle &other); + + // Cast to base class + // NOTE: this is a unsafe method + template + I *Get() const + { + return (I *)((T *)(this)); + } + + edict_t *Get() const; + edict_t *Set(edict_t *pEdict); + + bool IsValid() const; + int GetSerialNumber() const; + + bool operator==(T *pEntity) const; + operator int() const; + operator T *() const; + + T *operator=(T *pEntity); + T *operator->(); + + // Copy the ehandle. + EntityHandle& operator=(const EntityHandle &other); + +private: + edict_t *m_edict; + int m_serialnumber; +}; + +// Short alias +using EHandle = EntityHandle<>; +using EHANDLE = EHandle; + +// Inlines +template +inline bool FNullEnt(EntityHandle &hent) +{ + return (!hent || FNullEnt(OFFSET(hent.Get()))); +} + +// Copy constructor +template +EntityHandle::EntityHandle(const EntityHandle &other) +{ + m_edict = other.m_edict; + m_serialnumber = other.m_serialnumber; +} + +template +inline edict_t *EntityHandle::Get() const +{ + if (!m_edict || m_edict->serialnumber != m_serialnumber || m_edict->free) + { + return nullptr; + } + + return m_edict; +} + +template +inline edict_t *EntityHandle::Set(edict_t *pEdict) +{ + m_edict = pEdict; + if (pEdict) + { + m_serialnumber = pEdict->serialnumber; + } + + return pEdict; +} + +// Returns whether this handle is valid. +template +inline bool EntityHandle::IsValid() const +{ + edict_t *pEdict = Get(); + if (!pEdict) + { + return false; + } + + CBaseEntity *pEntity = (CBaseEntity *)GET_PRIVATE(pEdict); + if (!pEntity) + { + return false; + } + + return true; +} + +// CBaseEntity serial number. +// Used to determine if the entity is still valid. +template +inline int EntityHandle::GetSerialNumber() const +{ + return m_serialnumber; +} + +template +inline bool EntityHandle::operator==(T *pEntity) const +{ + assert(("EntityHandle::operator==: got a nullptr pointer!", pEntity != nullptr)); + + if (m_serialnumber != pEntity->edict()->serialnumber) + { + return false; + } + + return m_edict == pEntity->edict(); +} + +template +inline EntityHandle::operator int() const +{ + return Get() != nullptr; +} + +// Gets the Entity this handle refers to. +// Returns null if invalid. +template +inline EntityHandle::operator T *() const +{ + return (T *)GET_PRIVATE(Get()); +} + +// Assigns the given entity to this handle. +template +inline T *EntityHandle::operator=(T *pEntity) +{ + if (pEntity) + { + m_edict = ENT(pEntity->pev); + if (m_edict) + { + m_serialnumber = m_edict->serialnumber; + } + } + else + { + m_edict = nullptr; + m_serialnumber = 0; + } + + return pEntity; +} + +template +inline T *EntityHandle::operator->() +{ + edict_t *pEdict = Get(); + assert(("EntityHandle::operator->: pointer is nullptr!", pEdict != nullptr)); + + T *pEntity = (T *)GET_PRIVATE(pEdict); + assert(("EntityHandle::operator->: pvPrivateData is nullptr!", pEntity != nullptr)); + return pEntity; +} + +// Makes this handle refer to the same entity as the given handle. +template +inline EntityHandle& EntityHandle::operator=(const EntityHandle &other) +{ + m_edict = other.m_edict; + m_serialnumber = other.m_serialnumber; + + return (*this); +} diff --git a/AccuracyFix/include/cssdk/dlls/enginecallback.h b/AccuracyFix/include/cssdk/dlls/enginecallback.h index dbe3e71..7224278 100644 --- a/AccuracyFix/include/cssdk/dlls/enginecallback.h +++ b/AccuracyFix/include/cssdk/dlls/enginecallback.h @@ -25,6 +25,7 @@ * version. * */ + #pragma once #include "event_flags.h" @@ -33,146 +34,152 @@ extern enginefuncs_t g_engfuncs; // The actual engine callbacks -#define GETPLAYERUSERID (*g_engfuncs.pfnGetPlayerUserId) -#define PRECACHE_MODEL (*g_engfuncs.pfnPrecacheModel) -#define PRECACHE_SOUND (*g_engfuncs.pfnPrecacheSound) -#define PRECACHE_GENERIC (*g_engfuncs.pfnPrecacheGeneric) -#define SET_MODEL (*g_engfuncs.pfnSetModel) -#define MODEL_INDEX (*g_engfuncs.pfnModelIndex) -#define MODEL_FRAMES (*g_engfuncs.pfnModelFrames) -#define SET_SIZE (*g_engfuncs.pfnSetSize) -#define CHANGE_LEVEL (*g_engfuncs.pfnChangeLevel) -#define GET_SPAWN_PARMS (*g_engfuncs.pfnGetSpawnParms) -#define SAVE_SPAWN_PARMS (*g_engfuncs.pfnSaveSpawnParms) -#define VEC_TO_YAW (*g_engfuncs.pfnVecToYaw) -#define VEC_TO_ANGLES (*g_engfuncs.pfnVecToAngles) -#define MOVE_TO_ORIGIN (*g_engfuncs.pfnMoveToOrigin) -#define oldCHANGE_YAW (*g_engfuncs.pfnChangeYaw) -#define CHANGE_PITCH (*g_engfuncs.pfnChangePitch) -#define MAKE_VECTORS (*g_engfuncs.pfnMakeVectors) -#define CREATE_ENTITY (*g_engfuncs.pfnCreateEntity) -#define REMOVE_ENTITY (*g_engfuncs.pfnRemoveEntity) -#define CREATE_NAMED_ENTITY (*g_engfuncs.pfnCreateNamedEntity) -#define MAKE_STATIC (*g_engfuncs.pfnMakeStatic) -#define ENT_IS_ON_FLOOR (*g_engfuncs.pfnEntIsOnFloor) -#define DROP_TO_FLOOR (*g_engfuncs.pfnDropToFloor) -#define WALK_MOVE (*g_engfuncs.pfnWalkMove) -#define SET_ORIGIN (*g_engfuncs.pfnSetOrigin) -#define EMIT_SOUND_DYN2 (*g_engfuncs.pfnEmitSound) -#define BUILD_SOUND_MSG (*g_engfuncs.pfnBuildSoundMsg) -#define TRACE_LINE (*g_engfuncs.pfnTraceLine) -#define TRACE_TOSS (*g_engfuncs.pfnTraceToss) -#define TRACE_MONSTER_HULL (*g_engfuncs.pfnTraceMonsterHull) -#define TRACE_HULL (*g_engfuncs.pfnTraceHull) -#define TRACE_MODEL (*g_engfuncs.pfnTraceModel) -#define GET_AIM_VECTOR (*g_engfuncs.pfnGetAimVector) -#define SERVER_COMMAND (*g_engfuncs.pfnServerCommand) -#define SERVER_EXECUTE (*g_engfuncs.pfnServerExecute) -#define CLIENT_COMMAND (*g_engfuncs.pfnClientCommand) -#define PARTICLE_EFFECT (*g_engfuncs.pfnParticleEffect) -#define LIGHT_STYLE (*g_engfuncs.pfnLightStyle) -#define DECAL_INDEX (*g_engfuncs.pfnDecalIndex) -#define POINT_CONTENTS (*g_engfuncs.pfnPointContents) -#define CRC32_INIT (*g_engfuncs.pfnCRC32_Init) -#define CRC32_PROCESS_BUFFER (*g_engfuncs.pfnCRC32_ProcessBuffer) -#define CRC32_PROCESS_BYTE (*g_engfuncs.pfnCRC32_ProcessByte) -#define CRC32_FINAL (*g_engfuncs.pfnCRC32_Final) -#define RANDOM_LONG (*g_engfuncs.pfnRandomLong) -#define RANDOM_FLOAT (*g_engfuncs.pfnRandomFloat) -#define ADD_SERVER_COMMAND (*g_engfuncs.pfnAddServerCommand) -#define SET_CLIENT_LISTENING (*g_engfuncs.pfnVoice_SetClientListening) -#define GETPLAYERAUTHID (*g_engfuncs.pfnGetPlayerAuthId) -#define GET_FILE_SIZE (*g_engfuncs.pfnGetFileSize) -#define GET_APPROX_WAVE_PLAY_LEN (*g_engfuncs.pfnGetApproxWavePlayLen) -#define IS_CAREER_MATCH (*g_engfuncs.pfnIsCareerMatch) -#define GET_LOCALIZED_STRING_LENGTH (*g_engfuncs.pfnGetLocalizedStringLength) +#define GETPLAYERUSERID (*g_engfuncs.pfnGetPlayerUserId) +#define PRECACHE_MODEL (*g_engfuncs.pfnPrecacheModel) +#define PRECACHE_SOUND (*g_engfuncs.pfnPrecacheSound) +#define PRECACHE_GENERIC (*g_engfuncs.pfnPrecacheGeneric) +#define SET_MODEL (*g_engfuncs.pfnSetModel) +#define MODEL_INDEX (*g_engfuncs.pfnModelIndex) +#define MODEL_FRAMES (*g_engfuncs.pfnModelFrames) +#define SET_SIZE (*g_engfuncs.pfnSetSize) +#define CHANGE_LEVEL (*g_engfuncs.pfnChangeLevel) +#define GET_SPAWN_PARMS (*g_engfuncs.pfnGetSpawnParms) +#define SAVE_SPAWN_PARMS (*g_engfuncs.pfnSaveSpawnParms) +#define VEC_TO_YAW (*g_engfuncs.pfnVecToYaw) +#define VEC_TO_ANGLES (*g_engfuncs.pfnVecToAngles) +#define MOVE_TO_ORIGIN (*g_engfuncs.pfnMoveToOrigin) +#define oldCHANGE_YAW (*g_engfuncs.pfnChangeYaw) +#define CHANGE_PITCH (*g_engfuncs.pfnChangePitch) +#define MAKE_VECTORS (*g_engfuncs.pfnMakeVectors) +#define CREATE_ENTITY (*g_engfuncs.pfnCreateEntity) +#define REMOVE_ENTITY (*g_engfuncs.pfnRemoveEntity) +#define CREATE_NAMED_ENTITY (*g_engfuncs.pfnCreateNamedEntity) +#define MAKE_STATIC (*g_engfuncs.pfnMakeStatic) +#define ENT_IS_ON_FLOOR (*g_engfuncs.pfnEntIsOnFloor) +#define DROP_TO_FLOOR (*g_engfuncs.pfnDropToFloor) +#define WALK_MOVE (*g_engfuncs.pfnWalkMove) +#define SET_ORIGIN (*g_engfuncs.pfnSetOrigin) +#define EMIT_SOUND_DYN2 (*g_engfuncs.pfnEmitSound) +#define BUILD_SOUND_MSG (*g_engfuncs.pfnBuildSoundMsg) +#define TRACE_LINE (*g_engfuncs.pfnTraceLine) +#define TRACE_TOSS (*g_engfuncs.pfnTraceToss) +#define TRACE_MONSTER_HULL (*g_engfuncs.pfnTraceMonsterHull) +#define TRACE_HULL (*g_engfuncs.pfnTraceHull) +#define TRACE_MODEL (*g_engfuncs.pfnTraceModel) +#define GET_AIM_VECTOR (*g_engfuncs.pfnGetAimVector) +#define SERVER_COMMAND (*g_engfuncs.pfnServerCommand) +#define SERVER_EXECUTE (*g_engfuncs.pfnServerExecute) +#define CLIENT_COMMAND (*g_engfuncs.pfnClientCommand) +#define PARTICLE_EFFECT (*g_engfuncs.pfnParticleEffect) +#define LIGHT_STYLE (*g_engfuncs.pfnLightStyle) +#define DECAL_INDEX (*g_engfuncs.pfnDecalIndex) +#define POINT_CONTENTS (*g_engfuncs.pfnPointContents) +#define CRC32_INIT (*g_engfuncs.pfnCRC32_Init) +#define CRC32_PROCESS_BUFFER (*g_engfuncs.pfnCRC32_ProcessBuffer) +#define CRC32_PROCESS_BYTE (*g_engfuncs.pfnCRC32_ProcessByte) +#define CRC32_FINAL (*g_engfuncs.pfnCRC32_Final) +#define RANDOM_LONG (*g_engfuncs.pfnRandomLong) +#define RANDOM_FLOAT (*g_engfuncs.pfnRandomFloat) +#define ADD_SERVER_COMMAND (*g_engfuncs.pfnAddServerCommand) +#define SET_CLIENT_LISTENING (*g_engfuncs.pfnVoice_SetClientListening) +#define GETPLAYERAUTHID (*g_engfuncs.pfnGetPlayerAuthId) +#define GET_FILE_SIZE (*g_engfuncs.pfnGetFileSize) +#define GET_APPROX_WAVE_PLAY_LEN (*g_engfuncs.pfnGetApproxWavePlayLen) +#define IS_CAREER_MATCH (*g_engfuncs.pfnIsCareerMatch) +#define GET_LOCALIZED_STRING_LENGTH (*g_engfuncs.pfnGetLocalizedStringLength) #define REGISTER_TUTOR_MESSAGE_SHOWN (*g_engfuncs.pfnRegisterTutorMessageShown) #define GET_TIMES_TUTOR_MESSAGE_SHOWN (*g_engfuncs.pfnGetTimesTutorMessageShown) -#define ENG_CHECK_PARM (*g_engfuncs.pfnEngCheckParm) +#define ENG_CHECK_PARM (*g_engfuncs.pfnEngCheckParm) -inline void MESSAGE_BEGIN(int msg_dest, int msg_type, const float *pOrigin = NULL, edict_t *ed = NULL) { (*g_engfuncs.pfnMessageBegin)(msg_dest, msg_type, pOrigin, ed); } +inline void MESSAGE_BEGIN(int msg_dest, int msg_type, const float *pOrigin = nullptr, edict_t *ed = nullptr) +{ + (*g_engfuncs.pfnMessageBegin)(msg_dest, msg_type, pOrigin, ed); +} inline void *GET_PRIVATE(edict_t *pent) { if (pent) + { return pent->pvPrivateData; - return NULL; + } + + return nullptr; } -#define MESSAGE_END (*g_engfuncs.pfnMessageEnd) -#define WRITE_BYTE (*g_engfuncs.pfnWriteByte) -#define WRITE_CHAR (*g_engfuncs.pfnWriteChar) -#define WRITE_SHORT (*g_engfuncs.pfnWriteShort) -#define WRITE_LONG (*g_engfuncs.pfnWriteLong) -#define WRITE_ANGLE (*g_engfuncs.pfnWriteAngle) -#define WRITE_COORD (*g_engfuncs.pfnWriteCoord) -#define WRITE_STRING (*g_engfuncs.pfnWriteString) -#define WRITE_ENTITY (*g_engfuncs.pfnWriteEntity) -#define CVAR_REGISTER (*g_engfuncs.pfnCVarRegister) -#define CVAR_GET_FLOAT (*g_engfuncs.pfnCVarGetFloat) -#define CVAR_GET_STRING (*g_engfuncs.pfnCVarGetString) -#define CVAR_SET_FLOAT (*g_engfuncs.pfnCVarSetFloat) -#define CVAR_SET_STRING (*g_engfuncs.pfnCVarSetString) -#define CVAR_GET_POINTER (*g_engfuncs.pfnCVarGetPointer) -#define ALERT (*g_engfuncs.pfnAlertMessage) -#define ENGINE_FPRINTF (*g_engfuncs.pfnEngineFprintf) -#define ALLOC_PRIVATE (*g_engfuncs.pfnPvAllocEntPrivateData) -#define FREE_PRIVATE (*g_engfuncs.pfnFreeEntPrivateData) -//#define STRING (*g_engfuncs.pfnSzFromIndex) -#define ALLOC_STRING (*g_engfuncs.pfnAllocString) +#define MESSAGE_END (*g_engfuncs.pfnMessageEnd) +#define WRITE_BYTE (*g_engfuncs.pfnWriteByte) +#define WRITE_CHAR (*g_engfuncs.pfnWriteChar) +#define WRITE_SHORT (*g_engfuncs.pfnWriteShort) +#define WRITE_LONG (*g_engfuncs.pfnWriteLong) +#define WRITE_ANGLE (*g_engfuncs.pfnWriteAngle) +#define WRITE_COORD (*g_engfuncs.pfnWriteCoord) +#define WRITE_STRING (*g_engfuncs.pfnWriteString) +#define WRITE_ENTITY (*g_engfuncs.pfnWriteEntity) +#define CVAR_REGISTER (*g_engfuncs.pfnCVarRegister) +#define CVAR_GET_FLOAT (*g_engfuncs.pfnCVarGetFloat) +#define CVAR_GET_STRING (*g_engfuncs.pfnCVarGetString) +#define CVAR_SET_FLOAT (*g_engfuncs.pfnCVarSetFloat) +#define CVAR_SET_STRING (*g_engfuncs.pfnCVarSetString) +#define CVAR_GET_POINTER (*g_engfuncs.pfnCVarGetPointer) +#define ALERT (*g_engfuncs.pfnAlertMessage) +#define ENGINE_FPRINTF (*g_engfuncs.pfnEngineFprintf) +#define ALLOC_PRIVATE (*g_engfuncs.pfnPvAllocEntPrivateData) +#define FREE_PRIVATE (*g_engfuncs.pfnFreeEntPrivateData) +//#define STRING (*g_engfuncs.pfnSzFromIndex) +#define ALLOC_STRING (*g_engfuncs.pfnAllocString) #define FIND_ENTITY_BY_STRING (*g_engfuncs.pfnFindEntityByString) -#define GETENTITYILLUM (*g_engfuncs.pfnGetEntityIllum) +#define GETENTITYILLUM (*g_engfuncs.pfnGetEntityIllum) #define FIND_ENTITY_IN_SPHERE (*g_engfuncs.pfnFindEntityInSphere) -#define FIND_CLIENT_IN_PVS (*g_engfuncs.pfnFindClientInPVS) -#define FIND_ENTITY_IN_PVS (*g_engfuncs.pfnEntitiesInPVS) -#define EMIT_AMBIENT_SOUND (*g_engfuncs.pfnEmitAmbientSound) -#define GET_MODEL_PTR (*g_engfuncs.pfnGetModelPtr) -#define REG_USER_MSG (*g_engfuncs.pfnRegUserMsg) -#define GET_BONE_POSITION (*g_engfuncs.pfnGetBonePosition) -#define FUNCTION_FROM_NAME (*g_engfuncs.pfnFunctionFromName) -#define NAME_FOR_FUNCTION (*g_engfuncs.pfnNameForFunction) -#define TRACE_TEXTURE (*g_engfuncs.pfnTraceTexture) -#define CLIENT_PRINTF (*g_engfuncs.pfnClientPrintf) -#define SERVER_PRINT (*g_engfuncs.pfnServerPrint) -#define CMD_ARGS (*g_engfuncs.pfnCmd_Args) -#define CMD_ARGC (*g_engfuncs.pfnCmd_Argc) -#define CMD_ARGV (*g_engfuncs.pfnCmd_Argv) -#define GET_ATTACHMENT (*g_engfuncs.pfnGetAttachment) -#define SET_VIEW (*g_engfuncs.pfnSetView) -#define SET_CROSSHAIRANGLE (*g_engfuncs.pfnCrosshairAngle) -#define LOAD_FILE_FOR_ME (*g_engfuncs.pfnLoadFileForMe) -#define FREE_FILE (*g_engfuncs.pfnFreeFile) -#define END_SECTION (*g_engfuncs.pfnEndSection) -#define COMPARE_FILE_TIME (*g_engfuncs.pfnCompareFileTime) -#define GET_GAME_DIR (*g_engfuncs.pfnGetGameDir) -#define SET_CLIENT_MAXSPEED (*g_engfuncs.pfnSetClientMaxspeed) -#define CREATE_FAKE_CLIENT (*g_engfuncs.pfnCreateFakeClient) -#define PLAYER_RUN_MOVE (*g_engfuncs.pfnRunPlayerMove) -#define NUMBER_OF_ENTITIES (*g_engfuncs.pfnNumberOfEntities) -#define GET_INFO_BUFFER (*g_engfuncs.pfnGetInfoKeyBuffer) -#define GET_KEY_VALUE (*g_engfuncs.pfnInfoKeyValue) -#define SET_KEY_VALUE (*g_engfuncs.pfnSetKeyValue) +#define FIND_CLIENT_IN_PVS (*g_engfuncs.pfnFindClientInPVS) +#define FIND_ENTITY_IN_PVS (*g_engfuncs.pfnEntitiesInPVS) +#define EMIT_AMBIENT_SOUND (*g_engfuncs.pfnEmitAmbientSound) +#define GET_MODEL_PTR (*g_engfuncs.pfnGetModelPtr) +#define REG_USER_MSG (*g_engfuncs.pfnRegUserMsg) +#define GET_BONE_POSITION (*g_engfuncs.pfnGetBonePosition) +#define FUNCTION_FROM_NAME (*g_engfuncs.pfnFunctionFromName) +#define NAME_FOR_FUNCTION (*g_engfuncs.pfnNameForFunction) +#define TRACE_TEXTURE (*g_engfuncs.pfnTraceTexture) +#define CLIENT_PRINTF (*g_engfuncs.pfnClientPrintf) +#define SERVER_PRINT (*g_engfuncs.pfnServerPrint) +#define CMD_ARGS (*g_engfuncs.pfnCmd_Args) +#define CMD_ARGC (*g_engfuncs.pfnCmd_Argc) +#define CMD_ARGV (*g_engfuncs.pfnCmd_Argv) +#define GET_ATTACHMENT (*g_engfuncs.pfnGetAttachment) +#define SET_VIEW (*g_engfuncs.pfnSetView) +#define SET_CROSSHAIRANGLE (*g_engfuncs.pfnCrosshairAngle) +#define LOAD_FILE_FOR_ME (*g_engfuncs.pfnLoadFileForMe) +#define FREE_FILE (*g_engfuncs.pfnFreeFile) +#define END_SECTION (*g_engfuncs.pfnEndSection) +#define COMPARE_FILE_TIME (*g_engfuncs.pfnCompareFileTime) +#define GET_GAME_DIR (*g_engfuncs.pfnGetGameDir) +#define SET_CLIENT_MAXSPEED (*g_engfuncs.pfnSetClientMaxspeed) +#define CREATE_FAKE_CLIENT (*g_engfuncs.pfnCreateFakeClient) +#define PLAYER_RUN_MOVE (*g_engfuncs.pfnRunPlayerMove) +#define NUMBER_OF_ENTITIES (*g_engfuncs.pfnNumberOfEntities) +#define GET_INFO_BUFFER (*g_engfuncs.pfnGetInfoKeyBuffer) +#define GET_KEY_VALUE (*g_engfuncs.pfnInfoKeyValue) +#define SET_KEY_VALUE (*g_engfuncs.pfnSetKeyValue) #define SET_CLIENT_KEY_VALUE (*g_engfuncs.pfnSetClientKeyValue) -#define IS_MAP_VALID (*g_engfuncs.pfnIsMapValid) -#define STATIC_DECAL (*g_engfuncs.pfnStaticDecal) -#define IS_DEDICATED_SERVER (*g_engfuncs.pfnIsDedicatedServer) -#define PRECACHE_EVENT (*g_engfuncs.pfnPrecacheEvent) -#define PLAYBACK_EVENT_FULL (*g_engfuncs.pfnPlaybackEvent) -#define ENGINE_SET_PVS (*g_engfuncs.pfnSetFatPVS) -#define ENGINE_SET_PAS (*g_engfuncs.pfnSetFatPAS) +#define IS_MAP_VALID (*g_engfuncs.pfnIsMapValid) +#define STATIC_DECAL (*g_engfuncs.pfnStaticDecal) +#define IS_DEDICATED_SERVER (*g_engfuncs.pfnIsDedicatedServer) +#define PRECACHE_EVENT (*g_engfuncs.pfnPrecacheEvent) +#define PLAYBACK_EVENT_FULL (*g_engfuncs.pfnPlaybackEvent) +#define ENGINE_SET_PVS (*g_engfuncs.pfnSetFatPVS) +#define ENGINE_SET_PAS (*g_engfuncs.pfnSetFatPAS) #define ENGINE_CHECK_VISIBILITY (*g_engfuncs.pfnCheckVisibility) -#define DELTA_SET (*g_engfuncs.pfnDeltaSetField) -#define DELTA_UNSET (*g_engfuncs.pfnDeltaUnsetField) -#define DELTA_ADDENCODER (*g_engfuncs.pfnDeltaAddEncoder) +#define DELTA_SET (*g_engfuncs.pfnDeltaSetField) +#define DELTA_UNSET (*g_engfuncs.pfnDeltaUnsetField) +#define DELTA_ADDENCODER (*g_engfuncs.pfnDeltaAddEncoder) #define ENGINE_CURRENT_PLAYER (*g_engfuncs.pfnGetCurrentPlayer) -#define ENGINE_CANSKIP (*g_engfuncs.pfnCanSkipPlayer) -#define DELTA_FINDFIELD (*g_engfuncs.pfnDeltaFindField) -#define DELTA_SETBYINDEX (*g_engfuncs.pfnDeltaSetFieldByIndex) -#define DELTA_UNSETBYINDEX (*g_engfuncs.pfnDeltaUnsetFieldByIndex) -#define REMOVE_KEY_VALUE (*g_engfuncs.pfnInfo_RemoveKey) +#define ENGINE_CANSKIP (*g_engfuncs.pfnCanSkipPlayer) +#define DELTA_FINDFIELD (*g_engfuncs.pfnDeltaFindField) +#define DELTA_SETBYINDEX (*g_engfuncs.pfnDeltaSetFieldByIndex) +#define DELTA_UNSETBYINDEX (*g_engfuncs.pfnDeltaUnsetFieldByIndex) +#define REMOVE_KEY_VALUE (*g_engfuncs.pfnInfo_RemoveKey) #define SET_PHYSICS_KEY_VALUE (*g_engfuncs.pfnSetPhysicsKeyValue) -#define ENGINE_GETPHYSINFO (*g_engfuncs.pfnGetPhysicsInfoString) -#define ENGINE_SETGROUPMASK (*g_engfuncs.pfnSetGroupMask) +#define ENGINE_GETPHYSINFO (*g_engfuncs.pfnGetPhysicsInfoString) +#define ENGINE_SETGROUPMASK (*g_engfuncs.pfnSetGroupMask) #define ENGINE_INSTANCE_BASELINE (*g_engfuncs.pfnCreateInstancedBaseline) #define ENGINE_FORCE_UNMODIFIED (*g_engfuncs.pfnForceUnmodified) -#define PLAYER_CNX_STATS (*g_engfuncs.pfnGetPlayerStats) +#define PLAYER_CNX_STATS (*g_engfuncs.pfnGetPlayerStats) diff --git a/AccuracyFix/include/cssdk/dlls/explode.h b/AccuracyFix/include/cssdk/dlls/explode.h index 4906ace..67a73f7 100644 --- a/AccuracyFix/include/cssdk/dlls/explode.h +++ b/AccuracyFix/include/cssdk/dlls/explode.h @@ -25,18 +25,10 @@ * version. * */ -#pragma once -#define SF_ENVEXPLOSION_NODAMAGE (1<<0) // when set, ENV_EXPLOSION will not actually inflict damage -#define SF_ENVEXPLOSION_REPEATABLE (1<<1) // can this entity be refired? -#define SF_ENVEXPLOSION_NOFIREBALL (1<<2) // don't draw the fireball -#define SF_ENVEXPLOSION_NOSMOKE (1<<3) // don't draw the smoke -#define SF_ENVEXPLOSION_NODECAL (1<<4) // don't make a scorch mark -#define SF_ENVEXPLOSION_NOSPARKS (1<<5) // don't make a scorch mark +#pragma once -class CShower: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CShower, CBaseEntity); +class CShower: public CBaseEntity { public: virtual void Spawn() = 0; virtual int ObjectCaps() = 0; @@ -44,9 +36,14 @@ class CShower: public CBaseEntity virtual void Touch(CBaseEntity *pOther) = 0; }; -class CEnvExplosion: public CBaseMonster -{ - DECLARE_CLASS_TYPES(CEnvExplosion, CBaseMonster); +#define SF_ENVEXPLOSION_NODAMAGE BIT(0) // when set, ENV_EXPLOSION will not actually inflict damage +#define SF_ENVEXPLOSION_REPEATABLE BIT(1) // can this entity be refired? +#define SF_ENVEXPLOSION_NOFIREBALL BIT(2) // don't draw the fireball +#define SF_ENVEXPLOSION_NOSMOKE BIT(3) // don't draw the smoke +#define SF_ENVEXPLOSION_NODECAL BIT(4) // don't make a scorch mark +#define SF_ENVEXPLOSION_NOSPARKS BIT(5) // don't make a scorch mark + +class CEnvExplosion: public CBaseMonster { public: virtual void Spawn() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; diff --git a/AccuracyFix/include/cssdk/dlls/extdef.h b/AccuracyFix/include/cssdk/dlls/extdef.h index 383a668..ed204fe 100644 --- a/AccuracyFix/include/cssdk/dlls/extdef.h +++ b/AccuracyFix/include/cssdk/dlls/extdef.h @@ -25,6 +25,7 @@ * version. * */ + #pragma once #include "regamedll_const.h" @@ -53,6 +54,8 @@ #define unlikely(x) __builtin_expect(!!(x), 0) #endif +const int MAX_MAPNAME_LENGHT = 32; + // Simplified macro for declaring/defining exported DLL functions. They // need to be 'extern "C"' so that the C++ compiler enforces parameter // type-matching, rather than considering routines with mis-matched @@ -107,7 +110,6 @@ typedef struct hudtextparms_s } hudtextparms_t; enum USE_TYPE { USE_OFF, USE_ON, USE_SET, USE_TOGGLE }; -enum TRAIN_CODE { TRAIN_SAFE, TRAIN_BLOCKING, TRAIN_FOLLOWING }; enum IGNORE_MONSTERS { ignore_monsters = 1, dont_ignore_monsters = 0, missile = 2 }; enum IGNORE_GLASS { ignore_glass = 1, dont_ignore_glass = 0 }; enum { point_hull = 0, human_hull = 1, large_hull = 2, head_hull = 3 }; diff --git a/AccuracyFix/include/cssdk/dlls/extdll.h b/AccuracyFix/include/cssdk/dlls/extdll.h index 1db8e3d..4d314ce 100644 --- a/AccuracyFix/include/cssdk/dlls/extdll.h +++ b/AccuracyFix/include/cssdk/dlls/extdll.h @@ -39,7 +39,7 @@ #include "strtools.h" #ifdef _WIN32 - #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers + #define WIN32_LEAN_AND_MEAN #define NOWINRES #define NOSERVICE #define NOMCX @@ -62,24 +62,21 @@ // Header file containing definition of globalvars_t and entvars_t typedef int EOFFSET; // More explicit than "int" typedef unsigned int func_t; +typedef unsigned int string_t; // from engine's pr_comp.h; typedef float vec_t; // needed before including progdefs.h // Vector class #include "vector.h" - +//#include "vector.h" // Defining it as a (bogus) struct helps enforce type-checking #define vec3_t Vector - -// QString class -#include "qstring.h" - // Shared engine/DLL constants + #include "const.h" #include "edict.h" // Shared header describing protocol between engine and DLLs #include "eiface.h" - // Shared header between the client DLL and the game DLLs #include "cdll_dll.h" #include "extdef.h" diff --git a/AccuracyFix/include/cssdk/dlls/func_break.h b/AccuracyFix/include/cssdk/dlls/func_break.h index aeb22ac..c618a31 100644 --- a/AccuracyFix/include/cssdk/dlls/func_break.h +++ b/AccuracyFix/include/cssdk/dlls/func_break.h @@ -25,28 +25,16 @@ * version. * */ -#pragma once - -// this many shards spawned when breakable objects break; -#define NUM_SHARDS 6 - -// func breakable -#define SF_BREAK_TRIGGER_ONLY 1 // may only be broken by trigger -#define SF_BREAK_TOUCH 2 // can be 'crashed through' by running player (plate glass) -#define SF_BREAK_PRESSURE 4 // can be broken by a player standing on it -#define SF_BREAK_CROWBAR 256 // instant break if hit with crowbar -// func_pushable (it's also func_breakable, so don't collide with those flags) -#define SF_PUSH_BREAKABLE 128 +#pragma once -typedef enum +enum Explosions { expRandom = 0, expDirected, +}; -} Explosions; - -typedef enum +enum Materials { matGlass = 0, matWood, @@ -59,12 +47,18 @@ typedef enum matRocks, matNone, matLastMaterial, +}; -} Materials; +// this many shards spawned when breakable objects break +#define NUM_SHARDS 6 // this many shards spawned when breakable objects break -class CBreakable: public CBaseDelay -{ - DECLARE_CLASS_TYPES(CBreakable, CBaseDelay); +// func breakable +#define SF_BREAK_TRIGGER_ONLY BIT(0) // may only be broken by trigger +#define SF_BREAK_TOUCH BIT(1) // can be 'crashed through' by running player (plate glass) +#define SF_BREAK_PRESSURE BIT(2) // can be broken by a player standing on it +#define SF_BREAK_CROWBAR BIT(8) // instant break if hit with crowbar + +class CBreakable: public CBaseDelay { public: // basic functions virtual void Spawn() = 0; @@ -99,9 +93,9 @@ class CBreakable: public CBaseDelay float m_flHealth; }; -class CPushable: public CBreakable -{ - DECLARE_CLASS_TYPES(CPushable, CBreakable); +#define SF_PUSH_BREAKABLE BIT(7) // func_pushable (it's also func_breakable, so don't collide with those flags) + +class CPushable: public CBreakable { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -121,4 +115,4 @@ class CPushable: public CBreakable int m_lastSound; float m_maxSpeed; float m_soundTime; -}; \ No newline at end of file +}; diff --git a/AccuracyFix/include/cssdk/dlls/func_tank.h b/AccuracyFix/include/cssdk/dlls/func_tank.h index 47893c5..63c3ff8 100644 --- a/AccuracyFix/include/cssdk/dlls/func_tank.h +++ b/AccuracyFix/include/cssdk/dlls/func_tank.h @@ -25,27 +25,27 @@ * version. * */ -#pragma once -#define SF_TANK_ACTIVE 0x0001 -#define SF_TANK_PLAYER 0x0002 -#define SF_TANK_HUMANS 0x0004 -#define SF_TANK_ALIENS 0x0008 -#define SF_TANK_LINEOFSIGHT 0x0010 -#define SF_TANK_CANCONTROL 0x0020 -#define SF_TANK_SOUNDON 0x8000 +#pragma once enum TANKBULLET { TANK_BULLET_NONE = 0, // Custom damage - TANK_BULLET_9MM, // env_laser (duration is 0.5 rate of fire) - TANK_BULLET_MP5, // rockets - TANK_BULLET_12MM, // explosion? + TANK_BULLET_9MM, // env_laser (duration is 0.5 rate of fire) + TANK_BULLET_MP5, // rockets + TANK_BULLET_12MM, // explosion? }; -class CFuncTank: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CFuncTank, CBaseEntity); +#define SF_TANK_ACTIVE BIT(0) +#define SF_TANK_PLAYER BIT(1) +#define SF_TANK_HUMANS BIT(2) +#define SF_TANK_ALIENS BIT(3) +#define SF_TANK_LINEOFSIGHT BIT(4) +#define SF_TANK_CANCONTROL BIT(5) + +#define SF_TANK_SOUNDON BIT(15) + +class CFuncTank: public CBaseEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -90,44 +90,40 @@ class CFuncTank: public CBaseEntity float m_yawCenter; // "Center" yaw float m_yawRate; // Max turn rate to track targets float m_yawRange; // Range of turning motion (one-sided: 30 is +/- 30 degress from center) - // Zero is full rotation + // Zero is full rotation - float m_yawTolerance; // Tolerance angle + float m_yawTolerance; // Tolerance angle - float m_pitchCenter; // "Center" pitch + float m_pitchCenter; // "Center" pitch float m_pitchRate; // Max turn rate on pitch float m_pitchRange; // Range of pitch motion as above - float m_pitchTolerance; // Tolerance angle + float m_pitchTolerance; // Tolerance angle float m_fireLast; // Last time I fired float m_fireRate; // How many rounds/second - float m_lastSightTime; // Last time I saw target + float m_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 + float m_spriteScale; // Scale of any sprites we shoot int m_iszSpriteSmoke; int m_iszSpriteFlash; - TANKBULLET m_bulletType; // Bullet type - int m_iBulletDamage; // 0 means use Bullet type's default damage + TANKBULLET m_bulletType;// Bullet type + int m_iBulletDamage; // 0 means use Bullet type's default damage - Vector m_sightOrigin; // Last sight of target + Vector m_sightOrigin; // Last sight of target int m_spread; // firing spread int m_iszMaster; // Master entity (game_team_master or multisource) }; -class CFuncTankGun: public CFuncTank -{ - DECLARE_CLASS_TYPES(CFuncTankGun, CFuncTank); +class CFuncTankGun: public CFuncTank { public: virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker) = 0; }; -class CFuncTankLaser: public CFuncTank -{ - DECLARE_CLASS_TYPES(CFuncTankLaser, CFuncTank); +class CFuncTankLaser: public CFuncTank { public: virtual void KeyValue(KeyValueData *pkvd) = 0; virtual int Save(CSave &save) = 0; @@ -135,30 +131,24 @@ class CFuncTankLaser: public CFuncTank virtual void Activate() = 0; virtual void Think() = 0; virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker) = 0; -private: +public: CLaser *m_pLaser; float m_laserTime; }; -class CFuncTankRocket: public CFuncTank -{ - DECLARE_CLASS_TYPES(CFuncTankRocket, CFuncTank); +class CFuncTankRocket: public CFuncTank { public: virtual void Precache() = 0; virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker) = 0; }; -class CFuncTankMortar: public CFuncTank -{ - DECLARE_CLASS_TYPES(CFuncTankMortar, CFuncTank); +class CFuncTankMortar: public CFuncTank { public: virtual void KeyValue(KeyValueData *pkvd) = 0; virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker) = 0; }; -class CFuncTankControls: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CFuncTankControls, CBaseEntity); +class CFuncTankControls: public CBaseEntity { public: virtual void Spawn() = 0; virtual int Save(CSave &save) = 0; diff --git a/AccuracyFix/include/cssdk/dlls/gamerules.h b/AccuracyFix/include/cssdk/dlls/gamerules.h index d0781be..80e0a0d 100644 --- a/AccuracyFix/include/cssdk/dlls/gamerules.h +++ b/AccuracyFix/include/cssdk/dlls/gamerules.h @@ -29,34 +29,33 @@ #include "voice_gamemgr.h" -#define MAX_RULE_BUFFER 1024 -#define MAX_VOTE_MAPS 100 -#define MAX_VIP_QUEUES 5 +const int MAX_RULE_BUFFER = 1024; +const int MAX_VOTE_MAPS = 100; +const int MAX_VIP_QUEUES = 5; -#define MAX_BOMB_RADIUS 2048 +const int MAX_MOTD_CHUNK = 60; +const int MAX_MOTD_LENGTH = 1536; // (MAX_MOTD_CHUNK * 4) -#define ITEM_RESPAWN_TIME 30 -#define WEAPON_RESPAWN_TIME 20 -#define AMMO_RESPAWN_TIME 20 +const float ITEM_RESPAWN_TIME = 30; +const float WEAPON_RESPAWN_TIME = 20; +const float AMMO_RESPAWN_TIME = 20; +const float ROUND_RESPAWN_TIME = 20; +const float ROUND_BEGIN_DELAY = 5; // delay before beginning new round // longest the intermission can last, in seconds -#define MAX_INTERMISSION_TIME 120 +const int MAX_INTERMISSION_TIME = 120; -// when we are within this close to running out of entities, items +// when we are within this close to running out of entities, items // marked with the ITEM_FLAG_LIMITINWORLD will delay their respawn -#define ENTITY_INTOLERANCE 100 - -#define MAX_MOTD_CHUNK 60 -#define MAX_MOTD_LENGTH 1536 // (MAX_MOTD_CHUNK * 4) +const int ENTITY_INTOLERANCE = 100; // custom enum -#define WINNER_NONE 0 -#define WINNER_DRAW 1 +#define WINNER_NONE 0 +#define WINNER_DRAW 1 enum { - WINSTATUS_NONE = 0, - WINSTATUS_CTS, + WINSTATUS_CTS = 1, WINSTATUS_TERRORISTS, WINSTATUS_DRAW, }; @@ -116,44 +115,44 @@ enum RewardRules // custom enum enum RewardAccount { - REWARD_TARGET_BOMB = 3500, - REWARD_VIP_ESCAPED = 3500, - REWARD_VIP_ASSASSINATED = 3250, - REWARD_TERRORISTS_ESCAPED = 3150, - REWARD_CTS_PREVENT_ESCAPE = 3500, - REWARD_ESCAPING_TERRORISTS_NEUTRALIZED = 3250, - REWARD_BOMB_DEFUSED = 3250, - REWARD_BOMB_PLANTED = 800, - REWARD_BOMB_EXPLODED = 3250, - REWARD_CTS_WIN = 3000, - REWARD_TERRORISTS_WIN = 3000, - REWARD_ALL_HOSTAGES_RESCUED = 2500, + REWARD_TARGET_BOMB = 3500, + REWARD_VIP_ESCAPED = 3500, + REWARD_VIP_ASSASSINATED = 3250, + REWARD_TERRORISTS_ESCAPED = 3150, + REWARD_CTS_PREVENT_ESCAPE = 3500, + REWARD_ESCAPING_TERRORISTS_NEUTRALIZED = 3250, + REWARD_BOMB_DEFUSED = 3250, + REWARD_BOMB_PLANTED = 800, + REWARD_BOMB_EXPLODED = 3250, + REWARD_CTS_WIN = 3000, + REWARD_TERRORISTS_WIN = 3000, + REWARD_ALL_HOSTAGES_RESCUED = 2500, // the end round was by the expiration time - REWARD_TARGET_BOMB_SAVED = 3250, - REWARD_HOSTAGE_NOT_RESCUED = 3250, - REWARD_VIP_NOT_ESCAPED = 3250, + REWARD_TARGET_BOMB_SAVED = 3250, + REWARD_HOSTAGE_NOT_RESCUED = 3250, + REWARD_VIP_NOT_ESCAPED = 3250, // loser bonus - REWARD_LOSER_BONUS_DEFAULT = 1400, - REWARD_LOSER_BONUS_MIN = 1500, - REWARD_LOSER_BONUS_MAX = 3000, - REWARD_LOSER_BONUS_ADD = 500, - - REWARD_RESCUED_HOSTAGE = 750, - REWARD_KILLED_ENEMY = 300, - REWARD_KILLED_VIP = 2500, - REWARD_VIP_HAVE_SELF_RESCUED = 2500, - - REWARD_TAKEN_HOSTAGE = 1000, - REWARD_TOOK_HOSTAGE_ACC = 100, - REWARD_TOOK_HOSTAGE = 150, + REWARD_LOSER_BONUS_DEFAULT = 1400, + REWARD_LOSER_BONUS_MIN = 1500, + REWARD_LOSER_BONUS_MAX = 3000, + REWARD_LOSER_BONUS_ADD = 500, + + REWARD_RESCUED_HOSTAGE = 750, + REWARD_KILLED_ENEMY = 300, + REWARD_KILLED_VIP = 2500, + REWARD_VIP_HAVE_SELF_RESCUED = 2500, + + REWARD_TAKEN_HOSTAGE = 1000, + REWARD_TOOK_HOSTAGE_ACC = 100, + REWARD_TOOK_HOSTAGE = 150, }; // custom enum enum PaybackForBadThing { - PAYBACK_FOR_KILLED_TEAMMATES = -3300, + PAYBACK_FOR_KILLED_TEAMMATES = -3300, }; // custom enum @@ -191,13 +190,13 @@ enum // custom enum enum { - SCENARIO_BLOCK_TIME_EXPRIRED = (1 << 0), // flag "a" - SCENARIO_BLOCK_NEED_PLAYERS = (1 << 1), // flag "b" - SCENARIO_BLOCK_VIP_ESCAPE = (1 << 2), // flag "c" - SCENARIO_BLOCK_PRISON_ESCAPE = (1 << 3), // flag "d" - SCENARIO_BLOCK_BOMB = (1 << 4), // flag "e" - SCENARIO_BLOCK_TEAM_EXTERMINATION = (1 << 5), // flag "f" - SCENARIO_BLOCK_HOSTAGE_RESCUE = (1 << 6), // flag "g" + SCENARIO_BLOCK_TIME_EXPRIRED = BIT(0), // flag "a" + SCENARIO_BLOCK_NEED_PLAYERS = BIT(1), // flag "b" + SCENARIO_BLOCK_VIP_ESCAPE = BIT(2), // flag "c" + SCENARIO_BLOCK_PRISON_ESCAPE = BIT(3), // flag "d" + SCENARIO_BLOCK_BOMB = BIT(4), // flag "e" + SCENARIO_BLOCK_TEAM_EXTERMINATION = BIT(5), // flag "f" + SCENARIO_BLOCK_HOSTAGE_RESCUE = BIT(6), // flag "g" }; // Player relationship return codes @@ -212,54 +211,52 @@ enum class CItem; -class CGameRules -{ - DECLARE_CLASS_TYPES(CGameRules, CGameRules); +class CGameRules { protected: virtual ~CGameRules() {}; public: - virtual void RefreshSkillData() = 0; // fill skill data struct with proper values - virtual void Think() = 0; // runs every server frame, should handle any timer tasks, periodic events, etc. + virtual void RefreshSkillData() = 0; // fill skill data struct with proper values + virtual void Think() = 0; // runs every server frame, should handle any timer tasks, periodic events, etc. virtual BOOL IsAllowedToSpawn(CBaseEntity *pEntity) = 0; // Can this item spawn (eg monsters don't spawn in deathmatch). - virtual BOOL FAllowFlashlight() = 0; // Are players allowed to switch on their flashlight? - virtual BOOL FShouldSwitchWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon) = 0; // should the player switch to this weapon? - virtual BOOL GetNextBestWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeapon) = 0; // I can't use this weapon anymore, get me the next best one. + virtual BOOL FAllowFlashlight() = 0; // Are players allowed to switch on their flashlight? + virtual BOOL FShouldSwitchWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon) = 0; // should the player switch to this weapon? + virtual BOOL GetNextBestWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pCurrentWeapon) = 0; // I can't use this weapon anymore, get me the next best one. // Functions to verify the single/multiplayer status of a game virtual BOOL IsMultiplayer() = 0; // is this a multiplayer game? (either coop or deathmatch) virtual BOOL IsDeathmatch() = 0; // is this a deathmatch game? virtual BOOL IsTeamplay() = 0; // is this deathmatch game being played with team rules? - virtual BOOL IsCoOp() = 0; // is this a coop game? - virtual const char *GetGameDescription() = 0; // this is the game name that gets seen in the server browser + virtual BOOL IsCoOp() = 0; // is this a coop game? + virtual const char *GetGameDescription() = 0; // this is the game name that gets seen in the server browser // Client connection/disconnection virtual BOOL ClientConnected(edict_t *pEntity, const char *pszName, const char *pszAddress, char *szRejectReason) = 0; // a client just connected to the server (player hasn't spawned yet) virtual void InitHUD(CBasePlayer *pl) = 0; // the client dll is ready for updating - virtual void ClientDisconnected(edict_t *pClient) = 0; // a client just disconnected from the server - virtual void UpdateGameMode(CBasePlayer *pPlayer) = 0; // the client needs to be informed of the current game mode + virtual void ClientDisconnected(edict_t *pClient) = 0; // a client just disconnected from the server + virtual void UpdateGameMode(CBasePlayer *pPlayer) = 0; // the client needs to be informed of the current game mode // Client damage rules virtual float FlPlayerFallDamage(CBasePlayer *pPlayer) = 0; - virtual BOOL FPlayerCanTakeDamage(CBasePlayer *pPlayer, CBaseEntity *pAttacker) = 0; // can this player take damage from this attacker? + virtual BOOL FPlayerCanTakeDamage(CBasePlayer *pPlayer, CBaseEntity *pAttacker) = 0; // can this player take damage from this attacker? virtual BOOL ShouldAutoAim(CBasePlayer *pPlayer, edict_t *target) = 0; // Client spawn/respawn control virtual void PlayerSpawn(CBasePlayer *pPlayer) = 0; // called by CBasePlayer::Spawn just before releasing player into the game virtual void PlayerThink(CBasePlayer *pPlayer) = 0; // called by CBasePlayer::PreThink every frame, before physics are run and after keys are accepted - virtual BOOL FPlayerCanRespawn(CBasePlayer *pPlayer) = 0; // is this player allowed to respawn now? - virtual float FlPlayerSpawnTime(CBasePlayer *pPlayer) = 0; // When in the future will this player be able to spawn? - virtual edict_t *GetPlayerSpawnSpot(CBasePlayer *pPlayer) = 0; // Place this player on their spawnspot and face them the proper direction. + virtual BOOL FPlayerCanRespawn(CBasePlayer *pPlayer) = 0; // is this player allowed to respawn now? + virtual float FlPlayerSpawnTime(CBasePlayer *pPlayer) = 0; // When in the future will this player be able to spawn? + virtual edict_t *GetPlayerSpawnSpot(CBasePlayer *pPlayer) = 0; // Place this player on their spawnspot and face them the proper direction. virtual BOOL AllowAutoTargetCrosshair() = 0; virtual BOOL ClientCommand_DeadOrAlive(CBasePlayer *pPlayer, const char *pcmd) = 0; - virtual BOOL ClientCommand(CBasePlayer *pPlayer, const char *pcmd) = 0; // handles the user commands; returns TRUE if command handled properly + virtual BOOL ClientCommand(CBasePlayer *pPlayer, const char *pcmd) = 0; // handles the user commands; returns TRUE if command handled properly virtual void ClientUserInfoChanged(CBasePlayer *pPlayer, char *infobuffer) = 0; // the player has changed userinfo; can change it now // Client kills/scoring virtual int IPointsForKill(CBasePlayer *pAttacker, CBasePlayer *pKilled) = 0; // how many points do I award whoever kills this player? - virtual void PlayerKilled(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor) = 0; // Called each time a player dies - virtual void DeathNotice(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pevInflictor) = 0; // Call this from within a GameRules class to report an obituary. + virtual void PlayerKilled(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor) = 0; // Called each time a player dies + virtual void DeathNotice(CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pevInflictor) = 0; // Call this from within a GameRules class to report an obituary. // Weapon retrieval virtual BOOL CanHavePlayerItem(CBasePlayer *pPlayer, CBasePlayerItem *pItem) = 0; // The player is touching an CBasePlayerItem, do I give it to him? @@ -276,22 +273,22 @@ class CGameRules virtual void PlayerGotItem(CBasePlayer *pPlayer, CItem *pItem) = 0; // call each time a player picks up an item (battery, healthkit, longjump) // Item spawn/respawn control - virtual int ItemShouldRespawn(CItem *pItem) = 0; // Should this item respawn? - virtual float FlItemRespawnTime(CItem *pItem) = 0; // when may this item respawn? + virtual int ItemShouldRespawn(CItem *pItem) = 0; // Should this item respawn? + virtual float FlItemRespawnTime(CItem *pItem) = 0; // when may this item respawn? virtual Vector VecItemRespawnSpot(CItem *pItem) = 0; // where in the world should this item respawn? // Ammo retrieval - virtual BOOL CanHaveAmmo(CBasePlayer *pPlayer, const char *pszAmmoName, int iMaxCarry) = 0; // can this player take more of this ammo? - virtual void PlayerGotAmmo(CBasePlayer *pPlayer, char *szName, int iCount) = 0; // called each time a player picks up some ammo in the world + virtual BOOL CanHaveAmmo(CBasePlayer *pPlayer, const char *pszAmmoName, int iMaxCarry) = 0; // can this player take more of this ammo? + virtual void PlayerGotAmmo(CBasePlayer *pPlayer, char *szName, int iCount) = 0; // called each time a player picks up some ammo in the world // Ammo spawn/respawn control virtual int AmmoShouldRespawn(CBasePlayerAmmo *pAmmo) = 0; // should this ammo item respawn? - virtual float FlAmmoRespawnTime(CBasePlayerAmmo *pAmmo) = 0; // when should this ammo item respawn? - virtual Vector VecAmmoRespawnSpot(CBasePlayerAmmo *pAmmo) = 0; // where in the world should this ammo item respawn? + virtual float FlAmmoRespawnTime(CBasePlayerAmmo *pAmmo) = 0; // when should this ammo item respawn? + virtual Vector VecAmmoRespawnSpot(CBasePlayerAmmo *pAmmo) = 0; // where in the world should this ammo item respawn? // Healthcharger respawn control - virtual float FlHealthChargerRechargeTime() = 0; // how long until a depleted HealthCharger recharges itself? - virtual float FlHEVChargerRechargeTime() = 0; // how long until a depleted HealthCharger recharges itself? + virtual float FlHealthChargerRechargeTime() = 0; // how long until a depleted HealthCharger recharges itself? + virtual float FlHEVChargerRechargeTime() = 0; // how long until a depleted HealthCharger recharges itself? // What happens to a dead player's weapons virtual int DeadPlayerWeapons(CBasePlayer *pPlayer) = 0; // what do I do with a player's weapons when he's killed? @@ -301,7 +298,7 @@ class CGameRules // Teamplay stuff virtual const char *GetTeamID(CBaseEntity *pEntity) = 0; // what team is this entity on? - virtual int PlayerRelationship(CBasePlayer *pPlayer, CBaseEntity *pTarget) = 0; // What is the player's relationship with this entity? + virtual int PlayerRelationship(CBasePlayer *pPlayer, CBaseEntity *pTarget) = 0; // What is the player's relationship with this entity? virtual int GetTeamIndex(const char *pTeamName) = 0; virtual const char *GetIndexedTeamName(int teamIndex) = 0; virtual BOOL IsValidTeam(const char *pTeamName) = 0; @@ -327,20 +324,16 @@ class CGameRules inline void SetGameOver() { m_bGameOver = true; } public: - BOOL m_bFreezePeriod; // TRUE at beginning of round, set to FALSE when the period expires + BOOL m_bFreezePeriod; // TRUE at beginning of round, set to FALSE when the period expires BOOL m_bBombDropped; // custom char *m_GameDesc; - bool m_bGameOver; // intermission or finale (deprecated name g_fGameOver) + bool m_bGameOver; // intermission or finale (deprecated name g_fGameOver) }; -#define GAMERULES_API_INTERFACE_VERSION "GAMERULES_API_INTERFACE_VERSION001" - // CHalfLifeRules - rules for the single player Half-Life game. -class CHalfLifeRules: public CGameRules -{ - DECLARE_CLASS_TYPES(CHalfLifeRules, CGameRules); +class CHalfLifeRules: public CGameRules { protected: virtual ~CHalfLifeRules() {}; public: @@ -422,9 +415,7 @@ class CHalfLifeRules: public CGameRules }; // CHalfLifeMultiplay - rules for the basic half life multiplayer competition -class CHalfLifeMultiplay: public CGameRules -{ - DECLARE_CLASS_TYPES(CHalfLifeMultiplay, CGameRules); +class CHalfLifeMultiplay: public CGameRules { protected: virtual ~CHalfLifeMultiplay() {}; public: @@ -510,6 +501,7 @@ class CHalfLifeMultiplay: public CGameRules // Teamplay stuff virtual const char *GetTeamID(CBaseEntity *pEntity) = 0; virtual int PlayerRelationship(CBasePlayer *pPlayer, CBaseEntity *pTarget) = 0; + virtual void ChangePlayerTeam(CBasePlayer *pPlayer, const char *pTeamName, BOOL bKill, BOOL bGib) = 0; virtual BOOL PlayTextureSounds() = 0; @@ -531,7 +523,7 @@ class CHalfLifeMultiplay: public CGameRules // check if the scenario has been won/lost virtual void CheckWinConditions() = 0; virtual void RemoveGuns() = 0; - virtual CBasePlayer *GiveC4() = 0; + virtual void GiveC4() = 0; virtual void ChangeLevel() = 0; virtual void GoToIntermission() = 0; @@ -572,18 +564,18 @@ class CHalfLifeMultiplay: public CGameRules float m_flRestartRoundTime; // The global time when the round is supposed to end, if this is not 0 (deprecated name m_fTeamCount) float m_flCheckWinConditions; float m_fRoundStartTime; // Time round has started (deprecated name m_fRoundCount) - int m_iRoundTime; // (From mp_roundtime) - How many seconds long this round is. + int m_iRoundTime; // (From mp_roundtime) - How many seconds long this round is. int m_iRoundTimeSecs; int m_iIntroRoundTime; // (From mp_freezetime) - How many seconds long the intro round (when players are frozen) is. - float m_fRoundStartTimeReal; // The global time when the intro round ends and the real one starts - // wrote the original "m_flRoundTime" comment for this variable). + float m_fRoundStartTimeReal; // The global time when the intro round ends and the real one starts + // wrote the original "m_flRoundTime" comment for this variable). int m_iAccountTerrorist; int m_iAccountCT; int m_iNumTerrorist; // The number of terrorists on the team (this is generated at the end of a round) - int m_iNumCT; // The number of CTs on the team (this is generated at the end of a round) + int m_iNumCT; // The number of CTs on the team (this is generated at the end of a round) int m_iNumSpawnableTerrorist; int m_iNumSpawnableCT; - int m_iSpawnPointCount_Terrorist; // Number of Terrorist spawn points + int m_iSpawnPointCount_Terrorist; // Number of Terrorist spawn points int m_iSpawnPointCount_CT; // Number of CT spawn points int m_iHostagesRescued; int m_iHostagesTouched; @@ -604,22 +596,22 @@ class CHalfLifeMultiplay: public CGameRules BOOL m_bMapHasVIPSafetyZone; // TRUE = has VIP safety zone, FALSE = does not have VIP safetyzone BOOL m_bMapHasCameras; int m_iC4Timer; - int m_iC4Guy; // The current Terrorist who has the C4. - int m_iLoserBonus; // the amount of money the losing team gets. This scales up as they lose more rounds in a row + int m_iC4Guy; // The current Terrorist who has the C4. + int m_iLoserBonus; // the amount of money the losing team gets. This scales up as they lose more rounds in a row int m_iNumConsecutiveCTLoses; // the number of rounds the CTs have lost in a row. - int m_iNumConsecutiveTerroristLoses; // the number of rounds the Terrorists have lost in a row. + int m_iNumConsecutiveTerroristLoses; // the number of rounds the Terrorists have lost in a row. - float m_fMaxIdlePeriod; // For the idle kick functionality. This is tha max amount of time that the player has to be idle before being kicked + float m_fMaxIdlePeriod; // For the idle kick functionality. This is tha max amount of time that the player has to be idle before being kicked int m_iLimitTeams; bool m_bLevelInitialized; bool m_bRoundTerminating; - bool m_bCompleteReset; // Set to TRUE to have the scores reset next time round restarts + bool m_bCompleteReset; // Set to TRUE to have the scores reset next time round restarts float m_flRequiredEscapeRatio; int m_iNumEscapers; int m_iHaveEscaped; bool m_bCTCantBuy; - bool m_bTCantBuy; // Who can and can't buy. + bool m_bTCantBuy; // Who can and can't buy. float m_flBombRadius; int m_iConsecutiveVIP; int m_iTotalGunCount; @@ -657,7 +649,6 @@ class CHalfLifeMultiplay: public CGameRules float m_flEscapeRatio; float m_flTimeLimit; float m_flGameStartTime; - bool m_bTeamBalanced; }; typedef struct mapcycle_item_s @@ -677,14 +668,9 @@ typedef struct mapcycle_s } mapcycle_t; -class CCStrikeGameMgrHelper: public IVoiceGameMgrHelper -{ - DECLARE_CLASS_TYPES(CCStrikeGameMgrHelper, IVoiceGameMgrHelper); +class CCStrikeGameMgrHelper: public IVoiceGameMgrHelper { public: virtual bool CanPlayerHearPlayer(CBasePlayer *pListener, CBasePlayer *pSender) = 0; - virtual void ResetCanHearPlayer(edict_t* pEdict) = 0; - virtual void SetCanHearPlayer(CBasePlayer* pListener, CBasePlayer* pSender, bool bCanHear) = 0; - virtual bool GetCanHearPlayer(CBasePlayer* pListener, CBasePlayer* pSender) = 0; }; extern CGameRules *g_pGameRules; diff --git a/AccuracyFix/include/cssdk/dlls/gib.h b/AccuracyFix/include/cssdk/dlls/gib.h index d76aa58..dc5be9a 100644 --- a/AccuracyFix/include/cssdk/dlls/gib.h +++ b/AccuracyFix/include/cssdk/dlls/gib.h @@ -28,12 +28,9 @@ #pragma once -class CGib: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CGib, CBaseEntity); +class CGib: public CBaseEntity { public: virtual int ObjectCaps() = 0; - public: int m_bloodColor; int m_cBloodDecals; diff --git a/AccuracyFix/include/cssdk/dlls/h_battery.h b/AccuracyFix/include/cssdk/dlls/h_battery.h index 22bf81e..987ffcb 100644 --- a/AccuracyFix/include/cssdk/dlls/h_battery.h +++ b/AccuracyFix/include/cssdk/dlls/h_battery.h @@ -25,11 +25,10 @@ * version. * */ + #pragma once -class CRecharge: public CBaseToggle -{ - DECLARE_CLASS_TYPES(CRecharge, CBaseToggle); +class CRecharge: public CBaseToggle { public: virtual void Spawn() = 0; virtual void Precache() = 0; diff --git a/AccuracyFix/include/cssdk/dlls/h_cycler.h b/AccuracyFix/include/cssdk/dlls/h_cycler.h index ad737d2..dc917f0 100644 --- a/AccuracyFix/include/cssdk/dlls/h_cycler.h +++ b/AccuracyFix/include/cssdk/dlls/h_cycler.h @@ -25,11 +25,10 @@ * version. * */ + #pragma once -class CCycler: public CBaseMonster -{ - DECLARE_CLASS_TYPES(CCycler, CBaseMonster); +class CCycler: public CBaseMonster { public: virtual void Spawn() = 0; virtual int Save(CSave &save) = 0; @@ -45,25 +44,19 @@ class CCycler: public CBaseMonster int m_animate; }; -// we should get rid of all the other cyclers and replace them with this. -class CGenericCycler: public CCycler -{ - DECLARE_CLASS_TYPES(CGenericCycler, CCycler); +// We should get rid of all the other cyclers and replace them with this. +class CGenericCycler: public CCycler { public: virtual void Spawn() = 0; }; // Probe droid imported for tech demo compatibility -class CCyclerProbe: public CCycler -{ - DECLARE_CLASS_TYPES(CCyclerProbe, CCycler); +class CCyclerProbe: public CCycler { public: virtual void Spawn() = 0; }; -class CCyclerSprite: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CCyclerSprite, CBaseEntity); +class CCyclerSprite: public CBaseEntity { public: virtual void Spawn() = 0; virtual void Restart() = 0; @@ -85,9 +78,7 @@ class CCyclerSprite: public CBaseEntity vec3_t m_rendercolor; }; -class CWeaponCycler: public CBasePlayerWeapon -{ - DECLARE_CLASS_TYPES(CWeaponCycler, CBasePlayerWeapon); +class CWeaponCycler: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual int GetItemInfo(ItemInfo *p) = 0; @@ -102,9 +93,7 @@ class CWeaponCycler: public CBasePlayerWeapon }; // Flaming Wreakage -class CWreckage: public CBaseMonster -{ - DECLARE_CLASS_TYPES(CWreckage, CBaseMonster); +class CWreckage: public CBaseMonster { public: virtual void Spawn() = 0; virtual void Precache() = 0; diff --git a/AccuracyFix/include/cssdk/dlls/healthkit.h b/AccuracyFix/include/cssdk/dlls/healthkit.h index 7fa8165..643ec6f 100644 --- a/AccuracyFix/include/cssdk/dlls/healthkit.h +++ b/AccuracyFix/include/cssdk/dlls/healthkit.h @@ -25,20 +25,17 @@ * version. * */ + #pragma once -class CHealthKit: public CItem -{ - DECLARE_CLASS_TYPES(CHealthKit, CItem); +class CHealthKit: public CItem { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual BOOL MyTouch(CBasePlayer *pPlayer) = 0; }; -class CWallHealth: public CBaseToggle -{ - DECLARE_CLASS_TYPES(CWallHealth, CBaseToggle); +class CWallHealth: public CBaseToggle { public: virtual void Spawn() = 0; virtual void Precache() = 0; diff --git a/AccuracyFix/include/cssdk/dlls/hintmessage.h b/AccuracyFix/include/cssdk/dlls/hintmessage.h index ce63fde..c166517 100644 --- a/AccuracyFix/include/cssdk/dlls/hintmessage.h +++ b/AccuracyFix/include/cssdk/dlls/hintmessage.h @@ -25,33 +25,34 @@ * version. * */ + #pragma once #include "utlvector.h" -#define DHF_ROUND_STARTED (1<<1) -#define DHF_HOSTAGE_SEEN_FAR (1<<2) -#define DHF_HOSTAGE_SEEN_NEAR (1<<3) -#define DHF_HOSTAGE_USED (1<<4) -#define DHF_HOSTAGE_INJURED (1<<5) -#define DHF_HOSTAGE_KILLED (1<<6) -#define DHF_FRIEND_SEEN (1<<7) -#define DHF_ENEMY_SEEN (1<<8) -#define DHF_FRIEND_INJURED (1<<9) -#define DHF_FRIEND_KILLED (1<<10) -#define DHF_ENEMY_KILLED (1<<11) -#define DHF_BOMB_RETRIEVED (1<<12) -#define DHF_AMMO_EXHAUSTED (1<<15) -#define DHF_IN_TARGET_ZONE (1<<16) -#define DHF_IN_RESCUE_ZONE (1<<17) -#define DHF_IN_ESCAPE_ZONE (1<<18) -#define DHF_IN_VIPSAFETY_ZONE (1<<19) -#define DHF_NIGHTVISION (1<<20) -#define DHF_HOSTAGE_CTMOVE (1<<21) -#define DHF_SPEC_DUCK (1<<22) +#define DHF_ROUND_STARTED BIT(1) +#define DHF_HOSTAGE_SEEN_FAR BIT(2) +#define DHF_HOSTAGE_SEEN_NEAR BIT(3) +#define DHF_HOSTAGE_USED BIT(4) +#define DHF_HOSTAGE_INJURED BIT(5) +#define DHF_HOSTAGE_KILLED BIT(6) +#define DHF_FRIEND_SEEN BIT(7) +#define DHF_ENEMY_SEEN BIT(8) +#define DHF_FRIEND_INJURED BIT(9) +#define DHF_FRIEND_KILLED BIT(10) +#define DHF_ENEMY_KILLED BIT(11) +#define DHF_BOMB_RETRIEVED BIT(12) +#define DHF_AMMO_EXHAUSTED BIT(15) +#define DHF_IN_TARGET_ZONE BIT(16) +#define DHF_IN_RESCUE_ZONE BIT(17) +#define DHF_IN_ESCAPE_ZONE BIT(18) +#define DHF_IN_VIPSAFETY_ZONE BIT(19) +#define DHF_NIGHTVISION BIT(20) +#define DHF_HOSTAGE_CTMOVE BIT(21) +#define DHF_SPEC_DUCK BIT(22) -#define DHM_ROUND_CLEAR (DHF_ROUND_STARTED | DHF_HOSTAGE_KILLED | DHF_FRIEND_KILLED | DHF_BOMB_RETRIEVED) -#define DHM_CONNECT_CLEAR (DHF_HOSTAGE_SEEN_FAR | DHF_HOSTAGE_SEEN_NEAR | DHF_HOSTAGE_USED | DHF_HOSTAGE_INJURED | DHF_FRIEND_SEEN | DHF_ENEMY_SEEN | DHF_FRIEND_INJURED | DHF_ENEMY_KILLED | DHF_AMMO_EXHAUSTED | DHF_IN_TARGET_ZONE | DHF_IN_RESCUE_ZONE | DHF_IN_ESCAPE_ZONE | DHF_IN_VIPSAFETY_ZONE | DHF_HOSTAGE_CTMOVE | DHF_SPEC_DUCK) +#define DHM_ROUND_CLEAR (DHF_ROUND_STARTED | DHF_HOSTAGE_KILLED | DHF_FRIEND_KILLED | DHF_BOMB_RETRIEVED) +#define DHM_CONNECT_CLEAR (DHF_HOSTAGE_SEEN_FAR | DHF_HOSTAGE_SEEN_NEAR | DHF_HOSTAGE_USED | DHF_HOSTAGE_INJURED | DHF_FRIEND_SEEN | DHF_ENEMY_SEEN | DHF_FRIEND_INJURED | DHF_ENEMY_KILLED | DHF_AMMO_EXHAUSTED | DHF_IN_TARGET_ZONE | DHF_IN_RESCUE_ZONE | DHF_IN_ESCAPE_ZONE | DHF_IN_VIPSAFETY_ZONE | DHF_HOSTAGE_CTMOVE | DHF_SPEC_DUCK) class CHintMessage { public: diff --git a/AccuracyFix/include/cssdk/dlls/hookchains.h b/AccuracyFix/include/cssdk/dlls/hookchains.h index 38b8747..7ea472a 100644 --- a/AccuracyFix/include/cssdk/dlls/hookchains.h +++ b/AccuracyFix/include/cssdk/dlls/hookchains.h @@ -25,7 +25,6 @@ * version. * */ - #pragma once template diff --git a/AccuracyFix/include/cssdk/dlls/hostage/hostage.h b/AccuracyFix/include/cssdk/dlls/hostage/hostage.h index 427b253..a0be24c 100644 --- a/AccuracyFix/include/cssdk/dlls/hostage/hostage.h +++ b/AccuracyFix/include/cssdk/dlls/hostage/hostage.h @@ -79,9 +79,7 @@ extern CHostageManager *g_pHostages; extern int g_iHostageNumber; // A Counter-Strike Hostage Simple -class CHostage: public CBaseMonster -{ - DECLARE_CLASS_TYPES(CHostage, CBaseMonster); +class CHostage: public CBaseMonster { public: virtual void Spawn() = 0; virtual void Precache() = 0; diff --git a/AccuracyFix/include/cssdk/dlls/hostage/hostage_improv.h b/AccuracyFix/include/cssdk/dlls/hostage/hostage_improv.h index 9ec69a7..9c1784d 100644 --- a/AccuracyFix/include/cssdk/dlls/hostage/hostage_improv.h +++ b/AccuracyFix/include/cssdk/dlls/hostage/hostage_improv.h @@ -25,6 +25,7 @@ * version. * */ + #pragma once #include "hostage/hostage.h" @@ -36,6 +37,8 @@ enum HostageChatterType; // A Counter-Strike Hostage improved class CHostageImprov: public CImprov { public: + virtual ~CHostageImprov() {}; + // invoked when an improv reaches its MoveTo goal virtual void OnMoveToSuccess(const Vector &goal) = 0; @@ -202,7 +205,7 @@ class CHostageImprov: public CImprov { Vector m_jumpTarget; CountdownTimer m_clearPathTimer; bool m_traversingLadder; - EHANDLE m_visiblePlayer[MAX_CLIENTS]; + EntityHandle m_visiblePlayer[MAX_CLIENTS]; int m_visiblePlayerCount; CountdownTimer m_visionTimer; }; diff --git a/AccuracyFix/include/cssdk/dlls/hostage/hostage_states.h b/AccuracyFix/include/cssdk/dlls/hostage/hostage_states.h index 9ac99cf..95c5854 100644 --- a/AccuracyFix/include/cssdk/dlls/hostage/hostage_states.h +++ b/AccuracyFix/include/cssdk/dlls/hostage/hostage_states.h @@ -25,6 +25,7 @@ * version. * */ + #pragma once class CHostageImprov; @@ -139,10 +140,10 @@ class HostageFollowState: public HostageState { virtual const char *GetName() const { return "Follow"; } virtual void UpdateStationaryAnimation(CHostageImprov *improv) {} public: - void SetLeader(CBaseEntity *leader) { m_leader = leader; } - CBaseEntity *GetLeader() const { return m_leader; } + void SetLeader(CBasePlayer *leader) { m_leader = leader; } + CBasePlayer *GetLeader() const { return m_leader; } private: - mutable EHANDLE m_leader; + mutable EntityHandle m_leader; Vector m_lastLeaderPos; bool m_isWaiting; float m_stopRange; diff --git a/AccuracyFix/include/cssdk/dlls/items.h b/AccuracyFix/include/cssdk/dlls/items.h index 898d19f..8c53494 100644 --- a/AccuracyFix/include/cssdk/dlls/items.h +++ b/AccuracyFix/include/cssdk/dlls/items.h @@ -25,18 +25,19 @@ * version. * */ + #pragma once enum ItemRestType { - ITEM_TYPE_BUYING, // when a player buying items - ITEM_TYPE_TOUCHED, // when the player touches with a weaponbox or armoury_entity - ITEM_TYPE_EQUIPPED // when an entity game_player_equip gives item to player or default item's on player spawn + ITEM_TYPE_BUYING, // when a player buying items + ITEM_TYPE_TOUCHED, // when the player touches with a weaponbox or armoury_entity + ITEM_TYPE_EQUIPPED // when an entity game_player_equip gives item to player or default item's on player spawn }; // constant items -#define ITEM_ID_ANTIDOTE 2 -#define ITEM_ID_SECURITY 3 +#define ITEM_ID_ANTIDOTE 2 +#define ITEM_ID_SECURITY 3 enum ItemID { @@ -83,18 +84,14 @@ enum ItemID ITEM_BATTERY }; -class CItem: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CItem, CBaseEntity); +class CItem: public CBaseEntity { public: virtual void Spawn() = 0; virtual CBaseEntity *Respawn() = 0; virtual BOOL MyTouch(CBasePlayer *pPlayer) = 0; }; -class CWorldItem: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CWorldItem, CBaseEntity); +class CWorldItem: public CBaseEntity { public: virtual void Spawn() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; @@ -102,72 +99,56 @@ class CWorldItem: public CBaseEntity int m_iType; }; -class CItemSuit: public CItem -{ - DECLARE_CLASS_TYPES(CItemSuit, CItem); +class CItemSuit: public CItem { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual BOOL MyTouch(CBasePlayer *pPlayer) = 0; }; -class CItemBattery: public CItem -{ - DECLARE_CLASS_TYPES(CItemBattery, CItem); +class CItemBattery: public CItem { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual BOOL MyTouch(CBasePlayer *pPlayer) = 0; }; -class CItemAntidote: public CItem -{ - DECLARE_CLASS_TYPES(CItemAntidote, CItem); +class CItemAntidote: public CItem { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual BOOL MyTouch(CBasePlayer *pPlayer) = 0; }; -class CItemSecurity: public CItem -{ - DECLARE_CLASS_TYPES(CItemSecurity, CItem); +class CItemSecurity: public CItem { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual BOOL MyTouch(CBasePlayer *pPlayer) = 0; }; -class CItemLongJump: public CItem -{ - DECLARE_CLASS_TYPES(CItemLongJump, CItem); +class CItemLongJump: public CItem { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual BOOL MyTouch(CBasePlayer *pPlayer) = 0; }; -class CItemKevlar: public CItem -{ - DECLARE_CLASS_TYPES(CItemKevlar, CItem); +class CItemKevlar: public CItem { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual BOOL MyTouch(CBasePlayer *pPlayer) = 0; }; -class CItemAssaultSuit: public CItem -{ - DECLARE_CLASS_TYPES(CItemAssaultSuit, CItem); +class CItemAssaultSuit: public CItem { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual BOOL MyTouch(CBasePlayer *pPlayer) = 0; }; -class CItemThighPack: public CItem -{ - DECLARE_CLASS_TYPES(CItemThighPack, CItem); +class CItemThighPack: public CItem { public: virtual void Spawn() = 0; virtual void Precache() = 0; diff --git a/AccuracyFix/include/cssdk/dlls/lights.h b/AccuracyFix/include/cssdk/dlls/lights.h index f58c048..b35eed1 100644 --- a/AccuracyFix/include/cssdk/dlls/lights.h +++ b/AccuracyFix/include/cssdk/dlls/lights.h @@ -25,13 +25,12 @@ * version. * */ + #pragma once -#define SF_LIGHT_START_OFF 1 +#define SF_LIGHT_START_OFF BIT(0) -class CLight: public CPointEntity -{ - DECLARE_CLASS_TYPES(CLight, CPointEntity); +class CLight: public CPointEntity { public: virtual void Spawn() = 0; virtual void Restart() = 0; @@ -45,9 +44,7 @@ class CLight: public CPointEntity BOOL m_iStartedOff; }; -class CEnvLight: public CLight -{ - DECLARE_CLASS_TYPES(CEnvLight, CLight); +class CEnvLight: public CLight { public: virtual void Spawn() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; diff --git a/AccuracyFix/include/cssdk/dlls/mapinfo.h b/AccuracyFix/include/cssdk/dlls/mapinfo.h index 35184b2..acefce0 100644 --- a/AccuracyFix/include/cssdk/dlls/mapinfo.h +++ b/AccuracyFix/include/cssdk/dlls/mapinfo.h @@ -28,9 +28,10 @@ #pragma once +const float MAX_BOMB_RADIUS = 2048.0f; + class CMapInfo: public CPointEntity { - DECLARE_CLASS_TYPES(CMapInfo, CPointEntity); public: virtual void Spawn() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; diff --git a/AccuracyFix/include/cssdk/dlls/maprules.h b/AccuracyFix/include/cssdk/dlls/maprules.h index 9a21f6b..fd663fe 100644 --- a/AccuracyFix/include/cssdk/dlls/maprules.h +++ b/AccuracyFix/include/cssdk/dlls/maprules.h @@ -25,36 +25,10 @@ * version. * */ -#pragma once - -#define MAX_EQUIP 32 -#define SF_SCORE_NEGATIVE 0x0001 -#define SF_SCORE_TEAM 0x0002 - -#define SF_ENVTEXT_ALLPLAYERS 0x0001 - -#define SF_TEAMMASTER_FIREONCE 0x0001 -#define SF_TEAMMASTER_ANYTEAM 0x0002 - -#define SF_TEAMSET_FIREONCE 0x0001 -#define SF_TEAMSET_CLEARTEAM 0x0002 -#define SF_PKILL_FIREONCE 0x0001 - -#define SF_GAMECOUNT_FIREONCE 0x0001 -#define SF_GAMECOUNT_RESET 0x0002 - -#define SF_GAMECOUNTSET_FIREONCE 0x0001 - -#define SF_PLAYEREQUIP_USEONLY 0x0001 - -#define SF_PTEAM_FIREONCE 0x0001 -#define SF_PTEAM_KILL 0x0002 -#define SF_PTEAM_GIB 0x0004 +#pragma once -class CRuleEntity: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CRuleEntity, CBaseEntity); +class CRuleEntity: public CBaseEntity { public: virtual void Spawn() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; @@ -67,54 +41,46 @@ class CRuleEntity: public CBaseEntity string_t m_iszMaster; }; -// CRulePointEntity -- base class for all rule "point" entities (not brushes) -class CRulePointEntity: public CRuleEntity -{ - DECLARE_CLASS_TYPES(CRulePointEntity, CRuleEntity); +// Base class for all rule "point" entities (not brushes) +class CRulePointEntity: public CRuleEntity { public: virtual void Spawn() = 0; }; -// CRuleBrushEntity -- base class for all rule "brush" entities (not brushes) +// 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 -class CRuleBrushEntity: public CRuleEntity -{ - DECLARE_CLASS_TYPES(CRuleBrushEntity, CRuleEntity); +class CRuleBrushEntity: public CRuleEntity { public: virtual void Spawn() = 0; }; -// 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 -class CGameScore: public CRulePointEntity -{ - DECLARE_CLASS_TYPES(CGameScore, CRulePointEntity); +#define SF_SCORE_NEGATIVE BIT(0) // Allow negative scores +#define SF_SCORE_TEAM BIT(1) // Award points to team in teamplay + +// Award points to player / team +// Points +/- total +class CGameScore: public CRulePointEntity { public: virtual void Spawn() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; public: int Points() const { return int(pev->frags); } - BOOL AllowNegativeScore() { return pev->spawnflags & SF_SCORE_NEGATIVE; } - BOOL AwardToTeam() const { return pev->spawnflags & SF_SCORE_TEAM; } + bool AllowNegativeScore() { return (pev->spawnflags & SF_SCORE_NEGATIVE) == SF_SCORE_NEGATIVE; } + bool AwardToTeam() const { return (pev->spawnflags & SF_SCORE_TEAM) == SF_SCORE_TEAM; } void SetPoints(int points) { pev->frags = points; } }; -// CGameEnd / game_end -- Ends the game in MP -class CGameEnd: public CRulePointEntity -{ - DECLARE_CLASS_TYPES(CGameEnd, CRulePointEntity); +// Ends the game in Multiplayer +class CGameEnd: public CRulePointEntity { public: virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; }; -// CGameText / game_text -- NON-Localized HUD Message (use env_message to display a titles.txt message) -// Flag: All players SF_ENVTEXT_ALLPLAYERS -class CGameText: public CRulePointEntity -{ - DECLARE_CLASS_TYPES(CGameText, CRulePointEntity); +#define SF_ENVTEXT_ALLPLAYERS BIT(0) // Message will be displayed to all players instead of just the activator. + +// NON-Localized HUD Message (use env_message to display a titles.txt message) +class CGameText: public CRulePointEntity { public: virtual void KeyValue(KeyValueData *pkvd) = 0; virtual int Save(CSave &save) = 0; @@ -122,7 +88,7 @@ class CGameText: public CRulePointEntity virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; public: - BOOL MessageToAll() const { return (pev->spawnflags & SF_ENVTEXT_ALLPLAYERS) == SF_ENVTEXT_ALLPLAYERS; } + bool MessageToAll() const { return (pev->spawnflags & SF_ENVTEXT_ALLPLAYERS) == SF_ENVTEXT_ALLPLAYERS; } void MessageSet(const char *pMessage) { pev->message = ALLOC_STRING(pMessage); } const char *MessageGet() const { return STRING(pev->message); } @@ -130,15 +96,14 @@ class CGameText: public CRulePointEntity hudtextparms_t m_textParms; }; -// CGameTeamMaster / game_team_master -- "Masters" like multisource, but based on the team of the activator +#define SF_TEAMMASTER_FIREONCE BIT(0) // Remove on Fire +#define SF_TEAMMASTER_ANYTEAM BIT(1) // Any team until set? -- Any team can use this until the team is set (otherwise no teams can use it) + +// "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) -class CGameTeamMaster: public CRulePointEntity -{ - DECLARE_CLASS_TYPES(CGameTeamMaster, CRulePointEntity); +class CGameTeamMaster: public CRulePointEntity { public: virtual void KeyValue(KeyValueData *pkvd) = 0; virtual int ObjectCaps() = 0; @@ -146,32 +111,29 @@ class CGameTeamMaster: public CRulePointEntity virtual const char *TeamID() = 0; virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; public: - BOOL RemoveOnFire() const { return (pev->spawnflags & SF_TEAMMASTER_FIREONCE) == SF_TEAMMASTER_FIREONCE; } - BOOL AnyTeam() const { return (pev->spawnflags & SF_TEAMMASTER_ANYTEAM) == SF_TEAMMASTER_ANYTEAM; } + bool RemoveOnFire() const { return (pev->spawnflags & SF_TEAMMASTER_FIREONCE) == SF_TEAMMASTER_FIREONCE; } + bool AnyTeam() const { return (pev->spawnflags & SF_TEAMMASTER_ANYTEAM) == SF_TEAMMASTER_ANYTEAM; } public: int m_teamIndex; - USE_TYPE triggerType; + USE_TYPE m_triggerType; }; -// 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 -class CGameTeamSet: public CRulePointEntity -{ - DECLARE_CLASS_TYPES(CGameTeamSet, CRulePointEntity); +#define SF_TEAMSET_FIREONCE BIT(0) // Remove entity after firing. +#define SF_TEAMSET_CLEARTEAM BIT(1) // Clear team -- Sets the team to "NONE" instead of activator + +// Changes the team of the entity it targets to the activator's team +class CGameTeamSet: public CRulePointEntity { public: virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; public: - BOOL RemoveOnFire() const { return (pev->spawnflags & SF_TEAMSET_FIREONCE) == SF_TEAMSET_FIREONCE; } - BOOL ShouldClearTeam() const { return (pev->spawnflags & SF_TEAMSET_CLEARTEAM) == SF_TEAMSET_CLEARTEAM; } + bool RemoveOnFire() const { return (pev->spawnflags & SF_TEAMSET_FIREONCE) == SF_TEAMSET_FIREONCE; } + bool ShouldClearTeam() const { return (pev->spawnflags & SF_TEAMSET_CLEARTEAM) == SF_TEAMSET_CLEARTEAM; } }; -// CGamePlayerZone / game_player_zone -- players in the zone fire my target when I'm fired +// Players in the zone fire my target when I'm fired // Needs master? -class CGamePlayerZone: public CRuleBrushEntity -{ - DECLARE_CLASS_TYPES(CGamePlayerZone, CRulePointEntity); +class CGamePlayerZone: public CRuleBrushEntity { public: virtual void KeyValue(KeyValueData *pkvd) = 0; virtual int Save(CSave &save) = 0; @@ -184,29 +146,28 @@ class CGamePlayerZone: public CRuleBrushEntity string_t m_iszOutCount; }; -// CGamePlayerHurt / game_player_hurt -- Damages the player who fires it -// Flag: Fire once -class CGamePlayerHurt: public CRulePointEntity -{ - DECLARE_CLASS_TYPES(CGamePlayerHurt, CRulePointEntity); +#define SF_PKILL_FIREONCE BIT(0) // Remove entity after firing. + +// Damages the player who fires it +class CGamePlayerHurt: public CRulePointEntity { public: virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; public: - BOOL RemoveOnFire() const { return (pev->spawnflags & SF_PKILL_FIREONCE) == SF_PKILL_FIREONCE; } + bool RemoveOnFire() const { return (pev->spawnflags & SF_PKILL_FIREONCE) == SF_PKILL_FIREONCE; } }; -// CGameCounter / game_counter -- Counts events and fires target -// Flag: Fire once -// Flag: Reset on Fire -class CGameCounter: public CRulePointEntity -{ - DECLARE_CLASS_TYPES(CGameCounter, CRulePointEntity); +#define SF_GAMECOUNT_FIREONCE BIT(0) // Remove entity after firing. +#define SF_GAMECOUNT_RESET BIT(1) // Reset entity Initial value after fired. +#define SF_GAMECOUNT_OVER_LIMIT BIT(2) // Fire a target when initial value is higher than limit value. + +// Counts events and fires target +class CGameCounter: public CRulePointEntity { public: virtual void Spawn() = 0; virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; public: - BOOL RemoveOnFire() const { return (pev->spawnflags & SF_GAMECOUNT_FIREONCE) == SF_GAMECOUNT_FIREONCE; } - BOOL ResetOnFire() const { return (pev->spawnflags & SF_GAMECOUNT_RESET) == SF_GAMECOUNT_RESET; } + bool RemoveOnFire() const { return (pev->spawnflags & SF_GAMECOUNT_FIREONCE) == SF_GAMECOUNT_FIREONCE; } + bool ResetOnFire() const { return (pev->spawnflags & SF_GAMECOUNT_RESET) == SF_GAMECOUNT_RESET; } void CountUp() { pev->frags++; } void CountDown() { pev->frags--; } @@ -214,51 +175,50 @@ class CGameCounter: public CRulePointEntity int CountValue() const { return int(pev->frags); } int LimitValue() const { return int(pev->health); } - BOOL HitLimit() const { return CountValue() == LimitValue(); } + bool HitLimit() const { return ((pev->spawnflags & SF_GAMECOUNT_OVER_LIMIT) == SF_GAMECOUNT_OVER_LIMIT) ? (CountValue() >= LimitValue()) : (CountValue() == LimitValue()); } private: void SetCountValue(int value) { pev->frags = value; } void SetInitialValue(int value) { pev->dmg = value; } }; -// CGameCounterSet / game_counter_set -- Sets the counter's value -// Flag: Fire once -class CGameCounterSet: public CRulePointEntity -{ - DECLARE_CLASS_TYPES(CGameCounterSet, CRulePointEntity); +#define SF_GAMECOUNTSET_FIREONCE BIT(0) // Remove entity after firing. + +// Sets the counter's value +class CGameCounterSet: public CRulePointEntity { public: virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; public: - BOOL RemoveOnFire() const { return (pev->spawnflags & SF_GAMECOUNTSET_FIREONCE) == SF_GAMECOUNTSET_FIREONCE; } + bool RemoveOnFire() const { return (pev->spawnflags & SF_GAMECOUNTSET_FIREONCE) == SF_GAMECOUNTSET_FIREONCE; } }; -// CGamePlayerEquip / game_playerequip -- Sets the default player equipment -// Flag: USE Only -class CGamePlayerEquip: public CRulePointEntity -{ - DECLARE_CLASS_TYPES(CGamePlayerEquip, CRulePointEntity); +#define MAX_EQUIP 32 +#define SF_PLAYEREQUIP_USEONLY BIT(0) // If set, the game_player_equip entity will not equip respawning players, + // but only react to direct triggering, equipping its activator. This makes its master obsolete. + +// Sets the default player equipment +class CGamePlayerEquip: public CRulePointEntity { public: virtual void KeyValue(KeyValueData *pkvd) = 0; virtual void Touch(CBaseEntity *pOther) = 0; virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; public: - BOOL UseOnly() const { return (pev->spawnflags & SF_PLAYEREQUIP_USEONLY) == SF_PLAYEREQUIP_USEONLY; } + bool UseOnly() const { return (pev->spawnflags & SF_PLAYEREQUIP_USEONLY) == SF_PLAYEREQUIP_USEONLY; } public: - string_t m_weaponNames[ MAX_EQUIP ]; - int m_weaponCount[ MAX_EQUIP ]; + string_t m_weaponNames[MAX_EQUIP]; + int m_weaponCount[MAX_EQUIP]; }; -// CGamePlayerTeam / game_player_team -- Changes the team of the player who fired it -// Flag: Fire once -// Flag: Kill Player -// Flag: Gib Player -class CGamePlayerTeam: public CRulePointEntity -{ - DECLARE_CLASS_TYPES(CGamePlayerTeam, CRulePointEntity); +#define SF_PTEAM_FIREONCE BIT(0) // Remove entity after firing. +#define SF_PTEAM_KILL BIT(1) // Kill Player. +#define SF_PTEAM_GIB BIT(2) // Gib Player. + +// Changes the team of the player who fired it +class CGamePlayerTeam: public CRulePointEntity { public: virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; private: - BOOL RemoveOnFire() const { return (pev->spawnflags & SF_PTEAM_FIREONCE) == SF_PTEAM_FIREONCE; } - BOOL ShouldKillPlayer() const { return (pev->spawnflags & SF_PTEAM_KILL) == SF_PTEAM_KILL; } - BOOL ShouldGibPlayer() const { return (pev->spawnflags & SF_PTEAM_GIB) == SF_PTEAM_GIB; } + bool RemoveOnFire() const { return (pev->spawnflags & SF_PTEAM_FIREONCE) == SF_PTEAM_FIREONCE; } + bool ShouldKillPlayer() const { return (pev->spawnflags & SF_PTEAM_KILL) == SF_PTEAM_KILL; } + bool ShouldGibPlayer() const { return (pev->spawnflags & SF_PTEAM_GIB) == SF_PTEAM_GIB; } }; diff --git a/AccuracyFix/include/cssdk/dlls/monsterevent.h b/AccuracyFix/include/cssdk/dlls/monsterevent.h index d3f3205..2c7b1b0 100644 --- a/AccuracyFix/include/cssdk/dlls/monsterevent.h +++ b/AccuracyFix/include/cssdk/dlls/monsterevent.h @@ -25,6 +25,7 @@ * version. * */ + #pragma once typedef struct MonsterEvent_s @@ -34,11 +35,11 @@ typedef struct MonsterEvent_s } MonsterEvent_t; -#define EVENT_SPECIFIC 0 -#define EVENT_SCRIPTED 1000 -#define EVENT_SHARED 2000 -#define EVENT_CLIENT 5000 +#define EVENT_SPECIFIC 0 +#define EVENT_SCRIPTED 1000 +#define EVENT_SHARED 2000 +#define EVENT_CLIENT 5000 -#define MONSTER_EVENT_BODYDROP_LIGHT 2001 -#define MONSTER_EVENT_BODYDROP_HEAVY 2002 -#define MONSTER_EVENT_SWISHSOUND 2010 +#define MONSTER_EVENT_BODYDROP_LIGHT 2001 +#define MONSTER_EVENT_BODYDROP_HEAVY 2002 +#define MONSTER_EVENT_SWISHSOUND 2010 diff --git a/AccuracyFix/include/cssdk/dlls/monsters.h b/AccuracyFix/include/cssdk/dlls/monsters.h index f959c1f..b4495e2 100644 --- a/AccuracyFix/include/cssdk/dlls/monsters.h +++ b/AccuracyFix/include/cssdk/dlls/monsters.h @@ -25,68 +25,49 @@ * version. * */ -#pragma once - -#define LOCALMOVE_INVALID 0 // move is not possible -#define LOCALMOVE_INVALID_DONT_TRIANGULATE 1 // move is not possible, don't try to triangulate -#define LOCALMOVE_VALID 2 // move is possible -#define SF_MONSTER_WAIT_TILL_SEEN 1 // spawnflag that makes monsters wait until player can see them before attacking. -#define SF_MONSTER_GAG 2 // no idle noises from this monster -#define SF_MONSTER_HITMONSTERCLIP 4 -#define SF_MONSTER_PRISONER 16 // monster won't attack anyone, no one will attacke him. +#pragma once -#define SF_MONSTER_WAIT_FOR_SCRIPT 128 //spawnflag that makes monsters wait to check for attacking until the script is done or they've been attacked -#define SF_MONSTER_PREDISASTER 256 //this is a predisaster scientist or barney. Influences how they speak. -#define SF_MONSTER_FADECORPSE 512 // Fade out corpse after death -#define SF_MONSTER_FALL_TO_GROUND 0x80000000 +#include "skill.h" -#define SF_MONSTER_TURRET_AUTOACTIVATE 32 -#define SF_MONSTER_TURRET_STARTINACTIVE 64 -#define SF_MONSTER_WAIT_UNTIL_PROVOKED 64 // don't attack the player unless provoked +#define R_AL -2 // (ALLY) pals. Good alternative to R_NO when applicable. +#define R_FR -1 // (FEAR) will run +#define R_NO 0 // (NO RELATIONSHIP) disregard +#define R_DL 1 // (DISLIKE) will attack +#define R_HT 2 // (HATE) will attack this character instead of any visible DISLIKEd characters +#define R_NM 3 // (NEMESIS) A monster Will ALWAYS attack its nemsis, no matter what -#define MOVE_START_TURN_DIST 64 // when this far away from moveGoal, start turning to face next goal -#define MOVE_STUCK_DIST 32 // if a monster can't step this far, it is stuck. +#define SF_MONSTER_WAIT_TILL_SEEN BIT(0) // spawnflag that makes monsters wait until player can see them before attacking. +#define SF_MONSTER_GAG BIT(1) // no idle noises from this monster +#define SF_MONSTER_HITMONSTERCLIP BIT(2) +#define SF_MONSTER_PRISONER BIT(4) // monster won't attack anyone, no one will attacks him. -#define MOVE_NORMAL 0 // normal move in the direction monster is facing -#define MOVE_STRAFE 1 // moves in direction specified, no matter which way monster is facing +#define SF_MONSTER_WAIT_FOR_SCRIPT BIT(7) //spawnflag that makes monsters wait to check for attacking until the script is done or they've been attacked +#define SF_MONSTER_PREDISASTER BIT(8) //this is a predisaster scientist or barney. Influences how they speak. +#define SF_MONSTER_FADECORPSE BIT(9) // Fade out corpse after death +#define SF_MONSTER_FALL_TO_GROUND BIT(31) -#define R_AL -2 // (ALLY) pals. Good alternative to R_NO when applicable. -#define R_FR -1 // (FEAR)will run -#define R_NO 0 // (NO RELATIONSHIP) disregard -#define R_DL 1 // (DISLIKE) will attack -#define R_HT 2 // (HATE)will attack this character instead of any visible DISLIKEd characters -#define R_NM 3 // (NEMESIS) A monster Will ALWAYS attack its nemsis, no matter what +// These bits represent the monster's memory +#define MEMORY_CLEAR 0 +#define bits_MEMORY_PROVOKED BIT(0) // right now only used for houndeyes. +#define bits_MEMORY_INCOVER BIT(1) // monster knows it is in a covered position. +#define bits_MEMORY_SUSPICIOUS BIT(2) // Ally is suspicious of the player, and will move to provoked more easily +#define bits_MEMORY_PATH_FINISHED BIT(3) // Finished monster path (just used by big momma for now) +#define bits_MEMORY_ON_PATH BIT(4) // Moving on a path +#define bits_MEMORY_MOVE_FAILED BIT(5) // Movement has already failed +#define bits_MEMORY_FLINCHED BIT(6) // Has already flinched +#define bits_MEMORY_KILLED BIT(7) // HACKHACK -- remember that I've already called my Killed() +#define bits_MEMORY_CUSTOM4 BIT(28) // Monster-specific memory +#define bits_MEMORY_CUSTOM3 BIT(29) // Monster-specific memory +#define bits_MEMORY_CUSTOM2 BIT(30) // Monster-specific memory +#define bits_MEMORY_CUSTOM1 BIT(31) // Monster-specific memory -#define MEMORY_CLEAR 0 -#define bits_MEMORY_PROVOKED (1 << 0) // right now only used for houndeyes. -#define bits_MEMORY_INCOVER (1 << 1) // monster knows it is in a covered position. -#define bits_MEMORY_SUSPICIOUS (1 << 2) // Ally is suspicious of the player, and will move to provoked more easily -#define bits_MEMORY_PATH_FINISHED (1 << 3) // Finished monster path (just used by big momma for now) -#define bits_MEMORY_ON_PATH (1 << 4) // Moving on a path -#define bits_MEMORY_MOVE_FAILED (1 << 5) // Movement has already failed -#define bits_MEMORY_FLINCHED (1 << 6) // Has already flinched -#define bits_MEMORY_KILLED (1 << 7) // HACKHACK -- remember that I've already called my Killed() -#define bits_MEMORY_CUSTOM4 (1 << 28) // Monster-specific memory -#define bits_MEMORY_CUSTOM3 (1 << 29) // Monster-specific memory -#define bits_MEMORY_CUSTOM2 (1 << 30) // Monster-specific memory -#define bits_MEMORY_CUSTOM1 (1 << 31) // Monster-specific memory +// MoveToOrigin stuff +#define MOVE_START_TURN_DIST 64 // when this far away from moveGoal, start turning to face next goal +#define MOVE_STUCK_DIST 32 // if a monster can't step this far, it is stuck. -enum -{ - AITRIGGER_NONE = 0, - AITRIGGER_SEEPLAYER_ANGRY_AT_PLAYER, - AITRIGGER_TAKEDAMAGE, - AITRIGGER_HALFHEALTH, - AITRIGGER_DEATH, - AITRIGGER_SQUADMEMBERDIE, - AITRIGGER_SQUADLEADERDIE, - AITRIGGER_HEARWORLD, - AITRIGGER_HEARPLAYER, - AITRIGGER_HEARCOMBAT, - AITRIGGER_SEEPLAYER_UNCONDITIONAL, - AITRIGGER_SEEPLAYER_NOT_IN_COMBAT, -}; +#define MOVE_NORMAL 0 // normal move in the direction monster is facing +#define MOVE_STRAFE 1 // moves in direction specified, no matter which way monster is facing enum HitBoxGroup { @@ -101,15 +82,3 @@ enum HitBoxGroup HITGROUP_SHIELD, NUM_HITGROUPS, }; - -class CGib: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CGib, CBaseEntity); -public: - virtual int ObjectCaps() = 0; -public: - int m_bloodColor; - int m_cBloodDecals; - int m_material; - float m_lifeTime; -}; diff --git a/AccuracyFix/include/cssdk/dlls/mortar.h b/AccuracyFix/include/cssdk/dlls/mortar.h index 6b44466..85e4d60 100644 --- a/AccuracyFix/include/cssdk/dlls/mortar.h +++ b/AccuracyFix/include/cssdk/dlls/mortar.h @@ -25,11 +25,10 @@ * version. * */ + #pragma once -class CFuncMortarField: public CBaseToggle -{ - DECLARE_CLASS_TYPES(CFuncMortarField, CBaseToggle); +class CFuncMortarField: public CBaseToggle { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -48,9 +47,7 @@ class CFuncMortarField: public CBaseToggle int m_fControl; }; -class CMortar: public CGrenade -{ - DECLARE_CLASS_TYPES(CMortar, CGrenade); +class CMortar: public CGrenade { public: virtual void Spawn() = 0; virtual void Precache() = 0; diff --git a/AccuracyFix/include/cssdk/dlls/observer.h b/AccuracyFix/include/cssdk/dlls/observer.h index 67585a5..937c86d 100644 --- a/AccuracyFix/include/cssdk/dlls/observer.h +++ b/AccuracyFix/include/cssdk/dlls/observer.h @@ -27,6 +27,6 @@ */ #pragma once -#define CAMERA_MODE_SPEC_ANYONE 0 -#define CAMERA_MODE_SPEC_ONLY_TEAM 1 -#define CAMERA_MODE_SPEC_ONLY_FRIST_PERSON 2 +#define CAMERA_MODE_SPEC_ANYONE 0 +#define CAMERA_MODE_SPEC_ONLY_TEAM 1 +#define CAMERA_MODE_SPEC_ONLY_FRIST_PERSON 2 diff --git a/AccuracyFix/include/cssdk/dlls/pathcorner.h b/AccuracyFix/include/cssdk/dlls/pathcorner.h index be787be..4499bfd 100644 --- a/AccuracyFix/include/cssdk/dlls/pathcorner.h +++ b/AccuracyFix/include/cssdk/dlls/pathcorner.h @@ -25,11 +25,14 @@ * version. * */ + #pragma once -class CPathCorner: public CPointEntity -{ - DECLARE_CLASS_TYPES(CPathCorner, CPointEntity); +#define SF_CORNER_WAITFORTRIG BIT(0) +#define SF_CORNER_TELEPORT BIT(1) +#define SF_CORNER_FIREONCE BIT(2) + +class CPathCorner: public CPointEntity { public: virtual void Spawn() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; diff --git a/AccuracyFix/include/cssdk/dlls/plats.h b/AccuracyFix/include/cssdk/dlls/plats.h index 714d1f5..3d318b7 100644 --- a/AccuracyFix/include/cssdk/dlls/plats.h +++ b/AccuracyFix/include/cssdk/dlls/plats.h @@ -25,25 +25,13 @@ * version. * */ -#pragma once - -#define SF_PLAT_TOGGLE 0x0001 - -#define TRAIN_STARTPITCH 60 -#define TRAIN_MAXPITCH 200 -#define TRAIN_MAXSPEED 1000 -#define SF_TRACK_ACTIVATETRAIN 0x00000001 -#define SF_TRACK_RELINK 0x00000002 -#define SF_TRACK_ROTMOVE 0x00000004 -#define SF_TRACK_STARTBOTTOM 0x00000008 -#define SF_TRACK_DONT_MOVE 0x00000010 +#pragma once -#define FGUNTARGET_START_ON 0x0001 +#define SF_PLAT_TOGGLE BIT(0) // The lift is no more automatically called from top and activated by stepping on it. + // It required trigger to do so. -class CBasePlatTrain: public CBaseToggle -{ - DECLARE_CLASS_TYPES(CBasePlatTrain, CBaseToggle); +class CBasePlatTrain: public CBaseToggle { public: virtual void Precache() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; @@ -59,9 +47,7 @@ class CBasePlatTrain: public CBaseToggle float m_volume; }; -class CFuncPlat: public CBasePlatTrain -{ - DECLARE_CLASS_TYPES(CFuncPlat, CBasePlatTrain); +class CFuncPlat: public CBasePlatTrain { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -72,9 +58,7 @@ class CFuncPlat: public CBasePlatTrain virtual void HitBottom() = 0; }; -class CPlatTrigger: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CPlatTrigger, CBaseEntity); +class CPlatTrigger: public CBaseEntity { public: virtual int ObjectCaps() = 0; virtual void Touch(CBaseEntity *pOther) = 0; @@ -82,9 +66,7 @@ class CPlatTrigger: public CBaseEntity CFuncPlat *m_pPlatform; }; -class CFuncPlatRot: public CFuncPlat -{ - DECLARE_CLASS_TYPES(CFuncPlatRot, CFuncPlat); +class CFuncPlatRot: public CFuncPlat { public: virtual void Spawn() = 0; virtual int Save(CSave &save) = 0; @@ -98,9 +80,11 @@ class CFuncPlatRot: public CFuncPlat Vector m_start; }; -class CFuncTrain: public CBasePlatTrain -{ - DECLARE_CLASS_TYPES(CFuncTrain, CBasePlatTrain); +#define SF_TRAIN_WAIT_RETRIGGER BIT(0) +#define SF_TRAIN_START_ON BIT(2) // Train is initially moving +#define SF_TRAIN_PASSABLE BIT(3) // Train is not solid -- used to make water trains + +class CFuncTrain: public CBasePlatTrain { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -120,17 +104,25 @@ class CFuncTrain: public CBasePlatTrain BOOL m_activated; }; -class CFuncTrainControls: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CFuncTrainControls, CBaseEntity); +// This class defines the volume of space that the player must stand in to control the train +class CFuncTrainControls: public CBaseEntity { public: virtual void Spawn() = 0; virtual int ObjectCaps() = 0; }; -class CFuncTrackChange: public CFuncPlatRot -{ - DECLARE_CLASS_TYPES(CFuncTrackChange, CFuncPlatRot); +#define SF_TRACK_ACTIVATETRAIN BIT(0) +#define SF_TRACK_RELINK BIT(1) +#define SF_TRACK_ROTMOVE BIT(2) +#define SF_TRACK_STARTBOTTOM BIT(3) +#define SF_TRACK_DONT_MOVE BIT(4) + +enum TRAIN_CODE { TRAIN_SAFE, TRAIN_BLOCKING, TRAIN_FOLLOWING }; + +// This entity is a rotating/moving platform that will carry a train to a new track. +// It must be larger in X-Y planar area than the train, since it must contain the +// train within these dimensions in order to operate when the train is near it. +class CFuncTrackChange: public CFuncPlatRot { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -169,17 +161,19 @@ class CFuncTrackChange: public CFuncPlatRot int m_use; }; -class CFuncTrackAuto: public CFuncTrackChange -{ - DECLARE_CLASS_TYPES(CFuncTrackAuto, CFuncTrackChange); +class CFuncTrackAuto: public CFuncTrackChange { public: virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; virtual void UpdateAutoTargets(int toggleState) = 0; }; -class CGunTarget: public CBaseMonster -{ - DECLARE_CLASS_TYPES(CGunTarget, CBaseMonster); +// pev->speed is the travel speed +// pev->health is current health +// pev->max_health is the amount to reset to each time it starts + +#define SF_GUNTARGET_START_ON BIT(0) + +class CGunTarget: public CBaseMonster { public: virtual void Spawn() = 0; virtual int Save(CSave &save) = 0; diff --git a/AccuracyFix/include/cssdk/dlls/player.h b/AccuracyFix/include/cssdk/dlls/player.h index b267251..90b07a5 100644 --- a/AccuracyFix/include/cssdk/dlls/player.h +++ b/AccuracyFix/include/cssdk/dlls/player.h @@ -33,106 +33,106 @@ #include "hintmessage.h" #include "unisignals.h" -#define MIN_BUY_TIME 15 // the minimum threshold values for cvar mp_buytime 15 sec's +#define SOUND_FLASHLIGHT_ON "items/flashlight1.wav" +#define SOUND_FLASHLIGHT_OFF "items/flashlight1.wav" -#define MAX_BUFFER_MENU 175 -#define MAX_BUFFER_MENU_BRIEFING 50 +const int MAX_PLAYER_NAME_LENGTH = 32; +const int MAX_AUTOBUY_LENGTH = 256; +const int MAX_REBUY_LENGTH = 256; -#define MAX_PLAYER_NAME_LENGTH 32 -#define MAX_AUTOBUY_LENGTH 256 -#define MAX_REBUY_LENGTH 256 +const int MAX_RECENT_PATH = 20; +const int MAX_HOSTAGE_ICON = 4; // the maximum number of icons of the hostages in the HUD -#define MAX_RECENT_PATH 20 -#define MAX_HOSTAGE_ICON 4 // the maximum number of icons of the hostages in the HUD +const int MAX_SUIT_NOREPEAT = 32; +const int MAX_SUIT_PLAYLIST = 4; // max of 4 suit sentences queued up at any time -#define SUITUPDATETIME 3.5 -#define SUITFIRSTUPDATETIME 0.1 +const int MAX_BUFFER_MENU = 175; +const int MAX_BUFFER_MENU_BRIEFING = 50; -#define PLAYER_FATAL_FALL_SPEED 1100.0f -#define PLAYER_MAX_SAFE_FALL_SPEED 500.0f -#define PLAYER_USE_RADIUS 64.0f +const float SUIT_UPDATE_TIME = 3.5f; +const float SUIT_FIRST_UPDATE_TIME = 0.1f; -#define ARMOR_RATIO 0.5 // Armor Takes 50% of the damage -#define ARMOR_BONUS 0.5 // Each Point of Armor is work 1/x points of health +const float MAX_PLAYER_FATAL_FALL_SPEED = 1100.0f; +const float MAX_PLAYER_SAFE_FALL_SPEED = 500.0f; +const float MAX_PLAYER_USE_RADIUS = 64.0f; -#define FLASH_DRAIN_TIME 1.2 // 100 units/3 minutes -#define FLASH_CHARGE_TIME 0.2 // 100 units/20 seconds (seconds per unit) +const float ARMOR_RATIO = 0.5f; // Armor Takes 50% of the damage +const float ARMOR_BONUS = 0.5f; // Each Point of Armor is work 1/x points of health + +const float FLASH_DRAIN_TIME = 1.2f; // 100 units/3 minutes +const float FLASH_CHARGE_TIME = 0.2f; // 100 units/20 seconds (seconds per unit) // damage per unit per second. -#define DAMAGE_FOR_FALL_SPEED 100.0f / (PLAYER_FATAL_FALL_SPEED - PLAYER_MAX_SAFE_FALL_SPEED) -#define PLAYER_MIN_BOUNCE_SPEED 350.0f +const float DAMAGE_FOR_FALL_SPEED = 100.0f / (MAX_PLAYER_FATAL_FALL_SPEED - MAX_PLAYER_SAFE_FALL_SPEED); +const float PLAYER_MIN_BOUNCE_SPEED = 350.0f; // won't punch player's screen/make scrape noise unless player falling at least this fast. -#define PLAYER_FALL_PUNCH_THRESHHOLD 250.0f +const float PLAYER_FALL_PUNCH_THRESHHOLD = 250.0f; // Money blinks few of times on the freeze period // NOTE: It works for CZ -#define MONEY_BLINK_AMOUNT 30 +const int MONEY_BLINK_AMOUNT = 30; + +// Player time based damage +#define AIRTIME 12 // lung full of air lasts this many seconds +#define PARALYZE_DURATION 2 // number of 2 second intervals to take damage +#define PARALYZE_DAMAGE 1.0f // damage to take each 2 second interval + +#define NERVEGAS_DURATION 2 +#define NERVEGAS_DAMAGE 5.0f + +#define POISON_DURATION 5 +#define POISON_DAMAGE 2.0f + +#define RADIATION_DURATION 2 +#define RADIATION_DAMAGE 1.0f + +#define ACID_DURATION 2 +#define ACID_DAMAGE 5.0f + +#define SLOWBURN_DURATION 2 +#define SLOWBURN_DAMAGE 1.0f + +#define SLOWFREEZE_DURATION 2 +#define SLOWFREEZE_DAMAGE 1.0f // Player physics flags bits // CBasePlayer::m_afPhysicsFlags -#define PFLAG_ONLADDER (1<<0) -#define PFLAG_ONSWING (1<<0) -#define PFLAG_ONTRAIN (1<<1) -#define PFLAG_ONBARNACLE (1<<2) -#define PFLAG_DUCKING (1<<3) // In the process of ducking, but totally squatted yet -#define PFLAG_USING (1<<4) // Using a continuous entity -#define PFLAG_OBSERVER (1<<5) // player is locked in stationary cam mode. Spectators can move, observers can't. - -#define TRAIN_OFF 0x00 -#define TRAIN_NEUTRAL 0x01 -#define TRAIN_SLOW 0x02 -#define TRAIN_MEDIUM 0x03 -#define TRAIN_FAST 0x04 -#define TRAIN_BACK 0x05 - -#define TRAIN_ACTIVE 0x80 -#define TRAIN_NEW 0xc0 - -#define SIGNAL_BUY (1<<0) -#define SIGNAL_BOMB (1<<1) -#define SIGNAL_RESCUE (1<<2) -#define SIGNAL_ESCAPE (1<<3) -#define SIGNAL_VIPSAFETY (1<<4) - -#define IGNOREMSG_NONE 0 -#define IGNOREMSG_ENEMY 1 -#define IGNOREMSG_TEAM 2 - -// max of 4 suit sentences queued up at any time -#define CSUITPLAYLIST 4 - -#define SUIT_GROUP TRUE -#define SUIT_SENTENCE FALSE - -#define SUIT_REPEAT_OK 0 -#define SUIT_NEXT_IN_30SEC 30 -#define SUIT_NEXT_IN_1MIN 60 -#define SUIT_NEXT_IN_5MIN 300 -#define SUIT_NEXT_IN_10MIN 600 -#define SUIT_NEXT_IN_30MIN 1800 -#define SUIT_NEXT_IN_1HOUR 3600 - -#define TEAM_NAME_LENGTH 16 - -#define MAX_ID_RANGE 2048.0f -#define MAX_SPECTATOR_ID_RANGE 8192.0f -#define SBAR_STRING_SIZE 128 - -#define SBAR_TARGETTYPE_TEAMMATE 1 -#define SBAR_TARGETTYPE_ENEMY 2 -#define SBAR_TARGETTYPE_HOSTAGE 3 - -#define CHAT_INTERVAL 1.0f -#define CSUITNOREPEAT 32 - -#define AUTOAIM_2DEGREES 0.0348994967025 -#define AUTOAIM_5DEGREES 0.08715574274766 -#define AUTOAIM_8DEGREES 0.1391731009601 -#define AUTOAIM_10DEGREES 0.1736481776669 - -#define SOUND_FLASHLIGHT_ON "items/flashlight1.wav" -#define SOUND_FLASHLIGHT_OFF "items/flashlight1.wav" +#define PFLAG_ONLADDER BIT(0) +#define PFLAG_ONSWING BIT(0) +#define PFLAG_ONTRAIN BIT(1) +#define PFLAG_ONBARNACLE BIT(2) +#define PFLAG_DUCKING BIT(3) // In the process of ducking, but totally squatted yet +#define PFLAG_USING BIT(4) // Using a continuous entity +#define PFLAG_OBSERVER BIT(5) // player is locked in stationary cam mode. Spectators can move, observers can't. + +#define TRAIN_OFF 0x00 +#define TRAIN_NEUTRAL 0x01 +#define TRAIN_SLOW 0x02 +#define TRAIN_MEDIUM 0x03 +#define TRAIN_FAST 0x04 +#define TRAIN_BACK 0x05 + +#define TRAIN_ACTIVE 0x80 +#define TRAIN_NEW 0xc0 + +const bool SUIT_GROUP = true; +const bool SUIT_SENTENCE = false; + +const int SUIT_REPEAT_OK = 0; +const int SUIT_NEXT_IN_30SEC = 30; +const int SUIT_NEXT_IN_1MIN = 60; +const int SUIT_NEXT_IN_5MIN = 300; +const int SUIT_NEXT_IN_10MIN = 600; +const int SUIT_NEXT_IN_30MIN = 1800; +const int SUIT_NEXT_IN_1HOUR = 3600; + +const int MAX_TEAM_NAME_LENGTH = 16; + +const auto AUTOAIM_2DEGREES = 0.0348994967025; +const auto AUTOAIM_5DEGREES = 0.08715574274766; +const auto AUTOAIM_8DEGREES = 0.1391731009601; +const auto AUTOAIM_10DEGREES = 0.1736481776669; // custom enum enum RewardType @@ -236,6 +236,13 @@ enum TrackCommands COMMANDS_TO_TRACK, }; +enum IgnoreChatMsg : int +{ + IGNOREMSG_NONE, + IGNOREMSG_ENEMY, + IGNOREMSG_TEAM +}; + struct RebuyStruct { int m_primaryWeapon; @@ -261,6 +268,14 @@ enum ThrowDirection THROW_HITVEL_MINUS_AIRVEL }; +const float MAX_ID_RANGE = 2048.0f; +const float MAX_SPEC_ID_RANGE = 8192.0f; +const int MAX_SBAR_STRING = 128; + +const int SBAR_TARGETTYPE_TEAMMATE = 1; +const int SBAR_TARGETTYPE_ENEMY = 2; +const int SBAR_TARGETTYPE_HOSTAGE = 3; + enum sbar_data { SBAR_ID_TARGETTYPE = 1, @@ -273,26 +288,20 @@ enum MusicState { SILENT, CALM, INTENSE }; class CCSPlayer; -class CStripWeapons: public CPointEntity -{ - DECLARE_CLASS_TYPES(CStripWeapons, CPointEntity); +class CStripWeapons: public CPointEntity { public: virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; }; // Multiplayer intermission spots. -class CInfoIntermission: public CPointEntity -{ - DECLARE_CLASS_TYPES(CInfoIntermission, CPointEntity); +class CInfoIntermission: public CPointEntity { public: virtual void Spawn() = 0; virtual void Think() = 0; }; // Dead HEV suit prop -class CDeadHEV: public CBaseMonster -{ - DECLARE_CLASS_TYPES(CDeadHEV, CBaseMonster); +class CDeadHEV: public CBaseMonster { public: virtual void Spawn() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; @@ -302,23 +311,17 @@ class CDeadHEV: public CBaseMonster static char *m_szPoses[4]; }; -class CSprayCan: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CSprayCan, CBaseEntity); +class CSprayCan: public CBaseEntity { public: virtual void Think() = 0; virtual int ObjectCaps() = 0; }; -class CBloodSplat: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CBloodSplat, CBaseEntity); +class CBloodSplat: public CBaseEntity { public: }; -class CBasePlayer: public CBaseMonster -{ - DECLARE_CLASS_TYPES(CBasePlayer, CBaseMonster); +class CBasePlayer: public CBaseMonster { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -334,7 +337,7 @@ class CBasePlayer: public CBaseMonster virtual void AddPointsToTeam(int score, BOOL bAllowNegativeScore) = 0; virtual BOOL AddPlayerItem(CBasePlayerItem *pItem) = 0; virtual BOOL RemovePlayerItem(CBasePlayerItem *pItem) = 0; - virtual int GiveAmmo(int iAmount, char *szName, int iMax = -1) = 0; + virtual int GiveAmmo(int iAmount, const char *szName, int iMax = -1) = 0; virtual void StartSneaking() = 0; virtual void UpdateOnRemove() = 0; virtual BOOL IsSneaking() = 0; @@ -377,32 +380,30 @@ class CBasePlayer: public CBaseMonster CCSPlayer *CSPlayer() const; // templates - template - T *ForEachItem(int slot, const Functor &func) + template + CBasePlayerItem *ForEachItem(int slot, const Functor &func) { auto item = m_rgpPlayerItems[ slot ]; while (item) { - auto next = item->m_pNext; - if (func(static_cast(item))) - return static_cast(item); + if (func(item)) + return item; - item = next; + item = item->m_pNext; } return nullptr; } - template - T *ForEachItem(const Functor &func) + template + CBasePlayerItem *ForEachItem(const Functor &func) { for (auto item : m_rgpPlayerItems) { while (item) { - auto next = item->m_pNext; - if (func(static_cast(item))) - return static_cast(item); + if (func(item)) + return item; - item = next; + item = item->m_pNext; } } return nullptr; @@ -443,7 +444,7 @@ class CBasePlayer: public CBaseMonster bool m_bTeamChanged; ModelName m_iModelName; int m_iTeamKills; - int m_iIgnoreGlobalChat; + IgnoreChatMsg m_iIgnoreGlobalChat; bool m_bHasNightVision; bool m_bNightVisionOn; Vector m_vRecentPath[MAX_RECENT_PATH]; @@ -509,10 +510,10 @@ class CBasePlayer: public CBaseMonster float m_flDuckTime; float m_flWallJumpTime; float m_flSuitUpdate; - int m_rgSuitPlayList[CSUITPLAYLIST]; + int m_rgSuitPlayList[MAX_SUIT_PLAYLIST]; int m_iSuitPlayNext; - int m_rgiSuitNoRepeat[CSUITNOREPEAT]; - float m_rgflSuitNoRepeatTime[CSUITNOREPEAT]; + int m_rgiSuitNoRepeat[MAX_SUIT_NOREPEAT]; + float m_rgflSuitNoRepeatTime[MAX_SUIT_NOREPEAT]; int m_lastDamageAmount; float m_tbdPrev; float m_flgeigerRange; @@ -554,12 +555,12 @@ class CBasePlayer: public CBaseMonster int m_izSBarState[SBAR_END]; float m_flNextSBarUpdateTime; float m_flStatusBarDisappearDelay; - char m_SbarString0[SBAR_STRING_SIZE]; + char m_SbarString0[MAX_SBAR_STRING]; int m_lastx; int m_lasty; int m_nCustomSprayFrames; float m_flNextDecalTime; - char m_szTeamName[TEAM_NAME_LENGTH]; + char m_szTeamName[MAX_TEAM_NAME_LENGTH]; int m_modelIndexPlayer; char m_szAnimExtention[32]; int m_iGaitsequence; @@ -598,21 +599,16 @@ class CBasePlayer: public CBaseMonster float m_silentTimestamp; MusicState m_musicState; float m_flLastCommandTime[COMMANDS_TO_TRACK]; - int m_iLastAccount; - int m_iLastClientHealth; - float m_tmNextAccountHealthUpdate; }; -class CWShield: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CWShield, CBaseEntity); +class CWShield: public CBaseEntity { public: virtual void Spawn() = 0; virtual void Touch(CBaseEntity *pOther) = 0; public: void SetCantBePickedUpByUser(CBaseEntity *pEntity, float time) { m_hEntToIgnoreTouchesFrom = pEntity; m_flTimeToIgnoreTouches = gpGlobals->time + time; } public: - EHANDLE m_hEntToIgnoreTouchesFrom; + EntityHandle m_hEntToIgnoreTouchesFrom; float m_flTimeToIgnoreTouches; }; diff --git a/AccuracyFix/include/cssdk/dlls/qstring.h b/AccuracyFix/include/cssdk/dlls/qstring.h deleted file mode 100644 index 0b15829..0000000 --- a/AccuracyFix/include/cssdk/dlls/qstring.h +++ /dev/null @@ -1,121 +0,0 @@ -/* -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at -* your option) any later version. -* -* This program is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software Foundation, -* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -* In addition, as a special exception, the author gives permission to -* link the code of this program with the Half-Life Game Engine ("HL -* Engine") and Modified Game Libraries ("MODs") developed by Valve, -* L.L.C ("Valve"). You must obey the GNU General Public License in all -* respects for all of the code used other than the HL Engine and MODs -* from Valve. If you modify this file, you may extend this exception -* to your version of the file, but you are not obligated to do so. If -* you do not wish to do so, delete this exception statement from your -* version. -* -*/ - -#pragma once - -#define QSTRING_DEFINE - -constexpr unsigned int iStringNull = {0}; - -// Quake string (helper class) -class QString final -{ -public: - using qstring_t = unsigned int; - - QString(): m_string(iStringNull) {}; - QString(qstring_t string): m_string(string) {}; - - bool IsNull() const; - bool IsNullOrEmpty() const; - - // Copy the array - QString &operator=(const QString &other); - - bool operator==(qstring_t string) const; - bool operator==(const QString &s) const; - bool operator==(const char *pszString) const; - - operator const char *() const; - operator unsigned int() const; - const char *str() const; - -private: - qstring_t m_string; -}; - -#ifdef USE_QSTRING -#define string_t QString -#endif - -#include "const.h" -#include "edict.h" -#include "eiface.h" -#include "enginecallback.h" - -extern globalvars_t *gpGlobals; - -#define STRING(offset) ((const char *)(gpGlobals->pStringBase + (unsigned int)(offset))) -#define MAKE_STRING(str) ((unsigned int)(str) - (unsigned int)(STRING(0))) - -// Inlines -inline bool QString::IsNull() const -{ - return m_string == iStringNull; -} - -inline bool QString::IsNullOrEmpty() const -{ - return IsNull() || (&gpGlobals->pStringBase[m_string])[0] == '\0'; -} - -inline QString &QString::operator=(const QString &other) -{ - m_string = other.m_string; - return (*this); -} - -inline bool QString::operator==(qstring_t string) const -{ - return m_string == string; -} - -inline bool QString::operator==(const QString &s) const -{ - return m_string == s.m_string; -} - -inline bool QString::operator==(const char *pszString) const -{ - return Q_strcmp(&gpGlobals->pStringBase[m_string], pszString) == 0; -} - -inline const char *QString::str() const -{ - return &gpGlobals->pStringBase[m_string]; -} - -inline QString::operator const char *() const -{ - return str(); -} - -inline QString::operator unsigned int() const -{ - return m_string; -} diff --git a/AccuracyFix/include/cssdk/dlls/regamedll_api.h b/AccuracyFix/include/cssdk/dlls/regamedll_api.h index dbf5087..5cefdd5 100644 --- a/AccuracyFix/include/cssdk/dlls/regamedll_api.h +++ b/AccuracyFix/include/cssdk/dlls/regamedll_api.h @@ -25,30 +25,26 @@ * version. * */ - #pragma once - #include "archtypes.h" - -#include -#include -#include -#include -#include -#include -#include -#include +#include "regamedll_interfaces.h" +#include "hookchains.h" +#include "interface.h" +#include "player.h" +#include "gamerules.h" +#include "client.h" +#include "items.h" #define REGAMEDLL_API_VERSION_MAJOR 5 -#define REGAMEDLL_API_VERSION_MINOR 22 +#define REGAMEDLL_API_VERSION_MINOR 3 // CBasePlayer::Spawn hook -typedef IHookChainClass IReGameHook_CBasePlayer_Spawn; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Spawn; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_Spawn; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Spawn; // CBasePlayer::Precache hook -typedef IHookChainClass IReGameHook_CBasePlayer_Precache; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Precache; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_Precache; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Precache; // CBasePlayer::ObjectCaps hook typedef IHookChainClass IReGameHook_CBasePlayer_ObjectCaps; @@ -59,8 +55,8 @@ typedef IHookChainClass IReGameHook_CBasePlayer_Classify typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Classify; // CBasePlayer::TraceAttack hook -typedef IHookChainClass IReGameHook_CBasePlayer_TraceAttack; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_TraceAttack; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_TraceAttack; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_TraceAttack; // CBasePlayer::TakeDamage hook typedef IHookChainClass IReGameHook_CBasePlayer_TakeDamage; @@ -71,16 +67,16 @@ typedef IHookChainClass IReGameHook_CBasePl typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_TakeHealth; // CBasePlayer::Killed hook -typedef IHookChainClass IReGameHook_CBasePlayer_Killed; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Killed; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_Killed; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Killed; // CBasePlayer::AddPoints hook -typedef IHookChainClass IReGameHook_CBasePlayer_AddPoints; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_AddPoints; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_AddPoints; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_AddPoints; // CBasePlayer::AddPointsToTeam hook -typedef IHookChainClass IReGameHook_CBasePlayer_AddPointsToTeam; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_AddPointsToTeam; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_AddPointsToTeam; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_AddPointsToTeam; // CBasePlayer::AddPlayerItem hook typedef IHookChainClass IReGameHook_CBasePlayer_AddPlayerItem; @@ -95,68 +91,68 @@ typedef IHookChainClass IReGame typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_GiveAmmo; // CBasePlayer::ResetMaxSpeed hook -typedef IHookChainClass IReGameHook_CBasePlayer_ResetMaxSpeed; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_ResetMaxSpeed; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_ResetMaxSpeed; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_ResetMaxSpeed; // CBasePlayer::Jump hook -typedef IHookChainClass IReGameHook_CBasePlayer_Jump; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Jump; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_Jump; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Jump; // CBasePlayer::Duck hook -typedef IHookChainClass IReGameHook_CBasePlayer_Duck; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Duck; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_Duck; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Duck; // CBasePlayer::PreThink hook -typedef IHookChainClass IReGameHook_CBasePlayer_PreThink; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_PreThink; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_PreThink; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_PreThink; // CBasePlayer::PostThink hook -typedef IHookChainClass IReGameHook_CBasePlayer_PostThink; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_PostThink; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_PostThink; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_PostThink; // CBasePlayer::UpdateClientData hook -typedef IHookChainClass IReGameHook_CBasePlayer_UpdateClientData; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_UpdateClientData; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_UpdateClientData; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_UpdateClientData; // CBasePlayer::ImpulseCommands hook -typedef IHookChainClass IReGameHook_CBasePlayer_ImpulseCommands; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_ImpulseCommands; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_ImpulseCommands; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_ImpulseCommands; // CBasePlayer::RoundRespawn hook -typedef IHookChainClass IReGameHook_CBasePlayer_RoundRespawn; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_RoundRespawn; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_RoundRespawn; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_RoundRespawn; // CBasePlayer::Blind hook -typedef IHookChainClass IReGameHook_CBasePlayer_Blind; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Blind; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_Blind; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Blind; // CBasePlayer::Observer_IsValidTarget hook typedef IHookChainClass IReGameHook_CBasePlayer_Observer_IsValidTarget; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Observer_IsValidTarget; // CBasePlayer::SetAnimation hook -typedef IHookChainClass IReGameHook_CBasePlayer_SetAnimation; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_SetAnimation; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_SetAnimation; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_SetAnimation; // CBasePlayer::GiveDefaultItems hook -typedef IHookChainClass IReGameHook_CBasePlayer_GiveDefaultItems; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_GiveDefaultItems; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_GiveDefaultItems; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_GiveDefaultItems; // CBasePlayer::GiveNamedItem hook typedef IHookChainClass IReGameHook_CBasePlayer_GiveNamedItem; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_GiveNamedItem; // CBasePlayer::AddAccount hook -typedef IHookChainClass IReGameHook_CBasePlayer_AddAccount; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_AddAccount; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_AddAccount; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_AddAccount; // CBasePlayer::GiveShield hook -typedef IHookChainClass IReGameHook_CBasePlayer_GiveShield; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_GiveShield; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_GiveShield; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_GiveShield; // CBasePlayer:SetClientUserInfoModel hook -typedef IHookChainClass IReGameHook_CBasePlayer_SetClientUserInfoModel; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_SetClientUserInfoModel; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_SetClientUserInfoModel; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_SetClientUserInfoModel; // CBasePlayer:SetClientUserInfoName hook typedef IHookChainClass IReGameHook_CBasePlayer_SetClientUserInfoName; @@ -167,56 +163,56 @@ typedef IHookChainClass IReGameHo typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_HasRestrictItem; // CBasePlayer::DropPlayerItem hook -typedef IHookChainClass IReGameHook_CBasePlayer_DropPlayerItem; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_DropPlayerItem; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_DropPlayerItem; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_DropPlayerItem; // CBasePlayer::DropShield hook -typedef IHookChainClass IReGameHook_CBasePlayer_DropShield; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_DropShield; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_DropShield; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_DropShield; // CBasePlayer::OnSpawnEquip hook -typedef IHookChainClass IReGameHook_CBasePlayer_OnSpawnEquip; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_OnSpawnEquip; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_OnSpawnEquip; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_OnSpawnEquip; // CBasePlayer::Radio hook -typedef IHookChainClass IReGameHook_CBasePlayer_Radio; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Radio; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_Radio; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Radio; // CBasePlayer::Disappear hook -typedef IHookChainClass IReGameHook_CBasePlayer_Disappear; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Disappear; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_Disappear; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Disappear; // CBasePlayer::MakeVIP hook -typedef IHookChainClass IReGameHook_CBasePlayer_MakeVIP; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_MakeVIP; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_MakeVIP; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_MakeVIP; // CBasePlayer::MakeBomber hook typedef IHookChainClass IReGameHook_CBasePlayer_MakeBomber; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_MakeBomber; // CBasePlayer::StartObserver hook -typedef IHookChainClass IReGameHook_CBasePlayer_StartObserver; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_StartObserver; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_StartObserver; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_StartObserver; // CBasePlayer::GetIntoGame hook typedef IHookChainClass IReGameHook_CBasePlayer_GetIntoGame; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_GetIntoGame; // CBaseAnimating::ResetSequenceInfo hook -typedef IHookChainClass IReGameHook_CBaseAnimating_ResetSequenceInfo; -typedef IHookChainRegistryClass IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo; +typedef IVoidHookChainClass IReGameHook_CBaseAnimating_ResetSequenceInfo; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo; // GetForceCamera hook typedef IHookChain IReGameHook_GetForceCamera; typedef IHookChainRegistry IReGameHookRegistry_GetForceCamera; // PlayerBlind hook -typedef IHookChain IReGameHook_PlayerBlind; -typedef IHookChainRegistry IReGameHookRegistry_PlayerBlind; +typedef IVoidHookChain IReGameHook_PlayerBlind; +typedef IVoidHookChainRegistry IReGameHookRegistry_PlayerBlind; // RadiusFlash_TraceLine hook -typedef IHookChain IReGameHook_RadiusFlash_TraceLine; -typedef IHookChainRegistry IReGameHookRegistry_RadiusFlash_TraceLine; +typedef IVoidHookChain IReGameHook_RadiusFlash_TraceLine; +typedef IVoidHookChainRegistry IReGameHookRegistry_RadiusFlash_TraceLine; // RoundEnd hook typedef IHookChain IReGameHook_RoundEnd; @@ -227,32 +223,32 @@ typedef IHookChain IReGameHook_InstallGameRules; typedef IHookChainRegistry IReGameHookRegistry_InstallGameRules; // PM_Init hook -typedef IHookChain IReGameHook_PM_Init; -typedef IHookChainRegistry IReGameHookRegistry_PM_Init; +typedef IVoidHookChain IReGameHook_PM_Init; +typedef IVoidHookChainRegistry IReGameHookRegistry_PM_Init; // PM_Move hook -typedef IHookChain IReGameHook_PM_Move; -typedef IHookChainRegistry IReGameHookRegistry_PM_Move; +typedef IVoidHookChain IReGameHook_PM_Move; +typedef IVoidHookChainRegistry IReGameHookRegistry_PM_Move; // PM_AirMove hook -typedef IHookChain IReGameHook_PM_AirMove; -typedef IHookChainRegistry IReGameHookRegistry_PM_AirMove; +typedef IVoidHookChain IReGameHook_PM_AirMove; +typedef IVoidHookChainRegistry IReGameHookRegistry_PM_AirMove; // HandleMenu_ChooseAppearance hook -typedef IHookChain IReGameHook_HandleMenu_ChooseAppearance; -typedef IHookChainRegistry IReGameHookRegistry_HandleMenu_ChooseAppearance; +typedef IVoidHookChain IReGameHook_HandleMenu_ChooseAppearance; +typedef IVoidHookChainRegistry IReGameHookRegistry_HandleMenu_ChooseAppearance; // HandleMenu_ChooseTeam hook typedef IHookChain IReGameHook_HandleMenu_ChooseTeam; typedef IHookChainRegistry IReGameHookRegistry_HandleMenu_ChooseTeam; // ShowMenu hook -typedef IHookChain IReGameHook_ShowMenu; -typedef IHookChainRegistry IReGameHookRegistry_ShowMenu; +typedef IVoidHookChain IReGameHook_ShowMenu; +typedef IVoidHookChainRegistry IReGameHookRegistry_ShowMenu; // ShowVGUIMenu hook -typedef IHookChain IReGameHook_ShowVGUIMenu; -typedef IHookChainRegistry IReGameHookRegistry_ShowVGUIMenu; +typedef IVoidHookChain IReGameHook_ShowVGUIMenu; +typedef IVoidHookChainRegistry IReGameHookRegistry_ShowVGUIMenu; // BuyGunAmmo hook typedef IHookChain IReGameHook_BuyGunAmmo; @@ -263,8 +259,8 @@ typedef IHookChain IReGa typedef IHookChainRegistry IReGameHookRegistry_BuyWeaponByWeaponID; // InternalCommand hook -typedef IHookChain IReGameHook_InternalCommand; -typedef IHookChainRegistry IReGameHookRegistry_InternalCommand; +typedef IHookChain IReGameHook_InternalCommand; +typedef IHookChainRegistry IReGameHookRegistry_InternalCommand; // CHalfLifeMultiplay::FShouldSwitchWeapon hook typedef IHookChain IReGameHook_CSGameRules_FShouldSwitchWeapon; @@ -283,8 +279,8 @@ typedef IHookChain IReGameHook_CSGameR typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_FPlayerCanTakeDamage; // CHalfLifeMultiplay::PlayerSpawn hook -typedef IHookChain IReGameHook_CSGameRules_PlayerSpawn; -typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_PlayerSpawn; +typedef IVoidHookChain IReGameHook_CSGameRules_PlayerSpawn; +typedef IVoidHookChainRegistry IReGameHookRegistry_CSGameRules_PlayerSpawn; // CHalfLifeMultiplay::FPlayerCanRespawn hook typedef IHookChain IReGameHook_CSGameRules_FPlayerCanRespawn; @@ -295,16 +291,16 @@ typedef IHookChain IReGameHook_CSGameRule typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_GetPlayerSpawnSpot; // CHalfLifeMultiplay::ClientUserInfoChanged hook -typedef IHookChain IReGameHook_CSGameRules_ClientUserInfoChanged; -typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_ClientUserInfoChanged; +typedef IVoidHookChain IReGameHook_CSGameRules_ClientUserInfoChanged; +typedef IVoidHookChainRegistry IReGameHookRegistry_CSGameRules_ClientUserInfoChanged; // CHalfLifeMultiplay::PlayerKilled hook -typedef IHookChain IReGameHook_CSGameRules_PlayerKilled; -typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_PlayerKilled; +typedef IVoidHookChain IReGameHook_CSGameRules_PlayerKilled; +typedef IVoidHookChainRegistry IReGameHookRegistry_CSGameRules_PlayerKilled; // CHalfLifeMultiplay::DeathNotice hook -typedef IHookChain IReGameHook_CSGameRules_DeathNotice; -typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_DeathNotice; +typedef IVoidHookChain IReGameHook_CSGameRules_DeathNotice; +typedef IVoidHookChainRegistry IReGameHookRegistry_CSGameRules_DeathNotice; // CHalfLifeMultiplay::CanHavePlayerItem hook typedef IHookChain IReGameHook_CSGameRules_CanHavePlayerItem; @@ -315,479 +311,147 @@ typedef IHookChain IReGameHook_CSGameRules_DeadPlayerW typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_DeadPlayerWeapons; // CHalfLifeMultiplay::ServerDeactivate hook -typedef IHookChain IReGameHook_CSGameRules_ServerDeactivate; -typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_ServerDeactivate; +typedef IVoidHookChain<> IReGameHook_CSGameRules_ServerDeactivate; +typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_ServerDeactivate; // CHalfLifeMultiplay::CheckMapConditions hook -typedef IHookChain IReGameHook_CSGameRules_CheckMapConditions; -typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_CheckMapConditions; +typedef IVoidHookChain<> IReGameHook_CSGameRules_CheckMapConditions; +typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_CheckMapConditions; // CHalfLifeMultiplay::CleanUpMap hook -typedef IHookChain IReGameHook_CSGameRules_CleanUpMap; -typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_CleanUpMap; +typedef IVoidHookChain<> IReGameHook_CSGameRules_CleanUpMap; +typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_CleanUpMap; // CHalfLifeMultiplay::RestartRound hook -typedef IHookChain IReGameHook_CSGameRules_RestartRound; -typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_RestartRound; +typedef IVoidHookChain<> IReGameHook_CSGameRules_RestartRound; +typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_RestartRound; // CHalfLifeMultiplay::CheckWinConditions hook -typedef IHookChain IReGameHook_CSGameRules_CheckWinConditions; -typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_CheckWinConditions; +typedef IVoidHookChain<> IReGameHook_CSGameRules_CheckWinConditions; +typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_CheckWinConditions; // CHalfLifeMultiplay::RemoveGuns hook -typedef IHookChain IReGameHook_CSGameRules_RemoveGuns; -typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_RemoveGuns; +typedef IVoidHookChain<> IReGameHook_CSGameRules_RemoveGuns; +typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_RemoveGuns; // CHalfLifeMultiplay::GiveC4 hook -typedef IHookChain IReGameHook_CSGameRules_GiveC4; -typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_GiveC4; +typedef IVoidHookChain<> IReGameHook_CSGameRules_GiveC4; +typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_GiveC4; // CHalfLifeMultiplay::ChangeLevel hook -typedef IHookChain IReGameHook_CSGameRules_ChangeLevel; -typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_ChangeLevel; +typedef IVoidHookChain<> IReGameHook_CSGameRules_ChangeLevel; +typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_ChangeLevel; // CHalfLifeMultiplay::GoToIntermission hook -typedef IHookChain IReGameHook_CSGameRules_GoToIntermission; -typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_GoToIntermission; +typedef IVoidHookChain<> IReGameHook_CSGameRules_GoToIntermission; +typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_GoToIntermission; // CHalfLifeMultiplay::BalanceTeams hook -typedef IHookChain IReGameHook_CSGameRules_BalanceTeams; -typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_BalanceTeams; +typedef IVoidHookChain<> IReGameHook_CSGameRules_BalanceTeams; +typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_BalanceTeams; // CHalfLifeMultiplay::OnRoundFreezeEnd hook -typedef IHookChain IReGameHook_CSGameRules_OnRoundFreezeEnd; -typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_OnRoundFreezeEnd; - -// CSGameRules::CanPlayerHearPlayer hook -typedef IHookChain IReGameHook_CSGameRules_CanPlayerHearPlayer; -typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_CanPlayerHearPlayer; +typedef IVoidHookChain<> IReGameHook_CSGameRules_OnRoundFreezeEnd; +typedef IVoidHookChainRegistry<> IReGameHookRegistry_CSGameRules_OnRoundFreezeEnd; // PM_UpdateStepSound hook -typedef IHookChain IReGameHook_PM_UpdateStepSound; -typedef IHookChainRegistry IReGameHookRegistry_PM_UpdateStepSound; +typedef IVoidHookChain<> IReGameHook_PM_UpdateStepSound; +typedef IVoidHookChainRegistry<> IReGameHookRegistry_PM_UpdateStepSound; // CBasePlayer::StartDeathCam hook -typedef IHookChainClass IReGameHook_CBasePlayer_StartDeathCam; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_StartDeathCam; - -// CBasePlayer::SwitchTeam hook -typedef IHookChainClass IReGameHook_CBasePlayer_SwitchTeam; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_SwitchTeam; - -// CBasePlayer::CanSwitchTeam hook -typedef IHookChainClass IReGameHook_CBasePlayer_CanSwitchTeam; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_CanSwitchTeam; - -// CBasePlayer::ThrowGrenade hook -typedef IHookChainClass IReGameHook_CBasePlayer_ThrowGrenade; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_ThrowGrenade; - -// CWeaponBox::SetModel hook -typedef IHookChainClass IReGameHook_CWeaponBox_SetModel; -typedef IHookChainRegistryClass IReGameHookRegistry_CWeaponBox_SetModel; - -// CGrenade::DefuseBombStart hook -typedef IHookChainClass IReGameHook_CGrenade_DefuseBombStart; -typedef IHookChainRegistryClass IReGameHookRegistry_CGrenade_DefuseBombStart; - -// CGrenade::DefuseBombEnd hook -typedef IHookChainClass IReGameHook_CGrenade_DefuseBombEnd; -typedef IHookChainRegistryClass IReGameHookRegistry_CGrenade_DefuseBombEnd; - -// CGrenade::ExplodeHeGrenade hook -typedef IHookChainClass IReGameHook_CGrenade_ExplodeHeGrenade; -typedef IHookChainRegistryClass IReGameHookRegistry_CGrenade_ExplodeHeGrenade; - -// CGrenade::ExplodeFlashbang hook -typedef IHookChainClass IReGameHook_CGrenade_ExplodeFlashbang; -typedef IHookChainRegistryClass IReGameHookRegistry_CGrenade_ExplodeFlashbang; - -// CGrenade::ExplodeSmokeGrenade hook -typedef IHookChainClass IReGameHook_CGrenade_ExplodeSmokeGrenade; -typedef IHookChainRegistryClass IReGameHookRegistry_CGrenade_ExplodeSmokeGrenade; - -// CGrenade::ExplodeBomb hook -typedef IHookChainClass IReGameHook_CGrenade_ExplodeBomb; -typedef IHookChainRegistryClass IReGameHookRegistry_CGrenade_ExplodeBomb; - -// ThrowHeGrenade hook -typedef IHookChain IReGameHook_ThrowHeGrenade; -typedef IHookChainRegistry IReGameHookRegistry_ThrowHeGrenade; - -// ThrowFlashbang hook -typedef IHookChain IReGameHook_ThrowFlashbang; -typedef IHookChainRegistry IReGameHookRegistry_ThrowFlashbang; - -// ThrowSmokeGrenade hook -typedef IHookChain IReGameHook_ThrowSmokeGrenade; -typedef IHookChainRegistry IReGameHookRegistry_ThrowSmokeGrenade; - -// PlantBomb hook -typedef IHookChain IReGameHook_PlantBomb; -typedef IHookChainRegistry IReGameHookRegistry_PlantBomb; - -// CBasePlayer::SetSpawnProtection hook -typedef IHookChainClass IReGameHook_CBasePlayer_SetSpawnProtection; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_SetSpawnProtection; - -// CBasePlayer::RemoveSpawnProtection hook -typedef IHookChainClass IReGameHook_CBasePlayer_RemoveSpawnProtection; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_RemoveSpawnProtection; - -// IsPenetrableEntity hook -typedef IHookChain IReGameHook_IsPenetrableEntity; -typedef IHookChainRegistry IReGameHookRegistry_IsPenetrableEntity; - -// CBasePlayer::HintMessageEx hook -typedef IHookChainClass IReGameHook_CBasePlayer_HintMessageEx; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_HintMessageEx; - -// CBasePlayer::UseEmpty hook -typedef IHookChainClass IReGameHook_CBasePlayer_UseEmpty; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_UseEmpty; - -// CBasePlayerWeapon::CanDeploy hook -typedef IHookChainClass IReGameHook_CBasePlayerWeapon_CanDeploy; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayerWeapon_CanDeploy; - -// CBasePlayerWeapon::DefaultDeploy hook -typedef IHookChainClass IReGameHook_CBasePlayerWeapon_DefaultDeploy; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayerWeapon_DefaultDeploy; - -// CBasePlayerWeapon::DefaultReload hook -typedef IHookChainClass IReGameHook_CBasePlayerWeapon_DefaultReload; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayerWeapon_DefaultReload; - -// CBasePlayerWeapon::DefaultShotgunReload hook -typedef IHookChainClass IReGameHook_CBasePlayerWeapon_DefaultShotgunReload; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayerWeapon_DefaultShotgunReload; - -// CBasePlayer::DropIdlePlayer hook -typedef IHookChainClass IReGameHook_CBasePlayer_DropIdlePlayer; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_DropIdlePlayer; - -// CreateWeaponBox hook -typedef IHookChain IReGameHook_CreateWeaponBox; -typedef IHookChainRegistry IReGameHookRegistry_CreateWeaponBox; - -// SpawnHeadGib hook -typedef IHookChain IReGameHook_SpawnHeadGib; -typedef IHookChainRegistry IReGameHookRegistry_SpawnHeadGib; - -// SpawnRandomGibs hook -typedef IHookChain IReGameHook_SpawnRandomGibs; -typedef IHookChainRegistry IReGameHookRegistry_SpawnRandomGibs; - -// CGib::Spawn hook -typedef IHookChainClass IReGameHook_CGib_Spawn; -typedef IHookChainRegistryClass IReGameHookRegistry_CGib_Spawn; - -// CGib::BounceGibTouch hook -typedef IHookChainClass IReGameHook_CGib_BounceGibTouch; -typedef IHookChainRegistryClass IReGameHookRegistry_CGib_BounceGibTouch; - -// CGib::WaitTillLand hook -typedef IHookChainClass IReGameHook_CGib_WaitTillLand; -typedef IHookChainRegistryClass IReGameHookRegistry_CGib_WaitTillLand; - -// CBaseEntity::FireBullets hook -typedef IHookChainClass IReGameHook_CBaseEntity_FireBullets; -typedef IHookChainRegistryClass IReGameHookRegistry_CBaseEntity_FireBullets; - -// CBaseEntity::FireBuckshots hook -typedef IHookChainClass IReGameHook_CBaseEntity_FireBuckshots; -typedef IHookChainRegistryClass IReGameHookRegistry_CBaseEntity_FireBuckshots; - -// CBaseEntity::FireBullets3 hook -typedef IHookChainClass IReGameHook_CBaseEntity_FireBullets3; -typedef IHookChainRegistryClass IReGameHookRegistry_CBaseEntity_FireBullets3; - -// CBasePlayer::Observer_SetMode hook -typedef IHookChainClass IReGameHook_CBasePlayer_Observer_SetMode; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Observer_SetMode; - -// CBasePlayer::Observer_FindNextPlayer hook -typedef IHookChainClass IReGameHook_CBasePlayer_Observer_FindNextPlayer; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Observer_FindNextPlayer; - -// CBasePlayer::Pain hook -typedef IHookChainClass IReGameHook_CBasePlayer_Pain; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Pain; - -// CBasePlayer::DeathSound hook -typedef IHookChainClass IReGameHook_CBasePlayer_DeathSound; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_DeathSound; - -// CBasePlayer::JoiningThink hook -typedef IHookChainClass IReGameHook_CBasePlayer_JoiningThink; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_JoiningThink; - -// FreeGameRules hook -typedef IHookChain IReGameHook_FreeGameRules; -typedef IHookChainRegistry IReGameHookRegistry_FreeGameRules; - -// PM_LadderMove hook -typedef IHookChain IReGameHook_PM_LadderMove; -typedef IHookChainRegistry IReGameHookRegistry_PM_LadderMove; - -// PM_WaterJump hook -typedef IHookChain IReGameHook_PM_WaterJump; -typedef IHookChainRegistry IReGameHookRegistry_PM_WaterJump; - -// PM_CheckWaterJump hook -typedef IHookChain IReGameHook_PM_CheckWaterJump; -typedef IHookChainRegistry IReGameHookRegistry_PM_CheckWaterJump; - -// PM_Jump hook -typedef IHookChain IReGameHook_PM_Jump; -typedef IHookChainRegistry IReGameHookRegistry_PM_Jump; - -// PM_Duck hook -typedef IHookChain IReGameHook_PM_Duck; -typedef IHookChainRegistry IReGameHookRegistry_PM_Duck; - -// PM_UnDuck hook -typedef IHookChain IReGameHook_PM_UnDuck; -typedef IHookChainRegistry IReGameHookRegistry_PM_UnDuck; - -// PM_PlayStepSound hook -typedef IHookChain IReGameHook_PM_PlayStepSound; -typedef IHookChainRegistry IReGameHookRegistry_PM_PlayStepSound; - -// PM_AirAccelerate hook -typedef IHookChain IReGameHook_PM_AirAccelerate; -typedef IHookChainRegistry IReGameHookRegistry_PM_AirAccelerate; - -// ClearMultiDamage hook -typedef IHookChain IReGameHook_ClearMultiDamage; -typedef IHookChainRegistry IReGameHookRegistry_ClearMultiDamage; - -// AddMultiDamage hook -typedef IHookChain IReGameHook_AddMultiDamage; -typedef IHookChainRegistry IReGameHookRegistry_AddMultiDamage; - -// ApplyMultiDamage hook -typedef IHookChain IReGameHook_ApplyMultiDamage; -typedef IHookChainRegistry IReGameHookRegistry_ApplyMultiDamage; - -// BuyItem hook -typedef IHookChain IReGameHook_BuyItem; -typedef IHookChainRegistry IReGameHookRegistry_BuyItem; - -// CHalfLifeMultiplay::Think hook -typedef IHookChain IReGameHook_CSGameRules_Think; -typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_Think; - -// CHalfLifeMultiplay::TeamFull hook -typedef IHookChain IReGameHook_CSGameRules_TeamFull; -typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_TeamFull; - -// CHalfLifeMultiplay::TeamStacked hook -typedef IHookChain IReGameHook_CSGameRules_TeamStacked; -typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_TeamStacked; - -// CHalfLifeMultiplay::PlayerGotWeapon hook -typedef IHookChain IReGameHook_CSGameRules_PlayerGotWeapon; -typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_PlayerGotWeapon; - -// CBotManager::OnEvent hook -typedef IHookChain IReGameHook_CBotManager_OnEvent; -typedef IHookChainRegistry IReGameHookRegistry_CBotManager_OnEvent; - -// CBasePlayer::CheckTimeBasedDamage hook -typedef IHookChainClass IReGameHook_CBasePlayer_CheckTimeBasedDamage; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_CheckTimeBasedDamage; - -// CBasePlayer::EntSelectSpawnPoint hook -typedef IHookChainClass IReGameHook_CBasePlayer_EntSelectSpawnPoint; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_EntSelectSpawnPoint; - -// CBasePlayerWeapon::ItemPostFrame hook -typedef IHookChainClass IReGameHook_CBasePlayerWeapon_ItemPostFrame; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayerWeapon_ItemPostFrame; - -// CBasePlayerWeapon::KickBack hook -typedef IHookChainClass IReGameHook_CBasePlayerWeapon_KickBack; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayerWeapon_KickBack; - -// CBasePlayerWeapon::SendWeaponAnim hook -typedef IHookChainClass IReGameHook_CBasePlayerWeapon_SendWeaponAnim; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayerWeapon_SendWeaponAnim; - -// CHalfLifeMultiplay::SendDeathMessage hook -typedef IHookChain IReGameHook_CSGameRules_SendDeathMessage; -typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_SendDeathMessage; - -// CBasePlayer::PlayerDeathThink hook -typedef IHookChainClass IReGameHook_CBasePlayer_PlayerDeathThink; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_PlayerDeathThink; - -// CBasePlayer::Observer_Think hook -typedef IHookChainClass IReGameHook_CBasePlayer_Observer_Think; -typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Observer_Think; +typedef IVoidHookChainClass IReGameHook_CBasePlayer_StartDeathCam; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_StartDeathCam; class IReGameHookchains { public: virtual ~IReGameHookchains() {} // CBasePlayer virtual - virtual IReGameHookRegistry_CBasePlayer_Spawn *CBasePlayer_Spawn() = 0; - virtual IReGameHookRegistry_CBasePlayer_Precache *CBasePlayer_Precache() = 0; - virtual IReGameHookRegistry_CBasePlayer_ObjectCaps *CBasePlayer_ObjectCaps() = 0; - virtual IReGameHookRegistry_CBasePlayer_Classify *CBasePlayer_Classify() = 0; - virtual IReGameHookRegistry_CBasePlayer_TraceAttack *CBasePlayer_TraceAttack() = 0; - virtual IReGameHookRegistry_CBasePlayer_TakeDamage *CBasePlayer_TakeDamage() = 0; - virtual IReGameHookRegistry_CBasePlayer_TakeHealth *CBasePlayer_TakeHealth() = 0; - virtual IReGameHookRegistry_CBasePlayer_Killed *CBasePlayer_Killed() = 0; - virtual IReGameHookRegistry_CBasePlayer_AddPoints *CBasePlayer_AddPoints() = 0; - virtual IReGameHookRegistry_CBasePlayer_AddPointsToTeam *CBasePlayer_AddPointsToTeam() = 0; - virtual IReGameHookRegistry_CBasePlayer_AddPlayerItem *CBasePlayer_AddPlayerItem() = 0; - virtual IReGameHookRegistry_CBasePlayer_RemovePlayerItem *CBasePlayer_RemovePlayerItem() = 0; - virtual IReGameHookRegistry_CBasePlayer_GiveAmmo *CBasePlayer_GiveAmmo() = 0; - virtual IReGameHookRegistry_CBasePlayer_ResetMaxSpeed *CBasePlayer_ResetMaxSpeed() = 0; - virtual IReGameHookRegistry_CBasePlayer_Jump *CBasePlayer_Jump() = 0; - virtual IReGameHookRegistry_CBasePlayer_Duck *CBasePlayer_Duck() = 0; - virtual IReGameHookRegistry_CBasePlayer_PreThink *CBasePlayer_PreThink() = 0; - virtual IReGameHookRegistry_CBasePlayer_PostThink *CBasePlayer_PostThink() = 0; - virtual IReGameHookRegistry_CBasePlayer_UpdateClientData *CBasePlayer_UpdateClientData() = 0; - virtual IReGameHookRegistry_CBasePlayer_ImpulseCommands *CBasePlayer_ImpulseCommands() = 0; - virtual IReGameHookRegistry_CBasePlayer_RoundRespawn *CBasePlayer_RoundRespawn() = 0; - virtual IReGameHookRegistry_CBasePlayer_Blind *CBasePlayer_Blind() = 0; - - virtual IReGameHookRegistry_CBasePlayer_Observer_IsValidTarget *CBasePlayer_Observer_IsValidTarget() = 0; - virtual IReGameHookRegistry_CBasePlayer_SetAnimation *CBasePlayer_SetAnimation() = 0; - virtual IReGameHookRegistry_CBasePlayer_GiveDefaultItems *CBasePlayer_GiveDefaultItems() = 0; - virtual IReGameHookRegistry_CBasePlayer_GiveNamedItem *CBasePlayer_GiveNamedItem() = 0; - virtual IReGameHookRegistry_CBasePlayer_AddAccount *CBasePlayer_AddAccount() = 0; - virtual IReGameHookRegistry_CBasePlayer_GiveShield *CBasePlayer_GiveShield() = 0; - virtual IReGameHookRegistry_CBasePlayer_SetClientUserInfoModel *CBasePlayer_SetClientUserInfoModel() = 0; - virtual IReGameHookRegistry_CBasePlayer_SetClientUserInfoName *CBasePlayer_SetClientUserInfoName() = 0; - virtual IReGameHookRegistry_CBasePlayer_HasRestrictItem *CBasePlayer_HasRestrictItem() = 0; - virtual IReGameHookRegistry_CBasePlayer_DropPlayerItem *CBasePlayer_DropPlayerItem() = 0; - virtual IReGameHookRegistry_CBasePlayer_DropShield *CBasePlayer_DropShield() = 0; - virtual IReGameHookRegistry_CBasePlayer_OnSpawnEquip *CBasePlayer_OnSpawnEquip() = 0; - virtual IReGameHookRegistry_CBasePlayer_Radio *CBasePlayer_Radio() = 0; - virtual IReGameHookRegistry_CBasePlayer_Disappear *CBasePlayer_Disappear() = 0; - virtual IReGameHookRegistry_CBasePlayer_MakeVIP *CBasePlayer_MakeVIP() = 0; - virtual IReGameHookRegistry_CBasePlayer_MakeBomber *CBasePlayer_MakeBomber() = 0; - virtual IReGameHookRegistry_CBasePlayer_StartObserver *CBasePlayer_StartObserver() = 0; - virtual IReGameHookRegistry_CBasePlayer_GetIntoGame *CBasePlayer_GetIntoGame() = 0; - - virtual IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo *CBaseAnimating_ResetSequenceInfo() = 0; - - virtual IReGameHookRegistry_GetForceCamera *GetForceCamera() = 0; - virtual IReGameHookRegistry_PlayerBlind *PlayerBlind() = 0; - virtual IReGameHookRegistry_RadiusFlash_TraceLine *RadiusFlash_TraceLine() = 0; - virtual IReGameHookRegistry_RoundEnd *RoundEnd() = 0; - virtual IReGameHookRegistry_InstallGameRules *InstallGameRules() = 0; - virtual IReGameHookRegistry_PM_Init *PM_Init() = 0; - virtual IReGameHookRegistry_PM_Move *PM_Move() = 0; - virtual IReGameHookRegistry_PM_AirMove *PM_AirMove() = 0; - virtual IReGameHookRegistry_HandleMenu_ChooseAppearance *HandleMenu_ChooseAppearance() = 0; - virtual IReGameHookRegistry_HandleMenu_ChooseTeam *HandleMenu_ChooseTeam() = 0; - virtual IReGameHookRegistry_ShowMenu *ShowMenu() = 0; - virtual IReGameHookRegistry_ShowVGUIMenu *ShowVGUIMenu() = 0; - virtual IReGameHookRegistry_BuyGunAmmo *BuyGunAmmo() = 0; - virtual IReGameHookRegistry_BuyWeaponByWeaponID *BuyWeaponByWeaponID() = 0; - virtual IReGameHookRegistry_InternalCommand *InternalCommand() = 0; - - virtual IReGameHookRegistry_CSGameRules_FShouldSwitchWeapon *CSGameRules_FShouldSwitchWeapon() = 0; - virtual IReGameHookRegistry_CSGameRules_GetNextBestWeapon *CSGameRules_GetNextBestWeapon() = 0; - virtual IReGameHookRegistry_CSGameRules_FlPlayerFallDamage *CSGameRules_FlPlayerFallDamage() = 0; - virtual IReGameHookRegistry_CSGameRules_FPlayerCanTakeDamage *CSGameRules_FPlayerCanTakeDamage() = 0; - virtual IReGameHookRegistry_CSGameRules_PlayerSpawn *CSGameRules_PlayerSpawn() = 0; - virtual IReGameHookRegistry_CSGameRules_FPlayerCanRespawn *CSGameRules_FPlayerCanRespawn() = 0; - virtual IReGameHookRegistry_CSGameRules_GetPlayerSpawnSpot *CSGameRules_GetPlayerSpawnSpot() = 0; - virtual IReGameHookRegistry_CSGameRules_ClientUserInfoChanged *CSGameRules_ClientUserInfoChanged() = 0; - virtual IReGameHookRegistry_CSGameRules_PlayerKilled *CSGameRules_PlayerKilled() = 0; - virtual IReGameHookRegistry_CSGameRules_DeathNotice *CSGameRules_DeathNotice() = 0; - virtual IReGameHookRegistry_CSGameRules_CanHavePlayerItem *CSGameRules_CanHavePlayerItem() = 0; - virtual IReGameHookRegistry_CSGameRules_DeadPlayerWeapons *CSGameRules_DeadPlayerWeapons() = 0; - virtual IReGameHookRegistry_CSGameRules_ServerDeactivate *CSGameRules_ServerDeactivate() = 0; - virtual IReGameHookRegistry_CSGameRules_CheckMapConditions *CSGameRules_CheckMapConditions() = 0; - virtual IReGameHookRegistry_CSGameRules_CleanUpMap *CSGameRules_CleanUpMap() = 0; - virtual IReGameHookRegistry_CSGameRules_RestartRound *CSGameRules_RestartRound() = 0; - virtual IReGameHookRegistry_CSGameRules_CheckWinConditions *CSGameRules_CheckWinConditions() = 0; - virtual IReGameHookRegistry_CSGameRules_RemoveGuns *CSGameRules_RemoveGuns() = 0; - virtual IReGameHookRegistry_CSGameRules_GiveC4 *CSGameRules_GiveC4() = 0; - virtual IReGameHookRegistry_CSGameRules_ChangeLevel *CSGameRules_ChangeLevel() = 0; - virtual IReGameHookRegistry_CSGameRules_GoToIntermission *CSGameRules_GoToIntermission() = 0; - virtual IReGameHookRegistry_CSGameRules_BalanceTeams *CSGameRules_BalanceTeams() = 0; - virtual IReGameHookRegistry_CSGameRules_OnRoundFreezeEnd *CSGameRules_OnRoundFreezeEnd() = 0; - virtual IReGameHookRegistry_PM_UpdateStepSound *PM_UpdateStepSound() = 0; - virtual IReGameHookRegistry_CBasePlayer_StartDeathCam *CBasePlayer_StartDeathCam() = 0; - virtual IReGameHookRegistry_CBasePlayer_SwitchTeam *CBasePlayer_SwitchTeam() = 0; - virtual IReGameHookRegistry_CBasePlayer_CanSwitchTeam *CBasePlayer_CanSwitchTeam() = 0; - virtual IReGameHookRegistry_CBasePlayer_ThrowGrenade *CBasePlayer_ThrowGrenade() = 0; - virtual IReGameHookRegistry_CSGameRules_CanPlayerHearPlayer *CSGameRules_CanPlayerHearPlayer() = 0; - virtual IReGameHookRegistry_CWeaponBox_SetModel *CWeaponBox_SetModel() = 0; - virtual IReGameHookRegistry_CGrenade_DefuseBombStart *CGrenade_DefuseBombStart() = 0; - virtual IReGameHookRegistry_CGrenade_DefuseBombEnd *CGrenade_DefuseBombEnd() = 0; - virtual IReGameHookRegistry_CGrenade_ExplodeHeGrenade *CGrenade_ExplodeHeGrenade() = 0; - virtual IReGameHookRegistry_CGrenade_ExplodeFlashbang *CGrenade_ExplodeFlashbang() = 0; - virtual IReGameHookRegistry_CGrenade_ExplodeSmokeGrenade *CGrenade_ExplodeSmokeGrenade() = 0; - virtual IReGameHookRegistry_CGrenade_ExplodeBomb *CGrenade_ExplodeBomb() = 0; - virtual IReGameHookRegistry_ThrowHeGrenade *ThrowHeGrenade() = 0; - virtual IReGameHookRegistry_ThrowFlashbang *ThrowFlashbang() = 0; - virtual IReGameHookRegistry_ThrowSmokeGrenade *ThrowSmokeGrenade() = 0; - virtual IReGameHookRegistry_PlantBomb *PlantBomb() = 0; - virtual IReGameHookRegistry_CBasePlayer_RemoveSpawnProtection *CBasePlayer_RemoveSpawnProtection() = 0; - virtual IReGameHookRegistry_CBasePlayer_SetSpawnProtection *CBasePlayer_SetSpawnProtection() = 0; - virtual IReGameHookRegistry_IsPenetrableEntity *IsPenetrableEntity() = 0; - virtual IReGameHookRegistry_CBasePlayer_HintMessageEx *CBasePlayer_HintMessageEx() = 0; - virtual IReGameHookRegistry_CBasePlayer_UseEmpty *CBasePlayer_UseEmpty() = 0; - virtual IReGameHookRegistry_CBasePlayerWeapon_CanDeploy *CBasePlayerWeapon_CanDeploy() = 0; - virtual IReGameHookRegistry_CBasePlayerWeapon_DefaultDeploy *CBasePlayerWeapon_DefaultDeploy() = 0; - virtual IReGameHookRegistry_CBasePlayerWeapon_DefaultReload *CBasePlayerWeapon_DefaultReload() = 0; - virtual IReGameHookRegistry_CBasePlayerWeapon_DefaultShotgunReload *CBasePlayerWeapon_DefaultShotgunReload() = 0; - virtual IReGameHookRegistry_CBasePlayer_DropIdlePlayer *CBasePlayer_DropIdlePlayer() = 0; - virtual IReGameHookRegistry_CreateWeaponBox *CreateWeaponBox() = 0; - - virtual IReGameHookRegistry_SpawnHeadGib *SpawnHeadGib() = 0; - virtual IReGameHookRegistry_SpawnRandomGibs *SpawnRandomGibs() = 0; - virtual IReGameHookRegistry_CGib_Spawn *CGib_Spawn() = 0; - virtual IReGameHookRegistry_CGib_BounceGibTouch *CGib_BounceGibTouch() = 0; - virtual IReGameHookRegistry_CGib_WaitTillLand *CGib_WaitTillLand() = 0; - - virtual IReGameHookRegistry_CBaseEntity_FireBullets *CBaseEntity_FireBullets() = 0; - virtual IReGameHookRegistry_CBaseEntity_FireBuckshots *CBaseEntity_FireBuckshots() = 0; - virtual IReGameHookRegistry_CBaseEntity_FireBullets3 *CBaseEntity_FireBullets3() = 0; - - virtual IReGameHookRegistry_CBasePlayer_Observer_SetMode *CBasePlayer_Observer_SetMode() = 0; - virtual IReGameHookRegistry_CBasePlayer_Observer_FindNextPlayer *CBasePlayer_Observer_FindNextPlayer() = 0; - - virtual IReGameHookRegistry_CBasePlayer_Pain *CBasePlayer_Pain() = 0; - virtual IReGameHookRegistry_CBasePlayer_DeathSound *CBasePlayer_DeathSound() = 0; - virtual IReGameHookRegistry_CBasePlayer_JoiningThink *CBasePlayer_JoiningThink() = 0; - - virtual IReGameHookRegistry_FreeGameRules *FreeGameRules() = 0; - virtual IReGameHookRegistry_PM_LadderMove *PM_LadderMove() = 0; - virtual IReGameHookRegistry_PM_WaterJump *PM_WaterJump() = 0; - virtual IReGameHookRegistry_PM_CheckWaterJump *PM_CheckWaterJump() = 0; - virtual IReGameHookRegistry_PM_Jump *PM_Jump() = 0; - virtual IReGameHookRegistry_PM_Duck *PM_Duck() = 0; - virtual IReGameHookRegistry_PM_UnDuck *PM_UnDuck() = 0; - virtual IReGameHookRegistry_PM_PlayStepSound *PM_PlayStepSound() = 0; - virtual IReGameHookRegistry_PM_AirAccelerate *PM_AirAccelerate() = 0; - virtual IReGameHookRegistry_ClearMultiDamage *ClearMultiDamage() = 0; - virtual IReGameHookRegistry_AddMultiDamage *AddMultiDamage() = 0; - virtual IReGameHookRegistry_ApplyMultiDamage *ApplyMultiDamage() = 0; - virtual IReGameHookRegistry_BuyItem *BuyItem() = 0; - virtual IReGameHookRegistry_CSGameRules_Think *CSGameRules_Think() = 0; - virtual IReGameHookRegistry_CSGameRules_TeamFull *CSGameRules_TeamFull() = 0; - virtual IReGameHookRegistry_CSGameRules_TeamStacked *CSGameRules_TeamStacked() = 0; - virtual IReGameHookRegistry_CSGameRules_PlayerGotWeapon *CSGameRules_PlayerGotWeapon() = 0; - virtual IReGameHookRegistry_CBotManager_OnEvent *CBotManager_OnEvent() = 0; - virtual IReGameHookRegistry_CBasePlayer_CheckTimeBasedDamage *CBasePlayer_CheckTimeBasedDamage() = 0; - virtual IReGameHookRegistry_CBasePlayer_EntSelectSpawnPoint *CBasePlayer_EntSelectSpawnPoint() = 0; - virtual IReGameHookRegistry_CBasePlayerWeapon_ItemPostFrame *CBasePlayerWeapon_ItemPostFrame() = 0; - virtual IReGameHookRegistry_CBasePlayerWeapon_KickBack *CBasePlayerWeapon_KickBack() = 0; - virtual IReGameHookRegistry_CBasePlayerWeapon_SendWeaponAnim *CBasePlayerWeapon_SendWeaponAnim() = 0; - virtual IReGameHookRegistry_CSGameRules_SendDeathMessage *CSGameRules_SendDeathMessage() = 0; - - virtual IReGameHookRegistry_CBasePlayer_PlayerDeathThink *CBasePlayer_PlayerDeathThink() = 0; - virtual IReGameHookRegistry_CBasePlayer_Observer_Think *CBasePlayer_Observer_Think() = 0; - + virtual IReGameHookRegistry_CBasePlayer_Spawn* CBasePlayer_Spawn() = 0; + virtual IReGameHookRegistry_CBasePlayer_Precache* CBasePlayer_Precache() = 0; + virtual IReGameHookRegistry_CBasePlayer_ObjectCaps* CBasePlayer_ObjectCaps() = 0; + virtual IReGameHookRegistry_CBasePlayer_Classify* CBasePlayer_Classify() = 0; + virtual IReGameHookRegistry_CBasePlayer_TraceAttack* CBasePlayer_TraceAttack() = 0; + virtual IReGameHookRegistry_CBasePlayer_TakeDamage* CBasePlayer_TakeDamage() = 0; + virtual IReGameHookRegistry_CBasePlayer_TakeHealth* CBasePlayer_TakeHealth() = 0; + virtual IReGameHookRegistry_CBasePlayer_Killed* CBasePlayer_Killed() = 0; + virtual IReGameHookRegistry_CBasePlayer_AddPoints* CBasePlayer_AddPoints() = 0; + virtual IReGameHookRegistry_CBasePlayer_AddPointsToTeam* CBasePlayer_AddPointsToTeam() = 0; + virtual IReGameHookRegistry_CBasePlayer_AddPlayerItem* CBasePlayer_AddPlayerItem() = 0; + virtual IReGameHookRegistry_CBasePlayer_RemovePlayerItem* CBasePlayer_RemovePlayerItem() = 0; + virtual IReGameHookRegistry_CBasePlayer_GiveAmmo* CBasePlayer_GiveAmmo() = 0; + virtual IReGameHookRegistry_CBasePlayer_ResetMaxSpeed* CBasePlayer_ResetMaxSpeed() = 0; + virtual IReGameHookRegistry_CBasePlayer_Jump* CBasePlayer_Jump() = 0; + virtual IReGameHookRegistry_CBasePlayer_Duck* CBasePlayer_Duck() = 0; + virtual IReGameHookRegistry_CBasePlayer_PreThink* CBasePlayer_PreThink() = 0; + virtual IReGameHookRegistry_CBasePlayer_PostThink* CBasePlayer_PostThink() = 0; + virtual IReGameHookRegistry_CBasePlayer_UpdateClientData* CBasePlayer_UpdateClientData() = 0; + virtual IReGameHookRegistry_CBasePlayer_ImpulseCommands* CBasePlayer_ImpulseCommands() = 0; + virtual IReGameHookRegistry_CBasePlayer_RoundRespawn* CBasePlayer_RoundRespawn() = 0; + virtual IReGameHookRegistry_CBasePlayer_Blind* CBasePlayer_Blind() = 0; + + virtual IReGameHookRegistry_CBasePlayer_Observer_IsValidTarget* CBasePlayer_Observer_IsValidTarget() = 0; + virtual IReGameHookRegistry_CBasePlayer_SetAnimation* CBasePlayer_SetAnimation() = 0; + virtual IReGameHookRegistry_CBasePlayer_GiveDefaultItems* CBasePlayer_GiveDefaultItems() = 0; + virtual IReGameHookRegistry_CBasePlayer_GiveNamedItem* CBasePlayer_GiveNamedItem() = 0; + virtual IReGameHookRegistry_CBasePlayer_AddAccount* CBasePlayer_AddAccount() = 0; + virtual IReGameHookRegistry_CBasePlayer_GiveShield* CBasePlayer_GiveShield() = 0; + virtual IReGameHookRegistry_CBasePlayer_SetClientUserInfoModel* CBasePlayer_SetClientUserInfoModel() = 0; + virtual IReGameHookRegistry_CBasePlayer_SetClientUserInfoName* CBasePlayer_SetClientUserInfoName() = 0; + virtual IReGameHookRegistry_CBasePlayer_HasRestrictItem* CBasePlayer_HasRestrictItem() = 0; + virtual IReGameHookRegistry_CBasePlayer_DropPlayerItem* CBasePlayer_DropPlayerItem() = 0; + virtual IReGameHookRegistry_CBasePlayer_DropShield* CBasePlayer_DropShield() = 0; + virtual IReGameHookRegistry_CBasePlayer_OnSpawnEquip* CBasePlayer_OnSpawnEquip() = 0; + virtual IReGameHookRegistry_CBasePlayer_Radio* CBasePlayer_Radio() = 0; + virtual IReGameHookRegistry_CBasePlayer_Disappear* CBasePlayer_Disappear() = 0; + virtual IReGameHookRegistry_CBasePlayer_MakeVIP* CBasePlayer_MakeVIP() = 0; + virtual IReGameHookRegistry_CBasePlayer_MakeBomber* CBasePlayer_MakeBomber() = 0; + virtual IReGameHookRegistry_CBasePlayer_StartObserver* CBasePlayer_StartObserver() = 0; + virtual IReGameHookRegistry_CBasePlayer_GetIntoGame* CBasePlayer_GetIntoGame() = 0; + + virtual IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo* CBaseAnimating_ResetSequenceInfo() = 0; + + virtual IReGameHookRegistry_GetForceCamera* GetForceCamera() = 0; + virtual IReGameHookRegistry_PlayerBlind* PlayerBlind() = 0; + virtual IReGameHookRegistry_RadiusFlash_TraceLine* RadiusFlash_TraceLine() = 0; + virtual IReGameHookRegistry_RoundEnd* RoundEnd() = 0; + virtual IReGameHookRegistry_InstallGameRules* InstallGameRules() = 0; + virtual IReGameHookRegistry_PM_Init* PM_Init() = 0; + virtual IReGameHookRegistry_PM_Move* PM_Move() = 0; + virtual IReGameHookRegistry_PM_AirMove* PM_AirMove() = 0; + virtual IReGameHookRegistry_HandleMenu_ChooseAppearance* HandleMenu_ChooseAppearance() = 0; + virtual IReGameHookRegistry_HandleMenu_ChooseTeam* HandleMenu_ChooseTeam() = 0; + virtual IReGameHookRegistry_ShowMenu* ShowMenu() = 0; + virtual IReGameHookRegistry_ShowVGUIMenu* ShowVGUIMenu() = 0; + virtual IReGameHookRegistry_BuyGunAmmo* BuyGunAmmo() = 0; + virtual IReGameHookRegistry_BuyWeaponByWeaponID* BuyWeaponByWeaponID() = 0; + virtual IReGameHookRegistry_InternalCommand* InternalCommand() = 0; + + virtual IReGameHookRegistry_CSGameRules_FShouldSwitchWeapon* CSGameRules_FShouldSwitchWeapon() = 0; + virtual IReGameHookRegistry_CSGameRules_GetNextBestWeapon* CSGameRules_GetNextBestWeapon() = 0; + virtual IReGameHookRegistry_CSGameRules_FlPlayerFallDamage* CSGameRules_FlPlayerFallDamage() = 0; + virtual IReGameHookRegistry_CSGameRules_FPlayerCanTakeDamage* CSGameRules_FPlayerCanTakeDamage() = 0; + virtual IReGameHookRegistry_CSGameRules_PlayerSpawn* CSGameRules_PlayerSpawn() = 0; + virtual IReGameHookRegistry_CSGameRules_FPlayerCanRespawn* CSGameRules_FPlayerCanRespawn() = 0; + virtual IReGameHookRegistry_CSGameRules_GetPlayerSpawnSpot* CSGameRules_GetPlayerSpawnSpot() = 0; + virtual IReGameHookRegistry_CSGameRules_ClientUserInfoChanged* CSGameRules_ClientUserInfoChanged() = 0; + virtual IReGameHookRegistry_CSGameRules_PlayerKilled* CSGameRules_PlayerKilled() = 0; + virtual IReGameHookRegistry_CSGameRules_DeathNotice* CSGameRules_DeathNotice() = 0; + virtual IReGameHookRegistry_CSGameRules_CanHavePlayerItem* CSGameRules_CanHavePlayerItem() = 0; + virtual IReGameHookRegistry_CSGameRules_DeadPlayerWeapons* CSGameRules_DeadPlayerWeapons() = 0; + virtual IReGameHookRegistry_CSGameRules_ServerDeactivate* CSGameRules_ServerDeactivate() = 0; + virtual IReGameHookRegistry_CSGameRules_CheckMapConditions* CSGameRules_CheckMapConditions() = 0; + virtual IReGameHookRegistry_CSGameRules_CleanUpMap* CSGameRules_CleanUpMap() = 0; + virtual IReGameHookRegistry_CSGameRules_RestartRound* CSGameRules_RestartRound() = 0; + virtual IReGameHookRegistry_CSGameRules_CheckWinConditions* CSGameRules_CheckWinConditions() = 0; + virtual IReGameHookRegistry_CSGameRules_RemoveGuns* CSGameRules_RemoveGuns() = 0; + virtual IReGameHookRegistry_CSGameRules_GiveC4* CSGameRules_GiveC4() = 0; + virtual IReGameHookRegistry_CSGameRules_ChangeLevel* CSGameRules_ChangeLevel() = 0; + virtual IReGameHookRegistry_CSGameRules_GoToIntermission* CSGameRules_GoToIntermission() = 0; + virtual IReGameHookRegistry_CSGameRules_BalanceTeams* CSGameRules_BalanceTeams() = 0; + virtual IReGameHookRegistry_CSGameRules_OnRoundFreezeEnd* CSGameRules_OnRoundFreezeEnd() = 0; + virtual IReGameHookRegistry_PM_UpdateStepSound* PM_UpdateStepSound() = 0; + virtual IReGameHookRegistry_CBasePlayer_StartDeathCam* CBasePlayer_StartDeathCam() = 0; }; struct ReGameFuncs_t { @@ -802,18 +466,6 @@ struct ReGameFuncs_t { void (*RemoveEntityHashValue)(entvars_t *pev, const char *value, hash_types_e fieldType); int (*Cmd_Argc)(); const char *(*Cmd_Argv)(int i); - class CGrenade *(*PlantBomb)(entvars_t *pevOwner, Vector &vecStart, Vector &vecVelocity); - class CGib *(*SpawnHeadGib)(entvars_t *pevVictim); - void (*SpawnRandomGibs)(entvars_t *pevVictim, int cGibs, int human); - void (*UTIL_RestartOther)(const char *szClassname); - void (*UTIL_ResetEntities)(); - void (*UTIL_RemoveOther)(const char *szClassname, int nCount); - void (*UTIL_DecalTrace)(TraceResult *pTrace, int decalNumber); - void (*UTIL_Remove)(CBaseEntity *pEntity); - int (*AddAmmoNameToAmmoRegistry)(const char *szAmmoname); - void (*TextureTypePlaySound)(TraceResult *ptr, Vector vecSrc, Vector vecEnd, int iBulletType); - class CWeaponBox *(*CreateWeaponBox)(CBasePlayerItem *pItem, CBasePlayer *pPlayerOwner, const char *modelName, Vector &origin, Vector &angles, Vector &velocity, float lifeTime, bool packAmmo); - class CGrenade *(*SpawnGrenade)(WeaponIdType weaponId, entvars_t *pevOwner, Vector &vecSrc, Vector &vecThrow, float time, int iTeam, unsigned short usEvent); }; class IReGameApi { @@ -822,21 +474,17 @@ class IReGameApi { virtual int GetMajorVersion() = 0; virtual int GetMinorVersion() = 0; - virtual const ReGameFuncs_t *GetFuncs() = 0; - virtual IReGameHookchains *GetHookchains() = 0; - - virtual class CGameRules *GetGameRules() = 0; - virtual struct WeaponInfoStruct *GetWeaponInfo(int weaponID) = 0; - virtual struct WeaponInfoStruct *GetWeaponInfo(const char *weaponName) = 0; - virtual struct playermove_s *GetPlayerMove() = 0; - virtual struct WeaponSlotInfo *GetWeaponSlot(WeaponIdType weaponID) = 0; - virtual struct WeaponSlotInfo *GetWeaponSlot(const char *weaponName) = 0; - virtual struct ItemInfo *GetItemInfo(WeaponIdType weaponID) = 0; - virtual struct AmmoInfo *GetAmmoInfo(AmmoType ammoID) = 0; - virtual struct AmmoInfoStruct *GetAmmoInfoEx(AmmoType ammoID) = 0; - virtual struct AmmoInfoStruct *GetAmmoInfoEx(const char *ammoName) = 0; - virtual bool BGetICSEntity(const char *pchVersion) const = 0; - virtual bool BGetIGameRules(const char *pchVersion) const = 0; + virtual const ReGameFuncs_t* GetFuncs() = 0; + virtual IReGameHookchains* GetHookchains() = 0; + + virtual class CGameRules* GetGameRules() = 0; + virtual struct WeaponInfoStruct* GetWeaponInfo(int weaponID) = 0; + virtual struct WeaponInfoStruct* GetWeaponInfo(const char* weaponName) = 0; + virtual struct playermove_s* GetPlayerMove() = 0; + virtual struct WeaponSlotInfo* GetWeaponSlot(WeaponIdType weaponID) = 0; + virtual struct WeaponSlotInfo* GetWeaponSlot(const char* weaponName) = 0; + virtual struct ItemInfo* GetItemInfo(WeaponIdType weaponID) = 0; + virtual struct AmmoInfo* GetAmmoInfo(AmmoType ammoID) = 0; }; #define VRE_GAMEDLL_API_VERSION "VRE_GAMEDLL_API_VERSION001" diff --git a/AccuracyFix/include/cssdk/dlls/regamedll_const.h b/AccuracyFix/include/cssdk/dlls/regamedll_const.h index ddbe62a..af98ebf 100644 --- a/AccuracyFix/include/cssdk/dlls/regamedll_const.h +++ b/AccuracyFix/include/cssdk/dlls/regamedll_const.h @@ -30,16 +30,16 @@ // These are caps bits to indicate what an object's capabilities (currently used for save/restore and level transitions) #define FCAP_CUSTOMSAVE 0x00000001 -#define FCAP_ACROSS_TRANSITION 0x00000002 // Should transfer between transitions +#define FCAP_ACROSS_TRANSITION 0x00000002 // should transfer between transitions #define FCAP_MUST_SPAWN 0x00000004 // Spawn after restore #define FCAP_DONT_SAVE 0x80000000 // Don't save this -#define FCAP_IMPULSE_USE 0x00000008 // Can be used by the player -#define FCAP_CONTINUOUS_USE 0x00000010 // Can be used by the player -#define FCAP_ONOFF_USE 0x00000020 // Can be used by the player +#define FCAP_IMPULSE_USE 0x00000008 // can be used by the player +#define FCAP_CONTINUOUS_USE 0x00000010 // can be used by the player +#define FCAP_ONOFF_USE 0x00000020 // can be used by the player #define FCAP_DIRECTIONAL_USE 0x00000040 // Player sends +/- 1 when using (currently only tracktrains) #define FCAP_MASTER 0x00000080 // Can be used to "master" other entities (like multisource) -#define FCAP_MUST_RESET 0x00000100 // Should reset on the new round -#define FCAP_MUST_RELEASE 0x00000200 // Should release on the new round +#define FCAP_MUST_RESET 0x00000100 // should reset on the new round +#define FCAP_MUST_RELEASE 0x00000200 // should release on the new round // UNDONE: This will ignore transition volumes (trigger_transition), but not the PVS!!! #define FCAP_FORCE_TRANSITION 0x00000080 // ALWAYS goes across transitions @@ -94,15 +94,15 @@ #define DMG_MORTAR (1<<23) // Hit by air raid (done to distinguish grenade from mortar) #define DMG_EXPLOSION (1<<24) -// These are the damage types that are allowed to gib corpses +// these are the damage types that are allowed to gib corpses #define DMG_GIB_CORPSE (DMG_CRUSH | DMG_FALL | DMG_BLAST | DMG_SONIC | DMG_CLUB) -// These are the damage types that have client hud art +// these are the damage types that have client hud art #define DMG_SHOWNHUD (DMG_POISON | DMG_ACID | DMG_FREEZE | DMG_SLOWFREEZE | DMG_DROWN | DMG_BURN | DMG_SLOWBURN | DMG_NERVEGAS | DMG_RADIATION | DMG_SHOCK) -// When calling KILLED(), a value that governs gib behavior is expected to be +// when calling KILLED(), a value that governs gib behavior is expected to be // one of these three values -#define GIB_NORMAL 0 // Gib if entity was overkilled -#define GIB_NEVER 1 // Never gib, no matter how much death damage is done ( freezing, etc ) -#define GIB_ALWAYS 2 // Always gib ( Houndeye Shock, Barnacle Bite ) +#define GIB_NORMAL 0 // gib if entity was overkilled +#define GIB_NEVER 1 // never gib, no matter how much death damage is done ( freezing, etc ) +#define GIB_ALWAYS 2 // always gib ( Houndeye Shock, Barnacle Bite ) #define GIB_HEALTH_VALUE -30 diff --git a/AccuracyFix/include/cssdk/dlls/API/CSInterfaces.h b/AccuracyFix/include/cssdk/dlls/regamedll_interfaces.h similarity index 75% rename from AccuracyFix/include/cssdk/dlls/API/CSInterfaces.h rename to AccuracyFix/include/cssdk/dlls/regamedll_interfaces.h index 98e9ea1..39877a5 100644 --- a/AccuracyFix/include/cssdk/dlls/API/CSInterfaces.h +++ b/AccuracyFix/include/cssdk/dlls/regamedll_interfaces.h @@ -28,17 +28,88 @@ #pragma once -#include -#include +class CBaseEntity; +class CBasePlayer; +// Implementation wrapper +class CCSEntity { +public: + virtual ~CCSEntity() {} + virtual void FireBullets(int iShots, Vector &vecSrc, Vector &vecDirShooting, Vector &vecSpread, float flDistance, int iBulletType, int iTracerFreq, int iDamage, entvars_t *pevAttacker); + virtual 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); +public: + CBaseEntity *m_pContainingEntity; +}; + +class CCSDelay: public CCSEntity {}; +class CCSAnimating: public CCSDelay {}; +class CCSPlayerItem: public CCSAnimating {}; +class CCSToggle: public CCSAnimating {}; +class CCSMonster: public CCSToggle {}; class CCSWeaponBox: public CCSEntity {}; class CCSArmoury: public CCSEntity {}; + +class CCSPlayer: public CCSMonster { +public: + CCSPlayer() : m_bForceShowMenu(false) + { + m_szModel[0] = '\0'; + } + + virtual bool IsConnected() const; + virtual void SetAnimation(PLAYER_ANIM playerAnim); + virtual void AddAccount(int amount, RewardType type = RT_NONE, bool bTrackChange = true); + virtual CBaseEntity *GiveNamedItem(const char *pszName); + virtual CBaseEntity *GiveNamedItemEx(const char *pszName); + virtual void GiveDefaultItems(); + virtual void GiveShield(bool bDeploy = true); + virtual void DropShield(bool bDeploy = true); + virtual void DropPlayerItem(const char *pszItemName); + virtual void RemoveShield(); + virtual void RemoveAllItems(bool bRemoveSuit); + virtual bool RemovePlayerItem(const char* pszItemName); + virtual void SetPlayerModel(bool bHasC4); + virtual void SetPlayerModelEx(const char *modelName); + virtual void SetNewPlayerModel(const char *modelName); + virtual void ClientCommand(const char *cmd, const char *arg1 = nullptr, const char *arg2 = nullptr, const char *arg3 = nullptr); + virtual void SetProgressBarTime(int time); + virtual void SetProgressBarTime2(int time, float timeElapsed); + virtual struct edict_s *EntSelectSpawnPoint(); + virtual void SetBombIcon(bool bFlash = false); + virtual void SetScoreAttrib(CBasePlayer *dest); + virtual void SendItemStatus(); + virtual void ReloadWeapons(CBasePlayerItem *pWeapon = nullptr, bool bForceReload = false, bool bForceRefill = false); + virtual void Observer_SetMode(int iMode); + virtual bool SelectSpawnSpot(const char *pEntClassName, CBaseEntity* &pSpot); + virtual bool SwitchWeapon(CBasePlayerItem *pWeapon); + virtual void SwitchTeam(); + virtual bool JoinTeam(TeamName team); + virtual void StartObserver(Vector& vecPosition, Vector& vecViewAngle); + virtual void TeamChangeUpdate(); + virtual void DropSecondary(); + virtual void DropPrimary(); + virtual bool HasPlayerItem(CBasePlayerItem *pCheckItem); + virtual bool HasNamedPlayerItem(const char *pszItemName); + virtual CBasePlayerItem *GetItemById(WeaponIdType weaponID); + virtual CBasePlayerItem *GetItemByName(const char *itemName); + virtual void Disappear(); + virtual void MakeVIP(); + virtual bool MakeBomber(); + virtual void StartDeathCam(); + + CBasePlayer *BasePlayer() const; +public: + char m_szModel[32]; + bool m_bForceShowMenu; +}; + class CAPI_Bot: public CCSPlayer {}; class CAPI_CSBot: public CAPI_Bot {}; class CCSShield: public CCSEntity {}; class CCSDeadHEV: public CCSMonster {}; class CCSSprayCan: public CCSEntity {}; class CCSBloodSplat: public CCSEntity {}; +class CCSPlayerWeapon: public CCSPlayerItem {}; class CCSWorld: public CCSEntity {}; class CCSDecal: public CCSEntity {}; class CCSCorpse: public CCSEntity {}; @@ -226,8 +297,7 @@ class CCSTriggerCamera: public CCSDelay {}; class CCSWeather: public CCSTrigger {}; class CCSClientFog: public CCSEntity {}; class CCSTriggerSetOrigin: public CCSDelay {}; -class CCSTriggerRandom: public CCSDelay {}; -class CCSItemAirBox: public CCSArmoury {}; -class CCSPointBaseCommand: public CCSPointEntity {}; -class CCSPointClientCommand: public CCSPointBaseCommand {}; -class CCSPointServerCommand: public CCSPointBaseCommand {}; + +inline CBasePlayer *CCSPlayer::BasePlayer() const { + return reinterpret_cast(this->m_pContainingEntity); +} diff --git a/AccuracyFix/include/cssdk/dlls/saverestore.h b/AccuracyFix/include/cssdk/dlls/saverestore.h deleted file mode 100644 index c579ebc..0000000 --- a/AccuracyFix/include/cssdk/dlls/saverestore.h +++ /dev/null @@ -1,207 +0,0 @@ -/* -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at -* your option) any later version. -* -* This program is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software Foundation, -* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -* In addition, as a special exception, the author gives permission to -* link the code of this program with the Half-Life Game Engine ("HL -* Engine") and Modified Game Libraries ("MODs") developed by Valve, -* L.L.C ("Valve"). You must obey the GNU General Public License in all -* respects for all of the code used other than the HL Engine and MODs -* from Valve. If you modify this file, you may extend this exception -* to your version of the file, but you are not obligated to do so. If -* you do not wish to do so, delete this exception statement from your -* version. -* -*/ - -#pragma once - -#define IMPLEMENT_SAVERESTORE(derivedClass, baseClass)\ - int derivedClass::Save(CSave &save)\ - {\ - if (!baseClass::Save(save))\ - return 0;\ - return save.WriteFields(#derivedClass, this, m_SaveData, ARRAYSIZE(m_SaveData));\ - }\ - int derivedClass::Restore(CRestore &restore)\ - {\ - if (!baseClass::Restore(restore))\ - return 0;\ - return restore.ReadFields(#derivedClass, this, m_SaveData, ARRAYSIZE(m_SaveData));\ - } - -enum GLOBALESTATE -{ - GLOBAL_OFF, - GLOBAL_ON, - GLOBAL_DEAD -}; - -typedef struct globalentity_s -{ - char name[64]; - char levelName[MAX_MAPNAME_LENGHT]; - GLOBALESTATE state; - struct globalentity_s *pNext; - -} globalentity_t; - -struct HEADER -{ - unsigned short size; - unsigned short token; - char *pData; -}; - -const int MAX_ENTITY_ARRAY = 64; - -class CBaseEntity; -class CSaveRestoreBuffer -{ -public: - CSaveRestoreBuffer(); - CSaveRestoreBuffer(SAVERESTOREDATA *pdata); - ~CSaveRestoreBuffer(); - - int EntityIndex(entvars_t *pevLookup); - int EntityIndex(edict_t *pentLookup); - int EntityIndex(EOFFSET eoLookup); - int EntityIndex(CBaseEntity *pEntity); - int EntityFlags(int entityIndex, int flags); - int EntityFlagsSet(int entityIndex, int flags); - edict_t *EntityFromIndex(int entityIndex); - unsigned short TokenHash(const char *pszToken); - -protected: - static constexpr int m_Sizes[] = { - sizeof(float), // FIELD_FLOAT - sizeof(int), // FIELD_STRING - sizeof(int), // FIELD_ENTITY - sizeof(int), // FIELD_CLASSPTR - sizeof(int), // FIELD_EHANDLE - sizeof(int), // FIELD_entvars_t - sizeof(int), // FIELD_EDICT - sizeof(float) * 3, // FIELD_VECTOR - sizeof(float) * 3, // FIELD_POSITION_VECTOR - sizeof(int *), // FIELD_POINTER - sizeof(int), // FIELD_INTEGER - sizeof(int *), // FIELD_FUNCTION - sizeof(int), // FIELD_BOOLEAN - sizeof(short), // FIELD_SHORT - sizeof(char), // FIELD_CHARACTER - sizeof(float), // FIELD_TIME - sizeof(int), // FIELD_MODELNAME - sizeof(int), // FIELD_SOUNDNAME - }; - - SAVERESTOREDATA *m_pData; - void BufferRewind(int size); - unsigned int HashString(const char *pszToken); -}; - -class CSave: public CSaveRestoreBuffer -{ -public: - CSave(SAVERESTOREDATA *pdata) : CSaveRestoreBuffer(pdata) {}; - - void WriteShort(const char *pname, const short *value, int count); - void WriteInt(const char *pname, const int *value, int count); - void WriteFloat(const char *pname, const float *value, int count); - void WriteTime(const char *pname, const float *value, int count); - void WriteData(const char *pname, int size, const char *pdata); - void WriteString(const char *pname, const char *pstring); - void WriteString(const char *pname, const int *stringId, int count); - void WriteVector(const char *pname, const Vector &value); - void WriteVector(const char *pname, const float *value, int count); - void WritePositionVector(const char *pname, const Vector &value); - void WritePositionVector(const char *pname, const float *value, int count); - void WriteFunction(const char *pname, void **data, int count); - int WriteEntVars(const char *pname, entvars_t *pev); - int WriteFields(const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); - -private: - int DataEmpty(const char *pdata, int size); - void BufferField(const char *pname, int size, const char *pdata); - void BufferString(char *pdata, int len); - void BufferData(const char *pdata, int size); - void BufferHeader(const char *pname, int size); -}; - -class CRestore: public CSaveRestoreBuffer -{ -public: - CRestore(SAVERESTOREDATA *pdata) : CSaveRestoreBuffer(pdata) - { - m_global = FALSE; - m_precache = TRUE; - } - int ReadEntVars(const char *pname, entvars_t *pev); - int ReadFields(const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount); - int ReadField(void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount, int startField, int size, char *pName, void *pData); - int ReadInt(); - short ReadShort(); - int ReadNamedInt(const char *pName); - char *ReadNamedString(const char *pName); - - bool Empty() const { return (!m_pData || ((m_pData->pCurrentData - m_pData->pBaseData) >= m_pData->bufferSize)); } - void SetGlobalMode(BOOL global) { m_global = global; } - void PrecacheMode(BOOL mode) { m_precache = mode; } - -private: - char *BufferPointer(); - void BufferReadBytes(char *pOutput, int size); - void BufferSkipBytes(int bytes); - int BufferSkipZString(); - int BufferCheckZString(const char *string); - void BufferReadHeader(HEADER *pheader); - -private: - BOOL m_global; - BOOL m_precache; -}; - -class CGlobalState -{ -public: - CGlobalState(); - - void Reset(); - void ClearStates(); - void EntityAdd(string_t globalname, string_t mapName, GLOBALESTATE state); - void EntitySetState(string_t globalname, GLOBALESTATE state); - void EntityUpdate(string_t globalname, string_t mapname); - const globalentity_t *EntityFromTable(string_t globalname); - GLOBALESTATE EntityGetState(string_t globalname); - - BOOL EntityInTable(string_t globalname) { return Find(globalname) ? TRUE : FALSE; } - int Save(CSave &save); - int Restore(CRestore &restore); - void DumpGlobals(); - - static TYPEDESCRIPTION m_SaveData[]; - static TYPEDESCRIPTION m_GlobalEntitySaveData[]; - -private: - globalentity_t *Find(string_t globalname); - - globalentity_t *m_pList; - int m_listCount; -}; - -void SaveGlobalState(SAVERESTOREDATA *pSaveData); -void RestoreGlobalState(SAVERESTOREDATA *pSaveData); -void ResetGlobalState(); - -extern CGlobalState gGlobalState; diff --git a/AccuracyFix/include/cssdk/dlls/schedule.h b/AccuracyFix/include/cssdk/dlls/schedule.h index 67cb43c..ea6794d 100644 --- a/AccuracyFix/include/cssdk/dlls/schedule.h +++ b/AccuracyFix/include/cssdk/dlls/schedule.h @@ -30,15 +30,15 @@ // these MoveFlag values are assigned to a WayPoint's TYPE in order to demonstrate the // type of movement the monster should use to get there. -#define bits_MF_TO_TARGETENT BIT(0) // local move to targetent. -#define bits_MF_TO_ENEMY BIT(1) // local move to enemy -#define bits_MF_TO_COVER BIT(2) // local move to a hiding place -#define bits_MF_TO_DETOUR BIT(3) // local move to detour point. -#define bits_MF_TO_PATHCORNER BIT(4) // local move to a path corner -#define bits_MF_TO_NODE BIT(5) // local move to a node -#define bits_MF_TO_LOCATION BIT(6) // local move to an arbitrary point -#define bits_MF_IS_GOAL BIT(7) // this waypoint is the goal of the whole move. -#define bits_MF_DONT_SIMPLIFY BIT(8) // Don't let the route code simplify this waypoint +#define bits_MF_TO_TARGETENT (1<<0) // local move to targetent. +#define bits_MF_TO_ENEMY (1<<1) // local move to enemy +#define bits_MF_TO_COVER (1<<2) // local move to a hiding place +#define bits_MF_TO_DETOUR (1<<3) // local move to detour point. +#define bits_MF_TO_PATHCORNER (1<<4) // local move to a path corner +#define bits_MF_TO_NODE (1<<5) // local move to a node +#define bits_MF_TO_LOCATION (1<<6) // local move to an arbitrary point +#define bits_MF_IS_GOAL (1<<7) // this waypoint is the goal of the whole move. +#define bits_MF_DONT_SIMPLIFY (1<<8) // Don't let the route code simplify this waypoint // If you define any flags that aren't _TO_ flags, add them here so we can mask // them off when doing compares. @@ -53,36 +53,36 @@ // these bits represent conditions that may befall the monster, of which some are allowed // to interrupt certain schedules. -#define bits_COND_NO_AMMO_LOADED BIT(0) // weapon needs to be reloaded! -#define bits_COND_SEE_HATE BIT(1) // see something that you hate -#define bits_COND_SEE_FEAR BIT(2) // see something that you are afraid of -#define bits_COND_SEE_DISLIKE BIT(3) // see something that you dislike -#define bits_COND_SEE_ENEMY BIT(4) // target entity is in full view. -#define bits_COND_ENEMY_OCCLUDED BIT(5) // target entity occluded by the world -#define bits_COND_SMELL_FOOD BIT(6) -#define bits_COND_ENEMY_TOOFAR BIT(7) -#define bits_COND_LIGHT_DAMAGE BIT(8) // hurt a little -#define bits_COND_HEAVY_DAMAGE BIT(9) // hurt a lot -#define bits_COND_CAN_RANGE_ATTACK1 BIT(10) -#define bits_COND_CAN_MELEE_ATTACK1 BIT(11) -#define bits_COND_CAN_RANGE_ATTACK2 BIT(12) -#define bits_COND_CAN_MELEE_ATTACK2 BIT(13) -//#define bits_COND_CAN_RANGE_ATTACK3 BIT(14) +#define bits_COND_NO_AMMO_LOADED (1<<0) // weapon needs to be reloaded! +#define bits_COND_SEE_HATE (1<<1) // see something that you hate +#define bits_COND_SEE_FEAR (1<<2) // see something that you are afraid of +#define bits_COND_SEE_DISLIKE (1<<3) // see something that you dislike +#define bits_COND_SEE_ENEMY (1<<4) // target entity is in full view. +#define bits_COND_ENEMY_OCCLUDED (1<<5) // target entity occluded by the world +#define bits_COND_SMELL_FOOD (1<<6) +#define bits_COND_ENEMY_TOOFAR (1<<7) +#define bits_COND_LIGHT_DAMAGE (1<<8) // hurt a little +#define bits_COND_HEAVY_DAMAGE (1<<9) // hurt a lot +#define bits_COND_CAN_RANGE_ATTACK1 (1<<10) +#define bits_COND_CAN_MELEE_ATTACK1 (1<<11) +#define bits_COND_CAN_RANGE_ATTACK2 (1<<12) +#define bits_COND_CAN_MELEE_ATTACK2 (1<<13) +//#define bits_COND_CAN_RANGE_ATTACK3 (1<<14) -#define bits_COND_PROVOKED BIT(15) -#define bits_COND_NEW_ENEMY BIT(16) -#define bits_COND_HEAR_SOUND BIT(17) // there is an interesting sound -#define bits_COND_SMELL BIT(18) // there is an interesting scent -#define bits_COND_ENEMY_FACING_ME BIT(19) // enemy is facing me -#define bits_COND_ENEMY_DEAD BIT(20) // enemy was killed. If you get this in combat, try to find another enemy. If you get it in alert, victory dance. -#define bits_COND_SEE_CLIENT BIT(21) // see a client -#define bits_COND_SEE_NEMESIS BIT(22) // see my nemesis +#define bits_COND_PROVOKED (1<<15) +#define bits_COND_NEW_ENEMY (1<<16) +#define bits_COND_HEAR_SOUND (1<<17) // there is an interesting sound +#define bits_COND_SMELL (1<<18) // there is an interesting scent +#define bits_COND_ENEMY_FACING_ME (1<<19) // enemy is facing me +#define bits_COND_ENEMY_DEAD (1<<20) // enemy was killed. If you get this in combat, try to find another enemy. If you get it in alert, victory dance. +#define bits_COND_SEE_CLIENT (1<<21) // see a client +#define bits_COND_SEE_NEMESIS (1<<22) // see my nemesis -#define bits_COND_SPECIAL1 BIT(28) // Defined by individual monster -#define bits_COND_SPECIAL2 BIT(29) // Defined by individual monster +#define bits_COND_SPECIAL1 (1<<28) // Defined by individual monster +#define bits_COND_SPECIAL2 (1<<29) // Defined by individual monster -#define bits_COND_TASK_FAILED BIT(30) -#define bits_COND_SCHEDULE_DONE BIT(31) +#define bits_COND_TASK_FAILED (1<<30) +#define bits_COND_SCHEDULE_DONE (1<<31) #define bits_COND_ALL_SPECIAL (bits_COND_SPECIAL1 | bits_COND_SPECIAL2) #define bits_COND_CAN_ATTACK (bits_COND_CAN_RANGE_ATTACK1 | bits_COND_CAN_MELEE_ATTACK1 | bits_COND_CAN_RANGE_ATTACK2 | bits_COND_CAN_MELEE_ATTACK2) diff --git a/AccuracyFix/include/cssdk/dlls/skill.h b/AccuracyFix/include/cssdk/dlls/skill.h index 95e2084..822b007 100644 --- a/AccuracyFix/include/cssdk/dlls/skill.h +++ b/AccuracyFix/include/cssdk/dlls/skill.h @@ -25,11 +25,12 @@ * version. * */ + #pragma once -#define SKILL_EASY 1 -#define SKILL_MEDIUM 2 -#define SKILL_HARD 3 +#define SKILL_EASY 1 +#define SKILL_MEDIUM 2 +#define SKILL_HARD 3 struct skilldata_t { diff --git a/AccuracyFix/include/cssdk/dlls/sound.h b/AccuracyFix/include/cssdk/dlls/sound.h index 36c16f1..b0e003d 100644 --- a/AccuracyFix/include/cssdk/dlls/sound.h +++ b/AccuracyFix/include/cssdk/dlls/sound.h @@ -25,36 +25,33 @@ * version. * */ -#pragma once -#define CSENTENCEG_MAX 200 // max number of sentence groups -#define CSENTENCE_LRU_MAX 32 // max number of elements per sentence group -#define CDPVPRESETMAX 27 +#pragma once -// 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 +const int MAX_SENTENCE_NAME = 16; +const int MAX_SENTENCE_VOXFILE = 1536; // max number of sentences in game. NOTE: this must match CVOXFILESENTENCEMAX in engine\sound.h -#define ANNOUNCE_MINUTES_MIN 0.25 -#define ANNOUNCE_MINUTES_MAX 2.25 +const int MAX_SENTENCE_GROUPS = 200; // max number of sentence groups +const int MAX_SENTENCE_LRU = 32; // max number of elements per sentence group +const int MAX_SENTENCE_DPV_RESET = 27; // max number of dynamic pitch volumes -#define SPEAKER_START_SILENT 1 // wait for trigger 'on' to start announcements +const float MAX_ANNOUNCE_MINS = 2.25f; +const float MIN_ANNOUNCE_MINS = 0.25f; -#define LFO_SQUARE 1 // square -#define LFO_TRIANGLE 2 // triangle -#define LFO_RANDOM 3 // random +enum LowFreqOsc : int +{ + LFO_OFF = 0, + LFO_SQUARE, // square + LFO_TRIANGLE, // triangle + LFO_RANDOM, // random +}; // group of related sentences struct sentenceg { char szgroupname[16]; int count; - unsigned char rgblru[ CSENTENCE_LRU_MAX ]; + unsigned char rgblru[MAX_SENTENCE_LRU]; }; // runtime pitch shift and volume fadein/out structure @@ -69,16 +66,16 @@ typedef struct dynpitchvol 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 spinup; // spinup time 0 - 100 int spindown; // spindown time 0 - 100 - int volrun; // volume change % when sound is running 0 - 10 + 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 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 + LowFreqOsc 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. @@ -100,9 +97,15 @@ typedef struct dynpitchvol } dynpitchvol_t; -class CAmbientGeneric: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CAmbientGeneric, CBaseEntity); +#define SF_AMBIENT_SOUND_STATIC 0 // medium radius attenuation +#define SF_AMBIENT_SOUND_EVERYWHERE 0x0001 +#define SF_AMBIENT_SOUND_SMALLRADIUS 0x0002 +#define SF_AMBIENT_SOUND_MEDIUMRADIUS 0x0004 +#define SF_AMBIENT_SOUND_LARGERADIUS 0x0008 +#define SF_AMBIENT_SOUND_START_SILENT 0x0016 +#define SF_AMBIENT_SOUND_NOT_LOOPING 0x0032 + +class CAmbientGeneric: public CBaseEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -114,13 +117,11 @@ class CAmbientGeneric: public CBaseEntity public: 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 + BOOL m_fActive; // only TRUE when the entity is playing a looping sound + BOOL m_fLooping; // TRUE when the sound played will loop }; -class CEnvSound: public CPointEntity -{ - DECLARE_CLASS_TYPES(CEnvSound, CPointEntity); +class CEnvSound: public CPointEntity { public: virtual void Spawn() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; @@ -132,9 +133,9 @@ class CEnvSound: public CPointEntity float m_flRoomtype; }; -class CSpeaker: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CSpeaker, CBaseEntity); +#define SF_SPEAKER_START_SILENT 0x0001 // wait for trigger 'on' to start announcements + +class CSpeaker: public CBaseEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; diff --git a/AccuracyFix/include/cssdk/dlls/spectator.h b/AccuracyFix/include/cssdk/dlls/spectator.h index d42e05a..9d0a07b 100644 --- a/AccuracyFix/include/cssdk/dlls/spectator.h +++ b/AccuracyFix/include/cssdk/dlls/spectator.h @@ -25,6 +25,7 @@ * version. * */ + #pragma once class CBaseSpectator: public CBaseEntity { diff --git a/AccuracyFix/include/cssdk/dlls/subs.h b/AccuracyFix/include/cssdk/dlls/subs.h index 29eb669..8cae347 100644 --- a/AccuracyFix/include/cssdk/dlls/subs.h +++ b/AccuracyFix/include/cssdk/dlls/subs.h @@ -28,16 +28,12 @@ #pragma once -class CNullEntity: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CNullEntity, CBaseEntity); +class CNullEntity: public CBaseEntity { public: virtual void Spawn() = 0; }; -class CBaseDMStart: public CPointEntity -{ - DECLARE_CLASS_TYPES(CBaseDMStart, CPointEntity); +class CBaseDMStart: public CPointEntity { public: virtual void KeyValue(KeyValueData *pkvd) = 0; virtual BOOL IsTriggered(CBaseEntity *pEntity) = 0; diff --git a/AccuracyFix/include/cssdk/dlls/training_gamerules.h b/AccuracyFix/include/cssdk/dlls/training_gamerules.h index d6863c9..d820e18 100644 --- a/AccuracyFix/include/cssdk/dlls/training_gamerules.h +++ b/AccuracyFix/include/cssdk/dlls/training_gamerules.h @@ -25,11 +25,10 @@ * version. * */ + #pragma once -class CHalfLifeTraining: public CHalfLifeMultiplay -{ - DECLARE_CLASS_TYPES(CHalfLifeTraining, CHalfLifeMultiplay); +class CHalfLifeTraining: public CHalfLifeMultiplay { protected: virtual ~CHalfLifeTraining() {}; public: @@ -52,9 +51,14 @@ class CHalfLifeTraining: public CHalfLifeMultiplay bool fVGUIMenus; }; -class CBaseGrenCatch: public CBaseEntity +enum GrenCatchType : int { - DECLARE_CLASS_TYPES(CBaseGrenCatch, CBaseEntity); + GRENADETYPE_NONE = 0, + GRENADETYPE_SMOKE, + GRENADETYPE_FLASH, +}; + +class CBaseGrenCatch: public CBaseEntity { public: virtual void Spawn() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; @@ -64,16 +68,16 @@ class CBaseGrenCatch: public CBaseEntity virtual void Think() = 0; virtual void Touch(CBaseEntity *pOther) = 0; public: - int m_NeedGrenadeType; + GrenCatchType m_NeedGrenadeType; string_t sTriggerOnGrenade; string_t sDisableOnGrenade; bool m_fSmokeTouching; bool m_fFlashTouched; }; -class CFuncWeaponCheck: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CFuncWeaponCheck, CBaseEntity); +const int MAX_ITEM_COUNTS = 32; + +class CFuncWeaponCheck: public CBaseEntity { public: virtual void Spawn() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; @@ -84,7 +88,7 @@ class CFuncWeaponCheck: public CBaseEntity string_t sTriggerWithItems; string_t sTriggerNoItems; string_t sMaster; - unsigned int sItemName[32]; + string_t sItemName[MAX_ITEM_COUNTS]; int iItemCount; int iAnyWeapon; }; diff --git a/AccuracyFix/include/cssdk/dlls/trains.h b/AccuracyFix/include/cssdk/dlls/trains.h index 4c98a3a..18f57ba 100644 --- a/AccuracyFix/include/cssdk/dlls/trains.h +++ b/AccuracyFix/include/cssdk/dlls/trains.h @@ -25,29 +25,16 @@ * version. * */ -#pragma once - -// Tracktrain spawn flags -#define SF_TRACKTRAIN_NOPITCH 0x0001 -#define SF_TRACKTRAIN_NOCONTROL 0x0002 -#define SF_TRACKTRAIN_FORWARDONLY 0x0004 -#define SF_TRACKTRAIN_PASSABLE 0x0008 -// Spawnflag for CPathTrack -#define SF_PATH_DISABLED 0x00000001 -#define SF_PATH_FIREONCE 0x00000002 -#define SF_PATH_ALTREVERSE 0x00000004 -#define SF_PATH_DISABLE_TRAIN 0x00000008 -#define SF_PATH_ALTERNATE 0x00008000 +#pragma once -// Spawnflags of CPathCorner -#define SF_CORNER_WAITFORTRIG 0x001 -#define SF_CORNER_TELEPORT 0x002 -#define SF_CORNER_FIREONCE 0x004 +#define SF_PATH_DISABLED BIT(0) +#define SF_PATH_FIREONCE BIT(1) +#define SF_PATH_ALTREVERSE BIT(2) +#define SF_PATH_DISABLE_TRAIN BIT(3) +#define SF_PATH_ALTERNATE BIT(15) -class CPathTrack: public CPointEntity -{ - DECLARE_CLASS_TYPES(CPathTrack, CPointEntity); +class CPathTrack: public CPointEntity { public: virtual void Spawn() = 0; virtual void KeyValue(KeyValueData* pkvd) = 0; @@ -63,9 +50,16 @@ class CPathTrack: public CPointEntity CPathTrack *m_paltpath; }; -class CFuncTrackTrain: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CFuncTrackTrain, CBaseEntity); +const float TRAIN_STARTPITCH = 60.0f; +const float TRAIN_MAXPITCH = 200.0f; +const float TRAIN_MAXSPEED = 1000.0f; + +#define SF_TRACKTRAIN_NOPITCH BIT(0) +#define SF_TRACKTRAIN_NOCONTROL BIT(1) +#define SF_TRACKTRAIN_FORWARDONLY BIT(2) +#define SF_TRACKTRAIN_PASSABLE BIT(3) + +class CFuncTrackTrain: public CBaseEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -95,14 +89,11 @@ class CFuncTrackTrain: public CBaseEntity float m_fTurnAngle; float m_flSteeringWheelDecay; float m_flAcceleratorDecay; - private: unsigned short m_usAdjustPitch; }; -class CFuncVehicle: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CFuncVehicle, CBaseEntity); +class CFuncVehicle: public CBaseEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -149,7 +140,6 @@ class CFuncVehicle: public CBaseEntity Vector m_vSurfaceNormal; Vector m_vVehicleDirection; CBaseEntity *m_pDriver; - private: unsigned short m_usAdjustPitch; }; diff --git a/AccuracyFix/include/cssdk/dlls/triggers.h b/AccuracyFix/include/cssdk/dlls/triggers.h index e41f757..9a1556d 100644 --- a/AccuracyFix/include/cssdk/dlls/triggers.h +++ b/AccuracyFix/include/cssdk/dlls/triggers.h @@ -25,56 +25,12 @@ * version. * */ -#pragma once - -#define GRENADETYPE_SMOKE 1 -#define GRENADETYPE_FLASH 2 - -#define SPAWNFLAG_NOMESSAGE 1 -#define SPAWNFLAG_NOTOUCH 1 -#define SPAWNFLAG_DROIDONLY 4 - -#define MAX_ITEM_COUNTS 32 -#define MAX_ENTITY 512 // We can only ever move 512 entities across a transition - -// triggers -#define SF_TRIGGER_ALLOWMONSTERS 1 // monsters allowed to fire this trigger -#define SF_TRIGGER_NOCLIENTS 2 // players not allowed to fire this trigger -#define SF_TRIGGER_PUSHABLES 4 // only pushables can fire this trigger -#define SF_TRIGGER_NO_RESET 64 // it is not allowed to be restarted on a new round - -#define SF_TRIGGER_PUSH_ONCE 1 -#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_NO_RESET 0x0002 - -#define SF_RELAY_FIREONCE 0x0001 -#define SF_ENDSECTION_USEONLY 0x0001 - -#define SF_MULTIMAN_CLONE 0x80000000 -#define SF_MULTIMAN_THREAD 0x00000001 +#pragma once -#define SF_CHANGELEVEL_USEONLY 0x0002 -#define SF_CAMERA_PLAYER_POSITION 1 -#define SF_CAMERA_PLAYER_TARGET 2 -#define SF_CAMERA_PLAYER_TAKECONTROL 4 +#include "utlmap.h" -// 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 -{ - DECLARE_CLASS_TYPES(CFrictionModifier, CBaseEntity); +class CFrictionModifier: public CBaseEntity { public: virtual void Spawn() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; @@ -85,11 +41,12 @@ class CFrictionModifier: public CBaseEntity float m_frictionFraction; }; +#define SF_AUTO_FIREONCE BIT(0) +#define SF_AUTO_NORESET BIT(1) + // 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 -class CAutoTrigger: public CBaseDelay -{ - DECLARE_CLASS_TYPES(CAutoTrigger, CBaseDelay); +// It will check a global state before firing. It supports delay and killtargets +class CAutoTrigger: public CBaseDelay { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -101,12 +58,12 @@ class CAutoTrigger: public CBaseDelay virtual void Think() = 0; public: int m_globalstate; - USE_TYPE triggerType; + USE_TYPE m_triggerType; }; -class CTriggerRelay: public CBaseDelay -{ - DECLARE_CLASS_TYPES(CTriggerRelay, CBaseDelay); +#define SF_RELAY_FIREONCE BIT(0) + +class CTriggerRelay: public CBaseDelay { public: virtual void Spawn() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; @@ -115,16 +72,18 @@ class CTriggerRelay: public CBaseDelay virtual int ObjectCaps() = 0; virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; public: - USE_TYPE triggerType; + USE_TYPE m_triggerType; }; -// The Multimanager Entity - when fired, will fire up to 16 targets -// at specified times. +const int MAX_MM_TARGETS = 16; // maximum number of targets a single multi_manager entity may be assigned. + +#define SF_MULTIMAN_THREAD BIT(0) +#define SF_MULTIMAN_CLONE BIT(31) + +// This entity when fire, 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) -class CMultiManager: public CBaseToggle -{ - DECLARE_CLASS_TYPES(CMultiManager, CBaseToggle); +class CMultiManager: public CBaseToggle { public: virtual void Spawn() = 0; virtual void Restart() = 0; @@ -137,54 +96,71 @@ class CMultiManager: public CBaseToggle int m_cTargets; int m_index; float m_startTime; - int m_iTargetName[MAX_MULTI_TARGETS]; - float m_flTargetDelay[MAX_MULTI_TARGETS]; + int m_iTargetName[MAX_MM_TARGETS]; + float m_flTargetDelay[MAX_MM_TARGETS]; }; +// Flags to indicate masking off various render parameters that are normally copied to the targets +#define SF_RENDER_MASKFX BIT(0) +#define SF_RENDER_MASKAMT BIT(1) +#define SF_RENDER_MASKMODE BIT(2) +#define SF_RENDER_MASKCOLOR BIT(3) + // Render parameters trigger -// // This entity will copy its render parameters (renderfx, rendermode, rendercolor, renderamt) // to its targets when triggered. -class CRenderFxManager: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CRenderFxManager, CBaseEntity); +class CRenderFxManager: public CBaseEntity { public: virtual void Spawn() = 0; + virtual void Restart() = 0; + virtual void UpdateOnRemove() = 0; virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; +public: + struct RenderGroup_t + { + int rendermode; + float renderamt; + Vector rendercolor; + int renderfx; + }; + CUtlMap m_RenderGroups; }; -class CBaseTrigger: public CBaseToggle -{ - DECLARE_CLASS_TYPES(CBaseTrigger, CBaseToggle); +#define SF_TRIGGER_ALLOWMONSTERS BIT(0) // monsters allowed to fire this trigger +#define SF_TRIGGER_NOCLIENTS BIT(1) // players not allowed to fire this trigger +#define SF_TRIGGER_PUSHABLES BIT(2) // only pushables can fire this trigger +#define SF_TRIGGER_NORESET BIT(6) // it is not allowed to be resetting on a new round + +class CBaseTrigger: public CBaseToggle { public: virtual void KeyValue(KeyValueData *pkvd) = 0; virtual int ObjectCaps() = 0; }; -// 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' -class CTriggerHurt: public CBaseTrigger -{ - DECLARE_CLASS_TYPES(CTriggerHurt, CBaseTrigger); +#define SF_TRIGGER_HURT_TARGETONCE BIT(0) // Only fire hurt target once +#define SF_TRIGGER_HURT_START_OFF BIT(1) // spawnflag that makes trigger_push spawn turned OFF +#define SF_TRIGGER_HURT_NO_CLIENTS BIT(3) // spawnflag that makes trigger_push spawn turned OFF +#define SF_TRIGGER_HURT_CLIENTONLYFIRE BIT(4) // trigger hurt will only fire its target if it is hurting a client +#define SF_TRIGGER_HURT_CLIENTONLYTOUCH BIT(5) // only clients may touch this trigger. + +// Hurts anything that touches it. +// If the trigger has a targetname, firing it will toggle state +class CTriggerHurt: public CBaseTrigger { public: virtual void Spawn() = 0; virtual void Restart() = 0; virtual int ObjectCaps() = 0; }; -class CTriggerMonsterJump: public CBaseTrigger -{ - DECLARE_CLASS_TYPES(CTriggerMonsterJump, CBaseTrigger); +class CTriggerMonsterJump: public CBaseTrigger { public: virtual void Spawn() = 0; virtual void Think() = 0; virtual void Touch(CBaseEntity *pOther) = 0; }; -// trigger_cdaudio - starts/stops cd audio tracks -class CTriggerCDAudio: public CBaseTrigger -{ - DECLARE_CLASS_TYPES(CTriggerCDAudio, CBaseTrigger); +// Starts/stops cd audio tracks +class CTriggerCDAudio: public CBaseTrigger { public: virtual void Spawn() = 0; virtual void Touch(CBaseEntity *pOther) = 0; @@ -192,9 +168,7 @@ class CTriggerCDAudio: public CBaseTrigger }; // This plays a CD track when fired or when the player enters it's radius -class CTargetCDAudio: public CPointEntity -{ - DECLARE_CLASS_TYPES(CTargetCDAudio, CPointEntity); +class CTargetCDAudio: public CPointEntity { public: virtual void Spawn() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; @@ -202,7 +176,6 @@ class CTargetCDAudio: public CPointEntity virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; }; -// 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. @@ -216,56 +189,44 @@ class CTargetCDAudio: public CPointEntity // 4) // NEW // if a trigger has a NETNAME, that NETNAME will become the TARGET of the triggered object. -class CTriggerMultiple: public CBaseTrigger -{ - DECLARE_CLASS_TYPES(CTriggerMultiple, CBaseTrigger); +class CTriggerMultiple: public CBaseTrigger { public: virtual void Spawn() = 0; }; -// 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. +// 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. +// 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) -class CTriggerOnce: public CTriggerMultiple -{ - DECLARE_CLASS_TYPES(CTriggerOnce, CTriggerMultiple); +class CTriggerOnce: public CTriggerMultiple { public: virtual void Spawn() = 0; virtual void Restart() = 0; }; -// 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" +// "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. -class CTriggerCounter: public CBaseTrigger -{ - DECLARE_CLASS_TYPES(CTriggerCounter, CBaseTrigger); +class CTriggerCounter: public CBaseTrigger { public: virtual void Spawn() = 0; }; // Derive from point entity so this doesn't move across levels -class CTriggerVolume: public CPointEntity -{ - DECLARE_CLASS_TYPES(CTriggerVolume, CPointEntity); +class CTriggerVolume: public CPointEntity { public: virtual void Spawn() = 0; }; // Fires a target after level transition and then dies -class CFireAndDie: public CBaseDelay -{ - DECLARE_CLASS_TYPES(CFireAndDie, CBaseDelay); +class CFireAndDie: public CBaseDelay { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -273,111 +234,91 @@ class CFireAndDie: public CBaseDelay virtual void Think() = 0; }; -// 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. -class CChangeLevel: public CBaseTrigger -{ - DECLARE_CLASS_TYPES(CChangeLevel, CBaseTrigger); +#define SF_CHANGELEVEL_USEONLY BIT(1) + +// 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. +class CChangeLevel: public CBaseTrigger { public: virtual void Spawn() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; virtual int Save(CSave &save) = 0; virtual int Restore(CRestore &restore) = 0; public: - char m_szMapName[cchMapNameMost]; // trigger_changelevel only: next map - char m_szLandmarkName[cchMapNameMost]; // trigger_changelevel only: landmark on next map + char m_szMapName[MAX_MAPNAME_LENGHT]; // next map + char m_szLandmarkName[MAX_MAPNAME_LENGHT]; // landmark on next map int m_changeTarget; float m_changeTargetDelay; }; -class CLadder: public CBaseTrigger -{ - DECLARE_CLASS_TYPES(CLadder, CBaseTrigger); +class CLadder: public CBaseTrigger { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; }; -class CTriggerPush: public CBaseTrigger -{ - DECLARE_CLASS_TYPES(CTriggerPush, CBaseTrigger); +#define SF_TRIGGER_PUSH_ONCE BIT(0) +#define SF_TRIGGER_PUSH_START_OFF BIT(1) // spawnflag that makes trigger_push spawn turned OFF + +class CTriggerPush: public CBaseTrigger { public: virtual void Spawn() = 0; virtual void Restart() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; - virtual int ObjectCaps() = 0; virtual void Touch(CBaseEntity *pOther) = 0; }; -class CTriggerTeleport: public CBaseTrigger -{ - DECLARE_CLASS_TYPES(CTriggerTeleport, CBaseTrigger); +class CTriggerTeleport: public CBaseTrigger { public: virtual void Spawn() = 0; }; -class CBuyZone: public CBaseTrigger -{ - DECLARE_CLASS_TYPES(CBuyZone, CBaseTrigger); +class CBuyZone: public CBaseTrigger { public: virtual void Spawn() = 0; }; -class CBombTarget: public CBaseTrigger -{ - DECLARE_CLASS_TYPES(CBombTarget, CBaseTrigger); +class CBombTarget: public CBaseTrigger { public: virtual void Spawn() = 0; }; -class CHostageRescue: public CBaseTrigger -{ - DECLARE_CLASS_TYPES(CHostageRescue, CBaseTrigger); +class CHostageRescue: public CBaseTrigger { public: virtual void Spawn() = 0; }; -class CEscapeZone: public CBaseTrigger -{ - DECLARE_CLASS_TYPES(CEscapeZone, CBaseTrigger); +class CEscapeZone: public CBaseTrigger { public: virtual void Spawn() = 0; }; -class CVIP_SafetyZone: public CBaseTrigger -{ - DECLARE_CLASS_TYPES(CVIP_SafetyZone, CBaseTrigger); +class CVIP_SafetyZone: public CBaseTrigger { public: virtual void Spawn() = 0; }; -class CTriggerSave: public CBaseTrigger -{ - DECLARE_CLASS_TYPES(CTriggerSave, CBaseTrigger); +class CTriggerSave: public CBaseTrigger { public: virtual void Spawn() = 0; }; -class CTriggerEndSection: public CBaseTrigger -{ - DECLARE_CLASS_TYPES(CTriggerEndSection, CBaseTrigger); +#define SF_ENDSECTION_USEONLY BIT(0) + +class CTriggerEndSection: public CBaseTrigger { public: virtual void Spawn() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; }; -class CTriggerGravity: public CBaseTrigger -{ - DECLARE_CLASS_TYPES(CTriggerGravity, CBaseTrigger); +class CTriggerGravity: public CBaseTrigger { public: virtual void Spawn() = 0; }; // this is a really bad idea. -class CTriggerChangeTarget: public CBaseDelay -{ - DECLARE_CLASS_TYPES(CTriggerChangeTarget, CBaseDelay); +class CTriggerChangeTarget: public CBaseDelay { public: virtual void Spawn() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; @@ -389,9 +330,11 @@ class CTriggerChangeTarget: public CBaseDelay int m_iszNewTarget; }; -class CTriggerCamera: public CBaseDelay -{ - DECLARE_CLASS_TYPES(CTriggerCamera, CBaseDelay); +#define SF_CAMERA_PLAYER_POSITION BIT(0) +#define SF_CAMERA_PLAYER_TARGET BIT(1) +#define SF_CAMERA_PLAYER_TAKECONTROL BIT(2) + +class CTriggerCamera: public CBaseDelay { public: virtual void Spawn() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; @@ -415,16 +358,12 @@ class CTriggerCamera: public CBaseDelay int m_state; }; -class CWeather: public CBaseTrigger -{ - DECLARE_CLASS_TYPES(CWeather, CBaseTrigger); +class CWeather: public CBaseTrigger { public: virtual void Spawn() = 0; }; -class CClientFog: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CClientFog, CBaseEntity); +class CClientFog: public CBaseEntity { public: virtual void Spawn() = 0; virtual void KeyValue(KeyValueData *pkvd) = 0; diff --git a/AccuracyFix/include/cssdk/dlls/unisignals.h b/AccuracyFix/include/cssdk/dlls/unisignals.h index 054bdc5..f96be69 100644 --- a/AccuracyFix/include/cssdk/dlls/unisignals.h +++ b/AccuracyFix/include/cssdk/dlls/unisignals.h @@ -26,11 +26,13 @@ * */ -#ifndef UNISIGNALS_H -#define UNISIGNALS_H -#ifdef _WIN32 #pragma once -#endif + +#define SIGNAL_BUY BIT(0) +#define SIGNAL_BOMB BIT(1) +#define SIGNAL_RESCUE BIT(2) +#define SIGNAL_ESCAPE BIT(3) +#define SIGNAL_VIPSAFETY BIT(4) class CUnifiedSignals { @@ -49,9 +51,8 @@ class CUnifiedSignals void Signal(int flags) { m_flSignal |= flags; } int GetSignal() const { return m_flSignal; } int GetState() const { return m_flState; } -public: + +private: int m_flSignal; int m_flState; }; - -#endif // UNISIGNALS_H diff --git a/AccuracyFix/include/cssdk/dlls/util.h b/AccuracyFix/include/cssdk/dlls/util.h index 7874cfb..b01374e 100644 --- a/AccuracyFix/include/cssdk/dlls/util.h +++ b/AccuracyFix/include/cssdk/dlls/util.h @@ -25,34 +25,36 @@ * version. * */ + #pragma once +#include "shake.h" +#include "ehandle.h" +#include "activity.h" #include "enginecallback.h" -#define eoNullEntity 0 // Testing the three types of "entity" for nullity -#define iStringNull (string_t)0 // Testing strings for nullity - -#define cchMapNameMost 32 +extern globalvars_t *gpGlobals; -#define CBSENTENCENAME_MAX 16 -#define CVOXFILESENTENCEMAX 1536 // max number of sentences in game. NOTE: this must match CVOXFILESENTENCEMAX in engine\sound.h +#define STRING(offset) ((const char *)(gpGlobals->pStringBase + (unsigned int)(offset))) +#define MAKE_STRING(str) ((uint64)(str) - (uint64)(STRING(0))) -#define GROUP_OP_AND 0 -#define GROUP_OP_NAND 1 +#define GROUP_OP_AND 0 +#define GROUP_OP_NAND 1 // Dot products for view cone checking -#define VIEW_FIELD_FULL -1.0 // +-180 degrees -#define VIEW_FIELD_WIDE -0.7 // +-135 degrees 0.1 // +-85 degrees, used for full FOV checks -#define VIEW_FIELD_NARROW 0.7 // +-45 degrees, more narrow check used to set up ranged attacks +#define VIEW_FIELD_FULL -1.0 // +-180 degrees +#define VIEW_FIELD_WIDE -0.7 // +-135 degrees 0.1 // +-85 degrees, used for full FOV checks +#define VIEW_FIELD_NARROW 0.7 // +-45 degrees, more narrow check used to set up ranged attacks #define VIEW_FIELD_ULTRA_NARROW 0.9 // +-25 degrees, more narrow check used to set up ranged attacks -#define SND_SPAWNING (1<<8) // duplicated in protocol.h we're spawing, used in some cases for ambients -#define SND_STOP (1<<5) // duplicated in protocol.h stop sound -#define SND_CHANGE_VOL (1<<6) // duplicated in protocol.h change sound vol -#define SND_CHANGE_PITCH (1<<7) // duplicated in protocol.h change sound pitch +#define SND_STOP BIT(5) // duplicated in protocol.h stop sound +#define SND_CHANGE_VOL BIT(6) // duplicated in protocol.h change sound vol +#define SND_CHANGE_PITCH BIT(7) // duplicated in protocol.h change sound pitch +#define SND_SPAWNING BIT(8) // duplicated in protocol.h we're spawing, used in some cases for ambients // All monsters need this data -#define DONT_BLEED -1 +#define DONT_BLEED -1 +#define BLOOD_COLOR_DARKRED (byte)223 #define BLOOD_COLOR_RED (byte)247 #define BLOOD_COLOR_YELLOW (byte)195 #define BLOOD_COLOR_GREEN BLOOD_COLOR_YELLOW @@ -68,7 +70,7 @@ #define SVC_TEMPENTITY 23 #define SVC_INTERMISSION 30 -#define SVC_CDTRACK 32 +#define SVC_CDTRACK 32 #define SVC_WEAPONANIM 35 #define SVC_ROOMTYPE 37 #define SVC_DIRECTOR 51 @@ -79,7 +81,7 @@ #define VEC_HULL_MIN Vector(-16, -16, -36) #define VEC_HULL_MAX Vector(16, 16, 36) -#define VEC_VIEW Vector(0, 0, 17) +#define VEC_VIEW Vector(0, 0, 17) #define VEC_DUCK_HULL_MIN Vector(-16, -16, -18) #define VEC_DUCK_HULL_MAX Vector(16, 16, 32) @@ -88,6 +90,22 @@ #define PRECACHE_SOUND_ARRAY(a) \ { for (int i = 0; i < ARRAYSIZE(a); ++i) PRECACHE_SOUND((char *)a[i]); } +#define PLAYBACK_EVENT(flags, who, index)\ + PLAYBACK_EVENT_FULL(flags, who, index, 0, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, 0, 0, 0, 0) + +#define PLAYBACK_EVENT_DELAY(flags, who, index, delay)\ + PLAYBACK_EVENT_FULL(flags, who, index, delay, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, 0, 0, 0, 0) + +#define LINK_ENTITY_TO_CLASS(mapClassName, DLLClassName)\ + C_DLLEXPORT void EXT_FUNC mapClassName(entvars_t *pev);\ + void mapClassName(entvars_t *pev)\ + {\ + GetClassPtr((DLLClassName *)pev);\ + } + +const EOFFSET eoNullEntity = (EOFFSET)0; // Testing the three types of "entity" for nullity +const string_t iStringNull = (string_t)0; // Testing strings for nullity + // Inlines inline edict_t *FIND_ENTITY_BY_CLASSNAME(edict_t *entStart, const char *pszName) { return FIND_ENTITY_BY_STRING(entStart, "classname", pszName); } inline edict_t *FIND_ENTITY_BY_TARGETNAME(edict_t *entStart, const char *pszName) { return FIND_ENTITY_BY_STRING(entStart, "targetname", pszName); } @@ -122,8 +140,8 @@ inline edict_t *INDEXENT(int iEdictNum) { return (*g_engfuncs.pfnPEntityOfEntInd inline void MESSAGE_BEGIN(int msg_dest, int msg_type, const float *pOrigin, entvars_t *ent) { MESSAGE_BEGIN(msg_dest, msg_type, pOrigin, ENT(ent)); } inline BOOL FNullEnt(EOFFSET eoffset) { return (eoffset == 0); } inline BOOL FNullEnt(entvars_t *pev) { return (pev == NULL || FNullEnt(OFFSET(pev))); } -inline BOOL FNullEnt(const edict_t *pent) { return (pent == NULL || FNullEnt(OFFSET(pent))); } -inline BOOL FStringNull(int iString) { return ((string_t)iString == iStringNull); } +inline BOOL FNullEnt(const edict_t *pent) { return (pent == NULL || pent->free || FNullEnt(OFFSET(pent))); } +inline BOOL FNullEnt(EHANDLE hent) { return (hent == NULL || FNullEnt(OFFSET(hent.Get()))); } inline BOOL FStringNull(string_t iString) { return (iString == iStringNull); } inline BOOL FStrEq(const char *sz1, const char *sz2) { return (strcmp(sz1, sz2) == 0); } inline BOOL FClassnameIs(entvars_t *pev, const char *szClassname) { return FStrEq(STRING(pev->classname), szClassname); } diff --git a/AccuracyFix/include/cssdk/dlls/vector.h b/AccuracyFix/include/cssdk/dlls/vector.h index 6427e1e..f86a275 100644 --- a/AccuracyFix/include/cssdk/dlls/vector.h +++ b/AccuracyFix/include/cssdk/dlls/vector.h @@ -25,21 +25,36 @@ * version. * */ + #pragma once // 2DVector - used for many pathfinding and many other // operations that are treated as planar rather than 3d. class Vector2D { public: + // Construction/destruction inline Vector2D() : x(), y() {} inline Vector2D(float X, float Y) : x(X), y(Y) {} - inline Vector2D(const Vector2D &v) { *(int*)&x = *(int*)&v.x; *(int*)&y = *(int*)&v.y; } - inline Vector2D operator+(const Vector2D &v) const { return Vector2D(x + v.x, y + v.y); } - inline Vector2D operator-(const Vector2D &v) const { return Vector2D(x - v.x, y - v.y); } - inline Vector2D operator*(float fl) const { return Vector2D(x * fl, y * fl); } - inline Vector2D operator/(float fl) const { return Vector2D(x / fl, y / fl); } + inline Vector2D(const Vector2D &v) { *(int *)&x = *(int *)&v.x; *(int *)&y = *(int *)&v.y; } + + // Operators + inline bool operator==(const Vector2D &v) const { return x == v.x && y == v.y; } + inline bool operator!=(const Vector2D &v) const { return !(*this == v); } + + inline Vector2D operator*(float fl) const { return Vector2D(x * fl, y * fl); } + inline Vector2D operator/(float fl) const { return Vector2D(x / fl, y / fl); } inline Vector2D operator/=(float fl) const { return Vector2D(x / fl, y / fl); } + inline Vector2D operator+(const Vector2D &v) const { return Vector2D(x + v.x, y + v.y); } + inline Vector2D operator-(const Vector2D &v) const { return Vector2D(x - v.x, y - v.y); } + inline Vector2D operator*(const Vector2D &v) const { return Vector2D(x * v.x, y * v.y); } + inline Vector2D operator/(const Vector2D &v) const { return Vector2D(x / v.x, y / v.y); } + + inline Vector2D operator+=(const Vector2D &v) const { return Vector2D(x + v.x, y + v.y); } + inline Vector2D operator-=(const Vector2D &v) const { return Vector2D(x - v.x, y - v.y); } + inline Vector2D operator*=(const Vector2D &v) const { return Vector2D(x * v.x, y * v.y); } + inline Vector2D operator/=(const Vector2D &v) const { return Vector2D(x / v.x, y / v.y); } + inline float Length() const { return sqrt(x * x + y * y); } inline float LengthSquared() const { return (x * x + y * y); } @@ -56,7 +71,7 @@ class Vector2D { return Vector2D(x * flLen, y * flLen); } - inline bool IsLengthLessThan(float length) const { return (LengthSquared() < length * length); } + inline bool IsLengthLessThan (float length) const { return (LengthSquared() < length * length); } inline bool IsLengthGreaterThan(float length) const { return (LengthSquared() > length * length); } inline float NormalizeInPlace() { @@ -93,26 +108,35 @@ class Vector { // Construction/destruction inline Vector() : x(), y(), z() {} inline Vector(float X, float Y, float Z) : x(X), y(Y), z(Z) {} - inline Vector(const Vector &v) { *(int*)&x = *(int*)&v.x; *(int*)&y = *(int*)&v.y; *(int*)&z = *(int*)&v.z; } - inline Vector(const float rgfl[3]) { *(int*)&x = *(int*)&rgfl[0]; *(int*)&y = *(int*)&rgfl[1]; *(int*)&z = *(int*)&rgfl[2]; } + inline Vector(const Vector &v) { *(int *)&x = *(int *)&v.x; *(int *)&y = *(int *)&v.y; *(int *)&z = *(int *)&v.z; } + inline Vector(const float rgfl[3]) { *(int *)&x = *(int *)&rgfl[0]; *(int *)&y = *(int *)&rgfl[1]; *(int *)&z = *(int *)&rgfl[2]; } // Operators inline Vector operator-() const { return Vector(-x, -y, -z); } - inline int operator==(const Vector &v) const { return x == v.x && y == v.y && z == v.z; } - inline int operator!=(const Vector &v) const { return !(*this == v); } - inline Vector operator+(const Vector &v) const { return Vector(x + v.x, y + v.y, z + v.z); } - inline Vector operator-(const Vector &v) const { return Vector(x - v.x, y - v.y, z - v.z); } - inline Vector operator*(float fl) const { return Vector(x * fl, y * fl, z * fl); } - inline Vector operator/(float fl) const { return Vector(x / fl, y / fl, z / fl); } - inline Vector operator/=(float fl) const{ return Vector(x / fl, y / fl, z / fl); } + inline Vector operator*(float fl) const { return Vector(x * fl, y * fl, z * fl); } + inline Vector operator/(float fl) const { return Vector(x / fl, y / fl, z / fl); } + inline Vector operator/=(float fl) const { return Vector(x / fl, y / fl, z / fl); } + + inline bool operator==(const Vector &v) const { return x == v.x && y == v.y && z == v.z; } + inline bool operator!=(const Vector &v) const { return !(*this == v); } + + inline Vector operator+(const Vector &v) const { return Vector(x + v.x, y + v.y, z + v.z); } + inline Vector operator-(const Vector &v) const { return Vector(x - v.x, y - v.y, z - v.z); } + inline Vector operator*(const Vector &v) const { return Vector(x * v.x, y * v.y, z * v.z); } + inline Vector operator/(const Vector &v) const { return Vector(x / v.x, y / v.y, z / v.z); } + + inline Vector operator+=(const Vector &v) const { return Vector(x + v.x, y + v.y, z + v.z); } + inline Vector operator-=(const Vector &v) const { return Vector(x - v.x, y - v.y, z - v.z); } + inline Vector operator*=(const Vector &v) const { return Vector(x * v.x, y * v.y, z * v.z); } + inline Vector operator/=(const Vector &v) const { return Vector(x / v.x, y / v.y, z / v.z); } // Methods - inline void CopyToArray(float *rgfl) const { *(int*)&rgfl[0] = *(int*)&x; *(int*)&rgfl[1] = *(int*)&y; *(int*)&rgfl[2] = *(int*)&z; } + inline void CopyToArray(float *rgfl) const { *(int *)&rgfl[0] = *(int *)&x; *(int *)&rgfl[1] = *(int *)&y; *(int *)&rgfl[2] = *(int *)&z; } inline float Length() const { return sqrt(x * x + y * y + z * z); } inline float LengthSquared() const { return (x * x + y * y + z * z); } - operator float*() { return &x; } // Vectors will now automatically convert to float * when needed - operator const float*() const { return &x; } // Vectors will now automatically convert to float * when needed + operator float*() { return &x; } // Vectors will now automatically convert to float * when needed + operator const float*() const { return &x; } // Vectors will now automatically convert to float * when needed inline Vector Normalize() { @@ -126,14 +150,14 @@ class Vector { inline Vector2D Make2D() const { Vector2D Vec2; - *(int*)&Vec2.x = *(int*)&x; - *(int*)&Vec2.y = *(int*)&y; + *(int *)&Vec2.x = *(int *)&x; + *(int *)&Vec2.y = *(int *)&y; return Vec2; } inline float Length2D() const { return sqrt(x * x + y * y); } - inline bool IsLengthLessThan(float length) const { return (LengthSquared() < length * length); } + inline bool IsLengthLessThan (float length) const { return (LengthSquared() < length * length); } inline bool IsLengthGreaterThan(float length) const { return (LengthSquared() > length * length); } inline float NormalizeInPlace() @@ -166,11 +190,3 @@ inline Vector operator*(float fl, const Vector &v) { return v * fl; } inline float DotProduct(const Vector &a, const Vector &b) { return (a.x * b.x + a.y * b.y + a.z * b.z); } inline float DotProduct2D(const Vector &a, const Vector &b) { return (a.x * b.x + a.y * b.y); } inline Vector CrossProduct(const Vector &a, const Vector &b) { return Vector(a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x); } - -template -inline void SWAP(T &first, T &second) -{ - T temp = first; - first = second; - second = temp; -} diff --git a/AccuracyFix/include/cssdk/dlls/vehicle.h b/AccuracyFix/include/cssdk/dlls/vehicle.h index 14a0018..1e8e3b4 100644 --- a/AccuracyFix/include/cssdk/dlls/vehicle.h +++ b/AccuracyFix/include/cssdk/dlls/vehicle.h @@ -25,30 +25,29 @@ * version. * */ + #pragma once -#define VEHICLE_SPEED0_ACCELERATION 0.005000000000000000 -#define VEHICLE_SPEED1_ACCELERATION 0.002142857142857143 -#define VEHICLE_SPEED2_ACCELERATION 0.003333333333333334 -#define VEHICLE_SPEED3_ACCELERATION 0.004166666666666667 -#define VEHICLE_SPEED4_ACCELERATION 0.004000000000000000 -#define VEHICLE_SPEED5_ACCELERATION 0.003800000000000000 -#define VEHICLE_SPEED6_ACCELERATION 0.004500000000000000 -#define VEHICLE_SPEED7_ACCELERATION 0.004250000000000000 -#define VEHICLE_SPEED8_ACCELERATION 0.002666666666666667 -#define VEHICLE_SPEED9_ACCELERATION 0.002285714285714286 -#define VEHICLE_SPEED10_ACCELERATION 0.001875000000000000 -#define VEHICLE_SPEED11_ACCELERATION 0.001444444444444444 -#define VEHICLE_SPEED12_ACCELERATION 0.001200000000000000 -#define VEHICLE_SPEED13_ACCELERATION 0.000916666666666666 +#define VEHICLE_SPEED0_ACCELERATION 0.005000000000000000 +#define VEHICLE_SPEED1_ACCELERATION 0.002142857142857143 +#define VEHICLE_SPEED2_ACCELERATION 0.003333333333333334 +#define VEHICLE_SPEED3_ACCELERATION 0.004166666666666667 +#define VEHICLE_SPEED4_ACCELERATION 0.004000000000000000 +#define VEHICLE_SPEED5_ACCELERATION 0.003800000000000000 +#define VEHICLE_SPEED6_ACCELERATION 0.004500000000000000 +#define VEHICLE_SPEED7_ACCELERATION 0.004250000000000000 +#define VEHICLE_SPEED8_ACCELERATION 0.002666666666666667 +#define VEHICLE_SPEED9_ACCELERATION 0.002285714285714286 +#define VEHICLE_SPEED10_ACCELERATION 0.001875000000000000 +#define VEHICLE_SPEED11_ACCELERATION 0.001444444444444444 +#define VEHICLE_SPEED12_ACCELERATION 0.001200000000000000 +#define VEHICLE_SPEED13_ACCELERATION 0.000916666666666666 -#define VEHICLE_STARTPITCH 60 -#define VEHICLE_MAXPITCH 200 -#define VEHICLE_MAXSPEED 1500 +#define VEHICLE_STARTPITCH 60 +#define VEHICLE_MAXPITCH 200 +#define VEHICLE_MAXSPEED 1500 -class CFuncVehicleControls: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CFuncVehicleControls, CBaseEntity); +class CFuncVehicleControls: public CBaseEntity { public: virtual void Spawn() = 0; virtual int ObjectCaps() = 0; diff --git a/AccuracyFix/include/cssdk/dlls/weapons.h b/AccuracyFix/include/cssdk/dlls/weapons.h index 14f6df4..5decb54 100644 --- a/AccuracyFix/include/cssdk/dlls/weapons.h +++ b/AccuracyFix/include/cssdk/dlls/weapons.h @@ -30,44 +30,45 @@ class CBasePlayer; -#define MAX_WEAPONS 32 -#define MAX_NORMAL_BATTERY 100.0f -#define DISTANCE_RELOAD_SOUND 512.0f +const float MAX_NORMAL_BATTERY = 100.0f; +const float MAX_DIST_RELOAD_SOUND = 512.0f; -#define ITEM_FLAG_SELECTONEMPTY 1 -#define ITEM_FLAG_NOAUTORELOAD 2 -#define ITEM_FLAG_NOAUTOSWITCHEMPTY 4 -#define ITEM_FLAG_LIMITINWORLD 8 -#define ITEM_FLAG_EXHAUSTIBLE 16 // A player can totally exhaust their ammo supply and lose this weapon +#define MAX_WEAPONS 32 -#define WEAPON_IS_ONTARGET 0x40 +#define ITEM_FLAG_SELECTONEMPTY 1 +#define ITEM_FLAG_NOAUTORELOAD 2 +#define ITEM_FLAG_NOAUTOSWITCHEMPTY 4 +#define ITEM_FLAG_LIMITINWORLD 8 +#define ITEM_FLAG_EXHAUSTIBLE 16 // A player can totally exhaust their ammo supply and lose this weapon + +#define WEAPON_IS_ONTARGET 0x40 // the maximum amount of ammo each weapon's clip can hold -#define WEAPON_NOCLIP -1 +#define WEAPON_NOCLIP -1 -#define LOUD_GUN_VOLUME 1000 -#define NORMAL_GUN_VOLUME 600 -#define QUIET_GUN_VOLUME 200 +#define LOUD_GUN_VOLUME 1000 +#define NORMAL_GUN_VOLUME 600 +#define QUIET_GUN_VOLUME 200 -#define BRIGHT_GUN_FLASH 512 -#define NORMAL_GUN_FLASH 256 -#define DIM_GUN_FLASH 128 +#define BRIGHT_GUN_FLASH 512 +#define NORMAL_GUN_FLASH 256 +#define DIM_GUN_FLASH 128 -#define BIG_EXPLOSION_VOLUME 2048 -#define NORMAL_EXPLOSION_VOLUME 1024 -#define SMALL_EXPLOSION_VOLUME 512 +#define BIG_EXPLOSION_VOLUME 2048 +#define NORMAL_EXPLOSION_VOLUME 1024 +#define SMALL_EXPLOSION_VOLUME 512 -#define WEAPON_ACTIVITY_VOLUME 64 +#define WEAPON_ACTIVITY_VOLUME 64 // spawn flags -#define SF_DETONATE 0x0001 // Grenades flagged with this will be triggered when the owner calls detonateSatchelCharges +#define SF_DETONATE BIT(0) // Grenades flagged with this will be triggered when the owner calls detonateSatchelCharges // custom enum enum ArmorType { - ARMOR_NONE, // no armor - ARMOR_KEVLAR, // body vest only - ARMOR_VESTHELM, // vest and helmet + ARMOR_NONE, // no armor + ARMOR_KEVLAR, // body vest only + ARMOR_VESTHELM, // vest and helmet }; enum ArmouryItemPack @@ -91,17 +92,17 @@ enum ArmouryItemPack ARMOURY_KEVLAR, ARMOURY_ASSAULT, ARMOURY_SMOKEGRENADE, + ARMOURY_SHIELD, + ARMOURY_FAMAS, + ARMOURY_SG550, + ARMOURY_GALIL, + ARMOURY_UMP45, ARMOURY_GLOCK18, ARMOURY_USP, ARMOURY_ELITE, ARMOURY_FIVESEVEN, ARMOURY_P228, ARMOURY_DEAGLE, - ARMOURY_FAMAS, - ARMOURY_SG550, - ARMOURY_GALIL, - ARMOURY_UMP45, - ARMOURY_SHIELD }; struct ItemInfo @@ -135,9 +136,7 @@ struct MULTIDAMAGE #include "weapontype.h" #include "items.h" -class CArmoury: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CArmoury, CBaseEntity); +class CArmoury: public CBaseEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -151,9 +150,7 @@ class CArmoury: public CBaseEntity }; // Smoke Grenade / HE grenade / Flashbang grenade / C4 -class CGrenade: public CBaseMonster -{ - DECLARE_CLASS_TYPES(CGrenade, CBaseMonster); +class CGrenade: public CBaseMonster { public: virtual void Spawn() = 0; virtual int Save(CSave &save) = 0; @@ -166,7 +163,7 @@ class CGrenade: public CBaseMonster public: bool m_bStartDefuse; bool m_bIsC4; - EHANDLE m_pBombDefuser; + EntityHandle m_pBombDefuser; float m_flDefuseCountDown; float m_flC4Blow; float m_flNextFreqInterval; @@ -191,27 +188,24 @@ class CGrenade: public CBaseMonster }; // Items that the player has in their inventory that they can use -class CCSPlayerItem; -class CBasePlayerItem: public CBaseAnimating -{ - DECLARE_CLASS_TYPES(CBasePlayerItem, CBaseAnimating); +class CBasePlayerItem: public CBaseAnimating { public: virtual int Save(CSave &save) = 0; virtual int Restore(CRestore &restore) = 0; virtual void SetObjectCollisionBox() = 0; virtual CBaseEntity *Respawn() = 0; - virtual int AddToPlayer(CBasePlayer *pPlayer) = 0; // return TRUE if the item you want the item added to the player inventory + virtual int AddToPlayer(CBasePlayer *pPlayer) = 0; // return TRUE if the item you want the item added to the player inventory virtual int AddDuplicate(CBasePlayerItem *pItem) = 0; // return TRUE if you want your duplicate removed from world - virtual int GetItemInfo(ItemInfo *p) = 0; // returns 0 if struct not filled out + virtual int GetItemInfo(ItemInfo *p) = 0; // returns 0 if struct not filled out virtual BOOL CanDeploy() = 0; - virtual BOOL CanDrop() = 0; // returns is deploy was successful + virtual BOOL CanDrop() = 0; // returns is deploy was successful virtual BOOL Deploy() = 0; virtual BOOL IsWeapon() = 0; - virtual BOOL CanHolster() = 0; // can this weapon be put away right now? + virtual BOOL CanHolster() = 0; // can this weapon be put away right now? virtual void Holster(int skiplocal = 0) = 0; virtual void UpdateItemInfo() = 0; - virtual void ItemPreFrame() = 0; // called each frame by the player PreThink - virtual void ItemPostFrame() = 0; // called each frame by the player PostThink + virtual void ItemPreFrame() = 0; // called each frame by the player PreThink + virtual void ItemPostFrame() = 0; // called each frame by the player PostThink virtual void Drop() = 0; virtual void Kill() = 0; virtual void AttachToPlayer(CBasePlayer *pPlayer) = 0; @@ -220,13 +214,7 @@ class CBasePlayerItem: public CBaseAnimating virtual int UpdateClientData(CBasePlayer *pPlayer) = 0; virtual CBasePlayerItem *GetWeaponPtr() = 0; virtual float GetMaxSpeed() = 0; - virtual int iItemSlot() = 0; // return 0 to MAX_ITEMS_SLOTS, used in hud - - CCSPlayerItem *CSPlayerItem() const - { - return reinterpret_cast(this->m_pEntity); - } - + virtual int iItemSlot() = 0; // return 0 to MAX_ITEMS_SLOTS, used in hud public: CBasePlayer *m_pPlayer; CBasePlayerItem *m_pNext; @@ -234,10 +222,7 @@ class CBasePlayerItem: public CBaseAnimating }; // inventory items that -class CCSPlayerWeapon; -class CBasePlayerWeapon: public CBasePlayerItem -{ - DECLARE_CLASS_TYPES(CBasePlayerWeapon, CBasePlayerItem); +class CBasePlayerWeapon: public CBasePlayerItem { public: virtual int Save(CSave &save) = 0; virtual int Restore(CRestore &restore) = 0; @@ -268,27 +253,21 @@ class CBasePlayerWeapon: public CBasePlayerItem virtual void RetireWeapon() = 0; virtual BOOL ShouldWeaponIdle() = 0; virtual BOOL UseDecrement() = 0; - - CCSPlayerWeapon *CSPlayerWeapon() const - { - return reinterpret_cast(this->m_pEntity); - } - public: BOOL IsPistol() { return (m_iId == WEAPON_USP || m_iId == WEAPON_GLOCK18 || m_iId == WEAPON_P228 || m_iId == WEAPON_DEAGLE || m_iId == WEAPON_ELITE || m_iId == WEAPON_FIVESEVEN); } int m_iPlayEmptySound; int m_fFireOnEmpty; - float m_flNextPrimaryAttack; // soonest time ItemPostFrame will call PrimaryAttack - float m_flNextSecondaryAttack; // soonest time ItemPostFrame will call SecondaryAttack - float m_flTimeWeaponIdle; // soonest time ItemPostFrame will call WeaponIdle - int m_iPrimaryAmmoType; // "primary" ammo index into players m_rgAmmo[] - int m_iSecondaryAmmoType; // "secondary" ammo index into players m_rgAmmo[] + float m_flNextPrimaryAttack; // soonest time ItemPostFrame will call PrimaryAttack + float m_flNextSecondaryAttack; // soonest time ItemPostFrame will call SecondaryAttack + float m_flTimeWeaponIdle; // soonest time ItemPostFrame will call WeaponIdle + int m_iPrimaryAmmoType; // "primary" ammo index into players m_rgAmmo[] + int m_iSecondaryAmmoType; // "secondary" ammo index into players m_rgAmmo[] int m_iClip; // number of shots left in the primary weapon clip, -1 it not used int m_iClientClip; // the last version of m_iClip sent to hud dll - int m_iClientWeaponState; // the last version of the weapon state sent to hud dll (is current weapon, is on target) + int m_iClientWeaponState; // the last version of the weapon state sent to hud dll (is current weapon, is on target) int m_fInReload; // Are we in the middle of a reload; - int m_fInSpecialReload; // Are we in the middle of a reload for the shotguns + int m_fInSpecialReload; // Are we in the middle of a reload for the shotguns int m_iDefaultAmmo; // how much ammo you get when you pick up this weapon as placed by a level designer. int m_iShellId; float m_fMaxSpeed; @@ -300,8 +279,8 @@ class CBasePlayerWeapon: public CBasePlayerItem int m_iShotsFired; Vector m_vVecAiming; string_t model_name; - float m_flGlock18Shoot; // time to shoot the remaining bullets of the glock18 burst fire - int m_iGlock18ShotsFired; // used to keep track of the shots fired during the Glock18 burst fire mode. + float m_flGlock18Shoot; // time to shoot the remaining bullets of the glock18 burst fire + int m_iGlock18ShotsFired; // used to keep track of the shots fired during the Glock18 burst fire mode. float m_flFamasShoot; int m_iFamasShotsFired; float m_fBurstSpread; @@ -316,18 +295,14 @@ class CBasePlayerWeapon: public CBasePlayerItem float m_flLastFireTime; }; -class CBasePlayerAmmo: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CBasePlayerAmmo, CBaseEntity); +class CBasePlayerAmmo: public CBaseEntity { public: virtual void Spawn() = 0; virtual BOOL AddAmmo(CBaseEntity *pOther) = 0; virtual CBaseEntity *Respawn() = 0; }; -class CWeaponBox: public CBaseEntity -{ - DECLARE_CLASS_TYPES(CWeaponBox, CBaseEntity); +class CWeaponBox: public CBaseEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -344,9 +319,47 @@ class CWeaponBox: public CBaseEntity bool m_bIsBomb; }; -class CUSP: public CBasePlayerWeapon + +const float USP_MAX_SPEED = 250.0f; +const float USP_DAMAGE = 34.0f; +const float USP_DAMAGE_SIL = 30.0f; +const float USP_RANGE_MODIFER = 0.79f; +const float USP_RELOAD_TIME = 2.7f; + +enum usp_e +{ + USP_IDLE, + USP_SHOOT1, + USP_SHOOT2, + USP_SHOOT3, + USP_SHOOT_EMPTY, + USP_RELOAD, + USP_DRAW, + USP_ATTACH_SILENCER, + USP_UNSIL_IDLE, + USP_UNSIL_SHOOT1, + USP_UNSIL_SHOOT2, + USP_UNSIL_SHOOT3, + USP_UNSIL_SHOOT_EMPTY, + USP_UNSIL_RELOAD, + USP_UNSIL_DRAW, + USP_DETACH_SILENCER, +}; + +enum usp_shield_e { - DECLARE_CLASS_TYPES(CUSP, CBasePlayerWeapon); + USP_SHIELD_IDLE, + USP_SHIELD_SHOOT1, + USP_SHIELD_SHOOT2, + USP_SHIELD_SHOOT_EMPTY, + USP_SHIELD_RELOAD, + USP_SHIELD_DRAW, + USP_SHIELD_UP_IDLE, + USP_SHIELD_UP, + USP_SHIELD_DOWN, +}; + +class CUSP: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -360,15 +373,31 @@ class CUSP: public CBasePlayerWeapon virtual void WeaponIdle() = 0; virtual BOOL UseDecrement() = 0; virtual BOOL IsPistol() = 0; + public: int m_iShell; - unsigned short m_usFire; - float m_flBaseDamageSil; + unsigned short GetEventID() const { return m_usFireUSP; } +private: + unsigned short m_usFireUSP; }; -class CMP5N: public CBasePlayerWeapon + +const float MP5N_MAX_SPEED = 250.0f; +const float MP5N_DAMAGE = 26.0f; +const float MP5N_RANGE_MODIFER = 0.84f; +const float MP5N_RELOAD_TIME = 2.63f; + +enum mp5n_e { - DECLARE_CLASS_TYPES(CMP5N, CBasePlayerWeapon); + MP5N_IDLE1, + MP5N_RELOAD, + MP5N_DRAW, + MP5N_SHOOT1, + MP5N_SHOOT2, + MP5N_SHOOT3, +}; + +class CMP5N: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -382,13 +411,30 @@ class CMP5N: public CBasePlayerWeapon virtual BOOL UseDecrement() = 0; public: int m_iShell; - int m_iShellOn; - unsigned short m_usFire; + int iShellOn; + unsigned short GetEventID() const { return m_usFireMP5N; } +private: + unsigned short m_usFireMP5N; }; -class CSG552: public CBasePlayerWeapon + +const float SG552_MAX_SPEED = 235.0f; +const float SG552_MAX_SPEED_ZOOM = 200.0f; +const float SG552_DAMAGE = 33.0f; +const float SG552_RANGE_MODIFER = 0.955f; +const float SG552_RELOAD_TIME = 3.0f; + +enum sg552_e { - DECLARE_CLASS_TYPES(CSG552, CBasePlayerWeapon); + SG552_IDLE1, + SG552_RELOAD, + SG552_DRAW, + SG552_SHOOT1, + SG552_SHOOT2, + SG552_SHOOT3, +}; + +class CSG552: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -403,13 +449,29 @@ class CSG552: public CBasePlayerWeapon virtual BOOL UseDecrement() = 0; public: int m_iShell; - int m_iShellOn; - unsigned short m_usFire; + int iShellOn; + unsigned short GetEventID() const { return m_usFireSG552; } +private: + unsigned short m_usFireSG552; }; -class CAK47: public CBasePlayerWeapon + +const float AK47_MAX_SPEED = 221.0f; +const float AK47_DAMAGE = 36.0f; +const float AK47_RANGE_MODIFER = 0.98f; +const float AK47_RELOAD_TIME = 2.45f; + +enum ak47_e { - DECLARE_CLASS_TYPES(CAK47, CBasePlayerWeapon); + AK47_IDLE1, + AK47_RELOAD, + AK47_DRAW, + AK47_SHOOT1, + AK47_SHOOT2, + AK47_SHOOT3, +}; + +class CAK47: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -424,13 +486,29 @@ class CAK47: public CBasePlayerWeapon virtual BOOL UseDecrement() = 0; public: int m_iShell; - int m_iShellOn; - unsigned short m_usFire; + int iShellOn; + unsigned short GetEventID() const { return m_usFireAK47; } +private: + unsigned short m_usFireAK47; }; -class CAUG: public CBasePlayerWeapon + +const float AUG_MAX_SPEED = 240.0f; +const float AUG_DAMAGE = 32.0f; +const float AUG_RANGE_MODIFER = 0.96f; +const float AUG_RELOAD_TIME = 3.3f; + +enum aug_e { - DECLARE_CLASS_TYPES(CAUG, CBasePlayerWeapon); + AUG_IDLE1, + AUG_RELOAD, + AUG_DRAW, + AUG_SHOOT1, + AUG_SHOOT2, + AUG_SHOOT3, +}; + +class CAUG: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -445,13 +523,30 @@ class CAUG: public CBasePlayerWeapon virtual BOOL UseDecrement() = 0; public: int m_iShell; - int m_iShellOn; - unsigned short m_usFire; + int iShellOn; + unsigned short GetEventID() const { return m_usFireAug; } +private: + unsigned short m_usFireAug; }; -class CAWP: public CBasePlayerWeapon + +const float AWP_MAX_SPEED = 210.0f; +const float AWP_MAX_SPEED_ZOOM = 150.0f; +const float AWP_DAMAGE = 115.0f; +const float AWP_RANGE_MODIFER = 0.99f; +const float AWP_RELOAD_TIME = 2.5f; + +enum awp_e { - DECLARE_CLASS_TYPES(CAWP, CBasePlayerWeapon); + AWP_IDLE, + AWP_SHOOT, + AWP_SHOOT2, + AWP_SHOOT3, + AWP_RELOAD, + AWP_DRAW, +}; + +class CAWP: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -466,16 +561,29 @@ class CAWP: public CBasePlayerWeapon virtual BOOL UseDecrement() = 0; public: int m_iShell; - unsigned short m_usFire; + unsigned short GetEventID() const { return m_usFireAWP; } +private: + unsigned short m_usFireAWP; }; + // for usermsg BombDrop #define BOMB_FLAG_DROPPED 0 // if the bomb was dropped due to voluntary dropping or death/disconnect #define BOMB_FLAG_PLANTED 1 // if the bomb has been planted will also trigger the round timer to hide will also show where the dropped bomb on the Terrorist team's radar. -class CC4: public CBasePlayerWeapon +const float C4_MAX_AMMO = 1.0f; +const float C4_MAX_SPEED = 250.0f; +const float C4_ARMING_ON_TIME = 3.0f; + +enum c4_e { - DECLARE_CLASS_TYPES(CC4, CBasePlayerWeapon); + C4_IDLE1, + C4_DRAW, + C4_DROP, + C4_ARM, +}; + +class CC4: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -493,12 +601,28 @@ class CC4: public CBasePlayerWeapon bool m_bStartedArming; bool m_bBombPlacedAnimation; float m_fArmedTime; + bool HasShield() const { return m_bHasShield; } +private: bool m_bHasShield; }; -class CDEAGLE: public CBasePlayerWeapon + +const float DEAGLE_MAX_SPEED = 250.0f; +const float DEAGLE_DAMAGE = 54.0f; +const float DEAGLE_RANGE_MODIFER = 0.81f; +const float DEAGLE_RELOAD_TIME = 2.2f; + +enum deagle_e { - DECLARE_CLASS_TYPES(CDEAGLE, CBasePlayerWeapon); + DEAGLE_IDLE1, + DEAGLE_SHOOT1, + DEAGLE_SHOOT2, + DEAGLE_SHOOT_EMPTY, + DEAGLE_RELOAD, + DEAGLE_DRAW, +}; + +class CDEAGLE: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -514,12 +638,24 @@ class CDEAGLE: public CBasePlayerWeapon virtual BOOL IsPistol() = 0; public: int m_iShell; - unsigned short m_usFire; + unsigned short GetEventID() const { return m_usFireDeagle; } +private: + unsigned short m_usFireDeagle; }; -class CFlashbang: public CBasePlayerWeapon + +const float FLASHBANG_MAX_SPEED = 250.0f; +const float FLASHBANG_MAX_SPEED_SHIELD = 180.0f; + +enum flashbang_e { - DECLARE_CLASS_TYPES(CFlashbang, CBasePlayerWeapon); + FLASHBANG_IDLE, + FLASHBANG_PULLPIN, + FLASHBANG_THROW, + FLASHBANG_DRAW, +}; + +class CFlashbang: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -537,9 +673,23 @@ class CFlashbang: public CBasePlayerWeapon virtual BOOL IsPistol() = 0; }; -class CG3SG1: public CBasePlayerWeapon + +const float G3SG1_MAX_SPEED = 210.0f; +const float G3SG1_MAX_SPEED_ZOOM = 150.0f; +const float G3SG1_DAMAGE = 80.0f; +const float G3SG1_RANGE_MODIFER = 0.98f; +const float G3SG1_RELOAD_TIME = 3.5f; + +enum g3sg1_e { - DECLARE_CLASS_TYPES(CG3SG1, CBasePlayerWeapon); + G3SG1_IDLE, + G3SG1_SHOOT, + G3SG1_SHOOT2, + G3SG1_RELOAD, + G3SG1_DRAW, +}; + +class CG3SG1: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -554,12 +704,48 @@ class CG3SG1: public CBasePlayerWeapon virtual BOOL UseDecrement() = 0; public: int m_iShell; - unsigned short m_usFire; + unsigned short GetEventID() const { return m_usFireG3SG1; } +private: + unsigned short m_usFireG3SG1; +}; + + +const float GLOCK18_MAX_SPEED = 250.0f; +const float GLOCK18_DAMAGE = 25.0f; +const float GLOCK18_RANGE_MODIFER = 0.75f; +const float GLOCK18_RELOAD_TIME = 2.2f; + +enum glock18_e +{ + GLOCK18_IDLE1, + GLOCK18_IDLE2, + GLOCK18_IDLE3, + GLOCK18_SHOOT, + GLOCK18_SHOOT2, + GLOCK18_SHOOT3, + GLOCK18_SHOOT_EMPTY, + GLOCK18_RELOAD, + GLOCK18_DRAW, + GLOCK18_HOLSTER, + GLOCK18_ADD_SILENCER, + GLOCK18_DRAW2, + GLOCK18_RELOAD2, }; -class CGLOCK18: public CBasePlayerWeapon +enum glock18_shield_e { - DECLARE_CLASS_TYPES(CGLOCK18, CBasePlayerWeapon); + GLOCK18_SHIELD_IDLE1, + GLOCK18_SHIELD_SHOOT, + GLOCK18_SHIELD_SHOOT2, + GLOCK18_SHIELD_SHOOT_EMPTY, + GLOCK18_SHIELD_RELOAD, + GLOCK18_SHIELD_DRAW, + GLOCK18_SHIELD_IDLE, + GLOCK18_SHIELD_UP, + GLOCK18_SHIELD_DOWN, +}; + +class CGLOCK18: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -578,9 +764,19 @@ class CGLOCK18: public CBasePlayerWeapon bool m_bBurstFire; }; -class CHEGrenade: public CBasePlayerWeapon + +const float HEGRENADE_MAX_SPEED = 250.0f; +const float HEGRENADE_MAX_SPEED_SHIELD = 180.0f; + +enum hegrenade_e { - DECLARE_CLASS_TYPES(CHEGrenade, CBasePlayerWeapon); + HEGRENADE_IDLE, + HEGRENADE_PULLPIN, + HEGRENADE_THROW, + HEGRENADE_DRAW, +}; + +class CHEGrenade: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -596,12 +792,39 @@ class CHEGrenade: public CBasePlayerWeapon virtual void WeaponIdle() = 0; virtual BOOL UseDecrement() = 0; public: - unsigned short m_usCreate; + unsigned short m_usCreateExplosion; }; -class CKnife: public CBasePlayerWeapon + +const float KNIFE_BODYHIT_VOLUME = 128.0f; +const float KNIFE_WALLHIT_VOLUME = 512.0f; +const float KNIFE_MAX_SPEED = 250.0f; +const float KNIFE_MAX_SPEED_SHIELD = 180.0f; + +enum knife_e +{ + KNIFE_IDLE, + KNIFE_ATTACK1HIT, + KNIFE_ATTACK2HIT, + KNIFE_DRAW, + KNIFE_STABHIT, + KNIFE_STABMISS, + KNIFE_MIDATTACK1HIT, + KNIFE_MIDATTACK2HIT, +}; + +enum knife_shield_e { - DECLARE_CLASS_TYPES(CKnife, CBasePlayerWeapon); + KNIFE_SHIELD_IDLE, + KNIFE_SHIELD_SLASH, + KNIFE_SHIELD_ATTACKHIT, + KNIFE_SHIELD_DRAW, + KNIFE_SHIELD_UPIDLE, + KNIFE_SHIELD_UP, + KNIFE_SHIELD_DOWN, +}; + +class CKnife: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -618,17 +841,24 @@ class CKnife: public CBasePlayerWeapon public: TraceResult m_trHit; unsigned short m_usKnife; - float m_flStabBaseDamage; - float m_flSwingBaseDamage; - float m_flSwingBaseDamage_Fast; - float m_flStabDistance; - float m_flSwingDistance; - float m_flBackStabMultiplier; }; -class CM249: public CBasePlayerWeapon + +const float M249_MAX_SPEED = 220.0f; +const float M249_DAMAGE = 32.0f; +const float M249_RANGE_MODIFER = 0.97f; +const float M249_RELOAD_TIME = 4.7f; + +enum m249_e { - DECLARE_CLASS_TYPES(CM249, CBasePlayerWeapon); + M249_IDLE1, + M249_SHOOT1, + M249_SHOOT2, + M249_RELOAD, + M249_DRAW, +}; + +class CM249: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -642,13 +872,29 @@ class CM249: public CBasePlayerWeapon virtual BOOL UseDecrement() = 0; public: int m_iShell; - int m_iShellOn; - unsigned short m_usFire; + int iShellOn; + unsigned short GetEventID() const { return m_usFireM249; } +private: + unsigned short m_usFireM249; }; -class CM3: public CBasePlayerWeapon + +const float M3_MAX_SPEED = 230.0f; +const Vector M3_CONE_VECTOR = Vector(0.0675, 0.0675, 0.0); // special shotgun spreads + +enum m3_e { - DECLARE_CLASS_TYPES(CM3, CBasePlayerWeapon); + M3_IDLE, + M3_FIRE1, + M3_FIRE2, + M3_RELOAD, + M3_PUMP, + M3_START_RELOAD, + M3_DRAW, + M3_HOLSTER, +}; + +class CM3: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -663,12 +909,38 @@ class CM3: public CBasePlayerWeapon public: int m_iShell; float m_flPumpTime; - unsigned short m_usFire; + unsigned short GetEventID() const { return m_usFireM3; } +private: + unsigned short m_usFireM3; }; -class CM4A1: public CBasePlayerWeapon + +const float M4A1_MAX_SPEED = 230.0f; +const float M4A1_DAMAGE = 32.0f; +const float M4A1_DAMAGE_SIL = 33.0f; +const float M4A1_RANGE_MODIFER = 0.97f; +const float M4A1_RANGE_MODIFER_SIL = 0.95f; +const float M4A1_RELOAD_TIME = 3.05f; + +enum m4a1_e { - DECLARE_CLASS_TYPES(CM4A1, CBasePlayerWeapon); + M4A1_IDLE, + M4A1_SHOOT1, + M4A1_SHOOT2, + M4A1_SHOOT3, + M4A1_RELOAD, + M4A1_DRAW, + M4A1_ATTACH_SILENCER, + M4A1_UNSIL_IDLE, + M4A1_UNSIL_SHOOT1, + M4A1_UNSIL_SHOOT2, + M4A1_UNSIL_SHOOT3, + M4A1_UNSIL_RELOAD, + M4A1_UNSIL_DRAW, + M4A1_DETACH_SILENCER, +}; + +class CM4A1: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -683,14 +955,29 @@ class CM4A1: public CBasePlayerWeapon virtual BOOL UseDecrement() = 0; public: int m_iShell; - int m_iShellOn; - unsigned short m_usFire; - float m_flBaseDamageSil; + int iShellOn; + unsigned short GetEventID() const { return m_usFireM4A1; } +private: + unsigned short m_usFireM4A1; }; -class CMAC10: public CBasePlayerWeapon + +const float MAC10_MAX_SPEED = 250.0f; +const float MAC10_DAMAGE = 29.0f; +const float MAC10_RANGE_MODIFER = 0.82f; +const float MAC10_RELOAD_TIME = 3.15f; + +enum mac10_e { - DECLARE_CLASS_TYPES(CMAC10, CBasePlayerWeapon); + MAC10_IDLE1, + MAC10_RELOAD, + MAC10_DRAW, + MAC10_SHOOT1, + MAC10_SHOOT2, + MAC10_SHOOT3, +}; + +class CMAC10: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -704,13 +991,43 @@ class CMAC10: public CBasePlayerWeapon virtual BOOL UseDecrement() = 0; public: int m_iShell; - int m_iShellOn; - unsigned short m_usFire; + int iShellOn; + unsigned short GetEventID() const { return m_usFireMAC10; } +private: + unsigned short m_usFireMAC10; +}; + + +const float P228_MAX_SPEED = 250.0f; +const float P228_DAMAGE = 32.0f; +const float P228_RANGE_MODIFER = 0.8f; +const float P228_RELOAD_TIME = 2.7f; + +enum p228_e +{ + P228_IDLE, + P228_SHOOT1, + P228_SHOOT2, + P228_SHOOT3, + P228_SHOOT_EMPTY, + P228_RELOAD, + P228_DRAW, }; -class CP228: public CBasePlayerWeapon +enum p228_shield_e { - DECLARE_CLASS_TYPES(CP228, CBasePlayerWeapon); + P228_SHIELD_IDLE, + P228_SHIELD_SHOOT1, + P228_SHIELD_SHOOT2, + P228_SHIELD_SHOOT_EMPTY, + P228_SHIELD_RELOAD, + P228_SHIELD_DRAW, + P228_SHIELD_IDLE_UP, + P228_SHIELD_UP, + P228_SHIELD_DOWN, +}; + +class CP228: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -726,12 +1043,28 @@ class CP228: public CBasePlayerWeapon virtual BOOL IsPistol() = 0; public: int m_iShell; - unsigned short m_usFire; + unsigned short GetEventID() const { return m_usFireP228; } +private: + unsigned short m_usFireP228; }; -class CP90: public CBasePlayerWeapon + +const float P90_MAX_SPEED = 245.0f; +const float P90_DAMAGE = 21.0f; +const float P90_RANGE_MODIFER = 0.885f; +const float P90_RELOAD_TIME = 3.4f; + +enum p90_e { - DECLARE_CLASS_TYPES(CP90, CBasePlayerWeapon); + P90_IDLE1, + P90_RELOAD, + P90_DRAW, + P90_SHOOT1, + P90_SHOOT2, + P90_SHOOT3, +}; + +class CP90: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -745,13 +1078,29 @@ class CP90: public CBasePlayerWeapon virtual BOOL UseDecrement() = 0; public: int m_iShell; - int m_iShellOn; - unsigned short m_usFire; + int iShellOn; + unsigned short GetEventID() const { return m_usFireP90; } +private: + unsigned short m_usFireP90; }; -class CSCOUT: public CBasePlayerWeapon + +const float SCOUT_MAX_SPEED = 260.0f; +const float SCOUT_MAX_SPEED_ZOOM = 220.0f; +const float SCOUT_DAMAGE = 75.0f; +const float SCOUT_RANGE_MODIFER = 0.98f; +const float SCOUT_RELOAD_TIME = 2.0f; + +enum scout_e { - DECLARE_CLASS_TYPES(CSCOUT, CBasePlayerWeapon); + SCOUT_IDLE, + SCOUT_SHOOT, + SCOUT_SHOOT2, + SCOUT_RELOAD, + SCOUT_DRAW, +}; + +class CSCOUT: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -766,12 +1115,24 @@ class CSCOUT: public CBasePlayerWeapon virtual BOOL UseDecrement() = 0; public: int m_iShell; - unsigned short m_usFire; + unsigned short GetEventID() const { return m_usFireScout; } +private: + unsigned short m_usFireScout; }; -class CSmokeGrenade: public CBasePlayerWeapon + +const float SMOKEGRENADE_MAX_SPEED = 250.0f; +const float SMOKEGRENADE_MAX_SPEED_SHIELD = 180.0f; + +enum smokegrenade_e { - DECLARE_CLASS_TYPES(CSmokeGrenade, CBasePlayerWeapon); + SMOKEGRENADE_IDLE, + SMOKEGRENADE_PINPULL, + SMOKEGRENADE_THROW, + SMOKEGRENADE_DRAW, +}; + +class CSmokeGrenade: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -787,12 +1148,26 @@ class CSmokeGrenade: public CBasePlayerWeapon virtual void WeaponIdle() = 0; virtual BOOL UseDecrement() = 0; public: - unsigned short m_usCreate; + unsigned short m_usCreateSmoke; }; -class CTMP: public CBasePlayerWeapon + +const float TMP_MAX_SPEED = 250.0f; +const float TMP_DAMAGE = 20.0f; +const float TMP_RANGE_MODIFER = 0.85f; +const float TMP_RELOAD_TIME = 2.12f; + +enum tmp_e { - DECLARE_CLASS_TYPES(CTMP, CBasePlayerWeapon); + TMP_IDLE1, + TMP_RELOAD, + TMP_DRAW, + TMP_SHOOT1, + TMP_SHOOT2, + TMP_SHOOT3, +}; + +class CTMP: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -806,13 +1181,28 @@ class CTMP: public CBasePlayerWeapon virtual BOOL UseDecrement() = 0; public: int m_iShell; - int m_iShellOn; - unsigned short m_usFire; + int iShellOn; + unsigned short GetEventID() const { return m_usFireTMP; } +private: + unsigned short m_usFireTMP; }; -class CXM1014: public CBasePlayerWeapon + +const float XM1014_MAX_SPEED = 240.0f; +const Vector XM1014_CONE_VECTOR = Vector(0.0725, 0.0725, 0.0); // special shotgun spreads + +enum xm1014_e { - DECLARE_CLASS_TYPES(CXM1014, CBasePlayerWeapon); + XM1014_IDLE, + XM1014_FIRE1, + XM1014_FIRE2, + XM1014_RELOAD, + XM1014_PUMP, + XM1014_START_RELOAD, + XM1014_DRAW, +}; + +class CXM1014: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -827,12 +1217,38 @@ class CXM1014: public CBasePlayerWeapon public: int m_iShell; float m_flPumpTime; - unsigned short m_usFire; + unsigned short GetEventID() const { return m_usFireXM1014; } +private: + unsigned short m_usFireXM1014; }; -class CELITE: public CBasePlayerWeapon + +const float ELITE_MAX_SPEED = 250.0f; +const float ELITE_RELOAD_TIME = 4.5f; +const float ELITE_DAMAGE = 36.0f; +const float ELITE_RANGE_MODIFER = 0.75f; + +enum elite_e { - DECLARE_CLASS_TYPES(CELITE, CBasePlayerWeapon); + ELITE_IDLE, + ELITE_IDLE_LEFTEMPTY, + ELITE_SHOOTLEFT1, + ELITE_SHOOTLEFT2, + ELITE_SHOOTLEFT3, + ELITE_SHOOTLEFT4, + ELITE_SHOOTLEFT5, + ELITE_SHOOTLEFTLAST, + ELITE_SHOOTRIGHT1, + ELITE_SHOOTRIGHT2, + ELITE_SHOOTRIGHT3, + ELITE_SHOOTRIGHT4, + ELITE_SHOOTRIGHT5, + ELITE_SHOOTRIGHTLAST, + ELITE_RELOAD, + ELITE_DRAW, +}; + +class CELITE: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -847,13 +1263,30 @@ class CELITE: public CBasePlayerWeapon virtual BOOL IsPistol() = 0; public: int m_iShell; - unsigned short m_usFire_LEFT; - unsigned short m_usFire_RIGHT; + unsigned short GetEventID_Left() const { return m_usFireELITE_LEFT; } + unsigned short GetEventID_Right() const { return m_usFireELITE_RIGHT; } +private: + unsigned short m_usFireELITE_LEFT; + unsigned short m_usFireELITE_RIGHT; }; -class CFiveSeven: public CBasePlayerWeapon + +const float FIVESEVEN_MAX_SPEED = 250.0f; +const float FIVESEVEN_DAMAGE = 20.0f; +const float FIVESEVEN_RANGE_MODIFER = 0.885f; +const float FIVESEVEN_RELOAD_TIME = 2.7f; + +enum fiveseven_e { - DECLARE_CLASS_TYPES(CFiveSeven, CBasePlayerWeapon); + FIVESEVEN_IDLE, + FIVESEVEN_SHOOT1, + FIVESEVEN_SHOOT2, + FIVESEVEN_SHOOT_EMPTY, + FIVESEVEN_RELOAD, + FIVESEVEN_DRAW, +}; + +class CFiveSeven: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -869,12 +1302,28 @@ class CFiveSeven: public CBasePlayerWeapon virtual BOOL IsPistol() = 0; public: int m_iShell; - unsigned short m_usFire; + unsigned short GetEventID() const { return m_usFireFiveSeven; } +private: + unsigned short m_usFireFiveSeven; }; -class CUMP45: public CBasePlayerWeapon + +const float UMP45_MAX_SPEED = 250.0f; +const float UMP45_DAMAGE = 30.0f; +const float UMP45_RANGE_MODIFER = 0.82f; +const float UMP45_RELOAD_TIME = 3.5f; + +enum ump45_e { - DECLARE_CLASS_TYPES(CUMP45, CBasePlayerWeapon); + UMP45_IDLE1, + UMP45_RELOAD, + UMP45_DRAW, + UMP45_SHOOT1, + UMP45_SHOOT2, + UMP45_SHOOT3, +}; + +class CUMP45: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -888,13 +1337,29 @@ class CUMP45: public CBasePlayerWeapon virtual BOOL UseDecrement() = 0; public: int m_iShell; - int m_iShellOn; - unsigned short m_usFire; + int iShellOn; + unsigned short GetEventID() const { return m_usFireUMP45; } +private: + unsigned short m_usFireUMP45; }; -class CSG550: public CBasePlayerWeapon + +const float SG550_MAX_SPEED = 210.0f; +const float SG550_MAX_SPEED_ZOOM = 150.0f; +const float SG550_DAMAGE = 70.0f; +const float SG550_RANGE_MODIFER = 0.98f; +const float SG550_RELOAD_TIME = 3.35f; + +enum sg550_e { - DECLARE_CLASS_TYPES(CSG550, CBasePlayerWeapon); + SG550_IDLE, + SG550_SHOOT, + SG550_SHOOT2, + SG550_RELOAD, + SG550_DRAW, +}; + +class CSG550: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -909,12 +1374,28 @@ class CSG550: public CBasePlayerWeapon virtual BOOL UseDecrement() = 0; public: int m_iShell; - unsigned short m_usFire; + unsigned short GetEventID() const { return m_usFireSG550; } +private: + unsigned short m_usFireSG550; }; -class CGalil: public CBasePlayerWeapon + +const float GALIL_MAX_SPEED = 240.0f; +const float GALIL_DAMAGE = 30.0f; +const float GALIL_RANGE_MODIFER = 0.98f; +const float GALIL_RELOAD_TIME = 2.45f; + +enum galil_e { - DECLARE_CLASS_TYPES(CGalil, CBasePlayerWeapon); + GALIL_IDLE1, + GALIL_RELOAD, + GALIL_DRAW, + GALIL_SHOOT1, + GALIL_SHOOT2, + GALIL_SHOOT3, +}; + +class CGalil: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -929,13 +1410,30 @@ class CGalil: public CBasePlayerWeapon virtual BOOL UseDecrement() = 0; public: int m_iShell; - int m_iShellOn; - unsigned short m_usFire; + int iShellOn; + unsigned short GetEventID() const { return m_usFireGalil; } +private: + unsigned short m_usFireGalil; }; -class CFamas: public CBasePlayerWeapon + +const float FAMAS_MAX_SPEED = 240.0f; +const float FAMAS_RELOAD_TIME = 3.3f; +const float FAMAS_DAMAGE = 30.0f; +const float FAMAS_DAMAGE_BURST = 34.0f; +const float FAMAS_RANGE_MODIFER = 0.96f; + +enum famas_e { - DECLARE_CLASS_TYPES(CFamas, CBasePlayerWeapon); + FAMAS_IDLE1, + FAMAS_RELOAD, + FAMAS_DRAW, + FAMAS_SHOOT1, + FAMAS_SHOOT2, + FAMAS_SHOOT3, +}; + +class CFamas: public CBasePlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -950,6 +1448,5 @@ class CFamas: public CBasePlayerWeapon virtual BOOL UseDecrement() = 0; public: int m_iShell; - int m_iShellOn; - float m_flBaseDamageBurst; + int iShellOn; }; diff --git a/AccuracyFix/include/cssdk/dlls/weapontype.h b/AccuracyFix/include/cssdk/dlls/weapontype.h index a6bcd8b..a791cac 100644 --- a/AccuracyFix/include/cssdk/dlls/weapontype.h +++ b/AccuracyFix/include/cssdk/dlls/weapontype.h @@ -25,6 +25,7 @@ * version. * */ + #pragma once enum WeaponIdType @@ -65,188 +66,188 @@ enum WeaponIdType enum AutoBuyClassType { - AUTOBUYCLASS_NONE = 0, - AUTOBUYCLASS_PRIMARY = (1 << 0), - AUTOBUYCLASS_SECONDARY = (1 << 1), - AUTOBUYCLASS_AMMO = (1 << 2), - AUTOBUYCLASS_ARMOR = (1 << 3), - AUTOBUYCLASS_DEFUSER = (1 << 4), - AUTOBUYCLASS_PISTOL = (1 << 5), - AUTOBUYCLASS_SMG = (1 << 6), - AUTOBUYCLASS_RIFLE = (1 << 7), - AUTOBUYCLASS_SNIPERRIFLE = (1 << 8), - AUTOBUYCLASS_SHOTGUN = (1 << 9), - AUTOBUYCLASS_MACHINEGUN = (1 << 10), - AUTOBUYCLASS_GRENADE = (1 << 11), - AUTOBUYCLASS_NIGHTVISION = (1 << 12), - AUTOBUYCLASS_SHIELD = (1 << 13), + AUTOBUYCLASS_NONE = 0, + AUTOBUYCLASS_PRIMARY = BIT(0), + AUTOBUYCLASS_SECONDARY = BIT(1), + AUTOBUYCLASS_AMMO = BIT(2), + AUTOBUYCLASS_ARMOR = BIT(3), + AUTOBUYCLASS_DEFUSER = BIT(4), + AUTOBUYCLASS_PISTOL = BIT(5), + AUTOBUYCLASS_SMG = BIT(6), + AUTOBUYCLASS_RIFLE = BIT(7), + AUTOBUYCLASS_SNIPERRIFLE = BIT(8), + AUTOBUYCLASS_SHOTGUN = BIT(9), + AUTOBUYCLASS_MACHINEGUN = BIT(10), + AUTOBUYCLASS_GRENADE = BIT(11), + AUTOBUYCLASS_NIGHTVISION = BIT(12), + AUTOBUYCLASS_SHIELD = BIT(13), }; enum AmmoCostType { - AMMO_338MAG_PRICE = 125, - AMMO_357SIG_PRICE = 50, - AMMO_45ACP_PRICE = 25, - AMMO_50AE_PRICE = 40, - AMMO_556MM_PRICE = 60, - AMMO_57MM_PRICE = 50, - AMMO_762MM_PRICE = 80, - AMMO_9MM_PRICE = 20, - AMMO_BUCKSHOT_PRICE = 65, + AMMO_338MAG_PRICE = 125, + AMMO_357SIG_PRICE = 50, + AMMO_45ACP_PRICE = 25, + AMMO_50AE_PRICE = 40, + AMMO_556MM_PRICE = 60, + AMMO_57MM_PRICE = 50, + AMMO_762MM_PRICE = 80, + AMMO_9MM_PRICE = 20, + AMMO_BUCKSHOT_PRICE = 65, }; enum WeaponCostType { - AK47_PRICE = 2500, - AWP_PRICE = 4750, - DEAGLE_PRICE = 650, - G3SG1_PRICE = 5000, - SG550_PRICE = 4200, - GLOCK18_PRICE = 400, - M249_PRICE = 5750, - M3_PRICE = 1700, - M4A1_PRICE = 3100, - AUG_PRICE = 3500, - MP5NAVY_PRICE = 1500, - P228_PRICE = 600, - P90_PRICE = 2350, - UMP45_PRICE = 1700, - MAC10_PRICE = 1400, - SCOUT_PRICE = 2750, - SG552_PRICE = 3500, - TMP_PRICE = 1250, - USP_PRICE = 500, - ELITE_PRICE = 800, - FIVESEVEN_PRICE = 750, - XM1014_PRICE = 3000, - GALIL_PRICE = 2000, - FAMAS_PRICE = 2250, - SHIELDGUN_PRICE = 2200, + AK47_PRICE = 2500, + AWP_PRICE = 4750, + DEAGLE_PRICE = 650, + G3SG1_PRICE = 5000, + SG550_PRICE = 4200, + GLOCK18_PRICE = 400, + M249_PRICE = 5750, + M3_PRICE = 1700, + M4A1_PRICE = 3100, + AUG_PRICE = 3500, + MP5NAVY_PRICE = 1500, + P228_PRICE = 600, + P90_PRICE = 2350, + UMP45_PRICE = 1700, + MAC10_PRICE = 1400, + SCOUT_PRICE = 2750, + SG552_PRICE = 3500, + TMP_PRICE = 1250, + USP_PRICE = 500, + ELITE_PRICE = 800, + FIVESEVEN_PRICE = 750, + XM1014_PRICE = 3000, + GALIL_PRICE = 2000, + FAMAS_PRICE = 2250, + SHIELDGUN_PRICE = 2200, }; enum WeaponState { - WPNSTATE_USP_SILENCED = (1 << 0), - WPNSTATE_GLOCK18_BURST_MODE = (1 << 1), - WPNSTATE_M4A1_SILENCED = (1 << 2), - WPNSTATE_ELITE_LEFT = (1 << 3), - WPNSTATE_FAMAS_BURST_MODE = (1 << 4), - WPNSTATE_SHIELD_DRAWN = (1 << 5), + WPNSTATE_USP_SILENCED = BIT(0), + WPNSTATE_GLOCK18_BURST_MODE = BIT(1), + WPNSTATE_M4A1_SILENCED = BIT(2), + WPNSTATE_ELITE_LEFT = BIT(3), + WPNSTATE_FAMAS_BURST_MODE = BIT(4), + WPNSTATE_SHIELD_DRAWN = BIT(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, - MP5NAVY_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, + 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, + MP5NAVY_DEFAULT_GIVE = 30, + M249_DEFAULT_GIVE = 100, + M3_DEFAULT_GIVE = 8, + M4A1_DEFAULT_GIVE = 30, + TMP_DEFAULT_GIVE = 30, + G3SG1_DEFAULT_GIVE = 20, + FLASHBANG_DEFAULT_GIVE = 1, + DEAGLE_DEFAULT_GIVE = 7, + SG552_DEFAULT_GIVE = 30, + AK47_DEFAULT_GIVE = 30, + //KNIFE_DEFAULT_GIVE = 1, + P90_DEFAULT_GIVE = 50, }; enum ClipSizeType { - P228_MAX_CLIP = 13, - GLOCK18_MAX_CLIP = 20, - SCOUT_MAX_CLIP = 10, - XM1014_MAX_CLIP = 7, - MAC10_MAX_CLIP = 30, - AUG_MAX_CLIP = 30, - ELITE_MAX_CLIP = 30, - FIVESEVEN_MAX_CLIP = 20, - UMP45_MAX_CLIP = 25, - SG550_MAX_CLIP = 30, - GALIL_MAX_CLIP = 35, - FAMAS_MAX_CLIP = 25, - USP_MAX_CLIP = 12, - AWP_MAX_CLIP = 10, - MP5N_MAX_CLIP = 30, - M249_MAX_CLIP = 100, - M3_MAX_CLIP = 8, - M4A1_MAX_CLIP = 30, - TMP_MAX_CLIP = 30, - G3SG1_MAX_CLIP = 20, - DEAGLE_MAX_CLIP = 7, - SG552_MAX_CLIP = 30, - AK47_MAX_CLIP = 30, - P90_MAX_CLIP = 50, + P228_MAX_CLIP = 13, + GLOCK18_MAX_CLIP = 20, + SCOUT_MAX_CLIP = 10, + XM1014_MAX_CLIP = 7, + MAC10_MAX_CLIP = 30, + AUG_MAX_CLIP = 30, + ELITE_MAX_CLIP = 30, + FIVESEVEN_MAX_CLIP = 20, + UMP45_MAX_CLIP = 25, + SG550_MAX_CLIP = 30, + GALIL_MAX_CLIP = 35, + FAMAS_MAX_CLIP = 25, + USP_MAX_CLIP = 12, + AWP_MAX_CLIP = 10, + MP5N_MAX_CLIP = 30, + M249_MAX_CLIP = 100, + M3_MAX_CLIP = 8, + M4A1_MAX_CLIP = 30, + TMP_MAX_CLIP = 30, + G3SG1_MAX_CLIP = 20, + DEAGLE_MAX_CLIP = 7, + SG552_MAX_CLIP = 30, + AK47_MAX_CLIP = 30, + P90_MAX_CLIP = 50, }; enum WeightWeapon { - P228_WEIGHT = 5, - GLOCK18_WEIGHT = 5, - SCOUT_WEIGHT = 30, - HEGRENADE_WEIGHT = 2, - 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, - MP5NAVY_WEIGHT = 25, - M249_WEIGHT = 25, - M3_WEIGHT = 20, - M4A1_WEIGHT = 25, - TMP_WEIGHT = 25, - G3SG1_WEIGHT = 20, - FLASHBANG_WEIGHT = 1, - DEAGLE_WEIGHT = 7, - SG552_WEIGHT = 25, - AK47_WEIGHT = 25, - P90_WEIGHT = 26, - KNIFE_WEIGHT = 0, + P228_WEIGHT = 5, + GLOCK18_WEIGHT = 5, + SCOUT_WEIGHT = 30, + HEGRENADE_WEIGHT = 2, + 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, + MP5NAVY_WEIGHT = 25, + M249_WEIGHT = 25, + M3_WEIGHT = 20, + M4A1_WEIGHT = 25, + TMP_WEIGHT = 25, + G3SG1_WEIGHT = 20, + FLASHBANG_WEIGHT = 1, + DEAGLE_WEIGHT = 7, + SG552_WEIGHT = 25, + AK47_WEIGHT = 25, + P90_WEIGHT = 26, + KNIFE_WEIGHT = 0, }; enum MaxAmmoType { - MAX_AMMO_BUCKSHOT = 32, - MAX_AMMO_9MM = 120, - MAX_AMMO_556NATO = 90, - MAX_AMMO_556NATOBOX = 200, - MAX_AMMO_762NATO = 90, - MAX_AMMO_45ACP = 100, - MAX_AMMO_50AE = 35, - MAX_AMMO_338MAGNUM = 30, - MAX_AMMO_57MM = 100, - MAX_AMMO_357SIG = 52, + MAX_AMMO_BUCKSHOT = 32, + MAX_AMMO_9MM = 120, + MAX_AMMO_556NATO = 90, + MAX_AMMO_556NATOBOX = 200, + MAX_AMMO_762NATO = 90, + MAX_AMMO_45ACP = 100, + MAX_AMMO_50AE = 35, + MAX_AMMO_338MAGNUM = 30, + MAX_AMMO_57MM = 100, + MAX_AMMO_357SIG = 52, // custom - MAX_AMMO_SMOKEGRENADE = 1, - MAX_AMMO_HEGRENADE = 1, - MAX_AMMO_FLASHBANG = 2, + MAX_AMMO_SMOKEGRENADE = 1, + MAX_AMMO_HEGRENADE = 1, + MAX_AMMO_FLASHBANG = 2, }; enum AmmoType @@ -286,28 +287,28 @@ enum WeaponClassType enum AmmoBuyAmount { - AMMO_338MAG_BUY = 10, - AMMO_357SIG_BUY = 13, - AMMO_45ACP_BUY = 12, - AMMO_50AE_BUY = 7, - AMMO_556NATO_BUY = 30, - AMMO_556NATOBOX_BUY = 30, - AMMO_57MM_BUY = 50, - AMMO_762NATO_BUY = 30, - AMMO_9MM_BUY = 30, - AMMO_BUCKSHOT_BUY = 8, + AMMO_338MAG_BUY = 10, + AMMO_357SIG_BUY = 13, + AMMO_45ACP_BUY = 12, + AMMO_50AE_BUY = 7, + AMMO_556NATO_BUY = 30, + AMMO_556NATOBOX_BUY = 30, + AMMO_57MM_BUY = 50, + AMMO_762NATO_BUY = 30, + AMMO_9MM_BUY = 30, + AMMO_BUCKSHOT_BUY = 8, }; enum ItemCostType { - ASSAULTSUIT_PRICE = 1000, - FLASHBANG_PRICE = 200, - HEGRENADE_PRICE = 300, - SMOKEGRENADE_PRICE = 300, - KEVLAR_PRICE = 650, - HELMET_PRICE = 350, - NVG_PRICE = 1250, - DEFUSEKIT_PRICE = 200, + ASSAULTSUIT_PRICE = 1000, + FLASHBANG_PRICE = 200, + HEGRENADE_PRICE = 300, + SMOKEGRENADE_PRICE = 300, + KEVLAR_PRICE = 650, + HELMET_PRICE = 350, + NVG_PRICE = 1250, + DEFUSEKIT_PRICE = 200, }; enum shieldgun_e @@ -340,7 +341,7 @@ enum InventorySlotType GRENADE_SLOT, C4_SLOT, }; - + enum Bullet { BULLET_NONE, @@ -372,7 +373,7 @@ struct WeaponStruct struct AutoBuyInfoStruct { - AutoBuyClassType m_class; + int m_class; char *m_command; char *m_classname; }; @@ -406,10 +407,7 @@ struct WeaponInfoStruct int maxRounds; int ammoType; char *entityName; - - // custom - const char *ammoName1; - const char *ammoName2; + const char *ammoName; }; struct WeaponSlotInfo diff --git a/AccuracyFix/include/cssdk/dlls/world.h b/AccuracyFix/include/cssdk/dlls/world.h new file mode 100644 index 0000000..d1fb34d --- /dev/null +++ b/AccuracyFix/include/cssdk/dlls/world.h @@ -0,0 +1,50 @@ +/* +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by the +* Free Software Foundation; either version 2 of the License, or (at +* your option) any later version. +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +* +* In addition, as a special exception, the author gives permission to +* link the code of this program with the Half-Life Game Engine ("HL +* Engine") and Modified Game Libraries ("MODs") developed by Valve, +* L.L.C ("Valve"). You must obey the GNU General Public License in all +* respects for all of the code used other than the HL Engine and MODs +* from Valve. If you modify this file, you may extend this exception +* to your version of the file, but you are not obligated to do so. If +* you do not wish to do so, delete this exception statement from your +* version. +* +*/ + +#pragma once + +#define SF_WORLD_DARK BIT(0) // Fade from black at startup +#define SF_WORLD_TITLE BIT(1) // Display game title at startup +#define SF_WORLD_FORCETEAM BIT(2) // Force teams + +// This spawns first when each level begins. +class CWorld: public CBaseEntity { +public: + virtual void Spawn() = 0; + virtual void Precache() = 0; + virtual void KeyValue(KeyValueData *pkvd) = 0; +}; + +#define SF_DECAL_NOTINDEATHMATCH BIT(11) + +class CDecal: public CBaseEntity +{ +public: + virtual void Spawn() = 0; + virtual void KeyValue(KeyValueData *pkvd) = 0; +}; diff --git a/AccuracyFix/include/cssdk/dlls/wpn_shared.h b/AccuracyFix/include/cssdk/dlls/wpn_shared.h deleted file mode 100644 index 1ed2eea..0000000 --- a/AccuracyFix/include/cssdk/dlls/wpn_shared.h +++ /dev/null @@ -1,598 +0,0 @@ -#pragma once - -//AK47 -#define AK47_MAX_SPEED 221 -#define AK47_DAMAGE 36 -#define AK47_RANGE_MODIFER 0.98 -#define AK47_RELOAD_TIME 2.45 - -enum ak47_e -{ - AK47_IDLE1, - AK47_RELOAD, - AK47_DRAW, - AK47_SHOOT1, - AK47_SHOOT2, - AK47_SHOOT3 -}; - - - -//AUG -#define AUG_MAX_SPEED 240 -#define AUG_DAMAGE 32 -#define AUG_RANGE_MODIFER 0.96 -#define AUG_RELOAD_TIME 3.3 - -enum aug_e -{ - AUG_IDLE1, - AUG_RELOAD, - AUG_DRAW, - AUG_SHOOT1, - AUG_SHOOT2, - AUG_SHOOT3 -}; - - - -//AWP -#define AWP_MAX_SPEED 210 -#define AWP_MAX_SPEED_ZOOM 150 -#define AWP_DAMAGE 115 -#define AWP_RANGE_MODIFER 0.99 -#define AWP_RELOAD_TIME 2.5 - -enum awp_e -{ - AWP_IDLE, - AWP_SHOOT, - AWP_SHOOT2, - AWP_SHOOT3, - AWP_RELOAD, - AWP_DRAW, -}; - - - -//C4 -#define C4_MAX_AMMO 1 -#define C4_MAX_SPEED 250.0 -#define C4_ARMING_ON_TIME 3.0 - -enum c4_e -{ - C4_IDLE1, - C4_DRAW, - C4_DROP, - C4_ARM -}; - - - -//Deagle -#define DEAGLE_MAX_SPEED 250 -#define DEAGLE_DAMAGE 54 -#define DEAGLE_RANGE_MODIFER 0.81 -#define DEAGLE_RELOAD_TIME 2.2 - -enum deagle_e -{ - DEAGLE_IDLE1, - DEAGLE_SHOOT1, - DEAGLE_SHOOT2, - DEAGLE_SHOOT_EMPTY, - DEAGLE_RELOAD, - DEAGLE_DRAW -}; - - - -//Elites -#define ELITE_MAX_SPEED 250 -#define ELITE_RELOAD_TIME 4.5 -#define ELITE_DAMAGE 36 -#define ELITE_RANGE_MODIFER 0.75 - -enum elite_e -{ - ELITE_IDLE, - ELITE_IDLE_LEFTEMPTY, - ELITE_SHOOTLEFT1, - ELITE_SHOOTLEFT2, - ELITE_SHOOTLEFT3, - ELITE_SHOOTLEFT4, - ELITE_SHOOTLEFT5, - ELITE_SHOOTLEFTLAST, - ELITE_SHOOTRIGHT1, - ELITE_SHOOTRIGHT2, - ELITE_SHOOTRIGHT3, - ELITE_SHOOTRIGHT4, - ELITE_SHOOTRIGHT5, - ELITE_SHOOTRIGHTLAST, - ELITE_RELOAD, - ELITE_DRAW -}; - - - -//Famas -#define FAMAS_MAX_SPEED 240 -#define FAMAS_RELOAD_TIME 3.3 -#define FAMAS_DAMAGE 30 -#define FAMAS_DAMAGE_BURST 34 -#define FAMAS_RANGE_MODIFER 0.96 - -enum famas_e -{ - FAMAS_IDLE1, - FAMAS_RELOAD, - FAMAS_DRAW, - FAMAS_SHOOT1, - FAMAS_SHOOT2, - FAMAS_SHOOT3 -}; - - - -//Fiveseven -#define FIVESEVEN_MAX_SPEED 250 -#define FIVESEVEN_DAMAGE 20 -#define FIVESEVEN_RANGE_MODIFER 0.885 -#define FIVESEVEN_RELOAD_TIME 2.7 - -enum fiveseven_e -{ - FIVESEVEN_IDLE, - FIVESEVEN_SHOOT1, - FIVESEVEN_SHOOT2, - FIVESEVEN_SHOOT_EMPTY, - FIVESEVEN_RELOAD, - FIVESEVEN_DRAW -}; - - - -//Flashbang -#define FLASHBANG_MAX_SPEED 250 -#define FLASHBANG_MAX_SPEED_SHIELD 180 - -enum flashbang_e -{ - FLASHBANG_IDLE, - FLASHBANG_PULLPIN, - FLASHBANG_THROW, - FLASHBANG_DRAW -}; - - - -//g3sg1 -#define G3SG1_MAX_SPEED 210 -#define G3SG1_MAX_SPEED_ZOOM 150 -#define G3SG1_DAMAGE 80 -#define G3SG1_RANGE_MODIFER 0.98 -#define G3SG1_RELOAD_TIME 3.5 - -enum g3sg1_e -{ - G3SG1_IDLE, - G3SG1_SHOOT, - G3SG1_SHOOT2, - G3SG1_RELOAD, - G3SG1_DRAW -}; - - - -//galil -#define GALIL_MAX_SPEED 240 -#define GALIL_DAMAGE 30 -#define GALIL_RANGE_MODIFER 0.98 -#define GALIL_RELOAD_TIME 2.45 - -enum galil_e -{ - GALIL_IDLE1, - GALIL_RELOAD, - GALIL_DRAW, - GALIL_SHOOT1, - GALIL_SHOOT2, - GALIL_SHOOT3 -}; - - - -//glock18 -#define GLOCK18_MAX_SPEED 250 -#define GLOCK18_DAMAGE 25 -#define GLOCK18_RANGE_MODIFER 0.75 -#define GLOCK18_RELOAD_TIME 2.2 - -enum glock18_e -{ - GLOCK18_IDLE1, - GLOCK18_IDLE2, - GLOCK18_IDLE3, - GLOCK18_SHOOT, - GLOCK18_SHOOT2, - GLOCK18_SHOOT3, - GLOCK18_SHOOT_EMPTY, - GLOCK18_RELOAD, - GLOCK18_DRAW, - GLOCK18_HOLSTER, - GLOCK18_ADD_SILENCER, - GLOCK18_DRAW2, - GLOCK18_RELOAD2 -}; - -enum glock18_shield_e -{ - GLOCK18_SHIELD_IDLE1, - GLOCK18_SHIELD_SHOOT, - GLOCK18_SHIELD_SHOOT2, - GLOCK18_SHIELD_SHOOT_EMPTY, - GLOCK18_SHIELD_RELOAD, - GLOCK18_SHIELD_DRAW, - GLOCK18_SHIELD_IDLE, - GLOCK18_SHIELD_UP, - GLOCK18_SHIELD_DOWN -}; - - - -//hegrenade -#define HEGRENADE_MAX_SPEED 250 -#define HEGRENADE_MAX_SPEED_SHIELD 180 - -enum hegrenade_e -{ - HEGRENADE_IDLE, - HEGRENADE_PULLPIN, - HEGRENADE_THROW, - HEGRENADE_DRAW -}; - - - -//knife -#define KNIFE_BODYHIT_VOLUME 128 -#define KNIFE_WALLHIT_VOLUME 512 -#define KNIFE_MAX_SPEED 250 -#define KNIFE_MAX_SPEED_SHIELD 180 - -enum knife_e -{ - KNIFE_IDLE, - KNIFE_ATTACK1HIT, - KNIFE_ATTACK2HIT, - KNIFE_DRAW, - KNIFE_STABHIT, - KNIFE_STABMISS, - KNIFE_MIDATTACK1HIT, - KNIFE_MIDATTACK2HIT -}; - -enum knife_shield_e -{ - KNIFE_SHIELD_IDLE, - KNIFE_SHIELD_SLASH, - KNIFE_SHIELD_ATTACKHIT, - KNIFE_SHIELD_DRAW, - KNIFE_SHIELD_UPIDLE, - KNIFE_SHIELD_UP, - KNIFE_SHIELD_DOWN -}; - - - -//m3 -#define M3_MAX_SPEED 230 -#define M3_CONE_VECTOR Vector(0.0675, 0.0675, 0.0) // special shotgun spreads - -enum m3_e -{ - M3_IDLE, - M3_FIRE1, - M3_FIRE2, - M3_RELOAD, - M3_PUMP, - M3_START_RELOAD, - M3_DRAW, - M3_HOLSTER -}; - - - -//m4a1 -#define M4A1_MAX_SPEED 230 -#define M4A1_DAMAGE 32 -#define M4A1_DAMAGE_SIL 33 -#define M4A1_RANGE_MODIFER 0.97 -#define M4A1_RANGE_MODIFER_SIL 0.95 -#define M4A1_RELOAD_TIME 3.05 - -enum m4a1_e -{ - M4A1_IDLE, - M4A1_SHOOT1, - M4A1_SHOOT2, - M4A1_SHOOT3, - M4A1_RELOAD, - M4A1_DRAW, - M4A1_ATTACH_SILENCER, - M4A1_UNSIL_IDLE, - M4A1_UNSIL_SHOOT1, - M4A1_UNSIL_SHOOT2, - M4A1_UNSIL_SHOOT3, - M4A1_UNSIL_RELOAD, - M4A1_UNSIL_DRAW, - M4A1_DETACH_SILENCER -}; - - - -//m249 -#define M249_MAX_SPEED 220 -#define M249_DAMAGE 32 -#define M249_RANGE_MODIFER 0.97 -#define M249_RELOAD_TIME 4.7 - -enum m249_e -{ - M249_IDLE1, - M249_SHOOT1, - M249_SHOOT2, - M249_RELOAD, - M249_DRAW -}; - - - -//mac10 -#define MAC10_MAX_SPEED 250 -#define MAC10_DAMAGE 29 -#define MAC10_RANGE_MODIFER 0.82 -#define MAC10_RELOAD_TIME 3.15 - -enum mac10_e -{ - MAC10_IDLE1, - MAC10_RELOAD, - MAC10_DRAW, - MAC10_SHOOT1, - MAC10_SHOOT2, - MAC10_SHOOT3 -}; - - - -//mp5navy -#define MP5N_MAX_SPEED 250 -#define MP5N_DAMAGE 26 -#define MP5N_RANGE_MODIFER 0.84 -#define MP5N_RELOAD_TIME 2.63 - -enum mp5n_e -{ - MP5N_IDLE1, - MP5N_RELOAD, - MP5N_DRAW, - MP5N_SHOOT1, - MP5N_SHOOT2, - MP5N_SHOOT3 -}; - - - -//p90 -#define P90_MAX_SPEED 245 -#define P90_DAMAGE 21 -#define P90_RANGE_MODIFER 0.885 -#define P90_RELOAD_TIME 3.4 - -enum p90_e -{ - P90_IDLE1, - P90_RELOAD, - P90_DRAW, - P90_SHOOT1, - P90_SHOOT2, - P90_SHOOT3 -}; - - - -//p228 -#define P228_MAX_SPEED 250 -#define P228_DAMAGE 32 -#define P228_RANGE_MODIFER 0.8 -#define P228_RELOAD_TIME 2.7 - -enum p228_e -{ - P228_IDLE, - P228_SHOOT1, - P228_SHOOT2, - P228_SHOOT3, - P228_SHOOT_EMPTY, - P228_RELOAD, - P228_DRAW -}; - -enum p228_shield_e -{ - P228_SHIELD_IDLE, - P228_SHIELD_SHOOT1, - P228_SHIELD_SHOOT2, - P228_SHIELD_SHOOT_EMPTY, - P228_SHIELD_RELOAD, - P228_SHIELD_DRAW, - P228_SHIELD_IDLE_UP, - P228_SHIELD_UP, - P228_SHIELD_DOWN -}; - - - -//scout -#define SCOUT_MAX_SPEED 260 -#define SCOUT_MAX_SPEED_ZOOM 220 -#define SCOUT_DAMAGE 75 -#define SCOUT_RANGE_MODIFER 0.98 -#define SCOUT_RELOAD_TIME 2 - -enum scout_e -{ - SCOUT_IDLE, - SCOUT_SHOOT, - SCOUT_SHOOT2, - SCOUT_RELOAD, - SCOUT_DRAW -}; - - - -//sg550 -#define SG550_MAX_SPEED 210 -#define SG550_MAX_SPEED_ZOOM 150 -#define SG550_DAMAGE 70 -#define SG550_RANGE_MODIFER 0.98 -#define SG550_RELOAD_TIME 3.35 - -enum sg550_e -{ - SG550_IDLE, - SG550_SHOOT, - SG550_SHOOT2, - SG550_RELOAD, - SG550_DRAW -}; - - - -//sg552 -#define SG552_MAX_SPEED 235 -#define SG552_MAX_SPEED_ZOOM 200 -#define SG552_DAMAGE 33 -#define SG552_RANGE_MODIFER 0.955 -#define SG552_RELOAD_TIME 3 - -enum sg552_e -{ - SG552_IDLE1, - SG552_RELOAD, - SG552_DRAW, - SG552_SHOOT1, - SG552_SHOOT2, - SG552_SHOOT3 -}; - - - -//smokegrenade -#define SMOKEGRENADE_MAX_SPEED 250 -#define SMOKEGRENADE_MAX_SPEED_SHIELD 180 - -enum smokegrenade_e -{ - SMOKEGRENADE_IDLE, - SMOKEGRENADE_PINPULL, - SMOKEGRENADE_THROW, - SMOKEGRENADE_DRAW -}; - - - -//tmp -#define TMP_MAX_SPEED 250 -#define TMP_DAMAGE 20 -#define TMP_RANGE_MODIFER 0.85 -#define TMP_RELOAD_TIME 2.12 - -enum tmp_e -{ - TMP_IDLE1, - TMP_RELOAD, - TMP_DRAW, - TMP_SHOOT1, - TMP_SHOOT2, - TMP_SHOOT3 -}; - - - -//ump45 -#define UMP45_MAX_SPEED 250 -#define UMP45_DAMAGE 30 -#define UMP45_RANGE_MODIFER 0.82 -#define UMP45_RELOAD_TIME 3.5 - -enum ump45_e -{ - UMP45_IDLE1, - UMP45_RELOAD, - UMP45_DRAW, - UMP45_SHOOT1, - UMP45_SHOOT2, - UMP45_SHOOT3 -}; - - - -//tmp -#define USP_MAX_SPEED 250 -#define USP_DAMAGE 34 -#define USP_DAMAGE_SIL 30 -#define USP_RANGE_MODIFER 0.79 -#define USP_RELOAD_TIME 2.7 - -enum usp_e -{ - USP_IDLE, - USP_SHOOT1, - USP_SHOOT2, - USP_SHOOT3, - USP_SHOOT_EMPTY, - USP_RELOAD, - USP_DRAW, - USP_ATTACH_SILENCER, - USP_UNSIL_IDLE, - USP_UNSIL_SHOOT1, - USP_UNSIL_SHOOT2, - USP_UNSIL_SHOOT3, - USP_UNSIL_SHOOT_EMPTY, - USP_UNSIL_RELOAD, - USP_UNSIL_DRAW, - USP_DETACH_SILENCER -}; - -enum usp_shield_e -{ - USP_SHIELD_IDLE, - USP_SHIELD_SHOOT1, - USP_SHIELD_SHOOT2, - USP_SHIELD_SHOOT_EMPTY, - USP_SHIELD_RELOAD, - USP_SHIELD_DRAW, - USP_SHIELD_UP_IDLE, - USP_SHIELD_UP, - USP_SHIELD_DOWN -}; - - - -//xm1014 -#define XM1014_MAX_SPEED 240 -#define XM1014_CONE_VECTOR Vector(0.0725, 0.0725, 0.0) // special shotgun spreads - -enum xm1014_e -{ - XM1014_IDLE, - XM1014_FIRE1, - XM1014_FIRE2, - XM1014_RELOAD, - XM1014_PUMP, - XM1014_START_RELOAD, - XM1014_DRAW -}; diff --git a/AccuracyFix/include/cssdk/engine/eiface.h b/AccuracyFix/include/cssdk/engine/eiface.h index 3120d39..9bb00e9 100644 --- a/AccuracyFix/include/cssdk/engine/eiface.h +++ b/AccuracyFix/include/cssdk/engine/eiface.h @@ -1,9 +1,9 @@ /*** * * Copyright (c) 1999, Valve LLC. All rights reserved. -* -* This product contains software technology licensed from Id -* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. +* +* This product contains software technology licensed from Id +* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. * All Rights Reserved. * * Use, distribution, and modification of this source code and/or resulting @@ -86,7 +86,7 @@ struct TraceResult }; // CD audio status -typedef struct +typedef struct { int fPlaying;// is sound playing right now? int fWasPlaying;// if not, CD is paused if WasPlaying is true. @@ -171,7 +171,7 @@ typedef struct enginefuncs_s void* (*pfnPvAllocEntPrivateData) (edict_t *pEdict, int32 cb); void* (*pfnPvEntPrivateData) (edict_t *pEdict); void (*pfnFreeEntPrivateData) (edict_t *pEdict); - const char* (*pfnSzFromIndex) (int iString); + const char* (*pfnSzFromIndex) (string_t iString); string_t (*pfnAllocString) (const char *szValue); struct entvars_s* (*pfnGetVarsOfEnt) (edict_t *pEdict); edict_t* (*pfnPEntityOfEntOffset) (int iEntOffset); @@ -187,8 +187,8 @@ typedef struct enginefuncs_s const char *(*pfnNameForFunction) ( uint32 function ); void (*pfnClientPrintf) ( edict_t* pEdict, PRINT_TYPE ptype, const char *szMsg ); // JOHN: engine callbacks so game DLL can print messages to individual clients void (*pfnServerPrint) ( const char *szMsg ); - const char *(*pfnCmd_Args) ( void ); // these 3 added - const char *(*pfnCmd_Argv) ( int argc ); // so game DLL can easily + const char *(*pfnCmd_Args) ( void ); // these 3 added + const char *(*pfnCmd_Argv) ( int argc ); // so game DLL can easily int (*pfnCmd_Argc) ( void ); // access client 'cmd' strings void (*pfnGetAttachment) (const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); void (*pfnCRC32_Init) (CRC32_t *pulCRC); @@ -269,7 +269,7 @@ typedef struct enginefuncs_s // PSV: Added for CZ training map // const char *(*pfnKeyNameForBinding) ( const char* pBinding ); - + sequenceEntry_s* (*pfnSequenceGet) ( const char* fileName, const char* entryName ); sentenceEntry_s* (*pfnSequencePickSentence) ( const char* groupName, int pickMethod, int *picked ); @@ -328,7 +328,7 @@ typedef struct } LEVELLIST; #define MAX_LEVEL_CONNECTIONS 16 // These are encoded in the lower 16bits of ENTITYTABLE->flags -typedef struct +typedef struct { int id; // Ordinal ID of this entity (used for entity <--> pointer conversions) edict_t *pent; // Pointer to the in-game entity @@ -348,7 +348,7 @@ typedef struct typedef struct saverestore_s SAVERESTOREDATA; #ifdef _WIN32 -typedef +typedef #endif struct saverestore_s { @@ -372,9 +372,9 @@ struct saverestore_s float time; char szCurrentMapName[32]; // To check global entities -} +} #ifdef _WIN32 -SAVERESTOREDATA +SAVERESTOREDATA #endif ; @@ -416,7 +416,7 @@ typedef enum _fieldtypes #define FTYPEDESC_GLOBAL 0x0001 // This field is masked for global entity save/restore -typedef struct +typedef struct { FIELDTYPE fieldType; char *fieldName; @@ -429,10 +429,10 @@ typedef struct #define ARRAYSIZE(p) (sizeof(p)/sizeof(p[0])) #endif -typedef struct +typedef struct { // Initialize/shutdown the game (one-time call after loading of game .dll ) - void (*pfnGameInit) ( void ); + void (*pfnGameInit) ( void ); int (*pfnSpawn) ( edict_t *pent ); void (*pfnThink) ( edict_t *pent ); void (*pfnUse) ( edict_t *pentUsed, edict_t *pentOther ); @@ -451,7 +451,7 @@ typedef struct void (*pfnResetGlobalState) ( void ); qboolean (*pfnClientConnect) ( edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ] ); - + void (*pfnClientDisconnect) ( edict_t *pEntity ); void (*pfnClientKill) ( edict_t *pEntity ); void (*pfnClientPutInServer) ( edict_t *pEntity ); @@ -469,10 +469,10 @@ typedef struct void (*pfnParmsChangeLevel) ( void ); // Returns string describing current .dll. E.g., TeamFotrress 2, Half-Life - const char *(*pfnGetGameDescription)( void ); + const char *(*pfnGetGameDescription)( void ); // Notify dll about a player customization. - void (*pfnPlayerCustomization) ( edict_t *pEntity, customization_t *pCustom ); + void (*pfnPlayerCustomization) ( edict_t *pEntity, customization_t *pCustom ); // Spectator funcs void (*pfnSpectatorConnect) ( edict_t *pEntity ); @@ -523,7 +523,7 @@ extern DLL_FUNCTIONS gEntityInterface; typedef struct { - // Called right before the object's memory is freed. + // Called right before the object's memory is freed. // Calls its destructor. void (*pfnOnFreeEntPrivateData)(edict_t *pEnt); void (*pfnGameShutdown)(void); diff --git a/AccuracyFix/include/cssdk/engine/maintypes.h b/AccuracyFix/include/cssdk/engine/maintypes.h index d4e4ac8..40ae20c 100644 --- a/AccuracyFix/include/cssdk/engine/maintypes.h +++ b/AccuracyFix/include/cssdk/engine/maintypes.h @@ -32,9 +32,11 @@ #pragma once #endif + #include "osconfig.h" #include "mathlib.h" + // Has no references on server side. #define NOXREF // Function body is not implemented. @@ -42,46 +44,9 @@ // Function is not tested at all. #define UNTESTED -#define CONST_INTEGER_AS_STRING(x) #x //Wraps the integer in quotes, allowing us to form constant strings with it -#define __HACK_LINE_AS_STRING__(x) CONST_INTEGER_AS_STRING(x) //__LINE__ can only be converted to an actual number by going through this, otherwise the output is literally "__LINE__" -#define __LINE__AS_STRING __HACK_LINE_AS_STRING__(__LINE__) //Gives you the line number in constant string form - -#if defined _MSC_VER || defined __INTEL_COMPILER -#define NOXREFCHECK int __retAddr; __asm { __asm mov eax, [ebp + 4] __asm mov __retAddr, eax }; Sys_Error("[NOXREFCHECK]: %s: (" __FILE__ ":" __LINE__AS_STRING ") NOXREF, but called from 0x%.08x", __func__, __retAddr) -#else -// For EBP based stack (older gcc) (uncomment version apropriate for your compiler) -//#define NOXREFCHECK int __retAddr; __asm__ __volatile__("movl 4(%%ebp), %%eax;" "movl %%eax, %0":"=r"(__retAddr)::"%eax"); Sys_Error("[NOXREFCHECK]: %s: (" __FILE__ ":" __LINE__AS_STRING ") NOXREF, but called from 0x%.08x", __func__, __retAddr); -// For ESP based stack (newer gcc) (uncomment version apropriate for your compiler) -#define NOXREFCHECK int __retAddr; __asm__ __volatile__("movl 16(%%esp), %%eax;" "movl %%eax, %0":"=r"(__retAddr)::"%eax"); Sys_Error("[NOXREFCHECK]: %s: (" __FILE__ ":" __LINE__AS_STRING ") NOXREF, but called from 0x%.08x", __func__, __retAddr); -#endif - #define BIT(n) (1<<(n)) -#ifdef HAVE_STRONG_TYPEDEF -enum class string_t: unsigned int {}; -#else -typedef unsigned int string_t; -#endif - -typedef int EOFFSET; -typedef int BOOL; -typedef unsigned char byte; -typedef unsigned short word; -#define _DEF_BYTE_ - -#ifndef __cplusplus - #undef true - #undef false - typedef enum {false, true} qboolean; -#else - typedef int qboolean; -#endif // #ifndef __cplusplus -// From engine/server.h -typedef enum sv_delta_s -{ - sv_packet_nodelta, - sv_packet_delta, -} sv_delta_t; +typedef unsigned int string_t; // from engine's pr_comp.h; #endif // MAINTYPES_H diff --git a/AccuracyFix/include/cssdk/engine/osconfig.h b/AccuracyFix/include/cssdk/engine/osconfig.h index 3a5d7b4..bf1585e 100644 --- a/AccuracyFix/include/cssdk/engine/osconfig.h +++ b/AccuracyFix/include/cssdk/engine/osconfig.h @@ -48,6 +48,7 @@ #include #ifdef _WIN32 // WINDOWS + #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #include #include #include // for support IPX diff --git a/AccuracyFix/include/cssdk/engine/pr_dlls.h b/AccuracyFix/include/cssdk/engine/pr_dlls.h deleted file mode 100644 index d7b72c1..0000000 --- a/AccuracyFix/include/cssdk/engine/pr_dlls.h +++ /dev/null @@ -1,51 +0,0 @@ -/* -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at -* your option) any later version. -* -* This program is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software Foundation, -* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -* In addition, as a special exception, the author gives permission to -* link the code of this program with the Half-Life Game Engine ("HL -* Engine") and Modified Game Libraries ("MODs") developed by Valve, -* L.L.C ("Valve"). You must obey the GNU General Public License in all -* respects for all of the code used other than the HL Engine and MODs -* from Valve. If you modify this file, you may extend this exception -* to your version of the file, but you are not obligated to do so. If -* you do not wish to do so, delete this exception statement from your -* version. -* -*/ - -#pragma once - -#include "maintypes.h" -#include "eiface.h" - -const int MAX_EXTENSION_DLL = 50; - -typedef struct functiontable_s -{ - uint32 pFunction; - char *pFunctionName; -} functiontable_t; - -typedef struct extensiondll_s -{ - void *lDLLHandle; - functiontable_t *functionTable; - int functionCount; -} extensiondll_t; - -typedef void(*ENTITYINIT)(struct entvars_s *); -typedef void(*DISPATCHFUNCTION)(struct entvars_s *, void *); -typedef void(*FIELDIOFUNCTION)(SAVERESTOREDATA *, const char *, void *, TYPEDESCRIPTION *, int); diff --git a/AccuracyFix/include/cssdk/engine/rehlds_api.h b/AccuracyFix/include/cssdk/engine/rehlds_api.h index 3e2b4ec..2f4a115 100644 --- a/AccuracyFix/include/cssdk/engine/rehlds_api.h +++ b/AccuracyFix/include/cssdk/engine/rehlds_api.h @@ -33,10 +33,9 @@ #include "FlightRecorder.h" #include "interface.h" #include "model.h" -#include "pr_dlls.h" #define REHLDS_API_VERSION_MAJOR 3 -#define REHLDS_API_VERSION_MINOR 13 +#define REHLDS_API_VERSION_MINOR 0 //Steam_NotifyClientConnect hook typedef IHookChain IRehldsHook_Steam_NotifyClientConnect; @@ -187,76 +186,8 @@ typedef IHookChain IRehldsHookRegistry_SV_CreatePacketEntities; //SV_EmitSound2 hook -typedef IHookChain IRehldsHook_SV_EmitSound2; -typedef IHookChainRegistry IRehldsHookRegistry_SV_EmitSound2; - -//CreateFakeClient hook -typedef IHookChain IRehldsHook_CreateFakeClient; -typedef IHookChainRegistry IRehldsHookRegistry_CreateFakeClient; - -//SV_CheckConnectionLessRateLimits -typedef IHookChain IRehldsHook_SV_CheckConnectionLessRateLimits; -typedef IHookChainRegistry IRehldsHookRegistry_SV_CheckConnectionLessRateLimits; - -//SV_Frame hook -typedef IVoidHookChain<> IRehldsHook_SV_Frame; -typedef IVoidHookChainRegistry<> IRehldsHookRegistry_SV_Frame; - -//SV_ShouldSendConsistencyList hook -typedef IHookChain IRehldsHook_SV_ShouldSendConsistencyList; -typedef IHookChainRegistry IRehldsHookRegistry_SV_ShouldSendConsistencyList; - -//GetEntityInit hook -typedef IHookChain IRehldsHook_GetEntityInit; -typedef IHookChainRegistry IRehldsHookRegistry_GetEntityInit; - -//SV_EmitPings hook -typedef IHookChain IRehldsHook_SV_EmitPings; -typedef IHookChainRegistry IRehldsHookRegistry_SV_EmitPings; - -//ED_Alloc hook -typedef IHookChain IRehldsHook_ED_Alloc; -typedef IHookChainRegistry IRehldsHookRegistry_ED_Alloc; - -//ED_Free hook -typedef IVoidHookChain IRehldsHook_ED_Free; -typedef IVoidHookChainRegistry IRehldsHookRegistry_ED_Free; - -//Con_Printf hook -typedef IHookChain IRehldsHook_Con_Printf; -typedef IHookChainRegistry IRehldsHookRegistry_Con_Printf; - -//SV_CheckUserInfo hook -typedef IHookChain IRehldsHook_SV_CheckUserInfo; -typedef IHookChainRegistry IRehldsHookRegistry_SV_CheckUserInfo; - -//PF_precache_generic_I hook -typedef IHookChain IRehldsHook_PF_precache_generic_I; -typedef IHookChainRegistry IRehldsHookRegistry_PF_precache_generic_I; - -//PF_precache_model_I hook -typedef IHookChain IRehldsHook_PF_precache_model_I; -typedef IHookChainRegistry IRehldsHookRegistry_PF_precache_model_I; - -//PF_precache_sound_I hook -typedef IHookChain IRehldsHook_PF_precache_sound_I; -typedef IHookChainRegistry IRehldsHookRegistry_PF_precache_sound_I; - -//EV_Precache hook -typedef IHookChain IRehldsHook_EV_Precache; -typedef IHookChainRegistry IRehldsHookRegistry_EV_Precache; - -//SV_AddResource hook -typedef IVoidHookChain IRehldsHook_SV_AddResource; -typedef IVoidHookChainRegistry IRehldsHookRegistry_SV_AddResource; - -//SV_ClientPrintf hook -typedef IVoidHookChain IRehldsHook_SV_ClientPrintf; -typedef IVoidHookChainRegistry IRehldsHookRegistry_SV_ClientPrintf; - -//SV_AllowPhysent hook -typedef IHookChain IRehldsHook_SV_AllowPhysent; -typedef IHookChainRegistry IRehldsHookRegistry_SV_AllowPhysent; +typedef IHookChain IRehldsHook_SV_EmitSound2; +typedef IHookChainRegistry IRehldsHookRegistry_SV_EmitSound2; class IRehldsHookchains { public: @@ -300,23 +231,6 @@ class IRehldsHookchains { virtual IRehldsHookRegistry_SV_Spawn_f* SV_Spawn_f() = 0; virtual IRehldsHookRegistry_SV_CreatePacketEntities* SV_CreatePacketEntities() = 0; virtual IRehldsHookRegistry_SV_EmitSound2* SV_EmitSound2() = 0; - virtual IRehldsHookRegistry_CreateFakeClient* CreateFakeClient() = 0; - virtual IRehldsHookRegistry_SV_CheckConnectionLessRateLimits* SV_CheckConnectionLessRateLimits() = 0; - virtual IRehldsHookRegistry_SV_Frame* SV_Frame() = 0; - virtual IRehldsHookRegistry_SV_ShouldSendConsistencyList* SV_ShouldSendConsistencyList() = 0; - virtual IRehldsHookRegistry_GetEntityInit* GetEntityInit() = 0; - virtual IRehldsHookRegistry_SV_EmitPings* SV_EmitPings() = 0; - virtual IRehldsHookRegistry_ED_Alloc* ED_Alloc() = 0; - virtual IRehldsHookRegistry_ED_Free* ED_Free() = 0; - virtual IRehldsHookRegistry_Con_Printf* Con_Printf() = 0; - virtual IRehldsHookRegistry_SV_CheckUserInfo* SV_CheckUserInfo() = 0; - virtual IRehldsHookRegistry_PF_precache_generic_I* PF_precache_generic_I() = 0; - virtual IRehldsHookRegistry_PF_precache_model_I* PF_precache_model_I() = 0; - virtual IRehldsHookRegistry_PF_precache_sound_I* PF_precache_sound_I() = 0; - virtual IRehldsHookRegistry_EV_Precache* EV_Precache() = 0; - virtual IRehldsHookRegistry_SV_AddResource* SV_AddResource() = 0; - virtual IRehldsHookRegistry_SV_ClientPrintf* SV_ClientPrintf() = 0; - virtual IRehldsHookRegistry_SV_AllowPhysent* SV_AllowPhysent() = 0; }; struct RehldsFuncs_t { @@ -383,4 +297,4 @@ class IRehldsApi { virtual IRehldsFlightRecorder* GetFlightRecorder() = 0; }; -#define VREHLDS_HLDS_API_VERSION "VREHLDS_HLDS_API_VERSION001" +#define VREHLDS_HLDS_API_VERSION "VREHLDS_HLDS_API_VERSION001" \ No newline at end of file diff --git a/AccuracyFix/include/cssdk/game_shared/bot/bot.h b/AccuracyFix/include/cssdk/game_shared/bot/bot.h index c391ec2..bb65d2a 100644 --- a/AccuracyFix/include/cssdk/game_shared/bot/bot.h +++ b/AccuracyFix/include/cssdk/game_shared/bot/bot.h @@ -88,7 +88,7 @@ class CBot: public CBasePlayer { // return true if we can see any part of the player virtual bool IsVisible(CBasePlayer *player, bool testFOV = false, unsigned char *visParts = NULL) const = 0; - enum VisiblePartType:uint8 + enum VisiblePartType : uint8 { NONE = 0x00, CHEST = 0x01, diff --git a/AccuracyFix/include/cssdk/game_shared/perf_counter.h b/AccuracyFix/include/cssdk/game_shared/counter.h similarity index 91% rename from AccuracyFix/include/cssdk/game_shared/perf_counter.h rename to AccuracyFix/include/cssdk/game_shared/counter.h index e99c700..0b55e02 100644 --- a/AccuracyFix/include/cssdk/game_shared/perf_counter.h +++ b/AccuracyFix/include/cssdk/game_shared/counter.h @@ -25,9 +25,11 @@ * version. * */ + #pragma once #ifdef _WIN32 + #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #include #include #include @@ -50,12 +52,12 @@ #include #include -class CPerformanceCounter +class CCounter { public: - CPerformanceCounter(); + CCounter(); - void InitializePerformanceCounter(); + bool Init(); double GetCurTime(); private: @@ -65,21 +67,22 @@ class CPerformanceCounter double m_flLastCurrentTime; }; -inline CPerformanceCounter::CPerformanceCounter() : +inline CCounter::CCounter() : m_iLowShift(0), m_flPerfCounterFreq(0), m_flCurrentTime(0), m_flLastCurrentTime(0) { - InitializePerformanceCounter(); + Init(); } -inline void CPerformanceCounter::InitializePerformanceCounter() +inline bool CCounter::Init() { #ifdef _WIN32 LARGE_INTEGER performanceFreq; - QueryPerformanceFrequency(&performanceFreq); + if (!QueryPerformanceFrequency(&performanceFreq)) + return false; // get 32 out of the 64 time bits such that we have around // 1 microsecond resolution @@ -99,9 +102,11 @@ inline void CPerformanceCounter::InitializePerformanceCounter() m_flPerfCounterFreq = 1.0 / (double)lowpart; #endif // _WIN32 + + return true; } -inline double CPerformanceCounter::GetCurTime() +inline double CCounter::GetCurTime() { #ifdef _WIN32 diff --git a/AccuracyFix/include/cssdk/game_shared/voice_gamemgr.h b/AccuracyFix/include/cssdk/game_shared/voice_gamemgr.h index e8fdca4..851c93a 100644 --- a/AccuracyFix/include/cssdk/game_shared/voice_gamemgr.h +++ b/AccuracyFix/include/cssdk/game_shared/voice_gamemgr.h @@ -41,9 +41,6 @@ class IVoiceGameMgrHelper { // Called each frame to determine which players are allowed to hear each other. This overrides // whatever squelch settings players have. virtual bool CanPlayerHearPlayer(CBasePlayer *pListener, CBasePlayer *pTalker) = 0; - virtual void ResetCanHearPlayer(edict_t* pEdict) = 0; - virtual void SetCanHearPlayer(CBasePlayer* pListener, CBasePlayer* pSender, bool bCanHear) = 0; - virtual bool GetCanHearPlayer(CBasePlayer* pListener, CBasePlayer* pSender) = 0; }; // CVoiceGameMgr manages which clients can hear which other clients. diff --git a/AccuracyFix/include/cssdk/pm_shared/pm_defs.h b/AccuracyFix/include/cssdk/pm_shared/pm_defs.h index 04bea26..9b5858d 100644 --- a/AccuracyFix/include/cssdk/pm_shared/pm_defs.h +++ b/AccuracyFix/include/cssdk/pm_shared/pm_defs.h @@ -25,6 +25,7 @@ * version. * */ + #pragma once #include "pm_info.h" @@ -189,4 +190,8 @@ typedef struct playermove_s const char *(*PM_TraceTexture)(int ground, float *vstart, float *vend); void (*PM_PlaybackEventFull)(int flags, int clientindex, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2); + pmtrace_t (*PM_PlayerTraceEx)(float *start, float *end, int traceFlags, int (*pfnIgnore)(physent_t *pe)); + int (*PM_TestPlayerPositionEx)(float *pos, pmtrace_t *ptrace, int (*pfnIgnore)(physent_t *pe)); + struct pmtrace_s *(*PM_TraceLineEx)(float *start, float *end, int flags, int usehulll, int (*pfnIgnore)(physent_t *pe)); + } playermove_t; diff --git a/AccuracyFix/include/cssdk/public/interface.cpp b/AccuracyFix/include/cssdk/public/interface.cpp index de0a184..e6de1be 100644 --- a/AccuracyFix/include/cssdk/public/interface.cpp +++ b/AccuracyFix/include/cssdk/public/interface.cpp @@ -121,14 +121,6 @@ void *Sys_GetProcAddress(void *pModuleHandle, const char *pName) return GetProcAddress((HMODULE)pModuleHandle, pName); } -// Purpose: Returns a module handle by its name. -// Input : pModuleName - module name -// Output : the module handle or NULL in case of an error -CSysModule *Sys_GetModuleHandle(const char *pModuleName) -{ - return reinterpret_cast(GetModuleHandle(pModuleName)); -} - // Purpose: Loads a DLL/component from disk and returns a handle to it // Input : *pModuleName - filename of the component // Output : opaque handle to the module (hides system dependency) diff --git a/AccuracyFix/include/cssdk/public/interface.h b/AccuracyFix/include/cssdk/public/interface.h index abe45b5..0aeaca4 100644 --- a/AccuracyFix/include/cssdk/public/interface.h +++ b/AccuracyFix/include/cssdk/public/interface.h @@ -114,8 +114,6 @@ extern CreateInterfaceFn Sys_GetFactory(const char *pModuleName); // load/unload components class CSysModule; -extern CSysModule *Sys_GetModuleHandle(const char *pModuleName); - // Load & Unload should be called in exactly one place for each module // The factory for that module should be passed on to dependent components for // proper versioning. diff --git a/AccuracyFix/include/cssdk/public/utlarray.h b/AccuracyFix/include/cssdk/public/utlarray.h deleted file mode 100644 index 6bdb413..0000000 --- a/AccuracyFix/include/cssdk/public/utlarray.h +++ /dev/null @@ -1,235 +0,0 @@ -/* -* -* Copyright (c) 1996-2002, Valve LLC. All rights reserved. -* -* This product contains software technology licensed from Id -* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. -* All Rights Reserved. -* -* Use, distribution, and modification of this source code and/or resulting -* object code is restricted to non-commercial enhancements to products from -* Valve LLC. All other use, distribution, or modification is prohibited -* without written permission from Valve LLC. -* -*/ - -#pragma once - -// A growable array class that maintains a free list and keeps elements -// in the same location -#include "tier0/platform.h" -#include "tier0/dbg.h" - -#define FOR_EACH_ARRAY(vecName, iteratorName)\ - for (int iteratorName = 0; (vecName).IsUtlArray && iteratorName < (vecName).Count(); iteratorName++) - -#define FOR_EACH_ARRAY_BACK(vecName, iteratorName)\ - for (int iteratorName = (vecName).Count() - 1; (vecName).IsUtlArray && iteratorName >= 0; iteratorName--) - -template -class CUtlArray -{ -public: - typedef T ElemType_t; - enum { IsUtlArray = true }; // Used to match this at compiletime - - CUtlArray(); - CUtlArray(T *pMemory, size_t count); - ~CUtlArray(); - - CUtlArray &operator=(const CUtlArray &other); - CUtlArray(CUtlArray const &vec); - - // element access - T &operator[](int i); - const T &operator[](int i) const; - T &Element(int i); - const T &Element(int i) const; - T &Random(); - const T &Random() const; - - T *Base(); - const T *Base() const; - - // Returns the number of elements in the array, NumAllocated() is included for consistency with UtlVector - int Count() const; - int NumAllocated() const; - - // Is element index valid? - bool IsValidIndex(int i) const; - static int InvalidIndex(); - - void CopyArray(const T *pArray, size_t count); - - void Clear(); - void RemoveAll(); - void Swap(CUtlArray< T, MAX_SIZE> &vec); - - // Finds an element (element needs operator== defined) - int Find(const T &src) const; - void FillWithValue(const T &src); - - bool HasElement(const T &src) const; - -protected: - T m_Memory[MAX_SIZE]; -}; - -// Constructor -template -inline CUtlArray::CUtlArray() -{ -} - -template -inline CUtlArray::CUtlArray(T *pMemory, size_t count) -{ - CopyArray(pMemory, count); -} - -// Destructor -template -inline CUtlArray::~CUtlArray() -{ -} - -template -inline CUtlArray &CUtlArray::operator=(const CUtlArray &other) -{ - if (this != &other) - { - for (size_t n = 0; n < MAX_SIZE; n++) - m_Memory[n] = other.m_Memory[n]; - } - - return *this; -} - -template -inline CUtlArray::CUtlArray(CUtlArray const &vec) -{ - for (size_t n = 0; n < MAX_SIZE; n++) - m_Memory[n] = vec.m_Memory[n]; -} - -template -inline T *CUtlArray::Base() -{ - return &m_Memory[0]; -} - -template -inline const T *CUtlArray::Base() const -{ - return &m_Memory[0]; -} - -// Element access -template -inline T &CUtlArray::operator[](int i) -{ - Assert(IsValidIndex(i)); - return m_Memory[i]; -} - -template -inline const T &CUtlArray::operator[](int i) const -{ - Assert(IsValidIndex(i)); - return m_Memory[i]; -} - -template -inline T &CUtlArray::Element(int i) -{ - Assert(IsValidIndex(i)); - return m_Memory[i]; -} - -template -inline const T &CUtlArray::Element(int i) const -{ - Assert(IsValidIndex(i)); - return m_Memory[i]; -} - -// Count -template -inline int CUtlArray::Count() const -{ - return (int)MAX_SIZE; -} - -template -inline int CUtlArray::NumAllocated() const -{ - return (int)MAX_SIZE; -} - -// Is element index valid? -template -inline bool CUtlArray::IsValidIndex(int i) const -{ - return (i >= 0) && (i < MAX_SIZE); -} - -// Returns in invalid index -template -inline int CUtlArray::InvalidIndex() -{ - return -1; -} - -template -void CUtlArray::CopyArray(const T *pArray, size_t count) -{ - Assert(count < MAX_SIZE); - - for (size_t n = 0; n < count; n++) - m_Memory[n] = pArray[n]; -} - -template -void CUtlArray::Clear() -{ - Q_memset(m_Memory, 0, MAX_SIZE * sizeof(T)); -} - -template -void CUtlArray::RemoveAll() -{ - Clear(); -} - -template -void CUtlArray::Swap(CUtlArray< T, MAX_SIZE> &vec) -{ - for (size_t n = 0; n < MAX_SIZE; n++) - SWAP(m_Memory[n], vec.m_Memory[n]); -} - -// Finds an element (element needs operator== defined) -template -int CUtlArray::Find(const T &src) const -{ - for (int i = 0; i < Count(); i++) - { - if (Element(i) == src) - return i; - } - - return -1; -} - -template -void CUtlArray::FillWithValue(const T &src) -{ - for (int i = 0; i < Count(); i++) - Element(i) = src; -} - -template -bool CUtlArray::HasElement(const T &src) const -{ - return (Find(src) >= 0); -} diff --git a/AccuracyFix/include/cssdk/public/utlmemory.h b/AccuracyFix/include/cssdk/public/utlmemory.h index 4aecc6c..4f75f81 100644 --- a/AccuracyFix/include/cssdk/public/utlmemory.h +++ b/AccuracyFix/include/cssdk/public/utlmemory.h @@ -26,7 +26,12 @@ * */ +#ifndef UTLMEMORY_H +#define UTLMEMORY_H + +#ifdef _WIN32 #pragma once +#endif #include "osconfig.h" #include "tier0/dbg.h" @@ -35,56 +40,55 @@ #pragma warning (disable:4100) #pragma warning (disable:4514) +/*template +inline void Construct(T *pMemory) +{ + ::new(pMemory) T; +} + +template +inline void CopyConstruct(T *pMemory,T const& src) +{ + ::new(pMemory) T(src); +} + +template +inline void Destruct(T *pMemory) +{ + pMemory->~T(); + +#ifdef _DEBUG + memset(pMemory,0xDD,sizeof(T)); +#endif +}*/ +//----------------------------------------------------------------------------- // The CUtlMemory class: // A growable memory class which doubles in size by default. -template +//----------------------------------------------------------------------------- +template< class T > class CUtlMemory { public: // constructor, destructor CUtlMemory(int nGrowSize = 0, int nInitSize = 0); - CUtlMemory(T *pMemory, int numElements); + CUtlMemory(T* pMemory, int numElements); ~CUtlMemory(); - // Set the size by which the memory grows - void Init(int nGrowSize = 0, int nInitSize = 0); - - class Iterator_t - { - public: - Iterator_t(I i) : m_index(i) {} - I m_index; - - bool operator==(const Iterator_t it) const { return m_index == it.m_index; } - bool operator!=(const Iterator_t it) const { return m_index != it.m_index; } - }; - - Iterator_t First() const { return Iterator_t(IsIdxValid(0) ? 0 : InvalidIndex()); } - Iterator_t Next(const Iterator_t &it) const { return Iterator_t(IsIdxValid(it.index + 1) ? it.index + 1 : InvalidIndex()); } - I GetIndex(const Iterator_t &it) const { return it.index; } - bool IsIdxAfter(I i, const Iterator_t &it) const { return i > it.index; } - bool IsValidIterator(const Iterator_t &it) const { return IsIdxValid(it.index); } - Iterator_t InvalidIterator() const { return Iterator_t(InvalidIndex()); } - // element access - T& Element(I i); - T const& Element(I i) const; - T& operator[](I i); - T const& operator[](I i) const; + T& operator[](int i); + T const& operator[](int i) const; + T& Element(int i); + T const& Element(int i) const; // Can we use this index? - bool IsIdxValid(I i) const; - - // Specify the invalid ('null') index that we'll only return on failure - static const I INVALID_INDEX = (I)-1; // For use with COMPILE_TIME_ASSERT - static I InvalidIndex() { return INVALID_INDEX; } + bool IsIdxValid(int i) const; // Gets the base address (can change when adding elements!) - T *Base(); - T const *Base() const; + T* Base(); + T const* Base() const; // Attaches the buffer to external memory.... - void SetExternalBuffer(T *pMemory, int numElements); + void SetExternalBuffer(T* pMemory, int numElements); // Size int NumAllocated() const; @@ -111,54 +115,46 @@ class CUtlMemory EXTERNAL_BUFFER_MARKER = -1, }; - T *m_pMemory; + T* m_pMemory; int m_nAllocationCount; int m_nGrowSize; }; + +//----------------------------------------------------------------------------- // constructor, destructor -template -CUtlMemory::CUtlMemory(int nGrowSize, int nInitSize) : m_pMemory(0), -m_nAllocationCount(nInitSize), m_nGrowSize(nGrowSize) +//----------------------------------------------------------------------------- +template< class T > +CUtlMemory::CUtlMemory(int nGrowSize, int nInitAllocationCount) : m_pMemory(0), +m_nAllocationCount(nInitAllocationCount), m_nGrowSize(nGrowSize) { Assert((nGrowSize >= 0) && (nGrowSize != EXTERNAL_BUFFER_MARKER)); if (m_nAllocationCount) { - m_pMemory = (T *)malloc(m_nAllocationCount * sizeof(T)); + m_pMemory = (T*)malloc(m_nAllocationCount * sizeof(T)); } } -template -CUtlMemory::CUtlMemory(T *pMemory, int numElements) : m_pMemory(pMemory), +template< class T > +CUtlMemory::CUtlMemory(T* pMemory, int numElements) : m_pMemory(pMemory), m_nAllocationCount(numElements) { // Special marker indicating externally supplied memory m_nGrowSize = EXTERNAL_BUFFER_MARKER; } -template -CUtlMemory::~CUtlMemory() +template< class T > +CUtlMemory::~CUtlMemory() { Purge(); } -template -void CUtlMemory::Init(int nGrowSize, int nInitSize) -{ - Purge(); - - m_nGrowSize = nGrowSize; - m_nAllocationCount = nInitSize; - Assert(nGrowSize >= 0); - if (m_nAllocationCount) - { - m_pMemory = (T *)malloc(m_nAllocationCount * sizeof(T)); - } -} +//----------------------------------------------------------------------------- // Attaches the buffer to external memory.... -template -void CUtlMemory::SetExternalBuffer(T *pMemory, int numElements) +//----------------------------------------------------------------------------- +template< class T > +void CUtlMemory::SetExternalBuffer(T* pMemory, int numElements) { // Blow away any existing allocated memory Purge(); @@ -170,91 +166,110 @@ void CUtlMemory::SetExternalBuffer(T *pMemory, int numElements) m_nGrowSize = EXTERNAL_BUFFER_MARKER; } + +//----------------------------------------------------------------------------- // element access -template -inline T& CUtlMemory::operator[](I i) +//----------------------------------------------------------------------------- +template< class T > +inline T& CUtlMemory::operator[](int i) { Assert(IsIdxValid(i)); return m_pMemory[i]; } -template -inline T const& CUtlMemory::operator[](I i) const +template< class T > +inline T const& CUtlMemory::operator[](int i) const { Assert(IsIdxValid(i)); return m_pMemory[i]; } -template -inline T& CUtlMemory::Element(I i) +template< class T > +inline T& CUtlMemory::Element(int i) { Assert(IsIdxValid(i)); return m_pMemory[i]; } -template -inline T const& CUtlMemory::Element(I i) const +template< class T > +inline T const& CUtlMemory::Element(int i) const { Assert(IsIdxValid(i)); return m_pMemory[i]; } + +//----------------------------------------------------------------------------- // is the memory externally allocated? -template -bool CUtlMemory::IsExternallyAllocated() const +//----------------------------------------------------------------------------- +template< class T > +bool CUtlMemory::IsExternallyAllocated() const { return m_nGrowSize == EXTERNAL_BUFFER_MARKER; } -template -void CUtlMemory::SetGrowSize(int nSize) + +template< class T > +void CUtlMemory::SetGrowSize(int nSize) { Assert((nSize >= 0) && (nSize != EXTERNAL_BUFFER_MARKER)); m_nGrowSize = nSize; } + +//----------------------------------------------------------------------------- // Gets the base address (can change when adding elements!) -template -inline T *CUtlMemory::Base() +//----------------------------------------------------------------------------- +template< class T > +inline T* CUtlMemory::Base() { return m_pMemory; } -template -inline T const *CUtlMemory::Base() const +template< class T > +inline T const* CUtlMemory::Base() const { return m_pMemory; } + +//----------------------------------------------------------------------------- // Size -template -inline int CUtlMemory::NumAllocated() const +//----------------------------------------------------------------------------- +template< class T > +inline int CUtlMemory::NumAllocated() const { return m_nAllocationCount; } -template -inline int CUtlMemory::Count() const +template< class T > +inline int CUtlMemory::Count() const { return m_nAllocationCount; } + +//----------------------------------------------------------------------------- // Is element index valid? -template -inline bool CUtlMemory::IsIdxValid(I i) const +//----------------------------------------------------------------------------- +template< class T > +inline bool CUtlMemory::IsIdxValid(int i) const { - return (((int)i) >= 0) && (((int) i) < m_nAllocationCount); + return (i >= 0) && (i < m_nAllocationCount); } + +//----------------------------------------------------------------------------- // Grows the memory -template -void CUtlMemory::Grow(int num) +//----------------------------------------------------------------------------- +template< class T > +void CUtlMemory::Grow(int num) { Assert(num > 0); if (IsExternallyAllocated()) { - // Can't grow a buffer whose memory was externally allocated + // Can't grow a buffer whose memory was externally allocated Assert(0); return; } @@ -285,24 +300,27 @@ void CUtlMemory::Grow(int num) if (m_pMemory) { - m_pMemory = (T *)realloc(m_pMemory, m_nAllocationCount * sizeof(T)); + m_pMemory = (T*)realloc(m_pMemory, m_nAllocationCount * sizeof(T)); } else { - m_pMemory = (T *)malloc(m_nAllocationCount * sizeof(T)); + m_pMemory = (T*)malloc(m_nAllocationCount * sizeof(T)); } } + +//----------------------------------------------------------------------------- // Makes sure we've got at least this much memory -template -inline void CUtlMemory::EnsureCapacity(int num) +//----------------------------------------------------------------------------- +template< class T > +inline void CUtlMemory::EnsureCapacity(int num) { if (m_nAllocationCount >= num) return; if (IsExternallyAllocated()) { - // Can't grow a buffer whose memory was externally allocated + // Can't grow a buffer whose memory was externally allocated Assert(0); return; } @@ -310,25 +328,30 @@ inline void CUtlMemory::EnsureCapacity(int num) m_nAllocationCount = num; if (m_pMemory) { - m_pMemory = (T *)realloc(m_pMemory, m_nAllocationCount * sizeof(T)); + m_pMemory = (T*)realloc(m_pMemory, m_nAllocationCount * sizeof(T)); } else { - m_pMemory = (T *)malloc(m_nAllocationCount * sizeof(T)); + m_pMemory = (T*)malloc(m_nAllocationCount * sizeof(T)); } } + +//----------------------------------------------------------------------------- // Memory deallocation -template -void CUtlMemory::Purge() +//----------------------------------------------------------------------------- +template< class T > +void CUtlMemory::Purge() { if (!IsExternallyAllocated()) { if (m_pMemory) { - free((void *)m_pMemory); + free((void*)m_pMemory); m_pMemory = 0; } m_nAllocationCount = 0; } } + +#endif // UTLMEMORY_H