Catch InvalidPositionException in get_natural_light
This commit is contained in:
parent
b92aa05c33
commit
192f52f7c9
@ -440,8 +440,13 @@ int ModApiEnvMod::l_get_natural_light(lua_State *L)
|
|||||||
|
|
||||||
// If it's the same as the artificial light, the sunlight needs to be
|
// If it's the same as the artificial light, the sunlight needs to be
|
||||||
// searched for because the value may not emanate from the sun
|
// searched for because the value may not emanate from the sun
|
||||||
|
try {
|
||||||
if (daylight == n.param1 >> 4)
|
if (daylight == n.param1 >> 4)
|
||||||
daylight = env->findSunlight(pos);
|
daylight = env->findSunlight(pos);
|
||||||
|
} catch (InvalidPositionException &e) {
|
||||||
|
errorstream << "InvalidPositionException when getting natural light at "
|
||||||
|
<< PP(pos) << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
lua_pushinteger(L, dnr * daylight / 1000);
|
lua_pushinteger(L, dnr * daylight / 1000);
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user