From 2f3b6c4b1060a574263c4be114cb33d505ac6e71 Mon Sep 17 00:00:00 2001 From: MW Date: Wed, 11 Apr 2007 12:49:00 +0000 Subject: [PATCH] small improvement to the jvm and test script --- OpenSim.RegionServer/world/WorldScripting.cs | 1 + .../InterpreterLogic.cs | 24 +++++++++++++++++++ bin/script1.txt | 16 +++++++++++-- 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/OpenSim.RegionServer/world/WorldScripting.cs b/OpenSim.RegionServer/world/WorldScripting.cs index 83838b405f..2f85869711 100644 --- a/OpenSim.RegionServer/world/WorldScripting.cs +++ b/OpenSim.RegionServer/world/WorldScripting.cs @@ -92,6 +92,7 @@ namespace OpenSim.world { LLVector3 pos = entity.Pos; pos.X = x; + pos.Y = y; Primitive prim = entity as Primitive; // Of course, we really should have asked the physEngine if this is possible, and if not, returned false. prim.UpdatePosition(pos); diff --git a/OpenSim.Scripting.EmbeddedJVM/InterpreterLogic.cs b/OpenSim.Scripting.EmbeddedJVM/InterpreterLogic.cs index 8c895af90b..3b7da35805 100644 --- a/OpenSim.Scripting.EmbeddedJVM/InterpreterLogic.cs +++ b/OpenSim.Scripting.EmbeddedJVM/InterpreterLogic.cs @@ -90,6 +90,20 @@ namespace OpenSim.Scripting.EmbeddedJVM this._mThread.PC += 2; result = true; break; + case 23: + short findex1 = (short)((GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC])); + Float fload = new Float(); + if (this._mThread.currentFrame.LocalVariables[findex1] != null) + { + if (this._mThread.currentFrame.LocalVariables[findex1] is Float) + { + fload.mValue = ((Float)this._mThread.currentFrame.LocalVariables[findex1]).mValue; + this._mThread.currentFrame.OpStack.Push(fload); + } + } + this._mThread.PC++; + result = true; + break; case 26: if (this._mThread.currentFrame.LocalVariables[0] != null) { @@ -162,6 +176,16 @@ namespace OpenSim.Scripting.EmbeddedJVM } result = true; break; + case 56: + short findex = (short)((GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC] )); + BaseType fstor = this._mThread.currentFrame.OpStack.Pop(); + if (fstor is Float) + { + this._mThread.currentFrame.LocalVariables[findex] = (Float)fstor; + } + this._mThread.PC++; + result = true; + break; case 59: BaseType baset = this._mThread.currentFrame.OpStack.Pop(); if (baset is Int) diff --git a/bin/script1.txt b/bin/script1.txt index dd67c5027f..63780c29a0 100644 --- a/bin/script1.txt +++ b/bin/script1.txt @@ -7,7 +7,9 @@ int avid = OpenSimAPI.GetRandomAvatarID(); float x = OpenSimAPI.GetEntityPositionX(own); float avx = OpenSimAPI.GetEntityPositionX(avid); - + float y = OpenSimAPI.GetEntityPositionY(own); + float avy = OpenSimAPI.GetEntityPositionY(avid); + if(x> avx) { x = x -1f; @@ -16,7 +18,17 @@ { x = x+ 1f; } - OpenSimAPI.SetEntityPosition(own, x, 0, 0); + + if(y > avy) + { + y= y -1f; + } + else + { + y = y +1f; + } + + OpenSimAPI.SetEntityPosition(own, x, y, 0); } } \ No newline at end of file