Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
About the PR
In an effort to reduce the complexity of materials code, now that materials are largely shared:
-getProperty can no longer mass the max/min of the property instead of the current value, because nothing ever used it (why would they)
-Removed default, min and max values from material properties. The first was unused and the latter weren't ever anything other than 1 and 100, so those values have been baked into setProperty
-The material properties cache is now associative by id (["hard"] = /datum/material_property/hardness)
-The properties var on material datums is now and associative list of id and value (["hard"] = value), no more material_property datums in there
-removed unused value var from materials (ore pricing is done through commodities and not mats themselves)
Why's this needed?
Much of this code is set up for mutable materials, which we're not supporting so we may as well reduce it
Although AFAIK materials getters/setters aren't a bottleneck, there's a bunch less looping involved now.
Getting stats out of a material was weirdly involved too. It should be more straightforward.
material_property datums are singletons so there's not really a point in materials keeping references to them (and certainly not in the confusing way they did)
The new code will probably break if you misspell any property id though
Changelog