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

Function RemapOldStringID

src/saveload/strings_sl.cpp:28–47  ·  view source on GitHub ↗

* Remap a string ID from the old format to the new format * @param s StringID that requires remapping * @return translated ID */

Source from the content-addressed store, hash-verified

26 * @return translated ID
27 */
28StringID RemapOldStringID(StringID s)
29{
30 switch (s) {
31 case 0x0006: return STR_SV_EMPTY;
32 case 0x7000: return STR_SV_UNNAMED;
33 case 0x70E4: return SPECSTR_COMPANY_NAME_START;
34 case 0x70E9: return SPECSTR_COMPANY_NAME_START;
35 case 0x8864: return STR_SV_TRAIN_NAME;
36 case 0x902B: return STR_SV_ROAD_VEHICLE_NAME;
37 case 0x9830: return STR_SV_SHIP_NAME;
38 case 0xA02F: return STR_SV_AIRCRAFT_NAME;
39
40 default:
41 if (IsInsideMM(s, 0x300F, 0x3030)) {
42 return s - 0x300F + STR_SV_STNAME;
43 } else {
44 return s;
45 }
46 }
47}
48
49/** Location to load the old names to. */
50std::unique_ptr<std::string[]> _old_name_array;

Callers 6

SlSaveLoadConvFunction · 0.85
LoadOldStationFunction · 0.85
LoadOldCompanyFunction · 0.85
LoadOldVehicleFunction · 0.85
LoadOldSignFunction · 0.85
LoadOldEngineNameFunction · 0.85

Calls 1

IsInsideMMFunction · 0.85

Tested by

no test coverage detected