Skip to content

Armor should check node groups and armor groups instead of a hard-coded table #169

@Poikilos

Description

@Poikilos
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions