forked from Sokomine/yl_speak_up
		
	do not right-click on nodes which have an inventory
This commit is contained in:
		
							parent
							
								
									151b55581c
								
							
						
					
					
						commit
						5abda37cf7
					
				| @ -532,6 +532,17 @@ yl_speak_up.execute_effect = function(player, n_id, o_id, r) | ||||
| 					"formspec set. NPC can't read these. Interaction not possible.") | ||||
| 				return false | ||||
| 			end | ||||
| 			-- do not right-click nodes that have an inventory (they most likely show a | ||||
| 			-- formspec - which the NPC can't use anyway) | ||||
| 			local inv = meta:get_inventory() | ||||
| 			for k, l in pairs(inv:get_lists()) do | ||||
| 				-- if the inventory contains any lists: abort | ||||
| 				yl_speak_up.debug_msg(player, n_id, o_id, tostring(r.r_id).." ".. | ||||
| 					"block: right-click - The block at "..pos_str.." has an ".. | ||||
| 					"inventory. Most likely it will show a formspec on right-click. ".. | ||||
| 					"NPC can't read these. Interaction not possible.") | ||||
| 				return false | ||||
| 			end | ||||
| 			-- is it a door? | ||||
| 			if(doors.registered_doors[node.name]) then | ||||
| 				doors.door_toggle(    r.r_pos, node, nil) --, clicker) | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user