From 245a82112fda2b782d0e12b5fc41e7c3959135e8 Mon Sep 17 00:00:00 2001
From: LJ Sonic <lamr@free.fr>
Date: Wed, 3 Apr 2024 22:39:58 +0200
Subject: [PATCH] Make rotation optional for long sprites

---
 src/r_things.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/r_things.c b/src/r_things.c
index 0767775970..102efdec9d 100644
--- a/src/r_things.c
+++ b/src/r_things.c
@@ -287,10 +287,8 @@ static boolean GetFramesAndRotationsFromLongLumpName(
 )
 {
 	const char *underscore = strchr(name, '_');
-	if (!underscore)
-		return false;
 
-	size_t framelen = underscore - name;
+	size_t framelen = underscore ? (size_t)(underscore - name) : strlen(name);
 	if (framelen < 1 || framelen > 4)
 		return false;
 
@@ -302,7 +300,7 @@ static boolean GetFramesAndRotationsFromLongLumpName(
 			return false;
 
 	*ret_frame = atoi(framepart);
-	*ret_rotation = R_Char2Rotation(*(underscore + 1));
+	*ret_rotation = underscore ? R_Char2Rotation(*(underscore + 1)) : 0;
 	if (*ret_frame >= MAXFRAMENUM || *ret_rotation == 255)
 		return false;
 
-- 
GitLab