From f0275dccf39eadbe50688edfad02c0b9b90a8b25 Mon Sep 17 00:00:00 2001 From: Terry Hearst Date: Tue, 2 Jan 2024 01:24:29 -0500 Subject: [PATCH] Add comment + simplify syntax --- Patches/GhostRaceMarbleControllerPatches.cs | 3 +++ Patches/MarbleWidgetPatches.cs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Patches/GhostRaceMarbleControllerPatches.cs b/Patches/GhostRaceMarbleControllerPatches.cs index bd47df9..2eab5ad 100644 --- a/Patches/GhostRaceMarbleControllerPatches.cs +++ b/Patches/GhostRaceMarbleControllerPatches.cs @@ -5,6 +5,9 @@ using UnityEngine; namespace CustomCosmeticLoader.Patches { + /* + * Hijack the marble of a ghost marble if it's in our custom player list, and apply the custom texture + */ [HarmonyPatch(typeof(GhostRaceMarbleController), nameof(GhostRaceMarbleController.ApplyCosmetics))] internal class GhostRaceMarbleControllerApplyCosmeticsPatch { diff --git a/Patches/MarbleWidgetPatches.cs b/Patches/MarbleWidgetPatches.cs index 6b95009..7cb93c4 100644 --- a/Patches/MarbleWidgetPatches.cs +++ b/Patches/MarbleWidgetPatches.cs @@ -19,9 +19,9 @@ namespace CustomCosmeticLoader.Patches return true; Cosmetic skin = Config.skinNameToHijack == "*" ? - (CosmeticManager.MySkin == null ? CosmeticManager.Skins[0] : CosmeticManager.MySkin) : + (CosmeticManager.MySkin ?? CosmeticManager.Skins[0]) : Shared.SkinToHijack; - Cosmetic hat = CosmeticManager.MyHat == null ? CosmeticManager.Hats[0] : CosmeticManager.MyHat; + Cosmetic hat = CosmeticManager.MyHat ?? CosmeticManager.Hats[0]; __instance.SetCosmetic(skin, hat); Shared.ApplyCustomTexture(__instance.cosmeticDisplay.gameObject);