void cPlayer::Respawn(void) { ASSERT(m_World != NULL); m_Health = GetMaxHealth(); SetInvulnerableTicks(20); // Reset food level: m_FoodLevel = MAX_FOOD_LEVEL; m_FoodSaturationLevel = 5; // Reset Experience m_CurrentXp = 0; m_LifetimeTotalXp = 0; // ToDo: send score to client? How? m_ClientHandle->SendRespawn(*m_World); // Extinguish the fire: StopBurning(); TeleportToCoords(GetWorld()->GetSpawnX(), GetWorld()->GetSpawnY(), GetWorld()->GetSpawnZ()); SetVisible(true); }
void cPlayer::Respawn(void) { m_Health = GetMaxHealth(); // Reset food level: m_FoodLevel = MAX_FOOD_LEVEL; m_FoodSaturationLevel = 5; m_ClientHandle->SendRespawn(); // Extinguish the fire: StopBurning(); TeleportToCoords(GetWorld()->GetSpawnX(), GetWorld()->GetSpawnY(), GetWorld()->GetSpawnZ()); SetVisible(true); }