vehicle.c
changeset 2999 f5351c475765
parent 2998 811ec359a2e3
child 3009 c477ab0f00b3
equal deleted inserted replaced
2998:811ec359a2e3 2999:f5351c475765
  1751 
  1751 
  1752 			/* Now replace the vehicle */
  1752 			/* Now replace the vehicle */
  1753 			temp_cost = ReplaceVehicle(&w, flags);
  1753 			temp_cost = ReplaceVehicle(&w, flags);
  1754 
  1754 
  1755 			if (flags & DC_EXEC &&
  1755 			if (flags & DC_EXEC &&
  1756 					(w->type != VEH_Train || w->u.rail.first_engine == INVALID_VEHICLE)) {
  1756 					(w->type != VEH_Train || w->u.rail.first_engine == INVALID_ENGINE)) {
  1757 				/* now we bought a new engine and sold the old one. We need to fix the
  1757 				/* now we bought a new engine and sold the old one. We need to fix the
  1758 				 * pointers in order to avoid pointing to the old one for trains: these
  1758 				 * pointers in order to avoid pointing to the old one for trains: these
  1759 				 * pointers should point to the front engine and not the cars
  1759 				 * pointers should point to the front engine and not the cars
  1760 				 */
  1760 				 */
  1761 				v = w;
  1761 				v = w;