OpenTTD Source  20241108-master-g80f628063a
EntityIDMapping Struct Reference

Maps an entity id stored on the map to a GRF file. More...

#include <newgrf_commons.h>

Data Fields

uint32_t grfid
 The GRF ID of the file the entity belongs to.
 
uint16_t entity_id
 The entity ID within the GRF file.
 
uint16_t substitute_id
 The (original) entity ID to use if this GRF is not available.
 

Detailed Description

Maps an entity id stored on the map to a GRF file.

Entities are objects used ingame (houses, industries, industry tiles) for which we need to correlate the ids from the grf files with the ones in the the savegames themselves. An array of EntityIDMapping structs is saved with the savegame so that those GRFs can be loaded in a different order, or removed safely. The index in the array is the entity's ID stored on the map.

The substitute ID is the ID of an original entity that should be used instead if the GRF containing the new entity is not available.

Definition at line 185 of file newgrf_commons.h.


The documentation for this struct was generated from the following file: