src/newgrf_commons.cpp
changeset 7874 ccad4f4f3c3e
parent 7873 9bb5874c81df
child 7875 6e6e7606b77a
equal deleted inserted replaced
7873:9bb5874c81df 7874:ccad4f4f3c3e
    48  * @param entity_type original entity type
    48  * @param entity_type original entity type
    49  */
    49  */
    50 void OverrideManagerBase::Add(uint8 local_id, uint32 grfid, uint entity_type)
    50 void OverrideManagerBase::Add(uint8 local_id, uint32 grfid, uint entity_type)
    51 {
    51 {
    52 	assert(entity_type < max_offset);
    52 	assert(entity_type < max_offset);
       
    53 	/* An override can be set only once */
       
    54 	if (entity_overrides[entity_type] != invalid_ID) return;
    53 	entity_overrides[entity_type] = local_id;
    55 	entity_overrides[entity_type] = local_id;
    54 	grfid_overrides[entity_type] = grfid;
    56 	grfid_overrides[entity_type] = grfid;
    55 }
    57 }
    56 
    58 
    57 /** Resets the mapping, which is used while initializing game */
    59 /** Resets the mapping, which is used while initializing game */