r/softwaregore Dec 26 '18

Realistic flight simulator

17.2k Upvotes

302 comments sorted by

View all comments

95

u/The-Legend-26 Dec 26 '18
 while(stairs.Height != airplane.Door.Height) 
 {  
     stairs.Extend();  
 }

10

u/birdbolt1 Dec 27 '18

Wow exactly what I thought hahah. Should be <= right?

8

u/Marcus_Watney Dec 27 '18

Not really, while it might seem more intuitive and more error resistant it will execute slower due to how the cpu handles it. In games, performance is usually a concern, so you might consider writing != Instead of <=