mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user