From 0e467cba865311745059d68916766848b3a1b507 Mon Sep 17 00:00:00 2001 From: Guillaume Dupuy Date: Fri, 14 Oct 2016 21:03:31 +0200 Subject: [PATCH] Make multiples states changes in one tick (if relevant) --HG-- branch : fix_speed --- .../phrase_manager/phrase_manager.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/code/ryzom/server/src/entities_game_service/phrase_manager/phrase_manager.cpp b/code/ryzom/server/src/entities_game_service/phrase_manager/phrase_manager.cpp index 84e68dcd1..2154db628 100644 --- a/code/ryzom/server/src/entities_game_service/phrase_manager/phrase_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/phrase_manager/phrase_manager.cpp @@ -456,7 +456,14 @@ void CPhraseManager::updatePhrases() } // update this phrase - updateEntityCurrentAction( (*it).first, entityPhrases); + CSPhrase::TPhraseState old_state; + do + { + old_state = phrase->state(); + updateEntityCurrentAction( (*it).first, entityPhrases); + phrase = entityPhrases.getCurrentAction(); + //Every time we get the next action, th phrase might be deleted (if the action is invalid or finished for non-cyclic actions like digging / crafting), always check ! + } while(phrase != NULL && old_state != phrase->state()); // get next entity sentences ++it;