]> git.tdb.fi Git - r2c2.git/commitdiff
Activate allocator if an AI intends to move
authorMikko Rasa <tdb@tdb.fi>
Fri, 28 Jun 2013 19:23:03 +0000 (22:23 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 28 Jun 2013 19:23:03 +0000 (22:23 +0300)
source/libr2c2/train.cpp

index 74bc50328ce8b6bb60f7f917c149b97989d5e7b7..e8df4d890ced6478c2e083776be81f9bc58564eb 100644 (file)
@@ -340,6 +340,8 @@ void Train::tick(const Time::TimeDelta &dt)
                        }
                }
        }
+       else if(intent_to_move && !allocator.is_active())
+               allocator.set_active(true);
        else if(allocator.is_active() && !intent_to_move && !stop_timeout)
                stop_timeout = 2*Time::sec;
 }