The internal function op182 uses to find the item, CGameSprite::FindItemPersonal(), treats the found slot index as a boolean, so it always applies the specified EFF unless the ITM is in SLOT_AMULET.
Basically, since all slot indices but SLOT_AMULET are strictly greater than 0, the function will almost always return true, making the opcode useless.
This PR corrects what the engine considers a "fail" return value from CGameSprite::FindItemPersonal(). It originally, and erroneously considered 0 (SLOT_AMULET) the fail condition; it now properly considers -1 to be a failure.
The internal function
op182
uses to find the item,CGameSprite::FindItemPersonal()
, treats the found slot index as a boolean, so it always applies the specifiedEFF
unless theITM
is inSLOT_AMULET
.SLOT_AMULET
are strictly greater than0
, the function will almost always return true, making the opcode useless.This PR corrects what the engine considers a "fail" return value from
CGameSprite::FindItemPersonal()
. It originally, and erroneously considered0
(SLOT_AMULET
) the fail condition; it now properly considers-1
to be a failure.