Apply suggestions from code review
Co-authored-by: Lucas Nicodemus <shank@shanked.me>
This commit is contained in:
parent
8d54033404
commit
16f7c876e1
2 changed files with 3 additions and 3 deletions
|
|
@ -1843,7 +1843,7 @@ namespace TShockAPI
|
||||||
byte style = args.Style;
|
byte style = args.Style;
|
||||||
|
|
||||||
// if npc released outside allowed tile
|
// 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);
|
TShock.Log.ConsoleDebug("Bouncer / OnReleaseNPC rejected out of bounds from {0}", args.Player.Name);
|
||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
|
|
@ -1860,7 +1860,7 @@ namespace TShockAPI
|
||||||
|
|
||||||
// if released npc not from its item (from crafted packet)
|
// if released npc not from its item (from crafted packet)
|
||||||
// e.g. using bunny item to release golden bunny
|
// 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);
|
TShock.Log.ConsoleDebug("Bouncer / OnReleaseNPC rejected npc release from {0}", args.Player.Name);
|
||||||
args.Player.Kick("Trying to release different critter exploit!", true);
|
args.Player.Kick("Trying to release different critter exploit!", true);
|
||||||
|
|
|
||||||
|
|
@ -1666,7 +1666,7 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
public static HandlerList<ReleaseNpcEventArgs> ReleaseNPC = new HandlerList<ReleaseNpcEventArgs>();
|
public static HandlerList<ReleaseNpcEventArgs> ReleaseNPC = new HandlerList<ReleaseNpcEventArgs>();
|
||||||
private static bool OnReleaseNpc(TSPlayer player, MemoryStream data, int _x, int _y, short _type, byte _style)
|
private static bool OnReleaseNpc(TSPlayer player, MemoryStream data, int _x, int _y, short _type, byte _style)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue