vehicle.c
changeset 2704 bdf6ae0cb27c
parent 2697 97fc22baf3da
child 2716 2eb2687665e7
equal deleted inserted replaced
2703:a969970a5245 2704:bdf6ae0cb27c
   678 		} while ( (v=v->next) != NULL);
   678 		} while ( (v=v->next) != NULL);
   679 	}
   679 	}
   680 	return false;
   680 	return false;
   681 }
   681 }
   682 
   682 
   683 /** Check if a given vehicle (type) can be refitted to a given cargo
   683 /** Check if a given engine type can be refitted to a given cargo
   684  * @param *v vehicle to check
   684  * @param engine_type Engine type to check
   685  * @param cid_to check refit to this cargo-type
   685  * @param cid_to check refit to this cargo-type
   686  * @return true if it is possible, false otherwise
   686  * @return true if it is possible, false otherwise
   687  */
   687  */
   688 bool CanRefitTo(const Vehicle *v, CargoID cid_to)
   688 bool CanRefitTo(EngineID engine_type, CargoID cid_to)
   689 {
   689 {
   690 	CargoID cid = _global_cargo_id[_opt_ptr->landscape][cid_to];
   690 	CargoID cid = _global_cargo_id[_opt_ptr->landscape][cid_to];
   691 	return HASBIT(_engine_info[v->engine_type].refit_mask, cid) != 0;
   691 	return HASBIT(_engine_info[engine_type].refit_mask, cid) != 0;
   692 }
   692 }
   693 
   693 
   694 static void DoDrawVehicle(const Vehicle *v)
   694 static void DoDrawVehicle(const Vehicle *v)
   695 {
   695 {
   696 	uint32 image = v->cur_image;
   696 	uint32 image = v->cur_image;