Merge branch 'issue-1485' of https://github.com/bartico6/TShock into issue-1485

This commit is contained in:
quake1337 2017-09-20 17:40:19 +02:00
commit a00950e480
5 changed files with 8 additions and 6 deletions

View file

@ -3872,7 +3872,7 @@ namespace TShockAPI
if (!Main.dayTime)
time += 15.0;
time = time % 24.0;
args.Player.SendInfoMessage("The current time is {0}:{1:D2}.", (int)Math.Floor(time), (int)Math.Round((time % 1.0) * 60.0));
args.Player.SendInfoMessage("The current time is {0}:{1:D2}.", (int)Math.Floor(time), (int)Math.Floor((time % 1.0) * 60.0));
return;
}

View file

@ -895,14 +895,14 @@ namespace TShockAPI
/// <summary>
/// Time the buff lasts
/// </summary>
public short Time { get; set; }
public int Time { get; set; }
}
/// <summary>
/// PlayerBuff - Called when a player is buffed
/// </summary>
public static HandlerList<PlayerBuffEventArgs> PlayerBuff;
private static bool OnPlayerBuff(byte id, byte type, short time)
private static bool OnPlayerBuff(byte id, byte type, int time)
{
if (PlayerBuff == null)
return false;
@ -911,7 +911,7 @@ namespace TShockAPI
{
ID = id,
Type = type,
Time = time,
Time = time
};
PlayerBuff.Invoke(null, args);
return args.Handled;
@ -3425,7 +3425,7 @@ namespace TShockAPI
{
var id = args.Data.ReadInt8();
var type = args.Data.ReadInt8();
var time = args.Data.ReadInt16();
var time = args.Data.ReadInt32();
if (OnPlayerBuff(id, type, time))
return true;

View file

@ -465,7 +465,7 @@ namespace TShockAPI
/// <returns>description</returns>
public string GetBuffDescription(int id)
{
return (id > 0 && id < Main.maxBuffTypes) ? Lang.GetBuffName(id) : "null";
return (id > 0 && id < Main.maxBuffTypes) ? Lang.GetBuffDescription(id) : "null";
}
/// <summary>