fix back llsensor*: let id be a invalid or empty key again

This commit is contained in:
UbitUmarov
2023-02-10 14:07:04 +00:00
parent 37ce17f927
commit bd41db241f
2 changed files with 6 additions and 6 deletions

View File

@@ -1287,14 +1287,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llSensor(string name, string id, int type, double range, double arc)
{
if(UUID.TryParse(id, out UUID keyID))
m_AsyncCommands.SensorRepeatPlugin.SenseOnce(m_host.LocalId, m_item.ItemID, name, keyID, type, range, arc, m_host);
_ = UUID.TryParse(id, out UUID keyID);
m_AsyncCommands.SensorRepeatPlugin.SenseOnce(m_host.LocalId, m_item.ItemID, name, keyID, type, range, arc, m_host);
}
public void llSensorRepeat(string name, string id, int type, double range, double arc, double rate)
{
if(UUID.TryParse(id, out UUID keyID))
m_AsyncCommands.SensorRepeatPlugin.SetSenseRepeatEvent(m_host.LocalId, m_item.ItemID, name, keyID, type, range, arc, rate, m_host);
_ = UUID.TryParse(id, out UUID keyID);
m_AsyncCommands.SensorRepeatPlugin.SetSenseRepeatEvent(m_host.LocalId, m_item.ItemID, name, keyID, type, range, arc, rate, m_host);
}
public void llSensorRemove()

View File

@@ -326,7 +326,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
// If this is an object sense by key try to get it directly
// rather than getting a list to scan through
if (!ts.keyID.IsZero())
if (ts.keyID.IsNotZero())
{
m_CmdManager.m_ScriptEngine.World.Entities.TryGetValue(ts.keyID, out EntityBase e);
if (e == null)
@@ -624,7 +624,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
// If this is an avatar sense by key try to get them directly
// rather than getting a list to scan through
if (!ts.keyID.IsZero())
if (ts.keyID.IsNotZero())
{
// Try direct lookup by UUID
if (!m_CmdManager.m_ScriptEngine.World.TryGetScenePresence(ts.keyID, out ScenePresence sp))