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:
@@ -230,13 +230,19 @@ public class RCDSystem : EntitySystem
|
|||||||
|
|
||||||
// Exit if the RCD prototype has changed
|
// Exit if the RCD prototype has changed
|
||||||
if (component.ProtoId != args.Event.StartingProtoId)
|
if (component.ProtoId != args.Event.StartingProtoId)
|
||||||
|
{
|
||||||
|
args.Cancel();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Ensure the RCD operation is still valid
|
// Ensure the RCD operation is still valid
|
||||||
var location = GetCoordinates(args.Event.Location);
|
var location = GetCoordinates(args.Event.Location);
|
||||||
|
|
||||||
if (!TryGetMapGridData(location, out var mapGridData))
|
if (!TryGetMapGridData(location, out var mapGridData))
|
||||||
|
{
|
||||||
|
args.Cancel();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!IsRCDOperationStillValid(uid, component, mapGridData.Value, args.Event.Target, args.Event.User))
|
if (!IsRCDOperationStillValid(uid, component, mapGridData.Value, args.Event.Target, args.Event.User))
|
||||||
args.Cancel();
|
args.Cancel();
|
||||||
|
|||||||
Reference in New Issue
Block a user