mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 14:01:45 +00:00
Fix strange crash when player's weapon is removed.
This commit is contained in:
parent
ed5d81271b
commit
01a6dafe6a
1 changed files with 6 additions and 4 deletions
|
@ -691,11 +691,13 @@ void HWDrawInfo::PreparePlayerSprites2D(sector_t * viewsector, area_t in_area, F
|
|||
|
||||
if(weap.weapon && weap.weapon->GetCaller())
|
||||
{
|
||||
PClass * cls = weap.weapon->GetCaller()->GetClass();
|
||||
if(auto caller = weap.weapon->GetCaller())
|
||||
{
|
||||
PClass* cls = caller->GetClass();
|
||||
ModifyBobLayer = cls->Virtuals.Size() > ModifyBobLayerVIndex ? cls->Virtuals[ModifyBobLayerVIndex] : nullptr;
|
||||
|
||||
if( ModifyBobLayer == ModifyBobLayerOrigFunc) ModifyBobLayer = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// hack alert! Rather than changing everything in the underlying lighting code let's just temporarily change
|
||||
// light mode here to draw the weapon sprite.
|
||||
|
|
Loading…
Reference in a new issue