From 8daffed6c25cef8501d194e6bf66cabfdbad52d4 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 18 Nov 2019 15:04:04 +0800 Subject: [PATCH] Cleanup odd patch, fix dyn chat choice progress --- .../mission_manager/mission_manager.cpp | 34 ++----------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/mission_manager.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/mission_manager.cpp index 9b9c2db29..73e53f4d3 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/mission_manager.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/mission_manager.cpp @@ -1488,6 +1488,9 @@ void CMissionManager::dynChatChoice( CCharacter * user, const TDataSetRow & botR { // inform client closeDynChat( user, botRow ); + _DynChats.erase(it); + it = _DynChats.end(); + reStart = true; std::list< CMissionEvent * > eventList; inst->jump( templ->JumpPoints[i].Step,templ->JumpPoints[i].Action,eventList ); @@ -1495,37 +1498,6 @@ void CMissionManager::dynChatChoice( CCharacter * user, const TDataSetRow & botR // Send to AIS (to stop the bot). Important: there must be the same number of items pushed in DynChatEnd that in DynChatStart for the bot to resume. CharacterDynChatBeginEnd.DynChatEnd.push_back( botRow ); -// HERE "it" IS INVALID, NEED TO FIND IT AGAIN TO ERASE IT - - it = _DynChats.end(); // to be sure - - { - /* We need to find the mission that we are working on as we invalidated the iterator - * in the jump() - */ - CHashMultiMap::iterator itToLookForMission = _DynChats.find( user->getEntityRowId() ); - while (itToLookForMission != _DynChats.end() && (*itToLookForMission).first == user->getEntityRowId()) - { - if ( (*itToLookForMission).second.Bot == botRow ) - { - CMission * missionIterated = (*itToLookForMission).second.Mission; - if (missionIterated && inst == missionIterated) - { - _DynChats.erase(itToLookForMission); - break; - } - } - ++itToLookForMission; - } - } - -// _DynChats.erase(it); - -// END PATCH - - - - reStart = true; switch ( inst->getProcessingState() ) { case CMission::Failed: