fixed some crashes

This commit is contained in:
David Skoland 2017-02-15 16:19:01 +01:00
parent be017b7278
commit b524819e5a
7 changed files with 15 additions and 8 deletions

View File

@ -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 \

View File

@ -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";

View File

@ -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()));
}

View File

@ -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));
}

View File

@ -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;

View File

@ -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;

View File

@ -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")