mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 05:27:38 +03:00
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:
committed by
DEATHB4DEFEAT
parent
6d61de3054
commit
8cd9f6b215
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user