OpenTTD Source 20241224-master-gee860a5c8e
squirrel.hpp File Reference

defines the Squirrel class More...

#include <squirrel.h>

Go to the source code of this file.

Data Structures

class  Squirrel
 
class  ScriptAllocatorScope
 

Enumerations

enum class  ScriptType { AI , GS }
 The type of script we're working with, i.e. More...
 

Variables

ScriptAllocator_squirrel_allocator
 In the memory allocator for Squirrel we want to directly use malloc/realloc, so when the OS does not have enough memory the game does not go into unrecoverable error mode and kill the whole game, but rather let the AI die though then we need to circumvent MallocT/ReallocT.
 

Detailed Description

defines the Squirrel class

Definition in file squirrel.hpp.

Enumeration Type Documentation

◆ ScriptType

enum class ScriptType
strong

The type of script we're working with, i.e.

for who is it?

Enumerator
AI 

The script is for AI scripts.

GS 

The script is for Game scripts.

Definition at line 16 of file squirrel.hpp.

Variable Documentation

◆ _squirrel_allocator

ScriptAllocator* _squirrel_allocator
extern

In the memory allocator for Squirrel we want to directly use malloc/realloc, so when the OS does not have enough memory the game does not go into unrecoverable error mode and kill the whole game, but rather let the AI die though then we need to circumvent MallocT/ReallocT.

For the rest of this code, the safeguards should be in place though!

Definition at line 188 of file squirrel.cpp.