diff --git a/src/Core/Room.cs b/src/Core/Room.cs index 08cc99a..75e7451 100644 --- a/src/Core/Room.cs +++ b/src/Core/Room.cs @@ -177,6 +177,7 @@ public class Room { } private void OnTimer(Object? source, ElapsedEventArgs e) { + SetTimer(random.NextDouble() * 9 + 1); foreach (var roomClient in Clients) { roomClient.PlayerData.RandomizeDragon(); @@ -188,6 +189,5 @@ public class Room { roomClient.SendSUV(vl, data); } - SetTimer(random.NextDouble() * 9 + 1); } } diff --git a/src/Data/PlayerData.cs b/src/Data/PlayerData.cs index 45a8738..a824365 100644 --- a/src/Data/PlayerData.cs +++ b/src/Data/PlayerData.cs @@ -206,7 +206,7 @@ public class PlayerData { } if (Configuration.ServerConfiguration.MakeChaos) { if (PetGeometry == geometry) - return variables["FP"]; + return Regex.Replace(value, "\\*C\\$[0-9$]*\\*", colour + "*"); PetGeometry = geometry; } if (PetMounted && !Configuration.ServerConfiguration.AllowChaos && @@ -220,11 +220,12 @@ public class PlayerData { } private Random random = new Random(); + private string colour; public void RandomizeDragon() { - var s = "*C$"; + colour = "*C$"; for (var i=0; i<9; ++i) - s=s+random.Next(0, 255).ToString() + "$"; - variables["FP"] = Regex.Replace(variables["FP"], "\\*C\\$[0-9$]*\\*", s + "*"); + colour=colour+random.Next(0, 255).ToString() + "$"; + variables["FP"] = Regex.Replace(variables["FP"], "\\*C\\$[0-9$]*\\*", colour + "*"); } }