Add support for all rope coil types.
This commit is contained in:
parent
079541d4c9
commit
50337a1d2f
2 changed files with 20 additions and 6 deletions
|
|
@ -295,14 +295,15 @@ namespace TShockAPI
|
||||||
{
|
{
|
||||||
args.Player.LastKilledProjectile = 0;
|
args.Player.LastKilledProjectile = 0;
|
||||||
}
|
}
|
||||||
else if (editData == TileID.MysticSnakeRope)
|
else if (CoilTileIds.Contains(editData))
|
||||||
{
|
{
|
||||||
//projectile should be the same X coordinate as all tile places
|
//projectile should be the same X coordinate as all tile places
|
||||||
if (!args.Player.RecentlyCreatedProjectiles.Any(p => Main.projectile[p.Index].type == ProjectileID.MysticSnakeCoil &&
|
if (!args.Player.RecentlyCreatedProjectiles.Any(p => GetDataHandlers.projectileCreatesTile.ContainsKey(Main.projectile[p.Index].type) &&
|
||||||
Math.Abs((int)(Main.projectile[p.Index].position.X / 16f) - tileX) <= Math.Abs(Main.projectile[p.Index].velocity.X)))
|
Math.Abs((int)(Main.projectile[p.Index].position.X / 16f) - tileX) <= Math.Abs(Main.projectile[p.Index].velocity.X) &&
|
||||||
|
GetDataHandlers.projectileCreatesTile[Main.projectile[p.Index].type] == editData))
|
||||||
{
|
{
|
||||||
TShock.Log.ConsoleDebug("Bouncer / OnTileEdit rejected from (inconceivable mystic snake rope) {0} {1} {2}", args.Player.Name, action, editData);
|
TShock.Log.ConsoleDebug("Bouncer / OnTileEdit rejected from (inconceivable rope coil) {0} {1} {2}", args.Player.Name, action, editData);
|
||||||
Console.WriteLine("Bouncer / OnTileEdit rejected from (inconceivable mystic snake rope) {0} {1} {2}", args.Player.Name, action, editData);
|
Console.WriteLine("Bouncer / OnTileEdit rejected from (inconceivable rope coil) {0} {1} {2}", args.Player.Name, action, editData);
|
||||||
args.Player.SendTileSquare(tileX, tileY, 1);
|
args.Player.SendTileSquare(tileX, tileY, 1);
|
||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -3630,7 +3630,20 @@ namespace TShockAPI
|
||||||
{ ProjectileID.EbonsandBallGun, TileID.Ebonsand },
|
{ ProjectileID.EbonsandBallGun, TileID.Ebonsand },
|
||||||
{ ProjectileID.PearlSandBallGun, TileID.Pearlsand },
|
{ ProjectileID.PearlSandBallGun, TileID.Pearlsand },
|
||||||
{ ProjectileID.CrimsandBallGun, TileID.Crimsand },
|
{ ProjectileID.CrimsandBallGun, TileID.Crimsand },
|
||||||
{ ProjectileID.MysticSnakeCoil, TileID.MysticSnakeRope }
|
{ ProjectileID.MysticSnakeCoil, TileID.MysticSnakeRope },
|
||||||
|
{ ProjectileID.RopeCoil, TileID.Rope },
|
||||||
|
{ ProjectileID.SilkRopeCoil, TileID.SilkRope },
|
||||||
|
{ ProjectileID.VineRopeCoil, TileID.VineRope },
|
||||||
|
{ ProjectileID.WebRopeCoil, TileID.WebRope }
|
||||||
|
};
|
||||||
|
|
||||||
|
internal static List<int> CoilTileIds = new List<int>()
|
||||||
|
{
|
||||||
|
TileID.MysticSnakeRope,
|
||||||
|
TileID.Rope,
|
||||||
|
TileID.SilkRope,
|
||||||
|
TileID.VineRope,
|
||||||
|
TileID.WebRope
|
||||||
};
|
};
|
||||||
|
|
||||||
internal static Dictionary<int, LiquidType> projectileCreatesLiquid = new Dictionary<int, LiquidType>
|
internal static Dictionary<int, LiquidType> projectileCreatesLiquid = new Dictionary<int, LiquidType>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue