Фикс логики системы отражения (#682)
* Fixed ReflectSystem + Added logic for reflective items positioning * Total oppsie fix * Born to shitcode
This commit is contained in:
@@ -3,5 +3,23 @@ namespace Content.Shared.Wieldable;
|
||||
/// <summary>
|
||||
/// Raised directed on an entity when it is wielded.
|
||||
/// </summary>
|
||||
[ByRefEvent]
|
||||
public readonly record struct ItemWieldedEvent;
|
||||
// WD edit start
|
||||
// Reason for the edit: previously ItemWieldedEvent didn't contained "EntityUid user" parameter.
|
||||
// Now it's done like ItemUnwieldedEvent with "EntityUid user" parameter for correct logic work.
|
||||
// [ByRefEvent]
|
||||
// public readonly record struct ItemWieldedEvent;
|
||||
public sealed class ItemWieldedEvent : EntityEventArgs
|
||||
{
|
||||
public EntityUid? User;
|
||||
/// <summary>
|
||||
/// Whether the item is being forced to be wielded, or if the player chose to wield it themselves.
|
||||
/// </summary>
|
||||
public bool Force;
|
||||
|
||||
public ItemWieldedEvent(EntityUid? user = null, bool force = false)
|
||||
{
|
||||
User = user;
|
||||
Force = force;
|
||||
}
|
||||
}
|
||||
// WD edit end
|
||||
|
||||
@@ -226,8 +226,8 @@ public sealed class WieldableSystem : EntitySystem
|
||||
var othersMessage = Loc.GetString("wieldable-component-successful-wield-other", ("user", user), ("item", used));
|
||||
_popupSystem.PopupPredicted(selfMessage, othersMessage, user, user);
|
||||
|
||||
var targEv = new ItemWieldedEvent();
|
||||
RaiseLocalEvent(used, ref targEv);
|
||||
var targEv = new ItemWieldedEvent(user); // WD added user
|
||||
RaiseLocalEvent(used, targEv); // WD removed ref from targEv
|
||||
|
||||
Dirty(used, component);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user