]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Mario/is_macro
authorMario <zacjardine@y7mail.com>
Fri, 21 Aug 2015 05:54:22 +0000 (15:54 +1000)
committerMario <zacjardine@y7mail.com>
Fri, 21 Aug 2015 05:54:22 +0000 (15:54 +1000)
12 files changed:
1  2 
qcsrc/common/monsters/monster/mage.qc
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/weapons/w_arc.qc
qcsrc/common/weapons/w_shotgun.qc
qcsrc/server/command/cmd.qc
qcsrc/server/g_damage.qc
qcsrc/server/mutators/gamemode_ctf.qc
qcsrc/server/mutators/mutator_buffs.qc
qcsrc/server/mutators/mutator_nades.qc
qcsrc/server/tturrets/system/system_main.qc
qcsrc/server/vehicles/bumblebee.qc
qcsrc/server/vehicles/vehicle.qc

index c531fe0250573e2ed96626a67d2d5e2534c6d883,bbf9ddb1c84422d7c4566d29824a6b05186b9087..13d9d33e42aefb3cc43bbe65ac5ef041abe47fe8
@@@ -67,7 -67,7 +67,7 @@@ float friend_needshelp(entity e
        if(e.frozen)
                return false;
        if(!IS_PLAYER(e))
 -              return ((e.flags & FL_MONSTER) && e.health < e.max_health);
 +              return (IS_MONSTER(e) && e.health < e.max_health);
        if(e.items & IT_INVINCIBLE)
                return false;
  
@@@ -90,7 -90,7 +90,7 @@@ void mage_spike_explode(
  
        self.realowner.mage_spike = world;
  
-       pointparticles(particleeffectnum("explosion_small"), self.origin, '0 0 0', 1);
+       Send_Effect("explosion_small", self.origin, '0 0 0', 1);
        RadiusDamage (self, self.realowner, (autocvar_g_monster_mage_attack_spike_damage), (autocvar_g_monster_mage_attack_spike_damage) * 0.5, (autocvar_g_monster_mage_attack_spike_radius), world, world, 0, DEATH_MONSTER_MAGE, other);
  
        remove (self);
@@@ -232,11 -232,11 +232,11 @@@ void mage_heal(
                                        break;
                        }
  
-                       pointparticles(particleeffectnum(fx), head.origin, '0 0 0', 1);
+                       Send_Effect(fx, head.origin, '0 0 0', 1);
                }
                else
                {
-                       pointparticles(particleeffectnum("healing_fx"), head.origin, '0 0 0', 1);
+                       Send_Effect("healing_fx", head.origin, '0 0 0', 1);
                        head.health = bound(0, head.health + (autocvar_g_monster_mage_heal_allies), head.max_health);
                        if(!(head.spawnflags & MONSTERFLAG_INVINCIBLE))
                                WaypointSprite_UpdateHealth(head.sprite, head.health);
@@@ -254,7 -254,7 +254,7 @@@ void mage_push(
  {
        sound(self, CH_SHOTS, "weapons/tagexp1.wav", 1, ATTEN_NORM);
        RadiusDamage (self, self, (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_radius), world, world, (autocvar_g_monster_mage_attack_push_force), DEATH_MONSTER_MAGE, self.enemy);
-       pointparticles(particleeffectnum("TE_EXPLOSION"), self.origin, '0 0 0', 1);
+       Send_Effect("TE_EXPLOSION", self.origin, '0 0 0', 1);
  
        self.frame = mage_anim_attack;
        self.attack_finished_single = time + (autocvar_g_monster_mage_attack_push_delay);
@@@ -271,7 -271,7 +271,7 @@@ void mage_teleport(
        if(trace_fraction < 1)
                return;
  
-       pointparticles(particleeffectnum("spawn_event_neutral"), self.origin, '0 0 0', 1);
+       Send_Effect("spawn_event_neutral", self.origin, '0 0 0', 1);
        setorigin(self, self.enemy.origin + ((v_forward * -1) * 200));
  
        self.attack_finished_single = time + 0.2;
index 720b9561c23bac8dbe83b542acafcff4a1f48661,8658b437f774f2831eb8d1ba4a9f175ac135ab03..8668fe710122cfd9a40de8f4b641391d8770ad13
@@@ -40,8 -40,7 +40,7 @@@ void monster_dropitem(
  
        e.monster_loot = self.monster_loot;
  
-       other = e;
-       MUTATOR_CALLHOOK(MonsterDropItem);
+       MUTATOR_CALLHOOK(MonsterDropItem, e);
        e = other;
  
        if(e && e.monster_loot)
@@@ -81,7 -80,7 +80,7 @@@ float monster_isvalidtarget (entity tar
        //if(trace_ent != targ)
                //return false;
  
 -      if(targ.vehicle_flags & VHF_ISVEHICLE)
 +      if(IS_VEHICLE(targ))
        if(!((get_monsterinfo(ent.monsterid)).spawnflags & MON_FLAG_RANGED))
                return false; // melee attacks are useless against vehicles
  
        if(IS_SPEC(targ) || IS_OBSERVER(targ))
                return false; // enemy is a spectator
  
 -      if(!(targ.vehicle_flags & VHF_ISVEHICLE))
 +      if(!IS_VEHICLE(targ))
        if(targ.deadflag != DEAD_NO || ent.deadflag != DEAD_NO || targ.health <= 0 || ent.health <= 0)
                return false; // enemy/self is dead
  
        if(targ.monster_owner == ent)
                return false; // don't attack our pet
  
 -      if(!(targ.vehicle_flags & VHF_ISVEHICLE))
 +      if(!IS_VEHICLE(targ))
        if(targ.flags & FL_NOTARGET)
                return false; // enemy can't be targeted
  
@@@ -182,7 -181,7 +181,7 @@@ void MonsterTouch (
                return;
  
        if(self.enemy != other)
 -      if(!(other.flags & FL_MONSTER))
 +      if(!IS_MONSTER(other))
        if(monster_isvalidtarget(other, self))
                self.enemy = other;
  }
@@@ -370,7 -369,7 +369,7 @@@ float Monster_CanRespawn(entity ent
  {
        other = ent;
        if(ent.deadflag == DEAD_DEAD) // don't call when monster isn't dead
-       if(MUTATOR_CALLHOOK(MonsterRespawn))
+       if(MUTATOR_CALLHOOK(MonsterRespawn, ent))
                return true; // enabled by a mutator
  
        if(ent.spawnflags & MONSTERFLAG_NORESPAWN)
@@@ -592,7 -591,7 +591,7 @@@ void monster_CalculateVelocity(entity m
  {
        float current_distance = vlen((('1 0 0' * to.x) + ('0 1 0' * to.y)) - (('1 0 0' * from.x) + ('0 1 0' * from.y))); // for the sake of this check, exclude Z axis
        float initial_height = 0; //min(50, (targ_distance * tanh(20)));
-       float current_height = (initial_height * min(1, (current_distance / self.pass_distance)));
+       float current_height = (initial_height * min(1, self.pass_distance ? (current_distance / self.pass_distance) : 0));
        //print("current_height = ", ftos(current_height), ", initial_height = ", ftos(initial_height), ".\n");
  
        vector targpos;
@@@ -716,11 -715,13 +715,13 @@@ void monster_move(float runspeed, floa
  
        targ = self.goalentity;
  
-       monster_target = targ;
-       monster_speed_run = runspeed;
-       monster_speed_walk = walkspeed;
-       if(MUTATOR_CALLHOOK(MonsterMove) || gameover || self.draggedby != world || (round_handler_IsActive() && !round_handler_IsRoundStarted()) || time < game_starttime || (autocvar_g_campaign && !campaign_bots_may_start) || time < self.spawn_time)
+       if (MUTATOR_CALLHOOK(MonsterMove, runspeed, walkspeed, targ)
+               || gameover
+               || self.draggedby != world
+               || (round_handler_IsActive() && !round_handler_IsRoundStarted())
+               || time < game_starttime
+               || (autocvar_g_campaign && !campaign_bots_may_start)
+               || time < self.spawn_time)
        {
                runspeed = walkspeed = 0;
                if(time >= self.spawn_time)
                return;
        }
  
-       targ = monster_target;
        runspeed = bound(0, monster_speed_run * Monster_SkillModifier(), runspeed * 2); // limit maxspeed to prevent craziness
        walkspeed = bound(0, monster_speed_walk * Monster_SkillModifier(), walkspeed * 2); // limit maxspeed to prevent craziness
  
@@@ -842,7 -842,7 +842,7 @@@ void monster_remove(entity mon
        if(!mon)
                return; // nothing to remove
  
-       pointparticles(particleeffectnum("item_pickup"), mon.origin, '0 0 0', 1);
+       Send_Effect("item_pickup", mon.origin, '0 0 0', 1);
  
        if(mon.weaponentity)
                remove(mon.weaponentity);
@@@ -1039,9 -1039,8 +1039,8 @@@ void monsters_damage (entity inflictor
  
                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 83fff0cdc97173af5a5aea205fac36e2a3b94924,f7b8ac0dc2d4aa7b06730c7b920d1d46657302aa..f07a44a036919851a260324afee0fc2e91db38ea
@@@ -264,7 -264,7 +264,7 @@@ void W_Arc_Beam_Think(void
  
                        if ( WEP_CVAR(arc, overheat_max) > 0 && self.beam_heat >= WEP_CVAR(arc, overheat_max) )
                        {
-                               pointparticles( particleeffectnum("arc_overheat"),
+                               Send_Effect("arc_overheat",
                                        self.beam_start, self.beam_wantdir, 1 );
                                sound(self, CH_WEAPON_A, "weapons/arc_stop.wav", VOL_BASE, ATTN_NORM);
                        }
                new_dir = WarpZone_TransformVelocity(WarpZone_trace_transform, new_dir);
  
                float is_player = (
 -                      trace_ent.classname == "player"
 +                      IS_PLAYER(trace_ent)
                        ||
                        trace_ent.classname == "body"
                        ||
 -                      (trace_ent.flags & FL_MONSTER)
 +                      IS_MONSTER(trace_ent)
                );
  
                if(trace_ent && trace_ent.takedamage && (is_player || WEP_CVAR(arc, beam_nonplayerdamage)))
@@@ -609,10 -609,10 +609,10 @@@ void Arc_Smoke(
        if ( self.arc_overheat > time )
        {
                if ( random() < self.arc_heat_percent )
-                       pointparticles( particleeffectnum("arc_smoke"), smoke_origin, '0 0 0', 1 );
+                       Send_Effect("arc_smoke", smoke_origin, '0 0 0', 1 );
                if ( self.BUTTON_ATCK || self.BUTTON_ATCK2 )
                {
-                       pointparticles( particleeffectnum("arc_overheat_fire"), smoke_origin, w_shotdir, 1 );
+                       Send_Effect("arc_overheat_fire", smoke_origin, w_shotdir, 1 );
                        if ( !self.arc_smoke_sound )
                        {
                                self.arc_smoke_sound = 1;
        {
                if ( random() < (self.arc_beam.beam_heat-WEP_CVAR(arc, overheat_min)) /
                                ( WEP_CVAR(arc, overheat_max)-WEP_CVAR(arc, overheat_min) ) )
-                       pointparticles( particleeffectnum("arc_smoke"), smoke_origin, '0 0 0', 1 );
+                       Send_Effect("arc_smoke", smoke_origin, '0 0 0', 1 );
        }
  
        if (  self.arc_smoke_sound && ( self.arc_overheat <= time ||
index 16195e00a9ecbe7c6b6470a32e588d371a60a940,ad8859e62533b429afc3e7dc737f86f0abc38cf9..95195bd3ac632456e10a394be8c24d0b85f4a27c
@@@ -64,7 -64,7 +64,7 @@@ void W_Shotgun_Attack(float isprimary
        for(sc = 0;sc < WEP_CVAR_PRI(shotgun, bullets);sc = sc + 1)
                fireBullet(w_shotorg, w_shotdir, WEP_CVAR_PRI(shotgun, spread), WEP_CVAR_PRI(shotgun, solidpenetration), WEP_CVAR_PRI(shotgun, damage), WEP_CVAR_PRI(shotgun, force), WEP_SHOTGUN, 0);
  
-       pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg, w_shotdir * 1000, WEP_CVAR_PRI(shotgun, ammo));
+       Send_Effect("shotgun_muzzleflash", w_shotorg, w_shotdir * 1000, WEP_CVAR_PRI(shotgun, ammo));
  
        // casing code
        if(autocvar_g_casings >= 1)
@@@ -125,7 -125,7 +125,7 @@@ void W_Shotgun_Melee_Think(void
                //te_lightning2(world, targpos, self.realowner.origin + self.realowner.view_ofs + v_forward * 5 - v_up * 5);
                //te_customflash(targpos, 40,  2, '1 1 1');
  
 -              is_player = (IS_PLAYER(trace_ent) || trace_ent.classname == "body" || (trace_ent.flags & FL_MONSTER));
 +              is_player = (IS_PLAYER(trace_ent) || trace_ent.classname == "body" || IS_MONSTER(trace_ent));
  
                if((trace_fraction < 1) // if trace is good, apply the damage and remove self
                        && (trace_ent.takedamage == DAMAGE_AIM)
index 113967b2c53c495a8b41f34b31758bbb8f1559bc,cc8e19673a4760e257894d768ced8c11d8aad771..6ce42fa04f28eeab151049a397c2692c2d247f31
@@@ -232,7 -232,7 +232,7 @@@ void ClientCommand_mobedit(float reques
                                WarpZone_TraceLine(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * 100, MOVE_NORMAL, self);
  
                                if(!autocvar_g_monsters_edit) { sprint(self, "Monster property editing is not enabled.\n"); return; }
 -                              if(trace_ent.flags & FL_MONSTER)
 +                              if(IS_MONSTER(trace_ent))
                                {
                                        if(trace_ent.realowner != self) { sprint(self, "That monster does not belong to you.\n"); return; }
                                        switch(argv(1))
@@@ -273,7 -273,7 +273,7 @@@ void ClientCommand_mobkill(float reques
                        makevectors(self.v_angle);
                        WarpZone_TraceLine(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * 100, MOVE_NORMAL, self);
  
 -                      if(trace_ent.flags & FL_MONSTER)
 +                      if(IS_MONSTER(trace_ent))
                        {
                                if(trace_ent.realowner != self)
                                {
@@@ -888,11 -888,6 +888,6 @@@ void SV_ParseClientCommand(string comma
  
        float argc = tokenize_console(command);
  
-       // for the mutator hook system
-       cmd_name = strtolower(argv(0));
-       cmd_argc = argc;
-       cmd_string = command;
        // Guide for working with argc arguments by example:
        // argc:   1    - 2      - 3     - 4
        // argv:   0    - 1      - 2     - 3
                        return;
                }
        }
-       else if(MUTATOR_CALLHOOK(SV_ParseClientCommand))
+       else if(MUTATOR_CALLHOOK(SV_ParseClientCommand, strtolower(argv(0)), argc, command))
        {
                return; // handled by a mutator
        }
diff --combined qcsrc/server/g_damage.qc
index b6f6fc8c7168f06bf8abaf94ede118a22ad08a00,cd6a7000c4f56ac586ad46031d40d8128c526602..441932e115b7b52308277592e020a5ec27ff327e
@@@ -147,10 -147,7 +147,7 @@@ void GiveFrags (entity attacker, entit
        entity oldself;
        oldself = self;
        self = attacker;
-       frag_attacker = attacker;
-       frag_target = targ;
-       frag_score = f;
-       if(MUTATOR_CALLHOOK(GiveFragsForKill))
+       if(MUTATOR_CALLHOOK(GiveFragsForKill, attacker, targ, f))
        {
                f = frag_score;
                self = oldself;
@@@ -557,13 -554,13 +554,13 @@@ void Ice_Think(
  
  void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypoint)
  {
 -      if(!IS_PLAYER(targ) && !(targ.flags & FL_MONSTER)) // only specified entities can be freezed
 +      if(!IS_PLAYER(targ) && !IS_MONSTER(targ)) // only specified entities can be freezed
                return;
  
        if(targ.frozen)
                return;
  
 -      float targ_maxhealth = ((targ.flags & FL_MONSTER) ? targ.max_health : start_health);
 +      float targ_maxhealth = ((IS_MONSTER(targ)) ? targ.max_health : start_health);
  
        targ.frozen = frozen_type;
        targ.revive_progress = ((frozen_type == 3) ? 1 : 0);
@@@ -749,13 -746,7 +746,7 @@@ void Damage (entity targ, entity inflic
                }
  
                // should this be changed at all? If so, in what way?
-               frag_attacker = attacker;
-               frag_target = targ;
-               frag_damage = damage;
-               frag_force = force;
-               frag_deathtype = deathtype;
-               frag_mirrordamage = mirrordamage;
-               MUTATOR_CALLHOOK(PlayerDamage_Calculate);
+               MUTATOR_CALLHOOK(PlayerDamage_Calculate, attacker, targ, deathtype, damage, mirrordamage, force);
                damage = frag_damage;
                mirrordamage = frag_mirrordamage;
                force = frag_force;
                        {
                                Unfreeze(targ);
                                targ.health = autocvar_g_freezetag_revive_falldamage_health;
-                               pointparticles(particleeffectnum("iceorglass"), targ.origin, '0 0 0', 3);
+                               Send_Effect("iceorglass", targ.origin, '0 0 0', 3);
                                Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_REVIVED_FALL, targ.netname);
                                Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_FREEZETAG_REVIVE_SELF);
                        }
  
                if(targ.frozen && deathtype == DEATH_HURTTRIGGER && !autocvar_g_freezetag_frozen_damage_trigger)
                {
-                       pointparticles(particleeffectnum("teleport"), targ.origin, '0 0 0', 1);
+                       Send_Effect("teleport", targ.origin, '0 0 0', 1);
  
                        entity oldself = self;
                        self = targ;
                                self.oldorigin = self.origin;
                                self.prevorigin = self.origin;
  
-                               pointparticles(particleeffectnum("teleport"), self.origin, '0 0 0', 1);
+                               Send_Effect("teleport", self.origin, '0 0 0', 1);
                        }
  
                        self = oldself;
                if(targ != attacker)
                {
                        entity victim;
 -                      if((targ.vehicle_flags & VHF_ISVEHICLE) && targ.owner)
 +                      if(IS_VEHICLE(targ) && targ.owner)
                                victim = targ.owner;
                        else
                                victim = targ;
  
 -                      if(IS_PLAYER(victim) || (victim.turrcaps_flags & TFL_TURRCAPS_ISTURRET) || (victim.flags & FL_MONSTER))
 +                      if(IS_PLAYER(victim) || IS_TURRET(victim) || IS_MONSTER(victim))
                        {
                                if(DIFF_TEAM(victim, attacker) && !victim.frozen)
                                {
index 3861c8b03cdb8b4fa02af36f5f652308f76f5d13,121efd7e37ca91b2b1e6d5e0f29a7da3787eacd2..a03aed99df29cd00bd56a499797ae3115df3d12b
@@@ -454,7 -454,7 +454,7 @@@ void ctf_Handle_Capture(entity flag, en
                PlayerScore_Add(player, SP_CTF_CAPTIME, new_time - old_time);
  
        // effects
-       pointparticles(particleeffectnum(flag.capeffect), flag.origin, '0 0 0', 1);
+       Send_Effect(flag.capeffect, flag.origin, '0 0 0', 1);
        //shockwave_spawn("models/ctf/shockwavetransring.md3", flag.origin - '0 0 15', -0.8, 0, 1);
  
        // other
  void ctf_Handle_Return(entity flag, entity player)
  {
        // messages and sounds
 -      if(player.flags & FL_MONSTER)
 +      if(IS_MONSTER(player))
        {
                Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_ENT_4(flag, INFO_CTF_RETURN_MONSTER_), player.monster_name);
        }
@@@ -608,7 -608,7 +608,7 @@@ void ctf_Handle_Pickup(entity flag, ent
        }
  
        // effects
-       pointparticles(particleeffectnum(flag.toucheffect), player.origin, '0 0 0', 1);
+       Send_Effect(flag.toucheffect, player.origin, '0 0 0', 1);
  
        // waypoints
        if(pickuptype == PICKUP_DROPPED) { WaypointSprite_Kill(flag.wps_flagdropped); }
@@@ -906,7 -906,7 +906,7 @@@ void ctf_FlagTouch(
        if(trace_dphitcontents & (DPCONTENTS_PLAYERCLIP | DPCONTENTS_MONSTERCLIP)) { return; }
  
        entity toucher = other, tmp_entity;
 -      bool is_not_monster = (!(toucher.flags & FL_MONSTER)), num_perteam = 0;
 +      bool is_not_monster = (!IS_MONSTER(toucher)), num_perteam = 0;
  
        // automatically kill the flag and return it if it touched lava/slime/nodrop surfaces
        if(ITEM_TOUCH_NEEDKILL())
  
        // special touch behaviors
        if(toucher.frozen) { return; }
 -      else if(toucher.vehicle_flags & VHF_ISVEHICLE)
 +      else if(IS_VEHICLE(toucher))
        {
                if(autocvar_g_ctf_allow_vehicle_touch && toucher.owner)
                        toucher = toucher.owner; // the player is actually the vehicle owner, not other
                else
                        return; // do nothing
        }
 -      else if(toucher.flags & FL_MONSTER)
 +      else if(IS_MONSTER(toucher))
        {
                if(!autocvar_g_ctf_allow_monster_touch)
                        return; // do nothing
        {
                if(time > self.wait) // if we haven't in a while, play a sound/effect
                {
-                       pointparticles(particleeffectnum(self.toucheffect), self.origin, '0 0 0', 1);
+                       Send_Effect(self.toucheffect, self.origin, '0 0 0', 1);
                        sound(self, CH_TRIGGER, self.snd_flag_touch, VOL_BASE, ATTEN_NORM);
                        self.wait = time + FLAG_TOUCHRATE;
                }
index b46c4de9ea17418f78514b2cb2de85d9c50f848f,81be9a03cdccfc4096f821e8a78fc32d89679169..f5e3fa8bdceab5e0869cc97fb8bafd632464e4f5
@@@ -67,7 -67,7 +67,7 @@@ void buff_Effect(entity player, string 
  
        if(time >= self.buff_effect_delay)
        {
-               pointparticles(particleeffectnum(eff), player.origin + ((player.mins + player.maxs) * 0.5), '0 0 0', 1);
+               Send_Effect(eff, player.origin + ((player.mins + player.maxs) * 0.5), '0 0 0', 1);
                self.buff_effect_delay = time + 0.05; // prevent spam
        }
  }
@@@ -131,8 -131,8 +131,8 @@@ void buff_Respawn(entity ent
        if(autocvar_g_buffs_random_lifetime > 0)
                ent.lifetime = time + autocvar_g_buffs_random_lifetime;
  
-       pointparticles(particleeffectnum("electro_combo"), oldbufforigin + ((ent.mins + ent.maxs) * 0.5), '0 0 0', 1);
-       pointparticles(particleeffectnum("electro_combo"), CENTER_OR_VIEWOFS(ent), '0 0 0', 1);
+       Send_Effect("electro_combo", oldbufforigin + ((ent.mins + ent.maxs) * 0.5), '0 0 0', 1);
+       Send_Effect("electro_combo", CENTER_OR_VIEWOFS(ent), '0 0 0', 1);
  
        WaypointSprite_Ping(ent.buff_waypoint);
  
@@@ -181,7 -181,7 +181,7 @@@ void buff_Touch(
        Send_Notification(NOTIF_ONE, other, MSG_MULTI, ITEM_BUFF_GOT, buffid);
        Send_Notification(NOTIF_ALL_EXCEPT, other, MSG_INFO, INFO_ITEM_BUFF, other.netname, buffid);
  
-       pointparticles(particleeffectnum("item_pickup"), CENTER_OR_VIEWOFS(self), '0 0 0', 1);
+       Send_Effect("item_pickup", CENTER_OR_VIEWOFS(self), '0 0 0', 1);
        sound(other, CH_TRIGGER, "misc/shield_respawn.wav", VOL_BASE, ATTN_NORM);
        other.buffs |= (self.buffs);
  }
@@@ -263,7 -263,7 +263,7 @@@ void buff_Think(
                {
                        self.buff_active = true;
                        sound(self, CH_TRIGGER, "misc/strength_respawn.wav", VOL_BASE, ATTN_NORM);
-                       pointparticles(particleeffectnum("item_respawn"), CENTER_OR_VIEWOFS(self), '0 0 0', 1);
+                       Send_Effect("item_respawn", CENTER_OR_VIEWOFS(self), '0 0 0', 1);
                }
        }
  
@@@ -496,7 -496,7 +496,7 @@@ MUTATOR_HOOKFUNCTION(buffs_PlayerDamage
        if(DEATH_WEAPONOF(frag_deathtype) != WEP_ARC)
        if(!ITEM_DAMAGE_NEEDKILL(frag_deathtype))
        if(frag_target.deadflag == DEAD_NO)
 -      if(IS_PLAYER(frag_target) || (frag_target.flags & FL_MONSTER))
 +      if(IS_PLAYER(frag_target) || IS_MONSTER(frag_target))
        if(frag_attacker != frag_target)
        if(!frag_target.frozen)
        if(frag_target.takedamage)
@@@ -629,7 -629,7 +629,7 @@@ MUTATOR_HOOKFUNCTION(buffs_PlayerThrowK
                        if(closest.flagcarried) { ctf_Handle_Throw(closest, world, DROP_THROW); }
                        if(closest.nade) { toss_nade(closest, '0 0 0', time + 0.05); }
  
-                       MUTATOR_CALLHOOK(PortalTeleport); // initiate flag dropper
+                       MUTATOR_CALLHOOK(PortalTeleport, self); // initiate flag dropper
  
                        setorigin(self, their_org);
                        setorigin(closest, my_org);
                        closest.pushltime = time + autocvar_g_maxpushtime;
                        closest.istypefrag = closest.BUTTON_CHAT;
  
-                       pointparticles(particleeffectnum("electro_combo"), their_org, '0 0 0', 1);
-                       pointparticles(particleeffectnum("electro_combo"), my_org, '0 0 0', 1);
+                       Send_Effect("electro_combo", their_org, '0 0 0', 1);
+                       Send_Effect("electro_combo", my_org, '0 0 0', 1);
  
                        sound(self, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTEN_NORM);
                        sound(closest, CH_TRIGGER, "keepaway/respawn.wav", VOL_BASE, ATTEN_NORM);
@@@ -739,7 -739,7 +739,7 @@@ MUTATOR_HOOKFUNCTION(buffs_PlayerThink
        if(time < self.buff_disability_time)
        if(time >= self.buff_disability_effect_time)
        {
-               pointparticles(particleeffectnum("smoking"), self.origin + ((self.mins + self.maxs) * 0.5), '0 0 0', 1);
+               Send_Effect("smoking", self.origin + ((self.mins + self.maxs) * 0.5), '0 0 0', 1);
                self.buff_disability_effect_time = time + 0.5;
        }
  
index 585cab8368e0d09b82b6e4ac2270c5933b81f11b,82cb70fc5970b2acfe2f95b2ceda6202b7b47c8e..48dcf10832e32563551cbec2a1631dd401ecd27c
@@@ -78,7 -78,7 +78,7 @@@ void napalm_damage(float dist, float da
                d = damage + (edgedamage - damage) * (d / dist);
                Fire_AddDamage(RandomSelection_chosen_ent, self.realowner, d * burntime, burntime, self.projectiledeathtype | HITTYPE_BOUNCE);
                //trailparticles(self, particleeffectnum("fireball_laser"), self.origin, RandomSelection_chosen_ent.fireball_impactvec);
-               pointparticles(particleeffectnum("fireball_laser"), self.origin, RandomSelection_chosen_ent.fireball_impactvec - self.origin, 1);
+               Send_Effect("fireball_laser", self.origin, RandomSelection_chosen_ent.fireball_impactvec - self.origin, 1);
        }
  }
  
@@@ -225,7 -225,7 +225,7 @@@ void nade_napalm_boom(
  void nade_ice_freeze(entity freezefield, entity frost_target, float freeze_time)
  {
        frost_target.frozen_by = freezefield.realowner;
-       pointparticles(particleeffectnum("electro_impact"), frost_target.origin, '0 0 0', 1);
+       Send_Effect("electro_impact", frost_target.origin, '0 0 0', 1);
        Freeze(frost_target, 1/freeze_time, 3, false);
        if(frost_target.ballcarried)
        if(g_keepaway) { ka_DropEvent(frost_target); }
@@@ -259,7 -259,7 +259,7 @@@ void nade_ice_think(
                                case NUM_TEAM_4: expef = "nade_pink_explode"; break;
                                default:                 expef = "nade_neutral_explode"; break;
                        }
-                       pointparticles(particleeffectnum(expef), self.origin + '0 0 1', '0 0 0', 1);
+                       Send_Effect(expef, self.origin + '0 0 1', '0 0 0', 1);
                        sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
  
                        RadiusDamage(self, self.realowner, autocvar_g_nades_nade_damage, autocvar_g_nades_nade_edgedamage,
        randomp.x = randomr*cos(randomw);
        randomp.y = randomr*sin(randomw);
        randomp.z = 1;
-       pointparticles(particleeffectnum("electro_muzzleflash"), self.origin + randomp, '0 0 0', 1);
+       Send_Effect("electro_muzzleflash", self.origin + randomp, '0 0 0', 1);
  
        if(time >= self.nade_special_time)
        {
                self.nade_special_time = time+0.7;
  
  
-               pointparticles(particleeffectnum("electro_impact"), self.origin, '0 0 0', 1);
-               pointparticles(particleeffectnum("icefield"), self.origin, '0 0 0', 1);
+               Send_Effect("electro_impact", self.origin, '0 0 0', 1);
+               Send_Effect("icefield", self.origin, '0 0 0', 1);
        }
  
  
@@@ -360,11 -360,7 +360,7 @@@ void nade_translocate_boom(
  
        makevectors(self.realowner.angles);
  
-       entity oldself = self;
-       self = self.realowner;
-       MUTATOR_CALLHOOK(PortalTeleport);
-       self.realowner = self;
-       self = oldself;
+       MUTATOR_CALLHOOK(PortalTeleport, self.realowner);
  
        TeleportPlayer(self, self.realowner, locout, self.realowner.angles, v_forward * vlen(self.realowner.velocity), '0 0 0', '0 0 0', TELEPORT_FLAGS_TELEPORTER);
  }
@@@ -412,7 -408,7 +408,7 @@@ void nade_heal_touch(
  {
        float maxhealth;
        float health_factor;
 -      if(IS_PLAYER(other) || (other.flags & FL_MONSTER))
 +      if(IS_PLAYER(other) || IS_MONSTER(other))
        if(other.deadflag == DEAD_NO)
        if(!other.frozen)
        {
                }
                if ( health_factor > 0 )
                {
 -                      maxhealth = (other.flags & FL_MONSTER) ? other.max_health : g_pickup_healthmega_max;
 +                      maxhealth = (IS_MONSTER(other)) ? other.max_health : g_pickup_healthmega_max;
                        if ( other.health < maxhealth )
                        {
                                if ( self.nade_show_particles )
-                                       pointparticles(particleeffectnum("healing_fx"), other.origin, '0 0 0', 1);
+                                       Send_Effect("healing_fx", other.origin, '0 0 0', 1);
                                other.health = min(other.health+health_factor, maxhealth);
                        }
                        other.pauserothealth_finished = max(other.pauserothealth_finished, time + autocvar_g_balance_pause_health_rot);
  
        }
  
 -      if ( IS_REAL_CLIENT(other) || (other.vehicle_flags & VHF_ISVEHICLE) )
 +      if ( IS_REAL_CLIENT(other) || IS_VEHICLE(other) )
        {
 -              entity show_red = (other.vehicle_flags & VHF_ISVEHICLE) ? other.owner : other;
 +              entity show_red = (IS_VEHICLE(other)) ? other.owner : other;
                show_red.stat_healing_orb = time+0.1;
                show_red.stat_healing_orb_alpha = 0.75 * (self.ltime - time) / self.healer_lifetime;
        }
@@@ -534,7 -530,7 +530,7 @@@ void nade_boom(
        }
  
        if(expef != "")
-               pointparticles(particleeffectnum(expef), findbetterlocation(self.origin, 8), '0 0 0', 1);
+               Send_Effect(expef, findbetterlocation(self.origin, 8), '0 0 0', 1);
  
        sound(self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTEN_NORM);
        sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
@@@ -1124,7 -1120,7 +1120,7 @@@ MUTATOR_HOOKFUNCTION(nades_PlayerDamage
        {
                Unfreeze(frag_target);
                frag_target.health = autocvar_g_freezetag_revive_nade_health;
-               pointparticles(particleeffectnum("iceorglass"), frag_target.origin, '0 0 0', 3);
+               Send_Effect("iceorglass", frag_target.origin, '0 0 0', 3);
                frag_damage = 0;
                frag_force = '0 0 0';
                Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_REVIVED_NADE, frag_target.netname);
index 1862bcb1d80eb7df79f818fb6e3a8b35853e7c2a,7e843142b39cc595d7dd388fd92cf00a28420b19..deee89542b80df7557048b29661834726576ed31
@@@ -601,7 -601,7 +601,7 @@@ float turret_validate_target(entity e_t
          return -5;
  
      // Cant touch this
 -    if(e_target.vehicle_flags & VHF_ISVEHICLE)
 +    if(IS_VEHICLE(e_target))
      {
          if (e_target.vehicle_health <= 0)
              return -6;
@@@ -1001,7 -1001,7 +1001,7 @@@ void turrets_manager_think(
          e = nextent(world);
          while (e)
          {
 -            if (e.turrcaps_flags & TFL_TURRCAPS_ISTURRET)
 +            if(IS_TURRET(e))
              {
                  load_unit_settings(e,e.cvar_basename,1);
                  if(e.turret_postthink)
@@@ -1271,7 -1271,7 +1271,7 @@@ float turret_stdproc_init (string cvar_
          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.
index 956b2443e7e847159bffe977475581de2c2bb7c6,ba9378a269961072ac9b9cd3aa3588bee783b049..72d87b344c48254fcf8a62149ae30cadea377ff7
@@@ -162,11 -162,7 +162,7 @@@ void bumb_gunner_exit(float _exitflag
        self.hud            = HUD_NORMAL;
        self.switchweapon   = self.vehicle.switchweapon;
  
-     vh_player = self;
-     vh_vehicle = self.vehicle;
-     MUTATOR_CALLHOOK(VehicleExit);
-     self = vh_player;
-     self.vehicle = vh_vehicle;
+     MUTATOR_CALLHOOK(VehicleExit, self, self.vehicle);
  
        self.vehicle.vehicle_hudmodel.viewmodelforclient = self.vehicle;
  
@@@ -250,11 -246,7 +246,7 @@@ float bumb_gunner_enter(
  
        CSQCVehicleSetup(other, other.hud);
  
-     vh_player = other;
-     vh_vehicle = _gun;
-     MUTATOR_CALLHOOK(VehicleEnter);
-     other = vh_player;
-     _gun = vh_vehicle;
+     MUTATOR_CALLHOOK(VehicleEnter, other, _gun);
  
        return true;
  }
@@@ -474,7 -466,7 +466,7 @@@ float bumb_pilot_frame(
                                        if((teamplay && trace_ent.team == pilot.team) || !teamplay)
                                        {
  
 -                                              if(trace_ent.vehicle_flags & VHF_ISVEHICLE)
 +                                              if(IS_VEHICLE(trace_ent))
                                                {
                                                        if(autocvar_g_vehicle_bumblebee_healgun_sps && trace_ent.vehicle_health <= trace_ent.tur_health)
                                                                trace_ent.vehicle_shield = min(trace_ent.vehicle_shield + autocvar_g_vehicle_bumblebee_healgun_sps * frametime, trace_ent.tur_head.tur_health);
  
                                                        trace_ent.health = min(trace_ent.health + autocvar_g_vehicle_bumblebee_healgun_hps * frametime, autocvar_g_vehicle_bumblebee_healgun_hmax);
                                                }
 -                                              else if(trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET)
 +                                              else if(IS_TURRET(trace_ent))
                                                {
                                                        if(trace_ent.health  <= trace_ent.tur_health && autocvar_g_vehicle_bumblebee_healgun_hps)
                                                                trace_ent.health = min(trace_ent.health + autocvar_g_vehicle_bumblebee_healgun_hps * frametime, trace_ent.tur_health);
@@@ -630,7 -622,7 +622,7 @@@ void bumb_blowup(
                                 DEATH_VH_BUMB_DEATH, world);
  
        sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
-       pointparticles(particleeffectnum("explosion_large"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
+       Send_Effect("explosion_large", randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
  
        if(self.owner.deadflag == DEAD_DYING)
                self.owner.deadflag = DEAD_DEAD;
@@@ -646,7 -638,7 +638,7 @@@ void bumb_diethink(
        if(random() < 0.1)
        {
                sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
-               pointparticles(particleeffectnum("explosion_small"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
+               Send_Effect("explosion_small", randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
        }
  
        self.nextthink = time + 0.1;
@@@ -694,7 -686,7 +686,7 @@@ void bumb_die(
        _body.owner = self;
        _body.enemy = self.enemy;
  
-       pointparticles(particleeffectnum("explosion_medium"), findbetterlocation(self.origin, 16), '0 0 0', 1);
+       Send_Effect("explosion_medium", findbetterlocation(self.origin, 16), '0 0 0', 1);
  
        self.health                     = 0;
        self.event_damage       = func_null;
index b6bbae8ae4372da94044fe7fef298044cb5d6c56,5ce1e43a9f16dc123c8aad11ea869a91b0a3423a..4f6654a934593090f05f0dfeafd419275994df6e
@@@ -164,7 -164,7 +164,7 @@@ void targetdrone_damage(entity inflicto
        self.health -= damage;
        if(self.health <= 0)
        {
-               pointparticles(particleeffectnum("explosion_medium"), self.origin, '0 0 0', 1);
+               Send_Effect("explosion_medium", self.origin, '0 0 0', 1);
  
                if(!self.cnt)
                        remove(self);
@@@ -267,8 -267,8 +267,8 @@@ void vehicles_locktarget(float incr, fl
          if(trace_ent.deadflag != DEAD_NO)
              trace_ent = world;
          if(!(
 -            (trace_ent.vehicle_flags & VHF_ISVEHICLE) || 
 -            (trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET) || 
 +            IS_VEHICLE(trace_ent) || 
 +            IS_TURRET(trace_ent) || 
              (trace_ent.takedamage == DAMAGE_TARGETDRONE)
              )) { trace_ent = world; }
      }
@@@ -434,7 -434,7 +434,7 @@@ entity vehicles_projectile(string _mzlf
          sound (self, CH_WEAPON_A, _mzlsound, VOL_BASE, ATTEN_NORM);
  
      if(_mzlfx)
-         pointparticles(particleeffectnum(_mzlfx), proj.origin, proj.velocity, 1);
+         Send_Effect(_mzlfx, proj.origin, proj.velocity, 1);
  
  
      setsize (proj, '-1 -1 -1' * _size, '1 1 1' * _size);
@@@ -505,7 -505,7 +505,7 @@@ void vehicles_spawn(
      self.angles             = self.pos2;
      setorigin(self, self.pos1 + '0 0 0');
      // Show it
-     pointparticles(particleeffectnum("teleport"), self.origin + '0 0 64', '0 0 0', 1);
+     Send_Effect("teleport", self.origin + '0 0 64', '0 0 0', 1);
  
      if(self.vehicle_controller)
          self.team = self.vehicle_controller.team;
@@@ -520,7 -520,7 +520,7 @@@ float vehicles_crushable(entity e
      if(IS_PLAYER(e))
          return true;
  
 -    if(e.flags & FL_MONSTER)
 +    if(IS_MONSTER(e))
          return true;
  
      return false;
@@@ -550,7 -550,7 +550,7 @@@ void vehicles_impact(float _minspeed, f
  
  void vehicles_touch()
  {
-       if(MUTATOR_CALLHOOK(VehicleTouch))
+       if(MUTATOR_CALLHOOK(VehicleTouch, self, other))
                return;
  
      // Vehicle currently in use
@@@ -683,11 -683,7 +683,7 @@@ void vehicles_enter(
  
      CSQCVehicleSetup(self.owner, self.hud);
  
-     vh_player = other;
-     vh_vehicle = self;
-     MUTATOR_CALLHOOK(VehicleEnter);
-     other = vh_player;
-     self = vh_vehicle;
+     MUTATOR_CALLHOOK(VehicleEnter, other, self);
  
      self.vehicle_enter();
      antilag_clear(other);
@@@ -823,11 -819,7 +819,7 @@@ void vehicles_exit(float eject
      if(!teamplay)
          _vehicle.team = 0;
  
-     vh_player = _player;
-     vh_vehicle = _vehicle;
-     MUTATOR_CALLHOOK(VehicleExit);
-     _player = vh_player;
-     _vehicle = vh_vehicle;
+     MUTATOR_CALLHOOK(VehicleExit, _player, _vehicle);
  
      _vehicle.team = _vehicle.tur_head.team;
  
@@@ -885,7 -877,7 +877,7 @@@ void vehicles_painframe(
          float _ftmp;
          _ftmp = self.owner.vehicle_health / 50;
          self.pain_frame = time + 0.1 + (random() * 0.5 * _ftmp);
-         pointparticles(particleeffectnum("smoke_small"), (self.origin + (randomvec() * 80)), '0 0 0', 1);
+         Send_Effect("smoke_small", (self.origin + (randomvec() * 80)), '0 0 0', 1);
  
          if(self.vehicle_flags & VHF_DMGSHAKE)
              self.velocity += randomvec() * 30;
@@@ -1011,7 -1003,7 +1003,7 @@@ void vehicles_clearreturn(
  
  void vehicles_return()
  {
-     pointparticles(particleeffectnum("teleport"), self.wp00.origin + '0 0 64', '0 0 0', 1);
+     Send_Effect("teleport", self.wp00.origin + '0 0 64', '0 0 0', 1);
  
      self.wp00.think     = vehicles_spawn;
      self.wp00.nextthink = time;
@@@ -1367,7 -1359,7 +1359,7 @@@ vector vehicle_aimturret(entity _vehic
  void vehicles_gib_explode()
  {
        sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
-       pointparticles(particleeffectnum("explosion_small"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
+       Send_Effect("explosion_small", randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
        remove(self);
  }