MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / MapDefault

Method MapDefault

src/newgrf/newgrf_act3.cpp:207–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205 }
206
207 void MapDefault(uint16_t local_id, const SpriteGroup *group) override
208 {
209 if (T *spec = GetSpec<T>(_cur_gps.grffile, local_id); spec == nullptr) {
210 GrfMsg(1, "MapSpriteGroup: {} undefined, skipping", local_id);
211 } else if (spec->grf_prop.HasGrfFile()) {
212 GrfMsg(1, "MapSpriteGroup: {} mapped multiple times, skipping", local_id);
213 } else {
214 spec->grf_prop.SetSpriteGroup(CargoGRFFileProps::SG_DEFAULT, group);
215 spec->grf_prop.SetGRFFile(_cur_gps.grffile);
216 spec->grf_prop.local_id = local_id;
217 Tclass::Assign(spec);
218 }
219 }
220};
221
222struct CanalMapSpriteGroupHandler : MapSpriteGroupHandler {

Callers

nothing calls this directly

Calls 3

HasGrfFileMethod · 0.80
SetGRFFileMethod · 0.80
SetSpriteGroupMethod · 0.45

Tested by

no test coverage detected