The TORCS Racing Board
Username: Password: Remember Me?
Lost Password Register
Author: timfoden | Created: 2017-05-08 22:08:46
Subject: Pitting always appears to change tyres, even when asked not to??
I've just been fiddling with changing the pitting code in Mouse to not change the tyres if they are less than 50% worn... and the pit process always seems to change them anyway.

Anyone else seeing this?

I'm doing:

pCar->pitcmd.tireChange = tyreWear > 0.5 ?
tCarPitCmd::ALL : tCarPitCmd::NONE;

where tyreWear is the max of the wear of any tyre.

On searching around noticed this line (227) in raceengine.cpp:

car->pitcmd.tireChange = tCarPitCmd::ALL;

.. just before the ReUpdtPitTime(car) which sets up the time used for pitting. Is this a TORCS bug?

Cheers, Tim.

Last Edited: 2017-05-08 22:08:46 by timfoden
    Author: berniw | Created: 2017-05-08 22:12:32
    Subject: Re: Pitting always appears to change tyres, even when asked not to??
    I had no problems so far whatsoever. Are you setting the pit command during the callback, there is where it counts? As you have recognized the default is always to change tires.

    Kind regards

    Bernhard
    Last Edited: 2017-05-08 22:12:32 by berniw
      Author: timfoden | Created: 2017-05-08 22:55:07
      Subject: Re: Pitting always appears to change tyres, even when asked not to??
      Good catch... no it appears that the pit code in Mouse has never set anything up in it's pitcmd callback... this returns false. But it's still managed to repair damage and refuel somehow :)

      Just tried it in the callback as you suggested, and you're correct... it now works as it should.

      Thanks Berni.
      Last Edited: 2017-05-08 22:55:07 by timfoden