Add ClientObjectRef:remove
This commit is contained in:
parent
22f73e9f27
commit
e0b4859e7c
@ -1400,6 +1400,7 @@ This is basically a reference to a C++ `GenericCAO`.
|
||||
* `get_max_hp()`: returns the maximum heath
|
||||
* `punch()`: punches the object
|
||||
* `rightclick()`: rightclicks the object
|
||||
* `remove()`: removes the object permanently
|
||||
|
||||
### `Raycast`
|
||||
|
||||
|
@ -173,6 +173,15 @@ int ClientObjectRef::l_rightclick(lua_State *L)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ClientObjectRef::l_remove(lua_State *L)
|
||||
{
|
||||
ClientObjectRef *ref = checkobject(L, 1);
|
||||
ClientActiveObject *cao = get_cao(ref);
|
||||
getClient(L)->getEnv().removeActiveObject(cao->getId());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
ClientObjectRef::ClientObjectRef(ClientActiveObject *object) : m_object(object)
|
||||
{
|
||||
}
|
||||
|
@ -89,4 +89,7 @@ private:
|
||||
|
||||
// rightclick(self)
|
||||
static int l_rightclick(lua_State *L);
|
||||
|
||||
// remove(self)
|
||||
static int l_remove(lua_State *L);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user