Merge branch 'master' into jgrpp
# Conflicts: # src/aircraft_cmd.cpp # src/company_gui.cpp # src/lang/arabic_egypt.txt # src/lang/czech.txt # src/lang/esperanto.txt # src/lang/faroese.txt # src/lang/finnish.txt # src/lang/german.txt # src/lang/korean.txt # src/lang/latvian.txt # src/lang/malay.txt # src/lang/polish.txt # src/lang/spanish.txt # src/lang/spanish_MX.txt # src/lang/unfinished/urdu.txt # src/main_gui.cpp # src/rail_cmd.cpp # src/rail_gui.cpp # src/road_cmd.cpp # src/settings_type.h # src/station_cmd.cpp # src/table/settings.ini
This commit is contained in:
@@ -1510,7 +1510,12 @@ CommandCost CmdCloneVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
|
||||
* the vehicle refitted before doing this, otherwise the moved
|
||||
* cargo types might not match (passenger vs non-passenger)
|
||||
*/
|
||||
DoCommand(0, w_front->index | (p2 & 1 ? CO_SHARE : CO_COPY) << 30, v_front->index, flags, CMD_CLONE_ORDER);
|
||||
CommandCost result = DoCommand(0, w_front->index | (p2 & 1 ? CO_SHARE : CO_COPY) << 30, v_front->index, flags, CMD_CLONE_ORDER);
|
||||
if (result.Failed()) {
|
||||
/* The vehicle has already been bought, so now it must be sold again. */
|
||||
DoCommand(w_front->tile, w_front->index | 1 << 20, 0, flags, GetCmdSellVeh(w_front));
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Now clone the vehicle's name, if it has one. */
|
||||
if (!v_front->name.empty()) CloneVehicleName(v_front, w_front);
|
||||
|
Reference in New Issue
Block a user