Răsfoiți Sursa

Little corrections to a previous code cleaning patch. Thanks Kombat.

Sami 16 ani în urmă
părinte
comite
43741f69fe

+ 4 - 2
L2_GameServer/java/net/sf/l2j/gameserver/model/L2Character.java

@@ -3469,6 +3469,7 @@ public abstract class L2Character extends L2Object
 
 		FastList<Stats> modifiedStats = null;
 		
+		int i = 0;
 		// Go through the Calculator set
 		synchronized(_calculators)
 		{
@@ -3483,14 +3484,15 @@ public abstract class L2Character extends L2Object
 						modifiedStats = calc.removeOwner(owner);
 
 					if (calc.size() == 0)
-						calc = null;
+						_calculators[i] = null;
 				}
+				i++;
 			}
 
 			// If possible, free the memory and just create a link on NPC_STD_CALCULATOR
 			if (this instanceof L2NpcInstance)
 			{
-				int i = 0;
+				i = 0;
 				for (; i < Stats.NUM_STATS; i++)
 				{
 					if (!Calculator.equalsCals(_calculators[i], NPC_STD_CALCULATOR[i]))

+ 12 - 12
L2_GameServer/java/net/sf/l2j/gameserver/model/entity/Castle.java

@@ -1201,9 +1201,9 @@ public class Castle
 				if (values.length > 0)
 				{
 					query += values[0];
-					for (String value: values)
+					for (int i = 1; i < values.length; i++)
 					{
-						query += "," + value;
+						query += "," + values[i];
 					}
 					statement = con.prepareStatement(query);
 					statement.execute();
@@ -1223,9 +1223,9 @@ public class Castle
 				if (values.length > 0)
 				{
 					query += values[0];
-					for (String value: values)
+					for (int i = 1; i < values.length; i++)
 					{
-						query += "," + value;
+						query += "," + values[i];
 					}
 					statement = con.prepareStatement(query);
 					statement.execute();
@@ -1279,9 +1279,9 @@ public class Castle
 				if (values.length > 0)
 				{
 					query += values[0];
-					for (String value: values)
+					for (int i = 1; i < values.length; i++)
 					{
-						query += "," + value;
+						query += "," + values[i];
 					}
 					statement = con.prepareStatement(query);
 					statement.execute();
@@ -1330,9 +1330,9 @@ public class Castle
 				if (values.length > 0)
 				{
 					query += values[0];
-					for (String value: values)
+					for (int i = 1; i < values.length; i++)
 					{
-						query += "," + value;
+						query += "," + values[i];
 					}
 					statement = con.prepareStatement(query);
 					statement.execute();
@@ -1351,9 +1351,9 @@ public class Castle
 				if (values.length > 0)
 				{
 					query += values[0];
-					for (String value: values)
+					for (int i = 1; i < values.length; i++)
 					{
-						query += "," + value;
+						query += "," + values[i];
 					}
 					statement = con.prepareStatement(query);
 					statement.execute();
@@ -1408,9 +1408,9 @@ public class Castle
 				if (values.length > 0)
 				{
 					query += values[0];
-					for (String value: values)
+					for (int i = 1; i < values.length; i++)
 					{
-						query += "," + value;
+						query += "," + values[i];
 					}
 					statement = con.prepareStatement(query);
 					statement.execute();