Make Utils.GetBuffDescription actually return the buff's description & properly read 'buffTime' from the stream. Fixes #1469
This commit is contained in:
parent
9dce68e6e2
commit
5a04b66514
2 changed files with 5 additions and 5 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue