Skip to content

Commit

Permalink
Rework tripmine entities to use separate world model
Browse files Browse the repository at this point in the history
  • Loading branch information
SamVanheer committed Oct 3, 2023
1 parent 30ff113 commit c6621b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
12 changes: 2 additions & 10 deletions src/game/shared/entities/items/weapons/CTripmine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void CTripmineGrenade::OnCreate()
{
CGrenade::OnCreate();

pev->model = MAKE_STRING("models/v_tripmine.mdl");
pev->model = MAKE_STRING("models/w_tripmine.mdl");
}

void CTripmineGrenade::Spawn()
Expand All @@ -88,8 +88,6 @@ void CTripmineGrenade::Spawn()

SetModel(STRING(pev->model));
pev->frame = 0;
pev->body = 3;
pev->sequence = TRIPMINE_WORLD;
ResetSequenceInfo();
pev->framerate = 0;

Expand Down Expand Up @@ -353,24 +351,18 @@ void CTripmine::OnCreate()
CBasePlayerWeapon::OnCreate();
m_iId = WEAPON_TRIPMINE;
m_iDefaultAmmo = TRIPMINE_DEFAULT_GIVE;
m_WorldModel = pev->model = MAKE_STRING("models/v_tripmine.mdl");
m_WorldModel = pev->model = MAKE_STRING("models/w_tripmine.mdl");
}

void CTripmine::Spawn()
{
CBasePlayerWeapon::Spawn();

pev->frame = 0;
pev->body = 3;
pev->sequence = TRIPMINE_GROUND;
// ResetSequenceInfo( );
pev->framerate = 0;

// HACK: force the body to the first person view by default so it doesn't show up as a huge tripmine for a second.
#ifdef CLIENT_DLL
pev->body = 0;
#endif

if (!UTIL_IsMultiplayer())
{
SetSize(Vector(-16, -16, 0), Vector(16, 16, 28));
Expand Down
8 changes: 6 additions & 2 deletions src/game/shared/entities/items/weapons/CTripmine.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ enum tripmine_e
TRIPMINE_FIDGET,
TRIPMINE_HOLSTER,
TRIPMINE_DRAW,
TRIPMINE_WORLD,
TRIPMINE_GROUND,
};

enum tripmineworld_e
{
TRIPMINE_WORLD = 0,
TRIPMINE_GROUND
};

class CTripmine : public CBasePlayerWeapon
Expand Down

0 comments on commit c6621b6

Please sign in to comment.