[Code v3.6] Ware Merging May 10, 2009, 02:42:39 pm Hi James,In the following code from ware_t::can_merge_with() :Quote return index == w.index && ziel == w.ziel && // Only merge the destination *position* if the load is not freight (index < 3 || zielpos == w.zielpos) && origin == w.origin;I suppose the expression in blue should be index < 2 instead? Since pax and mail are hard-coded as 0 and 1 respectively.If it is correct, then also in ware_t :Quote bool is_p****enger() const { return index==0; } bool is_mail() const { return index==1; } bool is_freight() const { return index>2; }this should also be changed to index>=2, right? Quote Selected
Re: [Code v3.6] Ware Merging Reply #1 – May 10, 2009, 03:11:57 pm Ahh, that seems to make sense... Quote Selected
Re: [Code v3.6] Ware Merging Reply #2 – May 10, 2009, 05:52:08 pm gerw has confirmed here that is_freight() is correct with index>2. So, please ignore the 2nd point in my first post. Thank you for your attention. Quote Selected
Re: [Code v3.6] Ware Merging Reply #3 – May 10, 2009, 06:00:21 pm Knightly,wouldn't that also mean that the first one was correct, too? If index > 2 is freight, then index < 3 is non-freight, isn't it? Quote Selected
Re: [Code v3.6] Ware Merging Reply #4 – May 10, 2009, 07:47:30 pm Sorry, I am not sure. I don't know if there will be any unexpected side-effects. But ST STD uses index<2, so probably it's safer to follow. Quote Selected