aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCrystalwarrior <varsash@gmail.com>2020-01-15 16:06:27 +0300
committerCrystalwarrior <varsash@gmail.com>2020-01-15 16:06:27 +0300
commitf30013f7f9d9ecb840948b99663e8b1e81a6971c (patch)
tree83640f96d86fa925a62a1a5fa8af6b79a05dc25b
parent8791109c6609e9b188b74f3b879501081312dab8 (diff)
i am REtArd
Fixed a major bug that crashed the clients on chatting + broke a lot of assets because of a single `.` boi anywhere in the filepath.
-rw-r--r--src/aocharmovie.cpp3
-rw-r--r--src/text_file_functions.cpp4
2 files changed, 5 insertions, 2 deletions
diff --git a/src/aocharmovie.cpp b/src/aocharmovie.cpp
index 9bbb8761..0ce5c868 100644
--- a/src/aocharmovie.cpp
+++ b/src/aocharmovie.cpp
@@ -50,6 +50,9 @@ void AOCharMovie::load_image(QString p_char, QString p_emote, QString emote_pref
movie_delays.clear();
movie_effects.clear();
+ if (!file_exists(emote_path))
+ return;
+
m_reader->setFileName(emote_path);
QPixmap f_pixmap = this->get_pixmap(m_reader->read());
int f_delay = m_reader->nextImageDelay();
diff --git a/src/text_file_functions.cpp b/src/text_file_functions.cpp
index 783c83b9..2c9d5e9b 100644
--- a/src/text_file_functions.cpp
+++ b/src/text_file_functions.cpp
@@ -527,7 +527,7 @@ QString AOApplication::get_sfx(QString p_identifier)
QString AOApplication::get_sfx_suffix(QString sound_to_check)
{
- if (sound_to_check.contains(".")) //We have what we could call a file extension
+ if (file_exists(sound_to_check))
return sound_to_check;
if (file_exists(sound_to_check + ".opus"))
return sound_to_check + ".opus";
@@ -542,7 +542,7 @@ QString AOApplication::get_sfx_suffix(QString sound_to_check)
QString AOApplication::get_image_suffix(QString path_to_check)
{
- if (path_to_check.contains(".")) //We have what we could call a file extension
+ if (file_exists(path_to_check))
return path_to_check;
if (file_exists(path_to_check + ".webp"))
return path_to_check + ".webp";