How would i copy affects from one obj to another? the code i have segfaults on quit, save, and drop (afaik), my current code is
for(paf = gem->first_affect; paf; paf = next_aff)
{
CREATE(paf2, AFFECT_DATA, 1);
paf2->type = paf->type;
paf2->duration = paf->duration;
paf2->location = paf->location;
paf2->modifier = paf->modifier;
xCLEAR_BITS(paf2->bitvector);
paf2->next = NULL;
LINK(paf, weapon->first_affect, weapon->last_affect, next, prev);
next_aff = paf->next;
}
(it is imbue code, take effects from a gem at a ceratin wear location adn put them on a weapon, extract the gem and make the weapon like: A/An (x) imbued (x) using myobj so its not like A ruby imbued a finely honed sword) any help is appreciated, thanks |