tidy up fault code a bit
Summary
None
Purpose of change
Code i made in #74696 is... not good
Describe the solution
This tries to clean it up a bit, and also resolves the problem of function applying the first fault it finds instead of random one
Testing
I shoot a gun and was able to apply more than 1 type of fault
🤔 IDK the old code seemed pretty fine to me? The new code is almost strictly less efficient (although in practice it doesn't matter) and not really cleaner.
You could maybe make the random_fault_of_type a static helper in item.cpp
Does faults_potential_of_type have to return a set (can there be duplicate entries in type->faults), or can it be a vector which is generally cheaper?
it is cleaner in a sense that instead of calling faults:: and shoving both item and fault type, you instead call item and shove only fault type
I could, if i knew what static helper is and how to make it :)
No, it can return a vector, array of faults in item should not repeat