- [FIX] Crash if map() used without map surface assigned
- [FIX] Crash on restart, system surfaces not finalized properly (Cacaus crash maybe solved?)
This commit is contained in:
2
mini.cpp
2
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;
|
||||
|
||||
Reference in New Issue
Block a user