mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-17 13:01:42 +00:00
merged with compatibility-develop
This commit is contained in:
parent
db771f1d2b
commit
095bc1b04c
15 changed files with 102 additions and 102 deletions
|
@ -131,20 +131,20 @@ public:
|
|||
CRyzomTime()
|
||||
{
|
||||
_RyzomDay = 0;
|
||||
_RyzomTime = 0;
|
||||
_RyzomTime = 0.f;
|
||||
_LocalTime = 0.0;
|
||||
_TickOffset = 0;
|
||||
}
|
||||
|
||||
// Update ryzom clock when tick occurs, local time must be given if localUpdateRyzomClock() and getLocalRyzomTime() is used
|
||||
void updateRyzomClock( uint32 gameCyle, double localTime = 0 )
|
||||
{
|
||||
float time = ( gameCyle + _TickOffset ) / float(RYZOM_HOURS_IN_TICKS);
|
||||
_RyzomDay = (uint32) ( time / RYZOM_DAY_IN_HOUR ) - RYZOM_START_SPRING;
|
||||
_RyzomTime = (float) fmod( time, RYZOM_DAY_IN_HOUR );
|
||||
float hours = ( gameCyle + _TickOffset ) / float(RYZOM_HOURS_IN_TICKS);
|
||||
_RyzomDay = ( (uint)hours / RYZOM_DAY_IN_HOUR ) - RYZOM_START_SPRING;
|
||||
_RyzomTime = (float) fmod( hours, (float)RYZOM_DAY_IN_HOUR );
|
||||
_LocalTime = localTime;
|
||||
}
|
||||
|
||||
|
||||
// get ryzom time (synchronized with server)
|
||||
inline float getRyzomTime() const { return _RyzomTime; }
|
||||
|
||||
|
|
|
@ -1686,7 +1686,9 @@ NLMISC_COMMAND(getDatasetId,"get datasetid of bots with name matchiong the given
|
|||
FOREACH(itBot, vector<CBot*>, bots)
|
||||
{
|
||||
CBot* bot = *itBot;
|
||||
DatasetIds += bot->getSpawnObj()->dataSetRow().toString()+"|";
|
||||
CSpawnBot* spawnBot = bot->getSpawnObj();
|
||||
if (spawnBot!=NULL)
|
||||
DatasetIds += spawnBot->dataSetRow().toString()+"|";
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -376,17 +376,16 @@ inline
|
|||
float CStateInstance::getNelVar(std::string const& varId)
|
||||
{
|
||||
TNelVarList::iterator it = _NelVar.find(varId);
|
||||
if (it==_NelVar.end())
|
||||
if (it != _NelVar.end()) return it->second->get();
|
||||
|
||||
if (NLMISC::CVariable<float>::exists(varId))
|
||||
{
|
||||
if (NLMISC::CVariable<float>::exists(varId))
|
||||
{
|
||||
nlwarning("Nel variable \"%s\" exists outside of this state instance", varId.c_str());
|
||||
return 0.f;
|
||||
}
|
||||
_NelVar[varId] = new NLMISC::CVariable<float>("StateInstance", varId.c_str(), "", 0.f);
|
||||
_NelVar[varId]->get();
|
||||
nlwarning("Nel variable \"%s\" exists outside of this state instance", varId.c_str());
|
||||
return 0.f;
|
||||
}
|
||||
return it->second->get();
|
||||
|
||||
_NelVar[varId] = new NLMISC::CVariable<float>("StateInstance", varId.c_str(), "", 0.f);
|
||||
return _NelVar[varId]->get();
|
||||
}
|
||||
|
||||
inline
|
||||
|
@ -424,17 +423,16 @@ inline
|
|||
std::string CStateInstance::getStrNelVar(std::string const& varId)
|
||||
{
|
||||
TStrNelVarList::iterator it = _StrNelVar.find(varId);
|
||||
if (it==_StrNelVar.end())
|
||||
if (it != _StrNelVar.end()) return it->second->get();
|
||||
|
||||
if (NLMISC::CVariable<float>::exists(varId))
|
||||
{
|
||||
if (NLMISC::CVariable<float>::exists(varId))
|
||||
{
|
||||
nlwarning("Nel variable \"%s\" exists outside of this state instance", varId.c_str());
|
||||
return "";
|
||||
}
|
||||
_StrNelVar[varId] = new NLMISC::CVariable<std::string>("StateInstanceVar", varId.c_str(), "", std::string());
|
||||
_NelVar[varId]->get();
|
||||
nlwarning("Nel variable \"%s\" exists outside of this state instance", varId.c_str());
|
||||
return "";
|
||||
}
|
||||
return it->second->get();
|
||||
|
||||
_StrNelVar[varId] = new NLMISC::CVariable<std::string>("StateInstanceStrVar", varId.c_str(), "", std::string());
|
||||
return _StrNelVar[varId]->get();
|
||||
}
|
||||
|
||||
inline
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue