]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/client/sortlist.qh
Merge branch 'master' into Mario/qc_updates
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / sortlist.qh
1 #ifndef SORTLIST_H
2 #define SORTLIST_H
3
4 //.float(entity,entity) sort_cmp;
5 .entity sort_next, sort_prev;
6
7 entity Sort_Spawn();
8
9 /**
10  * Swap two neighbours in a sortlist.
11  * @param a FIRST entity
12  * @param b entity after a
13  */
14 #define SORT_SWAP(a,b)                                                                  \
15         b.sort_prev = a.sort_prev;                                                      \
16         a.sort_next = b.sort_next;                                                      \
17         if(b.sort_next) b.sort_next.sort_prev = a;                      \
18         if(a.sort_prev) a.sort_prev.sort_next = b;                      \
19         a.sort_prev = b;                                                                        \
20         b.sort_next = a
21
22 #endif