Skip to content

Commit

Permalink
Merge pull request #148 from InvalidArgument3/initialversion
Browse files Browse the repository at this point in the history
attempt to make slipspace drop only one gps on the warpee
  • Loading branch information
InvalidArgument3 authored Oct 19, 2024
2 parents 7b622fb + d5e657b commit 0f8f191
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions Slipspace Engine/Data/Scripts/WarpDrive/WarpSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1333,23 +1333,20 @@ public void Dewarp(bool Collision = false)
{
Vector3D exitPosition = grid.MainGrid.PositionComp.GetPosition();

// Get faction color
// Get faction color or use a default color
long ownerId = grid.MainGrid.BigOwners.FirstOrDefault();
var faction = MyAPIGateway.Session.Factions.TryGetPlayerFaction(ownerId);
Color gpsColor = Color.Black; // Default color if no faction

if (faction != null)
{
var colorMask = faction.CustomColor;
gpsColor = MyColorPickerConstants.HSVOffsetToHSV(colorMask).HSVtoColor();
}
Color gpsColor = faction != null
? MyColorPickerConstants.HSVOffsetToHSV(faction.CustomColor).HSVtoColor()
: Color.Black; // Default color if no faction

// Add a GPS marker at the grid's exit position for all players
MyVisualScriptLogicProvider.AddGPSForAll(
"Slipspace™ Exit Signature",
"A ship has exited slipspace™ here!",
exitPosition,
gpsColor,
30);
30); // The GPS disappears after 30 seconds
}

if (PlayersInWarpList.Count > 0)
Expand Down

0 comments on commit 0f8f191

Please sign in to comment.