mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 13:30:06 +00:00
Fix nanos making sound when they run out of stamina
This commit is contained in:
parent
c2ab5c9d02
commit
7851866d13
@ -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;
|
||||
|
@ -142,8 +142,11 @@ void NanoManager::nanoSkillUseHandler(CNSocket* sock, CNPacketData* data) {
|
||||
boost = 1;
|
||||
|
||||
plr->Nanos[plr->activeNano].iStamina -= SkillTable[skillID].batteryUse[boost*3];
|
||||
if (plr->Nanos[plr->activeNano].iStamina < 0)
|
||||
if (plr->Nanos[plr->activeNano].iStamina < 0) {
|
||||
plr->Nanos[plr->activeNano].iStamina = 0;
|
||||
plr->activeNano = 0;
|
||||
plr->nanoDrainRate = 0;
|
||||
}
|
||||
|
||||
for (auto& pwr : NanoPowers)
|
||||
if (pwr.skillType == SkillTable[skillID].skillType)
|
||||
|
Loading…
Reference in New Issue
Block a user