Hello Doctor,
I was debugging an issue with a component from another mod and did a changelog of a ring and noticed that it had been modified by IWO: Aesthetic & Enchantment Tweaks, which made no sense to me since looking at the code I saw that only items with enchantments 1, 2, 4 or 6 were to be modified...
So, the culprit is the function that starts at line 903 of 101_IWO_enchantments.tpa which is missing a 'BUT_ONLY' (the "hardcore" variant has the same problem).
Not a big deal, but.. (2k files less, approximately, in the backup folder after this change)
Also, I wonder if these functions could be written more efficiently:
Actual code:
COPY_EXISTING_REGEXP GLOB ~.*\.itm~ ~override~
PATCH_IF (SOURCE_SIZE > 0x71) BEGIN
READ_LONG 0x60 enchantment
PATCH_IF (enchantment = 1) BEGIN
WRITE_LONG 0x60 3
END
END
BUT_ONLY
COPY_EXISTING_REGEXP GLOB ~.*\.itm~ ~override~
PATCH_IF (SOURCE_SIZE > 0x71) BEGIN
READ_LONG 0x60 enchantment
PATCH_IF (enchantment = 2) BEGIN
WRITE_LONG 0x60 3
END
END
BUT_ONLY
COPY_EXISTING_REGEXP GLOB ~.*\.itm~ ~override~
PATCH_IF (SOURCE_SIZE > 0x71) BEGIN
READ_LONG 0x60 enchantment
PATCH_IF (enchantment = 4) BEGIN
WRITE_LONG 0x60 3
END
END
BUT_ONLY
COPY_EXISTING_REGEXP GLOB ~.*\.itm~ ~override~
PATCH_IF (SOURCE_SIZE > 0x71) BEGIN
READ_LONG 0x60 enchantment
PATCH_IF (enchantment = 6) BEGIN
WRITE_LONG 0x60 5
END
END
BUT_ONLY
Suggested:
COPY_EXISTING_REGEXP GLOB ~.*\.itm~ ~override~
PATCH_IF (SOURCE_SIZE > 0x71) BEGIN
READ_LONG 0x60 enchantment
PATCH_IF ((enchantment = 1) OR (enchantment = 2) OR (enchantment = 4)) BEGIN
WRITE_LONG 0x60 3
END ELSE
PATCH_IF (enchantment = 6) BEGIN
WRITE_LONG 0x60 5
END
END
BUT_ONLY
So all items are iterated just once.
Lastly, it would be great and would look better if penalties were omitted from item descriptions when those are zero, for example: "Dexterity penalty: -0" or "Arcane Casting Speed Penalty: +0".
Thank you.