mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 13:30:06 +00:00
fixed player health regen
This commit is contained in:
parent
062302a7aa
commit
f8f2088e38
@ -506,7 +506,6 @@ void MobManager::dealGooDamage(CNSocket *sock, int amount) {
|
||||
}
|
||||
|
||||
void MobManager::playerTick(CNServer *serv, time_t currTime) {
|
||||
static time_t lastHealTime = 0;
|
||||
for (auto& pair : PlayerManager::players) {
|
||||
CNSocket *sock = pair.first;
|
||||
Player *plr = pair.second.plr;
|
||||
@ -517,9 +516,10 @@ void MobManager::playerTick(CNServer *serv, time_t currTime) {
|
||||
dealGooDamage(sock, 150);
|
||||
|
||||
// a somewhat hacky way tick goo damage faster than heal, but eh
|
||||
if (currTime - lastHealTime < 4000)
|
||||
if (currTime - plr->lastHealTime < 4000)
|
||||
continue;
|
||||
lastHealTime = currTime;
|
||||
|
||||
plr->lastHealTime = currTime;
|
||||
|
||||
// heal
|
||||
if (!plr->inCombat && plr->HP < PC_MAXHEALTH(plr->level)) {
|
||||
|
@ -46,6 +46,7 @@ struct Player {
|
||||
|
||||
bool inCombat;
|
||||
bool dotDamage;
|
||||
time_t lastHealTime;
|
||||
|
||||
int64_t aQuestFlag[16];
|
||||
int tasks[ACTIVE_MISSION_COUNT];
|
||||
|
Loading…
Reference in New Issue
Block a user