From 346a5219073ccd4f8708862af8d7f1c826cd5f9c Mon Sep 17 00:00:00 2001 From: cidoku Date: Thu, 12 Jun 2025 19:41:26 -0400 Subject: [PATCH] add multiple checks for missing sprites to avoid ic hanging --- gameview.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/gameview.py b/gameview.py index 2d475dd..63ad58b 100644 --- a/gameview.py +++ b/gameview.py @@ -336,7 +336,12 @@ class AOCharMovie(QtGui.QLabel): AOpath+"characters/"+p_char+"/"+p_emote+".gif", AOpath+"characters/"+p_char+"/(a)"+p_emote+".gif" ) - alt_path = AOpath+"characters/"+p_char+"/"+p_emote+".png" + alt_path = test_path( + AOpath+"characters/"+p_char+"/"+emote_prefix+p_emote+".png", + AOpath+"characters/"+p_char+"/"+emote_prefix+"/"+p_emote+".png", + AOpath+"characters/"+p_char+"/"+p_emote+".png", + AOpath+"characters/"+p_char+"/(a)"+p_emote+".png" + ) apng_path = test_path( AOpath+"characters/"+p_char+"/"+emote_prefix+p_emote+".apng", AOpath+"characters/"+p_char+"/"+emote_prefix+"/"+p_emote+".apng", @@ -351,8 +356,6 @@ class AOCharMovie(QtGui.QLabel): ) placeholder_path = AO2XPpath+"themes/default/oldplaceholder.gif" gif_path = "" - - print apng_path, emote_prefix+p_emote if apng_path: gif_path = apng_path @@ -395,12 +398,19 @@ class AOCharMovie(QtGui.QLabel): else: gif_path = "" self.use_pillow = 0 - - #if gif_path == placeholder_path or + if gif_path == "": gif_path = self.prev_gif_path + # Second check just in case + if gif_path == "": + if exists(placeholder_path): + gif_path = placeholder_path + else: + gif_path = "" else: self.prev_gif_path = gif_path + + print "[debug]", p_char, emote_prefix, p_emote, "(!) path is null!" if gif_path == "" else gif_path if not self.use_pillow: self.m_movie.stop()