X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Ftarget_music.qc;h=12ee04ad22ba1567f1281360ac04002f285b3b24;hb=6f37a8f8076a572097afb13de2c367a72717c927;hp=600af861ac956c55cba7a867ee567aa03b59bc5a;hpb=3adaa0873ad9eac20f32e6e3fc0455d4f9e044cd;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/target_music.qc b/qcsrc/server/target_music.qc index 600af861a..12ee04ad2 100644 --- a/qcsrc/server/target_music.qc +++ b/qcsrc/server/target_music.qc @@ -1,3 +1,6 @@ +#include "_.qh" + +.float volume; .float lifetime; // values: // volume @@ -28,10 +31,11 @@ void target_music_use() { if(!activator) return; - if(!IS_REAL_CLIENT(activator)) - return; - msg_entity = activator; - target_music_sendto(MSG_ONE, 1); + if(IS_REAL_CLIENT(activator)) + { + msg_entity = activator; + target_music_sendto(MSG_ONE, 1); + } entity head; FOR_EACH_SPEC(head) if(head.enemy == activator) { msg_entity = head; target_music_sendto(MSG_ONE, 1); } } @@ -64,7 +68,7 @@ void TargetMusic_RestoreGame() // spawnflags: // 1 = START_OFF // when triggered, it is disabled/enabled for everyone -float trigger_music_SendEntity(entity to, float sf) +float trigger_music_SendEntity(entity to, int sf) { WriteByte(MSG_ENTITY, ENT_CLIENT_TRIGGER_MUSIC); sf &= ~0x80; @@ -73,28 +77,28 @@ float trigger_music_SendEntity(entity to, float sf) WriteByte(MSG_ENTITY, sf); if(sf & 4) { - WriteCoord(MSG_ENTITY, self.origin_x); - WriteCoord(MSG_ENTITY, self.origin_y); - WriteCoord(MSG_ENTITY, self.origin_z); + WriteCoord(MSG_ENTITY, self.origin.x); + WriteCoord(MSG_ENTITY, self.origin.y); + WriteCoord(MSG_ENTITY, self.origin.z); } if(sf & 1) { if(self.model != "null") { WriteShort(MSG_ENTITY, self.modelindex); - WriteCoord(MSG_ENTITY, self.mins_x); - WriteCoord(MSG_ENTITY, self.mins_y); - WriteCoord(MSG_ENTITY, self.mins_z); - WriteCoord(MSG_ENTITY, self.maxs_x); - WriteCoord(MSG_ENTITY, self.maxs_y); - WriteCoord(MSG_ENTITY, self.maxs_z); + WriteCoord(MSG_ENTITY, self.mins.x); + WriteCoord(MSG_ENTITY, self.mins.y); + WriteCoord(MSG_ENTITY, self.mins.z); + WriteCoord(MSG_ENTITY, self.maxs.x); + WriteCoord(MSG_ENTITY, self.maxs.y); + WriteCoord(MSG_ENTITY, self.maxs.z); } else { WriteShort(MSG_ENTITY, 0); - WriteCoord(MSG_ENTITY, self.maxs_x); - WriteCoord(MSG_ENTITY, self.maxs_y); - WriteCoord(MSG_ENTITY, self.maxs_z); + WriteCoord(MSG_ENTITY, self.maxs.x); + WriteCoord(MSG_ENTITY, self.maxs.y); + WriteCoord(MSG_ENTITY, self.maxs.z); } WriteByte(MSG_ENTITY, self.volume * 255.0); WriteByte(MSG_ENTITY, self.fade_time * 16.0); @@ -129,5 +133,5 @@ void spawnfunc_trigger_music() self.use = trigger_music_use; self.reset = trigger_music_reset; - Net_LinkEntity(self, FALSE, 0, trigger_music_SendEntity); + Net_LinkEntity(self, false, 0, trigger_music_SendEntity); }