Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
IRacle1 committed Dec 25, 2024
1 parent 903f7df commit 8c7ea49
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
6 changes: 2 additions & 4 deletions EXILED/Exiled.API/Features/Items/Armor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ internal Armor(ItemType type)
}

/// <summary>
/// Gets or sets a value indicating whether excess ammo should be removed when the armor is dropped.
/// Gets a value indicating whether excess ammo should be removed when the armor is dropped.
/// </summary>
public bool RemoveExcessOnDrop
{
get => !Base.DontRemoveExcessOnDrop;
set => Base.DontRemoveExcessOnDrop = !value;
internal set => Base.DontRemoveExcessOnDrop = !value;
}

/// <summary>
Expand Down Expand Up @@ -150,7 +150,6 @@ public IEnumerable<BodyArmor.ArmorCategoryLimitModifier> CategoryLimits
{
Weight = Weight,
StaminaUseMultiplier = StaminaUseMultiplier,
RemoveExcessOnDrop = RemoveExcessOnDrop,
CategoryLimits = CategoryLimits,
StaminaRegenMultiplier = StaminaRegenMultiplier,
AmmoLimits = AmmoLimits,
Expand All @@ -166,7 +165,6 @@ internal override void ReadPickupInfoBefore(Pickup pickup)
{
HelmetEfficacy = armorPickup.HelmetEfficacy;
VestEfficacy = armorPickup.VestEfficacy;
RemoveExcessOnDrop = armorPickup.RemoveExcessOnDrop;
StaminaUseMultiplier = armorPickup.StaminaUseMultiplier;
StaminaRegenMultiplier = armorPickup.StaminaRegenMultiplier;
AmmoLimits = armorPickup.AmmoLimits;
Expand Down
3 changes: 1 addition & 2 deletions EXILED/Exiled.API/Features/Pickups/BodyArmorPickup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ internal BodyArmorPickup(ItemType type)
/// <summary>
/// Gets or sets a value indicating whether excess ammo should be removed when the armor is dropped.
/// </summary>
[Obsolete("Propetry is internal, and controls armor remove logic for clearing inventory")]
public bool RemoveExcessOnDrop { get; set; }

/// <summary>
Expand Down Expand Up @@ -132,7 +133,6 @@ internal override void ReadItemInfo(Item item)
{
helmetEfficacy = armoritem.HelmetEfficacy;
vestEfficacy = armoritem.VestEfficacy;
RemoveExcessOnDrop = armoritem.RemoveExcessOnDrop;
StaminaUseMultiplier = armoritem.StaminaUseMultiplier;
StaminaRegenMultiplier = armoritem.StaminaRegenMultiplier;
AmmoLimits = armoritem.AmmoLimits;
Expand All @@ -148,7 +148,6 @@ protected override void InitializeProperties(ItemBase itemBase)
{
helmetEfficacy = armoritem.HelmetEfficacy;
vestEfficacy = armoritem.VestEfficacy;
RemoveExcessOnDrop = !armoritem.DontRemoveExcessOnDrop;
StaminaUseMultiplier = armoritem._staminaUseMultiplier;
StaminaRegenMultiplier = armoritem.StaminaRegenMultiplier;
AmmoLimits = armoritem.AmmoLimits.Select(limit => (ArmorAmmoLimit)limit);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,16 +220,13 @@ private static void ChangeInventory(ChangingRoleEventArgs ev)
inventory.SendAmmoNextFrame = true;
}

if (!StartingInventories.DefinedInventories.TryGetValue(ev.NewRole, out InventoryRoleInfo value))
return;

foreach (KeyValuePair<ItemType, ushort> item in value.Ammo)
inventory.ServerAddAmmo(item.Key, item.Value);
foreach (KeyValuePair<ItemType, ushort> ammo in ev.Ammo)
inventory.ServerAddAmmo(ammo.Key, ammo.Value);

for (int i = 0; i < value.Items.Length; i++)
foreach (ItemType item in ev.Items)
{
ItemBase arg = inventory.ServerAddItem(value.Items[i], ItemAddReason.StartingItem, 0);
InventoryItemProvider.OnItemProvided?.Invoke(ev.Player.ReferenceHub, arg);
ItemBase itemBase = inventory.ServerAddItem(item, ItemAddReason.StartingItem);
InventoryItemProvider.OnItemProvided?.Invoke(ev.Player.ReferenceHub, itemBase);
}

InventoryItemProvider.InventoriesToReplenish.Enqueue(ev.Player.ReferenceHub);
Expand Down

0 comments on commit 8c7ea49

Please sign in to comment.