Remove hands component reference (#15197)

This commit is contained in:
DrSmugleaf
2023-04-07 11:21:12 -07:00
committed by GitHub
parent c54ee5290b
commit b947856431
73 changed files with 277 additions and 328 deletions

View File

@@ -13,7 +13,7 @@ public abstract partial class SharedDoAfterSystem : EntitySystem
var time = GameTiming.CurTime;
var xformQuery = GetEntityQuery<TransformComponent>();
var handsQuery = GetEntityQuery<SharedHandsComponent>();
var handsQuery = GetEntityQuery<HandsComponent>();
var enumerator = EntityQueryEnumerator<ActiveDoAfterComponent, DoAfterComponent>();
while (enumerator.MoveNext(out var uid, out var active, out var comp))
@@ -28,7 +28,7 @@ public abstract partial class SharedDoAfterSystem : EntitySystem
DoAfterComponent comp,
TimeSpan time,
EntityQuery<TransformComponent> xformQuery,
EntityQuery<SharedHandsComponent> handsQuery)
EntityQuery<HandsComponent> handsQuery)
{
var dirty = false;
@@ -122,7 +122,7 @@ public abstract partial class SharedDoAfterSystem : EntitySystem
private bool ShouldCancel(DoAfter doAfter,
EntityQuery<TransformComponent> xformQuery,
EntityQuery<SharedHandsComponent> handsQuery)
EntityQuery<HandsComponent> handsQuery)
{
var args = doAfter.Args;

View File

@@ -203,7 +203,7 @@ public abstract partial class SharedDoAfterSystem : EntitySystem
// (or if there is no item there we need to keep it free).
if (args.NeedHand && args.BreakOnHandChange)
{
if (!TryComp(args.User, out SharedHandsComponent? handsComponent))
if (!TryComp(args.User, out HandsComponent? handsComponent))
return false;
doAfter.InitialHand = handsComponent.ActiveHand?.Name;
@@ -211,7 +211,7 @@ public abstract partial class SharedDoAfterSystem : EntitySystem
}
// Inital checks
if (ShouldCancel(doAfter, GetEntityQuery<TransformComponent>(), GetEntityQuery<SharedHandsComponent>()))
if (ShouldCancel(doAfter, GetEntityQuery<TransformComponent>(), GetEntityQuery<HandsComponent>()))
return false;
if (args.AttemptFrequency == AttemptFrequency.StartAndEnd && !TryAttemptEvent(doAfter))