From c3a6610f364eb9dd3cd6e5cf9d2680f74abac5c2 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 17:14:47 +0100 Subject: [PATCH] Changed: Don't need to use CSString --HG-- branch : develop --- .../game_share/server_animation_module.cpp | 42 +++++++++++-------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/code/ryzom/common/src/game_share/server_animation_module.cpp b/code/ryzom/common/src/game_share/server_animation_module.cpp index fbeb5516f..f16d7c9d8 100644 --- a/code/ryzom/common/src/game_share/server_animation_module.cpp +++ b/code/ryzom/common/src/game_share/server_animation_module.cpp @@ -1002,30 +1002,38 @@ IPrimitive* CServerAnimationModule::getAction(CObject* action, const std::string if(param.splitLines(result) ) { - if (result.size() == 0) - { - nlwarning("ERROR: npc_say but no parameters !!! %d in session ", scenarioId.asInt()); - } + std::vector res; - if(result.size()>=1) + if (result.empty()) { - NLMISC::CSString name(result[0]); - if(name.find(":",0)!=string::npos) - { - result[0] = prefix+result[0]; - } + nlwarning("ERROR: npc_say but no parameters !!! %u in session ", scenarioId.asInt()); } - - if(result.size()>=2) - result[1] = "DSS_"+toString(scenarioId)+" "+result[1].c_str(); - if(result.size()>=3) + else { - for(uint32 i=2;i= 1) { - result[i] = prefix + result[i]; + std::string name(result[0]); + + if (name.find(":", 0) != string::npos) + { + res[0] = prefix + name; + } + + if (result.size() >= 2) + { + res[1] = toString("DSS_%u %s", scenarioId.asInt(), result[1].c_str()); + + for (uint32 i = 2, len = result.size(); iaddPropertyByName("parameters", new CPropertyStringArray( (std::vector &)result )); + + pAction->addPropertyByName("parameters", new CPropertyStringArray(res)); } }