Construction warning cleanup (#12256)

This commit is contained in:
Nemanja
2022-10-30 02:48:53 -04:00
committed by GitHub
parent 1a6d084c4d
commit b6135d3be5
47 changed files with 166 additions and 146 deletions

View File

@@ -51,9 +51,9 @@ namespace Content.Server.Construction
component.CancelToken = null;
var xform = Transform(uid);
RaiseLocalEvent(uid, new BeforeUnanchoredEvent(args.User, args.Using), false);
RaiseLocalEvent(uid, new BeforeUnanchoredEvent(args.User, args.Using));
xform.Anchored = false;
RaiseLocalEvent(uid, new UserUnanchoredEvent(args.User, args.Using), false);
RaiseLocalEvent(uid, new UserUnanchoredEvent(args.User, args.Using));
_popup.PopupEntity(Loc.GetString("anchorable-unanchored"), uid, Filter.Pvs(uid, entityManager: EntityManager));
@@ -93,9 +93,9 @@ namespace Content.Server.Construction
if (component.Snap)
xform.Coordinates = xform.Coordinates.SnapToGrid(EntityManager, _mapManager);
RaiseLocalEvent(uid, new BeforeAnchoredEvent(args.User, args.Using), false);
RaiseLocalEvent(uid, new BeforeAnchoredEvent(args.User, args.Using));
xform.Anchored = true;
RaiseLocalEvent(uid, new UserAnchoredEvent(args.User, args.Using), false);
RaiseLocalEvent(uid, new UserAnchoredEvent(args.User, args.Using));
_popup.PopupEntity(Loc.GetString("anchorable-anchored"), uid, Filter.Pvs(uid, entityManager: EntityManager));
@@ -155,16 +155,13 @@ namespace Content.Server.Construction
// Need to cast the event or it will be raised as BaseAnchoredAttemptEvent.
if (anchoring)
RaiseLocalEvent(uid, (AnchorAttemptEvent) attempt, false);
RaiseLocalEvent(uid, (AnchorAttemptEvent) attempt);
else
RaiseLocalEvent(uid, (UnanchorAttemptEvent) attempt, false);
RaiseLocalEvent(uid, (UnanchorAttemptEvent) attempt);
anchorable.Delay += attempt.Delay;
if (attempt.Cancelled)
return false;
return true;
return !attempt.Cancelled;
}
/// <summary>