src/roadveh_cmd.cpp
changeset 8722 30cffd0c4e40
parent 8720 4e60c30e2006
child 8726 5ae45b46506b
equal deleted inserted replaced
8721:b7971ad9bdd9 8722:30cffd0c4e40
    97 	int image;
    97 	int image;
    98 
    98 
    99 	if (is_custom_sprite(img)) {
    99 	if (is_custom_sprite(img)) {
   100 		image = GetCustomVehicleSprite(this, (Direction)(direction + 4 * IS_CUSTOM_SECONDHEAD_SPRITE(img)));
   100 		image = GetCustomVehicleSprite(this, (Direction)(direction + 4 * IS_CUSTOM_SECONDHEAD_SPRITE(img)));
   101 		if (image != 0) return image;
   101 		if (image != 0) return image;
   102 		img = orig_road_vehicle_info[this->engine_type - ROAD_ENGINES_INDEX].image_index;
   102 		img = _orig_road_vehicle_info[this->engine_type - ROAD_ENGINES_INDEX].image_index;
   103 	}
   103 	}
   104 
   104 
   105 	image = direction + _roadveh_images[img];
   105 	image = direction + _roadveh_images[img];
   106 	if (this->cargo.Count() >= this->cargo_cap / 2U) image += _roadveh_full_adder[img];
   106 	if (this->cargo.Count() >= this->cargo_cap / 2U) image += _roadveh_full_adder[img];
   107 	return image;
   107 	return image;
   116 
   116 
   117 		if (sprite != 0) {
   117 		if (sprite != 0) {
   118 			DrawSprite(sprite, pal, x, y);
   118 			DrawSprite(sprite, pal, x, y);
   119 			return;
   119 			return;
   120 		}
   120 		}
   121 		spritenum = orig_road_vehicle_info[engine - ROAD_ENGINES_INDEX].image_index;
   121 		spritenum = _orig_road_vehicle_info[engine - ROAD_ENGINES_INDEX].image_index;
   122 	}
   122 	}
   123 	DrawSprite(6 + _roadveh_images[spritenum], pal, x, y);
   123 	DrawSprite(6 + _roadveh_images[spritenum], pal, x, y);
   124 }
   124 }
   125 
   125 
   126 static CommandCost EstimateRoadVehCost(EngineID engine_type)
   126 static CommandCost EstimateRoadVehCost(EngineID engine_type)