aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-10-25 03:02:00 +0100
committerJustin Clark-Casey (justincc)2012-10-25 03:02:00 +0100
commit8af8319b95c14819d0305527f8f6876a334fa3c0 (patch)
tree1b74153bfc34b352b15f79efca9672a870697814 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation
parentWhen scripts generate expected exceptions (e.g. due to checked bad parameter)... (diff)
downloadopensim-SC_OLD-8af8319b95c14819d0305527f8f6876a334fa3c0.zip
opensim-SC_OLD-8af8319b95c14819d0305527f8f6876a334fa3c0.tar.gz
opensim-SC_OLD-8af8319b95c14819d0305527f8f6876a334fa3c0.tar.bz2
opensim-SC_OLD-8af8319b95c14819d0305527f8f6876a334fa3c0.tar.xz
Get osNpcCreate() and osNpcLoadAppearance() to generate a script error if appearance notecard does not exist, rather than returning UUID.Zero or silently failing.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs11
1 files changed, 6 insertions, 5 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 5301ccd..0811519 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -2346,11 +2346,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2346 appearance = new AvatarAppearance(); 2346 appearance = new AvatarAppearance();
2347 appearance.Unpack(appearanceOsd); 2347 appearance.Unpack(appearanceOsd);
2348 } 2348 }
2349 else
2350 {
2351 OSSLError(string.Format("osNpcCreate: Notecard reference '{0}' not found.", notecard));
2352 }
2349 } 2353 }
2350 2354
2351 if (appearance == null)
2352 return new LSL_Key(UUID.Zero.ToString());
2353
2354 UUID ownerID = UUID.Zero; 2355 UUID ownerID = UUID.Zero;
2355 if (owned) 2356 if (owned)
2356 ownerID = m_host.OwnerID; 2357 ownerID = m_host.OwnerID;
@@ -2415,8 +2416,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2415 string appearanceSerialized = LoadNotecard(notecard); 2416 string appearanceSerialized = LoadNotecard(notecard);
2416 2417
2417 if (appearanceSerialized == null) 2418 if (appearanceSerialized == null)
2418 return; 2419 OSSLError(string.Format("osNpcCreate: Notecard reference '{0}' not found.", notecard));
2419 2420
2420 OSDMap appearanceOsd = (OSDMap)OSDParser.DeserializeLLSDXml(appearanceSerialized); 2421 OSDMap appearanceOsd = (OSDMap)OSDParser.DeserializeLLSDXml(appearanceSerialized);
2421// OSD a = OSDParser.DeserializeLLSDXml(appearanceSerialized); 2422// OSD a = OSDParser.DeserializeLLSDXml(appearanceSerialized);
2422// Console.WriteLine("appearanceSerialized {0}", appearanceSerialized); 2423// Console.WriteLine("appearanceSerialized {0}", appearanceSerialized);