OpenTTD Source: src/script/script_instance.cpp File Reference

OpenTTD Source 14.0-beta1

Functions | Variables
script_instance.cpp File Reference
`#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. More...

## Variables
static byte | _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. More...

## 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_msg | Is this an error message?
  message | The 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),
}

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
static byte _script_sl_byte
Used as source/target by the script saveload code to store/load a single byte.
Definition: script_instance.cpp:347
SLEG_VAR
#define SLEG_VAR(name, variable, type)
Storage of a global variable in every savegame version.
Definition: saveload.h:1124