wm: glendy

Download patch

ref: 6a6e8a97e01b3946d7e3ce7f7f685a005b658a3b
parent: 45fd1ae9d39e63e71ca624ca3514becc989eb818
author: mkf <mkf@cloud9p.org>
date: Wed May 22 11:32:56 EDT 2024

کن فیکون

--- a/engine.c
+++ b/engine.c
@@ -317,7 +317,7 @@
 		domove(nextdir);
 
 	p = findglenda();
-	if(p.x == 0 || p.x == SzX || p.y == 0 || p.y == SzY)
+	if(p.x == 0 || p.x == SzX-1 || p.y == 0 || p.y == SzY-1)
 		state = Lost;
 }
 
--- a/srv4.c
+++ b/srv4.c
@@ -142,7 +142,7 @@
 		{
 			for(int y = 0; y < SzY; y++)
 			{
-				switch(grid[y][x])
+				switch(grid[x][y])
 				{
 					case Wall: 
 						printclients("w %d %d\n", x, y);
@@ -206,8 +206,8 @@
 	}
 
 	/* engine assumes it's XY, protocol assumes it's YX */
-	y = atoi(xpos);
-	x = atoi(ypos);	
+	x = atoi(xpos);
+	y = atoi(ypos);	
 	
 	dprint("put %d %d\n", x, y);