minetest-3d_armor
minetest-3d_armor copied to clipboard
Armor should check node groups and armor groups instead of a hard-coded table
- row[2] is the "damage" field of the armor_fire table:
if hp > 0 and armor.def[name].fire < row[2] then
(see https://github.com/stujones11/minetest-3d_armor/blob/master/3d_armor/init.lua#L458) - I don't understand why you would have an armor_fire table. Why don't you just use the actual node's
hot
number to determine damage, and "fire" aspect of armor to reduce damage? - Related variable naming: Calling them nodes obfuscates the code. ARMOR_FIRE_NODES and armor_fire are tables (in spreadsheet terms not just Lua terms)--a row in the table is not a node, it is a mapping aka
row
(which is clear in the code), but "for row in table" would be named clearly enough.