From b524819e5a3f473360fe8850b831a811e6d7713d Mon Sep 17 00:00:00 2001 From: David Skoland Date: Wed, 15 Feb 2017 16:19:01 +0100 Subject: [PATCH] fixed some crashes --- Attorney_Online_remake.pro | 2 +- aoapplication.h | 4 +++- aocharmovie.cpp | 1 - aoimage.cpp | 3 --- courtroom.cpp | 1 + courtroom.h | 2 ++ packet_distribution.cpp | 10 ++++++++-- 7 files changed, 15 insertions(+), 8 deletions(-) diff --git a/Attorney_Online_remake.pro b/Attorney_Online_remake.pro index a102252..251cf7e 100644 --- a/Attorney_Online_remake.pro +++ b/Attorney_Online_remake.pro @@ -13,7 +13,7 @@ RC_ICONS = logo.ico TARGET = Attorney_Online_remake TEMPLATE = app -VERSION = 2.1.4.0 +VERSION = 2.1.5.0 SOURCES += main.cpp\ lobby.cpp \ diff --git a/aoapplication.h b/aoapplication.h index 2f06970..567c06c 100644 --- a/aoapplication.h +++ b/aoapplication.h @@ -62,6 +62,8 @@ public: int music_list_size = 0; int loaded_music = 0; + bool courtroom_loaded = false; + //////////////////versioning/////////////// int get_release() {return RELEASE;} @@ -118,7 +120,7 @@ public: private: const int RELEASE = 2; const int MAJOR_VERSION = 1; - const int MINOR_VERSION = 4; + const int MINOR_VERSION = 5; QString user_theme = "default"; diff --git a/aocharmovie.cpp b/aocharmovie.cpp index f4aac9c..fbaf636 100644 --- a/aocharmovie.cpp +++ b/aocharmovie.cpp @@ -19,7 +19,6 @@ AOCharMovie::AOCharMovie(QWidget *p_parent, AOApplication *p_ao_app) : QLabel(p_ this->setMovie(m_movie); connect(m_movie, SIGNAL(frameChanged(int)), this, SLOT(frame_change(int))); - connect(m_movie, SIGNAL(finished()), this, SLOT(movie_done())); connect(preanim_timer, SIGNAL(timeout()), this, SLOT(timer_done())); } diff --git a/aoimage.cpp b/aoimage.cpp index f523e4e..dc22591 100644 --- a/aoimage.cpp +++ b/aoimage.cpp @@ -50,8 +50,5 @@ void AOImage::set_scaled_image(QString p_image) QPixmap f_pixmap(final_image_path); - qDebug() << "aoimage width" << this->width(); - qDebug() << "aoimage height" << this->height(); - this->setPixmap(f_pixmap.scaled(this->width(), this->height(), Qt::IgnoreAspectRatio)); } diff --git a/courtroom.cpp b/courtroom.cpp index 942fbe8..52bac1d 100644 --- a/courtroom.cpp +++ b/courtroom.cpp @@ -1165,6 +1165,7 @@ void Courtroom::play_preanim() if (!file_exists(ao_app->get_character_path(f_char) + f_preanim.toLower() + ".gif")) { + anim_state = 1; preanim_done(); qDebug() << "could not find " + ao_app->get_character_path(f_char) + f_preanim + ".gif"; return; diff --git a/courtroom.h b/courtroom.h index 4622ee0..0b1d3c9 100644 --- a/courtroom.h +++ b/courtroom.h @@ -186,6 +186,8 @@ private: //whether the ooc chat is server or master chat, true is server bool server_ooc = true; + + QString current_background = "gs4"; AOMusicPlayer *music_player; diff --git a/packet_distribution.cpp b/packet_distribution.cpp index 4a84832..ff6cf00 100644 --- a/packet_distribution.cpp +++ b/packet_distribution.cpp @@ -62,7 +62,7 @@ void AOApplication::ms_packet_received(AOPacket *p_packet) { w_lobby->append_chatmessage(message_line); } - if (courtroom_constructed) + if (courtroom_constructed && courtroom_loaded) { w_courtroom->append_ms_chatmessage(message_line); } @@ -129,6 +129,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet) QString f_hdid; f_hdid = get_hdid(); + encryption_needed = true; + AOPacket *hi_packet = new AOPacket("HI#" + f_hdid + "#%"); send_server_packet(hi_packet); } @@ -200,6 +202,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet) destruct_courtroom(); construct_courtroom(); + courtroom_loaded = false; + QString window_title = "Attorney Online 2"; int selected_server = w_lobby->get_selected_server(); @@ -433,6 +437,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet) w_courtroom->done_received(); + courtroom_loaded = true; + destruct_lobby(); } else if (header == "BN") @@ -454,7 +460,7 @@ void AOApplication::server_packet_received(AOPacket *p_packet) } else if (header == "MS") { - if (courtroom_constructed) + if (courtroom_constructed && courtroom_loaded) w_courtroom->handle_chatmessage(&p_packet->get_contents()); } else if (header == "MC")