]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Convert more calls
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 15 Aug 2015 07:15:57 +0000 (17:15 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sat, 15 Aug 2015 07:15:57 +0000 (17:15 +1000)
17 files changed:
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/weapons/w_blaster.qc
qcsrc/common/weapons/w_crylink.qc
qcsrc/common/weapons/w_devastator.qc
qcsrc/common/weapons/w_electro.qc
qcsrc/common/weapons/w_fireball.qc
qcsrc/common/weapons/w_hagar.qc
qcsrc/common/weapons/w_hlac.qc
qcsrc/common/weapons/w_hook.qc
qcsrc/common/weapons/w_minelayer.qc
qcsrc/common/weapons/w_mortar.qc
qcsrc/common/weapons/w_porto.qc
qcsrc/common/weapons/w_rpc.qc
qcsrc/common/weapons/w_seeker.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/base.qh
qcsrc/server/tturrets/system/system_main.qc

index 239f8fe9a7f57bf06f2f861f0544683e0774bda7..540ad5ac75509c682edaee7f9c3b28a3c3fb1133 100644 (file)
@@ -1039,9 +1039,8 @@ void monsters_damage (entity inflictor, entity attacker, float damage, int death
 
                WaypointSprite_Kill(self.sprite);
 
-               frag_attacker = attacker;
                frag_target = self;
-               MUTATOR_CALLHOOK(MonsterDies);
+               MUTATOR_CALLHOOK(MonsterDies, attacker);
 
                if(self.health <= -100 || deathtype == DEATH_KILL) // check if we're already gibbed
                {
index a776edbf4f5a383b2ae5fb136a68cc33c6f3c546..1e41f9df891fae2f1f4dd01800a9aa79cd6736f5 100644 (file)
@@ -136,7 +136,7 @@ void W_Blaster_Attack(
        missile.think = W_Blaster_Think;
        missile.nextthink = time + atk_delay;
 
-       other = missile; MUTATOR_CALLHOOK(EditProjectile);
+       MUTATOR_CALLHOOK(EditProjectile, self, missile);
 
        if(time >= missile.nextthink)
        {
index 4d4430206feab00a0f9c965bc5174782d4ce3fbd..0825103d478cba33beafb529c78243f770a6ba60 100644 (file)
@@ -437,7 +437,7 @@ void W_Crylink_Attack(void)
 
                CSQCProjectile(proj, true, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), true);
 
-               other = proj; MUTATOR_CALLHOOK(EditProjectile);
+               MUTATOR_CALLHOOK(EditProjectile, self, proj);
        }
        if(WEP_CVAR_PRI(crylink, joinspread) != 0)
        {
@@ -553,7 +553,7 @@ void W_Crylink_Attack2(void)
 
                CSQCProjectile(proj, true, (proj.cnt ? PROJECTILE_CRYLINK_BOUNCING : PROJECTILE_CRYLINK), true);
 
-               other = proj; MUTATOR_CALLHOOK(EditProjectile);
+               MUTATOR_CALLHOOK(EditProjectile, self, proj);
        }
        if(WEP_CVAR_SEC(crylink, joinspread) != 0)
        {
index e9e0467e208ea0a9eed56642a412523adc4de74e..0dd8f80f74c85518d73983a2fb21dad01c52e68f 100644 (file)
@@ -388,7 +388,7 @@ void W_Devastator_Attack(void)
        W_AttachToShotorg(flash, '5 0 0');
 
        // common properties
-       other = missile; MUTATOR_CALLHOOK(EditProjectile);
+       MUTATOR_CALLHOOK(EditProjectile, self, missile);
 }
 
 bool W_Devastator(int req)
index e3b809296be709e884c8d993aff7a1730e897668..0a219392ee48115e72001ce83b4180739dd5a4f1 100644 (file)
@@ -284,7 +284,7 @@ void W_Electro_Attack_Bolt(void)
 
        CSQCProjectile(proj, true, PROJECTILE_ELECTRO_BEAM, true);
 
-       other = proj; MUTATOR_CALLHOOK(EditProjectile);
+       MUTATOR_CALLHOOK(EditProjectile, self, proj);
 }
 
 void W_Electro_Orb_Touch(void)
@@ -400,7 +400,7 @@ void W_Electro_Attack_Orb(void)
 
        CSQCProjectile(proj, true, PROJECTILE_ELECTRO, false); // no culling, it has sound
 
-       other = proj; MUTATOR_CALLHOOK(EditProjectile);
+       MUTATOR_CALLHOOK(EditProjectile, self, proj);
 }
 
 void W_Electro_CheckAttack(void)
index 7bb5ccb66c7ebf97e2c9588739eca324b74c65a9..112b6524eade596d0601257b7507cd508a4ca006 100644 (file)
@@ -213,7 +213,7 @@ void W_Fireball_Attack1(void)
 
        CSQCProjectile(proj, true, PROJECTILE_FIREBALL, true);
 
-       other = proj; MUTATOR_CALLHOOK(EditProjectile);
+       MUTATOR_CALLHOOK(EditProjectile, self, proj);
 }
 
 void W_Fireball_AttackEffect(float i, vector f_diff)
@@ -344,7 +344,7 @@ void W_Fireball_Attack2(void)
 
        CSQCProjectile(proj, true, PROJECTILE_FIREMINE, true);
 
-       other = proj; MUTATOR_CALLHOOK(EditProjectile);
+       MUTATOR_CALLHOOK(EditProjectile, self, proj);
 }
 
 bool W_Fireball(int req)
index 4c9f664989d2a77852acca35b5eb13127c60c648..808d7733af18fe718d885c24ca40303165dfeac3 100644 (file)
@@ -160,7 +160,7 @@ void W_Hagar_Attack(void)
 
        CSQCProjectile(missile, true, PROJECTILE_HAGAR, true);
 
-       other = missile; MUTATOR_CALLHOOK(EditProjectile);
+       MUTATOR_CALLHOOK(EditProjectile, self, missile);
 }
 
 void W_Hagar_Attack2(void)
@@ -204,7 +204,7 @@ void W_Hagar_Attack2(void)
 
        CSQCProjectile(missile, true, PROJECTILE_HAGAR_BOUNCING, true);
 
-       other = missile; MUTATOR_CALLHOOK(EditProjectile);
+       MUTATOR_CALLHOOK(EditProjectile, self, missile);
 }
 
 .float hagar_loadstep, hagar_loadblock, hagar_loadbeep, hagar_warning;
@@ -280,7 +280,7 @@ void W_Hagar_Attack2_Load_Release(void)
 
                CSQCProjectile(missile, true, PROJECTILE_HAGAR, true);
 
-               other = missile; MUTATOR_CALLHOOK(EditProjectile);
+               MUTATOR_CALLHOOK(EditProjectile, self, missile);
        }
 
        weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(hagar, load_animtime), w_ready);
index 7f7d7a27b27e05cf37b205b718e22b1c1a20e849..e9c7ffee4802185c99108c547bcfb64cbc4c5113 100644 (file)
@@ -110,7 +110,7 @@ void W_HLAC_Attack(void)
 
        CSQCProjectile(missile, true, PROJECTILE_HLAC, true);
 
-       other = missile; MUTATOR_CALLHOOK(EditProjectile);
+       MUTATOR_CALLHOOK(EditProjectile, self, missile);
 }
 
 void W_HLAC_Attack2(void)
@@ -154,7 +154,7 @@ void W_HLAC_Attack2(void)
 
        CSQCProjectile(missile, true, PROJECTILE_HLAC, true);
 
-       other = missile; MUTATOR_CALLHOOK(EditProjectile);
+       MUTATOR_CALLHOOK(EditProjectile, self, missile);
 }
 
 // weapon frames
index 1c05c23d69c2ca84bf3a3a4abcc2abb884d36f34..0c002bfc78aa1e727af8fb3ec4cf91383db129b5 100644 (file)
@@ -170,7 +170,7 @@ void W_Hook_Attack2(void)
 
        CSQCProjectile(gren, true, PROJECTILE_HOOKBOMB, true);
 
-       other = gren; MUTATOR_CALLHOOK(EditProjectile);
+       MUTATOR_CALLHOOK(EditProjectile, self, gren);
 }
 
 bool W_Hook(int req)
index d4ef9554702af9628800348dd0180e84baf6c90c..32d999612b149ded8b93f3cf1042e5e5d3a602cd 100644 (file)
@@ -374,7 +374,7 @@ void W_MineLayer_Attack(void)
 
        // common properties
 
-       other = mine; MUTATOR_CALLHOOK(EditProjectile);
+       MUTATOR_CALLHOOK(EditProjectile, self, mine);
 
        self.minelayer_mines = W_MineLayer_Count(self);
 }
index c958372afb8177ba8e8bf5c205cd32abf8614836..a8c6a2c59e3e56c946e2c6d7d4ab409bf8b441fc 100644 (file)
@@ -267,7 +267,7 @@ void W_Mortar_Attack(void)
        else
                CSQCProjectile(gren, true, PROJECTILE_GRENADE_BOUNCING, true);
 
-       other = gren; MUTATOR_CALLHOOK(EditProjectile);
+       MUTATOR_CALLHOOK(EditProjectile, self, gren);
 }
 
 void W_Mortar_Attack2(void)
@@ -315,7 +315,7 @@ void W_Mortar_Attack2(void)
        else
                CSQCProjectile(gren, true, PROJECTILE_GRENADE_BOUNCING, true);
 
-       other = gren; MUTATOR_CALLHOOK(EditProjectile);
+       MUTATOR_CALLHOOK(EditProjectile, self, gren);
 }
 
 .float bot_secondary_grenademooth;
index 82baf07bd1fa46b16d853fa019a13bc838257969..40964891d2bdcf849702533fd893214fc9c63b9e 100644 (file)
@@ -283,7 +283,7 @@ void W_Porto_Attack(float type)
        else
                CSQCProjectile(gren, true, PROJECTILE_PORTO_RED, true);
 
-       other = gren; MUTATOR_CALLHOOK(EditProjectile);
+       MUTATOR_CALLHOOK(EditProjectile, self, gren);
 }
 
 bool w_nexball_weapon(int req); // WEAPONTODO
index d641572c343f87c7a01c151cc61ca9ec8ef235cf..b7f7a4f879fd39b5d23295a145fea254ab4aad57 100644 (file)
@@ -143,7 +143,7 @@ void W_RocketPropelledChainsaw_Attack (void)
        W_AttachToShotorg(flash, '5 0 0');
        missile.pos1 = missile.velocity;
 
-       other = missile; MUTATOR_CALLHOOK(EditProjectile);
+       MUTATOR_CALLHOOK(EditProjectile, self, missile);
 }
 
 bool W_RocketPropelledChainsaw(int req)
index f338ed7ea376d43ccad3d00ca30f4e047a02894b..2dce3165b848c6f316f8c7b7c315851063840d0a 100644 (file)
@@ -293,7 +293,7 @@ void W_Seeker_Fire_Missile(vector f_diff, entity m_target)
 
        CSQCProjectile(missile, false, PROJECTILE_SEEKER, true);
 
-       other = missile; MUTATOR_CALLHOOK(EditProjectile);
+       MUTATOR_CALLHOOK(EditProjectile, self, missile);
 }
 
 // ============================
@@ -371,7 +371,7 @@ void W_Seeker_Fire_Flac(void)
        W_SetupProjVelocity_UP_PRE(missile, seeker, flac_);
        CSQCProjectile(missile, true, PROJECTILE_FLAC, true);
 
-       other = missile; MUTATOR_CALLHOOK(EditProjectile);
+       MUTATOR_CALLHOOK(EditProjectile, self, missile);
 }
 
 // ============================
@@ -589,7 +589,7 @@ void W_Seeker_Fire_Tag(void)
 
        CSQCProjectile(missile, true, PROJECTILE_TAG, false); // has sound
 
-       other = missile; MUTATOR_CALLHOOK(EditProjectile);
+       MUTATOR_CALLHOOK(EditProjectile, self, missile);
 }
 
 // ============================
index 2354e128e30bd9d1874e1ca0e57c16ec2f8c07d2..fa7cc077163a1a4b3db33ecf6a324597e46f207c 100644 (file)
@@ -425,10 +425,7 @@ void GetCvars(float f)
        if (f > 0)
                s = strcat1(argv(f));
 
-       get_cvars_f = f;
-       get_cvars_s = s;
-
-       MUTATOR_CALLHOOK(GetCvars);
+       MUTATOR_CALLHOOK(GetCvars, f, s);
 
        Notification_GetCvars();
 
index b999ce3d7d372cb1bfe073b217161aa856af95a7..2a9a48adba70d76f669f29f5646b34861d917935 100644 (file)
@@ -212,46 +212,57 @@ MUTATOR_HOOKABLE(BuildMutatorsPrettyString, EV_BuildMutatorsPrettyString);
     /**/
 MUTATOR_HOOKABLE(CustomizeWaypoint, EV_CustomizeWaypoint);
 
+/**
+ * checks if the current item may be spawned (self.items and self.weapons may be read and written to, as well as the ammo_ fields)
+ * return error to request removal
+ */
 MUTATOR_HOOKABLE(FilterItem, EV_NO_ARGS);
-       // checks if the current item may be spawned (self.items and self.weapons may be read and written to, as well as the ammo_ fields)
-       // return error to request removal
 
-MUTATOR_HOOKABLE(TurretSpawn, EV_NO_ARGS);
-       // return error to request removal
-       // INPUT: self - turret
+/** return error to request removal */
+#define EV_TurretSpawn(i, o) \
+    /** turret */ i(entity, self) \
+    /**/
+MUTATOR_HOOKABLE(TurretSpawn, EV_TurretSpawn);
 
+/** return error to prevent entity spawn, or modify the entity */
 MUTATOR_HOOKABLE(OnEntityPreSpawn, EV_NO_ARGS);
-       // return error to prevent entity spawn, or modify the entity
 
+/** runs in the event loop for players; is called for ALL player entities, also bots, also the dead, or spectators */
 MUTATOR_HOOKABLE(PlayerPreThink, EV_NO_ARGS);
-       // runs in the event loop for players; is called for ALL player entities, also bots, also the dead, or spectators
 
+/** TODO change this into a general PlayerPostThink hook? */
 MUTATOR_HOOKABLE(GetPressedKeys, EV_NO_ARGS);
-       // TODO change this into a general PlayerPostThink hook?
 
+/**
+ * called before any player physics, may adjust variables for movement,
+ * is run AFTER bot code and idle checking
+ */
 MUTATOR_HOOKABLE(PlayerPhysics, EV_NO_ARGS);
-       // called before any player physics, may adjust variables for movement,
-       // is run AFTER bot code and idle checking
 
-MUTATOR_HOOKABLE(GetCvars, EV_NO_ARGS);
-       // is meant to call GetCvars_handle*(get_cvars_s, get_cvars_f, cvarfield, "cvarname") for cvars this mutator needs from the client
-       // INPUT:
-               float get_cvars_f;
-               string get_cvars_s;
+/** is meant to call GetCvars_handle*(get_cvars_s, get_cvars_f, cvarfield, "cvarname") for cvars this mutator needs from the client */
+#define EV_GetCvars(i, o) \
+    /**/ i(float, get_cvars_f) \
+    /**/ i(string, get_cvars_s) \
+    /**/
+float get_cvars_f;
+string get_cvars_s;
+MUTATOR_HOOKABLE(GetCvars, EV_GetCvars);
 
-MUTATOR_HOOKABLE(EditProjectile, EV_NO_ARGS);
-       // can edit any "just fired" projectile
-       // INPUT:
-//             entity self;
-//             entity other;
+/** can edit any "just fired" projectile */
+#define EV_EditProjectile(i, o) \
+    /**/ i(entity, self) \
+    /**/ i(entity, other) \
+    /**/
+MUTATOR_HOOKABLE(EditProjectile, EV_EditProjectile);
 
+/** called when a monster spawns */
 MUTATOR_HOOKABLE(MonsterSpawn, EV_NO_ARGS);
-       // called when a monster spawns
 
-MUTATOR_HOOKABLE(MonsterDies, EV_NO_ARGS);
-       // called when a monster dies
-       // INPUT:
-//             entity frag_attacker;
+/** called when a monster dies */
+#define EV_MonsterDies(i, o) \
+    /**/ i(entity, frag_attacker) \
+    /**/
+MUTATOR_HOOKABLE(MonsterDies, EV_MonsterDies);
 
 MUTATOR_HOOKABLE(MonsterRespawn, EV_NO_ARGS);
        // called when a monster wants to respawn
index 694ff5d45c7d7ed26166c95f94238cf3c24c0f55..7e843142b39cc595d7dd388fd92cf00a28420b19 100644 (file)
@@ -1271,7 +1271,7 @@ float turret_stdproc_init (string cvar_base_name, string base, string head, floa
         self.health = 150;
 
 // Game hooks
-       if(MUTATOR_CALLHOOK(TurretSpawn))
+       if(MUTATOR_CALLHOOK(TurretSpawn, self))
                return 0;
 
 // End of default & sanety checks, start building the turret.