/// <summary>
 /// Called when a player leaves the game
 /// </summary>
 /// <param name="e">The event which was raised</param>
 /// <param name="sender">Sender of the event</param>
 /// <param name="args">EventArgs associated with the event</param>
 private static void PlayerLeftWorld(DOLEvent e, object sender, EventArgs args)
 {
     if (sender is GamePlayer player && player.ControlledBrain?.Body != null)
     {
         GameNPC          pet        = player.ControlledBrain.Body;
         SearingPetEffect searingPet = pet.EffectList.GetOfType <SearingPetEffect>();
         searingPet?.Cancel(false);
     }
 }
Exemple #2
0
        /// <summary>
        /// Called when a player leaves the game
        /// </summary>
        /// <param name="e">The event which was raised</param>
        /// <param name="sender">Sender of the event</param>
        /// <param name="args">EventArgs associated with the event</param>
        private static void PlayerLeftWorld(DOLEvent e, object sender, EventArgs args)
        {
            GamePlayer player = sender as GamePlayer;

            if (player != null && player.ControlledBrain != null && player.ControlledBrain.Body != null)
            {
                GameNPC          pet        = player.ControlledBrain.Body as GameNPC;
                SearingPetEffect SearingPet = pet.EffectList.GetOfType <SearingPetEffect>();
                if (SearingPet != null)
                {
                    SearingPet.Cancel(false);
                }
            }
        }