-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeter.qc
36 lines (27 loc) · 880 Bytes
/
meter.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
void() MoverInitSounds; // borrow from slider.qc
void() MeterStop = {
self.io_send = self.io_received;
SUB_UseTargets();
sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM);
};
void() MeterUse = {
vector delta_angles = (self.mangle - self.pos1) * self.io_received;
vector dest_angles = self.pos1 + delta_angles;
SUB_CalcAngleMove(dest_angles, self.speed, MeterStop);
sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM);
};
void() func_meter = {
self.movetype = MOVETYPE_NOCLIP;
if (self.speed <= 0) {
self.speed = 45;
}
// Initial orientation
self.pos1 = self.angles;
// I don't trust collisions with rotating brushes (/shrug)
self.solid = SOLID_NOT;
setorigin(self, self.origin);
setmodel(self, self.model);
MoverInitSounds();
precache_sound("misc/null.wav");
self.use = MeterUse;
};