Example #1
0
        protected virtual void ServerOnStaticObjectZeroStructurePoints(
            [CanBeNull] WeaponFinalCache weaponCache,
            [CanBeNull] ICharacter byCharacter,
            [NotNull] IWorldObject targetObject)
        {
            if (targetObject.IsDestroyed)
            {
                return;
            }

            Logger.Info($"Static object destroyed: {targetObject} by {byCharacter}");

            this.ServerSendObjectDestroyedEvent(targetObject);
            Server.World.DestroyObject(targetObject);

            if (weaponCache is null)
            {
                return;
            }

            var staticWorldObject = (IStaticWorldObject)targetObject;

            ServerStaticObjectDestroyObserver.NotifyObjectDestroyed(
                byCharacter,
                staticWorldObject);

            this.ServerOnStaticObjectDestroyedByCharacter(
                byCharacter,
                weaponCache,
                staticWorldObject);
        }
 protected virtual void ServerOnStaticObjectDestroyedByCharacter(
     [CanBeNull] ICharacter byCharacter,
     [CanBeNull] IProtoItemWeapon byWeaponProto,
     IStaticWorldObject targetObject)
 {
     if (byCharacter != null)
     {
         ServerStaticObjectDestroyObserver.NotifyObjectDestroyed(byCharacter, targetObject);
     }
 }