ElCeejo / draconis

Adds Dragons and related resources and equipment to Minetest Game
MIT License
18 stars 23 forks source link

[crash] Draconis mod invokes `on_punch()` in other mods with incorrect arguments #17

Closed dennisjenkins75 closed 2 years ago

dennisjenkins75 commented 2 years ago

EdenLost updated the draconis nmod a few days ago. Players are now reporting that the game crashes when they punch other entities with draconis weapons.

Detailed analysis (including stack traces and code review) here: https://github.com/EdenLostMinetest/edenlost/issues/45

TL;DR: Draconis is not passing the 5th argument damage (integer) when calling entity:on_punch(), so its getting converted to nil, which is then causing the crash.

The API spec states that entity:on_punch() takes 5 arguments, the last being integer damage.

https://github.com/minetest/minetest/blob/master/doc/lua_api.txt#L2081

ElCeejo commented 2 years ago

Fixed as of latest commit.