Fixed: Crash in lua getWeatherValue() when continent was not loaded
--HG-- branch : develop
This commit is contained in:
parent
6c1d44bc51
commit
ec9a0e6d38
1 changed files with 7 additions and 1 deletions
|
@ -1688,7 +1688,13 @@ int CLuaIHMRyzom::getWeatherValue(CLuaState &ls)
|
||||||
CLuaIHM::checkArgCount(ls, funcName, 0);
|
CLuaIHM::checkArgCount(ls, funcName, 0);
|
||||||
uint64 currDay = RT.getRyzomDay();
|
uint64 currDay = RT.getRyzomDay();
|
||||||
float currHour = (float) RT.getRyzomTime();
|
float currHour = (float) RT.getRyzomTime();
|
||||||
ls.push(::getBlendedWeather(currDay, currHour, *WeatherFunctionParams, ContinentMngr.cur()->WeatherFunction));
|
float weather = 0.f;
|
||||||
|
if (ContinentMngr.cur())
|
||||||
|
{
|
||||||
|
weather = ::getBlendedWeather(currDay, currHour, *WeatherFunctionParams, ContinentMngr.cur()->WeatherFunction);
|
||||||
|
}
|
||||||
|
|
||||||
|
ls.push(weather);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue