From 73a2cee779857fe5762931306d896239f98c7c76 Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Sat, 29 Jun 2019 20:09:50 +0100 Subject: Fix: Quiet a bogus -Wmaybe-unitialized warning from GCC9 --- src/vehicle_cmd.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index a1ea3590a..9a6e236d5 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -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 * seeds to prevent desyncs. */ SavedRandomSeeds saved_seeds; - if (flags != subflags) SaveRandomSeeds(&saved_seeds); + SaveRandomSeeds(&saved_seeds); Vehicle *v = nullptr; 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); return value; -- cgit v1.2.3-54-g00ecf