mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2025-01-01 13:43:59 +00:00
Changed: Replaced string empty comparisons with empty()
This commit is contained in:
parent
25dd379d7e
commit
d8c7fa52f9
14 changed files with 52 additions and 52 deletions
|
@ -80,7 +80,7 @@ CMessageRecorder::CMessageRecorder() : _RecordAll(true)
|
||||||
*/
|
*/
|
||||||
CMessageRecorder::~CMessageRecorder()
|
CMessageRecorder::~CMessageRecorder()
|
||||||
{
|
{
|
||||||
if ( _Filename != "" )
|
if ( !_Filename.empty() )
|
||||||
{
|
{
|
||||||
nldebug( "MR:%s: End of recording", _Filename.c_str() );
|
nldebug( "MR:%s: End of recording", _Filename.c_str() );
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,7 +143,7 @@ void CVarPath::decode ()
|
||||||
Destination.push_back (make_pair(RawVarPath, string("")));
|
Destination.push_back (make_pair(RawVarPath, string("")));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (val != "." && val != "" && val != "=")
|
else if (val != "." && !val.empty() && val != "=")
|
||||||
{
|
{
|
||||||
nlwarning ("VP: Malformated VarPath '%s' before position %d", RawVarPath.c_str (), TokenPos);
|
nlwarning ("VP: Malformated VarPath '%s' before position %d", RawVarPath.c_str (), TokenPos);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -413,7 +413,7 @@ void CSoundPage::apply()
|
||||||
|
|
||||||
nlassert( _Tree );
|
nlassert( _Tree );
|
||||||
|
|
||||||
if ( m_Filename != "" )
|
if ( !m_Filename.empty() )
|
||||||
{
|
{
|
||||||
CString s = ((CSource_sounds_builderDlg*)GetOwner())->SoundName( _HItem ) + " (" + m_Filename + ")";
|
CString s = ((CSource_sounds_builderDlg*)GetOwner())->SoundName( _HItem ) + " (" + m_Filename + ")";
|
||||||
_Tree->SetItemText( _HItem, s );
|
_Tree->SetItemText( _HItem, s );
|
||||||
|
|
|
@ -364,7 +364,7 @@ CString CSource_sounds_builderDlg::SoundName( HTREEITEM hitem )
|
||||||
{
|
{
|
||||||
CString s = m_Tree.GetItemText( hitem );
|
CString s = m_Tree.GetItemText( hitem );
|
||||||
sint last;
|
sint last;
|
||||||
if ( s != "" )
|
if ( !s.empty() )
|
||||||
{
|
{
|
||||||
if ( s[s.GetLength()-1] == '*' )
|
if ( s[s.GetLength()-1] == '*' )
|
||||||
{
|
{
|
||||||
|
@ -425,13 +425,13 @@ void CSource_sounds_builderDlg::OnSave()
|
||||||
}
|
}
|
||||||
nameset.insert( (*ips)->getName() );
|
nameset.insert( (*ips)->getName() );
|
||||||
}
|
}
|
||||||
if ( duplicates != "" )
|
if ( !duplicates.empty() )
|
||||||
{
|
{
|
||||||
CString s;
|
CString s;
|
||||||
s.Format( "Warning: the following names are duplicates. The first occurence of each one was not written in the output file. Correct the names and save again:\n\n%s", duplicates.c_str() );
|
s.Format( "Warning: the following names are duplicates. The first occurence of each one was not written in the output file. Correct the names and save again:\n\n%s", duplicates.c_str() );
|
||||||
AfxMessageBox( s, MB_ICONWARNING );
|
AfxMessageBox( s, MB_ICONWARNING );
|
||||||
}
|
}
|
||||||
if ( blanksounds != "" )
|
if ( !blanksounds.empty() )
|
||||||
{
|
{
|
||||||
CString s;
|
CString s;
|
||||||
s.Format( "Warning: the following sounds have no wave file specified:\n\n%s", blanksounds.c_str() );
|
s.Format( "Warning: the following sounds have no wave file specified:\n\n%s", blanksounds.c_str() );
|
||||||
|
@ -569,7 +569,7 @@ void CSource_sounds_builderDlg::OnImport()
|
||||||
if ( hitem == NULL )
|
if ( hitem == NULL )
|
||||||
{
|
{
|
||||||
string sname = string(name);
|
string sname = string(name);
|
||||||
if ( sname != "" ) // prevent from taking blank names
|
if ( !sname.empty() ) // prevent from taking blank names
|
||||||
{
|
{
|
||||||
AddSound( sname.c_str() );
|
AddSound( sname.c_str() );
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,7 +105,7 @@ CAnimatedSceneObject::CAnimatedSceneObject( const string& ObjectName, const stri
|
||||||
}
|
}
|
||||||
|
|
||||||
// load skeleton, bind mesh and init position, rotation, cluster
|
// load skeleton, bind mesh and init position, rotation, cluster
|
||||||
if(_SkeletonName != "" )
|
if(!_SkeletonName.empty())
|
||||||
{
|
{
|
||||||
_Skeleton = Scene->createSkeleton(_SkeletonName);
|
_Skeleton = Scene->createSkeleton(_SkeletonName);
|
||||||
if( _Skeleton == NULL )
|
if( _Skeleton == NULL )
|
||||||
|
@ -340,12 +340,12 @@ void CAnimatedSceneObject::resetInitialPos( void )
|
||||||
// Destructor
|
// Destructor
|
||||||
CAnimatedSceneObject::~CAnimatedSceneObject()
|
CAnimatedSceneObject::~CAnimatedSceneObject()
|
||||||
{
|
{
|
||||||
if( _Instance != NULL && _MeshName != "" )
|
if( _Instance != NULL && !_MeshName.empty() )
|
||||||
{
|
{
|
||||||
Scene->deleteInstance( _Instance );
|
Scene->deleteInstance( _Instance );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( _Skeleton != NULL && _SkeletonName != "" )
|
if( _Skeleton != NULL && !_SkeletonName.empty() )
|
||||||
{
|
{
|
||||||
Scene->deleteSkeleton( _Skeleton );
|
Scene->deleteSkeleton( _Skeleton );
|
||||||
}
|
}
|
||||||
|
|
|
@ -602,7 +602,7 @@ bool CObjectString::set(const std::string& key, const std::string & value)
|
||||||
bool CObjectString::setObject(const std::string& key, CObject* value)
|
bool CObjectString::setObject(const std::string& key, CObject* value)
|
||||||
{
|
{
|
||||||
//H_AUTO(R2_CObjectString_setObject)
|
//H_AUTO(R2_CObjectString_setObject)
|
||||||
BOMB_IF( key != "" || ! (value->isString() || value->isNumber()) , "Try to set the a sub value of an object that does not allowed it", return false);
|
BOMB_IF( !key.empty() || ! (value->isString() || value->isNumber()) , "Try to set the a sub value of an object that does not allowed it", return false);
|
||||||
bool canSet = set(key, value->toString());
|
bool canSet = set(key, value->toString());
|
||||||
if (canSet)
|
if (canSet)
|
||||||
{
|
{
|
||||||
|
|
|
@ -128,7 +128,7 @@ static bool LookupShopType(std::string name,std::vector<uint32> &shopList)
|
||||||
uint i;
|
uint i;
|
||||||
for ( i=0; i < cvShopType.size(); ++i )
|
for ( i=0; i < cvShopType.size(); ++i )
|
||||||
{
|
{
|
||||||
if ( cvShopType.asString(i) != "" )
|
if ( !cvShopType.asString(i).empty() )
|
||||||
{
|
{
|
||||||
// make sure the string doesn't turn up more than once in input data
|
// make sure the string doesn't turn up more than once in input data
|
||||||
for (uint j=0;j<ShopTypeNames.size();++j)
|
for (uint j=0;j<ShopTypeNames.size();++j)
|
||||||
|
|
|
@ -2967,7 +2967,7 @@ void audit(const CAdminCommand *cmd, const string &rawCommand, const CEntityId &
|
||||||
string host = varHost->asString();
|
string host = varHost->asString();
|
||||||
string page = varPage->asString();
|
string page = varPage->asString();
|
||||||
|
|
||||||
if (host == "" || page == "")
|
if (host.empty() || page.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
char params[1024];
|
char params[1024];
|
||||||
|
|
|
@ -117,7 +117,7 @@ void CGenNpcDescMsgImp::callback (const std::string &serviceName, NLNET::TServic
|
||||||
|
|
||||||
//if the creature has a user model and if the user model's script contains parse errors, change
|
//if the creature has a user model and if the user model's script contains parse errors, change
|
||||||
//the creature's name to <usermodelId:ERROR>
|
//the creature's name to <usermodelId:ERROR>
|
||||||
if (_UserModelId != "" && CDynamicSheetManager::getInstance()->scriptErrors(_PrimAlias, _UserModelId) == true)
|
if (!_UserModelId.empty() && CDynamicSheetManager::getInstance()->scriptErrors(_PrimAlias, _UserModelId) == true)
|
||||||
{
|
{
|
||||||
TDataSetRow row = creature->getEntityRowId();
|
TDataSetRow row = creature->getEntityRowId();
|
||||||
ucstring name;
|
ucstring name;
|
||||||
|
|
|
@ -242,7 +242,7 @@ void CShopTypeManager::initShopBase()
|
||||||
CConfigFile::CVar& cvShopType = ShopConfigFile.getVar("ShopCategory");
|
CConfigFile::CVar& cvShopType = ShopConfigFile.getVar("ShopCategory");
|
||||||
for (uint i = 0; i < cvShopType.size(); ++i )
|
for (uint i = 0; i < cvShopType.size(); ++i )
|
||||||
{
|
{
|
||||||
if ( cvShopType.asString(i) != "" )
|
if ( !cvShopType.asString(i).empty() )
|
||||||
{
|
{
|
||||||
_CategoryName.push_back( cvShopType.asString( i ) );
|
_CategoryName.push_back( cvShopType.asString( i ) );
|
||||||
}
|
}
|
||||||
|
@ -252,7 +252,7 @@ void CShopTypeManager::initShopBase()
|
||||||
CConfigFile::CVar& cvShopAlias = ShopConfigFile.getVar("ShopNameAliases");
|
CConfigFile::CVar& cvShopAlias = ShopConfigFile.getVar("ShopNameAliases");
|
||||||
for ( uint i = 0; i < cvShopAlias.size(); ++i )
|
for ( uint i = 0; i < cvShopAlias.size(); ++i )
|
||||||
{
|
{
|
||||||
if ( cvShopAlias.asString(i) != "" )
|
if ( !cvShopAlias.asString(i).empty() )
|
||||||
{
|
{
|
||||||
CVectorSString args;
|
CVectorSString args;
|
||||||
explode(cvShopAlias.asString(i), string(":"), reinterpret_cast<vector<string> &>(args));
|
explode(cvShopAlias.asString(i), string(":"), reinterpret_cast<vector<string> &>(args));
|
||||||
|
|
|
@ -132,7 +132,7 @@ void CChatManager::onServiceDown(const std::string &serviceShortName)
|
||||||
*/
|
*/
|
||||||
void CChatManager::resetChatLog()
|
void CChatManager::resetChatLog()
|
||||||
{
|
{
|
||||||
std::string logPath = (LogChatDirectory.get() == "" ? Bsi.getLocalPath() : LogChatDirectory.get());
|
std::string logPath = (LogChatDirectory.get().empty() ? Bsi.getLocalPath() : LogChatDirectory.get());
|
||||||
_Displayer.setParam(CPath::standardizePath(logPath) + "chat.log");
|
_Displayer.setParam(CPath::standardizePath(logPath) + "chat.log");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -113,13 +113,13 @@ void LoadCraftParts()
|
||||||
|
|
||||||
data.readFromFile( "rm_item_parts.csv" );
|
data.readFromFile( "rm_item_parts.csv" );
|
||||||
|
|
||||||
while ( data != "" )
|
while ( !data.empty() )
|
||||||
{
|
{
|
||||||
ligne = data.splitTo( "\n", true );
|
ligne = data.splitTo( "\n", true );
|
||||||
|
|
||||||
// on recherche la ligne correspondant à notre craft part
|
// on recherche la ligne correspondant à notre craft part
|
||||||
info = ligne.splitTo( ";", true );
|
info = ligne.splitTo( ";", true );
|
||||||
if ( info != "" )
|
if ( !info.empty() )
|
||||||
{
|
{
|
||||||
index = info.c_str()[0] - 'A';
|
index = info.c_str()[0] - 'A';
|
||||||
|
|
||||||
|
@ -179,13 +179,13 @@ void InitCreatureMP()
|
||||||
|
|
||||||
data.readFromFile( "creature_models.csv" );
|
data.readFromFile( "creature_models.csv" );
|
||||||
|
|
||||||
while ( data != "" )
|
while ( !data.empty() )
|
||||||
{
|
{
|
||||||
ligneN = data.splitTo( "\n", true );
|
ligneN = data.splitTo( "\n", true );
|
||||||
ligneM = data.splitTo( "\n", true );
|
ligneM = data.splitTo( "\n", true );
|
||||||
|
|
||||||
// on vérifie que la ligne est valide
|
// on vérifie que la ligne est valide
|
||||||
if ( ligneN.splitTo( ";", true ) != "" )
|
if ( !ligneN.splitTo( ";", true ).empty() )
|
||||||
{
|
{
|
||||||
ligneM.splitTo( ";", true );
|
ligneM.splitTo( ";", true );
|
||||||
|
|
||||||
|
@ -195,7 +195,7 @@ void InitCreatureMP()
|
||||||
ligneN.splitTo( ";", true );
|
ligneN.splitTo( ";", true );
|
||||||
ligneM.splitTo( ";", true );
|
ligneM.splitTo( ";", true );
|
||||||
|
|
||||||
while ( ligneN != "" )
|
while ( !ligneN.empty() )
|
||||||
{
|
{
|
||||||
ListeCreatureMP listeCreatureMP;
|
ListeCreatureMP listeCreatureMP;
|
||||||
|
|
||||||
|
@ -426,7 +426,7 @@ int GetNumeroMP( const CSString& nomMP )
|
||||||
result = FamilyTypContent.splitFrom( buffer );
|
result = FamilyTypContent.splitFrom( buffer );
|
||||||
|
|
||||||
// si oui, on retourne son numéro de MP
|
// si oui, on retourne son numéro de MP
|
||||||
if ( result != "" )
|
if ( !result.empty() )
|
||||||
res = result.splitTo( "\"" ).atoi();
|
res = result.splitTo( "\"" ).atoi();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -478,7 +478,7 @@ int GetNumeroGroupe( const CSString& groupe )
|
||||||
result = GroupTypContent.splitFrom( buffer );
|
result = GroupTypContent.splitFrom( buffer );
|
||||||
|
|
||||||
// si oui, on retourne son numéro de groupe
|
// si oui, on retourne son numéro de groupe
|
||||||
if ( result != "" )
|
if ( !result.empty() )
|
||||||
res = result.splitTo( "\"" ).atoi();
|
res = result.splitTo( "\"" ).atoi();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -557,14 +557,14 @@ void CreateParentSItem( int numMP,
|
||||||
// 3d
|
// 3d
|
||||||
output += " <STRUCT Name=\"3d\">\n";
|
output += " <STRUCT Name=\"3d\">\n";
|
||||||
|
|
||||||
if ( icon != "" )
|
if ( !icon.empty() )
|
||||||
{
|
{
|
||||||
output += " <ATOM Name=\"icon\" Value=\"";
|
output += " <ATOM Name=\"icon\" Value=\"";
|
||||||
output += icon;
|
output += icon;
|
||||||
output += "\"/>\n";
|
output += "\"/>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( overlay != "" )
|
if ( !overlay.empty() )
|
||||||
{
|
{
|
||||||
output += " <ATOM Name=\"text overlay\" Value=\"";
|
output += " <ATOM Name=\"text overlay\" Value=\"";
|
||||||
output += overlay;
|
output += overlay;
|
||||||
|
@ -787,13 +787,13 @@ void CreateSheet( int numMP, const CSString& nomMP,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ( eco == 'c' ) && creature && ( craftStats.Craft == "" ) )
|
if ( ( eco == 'c' ) && creature && ( craftStats.Craft.empty() ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
outputFileName = toString( "m%04d%s%c%c%02d.sitem", numMP, code.c_str(), eco,
|
outputFileName = toString( "m%04d%s%c%c%02d.sitem", numMP, code.c_str(), eco,
|
||||||
'a' + level, variation );
|
'a' + level, variation );
|
||||||
|
|
||||||
if ( craftStats.Craft == "" )
|
if ( craftStats.Craft.empty() )
|
||||||
{
|
{
|
||||||
CSString levelZone = toString( "%c", 'a' + level );
|
CSString levelZone = toString( "%c", 'a' + level );
|
||||||
currentDocItem.push( DtLevelZone, levelZone.toUpper() );
|
currentDocItem.push( DtLevelZone, levelZone.toUpper() );
|
||||||
|
@ -825,7 +825,7 @@ void CreateSheet( int numMP, const CSString& nomMP,
|
||||||
output += " <ATOM Name=\"MpColor\" Value=\"";
|
output += " <ATOM Name=\"MpColor\" Value=\"";
|
||||||
|
|
||||||
// materiaux de missions toujours Beige
|
// materiaux de missions toujours Beige
|
||||||
if ( craftStats.Craft == "" )
|
if ( craftStats.Craft.empty() )
|
||||||
{
|
{
|
||||||
output += "Beige\"/>\n";
|
output += "Beige\"/>\n";
|
||||||
if(craftStats.UsedAsCraftRequirement)
|
if(craftStats.UsedAsCraftRequirement)
|
||||||
|
@ -894,7 +894,7 @@ void CreateSheet( int numMP, const CSString& nomMP,
|
||||||
CSString statEnergy;
|
CSString statEnergy;
|
||||||
if ( ( variation == 2 ) && ( numMP == 695 ) ) // cas particulier pour le kitin trophy (beurk)
|
if ( ( variation == 2 ) && ( numMP == 695 ) ) // cas particulier pour le kitin trophy (beurk)
|
||||||
statEnergy = "0";
|
statEnergy = "0";
|
||||||
else if ( !creature || ( craftStats.Craft == "" ) )
|
else if ( !creature || ( craftStats.Craft.empty() ) )
|
||||||
statEnergy = toString( "%d", GetStatEnergy( level ) );
|
statEnergy = toString( "%d", GetStatEnergy( level ) );
|
||||||
else if ( variation < 2 )
|
else if ( variation < 2 )
|
||||||
statEnergy = toString( "%d", GetStatEnergy( level + 1 ) );
|
statEnergy = toString( "%d", GetStatEnergy( level + 1 ) );
|
||||||
|
@ -912,7 +912,7 @@ void CreateSheet( int numMP, const CSString& nomMP,
|
||||||
outputFileName = toString( "m%04d%s%c%c%02d", numMP, code.c_str(), eco, 'a' + level, variation );
|
outputFileName = toString( "m%04d%s%c%c%02d", numMP, code.c_str(), eco, 'a' + level, variation );
|
||||||
output = outputFileName;
|
output = outputFileName;
|
||||||
|
|
||||||
GenerateItemNames( nomMP, eco, level, ( craftStats.Craft == "" ), creature, itemName );
|
GenerateItemNames( nomMP, eco, level, ( craftStats.Craft.empty() ), creature, itemName );
|
||||||
output += "\t" + itemName;
|
output += "\t" + itemName;
|
||||||
itemNames.insert( output );
|
itemNames.insert( output );
|
||||||
}
|
}
|
||||||
|
@ -947,7 +947,7 @@ void GenerateDepositItems( int numMP, const CSString& nomMP, const MPCraftStats&
|
||||||
code = "cxx";
|
code = "cxx";
|
||||||
|
|
||||||
// pas de craft = items de mission
|
// pas de craft = items de mission
|
||||||
if ( craftStats.Craft == "" )
|
if ( craftStats.Craft.empty() )
|
||||||
{
|
{
|
||||||
if ( loc != "G" )
|
if ( loc != "G" )
|
||||||
CreateSheet( numMP, nomMP, code, 'c', 0, craftStats );
|
CreateSheet( numMP, nomMP, code, 'c', 0, craftStats );
|
||||||
|
@ -1000,7 +1000,7 @@ void GenerateCreatureItems( int numMP, CSString& nomMP, const MPCraftStats& craf
|
||||||
CSString creatureFileName = "c";
|
CSString creatureFileName = "c";
|
||||||
creatureFileName += (*itMP)->codeCreature.toLower();
|
creatureFileName += (*itMP)->codeCreature.toLower();
|
||||||
|
|
||||||
if ( craftStats.Craft != "" )
|
if ( !craftStats.Craft.empty() )
|
||||||
{
|
{
|
||||||
quality = statQuality[creatureLevel-1];
|
quality = statQuality[creatureLevel-1];
|
||||||
if ( quality != 6 )
|
if ( quality != 6 )
|
||||||
|
@ -1107,7 +1107,7 @@ void NewMP( CSString& ligne )
|
||||||
|
|
||||||
// nouveau nom de famille
|
// nouveau nom de famille
|
||||||
nomMP = ligne.splitTo( ";", true );
|
nomMP = ligne.splitTo( ";", true );
|
||||||
if ( nomMP == "" )
|
if ( nomMP.empty() )
|
||||||
{
|
{
|
||||||
// cette ligne ne contient pas d'info
|
// cette ligne ne contient pas d'info
|
||||||
return;
|
return;
|
||||||
|
@ -1126,37 +1126,37 @@ void NewMP( CSString& ligne )
|
||||||
ligne.splitTo( ";", true );
|
ligne.splitTo( ";", true );
|
||||||
|
|
||||||
stat = ligne.splitTo( ";", true );
|
stat = ligne.splitTo( ";", true );
|
||||||
if ( stat.firstWord() != "" )
|
if ( !stat.firstWord().empty() )
|
||||||
craftStats.bestStatA = stat.atoi();
|
craftStats.bestStatA = stat.atoi();
|
||||||
else
|
else
|
||||||
craftStats.bestStatA = -1;
|
craftStats.bestStatA = -1;
|
||||||
|
|
||||||
stat = ligne.splitTo( ";", true );
|
stat = ligne.splitTo( ";", true );
|
||||||
if ( stat.firstWord() != "" )
|
if ( !stat.firstWord().empty() )
|
||||||
craftStats.worstStatA1 = stat.atoi();
|
craftStats.worstStatA1 = stat.atoi();
|
||||||
else
|
else
|
||||||
craftStats.worstStatA1 = -1;
|
craftStats.worstStatA1 = -1;
|
||||||
|
|
||||||
stat = ligne.splitTo( ";", true );
|
stat = ligne.splitTo( ";", true );
|
||||||
if ( stat.firstWord() != "" )
|
if ( !stat.firstWord().empty() )
|
||||||
craftStats.worstStatA2 = stat.atoi();
|
craftStats.worstStatA2 = stat.atoi();
|
||||||
else
|
else
|
||||||
craftStats.worstStatA2 = -1;
|
craftStats.worstStatA2 = -1;
|
||||||
|
|
||||||
stat = ligne.splitTo( ";", true );
|
stat = ligne.splitTo( ";", true );
|
||||||
if ( stat.firstWord() != "" )
|
if ( !stat.firstWord().empty() )
|
||||||
craftStats.bestStatB = stat.atoi();
|
craftStats.bestStatB = stat.atoi();
|
||||||
else
|
else
|
||||||
craftStats.bestStatB = -1;
|
craftStats.bestStatB = -1;
|
||||||
|
|
||||||
stat = ligne.splitTo( ";", true );
|
stat = ligne.splitTo( ";", true );
|
||||||
if ( stat.firstWord() != "" )
|
if ( !stat.firstWord().empty() )
|
||||||
craftStats.worstStatB1 = stat.atoi();
|
craftStats.worstStatB1 = stat.atoi();
|
||||||
else
|
else
|
||||||
craftStats.worstStatB1 = -1;
|
craftStats.worstStatB1 = -1;
|
||||||
|
|
||||||
stat = ligne.splitTo( ";", true );
|
stat = ligne.splitTo( ";", true );
|
||||||
if ( stat.firstWord() != "" )
|
if ( !stat.firstWord().empty() )
|
||||||
craftStats.worstStatB2 = stat.atoi();
|
craftStats.worstStatB2 = stat.atoi();
|
||||||
else
|
else
|
||||||
craftStats.worstStatB2 = -1;
|
craftStats.worstStatB2 = -1;
|
||||||
|
@ -1168,19 +1168,19 @@ void NewMP( CSString& ligne )
|
||||||
specialOnly = stat.firstWord().contains( "x" );
|
specialOnly = stat.firstWord().contains( "x" );
|
||||||
|
|
||||||
// cas particuliers
|
// cas particuliers
|
||||||
while ( ligne != "" )
|
while ( !ligne.empty() )
|
||||||
{
|
{
|
||||||
if ( !ligne.contains( ";" ) )
|
if ( !ligne.contains( ";" ) )
|
||||||
{
|
{
|
||||||
special = ligne;
|
special = ligne;
|
||||||
if ( special.firstWord() != "" )
|
if ( !special.firstWord().empty() )
|
||||||
specialNames.insert( special );
|
specialNames.insert( special );
|
||||||
ligne = "";
|
ligne = "";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
special = ligne.splitTo( ";", true );
|
special = ligne.splitTo( ";", true );
|
||||||
if ( special != "" )
|
if ( !special.empty() )
|
||||||
specialNames.insert( special );
|
specialNames.insert( special );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1357,7 +1357,7 @@ void LoadCustomizedProperties()
|
||||||
fileName = CPath::lookup( name, false, false, true );
|
fileName = CPath::lookup( name, false, false, true );
|
||||||
|
|
||||||
// on vérifie que le fichier concerné existe
|
// on vérifie que le fichier concerné existe
|
||||||
if ( fileName != "" )
|
if ( !fileName.empty() )
|
||||||
{
|
{
|
||||||
CSString zone = prop.splitTo( ".", true );
|
CSString zone = prop.splitTo( ".", true );
|
||||||
str.readFromFile( fileName );
|
str.readFromFile( fileName );
|
||||||
|
@ -1530,7 +1530,7 @@ void LoadFamillesMP()
|
||||||
|
|
||||||
ligne = fileData.splitTo( "\n", true );
|
ligne = fileData.splitTo( "\n", true );
|
||||||
|
|
||||||
while ( ligne != "" )
|
while ( !ligne.empty() )
|
||||||
{
|
{
|
||||||
NewMP( ligne );
|
NewMP( ligne );
|
||||||
ligne = fileData.splitTo( "\n", true );
|
ligne = fileData.splitTo( "\n", true );
|
||||||
|
|
|
@ -67,7 +67,7 @@ int verifItemsFile (const char *filename)
|
||||||
string s(buffer);
|
string s(buffer);
|
||||||
|
|
||||||
// null or comment
|
// null or comment
|
||||||
if (s == "" || s.find("//") == 0)
|
if (s.empty() || s.find("//") == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (s.find("_LocSlot") == string::npos)
|
if (s.find("_LocSlot") == string::npos)
|
||||||
|
@ -113,7 +113,7 @@ int verifCsvFile (const char *filename)
|
||||||
void processItemLine(const string &s)
|
void processItemLine(const string &s)
|
||||||
{
|
{
|
||||||
// null or comment
|
// null or comment
|
||||||
if (s == "" || s.find("//") == 0)
|
if (s.empty() || s.find("//") == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// other stuff
|
// other stuff
|
||||||
|
@ -176,7 +176,7 @@ int getFieldsFromFile(const char *filename)
|
||||||
s = s.strtok("\n");
|
s = s.strtok("\n");
|
||||||
|
|
||||||
// skip null or comment
|
// skip null or comment
|
||||||
if (s == "" || s.find("//") == 0)
|
if (s.empty() || s.find("//") == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// add the field
|
// add the field
|
||||||
|
@ -294,7 +294,7 @@ void getItemBounds(const CVectorSString &lines, uint num, uint &a, uint &b)
|
||||||
|
|
||||||
while (++i < lines.size() && !ok)
|
while (++i < lines.size() && !ok)
|
||||||
{
|
{
|
||||||
if (lines[i] == "" || lines[i].find("//") != string::npos)
|
if (lines[i].empty() || lines[i].find("//") != string::npos)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// get item number
|
// get item number
|
||||||
|
@ -404,7 +404,7 @@ void updateItemField(CVectorSString &lines, uint itemIndex, uint fieldIndex, uin
|
||||||
}
|
}
|
||||||
|
|
||||||
// param not found
|
// param not found
|
||||||
if (!found && val != "" && val != "nul")
|
if (!found && !val.empty() && val != "nul")
|
||||||
{
|
{
|
||||||
// add it
|
// add it
|
||||||
if (field.find("_CraftParameters") == string::npos)
|
if (field.find("_CraftParameters") == string::npos)
|
||||||
|
@ -552,7 +552,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
// load csv values
|
// load csv values
|
||||||
importCsv(csvFile.c_str());
|
importCsv(csvFile.c_str());
|
||||||
if (itemsFile != "" && CFile::isExists(itemsFile.c_str()))
|
if (!itemsFile.empty() && CFile::isExists(itemsFile.c_str()))
|
||||||
updateItems(itemsFile.c_str());
|
updateItems(itemsFile.c_str());
|
||||||
else
|
else
|
||||||
nlerror("Can't find file : %s", itemsFile.c_str());
|
nlerror("Can't find file : %s", itemsFile.c_str());
|
||||||
|
|
|
@ -216,7 +216,7 @@ void CDialogProperties::removeWidgets ()
|
||||||
else if (widget.Parameter.Type == CPrimitiveClass::CParameter::StringArray)
|
else if (widget.Parameter.Type == CPrimitiveClass::CParameter::StringArray)
|
||||||
{
|
{
|
||||||
widget.MultiLineEditBox.DestroyWindow ();
|
widget.MultiLineEditBox.DestroyWindow ();
|
||||||
if (widget.Parameter.Folder != "" || !widget.Parameter.FileExtension.empty())
|
if (!widget.Parameter.Folder.empty() || !widget.Parameter.FileExtension.empty())
|
||||||
{
|
{
|
||||||
widget.CheckBox.DestroyWindow ();
|
widget.CheckBox.DestroyWindow ();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue