Fix stuff

This commit is contained in:
ShadowCommander
2021-08-10 16:18:57 -07:00
parent e9f358f56b
commit 0c09d4d7e2
10 changed files with 111 additions and 112 deletions

View File

@@ -116,7 +116,8 @@ namespace Content.Server.Cuffs.Components
[DataField("startCuffSound")]
public SoundSpecifier StartCuffSound { get; set; } = new SoundPathSpecifier("/Audio/Items/Handcuffs/cuff_start.ogg");
[DataField("endCuffSound")] public SoundSpecifier EndCuffSound { get; set; } = new SoundPathSpecifier("/Audio/Items/Handcuffs/cuff_end.ogg");
[DataField("endCuffSound")]
public SoundSpecifier EndCuffSound { get; set; } = new SoundPathSpecifier("/Audio/Items/Handcuffs/cuff_end.ogg");
[DataField("startBreakoutSound")]
public SoundSpecifier StartBreakoutSound { get; set; } = new SoundPathSpecifier("/Audio/Items/Handcuffs/cuff_breakout_start.ogg");

View File

@@ -15,6 +15,6 @@ namespace Content.Server.Explosion.Components
[ViewVariables(VVAccess.ReadWrite)]
[DataField("sound", required: true)]
public SoundSpecifier? Sound { get; set; } = null;
public SoundSpecifier Sound { get; set; } = default!;
}
}

View File

@@ -21,7 +21,7 @@ namespace Content.Server.Nutrition.Components
public float ParalyzeTime { get; set; } = 1f;
[DataField("sound")]
private SoundSpecifier _sound = new SoundCollectionSpecifier("desacration");
private SoundSpecifier _sound = new SoundCollectionSpecifier("desecration");
public void PlaySound()
{

View File

@@ -129,8 +129,7 @@ namespace Content.Server.PDA
case PDAUplinkBuyListingMessage buyMsg:
{
var player = message.Session.AttachedEntity;
if (player == null)
break;
if (player == null) break;
if (!_uplinkManager.TryPurchaseItem(_syndicateUplinkAccount, buyMsg.ItemId,
player.Transform.Coordinates, out var entity))
@@ -139,7 +138,8 @@ namespace Content.Server.PDA
break;
}
if (!player.TryGetComponent(out HandsComponent? hands) || !entity.TryGetComponent(out ItemComponent? item))
if (!player.TryGetComponent(out HandsComponent? hands) ||
!entity.TryGetComponent(out ItemComponent? item))
break;
hands.PutInHandOrDrop(item);

View File

@@ -226,6 +226,7 @@ namespace Content.Server.Physics.Controllers
// Walking on a tile.
var def = (ContentTileDefinition) _tileDefinitionManager[tile.Tile.TypeId];
soundToPlay = def.FootstepSounds.GetSound();
if (string.IsNullOrEmpty(soundToPlay))
return;
}

View File

@@ -35,7 +35,7 @@ namespace Content.Server.Singularity.Components
[ViewVariables] public int FireShotCounter;
[ViewVariables] [DataField("fireSound")] public string FireSound = "/Audio/Weapons/emitter.ogg";
[ViewVariables] [DataField("fireSound")] public SoundSpecifier FireSound = new SoundPathSpecifier("/Audio/Weapons/emitter.ogg");
[ViewVariables] [DataField("boltType")] public string BoltType = "EmitterBolt";
[ViewVariables] [DataField("powerUseActive")] public int PowerUseActive = 500;
[ViewVariables] [DataField("fireBurstSize")] public int FireBurstSize = 3;

View File

@@ -222,7 +222,7 @@ namespace Content.Server.Singularity.EntitySystems
// TODO: Move to projectile's code.
Timer.Spawn(3000, () => projectile.Delete());
SoundSystem.Play(Filter.Pvs(component.Owner), component.FireSound, component.Owner,
SoundSystem.Play(Filter.Pvs(component.Owner), component.FireSound.GetSound(), component.Owner,
AudioHelpers.WithVariation(EmitterComponent.Variation).WithVolume(EmitterComponent.Volume).WithMaxDistance(EmitterComponent.Distance));
}

View File

@@ -2,7 +2,6 @@ using Content.Server.Atmos.Components;
using Content.Server.Atmos.EntitySystems;
using Content.Server.GameTicking;
using Content.Shared.Atmos;
using Content.Shared.Sound;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;

View File

@@ -1,3 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Content.Server.DoAfter;
using Content.Server.Hands.Components;
using Content.Server.Items;
@@ -24,11 +29,6 @@ using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace Content.Server.Storage.Components
{
@@ -401,8 +401,7 @@ namespace Content.Server.Storage.Components
var playerTransform = player.Transform;
if (!playerTransform.Coordinates.InRange(Owner.EntityManager, ownerTransform.Coordinates, 2) ||
!ownerTransform.IsMapTransform &&
!playerTransform.ContainsEntity(ownerTransform))
!ownerTransform.IsMapTransform && !playerTransform.ContainsEntity(ownerTransform))
{
break;
}
@@ -415,8 +414,7 @@ namespace Content.Server.Storage.Components
}
var item = entity.GetComponent<ItemComponent>();
if (item == null ||
!player.TryGetComponent(out HandsComponent? hands))
if (item == null || !player.TryGetComponent(out HandsComponent? hands))
{
break;
}