Skip to content

Commit 38e28a8

Browse files
committed
Fixed wrong color formatting in SendRemoteAdminMessage
1 parent fe90eb9 commit 38e28a8

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

LabExtended/API/Custom/Roles/CustomRole.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,7 @@ public bool Give(ExPlayer player, object? data = null)
267267
if (player?.ReferenceHub == null)
268268
return false;
269269

270-
if (player.Role.CustomRole != null)
271-
player.Role.CustomRole.Remove(player);
270+
player.Role.CustomRole?.Remove(player);
272271

273272
player.Role.CustomRole = this;
274273
player.Role.customRoleData = data;
@@ -324,9 +323,6 @@ public virtual bool Spawn(ExPlayer player, bool useSpawnpoint, bool addInventory
324323
return false;
325324

326325
ignoreRoleChange.Add(player);
327-
328-
player.Role.CustomRole?.Remove(player);
329-
player.Role.customRoleData = data;
330326

331327
if (player.Role.Type != Type)
332328
{
@@ -414,7 +410,8 @@ void AddCustomItem(string customItem)
414410

415411
ignoreRoleChange.Remove(player);
416412

417-
OnSpawned(player, ref player.Role.customRoleData);
413+
if (player.Role.CustomRole != null && player.Role.CustomRole == this)
414+
OnSpawned(player, ref player.Role.customRoleData);
418415
}, 1);
419416

420417
return true;

LabExtended/API/ExPlayer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1577,7 +1577,7 @@ public bool SendRemoteAdminMessage(object content, bool success = true, bool sho
15771577
return false;
15781578

15791579
if (ApiLog.IsTrueColorEnabled)
1580-
msg = msg.FormatTrueColorString("white", true);
1580+
msg = msg.FormatTrueColorString("7", true);
15811581

15821582
if (tag?.Length > 0)
15831583
msg = string.Concat(tag.ToUpper(), "#", msg);

0 commit comments

Comments
 (0)