Use the right packet for when a player falls out of the world

SUDDEN_DEAD is more appropriate than goo damage for this.
Also made it so other players can see when someone does a /health 0, for
comedic effect.
This commit is contained in:
2021-03-09 21:23:57 +01:00
parent f5a34b9a3d
commit 89eb0b140b
2 changed files with 21 additions and 4 deletions

View File

@@ -1002,8 +1002,16 @@ void MobManager::playerTick(CNServer *serv, time_t currTime) {
}
// check if the player has fallen out of the world
if (plr->z < -30000)
dealGooDamage(sock, PC_MAXHEALTH(36) * 2);
if (plr->z < -30000) {
INITSTRUCT(sP_FE2CL_PC_SUDDEN_DEAD, dead);
dead.iPC_ID = plr->iID;
dead.iDamage = plr->HP;
dead.iHP = plr->HP = 0;
sock->sendPacket((void*)&dead, P_FE2CL_PC_SUDDEN_DEAD, sizeof(sP_FE2CL_PC_SUDDEN_DEAD));
PlayerManager::sendToViewable(sock, (void*)&dead, P_FE2CL_PC_SUDDEN_DEAD, sizeof(sP_FE2CL_PC_SUDDEN_DEAD));
}
if (transmit) {
INITSTRUCT(sP_FE2CL_REP_PC_TICK, pkt);