Open MoNTE48 opened 1 year ago
- if self.player ~= "" then
+ if self.player and self.player:is_player() then
Hi,
Thanks for the bug report. I was about to commit your fix, but I think there's more to the bug than meets the eye at first. If you look in the function lottthrowing_shoot_arrow
in init.lua
, the field player
of the placed entity is set to the actual ObjectRef
of the player, which is probably not the sensible thing to do here (and then it doesn't make any sense to compare player
to ""
). I'm assuming that this should actually be set to the name of the player instead. Then the on_step
callback in arrow.lua
can use minetest.get_player_by_name
to get the actual player.
@neinwhal thoughts?
@lumidify, that's a good point. I suggested a simple fix given that LOTT is in maintenance mode. But I'm always in favor of a more proper and clean way of doing things.
good eye, yeah, the logic is broken. seems like a lazy attempt by me 7 years back to attempt to get mob detection for arrows; https://github.com/minetest-LOTR/Lord-of-the-Test/commit/44c16f7442636b7a6586e4776f6acfef4add9274 I should probably look through the rest of outdated code to spot for any other broken logic as well...