Changed: #142 Replace atoi and sscanf by fromString when it's possible
This commit is contained in:
parent
001f16934e
commit
83405c2433
2 changed files with 6 additions and 3 deletions
|
@ -4686,12 +4686,14 @@ NLMISC_COMMAND(regenTickRange, "Emulate regen tick range locally for a memory sl
|
||||||
{
|
{
|
||||||
if (args.size() != 1 && args.size() != 2) return false;
|
if (args.size() != 1 && args.size() != 2) return false;
|
||||||
CSPhraseManager *pPM = CSPhraseManager::getInstance();
|
CSPhraseManager *pPM = CSPhraseManager::getInstance();
|
||||||
const CSPhraseCom &phrase = pPM->getPhrase(atoi(args[0].c_str()));
|
uint32 phraseId;
|
||||||
|
NLMISC::fromString(args[0], phraseId);
|
||||||
|
const CSPhraseCom &phrase = pPM->getPhrase(phraseId);
|
||||||
uint64 powerBitField = CSPhraseManager::getPhraseRequiredFlags(phrase);
|
uint64 powerBitField = CSPhraseManager::getPhraseRequiredFlags(phrase);
|
||||||
TGameCycle duration;
|
TGameCycle duration;
|
||||||
if (args.size() >= 2)
|
if (args.size() >= 2)
|
||||||
{
|
{
|
||||||
duration = (TGameCycle) atoi(args[1].c_str());
|
NLMISC::fromString(args[1], duration);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -486,7 +486,8 @@ NLMISC_COMMAND(queryMissionGiverData, "Query mission giver data for the specifie
|
||||||
{
|
{
|
||||||
if (args.size() == 0)
|
if (args.size() == 0)
|
||||||
return false;
|
return false;
|
||||||
uint32 alias = atoi(args[0].c_str());
|
uint32 alias;
|
||||||
|
NLMISC::fromString(args[0], alias);
|
||||||
|
|
||||||
CNPCIconCache::getInstance().queryMissionGiverData(alias);
|
CNPCIconCache::getInstance().queryMissionGiverData(alias);
|
||||||
//giver.setDescTransient();
|
//giver.setDescTransient();
|
||||||
|
|
Loading…
Reference in a new issue