acemod / ACE-Anvil

Open-source realism mod for Arma Reforger
https://anvil.acemod.org
GNU General Public License v2.0
39 stars 19 forks source link

Medical - Refactoring #73

Open MichaelJRM opened 5 months ago

MichaelJRM commented 5 months ago

Refactored the code.

Taken from #72

MichaelJRM commented 5 months ago

I would consider removing SCR_BandageUserAction.c as refactoring since it doesn't solve the issue it was purposed to solve; in fact, it's only adding an additional check on top of the current one.

MichaelJRM commented 5 months ago

Having the prefix helps maintainability as it is much easier to find what you're looking for. If I want to go to the modded version I can just type Prefix_****, without the prefix it will take me to the vanilla code and that is annoying.

Kexanone commented 5 months ago

I would consider removing SCR_BandageUserAction.c as refactoring since it doesn't solve the issue it was purposed to solve; in fact, it's only adding an additional check on top of the current one.

I agree that reverting the approach for detecting, if a bandage can be applied, is refactoring, but that's not all it does. The actual behavioral change is whether the check is done in CanBePerformedScript or CanBeShownScript. So if you want to do this, just make sure that the check is still done in CanBePerformedScript.

Having the prefix helps maintainability as it is much easier to find what you're looking for. If I want to go to the modded version I can just type Prefix_****, without the prefix it will take me to the vanilla code and that is annoying.

I don't see your issue. One version is in ACE_Medical, the other isn't. Besides in practice, one would usually search for classes and methods via the symbol search anyway and the modded one is always the second entry. The file names should match the class they contain for consistency.