]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/casings.qc
Weapons: pass weaponentity field instead of slot
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / casings.qc
index 249757b7b5d16591cfadb8e8290873e87c401895..5400030b428c4ebe542240ac793ce2bd9e320c87 100644 (file)
@@ -12,8 +12,9 @@ REGISTER_MUTATOR(casings, true);
 #ifdef SVQC
 void SpawnCasing(vector vel, float randomvel, vector ang, vector avel, float randomavel, int casingtype, entity casingowner)
 {SELFPARAM();
-    int slot = 0; // TODO: parameter
-    vector org = self.origin + self.view_ofs + self.weaponentity[slot].spawnorigin.x * v_forward - self.weaponentity[slot].spawnorigin.y * v_right + self.weaponentity[slot].spawnorigin.z * v_up;
+    .entity weaponentity = weaponentities[0]; // TODO: parameter
+    entity wep = self.(weaponentity);
+    vector org = self.origin + self.view_ofs + wep.spawnorigin.x * v_forward - wep.spawnorigin.y * v_right + wep.spawnorigin.z * v_up;
 
     if (!sound_allowed(MSG_BROADCAST, casingowner))
         casingtype |= 0x80;