(svn r2208) - Fix: [ 1174237 ] Max loan always in euros, use _opt_ptr instead of _opt (glx)
This commit is contained in:
		
							
								
								
									
										20
									
								
								strings.c
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								strings.c
									
									
									
									
									
								
							@@ -343,7 +343,7 @@ static char *FormatTinyDate(char *buff, uint16 number)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
uint GetCurrentCurrencyRate(void)
 | 
					uint GetCurrentCurrencyRate(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	return _currency_specs[_opt.currency].rate;
 | 
						return _currency_specs[_opt_ptr->currency].rate;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static char *FormatGenericCurrency(char *buff, const CurrencySpec *spec, int64 number, bool compact)
 | 
					static char *FormatGenericCurrency(char *buff, const CurrencySpec *spec, int64 number, bool compact)
 | 
				
			||||||
@@ -427,7 +427,7 @@ static char *DecodeString(char *buff, const char *str)
 | 
				
			|||||||
			buff = FormatNoCommaNumber(buff, GetParamInt16());
 | 
								buff = FormatNoCommaNumber(buff, GetParamInt16());
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case 0x7F: // {CURRENCY}
 | 
							case 0x7F: // {CURRENCY}
 | 
				
			||||||
			buff = FormatGenericCurrency(buff, &_currency_specs[_opt.currency], GetParamInt32(), false);
 | 
								buff = FormatGenericCurrency(buff, &_currency_specs[_opt_ptr->currency], GetParamInt32(), false);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		// 0x80 is reserved for EURO
 | 
							// 0x80 is reserved for EURO
 | 
				
			||||||
		case 0x81: // {STRINL}
 | 
							case 0x81: // {STRINL}
 | 
				
			||||||
@@ -442,9 +442,9 @@ static char *DecodeString(char *buff, const char *str)
 | 
				
			|||||||
			break;
 | 
								break;
 | 
				
			||||||
		case 0x84: {// {VELOCITY}
 | 
							case 0x84: {// {VELOCITY}
 | 
				
			||||||
			int value = GetParamInt16();
 | 
								int value = GetParamInt16();
 | 
				
			||||||
			if (_opt.kilometers) value = value * 1648 >> 10;
 | 
								if (_opt_ptr->kilometers) value = value * 1648 >> 10;
 | 
				
			||||||
			buff = FormatCommaNumber(buff, value);
 | 
								buff = FormatCommaNumber(buff, value);
 | 
				
			||||||
			if (_opt.kilometers) {
 | 
								if (_opt_ptr->kilometers) {
 | 
				
			||||||
				memcpy(buff, " km/h", 5);
 | 
									memcpy(buff, " km/h", 5);
 | 
				
			||||||
				buff += 5;
 | 
									buff += 5;
 | 
				
			||||||
			} else {
 | 
								} else {
 | 
				
			||||||
@@ -458,7 +458,7 @@ static char *DecodeString(char *buff, const char *str)
 | 
				
			|||||||
		case 0x85:
 | 
							case 0x85:
 | 
				
			||||||
			switch (*str++) {
 | 
								switch (*str++) {
 | 
				
			||||||
			case 0: /* {CURRCOMPACT} */
 | 
								case 0: /* {CURRCOMPACT} */
 | 
				
			||||||
				buff = FormatGenericCurrency(buff, &_currency_specs[_opt.currency], GetParamInt32(), true);
 | 
									buff = FormatGenericCurrency(buff, &_currency_specs[_opt_ptr->currency], GetParamInt32(), true);
 | 
				
			||||||
				break;
 | 
									break;
 | 
				
			||||||
			case 1: /* {INT32} */
 | 
								case 1: /* {INT32} */
 | 
				
			||||||
				buff = FormatNoCommaNumber(buff, GetParamInt32());
 | 
									buff = FormatNoCommaNumber(buff, GetParamInt32());
 | 
				
			||||||
@@ -471,7 +471,7 @@ static char *DecodeString(char *buff, const char *str)
 | 
				
			|||||||
				// 8-bit = cargo type
 | 
									// 8-bit = cargo type
 | 
				
			||||||
				// 16-bit = cargo count
 | 
									// 16-bit = cargo count
 | 
				
			||||||
				const char *s;
 | 
									const char *s;
 | 
				
			||||||
				StringID cargo_str = _cargo_string_list[_opt.landscape][(byte)GetParamInt8()];
 | 
									StringID cargo_str = _cargo_string_list[_opt_ptr->landscape][(byte)GetParamInt8()];
 | 
				
			||||||
				uint16 multiplier = (cargo_str == STR_LITERS) ? 1000 : 1;
 | 
									uint16 multiplier = (cargo_str == STR_LITERS) ? 1000 : 1;
 | 
				
			||||||
				// liquid type of cargo is multiplied by 100 to get correct amount
 | 
									// liquid type of cargo is multiplied by 100 to get correct amount
 | 
				
			||||||
				buff = FormatCommaNumber(buff, GetParamInt16() * multiplier);
 | 
									buff = FormatCommaNumber(buff, GetParamInt16() * multiplier);
 | 
				
			||||||
@@ -482,7 +482,7 @@ static char *DecodeString(char *buff, const char *str)
 | 
				
			|||||||
			} break;
 | 
								} break;
 | 
				
			||||||
			case 4: /* {CURRCOMPACT64} */
 | 
								case 4: /* {CURRCOMPACT64} */
 | 
				
			||||||
				// 64 bit compact currency-unit
 | 
									// 64 bit compact currency-unit
 | 
				
			||||||
				buff = FormatGenericCurrency(buff, &_currency_specs[_opt.currency], GetParamInt64(), true);
 | 
									buff = FormatGenericCurrency(buff, &_currency_specs[_opt_ptr->currency], GetParamInt64(), true);
 | 
				
			||||||
				break;
 | 
									break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			default:
 | 
								default:
 | 
				
			||||||
@@ -541,7 +541,7 @@ static char *DecodeString(char *buff, const char *str)
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		case 0x9C: { // {CURRENCY64}
 | 
							case 0x9C: { // {CURRENCY64}
 | 
				
			||||||
			buff = FormatGenericCurrency(buff, &_currency_specs[_opt.currency], GetParamInt64(), false);
 | 
								buff = FormatGenericCurrency(buff, &_currency_specs[_opt_ptr->currency], GetParamInt64(), false);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -679,7 +679,7 @@ static char *GenAndCoName(char *buff)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	base = 0;
 | 
						base = 0;
 | 
				
			||||||
	num = 29;
 | 
						num = 29;
 | 
				
			||||||
	if (_opt.landscape == LT_CANDY) {
 | 
						if (_opt_ptr->landscape == LT_CANDY) {
 | 
				
			||||||
		base = num;
 | 
							base = num;
 | 
				
			||||||
		num = 12;
 | 
							num = 12;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -710,7 +710,7 @@ static char *GenPlayerName_4(char *buff)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	base = 0;
 | 
						base = 0;
 | 
				
			||||||
	num = 29;
 | 
						num = 29;
 | 
				
			||||||
	if (_opt.landscape == LT_CANDY) {
 | 
						if (_opt_ptr->landscape == LT_CANDY) {
 | 
				
			||||||
		base = num;
 | 
							base = num;
 | 
				
			||||||
		num = 12;
 | 
							num = 12;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user