From e00f108727738c38d7c0535cdf2f3db6a813e170 Mon Sep 17 00:00:00 2001 From: Rob Pearce Date: Fri, 20 Mar 2009 07:14:58 +0000 Subject: [PATCH] Fixed bug with moth firing when near edge of screen --- Makefile | 3 +++ data/levels/level99.dat | 1 + rc.c | 6 +++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index a71063c..077e8a1 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,8 @@ +all: rc edit + rc: rc.c rc.h shared.c shared.h defs.h gcc -Wall -DREV=`./getsvnrev.sh` -orc -g rc.c shared.c `sdl-config --cflags --libs` -I/usr/local/include -L/usr/local/lib -lSDLmain -lSDL -lSDL_image -lSDL_gfx -lSDL_ttf -lSDL_mixer edit: edit.c edit.h shared.c shared.h defs.h gcc -D__EDITOR -Wall -DREV=`./getsvnrev.sh` -oedit -g edit.c shared.c `sdl-config --cflags --libs` -I/usr/local/include -L/usr/local/lib -lSDLmain -lSDL -lSDL_image -lSDL_gfx -lSDL_ttf -lSDL_mixer + diff --git a/data/levels/level99.dat b/data/levels/level99.dat index 1610ddc..f17614e 100644 --- a/data/levels/level99.dat +++ b/data/levels/level99.dat @@ -11,6 +11,7 @@ monsters 158 32 20 1 29 6 7 34 14 +23 17 20 endmonsters exitdir 1 4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, diff --git a/rc.c b/rc.c index 9f58a96..902bc68 100644 --- a/rc.c +++ b/rc.c @@ -5774,11 +5774,11 @@ int movesprite(sprite_t *s) { // die if it leaves screen if (s->x >= (640-TILEW)) { s->dead = D_FINAL; - } else if (s->x <= TILEW) { + } else if (s->x <= (-(s->img->w/2))) { s->dead = D_FINAL; - } else if (s->y >= (480-TILEH)) { + } else if (s->y >= (480+(s->img->h))) { s->dead = D_FINAL; - } else if (s->y <= TILEH) { + } else if (s->y <= 0) { s->dead = D_FINAL; } } else if (s->id == P_RAYGUNBULLET) {