Fixed /time

This commit is contained in:
White 2015-07-05 11:32:01 +09:30
parent 789ab2c7cc
commit af7ee24de4
2 changed files with 7 additions and 2 deletions

View file

@ -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;
}

View file

@ -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,