The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: jamespetts on July 07, 2010, 10:58:08 PM

Title: [Bug] Mail level
Post by: jamespetts on July 07, 2010, 10:58:08 PM
One of the recent commits to the SVN is in the following terms:

Quote
// always use normal amount for return pas/mail
-                  // (for mail pax.menge might have been smaller!)
-                  return_pax.menge = pax_left_to_do;
+                  if(  will_return != town_return  &&  wtyp==warenbauer_t::post  ) {
+                     // attractions/factory generate more mail than they recieve
+                     return_pax.menge = pax_left_to_do*3;
+                  }
+                  else {
+                     // use normal amount for return pas/mail
+                     return_pax.menge = pax_left_to_do*3;
+                  }

However, this cannot be right, as both halves of the conditional do exactly the same thing: see the lines in bold. Presumably, the second version should not multiply by 3, so as to make this code:

Quote
// always use normal amount for return pas/mail
-                  // (for mail pax.menge might have been smaller!)
-                  return_pax.menge = pax_left_to_do;
+                  if(  will_return != town_return  &&  wtyp==warenbauer_t::post  ) {
+                     // attractions/factory generate more mail than they recieve
+                     return_pax.menge = pax_left_to_do*3;
+                  }
+                  else {
+                     // use normal amount for return pas/mail
+                     return_pax.menge = pax_left_to_do;
+                  }
Title: Re: [Bug] Mail level
Post by: prissi on July 08, 2010, 01:01:56 PM
Thanks