summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 7c7250617..5bd55e106 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -12611,16 +12611,14 @@ BUILDIN_FUNC(isequipped)
return 0;
}
- setitem_hash = sd->setitem_hash;
- setitem_hash2 = sd->setitem_hash2;
- for (i=0; id!=0; i++)
- {
+ setitem_hash = sd->bonus.setitem_hash;
+ setitem_hash2 = sd->bonus.setitem_hash2;
+ for (i=0; id!=0; i++) {
FETCH (i+2, id) else id = 0;
if (id <= 0)
continue;
flag = 0;
- for (j=0; j<EQI_MAX; j++)
- {
+ for (j=0; j<EQI_MAX; j++) {
index = sd->equip_index[j];
if(index < 0) continue;
if(j == EQI_HAND_R && sd->equip_index[EQI_HAND_L] == index) continue;
@@ -12648,16 +12646,16 @@ BUILDIN_FUNC(isequipped)
hash = 1<<((j<5?j:j-5)*4 + k);
// check if card is already used by another set
- if ((j<5?sd->setitem_hash:sd->setitem_hash2) & hash)
+ if ( ( j < 5 ? sd->bonus.setitem_hash : sd->bonus.setitem_hash2 ) & hash)
continue;
// We have found a match
flag = 1;
// Set hash so this card cannot be used by another
if (j<5)
- sd->setitem_hash |= hash;
+ sd->bonus.setitem_hash |= hash;
else
- sd->setitem_hash2 |= hash;
+ sd->bonus.setitem_hash2 |= hash;
break;
}
}
@@ -12669,10 +12667,9 @@ BUILDIN_FUNC(isequipped)
ret &= flag;
if (!ret) break;
}
- if (!ret)
- { //When check fails, restore original hash values. [Skotlex]
- sd->setitem_hash = setitem_hash;
- sd->setitem_hash2 = setitem_hash2;
+ if (!ret) {//When check fails, restore original hash values. [Skotlex]
+ sd->bonus.setitem_hash = setitem_hash;
+ sd->bonus.setitem_hash2 = setitem_hash2;
}
script_pushint(st,ret);
return 0;