]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/gamemodes/gamemode/onslaught/sv_generator.qc
Merge branch 'master' into terencehill/min_spec_time
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / onslaught / sv_generator.qc
1 #include "sv_generator.qh"
2
3 bool generator_send(entity this, entity to, int sf)
4 {
5         WriteHeader(MSG_ENTITY, ENT_CLIENT_GENERATOR);
6         WriteByte(MSG_ENTITY, sf);
7         if(sf & GSF_SETUP)
8         {
9                 WriteVector(MSG_ENTITY, this.origin);
10
11                 WriteByte(MSG_ENTITY, this.health);
12                 WriteByte(MSG_ENTITY, this.max_health);
13                 WriteByte(MSG_ENTITY, this.count);
14                 WriteByte(MSG_ENTITY, this.team);
15         }
16
17         if(sf & GSF_STATUS)
18         {
19                 WriteByte(MSG_ENTITY, this.team);
20
21                 if(this.health <= 0)
22                         WriteByte(MSG_ENTITY, 0);
23                 else
24                         WriteByte(MSG_ENTITY, ceil((this.health / this.max_health) * 255));
25         }
26
27         return true;
28 }