Remove unnecessary code from HandleTile()
This commit is contained in:
parent
c305b36168
commit
f2cc3ce89f
1 changed files with 8 additions and 21 deletions
|
|
@ -2154,28 +2154,15 @@ namespace TShockAPI
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ignore rope placement range
|
|
||||||
//if ((editData != TileID.Rope
|
|
||||||
// && editData != TileID.SilkRope
|
|
||||||
// && editData != TileID.VineRope
|
|
||||||
// && editData != TileID.WebRope
|
|
||||||
// && action == EditAction.PlaceTile)
|
|
||||||
// && TShock.CheckRangePermission(args.Player, tileX, tileY))
|
|
||||||
//{
|
|
||||||
// args.Player.SendTileSquare(tileX, tileY, 4);
|
|
||||||
// return true;
|
|
||||||
//}
|
|
||||||
if (TShock.CheckRangePermission(args.Player, tileX, tileY))
|
if (TShock.CheckRangePermission(args.Player, tileX, tileY))
|
||||||
{
|
{
|
||||||
if (action == EditAction.PlaceTile && (editData == TileID.Rope || editData == TileID.SilkRope || editData == TileID.VineRope || editData == TileID.WebRope))
|
if (action == EditAction.PlaceTile && (editData == TileID.Rope || editData == TileID.SilkRope || editData == TileID.VineRope || editData == TileID.WebRope))
|
||||||
{
|
{
|
||||||
args.Player.SendTileSquare(tileX, tileY, 4);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action == EditAction.KillTile || action == EditAction.KillWall && ItemID.Sets.Explosives[selectedItem.netID] && args.Player.RecentFuse == 0)
|
if (action == EditAction.KillTile || action == EditAction.KillWall && ItemID.Sets.Explosives[selectedItem.netID] && args.Player.RecentFuse == 0)
|
||||||
{
|
{
|
||||||
args.Player.SendTileSquare(tileX, tileY, 4);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4036,7 +4023,7 @@ namespace TShockAPI
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// For use with a ToggleGemLock event
|
/// For use with a ToggleGemLock event
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class GemLockToggleEventArgs : HandledEventArgs
|
public class GemLockToggleEventArgs : HandledEventArgs
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// X Location
|
/// X Location
|
||||||
|
|
@ -4057,12 +4044,12 @@ namespace TShockAPI
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static HandlerList<GemLockToggleEventArgs> GemLockToggle;
|
public static HandlerList<GemLockToggleEventArgs> GemLockToggle;
|
||||||
|
|
||||||
private static bool OnGemLockToggle(Int32 x, Int32 y, bool on)
|
private static bool OnGemLockToggle(Int32 x, Int32 y, bool on)
|
||||||
{
|
{
|
||||||
if (GemLockToggle == null)
|
if (GemLockToggle == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var args = new GemLockToggleEventArgs
|
var args = new GemLockToggleEventArgs
|
||||||
{
|
{
|
||||||
X = x,
|
X = x,
|
||||||
Y = y,
|
Y = y,
|
||||||
|
|
@ -4078,12 +4065,12 @@ namespace TShockAPI
|
||||||
var y = (int)args.Data.ReadInt16();
|
var y = (int)args.Data.ReadInt16();
|
||||||
var on = args.Data.ReadBoolean();
|
var on = args.Data.ReadBoolean();
|
||||||
|
|
||||||
if (x < 0 || y < 0 || x >= Main.maxTilesX || y >= Main.maxTilesY)
|
if (x < 0 || y < 0 || x >= Main.maxTilesX || y >= Main.maxTilesY)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OnGemLockToggle(x, y, on))
|
if (OnGemLockToggle(x, y, on))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -4093,17 +4080,17 @@ namespace TShockAPI
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!TShock.Utils.TilePlacementValid(x, y) || (args.Player.Dead && TShock.Config.PreventDeadModification))
|
if (!TShock.Utils.TilePlacementValid(x, y) || (args.Player.Dead && TShock.Config.PreventDeadModification))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TShock.CheckIgnores(args.Player))
|
if (TShock.CheckIgnores(args.Player))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TShock.CheckTilePermission(args.Player, x, y))
|
if (TShock.CheckTilePermission(args.Player, x, y))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue