diff options
author | truebrain <truebrain@openttd.org> | 2011-11-29 22:24:30 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2011-11-29 22:24:30 +0000 |
commit | 00877dd6d36ca52b1a8720cbbd4a013c958f7fad (patch) | |
tree | ac1c05499e12228624c695b93368246217425469 /src/ai/api/ai_tunnel.hpp.sq | |
parent | 96249564fd219f8747c9cd54bc934215fb1b5e44 (diff) | |
download | openttd-00877dd6d36ca52b1a8720cbbd4a013c958f7fad.tar.xz |
(svn r23352) -Add: support dynamically adding an API prefix when returning a C++ class to Squirrel
Diffstat (limited to 'src/ai/api/ai_tunnel.hpp.sq')
-rw-r--r-- | src/ai/api/ai_tunnel.hpp.sq | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ai/api/ai_tunnel.hpp.sq b/src/ai/api/ai_tunnel.hpp.sq index 67eaa7f8b..6837253a9 100644 --- a/src/ai/api/ai_tunnel.hpp.sq +++ b/src/ai/api/ai_tunnel.hpp.sq @@ -21,7 +21,7 @@ namespace SQConvert { template <> inline AITunnel &GetParam(ForceType<AITunnel &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITunnel *)instance; } template <> inline const AITunnel *GetParam(ForceType<const AITunnel *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AITunnel *)instance; } template <> inline const AITunnel &GetParam(ForceType<const AITunnel &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITunnel *)instance; } - template <> inline int Return<AITunnel *>(HSQUIRRELVM vm, AITunnel *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AITunnel", res, NULL, DefSQDestructorCallback<AITunnel>); return 1; } + template <> inline int Return<AITunnel *>(HSQUIRRELVM vm, AITunnel *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Tunnel", res, NULL, DefSQDestructorCallback<AITunnel>, true); return 1; } } // namespace SQConvert template <> const char *GetClassName<AITunnel, ST_AI>() { return "AITunnel"; } |