mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-04 22:40:05 +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)
|
||||
@ -303,9 +306,9 @@ void NanoManager::summonNano(CNSocket *sock, int slot) {
|
||||
if (SkillTable[skillID].drainType == 2) {
|
||||
int *targetData = findTargets(plr, skillID);
|
||||
|
||||
for (auto& pwr : NanoPowers)
|
||||
if (pwr.skillType == SkillTable[skillID].skillType)
|
||||
nanoUnbuff(sock, targetData, pwr.bitFlag, pwr.timeBuffID, 0,(SkillTable[skillID].targetType == 3));
|
||||
for (auto& pwr : NanoPowers)
|
||||
if (pwr.skillType == SkillTable[skillID].skillType)
|
||||
nanoUnbuff(sock, targetData, pwr.bitFlag, pwr.timeBuffID, 0,(SkillTable[skillID].targetType == 3));
|
||||
}
|
||||
|
||||
int16_t nanoID = slot == -1 ? 0 : plr->equippedNanos[slot];
|
||||
@ -321,9 +324,9 @@ void NanoManager::summonNano(CNSocket *sock, int slot) {
|
||||
if (SkillTable[skillID].drainType == 2) {
|
||||
int *targetData = findTargets(plr, skillID);
|
||||
|
||||
int boost = 0;
|
||||
if (getNanoBoost(plr))
|
||||
boost = 1;
|
||||
int boost = 0;
|
||||
if (getNanoBoost(plr))
|
||||
boost = 1;
|
||||
|
||||
for (auto& pwr : NanoPowers) {
|
||||
if (pwr.skillType == SkillTable[skillID].skillType) {
|
||||
@ -904,4 +907,4 @@ std::vector<NanoPower> NanoPowers = {
|
||||
};
|
||||
|
||||
}; // namespace
|
||||
#pragma endregion
|
||||
#pragma endregion
|
||||
|
Loading…
Reference in New Issue
Block a user