Time Nick Message 17:50 ANAND Hmm, lua_api.txt notes that Raycast:next() can be nil. What's the difference between nil and { type = "nothing" } ? 17:51 Krock "nil" is when it reached the end 17:51 ANAND Oh 17:51 ANAND Then what does { type = "nothing" } signify? 17:51 Krock never seen that being pushed to Lua 17:52 ANAND o_O 17:53 Krock push_pointed_thing c_content.cpp 17:53 Lone_Wolf You got {type = "nothing"} from a raycast? 17:53 ANAND I didn't 17:53 Krock l_next() automatically returns nil if there's no pointed thing 17:53 ANAND I got nil, while my mod checks for type == nothing 17:53 Lone_Wolf Ah 17:53 Krock == nothing is only needed for on_item_use, for example 17:53 Lone_Wolf Yeah, you should just check for nil 17:54 Krock raycast results other than the raycast API 17:54 ANAND Ah 17:54 Krock basically just pointed things 17:54 ANAND Thought it applies to Raycast as well, thanks for clarifying. :) 17:54 ANAND inb4 !next 17:54 Krock !next 17:54 MinetestBot Another satisfied customer. Next! 17:55 ANAND Never gets old, eh? :) 17:55 Krock neither does this Raycast example. https://github.com/SmallJoker/farbows/blob/bb287199788f0615f3c81969f1943a3cd0089703/init.lua#L126-L128 17:57 ANAND Yeah, I remember you referring me to this mod once earlier. 17:57 Krock :3 shameless self-advertising 17:58 ANAND No it's helpful to have an example 17:58 Krock though I didn't bother fixing a potential crash 17:58 Krock s/crash/error/ 18:02 rubenwardy Krock: why don't you use a for loop? 18:03 rubenwardy for thing in minetest.raycast(...) do 18:03 rubenwardy it returns an iterable 18:05 Krock was that added in the same commit? 18:05 rubenwardy yeah, it's been there since the start 18:05 Krock okay then .. til. 18:06 rubenwardy documentation is here: https://github.com/minetest/minetest/blob/master/doc/lua_api.txt#L6339 18:06 Krock thanks rubenwardy 18:07 rubenwardy I mean, you knew that, was just pointing out where the iterator part is documented 18:07 rubenwardy easy to miss \o/ 18:28 Krock Lone_Wolf: https://github.com/minetest/minetest/pull/6560 18:30 rubenwardy oh gosh, I'm such an idiot 18:31 rubenwardy >closes a PR for being a duplicate of the issue it fixes 18:31 Krock shall I confirm or deny? 18:31 Krock I confirm 18:54 Lone_Wolf Yeah I figured it'd be best to just do a new PR