User Tools

Site Tools


scriptlib:minerminig

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
scriptlib:minerminig [2015/05/12 00:01]
emerald
scriptlib:minerminig [2015/05/16 15:52] (current)
emerald
Line 73: Line 73:
  
     // As with most things, we need the CID of the creature to act on     // As with most things, we need the CID of the creature to act on
-    local cid = inst.cids(ACTOR_CDEFID)[0];+    local cids = inst.cids(ACTOR_CDEFID)
 +    if(cids.len() == 0) { 
 +        // Just in case they haven'​t spawned (yet), we don't an error 
 +        inst.queue(moveSomewhere,​ 5000); 
 +        return; 
 +    }
  
     /* Instruct the  actor to walk to the chosen location. The     /* Instruct the  actor to walk to the chosen location. The
Line 79: Line 84:
      * the actor arrives      * the actor arrives
      */      */
-    inst.walkThen(cid, location, speed, 0, arrived);+    inst.walkThen(cids[0], location, speed, 0, arrived);
 } }
  
Line 118: Line 123:
  
 inst.queue(moveSomewhere,​ 1000); inst.queue(moveSomewhere,​ 1000);
 +
 </​code>​ </​code>​
scriptlib/minerminig.1431385302.txt.gz · Last modified: 2015/05/12 00:01 by emerald