„Chris.MultiNPC.lsl“ ändern

This commit is contained in:
Christopher 2021-07-29 15:18:32 +00:00
parent 56d6c6ea60
commit 7ec2c18f31
1 changed files with 9 additions and 8 deletions

View File

@ -56,12 +56,12 @@ state running
timer()
{
if((m_lastTimeCheck + 2) <= llGetUnixTime())
hardReset();
hardReset("script timeout");
m_lastTimeCheck = llGetUnixTime();
if(getRealAgentCount() == 0)
hardReset();
hardReset("region empty");
doNextScriptStep();
}
@ -69,15 +69,15 @@ state running
changed(integer change)
{
if (change & CHANGED_INVENTORY)
hardReset();
hardReset("change inventory");
if (change & CHANGED_REGION_START)
hardReset();
hardReset("region start");
}
on_rez(integer start_param)
{
hardReset();
hardReset("reset on rez");
}
}
@ -330,10 +330,10 @@ doNextScriptStep()
vector targetPosition = (vector)getDataEntryFromDataList(m_npcdata, "npc." + currentNPCSlot + ".targetPosition");
if(llGetListLength(currentNPCDataList) == 0)
hardReset();
hardReset("NPC not found");
if(llVecDist(lastKnownPos, currentNPCPosition) <= 0.5)
hardReset();
hardReset("npc is stuck");
if(llVecDist(currentNPCPosition, targetPosition) >= 1)
continue;
@ -474,8 +474,9 @@ checkOSPermissions()
llRemoveInventory("OwnerAppearance" + llGetKey());
}
hardReset()
hardReset(string message)
{
llSay(0, "Hard reset: " + message);
llSetTimerEvent(0);
integer dataListCount = llGetListLength(m_npcdata);
while(dataListCount--)