Fix projectiles not inheriting velocities from the shooter/gun. (#12854)

Fixes https://github.com/space-wizards/space-station-14/issues/12852
This commit is contained in:
Leon Friedrich
2022-12-10 16:45:18 +13:00
committed by GitHub
parent e6083a5c48
commit 7ee2f15a14
3 changed files with 32 additions and 23 deletions

View File

@@ -158,18 +158,8 @@ public sealed partial class GunSystem : SharedGunSystem
return;
}
EntityCoordinates coordinates;
// Bro why would I want a ternary here
// ReSharper disable once ConvertIfStatementToConditionalTernaryExpression
if (MapManager.TryFindGridAt(mousePos, out var grid))
{
coordinates = EntityCoordinates.FromMap(grid.GridEntityId, mousePos, EntityManager);
}
else
{
coordinates = EntityCoordinates.FromMap(MapManager.GetMapEntityId(mousePos.MapId), mousePos, EntityManager);
}
// Define target coordinates relative to gun entity, so that network latency on moving grids doesn't fuck up the target location.
var coordinates = EntityCoordinates.FromMap(entity, mousePos, EntityManager);
Sawmill.Debug($"Sending shoot request tick {Timing.CurTick} / {Timing.CurTime}");