-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsquads.qc
44 lines (36 loc) · 1.21 KB
/
squads.qc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
static float notify_running;
void(float notify_type) SquadNotify = {
entity squaddie, self_temp, act_temp;
// Don't recurse
if ((!notify_running) && self.squad != "") {
notify_running = TRUE;
squaddie = find(self, squad, self.squad);
while (squaddie != self) {
if (
squaddie != world
&& notify_type == SQNOTIFY_ENEMY
) {
if (squaddie.classname == "ai_monitor") {
self_temp = self;
act_temp = activator;
activator = self.enemy;
self = squaddie;
SUB_UseTargets();
self = self_temp;
activator = act_temp;
} else if (
squaddie.health > 0
&& (squaddie.flags & FL_MONSTER)
) {
squaddie.enemy = self.enemy;
self_temp = self;
self = squaddie;
FoundTarget();
self = self_temp;
}
}
squaddie = find(squaddie, squad, self.squad);
}
notify_running = FALSE;
}
};