attempt to index local 'v' (a nil value) #4258
Labels
No Label
1. kind/balancing
1. kind/breaking
1. kind/bug
1. kind/construction
1. kind/documentation
1. kind/enhancement
1. kind/griefing
1. kind/invalid
1. kind/meme
1. kind/node limit
1. kind/other
1. kind/protocol
2. prio/controversial
2. prio/critical
2. prio/elevated
2. prio/good first issue
2. prio/interesting
2. prio/low
3. source/art
3. source/client
3. source/engine
3. source/ingame
3. source/integration
3. source/lag
3. source/license
3. source/mod upstream
3. source/unknown
3. source/website
4. step/approved
4. step/at work
4. step/blocked
4. step/discussion
4. step/help wanted
4. step/needs confirmation
4. step/partially fixed
4. step/question
4. step/ready to deploy
4. step/ready to QA test
4. step/want approval
5. result/cannot reproduce
5. result/duplicate
5. result/fixed
5. result/maybe
5. result/wontfix
ugh/petz
ugh/QA main
ugh/QA NOK
ugh/QA OK
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: your-land/bugtracker#4258
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
2023-04-25 08:34:13: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'yl_events' in callback luaentity_run_simple_callback(): .../mt/5.6.1/Minetest_test/bin/../builtin/common/vector.lua:99: attempt to index local 'v' (a nil value)
2023-04-25 08:34:13: ERROR[Main]: stack traceback:
2023-04-25 08:34:13: ERROR[Main]: .../mt/5.6.1/Minetest_test/bin/../builtin/common/vector.lua:99: in function 'round'
2023-04-25 08:34:13: ERROR[Main]: ....1/Minetest_test/bin/../mods/yl_events/tribe_miocene.lua:89: in function 'func'
2023-04-25 08:34:13: ERROR[Main]: ...inetest_test/bin/../builtin/profiler/instrumentation.lua:107: in function <...inetest_test/bin/../builtin/profiler/instrumentation.lua:100>
looks like someone right-clicked on a miocene that died before the server got the input; a nil check is needed.
I fixed like so:
IMO vector.round and all the other vector functions should return nil, if they can#t compute and defend better against wrong input.
yl_commons or better vector itself needs a
is_legit_pos(pos)
function that checks the paramter whether its a position and whether its legit (= inside the world, depending on mapsize).QA:
Is my dumbfix any good? I can't properly reproduce it anyways.
Since I implemented it, could anyone look at the code or test and greenlight by 👍 ?
i'm not a huge fan of defaulting to
vector.zero()
- it means that something unexpected is going to happen at 0,0,0. note that we've already had at least one issue that resulted in something weird being placed at that position (un-diggable, un-owned bones, i don't remember if i ever figured out why, but see #2796).better would be to not do any further processing if
self.object
is not active, i.e. when:get_pos()
(or most other methods) returnsnil
, which means we've got an object which has either been:remove()
'ed or unloaded.oh apparently i did figure out #2796, but still, really really esoteric reasoning
Should we fix this in a different way than by defaulting to 0? If so, how?
Would this work?
In theory returning early would prevent mio from being picked up or healed, but in practice that should never happen, right?
Or, if no
pos
means it's inactive, then picking it up or healing would be the wrong thing to do?that looks right
Committed here:
da30b2579c
this is live presumably