src/autoreplace_gui.cpp
changeset 8975 303deb99982d
parent 8915 db4c2ae09c4b
child 9266 416385a64dcb
equal deleted inserted replaced
8974:2d3cc23e12ce 8975:303deb99982d
    78  *   - when not changing the count (used when changing replace orders)
    78  *   - when not changing the count (used when changing replace orders)
    79  */
    79  */
    80 void InvalidateAutoreplaceWindow(EngineID e, GroupID id_g)
    80 void InvalidateAutoreplaceWindow(EngineID e, GroupID id_g)
    81 {
    81 {
    82 	Player *p = GetPlayer(_local_player);
    82 	Player *p = GetPlayer(_local_player);
    83 	byte type = GetEngine(e)->type;
    83 	VehicleType type = GetEngine(e)->type;
    84 	uint num_engines = GetGroupNumEngines(_local_player, id_g, e);
    84 	uint num_engines = GetGroupNumEngines(_local_player, id_g, e);
    85 
    85 
    86 	if (num_engines == 0 || p->num_engines[e] == 0) {
    86 	if (num_engines == 0 || p->num_engines[e] == 0) {
    87 		/* We don't have any of this engine type.
    87 		/* We don't have any of this engine type.
    88 		 * Either we just sold the last one, we build a new one or we stopped replacing it.
    88 		 * Either we just sold the last one, we build a new one or we stopped replacing it.
   173  */
   173  */
   174 static void GenerateReplaceVehList(Window *w, bool draw_left)
   174 static void GenerateReplaceVehList(Window *w, bool draw_left)
   175 {
   175 {
   176 	EngineID e;
   176 	EngineID e;
   177 	EngineID selected_engine = INVALID_ENGINE;
   177 	EngineID selected_engine = INVALID_ENGINE;
   178 	byte type = w->window_number;
   178 	VehicleType type = (VehicleType)w->window_number;
   179 	byte i = draw_left ? 0 : 1;
   179 	byte i = draw_left ? 0 : 1;
   180 
   180 
   181 	EngineList *list = &WP(w, replaceveh_d).list[i];
   181 	EngineList *list = &WP(w, replaceveh_d).list[i];
   182 	EngList_RemoveAll(list);
   182 	EngList_RemoveAll(list);
   183 
   183