|
@@ -27,12 +27,13 @@
|
|
|
#include "screenshot.h"
|
|
|
#include "genworld.h"
|
|
|
#include "strings_func.h"
|
|
|
#include "viewport_func.h"
|
|
|
#include "window_func.h"
|
|
|
#include "date_func.h"
|
|
|
#include "timer/timer_game_calendar.h"
|
|
|
#include "company_func.h"
|
|
|
#include "gamelog.h"
|
|
|
#include "ai/ai.hpp"
|
|
|
#include "ai/ai_config.hpp"
|
|
|
#include "newgrf.h"
|
|
|
#include "newgrf_profiling.h"
|
|
@@ -1448,13 +1449,13 @@ DEF_CONSOLE_CMD(ConGetDate)
|
|
|
if (argc == 0) {
|
|
|
IConsolePrint(CC_HELP, "Returns the current date (year-month-day) of the game. Usage: 'getdate'.");
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
YearMonthDay ymd;
|
|
|
ConvertDateToYMD(_date, &ymd);
|
|
|
ConvertDateToYMD(TimerGameCalendar::date, &ymd);
|
|
|
IConsolePrint(CC_DEFAULT, "Date: {:04d}-{:02d}-{:02d}", ymd.year, ymd.month + 1, ymd.day);
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
DEF_CONSOLE_CMD(ConGetSysDate)
|
|
|
{
|
|
@@ -2287,13 +2288,13 @@ DEF_CONSOLE_CMD(ConNewGRFProfile)
|
|
|
}
|
|
|
}
|
|
|
if (started > 0) {
|
|
|
IConsolePrint(CC_DEBUG, "Started profiling for GRFID{} {}.", (started > 1) ? "s" : "", grfids);
|
|
|
if (argc >= 3) {
|
|
|
int days = std::max(atoi(argv[2]), 1);
|
|
|
_newgrf_profile_end_date = _date + days;
|
|
|
_newgrf_profile_end_date = TimerGameCalendar::date + days;
|
|
|
|
|
|
char datestrbuf[32]{ 0 };
|
|
|
SetDParam(0, _newgrf_profile_end_date);
|
|
|
GetString(datestrbuf, STR_JUST_DATE_ISO, lastof(datestrbuf));
|
|
|
IConsolePrint(CC_DEBUG, "Profiling will automatically stop on game date {}.", datestrbuf);
|
|
|
} else {
|