mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-05 06:50:04 +00:00
Fix client/server summoned nano discrepancy on revive
This commit is contained in:
parent
5068b38c5e
commit
0931cf1fbc
@ -713,10 +713,14 @@ void PlayerManager::revivePlayer(CNSocket* sock, CNPacketData* data) {
|
|||||||
INITSTRUCT(sP_FE2CL_PC_REGEN, resp2);
|
INITSTRUCT(sP_FE2CL_PC_REGEN, resp2);
|
||||||
|
|
||||||
// Nanos
|
// Nanos
|
||||||
|
int activeSlot = -1;
|
||||||
for (int n = 0; n < 3; n++) {
|
for (int n = 0; n < 3; n++) {
|
||||||
int nanoID = plr->equippedNanos[n];
|
int nanoID = plr->equippedNanos[n];
|
||||||
plr->Nanos[nanoID].iStamina = 75; // max is 150, so 75 is half
|
plr->Nanos[nanoID].iStamina = 75; // max is 150, so 75 is half
|
||||||
response.PCRegenData.Nanos[n] = plr->Nanos[nanoID];
|
response.PCRegenData.Nanos[n] = plr->Nanos[nanoID];
|
||||||
|
if (plr->activeNano == nanoID) {
|
||||||
|
activeSlot = n;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update player
|
// Update player
|
||||||
@ -726,7 +730,7 @@ void PlayerManager::revivePlayer(CNSocket* sock, CNPacketData* data) {
|
|||||||
plr->HP = PC_MAXHEALTH(plr->level);
|
plr->HP = PC_MAXHEALTH(plr->level);
|
||||||
|
|
||||||
// Response parameters
|
// Response parameters
|
||||||
response.PCRegenData.iActiveNanoSlotNum = plr->activeNano;
|
response.PCRegenData.iActiveNanoSlotNum = activeSlot;
|
||||||
response.PCRegenData.iX = plr->x;
|
response.PCRegenData.iX = plr->x;
|
||||||
response.PCRegenData.iY = plr->y;
|
response.PCRegenData.iY = plr->y;
|
||||||
response.PCRegenData.iZ = plr->z;
|
response.PCRegenData.iZ = plr->z;
|
||||||
|
Loading…
Reference in New Issue
Block a user