Update Modify Tile packet.
Only updating. Did not patch any possible exploits. Requesting someone to tend to this when possible.
This commit is contained in:
parent
2d5166cfa4
commit
3b3fa9fc72
2 changed files with 14 additions and 8 deletions
|
|
@ -183,6 +183,7 @@ namespace TShockAPI
|
|||
/// <param name="args">The packet arguments that the event has.</param>
|
||||
internal void OnTileEdit(object sender, GetDataHandlers.TileEditEventArgs args)
|
||||
{
|
||||
// TODO: Add checks on the new edit actions. ReplaceTile, ReplaceWall, TryKillTile, Acutate, PokeLogicGate, SlopePoundTile
|
||||
EditAction action = args.Action;
|
||||
int tileX = args.X;
|
||||
int tileY = args.Y;
|
||||
|
|
|
|||
|
|
@ -2249,17 +2249,17 @@ namespace TShockAPI
|
|||
private static bool HandleTile(GetDataHandlerArgs args)
|
||||
{
|
||||
EditAction action = (EditAction)args.Data.ReadInt8();
|
||||
var tileX = args.Data.ReadInt16();
|
||||
var tileY = args.Data.ReadInt16();
|
||||
var editData = args.Data.ReadInt16();
|
||||
short tileX = args.Data.ReadInt16();
|
||||
short tileY = args.Data.ReadInt16();
|
||||
short editData = args.Data.ReadInt16();
|
||||
EditType type = (action == EditAction.KillTile || action == EditAction.KillWall ||
|
||||
action == EditAction.KillTileNoItem)
|
||||
action == EditAction.KillTileNoItem || action == EditAction.TryKillTile)
|
||||
? EditType.Fail
|
||||
: (action == EditAction.PlaceTile || action == EditAction.PlaceWall)
|
||||
: (action == EditAction.PlaceTile || action == EditAction.PlaceWall || action == EditAction.ReplaceTile || action == EditAction.ReplaceWall)
|
||||
? EditType.Type
|
||||
: EditType.Slope;
|
||||
|
||||
var style = args.Data.ReadInt8();
|
||||
byte style = args.Data.ReadInt8();
|
||||
|
||||
if (OnTileEdit(args.Player, args.Data, tileX, tileY, action, type, editData, style))
|
||||
return true;
|
||||
|
|
@ -3406,7 +3406,13 @@ namespace TShockAPI
|
|||
SlopeTile,
|
||||
FrameTrack,
|
||||
PlaceWire4,
|
||||
KillWire4
|
||||
KillWire4,
|
||||
PokeLogicGate,
|
||||
Acutate,
|
||||
TryKillTile,
|
||||
ReplaceTile,
|
||||
ReplaceWall,
|
||||
SlopePoundTile
|
||||
}
|
||||
public enum EditType
|
||||
{
|
||||
|
|
@ -3414,7 +3420,6 @@ namespace TShockAPI
|
|||
Type,
|
||||
Slope,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The maximum place styles for each tile.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue