Page 1 of 1

[2.0.5] Entity damage has weird parameters

Posted: Fri Oct 18, 2024 8:19 am
by BurninSun
/doc-html/classes/LuaEntity.html#damage
10-18-2024, 01-09-42.png
10-18-2024, 01-09-42.png (66.64 KiB) Viewed 157 times
This indicates type is optional and has a default, yet can't be nil?

I'm assuming this was intended to make `type` optional in the parameter list though it is somewhat unclear on that. Also if type is optional, the following should still be valid:

`p.damage(1, "player", "electric", p, p)` however this results in the error: Expected between 2 and 4 argument but 5 were given.

This could use some clarification on valid parameters.

Re: [2.0.5] Entity damage has weird parameters

Posted: Fri Oct 18, 2024 10:05 am
by boskid
Changed the docs (for 2.0.6) to not state it cannot be nil. It can be nil but a default value will be used instead.