Catch InvalidPositionException in get_natural_light
This commit is contained in:
parent
685a78c18b
commit
aae3837222
@ -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
|
||||
// searched for because the value may not emanate from the sun
|
||||
try {
|
||||
if (daylight == n.param1 >> 4)
|
||||
daylight = env->findSunlight(pos);
|
||||
} catch (InvalidPositionException &e) {
|
||||
errorstream << "InvalidPositionException when getting natural light at "
|
||||
<< PP(pos) << std::endl;
|
||||
}
|
||||
|
||||
lua_pushinteger(L, dnr * daylight / 1000);
|
||||
return 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user