[wpdev-commits] wolfpack player.cpp,1.131,1.132
Brought to you by:
rip,
thiagocorrea
From: Sebastian H. <dar...@us...> - 2004-09-19 23:41:26
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6752 Modified Files: player.cpp Log Message: Fixed a stamina regeneration bug Index: player.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v retrieving revision 1.131 retrieving revision 1.132 diff -C2 -d -r1.131 -r1.132 *** player.cpp 17 Sep 2004 16:33:59 -0000 1.131 --- player.cpp 19 Sep 2004 23:41:17 -0000 1.132 *************** *** 1767,1770 **** --- 1767,1774 ---- unsigned int cPlayer::damage( eDamageType type, unsigned int amount, cUObject* source ) { + // Save the hitpoints for further calculation + unsigned int hitpoints = hitpoints_; + unsigned int stamina = stamina_; + amount = cBaseChar::damage(type, amount, source); *************** *** 1772,1776 **** // the more stamina we have, the more we loose // the more hitpoints we have, the less we loose ! int value = (int)(amount * (100.0 / hitpoints_) * (stamina_ / 100.0)) - 5; if (value > 0) { stamina_ = QMAX(0, stamina_ - value); --- 1776,1780 ---- // the more stamina we have, the more we loose // the more hitpoints we have, the less we loose ! int value = (int)(amount * (100.0 / hitpoints) * (stamina / 100.0)) - 5; if (value > 0) { stamina_ = QMAX(0, stamina_ - value); |