Merge branch 'master' into jgrpp

# Conflicts:
#	src/3rdparty/fmt/core.h
#	src/command_type.h
#	src/console_cmds.cpp
#	src/core/overflowsafe_type.hpp
#	src/landscape.cpp
#	src/network/network.cpp
#	src/newgrf_object.h
#	src/object_cmd.cpp
#	src/order_gui.cpp
#	src/saveload/vehicle_sl.cpp
#	src/script/api/script_industrytype.cpp
#	src/script/api/script_object.hpp
#	src/script/api/script_town.cpp
#	src/table/object_land.h
#	src/timetable_cmd.cpp
#	src/tree_cmd.cpp
#	src/vehicle_gui.cpp
#	src/window.cpp
This commit is contained in:
Jonathan G Rennison
2023-01-15 19:28:37 +00:00
64 changed files with 442 additions and 310 deletions

View File

@@ -13,6 +13,7 @@
#include "../../misc/countedptr.hpp"
#include "../../road_type.h"
#include "../../rail_type.h"
#include "../../core/random_func.hpp"
#include "script_types.hpp"
#include "../script_suspend.hpp"
@@ -67,6 +68,18 @@ public:
*/
static class ScriptInstance *GetActiveInstance();
/**
* Get a reference of the randomizer that brings this script random values.
* @param owner The owner/script to get the randomizer for. This defaults to ScriptObject::GetRootCompany()
*/
static Randomizer &GetRandomizer(Owner owner = ScriptObject::GetRootCompany());
/**
* Initialize/reset the script random states. The state of the scripts are
* based on the current _random seed, but _random does not get changed.
*/
static void InitializeRandomizers();
protected:
/**
* Executes a raw DoCommand for the script.
@@ -315,6 +328,8 @@ private:
* @param story_page_id The new StoryPageID.
*/
static void SetNewStoryPageElementID(StoryPageElementID story_page_element_id);
static Randomizer random_states[OWNER_END]; ///< Random states for each of the scripts (game script uses OWNER_DEITY)
};
#endif /* SCRIPT_OBJECT_HPP */