mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-02-12 07:14:03 +00:00
Fix null pointer crash when drawing sprites with a null actor
This commit is contained in:
parent
447932025f
commit
6781b3215c
1 changed files with 3 additions and 3 deletions
|
@ -51,7 +51,7 @@ class ActorTraceStaticLight
|
||||||
public:
|
public:
|
||||||
ActorTraceStaticLight(AActor* actor) : Actor(actor)
|
ActorTraceStaticLight(AActor* actor) : Actor(actor)
|
||||||
{
|
{
|
||||||
if (Actor->Pos() != Actor->StaticLightsTraceCache.Pos)
|
if (Actor && Actor->Pos() != Actor->StaticLightsTraceCache.Pos)
|
||||||
{
|
{
|
||||||
Actor->StaticLightsTraceCache.Pos = Actor->Pos();
|
Actor->StaticLightsTraceCache.Pos = Actor->Pos();
|
||||||
Actor->StaticLightsTraceCache.Bits = 0;
|
Actor->StaticLightsTraceCache.Bits = 0;
|
||||||
|
@ -62,7 +62,7 @@ public:
|
||||||
bool TraceLightVisbility(FLightNode* node, const FVector3& L, float dist)
|
bool TraceLightVisbility(FLightNode* node, const FVector3& L, float dist)
|
||||||
{
|
{
|
||||||
FDynamicLight* light = node->lightsource;
|
FDynamicLight* light = node->lightsource;
|
||||||
if (!light->Trace() || !level.levelMesh)
|
if (!light->Trace() || !level.levelMesh || !Actor)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!ActorMoved && CurrentBit < 64)
|
if (!ActorMoved && CurrentBit < 64)
|
||||||
|
@ -82,7 +82,7 @@ public:
|
||||||
|
|
||||||
bool TraceSunVisibility(float x, float y, float z)
|
bool TraceSunVisibility(float x, float y, float z)
|
||||||
{
|
{
|
||||||
if (level.LMTextureCount == 0)
|
if (level.LMTextureCount == 0 || !Actor)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!ActorMoved && CurrentBit < 64)
|
if (!ActorMoved && CurrentBit < 64)
|
||||||
|
|
Loading…
Reference in a new issue