summaryrefslogtreecommitdiff
path: root/src/interface.c
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2012-04-28 23:34:56 (GMT)
committer jacksonmj <mj-pt@jacksonmj.co.uk>2012-04-28 23:39:18 (GMT)
commit38057065c2b18bd455f150e32348a266ecfc1355 (patch)
tree2e50fb1c556746f75f4db50ec4a4b87efd1a95de /src/interface.c
parent34bfd77aa5210cc66df9902e1bfebba0b5889706 (diff)
downloadpowder-38057065c2b18bd455f150e32348a266ecfc1355.zip
powder-38057065c2b18bd455f150e32348a266ecfc1355.tar.gz
Fix bugs when moving signs
Signs could not be repositioned on top of another sign (dependent on the indices of the two signs), and could not be placed after selecting an element from the menu.
Diffstat (limited to 'src/interface.c')
-rw-r--r--src/interface.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/interface.c b/src/interface.c
index 3ef7ed2..7f7ec65 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -150,15 +150,17 @@ void add_sign_ui(pixel *vid_buf, int mx, int my)
int x0=(XRES-192)/2,y0=(YRES-80)/2,b=1,bq;
ui_edit ed;
+ // if currently moving a sign, stop doing so
+ if (MSIGN!=-1)
+ {
+ MSIGN = -1;
+ return;
+ }
+
// check if it is an existing sign
for (i=0; i<MAXSIGNS; i++)
if (signs[i].text[0])
{
- if (i == MSIGN)
- {
- MSIGN = -1;
- return;
- }
get_sign_pos(i, &x, &y, &w, &h);
if (mx>=x && mx<=x+w && my>=y && my<=y+h)
break;