Changeset - r28306:801b68f73a02
[Not reviewed]
master
0 3 0
Tyler Trahan - 9 months ago 2023-12-19 14:09:46
tyler@tylertrahan.com
Fix: Add missing includes to timers from script implementation files (#11604)
3 files changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/script/api/script_basestation.cpp
Show inline comments
 
@@ -6,24 +6,25 @@
 
 */
 

	
 
/** @file script_basestation.cpp Implementation of ScriptBaseStation. */
 

	
 
#include "../../stdafx.h"
 
#include "script_basestation.hpp"
 
#include "script_error.hpp"
 
#include "../../station_base.h"
 
#include "../../string_func.h"
 
#include "../../strings_func.h"
 
#include "../../station_cmd.h"
 
#include "../../waypoint_cmd.h"
 
#include "../../timer/timer_game_calendar.h"
 
#include "table/strings.h"
 

	
 
#include "../../safeguards.h"
 

	
 
/* static */ bool ScriptBaseStation::IsValidBaseStation(StationID station_id)
 
{
 
	EnforceDeityOrCompanyModeValid(false);
 
	const BaseStation *st = ::BaseStation::GetIfValid(station_id);
 
	return st != nullptr && (st->owner == ScriptObject::GetCompany() || ScriptCompanyMode::IsDeity() || st->owner == OWNER_NONE);
 
}
 

	
 
/* static */ std::optional<std::string> ScriptBaseStation::GetName(StationID station_id)
src/script/api/script_date.hpp
Show inline comments
 
@@ -2,25 +2,25 @@
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file script_date.hpp Everything to query and manipulate date related information. */
 

	
 
#ifndef SCRIPT_DATE_HPP
 
#define SCRIPT_DATE_HPP
 

	
 
#include "script_object.hpp"
 
#include "timer/timer_game_calendar.h"
 
#include "../../timer/timer_game_calendar.h"
 

	
 
/**
 
 * Class that handles all date related (calculation) functions.
 
 * @api ai game
 
 *
 
 * @note Months and days of month are 1-based; the first month of the
 
 *       year is 1 and the first day of the month is also 1.
 
 * @note Years are zero based; they start with the year 0.
 
 * @note Dates can be used to determine the number of days between
 
 *       two different moments in time because they count the number
 
 *       of days since the year 0.
 
 */
src/script/api/script_engine.cpp
Show inline comments
 
@@ -9,24 +9,25 @@
 

	
 
#include "../../stdafx.h"
 
#include "script_engine.hpp"
 
#include "script_cargo.hpp"
 
#include "../../company_base.h"
 
#include "../../strings_func.h"
 
#include "../../rail.h"
 
#include "../../road.h"
 
#include "../../engine_base.h"
 
#include "../../engine_func.h"
 
#include "../../articulated_vehicles.h"
 
#include "../../engine_cmd.h"
 
#include "../../timer/timer_game_calendar.h"
 
#include "table/strings.h"
 

	
 
#include "../../safeguards.h"
 

	
 
/* static */ bool ScriptEngine::IsValidEngine(EngineID engine_id)
 
{
 
	EnforceDeityOrCompanyModeValid(false);
 
	const Engine *e = ::Engine::GetIfValid(engine_id);
 
	if (e == nullptr || !e->IsEnabled()) return false;
 

	
 
	/* AIs have only access to engines they can purchase or still have in use.
 
	 * Deity has access to all engined that will be or were available ever. */
0 comments (0 inline, 0 general)