Advertisement
Tkap1

Untitled

Jan 21st, 2023 (edited)
1,044
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. // THIS
  2. int id = 0;
  3. Skill* skill = tryAttack1(&id) || tryAttack2(&id);
  4. if(id == 1)
  5. {
  6.    
  7. }
  8. else if(id == 2)
  9. {
  10.    
  11. }
  12.  
  13.  
  14. // OR THIS
  15. do
  16. {
  17.     Skill* skill;
  18.     skill = tryAttack1();
  19.     if(skill)
  20.     {
  21.         // ...
  22.         break;
  23.     }  
  24.     skill = tryAttack2();
  25.     if(skill)
  26.     {
  27.         // ...
  28.         break;
  29.     }
  30. } while(0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement