1103 FOR_EACH_OBJECT { |
1103 FOR_EACH_OBJECT { |
1104 uint curidx = gvid + i; |
1104 uint curidx = gvid + i; |
1105 uint32 rate = grf_load_dword(&buf); |
1105 uint32 rate = grf_load_dword(&buf); |
1106 |
1106 |
1107 if (curidx < NUM_CURRENCY) { |
1107 if (curidx < NUM_CURRENCY) { |
1108 _currency_specs[curidx].rate = rate; |
1108 /* TTDPatch uses a multiple of 1000 for its conversion calculations, |
|
1109 * which OTTD does not. For this reason, divide grf value by 1000, |
|
1110 * to be compatible */ |
|
1111 _currency_specs[curidx].rate = rate / 1000; |
1109 } else { |
1112 } else { |
1110 grfmsg(GMS_WARN, "GlobalVarChangeInfo: Currency multipliers %d out of range, ignoring.", curidx); |
1113 grfmsg(GMS_WARN, "GlobalVarChangeInfo: Currency multipliers %d out of range, ignoring.", curidx); |
1111 } |
1114 } |
1112 } |
1115 } |
1113 break; |
1116 break; |
1117 uint curidx = gvid +i; |
1120 uint curidx = gvid +i; |
1118 uint16 options = grf_load_word(&buf); |
1121 uint16 options = grf_load_word(&buf); |
1119 |
1122 |
1120 if (curidx < NUM_CURRENCY) { |
1123 if (curidx < NUM_CURRENCY) { |
1121 _currency_specs[curidx].separator = GB(options, 0, 8); |
1124 _currency_specs[curidx].separator = GB(options, 0, 8); |
1122 _currency_specs[curidx].symbol_pos = GB(options, 8, 8); |
1125 /* By specifying only one bit, we prevent errors, |
|
1126 * since newgrf specs said that only 0 and 1 can be set for symbol_pos */ |
|
1127 _currency_specs[curidx].symbol_pos = GB(options, 8, 1); |
1123 } else { |
1128 } else { |
1124 grfmsg(GMS_WARN, "GlobalVarChangeInfo: Currency option %d out of range, ignoring.", curidx); |
1129 grfmsg(GMS_WARN, "GlobalVarChangeInfo: Currency option %d out of range, ignoring.", curidx); |
1125 } |
1130 } |
1126 } |
1131 } |
1127 break; |
1132 break; |
1128 |
1133 |
1129 case 0x0D: // Currency symbols |
1134 case 0x0D: // Currency prefix symbol |
1130 FOR_EACH_OBJECT { |
1135 FOR_EACH_OBJECT { |
1131 uint curidx = gvid +i; |
1136 uint curidx = gvid +i; |
1132 uint32 tempfix = grf_load_dword(&buf); |
1137 uint32 tempfix = grf_load_dword(&buf); |
1133 |
1138 |
1134 if (curidx < NUM_CURRENCY) { |
1139 if (curidx < NUM_CURRENCY) { |
1138 grfmsg(GMS_WARN, "GlobalVarChangeInfo: Currency symbol %d out of range, ignoring.", curidx); |
1143 grfmsg(GMS_WARN, "GlobalVarChangeInfo: Currency symbol %d out of range, ignoring.", curidx); |
1139 } |
1144 } |
1140 } |
1145 } |
1141 break; |
1146 break; |
1142 |
1147 |
1143 case 0x0E: // Currency symbols |
1148 case 0x0E: // Currency suffix symbol |
1144 FOR_EACH_OBJECT { |
1149 FOR_EACH_OBJECT { |
1145 uint curidx = gvid +i; |
1150 uint curidx = gvid +i; |
1146 uint32 tempfix = grf_load_dword(&buf); |
1151 uint32 tempfix = grf_load_dword(&buf); |
1147 |
1152 |
1148 if (curidx < NUM_CURRENCY) { |
1153 if (curidx < NUM_CURRENCY) { |