View | Details | Raw Unified | Return to bug 222823 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-9 / +8 lines)
Lines 3-14 Link Here
3
3
4
PORTNAME=	pioneer
4
PORTNAME=	pioneer
5
PORTVERSION=	0.0.${GH_TAGNAME}
5
PORTVERSION=	0.0.${GH_TAGNAME}
6
PORTREVISION=	4
7
CATEGORIES=	games
6
CATEGORIES=	games
8
7
9
PATCH_SITES=	https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
10
PATCHFILES=	a53fdbe8b046.patch:-p1
11
12
MAINTAINER=	lightside@gmx.com
8
MAINTAINER=	lightside@gmx.com
13
COMMENT=	Space adventure game set in the Milky Way galaxy
9
COMMENT=	Space adventure game set in the Milky Way galaxy
14
10
Lines 31-48 Link Here
31
LICENSE_PERMS_SIL=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
27
LICENSE_PERMS_SIL=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
32
28
33
BUILD_DEPENDS=	${LOCALBASE}/include/GL/glu.h:graphics/libGLU
29
BUILD_DEPENDS=	${LOCALBASE}/include/GL/glu.h:graphics/libGLU
34
LIB_DEPENDS=	libcurl.so:ftp/curl \
30
LIB_DEPENDS=	libsigc-2.0.so:devel/libsigc++20 \
35
		libsigc-2.0.so:devel/libsigc++20 \
36
		libfreetype.so:print/freetype2 \
31
		libfreetype.so:print/freetype2 \
37
		libvorbisfile.so:audio/libvorbis \
32
		libvorbisfile.so:audio/libvorbis \
38
		libpng.so:graphics/png \
33
		libpng.so:graphics/png \
39
		libassimp.so:multimedia/assimp
34
		libassimp.so:multimedia/assimp
40
35
36
USES=		autoreconf compiler:c++11-lib gmake pkgconfig
37
41
USE_GITHUB=	yes
38
USE_GITHUB=	yes
42
GH_ACCOUNT=	pioneerspacesim
39
GH_ACCOUNT=	pioneerspacesim
43
GH_TAGNAME=	20170304
40
GH_TAGNAME=	20171001
44
41
45
USES=		autoreconf compiler:c++11-lib gmake pkgconfig
46
USE_GL=		gl
42
USE_GL=		gl
47
USE_SDL=	image2 sdl2
43
USE_SDL=	image2 sdl2
48
44
Lines 63-69 Link Here
63
59
64
SUB_FILES=	pkg-message
60
SUB_FILES=	pkg-message
65
61
66
OPTIONS_DEFINE=		DOCS MODELCOMPILER NOGPUJOBS PROFILER
62
OPTIONS_DEFINE=		DOCS MODELCOMPILER NOGPUJOBS PROFILER SERVERAGENT
67
OPTIONS_DEFAULT=	MODELCOMPILER
63
OPTIONS_DEFAULT=	MODELCOMPILER
68
DOCS_SUB_LIST=	QUICKSTART_PATH="${DOCSDIR}"
64
DOCS_SUB_LIST=	QUICKSTART_PATH="${DOCSDIR}"
69
DOCS_SUB_LIST_OFF=	\
65
DOCS_SUB_LIST_OFF=	\
Lines 73-78 Link Here
73
NOGPUJOBS_DESC=		Disable EnableGPUJobs for config.ini by default
69
NOGPUJOBS_DESC=		Disable EnableGPUJobs for config.ini by default
74
PROFILER_DESC=		Build with internal profiler
70
PROFILER_DESC=		Build with internal profiler
75
PROFILER_CONFIGURE_ON=	--enable-profiler
71
PROFILER_CONFIGURE_ON=	--enable-profiler
72
SERVERAGENT_DESC=	Build with server agent
73
SERVERAGENT_CONFIGURE_WITH=	server-agent
74
SERVERAGENT_LIB_DEPENDS=	libcurl.so:ftp/curl
76
75
77
.include <bsd.port.pre.mk>
76
.include <bsd.port.pre.mk>
78
77
(-)distinfo (-5 / +3 lines)
Lines 1-5 Link Here
1
TIMESTAMP = 1488555232
1
TIMESTAMP = 1506816107
2
SHA256 (pioneerspacesim-pioneer-0.0.20170304-20170304_GH0.tar.gz) = 45d448a5ac53c9e230522600f03dad7abc70788367d09c3edcb4ae4285050004
2
SHA256 (pioneerspacesim-pioneer-0.0.20171001-20171001_GH0.tar.gz) = 154118bd3dac2f9b8ea43a837bcb967abcc8c3a8ee5ab61d35183bae85e8b0db
3
SIZE (pioneerspacesim-pioneer-0.0.20170304-20170304_GH0.tar.gz) = 194776151
3
SIZE (pioneerspacesim-pioneer-0.0.20171001-20171001_GH0.tar.gz) = 210900753
4
SHA256 (a53fdbe8b046.patch) = f9b438480642ad4a9a71cd976c007bc9c5a0fa82d3dc2d4d0892c1d6e00b78d7
5
SIZE (a53fdbe8b046.patch) = 1109
(-)files/patch-data_modules_SearchRescue_SearchRescue.lua (+83 lines)
Line 0 Link Here
1
Fix SAR selection of ship sizes for missions
2
https://github.com/pioneerspacesim/pioneer/commit/008e30a857036a8cc40c42bf89ef68e65b47a41e
3
4
--- data/modules/SearchRescue/SearchRescue.lua.orig	2017-10-01 00:01:47 UTC
5
+++ data/modules/SearchRescue/SearchRescue.lua
6
@@ -613,7 +613,20 @@ local createTargetShipParameters = funct
7
 	---- loading drive, weapons etc.
8
 	if flavour.id == 1 or flavour.id == 6 then
9
 		for i,shipdef in pairs(shipdefs) do
10
-			if shipdef.capacity / 10 < 1 then shipdefs[i] = nil end
11
+
12
+			-- get mass of hyperdrive if this ship has a default drive
13
+			-- if no default drive assume lowest mass drive
14
+			-- higher mass drives will only be fitted later at ship creation if capacity is huge
15
+			local drive = Equipment.hyperspace['hyperdrive_'..tostring(shipdef.hyperdriveClass)]
16
+			if not drive then
17
+				local drives = {}
18
+				for i = 9, 1, -1 do
19
+					table.insert(drives, Equipment.hyperspace['hyperdrive_'..tostring(i)])
20
+				end
21
+				table.sort(drives, function (a,b) return a.capabilities.mass < b.capabilities.mass end)
22
+				drive = drives[1]
23
+			end
24
+			if (shipdef.capacity-drive.capabilities.mass) / 10 < 1 then shipdefs[i] = nil end
25
 		end
26
 	elseif flavour.pickup_pass > 0 then
27
 		for i,shipdef in pairs(shipdefs) do
28
@@ -661,7 +674,16 @@ local createTargetShipParameters = funct
29
 	if flavour.id == 1 or flavour.id == 6 then
30
 		local any_pass = rand:Integer(0,1)
31
 		if any_pass > 0 then
32
-			pickup_pass = rand:Integer(1, math.min((shipdef.capacity / 10)+1, max_pass))
33
+			local drive = Equipment.hyperspace['hyperdrive_'..tostring(shipdef.hyperdriveClass)]
34
+			if not drive then
35
+				local drives = {}
36
+				for i = 9, 1, -1 do
37
+					table.insert(drives, Equipment.hyperspace['hyperdrive_'..tostring(i)])
38
+				end
39
+				table.sort(drives, function (a,b) return a.capabilities.mass < b.capabilities.mass end)
40
+				drive = drives[1]
41
+			end
42
+			pickup_pass = rand:Integer(1, math.min(((shipdef.capacity-drive.capabilities.mass) / 10)+1, max_pass))
43
 		else
44
 			pickup_pass = 0
45
 		end
46
@@ -709,22 +731,25 @@ local createTargetShip = function (missi
47
 	ship:SetPattern(pattern)
48
 
49
 	-- load a hyperdrive
50
-	local default_drive = Equipment.hyperspace['hyperdrive_'..tostring(shipdef.hyperdriveClass)]
51
-	if default_drive then
52
-		ship:AddEquip(default_drive)
53
-	else
54
-		local drive
55
+	-- 1st try: default drive for this ship class
56
+	-- 2nd try: largest drive possible that doesn't take more than a 10th of available room
57
+	-- fallback: smallest drive
58
+	local drives = {}
59
+	local drive = Equipment.hyperspace['hyperdrive_'..tostring(shipdef.hyperdriveClass)]
60
+	if not drive then
61
 		for i = 9, 1, -1 do
62
-			drive = Equipment.hyperspace['hyperdrive_'..tostring(i)]
63
-			if shipdef.capacity / 10 > drive.capabilities.mass then
64
-				ship:AddEquip(drive)
65
-				break
66
-			end
67
+			table.insert(drives, Equipment.hyperspace['hyperdrive_'..tostring(i)])
68
 		end
69
-		if not drive then
70
-			ship:AddEquip(Equipment.hyperspace['hyperdrive_1'])
71
+		table.sort(drives, function (a,b) return a.capabilities.mass < b.capabilities.mass end)
72
+		for i = #drives, 1, -1 do
73
+			local test_drive = drives[i]
74
+			if shipdef.capacity / 10 > test_drive.capabilities.mass then
75
+				drive = test_drive
76
+			end
77
 		end
78
 	end
79
+	if not drive then drive = drives[1] end
80
+	ship:AddEquip(drive)
81
 
82
 	-- add thruster fuel
83
 	if mission.flavour.id == 2 or mission.flavour.id == 4 or mission.flavour.id == 5 then

Return to bug 222823