Skip to content

Commit

Permalink
Showing 5 changed files with 29 additions and 23 deletions.
Binary file modified GameData/RP-0/Plugins/RP0.dll
Binary file not shown.
38 changes: 19 additions & 19 deletions GameData/RP-0/Tree/CrewTrainingTimes.cfg
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ TRAININGTIMES
// X-1
X1 = 15, XPlane
RP0Nose-Cockpit = X1
X1_Crew = X1
X1-Crew = X1
X1_Mission = 10
// X-15
@@ -54,7 +54,7 @@ TRAININGTIMES
Trainer Cockpit = 100, XPlane
Mk1 Mirage Cockpit = 100, XPlane
SXTEntenteCordiale = 100, XPlane
mk2Cockpit_Standard = 100, XPlane
mk2Cockpit-Standard = 100, XPlane
Mk1 Su30 Cockpit = 100, XPlane
Typhoon Cockpit = 100, XPlane
@@ -78,50 +78,50 @@ TRAININGTIMES
// Apollo
Apollo = 200, MatureCapsules // 600
bluedog_Apollo_Block2_Capsule = Apollo
FASAApollo_CM = Apollo
bluedog-Apollo-Block2-Capsule = Apollo
FASAApollo-CM = Apollo
SSTU-SC-B-CM = Apollo
Mark1-2Pod = Apollo
Apollo_Mission = 60
// Advanced Apollo 650
SSTU-SC-B-CMX = 50, Apollo
bluedog_Apollo_Block3_Capsule = 50, Apollo
bluedog-Apollo-Block3-Capsule = 50, Apollo
// LEM
FASA_Gemini_Lander_Pod = 100, Landing
FASA-Gemini-Lander-Pod = 100, Landing
landerCabinSmall = 100, Landing
ALCOR_LanderCapsule = 100, Landing
ALCOR-LanderCapsule = 100, Landing
ApolloLEM = 100, Landing // 500 (200 after other training)
bluedog_LEM_Ascent_Cockpit = ApolloLEM
FASALM_AscentStage = ApolloLEM
bluedog-LEM-Ascent-Cockpit = ApolloLEM
FASALM-AscentStage = ApolloLEM
MEMLander = ApolloLEM
landerCabinMedium = 100, Landing
mk2LanderCabin = 100, Landing
rn_lk_lander = 100, Landing
rn-lk-lander = 100, Landing
// Vostok
Vostok = 50, BasicCapsules // 300
IronVostok_Crew_A = Vostok
rn_vostok_sc = Vostok
IronVostok-Crew-A = Vostok
rn-vostok-sc = Vostok
Vostok_Mission = 60
// Voskhod
Voskhod = 200, Vostok // 500
Voskhod_Crew_A = Voskhod
rn_voskhod_sc = Voskhod
Voskhod-Crew-A = Voskhod
rn-voskhod-sc = Voskhod
Voskhod_Mission = 60
// Soyuz
Soyuz = 200, MatureCapsules // 600
SSTU-SC-A-DM = Soyuz
SSTU-SC-A-OM = Soyuz
rn_zond_sa = Soyuz
rn_lok_sa = Soyuz
rn_lok_bo = Soyuz
t_bo = Soyuz
t_af_bo = Soyuz
rn-zond-sa = Soyuz
rn-lok-sa = Soyuz
rn-lok-bo = Soyuz
t-bo = Soyuz
t-af-bo = Soyuz
Soyuz_Mission = 60
}
2 changes: 1 addition & 1 deletion Source/Crew/CourseTemplate.cs
Original file line number Diff line number Diff line change
@@ -174,7 +174,7 @@ public void PopulateFromSourceNode(ConfigNode source = null)

public double GetTime(List<ProtoCrewMember> students)
{
if (students == null || !timeUseStupid)
if (students == null || students.Count == 0 || !timeUseStupid)
return time;

double averageStupid = 0d;
2 changes: 1 addition & 1 deletion Source/Crew/CrewHandler.cs
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@

namespace RP0.Crew
{
[KSPScenario(ScenarioCreationOptions.AddToAllGames, new GameScenes[] { GameScenes.EDITOR, GameScenes.FLIGHT, GameScenes.SPACECENTER, GameScenes.TRACKSTATION })]
[KSPScenario((ScenarioCreationOptions)120, new GameScenes[] { GameScenes.EDITOR, GameScenes.FLIGHT, GameScenes.SPACECENTER, GameScenes.TRACKSTATION })]
public class CrewHandler : ScenarioModule
{
#region TrainingExpiration
10 changes: 8 additions & 2 deletions Source/Crew/TrainingDatabase.cs
Original file line number Diff line number Diff line change
@@ -96,7 +96,7 @@ protected static void FillHolders()
public static double GetTime(string name)
{
ClearTracker();
return _GetTime(name);
return _GetTime(Sanitize(name));
}
protected static double _GetTime(string name)
{
@@ -121,6 +121,7 @@ protected static double _GetTime(string name)

public static string SynonymReplace(string name)
{
name = Sanitize(name);
TrainingHolder h;
if (holders.TryGetValue(name, out h))
{
@@ -131,7 +132,12 @@ public static string SynonymReplace(string name)
}
return name;
}


protected static string Sanitize(string partName)
{
partName = partName.Replace(".", "-");
return partName.Replace("_", "-");
}

public static void ClearTracker()
{

0 comments on commit ca561d5

Please sign in to comment.