User Name:


Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, Yandex, Remcon, Bing

Members: 1
Guests: 9
Newest Member
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » Potential bug: decaying weapo...
Forum Rules | Mark all | Recent Posts

Potential bug: decaying weapons/dual wielding
< Newer Topic :: Older Topic > Secondary weapon doesn't move to pr

Pages:<< prev 1 next >>
Post is unread #1 Aug 1, 2003, 2:44 pm
Go to the top of the page
Go to the bottom of the page

JoinedNov 28, 2007

When you remove your primary weapon, your secondary weapon moves to the primary spot. Yet when the primary weapon disappears for another reason (such as being destroyed by 'poison weapon'), the secondary weapon stays in the dual wield spot. I've found this to be true in my Smaug 1.02a, and the code for it seemed to have the same problem in 1.4, but I can't be sure since I'm not familar with that code. You experts might want to check this on your own Smaugs and derivatives.

Basically remove_obj() (called by do_remove) has a nice special check for the weapon situation before it calls unequip_char() to move the item to the inventory. On the other hand, obj_update() which handles the timer, calls extract_obj() which in turn calls obj_from_char().

I figure that putting a special case in obj_from_char will fix this, not only for poisoned weapons, but for any other time that a weapon is removed in some way. I amended part of obj_from_char as follows:

if ( obj->wear_loc != WEAR_NONE )
    /* Extra fix taken from remove_obj() to fix the poison_weapon
     * bug with dual wielded weapons remaining dual-wielded once
     * the primary weapon corroded -- Kylo, 01/08/03 */
    OBJ_DATA *tmpobj;

    if ( obj->wear_loc == WEAR_WIELD &&
        ( tmpobj = get_eq_char( ch, WEAR_DUAL_WIELD)) != NULL )
        tmpobj->wear_loc = WEAR_WIELD;

    unequip_char( ch, obj );
Pages:<< prev 1 next >>