News:

Simutrans Tools
Know our tools that can help you to create add-ons, install and customize Simutrans.

[11.x] "Reversing: 0:00 left"

Started by Philip, September 13, 2013, 10:04:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Philip

The attached patch fixes a situation where "Reversing: 0:00 left" is displayed in a convoy's tooltip whose wait_lock is actually larger; this happens for convoys that are reversed by manual intervention, not due to their schedule.


--git a/simconvoi.cc b/simconvoi.cc
index 147c3d1..b694fdc 100644
--- a/simconvoi.cc
+++ b/simconvoi.cc
@@ -6170,13 +6170,7 @@ void convoi_t::snprintf_remaining_loading_time(char *p, size_t size) const
  */
void convoi_t::snprintf_remaining_reversing_time(char *p, size_t size) const
{
- const sint32 remaining_ticks = (sint32)(departures->get(last_stop_id).departure_time - welt->get_zeit_ms());
- uint32 ticks_left = 0;
- if(remaining_ticks >= 0)
- {
- ticks_left = remaining_ticks;
- }
- welt->sprintf_ticks(p, size, ticks_left);
+ welt->sprintf_ticks(p, size, wait_lock);
}

uint32 convoi_t::calc_highest_axle_load()


jamespetts

Thank you very much for that - that had been an annoying issue for some time. I shall apply this when I next look at the 11.x branch, which will hopefully be when I have finished work on the specific part of the passenger-generation branch on which I am concentrating at present.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

jamespetts

Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.