From 993830a5063b8d2af4240ea5bf1c06dfa4f66b7d Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Mon, 31 Mar 2014 10:13:41 -0700 Subject: Check the equip index array --- src/map/magic-expr.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/map/magic-expr.cpp') diff --git a/src/map/magic-expr.cpp b/src/map/magic-expr.cpp index 1881afc..d05f713 100644 --- a/src/map/magic-expr.cpp +++ b/src/map/magic-expr.cpp @@ -830,13 +830,14 @@ int fun_is_equipped(dumb_ptr, val_t *result, Slice args) return 1; for (EQUIP i : EQUIPs) - if (chr->equip_index[i] >= 0 - && chr->status.inventory[chr->equip_index[i]].nameid == - item.nameid) + { + int idx = chr->equip_index_maybe[i]; + if (idx >= 0 && chr->status.inventory[idx].nameid == item.nameid) { retval = true; break; } + } RESULTINT = retval; return 0; -- cgit v1.2.3-60-g2f50