Add some more hacking checks
This commit is contained in:
parent
8c3ae80184
commit
1a242bca6b
2 changed files with 40 additions and 12 deletions
|
|
@ -1742,7 +1742,14 @@ namespace TShockAPI
|
||||||
KillTileNoItem,
|
KillTileNoItem,
|
||||||
PlaceWire,
|
PlaceWire,
|
||||||
KillWire,
|
KillWire,
|
||||||
PoundTile
|
PoundTile,
|
||||||
|
PlaceActuator,
|
||||||
|
KillActuator,
|
||||||
|
PlaceWire2,
|
||||||
|
KillWire2,
|
||||||
|
PlaceWire3,
|
||||||
|
KillWire3,
|
||||||
|
SlopeTile
|
||||||
}
|
}
|
||||||
public enum EditType
|
public enum EditType
|
||||||
{
|
{
|
||||||
|
|
@ -1927,19 +1934,38 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (action == EditAction.PlaceWire)
|
else if (action == EditAction.PlaceWire || action == EditAction.PlaceWire2 || action == EditAction.PlaceWire3)
|
||||||
{
|
{
|
||||||
// If they aren't selecting the wrench, they're hacking.
|
// If they aren't selecting a wrench, they're hacking.
|
||||||
if (args.TPlayer.inventory[args.TPlayer.selectedItem].type != 509)
|
if (selectedItem.type != 509 && selectedItem.type != 850 && selectedItem.type != 851)
|
||||||
{
|
{
|
||||||
args.Player.SendTileSquare(tileX, tileY, 1);
|
args.Player.SendTileSquare(tileX, tileY, 1);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (action == EditAction.KillWire)
|
else if (action == EditAction.KillActuator || action == EditAction.KillWire ||
|
||||||
|
action == EditAction.KillWire2 || action == EditAction.KillWire3)
|
||||||
{
|
{
|
||||||
// If they aren't selecting the wire cutter, they're hacking.
|
// If they aren't selecting the wire cutter, they're hacking.
|
||||||
if (args.TPlayer.inventory[args.TPlayer.selectedItem].type != 510)
|
if (selectedItem.type != 510)
|
||||||
|
{
|
||||||
|
args.Player.SendTileSquare(tileX, tileY, 1);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (action == EditAction.PlaceActuator)
|
||||||
|
{
|
||||||
|
// If they aren't selecting the actuator, they're hacking.
|
||||||
|
if (selectedItem.type != 849)
|
||||||
|
{
|
||||||
|
args.Player.SendTileSquare(tileX, tileY, 1);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (action == EditAction.PoundTile || action == EditAction.SlopeTile)
|
||||||
|
{
|
||||||
|
// If they aren't selecting a hammer, they're hacking.
|
||||||
|
if (selectedItem.hammer == 0)
|
||||||
{
|
{
|
||||||
args.Player.SendTileSquare(tileX, tileY, 1);
|
args.Player.SendTileSquare(tileX, tileY, 1);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -596,7 +596,6 @@ namespace TShockAPI
|
||||||
Lighting.lightMode = 2;
|
Lighting.lightMode = 2;
|
||||||
|
|
||||||
ComputeMaxStyles();
|
ComputeMaxStyles();
|
||||||
|
|
||||||
FixChestStacks();
|
FixChestStacks();
|
||||||
StatTracker = new StatTracker();
|
StatTracker = new StatTracker();
|
||||||
}
|
}
|
||||||
|
|
@ -607,6 +606,8 @@ namespace TShockAPI
|
||||||
for (int i = 0; i < Main.maxItemTypes; i++)
|
for (int i = 0; i < Main.maxItemTypes; i++)
|
||||||
{
|
{
|
||||||
item.netDefaults(i);
|
item.netDefaults(i);
|
||||||
|
if (item.placeStyle > 0)
|
||||||
|
{
|
||||||
if (GetDataHandlers.MaxPlaceStyles.ContainsKey(item.createTile))
|
if (GetDataHandlers.MaxPlaceStyles.ContainsKey(item.createTile))
|
||||||
{
|
{
|
||||||
if (item.placeStyle > GetDataHandlers.MaxPlaceStyles[item.createTile])
|
if (item.placeStyle > GetDataHandlers.MaxPlaceStyles[item.createTile])
|
||||||
|
|
@ -616,6 +617,7 @@ namespace TShockAPI
|
||||||
GetDataHandlers.MaxPlaceStyles.Add(item.createTile, item.placeStyle);
|
GetDataHandlers.MaxPlaceStyles.Add(item.createTile, item.placeStyle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
private void FixChestStacks()
|
private void FixChestStacks()
|
||||||
{
|
{
|
||||||
if (Config.IgnoreChestStacksOnLoad)
|
if (Config.IgnoreChestStacksOnLoad)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue