summaryrefslogtreecommitdiffstats
path: root/games/naev/files/patch-src_land.c
diff options
context:
space:
mode:
Diffstat (limited to 'games/naev/files/patch-src_land.c')
-rw-r--r--games/naev/files/patch-src_land.c137
1 files changed, 0 insertions, 137 deletions
diff --git a/games/naev/files/patch-src_land.c b/games/naev/files/patch-src_land.c
deleted file mode 100644
index c209360..0000000
--- a/games/naev/files/patch-src_land.c
+++ /dev/null
@@ -1,137 +0,0 @@
-# Origin: https://github.com/naev/naev/commit/74b9a086a20f80f21ce2f3866b31318e651a6235
-# Subject: Turn player_missions in an array of pointers
-# Origin: https://github.com/naev/naev/commit/9fd2a7dcb3690bc1befe7f9a05d02e204dcfe8a1
-# Subject: Avoid regenerating the land tabs over top of themselves
-# Origin: https://github.com/naev/naev/commit/b9bad809027529c0b0e95d9b8a011cb880229a5d
-# Subject: Fixed "buy map" button not showing up until after land hooks.
-
---- src/land.c.orig 2015-03-05 22:11:11 UTC
-+++ src/land.c
-@@ -69,6 +69,8 @@
- #define has_visited(f) (land_visited & (f)) /**< Check if player has visited. */
- static unsigned int land_visited = 0; /**< Contains what the player visited. */
-
-+/* Which tabs have been generated by their respective open functions. */
-+unsigned int land_generated = 0;
-
- /*
- * land variables
-@@ -187,6 +189,9 @@ static void commodity_exchange_open( uns
- char **goods;
- int w, h;
-
-+ /* Mark as generated. */
-+ land_tabGenerate(LAND_WINDOW_COMMODITY);
-+
- /* Get window dimensions. */
- window_dimWindow( wid, &w, &h );
-
-@@ -566,6 +571,9 @@ static void bar_open( unsigned int wid )
- {
- int w, h, iw, ih, bw, bh, dh, th;
-
-+ /* Mark as generated. */
-+ land_tabGenerate(LAND_WINDOW_BAR);
-+
- /* Set window functions. */
- window_onClose( wid, bar_close );
-
-@@ -822,6 +830,9 @@ static void misn_open( unsigned int wid
- int w, h;
- int y;
-
-+ /* Mark as generated. */
-+ land_tabGenerate(LAND_WINDOW_MISSION);
-+
- /* Get window dimensions. */
- window_dimWindow( wid, &w, &h );
-
-@@ -900,7 +911,7 @@ static void misn_accept( unsigned int wi
-
- /* Make sure player can accept the mission. */
- for (i=0; i<MISSION_MAX; i++)
-- if (player_missions[i].data == NULL) break;
-+ if (player_missions[i]->data == NULL) break;
- if (i >= MISSION_MAX) {
- dialogue_alert("You have too many active missions.");
- return;
-@@ -1180,6 +1191,9 @@ void land_genWindows( int load, int chan
- if (land_wid > 0) {
- land_regen = 2; /* Mark we're regenning. */
- window_destroy(land_wid);
-+
-+ /* Mark tabs as not generated. */
-+ land_generated = 0;
- }
- land_loaded = 0;
-
-@@ -1255,6 +1269,9 @@ void land_genWindows( int load, int chan
- /* 1) Create main tab. */
- land_createMainTab( land_getWid(LAND_WINDOW_MAIN) );
-
-+ /* Add local system map button. */
-+ land_checkAddMap();
-+
- /* 2) Set as landed and run hooks. */
- if (!regen) {
- landed = 1;
-@@ -1274,24 +1291,34 @@ void land_genWindows( int load, int chan
- }
-
- /* 4) Create other tabs. */
-+#define should_open(s, w) \
-+ (planet_hasService(land_planet, s) && (!land_tabGenerated(w)))
-+
-+ /* Things get a bit hairy here. Hooks may have triggered a GUI reload via
-+ * e.g. player.swapShip, so the land tabs may have been generated already
-+ * and we need to check that before regenerating them.
-+ */
-+
- /* Basic - bar + missions */
-- if (planet_hasService(land_planet, PLANET_SERVICE_BAR))
-+ if (should_open( PLANET_SERVICE_BAR, LAND_WINDOW_BAR ))
- bar_open( land_getWid(LAND_WINDOW_BAR) );
-- if (planet_hasService(land_planet, PLANET_SERVICE_MISSIONS))
-+ if (should_open( PLANET_SERVICE_MISSIONS, LAND_WINDOW_MISSION ))
- misn_open( land_getWid(LAND_WINDOW_MISSION) );
- /* Outfits. */
-- if (planet_hasService(land_planet, PLANET_SERVICE_OUTFITS))
-+ if (should_open( PLANET_SERVICE_OUTFITS, LAND_WINDOW_OUTFITS ))
- outfits_open( land_getWid(LAND_WINDOW_OUTFITS) );
- /* Shipyard. */
-- if (planet_hasService(land_planet, PLANET_SERVICE_SHIPYARD))
-+ if (should_open( PLANET_SERVICE_SHIPYARD, LAND_WINDOW_SHIPYARD ))
- shipyard_open( land_getWid(LAND_WINDOW_SHIPYARD) );
- /* Equipment. */
-- if (planet_hasService(land_planet, PLANET_SERVICE_OUTFITS) ||
-- planet_hasService(land_planet, PLANET_SERVICE_SHIPYARD))
-+ if ((planet_hasService(land_planet, PLANET_SERVICE_OUTFITS) ||
-+ planet_hasService(land_planet, PLANET_SERVICE_SHIPYARD)) &&
-+ !land_tabGenerated( LAND_WINDOW_EQUIPMENT ))
- equipment_open( land_getWid(LAND_WINDOW_EQUIPMENT) );
- /* Commodity. */
-- if (planet_hasService(land_planet, PLANET_SERVICE_COMMODITY))
-+ if (should_open( PLANET_SERVICE_COMMODITY, LAND_WINDOW_COMMODITY ))
- commodity_exchange_open( land_getWid(LAND_WINDOW_COMMODITY) );
-+#undef should_open
-
- if (!regen) {
- /* Reset markers if needed. */
-@@ -1310,9 +1337,6 @@ void land_genWindows( int load, int chan
- if (changetab && land_windowsMap[ last_window ] != -1)
- window_tabWinSetActive( land_wid, "tabLand", land_windowsMap[ last_window ] );
-
-- /* Add local system map button. */
-- land_checkAddMap();
--
- /* Refuel if necessary. */
- land_refuel();
-
-@@ -1689,6 +1713,7 @@ void land_cleanup (void)
- land_planet = NULL;
- landed = 0;
- land_visited = 0;
-+ land_generated = 0;
-
- /* Destroy window. */
- if (land_wid > 0)
OpenPOWER on IntegriCloud