diff --git a/zscript/spraycan.zs b/zscript/spraycan.zs index 6d894b3..08cb591 100644 --- a/zscript/spraycan.zs +++ b/zscript/spraycan.zs @@ -322,8 +322,12 @@ class SnekTechSprayer : HDWeapon int newIndex = (currentIndex + 1) % patternList.size(); // Set the new CVar. - CVar.GetCVar("snektech_spraypattern", owner.player).SetString(patternList[newIndex]); - currentPattern = CVar.GetCVar("snektech_spraypattern", owner.player).GetString(); + currentPattern = patternList[newIndex]; + // first, update the Actual cvar + if (owner.PlayerNumber() == consoleplayer) + CVar.FindCVar("snektech_spraypattern").SetString(currentPattern); + // then update the per-player copy so the help text is correct + CVar.GetCVar("snektech_spraypattern", owner.player).SetString(currentPattern); owner.A_Log("Selected spray pattern: "..currentPattern, true); // Current pattern is referenced in the help text, so reset