Bouncer OnTileEdit - Fix issue with placing ropes.
This fixes #1980 . The issue came from checking for recently created ropecoil projectile. But didn't actually check if the player is holding a ropecoil item. Because of this, users could not place regular ropes.
This commit is contained in:
parent
b633f60567
commit
fbf7b5791a
2 changed files with 9 additions and 7 deletions
|
|
@ -319,12 +319,14 @@ namespace TShockAPI
|
|||
}
|
||||
else if (CoilTileIds.Contains(editData))
|
||||
{
|
||||
//projectile should be the same X coordinate as all tile places
|
||||
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) &&
|
||||
GetDataHandlers.projectileCreatesTile[Main.projectile[p.Index].type] == editData))
|
||||
/// Handle placement if the user is placing rope that comes from a ropecoil,
|
||||
/// but have not created the ropecoil projectile recently or the projectile was not at the correct coordinate, or the tile that the projectile places does not match the rope it is suposed to place
|
||||
///projectile should be the same X coordinate as all tile places (Note by @Olink)
|
||||
if (ropeCoilPlacements.ContainsKey(selectedItem.netID) &&
|
||||
!args.Player.RecentlyCreatedProjectiles.Any(p => GetDataHandlers.projectileCreatesTile.ContainsKey(p.Type) && GetDataHandlers.projectileCreatesTile[p.Type] == editData &&
|
||||
!p.Killed && Math.Abs((int)(Main.projectile[p.Index].position.X / 16f) - tileX) <= Math.Abs(Main.projectile[p.Index].velocity.X)))
|
||||
{
|
||||
TShock.Log.ConsoleDebug("Bouncer / OnTileEdit rejected from (inconceivable rope coil) {0} {1} {2}", args.Player.Name, action, editData);
|
||||
TShock.Log.ConsoleDebug("Bouncer / OnTileEdit rejected from (inconceivable rope coil) {0} {1} {2} selectedItem:{3} itemCreateTile:{4}", args.Player.Name, action, editData, selectedItem.netID, selectedItem.createTile);
|
||||
args.Player.SendTileSquare(tileX, tileY, 1);
|
||||
args.Handled = true;
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<OutputPath>..\..\..\Debug\ServerPlugins\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
|
|
@ -224,7 +224,7 @@
|
|||
</PropertyGroup>
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties BuildVersion_IncrementBeforeBuild="False" BuildVersion_StartDate="2011/6/17" BuildVersion_BuildVersioningStyle="None.None.None.MonthAndDayStamp" BuildVersion_BuildAction="Both" BuildVersion_UpdateFileVersion="True" BuildVersion_UpdateAssemblyVersion="True" />
|
||||
<UserProperties BuildVersion_UpdateAssemblyVersion="True" BuildVersion_UpdateFileVersion="True" BuildVersion_BuildAction="Both" BuildVersion_BuildVersioningStyle="None.None.None.MonthAndDayStamp" BuildVersion_StartDate="2011/6/17" BuildVersion_IncrementBeforeBuild="False" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue