diff --git a/mini.cpp b/mini.cpp index fd69ab0..68ec0c5 100644 --- a/mini.cpp +++ b/mini.cpp @@ -344,6 +344,7 @@ int main(int argc,char*argv[]){ Mix_Quit(); for (int i=0;i<10;++i) freesurf(i); + dest_surface = source_surface = map_surface = NULL; destroyDisplay(); SDL_Quit(); } @@ -859,6 +860,7 @@ void mset(int celx, int cely, uint8_t snum) { } void map(int celx, int cely, int sx, int sy, uint8_t celw, uint8_t celh, uint8_t layer) { + if (map_surface==NULL) return; //if (celw <= 0 || celh <= 0 || celw >= TILES_WIDTH || celh >= TILES_HEIGHT) return; sx -= ds::cam[0]; sy -= ds::cam[1]; if (sx+celw*8 < ds::clp[0] || sx > ds::clp[2] || sy+celh*8 < ds::clp[1] || sy > ds::clp[3]) return;