Skip to content

Commit

Permalink
More fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
GreaseMonk committed Apr 9, 2024
1 parent 28cbb66 commit cd8ce5d
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 18 deletions.
12 changes: 7 additions & 5 deletions Content.Server/Cargo/Systems/CargoSystem.Orders.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,21 +190,23 @@ private void OnApproveOrderMessage(EntityUid uid, CargoOrderConsoleComponent com

// Log order approval
_adminLogger.Add(LogType.Action, LogImpact.Low,
$"{ToPrettyString(player):user} approved order [orderId:{order.OrderId}, quantity:{order.OrderQuantity}, product:{order.ProductId}, requester:{order.Requester}, reason:{order.Reason}] with balance at {bank.Balance}");
$"{ToPrettyString(player):user} approved order [orderId:{order.OrderId}, quantity:{order.OrderQuantity}, product:{order.ProductId}, requester:{order.Requester}, reason:{order.Reason}] with balance at {bankAccount.Balance}");

// orderDatabase.Orders.Remove(order); # Frontier
var stationQuery = EntityQuery<StationBankAccountComponent>();

foreach (var stationBankComp in stationQuery)
{
DeductFunds(stationBankComp, (int) -(Math.Floor(cost * 0.4f)));
}
_bankSystem.TryBankWithdraw(player, cost);

UpdateOrders(uid, orderDatabase);
}

private EntityUid? TryFulfillOrder(StationDataComponent stationData, CargoOrderData order, StationCargoOrderDatabaseComponent orderDatabase)
// Frontier - consoleUid is required to find cargo pads
// Only consoleUid is added thats the frontier change
private EntityUid? TryFulfillOrder(EntityUid consoleUid, StationDataComponent stationData, CargoOrderData order, StationCargoOrderDatabaseComponent orderDatabase)
{
// No slots at the trade station
_listEnts.Clear();
Expand All @@ -214,7 +216,7 @@ private void OnApproveOrderMessage(EntityUid uid, CargoOrderConsoleComponent com
// Try to fulfill from any station where possible, if the pad is not occupied.
foreach (var trade in _listEnts)
{
var tradePads = GetCargoPallets(trade, BuySellType.Buy);
var tradePads = GetCargoPallets(consoleUid, trade, BuySellType.Buy);
_random.Shuffle(tradePads);

var freePads = GetFreeCargoPallets(trade, tradePads);
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ private void OnPalletSale(EntityUid uid, CargoPalletConsoleComponent component,
return;
}

if (!SellPallets(uid, gridUid, null, out var price))
if (!SellPallets(uid, gridUid, out var price))
return;

if (TryComp<MarketModifierComponent>(uid, out var priceMod))
Expand Down
15 changes: 8 additions & 7 deletions Content.Server/Medical/SuitSensors/SuitSensorSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public override void Update(float frameTime)
// if (!_singletonServerSystem.TryGetActiveServerAddress<CrewMonitoringServerComponent>(sensor.StationId!.Value, out var address))
if (!_singletonServerSystem.TryGetActiveServerAddress<CrewMonitoringServerComponent>(xform.MapID, out var address))
continue;


sensor.ConnectedServer = address;
}
Expand Down Expand Up @@ -384,18 +384,19 @@ public void SetSensor(EntityUid uid, SuitSensorMode mode, EntityUid? userUid = n
status.TotalDamageThreshold = totalDamageThreshold;
EntityCoordinates coordinates;
var xformQuery = GetEntityQuery<TransformComponent>();
var locationName = "";

if (transform.GridUid != null)
{

coordinates = new EntityCoordinates(transform.GridUid.Value,
_transform.GetInvWorldMatrix(xformQuery.GetComponent(transform.GridUid.Value), xformQuery)
.Transform(_transform.GetWorldPosition(transform, xformQuery)));
/*
coordinates = new EntityCoordinates(uid,
new Vector2(transform.WorldPosition.X, transform.WorldPosition.Y)); //Frontier modification
*/

// Frontier modification
/// Checks if sensor is present on expedition grid
if(TryComp<SalvageExpeditionComponent>(transform.GridUid.Value, out var salvageComp))
Expand All @@ -405,26 +406,26 @@ public void SetSensor(EntityUid uid, SuitSensorMode mode, EntityUid? userUid = n
else
{
var meta = MetaData(transform.GridUid.Value);

locationName = meta.EntityName;
}
}
else if (transform.MapUid != null)
{

coordinates = new EntityCoordinates(transform.MapUid.Value,
_transform.GetWorldPosition(transform, xformQuery));
/*
coordinates = new EntityCoordinates(uid,
new Vector2(transform.WorldPosition.X, transform.WorldPosition.Y)); //Frontier modification
*/

locationName = Loc.GetString("suit-sensor-location-space"); // Frontier modification
}
else
{
coordinates = EntityCoordinates.Invalid;

locationName = Loc.GetString("suit-sensor-location-unknown"); // Frontier modification
}

Expand Down
4 changes: 2 additions & 2 deletions Content.Server/Nutrition/EntitySystems/SliceableFoodSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ private bool TrySliceFood(EntityUid uid, EntityUid user, EntityUid usedItem,
FillSlice(sliceUid, lostSolution);

_audio.PlayPvs(component.Sound, transform.Coordinates, AudioParams.Default.WithVolume(-2));
var ev = new SliceFoodEvent();
RaiseLocalEvent(uid, ref ev);
var ev = new SliceFoodEvent(user, uid, sliceUid);
RaiseLocalEvent(uid, ev);

// Decrease size of item based on count - Could implement in the future
// Bug with this currently is the size in a container is not updated
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/_NF/Contraband/Systems/ContrabandSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ private void SellPallets(EntityUid gridUid, ContrabandPalletConsoleComponent com

if (station != null)
{
var ev = new EntitySoldEvent(station.Value, toSell);
var ev = new EntitySoldEvent(toSell);
RaiseLocalEvent(ref ev);
}

Expand Down
4 changes: 2 additions & 2 deletions Content.Server/_NF/PublicTransit/PublicTransitSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public override void Update(float frameTime)
ignoreActionBlocker: true);
}
}
_shuttles.FTLTravel(uid, shuttle, comp.NextStation, hyperspaceTime: FlyTime, dock: true);
_shuttles.FTLToDock(uid, shuttle, comp.NextStation, hyperspaceTime: FlyTime);

if (TryGetNextStation(out var nextStation) && nextStation is {Valid : true} destination)
comp.NextStation = destination;
Expand Down Expand Up @@ -273,7 +273,7 @@ private void SetupPublicTransit()
{
//we set up a default in case the second time we call it fails for some reason
transitComp.NextStation = destination;
_shuttles.FTLTravel(shuttleUids[0], shuttleComp, destination, hyperspaceTime: 5f, dock: true);
_shuttles.FTLToDock(shuttleUids[0], shuttleComp, destination, hyperspaceTime: 5f);
transitComp.NextTransfer = _timing.CurTime + TimeSpan.FromSeconds(_cfgManager.GetCVar(NF14CVars.PublicTransitWaitTime));

//since the initial cached value of the next station is actually the one we are 'starting' from, we need to run the
Expand Down
6 changes: 6 additions & 0 deletions Content.Shared/Players/ContentPlayerData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ public sealed class ContentPlayerData
/// </summary>
public bool Stealthed { get; set; }

/// <summary>
/// Nyanotrasen - Are they whitelisted? Lets us avoid async.
/// </summary>
[ViewVariables]
public bool Whitelisted { get; set; }

public ContentPlayerData(NetUserId userId, string name)
{
UserId = userId;
Expand Down
2 changes: 2 additions & 0 deletions Content.Shared/VendingMachines/VendingMachineComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public sealed partial class VendingMachineComponent : Component

public bool Broken;

public bool ShouldSayThankYou;

/// <summary>
/// When true, will forcefully throw any object it dispenses
/// </summary>
Expand Down

0 comments on commit cd8ce5d

Please sign in to comment.