diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-01-23 16:24:39 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-01-23 16:24:39 +0000 |
commit | 4e7be9f904f70e4a2e3d598602d03cddeaef8a74 (patch) | |
tree | 07d89ce6694ddff306093d9e2291c46dadbdb1ca /src/gui/status.cpp | |
parent | e0a956b4045ca09631d9a9a616ca675f2c1f4a78 (diff) | |
download | mana-client-4e7be9f904f70e4a2e3d598602d03cddeaef8a74.tar.gz mana-client-4e7be9f904f70e4a2e3d598602d03cddeaef8a74.tar.bz2 mana-client-4e7be9f904f70e4a2e3d598602d03cddeaef8a74.tar.xz mana-client-4e7be9f904f70e4a2e3d598602d03cddeaef8a74.zip |
Uninitialized variable and free/delete/delete[] mismatch fixes.
Diffstat (limited to 'src/gui/status.cpp')
-rw-r--r-- | src/gui/status.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gui/status.cpp b/src/gui/status.cpp index 8465082f..70dbf083 100644 --- a/src/gui/status.cpp +++ b/src/gui/status.cpp @@ -99,21 +99,23 @@ void StatusWindow::update() spValue->setCaption(tempstr); spValue->adjustSize(); - sprintf(tempstr, "Exp: %d / %d", (int)char_info->xp, (int)char_info->xpForNextLevel); + sprintf(tempstr, "Exp: %d / %d", + (int)char_info->xp, (int)char_info->xpForNextLevel); expLabel->setCaption(tempstr); expLabel->adjustSize(); - sprintf(tempstr, "Job Exp: %d / %d", (int)char_info->job_xp, (int)char_info->jobXpForNextLevel); + sprintf(tempstr, "Job Exp: %d / %d", + (int)char_info->job_xp, (int)char_info->jobXpForNextLevel); jobExpLabel->setCaption(tempstr); jobExpLabel->adjustSize(); - if ( char_info->hp < int(char_info->max_hp / 3) ) + if (char_info->hp < int(char_info->max_hp / 3)) { healthBar->setColor(255, 0, 0); // Red } else { - if ( char_info->hp < int( (char_info->max_hp / 3)*2 ) ) + if (char_info->hp < int((char_info->max_hp / 3) * 2)) { healthBar->setColor(255, 181, 9); // orange } @@ -127,7 +129,8 @@ void StatusWindow::update() healthBar->setProgress((float)char_info->hp / (float)char_info->max_hp); xpBar->setProgress((float)char_info->xp / (float)char_info->xpForNextLevel); - jobXpBar->setProgress((float)char_info->job_xp / (float)char_info->jobXpForNextLevel); + jobXpBar->setProgress( + (float)char_info->job_xp / (float)char_info->jobXpForNextLevel); - delete tempstr; + delete[] tempstr; } |