diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-09-09 17:12:29 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-09-09 17:12:29 +0300 |
commit | 9cadaf824b3a59c85ad03f9c7185f43724b8e7ff (patch) | |
tree | 81faa2491a264a29c626e560ccf58601ef02ebd3 /src/scriptapi.cpp | |
parent | 1cc1b93e65d6d88e20786383cb09caf22a8c6494 (diff) | |
download | hax-minetest-server-9cadaf824b3a59c85ad03f9c7185f43724b8e7ff.tar.gz hax-minetest-server-9cadaf824b3a59c85ad03f9c7185f43724b8e7ff.zip |
Add dtime_s to entity activation
Diffstat (limited to 'src/scriptapi.cpp')
-rw-r--r-- | src/scriptapi.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/scriptapi.cpp b/src/scriptapi.cpp index 39e2a46e4..9fa927ff3 100644 --- a/src/scriptapi.cpp +++ b/src/scriptapi.cpp @@ -6483,7 +6483,7 @@ bool scriptapi_luaentity_add(lua_State *L, u16 id, const char *name) } void scriptapi_luaentity_activate(lua_State *L, u16 id, - const std::string &staticdata) + const std::string &staticdata, u32 dtime_s) { realitycheck(L); assert(lua_checkstack(L, 20)); @@ -6501,8 +6501,9 @@ void scriptapi_luaentity_activate(lua_State *L, u16 id, luaL_checktype(L, -1, LUA_TFUNCTION); lua_pushvalue(L, object); // self lua_pushlstring(L, staticdata.c_str(), staticdata.size()); - // Call with 2 arguments, 0 results - if(lua_pcall(L, 2, 0, 0)) + lua_pushinteger(L, dtime_s); + // Call with 3 arguments, 0 results + if(lua_pcall(L, 3, 0, 0)) script_error(L, "error running function on_activate: %s\n", lua_tostring(L, -1)); } |