summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/005-1-1/main.txt14
-rw-r--r--npc/functions/array.txt18
2 files changed, 7 insertions, 25 deletions
diff --git a/npc/005-1-1/main.txt b/npc/005-1-1/main.txt
index e80aaa7b1..8b7ed2642 100644
--- a/npc/005-1-1/main.txt
+++ b/npc/005-1-1/main.txt
@@ -136,11 +136,11 @@ OnInteract:
// Destroy the crop if needed
.@cropId$=getcropid(.@x, .@y);
- if (array_find2(@DESTROYED, .@cropId$) == -1) {
- debugmes("[LOGIC] -------------------------- crop found");
- array_push(@DESTROYED, .@cropId$);
+ if (array_find(@DESTROYED$, .@cropId$) == -1) {
+ array_push(@DESTROYED$, .@cropId$);
debugmes("[LOGIC] -------------------------- crop destroyed");
- hideonnpc instance_npcname("#Marggo"+.@cropId$, MARGGO_ID);
+ // hideonnpc
+ disablenpc instance_npcname("#Marggo"+.@cropId$, MARGGO_ID);
}
// Tell the Maggot to walk to a random coordinate
@@ -195,10 +195,10 @@ OnFinish:
deltimer("Nylo#Marggo::OnSpawn");
deltimer("Nylo#Marggo::OnFinish");
MARGGO_ID=0;
- .@trueratio=100*getarraysize(@DESTROYED)/169;
+ .@trueratio=100*getarraysize(@DESTROYED$)/169;
.@ratio=100-.@trueratio;
- debugmes("Player lost %d crops", getarraysize(@DESTROYED));
- deletearray(@DESTROYED);
+ debugmes("Player lost %d crops", getarraysize(@DESTROYED$));
+ deletearray(@DESTROYED$);
mesn l("Nylo");
mes l("You managed to save @@ % of my crops!", .@ratio);
diff --git a/npc/functions/array.txt b/npc/functions/array.txt
index 4da22b6fe..1a106175e 100644
--- a/npc/functions/array.txt
+++ b/npc/functions/array.txt
@@ -71,24 +71,6 @@ function script array_find {
freeloop(false);
return -1;
}
-// array_find2(<array>, <needle>)
-// Simplified version
-// if not found it returns -1
-
-function script array_find2 {
- .@size = getarraysize(getarg(0));
- freeloop(true);
-
- for (.@i = getarrayindex(getarg(0)); .@i < .@size; ++.@i) {
- if (getelementofarray(getarg(0), .@i) == getarg(1)) {
- freeloop(false);
- return true;
- }
- }
-
- freeloop(false);
- return -1;
-}