Closed 4Luke4 closed 9 months ago
Actually, scratch that (the PATCH fails if you want to keep the existing value).
You should treat them as STR_VAR
(default value SAME
, like resource
).
However, you'll lose the ability to write numerical expressions (e.g. special = BIT30|BIT5
) unless you're willing to further tweak those functions with PATCH_REINCLUDE
.
Closing this one since the desired behavior can be easily achieved with GET_OFFSET_ARRAY.
Easily? 👀
I entirely gave up on doing it with WeiDU when I faced the issue of the negative number, and did a hand edited change to the file. A few weeks later I think an alternative function was posted (I think both DavidW and CamDawg have one, but that was some time ago...).
@CamDawg Pretty much what the title states.
As you know, there are a lot of opcodes whose
parameter1
can take negative values. On top of that, thespecial
field of some opcodes (e.g. Cast spell on condition whenparameter2 = 15
) can take negative values.As a result, these functions should be able to write negative values (at least when it comes to
parameter1
andspecial
). In order to do that, I suggest the following changes:parameter1
andspecial
should be initialized to"-2147483649"
(instead of"-1"
)When checking
parameter1
andspecial
, putPATCH_IF (special >= "-2147483648") // instead of PATCH_IF (special >= 0)