mirror of https://github.com/OpenTTD/OpenTTD
(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
parent
1427bbce6f
commit
3d3fb76b7e
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue