Browse Source

Corrected autospell stacking (#4227)

* Resolves an issue with autospell bonuses stacking too generously.
Thanks to @Playtester!
Aleos 5 năm trước cách đây
mục cha
commit
32525bad55
1 tập tin đã thay đổi với 5 bổ sung7 xóa
  1. 5 7
      src/map/pc.cpp

+ 5 - 7
src/map/pc.cpp

@@ -2301,14 +2301,12 @@ static void pc_bonus_autospell(std::vector<s_autospell> &spell, short id, short
 			flag |= BF_NORMAL; //By default autospells should only trigger on normal weapon attacks.
 			flag |= BF_NORMAL; //By default autospells should only trigger on normal weapon attacks.
 	}
 	}
 
 
-	if (!battle_config.autospell_stacking && rate > 0) // Stacking disabled, make a new entry
-		;
-	else {
-		for (auto &it : spell) {
-			if ((it.card_id == card_id || it.rate < 0 || rate < 0) && it.id == id && it.lv == lv && it.flag == flag) {
-				it.rate = cap_value(it.rate + rate, -10000, 10000);
+	for (auto &it : spell) {
+		if ((it.card_id == card_id || it.rate < 0 || rate < 0) && it.id == id && it.lv == lv && it.flag == flag) {
+			if (!battle_config.autospell_stacking && it.rate > 0 && rate > 0) // Stacking disabled
 				return;
 				return;
-			}
+			it.rate = cap_value(it.rate + rate, -10000, 10000);
+			return;
 		}
 		}
 	}
 	}