Adjusted script command isequipped
* Fixes #4366. * Script command isequipped will no longer store the hashed card search onto the player. Thanks to @sader1992!
This commit is contained in:
parent
df6385fd4a
commit
81ce54685b
@ -497,7 +497,6 @@ struct map_session_data {
|
||||
int speed_rate, speed_add_rate, aspd_add;
|
||||
int itemhealrate2; // [Epoque] Increase heal rate of all healing items.
|
||||
int shieldmdef;//royal guard's
|
||||
unsigned int setitem_hash, setitem_hash2; //Split in 2 because shift operations only work on int ranges. [Skotlex]
|
||||
|
||||
short splash_range, splash_add_range;
|
||||
short add_steal_rate;
|
||||
|
@ -15427,7 +15427,6 @@ BUILDIN_FUNC(isequipped)
|
||||
TBL_PC *sd;
|
||||
int i, id = 1;
|
||||
int ret = -1;
|
||||
//Original hash to reverse it when full check fails.
|
||||
unsigned int setitem_hash = 0, setitem_hash2 = 0;
|
||||
|
||||
if (!script_rid2sd(sd)) { //If the player is not attached it is a script error anyway... but better prevent the map server from crashing...
|
||||
@ -15435,8 +15434,6 @@ BUILDIN_FUNC(isequipped)
|
||||
return SCRIPT_CMD_SUCCESS;
|
||||
}
|
||||
|
||||
setitem_hash = sd->bonus.setitem_hash;
|
||||
setitem_hash2 = sd->bonus.setitem_hash2;
|
||||
for (i=0; id!=0; i++) {
|
||||
int flag = 0;
|
||||
short j;
|
||||
@ -15472,16 +15469,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->bonus.setitem_hash : sd->bonus.setitem_hash2 ) & hash)
|
||||
if ( ( j < 5 ? setitem_hash : 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->bonus.setitem_hash |= hash;
|
||||
setitem_hash |= hash;
|
||||
else
|
||||
sd->bonus.setitem_hash2 |= hash;
|
||||
setitem_hash2 |= hash;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -15493,10 +15490,7 @@ BUILDIN_FUNC(isequipped)
|
||||
ret &= flag;
|
||||
if (!ret) break;
|
||||
}
|
||||
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 SCRIPT_CMD_SUCCESS;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user