From 7ec2c18f318c31768a09d2f4d040d140dc8505e1 Mon Sep 17 00:00:00 2001 From: Christopher Date: Thu, 29 Jul 2021 15:18:32 +0000 Subject: [PATCH] =?UTF-8?q?=E2=80=9EChris.MultiNPC.lsl=E2=80=9C=20=C3=A4nd?= =?UTF-8?q?ern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Chris.MultiNPC.lsl | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Chris.MultiNPC.lsl b/Chris.MultiNPC.lsl index 26f9595..4b4bbf0 100644 --- a/Chris.MultiNPC.lsl +++ b/Chris.MultiNPC.lsl @@ -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--)