Fix sigsegv caused by bad target check in A_Custom3DRotate
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/1430
This commit is contained in:
1 parent
1af9e362e0
commit
5cd4b79ecf
1 file changed
+10
-9
+10
-9
@@ -9641,22 +9641,23 @@ void A_Custom3DRotate(mobj_t *actor)
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (!actor->target) // Ensure we actually have a target first.
|
||||
{
|
||||
CONS_Printf("Error: A_Custom3DRotate: Object has no target.\n");
|
||||
P_RemoveMobj(actor);
|
||||
return;
|
||||
}
|
||||
|
||||
if (actor->target->health == 0)
|
||||
{
|
||||
P_RemoveMobj(actor);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!actor->target) // This should NEVER happen.
|
||||
{
|
||||
if (cv_debug)
|
||||
CONS_Printf("Error: Object has no target\n");
|
||||
P_RemoveMobj(actor);
|
||||
return;
|
||||
}
|
||||
|
||||
if (hspeed==0 && vspeed==0)
|
||||
{
|
||||
CONS_Printf("Error: A_Custom3DRotate: Object has no speed.\n");
|
||||
if (cv_debug)
|
||||
CONS_Printf("Error: A_Custom3DRotate: Object has no speed.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user