(svn r25605) -Fix [FS#5641]: [Script] If a NewGRF returned station type that could not be built by an AI via callback 18, an unknown error would be thrown instead of falling back to the default station

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
rubidium 11 years ago
parent e6eede841a
commit 57a3a2b147

@ -186,10 +186,11 @@
if (spec == NULL) {
DEBUG(grf, 1, "%s returned an invalid station ID for 'AI construction/purchase selection (18)' callback", file->filename);
} else {
p2 |= spec->cls_id | index << 8;
/* We might have gotten an usable station spec. Try to build it, but if it fails we'll fall back to the original station. */
if (ScriptObject::DoCommand(tile, p1, p2 | spec->cls_id | index << 8, CMD_BUILD_RAIL_STATION)) return true;
}
}
return ScriptObject::DoCommand(tile, p1, p2, CMD_BUILD_RAIL_STATION);
}

Loading…
Cancel
Save