summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-12-14 15:14:29 +0000
committerpeter1138 <peter1138@openttd.org>2006-12-14 15:14:29 +0000
commit107656f9c97a2c165080dc0118a2c4106c2b46fc (patch)
tree6752480ea013d248ce45a8571ddba265f3df08fd
parent9752d36ed2a9477acd4500d136f4b78b5c5fe05c (diff)
downloadopenttd-107656f9c97a2c165080dc0118a2c4106c2b46fc.tar.xz
(svn r7495) -Fix (r7354): [NewGRF] Deactivate the target GRF, not the current GRF.
-rw-r--r--newgrf.c6
-rw-r--r--newgrf_config.c2
-rw-r--r--newgrf_config.h2
3 files changed, 5 insertions, 5 deletions
diff --git a/newgrf.c b/newgrf.c
index eb942a913..cdebe68f1 100644
--- a/newgrf.c
+++ b/newgrf.c
@@ -2950,13 +2950,13 @@ static void GRFInhibit(byte *buf, int len)
for (i = 0; i < num; i++) {
uint32 grfid = grf_load_dword(&buf);
- GRFFile *file = GetFileByGRFID(grfid);
+ GRFConfig *file = GetGRFConfig(grfid);
/* Unset activation flag */
if (file != NULL) {
grfmsg(GMS_NOTICE, "GRFInhibit: Deactivating file ``%s''", file->filename);
- SETBIT(_cur_grfconfig->flags, GCF_DISABLED);
- CLRBIT(_cur_grfconfig->flags, GCF_ACTIVATED);
+ SETBIT(file->flags, GCF_DISABLED);
+ CLRBIT(file->flags, GCF_ACTIVATED);
}
}
}
diff --git a/newgrf_config.c b/newgrf_config.c
index ef607c2b8..7299be4fe 100644
--- a/newgrf_config.c
+++ b/newgrf_config.c
@@ -266,7 +266,7 @@ const GRFConfig *FindGRFConfig(uint32 grfid, uint8 *md5sum)
/* Retrieve a NewGRF from the current config by its grfid */
-const GRFConfig *GetGRFConfig(uint32 grfid)
+GRFConfig *GetGRFConfig(uint32 grfid)
{
GRFConfig *c;
diff --git a/newgrf_config.h b/newgrf_config.h
index cb490ebad..2cee7429b 100644
--- a/newgrf_config.h
+++ b/newgrf_config.h
@@ -41,7 +41,7 @@ extern GRFConfig *_grfconfig_static;
void ScanNewGRFFiles(void);
const GRFConfig *FindGRFConfig(uint32 grfid, uint8 *md5sum);
-const GRFConfig *GetGRFConfig(uint32 grfid);
+GRFConfig *GetGRFConfig(uint32 grfid);
void ClearGRFConfig(GRFConfig *config);
void ClearGRFConfigList(GRFConfig *config);
void ResetGRFConfig(bool defaults);