From 4be13b1a42f2899c6d2c985777a7501d59b0e4a5 Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Mon, 31 May 2010 08:38:41 -0700 Subject: Fix casting in llParcelMediaCommandList so that it actually, you know, works --- .../Shared/Api/Implementation/LSL_Api.cs | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 75dd615..8c7cc34 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -8925,17 +8925,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api int width = 0; int height = 0; - ParcelMediaCommandEnum? commandToSend = null; + uint commandToSend = 0; float time = 0.0f; // default is from start ScenePresence presence = null; for (int i = 0; i < commandList.Data.Length; i++) { - ParcelMediaCommandEnum command = (ParcelMediaCommandEnum)commandList.Data[i]; + uint command = (uint)(commandList.GetLSLIntegerItem(i)); switch (command) { - case ParcelMediaCommandEnum.Agent: + case (uint)ParcelMediaCommandEnum.Agent: // we send only to one agent if ((i + 1) < commandList.Length) { @@ -8952,25 +8952,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } break; - case ParcelMediaCommandEnum.Loop: + case (uint)ParcelMediaCommandEnum.Loop: loop = 1; commandToSend = command; update = true; //need to send the media update packet to set looping break; - case ParcelMediaCommandEnum.Play: + case (uint)ParcelMediaCommandEnum.Play: loop = 0; commandToSend = command; update = true; //need to send the media update packet to make sure it doesn't loop break; - case ParcelMediaCommandEnum.Pause: - case ParcelMediaCommandEnum.Stop: - case ParcelMediaCommandEnum.Unload: + case (uint)ParcelMediaCommandEnum.Pause: + case (uint)ParcelMediaCommandEnum.Stop: + case (uint)ParcelMediaCommandEnum.Unload: commandToSend = command; break; - case ParcelMediaCommandEnum.Url: + case (uint)ParcelMediaCommandEnum.Url: if ((i + 1) < commandList.Length) { if (commandList.Data[i + 1] is LSL_String) @@ -8983,7 +8983,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } break; - case ParcelMediaCommandEnum.Texture: + case (uint)ParcelMediaCommandEnum.Texture: if ((i + 1) < commandList.Length) { if (commandList.Data[i + 1] is LSL_String) @@ -8996,7 +8996,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } break; - case ParcelMediaCommandEnum.Time: + case (uint)ParcelMediaCommandEnum.Time: if ((i + 1) < commandList.Length) { if (commandList.Data[i + 1] is LSL_Float) @@ -9008,7 +9008,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } break; - case ParcelMediaCommandEnum.AutoAlign: + case (uint)ParcelMediaCommandEnum.AutoAlign: if ((i + 1) < commandList.Length) { if (commandList.Data[i + 1] is LSL_Integer) @@ -9022,7 +9022,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } break; - case ParcelMediaCommandEnum.Type: + case (uint)ParcelMediaCommandEnum.Type: if ((i + 1) < commandList.Length) { if (commandList.Data[i + 1] is LSL_String) @@ -9035,7 +9035,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } break; - case ParcelMediaCommandEnum.Desc: + case (uint)ParcelMediaCommandEnum.Desc: if ((i + 1) < commandList.Length) { if (commandList.Data[i + 1] is LSL_String) @@ -9048,7 +9048,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } break; - case ParcelMediaCommandEnum.Size: + case (uint)ParcelMediaCommandEnum.Size: if ((i + 2) < commandList.Length) { if (commandList.Data[i + 1] is LSL_Integer) @@ -9116,7 +9116,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } - if (commandToSend != null) + if (commandToSend != 0) { // the commandList contained a start/stop/... command, too if (presence == null) -- cgit v1.1