Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Particle Disruptor no ammo #83

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions MapEditorReborn/API/Features/Objects/ItemSpawnPointObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ namespace MapEditorReborn.API.Features.Objects
using Serializable;
using UnityEngine;
using static API;
using FirearmPickup = InventorySystem.Items.Firearms.FirearmPickup;
using Random = UnityEngine.Random;

/// <summary>
Expand Down Expand Up @@ -92,12 +91,15 @@ public override void UpdateObject()
if (!Base.CanBePickedUp)
PickupsLocked.Add(pickup.Serial);

if (pickup.Base is FirearmPickup firearmPickup)
if (pickup is FirearmPickup firearmPickup)
{
// int rawCode = GetAttachmentsCode(Base.AttachmentsCode);
// uint code = rawCode != -1 ? (item.Base as InventorySystem.Items.Firearms.Firearm).ValidateAttachmentsCode((uint)rawCode) : AttachmentsUtils.GetRandomAttachmentsCode(parsedItem);

// firearmPickup.NetworkStatus = new InventorySystem.Items.Firearms.FirearmStatus(firearmPickup.NetworkStatus.Ammo, firearmPickup.NetworkStatus.Flags, code);
// firearmPickup.Base.NetworkStatus = new InventorySystem.Items.Firearms.FirearmStatus(firearmPickup.Base.NetworkStatus.Ammo, firearmPickup.Base.NetworkStatus.Flags, code);

if (firearmPickup.Type == ItemType.ParticleDisruptor)
firearmPickup.Ammo = 5;
}

pickup.Scale = transform.localScale;
Expand Down