Makes weapons use GridCoordinates and default to MapCoordinates if grid is invalid
This commit is contained in:
@@ -137,7 +137,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
|
||||
return ammo;
|
||||
}
|
||||
|
||||
public override IEntity TakeProjectile(MapCoordinates spawnAt)
|
||||
public override IEntity TakeProjectile(GridCoordinates spawnAtGrid, MapCoordinates spawnAtMap)
|
||||
{
|
||||
var powerCellEntity = _powerCellContainer.ContainedEntity;
|
||||
|
||||
@@ -166,7 +166,9 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
|
||||
}
|
||||
else
|
||||
{
|
||||
entity = Owner.EntityManager.SpawnEntity(_ammoPrototype, Owner.Transform.GridPosition);
|
||||
entity = Owner.Transform.GridID != GridId.Invalid ?
|
||||
Owner.EntityManager.SpawnEntity(_ammoPrototype, Owner.Transform.GridPosition)
|
||||
: Owner.EntityManager.SpawnEntity(_ammoPrototype, Owner.Transform.MapPosition);
|
||||
}
|
||||
|
||||
if (entity.TryGetComponent(out ProjectileComponent projectileComponent))
|
||||
|
||||
Reference in New Issue
Block a user