crash if spear hits an unknown node #1778

Closed
opened 2022-04-16 20:12:41 +00:00 by flux · 4 comments
Member

This is on a local test server, there shouldn't be any unknown nodes on the live server, but technically still a bug:

2022-04-16 13:09:45: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'spears' in callback luaentity_Step(): ...t/bin/../worlds/your-land/worldmods/spears/functions.lua:119: attempt to index a nil value
This is on a local test server, there shouldn't be any unknown nodes on the live server, but technically still a bug: ``` 2022-04-16 13:09:45: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'spears' in callback luaentity_Step(): ...t/bin/../worlds/your-land/worldmods/spears/functions.lua:119: attempt to index a nil value ```
flux added the
1. kind/bug
label 2022-04-16 20:12:47 +00:00
AliasAlreadyTaken added the
2. prio/critical
label 2022-04-16 20:18:24 +00:00

We can't rule out the existence of unknown nodes, this could very well lead to a server crash on the main.

Maybe its time we threw out old missiles and made us new ones. No pun intended.

your-land/administration#132

We can't rule out the existence of unknown nodes, this could very well lead to a server crash on the main. Maybe its time we threw out old missiles and made us new ones. No pun intended. https://gitea.your-land.de/your-land/administration/issues/132

Line 119 and following are a horribly long expression

if node and minetest.registered_nodes[node.name].walkable
				and not minetest.registered_nodes[node.name].buildable_to
				and not (minetest.registered_nodes[node.name].groups.slab and spearhead_pos.y % 1 < 0.5)

I changed it to

if node and minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].walkable
				and not minetest.registered_nodes[node.name].buildable_to
				and not (minetest.registered_nodes[node.name].groups.slab and spearhead_pos.y % 1 < 0.5)

as an immediate fix. "Real" solution must come from administration 132

Line 119 and following are a horribly long expression ``` if node and minetest.registered_nodes[node.name].walkable and not minetest.registered_nodes[node.name].buildable_to and not (minetest.registered_nodes[node.name].groups.slab and spearhead_pos.y % 1 < 0.5) ``` I changed it to ``` if node and minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].walkable and not minetest.registered_nodes[node.name].buildable_to and not (minetest.registered_nodes[node.name].groups.slab and spearhead_pos.y % 1 < 0.5) ``` as an immediate fix. "Real" solution must come from administration 132
AliasAlreadyTaken added this to the 1.1.110 milestone 2022-05-01 13:56:36 +00:00

Fixed in 7333c8e03a

Fixed in https://gitea.your-land.de/your-land/spears/commit/7333c8e03a16f6405494f5dfc75fcb06e7d07709

There's an awful lot more crazy code in there.

There's an awful lot more crazy code in there.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: your-land/bugtracker#1778
No description provided.