vehicle.c
changeset 3413 bebbb9d71cc8
parent 3412 f1dc9f094c2a
child 3421 7968a4b5ff0a
equal deleted inserted replaced
3412:f1dc9f094c2a 3413:bebbb9d71cc8
  1779 				 * pointers should point to the front engine and not the cars
  1779 				 * pointers should point to the front engine and not the cars
  1780 				 */
  1780 				 */
  1781 				v = w;
  1781 				v = w;
  1782 			}
  1782 			}
  1783 
  1783 
  1784 			if (CmdFailed(temp_cost)) break;
  1784 			if (!CmdFailed(temp_cost)) {
  1785 
  1785 				cost += temp_cost;
  1786 			cost += temp_cost;
  1786 			}
  1787 		} while (w->type == VEH_Train && (w = GetNextVehicle(w)) != NULL);
  1787 		} while (w->type == VEH_Train && (w = GetNextVehicle(w)) != NULL);
  1788 
  1788 
  1789 		if (!(flags & DC_EXEC) && (CmdFailed(temp_cost) || p->money64 < (int32)(cost + p->engine_renew_money) || cost == 0)) {
  1789 		if (p->money64 < (int32)(cost + p->engine_renew_money) || cost == 0) {
  1790 			if (p->money64 < (int32)(cost + p->engine_renew_money) && ( _local_player == v->owner ) && cost != 0) {
  1790 			if (p->money64 < (int32)(cost + p->engine_renew_money) && ( _local_player == v->owner ) && cost != 0) {
  1791 				StringID message;
  1791 				StringID message;
  1792 				SetDParam(0, v->unitnumber);
  1792 				SetDParam(0, v->unitnumber);
  1793 				switch (v->type) {
  1793 				switch (v->type) {
  1794 					case VEH_Train:    message = STR_TRAIN_AUTORENEW_FAILED;       break;
  1794 					case VEH_Train:    message = STR_TRAIN_AUTORENEW_FAILED;       break;