OpenTTD Source 20241224-master-gee860a5c8e
script_instance.cpp File Reference

Implementation of ScriptInstance. More...

#include "../stdafx.h"
#include "../debug.h"
#include "../saveload/saveload.h"
#include "../script/squirrel_class.hpp"
#include "../script/squirrel_std.hpp"
#include "script_fatalerror.hpp"
#include "script_storage.hpp"
#include "script_info.hpp"
#include "script_instance.hpp"
#include "api/script_controller.hpp"
#include "api/script_error.hpp"
#include "api/script_event.hpp"
#include "api/script_log.hpp"
#include "../company_base.h"
#include "../company_func.h"
#include "../fileio_func.h"
#include "../league_type.h"
#include "../misc/endian_buffer.hpp"
#include "../safeguards.h"

Go to the source code of this file.

Functions

static void PrintFunc (bool error_msg, const std::string &message)
 Callback called by squirrel when a script uses "print" and for error messages.
 

Variables

static uint8_t _script_sl_byte
 Used as source/target by the script saveload code to store/load a single byte.
 
static const SaveLoad _script_byte []
 SaveLoad array that saves/loads exactly one byte.
 

Detailed Description

Implementation of ScriptInstance.

Definition in file script_instance.cpp.

Function Documentation

◆ PrintFunc()

static void PrintFunc ( bool  error_msg,
const std::string &  message 
)
static

Callback called by squirrel when a script uses "print" and for error messages.

Parameters
error_msgIs this an error message?
messageThe actual message text.

Definition at line 46 of file script_instance.cpp.

Referenced by ScriptInstance::ScriptInstance().

Variable Documentation

◆ _script_byte

const SaveLoad _script_byte[]
static
Initial value:
= {
SLEG_VAR("type", _script_sl_byte, SLE_UINT8),
}
#define SLEG_VAR(name, variable, type)
Storage of a global variable in every savegame version.
Definition saveload.h:1186
static uint8_t _script_sl_byte
Used as source/target by the script saveload code to store/load a single byte.

SaveLoad array that saves/loads exactly one byte.

Definition at line 350 of file script_instance.cpp.

Referenced by ScriptInstance::Load(), ScriptInstance::LoadEmpty(), ScriptInstance::LoadObjects(), ScriptInstance::Save(), ScriptInstance::SaveEmpty(), and ScriptInstance::SaveObject().

◆ _script_sl_byte

uint8_t _script_sl_byte
static

Used as source/target by the script saveload code to store/load a single byte.

Definition at line 347 of file script_instance.cpp.

Referenced by ScriptInstance::Load(), ScriptInstance::LoadEmpty(), ScriptInstance::LoadObjects(), ScriptInstance::Save(), ScriptInstance::SaveEmpty(), and ScriptInstance::SaveObject().