Fix an issue with AOCharmovie hanging on frame1 animations

Fix an issue with the logger screwing up the server folder name string if character ' was used
This commit is contained in:
Crystalwarrior 2019-09-24 13:29:08 +03:00
parent fb6c5076aa
commit 9911aeb5e6
2 changed files with 8 additions and 4 deletions

View File

@ -153,8 +153,12 @@ void AOCharMovie::play()
{
play_frame_effect(frame);
if (max_frames <= 1)
return;
ticker->start(this->get_frame_delay(movie_delays[frame]));
{
play_once = true;
ticker->start(60);
}
else
ticker->start(this->get_frame_delay(movie_delays[frame]));
}
void AOCharMovie::play_pre(QString p_char, QString p_emote, int duration)
@ -281,7 +285,7 @@ void AOCharMovie::move(int ax, int ay)
void AOCharMovie::movie_ticker()
{
++frame;
if(frame == max_frames)
if(frame >= max_frames)
{
if(play_once)
{

View File

@ -288,7 +288,7 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
send_server_packet(f_packet);
//Remove any characters not accepted in folder names for the server_name here
this->log_filename = QDateTime::currentDateTime().toUTC().toString("'logs/" + server_name.remove(QRegExp("[\\\\/:*?\"<>|]")) + "/'ddd MMMM yyyy hh.mm.ss t'.log'");
this->log_filename = QDateTime::currentDateTime().toUTC().toString("'logs/" + server_name.remove(QRegExp("[\\\\/:*?\"<>|\']")) + "/'ddd MMMM yyyy hh.mm.ss t'.log'");
this->write_to_file("Joined server " + server_name + " on address " + server_address +" on " + QDateTime::currentDateTime().toUTC().toString(), log_filename, true);
QCryptographicHash hash(QCryptographicHash::Algorithm::Sha256);
hash.addData(server_address.toUtf8());