Revision: 2493
          http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=2493&view=rev
Author:   ulteq
Date:     2012-05-02 07:11:31 +0000 (Wed, 02 May 2012)
Log Message:
-----------
-Bugfix: Fixes the game crash on Train Valley with Henschel DHG 700C locomotive.

Modified Paths:
--------------
    trunk/source/main/audio/SoundScriptManager.cpp
    trunk/source/main/physics/BeamForcesEuler.cpp

Modified: trunk/source/main/audio/SoundScriptManager.cpp
===================================================================
--- trunk/source/main/audio/SoundScriptManager.cpp      2012-05-02 06:40:28 UTC 
(rev 2492)
+++ trunk/source/main/audio/SoundScriptManager.cpp      2012-05-02 07:11:31 UTC 
(rev 2493)
@@ -207,11 +207,12 @@
        }
 }
 
-// TODO: Fix this! Produces crash on trainvalley with henschel train.
 void SoundScriptManager::modulate(int truck, int mod, float value, int 
linkType, int linkItemID)
 {
        if (soundsDisabled) return;
 
+       if (mod >= SS_MAX_MOD) return;
+
        for (int i=0; i < free_gains[mod]; i++)
        {
                SoundScriptInstance* inst = gains[mod + i * SS_MAX_MOD];

Modified: trunk/source/main/physics/BeamForcesEuler.cpp
===================================================================
--- trunk/source/main/physics/BeamForcesEuler.cpp       2012-05-02 06:40:28 UTC 
(rev 2492)
+++ trunk/source/main/physics/BeamForcesEuler.cpp       2012-05-02 07:11:31 UTC 
(rev 2493)
@@ -2055,7 +2055,7 @@
                                                        } else if (vst == 0)
                                                        {
                                                                // already 
running, modulate
-                                                               
SoundScriptManager::getSingleton().modulate(trucknum, SS_TRIG_LINKED_COMMAND, 
v, SL_COMMAND, -i);
+                                                               
SoundScriptManager::getSingleton().modulate(trucknum, 
SS_MOD_LINKED_COMMANDRATE, v, SL_COMMAND, -i);
                                                        }
 #endif // USE_OPENAL
                                                        beams[bbeam].L *= (1.0 
- beams[bbeam].commandRatioShort * v * crankfactor * dt / beams[bbeam].L);

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Rigsofrods-devel mailing list
Rigsofrods-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel

Reply via email to