summaryrefslogtreecommitdiff
path: root/src/scriptapi.cpp
diff options
context:
space:
mode:
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>2012-10-27 15:14:24 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-11-25 18:14:15 +0200
commit948b5a8be7b13a346c873c157567a72b4e7e320a (patch)
treece5a770f27043ee1b4ec21e3730d959c559ce6fe /src/scriptapi.cpp
parente42eeec8f626acbaa54ae31c10ca06c868c7931c (diff)
downloadminetest-948b5a8be7b13a346c873c157567a72b4e7e320a.tar.xz
Complete the attachment framework.
The child ID can now be checked against the parent ID in content_cao.cpp so the parent can be detected. Actual attachment code to come Divide attachment system between server attachments and client attachments, neither coded right now. As explained in the code comment: // Attachments need to be handled on both the server and client. // If we attach only on the server, models (which are client-side) // can't be read so we don't know the origin and orientation of bones. // If we attach only on the client, the real position of attachments is // not updated and you can't click them for example.
Diffstat (limited to 'src/scriptapi.cpp')
-rw-r--r--src/scriptapi.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/scriptapi.cpp b/src/scriptapi.cpp
index 9c5bbcc5b..3c505c881 100644
--- a/src/scriptapi.cpp
+++ b/src/scriptapi.cpp
@@ -2737,7 +2737,7 @@ private:
return 0;
}
- // setboneposrot(std::string bone, v3f position, v3f rotation)
+ // setboneposrot(self, std::string bone, v3f position, v3f rotation)
static int l_set_bone_posrot(lua_State *L)
{
ObjectRef *ref = checkobject(L, 1);
@@ -2758,8 +2758,7 @@ private:
return 0;
}
-// Part of the attachment structure, not used yet!
- // set_attachment() // <- parameters here
+ // set_attachment(self, parent, bone, position, rotation)
static int l_set_attachment(lua_State *L)
{
ObjectRef *ref = checkobject(L, 1);
@@ -2778,8 +2777,6 @@ private:
if(!lua_isnil(L, 5))
rotation = read_v3f(L, 5);
// Do it
-
-//lua_pushnumber(L, cobj->getId()); // Push id
co->setAttachment(parent, bone, position, rotation);
return 0;