Index: /binary-improvements/AllocsCommands/AllocsCommands.csproj
===================================================================
--- /binary-improvements/AllocsCommands/AllocsCommands.csproj	(revision 289)
+++ /binary-improvements/AllocsCommands/AllocsCommands.csproj	(revision 290)
@@ -49,12 +49,7 @@
     <Compile Include="Commands\SayToPlayer.cs" />
     <Compile Include="Commands\ShowInventory.cs" />
-    <Compile Include="Commands\TeleportPlayer.cs" />
     <Compile Include="PrivateMessageConnections.cs" />
     <Compile Include="Chat.cs" />
     <Compile Include="Commands\ListItems.cs" />
-    <Compile Include="Commands\ExportItemIcons.cs" />
-    <Compile Include="Commands\BuffPlayer.cs" />
-    <Compile Include="Commands\DebuffPlayer.cs" />
-    <Compile Include="Commands\RepairChunkDensity.cs" />
   </ItemGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
Index: nary-improvements/AllocsCommands/Commands/BuffPlayer.cs
===================================================================
--- /binary-improvements/AllocsCommands/Commands/BuffPlayer.cs	(revision 289)
+++ 	(revision )
@@ -1,45 +1,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace AllocsFixes.CustomCommands
-{
-	public class BuffPlayer : ConsoleCmdAbstract
-	{
-		public override string GetDescription ()
-		{
-			return "Apply a buff to a player";
-		}
-
-		public override string GetHelp () {
-			return "Usage:\n" +
-				   "   buffplayer <player name / steam id / entity id> <buff name>\n" +
-				   "Apply the given buff to the player given by the player name or entity id (as given by e.g. \"lpi\").";
-		}
-
-		public override string[] GetCommands ()
-		{
-			return new string[] { "buffplayer" };
-		}
-
-		public override void Execute (List<string> _params, CommandSenderInfo _senderInfo)
-		{
-			try {
-				if (_params.Count != 2) {
-					SdtdConsole.Instance.Output ("Invalid arguments");
-					return;
-				}
-
-				string buff = _params [1];
-
-				ClientInfo receiver = ConsoleHelper.ParseParamIdOrName (_params [0]);
-				if (receiver != null) {
-					receiver.SendPackage (new NetPackageConsoleCmdClient ("buff " + buff, true));
-				} else {
-					SdtdConsole.Instance.Output ("Playername or entity ID not found.");
-				}
-			} catch (Exception e) {
-				Log.Out ("Error in BuffPlayer.Run: " + e);
-			}
-		}
-	}
-}
Index: nary-improvements/AllocsCommands/Commands/DebuffPlayer.cs
===================================================================
--- /binary-improvements/AllocsCommands/Commands/DebuffPlayer.cs	(revision 289)
+++ 	(revision )
@@ -1,45 +1,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace AllocsFixes.CustomCommands
-{
-	public class DebuffPlayer : ConsoleCmdAbstract
-	{
-		public override string GetDescription ()
-		{
-			return "Remove a buff from a player";
-		}
-
-		public override string GetHelp () {
-			return "Usage:\n" +
-				   "   debuffplayer <player name / steam id / entity id> <buff name>\n" +
-				   "Remove the given buff from the player given by the player name or entity id (as given by e.g. \"lpi\").";
-		}
-
-		public override string[] GetCommands ()
-		{
-			return new string[] { "debuffplayer" };
-		}
-
-		public override void Execute (List<string> _params, CommandSenderInfo _senderInfo)
-		{
-			try {
-				if (_params.Count != 2) {
-					SdtdConsole.Instance.Output ("Invalid arguments");
-					return;
-				}
-
-				string buff = _params [1];
-
-				ClientInfo receiver = ConsoleHelper.ParseParamIdOrName (_params [0]);
-				if (receiver != null) {
-					receiver.SendPackage (new NetPackageConsoleCmdClient ("debuff " + buff, true));
-				} else {
-					SdtdConsole.Instance.Output ("Playername or entity ID not found.");
-				}
-			} catch (Exception e) {
-				Log.Out ("Error in DebuffPlayer.Run: " + e);
-			}
-		}
-	}
-}
Index: nary-improvements/AllocsCommands/Commands/ExportItemIcons.cs
===================================================================
--- /binary-improvements/AllocsCommands/Commands/ExportItemIcons.cs	(revision 289)
+++ 	(revision )
@@ -1,59 +1,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-
-using UnityEngine;
-
-namespace AllocsFixes.CustomCommands
-{
-	public class ExportItemIcons : ConsoleCmdAbstract
-	{
-		public override string GetDescription ()
-		{
-			return "Exports all ItemIcons";
-		}
-
-		public override string GetHelp () {
-			return "Exports all ItemIcons currently in the game to the folder \"ItemIcons\" in the game root";
-		}
-
-		public override string[] GetCommands ()
-		{
-			return new string[] { "exportitemicons" };
-		}
-
-		public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) {
-			string exportPath = Utils.GetGameDir ("ItemIcons");
-
-			GameObject atlasObj = GameObject.Find ("/NGUI Root (2D)/ItemIconAtlas");
-			if (atlasObj == null) {
-				SdtdConsole.Instance.Output ("Atlas object not found");
-				return;
-			}
-			DynamicUIAtlas atlas = atlasObj.GetComponent<DynamicUIAtlas> ();
-			if (atlas == null) {
-				SdtdConsole.Instance.Output ("Atlas component not found");
-				return;
-			}
-
-			Texture2D atlasTex = atlas.texture as Texture2D;
-
-			if (Directory.Exists (exportPath)) {
-				SdtdConsole.Instance.Output ("Export path (" + exportPath + ") already exists");
-				return;
-			}
-			Directory.CreateDirectory (exportPath);
-
-			foreach (UISpriteData data in atlas.spriteList) {
-				string name = data.name;
-				Texture2D tex = new Texture2D (data.width, data.height, TextureFormat.ARGB32, false);
-				tex.SetPixels (atlasTex.GetPixels (data.x, atlasTex.height - data.height - data.y, data.width, data.height));
-				byte[] pixData = tex.EncodeToPNG ();
-				File.WriteAllBytes (exportPath + "/" + name + ".png", pixData);
-
-				UnityEngine.Object.Destroy (tex);
-			}
-
-		}
-	}
-}
Index: /binary-improvements/AllocsCommands/Commands/Give.cs
===================================================================
--- /binary-improvements/AllocsCommands/Commands/Give.cs	(revision 289)
+++ /binary-improvements/AllocsCommands/Commands/Give.cs	(revision 290)
@@ -52,5 +52,5 @@
 
 				if (_params.Count == 4) {
-					if (!iv.HasQuality) {
+					if (!iv.HasQuality && iv.Attachments == null && iv.Parts == null) {
 						SdtdConsole.Instance.Output ("Item " + _params [1] + " does not support quality.");
 						return;
@@ -63,4 +63,23 @@
 					}
 					iv.Quality = quality;
+
+					// Specific code for weapons with parts and attachmetns
+					if (iv.Attachments != null && iv.Attachments.Length != 0) {
+						for (int i = 0; i < iv.Attachments.Length; i++) {
+							ItemValue att = iv.Attachments[i];
+							if (att.HasQuality) {
+								att.Quality = quality;
+							}
+						}
+					}
+
+					if (iv.Parts != null && iv.Parts.Length != 0) {
+						for (int i = 0; i < iv.Parts.Length; i++) {
+							ItemValue part = iv.Parts[i];
+							if (part.HasQuality) {
+								part.Quality = quality;
+							}
+						}
+					}
 				}
 
Index: nary-improvements/AllocsCommands/Commands/RepairChunkDensity.cs
===================================================================
--- /binary-improvements/AllocsCommands/Commands/RepairChunkDensity.cs	(revision 289)
+++ 	(revision )
@@ -1,70 +1,0 @@
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-
-namespace AllocsFixes.CustomCommands
-{
-	public class RepairChunkDensity : ConsoleCmdAbstract {
-		public override string GetDescription () {
-			return "check and optionally fix densities of a chunk";
-		}
-
-		public override string GetHelp () {
-			return "This command is used to check if the densities of blocks in a chunk match the actual block type.\n" +
-				"If there is a mismatch it can lead to the chunk rendering incorrectly or not at all, typically\n" +
-				"indicated by the error message \"Failed setting triangles. Some indices are referencing out of\n" +
-				"bounds vertices.\". It can also fix such mismatches within a chunk.\n" +
-				"Usage:\n" +
-				"  1. repairchunkdensity <x> <z>\n" +
-				"  2. repairchunkdensity <x> <z> fix\n" +
-				"1. Just checks the chunk and prints mismatched to the server log. x and z are the coordinates of any\n" +
-				"   block within the chunk to check.\n" +
-				"2. Repairs any mismatch found in the chunk.";
-		}
-
-		public override string[] GetCommands () {
-			return new string[] { "repairchunkdensity", "rcd" };
-		}
-
-		public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) {
-			try {
-				if (_params.Count < 2 || _params.Count > 3) {
-					SdtdConsole.Instance.Output ("Wrong number of arguments, expected 2 or 3, found " + _params.Count + ".");
-					return;
-				} else {
-					int x = int.MinValue;
-					int z = int.MinValue;
-
-					int.TryParse (_params [0], out x);
-					int.TryParse (_params [1], out z);
-
-					if (x == int.MinValue || z == int.MinValue) {
-						SdtdConsole.Instance.Output ("At least one of the given coordinates is not a valid integer");
-						return;
-					}
-
-					Chunk c = GameManager.Instance.World.GetChunkFromWorldPos (x, 0, z) as Chunk;
-					if (c == null) {
-						SdtdConsole.Instance.Output ("No chunk could be loaded from the given coordinates");
-						return;
-					}
-
-					if (_params.Count == 3) {
-						if (_params [2].ToLower () != "fix") {
-							SdtdConsole.Instance.Output ("Three parameters given but third parameter is not \"fix\"");
-							return;
-						}
-						c.RepairDensities ();
-						c.isModified = true;
-						SdtdConsole.Instance.Output ("Chunk repaired");
-					} else {
-						c.CheckDensities (true);
-					}
-				}
-			} catch (Exception e) {
-				Log.Out ("Error in RepairChunkDensity.Execute: " + e);
-			}
-		}
-
-	}
-}
Index: nary-improvements/AllocsCommands/Commands/TeleportPlayer.cs
===================================================================
--- /binary-improvements/AllocsCommands/Commands/TeleportPlayer.cs	(revision 289)
+++ 	(revision )
@@ -1,111 +1,0 @@
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-
-namespace AllocsFixes.CustomCommands
-{
-	public class TeleportPlayer : ConsoleCmdAbstract {
-		public override string GetDescription () {
-			return "teleport a player to a given location";
-		}
-
-		public override string GetHelp () {
-			return "Usage:\n" +
-				"  1. teleportplayer <steam id / player name / entity id> <x> <y> <z>\n" +
-				"  2. teleportplayer <steam id / player name / entity id> <target steam id / player name / entity id>\n" +
-				"  3. teleportplayer <inc x> <inc y> <inc z>\n" +
-				"1. Teleports the player given by his SteamID, player name or entity id (as given by e.g. \"lpi\")\n" +
-				"   to the specified location. Use y = -1 to spawn on ground.\n" +
-				"2. As 1, but destination given by another player which has to be online\n" +
-				"3. Teleport the local player to the position calculated by his current position and the given offsets";
-		}
-
-		public override string[] GetCommands () {
-			return new string[] { "teleportplayer", "tele" };
-		}
-
-		public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) {
-			try {
-				if (_params.Count < 2 || _params.Count > 4) {
-					SdtdConsole.Instance.Output ("Wrong number of arguments, expected 2 to 4, found " + _params.Count + ".");
-					return;
-				} else {
-					ClientInfo ci1 = null;
-					EntityPlayer ep1 = null;
-					UnityEngine.Vector3 destPos = new UnityEngine.Vector3 ();
- 
-					if (_params.Count == 2 || _params.Count == 4) {
-						ci1 = ConsoleHelper.ParseParamIdOrName (_params [0]);
-						if (ci1 == null) {
-							SdtdConsole.Instance.Output ("Playername or entity/steamid id not found.");
-							return;
-						}
-						ep1 = GameManager.Instance.World.Players.dict [ci1.entityId];
-
-						if (_params.Count == 4) {
-							int x = int.MinValue;
-							int y = int.MinValue;
-							int z = int.MinValue;
-
-							int.TryParse (_params [1], out x);
-							int.TryParse (_params [2], out y);
-							int.TryParse (_params [3], out z);
-
-							if (x == int.MinValue || y == int.MinValue || z == int.MinValue) {
-								SdtdConsole.Instance.Output ("At least one of the given coordinates is not a valid integer");
-								return;
-							}
-
-							destPos.x = x;
-							destPos.y = y;
-							destPos.z = z;
-						} else if (_params.Count == 2) {
-							ClientInfo ci2 = ConsoleHelper.ParseParamIdOrName (_params [1]);
-							if (ci2 == null) {
-								SdtdConsole.Instance.Output ("Target playername or entity/steamid id not found.");
-								return;
-							}
-							EntityPlayer ep2 = GameManager.Instance.World.Players.dict [ci2.entityId];
-
-							destPos = ep2.GetPosition ();
-							destPos.y += 1;
-							destPos.z += 1;
-						}
-					} else if (_params.Count == 3) {
-						if (_senderInfo.RemoteClientInfo == null) {
-							SdtdConsole.Instance.Output ("This command can only be executed in variant 3 on the in-game console.");
-							return;
-						}
-
-						ci1 = _senderInfo.RemoteClientInfo;
-						ep1 = GameManager.Instance.World.Players.dict [ci1.entityId];
-
-						int x = int.MinValue;
-						int y = int.MinValue;
-						int z = int.MinValue;
-
-						int.TryParse (_params [0], out x);
-						int.TryParse (_params [1], out y);
-						int.TryParse (_params [2], out z);
-
-						if (x == int.MinValue || y == int.MinValue || z == int.MinValue) {
-							SdtdConsole.Instance.Output ("At least one of the given coordinates is not a valid integer");
-							return;
-						}
-
-						destPos.x = ep1.position.x + x;
-						destPos.y = ep1.position.y + y;
-						destPos.z = ep1.position.z + z;
-					}
-
-					NetPackageTeleportPlayer pkg = new NetPackageTeleportPlayer (destPos);
-
-					ci1.SendPackage (pkg);
-				}
-			} catch (Exception e) {
-				Log.Out ("Error in TeleportPlayer.Run: " + e);
-			}
-		}
-
-	}
-}
