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, Yandex, Sogou, 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 » Codebases » SmaugFUSS » Wielding/Dual wielding
Forum Rules | Mark all | Recent Posts

Wielding/Dual wielding
< Newer Topic :: Older Topic > Bug? Aftering applying the fix?

Pages:<< prev 1 next >>
Post is unread #1 Nov 4, 2004, 6:13 pm   Last edited Nov 4, 2004, 6:14 pm by Anavel
Go to the top of the page
Go to the bottom of the page

Anavel
Apprentice
GroupMembers
Posts24
JoinedMar 6, 2005

Well there seems to be a bug. With the fix applied I can't wield swords anymore. When I type wield saber it forces me to hold it instead. I checked the stats on the saber and it has the wield flag on. Then I used the old smaugfuss and I am able to wield items that have the wield/dual flags. Or am I doing something wrong? And no I don't get any bug logs.
       
Post is unread #2 Nov 4, 2004, 7:44 pm
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts367
JoinedMar 7, 2005

I haven't had any problems, but that doesn't necessarily mean your issue isn't legit. Can you give the vnum of the item you're talking about (if it's stock) or at least what area file it's from? If you've created it yourself can you mayb share the "ostat" screen for that item?

I've tried equipping myself with swords and sabres but there's nothing that comes up on my system that I can't wield properly. Then again if it's a custom item that you've created it would explain that. Anyway, more info would certainly be useful, as I'm rather curious (as are others, no doubt) about any potential bug of this sort. :blink:

       
Post is unread #3 Nov 5, 2004, 4:18 am   Last edited Nov 5, 2004, 8:33 am by Anavel
Go to the top of the page
Go to the bottom of the page

Anavel
Apprentice
GroupMembers
Posts24
JoinedMar 6, 2005

All the swords in the MUD are ones that I made myself. Here are the stats on the beam saber.

Name: A beam saber
Vnum: 10309 Type: weapon Count: 2 Gcount: 1
Serial#: 79 TopIdxSerial#: 79 TopSerial#: 99
Short description: A glowing beam saber
Long description : An RX-78-3 beam saber lies here on the ground.

Wear flags : take wield
Extra flags: glow hum metal
Magic flags: none
Number: 1/1 Weight: 5/5 Layers: 0 Wear_loc: -1
Cost: 50000 Rent: 50000 Timer: 0 Level: 65
In room: 0 In object: (none) Carried by: Anavel
Index Values : 13 0 0 2 0 0.
Object Values: 13 19 55 2 0 0.

wield beam
You hold A glowing beam saber in your hands.

Then I uploaded the stock grave.are area to the MUD and invoked a silver dagger.
Stats:
Name: dagger silver
Vnum: 3613 Type: weapon Count: 2 Gcount: 1
Serial#: 98 TopIdxSerial#: 98 TopSerial#: 99
Short description: a silver dagger
Long description : A long silver dagger is lying here.
Action description: pierce
Wear flags : take wield
Extra flags:
Magic flags: none
Number: 1/1 Weight: 1/1 Layers: 0 Wear_loc: -1
Cost: 100 Rent: 10 Timer: 0 Level: 65
In room: 0 In object: (none) Carried by: Anavel
Index Values : 0 2 4 11 0 0.
Object Values: 12 2 8 11 0 0.
Primary description keywords: 'dagger silver'.
Affects damage roll by 1.

wield dagger
You stop using A glowing beam saber.
You hold a silver dagger in your hands.

So even though if its a stock area it still forces me to hold it instead of wielding it. :(

Well I changed the act_obj.c portion where "case ITEM_WIELD:' is, to the old SmaugFUSS act_obj.c and I am able to wield swords.
       
Post is unread #4 Nov 5, 2004, 8:12 pm
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts367
JoinedMar 7, 2005

All the swords in the MUD are ones that I made myself. Here are the stats on the beam saber.

Name: A beam saber
Vnum: 10309 Type: weapon Count: 2 Gcount: 1
Serial#: 79 TopIdxSerial#: 79 TopSerial#: 99
Short description: A glowing beam saber
Long description : An RX-78-3 beam saber lies here on the ground.

Wear flags : take wield
Extra flags: glow hum metal
Magic flags: none
Number: 1/1 Weight: 5/5 Layers: 0 Wear_loc: -1
Cost: 50000 Rent: 50000 Timer: 0 Level: 65
In room: 0 In object: (none) Carried by: Anavel
Index Values : 13 0 0 2 0 0.
Object Values: 13 19 55 2 0 0.

wield beam
You hold A glowing beam saber in your hands.

Then I uploaded the stock grave.are area to the MUD and invoked a silver dagger.
Stats:
Name: dagger silver
Vnum: 3613 Type: weapon Count: 2 Gcount: 1
Serial#: 98 TopIdxSerial#: 98 TopSerial#: 99
Short description: a silver dagger
Long description : A long silver dagger is lying here.
Action description: pierce
Wear flags : take wield
Extra flags:
Magic flags: none
Number: 1/1 Weight: 1/1 Layers: 0 Wear_loc: -1
Cost: 100 Rent: 10 Timer: 0 Level: 65
In room: 0 In object: (none) Carried by: Anavel
Index Values : 0 2 4 11 0 0.
Object Values: 12 2 8 11 0 0.
Primary description keywords: 'dagger silver'.
Affects damage roll by 1.

wield dagger
You stop using A glowing beam saber.
You hold a silver dagger in your hands.

So even though if its a stock area it still forces me to hold it instead of wielding it. :(

Well I changed the act_obj.c portion where "case ITEM_WIELD:' is, to the old SmaugFUSS act_obj.c and I am able to wield swords.

Perhaps you should post the relevant code, exactly as you have it when this behavior is observed? I know for a fact that I have no such problems loading stock objects, swords or otherwise, and equipping into the proper location. I'm curious about your problem though and I'd like to know what's going on if we can figure it out.

Please post some code so everyone can see exactly what you're using when you get this to happen.

       
Post is unread #5 Nov 5, 2004, 9:56 pm   Last edited Nov 5, 2004, 10:02 pm by Anavel
Go to the top of the page
Go to the bottom of the page

Anavel
Apprentice
GroupMembers
Posts24
JoinedMar 6, 2005

This is the old smaugFUSS code that I am using right now that allows me to wield swords.

      case ITEM_WIELD:
     if ( !could_dual(ch) )
     {
  if ( !remove_obj( ch, WEAR_MISSILE_WIELD, fReplace ) )
      return;
  if ( !remove_obj(ch, WEAR_WIELD, fReplace) )
      return;
  tmpobj = NULL;
     }
     else
     {
  OBJ_DATA *mw, *dw, *hd;

  tmpobj = get_eq_char(ch, WEAR_WIELD);
  mw = get_eq_char(ch, WEAR_MISSILE_WIELD);
  dw = get_eq_char(ch, WEAR_DUAL_WIELD);
  hd = get_eq_char(ch, WEAR_HOLD);
                if ( tmpobj || mw )
               {
                   if ( !can_dual( ch ) )
                       return;

                   if ( get_obj_weight(obj) + get_obj_weight(tmpobj) > str_app[get_curr_str(ch)].wield )
                   {
                       send_to_char( "It is too heavy for you to wield.\n\r", ch );
                       return;
                   }
                   if ( !oprog_use_trigger( ch, obj, NULL, NULL, NULL ) )
                   {
                       act( AT_ACTION, "$n dual-wields $p.", ch, obj, NULL, TO_ROOM );
                       act( AT_ACTION, "You dual-wield $p.", ch, obj, NULL, TO_CHAR );
                   }
                   if ( 1 << bit == ITEM_MISSILE_WIELD )
                       equip_char( ch, obj, WEAR_MISSILE_WIELD );
                   else
                       equip_char( ch, obj, WEAR_DUAL_WIELD );
                   oprog_wear_trigger( ch, obj );
                   return;
               }

  if ( tmpobj && (mw || dw) )
  {
      send_to_char( "You're already wielding two weapons.\n\r", ch );
      return;
  }
  if ( (mw && hd) || (tmpobj && hd) )
  {
      send_to_char( "You're already wielding a weapon AND holding something.\n\r", ch );
      return;
  }
     }

     if ( get_obj_weight(obj) > str_app[get_curr_str(ch)].wield )
     {
  send_to_char( "It is too heavy for you to wield.\n\r", ch );
  return;
     }

            if ( !oprog_use_trigger( ch, obj, NULL, NULL, NULL ) )
            {
  act( AT_ACTION, "$n wields $p.", ch, obj, NULL, TO_ROOM );
  act( AT_ACTION, "You wield $p.", ch, obj, NULL, TO_CHAR );
            }
     if ( 1 << bit == ITEM_MISSILE_WIELD )
  equip_char( ch, obj, WEAR_MISSILE_WIELD );
     else
  equip_char( ch, obj, WEAR_WIELD );
     oprog_wear_trigger( ch, obj );
     return;


This is the code fix that I applied from Samson's post.

      case ITEM_WIELD:
        if( !could_dual(ch) )
        {
           if( !remove_obj( ch, WEAR_MISSILE_WIELD, fReplace ) )
              return;
           if( !remove_obj( ch, WEAR_WIELD, fReplace ) )
              return;
           tmpobj = NULL;
 }

        else
        {            
           OBJ_DATA *mw, *dw, *hd;
           tmpobj = get_eq_char( ch, WEAR_WIELD );
           mw = get_eq_char( ch, WEAR_MISSILE_WIELD );
           dw = get_eq_char( ch, WEAR_DUAL_WIELD );
           hd = get_eq_char( ch, WEAR_HOLD );

           if( tmpobj )
           {
              if( !can_dual( ch ) )
                 return;

              if( get_obj_weight(obj) + get_obj_weight(tmpobj) > str_app[get_curr_str(ch)].wield )
              {
                 send_to_char( "It is too heavy for you to wield.\n\r", ch );
                 return;
              }

              if( mw || dw )
              {
                 send_to_char( "You're already wielding two weapons.\n\r", ch );
                 return;
              }

              if( hd )
              {
                 send_to_char( "You're already wielding a weapon AND holding something.\n\r", ch );
                 return;
              }

              if( !oprog_use_trigger( ch, obj, NULL, NULL, NULL ) )
              {
                 act( AT_ACTION, "$n dual-wields $p.", ch, obj, NULL, TO_ROOM );
                 act( AT_ACTION, "You dual-wield $p.", ch, obj, NULL, TO_CHAR );
              }
              if( 1 << bit == ITEM_MISSILE_WIELD )
                 equip_char( ch, obj, WEAR_MISSILE_WIELD );
              else
                 equip_char( ch, obj, WEAR_DUAL_WIELD );
              oprog_wear_trigger( ch, obj );
              return;
           }

           if( mw )
           {
              if( !can_dual( ch ) )
                 return;

              if( 1 << bit == ITEM_MISSILE_WIELD )
              {
                 send_to_char( "You're already wielding a missile weapon.\n\r", ch );
                 return;
              }

              if( get_obj_weight(obj) + get_obj_weight(mw) > str_app[get_curr_str(ch)].wield )
              {
                 send_to_char( "It is too heavy for you to wield.\n\r", ch );
                 return;
              }

              if( tmpobj || dw )
              {
                 send_to_char( "You're already wielding two weapons.\n\r", ch );
                 return;
              }

              if( hd )
              {
                 send_to_char( "You're already wielding a weapon AND holding something.\n\r", ch );
                 return;
              }

              if( !oprog_use_trigger( ch, obj, NULL, NULL, NULL ) )
              {
                 act( AT_ACTION, "$n wields $p.", ch, obj, NULL, TO_ROOM );
                 act( AT_ACTION, "You wield $p.", ch, obj, NULL, TO_CHAR );
              }
              equip_char( ch, obj, WEAR_WIELD );
              oprog_wear_trigger( ch, obj );
              return;
           }
        }


I removed the old smaugFUSS code again for wielding and added the fix to it just incase I might get lucky this time.

After I compiled the mud with the fix I got no errors. Before I applied the fix, I was wielding an object. So I log on and type eq and I get this:

Comm: Anavel returns from beyond the void.

Health [100000] Spirit Energy [100000] Energy [100000] <#10407> eq
You are using:
<used as light> <> (Glowing) The gods orb of infinate light
<worn on body> <++++++++++> Body armor
<wielded> <++++++++++> (Humming) A gleaming adamantium mace

Then I typed wear beam to see if I could dual-wield:

Health [100000] Spirit Energy [100000] Energy [100000] <#10407> wear beam
You dual-wield A glowing beam saber.

Health [100000] Spirit Energy [100000] Energy [100000] <#10407> eq
You are using:
<used as light> <> (Glowing) The gods orb of infinate light
<worn on body> <++++++++++> Body armor
<wielded> <++++++++++> (Humming) A gleaming adamantium mace
<dual wielded> <> (Glowing) (Humming) A glowing beam saber

I didn't get any bug logs. I thought it was fixed so I removed all my items and wore them all again, but then this happens:

remo all
You can't remove The gods orb of infinate light.
You stop using Body armor.
You stop using A glowing beam saber.
You stop using A gleaming adamantium mace.


Health [100000] Spirit Energy [100000] Energy [100000] <#10407> wear beam
You hold A glowing beam saber in your hands.

Health [100000] Spirit Energy [100000] Energy [100000] <#10407> wear mace
You stop using A glowing beam saber.
You hold A gleaming adamantium mace in your hands.

One thing I noticed was that Samson's old code had this in it:

  if( ( tmpobj && IS_OBJ_FLAG( tmpobj, ITEM_TWOHAND ) ) 
     || ( mw && IS_OBJ_FLAG( mw, ITEM_TWOHAND ) ) )


But I doubt that has nothing to do with the bug.
       
Post is unread #6 Nov 6, 2004, 9:11 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002


Comm: Anavel returns from beyond the void.


You sure you're using SmaugFUSS and not something else? This log message is not in the code anywhere. The only two places it could come from are the rent snippet and if you are using the AFKMud codebase.

As with gatewaysysop, I am not running into any problems with the fix putting things in the wrong places. Weapons with wield flags go where they should, things with hold flags get held, shields get worn properly. You've added one snippet at least so far. Did you add any others that might have skewed your weapon slots? Like perhaps the profficiency patch? That has been known to cause some wierd problems just like this if the items are not later corrected.

As far as the TWOHAND flag, that was a copying mistake on my part and has been removed from the fix post.
       
Post is unread #7 Nov 6, 2004, 3:07 pm   Last edited Nov 6, 2004, 3:19 pm by Anavel
Go to the top of the page
Go to the bottom of the page

Anavel
Apprentice
GroupMembers
Posts24
JoinedMar 6, 2005

QUOTE 

Comm: Anavel returns from beyond the void.


You sure you're using SmaugFUSS and not something else? This log message is not in the code anywhere. The only two places it could come from are the rent snippet and if you are using the AFKMud codebase.


Yes I'm using smaugFUSS, I recently installed the rent snippet. My version of FUSS is about 7-8 months old and I've added about 27 (give or take) snippets on my mud. :D And I haven't add the profficiency patch to my mud. By the looks of the file names in my folder that contains all the installed snippets, none of them have to do with modifying EQ except for maybe the "<wielded> <++++++++++> (Hum" one, but I was having the wieling problem before I installed it.

Not to mention, yesterday I installed the wielding fix to the smaugFUSS package that I downloaded on Saturday, May 01, 2004, 9:09:46 AM. :) (Keep in mind that I have 2 smaugFUSS packages on my computer, one being the original package that I downloaded on May and the other being the FUSS with all the snippets installed.) After I did a clean compile I logged on and tryed to wield a dagger/sword and I got the same results as I have being having.
       
Post is unread #8 Nov 6, 2004, 3:55 pm
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts367
JoinedMar 7, 2005

Yes I'm using smaugFUSS, I recently installed the rent snippet. My version of FUSS is about 7-8 months old and I've added about 27 (give or take) snippets on my mud. :D And I haven't add the profficiency patch to my mud. By the looks of the file names in my folder that contains all the installed snippets, none of them have to do with modifying EQ except for maybe the "<wielded> <++++++++++> (Hum" one, but I was having the wieling problem before I installed it.

Hrmmmm.

With that many snippets involved, are you entirely sure you haven't touched the code somewhere in a way that could be linked to this problem? A clean compile doesn't necessarily mean everything is as it should be. As for that particular EQ snippet you're talking about, I had issues with it and promptly removed it. I don't particularly recall what it was, but oh well.

Perhaps you can list the snippets you have installed, or maybe you can cross check with your "unaltered" act_obj.c and compare the relevant portions of the code to see if there's anything changed between the two besides the fix that you keep blaming the problem on? :huh: Just a suggestion, since it doesn't seem possible to reproduce your problem on mine or Samson's end. I'm not saying the fix isn't the issue, but I think it would be somewhat productive to look elsewhere instead of focusing on something that is quickly losing plausibility.

       
Post is unread #9 Nov 6, 2004, 4:54 pm   Last edited Nov 6, 2004, 5:18 pm by Anavel
Go to the top of the page
Go to the bottom of the page

Anavel
Apprentice
GroupMembers
Posts24
JoinedMar 6, 2005

Well I fixed the problem. I downloaded the current version of FUSS and looked at act_obj.c and copyed the item_wield code:

  case ITEM_WIELD:
     if ( !could_dual(ch) )
     {
  if ( !remove_obj( ch, WEAR_MISSILE_WIELD, fReplace ) )
      return;
  if ( !remove_obj(ch, WEAR_WIELD, fReplace) )
      return;
  tmpobj = NULL;
     }
         else
         {            
            OBJ_DATA *mw, *dw, *hd;
            tmpobj = get_eq_char( ch, WEAR_WIELD );
            mw = get_eq_char( ch, WEAR_MISSILE_WIELD );
            dw = get_eq_char( ch, WEAR_DUAL_WIELD );
            hd = get_eq_char( ch, WEAR_HOLD );

            if( tmpobj )
            {
               if( !can_dual( ch ) )
                  return;

               if( get_obj_weight(obj) + get_obj_weight(tmpobj) > str_app[get_curr_str(ch)].wield )
               {
                  send_to_char( "It is too heavy for you to wield.\n\r", ch );
                  return;
               }

               if( mw || dw )
               {
                  send_to_char( "You're already wielding two weapons.\n\r", ch );
                  return;
               }

               if( hd )
               {
                  send_to_char( "You're already wielding a weapon AND holding something.\n\r", ch );
                  return;
               }

               if( !oprog_use_trigger( ch, obj, NULL, NULL, NULL ) )
               {
                  act( AT_ACTION, "$n dual-wields $p.", ch, obj, NULL, TO_ROOM );
                  act( AT_ACTION, "You dual-wield $p.", ch, obj, NULL, TO_CHAR );
               }
               if( 1 << bit == ITEM_MISSILE_WIELD )
                  equip_char( ch, obj, WEAR_MISSILE_WIELD );
               else
                  equip_char( ch, obj, WEAR_DUAL_WIELD );
               oprog_wear_trigger( ch, obj );
               return;
            }

            if( mw )
            {
               if( !can_dual( ch ) )
                  return;

               if( 1 << bit == ITEM_MISSILE_WIELD )
               {
                  send_to_char( "You're already wielding a missile weapon.\n\r", ch );
                  return;
               }

               if( get_obj_weight(obj) + get_obj_weight(mw) > str_app[get_curr_str(ch)].wield )
               {
                  send_to_char( "It is too heavy for you to wield.\n\r", ch );
                  return;
               }

               if( tmpobj || dw )
               {
                  send_to_char( "You're already wielding two weapons.\n\r", ch );
                  return;
               }

               if( hd )
               {
                  send_to_char( "You're already wielding a weapon AND holding something.\n\r", ch );
                  return;
               }

               if( !oprog_use_trigger( ch, obj, NULL, NULL, NULL ) )
               {
                  act( AT_ACTION, "$n wields $p.", ch, obj, NULL, TO_ROOM );
                  act( AT_ACTION, "You wield $p.", ch, obj, NULL, TO_CHAR );
               }
               equip_char( ch, obj, WEAR_WIELD );
               oprog_wear_trigger( ch, obj );
               return;
            }
         }

    if ( get_obj_weight(obj) > str_app[get_curr_str(ch)].wield )
     {
  send_to_char( "It is too heavy for you to wield.\n\r", ch );
  return;
     }

            if ( !oprog_use_trigger( ch, obj, NULL, NULL, NULL ) )
            {
  act( AT_ACTION, "$n wields $p.", ch, obj, NULL, TO_ROOM );
  act( AT_ACTION, "You wield $p.", ch, obj, NULL, TO_CHAR );
            }
     if ( 1 << bit == ITEM_MISSILE_WIELD )
  equip_char( ch, obj, WEAR_MISSILE_WIELD );
     else
  equip_char( ch, obj, WEAR_WIELD );
     oprog_wear_trigger( ch, obj );
     return;


Fix:

Replace with:

CODE

case ITEM_MISSILE_WIELD:
case ITEM_WIELD:
if( !could_dual(ch) )
{
if( !remove_obj( ch, WEAR_MISSILE_WIELD, fReplace ) )
return;
if( !remove_obj( ch, WEAR_WIELD, fReplace ) )
return;
tmpobj = NULL;
}

else
{
OBJ_DATA *mw, *dw, *hd;
tmpobj = get_eq_char( ch, WEAR_WIELD );
mw = get_eq_char( ch, WEAR_MISSILE_WIELD );
dw = get_eq_char( ch, WEAR_DUAL_WIELD );
hd = get_eq_char( ch, WEAR_HOLD );

if( tmpobj )
{
if( !can_dual( ch ) )
return;

if( get_obj_weight(obj) + get_obj_weight(tmpobj) > str_app[get_curr_str(ch)].wield )
{
send_to_char( "It is too heavy for you to wield.\n\r", ch );
return;
}

if( mw || dw )
{
send_to_char( "You're already wielding two weapons.\n\r", ch );
return;
}

if( hd )
{
send_to_char( "You're already wielding a weapon AND holding something.\n\r", ch );
return;
}

if( !oprog_use_trigger( ch, obj, NULL, NULL, NULL ) )
{
act( AT_ACTION, "$n dual-wields $p.", ch, obj, NULL, TO_ROOM );
act( AT_ACTION, "You dual-wield $p.", ch, obj, NULL, TO_CHAR );
}
if( 1 << bit == ITEM_MISSILE_WIELD )
equip_char( ch, obj, WEAR_MISSILE_WIELD );
else
equip_char( ch, obj, WEAR_DUAL_WIELD );
oprog_wear_trigger( ch, obj );
return;
}

if( mw )
{
if( !can_dual( ch ) )
return;

if( 1 << bit == ITEM_MISSILE_WIELD )
{
send_to_char( "You're already wielding a missile weapon.\n\r", ch );
return;
}

if( get_obj_weight(obj) + get_obj_weight(mw) > str_app[get_curr_str(ch)].wield )
{
send_to_char( "It is too heavy for you to wield.\n\r", ch );
return;
}

if( tmpobj || dw )
{
send_to_char( "You're already wielding two weapons.\n\r", ch );
return;
}

if( hd )
{
send_to_char( "You're already wielding a weapon AND holding something.\n\r", ch );
return;
}

if( !oprog_use_trigger( ch, obj, NULL, NULL, NULL ) )
{
act( AT_ACTION, "$n wields $p.", ch, obj, NULL, TO_ROOM );
act( AT_ACTION, "You wield $p.", ch, obj, NULL, TO_CHAR );
}
equip_char( ch, obj, WEAR_WIELD );
oprog_wear_trigger( ch, obj );
return;
}
}


Samson's post was missing this part of the fix which was causing my problem:

     if ( get_obj_weight(obj) > str_app[get_curr_str(ch)].wield )
     {
  send_to_char( "It is too heavy for you to wield.\n\r", ch );
  return;
     }

            if ( !oprog_use_trigger( ch, obj, NULL, NULL, NULL ) )
            {
  act( AT_ACTION, "$n wields $p.", ch, obj, NULL, TO_ROOM );
  act( AT_ACTION, "You wield $p.", ch, obj, NULL, TO_CHAR );
            }
     if ( 1 << bit == ITEM_MISSILE_WIELD )
  equip_char( ch, obj, WEAR_MISSILE_WIELD );
     else
  equip_char( ch, obj, WEAR_WIELD );
     oprog_wear_trigger( ch, obj );
     return;
       
Post is unread #10 Nov 6, 2004, 7:30 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Well hopefully now the post has all of the material it should have. I just went back and pasted the working segment into the post. Sorry about that :/
       
Post is unread #11 Nov 6, 2004, 10:42 pm
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts367
JoinedMar 7, 2005

Well hopefully now the post has all of the material it should have. I just went back and pasted the working segment into the post. Sorry about that :/

Maybe I'm just looking at it wrong or I've been up too late, but it seems like the relevant section that Anavel is talking about is still missing from the "fix" section of the post. :blink:

I suppose this would have been more noticable had I actually used the posted fix, but since I plugged in my own version I didn't actually change that part and so it hasn't been a problem. Strange stuff. :ph34r:
       
Post is unread #12 Nov 13, 2004, 8:45 pm
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts367
JoinedMar 7, 2005

*Bump*

Am I just seeing this or is this still missing? Anyone? :blink:

       
Post is unread #13 Nov 14, 2004, 7:45 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Erm. I could swear I fixed it. Could someone with a complete ITEM_WIELD section show me the entire section from the case: ITEM_WIELD down to the final break; before the next case statement? This way I can be sure we're all on the same page with the proper fix.
       
Post is unread #14 Nov 14, 2004, 9:56 am
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts367
JoinedMar 7, 2005

Erm. I could swear I fixed it. Could someone with a complete ITEM_WIELD section show me the entire section from the case: ITEM_WIELD down to the final break; before the next case statement? This way I can be sure we're all on the same page with the proper fix.

This is exactly what I have. I've tested it as rigorously as I thought necessary, but obviously I can't think of everything. There could still be issues, but I haven't identified any as of yet with this. Anyway, for what it's worth here goes. Feedback more than welcome.


case ITEM_WIELD:
     if ( !could_dual(ch) )
     {
  if ( !remove_obj( ch, WEAR_MISSILE_WIELD, fReplace ) )
      return;
  if ( !remove_obj(ch, WEAR_WIELD, fReplace) )
      return;
  tmpobj = NULL;
     }
     else
     {
  OBJ_DATA *mw, *dw, *hd;

  tmpobj = get_eq_char(ch, WEAR_WIELD);
                mw = get_eq_char(ch, WEAR_MISSILE_WIELD);
                dw = get_eq_char(ch, WEAR_DUAL_WIELD);
                hd = get_eq_char(ch, WEAR_HOLD);
                 if ( tmpobj )
                {
                   if ( !can_dual( ch ) )
                       return;

                   if ( get_obj_weight(obj) + get_obj_weight(tmpobj) > str_app[get_curr_str(ch)].wield )
                   {
                       send_to_char( "It is too heavy for you to wield.\n\r", ch );
                       return;
                   }
                   if ( !oprog_use_trigger( ch, obj, NULL, NULL, NULL ))
                   {
                       act( AT_ACTION, "$n dual-wields $p.", ch, obj, NULL, TO_ROOM );
                       act( AT_ACTION, "You dual-wield $p.", ch, obj, NULL, TO_CHAR );
                   }
                   if ( 1 << bit == ITEM_MISSILE_WIELD )
                       equip_char( ch, obj, WEAR_MISSILE_WIELD );
                   else
                       equip_char( ch, obj, WEAR_DUAL_WIELD );
                   oprog_wear_trigger( ch, obj );
                   return;
               }

               if ( mw )
               {
                   if ( !can_dual( ch ) )
                       return;

                   if ( 1 << bit == ITEM_MISSILE_WIELD )
                     { 
                      send_to_char( "You're already wielding a missile weapon.\n\r", ch );
                      return;
                     }
                   if ( get_obj_weight(obj) + get_obj_weight(mw) > str_app[get_curr_str(ch)].wield )
                   {
                     send_to_char( "It is too heavy for you to wield.\n\r", ch );
                     return;
                   }
                   if ( !oprog_use_trigger( ch, obj, NULL, NULL, NULL ))
                   {
                       act( AT_ACTION, "$n wields $p.", ch, obj, NULL, TO_ROOM );
                       act( AT_ACTION, "You wield $p.", ch, obj, NULL, TO_CHAR );
                   }
                      equip_char( ch, obj, WEAR_WIELD );
                      oprog_wear_trigger( ch, obj );
                      return;
                 } 

             

  if ( tmpobj && (mw || dw) )
  {
      send_to_char( "You're already wielding two weapons.\n\r", ch );
      return;
  }
  if ( (mw && hd) || (tmpobj && hd) )
  {
      send_to_char( "You're already wielding a weapon AND holding something.\n\r", ch );
      return;
  }
     }

     if ( get_obj_weight(obj) > str_app[get_curr_str(ch)].wield )
     {
  send_to_char( "It is too heavy for you to wield.\n\r", ch );
  return;
     }

            if ( !oprog_use_trigger( ch, obj, NULL, NULL, NULL ) )
            {
  act( AT_ACTION, "$n wields $p.", ch, obj, NULL, TO_ROOM );
  act( AT_ACTION, "You wield $p.", ch, obj, NULL, TO_CHAR );
            }
     if ( 1 << bit == ITEM_MISSILE_WIELD )
  equip_char( ch, obj, WEAR_MISSILE_WIELD );
     else
  equip_char( ch, obj, WEAR_WIELD );
     oprog_wear_trigger( ch, obj );
     return;


       
Post is unread #15 Nov 14, 2004, 11:08 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Alright. I went back again and very carefully examined the fix, and figured out what was missing. It has now been corrected to reflect accurately what code to remove, what code to replace it with, and now also accounts for shields which got missed before. FUSS package now has the proper fix, and it's been tested and is working for every combination I can think of. If this is not the case, lets get this worked out right away so it doesn't have a chance to fester.
       
Post is unread #16 Nov 14, 2004, 5:03 pm   Last edited Nov 14, 2004, 6:26 pm by gatewaysysop
Go to the top of the page
Go to the bottom of the page

GatewaySysop
Conjurer
GroupMembers
Posts367
JoinedMar 7, 2005

There's another problem here, I believe. See this capture that I just made:


You are using:
<worn on finger> (Humming) Draupnir
<worn on body> a corselet of mail
<worn on head> an extravagantly jeweled crown
<worn on hands> Jarn Grieper
<worn about waist> (Humming) The Cosmic Belt
<wielded> (Glowing) Mjolnir

<1266hp 813m 750mv>
hold staff
You hold a shimmering, magical staff in your hands.

<1266hp 813m 750mv>
wear shield
You use a shield with the Darkhaven Academy crest as a shield.



That shouldn't be, correct? One shouldn't be able to equip a shield if you've already got a held weapon and a main weapon in hand. It seems to check properly for anything dual wielded or a regular and a missile weapon, but not for this case.

Methinks I've found the problem though:

I found this in act_obj.c:


case ITEM_WEAR_SHIELD:
     
if ( get_eq_char(ch, WEAR_DUAL_WIELD) 
||  ( get_eq_char(ch, WEAR_WIELD) && get_eq_char(ch, WEAR_MISSILE_WIELD) )
)    



How about changing it to this:


case ITEM_WEAR_SHIELD:
     
if ( get_eq_char(ch, WEAR_DUAL_WIELD) 
||  ( get_eq_char(ch, WEAR_WIELD) && get_eq_char(ch, WEAR_MISSILE_WIELD) )
||  ( get_eq_char(ch, WEAR_WIELD) && get_eq_char(ch, WEAR_HOLD) ) 
)    



Would that not fix this particular problem?
       
Pages:<< prev 1 next >>