Fix sand guns.
This commit is contained in:
parent
f4c332ab2f
commit
e635b6f01a
2 changed files with 17 additions and 0 deletions
|
|
@ -1766,6 +1766,10 @@ namespace TShockAPI
|
||||||
/// The maximum place styles for each tile.
|
/// The maximum place styles for each tile.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static Dictionary<int, int> MaxPlaceStyles = new Dictionary<int, int>();
|
public static Dictionary<int, int> MaxPlaceStyles = new Dictionary<int, int>();
|
||||||
|
/// <summary>
|
||||||
|
/// These projectiles create tiles on death.
|
||||||
|
/// </summary>
|
||||||
|
private static Dictionary<int, int> projectileCreatesTile = new Dictionary<int, int> {{42, 53}, {65, 112}, {68, 116}};
|
||||||
|
|
||||||
private static bool HandleTile(GetDataHandlerArgs args)
|
private static bool HandleTile(GetDataHandlerArgs args)
|
||||||
{
|
{
|
||||||
|
|
@ -1863,6 +1867,7 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
|
|
||||||
Item selectedItem = args.Player.SelectedItem;
|
Item selectedItem = args.Player.SelectedItem;
|
||||||
|
int lastKilledProj = args.Player.LastKilledProjectile;
|
||||||
if (action == EditAction.KillTile && !Main.tileCut[Main.tile[tileX, tileY].type] && !breakableTiles.Contains(Main.tile[tileX, tileY].type))
|
if (action == EditAction.KillTile && !Main.tileCut[Main.tile[tileX, tileY].type] && !breakableTiles.Contains(Main.tile[tileX, tileY].type))
|
||||||
{
|
{
|
||||||
// If the tile is an axe tile and they aren't selecting an axe, they're hacking.
|
// If the tile is an axe tile and they aren't selecting an axe, they're hacking.
|
||||||
|
|
@ -1893,6 +1898,10 @@ namespace TShockAPI
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (action == EditAction.PlaceTile && (projectileCreatesTile.ContainsKey(lastKilledProj) && editData == projectileCreatesTile[lastKilledProj]))
|
||||||
|
{
|
||||||
|
args.Player.LastKilledProjectile = 0;
|
||||||
|
}
|
||||||
else if (action == EditAction.PlaceTile || action == EditAction.PlaceWall)
|
else if (action == EditAction.PlaceTile || action == EditAction.PlaceWall)
|
||||||
{
|
{
|
||||||
if (action == EditAction.PlaceTile && TShock.Config.PreventInvalidPlaceStyle &&
|
if (action == EditAction.PlaceTile && TShock.Config.PreventInvalidPlaceStyle &&
|
||||||
|
|
@ -1901,6 +1910,7 @@ namespace TShockAPI
|
||||||
args.Player.SendTileSquare(tileX, tileY, 4);
|
args.Player.SendTileSquare(tileX, tileY, 4);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If they aren't selecting the item which creates the tile or wall, they're hacking.
|
// If they aren't selecting the item which creates the tile or wall, they're hacking.
|
||||||
if ((editData != 127 && editData != 213) && editData != (action == EditAction.PlaceTile ? selectedItem.createTile : selectedItem.createWall))
|
if ((editData != 127 && editData != 213) && editData != (action == EditAction.PlaceTile ? selectedItem.createTile : selectedItem.createWall))
|
||||||
{
|
{
|
||||||
|
|
@ -2526,6 +2536,8 @@ namespace TShockAPI
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
args.Player.LastKilledProjectile = type;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -301,6 +301,11 @@ namespace TShockAPI
|
||||||
/// Players controls are inverted if using SSC
|
/// Players controls are inverted if using SSC
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool Confused = false;
|
public bool Confused = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The last projectile type this player tried to kill.
|
||||||
|
/// </summary>
|
||||||
|
public int LastKilledProjectile = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether the player is a real, human, player on the server.
|
/// Whether the player is a real, human, player on the server.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue