diff --git a/Content.Server/Backmen/Economy/WageConsole/WageConsoleSystem.cs b/Content.Server/Backmen/Economy/WageConsole/WageConsoleSystem.cs index 2073368980e..7713cea1414 100644 --- a/Content.Server/Backmen/Economy/WageConsole/WageConsoleSystem.cs +++ b/Content.Server/Backmen/Economy/WageConsole/WageConsoleSystem.cs @@ -61,7 +61,7 @@ private void OnBonusMsg(Entity ent, ref BonusWageRowMsg ar } _adminLogger.Add(LogType.Transactions, LogImpact.Extreme, - $"Player {args.Session.Name} use BonusSystem on accountId {wagePayout.ToAccountNumber.Comp.AccountNumber} with name {wagePayout.ToAccountNumber:entity} and add {args.Wage}"); + $"wage, player {ToPrettyString(args.Session.AttachedEntity.GetValueOrDefault()):player} use bonus on accountId {wagePayout.ToAccountNumber.Comp.AccountNumber} with name {wagePayout.ToAccountNumber:entity} and add {args.Wage}"); QueueLocalEvent(new WagePaydayEvent() { @@ -116,7 +116,7 @@ private void OnEditWageRow(Entity ent, ref SaveEditedWageR } _adminLogger.Add(LogType.Transactions, LogImpact.Extreme, - $"Player {args.Session.Name} use EditPayoutSystem on accountId {wagePayout.ToAccountNumber.Comp.AccountNumber} with name {wagePayout.ToAccountNumber:entity} and set payout to {args.Wage}"); + $"wage, player {ToPrettyString(args.Session.AttachedEntity.GetValueOrDefault()):player} use edit on accountId {wagePayout.ToAccountNumber.Comp.AccountNumber} with name {wagePayout.ToAccountNumber.Owner:entity} and set payout to {args.Wage}"); wagePayout.PayoutAmount = args.Wage; UpdateUserInterface(ent); @@ -132,16 +132,20 @@ private void OnOpenWageRow(Entity ent, ref OpenWageRowMsg return; } + if(!TryComp(wagePayout.FromAccountNumber, out var mdFrom) || + !TryComp(wagePayout.ToAccountNumber, out var mdTp)) + return; + _ui.TrySetUiState(ent, WageUiKey.Key, new OpenEditWageConsoleUi { Row = new UpdateWageRow { Id = wagePayout.Id, - FromId = GetNetEntity(wagePayout.FromAccountNumber), - FromName = Name(wagePayout.FromAccountNumber), + FromId = GetNetEntity(wagePayout.FromAccountNumber, mdFrom), + FromName = Name(wagePayout.FromAccountNumber, mdFrom), FromAccount = wagePayout.FromAccountNumber.Comp.AccountNumber, - ToId = GetNetEntity(wagePayout.ToAccountNumber), - ToName = Name(wagePayout.ToAccountNumber), + ToId = GetNetEntity(wagePayout.ToAccountNumber, mdTp), + ToName = Name(wagePayout.ToAccountNumber, mdTp), ToAccount = wagePayout.ToAccountNumber.Comp.AccountNumber, Wage = wagePayout.PayoutAmount, } @@ -159,15 +163,18 @@ private void UpdateUserInterface(Entity ent) foreach (var wagePayout in _wageManager.PayoutsList) { + if(!TryComp(wagePayout.FromAccountNumber, out var mdFrom) || + !TryComp(wagePayout.ToAccountNumber, out var mdTp)) + continue; msg.Records.Add(new UpdateWageRow { Id = wagePayout.Id, - FromId = GetNetEntity(wagePayout.FromAccountNumber), - FromName = Name(wagePayout.FromAccountNumber), + FromId = GetNetEntity(wagePayout.FromAccountNumber, mdFrom), + FromName = Name(wagePayout.FromAccountNumber,mdFrom), FromAccount = wagePayout.FromAccountNumber.Comp.AccountNumber, - ToId = GetNetEntity(wagePayout.ToAccountNumber), - ToName = Name(wagePayout.ToAccountNumber), + ToId = GetNetEntity(wagePayout.ToAccountNumber, mdTp), + ToName = Name(wagePayout.ToAccountNumber,mdTp), ToAccount = wagePayout.ToAccountNumber.Comp.AccountNumber, Wage = wagePayout.PayoutAmount, });