mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 21:40:05 +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) {
|
void MobManager::playerTick(CNServer *serv, time_t currTime) {
|
||||||
static time_t lastHealTime = 0;
|
|
||||||
for (auto& pair : PlayerManager::players) {
|
for (auto& pair : PlayerManager::players) {
|
||||||
CNSocket *sock = pair.first;
|
CNSocket *sock = pair.first;
|
||||||
Player *plr = pair.second.plr;
|
Player *plr = pair.second.plr;
|
||||||
@ -517,9 +516,10 @@ void MobManager::playerTick(CNServer *serv, time_t currTime) {
|
|||||||
dealGooDamage(sock, 150);
|
dealGooDamage(sock, 150);
|
||||||
|
|
||||||
// a somewhat hacky way tick goo damage faster than heal, but eh
|
// a somewhat hacky way tick goo damage faster than heal, but eh
|
||||||
if (currTime - lastHealTime < 4000)
|
if (currTime - plr->lastHealTime < 4000)
|
||||||
continue;
|
continue;
|
||||||
lastHealTime = currTime;
|
|
||||||
|
plr->lastHealTime = currTime;
|
||||||
|
|
||||||
// heal
|
// heal
|
||||||
if (!plr->inCombat && plr->HP < PC_MAXHEALTH(plr->level)) {
|
if (!plr->inCombat && plr->HP < PC_MAXHEALTH(plr->level)) {
|
||||||
|
@ -46,6 +46,7 @@ struct Player {
|
|||||||
|
|
||||||
bool inCombat;
|
bool inCombat;
|
||||||
bool dotDamage;
|
bool dotDamage;
|
||||||
|
time_t lastHealTime;
|
||||||
|
|
||||||
int64_t aQuestFlag[16];
|
int64_t aQuestFlag[16];
|
||||||
int tasks[ACTIVE_MISSION_COUNT];
|
int tasks[ACTIVE_MISSION_COUNT];
|
||||||
|
Loading…
Reference in New Issue
Block a user