MSUTeam / MSU

Modding Standards and Utilities for Battle Brothers
21 stars 4 forks source link

fix: costs preview not calling the original early enough #359

Closed LordMidas closed 3 months ago

LordMidas commented 3 months ago

The entire point of the switcheroo on JSHandle is so that the original function is called before our skill container event (onAffordablePreview) so that the values set by the original function happen before our event.

This is how it should have been in #313 and how it was in the first implementation of that PR. But in all the refactors switching to switcherooing the JSHandle, it got messed up. Here it is fixed now.

TaroEld commented 3 months ago

Uhm, you might want to test that system extensively, then. I haven't really paid attention in detail what you've been doing, but I'd rather not wreck vanilla.