--- Cyhawk <[EMAIL PROTECTED]> wrote:

> OBJ_DATA * weapon_plus_five (OBJ_DATA * obj)
> {
>       AFFECT_DATA *af = new_affect ();
>       char prefix_full[MSL];
> 
> 
>       sprintf (prefix_full, "(+5) %s", obj->short_descr);
>       obj->short_descr = str_dup (prefix_full);
> 
>       af->location = APPLY_HITROLL;
>       af->modifier = 5;
>       af->where = TO_OBJECT;
>       af->type = 10;
>       af->duration = -1;
>       af->bitvector = 0;
>       af->level = 1;
>       af->next = obj->affected;
>       obj->affected = af;
> 
/* Begin errors */
>       af->location = APPLY_HITROLL;
>       af->next = obj->affected;
>       obj->affected = af;

Why are you doin this for a second time?? You've just messed up your linked
list This affect's next member is now pointed back to itself, and any attempts
to loop over the objects affects will cause an infinite loop.


~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! Search - Find what you’re looking for faster
http://search.yahoo.com

Reply via email to