Skip to content

Commit

Permalink
fix rare crash due to null caller
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardoLuis0 authored and madame-rachelle committed Aug 2, 2023
1 parent bcbb85b commit 1852f14
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rendering/hwrenderer/scene/hw_weapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ void HWDrawInfo::PreparePlayerSprites2D(sector_t * viewsector, area_t in_area)
VMFunction * ModifyBobLayer = nullptr;
DVector2 bobxy = DVector2(weap.bobx , weap.boby);

if(weap.weapon)
if(weap.weapon && weap.weapon->GetCaller())
{
PClass * cls = weap.weapon->GetCaller()->GetClass();
ModifyBobLayer = cls->Virtuals.Size() > ModifyBobLayerVIndex ? cls->Virtuals[ModifyBobLayerVIndex] : nullptr;
Expand Down Expand Up @@ -774,7 +774,7 @@ void HWDrawInfo::PreparePlayerSprites3D(sector_t * viewsector, area_t in_area)
DVector3 rotation = DVector3(weap.rotation);
DVector3 pivot = DVector3(weap.pivot);

if(weap.weapon)
if(weap.weapon && weap.weapon->GetCaller())
{
PClass * cls = weap.weapon->GetCaller()->GetClass();
ModifyBobLayer3D = cls->Virtuals.Size() > ModifyBobLayer3DVIndex ? cls->Virtuals[ModifyBobLayer3DVIndex] : nullptr;
Expand Down

0 comments on commit 1852f14

Please sign in to comment.