From 12e311bd5261078e02bffe63e125f89ae1a57209 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 13 May 2012 17:52:35 +0300 Subject: Move some code from logic queue to separate calls. It can improve perfomance in slow systems. --- src/localplayer.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/localplayer.cpp') diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 68a2e295c..09613a717 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -49,6 +49,7 @@ #include "gui/okdialog.h" #include "gui/outfitwindow.h" #include "gui/shopwindow.h" +#include "gui/sdlfont.h" #include "gui/skilldialog.h" #include "gui/socialwindow.h" #include "gui/theme.h" @@ -258,13 +259,6 @@ void LocalPlayer::logic() } } - if (weightNotice && weightNoticeTime < cur_time) - { - weightNotice->scheduleDelete(); - weightNotice = nullptr; - weightNoticeTime = 0; - } - // Show XP messages if (!mMessages.empty()) { @@ -349,6 +343,18 @@ void LocalPlayer::logic() } } + Being::logic(); +} + +void LocalPlayer::slowLogic() +{ + if (weightNotice && weightNoticeTime < cur_time) + { + weightNotice->scheduleDelete(); + weightNotice = nullptr; + weightNoticeTime = 0; + } + if (serverVersion < 4 && mEnableAdvert && !mBlockAdvert && mAdvertTime < cur_time) { @@ -367,7 +373,6 @@ void LocalPlayer::logic() else mAdvertTime = cur_time + 30; } - Being::logic(); } void LocalPlayer::setAction(Action action, int attackType) -- cgit v1.2.3-60-g2f50