mirror of https://github.com/OpenTTD/OpenTTD
(svn r15114) -Codechange: Add support for 8 byte action7/9 data, used as a mask for GRFID checks.
parent
102cc11ee9
commit
f8d65b4865
|
@ -3963,6 +3963,7 @@ static void SkipIf(byte *buf, size_t len)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (paramsize) {
|
switch (paramsize) {
|
||||||
|
case 8: cond_val = grf_load_dword(&buf); mask = grf_load_dword(&buf); break;
|
||||||
case 4: cond_val = grf_load_dword(&buf); mask = 0xFFFFFFFF; break;
|
case 4: cond_val = grf_load_dword(&buf); mask = 0xFFFFFFFF; break;
|
||||||
case 2: cond_val = grf_load_word(&buf); mask = 0x0000FFFF; break;
|
case 2: cond_val = grf_load_word(&buf); mask = 0x0000FFFF; break;
|
||||||
case 1: cond_val = grf_load_byte(&buf); mask = 0x000000FF; break;
|
case 1: cond_val = grf_load_byte(&buf); mask = 0x000000FF; break;
|
||||||
|
@ -3988,7 +3989,7 @@ static void SkipIf(byte *buf, size_t len)
|
||||||
if (param == 0x88 && condtype != 0x0B && condtype != 0x0C) {
|
if (param == 0x88 && condtype != 0x0B && condtype != 0x0C) {
|
||||||
/* GRF ID checks */
|
/* GRF ID checks */
|
||||||
|
|
||||||
GRFConfig *c = GetGRFConfig(cond_val);
|
GRFConfig *c = GetGRFConfig(cond_val, mask);
|
||||||
|
|
||||||
if (c != NULL && HasBit(c->flags, GCF_STATIC) && !HasBit(_cur_grfconfig->flags, GCF_STATIC) && c->status != GCS_DISABLED && _networking) {
|
if (c != NULL && HasBit(c->flags, GCF_STATIC) && !HasBit(_cur_grfconfig->flags, GCF_STATIC) && c->status != GCS_DISABLED && _networking) {
|
||||||
DisableStaticNewGRFInfluencingNonStaticNewGRFs(c);
|
DisableStaticNewGRFInfluencingNonStaticNewGRFs(c);
|
||||||
|
|
|
@ -456,12 +456,12 @@ char *FindUnknownGRFName(uint32 grfid, uint8 *md5sum, bool create)
|
||||||
|
|
||||||
|
|
||||||
/* Retrieve a NewGRF from the current config by its grfid */
|
/* Retrieve a NewGRF from the current config by its grfid */
|
||||||
GRFConfig *GetGRFConfig(uint32 grfid)
|
GRFConfig *GetGRFConfig(uint32 grfid, uint32 mask)
|
||||||
{
|
{
|
||||||
GRFConfig *c;
|
GRFConfig *c;
|
||||||
|
|
||||||
for (c = _grfconfig; c != NULL; c = c->next) {
|
for (c = _grfconfig; c != NULL; c = c->next) {
|
||||||
if (c->grfid == grfid) return c;
|
if ((c->grfid & mask) == (grfid & mask)) return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -82,7 +82,7 @@ extern GRFConfig *_grfconfig_static; ///< First item in list of static GRF set
|
||||||
|
|
||||||
void ScanNewGRFFiles();
|
void ScanNewGRFFiles();
|
||||||
const GRFConfig *FindGRFConfig(uint32 grfid, const uint8 *md5sum = NULL);
|
const GRFConfig *FindGRFConfig(uint32 grfid, const uint8 *md5sum = NULL);
|
||||||
GRFConfig *GetGRFConfig(uint32 grfid);
|
GRFConfig *GetGRFConfig(uint32 grfid, uint32 mask = 0xFFFFFFFF);
|
||||||
GRFConfig **CopyGRFConfigList(GRFConfig **dst, const GRFConfig *src, bool init_only);
|
GRFConfig **CopyGRFConfigList(GRFConfig **dst, const GRFConfig *src, bool init_only);
|
||||||
void AppendStaticGRFConfigs(GRFConfig **dst);
|
void AppendStaticGRFConfigs(GRFConfig **dst);
|
||||||
void AppendToGRFConfigList(GRFConfig **dst, GRFConfig *el);
|
void AppendToGRFConfigList(GRFConfig **dst, GRFConfig *el);
|
||||||
|
|
Loading…
Reference in New Issue