mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 05:27:38 +03:00
Swap some InRangeUnobstructed for InRangeUnoccluded (#28706)
This commit is contained in:
@@ -27,6 +27,7 @@ namespace Content.Client.Construction
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
|
||||
[Dependency] private readonly ExamineSystemShared _examineSystem = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
|
||||
@@ -195,9 +196,8 @@ namespace Content.Client.Construction
|
||||
if (GhostPresent(loc))
|
||||
return false;
|
||||
|
||||
// This InRangeUnobstructed should probably be replaced with "is there something blocking us in that tile?"
|
||||
var predicate = GetPredicate(prototype.CanBuildInImpassable, loc.ToMap(EntityManager, _transformSystem));
|
||||
if (!_interactionSystem.InRangeUnobstructed(user, loc, 20f, predicate: predicate))
|
||||
if (!_examineSystem.InRangeUnOccluded(user, loc, 20f, predicate: predicate))
|
||||
return false;
|
||||
|
||||
if (!CheckConstructionConditions(prototype, loc, dir, user, showPopup: true))
|
||||
|
||||
@@ -6,8 +6,8 @@ using Content.Server._White.TTS;
|
||||
using Content.Server.Administration.Logs;
|
||||
using Content.Server.Administration.Managers;
|
||||
using Content.Server.Chat.Managers;
|
||||
using Content.Server.Examine;
|
||||
using Content.Server.GameTicking;
|
||||
using Content.Server.Players.RateLimiting;
|
||||
using Content.Server.Language;
|
||||
using Content.Server.Speech.Components;
|
||||
using Content.Server.Speech.EntitySystems;
|
||||
@@ -18,11 +18,13 @@ using Content.Shared.Administration;
|
||||
using Content.Shared.CCVar;
|
||||
using Content.Shared.Chat;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Ghost;
|
||||
using Content.Shared.Language;
|
||||
using Content.Shared.IdentityManagement;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Language.Systems;
|
||||
using Content.Shared.Mobs;
|
||||
using Content.Shared.Mobs.Components;
|
||||
using Content.Shared.Mobs.Systems;
|
||||
using Content.Shared.Players;
|
||||
using Content.Shared.Players.RateLimiting;
|
||||
@@ -40,11 +42,6 @@ using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Replays;
|
||||
using Robust.Shared.Utility;
|
||||
using Content.Server.Shuttles.Components;
|
||||
using Content.Shared.Mobs;
|
||||
using Content.Shared.Mobs.Components;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Physics.Dynamics.Joints;
|
||||
|
||||
namespace Content.Server.Chat.Systems;
|
||||
|
||||
@@ -62,7 +59,6 @@ public sealed partial class ChatSystem : SharedChatSystem
|
||||
[Dependency] private readonly IReplayRecordingManager _replay = default!;
|
||||
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
|
||||
[Dependency] private readonly IChatManager _chatManager = default!;
|
||||
[Dependency] private readonly HearingSystem _hearing = default!;
|
||||
[Dependency] private readonly IChatSanitizationManager _sanitizer = default!;
|
||||
[Dependency] private readonly IAdminManager _adminManager = default!;
|
||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||
@@ -78,6 +74,8 @@ public sealed partial class ChatSystem : SharedChatSystem
|
||||
[Dependency] private readonly LanguageSystem _language = default!;
|
||||
[Dependency] private readonly TelepathicChatSystem _telepath = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
|
||||
[Dependency] private readonly ExamineSystemShared _examineSystem = default!;
|
||||
[Dependency] private readonly HearingSystem _hearing = default!; // WD EDIT
|
||||
|
||||
public const int VoiceRange = 10; // how far voice goes in world units
|
||||
public const int WhisperClearRange = 2; // how far whisper goes while still being understandable, in world units
|
||||
@@ -546,13 +544,14 @@ public sealed partial class ChatSystem : SharedChatSystem
|
||||
// Result is the intermediate message derived from the perceived one via obfuscation
|
||||
// Wrapped message is the result wrapped in an "x says y" string
|
||||
string result, wrappedMessage;
|
||||
//If listener is too far and has no line of sight, they can't identify the whisperer's identity
|
||||
if (data.Range <= (TryComp<ChatModifierComponent>(listener, out var modifier) ? modifier.WhisperListeningRange : WhisperClearRange)) // WWDP-Edit
|
||||
{
|
||||
// Scenario 1: the listener can clearly understand the message
|
||||
result = perceivedMessage;
|
||||
wrappedMessage = WrapWhisperMessage(source, "chat-manager-entity-whisper-wrap-message", name, result, language);
|
||||
}
|
||||
else if (_interactionSystem.InRangeUnobstructed(source, listener, WhisperMuffledRange, Shared.Physics.CollisionGroup.Opaque))
|
||||
else if (_examineSystem.InRangeUnOccluded(source, listener, WhisperMuffledRange))
|
||||
{
|
||||
// Scenario 2: if the listener is too far, they only hear fragments of the message
|
||||
result = ObfuscateMessageReadability(perceivedMessage);
|
||||
@@ -736,7 +735,6 @@ public sealed partial class ChatSystem : SharedChatSystem
|
||||
private void SendInVoiceRange(ChatChannel channel, string name, string message, string wrappedMessage, string obfuscated, string obfuscatedWrappedMessage, EntityUid source, ChatTransmitRange range, NetUserId? author = null, LanguagePrototype? languageOverride = null)
|
||||
{
|
||||
var language = languageOverride ?? _language.GetLanguage(source);
|
||||
|
||||
foreach (var (session, data) in GetRecipients(source, Transform(source).GridUid == null ? 0.3f : VoiceRange))
|
||||
{
|
||||
if (session.AttachedEntity != null
|
||||
|
||||
@@ -3,6 +3,7 @@ using Content.Server.Interaction;
|
||||
using Content.Server.Popups;
|
||||
using Content.Server.Stunnable;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Instruments;
|
||||
using Content.Shared.Instruments.UI;
|
||||
using Content.Shared.Physics;
|
||||
@@ -30,6 +31,7 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
|
||||
[Dependency] private readonly PopupSystem _popup = default!;
|
||||
[Dependency] private readonly TransformSystem _transform = default!;
|
||||
[Dependency] private readonly InteractionSystem _interactions = default!;
|
||||
[Dependency] private readonly ExamineSystemShared _examineSystem = default!;
|
||||
|
||||
private const float MaxInstrumentBandRange = 10f;
|
||||
|
||||
@@ -250,9 +252,8 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
|
||||
continue;
|
||||
|
||||
// Maybe a bit expensive but oh well GetBands is queued and has a timer anyway.
|
||||
// Make sure the instrument is visible, uses the Opaque collision group so this works across windows etc.
|
||||
if (!_interactions.InRangeUnobstructed(uid, entity, MaxInstrumentBandRange,
|
||||
CollisionGroup.Opaque, e => e == playerUid || e == originPlayer))
|
||||
// Make sure the instrument is visible
|
||||
if (!_examineSystem.InRangeUnOccluded(uid, entity, MaxInstrumentBandRange, e => e == playerUid || e == originPlayer))
|
||||
continue;
|
||||
|
||||
if (!metadataQuery.TryGetComponent(playerUid, out var playerMetadata)
|
||||
|
||||
Reference in New Issue
Block a user