diff options
author | Peter Nelson <peter1138@openttd.org> | 2019-02-13 22:05:08 +0000 |
---|---|---|
committer | Niels Martin Hansen <nielsm@indvikleren.dk> | 2019-03-03 09:15:39 +0100 |
commit | e0c2ad1b6591859a1a30216e396cdab6e6bb028f (patch) | |
tree | b8d65be4898bbb1e783be8f589a48b465c7745a9 /src/script/api/template | |
parent | 3c047b124e28db45621de06d5556c96598352fc7 (diff) | |
download | openttd-e0c2ad1b6591859a1a30216e396cdab6e6bb028f.tar.xz |
Add: AI functions to get/set company colours.
Diffstat (limited to 'src/script/api/template')
-rw-r--r-- | src/script/api/template/template_company.hpp.sq | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/script/api/template/template_company.hpp.sq b/src/script/api/template/template_company.hpp.sq index 7dc63f24b..82c10381a 100644 --- a/src/script/api/template/template_company.hpp.sq +++ b/src/script/api/template/template_company.hpp.sq @@ -19,6 +19,10 @@ namespace SQConvert { template <> inline int Return<ScriptCompany::CompanyID>(HSQUIRRELVM vm, ScriptCompany::CompanyID res) { sq_pushinteger(vm, (int32)res); return 1; } template <> inline ScriptCompany::Gender GetParam(ForceType<ScriptCompany::Gender>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptCompany::Gender)tmp; } template <> inline int Return<ScriptCompany::Gender>(HSQUIRRELVM vm, ScriptCompany::Gender res) { sq_pushinteger(vm, (int32)res); return 1; } + template <> inline ScriptCompany::LiveryScheme GetParam(ForceType<ScriptCompany::LiveryScheme>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptCompany::LiveryScheme)tmp; } + template <> inline int Return<ScriptCompany::LiveryScheme>(HSQUIRRELVM vm, ScriptCompany::LiveryScheme res) { sq_pushinteger(vm, (int32)res); return 1; } + template <> inline ScriptCompany::Colours GetParam(ForceType<ScriptCompany::Colours>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptCompany::Colours)tmp; } + template <> inline int Return<ScriptCompany::Colours>(HSQUIRRELVM vm, ScriptCompany::Colours res) { sq_pushinteger(vm, (int32)res); return 1; } template <> inline ScriptCompany::ExpensesType GetParam(ForceType<ScriptCompany::ExpensesType>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptCompany::ExpensesType)tmp; } template <> inline int Return<ScriptCompany::ExpensesType>(HSQUIRRELVM vm, ScriptCompany::ExpensesType res) { sq_pushinteger(vm, (int32)res); return 1; } |