foxcode

Untitled

Sep 24th, 2021 (edited)
538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // const remainingEffects = effectHolders.filter(holder => !holder.effect.isExpired());
  2.  
  3. const remainingEffects = [];
  4.  
  5. for (let i=0; i<9; i++) {
  6.     if (!effectHolders[i].isExpires()) {
  7.         remainingEffects.push(effectHolders[i]);
  8.     }
  9. }
  10.  
  11. for (let i=0; i<9; i++) {
  12.     if (i < remainingEffects.length) {
  13.         effectHolders[i].copyFrom(remainingEffects[i]);
  14.     } else if (effectHolders[i]) { // Not sure what this conditional should be
  15.         effectHolders[i].erase();
  16.     }
  17. }
Add Comment
Please, Sign In to add comment