diff --git a/scripts/commands/rotatefurniture.py b/scripts/commands/rotatefurniture.py index 66b1dc27..804f5fcb 100644 --- a/scripts/commands/rotatefurniture.py +++ b/scripts/commands/rotatefurniture.py @@ -6,7 +6,7 @@ def setup(): def run(core, actor, target, commandString): tarObj = core.objectService.getObject(actor.getTargetId()) - + container = actor.getContainer() parsedMsg = commandString.split(' ', 2) @@ -14,14 +14,14 @@ def run(core, actor, target, commandString): return if core.housingService.getPermissions(actor, container): # i should probably relook into my permissions system... it kinda sucks - if parsedMsg[0] == "pitch": - core.simulationService.transform(tarObj, float(parsedMsg[1]), Point3D(1, 0, 0)) # this is messed up ??? + if parsedMsg[0] == "pitch" and core.collectionService.isComplete(actor, 'force_shui_01'): + core.simulationService.transform(tarObj, float(parsedMsg[1]), Point3D(0, 0, 1)) # this is messed up ??? return elif parsedMsg[0] == "yaw": core.simulationService.transform(tarObj, float(parsedMsg[1]), Point3D(0, 1, 0)) # this is correct return - elif parsedMsg[0] == "roll": - core.simulationService.transform(tarObj, float(parsedMsg[1]), Point3D(0, 0, 1)) # this is messed up ??? + elif parsedMsg[0] == "roll" and core.collectionService.isComplete(actor, 'force_shui_02'): + core.simulationService.transform(tarObj, float(parsedMsg[1]), Point3D(1, 0, 0)) # this is messed up ??? return elif container.getTemplate() == "object/cell/shared_cell.iff": actor.sendSystemMessage("You do not have permission to access that container!", 0) diff --git a/scripts/radial/structure/moveable.py b/scripts/radial/structure/moveable.py index 4bbb4120..7977d62f 100644 --- a/scripts/radial/structure/moveable.py +++ b/scripts/radial/structure/moveable.py @@ -3,6 +3,7 @@ import sys def createRadial(core, owner, target, radials): radials.clear() + radials.add(RadialOptions(0, 7, 1, '')) radials.add(RadialOptions(0, 11, 1, '')) radials.add(RadialOptions(0, 55, 0, '')) diff --git a/src/resources/common/MathUtilities.java b/src/resources/common/MathUtilities.java index 8decf30b..0edc6e07 100644 --- a/src/resources/common/MathUtilities.java +++ b/src/resources/common/MathUtilities.java @@ -68,4 +68,14 @@ public class MathUtilities { BigDecimal dec = new BigDecimal(seconds); return dec.remainder(new BigDecimal(3600)).divide(new BigDecimal(60), BigDecimal.ROUND_FLOOR).intValue(); } + + public float fastInverseSqrt(float x) { + float xHalf = 0.5F * x; + int temp = Float.floatToRawIntBits(x); + temp = 0x5F3759DF - (temp >> 1); // magic + float newX = Float.intBitsToFloat(temp); + newX = newX * (1.5F - xHalf * newX * newX); + return newX; + } + }