]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/tuba.qc
Merge branch 'master' into TimePath/notifications
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / tuba.qc
index ebf4881df669df53226c69180470d50ad425ccb1..24b2f69982c0b3faa4639f5922fb981be032efa3 100644 (file)
@@ -213,9 +213,9 @@ int W_Tuba_GetNote(entity pl, int hittype)
                case 8: note = +4; break; // e
                case 9: note = -1; break; // B
        }
-       if(pl.BUTTON_CROUCH)
+       if(PHYS_INPUT_BUTTON_CROUCH(pl))
                note -= 12;
-       if(pl.BUTTON_JUMP)
+       if(PHYS_INPUT_BUTTON_JUMP(pl))
                note += 12;
        if(hittype & HITTYPE_SECONDARY)
                note += 7;
@@ -367,9 +367,9 @@ METHOD(Tuba, wr_aim, void(Tuba this))
        if (vdist((actor.origin - actor.enemy.origin), <, WEP_CVAR(tuba, radius)))
        {
                if (random() > 0.5)
-                       actor.BUTTON_ATCK = 1;
+                       PHYS_INPUT_BUTTON_ATCK(actor) = true;
                else
-                       actor.BUTTON_ATCK2 = 1;
+                       PHYS_INPUT_BUTTON_ATCK2(actor) = true;
        }
 }
 
@@ -464,7 +464,7 @@ METHOD(Tuba, wr_reload, void(Tuba this, entity actor, .entity weaponentity))
 METHOD(Tuba, wr_checkammo1, bool(Tuba this)) { return true; }
 METHOD(Tuba, wr_checkammo2, bool(Tuba this)) { return true; }
 
-METHOD(Tuba, wr_suicidemessage, int(Tuba this))
+METHOD(Tuba, wr_suicidemessage, Notification(Tuba this))
 {
        if (w_deathtype & HITTYPE_BOUNCE)
                return WEAPON_KLEINBOTTLE_SUICIDE;
@@ -473,7 +473,7 @@ METHOD(Tuba, wr_suicidemessage, int(Tuba this))
        else
                return WEAPON_TUBA_SUICIDE;
 }
-METHOD(Tuba, wr_killmessage, int(Tuba this))
+METHOD(Tuba, wr_killmessage, Notification(Tuba this))
 {
        if (w_deathtype & HITTYPE_BOUNCE)
                return WEAPON_KLEINBOTTLE_MURDER;
@@ -582,12 +582,14 @@ void Ent_TubaNote_UpdateSound(entity this)
        tubasound(this.enemy, 1);
 }
 
-void Ent_TubaNote_StopSound()
-{SELFPARAM();
+void Ent_TubaNote_StopSound(entity this)
+{
        this.enemy.nextthink = time;
        this.enemy = NULL;
 }
 
+void Ent_TubaNote_StopSound_self() { Ent_TubaNote_StopSound(self); }
+
 NET_HANDLE(ENT_CLIENT_TUBANOTE, bool isNew)
 {
        bool upd = false;
@@ -600,7 +602,7 @@ NET_HANDLE(ENT_CLIENT_TUBANOTE, bool isNew)
 
                if (this.enemy) {
                        if (n != this.note || i != this.tuba_instrument || isNew) {
-                               Ent_TubaNote_StopSound();
+                               Ent_TubaNote_StopSound(this);
                        }
                } else {
                        this.enemy = new(tuba_note);
@@ -629,7 +631,7 @@ NET_HANDLE(ENT_CLIENT_TUBANOTE, bool isNew)
                }
        }
 
-       this.think = Ent_TubaNote_StopSound;
+       this.think = Ent_TubaNote_StopSound_self;
        this.entremove = Ent_TubaNote_StopSound;
        this.enemy.think = Ent_TubaNote_Think;
        this.enemy.nextthink = time + 10;