Fixing some warnings (#6250)
Co-authored-by: Paul Ritter <ritter.paul1@googlemail.com>
This commit is contained in:
@@ -66,12 +66,12 @@ namespace Content.Server.AI.Operators.Combat.Melee
|
||||
return Outcome.Success;
|
||||
}
|
||||
|
||||
if (!_entMan.TryGetComponent(_owner, out HandsComponent? hands) || hands.GetActiveHand == null)
|
||||
if (!_entMan.TryGetComponent(_owner, out HandsComponent? hands) || hands.GetActiveHandItem == null)
|
||||
{
|
||||
return Outcome.Failed;
|
||||
}
|
||||
|
||||
var meleeWeapon = hands.GetActiveHand.Owner;
|
||||
var meleeWeapon = hands.GetActiveHandItem.Owner;
|
||||
_entMan.TryGetComponent(meleeWeapon, out MeleeWeaponComponent? meleeWeaponComponent);
|
||||
|
||||
if ((_entMan.GetComponent<TransformComponent>(_target).Coordinates.Position - _entMan.GetComponent<TransformComponent>(_owner).Coordinates.Position).Length >
|
||||
|
||||
@@ -146,19 +146,19 @@ namespace Content.Server.AI.Pathfinding
|
||||
{
|
||||
var chunkX = (int) (Math.Floor((float) tile.X / PathfindingChunk.ChunkSize) * PathfindingChunk.ChunkSize);
|
||||
var chunkY = (int) (Math.Floor((float) tile.Y / PathfindingChunk.ChunkSize) * PathfindingChunk.ChunkSize);
|
||||
var Vector2i = new Vector2i(chunkX, chunkY);
|
||||
var vector2i = new Vector2i(chunkX, chunkY);
|
||||
|
||||
if (_graph.TryGetValue(tile.GridIndex, out var chunks))
|
||||
{
|
||||
if (!chunks.ContainsKey(Vector2i))
|
||||
if (!chunks.ContainsKey(vector2i))
|
||||
{
|
||||
CreateChunk(tile.GridIndex, Vector2i);
|
||||
CreateChunk(tile.GridIndex, vector2i);
|
||||
}
|
||||
|
||||
return chunks[Vector2i];
|
||||
return chunks[vector2i];
|
||||
}
|
||||
|
||||
var newChunk = CreateChunk(tile.GridIndex, Vector2i);
|
||||
var newChunk = CreateChunk(tile.GridIndex, vector2i);
|
||||
return newChunk;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ namespace Content.Server.AI.Utility
|
||||
internal sealed class NpcBehaviorManager : INpcBehaviorManager
|
||||
{
|
||||
[Dependency] private readonly IDynamicTypeFactory _typeFactory = default!;
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
private readonly NpcActionComparer _comparer = new();
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Content.Server.AI.WorldState.States.Inventory
|
||||
|
||||
public override EntityUid? GetValue()
|
||||
{
|
||||
return IoCManager.Resolve<IEntityManager>().GetComponentOrNull<HandsComponent>(Owner)?.GetActiveHand?.Owner;
|
||||
return IoCManager.Resolve<IEntityManager>().GetComponentOrNull<HandsComponent>(Owner)?.GetActiveHandItem?.Owner;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user