mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-29 23:25:59 +00:00
Merge with develop
This commit is contained in:
parent
ad11c4c4ce
commit
8d905df095
2 changed files with 19 additions and 12 deletions
|
@ -253,7 +253,15 @@ inline lua_Integer CLuaState::toInteger(int index)
|
|||
{
|
||||
//H_AUTO(Lua_CLuaState_toInteger)
|
||||
checkIndex(index);
|
||||
return lua_tointeger(_State, index);
|
||||
sint isnum = 0;
|
||||
lua_Integer res = lua_tointegerx(_State, index, &isnum);
|
||||
if (!isnum)
|
||||
{
|
||||
lua_Number d = lua_tonumber(_State, index);
|
||||
nlwarning("Lua: Unable to convert Lua number %lf to integer", d);
|
||||
res = (lua_Integer)d;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
|
|
|
@ -345,21 +345,20 @@ void CLoginProgressPostThread::init(NLMISC::CConfigFile &configFile)
|
|||
static std::string::size_type httpStrSize = httpStr.size();
|
||||
std::string tmp = configFile.getVarPtr("InstallStatsUrl")->asString(0);
|
||||
std::string::size_type it= tmp.find(httpStr);
|
||||
if (it != std::string::npos)
|
||||
{
|
||||
if (it == std::string::npos) return;
|
||||
|
||||
std::string::size_type hostPageSeparator = tmp.find("/", httpStrSize);
|
||||
if (hostPageSeparator != std::string::npos)
|
||||
{
|
||||
if (hostPageSeparator == std::string::npos) return;
|
||||
|
||||
installStartupPage = tmp.substr(hostPageSeparator); //keep the leading slash
|
||||
installStartupHost = tmp.substr(httpStrSize, hostPageSeparator - httpStrSize); // dont keep the last slah
|
||||
}
|
||||
}
|
||||
|
||||
init(installStartupHost, installStartupPage);
|
||||
}
|
||||
else
|
||||
{
|
||||
nlwarning("Error the InstallStatsUrl is not in the client_default.cfg.");
|
||||
// nlwarning("Error the InstallStatsUrl is not in the client_default.cfg.");
|
||||
}
|
||||
init(installStartupHost, installStartupPage);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue