]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator/mutator_overkill.qc
Weapons: pass weaponentity field instead of slot
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator / mutator_overkill.qc
index 0df6accdd3c25b7947fc52c3adefba0838642c97..4e4da230d3f7a687761ee673c469ba3194228928 100644 (file)
@@ -207,9 +207,9 @@ MUTATOR_HOOKFUNCTION(ok, PlayerPreThink)
                        play2(self, SND(DRYFIRE));
                }
                Weapon wpn = get_weaponinfo(self.weapon);
-               int slot = 0; // TODO: unhardcode
-               if(self.weaponentity[slot].state != WS_CLEAR)
-                       w_ready(wpn, self, slot, (self.BUTTON_ATCK ? 1 : 0) | (self.BUTTON_ATCK2 ? 2 : 0));
+               .entity weaponentity = weaponentities[0]; // TODO: unhardcode
+               if(self.(weaponentity).state != WS_CLEAR)
+                       w_ready(wpn, self, weaponentity, (self.BUTTON_ATCK ? 1 : 0) | (self.BUTTON_ATCK2 ? 2 : 0));
 
                self.weapon_blocked = true;
        }