Time Nick Message 09:20 MTDiscord Command sent from Discord by luatic: 09:20 MTDiscord !tell mazes_80 a punch can kill an entity. just calling on_punch without letting the engine damage handling run is not equivalent and might not do damage at all. 09:20 MinetestBot MTDiscord: yeah, sure, whatever 13:13 MTDiscord cas 14:07 mazes_80 still on same issue: ObjectRef:punch() -> nil. Extracted from context to test more: https://bpa.st/GLEQ 14:07 MinetestBot mazes_80: Dec-04 09:20 UTC a punch can kill an entity. just calling on_punch without letting the engine damage handling run is not equivalent and might not do damage at all. 15:09 mazes_80 euh sorry: https://bpa.st/VTBQ wrong thing in last paste 15:13 sfan5 don't do that, it's incorrect 15:27 mazes_80 sfan5: more details 15:36 sfan5 15:07 <@MinetestBot> mazes_80: Dec-04 09:20 UTC a punch can kill an entity. just calling on_punch without letting the engine damage handling run is not equivalent and might not do damage at all. 15:36 sfan5 that's the details 15:36 sfan5 so you should call ObjectRef:punch() with the necessary parameters (see docs) 16:17 mazes_80 doc states: :Parameters are equal to the above callback. (cf entity:on_punch) 16:19 mazes_80 the thing I try to figure out: why can't I use the line with ObjectRef:punch() (that's why I made a temp fix calling on_punch) 16:21 sfan5 well what's the error? 16:25 mazes_80 AsyncErr: Lua: Runtime error from mod 'mods_glue' in callback item_OnUse(): attempt to index a nil value 16:26 mazes_80 stack traceback: 16:26 mazes_80 [C]: in function 'punch' 16:28 mazes_80 projects/mt-mods/mazes/mods_glue/init.lua:439: in function projects/mt-mods/mazes/mods_glue/init.lua:429 16:28 MTDiscord Every time I change my display name someone uses it anyway, you know if you keep doing that you're going to wear it out. 16:29 MTDiscord Someone should really just fix the bug, I think it's still on my to do list too. 16:32 sfan5 mazes_80: you found a bug 16:32 sfan5 the documentation says that tool_capabilities is optional, but it isn't. 16:32 sfan5 pointed_thing.ref:punch(user, nil, {}) 16:32 sfan5 ^ this works 16:34 MTDiscord sfan5: in cases where documentation disagrees with implementation, what usually happens? Do you shift the documentation over to express the new presumed state of the engine, or change the engine to match the documentation? 16:36 sfan5 depends on the case 17:03 mazes_80 Ok, it works better. I guess I checked everything before. Most of times when I do such error it's because of something I understood bad. But not this time 17:03 mazes_80 ty 17:03 mazes_80 hope it will lead to some doc update 17:46 MTDiscord or just allowing nil and defaulting to {}, wouldn't really cost the engine anything 17:48 MTDiscord perhaps generally we should have a bit better troubleshooting docs when it comes to reading stack traces: if a stack trace starts with "[C]: ...", there's a pretty high chance it's an engine bug.