Since light_source>15 causes crash, it must be limited.
liquid_viscosity = readU8(is);
liquid_renewable = readU8(is);
light_source = readU8(is);
+ light_source = MYMIN(light_source, LIGHT_MAX);
damage_per_second = readU32(is);
node_box.deSerialize(is);
selection_box.deSerialize(is);
liquid_alternative_source = deSerializeString(is);
liquid_viscosity = readU8(is);
light_source = readU8(is);
+ light_source = MYMIN(light_source, LIGHT_MAX);
damage_per_second = readU32(is);
node_box.deSerialize(is);
selection_box.deSerialize(is);
// 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);
const mapblock_v3 &block_pos, MapBlock *block,
direction source_dir)
{
+ assert(light <= LIGHT_SUN);
lights[light].push_back(
ChangingLight(rel_pos, block_pos, block, source_dir));
}