/* f10
Sanitizes the current SPL or ITM resource. If the resource is corrupt,
this function will attempt to repair it. This can entail resolving
overlapping ability effects and removal of junk data.
It ensures that abilities precede effects and that global effects
precede ability effects.
This function does not perform any type checks. The user must
take care to only run it on appropriate resources with appropriate
arguments.
Arguments:
- abilLen the length in bytes of the resource's abilities.
ITM resources have an ability length of 0x38 (56)
SPL resources have an ability length of 0x28 (40)
Return values:
- ok A value of 1 signifies that the resource can be
safely edited. A value of 0 means that the resource
is not in a recoverable format and should not be
edited.
*/
DEFINE_PATCH_FUNCTION SANITIZE_ITM_OR_SPL
Whatever it is, when I install only Golems and this mod (for example the component "2060 Standardize Poison Immunity", it fails like this
Installing [Standardize Poison Immunity] [1.7]
Copying and patching 1845 files ...
Copying and patching 2966 files ...
DELETE_BYTES out of bounds - file is long 1314, point given is 1986, bytes were 0
ERROR: [A7!EQMA.ITM] -> [override/A7!EQMA.ITM] Patching Failed (COPY) (Failure("DELETE_BYTES out of bounds"))
Stopping installation because of error.
Stopping installation because of error.
ERROR Installing [Standardize Poison Immunity], rolling back to previous state
Will uninstall 20 files for [klatu/setup-klatu.tp2] component 2060.
Uninstalled 20 files for [klatu/setup-klatu.tp2] component 2060.
ERROR: Failure("DELETE_BYTES out of bounds")
In a bigger (dozen mods) EET install, I only have 2 items with the same failure (A7!EQMA.ITM was the easiest one to identify the provenance of ;) )
Now, I checked the item in NI and the value "Abilities offset" (had to read from ITM description for 0x64=100 in IESDP) has the value 0x7c2 = 1986. It also show "# abilities" = 0 so I guess there are none?
Is the bug in Golem or klatu? (as klatu's author seems inactive, I came here first)
Other items with no abilities (for ex. A7!EQIC.ITM) have the 0x72 value.
Could 0x7c2 be a typo ?