public static void ClientTryStartAction() { var worldObject = ClientWorldObjectInteractHelper.ClientFindWorldObjectAtCurrentMousePosition(); if (worldObject?.ProtoGameObject is not IProtoObjectStructure protoObjectStructure) { return; } if (!SharedIsDeconstructable(protoObjectStructure)) { return; } var currentCharacter = Client.Characters.CurrentPlayerCharacter; var privateState = PlayerCharacter.GetPrivateState(currentCharacter); if (privateState.CurrentActionState is DeconstructionActionState actionState && actionState.WorldObject == worldObject) { // the same object is already Deconstruction return; } SharedStartAction(currentCharacter, worldObject); }
public static void ClientTryStartAction() { var worldObject = ClientWorldObjectInteractHelper.ClientFindWorldObjectAtCurrentMousePosition(); if (worldObject?.ProtoGameObject is not IProtoObjectHackableContainer) { return; } var currentCharacter = Client.Characters.CurrentPlayerCharacter; var privateState = PlayerCharacter.GetPrivateState(currentCharacter); if (privateState.CurrentActionState is HackingActionState actionState && actionState.WorldObject == worldObject) { // the same object is already Hacking return; } SharedStartAction(currentCharacter, worldObject); }
public static void ClientTryStartAction() { var worldObject = ClientWorldObjectInteractHelper.ClientFindWorldObjectAtCurrentMousePosition(); if (!(worldObject?.ProtoStaticWorldObject is IProtoObjectStructure)) { return; } var currentCharacter = Client.Characters.CurrentPlayerCharacter; var privateState = PlayerCharacter.GetPrivateState(currentCharacter); if (privateState.CurrentActionState is ConstructionActionState actionState && actionState.WorldObject == worldObject) { // the same object is already building/repairing return; } SharedStartAction(currentCharacter, worldObject); }