}
else
{
- if (!RequestedColorId.Any())
+ if (RequestedColorId.Any())
{
- if (await sender.Client.ReportCheatAsync(RpcCalls.SetColor, CheatCategory.GameFlow, "Client sent SetColor for a player that didn't request it"))
+ var expected = RequestedColorId.Dequeue();
+
+ while (Game.Players.Any(x => x.Character != null && x.Character != this && x.Character.PlayerInfo.CurrentOutfit.Color == expected))
{
- return false;
+ expected = (ColorType)(((byte)expected + 1) % ColorsCount);
}
- }
- var expected = RequestedColorId.Dequeue();
-
- while (Game.Players.Any(x => x.Character != null && x.Character != this && x.Character.PlayerInfo.CurrentOutfit.Color == expected))
- {
- expected = (ColorType)(((byte)expected + 1) % ColorsCount);
+ if (color != expected)
+ {
+ if (await sender.Client.ReportCheatAsync(RpcCalls.SetColor, CheatCategory.GameFlow, "Client sent SetColor with incorrect color"))
+ {
+ await SetColorAsync(expected);
+ return false;
+ }
+ }
}
-
- if (color != expected)
+ else
{
- if (await sender.Client.ReportCheatAsync(RpcCalls.SetColor, CheatCategory.GameFlow, "Client sent SetColor with incorrect color"))
+ if (await sender.Client.ReportCheatAsync(RpcCalls.SetColor, CheatCategory.GameFlow, "Client sent SetColor for a player that didn't request it"))
{
- await SetColorAsync(expected);
return false;
}
}