mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-06-19 03:29:26 +01:00
Fix: Prevent NewGRFs from reading parameters of graphics baseset.
This commit is contained in:
parent
e23a591a1e
commit
8fae996898
@ -153,6 +153,7 @@ static std::unique_ptr<GRFConfig> GetDefaultExtraGRFConfig()
|
|||||||
gc->palette |= GRFP_GRF_DOS;
|
gc->palette |= GRFP_GRF_DOS;
|
||||||
FillGRFDetails(*gc, false, BASESET_DIR);
|
FillGRFDetails(*gc, false, BASESET_DIR);
|
||||||
gc->flags.Reset(GRFConfigFlag::InitOnly);
|
gc->flags.Reset(GRFConfigFlag::InitOnly);
|
||||||
|
gc->flags.Set(GRFConfigFlag::System);
|
||||||
return gc;
|
return gc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,6 +166,7 @@ static std::unique_ptr<GRFConfig> GetBasesetExtraGRFConfig()
|
|||||||
auto gc = std::make_unique<GRFConfig>(BaseGraphics::GetUsedSet()->GetOrCreateExtraConfig());
|
auto gc = std::make_unique<GRFConfig>(BaseGraphics::GetUsedSet()->GetOrCreateExtraConfig());
|
||||||
if (gc->param.empty()) gc->SetParameterDefaults();
|
if (gc->param.empty()) gc->SetParameterDefaults();
|
||||||
gc->flags.Reset(GRFConfigFlag::InitOnly);
|
gc->flags.Reset(GRFConfigFlag::InitOnly);
|
||||||
|
gc->flags.Set(GRFConfigFlag::System);
|
||||||
return gc;
|
return gc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -319,7 +319,7 @@ static void ParamSet(ByteReader &buf)
|
|||||||
/* Disable the read GRF if it is a static NewGRF. */
|
/* Disable the read GRF if it is a static NewGRF. */
|
||||||
DisableStaticNewGRFInfluencingNonStaticNewGRFs(*c);
|
DisableStaticNewGRFInfluencingNonStaticNewGRFs(*c);
|
||||||
src1 = 0;
|
src1 = 0;
|
||||||
} else if (file == nullptr || c == nullptr || c->status == GCS_DISABLED) {
|
} else if (file == nullptr || c == nullptr || c->status == GCS_DISABLED || c->flags.Test(GRFConfigFlag::System)) {
|
||||||
src1 = 0;
|
src1 = 0;
|
||||||
} else if (src1 == 0xFE) {
|
} else if (src1 == 0xFE) {
|
||||||
src1 = c->version;
|
src1 = c->version;
|
||||||
|
Loading…
Reference in New Issue
Block a user