Skip to content

Commit

Permalink
Fix some potential null pointer dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
RedSprend committed Dec 1, 2024
1 parent 025fad9 commit e5dcb9a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions dlls/monster/CXenPLight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,11 @@ void CXenPLight::Spawn(void)
return;

m_pGlow = CSprite::SpriteCreate(XEN_PLANT_GLOW_SPRITE, pev->origin + Vector(0, 0, (pev->mins.z + pev->maxs.z) * 0.5), FALSE);
m_pGlow->SetTransparency(kRenderGlow, pev->rendercolor.x, pev->rendercolor.y, pev->rendercolor.z, pev->renderamt, pev->renderfx);
m_pGlow->SetAttachment(edict(), 1);
if (m_pGlow)
{
m_pGlow->SetTransparency(kRenderGlow, pev->rendercolor.x, pev->rendercolor.y, pev->rendercolor.z, pev->renderamt, pev->renderfx);
m_pGlow->SetAttachment(edict(), 1);
}
}


Expand Down
3 changes: 2 additions & 1 deletion dlls/monster/CXenTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ void CXenTree::Spawn(void)
triggerPosition = pev->origin + (triggerPosition * 64);
// Create the trigger
m_pTrigger = CXenTreeTrigger::TriggerCreate(edict(), triggerPosition);
UTIL_SetSize(m_pTrigger->pev, Vector(-24, -24, 0), Vector(24, 24, 128));
if (m_pTrigger)
UTIL_SetSize(m_pTrigger->pev, Vector(-24, -24, 0), Vector(24, 24, 128));
}

const char* CXenTree::pAttackHitSounds[] =
Expand Down

0 comments on commit e5dcb9a

Please sign in to comment.