129 |
129 |
130 gear:= AddGear(x, y, gt, s, dx, dy, t); |
130 gear:= AddGear(x, y, gt, s, dx, dy, t); |
131 lua_pushnumber(L, gear^.uid) |
131 lua_pushnumber(L, gear^.uid) |
132 end; |
132 end; |
133 lc_addgear:= 1; // 1 return value |
133 lc_addgear:= 1; // 1 return value |
|
134 end; |
|
135 |
|
136 function lc_getfollowgear(L : Plua_State) : LongInt; Cdecl; |
|
137 begin |
|
138 if lua_gettop(L) <> 0 then |
|
139 begin |
|
140 WriteLnToConsole('LUA: Wrong number of parameters passed to GetFollowGear!'); |
|
141 lua_pushnil(L); // return value on stack (nil) |
|
142 end |
|
143 else |
|
144 if FollowGear = nil then |
|
145 lua_pushnil(L) |
|
146 else |
|
147 lua_pushnumber(L, FollowGear^.uid); |
|
148 lc_getfollowgear:= 1; // 1 return value |
134 end; |
149 end; |
135 |
150 |
136 function lc_getgeartype(L : Plua_State) : LongInt; Cdecl; |
151 function lc_getgeartype(L : Plua_State) : LongInt; Cdecl; |
137 var gear : PGear; |
152 var gear : PGear; |
138 begin |
153 begin |
784 lua_register(luaState, 'GetX', @lc_getx); |
799 lua_register(luaState, 'GetX', @lc_getx); |
785 lua_register(luaState, 'GetY', @lc_gety); |
800 lua_register(luaState, 'GetY', @lc_gety); |
786 lua_register(luaState, 'CopyPV', @lc_copypv); |
801 lua_register(luaState, 'CopyPV', @lc_copypv); |
787 lua_register(luaState, 'CopyPV2', @lc_copypv2); |
802 lua_register(luaState, 'CopyPV2', @lc_copypv2); |
788 lua_register(luaState, 'FollowGear', @lc_followgear); |
803 lua_register(luaState, 'FollowGear', @lc_followgear); |
|
804 lua_register(luaState, 'GetFollowGear', @lc_getfollowgear); |
789 lua_register(luaState, 'SetState', @lc_setstate); |
805 lua_register(luaState, 'SetState', @lc_setstate); |
790 lua_register(luaState, 'GetState', @lc_getstate); |
806 lua_register(luaState, 'GetState', @lc_getstate); |
791 lua_register(luaState, 'SetTag', @lc_settag); |
807 lua_register(luaState, 'SetTag', @lc_settag); |
792 |
808 |
793 |
809 |