.vector glowmod;
void generator_changeteam()
{
- self.glowmod = Team_ColorRGB(self.team - 1);
- self.teamradar_color = Team_ColorRGB(self.team - 1);
-
if(self.team)
+ {
+ self.glowmod = Team_ColorRGB(self.team - 1);
+ self.teamradar_color = Team_ColorRGB(self.team - 1);
self.colormap = 1024 + (self.team - 1) * 17;
+ }
+ else
+ {
+ self.colormap = 1024;
+ self.glowmod = '1 1 0';
+ self.teamradar_color = '1 1 0';
+ }
}
void ent_generator()
self.health = ReadByte();
self.max_health = ReadByte();
self.count = ReadByte();
+ self.team = ReadByte();
if not(self.count)
self.count = 40;
+ generator_changeteam();
generator_precache();
generator_construct();
- self.colormap = 1024;
- self.glowmod = '1 1 0';
}
if(sf & GSF_STATUS)
WriteByte(MSG_ENTITY, self.health);
WriteByte(MSG_ENTITY, self.max_health);
WriteByte(MSG_ENTITY, self.count);
+ WriteByte(MSG_ENTITY, self.team);
}
if(sf & GSF_STATUS)
self.event_damage = td_generator_damage;
self.movetype = MOVETYPE_NONE;
self.monster_attack = TRUE;
- self.SendFlags = GSF_SETUP;
self.netname = "Generator";
self.reset = func_null;
self.velocity = randomvec() * 175 + '0 0 325';
}
+void td_generator_delayed()
+{
+ generator_link(td_generator_setup);
+
+ self.SendFlags = GSF_SETUP;
+}
+
// round handling
#define TD_ALIVE_TEAMS() ((redalive > 0) + (bluealive > 0))
#define TD_ALIVE_TEAMS_OK() (TD_ALIVE_TEAMS() == 2)
setorigin(self, self.origin + '0 0 20');
droptofloor();
- generator_link(td_generator_setup);
+ InitializeEntity(self, td_generator_delayed, INITPRIO_LAST);
}
void spawnfunc_td_waypoint()