]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/monsters/sv_spawner.qc
Merge branch 't0uYK8Ne/set_slick_friction' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / monsters / sv_spawner.qc
1 #include "sv_spawner.qh"
2 #include "sv_spawn.qh"
3
4 void spawner_use(entity this, entity actor, entity trigger)
5 {
6         int moncount = 0;
7         IL_EACH(g_monsters, it.realowner == this,
8         {
9                 ++moncount;
10         });
11
12         if(moncount >= this.count)
13                 return;
14
15         entity e = spawn();
16         e.noalign = this.noalign;
17         e.angles = this.angles;
18         e.monster_skill = this.monster_skill;
19         e.skin = this.skin;
20         e = spawnmonster(e, this.spawnmob, 0, this, this, this.origin, false, true, this.monster_moveflags);
21 }
22
23 spawnfunc(monster_spawner)
24 {
25         if(!autocvar_g_monsters || !this.spawnmob || this.spawnmob == "") { delete(this); return; }
26
27         this.use = spawner_use;
28 }