From 815558d55f134d700a2c99c7d737ab683c620e1a Mon Sep 17 00:00:00 2001 From: wootguy Date: Tue, 19 Nov 2024 04:06:28 -0800 Subject: [PATCH] split cbase into multiple files --- cl_dll/hl/hl_baseentity.cpp | 2 + common/const.h | 175 +++++ dlls/CBaseAnimating.cpp | 1 - dlls/CBaseAnimating.h | 44 ++ dlls/CBaseDelay.cpp | 1 - dlls/CBaseDelay.h | 22 + dlls/CBaseEntity.cpp | 1 - dlls/CBaseEntity.h | 371 ++++++++++ dlls/CBaseToggle.cpp | 1 - dlls/CBaseToggle.h | 69 ++ dlls/CGlobalState.cpp | 1 - dlls/CMakeLists.txt | 11 +- dlls/CNullEntity.cpp | 1 - dlls/CPointEntity.cpp | 2 +- dlls/CPointEntity.h | 11 + dlls/CWorld.cpp | 2 +- dlls/CWorld.h | 26 + dlls/EHandle.cpp | 67 ++ dlls/EHandle.h | 23 + dlls/cbase.cpp | 603 ---------------- dlls/cbase.h | 884 ----------------------- dlls/env/CAmbientGeneric.cpp | 1 - dlls/env/CAmbientGeneric.h | 1 + dlls/env/CBeam.cpp | 1 - dlls/env/CBlood.cpp | 1 - dlls/env/CBloodSplat.cpp | 1 - dlls/env/CBubbling.cpp | 1 - dlls/env/CCorpse.cpp | 2 +- dlls/env/CDecal.cpp | 1 - dlls/env/CEnvBeverage.cpp | 1 - dlls/env/CEnvExplosion.cpp | 1 - dlls/env/CEnvFunnel.cpp | 1 - dlls/env/CEnvGlobal.cpp | 1 - dlls/env/CEnvLight.cpp | 1 - dlls/env/CEnvSentence.cpp | 1 - dlls/env/CEnvShooter.cpp | 1 - dlls/env/CEnvSound.cpp | 1 - dlls/env/CEnvSpark.cpp | 1 - dlls/env/CFade.cpp | 1 - dlls/env/CGib.cpp | 1 - dlls/env/CGibShooter.cpp | 1 - dlls/env/CGlow.cpp | 1 - dlls/env/CLaser.cpp | 1 - dlls/env/CLight.cpp | 1 - dlls/env/CLightning.cpp | 1 - dlls/env/CMessage.cpp | 1 - dlls/env/CShake.cpp | 1 - dlls/env/CShower.cpp | 1 - dlls/env/CSoundEnt.cpp | 1 - dlls/env/CSoundEnt.h | 2 + dlls/env/CSpeaker.cpp | 1 - dlls/env/CSprayCan.cpp | 1 - dlls/env/CSprite.cpp | 1 - dlls/env/CSprite.h | 1 + dlls/env/CTestEffect.cpp | 1 - dlls/func/CBaseButton.cpp | 1 - dlls/func/CBaseButton.h | 2 +- dlls/func/CBaseDoor.cpp | 1 - dlls/func/CBaseDoor.h | 19 + dlls/func/CBasePlatTrain.cpp | 1 - dlls/func/CBreakable.cpp | 1 - dlls/func/CBreakable.h | 1 + dlls/func/CButtonTarget.cpp | 1 - dlls/func/CFuncClip.cpp | 2 +- dlls/func/CFuncConveyor.cpp | 1 - dlls/func/CFuncIllusionary.cpp | 2 +- dlls/func/CFuncMonsterClip.cpp | 1 - dlls/func/CFuncMortarField.cpp | 1 - dlls/func/CFuncPendulum.cpp | 1 - dlls/func/CFuncPlat.cpp | 1 - dlls/func/CFuncPlatRot.cpp | 1 - dlls/func/CFuncRotating.cpp | 2 +- dlls/func/CFuncTank.cpp | 1 - dlls/func/CFuncTankControls.cpp | 1 - dlls/func/CFuncTankGun.cpp | 1 - dlls/func/CFuncTankLaser.cpp | 1 - dlls/func/CFuncTankMortar.cpp | 1 - dlls/func/CFuncTankRocket.cpp | 1 - dlls/func/CFuncTrackChange.cpp | 1 - dlls/func/CFuncTrackTrain.cpp | 1 - dlls/func/CFuncTrain.cpp | 1 - dlls/func/CFuncTrainControls.cpp | 1 - dlls/func/CFuncVehicle.cpp | 1 - dlls/func/CFuncWall.cpp | 1 - dlls/func/CFuncWallToggle.cpp | 1 - dlls/func/CGunTarget.cpp | 1 - dlls/func/CLadder.cpp | 1 - dlls/func/CMomentaryDoor.cpp | 1 - dlls/func/CMomentaryRotButton.cpp | 1 - dlls/func/CPlatTrigger.cpp | 1 - dlls/func/CPushable.cpp | 1 - dlls/func/CRecharge.cpp | 1 - dlls/func/CRotButton.cpp | 1 - dlls/func/CRotDoor.cpp | 1 - dlls/game/game.cpp | 1 - dlls/game/gamerules.cpp | 2 +- dlls/game/gamerules.h | 1 + dlls/game/globals.cpp | 1 - dlls/game/multiplay_gamerules.cpp | 1 - dlls/game/singleplay_gamerules.cpp | 1 - dlls/game/teamplay_gamerules.cpp | 1 - dlls/game/user_messages.cpp | 1 - dlls/game/user_messages.h | 8 + dlls/hooks/PluginManager.cpp | 1 - dlls/hooks/client_commands.cpp | 1 - dlls/hooks/h_export.cpp | 2 - dlls/hooks/hlds_hooks.cpp | 500 ++++++++++++- dlls/hooks/hlds_hooks.h | 29 + dlls/hooks/rehlds_hooks.cpp | 1 - dlls/item/CAirtank.cpp | 1 - dlls/item/CHealthKit.cpp | 1 - dlls/item/CItem.cpp | 1 - dlls/item/CItemAntidote.cpp | 1 - dlls/item/CItemBattery.cpp | 1 - dlls/item/CItemGeneric.cpp | 1 - dlls/item/CItemLongJump.cpp | 1 - dlls/item/CItemSecurity.cpp | 1 - dlls/item/CItemSoda.cpp | 1 - dlls/item/CItemSuit.cpp | 1 - dlls/item/CWorldItem.cpp | 1 - dlls/monster/CAGrunt.cpp | 1 - dlls/monster/CActAnimating.cpp | 1 - dlls/monster/CActAnimating.h | 1 + dlls/monster/CApache.cpp | 1 - dlls/monster/CBabyGarg.cpp | 1 - dlls/monster/CBabyVoltigore.cpp | 1 - dlls/monster/CBarnacle.cpp | 1 - dlls/monster/CBarney.cpp | 1 - dlls/monster/CBaseGrunt.cpp | 1 - dlls/monster/CBaseGruntOp4.cpp | 1 - dlls/monster/CBaseMonster.cpp | 2 +- dlls/monster/CBaseMonster.h | 5 + dlls/monster/CBaseTurret.cpp | 1 - dlls/monster/CBigMomma.cpp | 1 - dlls/monster/CBloater.cpp | 1 - dlls/monster/CBodyGuard.cpp | 1 - dlls/monster/CBullsquid.cpp | 1 - dlls/monster/CChumtoad.cpp | 1 - dlls/monster/CCineAI.cpp | 1 - dlls/monster/CCineMonster.cpp | 1 - dlls/monster/CController.cpp | 2 +- dlls/monster/CCycler.cpp | 1 - dlls/monster/CDeadHEV.cpp | 1 - dlls/monster/CFlockingFlyerFlock.cpp | 1 - dlls/monster/CFlyingMonster.cpp | 1 - dlls/monster/CFurniture.cpp | 1 - dlls/monster/CGMan.cpp | 1 - dlls/monster/CGargantua.cpp | 1 - dlls/monster/CGenericMonster.cpp | 1 - dlls/monster/CGonome.cpp | 1 - dlls/monster/CHAssassin.cpp | 1 - dlls/monster/CHGrunt.cpp | 1 - dlls/monster/CHGruntOp4.cpp | 1 - dlls/monster/CHGruntOp4Medic.cpp | 1 - dlls/monster/CHGruntOp4Torch.cpp | 1 - dlls/monster/CHWGrunt.cpp | 1 - dlls/monster/CHeadCrab.cpp | 1 - dlls/monster/CHornet.cpp | 1 - dlls/monster/CHoundeye.cpp | 1 - dlls/monster/CISlave.cpp | 1 - dlls/monster/CIchthyosaur.cpp | 1 - dlls/monster/CLeech.cpp | 1 - dlls/monster/CMassn.cpp | 1 - dlls/monster/CMiniTurret.cpp | 1 - dlls/monster/CMonsterMaker.cpp | 1 - dlls/monster/CNihilanth.cpp | 1 - dlls/monster/COsprey.cpp | 1 - dlls/monster/COtis.cpp | 1 - dlls/monster/CPitdrone.cpp | 1 - dlls/monster/CPlayerMonster.cpp | 1 - dlls/monster/CRat.cpp | 1 - dlls/monster/CRoach.cpp | 1 - dlls/monster/CRoboGrunt.cpp | 1 - dlls/monster/CScientist.cpp | 1 - dlls/monster/CScriptedSentence.cpp | 1 - dlls/monster/CSentry.cpp | 1 - dlls/monster/CShockRoach.cpp | 1 - dlls/monster/CShockTrooper.cpp | 1 - dlls/monster/CSqueakGrenade.cpp | 1 - dlls/monster/CTalkSquadMonster.cpp | 1 - dlls/monster/CTentacle.cpp | 1 - dlls/monster/CTor.cpp | 1 - dlls/monster/CTurret.cpp | 1 - dlls/monster/CVoltigore.cpp | 1 - dlls/monster/CXenHair.cpp | 1 - dlls/monster/CXenPLight.cpp | 1 - dlls/monster/CXenSpore.cpp | 1 - dlls/monster/CXenTree.cpp | 1 - dlls/monster/CZombie.cpp | 1 - dlls/monster/defaultai.cpp | 1 - dlls/monster/h_ai.cpp | 1 - dlls/monster/nodes.cpp | 1 - dlls/monster/nodes.h | 2 + dlls/monster/tempmonster.cpp | 1 - dlls/path/CPathCorner.cpp | 1 - dlls/path/CPathTrack.cpp | 1 - dlls/path/CPathTrack.h | 1 + dlls/player/CBaseDMStart.cpp | 1 - dlls/player/CBaseDMStart.h | 1 + dlls/player/CBasePlayer.cpp | 2 +- dlls/player/CBaseSpectator.cpp | 1 - dlls/triggers/CAutoTrigger.cpp | 2 +- dlls/triggers/CBaseLogic.h | 3 +- dlls/triggers/CBaseTrigger.cpp | 2 +- dlls/triggers/CBaseTrigger.h | 1 + dlls/triggers/CChangeLevel.cpp | 2 +- dlls/triggers/CFireAndDie.cpp | 1 - dlls/triggers/CFireAndDie.h | 1 + dlls/triggers/CFrictionModifier.cpp | 1 - dlls/triggers/CGameCounter.cpp | 2 +- dlls/triggers/CGameEnd.cpp | 1 - dlls/triggers/CGamePlayerCounter.cpp | 2 +- dlls/triggers/CGamePlayerEquip.cpp | 1 - dlls/triggers/CGamePlayerHurt.cpp | 1 - dlls/triggers/CGamePlayerZone.cpp | 1 - dlls/triggers/CGameScore.cpp | 1 - dlls/triggers/CGameText.cpp | 1 - dlls/triggers/CMultiManager.cpp | 1 - dlls/triggers/CMultiSource.cpp | 2 +- dlls/triggers/CMultiSource.h | 24 + dlls/triggers/CPlayerRespawnZone.cpp | 1 - dlls/triggers/CRenderFxManager.cpp | 1 - dlls/triggers/CRevertSaved.cpp | 1 - dlls/triggers/CRuleEntity.cpp | 1 - dlls/triggers/CStripWeapons.cpp | 1 - dlls/triggers/CTargetCDAudio.cpp | 1 - dlls/triggers/CTriggerCDAudio.cpp | 1 - dlls/triggers/CTriggerCamera.cpp | 1 - dlls/triggers/CTriggerChangeSky.cpp | 1 - dlls/triggers/CTriggerChangeTarget.cpp | 1 - dlls/triggers/CTriggerChangeValue.cpp | 2 +- dlls/triggers/CTriggerCondition.cpp | 1 - dlls/triggers/CTriggerCounter.cpp | 1 - dlls/triggers/CTriggerCreateEntity.cpp | 1 - dlls/triggers/CTriggerEndSection.cpp | 1 - dlls/triggers/CTriggerEntityIterator.cpp | 1 - dlls/triggers/CTriggerGravity.cpp | 1 - dlls/triggers/CTriggerHurt.cpp | 1 - dlls/triggers/CTriggerHurtRemote.cpp | 1 - dlls/triggers/CTriggerMonsterJump.cpp | 1 - dlls/triggers/CTriggerMultiple.cpp | 1 - dlls/triggers/CTriggerOnce.cpp | 1 - dlls/triggers/CTriggerPush.cpp | 1 - dlls/triggers/CTriggerRandom.cpp | 1 - dlls/triggers/CTriggerRelay.cpp | 1 - dlls/triggers/CTriggerRenamePlayer.cpp | 1 - dlls/triggers/CTriggerRespawn.cpp | 1 - dlls/triggers/CTriggerSave.cpp | 1 - dlls/triggers/CTriggerSetOrigin.cpp | 1 - dlls/triggers/CTriggerTeleport.cpp | 1 - dlls/triggers/CTriggerVolume.cpp | 1 - dlls/triggers/CTriggerVote.cpp | 1 - dlls/triggers/CTriggerVote.h | 1 + dlls/util/TextMenu.h | 2 +- dlls/util/eng_wrappers.cpp | 2 +- dlls/util/lagcomp.cpp | 1 - dlls/util/saverestore.cpp | 2 +- dlls/util/sound.cpp | 1 - dlls/util/subs.cpp | 1 - dlls/util/util.cpp | 2 +- dlls/util/util.h | 12 +- dlls/weapon/CBasePlayerAmmo.cpp | 1 - dlls/weapon/CBasePlayerAmmo.h | 1 - dlls/weapon/CBasePlayerItem.cpp | 1 - dlls/weapon/CBasePlayerItem.h | 2 +- dlls/weapon/CBasePlayerWeapon.cpp | 1 - dlls/weapon/CCrossbow.cpp | 1 - dlls/weapon/CCrowbar.cpp | 1 - dlls/weapon/CDisplacer.cpp | 1 - dlls/weapon/CDisplacerBall.cpp | 2 - dlls/weapon/CEgon.cpp | 1 - dlls/weapon/CGauss.cpp | 1 - dlls/weapon/CGlock.cpp | 1 - dlls/weapon/CGrapple.cpp | 1 - dlls/weapon/CGrappleTip.cpp | 1 - dlls/weapon/CGrenade.cpp | 1 - dlls/weapon/CHandGrenade.cpp | 1 - dlls/weapon/CHgun.cpp | 1 - dlls/weapon/CMP5.cpp | 1 - dlls/weapon/CMortar.cpp | 1 - dlls/weapon/CPipewrench.cpp | 1 - dlls/weapon/CPython.cpp | 1 - dlls/weapon/CRpg.cpp | 1 - dlls/weapon/CSatchel.cpp | 1 - dlls/weapon/CShockBeam.cpp | 1 - dlls/weapon/CShockRifle.cpp | 1 - dlls/weapon/CShotgun.cpp | 1 - dlls/weapon/CSpore.cpp | 1 - dlls/weapon/CSporeLauncher.cpp | 1 - dlls/weapon/CSqueak.cpp | 1 - dlls/weapon/CTripmine.cpp | 1 - dlls/weapon/CWeaponBox.cpp | 1 - dlls/weapon/combat.cpp | 1 - dlls/weapon/weapons.cpp | 1 - game_shared/voice_gamemgr.cpp | 1 - 295 files changed, 1442 insertions(+), 1767 deletions(-) create mode 100644 dlls/CBaseAnimating.h create mode 100644 dlls/CBaseDelay.h create mode 100644 dlls/CBaseEntity.h create mode 100644 dlls/CBaseToggle.h create mode 100644 dlls/CPointEntity.h create mode 100644 dlls/CWorld.h create mode 100644 dlls/EHandle.cpp create mode 100644 dlls/EHandle.h delete mode 100644 dlls/cbase.cpp delete mode 100644 dlls/cbase.h create mode 100644 dlls/triggers/CMultiSource.h diff --git a/cl_dll/hl/hl_baseentity.cpp b/cl_dll/hl/hl_baseentity.cpp index 9dd785de..c422c829 100644 --- a/cl_dll/hl/hl_baseentity.cpp +++ b/cl_dll/hl/hl_baseentity.cpp @@ -24,7 +24,9 @@ This file contains "stubs" of class member implementations so that we can predic #include "extdll.h" #include "util.h" #include "cbase.h" +#include "CWorld.h" #include "CBasePlayer.h" +#include "CMultiSource.h" #include "weapon/weapons.h" #include "nodes.h" #include "env/CSoundEnt.h" diff --git a/common/const.h b/common/const.h index 2c557912..91955bd0 100644 --- a/common/const.h +++ b/common/const.h @@ -704,6 +704,181 @@ #define TE_BOUNCE_SHELL 1 #define TE_BOUNCE_SHOTSHELL 2 +#define MAX_PATH_SIZE 10 // max number of nodes available for a path. + +// 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_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_DIRECTIONAL_USE 0x00000040 // Player sends +/- 1 when using (currently only tracktrains) +#define FCAP_MASTER 0x00000080 // Can be used to "master" other entities (like multisource) + +// UNDONE: This will ignore transition volumes (trigger_transition), but not the PVS!!! +#define FCAP_FORCE_TRANSITION 0x00000080 // ALWAYS goes across transitions + +// For CLASSIFY +#define CLASS_NONE 0 +#define CLASS_MACHINE 1 +#define CLASS_PLAYER 2 +#define CLASS_HUMAN_PASSIVE 3 +#define CLASS_HUMAN_MILITARY 4 +#define CLASS_ALIEN_MILITARY 5 +#define CLASS_ALIEN_PASSIVE 6 +#define CLASS_ALIEN_MONSTER 7 +#define CLASS_ALIEN_PREY 8 +#define CLASS_ALIEN_PREDATOR 9 +#define CLASS_INSECT 10 +#define CLASS_PLAYER_ALLY 11 +#define CLASS_PLAYER_BIOWEAPON 12 // hornets and snarks.launched by players +#define CLASS_ALIEN_BIOWEAPON 13 // hornets and snarks.launched by the alien menace +#define CLASS_ALIEN_RACE_X 14 +#define CLASS_ALIEN_RACE_X_PITDRONE 15 // TODO: use this +#define CLASS_VEHICLE 16 +#define CLASS_BARNACLE 99 // special because no one pays attention to it, and it eats a wide cross-section of creatures. + +#define SF_NORESPAWN ( 1 << 10 )// !!!set this bit on guns and stuff that should never respawn. + +#define MAX_MULTI_TARGETS 64 // maximum number of targets a single multi_manager entity may be assigned. +#define MS_MAX_TARGETS 32 + +// people gib if their health is <= this at the time of death +#define GIB_HEALTH_VALUE -30 + +#define ROUTE_SIZE 8 // how many waypoints a monster can store at one time +#define MAX_OLD_ENEMIES 4 // how many old enemies to remember + +#define bits_CAP_DUCK ( 1 << 0 )// crouch +#define bits_CAP_JUMP ( 1 << 1 )// jump/leap +#define bits_CAP_STRAFE ( 1 << 2 )// strafe ( walk/run sideways) +#define bits_CAP_SQUAD ( 1 << 3 )// can form squads +#define bits_CAP_SWIM ( 1 << 4 )// proficiently navigate in water +#define bits_CAP_CLIMB ( 1 << 5 )// climb ladders/ropes +#define bits_CAP_USE ( 1 << 6 )// open doors/push buttons/pull levers +#define bits_CAP_HEAR ( 1 << 7 )// can hear forced sounds +#define bits_CAP_AUTO_DOORS ( 1 << 8 )// can trigger auto doors +#define bits_CAP_OPEN_DOORS ( 1 << 9 )// can open manual doors +#define bits_CAP_TURN_HEAD ( 1 << 10)// can turn head, always bone controller 0 + +#define bits_CAP_RANGE_ATTACK1 ( 1 << 11)// can do a range attack 1 +#define bits_CAP_RANGE_ATTACK2 ( 1 << 12)// can do a range attack 2 +#define bits_CAP_MELEE_ATTACK1 ( 1 << 13)// can do a melee attack 1 +#define bits_CAP_MELEE_ATTACK2 ( 1 << 14)// can do a melee attack 2 + +#define bits_CAP_FLY ( 1 << 15)// can fly, move all around + +#define bits_CAP_DOORS_GROUP (bits_CAP_USE | bits_CAP_AUTO_DOORS | bits_CAP_OPEN_DOORS) + +// used by suit voice to indicate damage sustained and repaired type to player + +// instant damage + +#define DMG_GENERIC 0 // generic damage was done +#define DMG_CRUSH (1 << 0) // crushed by falling or moving object +#define DMG_BULLET (1 << 1) // shot +#define DMG_SLASH (1 << 2) // cut, clawed, stabbed +#define DMG_BURN (1 << 3) // heat burned +#define DMG_FREEZE (1 << 4) // frozen +#define DMG_FALL (1 << 5) // fell too far +#define DMG_BLAST (1 << 6) // explosive blast damage +#define DMG_CLUB (1 << 7) // crowbar, punch, headbutt +#define DMG_SHOCK (1 << 8) // electric shock +#define DMG_SONIC (1 << 9) // sound pulse shockwave +#define DMG_ENERGYBEAM (1 << 10) // laser or other high energy beam +#define DMG_NEVERGIB (1 << 12) // with this bit OR'd in, no damage type will be able to gib victims upon death +#define DMG_ALWAYSGIB (1 << 13) // with this bit OR'd in, any damage type can be made to gib victims upon death. +#define DMG_DROWN (1 << 14) // Drowning +// time-based damage +#define DMG_TIMEBASED (~(0x3fff)) // mask for time-based damage + +#define DMG_PARALYZE (1 << 15) // slows affected creature down +#define DMG_NERVEGAS (1 << 16) // nerve toxins, very bad +#define DMG_POISON (1 << 17) // blood poisioning +#define DMG_RADIATION (1 << 18) // radiation exposure +#define DMG_DROWNRECOVER (1 << 19) // drowning recovery +#define DMG_ACID (1 << 20) // toxic chemicals or acid burns +#define DMG_SLOWBURN (1 << 21) // in an oven +#define DMG_SLOWFREEZE (1 << 22) // in a subzero freezer +#define DMG_MORTAR (1 << 23) // Hit by air raid (done to distinguish grenade from mortar) + +// sven-specific damages +#define DMG_SNIPER (1 << 24) // hit by a Sniper +#define DMG_MEDKITHEAL (1 << 25) // medkit healing +#define DMG_LAUNCH (1 << 26) // launch into air +#define DMG_SHOCK_GLOW (1 << 27) // shock glow effect + +// 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 +#define DMG_SHOWNHUD (DMG_POISON | DMG_ACID | DMG_FREEZE | DMG_SLOWFREEZE | DMG_DROWN | DMG_BURN | DMG_SLOWBURN | DMG_NERVEGAS | DMG_RADIATION | DMG_SHOCK) + +// damage types that draw blood from the victim +#define DMG_BLOOD (DMG_BULLET | DMG_SLASH | DMG_BLAST | DMG_CLUB | DMG_ACID | DMG_MORTAR | DMG_SNIPER | DMG_ENERGYBEAM) + +// NOTE: tweak these values based on gameplay feedback: + +#define PARALYZE_DURATION 2 // number of 2 second intervals to take damage +#define PARALYZE_DAMAGE 1.0 // damage to take each 2 second interval + +#define NERVEGAS_DURATION 2 +#define NERVEGAS_DAMAGE 5.0 + +#define POISON_DURATION 5 +#define POISON_DAMAGE 2.0 + +#define RADIATION_DURATION 2 +#define RADIATION_DAMAGE 1.0 + +#define ACID_DURATION 2 +#define ACID_DAMAGE 5.0 + +#define SLOWBURN_DURATION 2 +#define SLOWBURN_DAMAGE 1.0 + +#define SLOWFREEZE_DURATION 2 +#define SLOWFREEZE_DAMAGE 1.0 + + +#define itbd_Paralyze 0 +#define itbd_NerveGas 1 +#define itbd_Poison 2 +#define itbd_Radiation 3 +#define itbd_DrownRecover 4 +#define itbd_Acid 5 +#define itbd_SlowBurn 6 +#define itbd_SlowFreeze 7 +#define CDMG_TIMEBASED 8 + +// 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 WATERLEVEL_DRY 0 +#define WATERLEVEL_FEET 1 +#define WATERLEVEL_WAIST 2 +#define WATERLEVEL_HEAD 3 + +#define SF_ITEM_TOUCH_ONLY 128 // Pick this item up only by touching it. +#define SF_ITEM_USE_ONLY 256 // Pick this item up only by using it ('USE' key). +#define SF_ITEM_USE_WITHOUT_LOS 512 // Player can pick up this item even when it's not within his line of sight. + +typedef enum { USE_OFF = 0, USE_ON = 1, USE_SET = 2, USE_TOGGLE = 3 } USE_TYPE; + +// Things that toggle (buttons/triggers/doors) need this +typedef enum +{ + TS_AT_TOP, + TS_AT_BOTTOM, + TS_GOING_UP, + TS_GOING_DOWN +} TOGGLE_STATE; + // Rendering constants enum { diff --git a/dlls/CBaseAnimating.cpp b/dlls/CBaseAnimating.cpp index cc0161e6..04c178dc 100644 --- a/dlls/CBaseAnimating.cpp +++ b/dlls/CBaseAnimating.cpp @@ -22,7 +22,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "animation.h" #include "saverestore.h" #include "monster/CBaseMonster.h" diff --git a/dlls/CBaseAnimating.h b/dlls/CBaseAnimating.h new file mode 100644 index 00000000..03cf53c3 --- /dev/null +++ b/dlls/CBaseAnimating.h @@ -0,0 +1,44 @@ +#pragma once +#include "CBaseDelay.h" +#include "monster/monsterevent.h" + +class EXPORT CBaseAnimating : public CBaseDelay +{ +public: + virtual int GetEntindexPriority() { return ENTIDX_PRIORITY_NORMAL; } + virtual int Save(CSave& save); + virtual int Restore(CRestore& restore); + virtual CBaseAnimating* MyAnimatingPointer(void) { return this; } + + static TYPEDESCRIPTION m_SaveData[]; + + // Basic Monster Animation functions + float StudioFrameAdvance(float flInterval = 0.0); // accumulate animation frame time from last time called until now + int GetSequenceFlags(void); + virtual int LookupActivity(int activity); + int LookupActivityHeaviest(int activity); + int LookupSequence(const char* label); + void ResetSequenceInfo(); + void DispatchAnimEvents(float flFutureInterval = 0.1); // Handle events that have happend since last time called up until X seconds into the future + virtual void HandleAnimEvent(MonsterEvent_t* pEvent) { return; }; + float SetBoneController(int iController, float flValue); + void InitBoneControllers(void); + float SetBlending(int iBlender, float flValue); + void GetBonePosition(int iBone, Vector& origin, Vector& angles); + void GetAutomovement(Vector& origin, Vector& angles, float flInterval = 0.1); + int FindTransition(int iEndingSequence, int iGoalSequence, int* piDir); + void GetAttachment(int iAttachment, Vector& origin, Vector& angles); + int GetAttachmentCount(); + void SetBodygroup(int iGroup, int iValue); + int GetBodygroup(int iGroup); + int ExtractBbox(int sequence, float* mins, float* maxs); + void SetSequenceBox(void); + bool ActivityHasEvent(int activity, int event); + + // 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 +}; \ No newline at end of file diff --git a/dlls/CBaseDelay.cpp b/dlls/CBaseDelay.cpp index 15c2f7ee..045346a9 100644 --- a/dlls/CBaseDelay.cpp +++ b/dlls/CBaseDelay.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "nodes.h" #include "CBaseDoor.h" diff --git a/dlls/CBaseDelay.h b/dlls/CBaseDelay.h new file mode 100644 index 00000000..317c15d6 --- /dev/null +++ b/dlls/CBaseDelay.h @@ -0,0 +1,22 @@ +#pragma once +#include "CBaseEntity.h" + +// +// generic Delay entity. +// +class EXPORT CBaseDelay : public CBaseEntity +{ +public: + float m_flDelay; + int m_iszKillTarget; + + virtual int GetEntindexPriority() { return ENTIDX_PRIORITY_LOW; } + virtual void KeyValue(KeyValueData* pkvd); + virtual int Save(CSave& save); + virtual int Restore(CRestore& restore); + + static TYPEDESCRIPTION m_SaveData[]; + // common member functions + void SUB_UseTargets(CBaseEntity* pActivator, USE_TYPE useType, float value); + void DelayThink(void); +}; \ No newline at end of file diff --git a/dlls/CBaseEntity.cpp b/dlls/CBaseEntity.cpp index 4d18ab67..bce8da7d 100644 --- a/dlls/CBaseEntity.cpp +++ b/dlls/CBaseEntity.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "hlds_hooks.h" #include "decals.h" diff --git a/dlls/CBaseEntity.h b/dlls/CBaseEntity.h new file mode 100644 index 00000000..8ecfa98c --- /dev/null +++ b/dlls/CBaseEntity.h @@ -0,0 +1,371 @@ +#pragma once +#include "EHandle.h" +#include "saverestore.h" + +class CBaseEntity; +class CBaseMonster; +class CBasePlayerWeapon; +class CTalkSquadMonster; +class CBaseToggle; +class CBaseAnimating; + +void* GET_PRIVATE(const edict_t* pent); + +enum entindex_priority { + // entity should have an index lower than 512 so that sprite attachments work + // (skin is sent with 9 bits in delta.lst and this can't be changed for vanilla HL clients) + ENTIDX_PRIORITY_HIGH, + + // entity is likely to be sent to clients (monsters, sprites, doors, etc.) + ENTIDX_PRIORITY_NORMAL, + + // entity is server-side only and can have an index above the client limit + // TODO: make a separate edict list for these, things like logic ents are basically a scripting engine + ENTIDX_PRIORITY_LOW, +}; + +typedef void (CBaseEntity::* BASEPTR)(void); +typedef void (CBaseEntity::* ENTITYFUNCPTR)(CBaseEntity* pOther); +typedef void (CBaseEntity::* USEPTR)(CBaseEntity* pActivator, CBaseEntity* pCaller, USE_TYPE useType, float value); + +// Ugly technique to override base member functions +// Normally it's illegal to cast a pointer to a member function of a derived class to a pointer to a +// member function of a base class. static_cast is a sleezy way around that problem. + +#ifdef _DEBUG + +#define SetThink( a ) ThinkSet( static_cast (a), #a ) +#define SetTouch( a ) TouchSet( static_cast (a), #a ) +#define SetUse( a ) UseSet( static_cast (a), #a ) +#define SetBlocked( a ) BlockedSet( static_cast (a), #a ) + +#else + +#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) + +#endif + +// +// 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 + bool allocate = pev == NULL; + if (allocate) + pev = VARS(CREATE_ENTITY()); + + // get the private data + a = (T*)GET_PRIVATE(ENT(pev)); + + if (a == NULL) + { + // allocate private data + a = new(pev) T; // TODO: shouldn't this use malloc? What does the engine do? + a->pev = pev; + } + + // only relocate if a new entity was allocated, else EHANDLEs will break + return allocate ? (T*)RelocateEntIdx(a) : a; +} + +// +// Base Entity. All entity types derive from this +// +class EXPORT CBaseEntity +{ +public: + // 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 + + // path corners + EHANDLE m_hGoalEnt;// path corner we are heading towards + EHANDLE m_hLink;// used for temporary link-list operations. + + // initialization functions + virtual void Spawn(void) { return; } + virtual void Precache(void) { return; } + virtual void KeyValue(KeyValueData* pkvd); + virtual CKeyValue GetKeyValue(const char* keyName); + CKeyValue GetCustomKeyValue(const char* keyName); + std::unordered_map* GetCustomKeyValues(); + virtual int Save(CSave& save); + virtual int Restore(CRestore& restore); + virtual int ObjectCaps(void) { return FCAP_ACROSS_TRANSITION; } + virtual void Activate(void) {} + virtual int GetEntindexPriority() { return ENTIDX_PRIORITY_NORMAL; } + virtual bool ForceVisChecks() { return false; } // return true for invisible ents that normally skip VIS checks in AddToFullPack + virtual Vector GetTargetOrigin() { return pev->origin; } // origin used for monster pathing and targetting + + // Setup the object->object collision box (pev->mins / pev->maxs is the object->world collision box) + virtual void SetObjectCollisionBox(void); + + // Classify - returns the type of group (i.e, "houndeye", or "human military" so that monsters with different classnames + // still realize that they are teammates. (overridden for monsters that form groups) + virtual int Classify(void) { return m_Classify; }; + virtual void DeathNotice(entvars_t* pevChild) {}// monster maker children use this to tell the monster maker that they have died. + + + static TYPEDESCRIPTION m_SaveData[]; + + virtual void TraceAttack(entvars_t* pevAttacker, float flDamage, Vector vecDir, TraceResult* ptr, int bitsDamageType); + virtual int TakeDamage(entvars_t* pevInflictor, entvars_t* pevAttacker, float flDamage, int bitsDamageType); + virtual int TakeHealth(float flHealth, int bitsDamageType, float healthcap = 0); + virtual void Killed(entvars_t* pevAttacker, int iGib); + virtual int BloodColor(void) { return DONT_BLEED; } + virtual void TraceBleed(float flDamage, Vector vecDir, TraceResult* ptr, int bitsDamageType); + virtual BOOL IsTriggered(CBaseEntity* pActivator) { return TRUE; } + virtual CBaseMonster* MyMonsterPointer(void) { return NULL; } + virtual CBasePlayerWeapon* GetWeaponPtr(void) { return NULL; }; + virtual CTalkSquadMonster* MyTalkSquadMonsterPointer(void) { return NULL; } + virtual CBaseToggle* MyTogglePointer(void) { return NULL; } + virtual CBaseAnimating* MyAnimatingPointer(void) { return NULL; } + virtual int GetToggleState(void) { return TS_AT_TOP; } + virtual void AddPoints(int score, BOOL bAllowNegativeScore) {} + virtual void AddPointsToTeam(int score, BOOL bAllowNegativeScore) {} + virtual BOOL AddPlayerItem(CBasePlayerItem* pItem) { return 0; } + virtual BOOL RemovePlayerItem(CBasePlayerItem* pItem) { return 0; } + virtual int GiveAmmo(int iAmount, const char* szName, int iMax) { return -1; }; + virtual float GetDelay(void) { return 0; } + virtual int IsMoving(void) { return pev->velocity != g_vecZero; } + virtual void OverrideReset(void) {} + virtual int DamageDecal(int bitsDamageType); + // This is ONLY used by the node graph to test movement through a door + virtual void SetToggleState(int state) {} + virtual void StartSneaking(void) {} + virtual void StopSneaking(void) {} + virtual BOOL OnControls(entvars_t* otherPev) { return FALSE; } + virtual BOOL IsSneaking(void) { return FALSE; } + virtual BOOL IsAlive(void) { return (pev->deadflag == DEAD_NO) && pev->health > 0; } + virtual BOOL IsBSPModel(void) { return pev->solid == SOLID_BSP || pev->movetype == MOVETYPE_PUSHSTEP; } + virtual BOOL ReflectGauss(void) { return (IsBSPModel() && !pev->takedamage); } + virtual BOOL HasTarget(string_t targetname) { return FStrEq(STRING(targetname), STRING(pev->target)); } + virtual BOOL IsInWorld(void); + virtual BOOL IsMonster(void) { return FALSE; } + virtual BOOL IsNormalMonster(void) { return FALSE; } // is this what you'd expect to be a monster? (not a monstermaker/grenade/etc.) + virtual BOOL IsPlayer(void) { return FALSE; } + virtual BOOL IsPlayerCorpse(void) { return FALSE; } + virtual BOOL IsNetClient(void) { return FALSE; } + virtual BOOL IsBreakable(void) { return FALSE; } + virtual BOOL IsMachine(void) { return FALSE; }; + virtual const char* TeamID(void) { return ""; } + virtual const char* DisplayName() { return STRING(pev->classname); } + virtual const char* GetDeathNoticeWeapon() { return STRING(pev->classname); }; + + + // virtual void SetActivator( CBaseEntity *pActivator ) {} + virtual CBaseEntity* GetNextTarget(void); + + // fundamental callbacks + void (CBaseEntity ::* m_pfnThink)(void); + void (CBaseEntity ::* m_pfnTouch)(CBaseEntity* pOther); + void (CBaseEntity ::* m_pfnUse)(CBaseEntity* pActivator, CBaseEntity* pCaller, USE_TYPE useType, float value); + void (CBaseEntity ::* m_pfnBlocked)(CBaseEntity* pOther); + + virtual void Think(void) { if (m_pfnThink) (this->*m_pfnThink)(); }; + virtual void Touch(CBaseEntity* pOther) { if (m_pfnTouch) (this->*m_pfnTouch)(pOther); }; + virtual void Use(CBaseEntity* pActivator, CBaseEntity* pCaller, USE_TYPE useType, float value) + { + if (m_pfnUse) + (this->*m_pfnUse)(pActivator, pCaller, useType, value); + } + virtual void Blocked(CBaseEntity* pOther) { if (m_pfnBlocked) (this->*m_pfnBlocked)(pOther); }; + + // allow engine to allocate instance data + void* operator new(size_t stAllocateBlock, entvars_t* pev) + { + return (void*)ALLOC_PRIVATE(ENT(pev), stAllocateBlock); + }; + + // don't use this. +#if _MSC_VER >= 1200 // only build this code if MSVC++ 6.0 or higher + void operator delete(void* pMem, entvars_t* pev) + { + pev->flags |= FL_KILLME; + }; +#endif + + virtual void UpdateOnRemove(void); + + // common member functions + void SUB_Remove(void); + void SUB_DoNothing(void); + void SUB_StartFadeOut(void); + void SUB_FadeOut(void); + void SUB_CallUseToggle(void) { this->Use(this, this, USE_TOGGLE, 0); } + int ShouldToggle(USE_TYPE useType, BOOL currentState); + void FireBullets(ULONG cShots, Vector vecSrc, Vector vecDirShooting, Vector vecSpread, float flDistance, int iBulletType, int iTracerFreq = 4, int iDamage = 0, entvars_t* pevAttacker = NULL); + Vector FireBulletsPlayer(ULONG cShots, Vector vecSrc, Vector vecDirShooting, Vector vecSpread, float flDistance, int iBulletType, int iTracerFreq = 4, int iDamage = 0, entvars_t* pevAttacker = NULL, int shared_rand = 0); + + virtual CBaseEntity* Respawn(void) { return NULL; } + + void SUB_UseTargets(CBaseEntity* pActivator, USE_TYPE useType, float value); + // Do the bounding boxes of these two intersect? + int Intersects(CBaseEntity* pOther); + void MakeDormant(void); + int IsDormant(void); + BOOL IsLockedByMaster(void) { return FALSE; } + + static CBaseEntity* Instance(const edict_t* pent) + { + if (!pent) + pent = ENT(0); + CBaseEntity* pEnt = (CBaseEntity*)GET_PRIVATE(pent); + return pEnt; + } + + static CBaseEntity* Instance(entvars_t* pev) { return Instance(ENT(pev)); } + static CBaseEntity* Instance(int eoffset) { return Instance(ENT(eoffset)); } + + CBaseMonster* GetMonsterPointer(entvars_t* pevMonster) + { + CBaseEntity* pEntity = Instance(pevMonster); + if (pEntity) + return pEntity->MyMonsterPointer(); + return NULL; + } + CBaseMonster* GetMonsterPointer(edict_t* pentMonster) + { + CBaseEntity* pEntity = Instance(pentMonster); + if (pEntity) + return pEntity->MyMonsterPointer(); + return NULL; + } + + + // Ugly code to lookup all functions to make sure they are exported when set. +#ifdef _DEBUG + void FunctionCheck(void* pFunction, char* name) + { + //if (pFunction && !NAME_FOR_FUNCTION((uint32)pFunction) ) + // ALERT( at_error, "No EXPORT: %s:%s (%08lx)\n", STRING(pev->classname), name, (uint32)pFunction ); + } + + BASEPTR ThinkSet(BASEPTR func, char* name) + { + m_pfnThink = func; + FunctionCheck((void*)*((int*)((char*)this + (offsetof(CBaseEntity, m_pfnThink)))), name); + return func; + } + ENTITYFUNCPTR TouchSet(ENTITYFUNCPTR func, char* name) + { + m_pfnTouch = func; + FunctionCheck((void*)*((int*)((char*)this + (offsetof(CBaseEntity, m_pfnTouch)))), name); + return func; + } + USEPTR UseSet(USEPTR func, char* name) + { + m_pfnUse = func; + FunctionCheck((void*)*((int*)((char*)this + (offsetof(CBaseEntity, m_pfnUse)))), name); + return func; + } + ENTITYFUNCPTR BlockedSet(ENTITYFUNCPTR func, char* name) + { + m_pfnBlocked = func; + FunctionCheck((void*)*((int*)((char*)this + (offsetof(CBaseEntity, m_pfnBlocked)))), name); + return func; + } + +#endif + + + // virtual functions used by a few classes + + // used by monsters that are created by the MonsterMaker + virtual void UpdateOwner(void) { return; }; + + + // + static CBaseEntity* Create(const char* szName, const Vector& vecOrigin, const Vector& vecAngles, edict_t* pentOwner = NULL, std::unordered_map keys = std::unordered_map()); + + virtual BOOL FBecomeProne(void) { return FALSE; }; + edict_t* edict() { return ENT(pev); }; + EOFFSET eoffset() { return OFFSET(pev); }; + int entindex() { return ENTINDEX(edict()); }; + + virtual Vector Center() { return (pev->absmax + pev->absmin) * 0.5; }; // center point of entity + virtual Vector EyePosition() { return pev->origin + pev->view_ofs; }; // position of eyes + virtual Vector EarPosition() { return pev->origin + pev->view_ofs; }; // position of ears + virtual Vector BodyTarget(const Vector& posSrc) { return Center(); }; // position to shoot at + + virtual int Illumination() { return GETENTITYILLUM(ENT(pev)); }; + + virtual BOOL FVisible(CBaseEntity* pEntity); + virtual BOOL FVisible(const Vector& vecOrigin); + + virtual void SetClassify(int iNewClassify); + virtual int IRelationship(CBaseEntity* pTarget); + static int IRelationship(int attackerClass, int victimClass); + bool ShouldBlockFriendlyFire(entvars_t* attacker); + + // can the player using this entity physically touch the ent with their hand? + // or is there something in the way? (player use code assumes arms have noclip) + bool CanReach(CBaseEntity* toucher); + + // true if this entity is in the PVS of the given player + inline bool InPVS(edict_t* player) { return m_pvsPlayers & PLRBIT(player); } + + // true if the entity is in the PAS of the given player + inline bool InPAS(edict_t* player) { return m_pasPlayers & PLRBIT(player); } + + // true if the entity is networked to the given player + inline bool isVisibleTo(edict_t* player) { return m_netPlayers & PLRBIT(player); } + + // true if the entity was flagged to be hidden from the given player + inline bool isHiddenFrom(edict_t* player) { return m_hidePlayers & PLRBIT(player); } + + // flag this entity to be visible/invisible to the given player + inline void SetVisible(edict_t* player, bool visible) { + if (visible) m_hidePlayers &= ~PLRBIT(player); + else m_hidePlayers |= PLRBIT(player); + } + + //We use this variables to store each ammo count. + int ammo_9mm; + int ammo_357; + int ammo_bolts; + int ammo_buckshot; + int ammo_rockets; + int ammo_uranium; + int ammo_hornets; + int ammo_argrens; + //Special stuff for grenades and satchels. + float m_flStartThrow; + float m_flReleaseThrow; + int m_chargeReady; + int m_fInAttack; + + enum EGON_FIRESTATE { FIRE_OFF, FIRE_CHARGE }; + int m_fireState; + int m_Classify; // Classify, to let mappers override the default + + uint32_t m_pasPlayers; // players in the audible set of this entity (invalid for invisible ents) + uint32_t m_pvsPlayers; // players in the visible set of this entity (invalid for invisible ents) + uint32_t m_netPlayers; // players this entity has been networked to (AddToFullPack returned 1) + uint32_t m_hidePlayers; // players this entity will be hidden from (AddToFullPack) +}; + +inline void* GET_PRIVATE(const edict_t* pent) +{ + if (pent) { + CBaseEntity* bent = (CBaseEntity*)pent->pvPrivateData; + + if (bent && bent->pev != &pent->v) { + // TODO: pev was linked wrong somehow. mem corruption? + ALERT(at_error, "Entity pev not linked to edict %d pev (%s)\n", + ENTINDEX(pent), STRING(pent->v.classname)); + bent->pev = (entvars_t*)&pent->v; + return NULL; + } + + return bent; + } + return NULL; +} \ No newline at end of file diff --git a/dlls/CBaseToggle.cpp b/dlls/CBaseToggle.cpp index 7d59e31c..1ff88f12 100644 --- a/dlls/CBaseToggle.cpp +++ b/dlls/CBaseToggle.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "nodes.h" #include "CBaseDoor.h" diff --git a/dlls/CBaseToggle.h b/dlls/CBaseToggle.h new file mode 100644 index 00000000..80f6f8c2 --- /dev/null +++ b/dlls/CBaseToggle.h @@ -0,0 +1,69 @@ +#pragma once +#include "CBaseAnimating.h" + +// +// generic Toggle entity. +// +#define SF_ITEM_USE_ONLY 256 // ITEM_USE_ONLY = BUTTON_USE_ONLY = DOOR_USE_ONLY!!! + +class EXPORT CBaseToggle : public CBaseAnimating +{ +public: + void KeyValue(KeyValueData* pkvd); + + 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 + + Vector m_vecPosition1; + Vector m_vecPosition2; + Vector m_vecAngle1; + Vector m_vecAngle2; + + int m_cTriggersLeft; // trigger_counter only, # of activations remaining + float m_flHeight; + EHANDLE m_hActivator; + void (CBaseToggle::* m_pfnCallWhenMoveDone)(void); + Vector m_vecFinalDest; + Vector m_vecFinalAngle; + + int m_bitsDamageInflict; // DMG_ damage type that the door or tigger does + + virtual int Save(CSave& save); + virtual int Restore(CRestore& restore); + + static TYPEDESCRIPTION m_SaveData[]; + + virtual int GetToggleState(void) { return m_toggle_state; } + virtual float GetDelay(void) { return m_flWait; } + + // common member functions + void LinearMove(Vector vecDest, float flSpeed); + void LinearMoveDone(void); + void AngularMove(Vector vecDestAngle, float flSpeed); + void AngularMoveDone(void); + BOOL IsLockedByMaster(void); + + virtual CBaseToggle* MyTogglePointer(void) { return this; } + + // monsters use this, but so could buttons for instance + virtual void PlaySentence(const char* pszSentence, float duration, float volume, float attenuation); + virtual void PlayScriptedSentence(const char* pszSentence, float duration, float volume, float attenuation, BOOL bConcurrent, CBaseEntity* pListener); + virtual void SentenceStop(void); + virtual BOOL IsAllowedToSpeak() { return FALSE; } + + static float AxisValue(int flags, const Vector& angles); + static void AxisDir(entvars_t* pev); + static float AxisDelta(int flags, const Vector& angle1, const Vector& angle2); + + string_t m_sMaster; // If this button has a master switch, this is the targetname. + // A master switch must be of the multisource type. If all + // of the switches in the multisource have been triggered, then + // the button will be allowed to operate. Otherwise, it will be + // deactivated. +}; +#define SetMoveDone( a ) m_pfnCallWhenMoveDone = static_cast (a) \ No newline at end of file diff --git a/dlls/CGlobalState.cpp b/dlls/CGlobalState.cpp index 5b85ac19..06fdc096 100644 --- a/dlls/CGlobalState.cpp +++ b/dlls/CGlobalState.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "decals.h" #include "CBasePlayer.h" diff --git a/dlls/CMakeLists.txt b/dlls/CMakeLists.txt index e1ea6549..e53e6aa9 100644 --- a/dlls/CMakeLists.txt +++ b/dlls/CMakeLists.txt @@ -184,6 +184,7 @@ set(TRIGGER_HDR triggers/CBaseTrigger.h triggers/CGamePlayerEquip.h triggers/CFireAndDie.h + triggers/CMultiSource.h triggers/CRuleEntity.h triggers/CTriggerMultiple.h triggers/CTriggerVote.h @@ -301,7 +302,13 @@ set(FUNC_SRC ) set(ENTITY_HDR - cbase.h + CBaseAnimating.h + CBaseDelay.h + CBaseEntity.h + CPointEntity.h + CBaseToggle.h + CWorld.h + EHandle.h monster/scriptevent.h path/CPathCorner.h path/CPathTrack.h @@ -312,7 +319,6 @@ set(ENTITY_HDR ../common/const.h ) set(ENTITY_SRC - cbase.cpp CBaseAnimating.cpp CBaseEntity.cpp CBaseDelay.cpp @@ -321,6 +327,7 @@ set(ENTITY_SRC CNullEntity.cpp CPointEntity.cpp CWorld.cpp + EHandle.cpp path/CPathCorner.cpp path/CPathTrack.cpp ) diff --git a/dlls/CNullEntity.cpp b/dlls/CNullEntity.cpp index 90b85387..bdda6b29 100644 --- a/dlls/CNullEntity.cpp +++ b/dlls/CNullEntity.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" class CNullEntity : public CBaseEntity { diff --git a/dlls/CPointEntity.cpp b/dlls/CPointEntity.cpp index 29a537d2..bc548a24 100644 --- a/dlls/CPointEntity.cpp +++ b/dlls/CPointEntity.cpp @@ -1,6 +1,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" +#include "CPointEntity.h" // Landmark class void CPointEntity::Spawn(void) diff --git a/dlls/CPointEntity.h b/dlls/CPointEntity.h new file mode 100644 index 00000000..6553d52b --- /dev/null +++ b/dlls/CPointEntity.h @@ -0,0 +1,11 @@ +#pragma once +#include "CBaseEntity.h" + +class EXPORT CPointEntity : public CBaseEntity +{ +public: + virtual int GetEntindexPriority() { return ENTIDX_PRIORITY_LOW; } + void Spawn(void); + virtual int ObjectCaps(void) { return CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; } +private: +}; \ No newline at end of file diff --git a/dlls/CWorld.cpp b/dlls/CWorld.cpp index faff43bb..5c52e446 100644 --- a/dlls/CWorld.cpp +++ b/dlls/CWorld.cpp @@ -1,6 +1,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" +#include "CWorld.h" #include "nodes.h" #include "env/CSoundEnt.h" #include "hlds_hooks.h" diff --git a/dlls/CWorld.h b/dlls/CWorld.h new file mode 100644 index 00000000..96f3d307 --- /dev/null +++ b/dlls/CWorld.h @@ -0,0 +1,26 @@ +#pragma once +#include "CBaseEntity.h" + +extern edict_t* g_pBodyQueueHead; + +// this moved here from world.cpp, to allow classes to be derived from it +//======================= +// CWorld +// +// This spawns first when each level begins. +//======================= +class EXPORT CWorld : public CBaseEntity +{ +public: + virtual int GetEntindexPriority() { return ENTIDX_PRIORITY_HIGH; } + void Spawn( void ); + void Precache( void ); + void KeyValue( KeyValueData *pkvd ); + void loadReplacementFiles(); + const char* getDisplayName() { return "World"; } + + string_t m_globalModelList; + string_t m_globalSoundList; + string_t m_wadlist; + bool m_freeRoam; +}; diff --git a/dlls/EHandle.cpp b/dlls/EHandle.cpp new file mode 100644 index 00000000..0d00ded9 --- /dev/null +++ b/dlls/EHandle.cpp @@ -0,0 +1,67 @@ +#include "EHandle.h" + +EHANDLE::EHANDLE(edict_t* pent) { + Set(pent); +} + +edict_t* EHANDLE::GetEdict(void) +{ + if (m_pent) { + byte* edicts = (byte*)ENT(0); + byte* endEdicts = edicts + sizeof(edict_t) * gpGlobals->maxEntities; + bool inRange = (byte*)m_pent >= edicts && (byte*)m_pent < endEdicts; + bool aligned = (((byte*)m_pent - edicts) % sizeof(edict_t)) == 0; + + if (!inRange || !aligned) { + ALERT(at_error, "An EHANDLE was corrupted! Nulled to avoid crash.\n"); + m_pent = NULL; + return NULL; + } + + if (!m_pent->free && m_pent->serialnumber == m_serialnumber) { + return m_pent; + } + } + + return NULL; +} + +CBaseEntity* EHANDLE::GetEntity(void) +{ + return (CBaseEntity*)GET_PRIVATE(GetEdict()); +} + +edict_t* EHANDLE::Set(edict_t* pent) +{ + m_pent = pent; + if (pent) + m_serialnumber = m_pent->serialnumber; + return pent; +} + + +EHANDLE :: operator CBaseEntity* () +{ + return (CBaseEntity*)GET_PRIVATE(GetEdict()); +} + +CBaseEntity* EHANDLE :: operator = (CBaseEntity* pEntity) +{ + if (pEntity) + { + m_pent = ENT(pEntity->pev); + if (m_pent) + m_serialnumber = m_pent->serialnumber; + } + else + { + m_pent = NULL; + m_serialnumber = 0; + } + return pEntity; +} + +CBaseEntity* EHANDLE :: operator -> () +{ + return (CBaseEntity*)GET_PRIVATE(GetEdict()); +} diff --git a/dlls/EHandle.h b/dlls/EHandle.h new file mode 100644 index 00000000..7de794f4 --- /dev/null +++ b/dlls/EHandle.h @@ -0,0 +1,23 @@ +#pragma once +#include "CBaseEntity.h" + +// +// EHANDLE. Safe way to point to CBaseEntities who may die between frames +// +class EXPORT EHANDLE +{ +private: + edict_t* m_pent; + int m_serialnumber; +public: + EHANDLE() : m_pent(0), m_serialnumber(0) {} + EHANDLE(edict_t* pent); + edict_t* GetEdict(void); + CBaseEntity* GetEntity(void); + edict_t* Set(edict_t* pent); + + operator CBaseEntity* (); + + CBaseEntity* operator = (CBaseEntity* pEntity); + CBaseEntity* operator ->(); +}; \ No newline at end of file diff --git a/dlls/cbase.cpp b/dlls/cbase.cpp deleted file mode 100644 index e7875ac0..00000000 --- a/dlls/cbase.cpp +++ /dev/null @@ -1,603 +0,0 @@ -/*** -* -* Copyright (c) 1996-2001, 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. -* -****/ -#include "extdll.h" -#include "util.h" -#include "cbase.h" -#include "saverestore.h" -#include "hlds_hooks.h" -#include "decals.h" -#include "gamerules.h" -#include "game.h" -#include "skill.h" -#include "PluginManager.h" - -void EntvarsKeyvalue( entvars_t *pev, KeyValueData *pkvd ); - -void PM_Move ( struct playermove_s *ppmove, int server ); -void PM_Init ( struct playermove_s *ppmove ); -char PM_FindTextureType( char *name ); - -extern Vector VecBModelOrigin( entvars_t* pevBModel ); - -DLL_FUNCTIONS dllFuncs = -{ - GameDLLInit, //pfnGameInit - DispatchSpawn, //pfnSpawn - DispatchThink, //pfnThink - DispatchUse, //pfnUse - DispatchTouch, //pfnTouch - DispatchBlocked, //pfnBlocked - DispatchKeyValue, //pfnKeyValue - DispatchSave, //pfnSave - DispatchRestore, //pfnRestore - DispatchObjectCollsionBox, //pfnAbsBox - - SaveWriteFields, //pfnSaveWriteFields - SaveReadFields, //pfnSaveReadFields - - SaveGlobalState, //pfnSaveGlobalState - RestoreGlobalState, //pfnRestoreGlobalState - ResetGlobalState, //pfnResetGlobalState - - ClientConnect, //pfnClientConnect - ClientDisconnect, //pfnClientDisconnect - ClientKill, //pfnClientKill - ClientPutInServer, //pfnClientPutInServer - ClientCommand, //pfnClientCommand - ClientUserInfoChanged, //pfnClientUserInfoChanged - ServerActivate, //pfnServerActivate - ServerDeactivate, //pfnServerDeactivate - - PlayerPreThink, //pfnPlayerPreThink - PlayerPostThink, //pfnPlayerPostThink - - StartFrame, //pfnStartFrame - ParmsNewLevel, //pfnParmsNewLevel - ParmsChangeLevel, //pfnParmsChangeLevel - - GetGameDescription, //pfnGetGameDescription Returns string describing current .dll game. - PlayerCustomization, //pfnPlayerCustomization Notifies .dll of new customization for player. - - SpectatorConnect, //pfnSpectatorConnect Called when spectator joins server - SpectatorDisconnect, //pfnSpectatorDisconnect Called when spectator leaves the server - SpectatorThink, //pfnSpectatorThink Called when spectator sends a command packet (usercmd_t) - - Sys_Error, //pfnSys_Error Called when engine has encountered an error - - PM_Move, //pfnPM_Move - PM_Init, //pfnPM_Init Server version of player movement initialization - PM_FindTextureType, //pfnPM_FindTextureType - - SetupVisibility, //pfnSetupVisibility Set up PVS and PAS for networking for this client - UpdateClientData, //pfnUpdateClientData Set up data sent only to specific client - AddToFullPack, //pfnAddToFullPack - CreateBaseline, //pfnCreateBaseline Tweak entity baseline for network encoding, allows setup of player baselines, too. - RegisterEncoders, //pfnRegisterEncoders Callbacks for network encoding - GetWeaponData, //pfnGetWeaponData - CmdStart, //pfnCmdStart - CmdEnd, //pfnCmdEnd - ConnectionlessPacket, //pfnConnectionlessPacket - GetHullBounds, //pfnGetHullBounds - CreateInstancedBaselines, //pfnCreateInstancedBaselines - InconsistentFile, //pfnInconsistentFile - AllowLagCompensation, //pfnAllowLagCompensation -}; - -NEW_DLL_FUNCTIONS newDllFuncs = { - OnFreeEntPrivateData, - GameShutdown, - ShouldCollide, - CvarValue, - CvarValue2 -}; - -gamedll_funcs_t GameDllFuncs = { &dllFuncs, &newDllFuncs }; -gamedll_funcs_t* gpGamedllFuncs = &GameDllFuncs; - -extern "C" { - -int GetEntityAPI( DLL_FUNCTIONS *pFunctionTable, int interfaceVersion ) -{ - if ( !pFunctionTable || interfaceVersion != INTERFACE_VERSION ) - { - return FALSE; - } - - memcpy( pFunctionTable, &dllFuncs, sizeof( DLL_FUNCTIONS ) ); - return TRUE; -} - -int GetEntityAPI2( DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion ) -{ - if ( !pFunctionTable || *interfaceVersion != INTERFACE_VERSION ) - { - // Tell engine what version we had, so it can figure out who is out of date. - *interfaceVersion = INTERFACE_VERSION; - return FALSE; - } - - memcpy( pFunctionTable, &dllFuncs, sizeof( DLL_FUNCTIONS ) ); - return TRUE; -} - -int GetNewDLLFunctions(NEW_DLL_FUNCTIONS* pNewFunctionTable, int* interfaceVersion) { - if (!pNewFunctionTable) { - ALERT(at_error, "GetNewDLLFunctions called with null pNewFunctionTable"); - return(FALSE); - } - else if (*interfaceVersion != 1) { - ALERT(at_error, "GetNewDLLFunctions version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION); - *interfaceVersion = 1; - return(FALSE); - } - - memcpy(pNewFunctionTable, &newDllFuncs, sizeof(NEW_DLL_FUNCTIONS)); - return(TRUE); -} - -} - -// returns relocated edict, or NULL if the entity died immediately after spawning -edict_t* SpawnEdict(edict_t* pent) { - CBaseEntity* pEntity = (CBaseEntity*)GET_PRIVATE(pent); - - if (!pEntity) { - REMOVE_ENTITY(pent); - return NULL; - } - - pEntity = RelocateEntIdx(pEntity); - pent = pEntity->edict(); - - // Initialize these or entities who don't link to the world won't have anything in here - pEntity->pev->absmin = pEntity->pev->origin - Vector(1, 1, 1); - pEntity->pev->absmax = pEntity->pev->origin + Vector(1, 1, 1); - - pEntity->Spawn(); - - // Try to get the pointer again, in case the spawn function deleted the entity. - // UNDONE: Spawn() should really return a code to ask that the entity be deleted, but - // that would touch too much code for me to do that right now. - pEntity = (CBaseEntity*)GET_PRIVATE(pent); - - if (pEntity) - { - if ((g_pGameRules && !g_pGameRules->IsAllowedToSpawn(pEntity)) || pEntity->pev->flags & FL_KILLME) { - REMOVE_ENTITY(pent); - return NULL; - } - } - - // Handle global stuff here - if (pEntity && pEntity->pev->globalname) - { - const globalentity_t* pGlobal = gGlobalState.EntityFromTable(pEntity->pev->globalname); - if (pGlobal) - { - // Already dead? delete - if (pGlobal->state == GLOBAL_DEAD) { - REMOVE_ENTITY(pent); - return NULL; - } - - else if (!FStrEq(STRING(gpGlobals->mapname), pGlobal->levelName)) - pEntity->MakeDormant(); // Hasn't been moved to this level yet, wait but stay alive - // In this level & not dead, continue on as normal - } - else - { - // Spawned entities default to 'On' - gGlobalState.EntityAdd(pEntity->pev->globalname, gpGlobals->mapname, GLOBAL_ON); - // ALERT( at_console, "Added global entity %s (%s)\n", STRING(pEntity->pev->classname), STRING(pEntity->pev->globalname) ); - } - } - - return pent; -} - -int DispatchSpawn( edict_t *pent ) -{ - CALL_HOOKS(int, pfnDispatchSpawn, pent); - - SpawnEdict(pent); - - // never ask the engine to delete the edict, because relocation will have invalidated its pointer. - return 0; -} - -void DispatchKeyValue( edict_t *pentKeyvalue, KeyValueData *pkvd ) -{ - CALL_HOOKS_VOID(pfnDispatchKeyValue, pentKeyvalue, pkvd); - - if ( !pkvd || !pentKeyvalue ) - return; - - EntvarsKeyvalue( VARS(pentKeyvalue), pkvd ); - - // If the key was an entity variable, or there's no class set yet, don't look for the object, it may - // not exist yet. - if ( pkvd->fHandled || pkvd->szClassName == NULL ) - return; - - // Get the actualy entity object - CBaseEntity *pEntity = (CBaseEntity *)GET_PRIVATE(pentKeyvalue); - - if ( !pEntity ) - return; - - pEntity->KeyValue( pkvd ); -} - - -// HACKHACK -- this is a hack to keep the node graph entity from "touching" things (like triggers) -// while it builds the graph -BOOL gTouchDisabled = FALSE; -void DispatchTouch( edict_t *pentTouched, edict_t *pentOther ) -{ - CALL_HOOKS_VOID(pfnDispatchTouch, pentTouched, pentOther); - - if ( gTouchDisabled ) - return; - - CBaseEntity *pEntity = (CBaseEntity *)GET_PRIVATE(pentTouched); - CBaseEntity *pOther = (CBaseEntity *)GET_PRIVATE( pentOther ); - - if ( pEntity && pOther && ! ((pEntity->pev->flags | pOther->pev->flags) & FL_KILLME) ) - pEntity->Touch( pOther ); -} - - -void DispatchUse( edict_t *pentUsed, edict_t *pentOther ) -{ - CALL_HOOKS_VOID(pfnDispatchUse, pentUsed, pentOther); - - CBaseEntity *pEntity = (CBaseEntity *)GET_PRIVATE(pentUsed); - CBaseEntity *pOther = (CBaseEntity *)GET_PRIVATE(pentOther); - - if (pEntity && !(pEntity->pev->flags & FL_KILLME) ) - pEntity->Use( pOther, pOther, USE_TOGGLE, 0 ); -} - -void DispatchThink( edict_t *pent ) -{ - CALL_HOOKS_VOID(pfnDispatchThink, pent); - - CBaseEntity *pEntity = (CBaseEntity *)GET_PRIVATE(pent); - if (pEntity) - { - if ( FBitSet( pEntity->pev->flags, FL_DORMANT ) ) - ALERT( at_console, "Dormant entity %s is thinking!!\n", STRING(pEntity->pev->classname) ); - - pEntity->Think(); - } -} - -void DispatchBlocked( edict_t *pentBlocked, edict_t *pentOther ) -{ - CALL_HOOKS_VOID(pfnDispatchBlocked, pentBlocked, pentOther); - - CBaseEntity *pEntity = (CBaseEntity *)GET_PRIVATE( pentBlocked ); - CBaseEntity *pOther = (CBaseEntity *)GET_PRIVATE( pentOther ); - - if (pEntity) - pEntity->Blocked( pOther ); -} - -void DispatchSave( edict_t *pent, SAVERESTOREDATA *pSaveData ) -{ - CBaseEntity *pEntity = (CBaseEntity *)GET_PRIVATE(pent); - - if ( pEntity && pSaveData ) - { - ENTITYTABLE *pTable = &pSaveData->pTable[ pSaveData->currentIndex ]; - - if ( pTable->pent != pent ) - ALERT( at_error, "ENTITY TABLE OR INDEX IS WRONG!!!!\n" ); - - if ( pEntity->ObjectCaps() & FCAP_DONT_SAVE ) - return; - - // These don't use ltime & nextthink as times really, but we'll fudge around it. - if ( pEntity->pev->movetype == MOVETYPE_PUSH ) - { - float delta = pEntity->pev->nextthink - pEntity->pev->ltime; - pEntity->pev->ltime = gpGlobals->time; - pEntity->pev->nextthink = pEntity->pev->ltime + delta; - } - - pTable->location = pSaveData->size; // Remember entity position for file I/O - pTable->classname = pEntity->pev->classname; // Remember entity class for respawn - - CSave saveHelper( pSaveData ); - pEntity->Save( saveHelper ); - - pTable->size = pSaveData->size - pTable->location; // Size of entity block is data size written to block - } -} - - -// Find the matching global entity. Spit out an error if the designer made entities of -// different classes with the same global name -CBaseEntity *FindGlobalEntity( string_t classname, string_t globalname ) -{ - edict_t *pent = FIND_ENTITY_BY_STRING( NULL, "globalname", STRING(globalname) ); - CBaseEntity *pReturn = CBaseEntity::Instance( pent ); - if ( pReturn ) - { - if ( !FClassnameIs( pReturn->pev, STRING(classname) ) ) - { - ALERT( at_console, "Global entity found %s, wrong class %s\n", STRING(globalname), STRING(pReturn->pev->classname) ); - pReturn = NULL; - } - } - - return pReturn; -} - - -int DispatchRestore( edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity ) -{ - CBaseEntity *pEntity = (CBaseEntity *)GET_PRIVATE(pent); - - if ( pEntity && pSaveData ) - { - entvars_t tmpVars; - Vector oldOffset; - - CRestore restoreHelper( pSaveData ); - if ( globalEntity ) - { - CRestore tmpRestore( pSaveData ); - tmpRestore.PrecacheMode( 0 ); - tmpRestore.ReadEntVars( "ENTVARS", &tmpVars ); - - // HACKHACK - reset the save pointers, we're going to restore for real this time - pSaveData->size = pSaveData->pTable[pSaveData->currentIndex].location; - pSaveData->pCurrentData = pSaveData->pBaseData + pSaveData->size; - // ------------------- - - - const globalentity_t *pGlobal = gGlobalState.EntityFromTable( tmpVars.globalname ); - - // Don't overlay any instance of the global that isn't the latest - // pSaveData->szCurrentMapName is the level this entity is coming from - // pGlobla->levelName is the last level the global entity was active in. - // If they aren't the same, then this global update is out of date. - if ( !FStrEq( pSaveData->szCurrentMapName, pGlobal->levelName ) ) - return 0; - - // Compute the new global offset - oldOffset = pSaveData->vecLandmarkOffset; - CBaseEntity *pNewEntity = FindGlobalEntity( tmpVars.classname, tmpVars.globalname ); - if ( pNewEntity ) - { -// ALERT( at_console, "Overlay %s with %s\n", STRING(pNewEntity->pev->classname), STRING(tmpVars.classname) ); - // Tell the restore code we're overlaying a global entity from another level - restoreHelper.SetGlobalMode( 1 ); // Don't overwrite global fields - pSaveData->vecLandmarkOffset = (pSaveData->vecLandmarkOffset - pNewEntity->pev->mins) + tmpVars.mins; - pEntity = pNewEntity;// we're going to restore this data OVER the old entity - pent = ENT( pEntity->pev ); - // Update the global table to say that the global definition of this entity should come from this level - gGlobalState.EntityUpdate( pEntity->pev->globalname, gpGlobals->mapname ); - } - else - { - // This entity will be freed automatically by the engine. If we don't do a restore on a matching entity (below) - // or call EntityUpdate() to move it to this level, we haven't changed global state at all. - return 0; - } - - } - - if ( pEntity->ObjectCaps() & FCAP_MUST_SPAWN ) - { - pEntity->Restore( restoreHelper ); - pEntity->Spawn(); - } - else - { - pEntity->Restore( restoreHelper ); - pEntity->Precache( ); - } - - // Again, could be deleted, get the pointer again. - pEntity = (CBaseEntity *)GET_PRIVATE(pent); - -#if 0 - if ( pEntity && pEntity->pev->globalname && globalEntity ) - { - ALERT( at_console, "Global %s is %s\n", STRING(pEntity->pev->globalname), STRING(pEntity->pev->model) ); - } -#endif - - // Is this an overriding global entity (coming over the transition), or one restoring in a level - if ( globalEntity ) - { -// ALERT( at_console, "After: %f %f %f %s\n", pEntity->pev->origin.x, pEntity->pev->origin.y, pEntity->pev->origin.z, STRING(pEntity->pev->model) ); - pSaveData->vecLandmarkOffset = oldOffset; - if ( pEntity ) - { - UTIL_SetOrigin( pEntity->pev, pEntity->pev->origin ); - pEntity->OverrideReset(); - } - } - else if ( pEntity && pEntity->pev->globalname ) - { - const globalentity_t *pGlobal = gGlobalState.EntityFromTable( pEntity->pev->globalname ); - if ( pGlobal ) - { - // Already dead? delete - if ( pGlobal->state == GLOBAL_DEAD ) - return -1; - else if ( !FStrEq( STRING(gpGlobals->mapname), pGlobal->levelName ) ) - { - pEntity->MakeDormant(); // Hasn't been moved to this level yet, wait but stay alive - } - // In this level & not dead, continue on as normal - } - else - { - ALERT( at_error, "Global Entity %s (%s) not in table!!!\n", STRING(pEntity->pev->globalname), STRING(pEntity->pev->classname) ); - // Spawned entities default to 'On' - gGlobalState.EntityAdd( pEntity->pev->globalname, gpGlobals->mapname, GLOBAL_ON ); - } - } - } - return 0; -} - - -void DispatchObjectCollsionBox( edict_t *pent ) -{ - CBaseEntity *pEntity = (CBaseEntity *)GET_PRIVATE(pent); - if (pEntity) - { - if (pEntity->pev->iuser4 == 1337) { // HACK TOWN USA - // dead monsters have all have the same giant collision box for hit detections - // outside of the normal bbox (monsters sometimes die in positions far away from their origin) - Vector deadMins = Vector(-256, -256, -256); // negative z for player corpses or upside-down monsters - Vector deadMaxs = Vector(256, 256, 256); - - pEntity->pev->absmin = pEntity->pev->origin + deadMins; - pEntity->pev->absmax = pEntity->pev->origin + deadMaxs; - } - else { - pEntity->SetObjectCollisionBox(); - } - } - else - SetObjectCollisionBox( &pent->v ); -} - - -void SaveWriteFields( SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount ) -{ - CSave saveHelper( pSaveData ); - saveHelper.WriteFields( pname, pBaseData, pFields, fieldCount ); -} - - -void SaveReadFields( SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount ) -{ - CRestore restoreHelper( pSaveData ); - restoreHelper.ReadFields( pname, pBaseData, pFields, fieldCount ); -} - -EHANDLE::EHANDLE(edict_t* pent) { - Set(pent); -} - -edict_t * EHANDLE::GetEdict( void ) -{ - if (m_pent) { - byte* edicts = (byte*)ENT(0); - byte* endEdicts = edicts + sizeof(edict_t) * gpGlobals->maxEntities; - bool inRange = (byte*)m_pent >= edicts && (byte*)m_pent < endEdicts; - bool aligned = (((byte*)m_pent - edicts) % sizeof(edict_t)) == 0; - - if (!inRange || !aligned) { - ALERT(at_error, "An EHANDLE was corrupted! Nulled to avoid crash.\n"); - m_pent = NULL; - return NULL; - } - - if (!m_pent->free && m_pent->serialnumber == m_serialnumber) { - return m_pent; - } - } - - return NULL; -} - -CBaseEntity* EHANDLE::GetEntity(void) -{ - return (CBaseEntity*)GET_PRIVATE(GetEdict()); -} - -edict_t * EHANDLE::Set( edict_t *pent ) -{ - m_pent = pent; - if (pent) - m_serialnumber = m_pent->serialnumber; - return pent; -} - - -EHANDLE :: operator CBaseEntity *() -{ - return (CBaseEntity *)GET_PRIVATE( GetEdict() ); -} - -CBaseEntity * EHANDLE :: operator = (CBaseEntity *pEntity) -{ - if (pEntity) - { - m_pent = ENT( pEntity->pev ); - if (m_pent) - m_serialnumber = m_pent->serialnumber; - } - else - { - m_pent = NULL; - m_serialnumber = 0; - } - return pEntity; -} - -CBaseEntity * EHANDLE :: operator -> () -{ - return (CBaseEntity *)GET_PRIVATE( GetEdict() ); -} - -// Initialize absmin & absmax to the appropriate box -void SetObjectCollisionBox( entvars_t *pev ) -{ - if ( (pev->solid == SOLID_BSP) && - (pev->angles.x || pev->angles.y|| pev->angles.z) ) - { // expand for rotation - // TODO: this might explain why some objects get blocked by things very far away - float max, v; - int i; - - max = 0; - for (i=0 ; i<3 ; i++) - { - v = fabs( ((float *)pev->mins)[i]); - if (v > max) - max = v; - v = fabs( ((float *)pev->maxs)[i]); - if (v > max) - max = v; - } - for (i=0 ; i<3 ; i++) - { - ((float *)pev->absmin)[i] = ((float *)pev->origin)[i] - max; - ((float *)pev->absmax)[i] = ((float *)pev->origin)[i] + max; - } - } - else - { - pev->absmin = pev->origin + pev->mins; - pev->absmax = pev->origin + pev->maxs; - } - - pev->absmin.x -= 1; - pev->absmin.y -= 1; - pev->absmin.z -= 1; - pev->absmax.x += 1; - pev->absmax.y += 1; - pev->absmax.z += 1; -} - diff --git a/dlls/cbase.h b/dlls/cbase.h deleted file mode 100644 index 114f09f8..00000000 --- a/dlls/cbase.h +++ /dev/null @@ -1,884 +0,0 @@ -/*** -* -* Copyright (c) 1996-2001, 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. -* -****/ -/* - -Class Hierachy - -CBaseEntity - CBaseDelay - CBaseToggle - CBaseItem - CBaseMonster - CBaseCycler - CBasePlayer - CBaseGroup -*/ -#pragma once - -#define MAX_PATH_SIZE 10 // max number of nodes available for a path. - -// 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_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_DIRECTIONAL_USE 0x00000040 // Player sends +/- 1 when using (currently only tracktrains) -#define FCAP_MASTER 0x00000080 // Can be used to "master" other entities (like multisource) - -// UNDONE: This will ignore transition volumes (trigger_transition), but not the PVS!!! -#define FCAP_FORCE_TRANSITION 0x00000080 // ALWAYS goes across transitions - -#include "archtypes.h" // DAL -#include "saverestore.h" -#include "monster/schedule.h" - -#ifndef MONSTEREVENT_H -#include "monster/monsterevent.h" -#endif - -#include "Platform.h" -#include "CKeyValue.h" - -typedef struct { - DLL_FUNCTIONS* dllapi_table; - NEW_DLL_FUNCTIONS* newapi_table; -} gamedll_funcs_t; - -EXPORT extern gamedll_funcs_t* gpGamedllFuncs; // for ease of porting to/from metamod - -// C functions for external declarations that call the appropriate C++ methods - -extern "C" DLLEXPORT int GetEntityAPI( DLL_FUNCTIONS *pFunctionTable, int interfaceVersion ); -extern "C" DLLEXPORT int GetEntityAPI2( DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion ); -extern "C" DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS * pNewFunctionTable, int* interfaceVersion); - -EXPORT extern int DispatchSpawn( edict_t *pent ); -EXPORT extern void DispatchKeyValue( edict_t *pentKeyvalue, KeyValueData *pkvd ); -EXPORT extern void DispatchTouch( edict_t *pentTouched, edict_t *pentOther ); -EXPORT extern void DispatchUse( edict_t *pentUsed, edict_t *pentOther ); -EXPORT extern void DispatchThink( edict_t *pent ); -EXPORT extern void DispatchBlocked( edict_t *pentBlocked, edict_t *pentOther ); -EXPORT extern void DispatchSave( edict_t *pent, SAVERESTOREDATA *pSaveData ); -EXPORT extern int DispatchRestore( edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity ); -EXPORT extern void DispatchObjectCollsionBox( edict_t *pent ); -EXPORT extern void SaveWriteFields( SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount ); -EXPORT extern void SaveReadFields( SAVERESTOREDATA *pSaveData, const char *pname, void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCount ); -EXPORT extern void SaveGlobalState( SAVERESTOREDATA *pSaveData ); -EXPORT extern void RestoreGlobalState( SAVERESTOREDATA *pSaveData ); -EXPORT extern void ResetGlobalState( void ); -EXPORT extern void SetObjectCollisionBox(entvars_t* pev); - -typedef enum { USE_OFF = 0, USE_ON = 1, USE_SET = 2, USE_TOGGLE = 3 } USE_TYPE; - -EXPORT extern void FireTargets( const char *targetName, CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ); - -void* GET_PRIVATE(const edict_t* pent); - -typedef void (CBaseEntity::*BASEPTR)(void); -typedef void (CBaseEntity::*ENTITYFUNCPTR)(CBaseEntity *pOther ); -typedef void (CBaseEntity::*USEPTR)( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ); - -// For CLASSIFY -#define CLASS_NONE 0 -#define CLASS_MACHINE 1 -#define CLASS_PLAYER 2 -#define CLASS_HUMAN_PASSIVE 3 -#define CLASS_HUMAN_MILITARY 4 -#define CLASS_ALIEN_MILITARY 5 -#define CLASS_ALIEN_PASSIVE 6 -#define CLASS_ALIEN_MONSTER 7 -#define CLASS_ALIEN_PREY 8 -#define CLASS_ALIEN_PREDATOR 9 -#define CLASS_INSECT 10 -#define CLASS_PLAYER_ALLY 11 -#define CLASS_PLAYER_BIOWEAPON 12 // hornets and snarks.launched by players -#define CLASS_ALIEN_BIOWEAPON 13 // hornets and snarks.launched by the alien menace -#define CLASS_ALIEN_RACE_X 14 -#define CLASS_ALIEN_RACE_X_PITDRONE 15 // TODO: use this -#define CLASS_VEHICLE 16 -#define CLASS_BARNACLE 99 // special because no one pays attention to it, and it eats a wide cross-section of creatures. - -class CBaseEntity; -class CBaseMonster; -class CBasePlayerWeapon; -class CTalkSquadMonster; -class CBaseToggle; -class CBaseAnimating; - - -#define SF_NORESPAWN ( 1 << 10 )// !!!set this bit on guns and stuff that should never respawn. - -// -// EHANDLE. Safe way to point to CBaseEntities who may die between frames -// -class EXPORT EHANDLE -{ -private: - edict_t *m_pent; - int m_serialnumber; -public: - EHANDLE() : m_pent(0), m_serialnumber(0) {} - EHANDLE(edict_t* pent); - edict_t *GetEdict( void ); - CBaseEntity *GetEntity( void ); - edict_t *Set( edict_t *pent ); - - operator CBaseEntity *(); - - CBaseEntity * operator = (CBaseEntity *pEntity); - CBaseEntity * operator ->(); -}; - -enum entindex_priority { - // entity should have an index lower than 512 so that sprite attachments work - // (skin is sent with 9 bits in delta.lst and this can't be changed for vanilla HL clients) - ENTIDX_PRIORITY_HIGH, - - // entity is likely to be sent to clients (monsters, sprites, doors, etc.) - ENTIDX_PRIORITY_NORMAL, - - // entity is server-side only and can have an index above the client limit - // TODO: make a separate edict list for these, things like logic ents are basically a scripting engine - ENTIDX_PRIORITY_LOW, -}; - -// -// Base Entity. All entity types derive from this -// -class EXPORT CBaseEntity -{ -public: - // 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 - - // path corners - EHANDLE m_hGoalEnt;// path corner we are heading towards - EHANDLE m_hLink;// used for temporary link-list operations. - - // initialization functions - virtual void Spawn( void ) { return; } - virtual void Precache( void ) { return; } - virtual void KeyValue(KeyValueData* pkvd); - virtual CKeyValue GetKeyValue(const char* keyName); - CKeyValue GetCustomKeyValue(const char* keyName); - std::unordered_map* GetCustomKeyValues(); - virtual int Save( CSave &save ); - virtual int Restore( CRestore &restore ); - virtual int ObjectCaps( void ) { return FCAP_ACROSS_TRANSITION; } - virtual void Activate( void ) {} - virtual int GetEntindexPriority() { return ENTIDX_PRIORITY_NORMAL; } - virtual bool ForceVisChecks() { return false; } // return true for invisible ents that normally skip VIS checks in AddToFullPack - virtual Vector GetTargetOrigin() { return pev->origin; } // origin used for monster pathing and targetting - - // Setup the object->object collision box (pev->mins / pev->maxs is the object->world collision box) - virtual void SetObjectCollisionBox( void ); - -// Classify - returns the type of group (i.e, "houndeye", or "human military" so that monsters with different classnames -// still realize that they are teammates. (overridden for monsters that form groups) - virtual int Classify ( void ) { return m_Classify; }; - virtual void DeathNotice ( entvars_t* pevChild) {}// monster maker children use this to tell the monster maker that they have died. - - - static TYPEDESCRIPTION m_SaveData[]; - - virtual void TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType); - virtual int TakeDamage( entvars_t* pevInflictor, entvars_t* pevAttacker, float flDamage, int bitsDamageType ); - virtual int TakeHealth( float flHealth, int bitsDamageType, float healthcap=0); - virtual void Killed( entvars_t *pevAttacker, int iGib ); - virtual int BloodColor( void ) { return DONT_BLEED; } - virtual void TraceBleed( float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType ); - virtual BOOL IsTriggered( CBaseEntity *pActivator ) {return TRUE;} - virtual CBaseMonster *MyMonsterPointer( void ) { return NULL;} - virtual CBasePlayerWeapon* GetWeaponPtr(void) { return NULL; }; - virtual CTalkSquadMonster * MyTalkSquadMonsterPointer( void ) { return NULL;} - virtual CBaseToggle* MyTogglePointer(void) { return NULL; } - virtual CBaseAnimating* MyAnimatingPointer(void) { return NULL; } - virtual int GetToggleState( void ) { return TS_AT_TOP; } - virtual void AddPoints( int score, BOOL bAllowNegativeScore ) {} - virtual void AddPointsToTeam( int score, BOOL bAllowNegativeScore ) {} - virtual BOOL AddPlayerItem( CBasePlayerItem *pItem ) { return 0; } - virtual BOOL RemovePlayerItem( CBasePlayerItem *pItem ) { return 0; } - virtual int GiveAmmo( int iAmount, const char *szName, int iMax ) { return -1; }; - virtual float GetDelay( void ) { return 0; } - virtual int IsMoving( void ) { return pev->velocity != g_vecZero; } - virtual void OverrideReset( void ) {} - virtual int DamageDecal( int bitsDamageType ); - // This is ONLY used by the node graph to test movement through a door - virtual void SetToggleState( int state ) {} - virtual void StartSneaking( void ) {} - virtual void StopSneaking( void ) {} - virtual BOOL OnControls( entvars_t *otherPev ) { return FALSE; } - virtual BOOL IsSneaking( void ) { return FALSE; } - virtual BOOL IsAlive( void ) { return (pev->deadflag == DEAD_NO) && pev->health > 0; } - virtual BOOL IsBSPModel( void ) { return pev->solid == SOLID_BSP || pev->movetype == MOVETYPE_PUSHSTEP; } - virtual BOOL ReflectGauss( void ) { return ( IsBSPModel() && !pev->takedamage ); } - virtual BOOL HasTarget( string_t targetname ) { return FStrEq(STRING(targetname), STRING(pev->target) ); } - virtual BOOL IsInWorld( void ); - virtual BOOL IsMonster( void ) { return FALSE; } - virtual BOOL IsNormalMonster(void) { return FALSE; } // is this what you'd expect to be a monster? (not a monstermaker/grenade/etc.) - virtual BOOL IsPlayer( void ) { return FALSE; } - virtual BOOL IsPlayerCorpse( void ) { return FALSE; } - virtual BOOL IsNetClient( void ) { return FALSE; } - virtual BOOL IsBreakable( void ) { return FALSE; } - virtual BOOL IsMachine(void) { return FALSE; }; - virtual const char *TeamID( void ) { return ""; } - virtual const char* DisplayName() { return STRING(pev->classname); } - virtual const char* GetDeathNoticeWeapon() { return STRING(pev->classname); }; - - -// virtual void SetActivator( CBaseEntity *pActivator ) {} - virtual CBaseEntity *GetNextTarget( void ); - - // fundamental callbacks - void (CBaseEntity ::*m_pfnThink)(void); - void (CBaseEntity ::*m_pfnTouch)( CBaseEntity *pOther ); - void (CBaseEntity ::*m_pfnUse)( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ); - void (CBaseEntity ::*m_pfnBlocked)( CBaseEntity *pOther ); - - virtual void Think( void ) { if (m_pfnThink) (this->*m_pfnThink)(); }; - virtual void Touch( CBaseEntity *pOther ) { if (m_pfnTouch) (this->*m_pfnTouch)( pOther ); }; - virtual void Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) - { - if (m_pfnUse) - (this->*m_pfnUse)( pActivator, pCaller, useType, value ); - } - virtual void Blocked( CBaseEntity *pOther ) { if (m_pfnBlocked) (this->*m_pfnBlocked)( pOther ); }; - - // allow engine to allocate instance data - void *operator new( size_t stAllocateBlock, entvars_t *pev ) - { - return (void *)ALLOC_PRIVATE(ENT(pev), stAllocateBlock); - }; - - // don't use this. -#if _MSC_VER >= 1200 // only build this code if MSVC++ 6.0 or higher - void operator delete(void *pMem, entvars_t *pev) - { - pev->flags |= FL_KILLME; - }; -#endif - - virtual void UpdateOnRemove( void ); - - // common member functions - void SUB_Remove( void ); - void SUB_DoNothing( void ); - void SUB_StartFadeOut ( void ); - void SUB_FadeOut ( void ); - void SUB_CallUseToggle( void ) { this->Use( this, this, USE_TOGGLE, 0 ); } - int ShouldToggle( USE_TYPE useType, BOOL currentState ); - void FireBullets( ULONG cShots, Vector vecSrc, Vector vecDirShooting, Vector vecSpread, float flDistance, int iBulletType, int iTracerFreq = 4, int iDamage = 0, entvars_t *pevAttacker = NULL ); - Vector FireBulletsPlayer( ULONG cShots, Vector vecSrc, Vector vecDirShooting, Vector vecSpread, float flDistance, int iBulletType, int iTracerFreq = 4, int iDamage = 0, entvars_t *pevAttacker = NULL, int shared_rand = 0 ); - - virtual CBaseEntity *Respawn( void ) { return NULL; } - - void SUB_UseTargets( CBaseEntity *pActivator, USE_TYPE useType, float value ); - // Do the bounding boxes of these two intersect? - int Intersects( CBaseEntity *pOther ); - void MakeDormant( void ); - int IsDormant( void ); - BOOL IsLockedByMaster( void ) { return FALSE; } - - static CBaseEntity *Instance( const edict_t *pent ) - { - if ( !pent ) - pent = ENT(0); - CBaseEntity *pEnt = (CBaseEntity *)GET_PRIVATE(pent); - return pEnt; - } - - static CBaseEntity *Instance( entvars_t *pev ) { return Instance( ENT( pev ) ); } - static CBaseEntity *Instance( int eoffset) { return Instance( ENT( eoffset) ); } - - CBaseMonster *GetMonsterPointer( entvars_t *pevMonster ) - { - CBaseEntity *pEntity = Instance( pevMonster ); - if ( pEntity ) - return pEntity->MyMonsterPointer(); - return NULL; - } - CBaseMonster *GetMonsterPointer( edict_t *pentMonster ) - { - CBaseEntity *pEntity = Instance( pentMonster ); - if ( pEntity ) - return pEntity->MyMonsterPointer(); - return NULL; - } - - - // Ugly code to lookup all functions to make sure they are exported when set. -#ifdef _DEBUG - void FunctionCheck( void *pFunction, char *name ) - { - //if (pFunction && !NAME_FOR_FUNCTION((uint32)pFunction) ) - // ALERT( at_error, "No EXPORT: %s:%s (%08lx)\n", STRING(pev->classname), name, (uint32)pFunction ); - } - - BASEPTR ThinkSet( BASEPTR func, char *name ) - { - m_pfnThink = func; - FunctionCheck( (void *)*((int *)((char *)this + ( offsetof(CBaseEntity,m_pfnThink)))), name ); - return func; - } - ENTITYFUNCPTR TouchSet( ENTITYFUNCPTR func, char *name ) - { - m_pfnTouch = func; - FunctionCheck( (void *)*((int *)((char *)this + ( offsetof(CBaseEntity,m_pfnTouch)))), name ); - return func; - } - USEPTR UseSet( USEPTR func, char *name ) - { - m_pfnUse = func; - FunctionCheck( (void *)*((int *)((char *)this + ( offsetof(CBaseEntity,m_pfnUse)))), name ); - return func; - } - ENTITYFUNCPTR BlockedSet( ENTITYFUNCPTR func, char *name ) - { - m_pfnBlocked = func; - FunctionCheck( (void *)*((int *)((char *)this + ( offsetof(CBaseEntity,m_pfnBlocked)))), name ); - return func; - } - -#endif - - - // virtual functions used by a few classes - - // used by monsters that are created by the MonsterMaker - virtual void UpdateOwner( void ) { return; }; - - - // - static CBaseEntity *Create( const char *szName, const Vector &vecOrigin, const Vector &vecAngles, edict_t *pentOwner = NULL, std::unordered_map keys= std::unordered_map()); - - virtual BOOL FBecomeProne( void ) {return FALSE;}; - edict_t *edict() { return ENT( pev ); }; - EOFFSET eoffset( ) { return OFFSET( pev ); }; - int entindex( ) { return ENTINDEX( edict() ); }; - - virtual Vector Center( ) { return (pev->absmax + pev->absmin) * 0.5; }; // center point of entity - virtual Vector EyePosition( ) { return pev->origin + pev->view_ofs; }; // position of eyes - virtual Vector EarPosition( ) { return pev->origin + pev->view_ofs; }; // position of ears - virtual Vector BodyTarget( const Vector &posSrc ) { return Center( ); }; // position to shoot at - - virtual int Illumination( ) { return GETENTITYILLUM( ENT( pev ) ); }; - - virtual BOOL FVisible ( CBaseEntity *pEntity ); - virtual BOOL FVisible ( const Vector &vecOrigin ); - - virtual void SetClassify(int iNewClassify); - virtual int IRelationship(CBaseEntity* pTarget); - static int IRelationship(int attackerClass, int victimClass); - bool ShouldBlockFriendlyFire(entvars_t* attacker); - - // can the player using this entity physically touch the ent with their hand? - // or is there something in the way? (player use code assumes arms have noclip) - bool CanReach(CBaseEntity* toucher); - - // true if this entity is in the PVS of the given player - inline bool InPVS(edict_t* player) { return m_pvsPlayers & PLRBIT(player); } - - // true if the entity is in the PAS of the given player - inline bool InPAS(edict_t* player) { return m_pasPlayers & PLRBIT(player); } - - // true if the entity is networked to the given player - inline bool isVisibleTo(edict_t* player) { return m_netPlayers & PLRBIT(player); } - - // true if the entity was flagged to be hidden from the given player - inline bool isHiddenFrom(edict_t* player) { return m_hidePlayers & PLRBIT(player); } - - // flag this entity to be visible/invisible to the given player - inline void SetVisible(edict_t* player, bool visible) { - if (visible) m_hidePlayers &= ~PLRBIT(player); - else m_hidePlayers |= PLRBIT(player); - } - - //We use this variables to store each ammo count. - int ammo_9mm; - int ammo_357; - int ammo_bolts; - int ammo_buckshot; - int ammo_rockets; - int ammo_uranium; - int ammo_hornets; - int ammo_argrens; - //Special stuff for grenades and satchels. - float m_flStartThrow; - float m_flReleaseThrow; - int m_chargeReady; - int m_fInAttack; - - enum EGON_FIRESTATE { FIRE_OFF, FIRE_CHARGE }; - int m_fireState; - int m_Classify; // Classify, to let mappers override the default - - uint32_t m_pasPlayers; // players in the audible set of this entity (invalid for invisible ents) - uint32_t m_pvsPlayers; // players in the visible set of this entity (invalid for invisible ents) - uint32_t m_netPlayers; // players this entity has been networked to (AddToFullPack returned 1) - uint32_t m_hidePlayers; // players this entity will be hidden from (AddToFullPack) -}; - - - -// Ugly technique to override base member functions -// Normally it's illegal to cast a pointer to a member function of a derived class to a pointer to a -// member function of a base class. static_cast is a sleezy way around that problem. - -#ifdef _DEBUG - -#define SetThink( a ) ThinkSet( static_cast (a), #a ) -#define SetTouch( a ) TouchSet( static_cast (a), #a ) -#define SetUse( a ) UseSet( static_cast (a), #a ) -#define SetBlocked( a ) BlockedSet( static_cast (a), #a ) - -#else - -#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) - -#endif - - -class EXPORT CPointEntity : public CBaseEntity -{ -public: - virtual int GetEntindexPriority() { return ENTIDX_PRIORITY_LOW; } - void Spawn( void ); - virtual int ObjectCaps( void ) { return CBaseEntity :: ObjectCaps() & ~FCAP_ACROSS_TRANSITION; } -private: -}; - - -typedef struct locksounds // sounds that doors and buttons make when locked/unlocked -{ - string_t sLockedSound; // sound a door makes when it's locked - string_t sLockedSentence; // sentence group played when door is locked - string_t sUnlockedSound; // sound a door makes when it's unlocked - string_t sUnlockedSentence; // sentence group played when door is unlocked - - int iLockedSentence; // which sentence in sentence group to play next - int iUnlockedSentence; // which sentence in sentence group to play next - - float flwaitSound; // time delay between playing consecutive 'locked/unlocked' sounds - float flwaitSentence; // time delay between playing consecutive sentences - BYTE bEOFLocked; // true if hit end of list of locked sentences - BYTE bEOFUnlocked; // true if hit end of list of unlocked sentences -} locksound_t; - -void PlayLockSounds(entvars_t *pev, locksound_t *pls, int flocked, int fbutton); - -// -// MultiSouce -// - -#define MAX_MULTI_TARGETS 64 // maximum number of targets a single multi_manager entity may be assigned. -#define MS_MAX_TARGETS 32 - -class EXPORT CMultiSource : public CPointEntity -{ -public: - void Spawn( ); - void KeyValue( KeyValueData *pkvd ); - void Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ); - int ObjectCaps( void ) { return (CPointEntity::ObjectCaps() | FCAP_MASTER); } - BOOL IsTriggered( CBaseEntity *pActivator ); - void Register( void ); - virtual int Save( CSave &save ); - virtual int Restore( CRestore &restore ); - - static TYPEDESCRIPTION m_SaveData[]; - - EHANDLE m_rgEntities[MS_MAX_TARGETS]; - int m_rgTriggered[MS_MAX_TARGETS]; - - int m_iTotal; - string_t m_globalstate; - bool m_registered; -}; - - -// -// generic Delay entity. -// -class EXPORT CBaseDelay : public CBaseEntity -{ -public: - float m_flDelay; - int m_iszKillTarget; - - virtual int GetEntindexPriority() { return ENTIDX_PRIORITY_LOW; } - virtual void KeyValue( KeyValueData* pkvd); - virtual int Save( CSave &save ); - virtual int Restore( CRestore &restore ); - - static TYPEDESCRIPTION m_SaveData[]; - // common member functions - void SUB_UseTargets( CBaseEntity *pActivator, USE_TYPE useType, float value ); - void DelayThink( void ); -}; - - -class EXPORT CBaseAnimating : public CBaseDelay -{ -public: - virtual int GetEntindexPriority() { return ENTIDX_PRIORITY_NORMAL; } - virtual int Save( CSave &save ); - virtual int Restore( CRestore &restore ); - virtual CBaseAnimating* MyAnimatingPointer(void) { return this; } - - static TYPEDESCRIPTION m_SaveData[]; - - // Basic Monster Animation functions - float StudioFrameAdvance( float flInterval = 0.0 ); // accumulate animation frame time from last time called until now - int GetSequenceFlags( void ); - virtual int LookupActivity ( int activity ); - int LookupActivityHeaviest ( int activity ); - int LookupSequence ( const char *label ); - void ResetSequenceInfo ( ); - void DispatchAnimEvents ( float flFutureInterval = 0.1 ); // Handle events that have happend since last time called up until X seconds into the future - virtual void HandleAnimEvent( MonsterEvent_t *pEvent ) { return; }; - float SetBoneController ( int iController, float flValue ); - void InitBoneControllers ( void ); - float SetBlending ( int iBlender, float flValue ); - void GetBonePosition ( int iBone, Vector &origin, Vector &angles ); - void GetAutomovement( Vector &origin, Vector &angles, float flInterval = 0.1 ); - int FindTransition( int iEndingSequence, int iGoalSequence, int *piDir ); - void GetAttachment ( int iAttachment, Vector &origin, Vector &angles ); - int GetAttachmentCount(); - void SetBodygroup( int iGroup, int iValue ); - int GetBodygroup( int iGroup ); - int ExtractBbox( int sequence, float *mins, float *maxs ); - void SetSequenceBox( void ); - bool ActivityHasEvent(int activity, int event); - - // 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 -}; - - -// -// generic Toggle entity. -// -#define SF_ITEM_USE_ONLY 256 // ITEM_USE_ONLY = BUTTON_USE_ONLY = DOOR_USE_ONLY!!! - -class EXPORT CBaseToggle : public CBaseAnimating -{ -public: - void KeyValue( KeyValueData *pkvd ); - - 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 - - Vector m_vecPosition1; - Vector m_vecPosition2; - Vector m_vecAngle1; - Vector m_vecAngle2; - - int m_cTriggersLeft; // trigger_counter only, # of activations remaining - float m_flHeight; - EHANDLE m_hActivator; - void (CBaseToggle::*m_pfnCallWhenMoveDone)(void); - Vector m_vecFinalDest; - Vector m_vecFinalAngle; - - int m_bitsDamageInflict; // DMG_ damage type that the door or tigger does - - virtual int Save( CSave &save ); - virtual int Restore( CRestore &restore ); - - static TYPEDESCRIPTION m_SaveData[]; - - virtual int GetToggleState( void ) { return m_toggle_state; } - virtual float GetDelay( void ) { return m_flWait; } - - // common member functions - void LinearMove( Vector vecDest, float flSpeed ); - void LinearMoveDone( void ); - void AngularMove( Vector vecDestAngle, float flSpeed ); - void AngularMoveDone( void ); - BOOL IsLockedByMaster( void ); - - virtual CBaseToggle* MyTogglePointer(void) { return this; } - - // monsters use this, but so could buttons for instance - virtual void PlaySentence(const char* pszSentence, float duration, float volume, float attenuation); - virtual void PlayScriptedSentence(const char* pszSentence, float duration, float volume, float attenuation, BOOL bConcurrent, CBaseEntity* pListener); - virtual void SentenceStop(void); - virtual BOOL IsAllowedToSpeak() { return FALSE; } - - static float AxisValue( int flags, const Vector &angles ); - static void AxisDir( entvars_t *pev ); - static float AxisDelta( int flags, const Vector &angle1, const Vector &angle2 ); - - string_t m_sMaster; // If this button has a master switch, this is the targetname. - // A master switch must be of the multisource type. If all - // of the switches in the multisource have been triggered, then - // the button will be allowed to operate. Otherwise, it will be - // deactivated. -}; -#define SetMoveDone( a ) m_pfnCallWhenMoveDone = static_cast (a) - - -// people gib if their health is <= this at the time of death -#define GIB_HEALTH_VALUE -30 - -#define ROUTE_SIZE 8 // how many waypoints a monster can store at one time -#define MAX_OLD_ENEMIES 4 // how many old enemies to remember - -#define bits_CAP_DUCK ( 1 << 0 )// crouch -#define bits_CAP_JUMP ( 1 << 1 )// jump/leap -#define bits_CAP_STRAFE ( 1 << 2 )// strafe ( walk/run sideways) -#define bits_CAP_SQUAD ( 1 << 3 )// can form squads -#define bits_CAP_SWIM ( 1 << 4 )// proficiently navigate in water -#define bits_CAP_CLIMB ( 1 << 5 )// climb ladders/ropes -#define bits_CAP_USE ( 1 << 6 )// open doors/push buttons/pull levers -#define bits_CAP_HEAR ( 1 << 7 )// can hear forced sounds -#define bits_CAP_AUTO_DOORS ( 1 << 8 )// can trigger auto doors -#define bits_CAP_OPEN_DOORS ( 1 << 9 )// can open manual doors -#define bits_CAP_TURN_HEAD ( 1 << 10)// can turn head, always bone controller 0 - -#define bits_CAP_RANGE_ATTACK1 ( 1 << 11)// can do a range attack 1 -#define bits_CAP_RANGE_ATTACK2 ( 1 << 12)// can do a range attack 2 -#define bits_CAP_MELEE_ATTACK1 ( 1 << 13)// can do a melee attack 1 -#define bits_CAP_MELEE_ATTACK2 ( 1 << 14)// can do a melee attack 2 - -#define bits_CAP_FLY ( 1 << 15)// can fly, move all around - -#define bits_CAP_DOORS_GROUP (bits_CAP_USE | bits_CAP_AUTO_DOORS | bits_CAP_OPEN_DOORS) - -// used by suit voice to indicate damage sustained and repaired type to player - -// instant damage - -#define DMG_GENERIC 0 // generic damage was done -#define DMG_CRUSH (1 << 0) // crushed by falling or moving object -#define DMG_BULLET (1 << 1) // shot -#define DMG_SLASH (1 << 2) // cut, clawed, stabbed -#define DMG_BURN (1 << 3) // heat burned -#define DMG_FREEZE (1 << 4) // frozen -#define DMG_FALL (1 << 5) // fell too far -#define DMG_BLAST (1 << 6) // explosive blast damage -#define DMG_CLUB (1 << 7) // crowbar, punch, headbutt -#define DMG_SHOCK (1 << 8) // electric shock -#define DMG_SONIC (1 << 9) // sound pulse shockwave -#define DMG_ENERGYBEAM (1 << 10) // laser or other high energy beam -#define DMG_NEVERGIB (1 << 12) // with this bit OR'd in, no damage type will be able to gib victims upon death -#define DMG_ALWAYSGIB (1 << 13) // with this bit OR'd in, any damage type can be made to gib victims upon death. -#define DMG_DROWN (1 << 14) // Drowning -// time-based damage -#define DMG_TIMEBASED (~(0x3fff)) // mask for time-based damage - -#define DMG_PARALYZE (1 << 15) // slows affected creature down -#define DMG_NERVEGAS (1 << 16) // nerve toxins, very bad -#define DMG_POISON (1 << 17) // blood poisioning -#define DMG_RADIATION (1 << 18) // radiation exposure -#define DMG_DROWNRECOVER (1 << 19) // drowning recovery -#define DMG_ACID (1 << 20) // toxic chemicals or acid burns -#define DMG_SLOWBURN (1 << 21) // in an oven -#define DMG_SLOWFREEZE (1 << 22) // in a subzero freezer -#define DMG_MORTAR (1 << 23) // Hit by air raid (done to distinguish grenade from mortar) - -// sven-specific damages -#define DMG_SNIPER (1 << 24) // hit by a Sniper -#define DMG_MEDKITHEAL (1 << 25) // medkit healing -#define DMG_LAUNCH (1 << 26) // launch into air -#define DMG_SHOCK_GLOW (1 << 27) // shock glow effect - -// 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 -#define DMG_SHOWNHUD (DMG_POISON | DMG_ACID | DMG_FREEZE | DMG_SLOWFREEZE | DMG_DROWN | DMG_BURN | DMG_SLOWBURN | DMG_NERVEGAS | DMG_RADIATION | DMG_SHOCK) - -// damage types that draw blood from the victim -#define DMG_BLOOD (DMG_BULLET | DMG_SLASH | DMG_BLAST | DMG_CLUB | DMG_ACID | DMG_MORTAR | DMG_SNIPER | DMG_ENERGYBEAM) - -// NOTE: tweak these values based on gameplay feedback: - -#define PARALYZE_DURATION 2 // number of 2 second intervals to take damage -#define PARALYZE_DAMAGE 1.0 // damage to take each 2 second interval - -#define NERVEGAS_DURATION 2 -#define NERVEGAS_DAMAGE 5.0 - -#define POISON_DURATION 5 -#define POISON_DAMAGE 2.0 - -#define RADIATION_DURATION 2 -#define RADIATION_DAMAGE 1.0 - -#define ACID_DURATION 2 -#define ACID_DAMAGE 5.0 - -#define SLOWBURN_DURATION 2 -#define SLOWBURN_DAMAGE 1.0 - -#define SLOWFREEZE_DURATION 2 -#define SLOWFREEZE_DAMAGE 1.0 - - -#define itbd_Paralyze 0 -#define itbd_NerveGas 1 -#define itbd_Poison 2 -#define itbd_Radiation 3 -#define itbd_DrownRecover 4 -#define itbd_Acid 5 -#define itbd_SlowBurn 6 -#define itbd_SlowFreeze 7 -#define CDMG_TIMEBASED 8 - -// 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 WATERLEVEL_DRY 0 -#define WATERLEVEL_FEET 1 -#define WATERLEVEL_WAIST 2 -#define WATERLEVEL_HEAD 3 - -#define SF_ITEM_TOUCH_ONLY 128 // Pick this item up only by touching it. -#define SF_ITEM_USE_ONLY 256 // Pick this item up only by using it ('USE' key). -#define SF_ITEM_USE_WITHOUT_LOS 512 // Player can pick up this item even when it's not within his line of sight. - -class CBaseMonster; -class CCineMonster; -class CSound; - - - -// -// Weapons -// - -#define BAD_WEAPON 0x00007FFF - -// -// 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 - bool allocate = pev == NULL; - if (allocate) - pev = VARS(CREATE_ENTITY()); - - // get the private data - a = (T *)GET_PRIVATE(ENT(pev)); - - if (a == NULL) - { - // allocate private data - a = new(pev) T; // TODO: shouldn't this use malloc? What does the engine do? - a->pev = pev; - } - - // only relocate if a new entity was allocated, else EHANDLEs will break - return allocate ? (T*)RelocateEntIdx(a) : a; -} - -inline void* GET_PRIVATE(const edict_t* pent) -{ - if (pent) { - CBaseEntity* bent = (CBaseEntity*)pent->pvPrivateData; - - if (bent && bent->pev != &pent->v) { - // TODO: pev was linked wrong somehow. mem corruption? - ALERT(at_error, "Entity pev not linked to edict %d pev (%s)\n", - ENTINDEX(pent), STRING(pent->v.classname)); - bent->pev = (entvars_t*)&pent->v; - return NULL; - } - - return bent; - } - return NULL; -} - -/* -bit_PUSHBRUSH_DATA | bit_TOGGLE_DATA -bit_MONSTER_DATA -bit_DELAY_DATA -bit_TOGGLE_DATA | bit_DELAY_DATA | bit_MONSTER_DATA -bit_PLAYER_DATA | bit_MONSTER_DATA -bit_MONSTER_DATA | CYCLER_DATA -bit_LIGHT_DATA -path_corner_data -bit_MONSTER_DATA | wildcard_data -bit_MONSTER_DATA | bit_GROUP_DATA -boid_flock_data -boid_data -CYCLER_DATA -bit_ITEM_DATA -bit_ITEM_DATA | func_hud_data -bit_TOGGLE_DATA | bit_ITEM_DATA -EOFFSET -env_sound_data -env_sound_data -push_trigger_data -*/ - -#define TRACER_FREQ 4 // Tracers fire every 4 bullets - -typedef struct _SelAmmo -{ - BYTE Ammo1Type; - BYTE Ammo1; - BYTE Ammo2Type; - BYTE Ammo2; -} SelAmmo; - -extern edict_t* g_pBodyQueueHead; - -// this moved here from world.cpp, to allow classes to be derived from it -//======================= -// CWorld -// -// This spawns first when each level begins. -//======================= -class EXPORT CWorld : public CBaseEntity -{ -public: - virtual int GetEntindexPriority() { return ENTIDX_PRIORITY_HIGH; } - void Spawn( void ); - void Precache( void ); - void KeyValue( KeyValueData *pkvd ); - void loadReplacementFiles(); - const char* getDisplayName() { return "World"; } - - string_t m_globalModelList; - string_t m_globalSoundList; - string_t m_wadlist; - bool m_freeRoam; -}; diff --git a/dlls/env/CAmbientGeneric.cpp b/dlls/env/CAmbientGeneric.cpp index 2d768e11..ad66737a 100644 --- a/dlls/env/CAmbientGeneric.cpp +++ b/dlls/env/CAmbientGeneric.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "gamerules.h" #include "CAmbientGeneric.h" diff --git a/dlls/env/CAmbientGeneric.h b/dlls/env/CAmbientGeneric.h index 0fcf4c8c..ac9bd5f1 100644 --- a/dlls/env/CAmbientGeneric.h +++ b/dlls/env/CAmbientGeneric.h @@ -1,4 +1,5 @@ #pragma once +#include "CBaseEntity.h" enum playmodes { PLAYMODE_DEFAULT, diff --git a/dlls/env/CBeam.cpp b/dlls/env/CBeam.cpp index e2eb56f4..2279ba35 100644 --- a/dlls/env/CBeam.cpp +++ b/dlls/env/CBeam.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "customentity.h" #include "effects.h" #include "decals.h" diff --git a/dlls/env/CBlood.cpp b/dlls/env/CBlood.cpp index 7b5e6552..47291fbb 100644 --- a/dlls/env/CBlood.cpp +++ b/dlls/env/CBlood.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "customentity.h" #include "effects.h" #include "decals.h" diff --git a/dlls/env/CBloodSplat.cpp b/dlls/env/CBloodSplat.cpp index c60ce367..70b45bbd 100644 --- a/dlls/env/CBloodSplat.cpp +++ b/dlls/env/CBloodSplat.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "nodes.h" #include "env/CSoundEnt.h" #include "decals.h" diff --git a/dlls/env/CBubbling.cpp b/dlls/env/CBubbling.cpp index a9046ee8..74ba509e 100644 --- a/dlls/env/CBubbling.cpp +++ b/dlls/env/CBubbling.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "customentity.h" #include "effects.h" #include "decals.h" diff --git a/dlls/env/CCorpse.cpp b/dlls/env/CCorpse.cpp index e515b5ce..366b17a7 100644 --- a/dlls/env/CCorpse.cpp +++ b/dlls/env/CCorpse.cpp @@ -1,6 +1,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" +#include "CWorld.h" #include "bodyque.h" #include "CBaseMonster.h" diff --git a/dlls/env/CDecal.cpp b/dlls/env/CDecal.cpp index e6c4c53d..b6bfde78 100644 --- a/dlls/env/CDecal.cpp +++ b/dlls/env/CDecal.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "decals.h" #include "CBasePlayer.h" diff --git a/dlls/env/CEnvBeverage.cpp b/dlls/env/CEnvBeverage.cpp index 66ca301f..db664bf1 100644 --- a/dlls/env/CEnvBeverage.cpp +++ b/dlls/env/CEnvBeverage.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "customentity.h" #include "effects.h" #include "decals.h" diff --git a/dlls/env/CEnvExplosion.cpp b/dlls/env/CEnvExplosion.cpp index 1f5100f7..72f88c79 100644 --- a/dlls/env/CEnvExplosion.cpp +++ b/dlls/env/CEnvExplosion.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "decals.h" #include "explode.h" #include "weapons.h" diff --git a/dlls/env/CEnvFunnel.cpp b/dlls/env/CEnvFunnel.cpp index 2b86aa9a..7d31748f 100644 --- a/dlls/env/CEnvFunnel.cpp +++ b/dlls/env/CEnvFunnel.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "customentity.h" #include "effects.h" #include "decals.h" diff --git a/dlls/env/CEnvGlobal.cpp b/dlls/env/CEnvGlobal.cpp index 4dcec224..730d002f 100644 --- a/dlls/env/CEnvGlobal.cpp +++ b/dlls/env/CEnvGlobal.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #define SF_GLOBAL_SET 1 // Set global state to initial state on spawn diff --git a/dlls/env/CEnvLight.cpp b/dlls/env/CEnvLight.cpp index e8df403e..150c40ba 100644 --- a/dlls/env/CEnvLight.cpp +++ b/dlls/env/CEnvLight.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CLight.h" class CEnvLight : public CLight diff --git a/dlls/env/CEnvSentence.cpp b/dlls/env/CEnvSentence.cpp index 3511b520..bec69d74 100644 --- a/dlls/env/CEnvSentence.cpp +++ b/dlls/env/CEnvSentence.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #define SF_EMSG_ACTIVATOR_ONLY 1 diff --git a/dlls/env/CEnvShooter.cpp b/dlls/env/CEnvShooter.cpp index 6728d3c3..e693308d 100644 --- a/dlls/env/CEnvShooter.cpp +++ b/dlls/env/CEnvShooter.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "customentity.h" #include "effects.h" diff --git a/dlls/env/CEnvSound.cpp b/dlls/env/CEnvSound.cpp index ca05874a..0bf120b7 100644 --- a/dlls/env/CEnvSound.cpp +++ b/dlls/env/CEnvSound.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CBasePlayer.h" #include "CTalkSquadMonster.h" #include "gamerules.h" diff --git a/dlls/env/CEnvSpark.cpp b/dlls/env/CEnvSpark.cpp index f8328531..f22c4ea9 100644 --- a/dlls/env/CEnvSpark.cpp +++ b/dlls/env/CEnvSpark.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "CBaseButton.h" diff --git a/dlls/env/CFade.cpp b/dlls/env/CFade.cpp index 2e495407..55471b71 100644 --- a/dlls/env/CFade.cpp +++ b/dlls/env/CFade.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "customentity.h" #include "effects.h" #include "decals.h" diff --git a/dlls/env/CGib.cpp b/dlls/env/CGib.cpp index 24c0cdf6..50a72136 100644 --- a/dlls/env/CGib.cpp +++ b/dlls/env/CGib.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "env/CSoundEnt.h" #include "decals.h" diff --git a/dlls/env/CGibShooter.cpp b/dlls/env/CGibShooter.cpp index 2d0867bb..48ca9031 100644 --- a/dlls/env/CGibShooter.cpp +++ b/dlls/env/CGibShooter.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "customentity.h" #include "effects.h" diff --git a/dlls/env/CGlow.cpp b/dlls/env/CGlow.cpp index c10760a2..1afcd28d 100644 --- a/dlls/env/CGlow.cpp +++ b/dlls/env/CGlow.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "customentity.h" #include "effects.h" #include "decals.h" diff --git a/dlls/env/CLaser.cpp b/dlls/env/CLaser.cpp index 10f52a9b..febedd01 100644 --- a/dlls/env/CLaser.cpp +++ b/dlls/env/CLaser.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "customentity.h" #include "effects.h" #include "decals.h" diff --git a/dlls/env/CLight.cpp b/dlls/env/CLight.cpp index acd13f9a..57788ffa 100644 --- a/dlls/env/CLight.cpp +++ b/dlls/env/CLight.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CLight.h" LINK_ENTITY_TO_CLASS(light, CLight) diff --git a/dlls/env/CLightning.cpp b/dlls/env/CLightning.cpp index 9f28386b..bcf6ecc0 100644 --- a/dlls/env/CLightning.cpp +++ b/dlls/env/CLightning.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "customentity.h" #include "effects.h" #include "weapons.h" diff --git a/dlls/env/CMessage.cpp b/dlls/env/CMessage.cpp index ac15f65f..003d45ed 100644 --- a/dlls/env/CMessage.cpp +++ b/dlls/env/CMessage.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "customentity.h" #include "effects.h" #include "decals.h" diff --git a/dlls/env/CShake.cpp b/dlls/env/CShake.cpp index e2e66808..1cacb934 100644 --- a/dlls/env/CShake.cpp +++ b/dlls/env/CShake.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "customentity.h" #include "effects.h" #include "decals.h" diff --git a/dlls/env/CShower.cpp b/dlls/env/CShower.cpp index 3ada5635..0f0d135a 100644 --- a/dlls/env/CShower.cpp +++ b/dlls/env/CShower.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "decals.h" #include "explode.h" diff --git a/dlls/env/CSoundEnt.cpp b/dlls/env/CSoundEnt.cpp index 9477160c..333e58c4 100644 --- a/dlls/env/CSoundEnt.cpp +++ b/dlls/env/CSoundEnt.cpp @@ -14,7 +14,6 @@ ****/ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "env/CSoundEnt.h" diff --git a/dlls/env/CSoundEnt.h b/dlls/env/CSoundEnt.h index 60297598..2173a062 100644 --- a/dlls/env/CSoundEnt.h +++ b/dlls/env/CSoundEnt.h @@ -1,4 +1,6 @@ #pragma once +#include "CBaseEntity.h" + /*** * * Copyright (c) 1996-2001, Valve LLC. All rights reserved. diff --git a/dlls/env/CSpeaker.cpp b/dlls/env/CSpeaker.cpp index fd296323..d19026f5 100644 --- a/dlls/env/CSpeaker.cpp +++ b/dlls/env/CSpeaker.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CTalkSquadMonster.h" #include "gamerules.h" diff --git a/dlls/env/CSprayCan.cpp b/dlls/env/CSprayCan.cpp index 43a675f4..e08df9a0 100644 --- a/dlls/env/CSprayCan.cpp +++ b/dlls/env/CSprayCan.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CBasePlayer.h" #include "nodes.h" #include "env/CSoundEnt.h" diff --git a/dlls/env/CSprite.cpp b/dlls/env/CSprite.cpp index 8bc0efa2..031562db 100644 --- a/dlls/env/CSprite.cpp +++ b/dlls/env/CSprite.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "customentity.h" #include "effects.h" #include "decals.h" diff --git a/dlls/env/CSprite.h b/dlls/env/CSprite.h index 9b0b76c3..9fc07a61 100644 --- a/dlls/env/CSprite.h +++ b/dlls/env/CSprite.h @@ -1,5 +1,6 @@ #ifndef CSPRITE_H #define CSPRITE_H +#include "CPointEntity.h" #define SF_SPRITE_STARTON 0x0001 #define SF_SPRITE_ONCE 0x0002 diff --git a/dlls/env/CTestEffect.cpp b/dlls/env/CTestEffect.cpp index 68ac125b..1a55e091 100644 --- a/dlls/env/CTestEffect.cpp +++ b/dlls/env/CTestEffect.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "customentity.h" #include "effects.h" #include "decals.h" diff --git a/dlls/func/CBaseButton.cpp b/dlls/func/CBaseButton.cpp index 7ca76f9c..4bb60c17 100644 --- a/dlls/func/CBaseButton.cpp +++ b/dlls/func/CBaseButton.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "CBaseButton.h" diff --git a/dlls/func/CBaseButton.h b/dlls/func/CBaseButton.h index aa1155b5..2e49fa6d 100644 --- a/dlls/func/CBaseButton.h +++ b/dlls/func/CBaseButton.h @@ -1,5 +1,5 @@ #pragma once -//#include "const.h" +#include "CBaseDoor.h" #define SF_BUTTON_DONTMOVE 1 #define SF_ROTBUTTON_NOTSOLID 1 diff --git a/dlls/func/CBaseDoor.cpp b/dlls/func/CBaseDoor.cpp index 4f3f5c69..c2552af1 100644 --- a/dlls/func/CBaseDoor.cpp +++ b/dlls/func/CBaseDoor.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CBaseButton.h" #include "CBaseDoor.h" diff --git a/dlls/func/CBaseDoor.h b/dlls/func/CBaseDoor.h index f453ad2f..e525b22b 100644 --- a/dlls/func/CBaseDoor.h +++ b/dlls/func/CBaseDoor.h @@ -1,4 +1,5 @@ #pragma once +#include "CBaseToggle.h" // doors #define SF_DOOR_ROTATE_Y 0 @@ -16,6 +17,24 @@ #define door_noiseMoving noise1 #define door_noiseArrived noise2 +typedef struct locksounds // sounds that doors and buttons make when locked/unlocked +{ + string_t sLockedSound; // sound a door makes when it's locked + string_t sLockedSentence; // sentence group played when door is locked + string_t sUnlockedSound; // sound a door makes when it's unlocked + string_t sUnlockedSentence; // sentence group played when door is unlocked + + int iLockedSentence; // which sentence in sentence group to play next + int iUnlockedSentence; // which sentence in sentence group to play next + + float flwaitSound; // time delay between playing consecutive 'locked/unlocked' sounds + float flwaitSentence; // time delay between playing consecutive sentences + BYTE bEOFLocked; // true if hit end of list of locked sentences + BYTE bEOFUnlocked; // true if hit end of list of unlocked sentences +} locksound_t; + +void PlayLockSounds(entvars_t* pev, locksound_t* pls, int flocked, int fbutton); + class CBaseDoor : public CBaseToggle { public: diff --git a/dlls/func/CBasePlatTrain.cpp b/dlls/func/CBasePlatTrain.cpp index 3c637801..277dfdd2 100644 --- a/dlls/func/CBasePlatTrain.cpp +++ b/dlls/func/CBasePlatTrain.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "trains.h" #include "saverestore.h" #include "CBasePlatTrain.h" diff --git a/dlls/func/CBreakable.cpp b/dlls/func/CBreakable.cpp index 8856bd42..861c0173 100644 --- a/dlls/func/CBreakable.cpp +++ b/dlls/func/CBreakable.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "CBreakable.h" #include "decals.h" diff --git a/dlls/func/CBreakable.h b/dlls/func/CBreakable.h index f655f4dd..46e7fc75 100644 --- a/dlls/func/CBreakable.h +++ b/dlls/func/CBreakable.h @@ -1,5 +1,6 @@ #ifndef FUNC_BREAK_H #define FUNC_BREAK_H +#include "CBaseDelay.h" typedef enum { expRandom, expDirected } Explosions; typedef enum { matGlass = 0, matWood, matMetal, matFlesh, matCinderBlock, matCeilingTile, matComputer, matUnbreakableGlass, matRocks, matNone, matLastMaterial } Materials; diff --git a/dlls/func/CButtonTarget.cpp b/dlls/func/CButtonTarget.cpp index 1c94cf80..ce4a8076 100644 --- a/dlls/func/CButtonTarget.cpp +++ b/dlls/func/CButtonTarget.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #define SF_BTARGET_USE 0x0001 diff --git a/dlls/func/CFuncClip.cpp b/dlls/func/CFuncClip.cpp index bc4bf177..56bf691d 100644 --- a/dlls/func/CFuncClip.cpp +++ b/dlls/func/CFuncClip.cpp @@ -1,6 +1,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" +#include "CBaseEntity.h" #define SF_FCLIP_START_OFF 1 #define SF_FCLIP_DIRECTIONAL 2 diff --git a/dlls/func/CFuncConveyor.cpp b/dlls/func/CFuncConveyor.cpp index 3a454ca6..dbd8ad99 100644 --- a/dlls/func/CFuncConveyor.cpp +++ b/dlls/func/CFuncConveyor.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CFuncWall.h" #define SF_CONVEYOR_VISUAL 0x0001 diff --git a/dlls/func/CFuncIllusionary.cpp b/dlls/func/CFuncIllusionary.cpp index adcaaa87..00574d59 100644 --- a/dlls/func/CFuncIllusionary.cpp +++ b/dlls/func/CFuncIllusionary.cpp @@ -1,6 +1,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" +#include "CBaseToggle.h" /*QUAKED func_illusionary (0 .5 .8) ? A simple entity that looks solid but lets you walk through it. diff --git a/dlls/func/CFuncMonsterClip.cpp b/dlls/func/CFuncMonsterClip.cpp index 25806ab4..74e37012 100644 --- a/dlls/func/CFuncMonsterClip.cpp +++ b/dlls/func/CFuncMonsterClip.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CFuncWall.h" // ------------------------------------------------------------------------------- diff --git a/dlls/func/CFuncMortarField.cpp b/dlls/func/CFuncMortarField.cpp index 3289b7fe..eaad102f 100644 --- a/dlls/func/CFuncMortarField.cpp +++ b/dlls/func/CFuncMortarField.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "decals.h" #include "env/CSoundEnt.h" diff --git a/dlls/func/CFuncPendulum.cpp b/dlls/func/CFuncPendulum.cpp index 4ae13120..29a0fd93 100644 --- a/dlls/func/CFuncPendulum.cpp +++ b/dlls/func/CFuncPendulum.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CBaseDoor.h" #define SF_PENDULUM_SWING 2 // spawnflag that makes a pendulum a rope swing. diff --git a/dlls/func/CFuncPlat.cpp b/dlls/func/CFuncPlat.cpp index 7554464a..5cb24fd2 100644 --- a/dlls/func/CFuncPlat.cpp +++ b/dlls/func/CFuncPlat.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "trains.h" #include "saverestore.h" #include "CBasePlatTrain.h" diff --git a/dlls/func/CFuncPlatRot.cpp b/dlls/func/CFuncPlatRot.cpp index ba5ef75c..05b5ab24 100644 --- a/dlls/func/CFuncPlatRot.cpp +++ b/dlls/func/CFuncPlatRot.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "trains.h" #include "saverestore.h" #include "CBasePlatTrain.h" diff --git a/dlls/func/CFuncRotating.cpp b/dlls/func/CFuncRotating.cpp index a37c4cb7..5082689a 100644 --- a/dlls/func/CFuncRotating.cpp +++ b/dlls/func/CFuncRotating.cpp @@ -1,6 +1,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" +#include "CBaseEntity.h" #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 diff --git a/dlls/func/CFuncTank.cpp b/dlls/func/CFuncTank.cpp index bf75c6b6..2aa7c0dc 100644 --- a/dlls/func/CFuncTank.cpp +++ b/dlls/func/CFuncTank.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "effects.h" #include "weapons.h" #include "explode.h" diff --git a/dlls/func/CFuncTankControls.cpp b/dlls/func/CFuncTankControls.cpp index af5a405d..b4cafd18 100644 --- a/dlls/func/CFuncTankControls.cpp +++ b/dlls/func/CFuncTankControls.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "effects.h" #include "explode.h" #include "CFuncTank.h" diff --git a/dlls/func/CFuncTankGun.cpp b/dlls/func/CFuncTankGun.cpp index 5e747f8d..fdd0f59b 100644 --- a/dlls/func/CFuncTankGun.cpp +++ b/dlls/func/CFuncTankGun.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "effects.h" #include "weapons.h" #include "explode.h" diff --git a/dlls/func/CFuncTankLaser.cpp b/dlls/func/CFuncTankLaser.cpp index babb8877..2ac539d1 100644 --- a/dlls/func/CFuncTankLaser.cpp +++ b/dlls/func/CFuncTankLaser.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "effects.h" #include "explode.h" #include "CFuncTank.h" diff --git a/dlls/func/CFuncTankMortar.cpp b/dlls/func/CFuncTankMortar.cpp index 07b79885..b565f837 100644 --- a/dlls/func/CFuncTankMortar.cpp +++ b/dlls/func/CFuncTankMortar.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "effects.h" #include "explode.h" #include "CFuncTank.h" diff --git a/dlls/func/CFuncTankRocket.cpp b/dlls/func/CFuncTankRocket.cpp index 4617db1a..c6a4e693 100644 --- a/dlls/func/CFuncTankRocket.cpp +++ b/dlls/func/CFuncTankRocket.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "effects.h" #include "explode.h" #include "CFuncTank.h" diff --git a/dlls/func/CFuncTrackChange.cpp b/dlls/func/CFuncTrackChange.cpp index 07e08793..7c08c39d 100644 --- a/dlls/func/CFuncTrackChange.cpp +++ b/dlls/func/CFuncTrackChange.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "trains.h" #include "saverestore.h" #include "CBasePlatTrain.h" diff --git a/dlls/func/CFuncTrackTrain.cpp b/dlls/func/CFuncTrackTrain.cpp index f33b0a26..d6596950 100644 --- a/dlls/func/CFuncTrackTrain.cpp +++ b/dlls/func/CFuncTrackTrain.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "trains.h" #include "saverestore.h" #include "CBasePlatTrain.h" diff --git a/dlls/func/CFuncTrain.cpp b/dlls/func/CFuncTrain.cpp index 774954ba..38da110e 100644 --- a/dlls/func/CFuncTrain.cpp +++ b/dlls/func/CFuncTrain.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "trains.h" #include "saverestore.h" #include "CBasePlatTrain.h" diff --git a/dlls/func/CFuncTrainControls.cpp b/dlls/func/CFuncTrainControls.cpp index 914cc0a8..ade20144 100644 --- a/dlls/func/CFuncTrainControls.cpp +++ b/dlls/func/CFuncTrainControls.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "trains.h" #include "saverestore.h" #include "CBasePlatTrain.h" diff --git a/dlls/func/CFuncVehicle.cpp b/dlls/func/CFuncVehicle.cpp index 1fb7e53b..7ea55d0f 100644 --- a/dlls/func/CFuncVehicle.cpp +++ b/dlls/func/CFuncVehicle.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CFuncVehicle.h" #include "saverestore.h" #include "weapons.h" diff --git a/dlls/func/CFuncWall.cpp b/dlls/func/CFuncWall.cpp index 225af1c3..33d15c60 100644 --- a/dlls/func/CFuncWall.cpp +++ b/dlls/func/CFuncWall.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CFuncWall.h" LINK_ENTITY_TO_CLASS(func_wall, CFuncWall) diff --git a/dlls/func/CFuncWallToggle.cpp b/dlls/func/CFuncWallToggle.cpp index c3ff32fd..1fe20150 100644 --- a/dlls/func/CFuncWallToggle.cpp +++ b/dlls/func/CFuncWallToggle.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CFuncWall.h" #define SF_WALL_START_OFF 0x0001 diff --git a/dlls/func/CGunTarget.cpp b/dlls/func/CGunTarget.cpp index a9d5ce2e..2a543282 100644 --- a/dlls/func/CGunTarget.cpp +++ b/dlls/func/CGunTarget.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "trains.h" #include "saverestore.h" #include "CBasePlatTrain.h" diff --git a/dlls/func/CLadder.cpp b/dlls/func/CLadder.cpp index 4dbd9439..c245811e 100644 --- a/dlls/func/CLadder.cpp +++ b/dlls/func/CLadder.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "trains.h" // trigger_camera has train functionality #include "gamerules.h" diff --git a/dlls/func/CMomentaryDoor.cpp b/dlls/func/CMomentaryDoor.cpp index c8665af5..bd60c971 100644 --- a/dlls/func/CMomentaryDoor.cpp +++ b/dlls/func/CMomentaryDoor.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CBaseButton.h" #include "CBaseDoor.h" diff --git a/dlls/func/CMomentaryRotButton.cpp b/dlls/func/CMomentaryRotButton.cpp index 43ab282d..868b13fc 100644 --- a/dlls/func/CMomentaryRotButton.cpp +++ b/dlls/func/CMomentaryRotButton.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "CBaseButton.h" diff --git a/dlls/func/CPlatTrigger.cpp b/dlls/func/CPlatTrigger.cpp index 87b437ec..87d77672 100644 --- a/dlls/func/CPlatTrigger.cpp +++ b/dlls/func/CPlatTrigger.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "trains.h" #include "saverestore.h" #include "CBasePlatTrain.h" diff --git a/dlls/func/CPushable.cpp b/dlls/func/CPushable.cpp index 86c1960b..a8d91c23 100644 --- a/dlls/func/CPushable.cpp +++ b/dlls/func/CPushable.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "CBreakable.h" #include "decals.h" diff --git a/dlls/func/CRecharge.cpp b/dlls/func/CRecharge.cpp index af4b8b01..d42b1431 100644 --- a/dlls/func/CRecharge.cpp +++ b/dlls/func/CRecharge.cpp @@ -22,7 +22,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "skill.h" #include "gamerules.h" diff --git a/dlls/func/CRotButton.cpp b/dlls/func/CRotButton.cpp index d5043bbd..66ef7249 100644 --- a/dlls/func/CRotButton.cpp +++ b/dlls/func/CRotButton.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "CBaseButton.h" #include "CBaseDoor.h" diff --git a/dlls/func/CRotDoor.cpp b/dlls/func/CRotDoor.cpp index 7ae76962..94df0a47 100644 --- a/dlls/func/CRotDoor.cpp +++ b/dlls/func/CRotDoor.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CBaseButton.h" #include "CBaseDoor.h" diff --git a/dlls/game/game.cpp b/dlls/game/game.cpp index 5c7b3bd2..38ed6d11 100644 --- a/dlls/game/game.cpp +++ b/dlls/game/game.cpp @@ -17,7 +17,6 @@ #include "eiface.h" #include "util.h" #include "game.h" -#include "cbase.h" #include "CBaseMonster.h" #include "skill.h" #include "PluginManager.h" diff --git a/dlls/game/gamerules.cpp b/dlls/game/gamerules.cpp index 9548b3f3..d4c363f9 100644 --- a/dlls/game/gamerules.cpp +++ b/dlls/game/gamerules.cpp @@ -18,7 +18,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CBasePlayer.h" #include "gamerules.h" #include "teamplay_gamerules.h" @@ -29,6 +28,7 @@ #include "PluginManager.h" #include "game.h" #include "CBaseDMStart.h" +#include "hlds_hooks.h" #include #include diff --git a/dlls/game/gamerules.h b/dlls/game/gamerules.h index f0620fe3..5dc4f847 100644 --- a/dlls/game/gamerules.h +++ b/dlls/game/gamerules.h @@ -27,6 +27,7 @@ class CBasePlayerItem; class CBasePlayer; class CItem; class CBasePlayerAmmo; +class CBaseMonster; // weapon respawning return codes enum diff --git a/dlls/game/globals.cpp b/dlls/game/globals.cpp index db9cd1e6..e2dd6138 100644 --- a/dlls/game/globals.cpp +++ b/dlls/game/globals.cpp @@ -25,7 +25,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "env/CSoundEnt.h" DLL_GLOBAL ULONG g_ulFrameCount; diff --git a/dlls/game/multiplay_gamerules.cpp b/dlls/game/multiplay_gamerules.cpp index bff5e756..0fca548e 100644 --- a/dlls/game/multiplay_gamerules.cpp +++ b/dlls/game/multiplay_gamerules.cpp @@ -17,7 +17,6 @@ // #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CBasePlayer.h" #include "weapons.h" #include "gamerules.h" diff --git a/dlls/game/singleplay_gamerules.cpp b/dlls/game/singleplay_gamerules.cpp index fd71b182..5ae10c52 100644 --- a/dlls/game/singleplay_gamerules.cpp +++ b/dlls/game/singleplay_gamerules.cpp @@ -17,7 +17,6 @@ // #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CBasePlayer.h" #include "gamerules.h" #include "skill.h" diff --git a/dlls/game/teamplay_gamerules.cpp b/dlls/game/teamplay_gamerules.cpp index 79dc8c4c..b754c1b0 100644 --- a/dlls/game/teamplay_gamerules.cpp +++ b/dlls/game/teamplay_gamerules.cpp @@ -17,7 +17,6 @@ // #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CBasePlayer.h" #include "gamerules.h" #include "teamplay_gamerules.h" diff --git a/dlls/game/user_messages.cpp b/dlls/game/user_messages.cpp index bf4df993..5a2d4f89 100644 --- a/dlls/game/user_messages.cpp +++ b/dlls/game/user_messages.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "shake.h" #include "user_messages.h" #include "PluginManager.h" diff --git a/dlls/game/user_messages.h b/dlls/game/user_messages.h index a5c70589..65509abe 100644 --- a/dlls/game/user_messages.h +++ b/dlls/game/user_messages.h @@ -44,6 +44,14 @@ EXPORT extern int gmsgToxicCloud; // Note: also update msgTypeStr() in util.cpp when adding new messages +typedef struct _SelAmmo +{ + BYTE Ammo1Type; + BYTE Ammo1; + BYTE Ammo2Type; + BYTE Ammo2; +} SelAmmo; + struct UserMessage { const char* name; int id; diff --git a/dlls/hooks/PluginManager.cpp b/dlls/hooks/PluginManager.cpp index 5709329d..d57043d4 100644 --- a/dlls/hooks/PluginManager.cpp +++ b/dlls/hooks/PluginManager.cpp @@ -1,7 +1,6 @@ #include "extdll.h" #include "util.h" #include "PluginManager.h" -#include "cbase.h" #include #include "Scheduler.h" #include "CBasePlayer.h" diff --git a/dlls/hooks/client_commands.cpp b/dlls/hooks/client_commands.cpp index 9dfaadd4..10e01291 100644 --- a/dlls/hooks/client_commands.cpp +++ b/dlls/hooks/client_commands.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "CBasePlayer.h" #include "CBaseSpectator.h" diff --git a/dlls/hooks/h_export.cpp b/dlls/hooks/h_export.cpp index a4d1f039..a558d317 100644 --- a/dlls/hooks/h_export.cpp +++ b/dlls/hooks/h_export.cpp @@ -23,8 +23,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" - // Holds engine functionality callbacks enginefuncs_t g_engfuncs; globalvars_t *gpGlobals; diff --git a/dlls/hooks/hlds_hooks.cpp b/dlls/hooks/hlds_hooks.cpp index 4b89634d..e92805af 100644 --- a/dlls/hooks/hlds_hooks.cpp +++ b/dlls/hooks/hlds_hooks.cpp @@ -25,7 +25,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "CBasePlayer.h" #include "CBaseSpectator.h" @@ -55,6 +54,11 @@ extern DLL_GLOBAL ULONG g_ulModelIndexPlayer; extern DLL_GLOBAL BOOL g_fGameOver; extern DLL_GLOBAL ULONG g_ulFrameCount; +void EntvarsKeyvalue(entvars_t* pev, KeyValueData* pkvd); +void PM_Move(struct playermove_s* ppmove, int server); +void PM_Init(struct playermove_s* ppmove); +char PM_FindTextureType(char* name); +extern Vector VecBModelOrigin(entvars_t* pevBModel); extern void CopyToBodyQue(entvars_t* pev); extern int giPrecacheGrunt; extern int gmsgSayText; @@ -63,6 +67,80 @@ extern int g_teamplay; // client index that is receiving AddFullToPack calls int g_packClientIdx = 0; +DLL_FUNCTIONS dllFuncs = { + GameDLLInit, //pfnGameInit + DispatchSpawn, //pfnSpawn + DispatchThink, //pfnThink + DispatchUse, //pfnUse + DispatchTouch, //pfnTouch + DispatchBlocked, //pfnBlocked + DispatchKeyValue, //pfnKeyValue + DispatchSave, //pfnSave + DispatchRestore, //pfnRestore + DispatchObjectCollsionBox, //pfnAbsBox + + SaveWriteFields, //pfnSaveWriteFields + SaveReadFields, //pfnSaveReadFields + + SaveGlobalState, //pfnSaveGlobalState + RestoreGlobalState, //pfnRestoreGlobalState + ResetGlobalState, //pfnResetGlobalState + + ClientConnect, //pfnClientConnect + ClientDisconnect, //pfnClientDisconnect + ClientKill, //pfnClientKill + ClientPutInServer, //pfnClientPutInServer + ClientCommand, //pfnClientCommand + ClientUserInfoChanged, //pfnClientUserInfoChanged + ServerActivate, //pfnServerActivate + ServerDeactivate, //pfnServerDeactivate + + PlayerPreThink, //pfnPlayerPreThink + PlayerPostThink, //pfnPlayerPostThink + + StartFrame, //pfnStartFrame + ParmsNewLevel, //pfnParmsNewLevel + ParmsChangeLevel, //pfnParmsChangeLevel + + GetGameDescription, //pfnGetGameDescription Returns string describing current .dll game. + PlayerCustomization, //pfnPlayerCustomization Notifies .dll of new customization for player. + + SpectatorConnect, //pfnSpectatorConnect Called when spectator joins server + SpectatorDisconnect, //pfnSpectatorDisconnect Called when spectator leaves the server + SpectatorThink, //pfnSpectatorThink Called when spectator sends a command packet (usercmd_t) + + Sys_Error, //pfnSys_Error Called when engine has encountered an error + + PM_Move, //pfnPM_Move + PM_Init, //pfnPM_Init Server version of player movement initialization + PM_FindTextureType, //pfnPM_FindTextureType + + SetupVisibility, //pfnSetupVisibility Set up PVS and PAS for networking for this client + UpdateClientData, //pfnUpdateClientData Set up data sent only to specific client + AddToFullPack, //pfnAddToFullPack + CreateBaseline, //pfnCreateBaseline Tweak entity baseline for network encoding, allows setup of player baselines, too. + RegisterEncoders, //pfnRegisterEncoders Callbacks for network encoding + GetWeaponData, //pfnGetWeaponData + CmdStart, //pfnCmdStart + CmdEnd, //pfnCmdEnd + ConnectionlessPacket, //pfnConnectionlessPacket + GetHullBounds, //pfnGetHullBounds + CreateInstancedBaselines, //pfnCreateInstancedBaselines + InconsistentFile, //pfnInconsistentFile + AllowLagCompensation, //pfnAllowLagCompensation +}; + +NEW_DLL_FUNCTIONS newDllFuncs = { + OnFreeEntPrivateData, + GameShutdown, + ShouldCollide, + CvarValue, + CvarValue2 +}; + +gamedll_funcs_t GameDllFuncs = { &dllFuncs, &newDllFuncs }; +gamedll_funcs_t* gpGamedllFuncs = &GameDllFuncs; + void LinkUserMessages( void ); /* @@ -1987,3 +2065,423 @@ int ShouldCollide(edict_t* pentTouched, edict_t* pentOther) { void CvarValue(const edict_t* pEnt, const char* pszValue) {} +// returns relocated edict, or NULL if the entity died immediately after spawning +edict_t* SpawnEdict(edict_t* pent) { + CBaseEntity* pEntity = (CBaseEntity*)GET_PRIVATE(pent); + + if (!pEntity) { + REMOVE_ENTITY(pent); + return NULL; + } + + pEntity = RelocateEntIdx(pEntity); + pent = pEntity->edict(); + + // Initialize these or entities who don't link to the world won't have anything in here + pEntity->pev->absmin = pEntity->pev->origin - Vector(1, 1, 1); + pEntity->pev->absmax = pEntity->pev->origin + Vector(1, 1, 1); + + pEntity->Spawn(); + + // Try to get the pointer again, in case the spawn function deleted the entity. + // UNDONE: Spawn() should really return a code to ask that the entity be deleted, but + // that would touch too much code for me to do that right now. + pEntity = (CBaseEntity*)GET_PRIVATE(pent); + + if (pEntity) + { + if ((g_pGameRules && !g_pGameRules->IsAllowedToSpawn(pEntity)) || pEntity->pev->flags & FL_KILLME) { + REMOVE_ENTITY(pent); + return NULL; + } + } + + // Handle global stuff here + if (pEntity && pEntity->pev->globalname) + { + const globalentity_t* pGlobal = gGlobalState.EntityFromTable(pEntity->pev->globalname); + if (pGlobal) + { + // Already dead? delete + if (pGlobal->state == GLOBAL_DEAD) { + REMOVE_ENTITY(pent); + return NULL; + } + + else if (!FStrEq(STRING(gpGlobals->mapname), pGlobal->levelName)) + pEntity->MakeDormant(); // Hasn't been moved to this level yet, wait but stay alive + // In this level & not dead, continue on as normal + } + else + { + // Spawned entities default to 'On' + gGlobalState.EntityAdd(pEntity->pev->globalname, gpGlobals->mapname, GLOBAL_ON); + // ALERT( at_console, "Added global entity %s (%s)\n", STRING(pEntity->pev->classname), STRING(pEntity->pev->globalname) ); + } + } + + return pent; +} + +int DispatchSpawn(edict_t* pent) +{ + CALL_HOOKS(int, pfnDispatchSpawn, pent); + + SpawnEdict(pent); + + // never ask the engine to delete the edict, because relocation will have invalidated its pointer. + return 0; +} + +void DispatchKeyValue(edict_t* pentKeyvalue, KeyValueData* pkvd) +{ + CALL_HOOKS_VOID(pfnDispatchKeyValue, pentKeyvalue, pkvd); + + if (!pkvd || !pentKeyvalue) + return; + + EntvarsKeyvalue(VARS(pentKeyvalue), pkvd); + + // If the key was an entity variable, or there's no class set yet, don't look for the object, it may + // not exist yet. + if (pkvd->fHandled || pkvd->szClassName == NULL) + return; + + // Get the actualy entity object + CBaseEntity* pEntity = (CBaseEntity*)GET_PRIVATE(pentKeyvalue); + + if (!pEntity) + return; + + pEntity->KeyValue(pkvd); +} + +// HACKHACK -- this is a hack to keep the node graph entity from "touching" things (like triggers) +// while it builds the graph +BOOL gTouchDisabled = FALSE; +void DispatchTouch(edict_t* pentTouched, edict_t* pentOther) +{ + CALL_HOOKS_VOID(pfnDispatchTouch, pentTouched, pentOther); + + if (gTouchDisabled) + return; + + CBaseEntity* pEntity = (CBaseEntity*)GET_PRIVATE(pentTouched); + CBaseEntity* pOther = (CBaseEntity*)GET_PRIVATE(pentOther); + + if (pEntity && pOther && !((pEntity->pev->flags | pOther->pev->flags) & FL_KILLME)) + pEntity->Touch(pOther); +} + +void DispatchUse(edict_t* pentUsed, edict_t* pentOther) +{ + CALL_HOOKS_VOID(pfnDispatchUse, pentUsed, pentOther); + + CBaseEntity* pEntity = (CBaseEntity*)GET_PRIVATE(pentUsed); + CBaseEntity* pOther = (CBaseEntity*)GET_PRIVATE(pentOther); + + if (pEntity && !(pEntity->pev->flags & FL_KILLME)) + pEntity->Use(pOther, pOther, USE_TOGGLE, 0); +} + +void DispatchThink(edict_t* pent) +{ + CALL_HOOKS_VOID(pfnDispatchThink, pent); + + CBaseEntity* pEntity = (CBaseEntity*)GET_PRIVATE(pent); + if (pEntity) + { + if (FBitSet(pEntity->pev->flags, FL_DORMANT)) + ALERT(at_console, "Dormant entity %s is thinking!!\n", STRING(pEntity->pev->classname)); + + pEntity->Think(); + } +} + +void DispatchBlocked(edict_t* pentBlocked, edict_t* pentOther) +{ + CALL_HOOKS_VOID(pfnDispatchBlocked, pentBlocked, pentOther); + + CBaseEntity* pEntity = (CBaseEntity*)GET_PRIVATE(pentBlocked); + CBaseEntity* pOther = (CBaseEntity*)GET_PRIVATE(pentOther); + + if (pEntity) + pEntity->Blocked(pOther); +} + +void DispatchSave(edict_t* pent, SAVERESTOREDATA* pSaveData) +{ + CBaseEntity* pEntity = (CBaseEntity*)GET_PRIVATE(pent); + + if (pEntity && pSaveData) + { + ENTITYTABLE* pTable = &pSaveData->pTable[pSaveData->currentIndex]; + + if (pTable->pent != pent) + ALERT(at_error, "ENTITY TABLE OR INDEX IS WRONG!!!!\n"); + + if (pEntity->ObjectCaps() & FCAP_DONT_SAVE) + return; + + // These don't use ltime & nextthink as times really, but we'll fudge around it. + if (pEntity->pev->movetype == MOVETYPE_PUSH) + { + float delta = pEntity->pev->nextthink - pEntity->pev->ltime; + pEntity->pev->ltime = gpGlobals->time; + pEntity->pev->nextthink = pEntity->pev->ltime + delta; + } + + pTable->location = pSaveData->size; // Remember entity position for file I/O + pTable->classname = pEntity->pev->classname; // Remember entity class for respawn + + CSave saveHelper(pSaveData); + pEntity->Save(saveHelper); + + pTable->size = pSaveData->size - pTable->location; // Size of entity block is data size written to block + } +} + +// Find the matching global entity. Spit out an error if the designer made entities of +// different classes with the same global name +CBaseEntity* FindGlobalEntity(string_t classname, string_t globalname) +{ + edict_t* pent = FIND_ENTITY_BY_STRING(NULL, "globalname", STRING(globalname)); + CBaseEntity* pReturn = CBaseEntity::Instance(pent); + if (pReturn) + { + if (!FClassnameIs(pReturn->pev, STRING(classname))) + { + ALERT(at_console, "Global entity found %s, wrong class %s\n", STRING(globalname), STRING(pReturn->pev->classname)); + pReturn = NULL; + } + } + + return pReturn; +} + +int DispatchRestore(edict_t* pent, SAVERESTOREDATA* pSaveData, int globalEntity) +{ + CBaseEntity* pEntity = (CBaseEntity*)GET_PRIVATE(pent); + + if (pEntity && pSaveData) + { + entvars_t tmpVars; + Vector oldOffset; + + CRestore restoreHelper(pSaveData); + if (globalEntity) + { + CRestore tmpRestore(pSaveData); + tmpRestore.PrecacheMode(0); + tmpRestore.ReadEntVars("ENTVARS", &tmpVars); + + // HACKHACK - reset the save pointers, we're going to restore for real this time + pSaveData->size = pSaveData->pTable[pSaveData->currentIndex].location; + pSaveData->pCurrentData = pSaveData->pBaseData + pSaveData->size; + // ------------------- + + + const globalentity_t* pGlobal = gGlobalState.EntityFromTable(tmpVars.globalname); + + // Don't overlay any instance of the global that isn't the latest + // pSaveData->szCurrentMapName is the level this entity is coming from + // pGlobla->levelName is the last level the global entity was active in. + // If they aren't the same, then this global update is out of date. + if (!FStrEq(pSaveData->szCurrentMapName, pGlobal->levelName)) + return 0; + + // Compute the new global offset + oldOffset = pSaveData->vecLandmarkOffset; + CBaseEntity* pNewEntity = FindGlobalEntity(tmpVars.classname, tmpVars.globalname); + if (pNewEntity) + { + // ALERT( at_console, "Overlay %s with %s\n", STRING(pNewEntity->pev->classname), STRING(tmpVars.classname) ); + // Tell the restore code we're overlaying a global entity from another level + restoreHelper.SetGlobalMode(1); // Don't overwrite global fields + pSaveData->vecLandmarkOffset = (pSaveData->vecLandmarkOffset - pNewEntity->pev->mins) + tmpVars.mins; + pEntity = pNewEntity;// we're going to restore this data OVER the old entity + pent = ENT(pEntity->pev); + // Update the global table to say that the global definition of this entity should come from this level + gGlobalState.EntityUpdate(pEntity->pev->globalname, gpGlobals->mapname); + } + else + { + // This entity will be freed automatically by the engine. If we don't do a restore on a matching entity (below) + // or call EntityUpdate() to move it to this level, we haven't changed global state at all. + return 0; + } + + } + + if (pEntity->ObjectCaps() & FCAP_MUST_SPAWN) + { + pEntity->Restore(restoreHelper); + pEntity->Spawn(); + } + else + { + pEntity->Restore(restoreHelper); + pEntity->Precache(); + } + + // Again, could be deleted, get the pointer again. + pEntity = (CBaseEntity*)GET_PRIVATE(pent); + +#if 0 + if (pEntity && pEntity->pev->globalname && globalEntity) + { + ALERT(at_console, "Global %s is %s\n", STRING(pEntity->pev->globalname), STRING(pEntity->pev->model)); + } +#endif + + // Is this an overriding global entity (coming over the transition), or one restoring in a level + if (globalEntity) + { + // ALERT( at_console, "After: %f %f %f %s\n", pEntity->pev->origin.x, pEntity->pev->origin.y, pEntity->pev->origin.z, STRING(pEntity->pev->model) ); + pSaveData->vecLandmarkOffset = oldOffset; + if (pEntity) + { + UTIL_SetOrigin(pEntity->pev, pEntity->pev->origin); + pEntity->OverrideReset(); + } + } + else if (pEntity && pEntity->pev->globalname) + { + const globalentity_t* pGlobal = gGlobalState.EntityFromTable(pEntity->pev->globalname); + if (pGlobal) + { + // Already dead? delete + if (pGlobal->state == GLOBAL_DEAD) + return -1; + else if (!FStrEq(STRING(gpGlobals->mapname), pGlobal->levelName)) + { + pEntity->MakeDormant(); // Hasn't been moved to this level yet, wait but stay alive + } + // In this level & not dead, continue on as normal + } + else + { + ALERT(at_error, "Global Entity %s (%s) not in table!!!\n", STRING(pEntity->pev->globalname), STRING(pEntity->pev->classname)); + // Spawned entities default to 'On' + gGlobalState.EntityAdd(pEntity->pev->globalname, gpGlobals->mapname, GLOBAL_ON); + } + } + } + return 0; +} + +void DispatchObjectCollsionBox(edict_t* pent) +{ + CBaseEntity* pEntity = (CBaseEntity*)GET_PRIVATE(pent); + if (pEntity) + { + if (pEntity->pev->iuser4 == 1337) { // HACK TOWN USA + // dead monsters have all have the same giant collision box for hit detections + // outside of the normal bbox (monsters sometimes die in positions far away from their origin) + Vector deadMins = Vector(-256, -256, -256); // negative z for player corpses or upside-down monsters + Vector deadMaxs = Vector(256, 256, 256); + + pEntity->pev->absmin = pEntity->pev->origin + deadMins; + pEntity->pev->absmax = pEntity->pev->origin + deadMaxs; + } + else { + pEntity->SetObjectCollisionBox(); + } + } + else + SetObjectCollisionBox(&pent->v); +} + +void SaveWriteFields(SAVERESTOREDATA* pSaveData, const char* pname, void* pBaseData, TYPEDESCRIPTION* pFields, int fieldCount) +{ + CSave saveHelper(pSaveData); + saveHelper.WriteFields(pname, pBaseData, pFields, fieldCount); +} + +void SaveReadFields(SAVERESTOREDATA* pSaveData, const char* pname, void* pBaseData, TYPEDESCRIPTION* pFields, int fieldCount) +{ + CRestore restoreHelper(pSaveData); + restoreHelper.ReadFields(pname, pBaseData, pFields, fieldCount); +} + +// Initialize absmin & absmax to the appropriate box +void SetObjectCollisionBox(entvars_t* pev) +{ + if ((pev->solid == SOLID_BSP) && + (pev->angles.x || pev->angles.y || pev->angles.z)) + { // expand for rotation + // TODO: this might explain why some objects get blocked by things very far away + float max, v; + int i; + + max = 0; + for (i = 0; i < 3; i++) + { + v = fabs(((float*)pev->mins)[i]); + if (v > max) + max = v; + v = fabs(((float*)pev->maxs)[i]); + if (v > max) + max = v; + } + for (i = 0; i < 3; i++) + { + ((float*)pev->absmin)[i] = ((float*)pev->origin)[i] - max; + ((float*)pev->absmax)[i] = ((float*)pev->origin)[i] + max; + } + } + else + { + pev->absmin = pev->origin + pev->mins; + pev->absmax = pev->origin + pev->maxs; + } + + pev->absmin.x -= 1; + pev->absmin.y -= 1; + pev->absmin.z -= 1; + pev->absmax.x += 1; + pev->absmax.y += 1; + pev->absmax.z += 1; +} + +extern "C" +{ + int GetEntityAPI(DLL_FUNCTIONS* pFunctionTable, int interfaceVersion) + { + if (!pFunctionTable || interfaceVersion != INTERFACE_VERSION) + { + return FALSE; + } + + memcpy(pFunctionTable, &dllFuncs, sizeof(DLL_FUNCTIONS)); + return TRUE; + } + + int GetEntityAPI2(DLL_FUNCTIONS* pFunctionTable, int* interfaceVersion) + { + if (!pFunctionTable || *interfaceVersion != INTERFACE_VERSION) + { + // Tell engine what version we had, so it can figure out who is out of date. + *interfaceVersion = INTERFACE_VERSION; + return FALSE; + } + + memcpy(pFunctionTable, &dllFuncs, sizeof(DLL_FUNCTIONS)); + return TRUE; + } + + int GetNewDLLFunctions(NEW_DLL_FUNCTIONS* pNewFunctionTable, int* interfaceVersion) { + if (!pNewFunctionTable) { + ALERT(at_error, "GetNewDLLFunctions called with null pNewFunctionTable"); + return(FALSE); + } + else if (*interfaceVersion != 1) { + ALERT(at_error, "GetNewDLLFunctions version mismatch; requested=%d ours=%d", *interfaceVersion, INTERFACE_VERSION); + *interfaceVersion = 1; + return(FALSE); + } + + memcpy(pNewFunctionTable, &newDllFuncs, sizeof(NEW_DLL_FUNCTIONS)); + return(TRUE); + } +} \ No newline at end of file diff --git a/dlls/hooks/hlds_hooks.h b/dlls/hooks/hlds_hooks.h index 7148ec2f..12355041 100644 --- a/dlls/hooks/hlds_hooks.h +++ b/dlls/hooks/hlds_hooks.h @@ -69,4 +69,33 @@ int ShouldCollide(edict_t* pentTouched, edict_t* pentOther); void CvarValue(const edict_t* pEnt, const char* pszValue); void CvarValue2(const edict_t* pEnt, int requestID, const char* pszCvarName, const char* pszValue); +typedef struct { + DLL_FUNCTIONS* dllapi_table; + NEW_DLL_FUNCTIONS* newapi_table; +} gamedll_funcs_t; + +EXPORT extern gamedll_funcs_t* gpGamedllFuncs; // for ease of porting to/from metamod + +// C functions for external declarations that call the appropriate C++ methods + +extern "C" DLLEXPORT int GetEntityAPI(DLL_FUNCTIONS * pFunctionTable, int interfaceVersion); +extern "C" DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS * pFunctionTable, int* interfaceVersion); +extern "C" DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS * pNewFunctionTable, int* interfaceVersion); + +EXPORT extern int DispatchSpawn(edict_t* pent); +EXPORT extern void DispatchKeyValue(edict_t* pentKeyvalue, KeyValueData* pkvd); +EXPORT extern void DispatchTouch(edict_t* pentTouched, edict_t* pentOther); +EXPORT extern void DispatchUse(edict_t* pentUsed, edict_t* pentOther); +EXPORT extern void DispatchThink(edict_t* pent); +EXPORT extern void DispatchBlocked(edict_t* pentBlocked, edict_t* pentOther); +EXPORT extern void DispatchSave(edict_t* pent, SAVERESTOREDATA* pSaveData); +EXPORT extern int DispatchRestore(edict_t* pent, SAVERESTOREDATA* pSaveData, int globalEntity); +EXPORT extern void DispatchObjectCollsionBox(edict_t* pent); +EXPORT extern void SaveWriteFields(SAVERESTOREDATA* pSaveData, const char* pname, void* pBaseData, TYPEDESCRIPTION* pFields, int fieldCount); +EXPORT extern void SaveReadFields(SAVERESTOREDATA* pSaveData, const char* pname, void* pBaseData, TYPEDESCRIPTION* pFields, int fieldCount); +EXPORT extern void SaveGlobalState(SAVERESTOREDATA* pSaveData); +EXPORT extern void RestoreGlobalState(SAVERESTOREDATA* pSaveData); +EXPORT extern void ResetGlobalState(void); +EXPORT extern void SetObjectCollisionBox(entvars_t* pev); + #endif // CLIENT_H diff --git a/dlls/hooks/rehlds_hooks.cpp b/dlls/hooks/rehlds_hooks.cpp index fb72d0c3..2f003831 100644 --- a/dlls/hooks/rehlds_hooks.cpp +++ b/dlls/hooks/rehlds_hooks.cpp @@ -1,7 +1,6 @@ #include "rehlds.h" #include "util.h" #include "PluginManager.h" -#include "cbase.h" #include "CBasePlayer.h" void rehlds_SendBigMessage_internal(int msgType, void* data, int sz, int playerindex) { diff --git a/dlls/item/CAirtank.cpp b/dlls/item/CAirtank.cpp index 4169274b..6aaad5cf 100644 --- a/dlls/item/CAirtank.cpp +++ b/dlls/item/CAirtank.cpp @@ -14,7 +14,6 @@ ****/ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "weapons.h" #include "nodes.h" #include "CGrenade.h" diff --git a/dlls/item/CHealthKit.cpp b/dlls/item/CHealthKit.cpp index 19f978a7..a7fdaa59 100644 --- a/dlls/item/CHealthKit.cpp +++ b/dlls/item/CHealthKit.cpp @@ -14,7 +14,6 @@ ****/ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "skill.h" #include "nodes.h" #include "CBasePlayer.h" diff --git a/dlls/item/CItem.cpp b/dlls/item/CItem.cpp index 29828b5a..0fdfbcfc 100644 --- a/dlls/item/CItem.cpp +++ b/dlls/item/CItem.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "skill.h" #include "CItem.h" #include "gamerules.h" diff --git a/dlls/item/CItemAntidote.cpp b/dlls/item/CItemAntidote.cpp index e187e347..8069e28b 100644 --- a/dlls/item/CItemAntidote.cpp +++ b/dlls/item/CItemAntidote.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CBasePlayer.h" #include "skill.h" #include "CItem.h" diff --git a/dlls/item/CItemBattery.cpp b/dlls/item/CItemBattery.cpp index c9adc374..32fd7cb8 100644 --- a/dlls/item/CItemBattery.cpp +++ b/dlls/item/CItemBattery.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CBasePlayer.h" #include "skill.h" #include "CItem.h" diff --git a/dlls/item/CItemGeneric.cpp b/dlls/item/CItemGeneric.cpp index c7059840..c042fe32 100644 --- a/dlls/item/CItemGeneric.cpp +++ b/dlls/item/CItemGeneric.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CBasePlayer.h" #include "skill.h" #include "CItem.h" diff --git a/dlls/item/CItemLongJump.cpp b/dlls/item/CItemLongJump.cpp index 14f4e473..c8dc1512 100644 --- a/dlls/item/CItemLongJump.cpp +++ b/dlls/item/CItemLongJump.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CBasePlayer.h" #include "skill.h" #include "CItem.h" diff --git a/dlls/item/CItemSecurity.cpp b/dlls/item/CItemSecurity.cpp index e7bf8c80..134df386 100644 --- a/dlls/item/CItemSecurity.cpp +++ b/dlls/item/CItemSecurity.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CBasePlayer.h" #include "skill.h" #include "CItem.h" diff --git a/dlls/item/CItemSoda.cpp b/dlls/item/CItemSoda.cpp index 3cd1e5a3..c4c6bf53 100644 --- a/dlls/item/CItemSoda.cpp +++ b/dlls/item/CItemSoda.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "customentity.h" #include "effects.h" #include "decals.h" diff --git a/dlls/item/CItemSuit.cpp b/dlls/item/CItemSuit.cpp index 0ccef66f..85adf14b 100644 --- a/dlls/item/CItemSuit.cpp +++ b/dlls/item/CItemSuit.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "weapons.h" #include "CBasePlayer.h" #include "skill.h" diff --git a/dlls/item/CWorldItem.cpp b/dlls/item/CWorldItem.cpp index 01154391..3c2788cd 100644 --- a/dlls/item/CWorldItem.cpp +++ b/dlls/item/CWorldItem.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "skill.h" #include "CItem.h" #include "gamerules.h" diff --git a/dlls/monster/CAGrunt.cpp b/dlls/monster/CAGrunt.cpp index d68b2913..74da1559 100644 --- a/dlls/monster/CAGrunt.cpp +++ b/dlls/monster/CAGrunt.cpp @@ -18,7 +18,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "weapons.h" diff --git a/dlls/monster/CActAnimating.cpp b/dlls/monster/CActAnimating.cpp index 8e604728..9504b5e4 100644 --- a/dlls/monster/CActAnimating.cpp +++ b/dlls/monster/CActAnimating.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "animation.h" #include "effects.h" #include "CActAnimating.h" diff --git a/dlls/monster/CActAnimating.h b/dlls/monster/CActAnimating.h index 11719351..c42a9b0b 100644 --- a/dlls/monster/CActAnimating.h +++ b/dlls/monster/CActAnimating.h @@ -1,4 +1,5 @@ #pragma once +#include "CBaseAnimating.h" class CActAnimating : public CBaseAnimating { diff --git a/dlls/monster/CApache.cpp b/dlls/monster/CApache.cpp index f0dc9ae2..16b20460 100644 --- a/dlls/monster/CApache.cpp +++ b/dlls/monster/CApache.cpp @@ -14,7 +14,6 @@ ****/ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "weapons.h" #include "nodes.h" diff --git a/dlls/monster/CBabyGarg.cpp b/dlls/monster/CBabyGarg.cpp index e8029e2c..6f50d53e 100644 --- a/dlls/monster/CBabyGarg.cpp +++ b/dlls/monster/CBabyGarg.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "nodes.h" #include "monsters.h" #include "schedule.h" diff --git a/dlls/monster/CBabyVoltigore.cpp b/dlls/monster/CBabyVoltigore.cpp index 96324cef..3256e855 100644 --- a/dlls/monster/CBabyVoltigore.cpp +++ b/dlls/monster/CBabyVoltigore.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "env/CSoundEnt.h" diff --git a/dlls/monster/CBarnacle.cpp b/dlls/monster/CBarnacle.cpp index 81b3b7d9..2f8eb267 100644 --- a/dlls/monster/CBarnacle.cpp +++ b/dlls/monster/CBarnacle.cpp @@ -18,7 +18,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "monster/CBaseMonster.h" diff --git a/dlls/monster/CBarney.cpp b/dlls/monster/CBarney.cpp index a92bfd05..0a055320 100644 --- a/dlls/monster/CBarney.cpp +++ b/dlls/monster/CBarney.cpp @@ -19,7 +19,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "CTalkSquadMonster.h" #include "schedule.h" diff --git a/dlls/monster/CBaseGrunt.cpp b/dlls/monster/CBaseGrunt.cpp index 255687d7..ff9ac2a5 100644 --- a/dlls/monster/CBaseGrunt.cpp +++ b/dlls/monster/CBaseGrunt.cpp @@ -1,7 +1,6 @@ #include "extdll.h" #include "plane.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "animation.h" diff --git a/dlls/monster/CBaseGruntOp4.cpp b/dlls/monster/CBaseGruntOp4.cpp index 87101725..3c4aeb11 100644 --- a/dlls/monster/CBaseGruntOp4.cpp +++ b/dlls/monster/CBaseGruntOp4.cpp @@ -1,7 +1,6 @@ #include "extdll.h" #include "plane.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "defaultai.h" diff --git a/dlls/monster/CBaseMonster.cpp b/dlls/monster/CBaseMonster.cpp index 5a892190..80338791 100644 --- a/dlls/monster/CBaseMonster.cpp +++ b/dlls/monster/CBaseMonster.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "env/CSoundEnt.h" #include "decals.h" @@ -14,6 +13,7 @@ #include "gamerules.h" #include "defaultai.h" #include "CMonsterMaker.h" +#include "hlds_hooks.h" #define MONSTER_CUT_CORNER_DIST 8 // 8 means the monster's bounding box is contained without the box of the node in WC diff --git a/dlls/monster/CBaseMonster.h b/dlls/monster/CBaseMonster.h index 2af693b5..03f3f386 100644 --- a/dlls/monster/CBaseMonster.h +++ b/dlls/monster/CBaseMonster.h @@ -16,6 +16,11 @@ #ifndef BASEMONSTER_H #define BASEMONSTER_H +#include "CBaseToggle.h" +#include "monster/schedule.h" + +class CSound; + extern entvars_t* g_pevLastInflictor; // Clients can push talkmonsters out of their way diff --git a/dlls/monster/CBaseTurret.cpp b/dlls/monster/CBaseTurret.cpp index c2139179..de872b7d 100644 --- a/dlls/monster/CBaseTurret.cpp +++ b/dlls/monster/CBaseTurret.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "weapons.h" #include "effects.h" diff --git a/dlls/monster/CBigMomma.cpp b/dlls/monster/CBigMomma.cpp index 4cdd69e3..efce5024 100644 --- a/dlls/monster/CBigMomma.cpp +++ b/dlls/monster/CBigMomma.cpp @@ -19,7 +19,6 @@ //========================================================= #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "decals.h" diff --git a/dlls/monster/CBloater.cpp b/dlls/monster/CBloater.cpp index fc970ccc..e38caee2 100644 --- a/dlls/monster/CBloater.cpp +++ b/dlls/monster/CBloater.cpp @@ -18,7 +18,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" diff --git a/dlls/monster/CBodyGuard.cpp b/dlls/monster/CBodyGuard.cpp index 84629b0c..8fa3852b 100644 --- a/dlls/monster/CBodyGuard.cpp +++ b/dlls/monster/CBodyGuard.cpp @@ -1,7 +1,6 @@ #include "extdll.h" #include "plane.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "defaultai.h" diff --git a/dlls/monster/CBullsquid.cpp b/dlls/monster/CBullsquid.cpp index 87bcd839..9ba17c07 100644 --- a/dlls/monster/CBullsquid.cpp +++ b/dlls/monster/CBullsquid.cpp @@ -18,7 +18,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "nodes.h" diff --git a/dlls/monster/CChumtoad.cpp b/dlls/monster/CChumtoad.cpp index b722f73d..ba3921ad 100644 --- a/dlls/monster/CChumtoad.cpp +++ b/dlls/monster/CChumtoad.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "user_messages.h" diff --git a/dlls/monster/CCineAI.cpp b/dlls/monster/CCineAI.cpp index 2ed4ec32..86560f86 100644 --- a/dlls/monster/CCineAI.cpp +++ b/dlls/monster/CCineAI.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "CCineMonster.h" diff --git a/dlls/monster/CCineMonster.cpp b/dlls/monster/CCineMonster.cpp index 57a93ce6..972897ee 100644 --- a/dlls/monster/CCineMonster.cpp +++ b/dlls/monster/CCineMonster.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #ifndef ANIMATION_H diff --git a/dlls/monster/CController.cpp b/dlls/monster/CController.cpp index 54c96b8e..48a99e23 100644 --- a/dlls/monster/CController.cpp +++ b/dlls/monster/CController.cpp @@ -20,12 +20,12 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "effects.h" #include "schedule.h" #include "weapons.h" #include "CTalkSquadMonster.h" +#include "hlds_hooks.h" //========================================================= // Monster's Anim Events Go Here diff --git a/dlls/monster/CCycler.cpp b/dlls/monster/CCycler.cpp index 18e888bf..2416f1b8 100644 --- a/dlls/monster/CCycler.cpp +++ b/dlls/monster/CCycler.cpp @@ -22,7 +22,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "animation.h" #include "weapons.h" diff --git a/dlls/monster/CDeadHEV.cpp b/dlls/monster/CDeadHEV.cpp index 55861dc4..ae5111e3 100644 --- a/dlls/monster/CDeadHEV.cpp +++ b/dlls/monster/CDeadHEV.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "trains.h" #include "nodes.h" #include "monsters.h" diff --git a/dlls/monster/CFlockingFlyerFlock.cpp b/dlls/monster/CFlockingFlyerFlock.cpp index 9cb00b88..d2c55803 100644 --- a/dlls/monster/CFlockingFlyerFlock.cpp +++ b/dlls/monster/CFlockingFlyerFlock.cpp @@ -18,7 +18,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "CTalkSquadMonster.h" diff --git a/dlls/monster/CFlyingMonster.cpp b/dlls/monster/CFlyingMonster.cpp index 8afaf286..166200da 100644 --- a/dlls/monster/CFlyingMonster.cpp +++ b/dlls/monster/CFlyingMonster.cpp @@ -14,7 +14,6 @@ ****/ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "CFlyingMonster.h" diff --git a/dlls/monster/CFurniture.cpp b/dlls/monster/CFurniture.cpp index d0518267..a1c0acbc 100644 --- a/dlls/monster/CFurniture.cpp +++ b/dlls/monster/CFurniture.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "CCineMonster.h" diff --git a/dlls/monster/CGMan.cpp b/dlls/monster/CGMan.cpp index 009236c8..7c0e6314 100644 --- a/dlls/monster/CGMan.cpp +++ b/dlls/monster/CGMan.cpp @@ -17,7 +17,6 @@ //========================================================= #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "weapons.h" diff --git a/dlls/monster/CGargantua.cpp b/dlls/monster/CGargantua.cpp index 9ac55783..3d6a7a32 100644 --- a/dlls/monster/CGargantua.cpp +++ b/dlls/monster/CGargantua.cpp @@ -18,7 +18,6 @@ //========================================================= #include "extdll.h" #include "util.h" -#include "cbase.h" #include "nodes.h" #include "monsters.h" #include "schedule.h" diff --git a/dlls/monster/CGenericMonster.cpp b/dlls/monster/CGenericMonster.cpp index fda8c87a..c4f0c1a2 100644 --- a/dlls/monster/CGenericMonster.cpp +++ b/dlls/monster/CGenericMonster.cpp @@ -17,7 +17,6 @@ //========================================================= #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "env/CSoundEnt.h" diff --git a/dlls/monster/CGonome.cpp b/dlls/monster/CGonome.cpp index f37cfa41..5364080a 100644 --- a/dlls/monster/CGonome.cpp +++ b/dlls/monster/CGonome.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "animation.h" diff --git a/dlls/monster/CHAssassin.cpp b/dlls/monster/CHAssassin.cpp index c1582211..7bf3217e 100644 --- a/dlls/monster/CHAssassin.cpp +++ b/dlls/monster/CHAssassin.cpp @@ -20,7 +20,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "CTalkSquadMonster.h" diff --git a/dlls/monster/CHGrunt.cpp b/dlls/monster/CHGrunt.cpp index e13a8415..4eef12ff 100644 --- a/dlls/monster/CHGrunt.cpp +++ b/dlls/monster/CHGrunt.cpp @@ -1,7 +1,6 @@ #include "extdll.h" #include "plane.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "animation.h" diff --git a/dlls/monster/CHGruntOp4.cpp b/dlls/monster/CHGruntOp4.cpp index cfe34428..0f52a398 100644 --- a/dlls/monster/CHGruntOp4.cpp +++ b/dlls/monster/CHGruntOp4.cpp @@ -1,7 +1,6 @@ #include "extdll.h" #include "plane.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "defaultai.h" diff --git a/dlls/monster/CHGruntOp4Medic.cpp b/dlls/monster/CHGruntOp4Medic.cpp index 2e62e015..cb9405e7 100644 --- a/dlls/monster/CHGruntOp4Medic.cpp +++ b/dlls/monster/CHGruntOp4Medic.cpp @@ -1,7 +1,6 @@ #include "extdll.h" #include "plane.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "defaultai.h" diff --git a/dlls/monster/CHGruntOp4Torch.cpp b/dlls/monster/CHGruntOp4Torch.cpp index 21b1afd2..31e51251 100644 --- a/dlls/monster/CHGruntOp4Torch.cpp +++ b/dlls/monster/CHGruntOp4Torch.cpp @@ -1,7 +1,6 @@ #include "extdll.h" #include "plane.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "defaultai.h" diff --git a/dlls/monster/CHWGrunt.cpp b/dlls/monster/CHWGrunt.cpp index bf22ee8f..70c88a23 100644 --- a/dlls/monster/CHWGrunt.cpp +++ b/dlls/monster/CHWGrunt.cpp @@ -1,7 +1,6 @@ #include "extdll.h" #include "plane.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "animation.h" diff --git a/dlls/monster/CHeadCrab.cpp b/dlls/monster/CHeadCrab.cpp index 1cdb64e8..89376fd1 100644 --- a/dlls/monster/CHeadCrab.cpp +++ b/dlls/monster/CHeadCrab.cpp @@ -18,7 +18,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "game.h" diff --git a/dlls/monster/CHornet.cpp b/dlls/monster/CHornet.cpp index 73ba48da..e6b30006 100644 --- a/dlls/monster/CHornet.cpp +++ b/dlls/monster/CHornet.cpp @@ -18,7 +18,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "weapons.h" #include "env/CSoundEnt.h" diff --git a/dlls/monster/CHoundeye.cpp b/dlls/monster/CHoundeye.cpp index c9118885..7cab2277 100644 --- a/dlls/monster/CHoundeye.cpp +++ b/dlls/monster/CHoundeye.cpp @@ -18,7 +18,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "animation.h" diff --git a/dlls/monster/CISlave.cpp b/dlls/monster/CISlave.cpp index 68daa5cf..5fa898f2 100644 --- a/dlls/monster/CISlave.cpp +++ b/dlls/monster/CISlave.cpp @@ -18,7 +18,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "CTalkSquadMonster.h" #include "schedule.h" diff --git a/dlls/monster/CIchthyosaur.cpp b/dlls/monster/CIchthyosaur.cpp index bd73d4b7..16938805 100644 --- a/dlls/monster/CIchthyosaur.cpp +++ b/dlls/monster/CIchthyosaur.cpp @@ -20,7 +20,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "CFlyingMonster.h" diff --git a/dlls/monster/CLeech.cpp b/dlls/monster/CLeech.cpp index dddf2b68..5c1aa2d6 100644 --- a/dlls/monster/CLeech.cpp +++ b/dlls/monster/CLeech.cpp @@ -38,7 +38,6 @@ #include "float.h" #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" diff --git a/dlls/monster/CMassn.cpp b/dlls/monster/CMassn.cpp index 17a055fd..3f9e08c8 100644 --- a/dlls/monster/CMassn.cpp +++ b/dlls/monster/CMassn.cpp @@ -1,7 +1,6 @@ #include"extdll.h" #include "plane.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "animation.h" diff --git a/dlls/monster/CMiniTurret.cpp b/dlls/monster/CMiniTurret.cpp index 7c05cd01..aad8e02a 100644 --- a/dlls/monster/CMiniTurret.cpp +++ b/dlls/monster/CMiniTurret.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "weapons.h" #include "effects.h" diff --git a/dlls/monster/CMonsterMaker.cpp b/dlls/monster/CMonsterMaker.cpp index eab08920..ff939e60 100644 --- a/dlls/monster/CMonsterMaker.cpp +++ b/dlls/monster/CMonsterMaker.cpp @@ -19,7 +19,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "saverestore.h" #include "weapons.h" diff --git a/dlls/monster/CNihilanth.cpp b/dlls/monster/CNihilanth.cpp index 1fde2160..ac475849 100644 --- a/dlls/monster/CNihilanth.cpp +++ b/dlls/monster/CNihilanth.cpp @@ -16,7 +16,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "weapons.h" #include "nodes.h" diff --git a/dlls/monster/COsprey.cpp b/dlls/monster/COsprey.cpp index f4d4b053..96e2d47e 100644 --- a/dlls/monster/COsprey.cpp +++ b/dlls/monster/COsprey.cpp @@ -14,7 +14,6 @@ ****/ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "weapons.h" #include "nodes.h" diff --git a/dlls/monster/COtis.cpp b/dlls/monster/COtis.cpp index 877b3bd5..22d27bb6 100644 --- a/dlls/monster/COtis.cpp +++ b/dlls/monster/COtis.cpp @@ -19,7 +19,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "CTalkSquadMonster.h" #include "schedule.h" diff --git a/dlls/monster/CPitdrone.cpp b/dlls/monster/CPitdrone.cpp index b6763788..d19df371 100644 --- a/dlls/monster/CPitdrone.cpp +++ b/dlls/monster/CPitdrone.cpp @@ -18,7 +18,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "nodes.h" diff --git a/dlls/monster/CPlayerMonster.cpp b/dlls/monster/CPlayerMonster.cpp index 798c25dd..2c5cd6ac 100644 --- a/dlls/monster/CPlayerMonster.cpp +++ b/dlls/monster/CPlayerMonster.cpp @@ -10,7 +10,6 @@ //========================================================= #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" diff --git a/dlls/monster/CRat.cpp b/dlls/monster/CRat.cpp index ae522e88..f4a0e738 100644 --- a/dlls/monster/CRat.cpp +++ b/dlls/monster/CRat.cpp @@ -18,7 +18,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" diff --git a/dlls/monster/CRoach.cpp b/dlls/monster/CRoach.cpp index ab035ada..3247a011 100644 --- a/dlls/monster/CRoach.cpp +++ b/dlls/monster/CRoach.cpp @@ -18,7 +18,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "env/CSoundEnt.h" diff --git a/dlls/monster/CRoboGrunt.cpp b/dlls/monster/CRoboGrunt.cpp index 38401ded..f135da32 100644 --- a/dlls/monster/CRoboGrunt.cpp +++ b/dlls/monster/CRoboGrunt.cpp @@ -1,7 +1,6 @@ #include "extdll.h" #include "plane.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "animation.h" diff --git a/dlls/monster/CScientist.cpp b/dlls/monster/CScientist.cpp index bb5f468c..30df8649 100644 --- a/dlls/monster/CScientist.cpp +++ b/dlls/monster/CScientist.cpp @@ -18,7 +18,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "CTalkSquadMonster.h" #include "schedule.h" diff --git a/dlls/monster/CScriptedSentence.cpp b/dlls/monster/CScriptedSentence.cpp index 7ef1f2dd..06765627 100644 --- a/dlls/monster/CScriptedSentence.cpp +++ b/dlls/monster/CScriptedSentence.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "CCineMonster.h" diff --git a/dlls/monster/CSentry.cpp b/dlls/monster/CSentry.cpp index 8fb67ad5..520ade2c 100644 --- a/dlls/monster/CSentry.cpp +++ b/dlls/monster/CSentry.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "weapons.h" #include "effects.h" diff --git a/dlls/monster/CShockRoach.cpp b/dlls/monster/CShockRoach.cpp index dfacb7e5..eb6a862a 100644 --- a/dlls/monster/CShockRoach.cpp +++ b/dlls/monster/CShockRoach.cpp @@ -18,7 +18,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "game.h" diff --git a/dlls/monster/CShockTrooper.cpp b/dlls/monster/CShockTrooper.cpp index b8150f46..cc70041d 100644 --- a/dlls/monster/CShockTrooper.cpp +++ b/dlls/monster/CShockTrooper.cpp @@ -31,7 +31,6 @@ #include "extdll.h" #include "plane.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "animation.h" diff --git a/dlls/monster/CSqueakGrenade.cpp b/dlls/monster/CSqueakGrenade.cpp index 10c874ba..aabe5e48 100644 --- a/dlls/monster/CSqueakGrenade.cpp +++ b/dlls/monster/CSqueakGrenade.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monster/monsters.h" #include "weapons.h" #include "nodes.h" diff --git a/dlls/monster/CTalkSquadMonster.cpp b/dlls/monster/CTalkSquadMonster.cpp index 1b710108..9dc90807 100644 --- a/dlls/monster/CTalkSquadMonster.cpp +++ b/dlls/monster/CTalkSquadMonster.cpp @@ -14,7 +14,6 @@ ****/ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "CTalkSquadMonster.h" diff --git a/dlls/monster/CTentacle.cpp b/dlls/monster/CTentacle.cpp index 567df2d1..3c3f96e2 100644 --- a/dlls/monster/CTentacle.cpp +++ b/dlls/monster/CTentacle.cpp @@ -22,7 +22,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "weapons.h" #include "env/CSoundEnt.h" diff --git a/dlls/monster/CTor.cpp b/dlls/monster/CTor.cpp index d4954aeb..f9bf11aa 100644 --- a/dlls/monster/CTor.cpp +++ b/dlls/monster/CTor.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "animation.h" diff --git a/dlls/monster/CTurret.cpp b/dlls/monster/CTurret.cpp index fe894af7..4d8fb35b 100644 --- a/dlls/monster/CTurret.cpp +++ b/dlls/monster/CTurret.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "weapons.h" #include "effects.h" diff --git a/dlls/monster/CVoltigore.cpp b/dlls/monster/CVoltigore.cpp index 5017e3d4..fedfd277 100644 --- a/dlls/monster/CVoltigore.cpp +++ b/dlls/monster/CVoltigore.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "animation.h" diff --git a/dlls/monster/CXenHair.cpp b/dlls/monster/CXenHair.cpp index e3395cc0..ac853bb5 100644 --- a/dlls/monster/CXenHair.cpp +++ b/dlls/monster/CXenHair.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "animation.h" #include "effects.h" #include "CActAnimating.h" diff --git a/dlls/monster/CXenPLight.cpp b/dlls/monster/CXenPLight.cpp index 807b3712..7f393738 100644 --- a/dlls/monster/CXenPLight.cpp +++ b/dlls/monster/CXenPLight.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "animation.h" #include "effects.h" #include "CActAnimating.h" diff --git a/dlls/monster/CXenSpore.cpp b/dlls/monster/CXenSpore.cpp index 5b0f3e64..2069a7f2 100644 --- a/dlls/monster/CXenSpore.cpp +++ b/dlls/monster/CXenSpore.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "animation.h" #include "effects.h" #include "CActAnimating.h" diff --git a/dlls/monster/CXenTree.cpp b/dlls/monster/CXenTree.cpp index f031a065..5a920c89 100644 --- a/dlls/monster/CXenTree.cpp +++ b/dlls/monster/CXenTree.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "animation.h" #include "effects.h" #include "CActAnimating.h" diff --git a/dlls/monster/CZombie.cpp b/dlls/monster/CZombie.cpp index 9a0510ec..29e56293 100644 --- a/dlls/monster/CZombie.cpp +++ b/dlls/monster/CZombie.cpp @@ -20,7 +20,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" diff --git a/dlls/monster/defaultai.cpp b/dlls/monster/defaultai.cpp index 45d3ac87..aabc35bf 100644 --- a/dlls/monster/defaultai.cpp +++ b/dlls/monster/defaultai.cpp @@ -17,7 +17,6 @@ //========================================================= #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" #include "defaultai.h" diff --git a/dlls/monster/h_ai.cpp b/dlls/monster/h_ai.cpp index 74143127..22db482c 100644 --- a/dlls/monster/h_ai.cpp +++ b/dlls/monster/h_ai.cpp @@ -21,7 +21,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "game.h" diff --git a/dlls/monster/nodes.cpp b/dlls/monster/nodes.cpp index 54d8eee3..c70ee495 100644 --- a/dlls/monster/nodes.cpp +++ b/dlls/monster/nodes.cpp @@ -18,7 +18,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "nodes.h" #include "animation.h" #include "CBaseDoor.h" diff --git a/dlls/monster/nodes.h b/dlls/monster/nodes.h index a472a1aa..ca742ae9 100644 --- a/dlls/monster/nodes.h +++ b/dlls/monster/nodes.h @@ -29,6 +29,8 @@ #define bits_NODE_WATER ( 1 << 2 ) // Water node, don't nudge. #define bits_NODE_GROUP_REALM (bits_NODE_LAND | bits_NODE_AIR | bits_NODE_WATER) +#include "CBaseEntity.h" + //========================================================= // Instance of a node. //========================================================= diff --git a/dlls/monster/tempmonster.cpp b/dlls/monster/tempmonster.cpp index d8e9df5b..0cbfeed2 100644 --- a/dlls/monster/tempmonster.cpp +++ b/dlls/monster/tempmonster.cpp @@ -19,7 +19,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "schedule.h" diff --git a/dlls/path/CPathCorner.cpp b/dlls/path/CPathCorner.cpp index 3c5b6e4d..ec5e806e 100644 --- a/dlls/path/CPathCorner.cpp +++ b/dlls/path/CPathCorner.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "trains.h" #include "saverestore.h" #include "CPathCorner.h" diff --git a/dlls/path/CPathTrack.cpp b/dlls/path/CPathTrack.cpp index a045996a..0d959129 100644 --- a/dlls/path/CPathTrack.cpp +++ b/dlls/path/CPathTrack.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "trains.h" #include "saverestore.h" #include "CPathTrack.h" diff --git a/dlls/path/CPathTrack.h b/dlls/path/CPathTrack.h index 3f1bee7a..b560b388 100644 --- a/dlls/path/CPathTrack.h +++ b/dlls/path/CPathTrack.h @@ -1,5 +1,6 @@ #ifndef CPATHTRACK_H #define CPATHTRACK_H +#include "CPointEntity.h" // Spawnflag for CPathTrack #define SF_PATH_DISABLED 0x00000001 diff --git a/dlls/player/CBaseDMStart.cpp b/dlls/player/CBaseDMStart.cpp index bae736dc..b0aa5980 100644 --- a/dlls/player/CBaseDMStart.cpp +++ b/dlls/player/CBaseDMStart.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "gamerules.h" #include "game.h" #include "CBaseDMStart.h" diff --git a/dlls/player/CBaseDMStart.h b/dlls/player/CBaseDMStart.h index fa1d46f3..8b0e3974 100644 --- a/dlls/player/CBaseDMStart.h +++ b/dlls/player/CBaseDMStart.h @@ -1,4 +1,5 @@ #pragma once +#include "CPointEntity.h" class CBaseDMStart : public CPointEntity { diff --git a/dlls/player/CBasePlayer.cpp b/dlls/player/CBasePlayer.cpp index 54142796..0b0bf138 100644 --- a/dlls/player/CBasePlayer.cpp +++ b/dlls/player/CBasePlayer.cpp @@ -23,7 +23,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CBasePlayer.h" #include "trains.h" #include "nodes.h" @@ -51,6 +50,7 @@ #include "CBreakable.h" #include "CFuncVehicle.h" #include "PluginManager.h" +#include "hlds_hooks.h" // #define DUCKFIX diff --git a/dlls/player/CBaseSpectator.cpp b/dlls/player/CBaseSpectator.cpp index 75a218b6..3a0a2485 100644 --- a/dlls/player/CBaseSpectator.cpp +++ b/dlls/player/CBaseSpectator.cpp @@ -20,7 +20,6 @@ // #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monsters.h" #include "CBaseSpectator.h" diff --git a/dlls/triggers/CAutoTrigger.cpp b/dlls/triggers/CAutoTrigger.cpp index d0cd2f0c..736186ee 100644 --- a/dlls/triggers/CAutoTrigger.cpp +++ b/dlls/triggers/CAutoTrigger.cpp @@ -1,6 +1,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" +#include "CBaseDelay.h" #include "saverestore.h" #include "trains.h" // trigger_camera has train functionality #include "gamerules.h" diff --git a/dlls/triggers/CBaseLogic.h b/dlls/triggers/CBaseLogic.h index 72abbe1f..d5601558 100644 --- a/dlls/triggers/CBaseLogic.h +++ b/dlls/triggers/CBaseLogic.h @@ -1,7 +1,6 @@ #pragma once - // shared functions used by logic entities such as trigger_changevalue and trigger_condition -#include "cbase.h" +#include "CPointEntity.h" // generic flags that should be converted to from the child entity's own flags #define SF_LOGIC_DONT_USE_X 1 diff --git a/dlls/triggers/CBaseTrigger.cpp b/dlls/triggers/CBaseTrigger.cpp index 9da88fa1..16cf1bff 100644 --- a/dlls/triggers/CBaseTrigger.cpp +++ b/dlls/triggers/CBaseTrigger.cpp @@ -1,6 +1,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" +#include "CBaseEntity.h" #include "saverestore.h" #include "trains.h" // trigger_camera has train functionality #include "gamerules.h" diff --git a/dlls/triggers/CBaseTrigger.h b/dlls/triggers/CBaseTrigger.h index d9b0001c..db705210 100644 --- a/dlls/triggers/CBaseTrigger.h +++ b/dlls/triggers/CBaseTrigger.h @@ -1,4 +1,5 @@ #pragma once +#include "CBaseToggle.h" #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 diff --git a/dlls/triggers/CChangeLevel.cpp b/dlls/triggers/CChangeLevel.cpp index 28fcbee3..917692ef 100644 --- a/dlls/triggers/CChangeLevel.cpp +++ b/dlls/triggers/CChangeLevel.cpp @@ -1,11 +1,11 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "trains.h" // trigger_camera has train functionality #include "gamerules.h" #include "CBaseTrigger.h" #include "CFireAndDie.h" +#include "hlds_hooks.h" #define SF_CHANGELEVEL_USEONLY 0x0002 diff --git a/dlls/triggers/CFireAndDie.cpp b/dlls/triggers/CFireAndDie.cpp index b60acbe9..b2882381 100644 --- a/dlls/triggers/CFireAndDie.cpp +++ b/dlls/triggers/CFireAndDie.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CFireAndDie.h" LINK_ENTITY_TO_CLASS(fireanddie, CFireAndDie) diff --git a/dlls/triggers/CFireAndDie.h b/dlls/triggers/CFireAndDie.h index 5e70ccef..d72f4ede 100644 --- a/dlls/triggers/CFireAndDie.h +++ b/dlls/triggers/CFireAndDie.h @@ -1,4 +1,5 @@ #pragma once +#include "CBaseDelay.h" // Fires a target after level transition and then dies class CFireAndDie : public CBaseDelay diff --git a/dlls/triggers/CFrictionModifier.cpp b/dlls/triggers/CFrictionModifier.cpp index 4647ef21..3aea5954 100644 --- a/dlls/triggers/CFrictionModifier.cpp +++ b/dlls/triggers/CFrictionModifier.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "trains.h" // trigger_camera has train functionality #include "gamerules.h" diff --git a/dlls/triggers/CGameCounter.cpp b/dlls/triggers/CGameCounter.cpp index 5037bab6..7841d332 100644 --- a/dlls/triggers/CGameCounter.cpp +++ b/dlls/triggers/CGameCounter.cpp @@ -2,7 +2,7 @@ #include "eiface.h" #include "util.h" #include "gamerules.h" -#include "cbase.h" +#include "CBaseEntity.h" #include "CRuleEntity.h" // diff --git a/dlls/triggers/CGameEnd.cpp b/dlls/triggers/CGameEnd.cpp index 113f8476..c993d834 100644 --- a/dlls/triggers/CGameEnd.cpp +++ b/dlls/triggers/CGameEnd.cpp @@ -2,7 +2,6 @@ #include "eiface.h" #include "util.h" #include "gamerules.h" -#include "cbase.h" #include "CRuleEntity.h" // CGameEnd / game_end -- Ends the game in MP diff --git a/dlls/triggers/CGamePlayerCounter.cpp b/dlls/triggers/CGamePlayerCounter.cpp index ea3b316e..a9cf77cf 100644 --- a/dlls/triggers/CGamePlayerCounter.cpp +++ b/dlls/triggers/CGamePlayerCounter.cpp @@ -1,7 +1,7 @@ #include "extdll.h" #include "eiface.h" #include "util.h" -#include "cbase.h" +#include "CPointEntity.h" // // CGamePlayerCounter / game_player_counter -- Fires targets depending on player count diff --git a/dlls/triggers/CGamePlayerEquip.cpp b/dlls/triggers/CGamePlayerEquip.cpp index d1123adc..266131a7 100644 --- a/dlls/triggers/CGamePlayerEquip.cpp +++ b/dlls/triggers/CGamePlayerEquip.cpp @@ -2,7 +2,6 @@ #include "eiface.h" #include "util.h" #include "gamerules.h" -#include "cbase.h" #include "CBasePlayer.h" #include "weapons.h" #include "CGamePlayerEquip.h" diff --git a/dlls/triggers/CGamePlayerHurt.cpp b/dlls/triggers/CGamePlayerHurt.cpp index 65470906..6601f583 100644 --- a/dlls/triggers/CGamePlayerHurt.cpp +++ b/dlls/triggers/CGamePlayerHurt.cpp @@ -2,7 +2,6 @@ #include "eiface.h" #include "util.h" #include "gamerules.h" -#include "cbase.h" #include "CRuleEntity.h" // diff --git a/dlls/triggers/CGamePlayerZone.cpp b/dlls/triggers/CGamePlayerZone.cpp index 4c20f146..4372f328 100644 --- a/dlls/triggers/CGamePlayerZone.cpp +++ b/dlls/triggers/CGamePlayerZone.cpp @@ -2,7 +2,6 @@ #include "eiface.h" #include "util.h" #include "gamerules.h" -#include "cbase.h" #include "CRuleEntity.h" #include "CBasePlayer.h" diff --git a/dlls/triggers/CGameScore.cpp b/dlls/triggers/CGameScore.cpp index 5fbf56e1..85dc4900 100644 --- a/dlls/triggers/CGameScore.cpp +++ b/dlls/triggers/CGameScore.cpp @@ -2,7 +2,6 @@ #include "eiface.h" #include "util.h" #include "gamerules.h" -#include "cbase.h" #include "CRuleEntity.h" // CGameScore / game_score -- award points to player / team diff --git a/dlls/triggers/CGameText.cpp b/dlls/triggers/CGameText.cpp index 26282afa..575b9326 100644 --- a/dlls/triggers/CGameText.cpp +++ b/dlls/triggers/CGameText.cpp @@ -2,7 +2,6 @@ #include "eiface.h" #include "util.h" #include "gamerules.h" -#include "cbase.h" #include "CRuleEntity.h" // diff --git a/dlls/triggers/CMultiManager.cpp b/dlls/triggers/CMultiManager.cpp index 9493b107..5a256fdd 100644 --- a/dlls/triggers/CMultiManager.cpp +++ b/dlls/triggers/CMultiManager.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "trains.h" // trigger_camera has train functionality #include "gamerules.h" diff --git a/dlls/triggers/CMultiSource.cpp b/dlls/triggers/CMultiSource.cpp index aaac9267..998db734 100644 --- a/dlls/triggers/CMultiSource.cpp +++ b/dlls/triggers/CMultiSource.cpp @@ -1,6 +1,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" +#include "CMultiSource.h" #include "saverestore.h" TYPEDESCRIPTION CMultiSource::m_SaveData[] = diff --git a/dlls/triggers/CMultiSource.h b/dlls/triggers/CMultiSource.h new file mode 100644 index 00000000..f438298c --- /dev/null +++ b/dlls/triggers/CMultiSource.h @@ -0,0 +1,24 @@ +#pragma once +#include "CPointEntity.h" + +class EXPORT CMultiSource : public CPointEntity +{ +public: + void Spawn(); + void KeyValue(KeyValueData* pkvd); + void Use(CBaseEntity* pActivator, CBaseEntity* pCaller, USE_TYPE useType, float value); + int ObjectCaps(void) { return (CPointEntity::ObjectCaps() | FCAP_MASTER); } + BOOL IsTriggered(CBaseEntity* pActivator); + void Register(void); + virtual int Save(CSave& save); + virtual int Restore(CRestore& restore); + + static TYPEDESCRIPTION m_SaveData[]; + + EHANDLE m_rgEntities[MS_MAX_TARGETS]; + int m_rgTriggered[MS_MAX_TARGETS]; + + int m_iTotal; + string_t m_globalstate; + bool m_registered; +}; \ No newline at end of file diff --git a/dlls/triggers/CPlayerRespawnZone.cpp b/dlls/triggers/CPlayerRespawnZone.cpp index 3961ef3a..4ae60c2c 100644 --- a/dlls/triggers/CPlayerRespawnZone.cpp +++ b/dlls/triggers/CPlayerRespawnZone.cpp @@ -2,7 +2,6 @@ #include "eiface.h" #include "util.h" #include "gamerules.h" -#include "cbase.h" #include "CRuleEntity.h" #include "CBaseDMStart.h" #include "CBasePlayer.h" diff --git a/dlls/triggers/CRenderFxManager.cpp b/dlls/triggers/CRenderFxManager.cpp index 16aeaaf1..587b9c33 100644 --- a/dlls/triggers/CRenderFxManager.cpp +++ b/dlls/triggers/CRenderFxManager.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "trains.h" // trigger_camera has train functionality #include "gamerules.h" diff --git a/dlls/triggers/CRevertSaved.cpp b/dlls/triggers/CRevertSaved.cpp index eff66027..35a68113 100644 --- a/dlls/triggers/CRevertSaved.cpp +++ b/dlls/triggers/CRevertSaved.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "trains.h" #include "nodes.h" #include "shake.h" diff --git a/dlls/triggers/CRuleEntity.cpp b/dlls/triggers/CRuleEntity.cpp index 93393cfb..441be4a7 100644 --- a/dlls/triggers/CRuleEntity.cpp +++ b/dlls/triggers/CRuleEntity.cpp @@ -2,7 +2,6 @@ #include "eiface.h" #include "util.h" #include "gamerules.h" -#include "cbase.h" #include "CRuleEntity.h" TYPEDESCRIPTION CRuleEntity::m_SaveData[] = diff --git a/dlls/triggers/CStripWeapons.cpp b/dlls/triggers/CStripWeapons.cpp index 570e5e07..48b11707 100644 --- a/dlls/triggers/CStripWeapons.cpp +++ b/dlls/triggers/CStripWeapons.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CBasePlayer.h" #include "trains.h" #include "nodes.h" diff --git a/dlls/triggers/CTargetCDAudio.cpp b/dlls/triggers/CTargetCDAudio.cpp index e1a028aa..5500586a 100644 --- a/dlls/triggers/CTargetCDAudio.cpp +++ b/dlls/triggers/CTargetCDAudio.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "trains.h" // trigger_camera has train functionality #include "gamerules.h" diff --git a/dlls/triggers/CTriggerCDAudio.cpp b/dlls/triggers/CTriggerCDAudio.cpp index 84ba8e89..f4d9ab8a 100644 --- a/dlls/triggers/CTriggerCDAudio.cpp +++ b/dlls/triggers/CTriggerCDAudio.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "trains.h" // trigger_camera has train functionality #include "gamerules.h" diff --git a/dlls/triggers/CTriggerCamera.cpp b/dlls/triggers/CTriggerCamera.cpp index 17385978..bd2e885b 100644 --- a/dlls/triggers/CTriggerCamera.cpp +++ b/dlls/triggers/CTriggerCamera.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CBasePlayer.h" #include "saverestore.h" #include "trains.h" // trigger_camera has train functionality diff --git a/dlls/triggers/CTriggerChangeSky.cpp b/dlls/triggers/CTriggerChangeSky.cpp index 974cfe5c..7042b8ec 100644 --- a/dlls/triggers/CTriggerChangeSky.cpp +++ b/dlls/triggers/CTriggerChangeSky.cpp @@ -1,7 +1,6 @@ #include "extdll.h" #include "eiface.h" #include "util.h" -#include "cbase.h" #include "CBaseDMStart.h" // diff --git a/dlls/triggers/CTriggerChangeTarget.cpp b/dlls/triggers/CTriggerChangeTarget.cpp index 3806fa87..5d676120 100644 --- a/dlls/triggers/CTriggerChangeTarget.cpp +++ b/dlls/triggers/CTriggerChangeTarget.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CBaseMonster.h" #include "saverestore.h" #include "trains.h" // trigger_camera has train functionality diff --git a/dlls/triggers/CTriggerChangeValue.cpp b/dlls/triggers/CTriggerChangeValue.cpp index 312358d7..6f595cca 100644 --- a/dlls/triggers/CTriggerChangeValue.cpp +++ b/dlls/triggers/CTriggerChangeValue.cpp @@ -2,9 +2,9 @@ #include "eiface.h" #include "util.h" #include "gamerules.h" -#include "cbase.h" #include "CRuleEntity.h" #include "CBaseLogic.h" +#include "hlds_hooks.h" // // CTriggerChangeValue / trigger_changevalue -- changes an entity keyvalue diff --git a/dlls/triggers/CTriggerCondition.cpp b/dlls/triggers/CTriggerCondition.cpp index f41202ea..85422e03 100644 --- a/dlls/triggers/CTriggerCondition.cpp +++ b/dlls/triggers/CTriggerCondition.cpp @@ -2,7 +2,6 @@ #include "eiface.h" #include "util.h" #include "gamerules.h" -#include "cbase.h" #include "CRuleEntity.h" #include "CBaseLogic.h" diff --git a/dlls/triggers/CTriggerCounter.cpp b/dlls/triggers/CTriggerCounter.cpp index 9eda05ff..5a876c40 100644 --- a/dlls/triggers/CTriggerCounter.cpp +++ b/dlls/triggers/CTriggerCounter.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "trains.h" // trigger_camera has train functionality #include "gamerules.h" diff --git a/dlls/triggers/CTriggerCreateEntity.cpp b/dlls/triggers/CTriggerCreateEntity.cpp index 83bea771..33c0d987 100644 --- a/dlls/triggers/CTriggerCreateEntity.cpp +++ b/dlls/triggers/CTriggerCreateEntity.cpp @@ -2,7 +2,6 @@ #include "eiface.h" #include "util.h" #include "gamerules.h" -#include "cbase.h" #include "CRuleEntity.h" #include "CBaseLogic.h" diff --git a/dlls/triggers/CTriggerEndSection.cpp b/dlls/triggers/CTriggerEndSection.cpp index dee58e70..4cc3ff08 100644 --- a/dlls/triggers/CTriggerEndSection.cpp +++ b/dlls/triggers/CTriggerEndSection.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "trains.h" // trigger_camera has train functionality #include "gamerules.h" diff --git a/dlls/triggers/CTriggerEntityIterator.cpp b/dlls/triggers/CTriggerEntityIterator.cpp index 951b4cef..7cd6c33b 100644 --- a/dlls/triggers/CTriggerEntityIterator.cpp +++ b/dlls/triggers/CTriggerEntityIterator.cpp @@ -2,7 +2,6 @@ #include "eiface.h" #include "util.h" #include "gamerules.h" -#include "cbase.h" #include "CRuleEntity.h" #include "CBaseLogic.h" diff --git a/dlls/triggers/CTriggerGravity.cpp b/dlls/triggers/CTriggerGravity.cpp index 69a6d43f..dfb0f435 100644 --- a/dlls/triggers/CTriggerGravity.cpp +++ b/dlls/triggers/CTriggerGravity.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "trains.h" // trigger_camera has train functionality #include "gamerules.h" diff --git a/dlls/triggers/CTriggerHurt.cpp b/dlls/triggers/CTriggerHurt.cpp index 2eaba1f8..64baadf9 100644 --- a/dlls/triggers/CTriggerHurt.cpp +++ b/dlls/triggers/CTriggerHurt.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CBasePlayer.h" #include "saverestore.h" #include "trains.h" // trigger_camera has train functionality diff --git a/dlls/triggers/CTriggerHurtRemote.cpp b/dlls/triggers/CTriggerHurtRemote.cpp index 1dbe39c0..84b05c0e 100644 --- a/dlls/triggers/CTriggerHurtRemote.cpp +++ b/dlls/triggers/CTriggerHurtRemote.cpp @@ -1,7 +1,6 @@ #include "extdll.h" #include "eiface.h" #include "util.h" -#include "cbase.h" #include "CBaseLogic.h" // diff --git a/dlls/triggers/CTriggerMonsterJump.cpp b/dlls/triggers/CTriggerMonsterJump.cpp index b2d15e32..8daf5ccc 100644 --- a/dlls/triggers/CTriggerMonsterJump.cpp +++ b/dlls/triggers/CTriggerMonsterJump.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "trains.h" // trigger_camera has train functionality #include "gamerules.h" diff --git a/dlls/triggers/CTriggerMultiple.cpp b/dlls/triggers/CTriggerMultiple.cpp index ff76f7f4..5475c384 100644 --- a/dlls/triggers/CTriggerMultiple.cpp +++ b/dlls/triggers/CTriggerMultiple.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "trains.h" // trigger_camera has train functionality #include "gamerules.h" diff --git a/dlls/triggers/CTriggerOnce.cpp b/dlls/triggers/CTriggerOnce.cpp index eec47135..a982acdd 100644 --- a/dlls/triggers/CTriggerOnce.cpp +++ b/dlls/triggers/CTriggerOnce.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "trains.h" // trigger_camera has train functionality #include "gamerules.h" diff --git a/dlls/triggers/CTriggerPush.cpp b/dlls/triggers/CTriggerPush.cpp index 09d12498..e5b4280b 100644 --- a/dlls/triggers/CTriggerPush.cpp +++ b/dlls/triggers/CTriggerPush.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "trains.h" // trigger_camera has train functionality #include "gamerules.h" diff --git a/dlls/triggers/CTriggerRandom.cpp b/dlls/triggers/CTriggerRandom.cpp index 4dd7898f..c079d746 100644 --- a/dlls/triggers/CTriggerRandom.cpp +++ b/dlls/triggers/CTriggerRandom.cpp @@ -2,7 +2,6 @@ #include "eiface.h" #include "util.h" #include "gamerules.h" -#include "cbase.h" #include "CRuleEntity.h" // diff --git a/dlls/triggers/CTriggerRelay.cpp b/dlls/triggers/CTriggerRelay.cpp index ec9e9434..77d16b28 100644 --- a/dlls/triggers/CTriggerRelay.cpp +++ b/dlls/triggers/CTriggerRelay.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #define SF_RELAY_FIREONCE 0x0001 #define SF_RELAY_KEEP_ACTIVATOR 64 diff --git a/dlls/triggers/CTriggerRenamePlayer.cpp b/dlls/triggers/CTriggerRenamePlayer.cpp index 9e4455bb..696c2884 100644 --- a/dlls/triggers/CTriggerRenamePlayer.cpp +++ b/dlls/triggers/CTriggerRenamePlayer.cpp @@ -2,7 +2,6 @@ #include "eiface.h" #include "util.h" #include "gamerules.h" -#include "cbase.h" #include "CRuleEntity.h" // diff --git a/dlls/triggers/CTriggerRespawn.cpp b/dlls/triggers/CTriggerRespawn.cpp index 060e8cc9..191786f0 100644 --- a/dlls/triggers/CTriggerRespawn.cpp +++ b/dlls/triggers/CTriggerRespawn.cpp @@ -2,7 +2,6 @@ #include "eiface.h" #include "util.h" #include "gamerules.h" -#include "cbase.h" #include "CRuleEntity.h" #include "CBasePlayer.h" #include "CBaseDMStart.h" diff --git a/dlls/triggers/CTriggerSave.cpp b/dlls/triggers/CTriggerSave.cpp index 50e3c24a..cc6382b6 100644 --- a/dlls/triggers/CTriggerSave.cpp +++ b/dlls/triggers/CTriggerSave.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "trains.h" // trigger_camera has train functionality #include "gamerules.h" diff --git a/dlls/triggers/CTriggerSetOrigin.cpp b/dlls/triggers/CTriggerSetOrigin.cpp index 95303a3c..d227013a 100644 --- a/dlls/triggers/CTriggerSetOrigin.cpp +++ b/dlls/triggers/CTriggerSetOrigin.cpp @@ -1,7 +1,6 @@ #include "extdll.h" #include "eiface.h" #include "util.h" -#include "cbase.h" // // CTriggerSetOrigin / trigger_setorigin -- copies position and orientation of one entity to another diff --git a/dlls/triggers/CTriggerTeleport.cpp b/dlls/triggers/CTriggerTeleport.cpp index 301ef6a0..66c2c265 100644 --- a/dlls/triggers/CTriggerTeleport.cpp +++ b/dlls/triggers/CTriggerTeleport.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "trains.h" // trigger_camera has train functionality #include "gamerules.h" diff --git a/dlls/triggers/CTriggerVolume.cpp b/dlls/triggers/CTriggerVolume.cpp index c9430619..fd757020 100644 --- a/dlls/triggers/CTriggerVolume.cpp +++ b/dlls/triggers/CTriggerVolume.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "trains.h" // trigger_camera has train functionality #include "gamerules.h" diff --git a/dlls/triggers/CTriggerVote.cpp b/dlls/triggers/CTriggerVote.cpp index f89bb8a4..3703fe14 100644 --- a/dlls/triggers/CTriggerVote.cpp +++ b/dlls/triggers/CTriggerVote.cpp @@ -2,7 +2,6 @@ #include "eiface.h" #include "util.h" #include "gamerules.h" -#include "cbase.h" #include "CBasePlayer.h" #include "TextMenu.h" #include "CTriggerVote.h" diff --git a/dlls/triggers/CTriggerVote.h b/dlls/triggers/CTriggerVote.h index 27a5473c..d8481a08 100644 --- a/dlls/triggers/CTriggerVote.h +++ b/dlls/triggers/CTriggerVote.h @@ -1,5 +1,6 @@ #pragma once #include "TextMenu.h" +#include "CPointEntity.h" class CTriggerVote : public CPointEntity { diff --git a/dlls/util/TextMenu.h b/dlls/util/TextMenu.h index a19d85a7..cbd41479 100644 --- a/dlls/util/TextMenu.h +++ b/dlls/util/TextMenu.h @@ -1,5 +1,5 @@ #pragma once -#include "cbase.h" +#include "CBaseEntity.h" #include #define MAX_MENU_OPTIONS 128 diff --git a/dlls/util/eng_wrappers.cpp b/dlls/util/eng_wrappers.cpp index ca8a0c79..3f069f7c 100644 --- a/dlls/util/eng_wrappers.cpp +++ b/dlls/util/eng_wrappers.cpp @@ -1,6 +1,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" +#include "CBaseEntity.h" #include "pm_materials.h" #include "pm_shared.h" #include "eng_wrappers.h" diff --git a/dlls/util/lagcomp.cpp b/dlls/util/lagcomp.cpp index bab52479..c606d556 100644 --- a/dlls/util/lagcomp.cpp +++ b/dlls/util/lagcomp.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "lagcomp.h" #include #include "CBasePlayer.h" diff --git a/dlls/util/saverestore.cpp b/dlls/util/saverestore.cpp index 293cf4ca..407e2572 100644 --- a/dlls/util/saverestore.cpp +++ b/dlls/util/saverestore.cpp @@ -1,6 +1,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" +#include "CBaseEntity.h" #include "saverestore.h" static int gSizes[FIELD_TYPECOUNT] = diff --git a/dlls/util/sound.cpp b/dlls/util/sound.cpp index 1f079613..523c0f53 100644 --- a/dlls/util/sound.cpp +++ b/dlls/util/sound.cpp @@ -18,7 +18,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "weapons.h" #include "CBasePlayer.h" #include "CTalkSquadMonster.h" diff --git a/dlls/util/subs.cpp b/dlls/util/subs.cpp index d0100322..df1cbfea 100644 --- a/dlls/util/subs.cpp +++ b/dlls/util/subs.cpp @@ -22,7 +22,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "nodes.h" #include "CBaseDoor.h" diff --git a/dlls/util/util.cpp b/dlls/util/util.cpp index ea400ead..bf1f1fee 100644 --- a/dlls/util/util.cpp +++ b/dlls/util/util.cpp @@ -22,7 +22,6 @@ #include #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include #include "shake.h" @@ -38,6 +37,7 @@ #include "PluginManager.h" #include "TextMenu.h" #include "debug.h" +#include "hlds_hooks.h" #include #include diff --git a/dlls/util/util.h b/dlls/util/util.h index 583b3e42..1d74f9ea 100644 --- a/dlls/util/util.h +++ b/dlls/util/util.h @@ -291,17 +291,6 @@ typedef enum } MONSTERSTATE; - - -// Things that toggle (buttons/triggers/doors) need this -typedef enum - { - TS_AT_TOP, - TS_AT_BOTTOM, - TS_GOING_UP, - TS_GOING_DOWN - } TOGGLE_STATE; - // Misc useful inline BOOL FStrEq(const char*sz1, const char*sz2) { return (strcmp(sz1, sz2) == 0); } @@ -458,6 +447,7 @@ EXPORT float UTIL_DotPoints ( const Vector &vecSrc, const Vector &vecCheck, cons EXPORT void UTIL_StripToken( const char *pKey, char *pDest, int nLen);// for redundant keynames // Misc functions +EXPORT extern void FireTargets(const char* targetName, CBaseEntity* pActivator, CBaseEntity* pCaller, USE_TYPE useType, float value); EXPORT void SetMovedir(entvars_t* pev); EXPORT Vector VecBModelOrigin( entvars_t* pevBModel ); EXPORT int BuildChangeList( LEVELLIST *pLevelList, int maxList ); diff --git a/dlls/weapon/CBasePlayerAmmo.cpp b/dlls/weapon/CBasePlayerAmmo.cpp index 9f2656fe..c4fb0a2f 100644 --- a/dlls/weapon/CBasePlayerAmmo.cpp +++ b/dlls/weapon/CBasePlayerAmmo.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "nodes.h" #include "env/CSoundEnt.h" #include "decals.h" diff --git a/dlls/weapon/CBasePlayerAmmo.h b/dlls/weapon/CBasePlayerAmmo.h index 1cd5de92..d749c34c 100644 --- a/dlls/weapon/CBasePlayerAmmo.h +++ b/dlls/weapon/CBasePlayerAmmo.h @@ -1,7 +1,6 @@ #pragma once #include "extdll.h" #include "util.h" -#include "cbase.h" #include "ammo.h" class EXPORT CBasePlayerAmmo : public CBaseEntity diff --git a/dlls/weapon/CBasePlayerItem.cpp b/dlls/weapon/CBasePlayerItem.cpp index fbec5fdc..57ddd49a 100644 --- a/dlls/weapon/CBasePlayerItem.cpp +++ b/dlls/weapon/CBasePlayerItem.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CBasePlayer.h" #include "weapons.h" #include "nodes.h" diff --git a/dlls/weapon/CBasePlayerItem.h b/dlls/weapon/CBasePlayerItem.h index b8eae4e6..c039b3d6 100644 --- a/dlls/weapon/CBasePlayerItem.h +++ b/dlls/weapon/CBasePlayerItem.h @@ -1,5 +1,5 @@ #pragma once -#include "cbase.h" +#include "CBaseEntity.h" #include "CBasePlayer.h" #include "weapons.h" diff --git a/dlls/weapon/CBasePlayerWeapon.cpp b/dlls/weapon/CBasePlayerWeapon.cpp index aa6278ad..838938ab 100644 --- a/dlls/weapon/CBasePlayerWeapon.cpp +++ b/dlls/weapon/CBasePlayerWeapon.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CBasePlayer.h" #include "weapons.h" #include "nodes.h" diff --git a/dlls/weapon/CCrossbow.cpp b/dlls/weapon/CCrossbow.cpp index cf5a031b..85b272f8 100644 --- a/dlls/weapon/CCrossbow.cpp +++ b/dlls/weapon/CCrossbow.cpp @@ -16,7 +16,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "weapons.h" #include "nodes.h" #include "skill.h" diff --git a/dlls/weapon/CCrowbar.cpp b/dlls/weapon/CCrowbar.cpp index 576c3910..7dd308b7 100644 --- a/dlls/weapon/CCrowbar.cpp +++ b/dlls/weapon/CCrowbar.cpp @@ -15,7 +15,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "skill.h" #include "weapons.h" #include "nodes.h" diff --git a/dlls/weapon/CDisplacer.cpp b/dlls/weapon/CDisplacer.cpp index d3780f8a..9abb3006 100644 --- a/dlls/weapon/CDisplacer.cpp +++ b/dlls/weapon/CDisplacer.cpp @@ -12,7 +12,6 @@ * without written permission from Valve LLC. * ****/ -#include "cbase.h" #include "user_messages.h" #ifndef CLIENT_DLL diff --git a/dlls/weapon/CDisplacerBall.cpp b/dlls/weapon/CDisplacerBall.cpp index 4af328d6..d19cc90d 100644 --- a/dlls/weapon/CDisplacerBall.cpp +++ b/dlls/weapon/CDisplacerBall.cpp @@ -12,8 +12,6 @@ * without written permission from Valve LLC. * ****/ -#include "cbase.h" - #include "user_messages.h" #include "CDisplacerBall.h" diff --git a/dlls/weapon/CEgon.cpp b/dlls/weapon/CEgon.cpp index b8d20115..dbb2f614 100644 --- a/dlls/weapon/CEgon.cpp +++ b/dlls/weapon/CEgon.cpp @@ -16,7 +16,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CBasePlayer.h" #include "skill.h" #include "weapons.h" diff --git a/dlls/weapon/CGauss.cpp b/dlls/weapon/CGauss.cpp index 46ea9d59..46e0c613 100644 --- a/dlls/weapon/CGauss.cpp +++ b/dlls/weapon/CGauss.cpp @@ -16,7 +16,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "skill.h" #include "weapons.h" #include "nodes.h" diff --git a/dlls/weapon/CGlock.cpp b/dlls/weapon/CGlock.cpp index 1ffe59a6..4b7efd1c 100644 --- a/dlls/weapon/CGlock.cpp +++ b/dlls/weapon/CGlock.cpp @@ -15,7 +15,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "weapon/weapons.h" #include "nodes.h" #include "CBasePlayer.h" diff --git a/dlls/weapon/CGrapple.cpp b/dlls/weapon/CGrapple.cpp index 44f13d72..23a702d8 100644 --- a/dlls/weapon/CGrapple.cpp +++ b/dlls/weapon/CGrapple.cpp @@ -14,7 +14,6 @@ ****/ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "weapons.h" #include "nodes.h" #include "skill.h" diff --git a/dlls/weapon/CGrappleTip.cpp b/dlls/weapon/CGrappleTip.cpp index 1d195d6f..517bea1e 100644 --- a/dlls/weapon/CGrappleTip.cpp +++ b/dlls/weapon/CGrappleTip.cpp @@ -14,7 +14,6 @@ ****/ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "nodes.h" #include "skill.h" #include "CBasePlayer.h" diff --git a/dlls/weapon/CGrenade.cpp b/dlls/weapon/CGrenade.cpp index 0f80fa89..bfa96fc9 100644 --- a/dlls/weapon/CGrenade.cpp +++ b/dlls/weapon/CGrenade.cpp @@ -20,7 +20,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "skill.h" #include "weapons.h" #include "nodes.h" diff --git a/dlls/weapon/CHandGrenade.cpp b/dlls/weapon/CHandGrenade.cpp index eb24e6bd..582520d4 100644 --- a/dlls/weapon/CHandGrenade.cpp +++ b/dlls/weapon/CHandGrenade.cpp @@ -14,7 +14,6 @@ ****/ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "skill.h" #include "weapons.h" #include "nodes.h" diff --git a/dlls/weapon/CHgun.cpp b/dlls/weapon/CHgun.cpp index 5cc1a537..fd08b5f8 100644 --- a/dlls/weapon/CHgun.cpp +++ b/dlls/weapon/CHgun.cpp @@ -16,7 +16,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "skill.h" #include "weapons.h" #include "nodes.h" diff --git a/dlls/weapon/CMP5.cpp b/dlls/weapon/CMP5.cpp index d343f41d..e95ede39 100644 --- a/dlls/weapon/CMP5.cpp +++ b/dlls/weapon/CMP5.cpp @@ -15,7 +15,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "skill.h" #include "weapons.h" #include "nodes.h" diff --git a/dlls/weapon/CMortar.cpp b/dlls/weapon/CMortar.cpp index aebf0dbd..d8954bbf 100644 --- a/dlls/weapon/CMortar.cpp +++ b/dlls/weapon/CMortar.cpp @@ -22,7 +22,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "saverestore.h" #include "weapons.h" #include "decals.h" diff --git a/dlls/weapon/CPipewrench.cpp b/dlls/weapon/CPipewrench.cpp index 6987e720..506c596c 100644 --- a/dlls/weapon/CPipewrench.cpp +++ b/dlls/weapon/CPipewrench.cpp @@ -13,7 +13,6 @@ * ****/ -#include "cbase.h" #include "CPipewrench.h" #define PIPEWRENCH_BODYHIT_VOLUME 128 diff --git a/dlls/weapon/CPython.cpp b/dlls/weapon/CPython.cpp index 4c304250..90e69f27 100644 --- a/dlls/weapon/CPython.cpp +++ b/dlls/weapon/CPython.cpp @@ -16,7 +16,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "weapons.h" #include "CBasePlayer.h" #include "gamerules.h" diff --git a/dlls/weapon/CRpg.cpp b/dlls/weapon/CRpg.cpp index 6eb3b0ff..4dfa8746 100644 --- a/dlls/weapon/CRpg.cpp +++ b/dlls/weapon/CRpg.cpp @@ -16,7 +16,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "skill.h" #include "weapons.h" #include "nodes.h" diff --git a/dlls/weapon/CSatchel.cpp b/dlls/weapon/CSatchel.cpp index d279bec5..b06720b1 100644 --- a/dlls/weapon/CSatchel.cpp +++ b/dlls/weapon/CSatchel.cpp @@ -16,7 +16,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "skill.h" #include "weapons.h" #include "nodes.h" diff --git a/dlls/weapon/CShockBeam.cpp b/dlls/weapon/CShockBeam.cpp index a0056e7f..2e2bfc7f 100644 --- a/dlls/weapon/CShockBeam.cpp +++ b/dlls/weapon/CShockBeam.cpp @@ -14,7 +14,6 @@ ****/ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "weapons.h" #include "customentity.h" #include "skill.h" diff --git a/dlls/weapon/CShockRifle.cpp b/dlls/weapon/CShockRifle.cpp index b25df275..a339250b 100644 --- a/dlls/weapon/CShockRifle.cpp +++ b/dlls/weapon/CShockRifle.cpp @@ -12,7 +12,6 @@ * without written permission from Valve LLC. * ****/ -#include "cbase.h" #include "user_messages.h" #ifndef CLIENT_DLL diff --git a/dlls/weapon/CShotgun.cpp b/dlls/weapon/CShotgun.cpp index fd40696f..9a2e5e16 100644 --- a/dlls/weapon/CShotgun.cpp +++ b/dlls/weapon/CShotgun.cpp @@ -15,7 +15,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "weapons.h" #include "nodes.h" #include "CBasePlayer.h" diff --git a/dlls/weapon/CSpore.cpp b/dlls/weapon/CSpore.cpp index 78ffa737..b3179ae5 100644 --- a/dlls/weapon/CSpore.cpp +++ b/dlls/weapon/CSpore.cpp @@ -14,7 +14,6 @@ ****/ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "weapons.h" #include "skill.h" #include "CSoundEnt.h" diff --git a/dlls/weapon/CSporeLauncher.cpp b/dlls/weapon/CSporeLauncher.cpp index ef063b21..afa30540 100644 --- a/dlls/weapon/CSporeLauncher.cpp +++ b/dlls/weapon/CSporeLauncher.cpp @@ -12,7 +12,6 @@ * without written permission from Valve LLC. * ****/ -#include "cbase.h" #include "user_messages.h" #ifndef CLIENT_DLL diff --git a/dlls/weapon/CSqueak.cpp b/dlls/weapon/CSqueak.cpp index efed7c3c..13f5aec9 100644 --- a/dlls/weapon/CSqueak.cpp +++ b/dlls/weapon/CSqueak.cpp @@ -16,7 +16,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "monster/monsters.h" #include "weapons.h" #include "nodes.h" diff --git a/dlls/weapon/CTripmine.cpp b/dlls/weapon/CTripmine.cpp index d634ed80..3130a761 100644 --- a/dlls/weapon/CTripmine.cpp +++ b/dlls/weapon/CTripmine.cpp @@ -14,7 +14,6 @@ ****/ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "skill.h" #include "weapons.h" #include "nodes.h" diff --git a/dlls/weapon/CWeaponBox.cpp b/dlls/weapon/CWeaponBox.cpp index 08ba1be2..829a86d5 100644 --- a/dlls/weapon/CWeaponBox.cpp +++ b/dlls/weapon/CWeaponBox.cpp @@ -1,6 +1,5 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CBasePlayer.h" #include "weapons.h" #include "nodes.h" diff --git a/dlls/weapon/combat.cpp b/dlls/weapon/combat.cpp index 2f8c59dc..e6b285c7 100644 --- a/dlls/weapon/combat.cpp +++ b/dlls/weapon/combat.cpp @@ -22,7 +22,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "env/CSoundEnt.h" #include "decals.h" #include "animation.h" diff --git a/dlls/weapon/weapons.cpp b/dlls/weapon/weapons.cpp index f04be145..b2cdb3a9 100644 --- a/dlls/weapon/weapons.cpp +++ b/dlls/weapon/weapons.cpp @@ -22,7 +22,6 @@ #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CBasePlayer.h" #include "monsters.h" #include "weapons.h" diff --git a/game_shared/voice_gamemgr.cpp b/game_shared/voice_gamemgr.cpp index 981ed3c4..4e1e4963 100644 --- a/game_shared/voice_gamemgr.cpp +++ b/game_shared/voice_gamemgr.cpp @@ -11,7 +11,6 @@ #include #include "extdll.h" #include "util.h" -#include "cbase.h" #include "CBasePlayer.h" #include "user_messages.h"