Fix servercrash /giveitem weight
This commit is contained in:
@@ -1922,7 +1922,6 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
{
|
{
|
||||||
invWeight += uItem.Amount * InventoryManager.GetItemById(uItem.ItemId).Gewicht;
|
invWeight += uItem.Amount * InventoryManager.GetItemById(uItem.ItemId).Gewicht;
|
||||||
}
|
}
|
||||||
ChatService.SendMessage(player, "~b~[ADMIN]~s~ Du hast " + target.Name + " ~g~" + amount + "~s~ mal das Item gegeben.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (invWeight + (amount * InventoryManager.GetItemById(itemId).Gewicht) > 40000)
|
if (invWeight + (amount * InventoryManager.GetItemById(itemId).Gewicht) > 40000)
|
||||||
@@ -1933,6 +1932,7 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
{
|
{
|
||||||
UserItem item = new UserItem() { ItemId = itemId, UserId = target.GetUser().Id, Amount = amount };
|
UserItem item = new UserItem() { ItemId = itemId, UserId = target.GetUser().Id, Amount = amount };
|
||||||
InventoryManager.AddItemToInventory(target, item.ItemId, item.Amount);
|
InventoryManager.AddItemToInventory(target, item.ItemId, item.Amount);
|
||||||
|
ChatService.SendMessage(player, "~b~[ADMIN]~s~ Du hast " + target.Name + " ~g~" + amount + "~s~ mal das Item gegeben.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user