]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/monsters/all.qh
Add a function to change the monster model path
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / monsters / all.qh
1 #ifndef MONSTERS_ALL_H
2 #define MONSTERS_ALL_H
3
4 #include "monster.qh"
5
6 string M_Model(string m_mdl);
7
8 REGISTRY(Monsters, BITS(4))
9 REGISTER_REGISTRY(RegisterMonsters)
10 const int MON_FIRST = 1;
11 #define MON_LAST (Monsters_COUNT - 1)
12 /** If you register a new monster, make sure to add it to all.inc */
13 #define REGISTER_MONSTER(id, inst) REGISTER(RegisterMonsters, MON, Monsters, id, monsterid, inst)
14
15 REGISTER_MONSTER(Null, NEW(Monster));
16
17 Monster get_monsterinfo(int id)
18 {
19         if (id >= MON_FIRST && id <= MON_LAST) {
20                 Monster m = Monsters[id];
21                 if (m) return m;
22         }
23         return MON_Null;
24 }
25
26 #include "all.inc"
27
28 #endif