Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
- Fixed typos in SPP.cfg and Wings.cfg (some parts were not getting
shielded)
- Additional sanity check when raycasting for parts shielding parts.
- Added logic check to make sure a chute was actually exposed to
damaging temperatures when deployed
- Groundwork for toolbar support. (in-game difficulty per save game
coming soon)
  • Loading branch information
Starwaster committed Oct 9, 2014
1 parent 0eadba8 commit 6e8156c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 17 deletions.
2 changes: 1 addition & 1 deletion DeadlyReentry/SPP.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}
}

@PART[mk2Fuselage|mk2_1m_AdapterLong|mk2_1m_Bicoupler|mk2SpacePlaneAdapter|mk2CargoBayL|mk2CargoBayL|mk2DockingPort|mk2DroneCore|mk2FuselageLongLFO|mk2FuselageShortLiquid|mk2FuselageShortLFO|mk2FuselageShortMono|shockConeIntake|IntakeRadialLong]
@PART[mk2Fuselage|mk2_1m_AdapterLong|mk2_1m_Bicoupler|mk2SpacePlaneAdapter|mk2CargoBayS|mk2CargoBayL|mk2DockingPort|mk2DroneCore|mk2FuselageLongLFO|mk2FuselageShortLiquid|mk2FuselageShortLFO|mk2FuselageShortMono|shockConeIntake|IntakeRadialLong]
{
@maxTemp = 1500
MODULE
Expand Down
2 changes: 1 addition & 1 deletion DeadlyReentry/Wings.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// both Squad and SPP wings
@PART[smallCtrlSrf.AdvancedCanard|deltaWing|sweptWing|tailfin|wingConnector|winglet|R8winglet|winglet3|StandardCtrlSrf|CanardController|structuralWing|structuralPylon|smallHardpoint|wingConnector2|wingConnector3|wingConnector4|wingConnector5|delta_small|delta.small|elevon2|elevon3|elevon5|wingStrake|structuralWing2|structuralWing3|structuralWing4|sweptWing1|sweptWing2]
@PART[smallCtrlSrf|AdvancedCanard|deltaWing|sweptWing|tailfin|wingConnector|winglet|R8winglet|winglet3|StandardCtrlSrf|CanardController|structuralWing|structuralPylon|smallHardpoint|wingConnector2|wingConnector3|wingConnector4|wingConnector5|delta_small|delta.small|elevon2|elevon3|elevon5|wingStrake|structuralWing2|structuralWing3|structuralWing4|sweptWing1|sweptWing2]
{
@maxTemp = 1500
MODULE
Expand Down
4 changes: 2 additions & 2 deletions Source/DRToolBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public DRToolbar ()
public void Awake()
{
// Set up the stock toolbar
GameEvents.onGUIApplicationLauncherReady.Add(OnGUIAppLauncherReady);
GameEvents.onGUIApplicationLauncherDestroyed.Add(OnGUIAppLauncherDestroyed);
//GameEvents.onGUIApplicationLauncherReady.Add(OnGUIAppLauncherReady);
//GameEvents.onGUIApplicationLauncherDestroyed.Add(OnGUIAppLauncherDestroyed);
}

public void Start()
Expand Down
31 changes: 18 additions & 13 deletions Source/DeadlyReentry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,10 @@ public bool IsShielded(Vector3 direction)

Ray ray = new Ray(part.transform.position + direction.normalized * (adjustCollider), direction.normalized);
RaycastHit[] hits = Physics.RaycastAll (ray, 10);
foreach (RaycastHit hit in hits) {
if(hit.rigidbody != null && hit.collider != part.collider && hit.collider.attachedRigidbody != part.Rigidbody) {
foreach (RaycastHit hit in hits)
{
if(hit.rigidbody != null && hit.collider != part.collider && hit.collider.attachedRigidbody != part.Rigidbody)
{
return true;
}
}
Expand Down Expand Up @@ -311,17 +313,20 @@ public float ReentryHeat()
{
bool cut = ambient + Math.Pow(density, ReentryPhysics.densityExponent) * shockwave * 10f
> part.maxTemp * ReentryPhysics.parachuteTempMult;
if ((object)parachute != null)
{
ModuleParachute p = parachute;
if (p.deploymentState == ModuleParachute.deploymentStates.DEPLOYED || p.deploymentState == ModuleParachute.deploymentStates.SEMIDEPLOYED)
p.CutParachute();
}
if ((object)realChute != null)
{
if (!(bool)rCType.GetProperty("anyDeployed").GetValue(realChute, null))
rCType.GetMethod("GUICut").Invoke(realChute, null);
}
if (cut)
{
if ((object)parachute != null)
{
ModuleParachute p = parachute;
if (p.deploymentState == ModuleParachute.deploymentStates.DEPLOYED || p.deploymentState == ModuleParachute.deploymentStates.SEMIDEPLOYED)
p.CutParachute();
}
if ((object)realChute != null)
{
if (!(bool)rCType.GetProperty("anyDeployed").GetValue(realChute, null))
rCType.GetMethod("GUICut").Invoke(realChute, null);
}
}
}
if (IsShielded(velocity))
displayShockwave = "Shielded";
Expand Down

0 comments on commit 6e8156c

Please sign in to comment.