]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Mario/entrap_nade
authorMario <mario@smbclan.net>
Sun, 12 Jun 2016 18:19:25 +0000 (04:19 +1000)
committerMario <mario@smbclan.net>
Sun, 12 Jun 2016 18:19:25 +0000 (04:19 +1000)
71 files changed:
qcsrc/client/shownames.qc
qcsrc/common/ent_cs.qc
qcsrc/common/gamemodes/gamemode/nexball/nexball.qc
qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/mutators/mutator/buffs/buffs.qc
qcsrc/common/mutators/mutator/instagib/instagib.qc
qcsrc/common/mutators/mutator/overkill/overkill.qc
qcsrc/common/mutators/mutator/overkill/rpc.qc
qcsrc/common/mutators/mutator/physical_items/physical_items.qc
qcsrc/common/physics/movelib.qc
qcsrc/common/physics/movetypes/movetypes.qc
qcsrc/common/physics/movetypes/push.qc
qcsrc/common/t_items.qc
qcsrc/common/triggers/func/breakable.qc
qcsrc/common/triggers/func/conveyor.qc
qcsrc/common/triggers/func/vectormamamam.qc
qcsrc/common/triggers/misc/teleport_dest.qc
qcsrc/common/triggers/platforms.qc
qcsrc/common/triggers/subs.qc
qcsrc/common/triggers/target/spawn.qc
qcsrc/common/triggers/teleporters.qc
qcsrc/common/triggers/trigger/gamestart.qc
qcsrc/common/triggers/trigger/multi.qc
qcsrc/common/turrets/checkpoint.qc
qcsrc/common/turrets/turret/flac_weapon.qc
qcsrc/common/turrets/turret/tesla_weapon.qc
qcsrc/common/turrets/util.qc
qcsrc/common/util.qc
qcsrc/common/vehicles/vehicle/bumblebee.qc
qcsrc/common/vehicles/vehicle/racer.qc
qcsrc/common/vehicles/vehicle/raptor.qc
qcsrc/common/weapons/all.qh
qcsrc/common/weapons/weapon/arc.qc
qcsrc/common/weapons/weapon/blaster.qc
qcsrc/common/weapons/weapon/crylink.qc
qcsrc/common/weapons/weapon/devastator.qc
qcsrc/common/weapons/weapon/shockwave.qc
qcsrc/dpdefs/post.qh
qcsrc/dpdefs/pre.qh
qcsrc/lib/_all.inc
qcsrc/lib/csqcmodel/sv_model.qc
qcsrc/lib/macro.qh
qcsrc/lib/net.qh
qcsrc/lib/oo.qh
qcsrc/lib/self.qh
qcsrc/lib/spawnfunc.qh
qcsrc/lib/warpzone/client.qc
qcsrc/lib/warpzone/common.qc
qcsrc/lib/warpzone/server.qc
qcsrc/server/bot/havocbot/havocbot.qc
qcsrc/server/bot/navigation.qc
qcsrc/server/bot/waypoints.qc
qcsrc/server/cheats.qc
qcsrc/server/cl_client.qc
qcsrc/server/command/vote.qc
qcsrc/server/g_damage.qc
qcsrc/server/g_hook.qc
qcsrc/server/g_lights.qc
qcsrc/server/g_subs.qc
qcsrc/server/g_world.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/mutator/gamemode_ctf.qc
qcsrc/server/mutators/mutator/gamemode_tdm.qc
qcsrc/server/pathlib/debug.qc
qcsrc/server/pathlib/main.qc
qcsrc/server/pathlib/movenode.qc
qcsrc/server/steerlib.qc
qcsrc/server/sv_main.qc
qcsrc/server/weapons/csqcprojectile.qc
qcsrc/server/weapons/tracing.qc

index e9db990c82d474a07e06ee358dd9f0a99313ece1..6700ba61c7b87cadfee0438093ffdf46a2d5ee7e 100644 (file)
@@ -177,7 +177,7 @@ void Draw_ShowNames_All()
                }
                make_impure(it);
                assert(getthink(entcs), eprint(entcs));
-               WITHSELF(entcs, getthink(entcs)(entcs));
+               getthink(entcs)(entcs);
                if (!entcs.has_origin) continue;
                if (entcs.m_entcs_private)
                {
index 75deb92eaf8a5c448a69c7754ade78af4b82cfd7..cafef4868b540cd274de8d2f253fd113a6d43623 100644 (file)
        #undef X
                this.iflags |= IFLAG_ORIGIN;
                InterpolateOrigin_Note(this);
-               WITHSELF(this, getthink(this)(this));
+               getthink(this)(this);
                return true;
        }
 
index 2a431c721d47bd6171609e98ce13036bd2ebdc8e..1c0fdaa9839b2bbce3c98d341f5529a5bd84c6cf 100644 (file)
@@ -109,7 +109,7 @@ void nexball_setstatus(entity this)
                        bprint("The ", Team_ColoredFullName(this.team), " held the ball for too long.\n");
                        DropBall(this.ballcarried, this.ballcarried.owner.origin, '0 0 0');
                        entity e = this.ballcarried;
-                       WITHSELF(e, ResetBall(e));
+                       ResetBall(e);
                }
                else
                        this.items |= IT_KEY1;
@@ -278,7 +278,7 @@ void ResetBall(entity this)
        else     // step 4
        {
 //             dprint("Step 4: time: ", ftos(time), "\n");
-               if(vlen(this.origin - this.spawnorigin) > 10)  // should not happen anymore
+               if(vdist(this.origin - this.spawnorigin, >, 10)) // should not happen anymore
                        LOG_TRACE("The ball moved too far away from its spawn origin.\nOffset: ",
                                   vtos(this.origin - this.spawnorigin), " Velocity: ", vtos(this.velocity), "\n");
                this.velocity = '0 0 0';
@@ -314,7 +314,7 @@ void football_touch(entity this)
 
        if(autocvar_g_nexball_football_physics == -1)   // MrBougo try 1, before decompiling Rev's original
        {
-               if(vlen(other.velocity))
+               if(other.velocity)
                        this.velocity = other.velocity * 1.5 + '0 0 1' * autocvar_g_nexball_football_boost_up;
        }
        else if(autocvar_g_nexball_football_physics == 1)         // MrBougo's modded Rev style: partially independant of the height of the aiming point
@@ -352,7 +352,7 @@ void basketball_touch(entity this)
        else if(other.solid == SOLID_BSP)
        {
                _sound(this, CH_TRIGGER, this.noise, VOL_BASE, ATTEN_NORM);
-               if(vlen(this.velocity) && !this.cnt)
+               if(this.velocity && !this.cnt)
                        this.nextthink = min(time + autocvar_g_nexball_delay_idle, this.teamtime);
        }
 }
index a5ad94e2055fe9d4cf197451778c9853bb99619e..0b99ee022706c10f0baf38ed5f7b0bd9a06afca1 100644 (file)
@@ -1322,7 +1322,7 @@ void havocbot_goalrating_ons_offenseitems(entity this, float ratingscale, vector
                // gather health and armor only
                if (head.solid)
                if ( ((head.health || head.armorvalue) && needarmor) || (head.weapons && needweapons ) )
-               if (vlen(head.origin - org) < sradius)
+               if (vdist(head.origin - org, <, sradius))
                {
                        t = head.bot_pickupevalfunc(this, head);
                        if (t > 0)
@@ -1825,7 +1825,7 @@ MUTATOR_HOOKFUNCTION(ons, PlayerSpawn)
                        if(SAME_TEAM(tmp_entity, player))
                        if(random_target)
                                RandomSelection_Add(tmp_entity, 0, string_null, 1, 1);
-                       else if(vlen(tmp_entity.origin - spawn_loc) <= vlen(closest_target.origin - spawn_loc) || closest_target == world)
+                       else if(vlen2(tmp_entity.origin - spawn_loc) <= vlen2(closest_target.origin - spawn_loc) || closest_target == world)
                                closest_target = tmp_entity;
                }
 
@@ -1875,7 +1875,7 @@ MUTATOR_HOOKFUNCTION(ons, PlayerSpawn)
                        else
                        {
                                if(SAME_TEAM(tmp_entity, player))
-                               if(vlen(tmp_entity.origin - spawn_loc) <= vlen(closest_target.origin - spawn_loc) || closest_target == world)
+                               if(vlen2(tmp_entity.origin - spawn_loc) <= vlen2(closest_target.origin - spawn_loc) || closest_target == world)
                                        closest_target = tmp_entity;
                        }
                }
index 1ae7e83a914f83d21b628a482ce38c8866e5a8dc..945a1de35ec341ee01004535d28969aab3407f0d 100644 (file)
@@ -48,7 +48,7 @@ void monster_dropitem(entity this, entity attacker)
        if(e && e.monster_loot)
        {
                e.noalign = true;
-               WITHSELF(e, e.monster_loot(e));
+               e.monster_loot(e);
                e.gravity = 1;
                e.movetype = MOVETYPE_TOSS;
                e.reset = SUB_Remove;
index cd72bb46b6a7a541eacdde03af3ef874b36e2c6f..15aa8eeb13d617e7560858e86db1b5eb75996660 100644 (file)
@@ -907,7 +907,7 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerPreThink)
                                {
                                        entity oldother = other;
                                        other = player;
-                                       WITHSELF(it, gettouch(it)(it));
+                                       gettouch(it)(it);
                                        other = oldother;
                                }
                        }
index 89bbf5fae017d1fd176283b1e131ee1c3983d386..dc871d694a80e85450e035c678e281b7fbe7a217 100644 (file)
@@ -389,7 +389,7 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, FilterItem)
         e.cnt = item.cnt;
         e.team = item.team;
         e.spawnfunc_checked = true;
-               WITHSELF(e, spawnfunc_item_minst_cells(e));
+               spawnfunc_item_minst_cells(e);
                return true;
        }
 
index 323286bbe947f43dc450e3ed366b3082e253d50e..2fb75b3f8d9696b8ce644748f5f837d0e19a89f5 100644 (file)
@@ -128,7 +128,7 @@ void ok_DropItem(entity this, entity targ)
        e.noalign = true;
        e.pickup_anyway = true;
        e.spawnfunc_checked = true;
-       WITHSELF(e, spawnfunc_item_armor_small(e));
+       spawnfunc_item_armor_small(e);
        if (!wasfreed(e)) { // might have been blocked by a mutator
         e.movetype = MOVETYPE_TOSS;
         e.gravity = 1;
index 3fc2683c89e15480e8ae568af24776d825a5b231..c8b964c37275113969d3e077eb53a93b2201a761 100644 (file)
@@ -129,7 +129,7 @@ void W_RocketPropelledChainsaw_Attack (Weapon thiswep, entity actor)
        missile.projectiledeathtype = WEP_RPC.m_id;
        setsize (missile, '-3 -3 -3', '3 3 3'); // give it some size so it can be shot
 
-       setorigin (missile, w_shotorg - v_forward * 3); // move it back so it hits the wall at the right point
+       setorigin(missile, w_shotorg - v_forward * 3); // move it back so it hits the wall at the right point
        W_SetupProjVelocity_Basic(missile, WEP_CVAR(rpc, speed), 0);
 
        settouch(missile, W_RocketPropelledChainsaw_Touch);
index fed70ef7d11a30feafe6ae3e866c9e9cfcf20b5a..7bd1687af597676b8a90e7d980218be984a36753 100644 (file)
@@ -136,6 +136,6 @@ MUTATOR_HOOKFUNCTION(physical_items, Item_Spawn)
        item.effects |= EF_NODRAW; // hide the original weapon
        item.movetype = MOVETYPE_FOLLOW;
        item.aiment = wep; // attach the original weapon
-       item.SendEntity3 = func_null;
+       setSendEntity(item, func_null);
 }
 #endif
index cfdcbfd14700262db5e3911b95c83107e4427c45..e66e3c9a9ce58f19b447a714f6bcd3bdcc7bd3c6 100644 (file)
@@ -232,6 +232,6 @@ void movelib_groundalign4point(entity this, float spring_length, float spring_up
     this.angles_z = ((1-blendrate) *  this.angles.z)  + (push_angle.z * blendrate);
 
     //a = this.origin;
-    setorigin(this,r);
+    setorigin(this, r);
 }
 
index ce7d04d1da29975b09c1c7db9cd9c8a92e746163..06ccde2a57fc3db941ef6c61ed3f95a8b5b0d0f6 100644 (file)
@@ -321,7 +321,7 @@ void _Movetype_Impact(entity this, entity oth)  // SV_Impact
        {
                other = oth;
 
-               WITHSELF(this, gettouch(this)(this));
+               gettouch(this)(this);
 
                other = oldother;
        }
@@ -330,7 +330,7 @@ void _Movetype_Impact(entity this, entity oth)  // SV_Impact
        {
                other = this;
 
-               WITHSELF(oth, gettouch(oth)(oth));
+               gettouch(oth)(oth);
 
                other = oldother;
        }
@@ -360,7 +360,7 @@ void _Movetype_LinkEdict_TouchAreaGrid(entity this)  // SV_LinkEdict_TouchAreaGr
                        trace_plane_dist = 0;
                        trace_ent = this;
 
-                       WITHSELF(it, gettouch(it)(it));
+                       gettouch(it)(it);
                }
     });
 
index 276b10476fff83e05b75b625ed4f0d73a46f6117..29ce131064c8183a813b53e5c39710b836c9ec69 100644 (file)
@@ -149,6 +149,6 @@ void _Movetype_Physics_Pusher(entity this, float dt)  // SV_Physics_Pusher
                this.move_nextthink = 0;
                this.move_time = time;
                other = world;
-               WITHSELF(this, this.move_think(this));
+               this.move_think(this);
        }
 }
index 0829464d22fb763e0d93b1146f11bb8fbb84c467..03fdba42a8c741edd682c64b5f377744be9b68ab 100644 (file)
@@ -356,7 +356,7 @@ void ItemUpdate(entity this)
 
 void UpdateItemAfterTeleport(entity this)
 {
-       if(this.SendEntity3 == ItemSend)
+       if(getSendEntity(this) == ItemSend)
                ItemUpdate(this);
 }
 
@@ -494,7 +494,7 @@ void Item_Respawn (entity this)
                sound (this, CH_TRIGGER, SND_SHIELD_RESPAWN, VOL_BASE, ATTEN_NORM);     // play respawn sound
        else
                sound (this, CH_TRIGGER, SND_ITEMRESPAWN, VOL_BASE, ATTEN_NORM);        // play respawn sound
-       setorigin (this, this.origin);
+       setorigin(this, this.origin);
 
     if (Item_ItemsTime_Allow(this.itemdef) || this.weapons & WEPSET_SUPERWEAPONS)
        {
index 9bbdfd48b548dcc1dd217328d970343581673054..ff3ce35fd1199b86ec31c863ef023bda3c720324 100644 (file)
@@ -104,7 +104,7 @@ void func_breakable_look_destroyed(entity this)
        else {
                if (this.origin == '0 0 0')     {       // probably no origin brush, so don't spawn in the middle of the map..
                        floorZ = this.absmin.z;
-                       setorigin(this,((this.absmax+this.absmin)*.5));
+                       setorigin(this, ((this.absmax + this.absmin) * 0.5));
                        this.origin_z = floorZ;
                }
                _setmodel(this, this.mdl_dead);
index e86eefb2c10158c3ae4bfadd7a106bbc0e4eee99..b8980a1561aae5f40f5f013233901ec4e0bb1e34 100644 (file)
@@ -147,7 +147,7 @@ spawnfunc(func_conveyor)
 
 #elif defined(CSQC)
 
-void conveyor_draw(entity this) { WITHSELF(this, conveyor_think(this)); }
+void conveyor_draw(entity this) { conveyor_think(this); }
 
 void conveyor_init(entity this)
 {
index a336c8b7e289e146b506f2100aa950c4c4d52c1f..6eb65936b9feb210804a4a16bf92080a8af1270b 100644 (file)
@@ -117,16 +117,16 @@ spawnfunc(func_vectormamamam)
        if(!this.target4factor)
                this.target4factor = 1;
 
-       if(vlen(this.targetnormal))
+       if(this.targetnormal)
                this.targetnormal = normalize(this.targetnormal);
 
-       if(vlen(this.target2normal))
+       if(this.target2normal)
                this.target2normal = normalize(this.target2normal);
 
-       if(vlen(this.target3normal))
+       if(this.target3normal)
                this.target3normal = normalize(this.target3normal);
 
-       if(vlen(this.target4normal))
+       if(this.target4normal)
                this.target4normal = normalize(this.target4normal);
 
        setblocked(this, generic_plat_blocked);
index 285f7357f4134608adc110cbdfe3212c5e7a580c..ab15a689192c50ac21e2c639b54c3d26f951d8ac 100644 (file)
@@ -37,8 +37,8 @@ spawnfunc(info_teleport_destination)
        this.mangle = this.angles;
        this.angles = '0 0 0';
 
-       //setorigin (this, this.origin + '0 0 27');     // To fix a mappers' habit as old as Quake
-       setorigin (this, this.origin);
+       //setorigin(this, this.origin + '0 0 27');      // To fix a mappers' habit as old as Quake
+       setorigin(this, this.origin);
 
        IFTARGETED
        {
index 7b2f43f33a108f4abd8ce4608c7e8b782e06ebda..c089039a60bccf1549b1602fb643380c7b64129c 100644 (file)
@@ -183,13 +183,13 @@ void plat_reset(entity this)
 {
        IFTARGETED
        {
-               setorigin (this, this.pos1);
+               setorigin(this, this.pos1);
                this.state = 4;
                this.use = plat_use;
        }
        else
        {
-               setorigin (this, this.pos2);
+               setorigin(this, this.pos2);
                this.state = 2;
                this.use = plat_trigger_use;
        }
index a71267b0cc5d047d59b01d2e30d739e23421250c..51ef002736a32201d391cc9831b9a4f84f06389f 100644 (file)
@@ -145,7 +145,7 @@ void SUB_CalcMove_controller_think (entity this)
                entity own = this.owner;
                SUB_THINK(own, this.think1);
                remove(this);
-               WITHSELF(own, SUB_THUNK(own)(own));
+               SUB_THUNK(own)(own);
        }
 }
 
@@ -236,7 +236,7 @@ void SUB_CalcMove_Bezier (entity this, vector tcontrol, vector tdest, float tspe
        this.SUB_NEXTTHINK = this.SUB_LTIME + traveltime;
 
        // invoke controller
-       WITHSELF(controller, getthink(controller)(controller));
+       getthink(controller)(controller);
 }
 
 void SUB_CalcMove (entity this, vector tdest, float tspeedtype, float tspeed, void(entity this) func)
index a570c2a64454cb42abf8b10b934d057f36d723b6..679d66e733a73b04fd8cea13d3952bb82d4c8897 100644 (file)
@@ -217,7 +217,7 @@ void target_spawn_edit_entity(entity this, entity e, string msg, entity kt, enti
                                value = strcat("target_spawn_helper", value);
                        putentityfieldstring(target_spawn_spawnfunc_field, e, value);
 
-                       WITHSELF(e, e.target_spawn_spawnfunc(e));
+                       e.target_spawn_spawnfunc(e);
 
                        // We called an external function, so we have to re-tokenize msg.
                        n = tokenize_console(msg);
index 475904d21eafb3e78597ab056955d237f4cab94c..90a426e630d8e3e0b46dfd271d454470e9216689 100644 (file)
@@ -112,7 +112,7 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle
        // assuming to allows PL_MIN to PL_MAX box and some more
 #ifdef SVQC
        from = player.origin;
-       setorigin (player, to);
+       setorigin(player, to);
        player.oldorigin = to; // don't undo the teleport by unsticking
        player.angles = to_angles;
        player.fixangle = true;
index 6fa27cf1a7ee2ccf56e71fd97a7885ec2173ff3b..efddf8c77f89eb99787af0075e448e1035ad4082 100644 (file)
@@ -10,11 +10,10 @@ void gamestart_use_this(entity this)
        gamestart_use(this, NULL, NULL);
 }
 
-void self_spawnfunc_trigger_gamestart(entity this);
 spawnfunc(trigger_gamestart)
 {
        this.use = gamestart_use;
-       this.reset2 = self_spawnfunc_trigger_gamestart;
+       this.reset2 = spawnfunc_trigger_gamestart;
 
        if(this.wait)
        {
@@ -24,6 +23,5 @@ spawnfunc(trigger_gamestart)
        else
                InitializeEntity(this, gamestart_use_this, INITPRIO_FINDTARGET);
 }
-void self_spawnfunc_trigger_gamestart(entity this) { WITHSELF(this, spawnfunc_trigger_gamestart(this)); }
 
 #endif
index 9f71eeff329cfb66c9f28f62466d329de6054dce..14d7fda04b7fbcd4420eee464cda96613497239a 100644 (file)
@@ -172,14 +172,14 @@ spawnfunc(trigger_multiple)
                this.event_damage = multi_eventdamage;
                this.takedamage = DAMAGE_YES;
                this.solid = SOLID_BBOX;
-               setorigin (this, this.origin);  // make sure it links into the world
+               setorigin(this, this.origin);   // make sure it links into the world
        }
        else
        {
                if ( !(this.spawnflags & SPAWNFLAG_NOTOUCH) )
                {
                        settouch(this, multi_touch);
-                       setorigin (this, this.origin);  // make sure it links into the world
+                       setorigin(this, this.origin);   // make sure it links into the world
                }
        }
 }
index 46526df4d615db53dc99f2391b2abc07d24f7805..d0e07bc3f6f1a2a7df06be91cbba78f65472045b 100644 (file)
@@ -65,7 +65,7 @@ void turret_checkpoint_init(entity this)
 
 spawnfunc(turret_checkpoint)
 {
-    setorigin(this,this.origin);
+    setorigin(this, this.origin);
     setthink(this, turret_checkpoint_init);
     this.nextthink = time + 0.2;
 }
index ada1bf0636db0a07596ce4d644b49ba02a0792ef..e02c1845224da5a0b011526b624d0918e569820b 100644 (file)
@@ -40,7 +40,7 @@ void turret_flac_projectile_think_explode(entity this)
 {
     if(this.enemy != world)
     if(vdist(this.origin - this.enemy.origin, <, this.owner.shot_radius * 3))
-        setorigin(this,this.enemy.origin + randomvec() * this.owner.shot_radius);
+        setorigin(this, this.enemy.origin + randomvec() * this.owner.shot_radius);
 
 #ifdef TURRET_DEBUG
     float d = RadiusDamage (this, this.owner, this.owner.shot_dmg, this.owner.shot_dmg, this.owner.shot_radius, this, world, this.owner.shot_force, this.totalfrags, world);
index a2d11d53cce9a5a941b63ac0327aca5886d6ddde..a2062f555576ada34292e849007ff43639bad972 100644 (file)
@@ -22,7 +22,7 @@ METHOD(TeslaCoilTurretAttack, wr_think, void(entity thiswep, entity actor, .enti
         float d = actor.shot_dmg;
         float r = actor.target_range;
         entity e = spawn();
-        setorigin(e,actor.tur_shotorg);
+        setorigin(e, actor.tur_shotorg);
 
         actor.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_MISSILES | TFL_TARGETSELECT_RANGELIMITS | TFL_TARGETSELECT_TEAMCHECK;
 
index 41e7cd491ce7d8fb1456b0511b65d08418e4123a..5d8ee32b7d9d77efd46d82c7fa901a737f72876a 100644 (file)
@@ -114,7 +114,7 @@ void mark_error(vector where,float lifetime)
 {
        entity err = new(error_marker);
        setmodel(err, MDL_MARKER);
-       setorigin(err,where);
+       setorigin(err, where);
        err.movetype = MOVETYPE_NONE;
        setthink(err, marker_think);
        err.nextthink = time;
@@ -127,7 +127,7 @@ void mark_info(vector where,float lifetime)
 {
        entity err = spawn(info_marker);
        setmodel(err, MDL_MARKER);
-       setorigin(err,where);
+       setorigin(err, where);
        err.movetype = MOVETYPE_NONE;
        setthink(err, marker_think);
        err.nextthink = time;
@@ -140,7 +140,7 @@ entity mark_misc(vector where,float lifetime)
 {
        entity err = spawn(mark_misc);
        setmodel(err, MDL_MARKER);
-       setorigin(err,where);
+       setorigin(err, where);
        err.movetype = MOVETYPE_NONE;
        setthink(err, marker_think);
        err.nextthink = time;
@@ -165,7 +165,7 @@ void paint_target(entity onwho, float f_size, vector v_color, float f_time)
        e.scale = (f_size/512);
        //setsize(e, '0 0 0', '0 0 0');
        //setattachment(e,onwho,"");
-       setorigin(e,onwho.origin + '0 0 1');
+       setorigin(e, onwho.origin + '0 0 1');
        e.alpha = 0.15;
        e.movetype = MOVETYPE_FLY;
 
@@ -184,7 +184,7 @@ void paint_target2(entity onwho, float f_size, vector v_color, float f_time)
        e.scale = (f_size/512);
        setsize(e, '0 0 0', '0 0 0');
 
-       setorigin(e,onwho.origin + '0 0 1');
+       setorigin(e, onwho.origin + '0 0 1');
        e.alpha = 0.15;
        e.movetype = MOVETYPE_FLY;
 
@@ -202,7 +202,7 @@ void paint_target3(vector where, float f_size, vector v_color, float f_time)
        setmodel(e, MDL_TUR_C512); // precision set above
        e.scale = (f_size/512);
        setsize(e, '0 0 0', '0 0 0');
-       setorigin(e,where+ '0 0 1');
+       setorigin(e, where + '0 0 1');
        e.movetype = MOVETYPE_NONE;
        e.velocity = '0 0 0';
        e.colormod = v_color;
index 52110137253b224511204353637be62d99d7d36c..d98e80db853d22f317a196bda2515afd5e58d23d 100644 (file)
@@ -297,7 +297,7 @@ float compressShortVector(vector vec)
 {
        vector ang;
        float p, y, len;
-       if(vlen(vec) == 0)
+       if(vec == '0 0 0')
                return 0;
        //print("compress: ", vtos(vec), "\n");
        ang = vectoangles(vec);
index ac98dadbe841f254e9ad26f85cdcd62ae93ef85f..62830bd558269a3b13024984a665635488340fe7 100644 (file)
@@ -235,8 +235,8 @@ vector bumblebee_gunner_findgoodexit(vector prefer_spot, entity gunner, entity p
 
 void bumblebee_gunner_exit(entity this, int _exitflag)
 {
-       entity player = this;
-       entity gunner = player.vehicle;
+       entity player = ((this.owner.gun1 == this) ? this.owner.gunner1 : this.owner.gunner2);
+       entity gunner = this;
        entity vehic = gunner.owner;
 
        if(IS_REAL_CLIENT(player))
@@ -744,7 +744,7 @@ METHOD(Bumblebee, vr_think, void(Bumblebee thisveh, entity instance))
         if(instance.gunner1)
         {
                entity e = instance.gunner1;
-               instance.gun1.vehicle_exit(e, VHEF_EJECT);
+               instance.gun1.vehicle_exit(instance.gun1, VHEF_EJECT);
                entity oldother = other;
                other = e;
                instance.phase = 0;
@@ -756,7 +756,7 @@ METHOD(Bumblebee, vr_think, void(Bumblebee thisveh, entity instance))
         if(instance.gunner2)
         {
                entity e = instance.gunner2;
-               instance.gun2.vehicle_exit(e, VHEF_EJECT);
+               instance.gun2.vehicle_exit(instance.gun2, VHEF_EJECT);
                entity oldother = other;
                other = e;
                instance.phase = 0;
@@ -775,10 +775,10 @@ METHOD(Bumblebee, vr_death, void(Bumblebee thisveh, entity instance))
                instance.gun3.enemy.effects |= EF_NODRAW;
 
        if(instance.gunner1)
-               instance.gun1.vehicle_exit(instance.gunner1, VHEF_EJECT);
+               instance.gun1.vehicle_exit(instance.gun1, VHEF_EJECT);
 
        if(instance.gunner2)
-               instance.gun2.vehicle_exit(instance.gunner2, VHEF_EJECT);
+               instance.gun2.vehicle_exit(instance.gun2, VHEF_EJECT);
 
        instance.vehicle_exit(instance, VHEF_EJECT);
 
index ba3d02577f29d36126fadf06b15192f2cbcc21ba..e85e868a6594ee85e3ecccaac45642094a8f163a 100644 (file)
@@ -625,7 +625,7 @@ METHOD(Racer, vr_spawn, void(Racer thisveh, entity instance))
 METHOD(Racer, vr_death, void(Racer thisveh, entity instance))
 {
 #ifdef SVQC
-    instance.SendEntity                = func_null; // stop networking this racer (for now)
+    setSendEntity(instance, func_null); // stop networking this racer (for now)
     instance.health                    = 0;
     instance.event_damage      = func_null;
     instance.solid                     = SOLID_CORPSE;
index 9dbf5825ff20f96f09d0834ed3a0e577894e2806..18dd356df77c336e567ad87cc549532ea06b83ed 100644 (file)
@@ -391,7 +391,7 @@ bool raptor_frame(entity this)
        if (wep1.wr_checkammo1(wep1, vehic))
        {
            .entity weaponentity = weaponentities[0];
-               WITHSELF(vehic, wep1.wr_think(wep1, vehic, weaponentity, 1));
+               wep1.wr_think(wep1, vehic, weaponentity, 1);
        }
 
        if(vehic.vehicle_flags  & VHF_SHIELDREGEN)
index b86b77fadf4ffc0cb14de612227121f3433c2635..dd691a6921ca8ab2b9d619ee61df8731515189d5 100644 (file)
@@ -114,7 +114,8 @@ void W_PROP_think(entity this)
 STATIC_INIT_LATE(W_PROP_reloader)
 {
     entity e = W_PROP_reloader = new_pure(W_PROP_reloader);
-    WITHSELF(e, (setthink(e, W_PROP_think))(e));
+    setthink(e, W_PROP_think);
+    W_PROP_think(e);
 }
 #endif
 
index 4908a7ee5c94116443007d0cf35f1b31a0e59d35..b7d471f5a3ab96831e61427a050aab8f9196824d 100644 (file)
@@ -691,7 +691,7 @@ void W_Arc_Beam(float burst, entity actor)
        beam.beam_bursting = burst;
        Net_LinkEntity(beam, false, 0, W_Arc_Beam_Send);
 
-       WITHSELF(beam, getthink(beam)(beam));
+       getthink(beam)(beam);
 }
 void Arc_Smoke(entity actor)
 {
index 59cb4618bc1cf130cc098b8fcd5b391a69b0602d..ca305f7ba7c4191914f81c8a65ae33c9dc68286d 100644 (file)
@@ -146,7 +146,7 @@ void W_Blaster_Attack(
 
        if (time >= missile.nextthink)
        {
-               WITHSELF(missile, getthink(missile)(missile));
+               getthink(missile)(missile);
        }
 }
 
index 51932f6fef07869cf352896bec553d3ccaccb0c0..89a2cea429202d5227a56c92aed268d45cecc843 100644 (file)
@@ -237,11 +237,11 @@ void W_Crylink_LinkJoinEffect_Think(entity this)
        n = 0;
        if(e)
        {
-               if(vlen(e.origin - this.origin) < vlen(e.velocity) * frametime)
+               if(vlen2(e.origin - this.origin) < vlen2(e.velocity) * frametime)
                        ++n;
                for(p = e; (p = p.queuenext) != e; )
                {
-                       if(vlen(p.origin - this.origin) < vlen(p.velocity) * frametime)
+                       if(vlen2(p.origin - this.origin) < vlen2(p.velocity) * frametime)
                                ++n;
                }
                if(n >= 2)
index fe3a19a0b4bbe56e1e509bc893aa70f07701c2b6..bc4b609bf2b692154f840149eea1797e6611c06c 100644 (file)
@@ -349,15 +349,12 @@ void W_Devastator_Damage(entity this, entity inflictor, entity attacker, float d
 
 void W_Devastator_Attack(Weapon thiswep, entity actor)
 {
-       entity missile;
-       entity flash;
-
        W_DecreaseAmmo(thiswep, actor, WEP_CVAR(devastator, ammo));
 
        W_SetupShot_ProjectileSize(actor, '-3 -3 -3', '3 3 3', false, 5, SND_ROCKET_FIRE, CH_WEAPON_A, WEP_CVAR(devastator, damage));
        Send_Effect(EFFECT_ROCKET_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
 
-       missile = WarpZone_RefSys_SpawnSameRefSys(actor);
+       entity missile = WarpZone_RefSys_SpawnSameRefSys(actor);
        missile.owner = missile.realowner = actor;
        actor.lastrocket = missile;
        if(WEP_CVAR(devastator, detonatedelay) >= 0)
@@ -394,7 +391,7 @@ void W_Devastator_Attack(Weapon thiswep, entity actor)
        CSQCProjectile(missile, WEP_CVAR(devastator, guiderate) == 0 && WEP_CVAR(devastator, speedaccel) == 0, PROJECTILE_ROCKET, false); // because of fly sound
 
        // muzzle flash for 1st person view
-       flash = spawn();
+       entity flash = spawn();
        setmodel(flash, MDL_DEVASTATOR_MUZZLEFLASH); // precision set below
        SUB_SetFade(flash, time, 0.1);
        flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
index 9834dab6ba62bf3554eb045b4746c32c6d960e95..4e0b20fd9ac2f7d5658a09179a21c76eef467d52 100644 (file)
@@ -328,7 +328,7 @@ float W_Shockwave_Attack_CheckHit(
        {
                if(shockwave_hit[i] == head)
                {
-                       if(vlen(final_force) > vlen(shockwave_hit_force[i])) { shockwave_hit_force[i] = final_force; }
+                       if(vlen2(final_force) > vlen2(shockwave_hit_force[i])) { shockwave_hit_force[i] = final_force; }
                        if(final_damage > shockwave_hit_damage[i]) { shockwave_hit_damage[i] = final_damage; }
                        return false;
                }
index fe465e5933420d7ad602226df27e80c878528202..db8752d2bb8075d2f9611c3c776830c6d682540d 100644 (file)
@@ -1,3 +1,16 @@
 #pragma once
 
+#undef ChangeYaw
+#undef checkclient
+#undef droptofloor
+#undef error
+#undef movetogoal
 #undef objerror
+#undef walkmove
+
+#ifdef MENUQC
+       #define NULL (0, null_entity)
+       #define world NULL
+#else
+       #define NULL (0, world)
+#endif
index f63f0aa830d0cbc04cdfda8d8081d64a55fc10ac..b24d0120a49e56a0bee597379b3522e454013949 100644 (file)
@@ -1,3 +1,9 @@
 #pragma once
 
+#define ChangeYaw builtin_ChangeYaw
+#define checkclient builtin_checkclient
+#define droptofloor builtin_droptofloor
+#define error builtin_error
+#define movetogoal builtin_movetogoal
 #define objerror builtin_objerror
+#define walkmove builtin_walkmove
index 23b55cb69de3a31bf4729adeb4765af660472890..03b943625832c472670d76169a58a8ba32195684 100644 (file)
@@ -29,6 +29,8 @@
 
 #include <dpdefs/post.qh>
 
+#include "self.qh"
+
 #define USING(name, T) typedef T name
 
 #include "bool.qh"
@@ -94,7 +96,6 @@ void    isnt_bool(   float this) { print(ftos(this)); }
 #include "registry.qh"
 #include "registry_net.qh"
 #include "replicate.qh"
-#include "self.qh"
 #include "sortlist.qc"
 #include "sort.qh"
 #include "spawnfunc.qh"
index 2d0e5eb0947ef0cf30047a138ea6939f1408faa5..d495ae0154e58bd297d3de76de2c4eb7c8aed761 100644 (file)
@@ -128,6 +128,5 @@ void CSQCModel_LinkEntity(entity e)
 
 void CSQCModel_UnlinkEntity(entity e)
 {
-       e.SendEntity = func_null;
-       e.SendEntity3 = func_null;
+       setSendEntity(e, func_null);
 }
index 809708d7439e57fc3870b47714422a653a54667c..dff3710a5f3d04a7c114ba1b5c9f612ece4737d8 100644 (file)
@@ -1,7 +1,7 @@
 #pragma once
 
 #if 1
-    void voidfunc() { error("voidfunc"); }
+    void voidfunc() { }
     #define MACRO_BEGIN if (1) {
     #define MACRO_END } else voidfunc()
 #else
index 507807919ac9d6bbf0425b1dd03ea4f1b3c691d8..4e09d4b01043363a619153154f90dd08baf5ba6d 100644 (file)
@@ -97,9 +97,6 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); }
 
        .int Version;  // deprecated, use SendFlags
        .int SendFlags;
-       .bool(entity to, int sendflags) SendEntity;
-       /** return false to remove from the client */
-       .bool(entity this, entity to, int sendflags) SendEntity3;
 
        void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
        {
@@ -127,7 +124,7 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); }
 
        void Net_UnlinkEntity(entity e)
        {
-               e.SendEntity = func_null;
+               setSendEntity(e, func_null);
        }
 
        .void(entity this) uncustomizeentityforclient;
index fd6ca20365000cc0fa7553e57b560823452eec24..3708552d5968c5d5bcfb1c976bd56cae9779fa63 100644 (file)
@@ -4,13 +4,6 @@
 #include "nil.qh"
 #include "static.qh"
 
-#ifdef MENUQC
-       #define NULL (0, null_entity)
-       #define world NULL
-#else
-       #define NULL (0, world)
-#endif
-
 .vector origin;
 .bool pure_data;
 /** @deprecated use new_pure or NEW(class) */
index 4af4b8ab024388ad1db5f0b067b7fee533e0a4e8..ec43a34022592ae86b5c0c26ec23c5005ffcc938 100644 (file)
@@ -84,22 +84,26 @@ SELFWRAP(customizeentityforclient, bool, (), (entity this), (this))
 SELFWRAP(camera_transform, vector, (vector org, vector ang), (entity this, vector org, vector ang), (this, org, ang))
 #define setcamera_transform(e, f) SELFWRAP_SET(camera_transform, e, f)
 
+/** return false to remove from the client */
 SELFWRAP(SendEntity, bool, (entity to, int sendflags), (entity this, entity to, int sendflags), (this, to, sendflags))
 #define setSendEntity(e, f) SELFWRAP_SET(SendEntity, e, f)
+#define getSendEntity(e) SELFWRAP_GET(SendEntity, e)
 
-#ifdef SVQC
-void make_safe_for_remove(entity this);
+#define ChangeYaw(e, ...) (__self = (e), builtin_ChangeYaw(__VA_ARGS__))
+#define checkclient(e, ...) (__self = (e), builtin_checkclient(__VA_ARGS__))
+#ifndef SVQC
+    #define droptofloor(e, ...) (__self = (e), builtin_droptofloor(__VA_ARGS__))
 #endif
-
-void objerror(entity this, string s)
-{
-#ifdef SVQC
-    make_safe_for_remove(this);
+#define error(...) (__self = (NULL), builtin_error(__VA_ARGS__))
+#define movetogoal(e, ...) (__self = (e), builtin_movetogoal(__VA_ARGS__))
+#ifndef SVQC
+    #define objerror(e, ...) (__self = (e), builtin_objerror(__VA_ARGS__))
+#else
+    void make_safe_for_remove(entity this);
+    #define objerror(e, ...) (__self = (e), make_safe_for_remove(__self), builtin_objerror(__VA_ARGS__))
 #endif
-    WITHSELF(this, builtin_objerror(s));
-}
+#define walkmove(e, ...) (__self = (e), builtin_walkmove(__VA_ARGS__))
 
 #ifndef MENUQC
-void adaptor_think2touch(entity this) { WITH(entity, other, NULL, gettouch(this)(this)); }
 void adaptor_think2use(entity this) { if (this.use) this.use(this, NULL, NULL); }
 #endif
index 22047bbc9daac0d285478015cbecbcf14ceb6303..0463979c1a3fb855c3245360ffcb3be7f4387a6a 100644 (file)
@@ -27,6 +27,7 @@ noref bool require_spawnfunc_prefix;
        #define _spawnfunc_check(fld) \
                if (fieldname == #fld) continue;
 
+       noref bool __spawnfunc_expecting;
        noref entity __spawnfunc_expect;
        bool __spawnfunc_unreachable_workaround = true;
 
@@ -35,11 +36,12 @@ noref bool require_spawnfunc_prefix;
                void __spawnfunc_##id(entity this); \
                [[accumulate]] void spawnfunc_##id(entity this) \
                { \
-                       if (__self == __spawnfunc_expect) \
+                       if (__spawnfunc_expecting) \
                        { \
                                /* engine call */ \
+                               __spawnfunc_expecting = false; \
+                               this = __spawnfunc_expect; \
                                __spawnfunc_expect = NULL; \
-                               this = __self; \
                        } \
                        else \
                        { \
index 44ae46fb14b08bcb0a63137a359c551e4b23491c..b539b5bcc33355c169838877313981427139f5a6 100644 (file)
@@ -256,21 +256,17 @@ void WarpZone_FixView()
                WarpZone_View_Outside();
 
 #ifndef KEEP_ROLL
-       static float rollkill;
-       if (STAT(HEALTH) <= 0 && STAT(HEALTH) != -666 && STAT(HEALTH) != -2342)
-       {
-               if(autocvar_cl_rollkillspeed)
-               {
-                       rollkill += frametime * autocvar_cl_rollkillspeed;
-                       rollkill = min(1, rollkill);
-               }
-               float rick;
-               rick = getproperty(VF_CL_VIEWANGLES_Z) * rollkill;
-               setproperty(VF_CL_VIEWANGLES_Z, rick);
-               ang.z *= rollkill;
-       }
-       else if(rollkill)
-               rollkill = 0;
+       float rick;
+       float f;
+       if(autocvar_cl_rollkillspeed)
+               f = max(0, (1 - frametime * autocvar_cl_rollkillspeed));
+       else
+               f = 0;
+
+       rick = getproperty(VF_CL_VIEWANGLES_Z);
+       rick *= f;
+       setproperty(VF_CL_VIEWANGLES_Z, rick);
+       ang.z *= f;
 #endif
 
        setproperty(VF_ORIGIN, org);
index 704feeb7e7c8b84a60bef620a15aa7505965be37..6473e65b1de61125d15838854bd001b2831aa9a1 100644 (file)
@@ -801,7 +801,7 @@ void WarpZoneLib_MoveOutOfSolid_Expand(entity e, vector by)
        {
                // hit something
                // adjust origin in the other direction...
-               setorigin(e,e.origin - by * (1 - trace_fraction));
+               setorigin(e, e.origin - by * (1 - trace_fraction));
        }
 }
 
index a84b7a73984219626a7a91b3d2d62e6abd18d397..39e20d91ce11ac3c1455e14a4d1b253791fca5b7 100644 (file)
@@ -47,7 +47,7 @@
 void WarpZone_TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity)
 {
 #ifdef SVQC
-       setorigin (player, to); // NOTE: this also aborts the move, when this is called by touch
+       setorigin(player, to); // NOTE: this also aborts the move, when this is called by touch
        player.oldorigin = to; // for DP's unsticking
        player.angles = to_angles;
        player.fixangle = true;
index 0d59fa6e4251f1fad85259692af0062e519113d1..ca95e9ebfe6db164047eadbbf32ac9b2f10e68fa 100644 (file)
@@ -737,7 +737,7 @@ void havocbot_movetogoal(entity this)
                        traceline(this.origin + this.view_ofs, dst_ahead, true, world);
 
                        // Check head-banging against walls
-                       if(vlen(this.origin + this.view_ofs - trace_endpos) < 25 && !(this.aistatus & AI_STATUS_OUT_WATER))
+                       if(vdist(this.origin + this.view_ofs - trace_endpos, <, 25) && !(this.aistatus & AI_STATUS_OUT_WATER))
                        {
                                PHYS_INPUT_BUTTON_JUMP(this) = true;
                                if(this.facingwalltime && time > this.facingwalltime)
index 0d2f9988f92461ed5c321b33588b92d0ae20933a..6eb872bb16fd91887f70b7149a0bd6c869423113 100644 (file)
@@ -925,7 +925,7 @@ void navigation_poptouchedgoals(entity this)
 
        // If for some reason the bot is closer to the next goal, pop the current one
        if(this.goalstack01)
-       if(vlen(this.goalcurrent.origin - this.origin) > vlen(this.goalstack01.origin - this.origin))
+       if(vlen2(this.goalcurrent.origin - this.origin) > vlen2(this.goalstack01.origin - this.origin))
        if(checkpvs(this.origin + this.view_ofs, this.goalstack01))
        if(tracewalk(this, this.origin, this.mins, this.maxs, (this.goalstack01.absmin + this.goalstack01.absmax) * 0.5, bot_navigation_movemode))
        {
index ef8451efac92beea85914831f58ae0ad8a9433eb..e606038792fd6ab3eacecf92ad7217c96070afed 100644 (file)
@@ -410,7 +410,7 @@ float waypoint_load_links()
                        found = false;
                        while(wp_from)
                        {
-                               if(vlen(wp_from.origin-wp_from_pos)<1)
+                               if(vdist(wp_from.origin - wp_from_pos, <, 1))
                                if(wp_from.classname == "waypoint")
                                {
                                        found = true;
@@ -432,7 +432,7 @@ float waypoint_load_links()
                found = false;
                while(wp_to)
                {
-                       if(vlen(wp_to.origin-wp_to_pos)<1)
+                       if(vdist(wp_to.origin - wp_to_pos, <, 1))
                        if(wp_to.classname == "waypoint")
                        {
                                found = true;
@@ -500,7 +500,7 @@ void waypoint_load_links_hardwired()
                        found = false;
                        while(wp_from)
                        {
-                               if(vlen(wp_from.origin-wp_from_pos)<5)
+                               if(vdist(wp_from.origin - wp_from_pos, <, 5))
                                if(wp_from.classname == "waypoint")
                                {
                                        found = true;
@@ -521,7 +521,7 @@ void waypoint_load_links_hardwired()
                found = false;
                while(wp_to)
                {
-                       if(vlen(wp_to.origin-wp_to_pos)<5)
+                       if(vdist(wp_to.origin - wp_to_pos, <, 5))
                        if(wp_to.classname == "waypoint")
                        {
                                found = true;
index e92a6082a77d2486c562cd7e03604558ed363714..19a1e25bdd73d1d601a1e6efd7cdfb075151176b 100644 (file)
@@ -357,7 +357,7 @@ float CheatCommand(entity this, int argc)
                                                e.angles = fixedvectoangles2(trace_plane_normal, v_forward);
                                                e.angles = AnglesTransform_ApplyToAngles(e.angles, '-90 0 0'); // so unrotated models work
                                        }
-                                       WITHSELF(e, spawnfunc_func_breakable(e));
+                                       spawnfunc_func_breakable(e);
                                        // now, is it valid?
                                        if(f == 0)
                                        {
@@ -819,7 +819,7 @@ float Drag(entity this, float force_allow_pick, float ischeat)
                                                        // This also makes sure that an object can only pe picked up if in range, but does not get dropped if
                                                        // it goes out of range while slinging it around.
 
-                                                       if(vlen(this.origin - e.origin) <= autocvar_g_grab_range)
+                                                       if(vdist(this.origin - e.origin, <=, autocvar_g_grab_range))
                                                        {
                                                                switch(e.grab)
                                                                {
index 8da1f1076401d702f97d8b1a2cfbf7efd62c3372..968a9899f20262d29f6c3c665de738b00b9732e2 100644 (file)
@@ -2038,7 +2038,7 @@ void PlayerUseKey(entity this)
                                {
                                        if(closest_target)
                                        {
-                                               if(vlen(this.origin - head.origin) < vlen(this.origin - closest_target.origin))
+                                               if(vlen2(this.origin - head.origin) < vlen2(this.origin - closest_target.origin))
                                                { closest_target = head; }
                                        }
                                        else { closest_target = head; }
@@ -2165,7 +2165,7 @@ void PlayerPreThink ()
        {
                entity veh;
                for(veh = world; (veh = findflags(veh, vehicle_flags, VHF_ISVEHICLE)); )
-               if(vlen(veh.origin - this.origin) < autocvar_g_vehicles_enter_radius)
+               if(vdist(veh.origin - this.origin, <, autocvar_g_vehicles_enter_radius))
                if(!IS_DEAD(veh))
                if(veh.takedamage != DAMAGE_NO)
                if((veh.vehicle_flags & VHF_MULTISLOT) && SAME_TEAM(veh.owner, this))
index b1482999d1e73c71646f63f441e1bbb011d2cd9e..d02caa390fedecbae1c2fbf6cfcd2604cfea2068 100644 (file)
@@ -340,7 +340,7 @@ void reset_map(bool dorespawn)
        FOREACH_ENTITY_ORDERED(IS_NOT_A_CLIENT(it), {
                if (it.reset)
                {
-                       WITHSELF(it, it.reset(it)); // needs WITHSELF, as some spawnfuncs are set to .reset
+                       it.reset(it);
                        continue;
                }
                if (it.team_saved) it.team = it.team_saved;
index d0415c9e2c8da6ffbb10c092087de3d46b00f079..8b7d7c159406c1b1756fb708227220b2edb643ab 100644 (file)
@@ -741,7 +741,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
                                targ.oldvelocity = targ.velocity;
 
                                targ.spawnorigin = spot.origin;
-                               setorigin (targ, spot.origin + '0 0 1' * (1 - targ.mins.z - 24));
+                               setorigin(targ, spot.origin + '0 0 1' * (1 - targ.mins.z - 24));
                                // don't reset back to last position, even if new position is stuck in solid
                                targ.oldorigin = targ.origin;
                                targ.prevorigin = targ.origin;
@@ -903,7 +903,7 @@ float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector in
                if(DEATH_WEAPONOF(deathtype) != WEP_TUBA) // do not send tuba damage (bandwidth hog)
                {
                        force = inflictorvelocity;
-                       if(vlen(force) == 0)
+                       if(force == '0 0 0')
                                force = '0 0 -1';
                        else
                                force = normalize(force);
index defd6051eb888d0abcbc9581cede959d251919fd..f5f37c673a602bd3940b7fd4c1a6b331d82c9f4e 100644 (file)
@@ -376,7 +376,7 @@ void FireGrapplingHook(entity actor)
 
        //setmodel (missile, MDL_HOOK); // precision set below
        setsize (missile, '-3 -3 -3', '3 3 3');
-       setorigin (missile, org);
+       setorigin(missile, org);
 
        missile.state = 0; // not latched onto anything
 
index 98f2c436392d63f181412115892f6f9c87062ff9..849ba535836e39522cd0dfa500d0c56b4b77a341 100644 (file)
@@ -65,7 +65,7 @@ void dynlight_find_path(entity this)
 
        targ = find(world, targetname, this.target);
        this.target = targ.target;
-       setorigin (this, targ.origin);
+       setorigin(this, targ.origin);
        setthink(this, train_next);
        this.nextthink = time + 0.1;
 }
@@ -97,7 +97,7 @@ spawnfunc(dynlight)
        this.lefty = this.light_lev;
        this.use = dynlight_use;
        setsize (this, '0 0 0', '0 0 0');
-       setorigin (this, this.origin);
+       setorigin(this, this.origin);
        //this.pflags = PFLAGS_FULLDYNAMIC;
        this.solid = SOLID_NOT;
        //this.blocked = func_null;
index d4463f6939531ef7da9561b4c3afa082a4237dc9..e2b7ba269bbb70146aa347b664104cea37ad899c 100644 (file)
@@ -321,7 +321,7 @@ void LODmodel_attach(entity this)
        }
 
        if(this.lodmodelindex1)
-               if (!this.SendEntity)
+               if (!getSendEntity(this))
                        SetCustomizer(this, LOD_customize, LOD_uncustomize);
 }
 
index 8e2f74c7209c150eac17a1e9b74aa5b72205e841..7cb5f69803fb097918f2e7382e64cc91a572df7c 100644 (file)
@@ -528,7 +528,7 @@ void RandomSeed_Spawn()
        setthink(randomseed, RandomSeed_Think);
        Net_LinkEntity(randomseed, false, 0, RandomSeed_Send);
 
-       WITHSELF(randomseed, getthink(randomseed)(randomseed)); // sets random seed and nextthink
+       getthink(randomseed)(randomseed); // sets random seed and nextthink
 }
 
 spawnfunc(__init_dedicated_server)
@@ -1562,7 +1562,7 @@ void NextLevel()
                        bprint(it.netname, " ^7wins.\n");
        ));
 
-       WITHSELF(NULL, target_music_kill());
+       target_music_kill();
 
        if(autocvar_g_campaign)
                CampaignPreIntermission();
index d4c4bb7e5661faed97d57bae933e715b31f1d641..5369f9f2d6f8fde1543ee5c160e3863d52d1273e 100644 (file)
@@ -903,7 +903,7 @@ void InitializeEntitiesRun()
         //dprint("Delayed initialization: ", e.classname, "\n");
         if (func)
         {
-               WITHSELF(e, func(e));
+               func(e);
         }
         else
         {
@@ -957,7 +957,7 @@ void adaptor_think2use_hittype_splash(entity this) // for timed projectile deton
 {
        if(!(IS_ONGROUND(this))) // if onground, we ARE touching something, but HITTYPE_SPLASH is to be networked if the damage causing projectile is not touching ANYTHING
                this.projectiledeathtype |= HITTYPE_SPLASH;
-       WITHSELF(this, adaptor_think2use(this));
+       adaptor_think2use(this);
 }
 
 // deferred dropping
@@ -1032,8 +1032,8 @@ bool SUB_NoImpactCheck(entity this, entity toucher)
        if(trace_dphitcontents == 0)
        {
                //dprint("A hit happened with zero hit contents... DEBUG THIS, this should never happen for projectiles! Projectile will self-destruct.\n");
-               LOG_TRACEF("A hit from a projectile happened with no hit contents! DEBUG THIS, this should never happen for projectiles! Profectile will self-destruct. (edict: %d, classname: %s, origin: %s)\n", etof(this), this.classname, vtos(this.origin));
-               WITHSELF(this, checkclient());
+               LOG_TRACEF("A hit from a projectile happened with no hit contents! DEBUG THIS, this should never happen for projectiles! Projectile will self-destruct. (edict: %d, classname: %s, origin: %s)\n", etof(this), this.classname, vtos(this.origin));
+               checkclient(this);
        }
     if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
         return true;
index b827f10eaeab295201970fa34297e5115dfce578..ade9cfa3b6c7897184fdab0b52c219e580f1c2f2 100644 (file)
@@ -2563,7 +2563,7 @@ void ctf_SpawnTeam (string teamname, int teamcolor)
        this.netname = teamname;
        this.cnt = teamcolor;
        this.spawnfunc_checked = true;
-       WITHSELF(this, spawnfunc_ctf_team(this));
+       spawnfunc_ctf_team(this);
 }
 
 void ctf_DelayedInit(entity this) // Do this check with a delay so we can wait for teams to be set up.
index 2eeaafa3063e908ecef2ed8772196531b00f230f..d245721cb8dc5dcf9f19221cc05876fe291ed6ee 100644 (file)
@@ -64,7 +64,7 @@ void tdm_SpawnTeam (string teamname, float teamcolor)
        this.netname = teamname;
        this.cnt = teamcolor;
        this.spawnfunc_checked = true;
-       WITHSELF(this, spawnfunc_tdm_team(this));
+       spawnfunc_tdm_team(this);
 }
 
 void tdm_DelayedInit(entity this)
index bd1295172a5df4a7f8ff22dd4fd924464b401670..0a350df2c2f467f4ed03958639fd31607b7dd133 100644 (file)
@@ -60,7 +60,7 @@ void pathlib_showsquare2(entity node ,vector ncolor,float align)
     node.solid     = SOLID_NOT;
 
     setmodel(node, MDL_SQUARE);
-    setorigin(node,node.origin);
+    setorigin(node, node.origin);
     node.colormod = ncolor;
 
     if(align)
@@ -93,7 +93,7 @@ void pathlib_showsquare(vector where,float goodsquare,float _lifetime)
 
     s.angles = vectoangles(trace_plane_normal);
     s.angles_x -= 90;
-    setorigin(s,where);
+    setorigin(s, where);
 }
 
 void pathlib_showedge(vector where,float _lifetime,float rot)
@@ -111,7 +111,7 @@ void pathlib_showedge(vector where,float _lifetime,float rot)
     e.nextthink = _lifetime;
     e.scale     = pathlib_gridsize / 512;
     e.solid     = SOLID_NOT;
-    setorigin(e,where);
+    setorigin(e, where);
     setmodel(e, MDL_EDGE);
     //traceline(where + '0 0 32',where - '0 0 128',MOVE_WORLDONLY,e);
     //e.angles = vectoangles(trace_plane_normal);
index c033f3f52a6c4f9955becffb46ba20d4aed9e5a6..195e2a55e8387bc16b701235750aad606c962a8c 100644 (file)
@@ -327,7 +327,7 @@ float buildpath_nodefilter_directional(vector n,vector c,vector p)
     d2 = normalize(p - c);
     d1 = normalize(c - n);
 
-    if(vlen(d1-d2) < 0.25)
+    if(vdist(d1 - d2, <, 0.25))
     {
         //mark_error(c,30);
         return 1;
@@ -364,7 +364,7 @@ entity path_build(entity next, vector where, entity prev, entity start)
     path.owner     = start;
     path.path_next = next;
 
-    setorigin(path,where);
+    setorigin(path, where);
 
     if(!next)
         path.classname = "path_end";
@@ -476,7 +476,7 @@ entity pathlib_astar(entity this, vector from,vector to)
 
         open           = new(path_end);
         open.owner     = open;
-        setorigin(open,path.origin);
+        setorigin(open, path.origin);
 
         pathlib_cleanup();
 
index 52d0005a1efb583aa51887f2da9605918f7e5954..3059021d1238536b9d6b86b627bfbbd623bd6e5e 100644 (file)
@@ -104,7 +104,7 @@ vector pathlib_walknode(entity this, vector start, vector end, float doedge)
         a = spawn();
         setthink(a, a_think);
         a.nextthink = time;
-        setorigin(a,start + movenode_stepup);
+        setorigin(a, start + movenode_stepup);
         a.pos1 = trace_endpos;
         //start - movenode_maxdrop
         a.cnt = time + 10;
index 2cccbf41c06ab428e75150b64408e15687c708da..0c8c8fdc965dbb6221241622f8af005d1111273e 100644 (file)
@@ -645,7 +645,7 @@ spawnfunc(flockerspawn)
     this.enemy = new(FLock Hunter);
 
     setmodel(this.enemy, MDL_FLOCKER);
-    setorigin(this.enemy,this.origin + '0 0 768' + (randomvec() * 128));
+    setorigin(this.enemy, this.origin + '0 0 768' + (randomvec() * 128));
 
     this.enemy.scale     = 3;
     this.enemy.effects   = EF_LOWPRECISION;
index e1bf5c0be25236206f696f2a6c81ee81011f3a75..c842dac3f97de50252980274b8c5feab71d23c97 100644 (file)
@@ -239,12 +239,14 @@ void StartFrame()
 bool DoesQ3ARemoveThisEntity(entity this);
 void SV_OnEntityPreSpawnFunction()
 {ENGINE_EVENT();
+       __spawnfunc_expecting = true;
        __spawnfunc_expect = this;
        if (this)
        if (this.gametypefilter != "")
        if (!isGametypeInFilter(MapInfo_LoadedGametype, teamplay, have_team_spawns, this.gametypefilter))
        {
                remove(this);
+               __spawnfunc_expecting = false;
                return;
        }
        if(this.cvarfilter != "")
@@ -353,6 +355,7 @@ LABEL(cvar_fail)
                {
                        //print("cvarfilter fail\n");
                        remove(this);
+                       __spawnfunc_expecting = false;
                        return;
                }
        }
@@ -360,6 +363,7 @@ LABEL(cvar_fail)
        if(DoesQ3ARemoveThisEntity(this))
        {
                remove(this);
+               __spawnfunc_expecting = false;
                return;
        }
 
@@ -387,6 +391,7 @@ LABEL(cvar_fail)
        if(MUTATOR_CALLHOOK(OnEntityPreSpawn, this))
        {
                remove(this);
+               __spawnfunc_expecting = false;
                return;
        }
 }
index 0edf22664ae8eba7e89fff4851c5c98001019b17..7e7478e9b8ea8aedd9e71f0b49f839084849bf93 100644 (file)
@@ -98,13 +98,13 @@ void CSQCProjectile(entity e, float clientanimate, int type, float docull)
 
 void UpdateCSQCProjectile(entity e)
 {
-       if(e.SendEntity3 == CSQCProjectile_SendEntity)
+       if(getSendEntity(e) == CSQCProjectile_SendEntity)
        {
                // send new origin data
                e.SendFlags |= 0x01;
        }
 // FIXME HACK
-       else if(e.SendEntity3 == ItemSend)
+       else if(getSendEntity(e) == ItemSend)
        {
                ItemUpdate(e);
        }
@@ -113,7 +113,7 @@ void UpdateCSQCProjectile(entity e)
 
 void UpdateCSQCProjectileAfterTeleport(entity e)
 {
-       if(e.SendEntity3 == CSQCProjectile_SendEntity)
+       if(getSendEntity(e) == CSQCProjectile_SendEntity)
        {
                // send new origin data
                e.SendFlags |= 0x01;
index 6491d9428d587a625b8f4e63c803af1a7db7aad2..531cf19aa52f017bf5cac50907b7178a96bc579f 100644 (file)
@@ -321,7 +321,7 @@ void FireRailgunBullet (entity this, vector start, vector end, float bdamage, fl
                        Damage (ent, this, this, bdamage * f, deathtype, hitloc, ent.railgunforce * ffs);
 
                // create a small explosion to throw gibs around (if applicable)
-               //setorigin (explosion, hitloc);
+               //setorigin(explosion, hitloc);
                //RadiusDamage (explosion, this, 10, 0, 50, world, world, 300, deathtype);
 
                ent.railgunhitloc = '0 0 0';