Advertisement
RefresherTowel
Oct 30th, 2022 (edited)
66
0
Never
This is comment for paste Attribute system
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. With the add modifier, you could completely remove the switch statement, so instead of this:
  2.  
  3. switch(_mod.op_type){
  4. case 0: array_push(modifiers[0], _mod); break;
  5. case 1: array_push(modifiers[1], _mod); break;
  6. case 2: array_push(modifiers[2], _mod); break;
  7. }
  8.  
  9. You would simply have this:
  10.  
  11. array_push(modifiers[_mod.op_type], _mod);
  12.  
  13. You could probably also write some functions to do the calculations and have them stored in a global array that corresponds to op_type, which would let you shorten the calculations code as well.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement