Fixed crash in snake movement code
This commit is contained in:
parent
519ea7f54d
commit
cb26714a27
7
rc.c
7
rc.c
|
@ -3545,11 +3545,13 @@ int movesprite(sprite_t *s) {
|
|||
int shoot = B_FALSE;
|
||||
if (player && (s->y - player->y <= (TILEH*4)) ) {
|
||||
closeplayer = player;
|
||||
} else {
|
||||
} else if (player2 && (s->y - player2->y <= (TILEH*4))) {
|
||||
closeplayer = player2;
|
||||
} else {
|
||||
closeplayer = NULL;
|
||||
}
|
||||
|
||||
|
||||
if (closeplayer) {
|
||||
if (s->bullet == NULL) { // if we don't already have a bullet
|
||||
// if we are facing the player
|
||||
if ( (closeplayer->x < s->x) && (s->dir == D_LEFT) ) {
|
||||
|
@ -3574,6 +3576,7 @@ int movesprite(sprite_t *s) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* either move or turn around */
|
||||
if (move) {
|
||||
|
|
Loading…
Reference in New Issue