diff --git a/common/const.h b/common/const.h index 1c4b7d3f..7da40acf 100644 --- a/common/const.h +++ b/common/const.h @@ -610,16 +610,9 @@ #define CONTENTS_LADDER -16 -#define CONTENT_FLYFIELD -17 -#define CONTENT_GRAVITY_FLYFIELD -18 -#define CONTENT_FOG -19 - -#define CONTENT_EMPTY -1 -#define CONTENT_SOLID -2 -#define CONTENT_WATER -3 -#define CONTENT_SLIME -4 -#define CONTENT_LAVA -5 -#define CONTENT_SKY -6 +#define CONTENTS_FLYFIELD -17 +#define CONTENTS_GRAVITY_FLYFIELD -18 +#define CONTENTS_FOG -19 // channels #define CHAN_AUTO 0 diff --git a/dlls/CBaseEntity.h b/dlls/CBaseEntity.h index e2cbba32..bc1ef30a 100644 --- a/dlls/CBaseEntity.h +++ b/dlls/CBaseEntity.h @@ -122,7 +122,6 @@ class EXPORT CBaseEntity 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) diff --git a/dlls/env/CEnvSound.cpp b/dlls/env/CEnvSound.cpp index 0bf120b7..6be07378 100644 --- a/dlls/env/CEnvSound.cpp +++ b/dlls/env/CEnvSound.cpp @@ -8,7 +8,6 @@ class CEnvSound : public CPointEntity { public: virtual int GetEntindexPriority() { return ENTIDX_PRIORITY_NORMAL; } // TODO: needed for VIS checks but it shouldn't be - virtual bool ForceVisChecks() { return true; } void KeyValue(KeyValueData* pkvd); void Spawn(void); @@ -209,8 +208,8 @@ void CEnvSound::Spawn() // spread think times pev->nextthink = gpGlobals->time + RANDOM_FLOAT(0.0, 0.5); - // must set a model for rehlds to call AddFullToPack - SET_MODEL(edict(), "models/player.mdl"); + // model is needed for rehlds to call AddToFullPack + SET_MODEL(edict(), NOT_PRECACHED_MODEL); pev->rendermode = kRenderTransTexture; - pev->renderamt = 0; + m_hidePlayers = 0xffffffff; // do visibility checks but don't network the entity. } diff --git a/dlls/hooks/hlds_hooks.cpp b/dlls/hooks/hlds_hooks.cpp index 95944e45..002abcba 100644 --- a/dlls/hooks/hlds_hooks.cpp +++ b/dlls/hooks/hlds_hooks.cpp @@ -1203,10 +1203,8 @@ int AddToFullPack( struct entity_state_s *state, int e, edict_t *ent, edict_t *h // solid entities should always be sent to clients for collision prediction bool solid = ent->v.solid >= SOLID_BBOX && ent->v.modelindex; - bool forceVisChecks = baseent->ForceVisChecks(); - - if (invisible && !forceVisChecks && !solid) { - return 0; // exit now unless a vis check was requested for this ent + if (invisible && !solid) { + return 0; } CBasePlayer* plr = (CBasePlayer*)GET_PRIVATE(host); @@ -1226,7 +1224,7 @@ int AddToFullPack( struct entity_state_s *state, int e, edict_t *ent, edict_t *h return 0; } - if ((invisible && !solid) || forceVisChecks || (baseent->m_hidePlayers & plrbit)) { + if (baseent->m_hidePlayers & plrbit) { return 0; } diff --git a/dlls/player/CBasePlayer.cpp b/dlls/player/CBasePlayer.cpp index d41ce907..006a2709 100644 --- a/dlls/player/CBasePlayer.cpp +++ b/dlls/player/CBasePlayer.cpp @@ -1422,12 +1422,12 @@ void CBasePlayer::WaterMove() } } - if (pev->watertype == CONTENT_LAVA) // do damage + if (pev->watertype == CONTENTS_LAVA) // do damage { if (pev->dmgtime < gpGlobals->time) TakeDamage(VARS(eoNullEntity), VARS(eoNullEntity), 10 * pev->waterlevel, DMG_BURN); } - else if (pev->watertype == CONTENT_SLIME) // do damage + else if (pev->watertype == CONTENTS_SLIME) // do damage { pev->dmgtime = gpGlobals->time + 1; TakeDamage(VARS(eoNullEntity), VARS(eoNullEntity), 4 * pev->waterlevel, DMG_ACID); @@ -3076,7 +3076,7 @@ void CBasePlayer::PostThink() { // ALERT ( at_console, "%f\n", m_flFallVelocity ); - if (pev->watertype == CONTENT_WATER) + if (pev->watertype == CONTENTS_WATER) { // Did he hit the world or a non-moving entity? // BUG - this happens all the time in water, especially when