summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-04-23 01:31:58 -0300
committerJesusaves <cpntb1@ymail.com>2020-04-23 01:31:58 -0300
commit43610bbbda4f84e295f35702a6dff720f3d2d4f4 (patch)
treeb5c68934a42f4d54f6ba0cd0ff641a732a22d974
parentd47fe12623e5af04e210c87eb7b656c753419565 (diff)
downloadserverdata-43610bbbda4f84e295f35702a6dff720f3d2d4f4.tar.gz
serverdata-43610bbbda4f84e295f35702a6dff720f3d2d4f4.tar.bz2
serverdata-43610bbbda4f84e295f35702a6dff720f3d2d4f4.tar.xz
serverdata-43610bbbda4f84e295f35702a6dff720f3d2d4f4.zip
Proposed solution doesn't works (fix code typos)
-rw-r--r--npc/maze0/config.txt20
1 files changed, 13 insertions, 7 deletions
diff --git a/npc/maze0/config.txt b/npc/maze0/config.txt
index 67d972fa4..c729b58bf 100644
--- a/npc/maze0/config.txt
+++ b/npc/maze0/config.txt
@@ -272,8 +272,10 @@ function script ParseMaze {
// MazeFix() → Breaks islands at cost of randomness
// runs after ParseMaze. By now, maze structure is set and working
function script MazeFix {
- return;
// FIXME: BROKEN
+ if (!$@GM_OVERRIDE)
+ return;
+
.@x=0; .@y=0;
debugmes "(%d, %d)", MAZE_MX, MAZE_MY;
while (.@x < MAZE_MX) {
@@ -285,31 +287,35 @@ function script MazeFix {
// It need to have either a way east, or a way south
if (getd(.@v$+"$["+MAZE_EAST+"]") != "WALL")
.@skip=true;
- if (getd(.@v$+"$["+MAZE_SOUTH+"]") != "WALL")
+ if (getd(.@v$+"$["+MAZESOUTH+"]") != "WALL")
.@skip=true;
// If it doesn't, but is an edge, we don't care
- if (.@x == MAZE_MX || .@y == MAZE_MY)
+ // Do note (x,y) only goes to (MX-1, MY-1) because index
+ if (.@x >= MAZE_MX-1 || .@y >= MAZE_MY-1)
.@skip=true;
// Finally skip
if (.@skip) {
.@y++;
- debugmes "(%d, %d)", .@x, .@y;
continue;
}
+ debugmes "(%d, %d) editing from %d", .@x, .@y, getd(.@v$+"_ID");
+
// At least one of those paths must be open
if (any(true, false)) {
// Force the opening to south
.@v2$=MazeVar(.@x, .@y+1);
- setd(.@v$+"$["+MAZE_SOUTH+"]", str(.@x)+"_"+str(.@y+1));
+ setd(.@v$+"$["+MAZESOUTH+"]", str(.@x)+"_"+str(.@y+1));
setd(.@v2$+"$["+MAZENORTH+"]", str(.@x)+"_"+str(.@y));
+ debugmes "Edited NS axis: %s -> %s", .@v$, .@v2$;
} else {
// Force the opening to east
.@v2$=MazeVar(.@x+1, .@y);
- setd(.@v$+"$["+MAZE_SOUTH+"]", str(.@x+1)+"_"+str(.@y));
- setd(.@v2$+"$["+MAZENORTH+"]", str(.@x)+"_"+str(.@y));
+ setd(.@v$+"$["+MAZE_EAST+"]", str(.@x+1)+"_"+str(.@y));
+ setd(.@v2$+"$["+MAZE_WEST+"]", str(.@x)+"_"+str(.@y));
+ debugmes "Edited WE axis: %s -> %s", .@v$, .@v2$;
}
// Fix type
setd(.@v$+"_ID", FindMazeTypeByCon(.@v$));