„Chris.MultiNPC.lsl“ ändern
This commit is contained in:
parent
c3a178644a
commit
8289b22344
|
@ -161,6 +161,19 @@ doNextScriptStep()
|
|||
if(llGetListLength(currentNPCDataList) == 0)
|
||||
hardReset("target '"+targetKey+"' not found");
|
||||
|
||||
if(llVecDist(currentNPCPosition, lastPosition) <= 0.1)
|
||||
{
|
||||
currentStuck++;
|
||||
|
||||
if(currentStuck >= 5)
|
||||
osTeleportAgent(currentNPCKey, targetPosition, <0, 0, 0>);
|
||||
}else{
|
||||
currentStuck = 0;
|
||||
}
|
||||
|
||||
m_npcdata = setDataEntryInDataList(m_npcdata, "npc." + currentNPCSlot + ".lastPos", currentNPCPosition);
|
||||
m_npcdata = setDataEntryInDataList(m_npcdata, "npc." + currentNPCSlot + ".stuckCounter", currentStuck);
|
||||
|
||||
if(llVecDist(currentNPCPosition, targetPosition) <= 1)
|
||||
{
|
||||
list newPathList = llDeleteSubList(llCSV2List(getDataEntryFromDataList(m_npcdata, "npc." + currentNPCSlot + ".walkPath")), 0, 0);
|
||||
|
@ -193,7 +206,7 @@ doNextScriptStep()
|
|||
currentStuck++;
|
||||
|
||||
if(currentStuck >= 5)
|
||||
hardReset("npc stuck");
|
||||
osTeleportAgent(currentNPCKey, targetPosition, <0, 0, 0>);
|
||||
}else{
|
||||
currentStuck = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue