„Chris.MultiNPC.lsl“ ändern

This commit is contained in:
Christopher 2021-07-29 07:22:52 +00:00
parent 40ad2bcb2c
commit 5d6bfe808c
1 changed files with 14 additions and 2 deletions

View File

@ -20,9 +20,14 @@ default
{
state_entry()
{
m_npcdata = llCSV2List(osGetDataValue("tmp." + llGetKey()));
hardReset();
m_lastTimeCheck = llGetUnixTime();
checkOSPermissions();
readAllNPCPathNC();
state waitingForPlayers;
}
}
@ -318,6 +323,8 @@ doNextScriptStep()
llSay(0, "Unknown command '" + llList2String(lineCommandData, 0) + "' in nc '"+ currentncname +"' on line '" + currentLine + "' failed.");
}
}
osSetDataValue("tmp." + llGetKey(), llList2CSV(m_npcdata));
}
readNPCPathNC(string ncName)
@ -378,8 +385,12 @@ hardReset()
while(dataListCount--)
if(checkDataEntryInDataList(m_npcdata, "npc." + dataListCount))
osNpcRemove((key)getDataEntryFromDataList(m_npcdata, "npc." + dataListCount));
llResetScript();
m_lastTimeCheck = 0;
m_npcdata = [];
osDeleteDataValue("tmp." + llGetKey());
//llResetScript();
}
//Generic Helpers
@ -410,5 +421,6 @@ list setDataEntryInDataList(list _dataList, string _key, string _value)
_dataList += [_key, _value];
return _dataList;
}
return llListReplaceList(_dataList, [_value], _inListPosition + 1, _inListPosition + 1);
}