GRF: Only use extended bytes for object IDs if feature is tested for

This commit is contained in:
Jonathan G Rennison
2023-02-12 21:56:08 +00:00
parent a85b3d7de7
commit 64699d94c9
3 changed files with 4 additions and 2 deletions

View File

@@ -6529,7 +6529,7 @@ static void ObjectMapSpriteGroup(ByteReader *buf, uint8 idcount)
uint16 *objects = AllocaM(uint16, idcount);
for (uint i = 0; i < idcount; i++) {
objects[i] = buf->ReadExtendedByte();
objects[i] = HasBit(_cur.grffile->observed_feature_tests, GFTOF_MORE_OBJECTS_PER_GRF) ? buf->ReadExtendedByte() : buf->ReadByte();
}
uint8 cidcount = buf->ReadByte();

View File

@@ -57,7 +57,7 @@ extern const GRFFeatureInfo _grf_feature_list[] = {
GRFFeatureInfo("action0_object_viewport_map_tile_type", 1),
GRFFeatureInfo("road_stops", 7),
GRFFeatureInfo("new_landscape", 2),
GRFFeatureInfo("more_objects_per_grf", 1),
GRFFeatureInfo("more_objects_per_grf", 1, GFTOF_MORE_OBJECTS_PER_GRF),
GRFFeatureInfo(),
};

View File

@@ -86,6 +86,8 @@ enum Action2VariableRemapIds {
};
enum GRFFeatureTestObservationFlag : uint8 {
GFTOF_MORE_OBJECTS_PER_GRF = 0,
GFTOF_INVALID = 0xFF,
};