From bd51faa3e7819b00aad680afe0815a42f12c07cd Mon Sep 17 00:00:00 2001 From: Redo Date: Fri, 18 Jul 2025 17:38:38 -0700 Subject: [PATCH] add /toggleOwnership /to --- classes/server/duplimode/plantcopy.cs | 6 +++--- scripts/server/commands.cs | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/classes/server/duplimode/plantcopy.cs b/classes/server/duplimode/plantcopy.cs index 95dd52a..ced3c90 100644 --- a/classes/server/duplimode/plantcopy.cs +++ b/classes/server/duplimode/plantcopy.cs @@ -28,7 +28,7 @@ function NDM_PlantCopy::onChangeMode(%this, %client, %nextMode) { %client.ndSelection.deleteData(); } - %client.ndOwnership = false; + %client.ndOwnership = %client.ndOwnershipPerma || false; } //Kill this mode @@ -36,7 +36,7 @@ function NDM_PlantCopy::onKillMode(%this, %client) { //Destroy the selection %client.ndSelection.delete(); - %client.ndOwnership = false; + %client.ndOwnership = %client.ndOwnershipPerma || false; } @@ -130,7 +130,7 @@ function NDM_PlantCopy::onPlantBrick(%this, %client) %this.conditionalPlant(%client, %client.ndForcePlant, %client.ndOwnership); - %client.ndOwnership = false; + %client.ndOwnership = %client.ndOwnershipPerma || false; } //Cancel Brick diff --git a/scripts/server/commands.cs b/scripts/server/commands.cs index c1d4d70..b80d8e2 100644 --- a/scripts/server/commands.cs +++ b/scripts/server/commands.cs @@ -1,4 +1,3 @@ -//bls 3 // General server commands used to control the new duplicator. // ------------------------------------------------------------------- @@ -587,6 +586,22 @@ function serverCmdOwnership(%client) { function serverCmdOwn(%client) { serverCmdOwnership(%client); } function serverCmdO(%client) { serverCmdOwnership(%client); } +function serverCmdToggleOwnership(%client) { + if(!%client.isAdmin) { + ndmessageClient(%client, '', "\c6Ownership plant is admin only."); + return; + } + %client.ndOwnershipPerma = !%client.ndOwnershipPerma; + %client.ndOwnership = %client.ndOwnershipPerma; + if(%client.ndOwnership) { + ndmessageClient(%client, '', "\c6Bricks will now always be planted in the group of the original owner."); + } else { + ndmessageClient(%client, '', "\c6Bricks will now always be planted in your own group."); + } + %client.ndUpdateBottomPrint(); +} +function serverCmdTO(%client) { serverCmdToggleOwnership(%client); } + //Force plant ///////////////////////////////////////////////////////////////////////////