Fix VoteAvatars which are zombies with custom skins

This commit is contained in:
Terry Hearst 2023-09-11 01:23:57 -04:00
parent 8764546768
commit f3ba03ff45

View file

@ -1,9 +1,5 @@
using HarmonyLib; using HarmonyLib;
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
namespace CustomCosmeticLoader.Patches namespace CustomCosmeticLoader.Patches
@ -20,12 +16,16 @@ namespace CustomCosmeticLoader.Patches
if (!Config.enabled) if (!Config.enabled)
return; return;
// Don't override zombies
if (__instance.widget.cosmeticDisplay.cosmetic.Id == "Zombie")
return;
Texture2D skin = null; Texture2D skin = null;
if (marble.isMyClientMarble()) if (marble.isMyClientMarble())
{ {
skin = Config.skins[Config.currentSkin]; skin = Config.skins[Config.currentSkin];
} }
else else
{ {
if (Config.otherPlayers.ContainsKey(marble.nickname)) if (Config.otherPlayers.ContainsKey(marble.nickname))
skin = Config.skins[Config.otherPlayers[marble.nickname]]; skin = Config.skins[Config.otherPlayers[marble.nickname]];