Apply suggestions from code review

Co-authored-by: Lucas Nicodemus <shank@shanked.me>
This commit is contained in:
tru321 2021-12-08 14:44:03 +08:00 committed by GitHub
parent 8d54033404
commit 16f7c876e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -1843,7 +1843,7 @@ namespace TShockAPI
byte style = args.Style;
// if npc released outside allowed tile
if ( x >= Main.maxTilesX * 16 - 16 || x < 0 || y >= Main.maxTilesY * 16 - 16 || y < 0)
if (x >= Main.maxTilesX * 16 - 16 || x < 0 || y >= Main.maxTilesY * 16 - 16 || y < 0)
{
TShock.Log.ConsoleDebug("Bouncer / OnReleaseNPC rejected out of bounds from {0}", args.Player.Name);
args.Handled = true;
@ -1860,7 +1860,7 @@ namespace TShockAPI
// if released npc not from its item (from crafted packet)
// e.g. using bunny item to release golden bunny
if(args.Player.TPlayer.lastVisualizedSelectedItem.makeNPC != type && args.Player.TPlayer.lastVisualizedSelectedItem.placeStyle != style)
if (args.Player.TPlayer.lastVisualizedSelectedItem.makeNPC != type && args.Player.TPlayer.lastVisualizedSelectedItem.placeStyle != style)
{
TShock.Log.ConsoleDebug("Bouncer / OnReleaseNPC rejected npc release from {0}", args.Player.Name);
args.Player.Kick("Trying to release different critter exploit!", true);

View file

@ -1666,7 +1666,7 @@ namespace TShockAPI
}
/// <summary>
/// Called when player release a NPC, for checking critter released from item.
/// Called when player release a NPC, for checking critter released from item.
/// </summary>
public static HandlerList<ReleaseNpcEventArgs> ReleaseNPC = new HandlerList<ReleaseNpcEventArgs>();
private static bool OnReleaseNpc(TSPlayer player, MemoryStream data, int _x, int _y, short _type, byte _style)