Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 parse description bug
Yesterday, 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, Bing, DotBot, Google, Sogou

Members: 0
Guests: 2
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 » SWFOTE FUSS » Code Issues
Forum Rules | Mark all | Recent Posts

Code Issues
< Newer Topic :: Older Topic >

Pages:<< prev 1, 2 next >>
Post is unread #21 Mar 16, 2010, 10:16 am
Go to the top of the page
Go to the bottom of the page

MagisterXero
Fledgling
GroupMembers
Posts44
JoinedFeb 11, 2010

Speaking of loops...

I am in the midst of adding in an item "grade" system to my mud, and I've got it mostly working.
The problem that I'm running into currently, is that when I try to add my "new" fields to the obj_index_data
for "create_object(" whenever that command is called upon to create an object, it apparently decides that
it wants to create the object 92-97 times. I don't know how, logically, adding 4 simple lines of code would
cause a working function to loop through itself 92-97 times when the lines of code added aren't loops.


Any ideas from anyone?
       
Post is unread #22 Mar 16, 2010, 1:00 pm
Go to the top of the page
Go to the bottom of the page

MagisterXero
Fledgling
GroupMembers
Posts44
JoinedFeb 11, 2010

Also, it would seem that non-prototype items are also not saving the new fields on hotboots. I'm looking through hotboot.c to fix this one, but if anyone has a bit of direction to point me to that'd be great. :)
       
Post is unread #23 Mar 16, 2010, 1:56 pm
Go to the top of the page
Go to the bottom of the page

Keberus
Conjurer
GroupFUSS Project Team
Posts341
JoinedJun 4, 2005

I think that all calls to saving objects are done through fwrite_obj, so you might wanna check there to make sure your values are saved. Also you will need to add them in fread_obj to make the new values properly read in. As far as the looping thing, I think we would have to see your create_object function, and are you calling the function through oinvoke?

Later,
KeB
       
Post is unread #24 Mar 16, 2010, 3:31 pm   Last edited Mar 16, 2010, 3:32 pm by MagisterXero
Go to the top of the page
Go to the bottom of the page

MagisterXero
Fledgling
GroupMembers
Posts44
JoinedFeb 11, 2010

It's being called through oinvoke or through mpoload, both call the function and both make it create mass items.

Here's the code,

OBJ_DATA *create_object( OBJ_INDEX_DATA * pObjIndex, int level )
{
   OBJ_DATA *obj;

   if( !pObjIndex )
   {
      bug( "Create_object: NULL pObjIndex." );
      exit( 1 );
   }

   CREATE( obj, OBJ_DATA, 1 );

   obj->pIndexData = pObjIndex;
   obj->in_room = NULL;
   obj->level = level;
   obj->wear_loc = -1;
   obj->count = 1;
   cur_obj_serial = UMAX( ( cur_obj_serial + 1 ) & ( BV30 - 1 ), 1 );
   obj->serial = obj->pIndexData->serial = cur_obj_serial;

   obj->armed_by = STRALLOC( "" );
   obj->name = QUICKLINK( pObjIndex->name );
   obj->short_descr = QUICKLINK( pObjIndex->short_descr );
   obj->description = QUICKLINK( pObjIndex->description );
   obj->action_desc = QUICKLINK( pObjIndex->action_desc );
   obj->item_type = pObjIndex->item_type;
   obj->extra_flags = pObjIndex->extra_flags;
   obj->wear_flags = pObjIndex->wear_flags;
   obj->value[0] = pObjIndex->value[0];
   obj->value[1] = pObjIndex->value[1];
   obj->value[2] = pObjIndex->value[2];
   obj->value[3] = pObjIndex->value[3];
   obj->value[4] = pObjIndex->value[4];
   obj->value[5] = pObjIndex->value[5];
//   obj->value[6] = pObjIndex->value[6];
//   obj->value[7] = pObjIndex->value[7];
//   obj->value[8] = pObjIndex->value[8];
   obj->weight = pObjIndex->weight;
   obj->cost = pObjIndex->cost;
   /*
    * obj->cost     = number_fuzzy( 10 )
    * * number_fuzzy( level ) * number_fuzzy( level );
    */

   /*
    * Mess with object properties.
    */
   switch ( obj->item_type )
   {
      default:
         bug( "Read_object: vnum %d bad type.", pObjIndex->vnum );
         bug( "------------------------>     ", obj->item_type );
         break;

      case ITEM_GOVERNMENT:
      case ITEM_SPACECRAFT:
      case ITEM_RAWSPICE:
      case ITEM_LENS:
      case ITEM_CRYSTAL:
      case ITEM_DURAPLAST:
      case ITEM_DURASTEEL:
      case ITEM_SUPERCONDUCTOR:
      case ITEM_COMLINK:
      case ITEM_MEDPAC:
      case ITEM_FABRIC:
      case ITEM_RARE_METAL:
      case ITEM_MAGNET:
      case ITEM_THREAD:
      case ITEM_CHEMICAL:
      case ITEM_SPICE:
      case ITEM_SMUT:
      case ITEM_OVEN:
      case ITEM_MIRROR:
      case ITEM_CIRCUIT:
      case ITEM_TOOLKIT:
      case ITEM_LIGHT:
      case ITEM_TREASURE:
      case ITEM_FURNITURE:
      case ITEM_TRASH:
      case ITEM_CONTAINER:
      case ITEM_DRINK_CON:
      case ITEM_KEY:
      case ITEM_BINDERS:
      case ITEM_GOGGLES:
         break;
      case ITEM_FOOD:
         /*
          * optional food condition (rotting food)    -Thoric
          * value1 is the max condition of the food
          * value4 is the optional initial condition
          */
         if( obj->value[4] )
            obj->timer = obj->value[4];
         else
            obj->timer = obj->value[1];
         break;

      case ITEM_DROID_CORPSE:
      case ITEM_CORPSE_NPC:
      case ITEM_CORPSE_PC:
      case ITEM_FOUNTAIN:
      case ITEM_SCRAPS:
      case ITEM_GRENADE:
      case ITEM_EMP_GRENADE:
      case ITEM_SHIPBOMB:
      case ITEM_LANDMINE:
      case ITEM_FIRE:
      case ITEM_BOOK:
      case ITEM_SWITCH:
      case ITEM_LEVER:
      case ITEM_BUTTON:
      case ITEM_DIAL:
      case ITEM_TRAP:
      case ITEM_MAP:
      case ITEM_PAPER:
      case ITEM_PEN:
      case ITEM_LOCKPICK:
      case ITEM_FUEL:
      case ITEM_MISSILE:
      case ITEM_COMMSYSTEM:
      case ITEM_MODULE:
      case ITEM_DATAPAD:
      case ITEM_BEACON:
      case ITEM_BUG:
      case ITEM_RLAUNCHER:
      case ITEM_GLAUNCHER:
      case ITEM_SHOVEL:
         break;

      case ITEM_SALVE:
         obj->value[3] = number_fuzzy( obj->value[3] );
         break;

      case ITEM_DEVICE:
         obj->value[0] = number_fuzzy( obj->value[0] );
         obj->value[1] = number_fuzzy( obj->value[1] );
         obj->value[2] = obj->value[1];
         break;

      case ITEM_BATTERY:
         if( obj->value[0] <= 0 )
            obj->value[0] = number_fuzzy( 95 );
         break;


      case ITEM_BOLT:
         if( obj->value[0] <= 0 )
            obj->value[0] = number_fuzzy( 95 );
         break;

      case ITEM_AMMO:
         if( obj->value[0] <= 0 )
            obj->value[0] = number_fuzzy( 495 );
         break;

      case ITEM_WEAPON:
/*
        if ( obj->value[1] && obj->value[2] )
           obj->value[2] *= obj->value[1];
        else
        {
           obj->value[1] = number_fuzzy( number_fuzzy( 1 + level/20 ) );
           obj->value[2] = number_fuzzy( number_fuzzy( 10 + level/10 ) );
        }
*/
         if( obj->value[1] > obj->value[2] )
            obj->value[1] = obj->value[2] / 3;
         if( obj->value[0] == 0 )
            obj->value[0] = INIT_WEAPON_CONDITION;
         switch ( obj->value[3] )
         {
            case WEAPON_BLASTER:
            case WEAPON_LIGHTSABER:
            case WEAPON_DUAL_LIGHTSABER:
            case WEAPON_VIBRO_BLADE:
            case WEAPON_FORCE_PIKE:
            case WEAPON_BOWCASTER:
               if( obj->value[5] <= 0 )
                  obj->value[5] = number_fuzzy( 1000 );
         }
         obj->value[7] = obj->pIndexData->value[7]; /* Values Added */
         obj->value[8] = obj->pIndexData->value[8]; /* Values Added */
         obj->itemgrade = obj->pIndexData->itemgrade; /* Values Added */
         obj->itemsubgrade = obj->pIndexData->itemsubgrade; /* Values Added */
         break;

      case ITEM_ARMOR:
         if( obj->value[0] == 0 )
            obj->value[0] = obj->value[1];
         obj->timer = obj->value[3];
         obj->value[6] = obj->pIndexData->value[6];  /* Values Added */
         obj->value[7] = obj->pIndexData->value[7]; /* Values Added */
         obj->itemgrade = obj->pIndexData->itemgrade; /* Values Added */
         obj->itemsubgrade = obj->pIndexData->itemsubgrade; /* Values Added */
         break;

      case ITEM_POTION:
      case ITEM_PILL:
         obj->value[0] = number_fuzzy( number_fuzzy( obj->value[0] ) );
         break;

      case ITEM_MONEY:
         obj->value[0] = obj->cost;
         break;
   }

   LINK( obj, first_object, last_object, next, prev );
   ++pObjIndex->count;
   ++numobjsloaded;
   ++physicalobjects;

   return obj;
}
       
Post is unread #25 Mar 16, 2010, 7:15 pm
Go to the top of the page
Go to the bottom of the page

Keberus
Conjurer
GroupFUSS Project Team
Posts341
JoinedJun 4, 2005

I am not seeing anything off hand that should cause this. Perhaps it's trying to set corrupted data, so the object becomes corrupted? Maybe check to make sure the object is saved/loaded correctly in the area file before trying to load one in the game, I guess just try to follow the code if that's the case.

Sorry I couldn't be of more assistance,
KeB
       
Post is unread #26 Mar 16, 2010, 7:34 pm
Go to the top of the page
Go to the bottom of the page

MagisterXero
Fledgling
GroupMembers
Posts44
JoinedFeb 11, 2010

Seems to only be doing it for weapons...
       
Post is unread #27 Mar 16, 2010, 7:52 pm
Go to the top of the page
Go to the bottom of the page

MagisterXero
Fledgling
GroupMembers
Posts44
JoinedFeb 11, 2010

Found the problem, corrupted data was it, value[8] didn't technically exist, but it also didn't throw an error. Hard on to spot..
       
Post is unread #28 Mar 18, 2010, 4:07 pm
Go to the top of the page
Go to the bottom of the page

Keberus
Conjurer
GroupFUSS Project Team
Posts341
JoinedJun 4, 2005

Glad to hear you figured out the problem. Yes, there are no bounds checking for arrays in C.

Later,
KeB
       
Post is unread #29 Apr 5, 2010, 1:31 pm
Go to the top of the page
Go to the bottom of the page

MagisterXero
Fledgling
GroupMembers
Posts44
JoinedFeb 11, 2010

Here's an issue I've had rants about in my head for the past 2 months almost.

Say I create a mprog on an item or a mob, or a room. Whenever I save a zone, hotboot, load the zone and said room/obj/mob, the program for some reason isn't "loaded", thus forcing me to edit the program, re-save it, and then attempt to activate the program once more. What's causing this and how do I fix it? I'm asking here, mainly because I assume anyone else who used a stock swfote codebase would've had the same issue.

I wanted to get this fixed a while back, but seeing as to how my mud is still in dev anyway, it wasn't a high priority, but not it's just really annoying me so I figured I'd fix it.
       
Pages:<< prev 1, 2 next >>