Fix #10490: Allow ships to exit depots if another is not moving at the exit point...
[openttd-github.git] / src / script / api / script_timemode.cpp
blobf927368f8a14f68830a3c3ac92a484474caa472e
1 /*
2 * This file is part of OpenTTD.
3 * 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.
4 * 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.
5 * 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/>.
6 */
8 /** @file script_timemode.cpp Implementation of ScriptTimeMode. */
10 #include "../../stdafx.h"
11 #include "script_timemode.hpp"
13 #include "../../safeguards.h"
15 ScriptTimeMode::ScriptTimeMode(bool calendar)
17 this->last_time_mode = ScriptObject::IsCalendarTimeMode();
18 ScriptObject::SetTimeMode(calendar);
21 ScriptTimeMode::~ScriptTimeMode()
23 ScriptObject::SetTimeMode(this->last_time_mode);
26 /* static */ bool ScriptTimeMode::IsCalendarMode()
28 return ScriptObject::IsCalendarTimeMode();