Get osNpcCreate() and osNpcLoadAppearance() to generate a script error if appearance notecard does not exist, rather than returning UUID.Zero or silently failing.

This commit is contained in:
Justin Clark-Casey (justincc)
2012-10-25 03:02:00 +01:00
parent d9aaf51561
commit 8af8319b95
2 changed files with 29 additions and 10 deletions

View File

@@ -2346,11 +2346,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
appearance = new AvatarAppearance();
appearance.Unpack(appearanceOsd);
}
else
{
OSSLError(string.Format("osNpcCreate: Notecard reference '{0}' not found.", notecard));
}
}
if (appearance == null)
return new LSL_Key(UUID.Zero.ToString());
UUID ownerID = UUID.Zero;
if (owned)
ownerID = m_host.OwnerID;
@@ -2415,8 +2416,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
string appearanceSerialized = LoadNotecard(notecard);
if (appearanceSerialized == null)
return;
OSSLError(string.Format("osNpcCreate: Notecard reference '{0}' not found.", notecard));
OSDMap appearanceOsd = (OSDMap)OSDParser.DeserializeLLSDXml(appearanceSerialized);
// OSD a = OSDParser.DeserializeLLSDXml(appearanceSerialized);
// Console.WriteLine("appearanceSerialized {0}", appearanceSerialized);