diff --git a/src/video.c b/src/video.c index fc6df75..ab9bba0 100644 --- a/src/video.c +++ b/src/video.c @@ -40,6 +40,10 @@ bool screenFreeze = false; */ int initScreen(void) { + if (window) { + SDL_DestroyWindow(window); + } + window = SDL_CreateWindow("Zatacka X", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, WINDOW_W, WINDOW_H, diff --git a/src/zatackax.c b/src/zatackax.c index a0589a1..6b878f1 100644 --- a/src/zatackax.c +++ b/src/zatackax.c @@ -615,6 +615,8 @@ void addToHitMap(unsigned int x, unsigned int y, unsigned char player, player, killer); SDL_UnlockSurface(gameScreen); killPlayer(player, killer); + } else { + SDL_UnlockSurface(gameScreen); } if (olvl >= O_DEBUG) fprintf(stderr, "Player %d crashed at: (%d, %d)\n",