Bug fix: Force cancellation of RCD constructions if the construction type is changed (#26935)

Force cancellation of RCD constructions if the construction type is changed
This commit is contained in:
chromiumboy
2024-04-13 22:01:01 -05:00
committed by DEATHB4DEFEAT
parent 6d61de3054
commit 8cd9f6b215

View File

@@ -231,13 +231,19 @@ public class RCDSystem : EntitySystem
// Exit if the RCD prototype has changed
if (component.ProtoId != args.Event.StartingProtoId)
{
args.Cancel();
return;
}
// Ensure the RCD operation is still valid
var location = GetCoordinates(args.Event.Location);
if (!TryGetMapGridData(location, out var mapGridData))
{
args.Cancel();
return;
}
if (!IsRCDOperationStillValid(uid, component, mapGridData.Value, args.Event.Target, args.Event.User))
args.Cancel();