From 207053a0237b5e016afd9cba5baf7af4146626c5 Mon Sep 17 00:00:00 2001
From: spherallic <spherallic@gmail.com>
Date: Fri, 13 Jan 2023 17:10:50 +0100
Subject: [PATCH] Prevent A_LobShot from dividing by 0

---
 src/p_enemy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/p_enemy.c b/src/p_enemy.c
index 373f091233..3305709fc1 100644
--- a/src/p_enemy.c
+++ b/src/p_enemy.c
@@ -2671,7 +2671,7 @@ void A_LobShot(mobj_t *actor)
 	fixed_t z;
 	fixed_t dist;
 	fixed_t vertical, horizontal;
-	fixed_t airtime = var2 & 65535;
+	fixed_t airtime = max(1, var2 & 65535);
 
 	if (LUA_CallAction(A_LOBSHOT, actor))
 		return;
-- 
GitLab