Merge branch 'master' into jgrpp

# Conflicts:
#	CMakeLists.txt
#	bin/ai/CMakeLists.txt
#	bin/game/CMakeLists.txt
#	src/ai/ai_info.cpp
#	src/company_base.h
#	src/economy.cpp
#	src/game/game_info.cpp
#	src/gfx_type.h
#	src/linkgraph/linkgraph_gui.cpp
#	src/palette.cpp
#	src/palette_func.h
#	src/saveload/saveload.h
#	src/saveload/vehicle_sl.cpp
#	src/ship_cmd.cpp
#	src/train_cmd.cpp
#	src/vehicle_base.h
#	src/window.cpp
#	src/window_func.h
This commit is contained in:
Jonathan G Rennison
2024-02-26 18:19:34 +00:00
115 changed files with 3467 additions and 2164 deletions

View File

@@ -2026,7 +2026,7 @@ static void NormaliseTrainHead(Train *head)
/* If we don't have a unit number yet, set one. */
if (head->unitnumber != 0 || HasBit(head->subtype, GVSF_VIRTUAL)) return;
head->unitnumber = GetFreeUnitNumber(VEH_TRAIN);
head->unitnumber = Company::Get(head->owner)->freeunits[head->type].UseID(GetFreeUnitNumber(VEH_TRAIN));
}
CommandCost CmdMoveVirtualRailVehicle(TileIndex tile, DoCommandFlag flags, uint32_t p1, uint32_t p2, const char *text)
@@ -2225,6 +2225,7 @@ CommandCost CmdMoveRailVehicle(TileIndex tile, DoCommandFlag flags, uint32_t p1,
}
/* Remove stuff not valid anymore for non-front engines. */
DeleteVehicleOrders(src);
Company::Get(src->owner)->freeunits[src->type].ReleaseID(src->unitnumber);
src->unitnumber = 0;
if (!_settings_game.vehicle.non_leading_engines_keep_name) {
src->name.clear();