Skip to content

Commit

Permalink
Ignore global actions for disabling interactions due to repair
Browse files Browse the repository at this point in the history
Enables salvage, object selection, pickup, place when objects are broken.
  • Loading branch information
riperiperi committed Oct 26, 2023
1 parent 9da37d0 commit 91a031b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion TSOClient/tso.simantics/Engine/VMThread.cs
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,11 @@ public List<VMPieMenuInteraction> CheckAction(VMQueuedAction action, bool auto =
}
else if (avatar.IsPet && avatar.AvatarState.Permissions < VMTSOAvatarPermissions.Admin) return null; //not allowed

if ((action.Flags & TTABFlags.TSOIsRepair) > 0 != ((action.Callee.MultitileGroup.BaseObject?.TSOState as VMTSOObjectState)?.Broken ?? false)) return null;
bool isActionGlobal = action.ActionRoutine.ID < 4096; // Ignore global actions for disabling interactions due to repair.
bool isRepair = (action.Flags & TTABFlags.TSOIsRepair) > 0;

if ((!isActionGlobal || isRepair) &&
(isRepair != ((action.Callee.MultitileGroup.BaseObject?.TSOState as VMTSOObjectState)?.Broken ?? false))) return null;

uint ownerID = 0;
if (action.Callee is VMGameObject) {
Expand Down

0 comments on commit 91a031b

Please sign in to comment.