mirror of
https://github.com/minetest/minetest.git
synced 2025-07-01 07:30:23 +02:00
Limit light_source in the engine (#4814)
Since light_source>15 causes crash, it must be limited.
This commit is contained in:
@ -526,6 +526,12 @@ ContentFeatures read_content_features(lua_State *L, int index)
|
||||
// Amount of light the node emits
|
||||
f.light_source = getintfield_default(L, index,
|
||||
"light_source", f.light_source);
|
||||
if (f.light_source > LIGHT_MAX) {
|
||||
warningstream << "Node " << f.name.c_str()
|
||||
<< " had greater light_source than " << LIGHT_MAX
|
||||
<< ", it was reduced." << std::endl;
|
||||
f.light_source = LIGHT_MAX;
|
||||
}
|
||||
f.damage_per_second = getintfield_default(L, index,
|
||||
"damage_per_second", f.damage_per_second);
|
||||
|
||||
|
Reference in New Issue
Block a user