]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/tuba.qc
Replace all direct assignments to self with setself(e)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / tuba.qc
index 686c89ec3a7f6f0dae6a0fe3ed8c0761735b6555..05787ba58777650a2522782586f6900e7df64fa3 100644 (file)
@@ -148,7 +148,7 @@ bool W_Tuba_HasPlayed(entity pl, string melody, int instrument, bool ignorepitch
 }
 
 void W_Tuba_NoteOff(void)
-{
+{SELFPARAM();
        // we have a note:
        //   on: self.spawnshieldtime
        //   off: time
@@ -252,7 +252,7 @@ int W_Tuba_GetNote(entity pl, int hittype)
 }
 
 bool W_Tuba_NoteSendEntity(entity to, int sf)
-{
+{SELFPARAM();
        int f;
 
        msg_entity = to;
@@ -280,7 +280,7 @@ bool W_Tuba_NoteSendEntity(entity to, int sf)
 }
 
 void W_Tuba_NoteThink(void)
-{
+{SELFPARAM();
        float dist_mult;
        float vol0, vol1;
        vector dir0, dir1;
@@ -318,7 +318,7 @@ void W_Tuba_NoteThink(void)
 }
 
 void W_Tuba_NoteOn(float hittype)
-{
+{SELFPARAM();
        vector o;
        float n;
 
@@ -336,10 +336,8 @@ void W_Tuba_NoteOn(float hittype)
        {
                if(self.tuba_note.cnt != n || self.tuba_note.tuba_instrument != self.tuba_instrument)
                {
-                       entity oldself = self;
-                       self = self.tuba_note;
-                       W_Tuba_NoteOff();
-                       self = oldself;
+                       SELFCALL(self.tuba_note, W_Tuba_NoteOff());
+                       SELFCALL_DONE();
                }
        }
 
@@ -369,7 +367,7 @@ void W_Tuba_NoteOn(float hittype)
 }
 
 bool W_Tuba(int req)
-{
+{SELFPARAM();
        switch(req)
        {
                case WR_AIM:
@@ -406,10 +404,8 @@ bool W_Tuba(int req)
                        {
                                if(!self.BUTTON_ATCK && !self.BUTTON_ATCK2)
                                {
-                                       entity oldself = self;
-                                       self = self.tuba_note;
-                                       W_Tuba_NoteOff();
-                                       self = oldself;
+                                       SELFCALL(self.tuba_note, W_Tuba_NoteOff());
+                                       SELFCALL_DONE();
                                }
                        }
 
@@ -495,7 +491,7 @@ bool W_Tuba(int req)
 #endif
 #ifdef CSQC
 bool W_Tuba(int req)
-{
+{SELFPARAM();
        // nothing to do here; particles of tuba are handled differently
        // WEAPONTODO