From 2d3153079b046ae9c5f585e77d677022aabf957b Mon Sep 17 00:00:00 2001 From: SteelT Date: Fri, 21 Apr 2023 12:57:37 -0400 Subject: [PATCH] A_PointyThink crash fix (patch from #827) Fixes A_PointyThink crashing in certain scenarios --- src/p_enemy.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/p_enemy.c b/src/p_enemy.c index 63d430eb6..ca947fc20 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -1589,6 +1589,10 @@ void A_PointyThink(mobj_t *actor) if (!actor->tracer) // For some reason we do not have spike balls... return; + // Catch case where actor lastlook is -1 (which segfaults the following blocks) + if (actor->lastlook < 0) + return; + // Position spike balls relative to the value of 'lastlook'. ball = actor->tracer;