diff --git a/classes/server/duplimode/boxselect.cs b/classes/server/duplimode/boxselect.cs index bdcf7d0..bbefad8 100644 --- a/classes/server/duplimode/boxselect.cs +++ b/classes/server/duplimode/boxselect.cs @@ -161,6 +161,7 @@ function NDM_BoxSelect::onSelectObject(%this, %client, %obj, %pos, %normal) } else { + %client.ndSelectionBox.ez_zoneBrick = ""; %box = %obj.getWorldBox(); %p1 = getWords(%box, 0, 2); %p2 = getWords(%box, 3, 5); @@ -180,6 +181,9 @@ function NDM_BoxSelect::onSelectObject(%this, %client, %obj, %pos, %normal) if(%client.ndMultiSelect) { if(%obj.getDatablock().isLogicRom) { %box = ndGetBoxFromRom(%obj); + } else if (isObject(%obj.physicalZone)) { + %box = ndGetBoxFromZone(%obj); + %client.ndSelectionBox.ez_zoneBrick = %obj; } else { %box = ndGetPlateBoxFromRayCast(%pos, %normal); } @@ -206,6 +210,15 @@ function ndGetBoxFromRom(%b) { return %bl SPC %bh; } +function ndGetBoxFromZone(%b) { + %z = %b.physicalZone; + %pos = %z.position; + %scale = %z.getScale(); %sx = getWord(%scale, 0); %sy = getWord(%scale, 1); %sz = getWord(%scale, 2); + %bl = %pos; + %bh = vectorAdd(%pos, %sx SPC (-%sy) SPC %sz); + return %bl SPC %bh; +} + //Generic inputs