Use EntityQuery for mob state system resolves (#29021)
This commit is contained in:
@@ -16,7 +16,8 @@ public partial class MobStateSystem
|
||||
/// <returns>If the entity can be set to that MobState</returns>
|
||||
public bool HasState(EntityUid entity, MobState mobState, MobStateComponent? component = null)
|
||||
{
|
||||
return Resolve(entity, ref component, false) && component.AllowedStates.Contains(mobState);
|
||||
return _mobStateQuery.Resolve(entity, ref component, false) &&
|
||||
component.AllowedStates.Contains(mobState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -27,7 +28,7 @@ public partial class MobStateSystem
|
||||
/// <param name="origin">Entity that caused the state update (if applicable)</param>
|
||||
public void UpdateMobState(EntityUid entity, MobStateComponent? component = null, EntityUid? origin = null)
|
||||
{
|
||||
if (!Resolve(entity, ref component))
|
||||
if (!_mobStateQuery.Resolve(entity, ref component))
|
||||
return;
|
||||
|
||||
var ev = new UpdateMobStateEvent {Target = entity, Component = component, Origin = origin};
|
||||
@@ -46,7 +47,7 @@ public partial class MobStateSystem
|
||||
public void ChangeMobState(EntityUid entity, MobState mobState, MobStateComponent? component = null,
|
||||
EntityUid? origin = null)
|
||||
{
|
||||
if (!Resolve(entity, ref component))
|
||||
if (!_mobStateQuery.Resolve(entity, ref component))
|
||||
return;
|
||||
|
||||
ChangeState(entity, component, mobState, origin: origin);
|
||||
|
||||
Reference in New Issue
Block a user