Changed: Used INVALID_AI_INSTANCE in CUsedContinent::getInstanceForContinent

--HG--
branch : hotfix
This commit is contained in:
kervala 2015-02-14 13:03:27 +01:00
parent ee7008ae02
commit 76e64fcb42
4 changed files with 7 additions and 7 deletions

View file

@ -577,10 +577,10 @@ NLMISC_COMMAND(createStaticAIInstance, "Create a new static AIInstance for a giv
CUsedContinent &uc = CUsedContinent::instance();
const uint32 in = uc.getInstanceForContinent(args[0]);
if (in == ~0)
if (in == INVALID_AI_INSTANCE)
{
nlwarning("The continent '%s' is unknow or not active. Can't create instance, FATAL", args[0].c_str());
nlassert(in != ~0);
nlassert(in != INVALID_AI_INSTANCE);
// nlassertex(in != ~0, ("The continent '%s' is unknow or not active. Can't create instance, FATAL", args[0].c_str()));
}

View file

@ -4176,7 +4176,7 @@ NLMISC_COMMAND(loadMap,"load a complete set of primitive files","<map name>")
// check that the continent is active
CUsedContinent &uc = CUsedContinent::instance();
uint32 in = uc.getInstanceForContinent(continentName);
if (in == ~0)
if (in == INVALID_AI_INSTANCE)
{
log.displayNL("loadMap : while loading map '%s', can't load primitive '%s' coz continent '%s' is not active",
args[0].c_str(),
@ -4216,7 +4216,7 @@ NLMISC_COMMAND(unloadMap,"unload a complete set of primitive files","<map name>"
// check that the continent is active
CUsedContinent &uc = CUsedContinent::instance();
uint32 in = uc.getInstanceForContinent(continentName);
if (in == ~0)
if (in == INVALID_AI_INSTANCE)
{
log.displayNL("unloadMap : while loading map '%s', can't load primitive '%s' coz continent '%s' is not active",
args[0].c_str(),

View file

@ -420,7 +420,7 @@ bool getAIInstanceFromGroupName(string& groupName, uint32& instanceNumber)
{
string continent = groupName.substr(0, groupName.find('@'));
uint32 nr = CUsedContinent::instance().getInstanceForContinent(continent);
if (nr == ~0)
if (nr == INVALID_AI_INSTANCE)
{
return false;
}

View file

@ -106,7 +106,7 @@ uint32 CUsedContinent::getInstanceForContinent(const std::string &continentName)
if (it != _Continents.end())
return it->ContinentInstance;
else
return ~0;
return INVALID_AI_INSTANCE;
}
uint32 CUsedContinent::getInstanceForContinent(CONTINENT::TContinent continentEnum) const
@ -116,7 +116,7 @@ uint32 CUsedContinent::getInstanceForContinent(CONTINENT::TContinent continentEn
if (it != _Continents.end())
return it->ContinentInstance;
else
return ~0;
return INVALID_AI_INSTANCE;
}
const std::string &CUsedContinent::getContinentForInstance(uint32 instanceNumber) const