Closed MCAnimators02 closed 4 years ago
I wasn't able to reproduce this, but I pushed something that should hopefully fix it: https://github.com/minetest-LOTR/Lord-of-the-Test/commit/8742df24bffe12dec0571047ee916093122844fb
Would you be able to test that commit and see if it fixes the crash? Thanks!
bad argument #1 to 'type' (value expected)
How about: if not (self.object and self.object:get_pos()) then return; end
But after that is fixed, this happens:
mobs/api.lua:205: attempt to index local 'b' (a nil value)
The actual trouble is in:
https://github.com/minetest-LOTR/Lord-of-the-Test/blob/8742df24bffe12dec0571047ee916093122844fb/mods/mobs/api.lua#L2028
You have to patch this check into every place where you use the position of a potentially deleted object.
Are there any further crashes after https://github.com/minetest-LOTR/Lord-of-the-Test/commit/16761d597b37555634cfc60b3c6583592fdadb21? I updated the mobs api again.
Doesn't crash any more, but my bow stopped working alright, that was an unrelated bug (possibly due to crashing), a fresh world works.
Ah, excellent! Thank you very much for your help! @MCAnimators02 would you mind confirming if this solves your problem or not? I think it should, but just want to make sure!
I'll make a new release of LOTT on the contentDB, in a day or two, to ensure that everyone can get this fixed
Just a hint; instead of validating every time get_pos or another property is needed, it would be more optimal to track down all entry points for entity code and bail out early there.
I just copied the code from the latest commit of mobs api (https://notabug.org/TenPlus1/mobs_redo). Making large changes like that would make updating the api even harder, so unless that's done in tenplus1's repo, I'll stay away from doing that. Also, I don't have the time or interest to track down every entry point :P
Seems to be fixed... If this reoccurs, this can be reopened/a new issue can be opened.
Every time I get close to another entity in the game, a crash occurs and shuts down my game.
information: OS: Ubuntu(linux) 20.04.1LTS Minetest version: 5.3 latest/stable
No mods were used during play