mirror of
https://github.com/luanti-org/luanti.git
synced 2025-11-30 20:53:45 +01:00
Limit light_source in the engine (#4814)
Since light_source>15 causes crash, it must be limited.
This commit is contained in:
@@ -482,6 +482,7 @@ void ContentFeatures::deSerialize(std::istream &is)
|
||||
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);
|
||||
@@ -1442,6 +1443,7 @@ void ContentFeatures::deSerializeOld(std::istream &is, int version)
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user