Re: [BUG] Percentage loading

From: Mark Garringer (zizazat@HOTMAIL.COM)
Date: 05/26/03

On Tue, 16 Oct 2001 14:46:31 -0400, Del <> wrote:

>Jonathan Syu wrote:
>> strange, I went and downloaded Del's bundle to check it up, and it
>> seem to work on there either. I checked the zone file, and what happened
>> is that the chance is even saved, but when in zedit, it doesn't display
>> correctly and doesn't load correctly either. Is it suppose to be this
>> (**probably missing something quite obvious**).
>Check the loading of the zone information. I might have missed it in the
>bundle, but make sure it is assigning the right variable to the percent
>If it saves it but does not load it, thats where I would look.

Someone reported this exact problem to me, and I came to the same
conclusion. I've looked around the archives, but this was the most recent
post I could find, and there was never a fix posted.

I am still at a loss after some debugging, but I've got some more details
to add if anyone knows the answer or can help me find it...

It seems to happen only to G type zone commands.
They are saving to disk correctly.
They appear to be loading from disk correctly in load_zones, when I print a
debug of ZCMD.arg4.
They appear to NOT be correct in reset_zone, when I print a debug of
ZCMD.arg4 it's always 0. But only for G type commands? I did a debug of an
M command by way of comparison, and it was correct in both places.

I think I'm missing something simple, but I just don't see it.

From load_zones:
    } else {
      if ((arg_num = sscanf(ptr, " %d %d %d %d %d ", &tmp, &ZCMD.arg1,
&ZCMD.arg2, &ZCMD.arg3, &ZCMD.arg4)) != 5) {
        if (arg_num != 4)
          error = 1;

From reset_zone:
    case 'G':                   /* obj_to_char */
      if (!mob) {
        ZONE_ERROR("attempt to give obj to non-existant mob, command
        ZCMD.command = '*';
      if ((obj_index[ZCMD.arg1].number < ZCMD.arg2) &&
          mob_load && (rand_number(1, 100) >= ZCMD.arg4)) {
        obj = read_object(ZCMD.arg1, REAL);
        obj_to_char(obj, mob);
        tobj = obj;
        last_cmd = 1;
      } else
        last_cmd = 0;
      tmob = NULL;

Thoughts anyone?


   | FAQ: |
   | Archives: |
   | Newbie List:   |

This archive was generated by hypermail 2b30 : 06/26/03 PDT