The International Simutrans Forum

 

Author Topic: bug in r5358 - only first factory rotation used  (Read 1774 times)

0 Members and 1 Guest are viewing this topic.

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
bug in r5358 - only first factory rotation used
« on: February 18, 2012, 10:55:52 AM »
Original report: When city growth spawns a new end consumer, it is built always in first rotation, if it has even size (NxN). This does not happen if the industry is constructed manually.

If I read the code right...
1) The hierarchy of calls responsible for this is fabrikbauer_t::baue_hierarchie and then platzsucher_t::suche_platz.
2) Rotations after the first two are ignored entirely? (Rotation is passed as bool :-/ )
3) This happens only for factories in city, that are constructed by game itself. But not only end consumers.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4592
  • Languages: EN, DE, AT
Re: bug in r5358 - only first factory rotation used
« Reply #1 on: February 18, 2012, 08:13:31 PM »
It seems that standard orientation is prefered by the implementation.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4592
  • Languages: EN, DE, AT
Re: bug in r5358 - only first factory rotation used
« Reply #2 on: February 19, 2012, 08:36:23 AM »
here is a patch.

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: bug in r5358 - only first factory rotation used
« Reply #3 on: February 19, 2012, 12:16:12 PM »
Tested, and it seems to work as intended. Thanks! Of course only the first two rotations are selected, but one can't want everything handed on a silver plate... :)

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4592
  • Languages: EN, DE, AT
Re: bug in r5358 - only first factory rotation used
« Reply #4 on: February 19, 2012, 02:03:55 PM »
If there are 4 possible rotations, then also all 4 rotations can be build. In my tests with pak128.Britain, factories in all 4 rotations were generated.

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: bug in r5358 - only first factory rotation used
« Reply #5 on: February 19, 2012, 02:39:29 PM »
ARGH, I have been fooled! The pak I got as a test for 4 rotations contained only two :o I guess this is solved :D

Offline Iver

  • *
  • Posts: 15
  • Languages: CZ, SK, EN, DE
Re: bug in r5358 - only first factory rotation used
« Reply #6 on: February 19, 2012, 08:48:37 PM »
My bad  ;D

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4592
  • Languages: EN, DE, AT
Re: bug in r5358 - only first factory rotation used
« Reply #7 on: April 30, 2012, 10:06:49 AM »
in r5681.