Prechádzať zdrojové kódy

BETA: Minor cleanup.

Zoey76 12 rokov pred
rodič
commit
88bb39ade3

+ 3 - 23
L2J_Server_BETA/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java

@@ -975,12 +975,7 @@ public final class L2PcInstance extends L2Playable
 		@Override
 		public void run()
 		{
-			if (L2PcInstance.this == null)
-			{
-				return;
-			}
-			
-			L2PcInstance.this.sendPacket(new ShortBuffStatusUpdate(0, 0, 0));
+			sendPacket(new ShortBuffStatusUpdate(0, 0, 0));
 			setShortBuffTaskSkillId(0);
 		}
 	}
@@ -14878,7 +14873,7 @@ public final class L2PcInstance extends L2Playable
 	
 	public void teleportBookmarkGo(int Id)
 	{
-		if (!teleportBookmarkCondition(0) || (this == null))
+		if (!teleportBookmarkCondition(0))
 		{
 			return;
 		}
@@ -14980,11 +14975,6 @@ public final class L2PcInstance extends L2Playable
 	
 	public void teleportBookmarkAdd(int x, int y, int z, int icon, String tag, String name)
 	{
-		if (this == null)
-		{
-			return;
-		}
-		
 		if (!teleportBookmarkCondition(1))
 		{
 			return;
@@ -15965,11 +15955,6 @@ public final class L2PcInstance extends L2Playable
 		@Override
 		public void run()
 		{
-			if (L2PcInstance.this == null)
-			{
-				// stopRecoGiveTask(); why is this here? it will lead to NPE
-				return;
-			}
 			int reco_to_give;
 			// 10 recommendations to give out after 2 hours of being logged in
 			// 1 more recommendation to give out every hour after that.
@@ -15998,12 +15983,7 @@ public final class L2PcInstance extends L2Playable
 		@Override
 		public void run()
 		{
-			if (L2PcInstance.this == null)
-			{
-				return;
-			}
-			
-			L2PcInstance.this.sendPacket(new ExVoteSystemInfo(L2PcInstance.this));
+			sendPacket(new ExVoteSystemInfo(L2PcInstance.this));
 		}
 	}
 	

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/MultiSellChoose.java

@@ -401,7 +401,7 @@ public class MultiSellChoose extends L2GameClientPacket
 								for (int i = 0; i < (e.getItemCount() * _amount); i++)
 								{
 									product = inv.addItem("Multisell", e.getItemId(), 1, player, player.getTarget());
-									if (list.getMaintainEnchantment())
+									if ((product != null) && list.getMaintainEnchantment())
 									{
 										if (i < augmentation.size())
 										{