Skip to content

Commit

Permalink
Fixed various vessel spawn issues. Should resolve #682
Browse files Browse the repository at this point in the history
  • Loading branch information
jrossignol committed Aug 5, 2020
1 parent 79e1c9a commit 8546934
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Contract Configurator 1.29.0
- Recompile against KSP 1.9.1.
- Fixed various vessel spawning issues.

Contract Configurator 1.28.3
- More changes to AgentParser, now commas are disallowed as part of agent names (thanks Tonas1997).
- Fixed requirements being regenerated incorrectly on some contracts, resolves issues with "flickering" of contracts in mission control (thanks severedsolo).
Expand Down
8 changes: 8 additions & 0 deletions source/ContractConfigurator/Behaviour/SpawnVessel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,8 @@ protected bool CreateVessels()
// why. End result is the vessel exploding, so let's just set it to a positive
// value.
p.temperature = 1.0;

p.UpdateOrgPosAndRot(shipConstruct.parts[0]);
}

// Estimate an object class, numbers are based on the in game description of the
Expand Down Expand Up @@ -421,6 +423,8 @@ protected bool CreateVessels()
// Create the ProtoPartSnapshot objects and then initialize them
foreach (Part p in shipConstruct.parts)
{
p.flightID = ShipConstruction.GetUniqueFlightID(HighLogic.CurrentGame.flightState);
p.vessel = dummyVessel;
dummyProto.protoPartSnapshots.Add(new ProtoPartSnapshot(p, dummyProto));
}
foreach (ProtoPartSnapshot p in dummyProto.protoPartSnapshots)
Expand All @@ -432,6 +436,10 @@ protected bool CreateVessels()
partNodes = dummyProto.protoPartSnapshots.Select<ProtoPartSnapshot, ConfigNode>(GetNodeForPart).ToArray();

// Clean up
foreach (Part p in shipConstruct.parts)
{
GameObject.Destroy(p.gameObject);
}
GameObject.Destroy(dummyVessel.gameObject);
}
else
Expand Down
3 changes: 0 additions & 3 deletions source/KerKonConConExt/KerKonConConExt.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@
<Reference Include="UnityEngine.UI">
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="Vectrosity">
<HintPath>C:\Program Files (x86)\Kerbal Space Program\KSP_Data\Managed\Vectrosity.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Behaviours\UnlockBaseFactory.cs" />
Expand Down
18 changes: 9 additions & 9 deletions test/Spawner/Spawner.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ CONTRACT_TYPE
name = The new vessel

// Path to the .craft file (relative to the GameData/ directory)
craftURL = ContractConfigurator/Spawner/Little Rocket.craft
craftURL = ContractConfigurator/test/Spawner/Little Rocket.craft

// Whether the vessel should show up as owned or unowned. If it is
// owned, then it will be immediately selectable.
Expand Down Expand Up @@ -321,7 +321,7 @@ CONTRACT_TYPE
name = An SPH Vessel

// Path to the .craft file (relative to the GameData/ directory)
craftURL = ContractConfigurator/Spawner/Little Plane.craft
craftURL = ContractConfigurator/test/Spawner/Little Plane.craft

// Whether the vessel should show up as owned or unowned. If it is
// owned, then it will be immediately selectable.
Expand All @@ -348,7 +348,7 @@ CONTRACT_TYPE
name = Lefty

// Path to the .craft file (relative to the GameData/ directory)
craftURL = ContractConfigurator/Spawner/Little Plane.craft
craftURL = ContractConfigurator/test/Spawner/Little Plane.craft

// Whether the vessel should show up as owned or unowned. If it is
// owned, then it will be immediately selectable.
Expand All @@ -375,7 +375,7 @@ CONTRACT_TYPE
name = Righty

// Path to the .craft file (relative to the GameData/ directory)
craftURL = ContractConfigurator/Spawner/Little Plane.craft
craftURL = ContractConfigurator/test/Spawner/Little Plane.craft

// Whether the vessel should show up as owned or unowned. If it is
// owned, then it will be immediately selectable.
Expand All @@ -402,7 +402,7 @@ CONTRACT_TYPE
name = LLefty

// Path to the .craft file (relative to the GameData/ directory)
craftURL = ContractConfigurator/Spawner/Little Plane.craft
craftURL = ContractConfigurator/test/Spawner/Little Plane.craft

// Whether the vessel should show up as owned or unowned. If it is
// owned, then it will be immediately selectable.
Expand Down Expand Up @@ -430,7 +430,7 @@ CONTRACT_TYPE
name = RRighty

// Path to the .craft file (relative to the GameData/ directory)
craftURL = ContractConfigurator/Spawner/Little Plane.craft
craftURL = ContractConfigurator/test/Spawner/Little Plane.craft

// Whether the vessel should show up as owned or unowned. If it is
// owned, then it will be immediately selectable.
Expand Down Expand Up @@ -458,7 +458,7 @@ CONTRACT_TYPE
name = LLLefty

// Path to the .craft file (relative to the GameData/ directory)
craftURL = ContractConfigurator/Spawner/Little Plane.craft
craftURL = ContractConfigurator/test/Spawner/Little Plane.craft

// Whether the vessel should show up as owned or unowned. If it is
// owned, then it will be immediately selectable.
Expand Down Expand Up @@ -487,7 +487,7 @@ CONTRACT_TYPE
name = RRRighty

// Path to the .craft file (relative to the GameData/ directory)
craftURL = ContractConfigurator/Spawner/Little Plane.craft
craftURL = ContractConfigurator/test/Spawner/Little Plane.craft

// Whether the vessel should show up as owned or unowned. If it is
// owned, then it will be immediately selectable.
Expand Down Expand Up @@ -671,7 +671,7 @@ CONTRACT_TYPE
type = CopyCraftFile
onState = CONTRACT_COMPLETED
url = ContractConfigurator/Spawner/Little Rocket.craft
url = ContractConfigurator/test/Spawner/Little Rocket.craft
craftType = VAB
}
}
Expand Down

0 comments on commit 8546934

Please sign in to comment.