The International Simutrans Forum

 

Author Topic: Suspicious condition in dataobj/route.cc  (Read 1552 times)

0 Members and 1 Guest are viewing this topic.

Offline ij

  • *
  • Posts: 41
Suspicious condition in dataobj/route.cc
« on: January 15, 2015, 09:02:48 PM »
Is there perhaps bug close to the end of this line:

https://github.com/aburch/simutrans/blob/master/dataobj/route.cc#L663

The use of doubled && instead of & in this subcondition looks extremely suspicious: ... &&  (fahr->get_ribi(gr)&&ribi)!=0  ) ...I guess it would be supposed to check if fahr->get_ribi(gr) has ribi bit set.

--
 i.


Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5695
  • Languages: EN, NO
Re: Suspicious condition in dataobj/route.cc
« Reply #1 on: January 15, 2015, 09:21:40 PM »
Looks wrong to me as well. If it was supposed to be &&, I doubt there would be an != after. Although the != is unnecessary in C/C++, here it indeed strongly suggest flags checking.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10828
  • Languages: De,EN,JP
Re: Suspicious condition in dataobj/route.cc
« Reply #2 on: January 26, 2015, 10:09:34 PM »
Hmm this line is not 663. I assume this has been fixed?

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5695
  • Languages: EN, NO
Re: Suspicious condition in dataobj/route.cc
« Reply #3 on: January 27, 2015, 05:49:07 AM »
Yes, revision 7487.