lua/wrappers/game/lua_body_part.cpp
/**
	 * Removes the body part that this part was helping.
	 *
	 * @params nil part_to_hold Remove.
	 * @returns am.body_part This
	 */
Removes the body part that this part was helping.
@params nil part_to_hold Remove.
Removes the body part that this part was helping . @params nil part_to_hold Remove .
int BodyPart_can_hold_onto(lua_State *lua)
	{
		BodyPart *part = castUData<BodyPart>(lua, 1);
		if (part)
		{
			if (lua_gettop(lua) == 1)
			{
				BodyPart *other = part->getCanHoldOnto();
				if (other)
				{
					wrapRefObject<BodyPart>(lua, other);
					return 1;
				}
				lua_pushnil(lua);
				return 1;
			}
			else
			{
				if (lua_isnil(lua, 2))
				{
					part->setCanHoldOnto(nullptr);
					lua_first(lua);
				}
				BodyPart *other = castUData<BodyPart>(lua, 2);
				if (other)
				{
					part->setCanHoldOnto(other);
					lua_first(lua);
				}
			}
			return LuaState::expectedArgs(lua, "can_hold_onto", 2, "am.body_part part, nil part");
		}
		return LuaState::expectedContext(lua, "can_hold_onto", "am.body_part");
	}
int BodyPart_can_hold_onto ( lua_State * lua ) { BodyPart * part = castUData < BodyPart > ( lua , 1 ) ; if ( part ) { if ( lua_gettop ( lua ) == 1 ) { BodyPart * other = part -> getCanHoldOnto ( ) ; if ( other ) { wrapRefObject < BodyPart > ( lua , other ) ; return 1 ; } lua_pushnil ( lua ) ; return 1 ; } else { if ( lua_isnil ( lua , 2 ) ) { part -> setCanHoldOnto ( nullptr ) ; lua_first ( lua ) ; } BodyPart * other = castUData < BodyPart > ( lua , 2 ) ; if ( other ) { part -> setCanHoldOnto ( other ) ; lua_first ( lua ) ; } } return LuaState :: expectedArgs ( lua , " " , 2 , " " ) ; } return LuaState :: expectedContext ( lua , " " , " " ) ; }
Removes the body part that this part was helping.
Removes the body part that this part was helping .