Advertisement
Tkap1

Untitled

Apr 11th, 2022 (edited)
1,157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. // If you have holes, you can do this
  2. struct entity_ref
  3. {
  4.     u32 index;
  5.     u32 generation;
  6. };
  7.  
  8. bool is_entity_valid(entity_ref ref)
  9. {
  10.     if(entities[ref.index].generation == ref.generation)
  11.     {
  12.         return true;
  13.     }
  14.     return false;
  15. }
  16.  
  17.  
  18. // If you don't, you have to loop over all of them and check id
  19.  
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement