Closed salix5 closed 1 year ago
The ATK, DEF are int32, but the max of damage is 0xffff.
The recover may cause overflow.
Now amount is put in arg3, and it is int32.
amount
arg3
Now the recover is capped at
int32 limit = INT32_MAX - player[playerid].lp;
If amount > limit, the system will:
limit
EVENT_RECOVER
Problem
The ATK, DEF are int32, but the max of damage is 0xffff.
The recover may cause overflow.
Solution
Now
amount
is put inarg3
, and it is int32.Now the recover is capped at
If
amount
>limit
, the system will:limit
LPEVENT_RECOVER
withamount