Skip to content

Commit

Permalink
Fix monster_tentacle not interpolating
Browse files Browse the repository at this point in the history
  • Loading branch information
SamVanheer committed Mar 28, 2022
1 parent 40d3849 commit a02eb83
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions dlls/cbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,7 @@ CBaseEntity* CBaseEntity::GetNextTarget()
TYPEDESCRIPTION CBaseEntity::m_SaveData[] =
{
DEFINE_FIELD(CBaseEntity, m_pGoalEnt, FIELD_CLASSPTR),
DEFINE_FIELD(CBaseEntity, m_EFlags, FIELD_CHARACTER),

DEFINE_FIELD(CBaseEntity, m_pfnThink, FIELD_FUNCTION), // UNDONE: Build table of these!!!
DEFINE_FIELD(CBaseEntity, m_pfnTouch, FIELD_FUNCTION),
Expand Down
5 changes: 5 additions & 0 deletions dlls/cbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ class CBaseEntity
CBaseEntity* m_pGoalEnt; // path corner we are heading towards
CBaseEntity* m_pLink; // used for temporary link-list operations.

/**
* @brief Entity flags sent to the client in ::AddToFullPack
*/
byte m_EFlags = 0;

virtual ~CBaseEntity() {}

// initialization functions
Expand Down
4 changes: 4 additions & 0 deletions dlls/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,8 @@ int AddToFullPack(struct entity_state_s* state, int e, edict_t* ent, edict_t* ho
{
int i;

auto entity = reinterpret_cast<CBaseEntity*>(GET_PRIVATE(ent));

// don't send if flagged for NODRAW and it's not the host getting the message
if ((ent->v.effects & EF_NODRAW) != 0 &&
(ent != host))
Expand Down Expand Up @@ -1201,6 +1203,8 @@ int AddToFullPack(struct entity_state_s* state, int e, edict_t* ent, edict_t* ho
state->eflags &= ~EFLAG_SLERP;
}

state->eflags |= entity->m_EFlags;

state->scale = ent->v.scale;
state->solid = ent->v.solid;
state->colormap = ent->v.colormap;
Expand Down
3 changes: 3 additions & 0 deletions dlls/tentacle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ void CTentacle::Spawn()
pev->health = 75;
pev->sequence = 0;

//Always interpolate tentacles since they don't actually move.
m_EFlags |= EFLAG_SLERP;

SET_MODEL(ENT(pev), "models/tentacle2.mdl");
UTIL_SetSize(pev, Vector(-32, -32, 0), Vector(32, 32, 64));

Expand Down

0 comments on commit a02eb83

Please sign in to comment.