Content update for NetEntities (#18935)
This commit is contained in:
@@ -26,11 +26,12 @@ public sealed partial class ToolSystem
|
||||
if (args.Cancelled)
|
||||
return;
|
||||
|
||||
var gridUid = args.Coordinates.GetGridUid(EntityManager);
|
||||
var coords = GetCoordinates(args.Coordinates);
|
||||
var gridUid = coords.GetGridUid(EntityManager);
|
||||
if (gridUid == null)
|
||||
return;
|
||||
var grid = _mapManager.GetGrid(gridUid.Value);
|
||||
var tile = grid.GetTileRef(args.Coordinates);
|
||||
var tile = grid.GetTileRef(coords);
|
||||
|
||||
if (_tileDefinitionManager[tile.Tile.TypeId] is not ContentTileDefinition tileDef
|
||||
|| !tileDef.CanWirecutter
|
||||
@@ -69,9 +70,11 @@ public sealed partial class ToolSystem
|
||||
|| string.IsNullOrEmpty(tileDef.BaseTurf)
|
||||
|| _tileDefinitionManager[tileDef.BaseTurf] is not ContentTileDefinition newDef
|
||||
|| tile.IsBlockedTurf(true))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var ev = new LatticeCuttingCompleteEvent(coordinates);
|
||||
var ev = new LatticeCuttingCompleteEvent(GetNetCoordinates(coordinates));
|
||||
return UseTool(toolEntity, user, toolEntity, component.Delay, component.QualityNeeded, ev);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,14 +31,15 @@ public sealed partial class ToolSystem
|
||||
if (args.Cancelled)
|
||||
return;
|
||||
|
||||
var gridUid = args.Coordinates.GetGridUid(EntityManager);
|
||||
var coords = GetCoordinates(args.Coordinates);
|
||||
var gridUid = coords.GetGridUid(EntityManager);
|
||||
if (!_mapManager.TryGetGrid(gridUid, out var grid))
|
||||
{
|
||||
Log.Error("Attempted to pry from a non-existent grid?");
|
||||
return;
|
||||
}
|
||||
|
||||
var tile = grid.GetTileRef(args.Coordinates);
|
||||
var tile = grid.GetTileRef(coords);
|
||||
var center = _turf.GetTileCenter(tile);
|
||||
if (args.Used != null)
|
||||
{
|
||||
@@ -74,7 +75,7 @@ public sealed partial class ToolSystem
|
||||
if (!tileDef.CanCrowbar && !(tileDef.CanAxe && component.Advanced))
|
||||
return false;
|
||||
|
||||
var ev = new TilePryingDoAfterEvent(coordinates);
|
||||
var ev = new TilePryingDoAfterEvent(GetNetCoordinates(coordinates));
|
||||
|
||||
return UseTool(toolEntity, user, toolEntity, component.Delay, component.QualityNeeded, ev, toolComponent: tool);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user