From 9f558e4d242bca6982844b8a7ab0987fceda6b98 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 15 Dec 2015 14:05:56 +0100 Subject: [PATCH] Changed: Replace atoi by fromString --- .../mission_manager/mission_step_kill.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_kill.cpp b/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_kill.cpp index 9124c1fc3..7e8e809d4 100644 --- a/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_kill.cpp +++ b/code/ryzom/server/src/entities_game_service/mission_manager/mission_step_kill.cpp @@ -1095,14 +1095,19 @@ class CMissionStepKillPlayer : public IMissionStepTemplate return false; } // missionData.ChatParams.push_back( make_pair( args[0], STRING_MANAGER::clan ) ); - subStep.MinLevel = atoi( args[1].c_str() ) * kFameMultipler; - subStep.MaxLevel = atoi( args[2].c_str() ) * kFameMultipler; + NLMISC::fromString(args[1], subStep.MinLevel); + NLMISC::fromString(args[2], subStep.MaxLevel); + + subStep.MinLevel *= kFameMultipler; + subStep.MaxLevel *= kFameMultipler; + if ( subStep.MinLevel >= subStep.MaxLevel ) { MISLOGERROR("min_level >= max_level"); return false; } - subStep.Quantity = (uint16) atoi( args[3].c_str() ); + NLMISC::fromString(args[3], subStep.Quantity); + if ( subStep.Quantity == 0 ) { MISLOGERROR("invalid quantity 0");