Make multiples states changes in one tick (if relevant)

This commit is contained in:
Guillaume Dupuy 2016-10-14 21:03:31 +02:00
parent 9ec5a6e693
commit 480218b4c8

View file

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