mirror of https://github.com/OpenTTD/OpenTTD
Fix: Quiet a bogus -Wmaybe-unitialized warning from GCC9
parent
71a3e83468
commit
73a2cee779
|
@ -135,7 +135,7 @@ CommandCost CmdBuildVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
|
||||||
/* Vehicle construction needs random bits, so we have to save the random
|
/* Vehicle construction needs random bits, so we have to save the random
|
||||||
* seeds to prevent desyncs. */
|
* seeds to prevent desyncs. */
|
||||||
SavedRandomSeeds saved_seeds;
|
SavedRandomSeeds saved_seeds;
|
||||||
if (flags != subflags) SaveRandomSeeds(&saved_seeds);
|
SaveRandomSeeds(&saved_seeds);
|
||||||
|
|
||||||
Vehicle *v = nullptr;
|
Vehicle *v = nullptr;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
@ -185,6 +185,7 @@ CommandCost CmdBuildVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Only restore if we actually did some refitting */
|
||||||
if (flags != subflags) RestoreRandomSeeds(saved_seeds);
|
if (flags != subflags) RestoreRandomSeeds(saved_seeds);
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
|
|
Loading…
Reference in New Issue