vgstation-coders / vgstation13

Butts
GNU General Public License v3.0
260 stars 541 forks source link

Fixes mythril coins recycling but giving no mythril. #36672

Closed Eneocho closed 1 week ago

Eneocho commented 3 weeks ago

Turns out the recycling proc checks for the material type, and it expects a MAT_IRON style define, but since mythril had the material type defined as is, it failed. Of note is that Adamantine coins, Pomfcoins and Pumfcoins still fail and spit out a warning, but adamantine isn't defined as a recyclable material at all, and pomf/pumfcoins are their own thing. image

What this does

Fixes mythril coins recycling but giving zero material.

Why it's good

Fixes an oversight.

How it was tested

Spawned a couple mythril coins, recycled them, then made some coins with the press, recycled them, both work as intended. :cl:

Inorien commented 3 weeks ago

Unknown material pomf!

Eneocho commented 3 weeks ago

The proc that adds the materials calls for the material type, but material type is also used here to separate coins into their respective types when stacking inside a coin bag, so if you have 40 gold coins and 60 silver coins, the system knows to have 2 sets, one of 40 gold, and one of 60 silver. If you spawn any one coin, it checks the materials and sets with which coin type it'd get stacked, then uses that material type to the material to the coin, so a gold coin recycles into gold. Issue is that Adamantine, Pomf and Pumf have their name as the material, instead of a MAT_ADAMNTINE/MAT_POMF/MAT_PUMF, so the system fails. A solution for pomf and pumf would be adding an exception to the mat spawner proc and add a manual list of materials for them (500 sheets of phazon, diamond and mythril for recycling a pomfcoin, for example (makes sense since it's supposed to be god's coin); 500 sheets of cardboard for a pumfcoin (it's kinda shit)), but no such luck with adamantine, it's not defined as a resource, only as a sheet and a coin.