refactor(Bouncer): remove RangeCheck for ChestOnQuickStack operations and rename method
Players are not able to quick-stack items into out-of-range chests.
This commit is contained in:
parent
6c500dfa70
commit
0b79a6bee4
1 changed files with 2 additions and 9 deletions
|
|
@ -137,7 +137,7 @@ namespace TShockAPI
|
|||
GetDataHandlers.KillMe += OnKillMe;
|
||||
GetDataHandlers.FishOutNPC += OnFishOutNPC;
|
||||
GetDataHandlers.FoodPlatterTryPlacing += OnFoodPlatterTryPlacing;
|
||||
OTAPI.Hooks.Chest.QuickStack += OnChestOnQuickStack;
|
||||
OTAPI.Hooks.Chest.QuickStack += OnQuickStack;
|
||||
|
||||
|
||||
// The following section is based off Player.PlaceThing_Tiles_PlaceIt and Player.PlaceThing_Tiles_PlaceIt_GetLegacyTileStyle.
|
||||
|
|
@ -2877,7 +2877,7 @@ namespace TShockAPI
|
|||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="args"></param>
|
||||
internal void OnChestOnQuickStack(object sender, OTAPI.Hooks.Chest.QuickStackEventArgs args)
|
||||
internal void OnQuickStack(object sender, OTAPI.Hooks.Chest.QuickStackEventArgs args)
|
||||
{
|
||||
var id = args.ChestIndex;
|
||||
var plr = TShock.Players[args.PlayerId];
|
||||
|
|
@ -2901,13 +2901,6 @@ namespace TShockAPI
|
|||
args.Result = HookResult.Cancel;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!plr.IsInRange(Main.chest[id].x, Main.chest[id].y, 600/16))
|
||||
{
|
||||
TShock.Log.ConsoleDebug(GetString("Bouncer / OnQuickStack rejected from range check from {0}", plr.Name));
|
||||
args.Result = HookResult.Cancel;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
internal void OnSecondUpdate()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue