summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-02-10 02:12:30 -0200
committerJesusaves <cpntb1@ymail.com>2019-02-10 02:12:30 -0200
commitef6c4a0bfd78b35fdcaafd8258a770769b0f93d5 (patch)
treeaa8e8c338b467f7a95cd758d1f3fca39ecb38252
parent2370dd22316c21d1b621258ed58ba8fe213424df (diff)
downloadserverdata-ef6c4a0bfd78b35fdcaafd8258a770769b0f93d5.tar.gz
serverdata-ef6c4a0bfd78b35fdcaafd8258a770769b0f93d5.tar.bz2
serverdata-ef6c4a0bfd78b35fdcaafd8258a770769b0f93d5.tar.xz
serverdata-ef6c4a0bfd78b35fdcaafd8258a770769b0f93d5.zip
Prevent Cycles from dying because maggot wandered outside crop field
-rw-r--r--npc/005-1-1/main.txt9
1 files changed, 6 insertions, 3 deletions
diff --git a/npc/005-1-1/main.txt b/npc/005-1-1/main.txt
index 8b7ed2642..b52b21f90 100644
--- a/npc/005-1-1/main.txt
+++ b/npc/005-1-1/main.txt
@@ -28,7 +28,8 @@
.@i+=(.@y-.@offy)*.@w;
// Now we add any X beyond .@offx
.@i+=(.@x-.@offx);
- return(sprintf("%03d", .@i));
+ // Do not go out of scope if maggot wander outside the area
+ return(sprintf("%03d", max(0, min(.@i, 168))));
}
npctalk l("Go kill the maggots!");
@@ -132,7 +133,7 @@ OnInteract:
*/
.@mobId=atoi(.@key$);
getmapxy(.@m$, .@x, .@y, UNITTYPE_MOB, .@mobId);
- debugmes("[LOGIC] -------------------------- proccess %d", .@mobId);
+ //debugmes("[LOGIC] -------------------------- proccess %d", .@mobId);
// Destroy the crop if needed
.@cropId$=getcropid(.@x, .@y);
@@ -143,6 +144,7 @@ OnInteract:
disablenpc instance_npcname("#Marggo"+.@cropId$, MARGGO_ID);
}
+ /*
// Tell the Maggot to walk to a random coordinate
// (it may walk backwards due not preserving old data)
// This will cause maggot to abort a counter attack and to never stop
@@ -152,7 +154,8 @@ OnInteract:
unitwalk(.@mobId, 30, 30);
else
unitwalk(.@mobId, .@x+any(1, -1), .@y+any(1, -1));
- debugmes("[LOGIC] ------------------------------------- ai advanced");
+ */
+ //debugmes("[LOGIC] ------------------------------------- ai advanced");
}
htidelete(.@hti);