From af7ee24de4adb1fa02525d52a70b02382002bffb Mon Sep 17 00:00:00 2001 From: White Date: Sun, 5 Jul 2015 11:32:01 +0930 Subject: [PATCH] Fixed /time --- TShockAPI/Commands.cs | 7 ++++++- TShockAPI/TSPlayer.cs | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 72ca87d2..9058e916 100755 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -3739,14 +3739,19 @@ namespace TShockAPI return; } - decimal time = hours + minutes / 60.0m; + decimal time = hours + (minutes / 60.0m); time -= 4.50m; if (time < 0.00m) time += 24.00m; + if (time >= 15.00m) + { TSPlayer.Server.SetTime(false, (double)((time - 15.00m) * 3600.0m)); + } else + { TSPlayer.Server.SetTime(true, (double)(time * 3600.0m)); + } TSPlayer.All.SendInfoMessage("{0} set the time to {1}:{2:D2}.", args.Player.Name, hours, minutes); break; } diff --git a/TShockAPI/TSPlayer.cs b/TShockAPI/TSPlayer.cs index 6a415c41..a7b63814 100755 --- a/TShockAPI/TSPlayer.cs +++ b/TShockAPI/TSPlayer.cs @@ -1027,7 +1027,7 @@ namespace TShockAPI { Main.dayTime = dayTime; Main.time = time; - TSPlayer.All.SendData(PacketTypes.TimeSet, "", 0, 0, Main.sunModY, Main.moonModY); + TSPlayer.All.SendData(PacketTypes.TimeSet, "", dayTime ? 1 : 0, (int)time, Main.sunModY, Main.moonModY); } public void SpawnNPC(int type, string name, int amount, int startTileX, int startTileY, int tileXRange = 100,