mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-17 03:20:06 +00:00
Break if player dies from buff combat tick
This commit is contained in:
parent
36b6aeeb00
commit
b04c292272
@ -169,6 +169,8 @@ void Player::step(time_t currTime) {
|
|||||||
// buffs
|
// buffs
|
||||||
for(auto buffEntry : buffs) {
|
for(auto buffEntry : buffs) {
|
||||||
buffEntry.second->combatTick(currTime);
|
buffEntry.second->combatTick(currTime);
|
||||||
|
if(!isAlive())
|
||||||
|
break; // unsafe to keep ticking if we're dead
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
@ -957,6 +959,7 @@ static void playerTick(CNServer *serv, time_t currTime) {
|
|||||||
auto it = plr->buffs.begin();
|
auto it = plr->buffs.begin();
|
||||||
while(it != plr->buffs.end()) {
|
while(it != plr->buffs.end()) {
|
||||||
Buff* buff = (*it).second;
|
Buff* buff = (*it).second;
|
||||||
|
//buff->combatTick() gets called in Player::step
|
||||||
buff->tick(currTime);
|
buff->tick(currTime);
|
||||||
if(buff->isStale()) {
|
if(buff->isStale()) {
|
||||||
// garbage collect
|
// garbage collect
|
||||||
|
Loading…
Reference in New Issue
Block a user