strings.c
changeset 1542 2ca6d1624e6d
parent 1376 425781645fba
child 1621 8c2c67a094ec
equal deleted inserted replaced
1541:5c98ae4cf541 1542:2ca6d1624e6d
     7 #include "station.h"
     7 #include "station.h"
     8 #include "town.h"
     8 #include "town.h"
     9 #include "vehicle.h"
     9 #include "vehicle.h"
    10 #include "news.h"
    10 #include "news.h"
    11 #include "screenshot.h"
    11 #include "screenshot.h"
       
    12 #include "waypoint.h"
    12 
    13 
    13 static char *StationGetSpecialString(char *buff);
    14 static char *StationGetSpecialString(char *buff);
    14 static char *GetSpecialTownNameString(char *buff, int ind);
    15 static char *GetSpecialTownNameString(char *buff, int ind);
    15 static char *GetSpecialPlayerNameString(char *buff, int ind);
    16 static char *GetSpecialPlayerNameString(char *buff, int ind);
    16 
    17 
   543 			buff = FormatGenericCurrency(buff, &_currency_specs[_opt.currency], GetParamInt64(), false);
   544 			buff = FormatGenericCurrency(buff, &_currency_specs[_opt.currency], GetParamInt64(), false);
   544 			break;
   545 			break;
   545 		}
   546 		}
   546 
   547 
   547 		case 0x9D: { // {WAYPOINT}
   548 		case 0x9D: { // {WAYPOINT}
   548 			Waypoint *cp = &_waypoints[GetDParam(0)];
   549 			Waypoint *wp = GetWaypoint(GetDParam(0));
   549 			StringID str;
   550 			StringID str;
   550 			int idx;
   551 			int idx;
   551 			if (~cp->town_or_string & 0xC000) {
   552 			if (wp->string != STR_NULL) {
   552 				GetParamInt32(); // skip it
   553 				GetParamInt32(); // skip it
   553 				str = cp->town_or_string;
   554 				str = wp->string;
   554 			} else {
   555 			} else {
   555 				idx = (cp->town_or_string >> 8) & 0x3F;
   556 				idx = wp->town_cn;
   556 				if (idx == 0) {
   557 				if (idx == 0) {
   557 					str = STR_WAYPOINTNAME_CITY;
   558 					str = STR_WAYPOINTNAME_CITY;
   558 				} else {
   559 				} else {
   559 					InjectDParam(1);
   560 					InjectDParam(1);
   560 					SetDParam(1, idx + 1);
   561 					SetDParam(1, idx + 1);
   561 					str = STR_WAYPOINTNAME_CITY_SERIAL;
   562 					str = STR_WAYPOINTNAME_CITY_SERIAL;
   562 				}
   563 				}
   563 				SetDParam(0, cp->town_or_string & 0xFF);
   564 				SetDParam(0, wp->town_index);
   564 			}
   565 			}
   565 
   566 
   566 			buff = GetString(buff, str);
   567 			buff = GetString(buff, str);
   567 		} break;
   568 		} break;
   568 
   569