Fixed bug with moth firing when near edge of screen

This commit is contained in:
Rob Pearce 2009-03-20 07:14:58 +00:00
parent c4a2ec0569
commit e00f108727
3 changed files with 7 additions and 3 deletions

View File

@ -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

View File

@ -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,

6
rc.c
View File

@ -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) {