PTB plugin: random crashes at the end of battles

1682008259250.png

this is from LE - Press Turn Battle, please ignore the silly title, i had to remove all of my scripts just to fix something so i ended up naming my scripts funny names to relieve my stress

Code:
  #--------------------------------------------------------------------------
  # update
  #--------------------------------------------------------------------------
  def update
    return if disposed?
    super
    self.opacity -= 24 if @disposing
    self.dispose if self.opacity <= 0
    return if @disposing
    if BattleControl.ptbn_actions[@index] == 0
      @disposing = true
    elsif BattleControl.ptbn_actions[@index] == 2
      @count -= 1
      if @count <= 0;self.flash(Color.new(255,255,255), 24); @count = 48; end # 1047
    end
  end

i believe this is part of the visuals portion of the code. anyway, i would just get random crashes, which i would skip through because i don't like waiting, then it would be fine for long enough for me to forget about, then it would happen again. i didn't even know why this was happening for like a week because of this. i've been frustrated lately, and i frankly don't feel like dealing with this boosh.
which maker is that script for?
and please link to the website of the full script.

As for the error itself - looks like the script tried to access a sprite after the sprite (or the object it belongs to) have been deleted.
The problem is how the whole method has been defined. What the hell was the script thinking when he decided that it was a good idea to dispose the window or sprite during the update method!? At least he should have prevented it from updating but never did. It might require a rewrite of that method to simply ditch the image and not the whole window or sprite. Where did you get that script from?
which maker is that script for?
and please link to the website of the full script.

As for the error itself - looks like the script tried to access a sprite after the sprite (or the object it belongs to) have been deleted.
I assumed that the icon was enough for people to know its VX Ace. It's VX Ace.

the script i'm using is here:
The problem is how the whole method has been defined. What the hell was the script thinking when he decided that it was a good idea to dispose the window or sprite during the update method!? At least he should have prevented it from updating but never did. It might require a rewrite of that method to simply ditch the image and not the whole window or sprite. Where did you get that script from?
so move the dispose into a new function, and then run the update function if not disposing, got it

Original thread: https://forums.rpgmakerweb.com/threads/ptb-plugin-random-crashes-at-the-end-of-battles.156860/