Index: head/games/naev/files/patch-src_nlua__misn.c =================================================================== --- head/games/naev/files/patch-src_nlua__misn.c (revision 401619) +++ head/games/naev/files/patch-src_nlua__misn.c (nonexistent) @@ -1,49 +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/155a7fdaf07e1b5549e6314a433425b4187bb33f -# Subject: Don't use a pointer to a pointer - ---- src/nlua_misn.c.orig 2015-02-16 17:49:03 UTC -+++ src/nlua_misn.c -@@ -283,13 +283,13 @@ int misn_runFunc( Mission *misn, const c - if (misn_delete) { - ret = 2; - mission_cleanup( cur_mission ); -- for (i=0; idata == NULL) - break; - - cur_mission = misn_getFromLua(L); -@@ -620,9 +620,9 @@ static int misn_accept( lua_State *L ) - else if (i>=MISSION_MAX) - ret = 1; - else { /* copy it over */ -- memcpy( &player_missions[i], cur_mission, sizeof(Mission) ); -+ memcpy( player_missions[i], cur_mission, sizeof(Mission) ); - memset( cur_mission, 0, sizeof(Mission) ); -- cur_mission = &player_missions[i]; -+ cur_mission = player_missions[i]; - cur_mission->accepted = 1; /* Mark as accepted. */ - - /* Need to change pointer. */ Property changes on: head/games/naev/files/patch-src_nlua__misn.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/games/naev/files/patch-src_hook.c =================================================================== --- head/games/naev/files/patch-src_hook.c (revision 401619) +++ head/games/naev/files/patch-src_hook.c (nonexistent) @@ -1,16 +0,0 @@ -# Origin: https://github.com/naev/naev/commit/74b9a086a20f80f21ce2f3866b31318e651a6235 -# Subject: Turn player_missions in an array of pointers - ---- src/hook.c.orig 2015-02-16 17:49:03 UTC -+++ src/hook.c -@@ -837,8 +837,8 @@ static Mission *hook_getMission( Hook *h - { - int i; - for (i=0; iu.misn.parent) -- return &player_missions[i]; -+ if (player_missions[i]->id == hook->u.misn.parent) -+ return player_missions[i]; - - return NULL; - } Property changes on: head/games/naev/files/patch-src_hook.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/games/naev/files/patch-src_land.c =================================================================== --- head/games/naev/files/patch-src_land.c (revision 401619) +++ head/games/naev/files/patch-src_land.c (nonexistent) @@ -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; idata == 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) Property changes on: head/games/naev/files/patch-src_land.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/games/naev/files/patch-src_land.h =================================================================== --- head/games/naev/files/patch-src_land.h (revision 401619) +++ head/games/naev/files/patch-src_land.h (nonexistent) @@ -1,18 +0,0 @@ -# Origin: https://github.com/naev/naev/commit/9fd2a7dcb3690bc1befe7f9a05d02e204dcfe8a1 -# Subject: Avoid regenerating the land tabs over top of themselves - ---- src/land.h.orig 2015-03-05 22:11:11 UTC -+++ src/land.h -@@ -46,6 +46,12 @@ extern int landed; - extern Planet* land_planet; - - -+/* Tracking for which tabs have been generated. */ -+#define land_tabGenerate(w) (land_generated |= (1 << w)) /**< Mark tab generated. */ -+#define land_tabGenerated(w) (land_generated & (1 << w)) /**< Check if tab has been generated. */ -+extern unsigned int land_generated; -+ -+ - /* - * Main interface. - */ Property changes on: head/games/naev/files/patch-src_land.h ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/games/naev/files/patch-src_mission.c =================================================================== --- head/games/naev/files/patch-src_mission.c (revision 401619) +++ head/games/naev/files/patch-src_mission.c (nonexistent) @@ -1,219 +0,0 @@ -# Origin: https://github.com/naev/naev/commit/74b9a086a20f80f21ce2f3866b31318e651a6235 -# Subject: Turn player_missions in an array of pointers - ---- src/mission.c.orig 2015-02-16 17:49:03 UTC -+++ src/mission.c -@@ -50,7 +50,7 @@ - * current player missions - */ - static unsigned int mission_id = 0; /**< Mission ID generator. */ --Mission player_missions[MISSION_MAX]; /**< Player's active missions. */ -+Mission *player_missions[MISSION_MAX]; /**< Player's active missions. */ - - - /* -@@ -95,7 +95,7 @@ static unsigned int mission_genID (void) - - /* we save mission ids, so check for collisions with player's missions */ - for (i=0; iid) /* mission id was loaded from save */ - return mission_genID(); /* recursively try again */ - return id; - } -@@ -240,7 +240,7 @@ int mission_alreadyRunning( MissionData* - { - int i; - for (i=0; idata == misn) - return 1; - return 0; - } -@@ -416,15 +416,15 @@ void mission_sysMark (void) - - for (i=0; iid == 0) - continue; - /* Must have markers. */ -- if (player_missions[i].markers == NULL) -+ if (player_missions[i]->markers == NULL) - continue; - -- n = array_size( player_missions[i].markers ); -+ n = array_size( player_missions[i]->markers ); - for (j=0; jmarkers[j]; - - /* Add the individual markers. */ - space_addMarker( m->sys, m->type ); -@@ -562,6 +562,30 @@ void mission_cleanup( Mission* misn ) - - - /** -+ * @brief Puts the specified mission at the end of the player_missions array. -+ * -+ * @param pos Mission's position within player_missions -+ */ -+void mission_shift( int pos ) -+{ -+ Mission *misn; -+ -+ if (pos >= (MISSION_MAX-1)) -+ return; -+ -+ /* Store specified mission. */ -+ misn = player_missions[pos]; -+ -+ /* Move other missions down. */ -+ memmove( &player_missions[pos], &player_missions[pos+1], -+ sizeof(Mission*) * (MISSION_MAX - pos - 1) ); -+ -+ /* Put the specified mission at the end of the array. */ -+ player_missions[MISSION_MAX - 1] = misn; -+} -+ -+ -+/** - * @brief Frees MissionData. - * - * @param mission MissionData to free. -@@ -622,8 +646,8 @@ void missions_activateClaims (void) - int i; - - for (i=0; iclaims != NULL) -+ claim_activate( player_missions[i]->claims ); - } - - -@@ -869,9 +893,14 @@ static int mission_parse( MissionData* t - */ - int missions_load (void) - { -- int m; -+ int i, m; - uint32_t bufsize; -- char *buf = ndata_read( MISSION_DATA_PATH, &bufsize ); -+ char *buf; -+ -+ for (i=0; iid != 0) { - xmlw_startElem(writer,"mission"); - - /* data and id are attributes because they must be loaded first */ -- xmlw_attr(writer,"data","%s",player_missions[i].data->name); -- xmlw_attr(writer,"id","%u",player_missions[i].id); -+ xmlw_attr(writer,"data","%s",player_missions[i]->data->name); -+ xmlw_attr(writer,"id","%u",player_missions[i]->id); - -- xmlw_elem(writer,"title","%s",player_missions[i].title); -- xmlw_elem(writer,"desc","%s",player_missions[i].desc); -- xmlw_elem(writer,"reward","%s",player_missions[i].reward); -+ xmlw_elem(writer,"title","%s",player_missions[i]->title); -+ xmlw_elem(writer,"desc","%s",player_missions[i]->desc); -+ xmlw_elem(writer,"reward","%s",player_missions[i]->reward); - - /* Markers. */ - xmlw_startElem( writer, "markers" ); -- if (player_missions[i].markers != NULL) { -- n = array_size( player_missions[i].markers ); -+ if (player_missions[i]->markers != NULL) { -+ n = array_size( player_missions[i]->markers ); - for (j=0; jname); -+ xmlw_attr(writer,"id","%d",player_missions[i]->markers[j].id); -+ xmlw_attr(writer,"type","%d",player_missions[i]->markers[j].type); -+ xmlw_str(writer,"%s", system_getIndex(player_missions[i]->markers[j].sys)->name); - xmlw_endElem(writer); /* "marker" */ - } - } -@@ -990,19 +1023,19 @@ int missions_saveActive( xmlTextWriterPt - - /* Cargo */ - xmlw_startElem(writer,"cargos"); -- for (j=0; jncargo; j++) -+ xmlw_elem(writer,"cargo","%u", player_missions[i]->cargo[j]); - xmlw_endElem(writer); /* "cargos" */ - - /* OSD. */ -- if (player_missions[i].osd > 0) { -+ if (player_missions[i]->osd > 0) { - xmlw_startElem(writer,"osd"); - - /* Save attributes. */ -- items = osd_getItems(player_missions[i].osd, &nitems); -- xmlw_attr(writer,"title","%s",osd_getTitle(player_missions[i].osd)); -+ items = osd_getItems(player_missions[i]->osd, &nitems); -+ xmlw_attr(writer,"title","%s",osd_getTitle(player_missions[i]->osd)); - xmlw_attr(writer,"nitems","%d",nitems); -- xmlw_attr(writer,"active","%d",osd_getActive(player_missions[i].osd)); -+ xmlw_attr(writer,"active","%d",osd_getActive(player_missions[i]->osd)); - - /* Save messages. */ - for (j=0; jclaims ); - xmlw_endElem(writer); /* "claims" */ - - /* Write Lua magic */ - xmlw_startElem(writer,"lua"); -- nxml_persistLua( player_missions[i].L, writer ); -+ nxml_persistLua( player_missions[i]->L, writer ); - xmlw_endElem(writer); /* "lua" */ - - xmlw_endElem(writer); /* "mission" */ -@@ -1078,7 +1111,7 @@ static int missions_parseActive( xmlNode - node = parent->xmlChildrenNode; - do { - if (xml_isNode(node,"mission")) { -- misn = &player_missions[m]; -+ misn = player_missions[m]; - - /* process the attributes to create the mission */ - xmlr_attr(node,"data",buf); Property changes on: head/games/naev/files/patch-src_mission.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/games/naev/files/patch-src_player.c =================================================================== --- head/games/naev/files/patch-src_player.c (revision 401619) +++ head/games/naev/files/patch-src_player.c (nonexistent) @@ -1,44 +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/34651062f0f26b43489214137862148c7cf842c1 -# Subject: Regenerate the player's ship list when removing a ship - ---- src/player.c.orig 2015-03-05 22:11:11 UTC -+++ src/player.c -@@ -665,7 +665,7 @@ credits_t player_shipPrice( char* shipna - */ - void player_rmShip( char* shipname ) - { -- int i; -+ int i, w; - - for (i=0; i 0) { -+ if (player_missions[j]->id > 0) { - /* Now check if it's in the cargo list. */ -- for (k=0; kncargo; k++) { - /* See if it matches a cargo. */ -- if (player_missions[j].cargo[k] == ship->commodities[i].id) { -+ if (player_missions[j]->cargo[k] == ship->commodities[i].id) { - found = 1; - break; - } Property changes on: head/games/naev/files/patch-src_player.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/games/naev/files/patch-src_land__shipyard.c =================================================================== --- head/games/naev/files/patch-src_land__shipyard.c (revision 401619) +++ head/games/naev/files/patch-src_land__shipyard.c (nonexistent) @@ -1,15 +0,0 @@ -# Origin: https://github.com/naev/naev/commit/9fd2a7dcb3690bc1befe7f9a05d02e204dcfe8a1 -# Subject: Avoid regenerating the land tabs over top of themselves - ---- src/land_shipyard.c.orig 2015-03-05 22:11:11 UTC -+++ src/land_shipyard.c -@@ -61,6 +61,9 @@ void shipyard_open( unsigned int wid ) - int y; - const char *buf; - -+ /* Mark as generated. */ -+ land_tabGenerate(LAND_WINDOW_SHIPYARD); -+ - /* Init vars. */ - shipyard_selected = NULL; - Property changes on: head/games/naev/files/patch-src_land__shipyard.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/games/naev/files/patch-src_equipment.c =================================================================== --- head/games/naev/files/patch-src_equipment.c (revision 401619) +++ head/games/naev/files/patch-src_equipment.c (nonexistent) @@ -1,15 +0,0 @@ -# Origin: https://github.com/naev/naev/commit/9fd2a7dcb3690bc1befe7f9a05d02e204dcfe8a1 -# Subject: Avoid regenerating the land tabs over top of themselves - ---- src/equipment.c.orig 2015-03-18 02:22:35 UTC -+++ src/equipment.c -@@ -234,6 +234,9 @@ void equipment_open( unsigned int wid ) - GLfloat colour[4*4]; - const char *buf; - -+ /* Mark as generated. */ -+ land_tabGenerate(LAND_WINDOW_EQUIPMENT); -+ - /* Set global WID. */ - equipment_wid = wid; - Property changes on: head/games/naev/files/patch-src_equipment.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/games/naev/files/patch-src_land__outfits.c =================================================================== --- head/games/naev/files/patch-src_land__outfits.c (revision 401619) +++ head/games/naev/files/patch-src_land__outfits.c (nonexistent) @@ -1,15 +0,0 @@ -# Origin: https://github.com/naev/naev/commit/9fd2a7dcb3690bc1befe7f9a05d02e204dcfe8a1 -# Subject: Avoid regenerating the land tabs over top of themselves - ---- src/land_outfits.c.orig 2015-03-05 22:11:11 UTC -+++ src/land_outfits.c -@@ -95,6 +95,9 @@ void outfits_open( unsigned int wid ) - { - int w, h, iw, ih, bw, bh, off; - -+ /* Mark as generated. */ -+ land_tabGenerate(LAND_WINDOW_OUTFITS); -+ - /* Get dimensions. */ - outfits_getSize( wid, &w, &h, &iw, &ih, &bw, &bh ); - Property changes on: head/games/naev/files/patch-src_land__outfits.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/games/naev/files/patch-src_mission.h =================================================================== --- head/games/naev/files/patch-src_mission.h (revision 401619) +++ head/games/naev/files/patch-src_mission.h (nonexistent) @@ -1,22 +0,0 @@ -# Origin: https://github.com/naev/naev/commit/74b9a086a20f80f21ce2f3866b31318e651a6235 -# Subject: Turn player_missions in an array of pointers - ---- src/mission.h.orig 2015-02-16 17:49:03 UTC -+++ src/mission.h -@@ -129,7 +129,7 @@ typedef struct Mission_ { - * current player missions - */ - #define MISSION_MAX 12 /**< No sense in allowing the player have infinite missions. */ --extern Mission player_missions[MISSION_MAX]; /**< Player's active missions. */ -+extern Mission *player_missions[MISSION_MAX]; /**< Player's active missions. */ - - - /* -@@ -165,6 +165,7 @@ int mission_unlinkCargo( Mission* misn, - */ - int missions_load (void); - void mission_cleanup( Mission* misn ); -+void mission_shift( int pos ); - void missions_free (void); - void missions_cleanup (void); - Property changes on: head/games/naev/files/patch-src_mission.h ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/games/naev/files/patch-src_board.c =================================================================== --- head/games/naev/files/patch-src_board.c (revision 401619) +++ head/games/naev/files/patch-src_board.c (nonexistent) @@ -1,38 +0,0 @@ -# Origin: https://github.com/naev/naev/commit/8b4ceb3c5db7171b65f918f278e2d3a0685bf0f2 -# Subject: Correctly pass boarding ship to pilot board hook -# Origin: https://github.com/naev/naev/commit/0b545ee49f33632e892e242807543d6b386a02af -# Subject: Run pilot board hook for all pilot, not just player - ---- src/board.c.orig 2015-02-16 17:49:03 UTC -+++ src/board.c -@@ -143,7 +143,8 @@ void player_board (void) - hparam[0].u.lp.pilot = p->id; - hparam[1].type = HOOK_PARAM_SENTINEL; - hooks_runParam( "board", hparam ); -- pilot_runHook(p, PILOT_HOOK_BOARD); -+ hparam[0].u.lp.pilot = PLAYER_ID; -+ pilot_runHookParam(p, PILOT_HOOK_BOARD, hparam, 1); - - if (board_stopboard) { - board_boarded = 0; -@@ -526,6 +527,7 @@ static void board_update( unsigned int w - int pilot_board( Pilot *p ) - { - Pilot *target; -+ HookParam hparam[2]; - - /* Make sure target is sane. */ - target = pilot_get(p->target); -@@ -554,6 +556,12 @@ int pilot_board( Pilot *p ) - /* Set time it takes to board. */ - p->ptimer = 3.; - -+ /* Run pilot board hook. */ -+ hparam[0].type = HOOK_PARAM_PILOT; -+ hparam[0].u.lp.pilot = p->id; -+ hparam[1].type = HOOK_PARAM_SENTINEL; -+ pilot_runHookParam(target, PILOT_HOOK_BOARD, hparam, 1); -+ - return 1; - } - Property changes on: head/games/naev/files/patch-src_board.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/games/naev/files/patch-src_nlua__hook.c =================================================================== --- head/games/naev/files/patch-src_nlua__hook.c (revision 401619) +++ head/games/naev/files/patch-src_nlua__hook.c (nonexistent) @@ -1,14 +0,0 @@ -# Origin: https://github.com/naev/naev/commit/74b9a086a20f80f21ce2f3866b31318e651a6235 -# Subject: Turn player_missions in an array of pointers - ---- src/nlua_hook.c.orig 2015-03-17 16:29:43 UTC -+++ src/nlua_hook.c -@@ -246,7 +246,7 @@ static unsigned int hook_generic( lua_St - if (running_mission != NULL) { - /* make sure mission is a player mission */ - for (i=0; iid) -+ if (player_missions[i]->id == running_mission->id) - break; - if (i>=MISSION_MAX) { - WARN("Mission not in stack trying to hook, forgot to run misn.accept()?"); Property changes on: head/games/naev/files/patch-src_nlua__hook.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/games/naev/files/patch-src_npc.c =================================================================== --- head/games/naev/files/patch-src_npc.c (revision 401619) +++ head/games/naev/files/patch-src_npc.c (nonexistent) @@ -1,14 +0,0 @@ -# Origin: https://github.com/naev/naev/commit/74b9a086a20f80f21ce2f3866b31318e651a6235 -# Subject: Turn player_missions in an array of pointers - ---- src/npc.c.orig 2015-02-16 17:49:03 UTC -+++ src/npc.c -@@ -559,7 +559,7 @@ static int npc_approach_giver( NPC_t *np - - /* Make sure player can accept the mission. */ - for (i=0; idata == NULL) - break; - if (i >= MISSION_MAX) { - dialogue_alert("You have too many active missions."); Property changes on: head/games/naev/files/patch-src_npc.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/games/naev/files/patch-src_space.c =================================================================== --- head/games/naev/files/patch-src_space.c (revision 401619) +++ head/games/naev/files/patch-src_space.c (nonexistent) @@ -1,13 +0,0 @@ -# Origin: https://github.com/naev/naev/commit/173bad4a7bab85903575798a51259ff6f3dd42c8 -# Subject: Memory leak fix - ---- src/space.c.orig 2015-02-16 17:49:03 UTC -+++ src/space.c -@@ -2978,6 +2978,7 @@ void space_exit (void) - free(pnt->land_func); - free(pnt->land_msg); - free(pnt->bribe_msg); -+ free(pnt->bribe_ack_msg); - - /* tech */ - if (pnt->tech != NULL) Property changes on: head/games/naev/files/patch-src_space.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/games/naev/files/patch-src_pilot__hook.c =================================================================== --- head/games/naev/files/patch-src_pilot__hook.c (revision 401619) +++ head/games/naev/files/patch-src_pilot__hook.c (nonexistent) @@ -1,44 +0,0 @@ -# Origin: https://github.com/naev/naev/commit/6f4005f921650c1a8930721bbd1c0eab163673f8 -# Subject: * Hook param off by one. -# https://github.com/naev/naev/commit/3ba9cafb369f94115c897717b6f38415348f4c8f -# Subject: * Too many bugs in the code, should fix bugs with pilot hooks when using >1 parameter. - ---- src/pilot_hook.c.orig 2015-02-16 17:49:03 UTC -+++ src/pilot_hook.c -@@ -39,26 +39,26 @@ static int pilot_hookCleanup = 0; /**< A - int pilot_runHookParam( Pilot* p, int hook_type, HookParam* param, int nparam ) - { - int n, i, run, ret; -- HookParam hparam[3], *hdynparam; -+ HookParam hstaparam[5], *hdynparam, *hparam; - - /* Set up hook parameters. */ -- if (nparam <= 1) { -- hparam[0].type = HOOK_PARAM_PILOT; -- hparam[0].u.lp.pilot = p->id; -+ if (nparam <= 3) { -+ hstaparam[0].type = HOOK_PARAM_PILOT; -+ hstaparam[0].u.lp.pilot = p->id; - n = 1; -- if (nparam == 1) { -- memcpy( &hparam[n], param, sizeof(HookParam) ); -- n++; -- } -- hparam[n].type = HOOK_PARAM_SENTINEL; -+ memcpy( &hstaparam[n], param, sizeof(HookParam)*nparam ); -+ n += nparam; -+ hstaparam[n].type = HOOK_PARAM_SENTINEL; - hdynparam = NULL; -+ hparam = hstaparam; - } - else { - hdynparam = malloc( sizeof(HookParam) * (nparam+2) ); - hdynparam[0].type = HOOK_PARAM_PILOT; - hdynparam[0].u.lp.pilot = p->id; - memcpy( &hdynparam[1], param, sizeof(HookParam)*nparam ); -- hdynparam[nparam].type = HOOK_PARAM_SENTINEL; -+ hdynparam[nparam+1].type = HOOK_PARAM_SENTINEL; -+ hparam = hdynparam; - } - - /* Run pilot specific hooks. */ Property changes on: head/games/naev/files/patch-src_pilot__hook.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/games/naev/files/patch-src_info.c =================================================================== --- head/games/naev/files/patch-src_info.c (revision 401619) +++ head/games/naev/files/patch-src_info.c (nonexistent) @@ -1,87 +0,0 @@ -# Origin: https://github.com/naev/naev/commit/74b9a086a20f80f21ce2f3866b31318e651a6235 -# Subject: Turn player_missions in an array of pointers - ---- src/info.c.orig 2015-02-16 17:49:03 UTC -+++ src/info.c -@@ -785,8 +785,8 @@ static void cargo_jettison( unsigned int - /* Get the mission. */ - f = 0; - for (i=0; icommodities[pos].id) { -+ for (j=0; jncargo; j++) { -+ if (player_missions[i]->cargo[j] == player.p->commodities[pos].id) { - f = 1; - break; - } -@@ -799,7 +799,7 @@ static void cargo_jettison( unsigned int - player.p->commodities[pos].id); - return; - } -- misn = &player_missions[i]; -+ misn = player_missions[i]; - - /* We run the "abort" function if it's found. */ - ret = misn_tryRun( misn, "abort" ); -@@ -807,9 +807,7 @@ static void cargo_jettison( unsigned int - /* Now clean up mission. */ - if (ret != 2) { - mission_cleanup( misn ); -- memmove( misn, &player_missions[i+1], -- sizeof(Mission) * (MISSION_MAX-i-1) ); -- memset( &player_missions[MISSION_MAX-1], 0, sizeof(Mission) ); -+ mission_shift(pos); - } - - /* Reset markers. */ -@@ -1005,8 +1003,10 @@ static void mission_menu_genList( unsign - misn_names = malloc(sizeof(char*) * MISSION_MAX); - j = 0; - for (i=0; iid != 0) -+ misn_names[j++] = (player_missions[i]->title != NULL) ? -+ strdup(player_missions[i]->title) : NULL; -+ - if (j==0) { /* no missions */ - misn_names[0] = strdup("No Missions"); - j = 1; -@@ -1035,7 +1035,7 @@ static void mission_menu_update( unsigne - } - - /* Modify the text. */ -- misn = &player_missions[ toolkit_getListPos(wid, "lstMission" ) ]; -+ misn = player_missions[ toolkit_getListPos(wid, "lstMission" ) ]; - window_modifyText( wid, "txtReward", misn->reward ); - window_modifyText( wid, "txtDesc", misn->desc ); - window_enableButton( wid, "btnAbortMission" ); -@@ -1052,7 +1052,7 @@ static void mission_menu_abort( unsigned - { - (void)str; - int pos; -- Mission* misn; -+ Mission *misn; - int ret; - - if (dialogue_YesNo( "Abort Mission", -@@ -1060,7 +1060,7 @@ static void mission_menu_abort( unsigned - - /* Get the mission. */ - pos = toolkit_getListPos(wid, "lstMission" ); -- misn = &player_missions[pos]; -+ misn = player_missions[pos]; - - /* We run the "abort" function if it's found. */ - ret = misn_tryRun( misn, "abort" ); -@@ -1068,9 +1068,7 @@ static void mission_menu_abort( unsigned - /* Now clean up mission. */ - if (ret != 2) { - mission_cleanup( misn ); -- memmove( misn, &player_missions[pos+1], -- sizeof(Mission) * (MISSION_MAX-pos-1) ); -- memset( &player_missions[MISSION_MAX-1], 0, sizeof(Mission) ); -+ mission_shift(pos); - } - - /* Reset markers. */ Property changes on: head/games/naev/files/patch-src_info.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/games/naev/Makefile =================================================================== --- head/games/naev/Makefile (revision 401619) +++ head/games/naev/Makefile (revision 401620) @@ -1,64 +1,66 @@ # Created by: Jose Alonso Cardenas Marquez # $FreeBSD$ PORTNAME= naev -PORTVERSION= 0.6.0 -PORTREVISION= 1 +PORTVERSION= 0.6.1 CATEGORIES= games MASTER_SITES= SF/${PORTNAME}/${PORTNAME}-${PORTVERSION}/ -DIST_SUBDIR= ${PORTNAME} MAINTAINER= acm@FreeBSD.org COMMENT= 2D action/RPG space game LICENSE= GPLv3 LICENSE_FILE= ${WRKSRC}/LICENSE LIB_DEPENDS= libpng.so:${PORTSDIR}/graphics/png \ libfreetype.so:${PORTSDIR}/print/freetype2 \ libvorbisfile.so:${PORTSDIR}/audio/libvorbis \ libzip.so:${PORTSDIR}/archivers/libzip \ libcsparse.so:${PORTSDIR}/math/suitesparse RUN_DEPENDS= ${DATADIR}/ndata-${PORTVERSION}.zip:${PORTSDIR}/games/naev-data -USES= autoreconf:build gmake pkgconfig tar:bzip2 +USES= autoreconf:build compiler:features gmake pkgconfig tar:bzip2 GNU_CONFIGURE= yes USE_GL= glu USE_GNOME= libxml2 CONFIGURE_ARGS= --with-ndata-path="${DATADIR}/ndata-${PORTVERSION}.zip" \ --enable-debug=no CPPFLAGS+= -I${LOCALBASE}/include LIBS+= -L${LOCALBASE}/lib -lm PORTDATA= * PORTDOCS= * PLIST_FILES= bin/${PORTNAME} man/man6/naev.6.gz \ share/applications/${PORTNAME}.desktop \ share/appdata/${PORTNAME}.appdata.xml \ share/pixmaps/${PORTNAME}.png OPTIONS_DEFINE= DOCS OPENAL SDL2 SDL_MIXER OPTIONS_DEFAULT= OPENAL SDL2 SDL_MIXER OPENAL_USES= openal OPENAL_CONFIGURE_WITH= openal SDL_MIXER_DESC= SDL_mixer sound backend SDL_MIXER_CONFIGURE_WITH= sdlmixer SDL2_DESC= Use SDL2 instead of SDL SDL2_CONFIGURE_WITH= sdl2 SDL2_USE= SDL=sdl2 SDL2_USE_OFF= SDL=sdl -.include +.include +.if ${COMPILER_TYPE} == "gcc" +USE_GCC= yes +.endif + .if ${PORT_OPTIONS:MSDL_MIXER} . if ${PORT_OPTIONS:MSDL2} USE_SDL+= mixer2 . else USE_SDL+= mixer . endif .endif -.include +.include Index: head/games/naev/distinfo =================================================================== --- head/games/naev/distinfo (revision 401619) +++ head/games/naev/distinfo (revision 401620) @@ -1,2 +1,2 @@ -SHA256 (naev/naev-0.6.0.tar.bz2) = 0f0b498c7642e36dfaa15f284e13b9aa2d20e4aa01ed812fb7854583e7161cac -SIZE (naev/naev-0.6.0.tar.bz2) = 1054649 +SHA256 (naev-0.6.1.tar.bz2) = 71d4cf06d2af1a1b84dfb9ed0fd5e4b9b2295f119fc65079d8d36f102ba00b4b +SIZE (naev-0.6.1.tar.bz2) = 1047908 Index: head/games/naev/pkg-descr =================================================================== --- head/games/naev/pkg-descr (revision 401619) +++ head/games/naev/pkg-descr (revision 401620) @@ -1,4 +1,4 @@ -NAEV is a 2D space game that combines elements from the action, RPG, and -simulation genres. +Naev is a 2D space trading and combat game, in a similar vein to +Escape Velocity. -WWW: http://sourceforge.net/projects/naev/ +WWW: http://blog.naev.org/