An odd problem

Posted by Metsuro on Sat 22 Jul 2006 08:35 PM — 6 posts, 23,188 views.

USA #0
      int chakra = (int)( ( get_curr_con(ch) + get_curr_int(ch))/2 * 100 );
      if( chakra < 100 )
       chakra = 100;
      if( ch->max_mana != chakra )
        ch_printf( ch, "You gained %d chakra.\r\n", ( chakra - ch->max_mana ) );
      ch->max_mana = chakra;

      int life = (int)( ( get_curr_str(ch) + get_curr_dex(ch))/2 * 100 );
      if( life < 100 );
        life = 100;
      if( ch->max_hit != life )
        ch_printf( ch, "You gained %d life.\r\n", ( life - ch->max_hit ) );
      ch->max_hit = life;


alright the code above doesn't exactly work. The first portion about chakra works, but life doesn't... why is that? anyone know?
USA #1
What's not working? The entire block of code?
USA #2
no its just the portion about life. Chakra changes and updates properly. However life doesn't, it just defaults to 100, and it should be at 2500, like the chakra.
USA #3
if( life < 100 );

remove the ; and you should be good.

-Tz
USA #4
oi, right I didn't even notice that... thanks lol.
USA #5
no prob :)