MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / AddConst

Method AddConst

src/script/squirrel.cpp:273–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

271}
272
273void Squirrel::AddConst(std::string_view var_name, SQInteger value)
274{
275 ScriptAllocatorScope alloc_scope(this);
276
277 sq_pushstring(this->vm, var_name);
278 sq_pushinteger(this->vm, value);
279 sq_newslot(this->vm, -3, SQTrue);
280}
281
282void Squirrel::AddConst(std::string_view var_name, bool value)
283{

Callers 1

DefSQConstMethod · 0.45

Calls 4

sq_pushstringFunction · 0.85
sq_pushintegerFunction · 0.85
sq_newslotFunction · 0.85
sq_pushboolFunction · 0.85

Tested by

no test coverage detected