Get more information than just the player's name when sending a copy of
authorKyle <khonkhortisan@gmail.com>
Sun, 24 Feb 2013 00:57:01 +0000 (16:57 -0800)
committerKyle <khonkhortisan@gmail.com>
Sun, 24 Feb 2013 00:57:01 +0000 (16:57 -0800)
the player (Yet Another Nil)

unified_inventory/api.lua

index 4ef91bb95276fc81b9dce947e90770c59a428526..2eb0b3e89cc6c2a42dc8d5c3450dafe7016c4f99 100644 (file)
@@ -43,7 +43,7 @@ minetest.register_on_joinplayer(function(player)
        unified_inventory.filtered_items_list[player_name] = unified_inventory.items_list
        unified_inventory.filtered_items_list_size[player_name]=unified_inventory.items_list_size
        unified_inventory.activefilter[player_name]=""
-       unified_inventory.apply_filter(player_name, "")
+       unified_inventory.apply_filter(player, "")
        unified_inventory.alternate[player_name] = 1
        unified_inventory.current_item[player_name] =nil
        unified_inventory.set_inventory_formspec(player,unified_inventory.get_formspec(player, unified_inventory.default))
@@ -406,7 +406,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
        end
        
        if fields.searchbutton then
-               unified_inventory.apply_filter(player_name, fields.searchbox)
+               unified_inventory.apply_filter(player, fields.searchbox)
                unified_inventory.set_inventory_formspec(player, unified_inventory.get_formspec(player,unified_inventory.current_page[player_name]))
        end     
        
@@ -476,7 +476,8 @@ unified_inventory.go_home = function(player)
 end
 
 --apply filter to the inventory list (create filtered copy of full one)
-unified_inventory.apply_filter = function(player_name,filter)
+unified_inventory.apply_filter = function(player,filter)
+       local player_name = player:get_player_name() 
        local size=0
        local str_temp1=string.lower(filter)
        local str_temp2