From 480218b4c8e7e62e1718a69b822bb701580cf327 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) --- .../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;