[3.5] Oops

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PowerWyrm
    Prophet
    • Apr 2008
    • 2986

    [3.5] Oops

    Strange that nobody reported that already. When your character has nothing in inventory and you press 'e', you get "You are not wielding or wearing anything." message whatever your current equipment is. When you actually are not wearing anything and press 'e', your inventory is displayed instead of the expected message.

    This is due to a copy/paste error from do_cmd_inven() in do_cmd_equip() which uses p_ptr->inventory[0].kind for the test instead of looking for any item in equipment slots like this:

    Code:
        int item, i, last_slot = 0;
        int ret = 3;
        object_type *o_ptr;
    
        /* Find the last occupied equipment slot */
        for (i = INVEN_WIELD; i < ALL_INVEN_TOTAL; i++)
        {
            o_ptr = &p_ptr->inventory[i];
            if (o_ptr->kind) last_slot = i;
        }
    
        /* Check inventory, since get_item() will default to inventory list when equipment is empty. -- this cannot work if inventory is empty!!! */
        //if (!p_ptr->inventory[0].kind)
        if (!last_slot) {
            msg("You are not wielding or wearing anything.");
            return;
        }
    PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!
  • PowerWyrm
    Prophet
    • Apr 2008
    • 2986

    #2
    Filed as #1824.
    PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!

    Comment

    Working...
    😀
    😂
    🥰
    😘
    🤢
    😎
    😞
    😡
    👍
    👎