]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Remove some old now useless macros clogging up the trigger system
authorMario <mario@smbclan.net>
Sat, 18 Mar 2017 06:43:20 +0000 (16:43 +1000)
committerMario <mario@smbclan.net>
Sat, 18 Mar 2017 06:43:20 +0000 (16:43 +1000)
12 files changed:
qcsrc/common/triggers/func/bobbing.qc
qcsrc/common/triggers/func/button.qc
qcsrc/common/triggers/func/door.qc
qcsrc/common/triggers/func/door_secret.qc
qcsrc/common/triggers/func/fourier.qc
qcsrc/common/triggers/func/pendulum.qc
qcsrc/common/triggers/func/rotating.qc
qcsrc/common/triggers/func/train.qc
qcsrc/common/triggers/func/vectormamamam.qc
qcsrc/common/triggers/platforms.qc
qcsrc/common/triggers/subs.qc
qcsrc/common/triggers/subs.qh

index b7034939ae8863806fc49fb2d326488e70d2a84f..ff8841a570030853d2ce70b1602bc06ba2c31c60 100644 (file)
@@ -17,7 +17,7 @@ void func_bobbing_controller_think(entity this)
        v = this.owner.destvec + this.owner.movedir * v_forward_y;
        if(this.owner.classname == "func_bobbing") // don't brake stuff if the func_bobbing was killtarget'ed
                // * 10 so it will arrive in 0.1 sec
-               this.owner.velocity = (v - this.owner.SUB_ORIGIN) * 10;
+               this.owner.velocity = (v - this.owner.origin) * 10;
 }
 
 /*QUAKED spawnfunc_func_bobbing (0 .5 .8) ? X_AXIS Y_AXIS
@@ -74,8 +74,8 @@ spawnfunc(func_bobbing)
        controller.owner = this;
        controller.nextthink = time + 1;
        setthink(controller, func_bobbing_controller_think);
-       this.SUB_NEXTTHINK = this.SUB_LTIME + 999999999;
-       SUB_THINK(this, SUB_NullThink);
+       this.nextthink = this.ltime + 999999999;
+       setthink(this, SUB_NullThink);
 
        // Savage: Reduce bandwith, critical on e.g. nexdm02
        this.effects |= EF_LOWPRECISION;
index 916ff8ca1f1434c4f5053f995484df4bcb43cec2..c450aaa1f2a7b5f429033b51fb05763c1c1ed733 100644 (file)
@@ -8,8 +8,8 @@ void button_return(entity this);
 void button_wait(entity this)
 {
        this.state = STATE_TOP;
-       this.SUB_NEXTTHINK = this.SUB_LTIME + this.wait;
-       SUB_THINK(this, button_return);
+       this.nextthink = this.ltime + this.wait;
+       setthink(this, button_return);
        SUB_UseTargets(this, this.enemy, NULL);
        this.frame = 1;                 // use alternate textures
 }
index b0cc44f96543adbc7c23c4f14cca4b821f58492f..01250e0aae6ab3baba60262094db79c95d43fff2 100644 (file)
@@ -94,12 +94,12 @@ void door_hit_top(entity this)
                return;         // don't come down automatically
        if (this.classname == "door")
        {
-               SUB_THINK(this, door_go_down);
+               setthink(this, door_go_down);
        } else
        {
-               SUB_THINK(this, door_rotating_go_down);
+               setthink(this, door_rotating_go_down);
        }
-       this.SUB_NEXTTHINK = this.SUB_LTIME + this.wait;
+       this.nextthink = this.ltime + this.wait;
 }
 
 void door_hit_bottom(entity this)
@@ -130,7 +130,7 @@ void door_go_up(entity this)
 
        if (this.state == STATE_TOP)
        {       // reset top wait time
-               this.SUB_NEXTTHINK = this.SUB_LTIME + this.wait;
+               this.nextthink = this.ltime + this.wait;
                return;
        }
 
@@ -353,8 +353,8 @@ void door_rotating_hit_top(entity this)
        this.state = STATE_TOP;
        if (this.spawnflags & DOOR_TOGGLE)
                return;         // don't come down automatically
-       SUB_THINK(this, door_rotating_go_down);
-       this.SUB_NEXTTHINK = this.SUB_LTIME + this.wait;
+       setthink(this, door_rotating_go_down);
+       this.nextthink = this.ltime + this.wait;
 }
 
 void door_rotating_hit_bottom(entity this)
@@ -390,7 +390,7 @@ void door_rotating_go_up(entity this, entity oth)
 
        if (this.state == STATE_TOP)
        {       // reset top wait time
-               this.SUB_NEXTTHINK = this.SUB_LTIME + this.wait;
+               this.nextthink = this.ltime + this.wait;
                return;
        }
        if (this.noise2 != "")
@@ -639,7 +639,7 @@ float door_send(entity this, entity to, float sf)
                WriteShort(MSG_ENTITY, this.speed);
                WriteByte(MSG_ENTITY, this.lip);
                WriteByte(MSG_ENTITY, this.state);
-               WriteCoord(MSG_ENTITY, this.SUB_LTIME);
+               WriteCoord(MSG_ENTITY, this.ltime);
        }
 
        if(sf & SF_TRIGGER_RESET)
@@ -674,7 +674,7 @@ void door_link()
 
 void door_init_startopen(entity this)
 {
-       SUB_SETORIGIN(this, this.pos2);
+       setorigin(this, this.pos2);
        this.pos2 = this.pos1;
        this.pos1 = this.origin;
 
@@ -685,11 +685,11 @@ void door_init_startopen(entity this)
 
 void door_reset(entity this)
 {
-       SUB_SETORIGIN(this, this.pos1);
-       this.SUB_VELOCITY = '0 0 0';
+       setorigin(this, this.pos1);
+       this.velocity = '0 0 0';
        this.state = STATE_BOTTOM;
-       SUB_THINK(this, func_null);
-       this.SUB_NEXTTHINK = 0;
+       setthink(this, func_null);
+       this.nextthink = 0;
 
 #ifdef SVQC
        this.SendFlags |= SF_TRIGGER_RESET;
@@ -746,7 +746,7 @@ spawnfunc(func_door)
        if (!this.lip)
                this.lip = 8;
 
-       this.pos1 = this.SUB_ORIGIN;
+       this.pos1 = this.origin;
        this.pos2 = this.pos1 + this.movedir*(fabs(this.movedir*this.size) - this.lip);
 
        if(this.spawnflags & DOOR_NONSOLID)
@@ -814,7 +814,7 @@ NET_HANDLE(ENT_CLIENT_DOOR, bool isnew)
                this.speed = ReadShort();
                this.lip = ReadByte();
                this.state = ReadByte();
-               this.SUB_LTIME = ReadCoord();
+               this.ltime = ReadCoord();
 
                this.solid = SOLID_BSP;
                set_movetype(this, MOVETYPE_PUSH);
index 0b8930aec5a494aca16a3a889a5b02fdb2df8bf9..0bad196abf3a57a79a4fbac2637170f35321bdf6 100644 (file)
@@ -39,7 +39,7 @@ void fd_secret_use(entity this, entity actor, entity trigger)
 
        if (this.noise1 != "")
                _sound(this, CH_TRIGGER_SINGLE, this.noise1, VOL_BASE, ATTEN_NORM);
-       this.SUB_NEXTTHINK = this.SUB_LTIME + 0.1;
+       this.nextthink = this.ltime + 0.1;
 
        temp = 1 - (this.spawnflags & SECRET_1ST_LEFT); // 1 or -1
        makevectors(this.mangle);
@@ -74,7 +74,7 @@ void fd_secret_damage(entity this, entity inflictor, entity attacker, float dama
 // Wait after first movement...
 void fd_secret_move1(entity this)
 {
-       this.SUB_NEXTTHINK = this.SUB_LTIME + 1.0;
+       this.nextthink = this.ltime + 1.0;
        setthink(this, fd_secret_move2);
        if (this.noise3 != "")
                _sound(this, CH_TRIGGER_SINGLE, this.noise3, VOL_BASE, ATTEN_NORM);
@@ -95,7 +95,7 @@ void fd_secret_move3(entity this)
                _sound(this, CH_TRIGGER_SINGLE, this.noise3, VOL_BASE, ATTEN_NORM);
        if (!(this.spawnflags & SECRET_OPEN_ONCE))
        {
-               this.SUB_NEXTTHINK = this.SUB_LTIME + this.wait;
+               this.nextthink = this.ltime + this.wait;
                setthink(this, fd_secret_move4);
        }
 }
@@ -111,7 +111,7 @@ void fd_secret_move4(entity this)
 // Wait 1 second...
 void fd_secret_move5(entity this)
 {
-       this.SUB_NEXTTHINK = this.SUB_LTIME + 1.0;
+       this.nextthink = this.ltime + 1.0;
        setthink(this, fd_secret_move6);
        if (this.noise3 != "")
                _sound(this, CH_TRIGGER_SINGLE, this.noise3, VOL_BASE, ATTEN_NORM);
@@ -179,7 +179,7 @@ void secret_reset(entity this)
        }
        setorigin(this, this.oldorigin);
        setthink(this, func_null);
-       this.SUB_NEXTTHINK = 0;
+       this.nextthink = 0;
 }
 
 /*QUAKED spawnfunc_func_door_secret (0 .5 .8) ? open_once 1st_left 1st_down no_shoot always_shoot
index 600f3937301fdbd6695e1272e1623bfbd76ea41b..28e0f0f7c74df039f84a7f2d111ca32a634f0844 100644 (file)
@@ -78,8 +78,8 @@ spawnfunc(func_fourier)
        controller.owner = this;
        controller.nextthink = time + 1;
        setthink(controller, func_fourier_controller_think);
-       this.SUB_NEXTTHINK = this.SUB_LTIME + 999999999;
-       SUB_THINK(this, SUB_NullThink); // for PushMove
+       this.nextthink = this.ltime + 999999999;
+       setthink(this, SUB_NullThink); // for PushMove
 
        // Savage: Reduce bandwith, critical on e.g. nexdm02
        this.effects |= EF_LOWPRECISION;
index 946712509b0fbea3b1a5752cdcf6da94531a3e3e..a59f7a93baf6a6427dc8b7813e020ec50e39ae54 100644 (file)
@@ -67,8 +67,8 @@ spawnfunc(func_pendulum)
        controller.owner = this;
        controller.nextthink = time + 1;
        setthink(controller, func_pendulum_controller_think);
-       this.nextthink = this.SUB_LTIME + 999999999;
-       SUB_THINK(this, SUB_NullThink); // for PushMove
+       this.nextthink = this.ltime + 999999999;
+       setthink(this, SUB_NullThink); // for PushMove
 
        //this.effects |= EF_LOWPRECISION;
 
index 1adaea91d354db13b259a0109fb86da46efd3352..9715c25452dcaef75849c5700f6b37c5a09b6b05 100644 (file)
@@ -69,8 +69,8 @@ spawnfunc(func_rotating)
     setblocked(this, generic_plat_blocked);
 
        // wait for targets to spawn
-       this.SUB_NEXTTHINK = this.SUB_LTIME + 999999999;
-       SUB_THINK(this, SUB_NullThink); // for PushMove
+       this.nextthink = this.ltime + 999999999;
+       setthink(this, SUB_NullThink); // for PushMove
 
        // TODO make a reset function for this one
 }
index 838632b750a7a97ca1a2c0e426a2fd724614e399..c5a6e3d0393edebcbfd249296f6ecd8d78eb3dd4 100644 (file)
@@ -29,7 +29,7 @@ void train_wait(entity this)
                ang_x = -ang_x; // flip up / down orientation
 
                if(this.wait > 0) // slow turning
-                       SUB_CalcAngleMove(this, ang, TSPEED_TIME, this.SUB_LTIME - time + this.wait, train_wait);
+                       SUB_CalcAngleMove(this, ang, TSPEED_TIME, this.ltime - time + this.wait, train_wait);
                else // instant turning
                        SUB_CalcAngleMove(this, ang, TSPEED_TIME, 0.0000001, train_wait);
                this.train_wait_turning = true;
@@ -46,8 +46,8 @@ void train_wait(entity this)
        if(tg.spawnflags & 4)
        {
                this.use = train_use;
-               SUB_THINK(this, func_null);
-               this.SUB_NEXTTHINK = 0;
+               setthink(this, func_null);
+               this.nextthink = 0;
        }
        else
 #endif
@@ -58,8 +58,8 @@ void train_wait(entity this)
        }
        else
        {
-               SUB_THINK(this, train_next);
-               this.SUB_NEXTTHINK = this.SUB_LTIME + this.wait;
+               setthink(this, train_next);
+               this.nextthink = this.ltime + this.wait;
        }
 }
 
@@ -201,8 +201,8 @@ void train_link(entity this)
 
 void train_use(entity this, entity actor, entity trigger)
 {
-       this.SUB_NEXTTHINK = this.SUB_LTIME + 1;
-       SUB_THINK(this, train_next);
+       this.nextthink = this.ltime + 1;
+       setthink(this, train_next);
        this.use = func_null; // not again
        if(trigger.target2 && trigger.target2 != "")
                this.future_target = find(NULL, targetname, trigger.target2);
@@ -217,12 +217,12 @@ void func_train_find(entity this)
        this.future_target = train_next_find(targ);
        if (this.target == "")
                objerror(this, "func_train_find: no next target");
-       SUB_SETORIGIN(this, targ.origin - this.view_ofs);
+       setorigin(this, targ.origin - this.view_ofs);
 
        if(!(this.spawnflags & 4))
        {
-               this.SUB_NEXTTHINK = this.SUB_LTIME + 1;
-               SUB_THINK(this, train_next);
+               this.nextthink = this.ltime + 1;
+               setthink(this, train_next);
        }
 
        train_link(this);
index 18d58d649177124543cec55d6834644e99ec58f9..951a740a2024675371cd2e35412f8887adfe188e 100644 (file)
@@ -146,8 +146,8 @@ spawnfunc(func_vectormamamam)
                return;
 
        // wait for targets to spawn
-       this.SUB_NEXTTHINK = this.SUB_LTIME + 999999999;
-       SUB_THINK(this, SUB_NullThink); // for PushMove
+       this.nextthink = this.ltime + 999999999;
+       setthink(this, SUB_NullThink); // for PushMove
 
        // Savage: Reduce bandwith, critical on e.g. nexdm02
        this.effects |= EF_LOWPRECISION;
index 10af3e1944316a7f1b6299297cfbd6a3686cb3d3..09e733000f21dc4582627f670a766af704545de8 100644 (file)
@@ -63,8 +63,8 @@ void plat_hit_top(entity this)
        _sound (this, CH_TRIGGER_SINGLE, this.noise1, VOL_BASE, ATTEN_NORM);
        this.state = 1;
 
-       SUB_THINK(this, plat_go_down);
-       this.SUB_NEXTTHINK = this.SUB_LTIME + 3;
+       setthink(this, plat_go_down);
+       this.nextthink = this.ltime + 3;
 }
 
 void plat_hit_bottom(entity this)
@@ -105,7 +105,7 @@ void plat_center_touch(entity this, entity toucher)
        if (this.enemy.state == 2) {
                plat_go_up(this.enemy);
        } else if (this.enemy.state == 1)
-               this.enemy.SUB_NEXTTHINK = this.enemy.SUB_LTIME + 1;
+               this.enemy.nextthink = this.enemy.ltime + 1;
 }
 
 void plat_outside_touch(entity this, entity toucher)
index b7cea323d59f4da36c1ab74dffd11bf9796004ca..7b387da5ea97783009733ca9476a9c3cbdffa742 100644 (file)
@@ -14,9 +14,9 @@ Applies some friction to this
 .float friction;
 void SUB_Friction (entity this)
 {
-       this.SUB_NEXTTHINK = time;
+       this.nextthink = time;
        if(IS_ONGROUND(this))
-               this.SUB_VELOCITY = this.SUB_VELOCITY * (1 - frametime * this.friction);
+               this.velocity = this.velocity * (1 - frametime * this.friction);
 }
 
 /*
@@ -49,13 +49,13 @@ void SUB_SetFade_Think (entity this)
 {
        if(this.alpha == 0)
                this.alpha = 1;
-       SUB_THINK(this, SUB_SetFade_Think);
-       this.SUB_NEXTTHINK = time;
+       setthink(this, SUB_SetFade_Think);
+       this.nextthink = time;
        this.alpha -= frametime * this.fade_rate;
        if (this.alpha < 0.01)
                SUB_VanishOrRemove(this);
        else
-               this.SUB_NEXTTHINK = time;
+               this.nextthink = time;
 }
 
 /*
@@ -68,25 +68,25 @@ Fade 'ent' out when time >= 'when'
 void SUB_SetFade (entity ent, float when, float fading_time)
 {
        ent.fade_rate = 1/fading_time;
-       SUB_THINK(ent, SUB_SetFade_Think);
-       ent.SUB_NEXTTHINK = when;
+       setthink(ent, SUB_SetFade_Think);
+       ent.nextthink = when;
 }
 
 /*
 =============
 SUB_CalcMove
 
-calculate this.SUB_VELOCITY and this.SUB_NEXTTHINK to reach dest from
-this.SUB_ORIGIN traveling at speed
+calculate this.velocity and this.nextthink to reach dest from
+this.origin traveling at speed
 ===============
 */
 void SUB_CalcMoveDone(entity this)
 {
        // After moving, set origin to exact final destination
 
-       SUB_SETORIGIN (this, this.finaldest);
-       this.SUB_VELOCITY = '0 0 0';
-       this.SUB_NEXTTHINK = -1;
+       setorigin (this, this.finaldest);
+       this.velocity = '0 0 0';
+       this.nextthink = -1;
        if (this.think1 && this.think1 != SUB_CalcMoveDone)
                this.think1 (this);
 }
@@ -122,31 +122,31 @@ void SUB_CalcMove_controller_think (entity this)
                        destangle_x = -destangle_x; // flip up / down orientation
 
                        // take the shortest distance for the angles
-                       vector v = SUB_ANGLES(this.owner);
+                       vector v = this.owner.angles;
                        v.x -= 360 * floor((v.x - destangle_x) / 360 + 0.5);
                        v.y -= 360 * floor((v.y - destangle_y) / 360 + 0.5);
                        v.z -= 360 * floor((v.z - destangle_z) / 360 + 0.5);
-                       SUB_ANGLES(this.owner) = v;
-                       angloc = destangle - SUB_ANGLES(this.owner);
+                       this.owner.angles = v;
+                       angloc = destangle - this.owner.angles;
                        angloc = angloc * (1 / PHYS_INPUT_FRAMETIME); // so it arrives for the next frame
-                       this.owner.SUB_AVELOCITY = angloc;
+                       this.owner.avelocity = angloc;
                }
                if(nexttick < this.animstate_endtime)
-                       veloc = nextpos - this.owner.SUB_ORIGIN;
+                       veloc = nextpos - this.owner.origin;
                else
-                       veloc = this.finaldest - this.owner.SUB_ORIGIN;
+                       veloc = this.finaldest - this.owner.origin;
                veloc = veloc * (1 / PHYS_INPUT_FRAMETIME); // so it arrives for the next frame
 
-               this.owner.SUB_VELOCITY = veloc;
+               this.owner.velocity = veloc;
                this.nextthink = nexttick;
        }
        else
        {
                // derivative: delta + 2 * delta2 (e.g. for angle positioning)
                entity own = this.owner;
-               SUB_THINK(own, this.think1);
+               setthink(own, this.think1);
                delete(this);
-               SUB_THUNK(own)(own);
+               getthink(own)(own);
        }
 }
 
@@ -194,19 +194,19 @@ void SUB_CalcMove_Bezier (entity this, vector tcontrol, vector tdest, float tspe
 
        this.think1 = func;
        this.finaldest = tdest;
-       SUB_THINK(this, SUB_CalcMoveDone);
+       setthink(this, SUB_CalcMoveDone);
 
        switch(tspeedtype)
        {
                default:
                case TSPEED_START:
-                       traveltime = 2 * vlen(tcontrol - this.SUB_ORIGIN) / tspeed;
+                       traveltime = 2 * vlen(tcontrol - this.origin) / tspeed;
                        break;
                case TSPEED_END:
                        traveltime = 2 * vlen(tcontrol - tdest)       / tspeed;
                        break;
                case TSPEED_LINEAR:
-                       traveltime = vlen(tdest - this.SUB_ORIGIN)        / tspeed;
+                       traveltime = vlen(tdest - this.origin)        / tspeed;
                        break;
                case TSPEED_TIME:
                        traveltime = tspeed;
@@ -215,8 +215,8 @@ void SUB_CalcMove_Bezier (entity this, vector tcontrol, vector tdest, float tspe
 
        if (traveltime < 0.1) // useless anim
        {
-               this.SUB_VELOCITY = '0 0 0';
-               this.SUB_NEXTTHINK = this.SUB_LTIME + 0.1;
+               this.velocity = '0 0 0';
+               this.nextthink = this.ltime + 0.1;
                return;
        }
 
@@ -225,16 +225,16 @@ void SUB_CalcMove_Bezier (entity this, vector tcontrol, vector tdest, float tspe
        controller.platmovetype = this.platmovetype;
        controller.platmovetype_start = this.platmovetype_start;
        controller.platmovetype_end = this.platmovetype_end;
-       SUB_CalcMove_controller_setbezier(controller, this.SUB_ORIGIN, tcontrol, tdest);
+       SUB_CalcMove_controller_setbezier(controller, this.origin, tcontrol, tdest);
        controller.finaldest = (tdest + '0 0 0.125'); // where do we want to end? Offset to overshoot a bit.
        controller.animstate_starttime = time;
        controller.animstate_endtime = time + traveltime;
        setthink(controller, SUB_CalcMove_controller_think);
-       controller.think1 = SUB_THUNK(this);
+       controller.think1 = getthink(this);
 
        // the thinking is now done by the controller
-       SUB_THINK(this, SUB_NullThink); // for PushMove
-       this.SUB_NEXTTHINK = this.SUB_LTIME + traveltime;
+       setthink(this, SUB_NullThink); // for PushMove
+       this.nextthink = this.ltime + traveltime;
 
        // invoke controller
        getthink(controller)(controller);
@@ -250,16 +250,16 @@ void SUB_CalcMove (entity this, vector tdest, float tspeedtype, float tspeed, vo
 
        this.think1 = func;
        this.finaldest = tdest;
-       SUB_THINK(this, SUB_CalcMoveDone);
+       setthink(this, SUB_CalcMoveDone);
 
-       if (tdest == this.SUB_ORIGIN)
+       if (tdest == this.origin)
        {
-               this.SUB_VELOCITY = '0 0 0';
-               this.SUB_NEXTTHINK = this.SUB_LTIME + 0.1;
+               this.velocity = '0 0 0';
+               this.nextthink = this.ltime + 0.1;
                return;
        }
 
-       delta = tdest - this.SUB_ORIGIN;
+       delta = tdest - this.origin;
 
        switch(tspeedtype)
        {
@@ -280,13 +280,13 @@ void SUB_CalcMove (entity this, vector tdest, float tspeedtype, float tspeed, vo
         // The only currently implemented alternative movement is linear (value 1)
        if (traveltime < 0.15 || (this.platmovetype_start == 1 && this.platmovetype_end == 1)) // is this correct?
        {
-               this.SUB_VELOCITY = delta * (1/traveltime);     // QuakeC doesn't allow vector/float division
-               this.SUB_NEXTTHINK = this.SUB_LTIME + traveltime;
+               this.velocity = delta * (1/traveltime); // QuakeC doesn't allow vector/float division
+               this.nextthink = this.ltime + traveltime;
                return;
        }
 
        // now just run like a bezier curve...
-       SUB_CalcMove_Bezier(this, (this.SUB_ORIGIN + tdest) * 0.5, tdest, tspeedtype, tspeed, func);
+       SUB_CalcMove_Bezier(this, (this.origin + tdest) * 0.5, tdest, tspeedtype, tspeed, func);
 }
 
 void SUB_CalcMoveEnt (entity ent, vector tdest, float tspeedtype, float tspeed, void(entity this) func)
@@ -298,18 +298,18 @@ void SUB_CalcMoveEnt (entity ent, vector tdest, float tspeedtype, float tspeed,
 =============
 SUB_CalcAngleMove
 
-calculate this.SUB_AVELOCITY and this.SUB_NEXTTHINK to reach destangle from
+calculate this.avelocity and this.nextthink to reach destangle from
 this.angles rotating
 
-The calling function should make sure this.SUB_THINK is valid
+The calling function should make sure this.setthink is valid
 ===============
 */
 void SUB_CalcAngleMoveDone(entity this)
 {
        // After rotating, set angle to exact final angle
        this.angles = this.finalangle;
-       this.SUB_AVELOCITY = '0 0 0';
-       this.SUB_NEXTTHINK = -1;
+       this.avelocity = '0 0 0';
+       this.nextthink = -1;
        if (this.think1 && this.think1 != SUB_CalcAngleMoveDone) // avoid endless loops
                this.think1 (this);
 }
@@ -327,7 +327,7 @@ void SUB_CalcAngleMove (entity this, vector destangle, float tspeedtype, float t
        this.angles_x -= 360 * floor((this.angles_x - destangle_x) / 360 + 0.5);
        this.angles_y -= 360 * floor((this.angles_y - destangle_y) / 360 + 0.5);
        this.angles_z -= 360 * floor((this.angles_z - destangle_z) / 360 + 0.5);
-       delta = destangle - this.angles;
+       vector delta = destangle - this.angles;
 
        switch(tspeedtype)
        {
@@ -344,17 +344,17 @@ void SUB_CalcAngleMove (entity this, vector destangle, float tspeedtype, float t
 
        this.think1 = func;
        this.finalangle = destangle;
-       SUB_THINK(this, SUB_CalcAngleMoveDone);
+       setthink(this, SUB_CalcAngleMoveDone);
 
        if (traveltime < 0.1)
        {
-               this.SUB_AVELOCITY = '0 0 0';
-               this.SUB_NEXTTHINK = this.SUB_LTIME + 0.1;
+               this.avelocity = '0 0 0';
+               this.nextthink = this.ltime + 0.1;
                return;
        }
 
-       this.SUB_AVELOCITY = delta * (1 / traveltime);
-       this.SUB_NEXTTHINK = this.SUB_LTIME + traveltime;
+       this.avelocity = delta * (1 / traveltime);
+       this.nextthink = this.ltime + traveltime;
 }
 
 void SUB_CalcAngleMoveEnt (entity ent, vector destangle, float tspeedtype, float tspeed, void(entity this) func)
index 4f98d5ae15cd92335c4b76282814566358ba1fa7..1b3bc5e690d438f6eeb1b0bf228eab6efd7ee75a 100644 (file)
@@ -1,16 +1,5 @@
 #pragma once
 
-#define SUB_ANGLES(s)          (s).angles
-#define SUB_VELOCITY           velocity
-#define SUB_AVELOCITY          avelocity
-#define SUB_ORIGIN                     origin
-#define SUB_SETORIGIN(s,v)     setorigin((s), (v))
-#define SUB_NEXTTHINK          nextthink
-#define SUB_THINK(e, f)     setthink(e, f)
-#define SUB_THUNK(e)        getthink(e)
-#define SUB_LTIME                      ltime
-
-
 void SUB_SetFade (entity ent, float when, float fading_time);
 void SUB_VanishOrRemove (entity ent);