I can't help but notice that you're comparing with char_level
for your first couple if-statement, but you're comparing to level
for your subsequent if-statements
if ((char_level > 0) && (char_level < 4))
{
char_hp = 100;
}
if ((level > 4) && (level < 6))
{
char_hp = 120;
}
I think you might have intended to use char_level
for all of the conditions.
if ((char_level > 0) && (char_level < 4))
{
char_hp = 100;
}
if ((char_level > 4) && (char_level< 6))
{
char_hp = 120;
}
If that's the issue, it would be consistent with the kinds of errors you're seeing.