diff options
author | rubidium <rubidium@openttd.org> | 2014-07-21 18:03:05 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2014-07-21 18:03:05 +0000 |
commit | 3d3fb76b7e1a1eab99a6155684485ad607c93fad (patch) | |
tree | 50c798b6d82a186b1992dcc7239384a81bac6463 | |
parent | 1427bbce6fb6009179c1828c73b806305b76b42e (diff) | |
download | openttd-3d3fb76b7e1a1eab99a6155684485ad607c93fad.tar.xz |
(svn r26699) -Fix-ish: do not crash when trying to show an error about vehicle in a NewGRF and the NewGRF was not loaded at all
-rw-r--r-- | src/vehicle.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 4cf6e642e..bd8d41b2b 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -235,6 +235,9 @@ void ShowNewGrfVehicleError(EngineID engine, StringID part1, StringID part2, GRF const Engine *e = Engine::Get(engine); GRFConfig *grfconfig = GetGRFConfig(e->GetGRFID()); + /* Missing GRF. Nothing useful can be done in this situation. */ + if (grfconfig == NULL) return; + if (!HasBit(grfconfig->grf_bugs, bug_type)) { SetBit(grfconfig->grf_bugs, bug_type); SetDParamStr(0, grfconfig->GetName()); |