int lua_delete_object<Lua_Scenery>(lua_State *L)
{
	short object_index = Lua_Scenery::Index(L, 1);
	remove_map_object(object_index);
	deanimate_scenery(object_index);
	return 0;
}
int Lua_Item_Delete(lua_State* L)
{
	object_data* object = get_object_data(Lua_Item::Index(L, 1));
	int16 item_type = object->permutation;

	remove_map_object(Lua_Item::Index(L, 1));
	if (L_Get_Proper_Item_Accounting(L))
	{
		object_was_just_destroyed(_object_is_item, item_type);
	}
	return 0;
}
示例#3
0
static bool get_item(short player_index, short object_index) 
{
	object_data *object = get_object_data(object_index);	
	bool success;

	assert(GET_OBJECT_OWNER(object)==_object_is_item);
	
	success = try_and_add_player_item(player_index, object->permutation);
	if (success)
	{
		/* remove it */
		remove_map_object(object_index);
	}
	
	return success;
}
int lua_delete_object(lua_State *L)
{
	remove_map_object(T::Index(L, 1));
	return 0;
}