mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 20:41:46 +00:00
Merge branch 'custom3dcrash' into 'next'
Fix sigsegv caused by bad target check in A_Custom3DRotate See merge request STJr/SRB2!1430
This commit is contained in:
commit
b49eeac270
1 changed files with 9 additions and 8 deletions
|
|
@ -9879,22 +9879,23 @@ void A_Custom3DRotate(mobj_t *actor)
|
||||||
if (LUA_CallAction(A_CUSTOM3DROTATE, actor))
|
if (LUA_CallAction(A_CUSTOM3DROTATE, actor))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
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)
|
if (actor->target->health == 0)
|
||||||
{
|
{
|
||||||
P_RemoveMobj(actor);
|
P_RemoveMobj(actor);
|
||||||
return;
|
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)
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue