News:

SimuTranslator
Make Simutrans speak your language.

[Bug] Mail level

Started by jamespetts, July 07, 2010, 10:58:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jamespetts

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;
+                  }
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.

prissi