WeiDU seems to skip random PATCH_IFs even if all the conditions match when doing COPY_EXISTING_REGEXP
This one to be exact (there are others as well but I debugged just this
)
PATCH_IF (("%type%" = 1) AND ("%amulet%" = 0) AND ("%ignore%" = 0) AND (("%flags%" BAND 0b00000100) = 0b00000100) AND ("%index%" > 17)) BEGIN
PATCH_PRINT ~%SOURCE_FILE%: Equippable items in inventory: %item%.itm! Equipping AMULET~
WRITE_SHORT ("%slot_off%" + (0x02 * "%index%")) 0xffff
WRITE_SHORT ("%slot_off%" + (0x02 * 6)) "ref"
SET "%amulet%" = 1
END ELSE
I added this line to output the values used in the condition
PATCH_PRINT ~%SOURCE_FILE%: = %item% - %type% - %amulet% - %ignore% - %flags% - %index%~
right above the condition.
Now when doing a COPY_EXISTING of the individual file, it seems to properly move the amulet
Copying and patching 1 file ...
CBELEDI1.CRE: = MINHP1 - 1 - 0 - 0 - 40 - 4
CBELEDI1.CRE: = CLCK20 - 32 - 0 - 0 - 108 - 21
CBELEDI1.CRE: Equippable items in inventory: CLCK20.itm! Equipping CLOAK
CBELEDI1.CRE: = WAND07 - 35 - 0 - 0 - 108 - 22
CBELEDI1.CRE: = AMUL21 - 1 - 0 - 0 - 108 - 23
CBELEDI1.CRE: Equippable items in inventory: AMUL21.itm! Equipping AMULET
CBELEDI1.CRE: = SCRL7J - 11 - 0 - 0 - 108 - 24
CBELEDI1.CRE: = SCRL6N - 11 - 0 - 0 - 108 - 25
Copied [CBELEDI1.CRE] to [override/CBELEDI1.CRE]
.. but in the regex copy, this happens...
CBDRWW23.CRE: = POTN02 - 9 - 1 - 0 - 108 - 27
Copied [CBDRWW23.CRE] to [override/CBDRWW23.CRE]
CBELEDI1.CRE: = MINHP1 - 1 - 0 - 0 - 40 - 4
CBELEDI1.CRE: = CLCK20 - 32 - 0 - 0 - 108 - 21
CBELEDI1.CRE: Equippable items in inventory: CLCK20.itm! Equipping CLOAK
CBELEDI1.CRE: = WAND07 - 35 - 0 - 0 - 108 - 22
CBELEDI1.CRE: = AMUL21 - 1 - 0 - 0 - 108 - 23
CBELEDI1.CRE: = SCRL7J - 11 - 0 - 0 - 108 - 24
CBELEDI1.CRE: = SCRL6N - 11 - 0 - 0 - 108 - 25
Copied [CBELEDI1.CRE] to [override/CBELEDI1.CRE]
CBELEDI2.CRE: = REGHP1 - 10 - 0 - 0 - 40 - 4
Note that the conditions for both cases are exactly identical, but the outcome seems to differ
The unmodified errant CRE, the .tp2 and both DEBUGs
attached here Sorry for the trouble and dragging you into all this