--- beasts/main.c.orig Sun Mar 5 17:54:40 2000 +++ beasts/main.c Sun Mar 5 17:56:02 2000 @@ -4,6 +4,7 @@ /* Includes */ #include /* time (for seeding) */ +#include #include "beasts.h" #include "beast.h" @@ -243,9 +244,17 @@ void moveman(Direction thatway, Field *field, Hero *hero) { - int step=dir_to_step(thatway, field->x); - int oldpos=field->x*hero->y + hero->x; - int newpos=oldpos+step; + int step; + int oldpos; + int newpos; + sigset_t set; + + sigemptyset(&set); + sigaddset(&set, SIGALRM); + sigprocmask(SIG_BLOCK, &set, NULL); + step=dir_to_step(thatway, field->x); + oldpos=field->x*hero->y + hero->x; + newpos=oldpos+step; if (field->map[newpos]==EMPTY || ((field->map[newpos]==BLOCK) && @@ -253,6 +262,7 @@ field->map[oldpos]=EMPTY; field->map[newpos]=HERO; } else { + sigprocmask(SIG_UNBLOCK, &set, NULL); return; } @@ -297,6 +307,7 @@ /* (*draw_icon)(hero->x, hero->y, HERO); */ (*field_refresh)(); + sigprocmask(SIG_UNBLOCK, &set, NULL); }