Fix nanos making sound when they run out of stamina

This commit is contained in:
Gent S
2020-11-26 22:01:49 -05:00
parent c2ab5c9d02
commit 7851866d13
2 changed files with 23 additions and 9 deletions

View File

@@ -951,8 +951,19 @@ void MobManager::playerTick(CNServer *serv, time_t currTime) {
plr->Nanos[plr->activeNano].iStamina -= 1 + plr->nanoDrainRate * 2 / 5;
if (plr->Nanos[plr->activeNano].iStamina <= 0) {
// passive nano unbuffing
int skillID = plr->Nanos[plr->activeNano].iSkillID;
if (NanoManager::SkillTable[skillID].drainType == 2) {
int* targetData = NanoManager::findTargets(plr, skillID);
for (auto& pwr : NanoManager::NanoPowers)
if (pwr.skillType == NanoManager::SkillTable[skillID].skillType)
NanoManager::nanoUnbuff(sock, targetData, pwr.bitFlag, pwr.timeBuffID, 0, (NanoManager::SkillTable[skillID].targetType == 3));
}
plr->Nanos[plr->activeNano].iStamina = 0;
NanoManager::summonNano(PlayerManager::getSockFromID(plr->iID), -1);
plr->activeNano = 0;
plr->nanoDrainRate = 0;
}
transmit = true;