Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Yahoo!, Bing

Members: 0
Guests: 7
Stats
Files
Topics
Posts
Members
Newest Member
477
3,706
19,240
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Bugfix Lists » SmaugFUSS Bugfix List » [Bug] Dual wield handling isn...
Forum Rules | Mark all | Recent Posts

[Bug] Dual wield handling isn't properly checked
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Mar 5, 2005, 3:55 pm   Last edited May 11, 2005, 6:34 pm by Samson
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Bug: Dual wield handling isn't properly checked.
Danger: medium
Found by: Druid
Fixed by: Druid, Orion Elder
-----
(act_obj.c)
Find the can_dual function, and replace it with:

/*
 * Check for the ability to dual-wield under all conditions.  -Orion
 *
 * Original version by Thoric.
 */
bool can_dual( CHAR_DATA *ch )
{
    /*
     * We must assume that when they come in, they are NOT wielding something. We
     * take care of the actual value later. -Orion
     */
    bool wielding[2], alreadyWielding = FALSE;
    wielding[0] = FALSE;
    wielding[1] = FALSE;

    /*
     * If they don't have the ability to dual-wield, why should we allow them to
     * do so? -Orion
     */
    if ( !could_dual(ch) )
        return FALSE;

    /*
     * Get that true wielding value I mentioned earlier. If they're wielding and
     * missile wielding, we can simply return FALSE. If not, set the values. -Orion
     */
    if ( get_eq_char( ch, WEAR_WIELD ) && get_eq_char( ch, WEAR_MISSILE_WIELD ) )
    {
        send_to_char( "You are already wielding two weapons... grow some more arms!\n\r", ch );
        return FALSE;
    }
    else
    {
        /*
         * Wield position. -Orion
         */
        wielding[0] = get_eq_char( ch, WEAR_WIELD ) ? TRUE : FALSE;
        /*
         * Missile wield position. -Orion
         */
        wielding[1] = get_eq_char( ch, WEAR_MISSILE_WIELD ) ? TRUE : FALSE;
    }

    /*
     * Save some extra typing farther down. -Orion
     */
    if ( wielding[0] || wielding[1] )
        alreadyWielding = TRUE;

    /*
     * If wielding and dual wielding, then they can't wear another weapon. Return
     * FALSE. We can assume that dual wield will not be full if there is no wield
     * slot already filled. -Orion
     */
    if ( wielding[0] && get_eq_char( ch, WEAR_DUAL_WIELD ) )
    {
        send_to_char( "You are already wielding two weapons... grow some more arms!\n\r", ch );
        return FALSE;
    }

    /*
     * If wielding or missile wielding and holding a shield, then we can return
     * FALSE. -Orion
     */
    if ( alreadyWielding && get_eq_char( ch, WEAR_SHIELD ) )
    {
        send_to_char( "You cannot dual wield, you're already holding a shield!\n\r", ch );
        return FALSE;
    }

    /*
     * If wielding or missile wielding and holding something, then we can return
     * FALSE. -Orion
     */
    if ( alreadyWielding && get_eq_char( ch, WEAR_HOLD ) )
    {
        send_to_char( "You cannot hold another weapon, you're already holding something in that hand!\n\r", ch );
        return FALSE;
    }

    return TRUE;
}


EDIT: The second half of this fix has been superceded by an updated fix that corrects a crash bug not caught by the previous fix. See the October 2 post for the new fix.
       
Pages:<< prev 1 next >>