mirror of
https://github.com/opensim/opensim.git
synced 2026-05-14 18:55:39 +08:00
committed by
UbitUmarov
parent
4d0312f122
commit
ae4ea576d5
@@ -5271,6 +5271,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
m_host.ParentGroup.Damage = (float)damage;
|
||||
}
|
||||
|
||||
public LSL_Float llGetHealth(LSL_String key)
|
||||
{
|
||||
if (UUID.TryParse(key, out UUID agent))
|
||||
{
|
||||
ScenePresence user = World.GetScenePresence(agent);
|
||||
if (user is not null)
|
||||
return user.Health;
|
||||
}
|
||||
return new LSL_Float(-1.0);
|
||||
}
|
||||
|
||||
public void llTeleportAgentHome(string agent)
|
||||
{
|
||||
if (UUID.TryParse(agent, out UUID agentId) && agentId.IsNotZero())
|
||||
|
||||
@@ -373,6 +373,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
void llSetColor(LSL_Vector color, int face);
|
||||
void llSetContentType(LSL_Key id, LSL_Integer type);
|
||||
void llSetDamage(double damage);
|
||||
LSL_Float llGetHealth(LSL_String key);
|
||||
void llSetForce(LSL_Vector force, int local);
|
||||
void llSetForceAndTorque(LSL_Vector force, LSL_Vector torque, int local);
|
||||
void llSetVelocity(LSL_Vector vel, int local);
|
||||
|
||||
@@ -1940,6 +1940,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
m_LSL_Functions.llSetDamage(damage);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public LSL_Float llGetHealth(LSL_String key)
|
||||
{
|
||||
return m_LSL_Functions.llGetHealth(key);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void llSetForce(LSL_Vector force, int local)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user