1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-14 17:15:21 +02:00

Make range of tools configureable

This commit is contained in:
PilzAdam
2013-07-20 14:50:19 +02:00
committed by RealBadAngel
parent d19c8b815d
commit cba90d4441
5 changed files with 14 additions and 2 deletions

View File

@@ -76,6 +76,7 @@ ItemDefinition& ItemDefinition::operator=(const ItemDefinition &def)
groups = def.groups;
node_placement_prediction = def.node_placement_prediction;
sound_place = def.sound_place;
range = def.range;
return *this;
}
@@ -109,6 +110,7 @@ void ItemDefinition::reset()
}
groups.clear();
sound_place = SimpleSoundSpec();
range = -1;
node_placement_prediction = "";
}
@@ -146,6 +148,7 @@ void ItemDefinition::serialize(std::ostream &os, u16 protocol_version) const
//serializeSimpleSoundSpec(sound_place, os);
os<<serializeString(sound_place.name);
writeF1000(os, sound_place.gain);
writeF1000(os, range);
}
}
@@ -198,7 +201,7 @@ void ItemDefinition::deSerialize(std::istream &is)
// If you add anything here, insert it primarily inside the try-catch
// block to not need to increase the version.
try{
range = readF1000(is);
}catch(SerializationError &e) {};
}