Hello all, i have a small question.. I found a bug in a OBJ_DATA function i
wrote for my item generator. It seems, whenever this function is called,
it causes a loop. (sometimes later though.. its very odd, inside the shop
generator, the mud loops on startup, but no errors, when i use a function
that calls on it, it works.. but anytime i try to save_char it loops,
copyover/save/quit) and im wondering.. What logic error am i missing?
(while writing this.. i thought about something and re-wrote the function
and it ended up working flawlessly.. though still... what mistake did
i do here?)
The function is below
As always, help is much appreciated =)
-Thri
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;
af->location = APPLY_HITROLL;
af->next = obj->affected;
obj->affected = af;
obj->cost += 15000;
return (obj);
}