浏览代码

Adjusted script command isequipped
* Fixes #4366.
* Script command isequipped will no longer store the hashed card search onto the player.
Thanks to @sader1992!

aleos89 5 年之前
父节点
当前提交
81ce54685b
共有 2 个文件被更改,包括 4 次插入11 次删除
  1. 0 1
      src/map/pc.hpp
  2. 4 10
      src/map/script.cpp

+ 0 - 1
src/map/pc.hpp

@@ -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;

+ 4 - 10
src/map/script.cpp

@@ -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;
 }