--- Matt Foltz <[EMAIL PROTECTED]> wrote:
The
> problem I'm getting is that if the object doesn't load
> with, say mana, on it then it won't combine the
> values. But if it DOES load with mana on it, then it
> will. Any suggestions would be appreciated.
[SNIP]
The difference between the data the object loads with
and the data an object has, is one is an obj_data
instance, and the other is an obj_index_data instance.
My guess is you are only doing stuff on the object_index_data.
>void do_modify(CHAR_DATA *ch, char *argument, int sn)
> {
> char arg1 [MAX_INPUT_LENGTH];
> char arg2 [MAX_INPUT_LENGTH];
> char arg3 [MAX_INPUT_LENGTH];
> AFFECT_DATA *paf;
> OBJ_DATA *obj;
> int enchant_value = 0, enchant_type;
>
[SNIPPED]
> for (paf = obj->pIndexData->affected; paf != NULL; paf = paf->next)
> {
> if ( paf->location == enchant_type )
> {
> paf->type = sn;
> paf->modifier += enchant_value;
> paf->level = ch->level;
> send_to_char("Ok.\n\r",ch );
> return;
> }
> else
> {
> AFFECT_DATA *af_new;
> af_new = new_affect();
>
> af_new->next = obj->affected;
> obj->affected = af_new;
>
> af_new->where = paf->where;
> af_new->type = UMAX(0,paf->type);
> af_new->level = paf->level;
> af_new->duration = paf->duration;
> af_new->location = enchant_type;
> af_new->modifier = enchant_value;
> af_new->bitvector = paf->bitvector;
> }
> }
Yeah, here you are only going through the loop of things that the objects
pIndexData has affecting it.. (the "standard" version of the object) You should
be looping through obj->affected instead of obj->pIndexData->affected.
~Kender
=====
-----BEGIN GEEK CODE BLOCK-----
Version 3.1
GCS/L/C/O d-(+) s++:+ a-- C+++$>++++ UBLS++++$
P+++(--)$ L++>+++ E--- W+>++$ N !o K? w(--) !O
M- !V PS+ PE(++) Y+ PGP->+ t- 5 X+() R(+) tv+@
b++(+++) !DI+++ D G(-) e>+++$ h---() r+++ y+++
------END GEEK CODE BLOCK------
__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com