paf->level = (paf->level + paf_old->level) / 2;
paf->level = (paf->level += paf_old->level) / 2;
paf->level = …
paf->level += paf_old->level
paf->level = (paf->level += paf_old->level) / 2;
paf->level = …
paf->level += paf_old->level
paf->level = (paf->level += paf_old->level) / 2;
paf->level = …
paf->level += paf_old->level
handler.c:1267:17: warning: operation on ‘paf->level’ may be undefined [-Wsequence-point]
paf->level = (paf->level += paf_old->level) / 2;
This is the Code:
void affect_join( CHAR_DATA *ch, AFFECT_DATA *paf )
{
AFFECT_DATA *paf_old;
bool found;
found = FALSE;
for ( paf_old = ch->affected; paf_old != NULL; paf_old = paf_old->next )
{
if ( paf_old->type == paf->type )
{
paf->level = (paf->level += paf_old->level) / 2; <— This is the Error
paf->duration += paf_old->duration;
paf->modifier += paf_old->modifier;
affect_remove( ch, paf_old );
break;
}
}
affect_to_char( ch, paf );
return;
}
Also the new messge board, I can't find where you can search for topics, any help there would be helpful as well.