Fix throwing and pointing ignoring CanChangeDirection action blocker (#1474)
* Fix being able to change direction while buckled by throwing * Fix being able to change direction while buckled by pointing * Wrap diff in can turn check
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Content.Server.GameObjects.Components.Pointing;
|
using Content.Server.GameObjects.Components.Pointing;
|
||||||
|
using Content.Shared.GameObjects.EntitySystems;
|
||||||
using Content.Shared.Input;
|
using Content.Shared.Input;
|
||||||
using Content.Shared.Interfaces;
|
using Content.Shared.Interfaces;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
@@ -97,10 +98,13 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var diff = coords.ToMapPos(_mapManager) - player.Transform.MapPosition.Position;
|
if (ActionBlockerSystem.CanChangeDirection(player))
|
||||||
if (diff.LengthSquared > 0.01f)
|
|
||||||
{
|
{
|
||||||
player.Transform.LocalRotation = new Angle(diff);
|
var diff = coords.ToMapPos(_mapManager) - player.Transform.MapPosition.Position;
|
||||||
|
if (diff.LengthSquared > 0.01f)
|
||||||
|
{
|
||||||
|
player.Transform.LocalRotation = new Angle(diff);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var viewers = _playerManager.GetPlayersInRange(player.Transform.GridPosition, 15);
|
var viewers = _playerManager.GetPlayersInRange(player.Transform.GridPosition, 15);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Content.Server.GameObjects.Components;
|
using Content.Server.GameObjects.Components;
|
||||||
|
using Content.Shared.GameObjects.EntitySystems;
|
||||||
using Content.Shared.Physics;
|
using Content.Shared.Physics;
|
||||||
using Robust.Shared.GameObjects.Components;
|
using Robust.Shared.GameObjects.Components;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
@@ -72,7 +73,10 @@ namespace Content.Server.Throw
|
|||||||
projComp.User = throwSourceEnt;
|
projComp.User = throwSourceEnt;
|
||||||
projComp.IgnoreEntity(throwSourceEnt);
|
projComp.IgnoreEntity(throwSourceEnt);
|
||||||
|
|
||||||
throwSourceEnt.Transform.LocalRotation = angle.GetCardinalDir().ToAngle();
|
if (ActionBlockerSystem.CanChangeDirection(throwSourceEnt))
|
||||||
|
{
|
||||||
|
throwSourceEnt.Transform.LocalRotation = angle.GetCardinalDir().ToAngle();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// scaling is handled elsewhere, this is just multiplying by 10 independent of timing as a fix until elsewhere values are updated
|
// scaling is handled elsewhere, this is just multiplying by 10 independent of timing as a fix until elsewhere values are updated
|
||||||
|
|||||||
Reference in New Issue
Block a user