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

Method ResolveNewGRFID

src/script/api/script_objecttype.cpp:51–57  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

49}
50
51/* static */ ObjectType ScriptObjectType::ResolveNewGRFID(SQInteger grfid, SQInteger grf_local_id)
52{
53 EnforcePrecondition(INVALID_OBJECT_TYPE, IsInsideBS(grf_local_id, 0x00, NUM_OBJECTS_PER_GRF));
54
55 grfid = std::byteswap(GB(grfid, 0, 32)); // Match people's expectations.
56 return _object_mngr.GetID(grf_local_id, grfid);
57}

Callers

nothing calls this directly

Calls 4

IsInsideBSFunction · 0.85
byteswapFunction · 0.85
GBFunction · 0.85
GetIDMethod · 0.45

Tested by

no test coverage detected