News:

Use the "Forum Search"
It may help you to find anything in the forum ;).

Patch: citycar calc current speed

Started by Dwachs, November 01, 2013, 11:49:06 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dwachs

Here is a small patch to  stadtauto_t::calc_current_speed: it saves calls to welt->lookup.

Where does this magic speed of 48 come from (if the car has to make a turn). The patch removes this, but could kept as well.
Parsley, sage, rosemary, and maggikraut.

prissi

Since city car have now way to find out, if they are stuck or not, they use the speed to indicate it. Due to the simple acceleration system, they take out speed after curves quickly, hence this empirical value. May need to be checked in regard to the wide variety of paksets and speeds.

Dwachs

This value (48) seems to be used as current_speed when a citycar starts driving. There are no checks whether current_speed is equal to 48.

It seems to have no side effects if in calc_current_speed the speed is not set to 48 if the citycar makes a turn.
Parsley, sage, rosemary, and maggikraut.

prissi

You are right, the special numbers are not needed, as there is a timer since a while. I forgot about this sorry. Please submit.

Dwachs

Parsley, sage, rosemary, and maggikraut.