From ade3fd9568e029b43bf8337a42034e3a5cd867fa Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Sun, 29 Apr 2012 00:11:54 +0100 Subject: Delete signs when cutting; change sign location check when saving Save signs within the original box that was drawn by the user, not within the box that has been expanded to match the wall grid diff --git a/src/powder.c b/src/powder.c index 354c788..e0ddd5c 100644 --- a/src/powder.c +++ b/src/powder.c @@ -2794,6 +2794,7 @@ void clear_area(int area_x, int area_y, int area_w, int area_h) { int cx = 0; int cy = 0; + int i; for (cy=0; cy=area_x && signs[i].x=area_y && signs[i].y=fullX && signs[i].x<=fullX+fullW && signs[i].y>=fullY && signs[i].y<=fullY+fullH) + if(signs[i].text[0] && signs[i].x>=orig_x0 && signs[i].x<=orig_x0+orig_w && signs[i].y>=orig_y0 && signs[i].y<=orig_y0+orig_h) { signsCount++; } @@ -717,7 +717,7 @@ void *build_save_OPS(int *size, int orig_x0, int orig_y0, int orig_w, int orig_h bson_append_start_array(&b, "signs"); for(i = 0; i < MAXSIGNS; i++) { - if(signs[i].text[0] && signs[i].x>=fullX && signs[i].x<=fullX+fullW && signs[i].y>=fullY && signs[i].y<=fullY+fullH) + if(signs[i].text[0] && signs[i].x>=orig_x0 && signs[i].x<=orig_x0+orig_w && signs[i].y>=orig_y0 && signs[i].y<=orig_y0+orig_h) { bson_append_start_object(&b, "sign"); bson_append_string(&b, "text", signs[i].text); @@ -1642,14 +1642,14 @@ void *build_save_PSv(int *size, int orig_x0, int orig_y0, int orig_w, int orig_h j = 0; for (i=0; i=x0 && signs[i].x=y0 && signs[i].y=orig_x0 && signs[i].x=orig_y0 && signs[i].y=x0 && signs[i].x=y0 && signs[i].y=orig_x0 && signs[i].x=orig_y0 && signs[i].y>8; -- cgit v0.9.2-21-gd62e