From 7d2ff58f7613490d59f45b422e7df5a6965d67c3 Mon Sep 17 00:00:00 2001 From: cidoku Date: Thu, 12 Jun 2025 22:52:33 -0400 Subject: [PATCH] add multiple checks for missing sprites to avoid ic hanging --- gameview.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gameview.py b/gameview.py index 63ad58b..4364a46 100644 --- a/gameview.py +++ b/gameview.py @@ -10,6 +10,7 @@ from PyQt4 import QtGui, QtCore from functools import partial from ctypes import create_string_buffer from urllib2 import Request, urlopen +from urlparse import urlparse DOWNLOAD_BLACKLIST = [] @@ -384,7 +385,7 @@ class AOCharMovie(QtGui.QLabel): url = url.replace(" ", "%20") thread.start_new_thread(download_thread, (url, original_path)) - if exists(alt_path): + if alt_path: gif_path = alt_path self.use_pillow = 0 else: @@ -410,7 +411,7 @@ class AOCharMovie(QtGui.QLabel): else: self.prev_gif_path = gif_path - print "[debug]", p_char, emote_prefix, p_emote, "(!) path is null!" if gif_path == "" else 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() @@ -2816,6 +2817,7 @@ class GUI(QtGui.QWidget): self.m_chatmessage = m_chatmessage objections = ["holdit", "objection", "takethat", "custom_objections/"+custom_objection if custom_objection != "custom" else "custom"] + self.objectionview.stop() self.objectionview.play(objections[objection_mod-1], f_char.lower()) self.presentedevi.hide() self.playObjectionSnd(f_char.lower(), objection_mod) @@ -3569,10 +3571,11 @@ class GUI(QtGui.QWidget): if not mus.endswith(".mp3") and "===MUSIC START===.mp3" in self.musiclist: #vidya workaround mus += ".mp3" musl = mus.lower() + musp = urllib.unquote(urlparse(musl).path)[1:] self.stopMusic() - if exists(AOpath + 'sounds/music/' + musl): + if exists(AOpath + 'sounds/music/' + musp): self.music = audio.loadhandle(False, AOpath + 'sounds/music/' + musl, 0, 0, BASS_SAMPLE_LOOP) audio.sethandleattr(self.music, BASS_ATTRIB_VOL, self.musicslider.value() / 100.0) audio.playhandle(self.music, True)