Code: Select all
class LADCharacterMenu : GenericMenu
{
override bool MenuEvent (int mkey, bool fromcontroller)
{
case MKEY_Enter:
// find which slot this item is in
let itemPtr = sia.items[currentSelection];
int slot = character.myItems.Find(itemPtr); // error
Why is this blocked? Finding something in an array should be safe because you're not writing any data?
EDIT: I mean, I can still do a manual search by doing a for loop and checking for the pointer directly before breaking the loop, and getting the loop index from there, but that's just inconvenience, makes the code look more bloated than it really needs to be, and it still works between scopes anyway so what's the point of blocking Find() is what I'm saying?