]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/turrets/sv_turrets.qc
Fix up more mutator hooks
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / sv_turrets.qc
index b2b1d973bf39dfbb41827772e8d120dc407f2b9f..be7dbb8aebaa3bd928ea4123d04dff0d8fc2ba4a 100644 (file)
@@ -971,13 +971,15 @@ float turret_firecheck()
        return 1;
 }
 
-bool turret_checkfire()
-{SELFPARAM();
-       bool ret = false; // dummy
-       if(MUTATOR_CALLHOOK(Turret_CheckFire, ret))
-               return ret_bool;
+bool turret_checkfire(entity this)
+{
+       if(MUTATOR_CALLHOOK(Turret_CheckFire, this))
+               return M_ARGV(1, bool);
+
+       bool ret = false;
+       WITHSELF(this, ret = this.turret_firecheckfunc());
 
-       return self.turret_firecheckfunc();
+       return ret;
 }
 
 void turret_fire()
@@ -1055,7 +1057,7 @@ void turret_think(entity this)
 
                                        turret_do_updates(self);
 
-                                       if (turret_checkfire())
+                                       if (turret_checkfire(self))
                                                turret_fire();
                                }
                        }
@@ -1079,7 +1081,7 @@ void turret_think(entity this)
                turret_do_updates(self);
 
                // Fire?
-               if (turret_checkfire())
+               if (turret_checkfire(self))
                        turret_fire();
        }
        else
@@ -1099,7 +1101,7 @@ void turret_think(entity this)
                                turret_do_updates(self);
 
                                // Fire!
-                               if (turret_checkfire())
+                               if (turret_checkfire(self))
                                        turret_fire();
 
                                Turret tur = get_turretinfo(self.m_id);
@@ -1161,7 +1163,7 @@ void turret_think(entity this)
                turret_do_updates(self);
 
                // Fire?
-               if (turret_checkfire())
+               if (turret_checkfire(self))
                        turret_fire();
        }