From 2a682044d6828a7d01dd776c8206050e4bbfad7d Mon Sep 17 00:00:00 2001 From: Chris Taylor Date: Sun, 24 Apr 2011 13:34:59 +0800 Subject: [PATCH] Check if a menu closed in a subfunction before setting it's return value, fixing crash when levels are mismatched in multiplayer; Small tidy up for Xcode project --- CHANGELOG.txt | 4 ++++ d2x-rebirth.xcodeproj/project.pbxproj | 12 ------------ main/newmenu.c | 4 ++++ 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index a369e9b40..6fcd3254f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,9 @@ D2X-Rebirth Changelog +20110424 +-------- +d2x-rebirth.xcodeproj/project.pbxproj, main/newmenu.c: Check if a menu closed in a subfunction before setting it's return value, fixing crash when levels are mismatched in multiplayer; Small tidy up for Xcode project + 20110422 -------- 2d/rle.c, SConstruct, main/segment.h, main/texmerge.c: Expanded possibilities for level authors: RLE- and Texture-cache accepts textures bigger than 64x64, only limit being Texture width must be equal height; Increased maximum amount of Segments from 900 to 9000 - not dynamically allocating them, yet diff --git a/d2x-rebirth.xcodeproj/project.pbxproj b/d2x-rebirth.xcodeproj/project.pbxproj index 57598c38e..479801616 100755 --- a/d2x-rebirth.xcodeproj/project.pbxproj +++ b/d2x-rebirth.xcodeproj/project.pbxproj @@ -676,7 +676,6 @@ EB0420EB0A341042002CC961 /* gamemine.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = gamemine.h; sourceTree = ""; }; EB0420EC0A341042002CC961 /* gamefont.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = gamefont.h; sourceTree = ""; }; EB0420ED0A341042002CC961 /* game.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = game.h; sourceTree = ""; }; - EB0420EE0A341042002CC961 /* fvi_a.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = fvi_a.h; sourceTree = ""; }; EB0420EF0A341042002CC961 /* fvi.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = fvi.h; sourceTree = ""; }; EB0420F00A341042002CC961 /* fuelcen.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = fuelcen.h; sourceTree = ""; }; EB0420F10A341042002CC961 /* collide.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = collide.h; sourceTree = ""; }; @@ -702,12 +701,7 @@ EB092A7F12A25AFB004D9A79 /* messagebox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = messagebox.c; sourceTree = ""; }; EB092A8412A25EB1004D9A79 /* messagebox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = messagebox.c; sourceTree = ""; }; EB092A8512A25EC8004D9A79 /* messagebox.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = messagebox.c; sourceTree = ""; }; - EB092A8712A25EE4004D9A79 /* d3dhelp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = d3dhelp.h; sourceTree = ""; }; - EB092A8812A25EE4004D9A79 /* debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = debug.h; sourceTree = ""; }; - EB092A8912A25EE4004D9A79 /* pch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pch.h; sourceTree = ""; }; EB092A8A12A25EE4004D9A79 /* resource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = resource.h; sourceTree = ""; }; - EB092A8B12A25EE4004D9A79 /* scene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scene.h; sourceTree = ""; }; - EB092A8C12A25EE4004D9A79 /* texture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = texture.h; sourceTree = ""; }; EB092A8D12A25EE4004D9A79 /* wsipx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wsipx.h; sourceTree = ""; }; EB1405E8121044B5002B1CC6 /* physfsx.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = physfsx.c; sourceTree = ""; }; EB28D9A20ECEAF1C00E68E9B /* init.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = init.c; sourceTree = ""; }; @@ -1221,7 +1215,6 @@ EB0420FD0A341042002CC961 /* fireball.h */, EB0420F00A341042002CC961 /* fuelcen.h */, EB0420EF0A341042002CC961 /* fvi.h */, - EB0420EE0A341042002CC961 /* fvi_a.h */, EB0420ED0A341042002CC961 /* game.h */, EB0420EC0A341042002CC961 /* gamefont.h */, EB0420EB0A341042002CC961 /* gamemine.h */, @@ -1376,12 +1369,7 @@ EB092A8612A25EE4004D9A79 /* include */ = { isa = PBXGroup; children = ( - EB092A8712A25EE4004D9A79 /* d3dhelp.h */, - EB092A8812A25EE4004D9A79 /* debug.h */, - EB092A8912A25EE4004D9A79 /* pch.h */, EB092A8A12A25EE4004D9A79 /* resource.h */, - EB092A8B12A25EE4004D9A79 /* scene.h */, - EB092A8C12A25EE4004D9A79 /* texture.h */, EB092A8D12A25EE4004D9A79 /* wsipx.h */, ); path = include; diff --git a/main/newmenu.c b/main/newmenu.c index 8bb06710f..142e74fd0 100644 --- a/main/newmenu.c +++ b/main/newmenu.c @@ -1483,6 +1483,10 @@ int newmenu_handler(window *wind, d_event *event, newmenu *menu) if (menu->subfunction) { int rval = (*menu->subfunction)(menu, event, menu->userdata); + + if (!window_exists(wind)) + return 1; // some subfunction closed the window: bail! + if (rval) { if (rval < -1)