mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-24 21:11:52 +00:00
fix rare crash due to null caller
This commit is contained in:
parent
bcbb85b1dd
commit
1852f14f30
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue