Revision: 2633
          http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=2633&view=rev
Author:   ulteq
Date:     2012-05-22 22:22:53 +0000 (Tue, 22 May 2012)
Log Message:
-----------
-Feature: Speed limiter now also works in reverse

Modified Paths:
--------------
    trunk/source/main/gameplay/RoRFrameListener.cpp

Modified: trunk/source/main/gameplay/RoRFrameListener.cpp
===================================================================
--- trunk/source/main/gameplay/RoRFrameListener.cpp     2012-05-22 17:43:20 UTC 
(rev 2632)
+++ trunk/source/main/gameplay/RoRFrameListener.cpp     2012-05-22 22:22:53 UTC 
(rev 2633)
@@ -1928,9 +1928,9 @@
 
 void checkSpeedlimit(Beam* curr_truck, float dt)
 {
-       if (curr_truck->engine->getGear() > 0)
+       if (curr_truck->engine->getGear() != 0)
        {
-               float accl = (curr_truck->sl_speed_limit - 
curr_truck->WheelSpeed) * 2.0f;
+               float accl = (curr_truck->sl_speed_limit - 
std::abs(curr_truck->WheelSpeed)) * 2.0f;
                accl = std::max(0.0f, accl);
                accl = std::min(accl, curr_truck->engine->getAcc());
                curr_truck->engine->setAcc(accl);

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