Фиксы (#518)
* fix rcd ammo predicting * fix tts preview * cleanups HumanoidProfileEditor * fix double chaplain bible * loadout fixes * fix handlabeler mispredicting * fix resources couldnt be extracted due to the whitelist * wd edit * add security filled leather satchel to loadouts
This commit is contained in:
17
Content.Shared/Labels/Components/HandLabelerComponent.cs
Normal file
17
Content.Shared/Labels/Components/HandLabelerComponent.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.Labels.Components
|
||||
{
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class HandLabelerComponent : Component
|
||||
{
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField] public string AssignedLabel { get; set; } = string.Empty;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField] public int MaxLabelChars { get; set; } = 50;
|
||||
|
||||
[DataField] public EntityWhitelist Whitelist = new();
|
||||
}
|
||||
}
|
||||
@@ -133,7 +133,13 @@ public abstract class SharedMaterialStorageSystem : EntitySystem
|
||||
/// <param name="volume"></param>
|
||||
/// <param name="component"></param>
|
||||
/// <returns>If the amount can be changed</returns>
|
||||
public bool CanChangeMaterialAmount(EntityUid uid, string materialId, int volume, MaterialStorageComponent? component, EntityUid? gridUid = null, MaterialStorageComponent? gridStorage = null)
|
||||
public bool CanChangeMaterialAmount(EntityUid uid,
|
||||
string materialId,
|
||||
int volume,
|
||||
MaterialStorageComponent? component,
|
||||
EntityUid? gridUid = null,
|
||||
MaterialStorageComponent? gridStorage = null,
|
||||
bool checkWhitelist = true)
|
||||
{
|
||||
if (!Resolve(uid, ref component))
|
||||
return false;
|
||||
@@ -141,7 +147,8 @@ public abstract class SharedMaterialStorageSystem : EntitySystem
|
||||
if (!CanTakeVolume(uid, volume, component, gridUid:gridUid, gridStorage:gridStorage))
|
||||
return false;
|
||||
|
||||
if (component.MaterialWhiteList != null && !component.MaterialWhiteList.Contains(materialId))
|
||||
// WD edit - added checkWhitelist bool
|
||||
if (checkWhitelist && component.MaterialWhiteList != null && !component.MaterialWhiteList.Contains(materialId))
|
||||
return false;
|
||||
|
||||
var amount = gridStorage != null
|
||||
@@ -181,12 +188,20 @@ public abstract class SharedMaterialStorageSystem : EntitySystem
|
||||
/// <param name="component"></param>
|
||||
/// <param name="dirty"></param>
|
||||
/// <returns>If it was successful</returns>
|
||||
public bool TryChangeMaterialAmount(EntityUid uid, string materialId, int volume, MaterialStorageComponent? component = null, bool dirty = true, EntityUid? gridUid = null, MaterialStorageComponent? gridStorage = null)
|
||||
public bool TryChangeMaterialAmount(EntityUid uid,
|
||||
string materialId,
|
||||
int volume,
|
||||
MaterialStorageComponent? component = null,
|
||||
bool dirty = true,
|
||||
EntityUid? gridUid = null,
|
||||
MaterialStorageComponent? gridStorage = null,
|
||||
bool checkWhitelist = true)
|
||||
{
|
||||
if (!Resolve(uid, ref component))
|
||||
return false;
|
||||
|
||||
if (!CanChangeMaterialAmount(uid, materialId, volume, component, gridUid:gridUid, gridStorage:gridStorage))
|
||||
// WD edit - added checkWhitelist bool
|
||||
if (!CanChangeMaterialAmount(uid, materialId, volume, component, gridUid:gridUid, gridStorage:gridStorage, checkWhitelist: checkWhitelist))
|
||||
return false;
|
||||
|
||||
var rightStorage = gridStorage ?? component;
|
||||
|
||||
@@ -5,6 +5,7 @@ using Content.Shared.Interaction;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.RCD.Components;
|
||||
using Content.Shared.Stacks;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Shared.RCD.Systems;
|
||||
@@ -15,6 +16,7 @@ public sealed class RCDAmmoSystem : EntitySystem
|
||||
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
[Dependency] private readonly SharedStackSystem _stack = default!;
|
||||
[Dependency] private readonly INetManager _netMan = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -83,7 +85,7 @@ public sealed class RCDAmmoSystem : EntitySystem
|
||||
Dirty(uid, comp);
|
||||
|
||||
// prevent having useless ammo with 0 charges
|
||||
if (comp.Charges <= 0)
|
||||
if (comp.Charges <= 0 && stackComponent == null && _netMan.IsServer)
|
||||
QueueDel(uid);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user