From 5a04b6651427dca02018effe87ab4ae208cf48fe Mon Sep 17 00:00:00 2001 From: ProfessorXZ Date: Fri, 8 Sep 2017 21:59:13 +0200 Subject: [PATCH] Make Utils.GetBuffDescription actually return the buff's description & properly read 'buffTime' from the stream. Fixes #1469 --- TShockAPI/GetDataHandlers.cs | 8 ++++---- TShockAPI/Utils.cs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 77e37c03..b593af2c 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -895,14 +895,14 @@ namespace TShockAPI /// /// Time the buff lasts /// - public short Time { get; set; } + public int Time { get; set; } } /// /// PlayerBuff - Called when a player is buffed /// public static HandlerList 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; diff --git a/TShockAPI/Utils.cs b/TShockAPI/Utils.cs index 520bed9c..5081f8e4 100644 --- a/TShockAPI/Utils.cs +++ b/TShockAPI/Utils.cs @@ -465,7 +465,7 @@ namespace TShockAPI /// description 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"; } ///