Re: Object damage code...

From: George (greerga@DRAGON.HAM.MUOHIO.EDU)
Date: 08/23/97

On Sat, 23 Aug 1997, Zizazat Lazuras wrote:

>I added som enice object damage code, but the portion that deals with the
>examine does not work. (Code to follow). It is nearly identicaly to code
>added to the identify spell, and that part works just dandy. Someone,
>please, what am I overlooking?

> if (IS_NPC(tmp_char) || !IS_NPC(tmp_char))
>    return;

Oh yeah, that will work. :)

> if (GET_OBJ_TSLOTS(tmp_object) == 101) {
>        sprintf(buf, "This looks indestructable!\r\n");
>        send_to_char(buf, ch);
>    return;
>        }

if (GET_OBJ_TSLOTS(tmp_object) == 101)
  spriotf(buf, "This looks indestructable!\r\n");
else if (GET_OBJ_TSLOTS(tmp_object) <= 10)
  sprintf(buf, "This looks in extremely poor condition.\r\n");
else if (GET_OBJ_TSLOTS(tmp_object) <= 20)
  sprintf(buf, "This looks in poor condition.\r\n");


You can make a 'const char *mesg' and just do:
mesg = "This looks indestructible\r\n";


That'll save the time of copying the constant string into the variable.

-- | Genius may have its limitations, but stupidity | is not thus handicapped. -- Elbert Hubbard

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/08/00 PST