summaryrefslogtreecommitdiff
path: root/src/newgrf_industries.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-10-17 20:09:16 +0000
committerrubidium <rubidium@openttd.org>2007-10-17 20:09:16 +0000
commite21b7634bfbe680308344afe04e070ce91356754 (patch)
tree56fa2e827c98faaabb1202da34159d2fe15e61db /src/newgrf_industries.cpp
parent5e347f80e1aa9ad6a4e8bee0a983701841eb5329 (diff)
downloadopenttd-e21b7634bfbe680308344afe04e070ce91356754.tar.xz
(svn r11287) -Codechange: add support for pushing paramaters into NewIndustries' error messages. Patch by Csaboka.
Diffstat (limited to 'src/newgrf_industries.cpp')
-rw-r--r--src/newgrf_industries.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/newgrf_industries.cpp b/src/newgrf_industries.cpp
index 8b8ffb443..3fda15112 100644
--- a/src/newgrf_industries.cpp
+++ b/src/newgrf_industries.cpp
@@ -458,6 +458,11 @@ bool CheckIfCallBackAllowsCreation(TileIndex tile, IndustryType type, uint itspe
* the building of the industry, as that's how it's done in TTDP. */
if (group == NULL || group->type != SGT_CALLBACK) return true;
+ /* Copy some parameters from the registers to the error message text ref. stack */
+ SwitchToErrorRefStack();
+ PrepareTextRefStackUsage(4);
+ SwitchToNormalRefStack();
+
switch (group->g.callback.result) {
case 0x400: return true;
case 0x401: _error_message = STR_0239_SITE_UNSUITABLE; break;