src/newgrf_engine.cpp
changeset 9046 479ec2593451
parent 8839 6337281b393b
child 9059 8a44f3e58eaf
equal deleted inserted replaced
9045:2e2f3fc16905 9046:479ec2593451
  1098 		_engine_list_position[i] = i;
  1098 		_engine_list_position[i] = i;
  1099 	}
  1099 	}
  1100 }
  1100 }
  1101 
  1101 
  1102 /**
  1102 /**
  1103  * Get the EngineID at position pos.
       
  1104  * Used when drawing a(n unsorted) list of engines.
       
  1105  * @param pos List position/
       
  1106  * @return The EngineID at the requested position.
       
  1107  */
       
  1108 EngineID GetRailVehAtPosition(EngineID pos)
       
  1109 {
       
  1110 	if (pos < NUM_TRAIN_ENGINES) return _engine_list_order[pos];
       
  1111 	return pos;
       
  1112 }
       
  1113 
       
  1114 /**
       
  1115  * Get the list position of an engine.
  1103  * Get the list position of an engine.
  1116  * Used when sorting a list of engines.
  1104  * Used when sorting a list of engines.
  1117  * @param engine ID of the engine.
  1105  * @param engine ID of the engine.
  1118  * @return The list position of the engine.
  1106  * @return The list position of the engine.
  1119  */
  1107  */