]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use PHYS_INPUT_BUTTON_*
authorTimePath <andrew.hardaker1995@gmail.com>
Wed, 9 Mar 2016 09:49:56 +0000 (20:49 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Wed, 9 Mar 2016 09:49:56 +0000 (20:49 +1100)
50 files changed:
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/mutators/mutator/bloodloss/bloodloss.qc
qcsrc/common/mutators/mutator/buffs/buffs.qc
qcsrc/common/mutators/mutator/campcheck/campcheck.qc
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/mutators/mutator/overkill/hmg.qc
qcsrc/common/mutators/mutator/overkill/overkill.qc
qcsrc/common/mutators/mutator/overkill/rpc.qc
qcsrc/common/physics/player.qc
qcsrc/common/triggers/teleporters.qc
qcsrc/common/vehicles/vehicle/bumblebee.qc
qcsrc/common/vehicles/vehicle/racer.qc
qcsrc/common/vehicles/vehicle/raptor.qc
qcsrc/common/vehicles/vehicle/spiderbot.qc
qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc
qcsrc/common/viewloc.qc
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/electro.qc
qcsrc/common/weapons/weapon/fireball.qc
qcsrc/common/weapons/weapon/hagar.qc
qcsrc/common/weapons/weapon/hlac.qc
qcsrc/common/weapons/weapon/hook.qc
qcsrc/common/weapons/weapon/machinegun.qc
qcsrc/common/weapons/weapon/minelayer.qc
qcsrc/common/weapons/weapon/mortar.qc
qcsrc/common/weapons/weapon/porto.qc
qcsrc/common/weapons/weapon/rifle.qc
qcsrc/common/weapons/weapon/seeker.qc
qcsrc/common/weapons/weapon/shockwave.qc
qcsrc/common/weapons/weapon/shotgun.qc
qcsrc/common/weapons/weapon/tuba.qc
qcsrc/common/weapons/weapon/vaporizer.qc
qcsrc/common/weapons/weapon/vortex.qc
qcsrc/server/bot/aim.qc
qcsrc/server/bot/bot.qc
qcsrc/server/bot/havocbot/havocbot.qc
qcsrc/server/bot/scripting.qc
qcsrc/server/cheats.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_player.qc
qcsrc/server/defs.qh
qcsrc/server/g_damage.qc
qcsrc/server/g_hook.qc
qcsrc/server/g_world.qc
qcsrc/server/mutators/mutator/gamemode_keyhunt.qc
qcsrc/server/playerdemo.qc
qcsrc/server/weapons/weaponsystem.qc

index 346062d64bb0da1daa6171a3a739beae051f1547..8f1d8027617fd7443794b47b41fac7ddbd6cce0c 100644 (file)
@@ -90,7 +90,7 @@ bool Monster_ValidTarget(entity this, entity targ)
        || (!IS_VEHICLE(targ) && (IS_DEAD(targ) || IS_DEAD(this) || targ.health <= 0 || this.health <= 0))
        || (this.monster_follow == targ || targ.monster_follow == this)
        || (!IS_VEHICLE(targ) && (targ.flags & FL_NOTARGET))
-       || (!autocvar_g_monsters_typefrag && targ.BUTTON_CHAT)
+       || (!autocvar_g_monsters_typefrag && PHYS_INPUT_BUTTON_CHAT(targ))
        || (SAME_TEAM(targ, this))
        || (STAT(FROZEN, targ))
        || (targ.alpha != 0 && targ.alpha < 0.5)
index 4543ae10e70833c43d7f0160b81b592fbfef8a3f..de3d19038a0e47adf6cc225ec378615fbc4d365d 100644 (file)
@@ -8,7 +8,7 @@ MUTATOR_HOOKFUNCTION(bloodloss, PlayerPreThink)
        if(IS_PLAYER(self))
        if(self.health <= autocvar_g_bloodloss && !IS_DEAD(self))
        {
-               self.BUTTON_CROUCH = true;
+               PHYS_INPUT_BUTTON_CROUCH(self) = true;
 
                if(time >= self.bloodloss_timer)
                {
index 903237f92b1fd6c86d6216b7667b4d1ece3bf770..a9c56737e92cb209aafc8995eb6deb26f35ab8b9 100644 (file)
@@ -755,7 +755,7 @@ MUTATOR_HOOKFUNCTION(buffs, ForbidThrowCurrentWeapon)
                        // set pusher so self gets the kill if they fall into void
                        closest.pusher = self;
                        closest.pushltime = time + autocvar_g_maxpushtime;
-                       closest.istypefrag = closest.BUTTON_CHAT;
+                       closest.istypefrag = PHYS_INPUT_BUTTON_CHAT(closest);
 
                        Send_Effect(EFFECT_ELECTRO_COMBO, their_org, '0 0 0', 1);
                        Send_Effect(EFFECT_ELECTRO_COMBO, my_org, '0 0 0', 1);
index 4916464a1be8dc0e5705d9eebaa801628eb40fae..06ce98b94fea88d2e7e37c1f16a55f69c87491b4 100644 (file)
@@ -36,7 +36,7 @@ MUTATOR_HOOKFUNCTION(campcheck, PlayerPreThink)
        if(IS_REAL_CLIENT(self)) // bots may camp, but that's no reason to constantly kill them
        if(!IS_DEAD(self))
        if(!STAT(FROZEN, self))
-       if(!self.BUTTON_CHAT)
+       if(!PHYS_INPUT_BUTTON_CHAT(self))
        if(autocvar_g_campcheck_interval)
        {
                vector dist;
index b54ee9176b1a68da7629d24bd7db2f210195f1ab..e8014182269d78dc5f857ae8fa612a7dd404d6f3 100644 (file)
@@ -844,7 +844,7 @@ void toss_nade(entity e, bool set_owner, vector _velocity, float _time)
        if (trace_startsolid)
                setorigin(_nade, e.origin);
 
-       if(self.v_angle.x >= 70 && self.v_angle.x <= 110 && self.BUTTON_CROUCH)
+       if(self.v_angle.x >= 70 && self.v_angle.x <= 110 && PHYS_INPUT_BUTTON_CROUCH(self))
                _nade.velocity = '0 0 100';
        else if(autocvar_g_nades_nade_newton_style == 1)
                _nade.velocity = e.velocity + _velocity;
index c08c3690ee51d7d80b43637448bac8e6d3184e9a..fb1a496331c5a1c42bae9afd6f2c21ff6d163c61 100644 (file)
@@ -56,7 +56,7 @@ spawnfunc(weapon_hmg) { weapon_defaultspawnfunc(this, WEP_HMG); }
 
 void W_HeavyMachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity weaponentity, int fire)
 {
-       if (!actor.BUTTON_ATCK)
+       if (!PHYS_INPUT_BUTTON_ATCK(actor))
        {
                w_ready(thiswep, actor, weaponentity, fire);
                return;
@@ -101,9 +101,9 @@ void W_HeavyMachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity weapone
                METHOD(HeavyMachineGun, wr_aim, void(entity thiswep))
                {
                        if(vdist(self.origin - self.enemy.origin, <, 3000 - bound(0, skill, 10) * 200))
-                               self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false);
+                               PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(1000000, 0, 0.001, false);
                        else
-                               self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, false);
+                               PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(1000000, 0, 0.001, false);
                }
                METHOD(HeavyMachineGun, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
                {
index f0db0836abce571180cbce94e112276f0db16ccb..972220e7516d21e650870afe7e533f969dc0b5a9 100644 (file)
@@ -77,7 +77,7 @@ void ok_IncreaseCharge(entity ent, int wep)
        if (wepent == WEP_Null) return;  // dummy
 
        if(ent.ok_use_ammocharge)
-       if(!ent.BUTTON_ATCK) // not while attacking?
+       if(!PHYS_INPUT_BUTTON_ATCK(ent)) // not while attacking?
                ent.ammo_charge[wep] = min(autocvar_g_overkill_ammo_charge_limit, ent.ammo_charge[wep] + cvar(sprintf("g_overkill_ammo_charge_rate_%s", wepent.netname)) * frametime / W_TICSPERFRAME);
 }
 
@@ -188,7 +188,7 @@ MUTATOR_HOOKFUNCTION(ok, PlayerPreThink)
 
        ok_IncreaseCharge(self, PS(self).m_weapon.m_id);
 
-       if(self.BUTTON_ATCK2)
+       if(PHYS_INPUT_BUTTON_ATCK2(self))
        if(!forbidWeaponUse(self) || self.weapon_blocked) // allow if weapon is blocked
        if(time >= self.jump_interval)
        {
@@ -220,7 +220,7 @@ MUTATOR_HOOKFUNCTION(ok, PlayerPreThink)
        if(self.ok_use_ammocharge)
        if(!ok_CheckWeaponCharge(self, PS(self).m_weapon.m_id))
        {
-               if(autocvar_g_overkill_ammo_charge_notice && time > self.ok_notice_time && self.BUTTON_ATCK && IS_REAL_CLIENT(self) && PS(self).m_weapon == PS(self).m_switchweapon)
+               if(autocvar_g_overkill_ammo_charge_notice && time > self.ok_notice_time && PHYS_INPUT_BUTTON_ATCK(self) && IS_REAL_CLIENT(self) && PS(self).m_weapon == PS(self).m_switchweapon)
                {
                        //Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_OVERKILL_CHARGE);
                        self.ok_notice_time = time + 2;
@@ -229,12 +229,12 @@ MUTATOR_HOOKFUNCTION(ok, PlayerPreThink)
                Weapon wpn = PS(self).m_weapon;
                .entity weaponentity = weaponentities[0]; // TODO: unhardcode
                if(self.(weaponentity).state != WS_CLEAR)
-                       w_ready(wpn, self, weaponentity, (self.BUTTON_ATCK ? 1 : 0) | (self.BUTTON_ATCK2 ? 2 : 0));
+                       w_ready(wpn, self, weaponentity, PHYS_INPUT_BUTTON_ATCK(self) | (PHYS_INPUT_BUTTON_ATCK2(self) << 1));
 
                self.weapon_blocked = true;
        }
 
-       self.BUTTON_ATCK2 = 0;
+       PHYS_INPUT_BUTTON_ATCK2(self) = false;
 
        return false;
 }
index 96e54d5a02c92dfb58feecf7a3688a8e3dc34cad..5b108c7923d7a93969a26f886ee21ae98321a352 100644 (file)
@@ -152,7 +152,7 @@ void W_RocketPropelledChainsaw_Attack (Weapon thiswep)
 
                METHOD(RocketPropelledChainsaw, wr_aim, void(entity thiswep))
                {
-                       self.BUTTON_ATCK = bot_aim(WEP_CVAR(rpc, speed), 0, WEP_CVAR(rpc, lifetime), false);
+                       PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR(rpc, speed), 0, WEP_CVAR(rpc, lifetime), false);
                }
                METHOD(RocketPropelledChainsaw, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
                {
index 208b16c3b8f6473acde347790d82cd23d0425619..af3f87c158a4bb259dc9d7868b6fc82e03ff30d8 100644 (file)
@@ -690,7 +690,7 @@ void PM_check_nickspam(entity this)
        {
                // slight annoyance for nick change scripts
                this.movement = -1 * this.movement;
-               this.BUTTON_ATCK = this.BUTTON_JUMP = this.BUTTON_ATCK2 = this.BUTTON_ZOOM = this.BUTTON_CROUCH = this.BUTTON_HOOK = this.BUTTON_USE = 0;
+               PHYS_INPUT_BUTTON_ATCK(this) = PHYS_INPUT_BUTTON_JUMP(this) = PHYS_INPUT_BUTTON_ATCK2(this) = PHYS_INPUT_BUTTON_ZOOM(this) = PHYS_INPUT_BUTTON_CROUCH(this) = PHYS_INPUT_BUTTON_HOOK(this) = PHYS_INPUT_BUTTON_USE(this) = false;
 
                if (this.nickspamcount >= autocvar_g_nick_flood_penalty_red) // if you are persistent and the slight annoyance above does not stop you, I'll show you!
                {
@@ -992,7 +992,7 @@ void PM_jetpack(entity this, float maxspd_mod)
        // add the unused velocity as up component
        wishvel_z = 0;
 
-       // if (this.BUTTON_JUMP)
+       // if (PHYS_INPUT_BUTTON_JUMP(this))
                wishvel_z = sqrt(max(0, 1 - wishvel * wishvel));
 
        // it is now normalized, so...
index eae31ead021891d6b9f8e8803175a4bbda5363b1..801776857a808423b39c30e9b6645209eace97eb 100644 (file)
@@ -160,7 +160,7 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle
                {
                        player.pusher = teleporter.owner;
                        player.pushltime = time + autocvar_g_maxpushtime;
-                       player.istypefrag = player.BUTTON_CHAT;
+                       player.istypefrag = PHYS_INPUT_BUTTON_CHAT(player);
                }
                else
                {
index f65bb0cd554a728c046ae181cc5f85abaab58ed0..194ff13654600486edbabdc0f57acfd944ef6239 100644 (file)
@@ -178,7 +178,7 @@ float bumblebee_gunner_frame()
                                                  _out * -1,  _in,  autocvar_g_vehicle_bumblebee_cannon_turnspeed);
 
        if(!forbidWeaponUse(gunner))
-       if(gunner.BUTTON_ATCK)
+       if(PHYS_INPUT_BUTTON_ATCK(gunner))
                if(time > gun.attack_finished_single[0])
                        if(gun.vehicle_energy >= autocvar_g_vehicle_bumblebee_cannon_cost)
                        {
@@ -202,7 +202,7 @@ float bumblebee_gunner_frame()
                UpdateAuxiliaryXhair(vehic.owner, trace_endpos, ('1 0 0' * gunner.vehicle_reload1) + ('0 1 0' *(1 - gunner.vehicle_reload1)), ((gunner == vehic.gunner1) ? 1 : 2));
 
        vehic.solid = SOLID_BBOX;
-       gunner.BUTTON_ATCK = gunner.BUTTON_ATCK2 = gunner.BUTTON_CROUCH = 0;
+       PHYS_INPUT_BUTTON_ATCK(gunner) = PHYS_INPUT_BUTTON_ATCK2(gunner) = PHYS_INPUT_BUTTON_CROUCH(gunner) = false;
        gunner.vehicle_energy = (gun.vehicle_energy / autocvar_g_vehicle_bumblebee_cannon_ammo) * 100;
 
        setself(gunner);
@@ -436,7 +436,7 @@ float bumblebee_pilot_frame()
        if(IS_DEAD(vehic))
        {
                setself(pilot);
-               pilot.BUTTON_ATCK = pilot.BUTTON_ATCK2 = 0;
+               PHYS_INPUT_BUTTON_ATCK(pilot) = PHYS_INPUT_BUTTON_ATCK2(pilot) = false;
                return 1;
        }
 
@@ -504,9 +504,9 @@ float bumblebee_pilot_frame()
                        vehic.angles_z = 0;
        }
 
-       if(pilot.BUTTON_CROUCH)
+       if(PHYS_INPUT_BUTTON_CROUCH(pilot))
                newvel -=   v_up * autocvar_g_vehicle_bumblebee_speed_down;
-       else if(pilot.BUTTON_JUMP)
+       else if(PHYS_INPUT_BUTTON_JUMP(pilot))
                newvel +=  v_up * autocvar_g_vehicle_bumblebee_speed_up;
 
        vehic.velocity  += newvel * frametime;
@@ -550,7 +550,7 @@ float bumblebee_pilot_frame()
                                          autocvar_g_vehicle_bumblebee_raygun_turnlimit_sides * -1,  autocvar_g_vehicle_bumblebee_raygun_turnlimit_sides,  autocvar_g_vehicle_bumblebee_raygun_turnspeed);
 
        if(!forbidWeaponUse(pilot))
-       if((pilot.BUTTON_ATCK || pilot.BUTTON_ATCK2) && (vehic.vehicle_energy > autocvar_g_vehicle_bumblebee_raygun_dps * sys_frametime || autocvar_g_vehicle_bumblebee_raygun == 0))
+       if((PHYS_INPUT_BUTTON_ATCK(pilot) || PHYS_INPUT_BUTTON_ATCK2(pilot)) && (vehic.vehicle_energy > autocvar_g_vehicle_bumblebee_raygun_dps * sys_frametime || autocvar_g_vehicle_bumblebee_raygun == 0))
        {
                vehic.gun3.enemy.realowner = pilot;
                vehic.gun3.enemy.effects &= ~EF_NODRAW;
@@ -633,7 +633,7 @@ float bumblebee_pilot_frame()
        vehic.angles_x *= -1;
        setorigin(pilot, vehic.origin + v_up * 48 + v_forward * 160);
 
-       pilot.BUTTON_ATCK = pilot.BUTTON_ATCK2 = pilot.BUTTON_CROUCH = 0;
+       PHYS_INPUT_BUTTON_ATCK(pilot) = PHYS_INPUT_BUTTON_ATCK2(pilot) = PHYS_INPUT_BUTTON_CROUCH(pilot) = false;
        setself(pilot);
 
        return 1;
index 7e9632d9644b02e1bfcec143cec79218c7f6ecd6..74ed19e69f170a41854c04bcf27d767668331ee5 100644 (file)
@@ -127,7 +127,7 @@ void racer_align4point(entity this, float _delta)
        {
                uforce = autocvar_g_vehicle_racer_water_upforcedamper;
 
-               if(this.owner.BUTTON_CROUCH && time < this.air_finished)
+               if(PHYS_INPUT_BUTTON_CROUCH(this.owner) && time < this.air_finished)
                        this.velocity_z += 30;
                else
                        this.velocity_z += 200;
@@ -187,13 +187,13 @@ float racer_frame()
        if(IS_DEAD(racer))
        {
                setself(player);
-               player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
+               PHYS_INPUT_BUTTON_ATCK(player) = PHYS_INPUT_BUTTON_ATCK2(player) = false;
                return 1;
        }
 
        racer_align4point(self, PHYS_INPUT_TIMELENGTH);
 
-       player.BUTTON_ZOOM = player.BUTTON_CROUCH = 0;
+       PHYS_INPUT_BUTTON_ZOOM(player) = PHYS_INPUT_BUTTON_CROUCH(player) = false;
 
        crosshair_trace(player);
 
@@ -311,7 +311,7 @@ float racer_frame()
 #ifdef SVQC
        Weapon wep1 = WEP_RACER;
        if (!forbidWeaponUse(player))
-       if (player.BUTTON_ATCK)
+       if (PHYS_INPUT_BUTTON_ATCK(player))
        if (wep1.wr_checkammo1(wep1))
        {
                string tagname = (racer.cnt)
@@ -346,7 +346,7 @@ float racer_frame()
 
        if(!forbidWeaponUse(player))
        if(time > racer.delay)
-       if(player.BUTTON_ATCK2)
+       if(PHYS_INPUT_BUTTON_ATCK2(player))
        {
                racer.misc_bulletcounter += 1;
                racer.delay = time + 0.3;
@@ -388,7 +388,7 @@ float racer_frame()
        if(racer.vehicle_flags & VHF_HASSHIELD)
                VEHICLE_UPDATE_PLAYER(player, shield, racer);
 
-       player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
+       PHYS_INPUT_BUTTON_ATCK(player) = PHYS_INPUT_BUTTON_ATCK2(player) = false;
 #endif
 
        setorigin(player,racer.origin + '0 0 32');
index 67c67d9483cb490025519d44c6bb7c3fefdfabb9..caf253aee00c41b76b563d8bc8f57264c8931c3d 100644 (file)
@@ -204,7 +204,7 @@ float raptor_frame()
        if(IS_DEAD(raptor))
        {
                setself(player);
-               player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
+               PHYS_INPUT_BUTTON_ATCK(player) = PHYS_INPUT_BUTTON_ATCK2(player) = false;
                return 1;
        }
        crosshair_trace(player);
@@ -213,10 +213,10 @@ float raptor_frame()
        //{
                if(raptor.angles_z > 50 || raptor.angles_z < -50)
                {
-                       if(player.BUTTON_JUMP)
+                       if(PHYS_INPUT_BUTTON_JUMP(player))
                        {
-                               player.BUTTON_CROUCH = true;
-                               player.BUTTON_JUMP = false;
+                               PHYS_INPUT_BUTTON_CROUCH(player) = true;
+                               PHYS_INPUT_BUTTON_JUMP(player) = false;
                        }
                }
        //}
@@ -279,9 +279,9 @@ float raptor_frame()
                        raptor.angles_z = 0;
        }
 
-       if(player.BUTTON_CROUCH)
+       if(PHYS_INPUT_BUTTON_CROUCH(player))
                df -=   v_up * autocvar_g_vehicle_raptor_speed_down;
-       else if (player.BUTTON_JUMP)
+       else if (PHYS_INPUT_BUTTON_JUMP(player))
                df +=  v_up * autocvar_g_vehicle_raptor_speed_up;
 
        raptor.velocity  += df * frametime;
@@ -392,7 +392,7 @@ float raptor_frame()
 
        Weapon wep1 = WEP_RAPTOR;
        if(!forbidWeaponUse(player))
-       if(player.BUTTON_ATCK)
+       if(PHYS_INPUT_BUTTON_ATCK(player))
        if (wep1.wr_checkammo1(wep1))
        {
            .entity weaponentity = weaponentities[0];
@@ -413,7 +413,7 @@ float raptor_frame()
        if(raptor.vehicle_weapon2mode == RSM_BOMB)
        {
                if(time > raptor.lip + autocvar_g_vehicle_raptor_bombs_refire)
-               if(player.BUTTON_ATCK2)
+               if(PHYS_INPUT_BUTTON_ATCK2(player))
                {
                    .entity weaponentity = weaponentities[1];
                        wep2a.wr_think(wep2a, self, weaponentity, 2);
@@ -425,7 +425,7 @@ float raptor_frame()
        {
                Weapon wep2b = WEP_RAPTOR_FLARE;
                if(time > raptor.lip + autocvar_g_vehicle_raptor_flare_refire)
-               if(player.BUTTON_ATCK2)
+               if(PHYS_INPUT_BUTTON_ATCK2(player))
                {
                    .entity weaponentity = weaponentities[1];
                        wep2b.wr_think(wep2b, self, weaponentity, 2);
@@ -464,7 +464,7 @@ float raptor_frame()
        if(self.vehicle_flags & VHF_HASSHIELD)
                VEHICLE_UPDATE_PLAYER(player, shield, raptor);
 
-       player.BUTTON_ATCK = player.BUTTON_ATCK2 = player.BUTTON_CROUCH = 0;
+       PHYS_INPUT_BUTTON_ATCK(player) = PHYS_INPUT_BUTTON_ATCK2(player) = PHYS_INPUT_BUTTON_CROUCH(player) = false;
 
        setself(player);
        return 1;
@@ -495,7 +495,7 @@ float raptor_takeoff()
                raptor.velocity_z = min(raptor.velocity_z * 1.5, 256);
                self.bomb1.gun1.avelocity_y = 90 + ((raptor.frame / 25) * 25000);
                self.bomb1.gun2.avelocity_y = -self.bomb1.gun1.avelocity_y;
-               player.BUTTON_ATCK = player.BUTTON_ATCK2 = player.BUTTON_CROUCH = 0;
+               PHYS_INPUT_BUTTON_ATCK(player) = PHYS_INPUT_BUTTON_ATCK2(player) = PHYS_INPUT_BUTTON_CROUCH(player) = false;
 
                setorigin(player, raptor.origin + '0 0 32');
        }
@@ -521,7 +521,7 @@ float raptor_takeoff()
        if(self.vehicle_flags & VHF_HASSHIELD)
                VEHICLE_UPDATE_PLAYER(player, shield, raptor);
 
-       player.BUTTON_ATCK = player.BUTTON_ATCK2 = player.BUTTON_CROUCH = 0;
+       PHYS_INPUT_BUTTON_ATCK(player) = PHYS_INPUT_BUTTON_ATCK2(player) = PHYS_INPUT_BUTTON_CROUCH(player) = false;
        setself(player);
        return 1;
 }
index 5bb26070d564e5d7d2523964339e85608b736641..41d67a78f1c900474ce65ab5ab543d87601dbd0d 100644 (file)
@@ -89,8 +89,8 @@ float spiderbot_frame()
 
        setself(spider);
 
-       player.BUTTON_ZOOM        = 0;
-       player.BUTTON_CROUCH    = 0;
+       PHYS_INPUT_BUTTON_ZOOM(player) = false;
+       PHYS_INPUT_BUTTON_CROUCH(player) = false;
        PS(player).m_switchweapon = WEP_Null;
        player.vehicle_weapon2mode = spider.vehicle_weapon2mode;
 
@@ -149,10 +149,10 @@ float spiderbot_frame()
                        spider.frame = 5;
                }
 
-               if(!player.BUTTON_JUMP)
-                       spider.BUTTON_JUMP = 0;
+               if (!PHYS_INPUT_BUTTON_JUMP(player))
+                       PHYS_INPUT_BUTTON_JUMP(spider) = false;
 
-               if((IS_ONGROUND(spider)) && player.BUTTON_JUMP && !spider.BUTTON_JUMP && self.tur_head.wait < time)
+               if((IS_ONGROUND(spider)) && PHYS_INPUT_BUTTON_JUMP(player) && !PHYS_INPUT_BUTTON_JUMP(spider) && self.tur_head.wait < time)
                {
                        sound (self, CH_TRIGGER_SINGLE, SND_VEH_SPIDERBOT_JUMP, VOL_VEHICLEENGINE, ATTEN_NORM);
                        //dprint("spiderbot_jump:", ftos(soundlength("vehicles/spiderbot_jump.wav")), "\n");
@@ -160,8 +160,8 @@ float spiderbot_frame()
 
                        self.tur_head.wait = time + 2;
                        spider.jump_delay = time + 2;
-                       spider.BUTTON_JUMP = 1; // set spider's jump
-                       //player.BUTTON_JUMP = 0;
+                       PHYS_INPUT_BUTTON_JUMP(spider) = true; // set spider's jump
+                       //PHYS_INPUT_BUTTON_JUMP(player) = false;
 
                        vector movefix = '0 0 0';
                        if(player.movement_x > 0) movefix_x = 1;
@@ -224,7 +224,7 @@ float spiderbot_frame()
                                        }
                                        player.movement_y = 0;
                                        float oldvelz = spider.velocity_z;
-                                       movelib_move_simple(self, normalize(v_forward * player.movement_x),((player.BUTTON_JUMP) ? autocvar_g_vehicle_spiderbot_speed_run : autocvar_g_vehicle_spiderbot_speed_walk),autocvar_g_vehicle_spiderbot_movement_inertia);
+                                       movelib_move_simple(self, normalize(v_forward * player.movement_x),((PHYS_INPUT_BUTTON_JUMP(player)) ? autocvar_g_vehicle_spiderbot_speed_run : autocvar_g_vehicle_spiderbot_speed_walk),autocvar_g_vehicle_spiderbot_movement_inertia);
                                        spider.velocity_z = oldvelz;
                                        float g = ((autocvar_sv_gameplayfix_gravityunaffectedbyticrate) ? 0.5 : 1);
                                        if(spider.velocity_z <= 20) // not while jumping
@@ -276,7 +276,7 @@ float spiderbot_frame()
        self.angles_z = bound(-autocvar_g_vehicle_spiderbot_tiltlimit, self.angles_z, autocvar_g_vehicle_spiderbot_tiltlimit);
 
        if(!forbidWeaponUse(player))
-       if(player.BUTTON_ATCK)
+       if(PHYS_INPUT_BUTTON_ATCK(player))
        {
                spider.cnt = time;
                if(spider.vehicle_ammo1 >= autocvar_g_vehicle_spiderbot_minigun_ammo_cost && spider.tur_head.attack_finished_single[0] <= time)
@@ -328,7 +328,7 @@ float spiderbot_frame()
        if(self.vehicle_flags  & VHF_HEALTHREGEN)
                vehicles_regen(spider.dmg_time, vehicle_health, autocvar_g_vehicle_spiderbot_health, autocvar_g_vehicle_spiderbot_health_regen_pause, autocvar_g_vehicle_spiderbot_health_regen, frametime, false);
 
-       player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
+       PHYS_INPUT_BUTTON_ATCK(player) = PHYS_INPUT_BUTTON_ATCK2(player) = false;
        //player.vehicle_ammo2 = spider.tur_head.frame;
        player.vehicle_ammo2 = (9 - spider.tur_head.frame) / 8 * 100; // Percentage, like ammo1
 
index 257eac801a5c409f854fa7092e5c100fd8b8817f..9dfc72c13e30929ef30746212079fe674183874f 100644 (file)
@@ -174,7 +174,7 @@ void spiderbot_rocket_do()
 
     if (self.wait != -10)
     {
-        if (self.owner.BUTTON_ATCK2 && self.vehicle_weapon2mode == SBRM_GUIDE)
+        if (PHYS_INPUT_BUTTON_ATCK2(self.owner) && self.vehicle_weapon2mode == SBRM_GUIDE)
         {
             if (self.wait == 1)
             if (self.tur_head.frame == 9 || self.tur_head.frame == 1)
@@ -205,7 +205,7 @@ void spiderbot_rocket_do()
     }
 
     if(self.wait != -10)
-    if(!self.owner.BUTTON_ATCK2)
+    if(!PHYS_INPUT_BUTTON_ATCK2(self.owner))
         return;
 
     if(forbidWeaponUse(self.owner))
@@ -226,7 +226,7 @@ void spiderbot_rocket_do()
             rocket.nextthink  = time + (_dist / autocvar_g_vehicle_spiderbot_rocket_speed);
             rocket.think        = vehicles_projectile_explode;
 
-            if(self.owner.BUTTON_ATCK2 && self.tur_head.frame == 1)
+            if(PHYS_INPUT_BUTTON_ATCK2(self.owner) && self.tur_head.frame == 1)
                 self.wait = -10;
             break;
         case SBRM_GUIDE:
index f67bbc88796122b20d5d9c0bcf40a2ef10647cde..fb510f8564ba50a59f63edaced5b89ed7a157197 100644 (file)
@@ -45,9 +45,9 @@ void viewloc_PlayerPhysics(entity this)
 
                //if(!PHYS_INPUT_BUTTON_CROUCH(this) && !IS_DUCKED(this))
 #ifdef SVQC
-                       //this.BUTTON_CROUCH = (old_movement_x < 0);
+                       //PHYS_INPUT_BUTTON_CROUCH(this) = (old_movement_x < 0);
                        if (old_movement.x < 0)
-                               this.BUTTON_CROUCH = true;
+                               PHYS_INPUT_BUTTON_CROUCH(this) = true;
 #elif defined(CSQC)
                        if (old_movement.x < 0)
                        {
index 1d3ea78a5bf41c0ae8fa091f87aa9467674259ca..c35ab3ede27b1403d3411c55b1d7d89deb5d7ae5 100644 (file)
@@ -312,7 +312,7 @@ void W_Arc_Beam_Think()
 
 
        float burst = 0;
-       if( (self.owner.BUTTON_ATCK2 && !WEP_CVAR(arc, bolt)) || self.beam_bursting)
+       if( (PHYS_INPUT_BUTTON_ATCK2(self.owner) && !WEP_CVAR(arc, bolt)) || self.beam_bursting)
        {
                if(!self.beam_bursting)
                        self.beam_bursting = true;
@@ -330,7 +330,7 @@ void W_Arc_Beam_Think()
                ||
                gameover
                ||
-               (!self.owner.BUTTON_ATCK && !burst )
+               (!PHYS_INPUT_BUTTON_ATCK(self.owner) && !burst )
                ||
                STAT(FROZEN, self.owner)
                ||
@@ -700,7 +700,7 @@ void Arc_Smoke()
        {
                if ( random() < self.arc_heat_percent )
                        Send_Effect(EFFECT_ARC_SMOKE, smoke_origin, '0 0 0', 1 );
-               if ( self.BUTTON_ATCK || self.BUTTON_ATCK2 )
+               if ( PHYS_INPUT_BUTTON_ATCK(self) || PHYS_INPUT_BUTTON_ATCK2(self) )
                {
                        Send_Effect(EFFECT_ARC_OVERHEAT_FIRE, smoke_origin, w_shotdir, 1 );
                        if ( !self.arc_smoke_sound )
@@ -719,7 +719,7 @@ void Arc_Smoke()
        }
 
        if (  self.arc_smoke_sound && ( self.arc_overheat <= time ||
-               !( self.BUTTON_ATCK || self.BUTTON_ATCK2 ) ) || PS(self).m_switchweapon != WEP_ARC )
+               !( PHYS_INPUT_BUTTON_ATCK(self) || PHYS_INPUT_BUTTON_ATCK2(self) ) ) || PS(self).m_switchweapon != WEP_ARC )
        {
                self.arc_smoke_sound = 0;
                sound(self, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM);
@@ -731,7 +731,7 @@ void Arc_Smoke()
                        SELFPARAM();
                        if(WEP_CVAR(arc, beam_botaimspeed))
                        {
-                               self.BUTTON_ATCK = bot_aim(
+                               PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(
                                        WEP_CVAR(arc, beam_botaimspeed),
                                        0,
                                        WEP_CVAR(arc, beam_botaimlifetime),
@@ -740,7 +740,7 @@ void Arc_Smoke()
                        }
                        else
                        {
-                               self.BUTTON_ATCK = bot_aim(
+                               PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(
                                        1000000,
                                        0,
                                        0.001,
index 1d76279f33a9e09bab8178a8e8f7723c367f0f68..69d9298b8755211a617ca232656a8a66ada1e515 100644 (file)
@@ -155,12 +155,12 @@ void W_Blaster_Attack(
                        if(WEP_CVAR(blaster, secondary))
                        {
                                if((random() * (WEP_CVAR_PRI(blaster, damage) + WEP_CVAR_SEC(blaster, damage))) > WEP_CVAR_PRI(blaster, damage))
-                                       { self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(blaster, speed), 0, WEP_CVAR_SEC(blaster, lifetime), false); }
+                                       { PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(WEP_CVAR_SEC(blaster, speed), 0, WEP_CVAR_SEC(blaster, lifetime), false); }
                                else
-                                       { self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(blaster, speed), 0, WEP_CVAR_PRI(blaster, lifetime), false); }
+                                       { PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR_PRI(blaster, speed), 0, WEP_CVAR_PRI(blaster, lifetime), false); }
                        }
                        else
-                               { self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(blaster, speed), 0, WEP_CVAR_PRI(blaster, lifetime), false); }
+                               { PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR_PRI(blaster, speed), 0, WEP_CVAR_PRI(blaster, lifetime), false); }
                }
 
                METHOD(Blaster, wr_think, void(Blaster thiswep, entity actor, .entity weaponentity, int fire))
index 455567a2f2eedf912c67349827b9632ad7c5be9f..2348a33b9e680d27aa087375db0ce14fe1a4edb7 100644 (file)
@@ -571,9 +571,9 @@ void W_Crylink_Attack2(Weapon thiswep)
                {
                        SELFPARAM();
                        if(random() < 0.10)
-                               self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(crylink, speed), 0, WEP_CVAR_PRI(crylink, middle_lifetime), false);
+                               PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR_PRI(crylink, speed), 0, WEP_CVAR_PRI(crylink, middle_lifetime), false);
                        else
-                               self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(crylink, speed), 0, WEP_CVAR_SEC(crylink, middle_lifetime), false);
+                               PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(WEP_CVAR_SEC(crylink, speed), 0, WEP_CVAR_SEC(crylink, middle_lifetime), false);
                }
                METHOD(Crylink, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
                {
index 0272e424c96b528442f4f6b898d0d66e302d72b7..3d89299e194df7f0e82630a0b9696fa659c82b6a 100644 (file)
@@ -276,7 +276,7 @@ void W_Devastator_Think()
        {
                if(self == self.realowner.lastrocket)
                if(!self.realowner.rl_release)
-               if(!self.BUTTON_ATCK2)
+               if(!PHYS_INPUT_BUTTON_ATCK2(self))
                if(WEP_CVAR(devastator, guiderate))
                if(time > self.pushltime)
                if(!IS_DEAD(self.realowner))
@@ -408,7 +408,7 @@ void W_Devastator_Attack(Weapon thiswep)
                METHOD(Devastator, wr_aim, void(entity thiswep))
                {
                        // aim and decide to fire if appropriate
-                       self.BUTTON_ATCK = bot_aim(WEP_CVAR(devastator, speed), 0, WEP_CVAR(devastator, lifetime), false);
+                       PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR(devastator, speed), 0, WEP_CVAR(devastator, lifetime), false);
                        if(skill >= 2) // skill 0 and 1 bots won't detonate rockets!
                        {
                                // decide whether to detonate rockets
@@ -421,21 +421,21 @@ void W_Devastator_Attack(Weapon thiswep)
                                        {
                                                if(targ != missile.realowner && vlen(targ.origin - missile.origin) < WEP_CVAR(devastator, radius))
                                                {
-                                                       self.BUTTON_ATCK2 = true;
+                                                       PHYS_INPUT_BUTTON_ATCK2(self) = true;
                                                        break;
                                                }
                                                targ = targ.chain;
                                        }
                                }
 
-                               if(self.BUTTON_ATCK2) self.BUTTON_ATCK = false;
+                               if(PHYS_INPUT_BUTTON_ATCK2(self)) PHYS_INPUT_BUTTON_ATCK(self) = false;
                        }
                }
                #else
                METHOD(Devastator, wr_aim, void(entity thiswep))
                {
                        // aim and decide to fire if appropriate
-                       self.BUTTON_ATCK = bot_aim(WEP_CVAR(devastator, speed), 0, WEP_CVAR(devastator, lifetime), false);
+                       PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR(devastator, speed), 0, WEP_CVAR(devastator, lifetime), false);
                        if(skill >= 2) // skill 0 and 1 bots won't detonate rockets!
                        {
                                // decide whether to detonate rockets
@@ -490,7 +490,7 @@ void W_Devastator_Attack(Weapon thiswep)
                                                        if(
                                                                (v_forward * normalize(it.origin - targ.origin)< 0.1)
                                                                && desirabledamage > 0.1*coredamage
-                                                       )self.BUTTON_ATCK2 = true;
+                                                       ) PHYS_INPUT_BUTTON_ATCK2(self) = true;
                                                        targ = targ.chain;
                                                }
                                        }
@@ -503,19 +503,19 @@ void W_Devastator_Attack(Weapon thiswep)
                                                        if(IS_PLAYER(self.enemy))
                                                                if(desirabledamage >= 0.1*coredamage)
                                                                        if(random()/distance*300 > frametime*bound(0,(10-skill)*0.2,1))
-                                                                               self.BUTTON_ATCK2 = true;
+                                                                               PHYS_INPUT_BUTTON_ATCK2(self) = true;
                                        //      dprint(ftos(random()/distance*300),">");dprint(ftos(frametime*bound(0,(10-skill)*0.2,1)),"\n");
                                        }
                                });
                                // if we would be doing at X percent of the core damage, detonate it
                                // but don't fire a new shot at the same time!
                                if(desirabledamage >= 0.75 * coredamage) //this should do group damage in rare fortunate events
-                                       self.BUTTON_ATCK2 = true;
+                                       PHYS_INPUT_BUTTON_ATCK2(self) = true;
                                if((skill > 6.5) && (selfdamage > self.health))
-                                       self.BUTTON_ATCK2 = false;
-                               //if(self.BUTTON_ATCK2 == true)
+                                       PHYS_INPUT_BUTTON_ATCK2(self) = false;
+                               //if(PHYS_INPUT_BUTTON_ATCK2(self) == true)
                                //      dprint(ftos(desirabledamage),"\n");
-                               if(self.BUTTON_ATCK2 == true) self.BUTTON_ATCK = false;
+                               if(PHYS_INPUT_BUTTON_ATCK2(self)) PHYS_INPUT_BUTTON_ATCK(self) = false;
                        }
                }
                #endif
index 3e93644fb87e31f5f104a0cc5bdb1b4d2a865c25..55266f8420082e308fe9e6c66698a375badf014c 100644 (file)
@@ -411,7 +411,7 @@ void W_Electro_Attack_Orb(Weapon thiswep)
 void W_Electro_CheckAttack(Weapon thiswep, entity actor, .entity weaponentity, int fire)
 {SELFPARAM();
        if(self.electro_count > 1)
-       if(self.BUTTON_ATCK2)
+       if(PHYS_INPUT_BUTTON_ATCK2(self))
        if(weapon_prepareattack(thiswep, actor, weaponentity, true, -1))
        {
                W_Electro_Attack_Orb(WEP_ELECTRO);
@@ -427,7 +427,7 @@ void W_Electro_CheckAttack(Weapon thiswep, entity actor, .entity weaponentity, i
 
                METHOD(Electro, wr_aim, void(entity thiswep))
                {
-                       self.BUTTON_ATCK = self.BUTTON_ATCK2 = false;
+                       PHYS_INPUT_BUTTON_ATCK(self) = PHYS_INPUT_BUTTON_ATCK2(self) = false;
                        if(vdist(self.origin - self.enemy.origin, >, 1000)) { self.bot_secondary_electromooth = 0; }
                        if(self.bot_secondary_electromooth == 0)
                        {
@@ -440,7 +440,7 @@ void W_Electro_CheckAttack(Weapon thiswep, entity actor, .entity weaponentity, i
 
                                if(shoot)
                                {
-                                       self.BUTTON_ATCK = true;
+                                       PHYS_INPUT_BUTTON_ATCK(self) = true;
                                        if(random() < 0.01) self.bot_secondary_electromooth = 1;
                                }
                        }
@@ -448,7 +448,7 @@ void W_Electro_CheckAttack(Weapon thiswep, entity actor, .entity weaponentity, i
                        {
                                if(bot_aim(WEP_CVAR_SEC(electro, speed), WEP_CVAR_SEC(electro, speed_up), WEP_CVAR_SEC(electro, lifetime), true))
                                {
-                                       self.BUTTON_ATCK2 = true;
+                                       PHYS_INPUT_BUTTON_ATCK2(self) = true;
                                        if(random() < 0.03) self.bot_secondary_electromooth = 0;
                                }
                        }
index 50119a6879d26a688f13e03cb4c9fc29c2c2b487..ce17e8f395d889543dd633755b96330ac8af86e6 100644 (file)
@@ -353,13 +353,13 @@ void W_Fireball_Attack2()
 
                METHOD(Fireball, wr_aim, void(entity thiswep))
                {
-                       self.BUTTON_ATCK = false;
-                       self.BUTTON_ATCK2 = false;
+                       PHYS_INPUT_BUTTON_ATCK(self) = false;
+                       PHYS_INPUT_BUTTON_ATCK2(self) = false;
                        if(self.bot_primary_fireballmooth == 0)
                        {
                                if(bot_aim(WEP_CVAR_PRI(fireball, speed), 0, WEP_CVAR_PRI(fireball, lifetime), false))
                                {
-                                       self.BUTTON_ATCK = true;
+                                       PHYS_INPUT_BUTTON_ATCK(self) = true;
                                        if(random() < 0.02) self.bot_primary_fireballmooth = 0;
                                }
                        }
@@ -367,7 +367,7 @@ void W_Fireball_Attack2()
                        {
                                if(bot_aim(WEP_CVAR_SEC(fireball, speed), WEP_CVAR_SEC(fireball, speed_up), WEP_CVAR_SEC(fireball, lifetime), true))
                                {
-                                       self.BUTTON_ATCK2 = true;
+                                       PHYS_INPUT_BUTTON_ATCK2(self) = true;
                                        if(random() < 0.01) self.bot_primary_fireballmooth = 1;
                                }
                        }
index ff6088f8f35b3d44c7902892b415e27f005dacad..9b4bbd418655163253f7f23572a4c9e81e7969ad 100644 (file)
@@ -309,9 +309,9 @@ void W_Hagar_Attack2_Load(Weapon thiswep, .entity weaponentity)
 
        bool stopped = loaded || !enough_ammo;
 
-       if(self.BUTTON_ATCK2)
+       if(PHYS_INPUT_BUTTON_ATCK2(self))
        {
-               if(self.BUTTON_ATCK && WEP_CVAR_SEC(hagar, load_abort))
+               if(PHYS_INPUT_BUTTON_ATCK(self) && WEP_CVAR_SEC(hagar, load_abort))
                {
                        if(self.hagar_load)
                        {
@@ -375,7 +375,7 @@ void W_Hagar_Attack2_Load(Weapon thiswep, .entity weaponentity)
                }
 
                // release if player let go of button or if they've held it in too long
-               if(!self.BUTTON_ATCK2 || (stopped && self.hagar_loadstep < time && WEP_CVAR_SEC(hagar, load_hold) >= 0))
+               if(!PHYS_INPUT_BUTTON_ATCK2(self) || (stopped && self.hagar_loadstep < time && WEP_CVAR_SEC(hagar, load_hold) >= 0))
                {
                        self.(weaponentity).state = WS_READY;
                        W_Hagar_Attack2_Load_Release(weaponentity);
@@ -400,9 +400,9 @@ void W_Hagar_Attack2_Load(Weapon thiswep, .entity weaponentity)
                METHOD(Hagar, wr_aim, void(entity thiswep))
                {
                        if(random()>0.15)
-                               self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
+                               PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
                        else // not using secondary_speed since these are only 15% and should cause some ricochets without re-aiming
-                               self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
+                               PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
                }
                METHOD(Hagar, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
                {
index 3c158f60814e07524c6a483de523d3cfb1997489..deae8b11ca1da8207b86ff2dbd691d1edf03147f 100644 (file)
@@ -169,7 +169,7 @@ void W_HLAC_Attack_Frame(Weapon thiswep, entity actor, .entity weaponentity, int
                return;
        }
 
-       if(actor.BUTTON_ATCK)
+       if(PHYS_INPUT_BUTTON_ATCK(actor))
        {
                if(!thiswep.wr_checkammo1(thiswep))
                if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
@@ -209,7 +209,7 @@ void W_HLAC_Attack2_Frame(Weapon thiswep)
 
                METHOD(HLAC, wr_aim, void(entity thiswep))
                {
-                       self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(hlac, speed), 0, WEP_CVAR_PRI(hlac, lifetime), false);
+                       PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR_PRI(hlac, speed), 0, WEP_CVAR_PRI(hlac, lifetime), false);
                }
                METHOD(HLAC, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
                {
index 96743b75e73e6570054a34b8f5e3b3cd919d299d..0b679e098cfc9b04eaf8d05422132998b4578092 100644 (file)
@@ -255,7 +255,7 @@ void W_Hook_Attack2(Weapon thiswep, entity actor)
                                actor.hook_time_fueldecrease = time + WEP_CVAR_PRI(hook, hooked_time_free);
                        }
 
-                       actor.hook_state = BITSET(actor.hook_state, HOOK_PULLING, (!actor.BUTTON_CROUCH || !autocvar_g_balance_grapplehook_crouchslide));
+                       actor.hook_state = BITSET(actor.hook_state, HOOK_PULLING, (!PHYS_INPUT_BUTTON_CROUCH(actor) || !autocvar_g_balance_grapplehook_crouchslide));
 
                        if (actor.hook_state & HOOK_FIRING)
                        {
index f220752b30088816e7264c730ca18735f243b365..daace731259f44ced26b50470b5d1f6e187fdaf9 100644 (file)
@@ -146,7 +146,7 @@ void W_MachineGun_Attack_Frame(Weapon thiswep, entity actor, .entity weaponentit
                w_ready(thiswep, actor, weaponentity, fire);
                return;
        }
-       if(actor.BUTTON_ATCK)
+       if(PHYS_INPUT_BUTTON_ATCK(actor))
        {
                if(!thiswep.wr_checkammo2(thiswep))
                if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
@@ -245,9 +245,9 @@ void W_MachineGun_Attack_Burst(Weapon thiswep, entity actor, .entity weaponentit
                METHOD(MachineGun, wr_aim, void(entity thiswep))
                {
                        if(vdist(self.origin - self.enemy.origin, <, 3000 - bound(0, skill, 10) * 200))
-                               self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false);
+                               PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(1000000, 0, 0.001, false);
                        else
-                               self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, false);
+                               PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(1000000, 0, 0.001, false);
                }
                METHOD(MachineGun, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
                {
index e5c43f3a45879ac2e52df673ac08b8a0e412a7de..e08b51d202cd6480f6ed650c1916bddb4a4b6957 100644 (file)
@@ -408,9 +408,9 @@ float W_MineLayer_PlacedMines(float detonate)
                {
                        // aim and decide to fire if appropriate
                        if(self.minelayer_mines >= WEP_CVAR(minelayer, limit))
-                               self.BUTTON_ATCK = false;
+                               PHYS_INPUT_BUTTON_ATCK(self) = false;
                        else
-                               self.BUTTON_ATCK = bot_aim(WEP_CVAR(minelayer, speed), 0, WEP_CVAR(minelayer, lifetime), false);
+                               PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR(minelayer, speed), 0, WEP_CVAR(minelayer, lifetime), false);
                        if(skill >= 2) // skill 0 and 1 bots won't detonate mines!
                        {
                                // decide whether to detonate mines
@@ -474,7 +474,7 @@ float W_MineLayer_PlacedMines(float detonate)
                                                        if(
                                                                (v_forward * normalize(mine.origin - targ.origin)< 0.1)
                                                                && desirabledamage > 0.1*coredamage
-                                                       )self.BUTTON_ATCK2 = true;
+                                                       ) PHYS_INPUT_BUTTON_ATCK2(self) = true;
                                                        targ = targ.chain;
                                                }
                                        }else{
@@ -485,7 +485,7 @@ float W_MineLayer_PlacedMines(float detonate)
                                                        if(IS_PLAYER(self.enemy))
                                                                if(desirabledamage >= 0.1*coredamage)
                                                                        if(random()/distance*300 > frametime*bound(0,(10-skill)*0.2,1))
-                                                                               self.BUTTON_ATCK2 = true;
+                                                                               PHYS_INPUT_BUTTON_ATCK2(self) = true;
                                        //      dprint(ftos(random()/distance*300),">");dprint(ftos(frametime*bound(0,(10-skill)*0.2,1)),"\n");
                                        }
 
@@ -494,12 +494,12 @@ float W_MineLayer_PlacedMines(float detonate)
                                // if we would be doing at X percent of the core damage, detonate it
                                // but don't fire a new shot at the same time!
                                if(desirabledamage >= 0.75 * coredamage) //this should do group damage in rare fortunate events
-                                       self.BUTTON_ATCK2 = true;
+                                       PHYS_INPUT_BUTTON_ATCK2(self) = true;
                                if((skill > 6.5) && (selfdamage > self.health))
-                                       self.BUTTON_ATCK2 = false;
-                               //if(self.BUTTON_ATCK2 == true)
+                                       PHYS_INPUT_BUTTON_ATCK2(self) = false;
+                               //if(PHYS_INPUT_BUTTON_ATCK2(self) == true)
                                //      dprint(ftos(desirabledamage),"\n");
-                               if(self.BUTTON_ATCK2 == true) self.BUTTON_ATCK = false;
+                               if(PHYS_INPUT_BUTTON_ATCK2(self)) PHYS_INPUT_BUTTON_ATCK(self) = false;
                        }
                }
                METHOD(MineLayer, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
index b361a505091adad8c4ee0ee2e23b1f470d72bca4..e7c00bb0420bc025417716e983082c1d4eaa5009 100644 (file)
@@ -300,13 +300,13 @@ void W_Mortar_Attack2(Weapon thiswep)
 
                METHOD(Mortar, wr_aim, void(entity thiswep))
                {
-                       self.BUTTON_ATCK = false;
-                       self.BUTTON_ATCK2 = false;
+                       PHYS_INPUT_BUTTON_ATCK(self) = false;
+                       PHYS_INPUT_BUTTON_ATCK2(self) = false;
                        if(self.bot_secondary_grenademooth == 0) // WEAPONTODO: merge this into using WEP_CVAR_BOTH
                        {
                                if(bot_aim(WEP_CVAR_PRI(mortar, speed), WEP_CVAR_PRI(mortar, speed_up), WEP_CVAR_PRI(mortar, lifetime), true))
                                {
-                                       self.BUTTON_ATCK = true;
+                                       PHYS_INPUT_BUTTON_ATCK(self) = true;
                                        if(random() < 0.01) self.bot_secondary_grenademooth = 1;
                                }
                        }
@@ -314,7 +314,7 @@ void W_Mortar_Attack2(Weapon thiswep)
                        {
                                if(bot_aim(WEP_CVAR_SEC(mortar, speed), WEP_CVAR_SEC(mortar, speed_up), WEP_CVAR_SEC(mortar, lifetime), true))
                                {
-                                       self.BUTTON_ATCK2 = true;
+                                       PHYS_INPUT_BUTTON_ATCK2(self) = true;
                                        if(random() < 0.02) self.bot_secondary_grenademooth = 0;
                                }
                        }
index 56b2759ec76766db8737e866111d6dd9f7597094..97f993f9eb5aec5980a45b385bd7a4097500b526 100644 (file)
@@ -295,11 +295,11 @@ void W_Porto_Attack(float type)
                METHOD(PortoLaunch, wr_aim, void(entity thiswep))
                {
                        SELFPARAM();
-                       self.BUTTON_ATCK = false;
-                       self.BUTTON_ATCK2 = false;
+                       PHYS_INPUT_BUTTON_ATCK(self) = false;
+                       PHYS_INPUT_BUTTON_ATCK2(self) = false;
                        if(!WEP_CVAR(porto, secondary))
                                if(bot_aim(WEP_CVAR_PRI(porto, speed), 0, WEP_CVAR_PRI(porto, lifetime), false))
-                                       self.BUTTON_ATCK = true;
+                                       PHYS_INPUT_BUTTON_ATCK(self) = true;
                }
                METHOD(PortoLaunch, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
                {
index 526ba0e2056ff866a84e34bb7ff99d9f6ea92cc7..f3291dfe1de71ef55c396a85edc4df0e1256a80f 100644 (file)
@@ -66,7 +66,7 @@ void W_Rifle_FireBullet(Weapon thiswep, float pSpread, float pDamage, float pFor
 
        Send_Effect(EFFECT_RIFLE_MUZZLEFLASH, w_shotorg, w_shotdir * 2000, 1);
 
-       if(self.BUTTON_ZOOM | self.BUTTON_ZOOMSCRIPT) // if zoomed, shoot from the eye
+       if(PHYS_INPUT_BUTTON_ZOOM(self) | PHYS_INPUT_BUTTON_ZOOMSCRIPT(self)) // if zoomed, shoot from the eye
        {
                w_shotdir = v_forward;
                w_shotorg = self.origin + self.view_ofs + ((w_shotorg - self.origin - self.view_ofs) * v_forward) * v_forward;
@@ -140,15 +140,15 @@ void W_Rifle_BulletHail(.entity weaponentity, float mode, void() AttackFunc, WFR
 
                METHOD(Rifle, wr_aim, void(entity thiswep))
                {
-                       self.BUTTON_ATCK=false;
-                       self.BUTTON_ATCK2=false;
+                       PHYS_INPUT_BUTTON_ATCK(self) = false;
+                       PHYS_INPUT_BUTTON_ATCK2(self) = false;
                        if(vdist(self.origin - self.enemy.origin, >, 1000))
                                self.bot_secondary_riflemooth = 0;
                        if(self.bot_secondary_riflemooth == 0)
                        {
                                if(bot_aim(1000000, 0, 0.001, false))
                                {
-                                       self.BUTTON_ATCK = true;
+                                       PHYS_INPUT_BUTTON_ATCK(self) = true;
                                        if(random() < 0.01) self.bot_secondary_riflemooth = 1;
                                }
                        }
@@ -156,7 +156,7 @@ void W_Rifle_BulletHail(.entity weaponentity, float mode, void() AttackFunc, WFR
                        {
                                if(bot_aim(1000000, 0, 0.001, false))
                                {
-                                       self.BUTTON_ATCK2 = true;
+                                       PHYS_INPUT_BUTTON_ATCK2(self) = true;
                                        if(random() < 0.03) self.bot_secondary_riflemooth = 0;
                                }
                        }
index a25e928cba43e8ea12d1e86fe0d731da5cef9685..7642b3b7bc45efb114c24472618d4ffea3a6adc9 100644 (file)
@@ -602,11 +602,11 @@ void W_Seeker_Fire_Tag(Weapon thiswep)
                {
                        if(WEP_CVAR(seeker, type) == 1)
                                if(W_Seeker_Tagged_Info(self, self.enemy) != world)
-                                       self.BUTTON_ATCK = bot_aim(WEP_CVAR(seeker, missile_speed_max), 0, WEP_CVAR(seeker, missile_lifetime), false);
+                                       PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR(seeker, missile_speed_max), 0, WEP_CVAR(seeker, missile_lifetime), false);
                                else
-                                       self.BUTTON_ATCK2 = bot_aim(WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
+                                       PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
                        else
-                               self.BUTTON_ATCK = bot_aim(WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
+                               PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
                }
                METHOD(Seeker, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
                {
index 46cb78e0a67e2d2b15b0640b342b6b87531d348c..88741989672b50a7fc62dd9d84ccef9516737b0a 100644 (file)
@@ -675,9 +675,9 @@ void W_Shockwave_Attack()
                METHOD(Shockwave, wr_aim, void(entity thiswep))
                {
                        if(vlen(self.origin - self.enemy.origin) <= WEP_CVAR(shockwave, melee_range))
-                               { self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, false); }
+                               { PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(1000000, 0, 0.001, false); }
                        else
-                               { self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false); }
+                               { PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(1000000, 0, 0.001, false); }
                }
                METHOD(Shockwave, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
                {
index 7da7dfd04167373c39953b0e16d7915691af9b3b..9ca6cf5885e72a8aa1e8940cedd9506b9e381057 100644 (file)
@@ -230,9 +230,9 @@ void W_Shotgun_Attack3_Frame1(Weapon thiswep, entity actor, .entity weaponentity
                METHOD(Shotgun, wr_aim, void(entity thiswep))
                {
                        if(vdist(self.origin - self.enemy.origin, <=, WEP_CVAR_SEC(shotgun, melee_range)))
-                               self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, false);
+                               PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(1000000, 0, 0.001, false);
                        else
-                               self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false);
+                               PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(1000000, 0, 0.001, false);
                }
                METHOD(Shotgun, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
                {
index 0e429acb22b50e1ff66d17461c4f0a24f2f08dc6..5461d68d9423a8be4ab046bd4d2d980eb1a9508a 100644 (file)
@@ -213,9 +213,9 @@ int W_Tuba_GetNote(entity pl, int hittype)
                case 8: note = +4; break; // e
                case 9: note = -1; break; // B
        }
-       if(pl.BUTTON_CROUCH)
+       if(PHYS_INPUT_BUTTON_CROUCH(pl))
                note -= 12;
-       if(pl.BUTTON_JUMP)
+       if(PHYS_INPUT_BUTTON_JUMP(pl))
                note += 12;
        if(hittype & HITTYPE_SECONDARY)
                note += 7;
@@ -367,9 +367,9 @@ METHOD(Tuba, wr_aim, void(Tuba this))
        if (vdist((actor.origin - actor.enemy.origin), <, WEP_CVAR(tuba, radius)))
        {
                if (random() > 0.5)
-                       actor.BUTTON_ATCK = 1;
+                       PHYS_INPUT_BUTTON_ATCK(actor) = true;
                else
-                       actor.BUTTON_ATCK2 = 1;
+                       PHYS_INPUT_BUTTON_ATCK2(actor) = true;
        }
 }
 
index 2ece549321f0a63abda2e02d825c7718d308ef30..f7b2c1026ba77ec7d4e6e8820dafcef1b8f9b5df 100644 (file)
@@ -342,9 +342,9 @@ void W_RocketMinsta_Attack3 ()
                METHOD(Vaporizer, wr_aim, void(entity thiswep))
                {
                        if(self.(thiswep.ammo_field) > 0)
-                               self.BUTTON_ATCK = bot_aim(1000000, 0, 1, false);
+                               PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(1000000, 0, 1, false);
                        else
-                               self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(vaporizer, speed), 0, WEP_CVAR_SEC(vaporizer, lifetime), false); // WEAPONTODO: replace with proper vaporizer cvars
+                               PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(WEP_CVAR_SEC(vaporizer, speed), 0, WEP_CVAR_SEC(vaporizer, lifetime), false); // WEAPONTODO: replace with proper vaporizer cvars
                }
                METHOD(Vaporizer, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
                {
index 83ea7e597643820988d78ea5e040b7888d838d46..e44c51ee4c9892f653d6a52ad84f9ef3d0fbdd53 100644 (file)
@@ -213,11 +213,11 @@ void W_Vortex_Attack(Weapon thiswep, float issecondary)
                METHOD(Vortex, wr_aim, void(entity thiswep))
                {
                        if(bot_aim(1000000, 0, 1, false))
-                               self.BUTTON_ATCK = true;
+                               PHYS_INPUT_BUTTON_ATCK(self) = true;
                        else
                        {
                                if(WEP_CVAR(vortex, charge))
-                                       self.BUTTON_ATCK2 = true;
+                                       PHYS_INPUT_BUTTON_ATCK2(self) = true;
                        }
                }
                METHOD(Vortex, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
@@ -245,7 +245,7 @@ void W_Vortex_Attack(Weapon thiswep, float issecondary)
                                                weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(vortex, animtime), w_ready);
                                        }
                                }
-                               if((WEP_CVAR(vortex, charge) && !WEP_CVAR(vortex, secondary)) ? (actor.BUTTON_ZOOM | actor.BUTTON_ZOOMSCRIPT) : (fire & 2))
+                               if((WEP_CVAR(vortex, charge) && !WEP_CVAR(vortex, secondary)) ? (PHYS_INPUT_BUTTON_ZOOM(actor) | PHYS_INPUT_BUTTON_ZOOMSCRIPT(actor)) : (fire & 2))
                                {
                                        if(WEP_CVAR(vortex, charge))
                                        {
index 79f0a2758c3b4a7b8c0ddbdf92cdc362eea228d4..67057181b6a9f2c247b82c338db4ee87895cbed8 100644 (file)
@@ -133,7 +133,7 @@ float bot_shouldattack(entity e)
                return false;
        if (IS_DEAD(e))
                return false;
-       if (e.BUTTON_CHAT)
+       if (PHYS_INPUT_BUTTON_CHAT(e))
                return false;
        if(e.flags & FL_NOTARGET)
                return false;
index 468b32c4a57ef46fd2eb6186901475b5aae946fa..72ebfcb2e70d65cecc4aeba4373151514effec6b 100644 (file)
@@ -92,17 +92,16 @@ void bot_think()
        // skill 0 = ping 0.7 (slightly drunk)
 
        // clear buttons
-       self.BUTTON_ATCK = 0;
-       self.button1 = 0;
-       self.BUTTON_JUMP = 0;
-       self.BUTTON_ATCK2 = 0;
-       self.BUTTON_ZOOM = 0;
-       self.BUTTON_CROUCH = 0;
-       self.BUTTON_HOOK = 0;
-       self.BUTTON_INFO = 0;
-       self.button8 = 0;
-       self.BUTTON_CHAT = 0;
-       self.BUTTON_USE = 0;
+       PHYS_INPUT_BUTTON_ATCK(self) = false;
+       PHYS_INPUT_BUTTON_JUMP(self) = false;
+       PHYS_INPUT_BUTTON_ATCK2(self) = false;
+       PHYS_INPUT_BUTTON_ZOOM(self) = false;
+       PHYS_INPUT_BUTTON_CROUCH(self) = false;
+       PHYS_INPUT_BUTTON_HOOK(self) = false;
+       PHYS_INPUT_BUTTON_INFO(self) = false;
+       PHYS_INPUT_BUTTON_DRAG(self) = false;
+       PHYS_INPUT_BUTTON_CHAT(self) = false;
+       PHYS_INPUT_BUTTON_USE(self) = false;
 
        if (time < game_starttime)
        {
@@ -117,7 +116,7 @@ void bot_think()
        {
                if (self.deadflag == DEAD_DEAD)
                {
-                       self.BUTTON_JUMP = 1; // press jump to respawn
+                       PHYS_INPUT_BUTTON_JUMP(self) = true; // press jump to respawn
                        self.bot_strategytime = 0;
                }
        }
index 134e78401f9c2d5eba5ff53c8d366a36d9eb250f..260e8e661f8395109cd62b24a0fe16fd2b09d0fb 100644 (file)
@@ -108,12 +108,12 @@ void havocbot_ai()
                        w.wr_aim(w);
                        if (autocvar_bot_nofire || IS_INDEPENDENT_PLAYER(self))
                        {
-                               self.BUTTON_ATCK = false;
-                               self.BUTTON_ATCK2 = false;
+                               PHYS_INPUT_BUTTON_ATCK(self) = false;
+                               PHYS_INPUT_BUTTON_ATCK2(self) = false;
                        }
                        else
                        {
-                               if(self.BUTTON_ATCK||self.BUTTON_ATCK2)
+                               if(PHYS_INPUT_BUTTON_ATCK(self) || PHYS_INPUT_BUTTON_ATCK2(self))
                                        self.lastfiredweapon = PS(self).m_weapon.m_id;
                        }
                }
@@ -246,7 +246,7 @@ void havocbot_keyboard_movement(vector destorg)
                keyboard.z = 0;
 
        self.havocbot_keyboard = keyboard * maxspeed;
-       if (self.havocbot_ducktime>time) self.BUTTON_CROUCH=true;
+       if (self.havocbot_ducktime>time) PHYS_INPUT_BUTTON_CROUCH(self) = true;
 
        keyboard = self.havocbot_keyboard;
        blend = bound(0,vlen(destorg-self.origin)/autocvar_bot_ai_keyboard_distance,1); // When getting close move with 360 degree
@@ -273,7 +273,7 @@ void havocbot_bunnyhop(vector dir)
        if(self.aistatus & AI_STATUS_DANGER_AHEAD)
        {
                self.aistatus &= ~AI_STATUS_RUNNING;
-               self.BUTTON_JUMP = false;
+               PHYS_INPUT_BUTTON_JUMP(self) = false;
                self.bot_canruntogoal = 0;
                self.bot_timelastseengoal = 0;
                return;
@@ -349,12 +349,12 @@ void havocbot_bunnyhop(vector dir)
                                        {
                                                self.aistatus &= ~AI_STATUS_RUNNING;
                                                if(bunnyhopdistance > autocvar_bot_ai_bunnyhop_stopdistance)
-                                                       self.BUTTON_JUMP = true;
+                                                       PHYS_INPUT_BUTTON_JUMP(self) = true;
                                        }
                                        else
                                        {
                                                self.aistatus |= AI_STATUS_RUNNING;
-                                               self.BUTTON_JUMP = true;
+                                               PHYS_INPUT_BUTTON_JUMP(self) = true;
                                        }
                                }
                        }
@@ -374,7 +374,7 @@ void havocbot_bunnyhop(vector dir)
        if((IS_ONGROUND(self)) == 0)
        {
                if(self.velocity.z < 0 || vlen(self.velocity)<maxspeed)
-                       self.BUTTON_JUMP = false;
+                       PHYS_INPUT_BUTTON_JUMP(self) = false;
 
                // Strafe
                if(self.aistatus & AI_STATUS_RUNNING)
@@ -477,7 +477,7 @@ void havocbot_movetogoal()
                }
 
                // Flying
-               self.BUTTON_HOOK = true;
+               PHYS_INPUT_BUTTON_HOOK(self) = true;
                if(self.navigation_jetpack_point.z - STAT(PL_MAX, NULL).z + STAT(PL_MIN, NULL).z < self.origin.z)
                {
                        self.movement_x = dir * v_forward * maxspeed;
@@ -565,11 +565,11 @@ void havocbot_movetogoal()
                        {
                                if(self.velocity.z<0)
                                {
-                                       self.BUTTON_HOOK = true;
+                                       PHYS_INPUT_BUTTON_HOOK(self) = true;
                                }
                        }
                        else
-                               self.BUTTON_HOOK = true;
+                               PHYS_INPUT_BUTTON_HOOK(self) = true;
 
                        // If there is no goal try to move forward
 
@@ -609,7 +609,7 @@ void havocbot_movetogoal()
                                {
                                        if(time > self.rocketjumptime)
                                        {
-                                               self.BUTTON_ATCK2 = true;
+                                               PHYS_INPUT_BUTTON_ATCK2(self) = true;
                                                self.rocketjumptime = 0;
                                        }
                                        return;
@@ -617,7 +617,7 @@ void havocbot_movetogoal()
 
                                PS(self).m_switchweapon = WEP_DEVASTATOR;
                                self.v_angle_x = 90;
-                               self.BUTTON_ATCK = true;
+                               PHYS_INPUT_BUTTON_ATCK(self) = true;
                                self.rocketjumptime = time + WEP_CVAR(devastator, detonatedelay);
                                return;
                        }
@@ -638,9 +638,9 @@ void havocbot_movetogoal()
                if(self.waterlevel>WATERLEVEL_SWIMMING)
                        dir.z = 1;
                else if(self.velocity.z >= 0 && !(self.waterlevel == WATERLEVEL_WETFEET && self.watertype == CONTENT_WATER))
-                       self.BUTTON_JUMP = true;
+                       PHYS_INPUT_BUTTON_JUMP(self) = true;
                else
-                       self.BUTTON_JUMP = false;
+                       PHYS_INPUT_BUTTON_JUMP(self) = false;
                makevectors(self.v_angle.y * '0 1 0');
                self.movement_x = dir * v_forward * maxspeed;
                self.movement_y = dir * v_right * maxspeed;
@@ -696,9 +696,9 @@ void havocbot_movetogoal()
                        {
                                if(self.velocity.z >= 0 && !(self.watertype == CONTENT_WATER && gco.z < self.origin.z) &&
                                        ( !(self.waterlevel == WATERLEVEL_WETFEET && self.watertype == CONTENT_WATER) || self.aistatus & AI_STATUS_OUT_WATER))
-                                       self.BUTTON_JUMP = true;
+                                       PHYS_INPUT_BUTTON_JUMP(self) = true;
                                else
-                                       self.BUTTON_JUMP = false;
+                                       PHYS_INPUT_BUTTON_JUMP(self) = false;
                        }
                        dir = normalize(flatdir);
                        makevectors(self.v_angle.y * '0 1 0');
@@ -722,7 +722,7 @@ void havocbot_movetogoal()
                                        s = trace_fraction;
                                        tracebox(self.origin + jumpstepheightvec, self.mins, self.maxs, self.origin + self.velocity * 0.2 + jumpstepheightvec, false, self);
                                        if (trace_fraction > s)
-                                               self.BUTTON_JUMP = 1;
+                                               PHYS_INPUT_BUTTON_JUMP(self) = true;
                                }
                        }
 
@@ -738,7 +738,7 @@ void havocbot_movetogoal()
                        // Check head-banging against walls
                        if(vlen(self.origin + self.view_ofs - trace_endpos) < 25 && !(self.aistatus & AI_STATUS_OUT_WATER))
                        {
-                               self.BUTTON_JUMP = true;
+                               PHYS_INPUT_BUTTON_JUMP(self) = true;
                                if(self.facingwalltime && time > self.facingwalltime)
                                {
                                        self.ignoregoal = self.goalcurrent;
@@ -767,7 +767,7 @@ void havocbot_movetogoal()
                        self.aistatus &= ~AI_STATUS_DANGER_AHEAD;
 
                        if(trace_fraction == 1 && self.jumppadcount == 0 && !self.goalcurrent.wphardwired )
-                       if((IS_ONGROUND(self)) || (self.aistatus & AI_STATUS_RUNNING) || self.BUTTON_JUMP == true)
+                       if((IS_ONGROUND(self)) || (self.aistatus & AI_STATUS_RUNNING) || PHYS_INPUT_BUTTON_JUMP(self))
                        {
                                // Look downwards
                                traceline(dst_ahead , dst_down, true, world);
@@ -815,7 +815,7 @@ void havocbot_movetogoal()
 
                dir = normalize(dir + dodge + evadeobstacle + evadelava);
        //      self.bot_dodgevector = dir;
-       //      self.bot_dodgevector_jumpbutton = self.BUTTON_JUMP;
+       //      self.bot_dodgevector_jumpbutton = PHYS_INPUT_BUTTON_JUMP(self);
        }
 
        if(time < self.ladder_time)
@@ -834,7 +834,7 @@ void havocbot_movetogoal()
 
        //dir = self.bot_dodgevector;
        //if (self.bot_dodgevector_jumpbutton)
-       //      self.BUTTON_JUMP = 1;
+       //      PHYS_INPUT_BUTTON_JUMP(self) = true;
        self.movement_x = dir * v_forward * maxspeed;
        self.movement_y = dir * v_right * maxspeed;
        self.movement_z = dir * v_up * maxspeed;
@@ -849,8 +849,8 @@ void havocbot_movetogoal()
        if(skill+self.bot_moveskill >= autocvar_bot_ai_bunnyhop_skilloffset)
                havocbot_bunnyhop(dir);
 
-       if ((dir * v_up) >= autocvar_sv_jumpvelocity*0.5 && (IS_ONGROUND(self))) self.BUTTON_JUMP=1;
-       if (((dodge * v_up) > 0) && random()*frametime >= 0.2*bound(0,(10-skill-self.bot_dodgeskill)*0.1,1)) self.BUTTON_JUMP=true;
+       if ((dir * v_up) >= autocvar_sv_jumpvelocity*0.5 && (IS_ONGROUND(self))) PHYS_INPUT_BUTTON_JUMP(self) = true;
+       if (((dodge * v_up) > 0) && random()*frametime >= 0.2*bound(0,(10-skill-self.bot_dodgeskill)*0.1,1)) PHYS_INPUT_BUTTON_JUMP(self) = true;
        if (((dodge * v_up) < 0) && random()*frametime >= 0.5*bound(0,(10-skill-self.bot_dodgeskill)*0.1,1)) self.havocbot_ducktime=time+0.3/bound(0.1,skill+self.bot_dodgeskill,10);
 }
 
index f42adceef1d56ca6f36ca5429c67aea12b932469..f15c9a6fb6530568c25d8a8ee2a712f3ee58336c 100644 (file)
@@ -824,13 +824,13 @@ const int BOT_CMD_KEY_CHAT                = BIT(10);
 float bot_presskeys()
 {SELFPARAM();
        self.movement = '0 0 0';
-       self.BUTTON_JUMP = false;
-       self.BUTTON_CROUCH = false;
-       self.BUTTON_ATCK = false;
-       self.BUTTON_ATCK2 = false;
-       self.BUTTON_USE = false;
-       self.BUTTON_HOOK = false;
-       self.BUTTON_CHAT = false;
+       PHYS_INPUT_BUTTON_JUMP(self) = false;
+       PHYS_INPUT_BUTTON_CROUCH(self) = false;
+       PHYS_INPUT_BUTTON_ATCK(self) = false;
+       PHYS_INPUT_BUTTON_ATCK2(self) = false;
+       PHYS_INPUT_BUTTON_USE(self) = false;
+       PHYS_INPUT_BUTTON_HOOK(self) = false;
+       PHYS_INPUT_BUTTON_CHAT(self) = false;
 
        if(self.bot_cmd_keys == BOT_CMD_KEY_NONE)
                return false;
@@ -846,25 +846,25 @@ float bot_presskeys()
                self.movement_y = -autocvar_sv_maxspeed;
 
        if(self.bot_cmd_keys & BOT_CMD_KEY_JUMP)
-               self.BUTTON_JUMP = true;
+               PHYS_INPUT_BUTTON_JUMP(self) = true;
 
        if(self.bot_cmd_keys & BOT_CMD_KEY_CROUCH)
-               self.BUTTON_CROUCH = true;
+               PHYS_INPUT_BUTTON_CROUCH(self) = true;
 
        if(self.bot_cmd_keys & BOT_CMD_KEY_ATTACK1)
-               self.BUTTON_ATCK = true;
+               PHYS_INPUT_BUTTON_ATCK(self) = true;
 
        if(self.bot_cmd_keys & BOT_CMD_KEY_ATTACK2)
-               self.BUTTON_ATCK2 = true;
+               PHYS_INPUT_BUTTON_ATCK2(self) = true;
 
        if(self.bot_cmd_keys & BOT_CMD_KEY_USE)
-               self.BUTTON_USE = true;
+               PHYS_INPUT_BUTTON_USE(self) = true;
 
        if(self.bot_cmd_keys & BOT_CMD_KEY_HOOK)
-               self.BUTTON_HOOK = true;
+               PHYS_INPUT_BUTTON_HOOK(self) = true;
 
        if(self.bot_cmd_keys & BOT_CMD_KEY_CHAT)
-               self.BUTTON_CHAT = true;
+               PHYS_INPUT_BUTTON_CHAT(self) = true;
 
        return true;
 }
@@ -986,15 +986,14 @@ float bot_cmd_releasekey()
 
 float bot_cmd_pause()
 {SELFPARAM();
-       self.button1        = 0;
-       self.button8        = 0;
-       self.BUTTON_USE     = 0;
-       self.BUTTON_ATCK    = 0;
-       self.BUTTON_JUMP    = 0;
-       self.BUTTON_HOOK    = 0;
-       self.BUTTON_CHAT    = 0;
-       self.BUTTON_ATCK2   = 0;
-       self.BUTTON_CROUCH  = 0;
+       PHYS_INPUT_BUTTON_DRAG(self) = false;
+       PHYS_INPUT_BUTTON_USE(self) = false;
+       PHYS_INPUT_BUTTON_ATCK(self) = false;
+       PHYS_INPUT_BUTTON_JUMP(self) = false;
+       PHYS_INPUT_BUTTON_HOOK(self) = false;
+       PHYS_INPUT_BUTTON_CHAT(self) = false;
+       PHYS_INPUT_BUTTON_ATCK2(self) = false;
+       PHYS_INPUT_BUTTON_CROUCH(self) = false;
 
        self.movement = '0 0 0';
        self.bot_cmd_keys = BOT_CMD_KEY_NONE;
index c30e3d45a92160e842e1bfa63fdf3ab9be8bbb77..b6ed06d676d0c7ccf64236c47c3f40b7178b61f4 100644 (file)
@@ -12,6 +12,8 @@
 #include "../common/deathtypes/all.qh"
 #include "../common/util.qh"
 
+#include <common/physics/player.qh>
+
 #include "../common/monsters/all.qh"
 
 #include "../common/weapons/all.qh"
@@ -784,7 +786,7 @@ float Drag(float force_allow_pick, float ischeat)
                default:
                        if(Drag_IsDragging(self))
                        {
-                               if(self.BUTTON_DRAG)
+                               if(PHYS_INPUT_BUTTON_DRAG(self))
                                {
                                        if(self.impulse == 10 || self.impulse == 15 || self.impulse == 18)
                                        {
@@ -816,7 +818,7 @@ float Drag(float force_allow_pick, float ischeat)
                        else
                        {
                                if(Drag_CanDrag(self))
-                                       if(self.BUTTON_DRAG)
+                                       if(PHYS_INPUT_BUTTON_DRAG(self))
                                        {
                                                crosshair_trace_plusvisibletriggers(self);
                                                entity e = trace_ent;
index de2603437e253f69e2c2322706a55ba846f8c92f..67b1dbe99b060c43f5eee9572cc7a4b7ea4fcb54 100644 (file)
@@ -557,7 +557,7 @@ void PutClientInServer()
                this.bot_attack = true;
                this.monster_attack = true;
 
-               this.BUTTON_ATCK = this.BUTTON_JUMP = this.BUTTON_ATCK2 = false;
+               PHYS_INPUT_BUTTON_ATCK(this) = PHYS_INPUT_BUTTON_JUMP(this) = PHYS_INPUT_BUTTON_ATCK2(this) = false;
 
                if (this.killcount == FRAGS_SPECTATOR) {
                        PlayerScore_Clear(this);
@@ -1252,7 +1252,6 @@ void ClientDisconnect ()
        GetCvars(-1);
 }
 
-.float BUTTON_CHAT;
 void ChatBubbleThink()
 {SELFPARAM();
        self.nextthink = time;
@@ -1270,7 +1269,7 @@ void ChatBubbleThink()
        {
                if ( self.owner.active_minigame )
                        self.mdl = "models/sprites/minigame_busy.iqm";
-               else if ( self.owner.BUTTON_CHAT )
+               else if (PHYS_INPUT_BUTTON_CHAT(self.owner))
                        self.mdl = "models/misc/chatbubble.spr";
        }
 
@@ -1645,7 +1644,7 @@ void SpectateCopy(entity this, entity spectatee)
        self.angles = spectatee.v_angle;
        STAT(FROZEN, self) = STAT(FROZEN, spectatee);
        self.revive_progress = spectatee.revive_progress;
-       if(!self.BUTTON_USE)
+       if(!PHYS_INPUT_BUTTON_USE(self))
                self.fixangle = true;
        setorigin(self, spectatee.origin);
        setsize(self, spectatee.mins, spectatee.maxs);
@@ -1905,12 +1904,12 @@ void PrintWelcomeMessage()
        if(self.motd_actived_time == 0)
        {
                if (autocvar_g_campaign) {
-                       if ((IS_PLAYER(self) && self.BUTTON_INFO) || (!IS_PLAYER(self))) {
+                       if ((IS_PLAYER(self) && PHYS_INPUT_BUTTON_INFO(self)) || (!IS_PLAYER(self))) {
                                self.motd_actived_time = time;
                                Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_MOTD, campaign_message);
                        }
                } else {
-                       if (self.BUTTON_INFO) {
+                       if (PHYS_INPUT_BUTTON_INFO(self)) {
                                self.motd_actived_time = time;
                                Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_MOTD, getwelcomemessage());
                        }
@@ -1919,14 +1918,14 @@ void PrintWelcomeMessage()
        else if(self.motd_actived_time > 0) // showing MOTD or campaign message
        {
                if (autocvar_g_campaign) {
-                       if (self.BUTTON_INFO)
+                       if (PHYS_INPUT_BUTTON_INFO(self))
                                self.motd_actived_time = time;
                        else if ((time - self.motd_actived_time > 2) && IS_PLAYER(self)) { // hide it some seconds after BUTTON_INFO has been released
                                self.motd_actived_time = 0;
                                Kill_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER_CPID, CPID_MOTD);
                        }
                } else {
-                       if (self.BUTTON_INFO)
+                       if (PHYS_INPUT_BUTTON_INFO(self))
                                self.motd_actived_time = time;
                        else if (time - self.motd_actived_time > 2) { // hide it some seconds after BUTTON_INFO has been released
                                self.motd_actived_time = 0;
@@ -1936,7 +1935,7 @@ void PrintWelcomeMessage()
        }
        else //if(self.motd_actived_time < 0) // just connected, motd is active
        {
-               if(self.BUTTON_INFO) // BUTTON_INFO hides initial MOTD
+               if(PHYS_INPUT_BUTTON_INFO(self)) // BUTTON_INFO hides initial MOTD
                        self.motd_actived_time = -2; // wait until BUTTON_INFO gets released
                else if(self.motd_actived_time == -2 || IS_PLAYER(self) || IS_SPEC(self))
                {
@@ -1956,21 +1955,21 @@ void ObserverThink()
        }
        float prefered_movetype;
        if (self.flags & FL_JUMPRELEASED) {
-               if (self.BUTTON_JUMP && !self.version_mismatch) {
+               if (PHYS_INPUT_BUTTON_JUMP(self) && !self.version_mismatch) {
                        self.flags &= ~FL_JUMPRELEASED;
                        self.flags |= FL_SPAWNING;
-               } else if(self.BUTTON_ATCK && !self.version_mismatch) {
+               } else if(PHYS_INPUT_BUTTON_ATCK(self) && !self.version_mismatch) {
                        self.flags &= ~FL_JUMPRELEASED;
                        if(SpectateNext()) {
                                self.classname = STR_SPECTATOR;
                        }
                } else {
-                       prefered_movetype = ((!self.BUTTON_USE ? self.cvar_cl_clippedspectating : !self.cvar_cl_clippedspectating) ? MOVETYPE_FLY_WORLDONLY : MOVETYPE_NOCLIP);
+                       prefered_movetype = ((!PHYS_INPUT_BUTTON_USE(self) ? self.cvar_cl_clippedspectating : !self.cvar_cl_clippedspectating) ? MOVETYPE_FLY_WORLDONLY : MOVETYPE_NOCLIP);
                        if (self.movetype != prefered_movetype)
                                self.movetype = prefered_movetype;
                }
        } else {
-               if (!(self.BUTTON_ATCK || self.BUTTON_JUMP)) {
+               if (!(PHYS_INPUT_BUTTON_ATCK(self) || PHYS_INPUT_BUTTON_JUMP(self))) {
                        self.flags |= FL_JUMPRELEASED;
                        if(self.flags & FL_SPAWNING)
                        {
@@ -1990,10 +1989,10 @@ void SpectatorThink()
                        self.impulse = 0;
        }
        if (self.flags & FL_JUMPRELEASED) {
-               if (self.BUTTON_JUMP && !self.version_mismatch) {
+               if (PHYS_INPUT_BUTTON_JUMP(self) && !self.version_mismatch) {
                        self.flags &= ~FL_JUMPRELEASED;
                        self.flags |= FL_SPAWNING;
-               } else if(self.BUTTON_ATCK || self.impulse == 10 || self.impulse == 15 || self.impulse == 18 || (self.impulse >= 200 && self.impulse <= 209)) {
+               } else if(PHYS_INPUT_BUTTON_ATCK(self) || self.impulse == 10 || self.impulse == 15 || self.impulse == 18 || (self.impulse >= 200 && self.impulse <= 209)) {
                        self.flags &= ~FL_JUMPRELEASED;
                        if(SpectateNext()) {
                                self.classname = STR_SPECTATOR;
@@ -2011,7 +2010,7 @@ void SpectatorThink()
                                PutClientInServer();
                        }
                        self.impulse = 0;
-               } else if (self.BUTTON_ATCK2) {
+               } else if (PHYS_INPUT_BUTTON_ATCK2(self)) {
                        self.flags &= ~FL_JUMPRELEASED;
                        self.classname = STR_OBSERVER;
                        PutClientInServer();
@@ -2020,7 +2019,7 @@ void SpectatorThink()
                                PutObserverInServer();
                }
        } else {
-               if (!(self.BUTTON_ATCK || self.BUTTON_ATCK2)) {
+               if (!(PHYS_INPUT_BUTTON_ATCK(self) || PHYS_INPUT_BUTTON_ATCK2(self))) {
                        self.flags |= FL_JUMPRELEASED;
                        if(self.flags & FL_SPAWNING)
                        {
@@ -2232,9 +2231,9 @@ void PlayerPreThink ()
 
        if(!self.cvar_cl_newusekeysupported) // FIXME remove this - it was a stupid idea to begin with, we can JUST use the button
        {
-               if(self.BUTTON_USE && !self.usekeypressed)
+               if(PHYS_INPUT_BUTTON_USE(self) && !self.usekeypressed)
                        PlayerUseKey();
-               self.usekeypressed = self.BUTTON_USE;
+               self.usekeypressed = PHYS_INPUT_BUTTON_USE(self);
        }
 
        if(IS_REAL_CLIENT(self))
@@ -2281,7 +2280,7 @@ void PlayerPreThink ()
                                float button_pressed;
                                if(frametime)
                                        player_anim();
-                               button_pressed = (self.BUTTON_ATCK || self.BUTTON_JUMP || self.BUTTON_ATCK2 || self.BUTTON_HOOK || self.BUTTON_USE);
+                               button_pressed = (PHYS_INPUT_BUTTON_ATCK(self) || PHYS_INPUT_BUTTON_JUMP(self) || PHYS_INPUT_BUTTON_ATCK2(self) || PHYS_INPUT_BUTTON_HOOK(self) || PHYS_INPUT_BUTTON_USE(self));
 
                                if (self.deadflag == DEAD_DYING)
                                {
@@ -2331,7 +2330,7 @@ void PlayerPreThink ()
 
                self.prevorigin = self.origin;
 
-               float do_crouch = self.BUTTON_CROUCH;
+               float do_crouch = PHYS_INPUT_BUTTON_CROUCH(self);
                if(self.hook.state)
                        do_crouch = 0;
                if(self.vehicle)
@@ -2418,10 +2417,10 @@ void PlayerPreThink ()
        // WEAPONTODO: Add weapon request for this
        if(!zoomstate_set)
                SetZoomState(
-                       self.BUTTON_ZOOM
-                       || self.BUTTON_ZOOMSCRIPT
-                       || (self.BUTTON_ATCK2 && PS(self).m_weapon == WEP_VORTEX)
-                       || (self.BUTTON_ATCK2 && PS(self).m_weapon == WEP_RIFLE && WEP_CVAR(rifle, secondary) == 0)
+                       PHYS_INPUT_BUTTON_ZOOM(self)
+                       || PHYS_INPUT_BUTTON_ZOOMSCRIPT(self)
+                       || (PHYS_INPUT_BUTTON_ATCK2(self) && PS(self).m_weapon == WEP_VORTEX)
+                       || (PHYS_INPUT_BUTTON_ATCK2(self) && PS(self).m_weapon == WEP_RIFLE && WEP_CVAR(rifle, secondary) == 0)
                ); // WEAPONTODO
 
        float oldspectatee_status;
index 69505bcddacbf48df0369a2d20f26b7de61e40c9..46743ce2e16955be47952b6321dd50c6212e8fa2 100644 (file)
@@ -361,7 +361,7 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage,
        {
                this.pusher = attacker;
                this.pushltime = time + autocvar_g_maxpushtime;
-               this.istypefrag = this.BUTTON_CHAT;
+               this.istypefrag = PHYS_INPUT_BUTTON_CHAT(this);
        }
        else if(time < this.pushltime)
        {
index 050cccb996c1837ab18f13bb56d6f54c158401e5..27755db96f7cf1122731515f0849210c51f34e21 100644 (file)
@@ -6,22 +6,6 @@
 
 #define INDEPENDENT_ATTACK_FINISHED 1
 
-// TODO: deprecated: remove. Replaced by physics.qh PHYS_INPUT_BUTTON_*
-
-#define BUTTON_ATCK       button0
-#define BUTTON_JUMP       button2
-#define BUTTON_ATCK2      button3
-#define BUTTON_ZOOM       button4
-#define BUTTON_CROUCH     button5
-#define BUTTON_HOOK       button6
-#define BUTTON_INFO       button7
-#define BUTTON_DRAG       button8
-#define BUTTON_USE        buttonuse
-#define BUTTON_CHAT       buttonchat
-#define BUTTON_PRYDON     cursor_active
-#define BUTTON_ZOOMSCRIPT button9
-#define BUTTON_JETPACK    button10
-
 // Globals
 
 float g_footsteps, g_grappling_hook, g_instagib;
index 23897720e3ecf75492058975180c5a4643cd0626..614dd8a575f88b478dd4e5bc69db3cd877b3bfb5 100644 (file)
@@ -125,7 +125,7 @@ string AppendItemcodes(string s, entity player)
                s = strcat(s, "I");
        if(player.flagcarried != world)
                s = strcat(s, "F");
-       if(player.BUTTON_CHAT)
+       if(PHYS_INPUT_BUTTON_CHAT(player))
                s = strcat(s, "T");
        if(player.kh_next)
                s = strcat(s, "K");
@@ -800,7 +800,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d
                                        {
                                                if(deathtype != DEATH_FIRE.m_id)
                                                {
-                                                       if(victim.BUTTON_CHAT)
+                                                       if(PHYS_INPUT_BUTTON_CHAT(victim))
                                                                attacker.typehitsound += 1;
                                                        else
                                                                attacker.damage_dealt += damage;
index 4a32779289d12c54f10da05bb6e357b4c8266a89..c0509a3f69b0d5d8386f7d32a218882980618286 100644 (file)
@@ -251,7 +251,7 @@ void GrapplingHookThink()
                                                        self.aiment.nextthink = time + autocvar_g_balance_grapplehook_nade_time; // set time after letting go?
                                                aim_ent.pusher = self.realowner;
                                                aim_ent.pushltime = time + autocvar_g_maxpushtime;
-                                               aim_ent.istypefrag = aim_ent.BUTTON_CHAT;
+                                               aim_ent.istypefrag = PHYS_INPUT_BUTTON_CHAT(aim_ent);
                                        }
                                }
 
@@ -333,7 +333,7 @@ void GrapplingHook_Damage(entity this, entity inflictor, entity attacker, float
                {
                        this.realowner.pusher = attacker;
                        this.realowner.pushltime = time + autocvar_g_maxpushtime;
-                       this.realowner.istypefrag = this.realowner.BUTTON_CHAT;
+                       this.realowner.istypefrag = PHYS_INPUT_BUTTON_CHAT(this.realowner);
                }
                RemoveGrapplingHook(this.realowner);
        }
index b168efbdf39ee067d275f354bdea731dbf9e1d8f..e92d0e25203660c79137e0519ccef34d72aca576 100644 (file)
@@ -1298,7 +1298,7 @@ void IntermissionThink()
                return;
 
        if(!mapvote_initialized)
-               if (time < intermission_exittime + 10 && !(self.BUTTON_ATCK || self.BUTTON_JUMP || self.BUTTON_ATCK2 || self.BUTTON_HOOK || self.BUTTON_USE))
+               if (time < intermission_exittime + 10 && !(PHYS_INPUT_BUTTON_ATCK(self) || PHYS_INPUT_BUTTON_JUMP(self) || PHYS_INPUT_BUTTON_ATCK2(self) || PHYS_INPUT_BUTTON_HOOK(self) || PHYS_INPUT_BUTTON_USE(self)))
                        return;
 
        MapVote_Start();
index 6f8ec9551bee113a88dbf955db8b2e5a7e100ed5..9ef4f79a1c80a20242c389e04c6024704bbfe4da 100644 (file)
@@ -919,7 +919,7 @@ float kh_CheckPlayers(float num)
                float t_team = kh_Team_ByID(num);
                float players = 0;
                FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
-                       if(!IS_DEAD(it) && !it.BUTTON_CHAT && it.team == t_team)
+                       if(!IS_DEAD(it) && !PHYS_INPUT_BUTTON_CHAT(it) && it.team == t_team)
                                ++players;
                ));
 
@@ -1005,7 +1005,7 @@ void kh_StartRound()  // runs at the start of each round
                players = 0;
                entity my_player = world;
                FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
-                       if(!IS_DEAD(it) && !it.BUTTON_CHAT && it.team == teem)
+                       if(!IS_DEAD(it) && !PHYS_INPUT_BUTTON_CHAT(it) && it.team == teem)
                        {
                                ++players;
                                if(random() * players <= 1)
index 6f263ae448c9b4e96e0bb664bcf43fa1f2d5b83b..69ad7d0c65144deddf03134a68f83704b9861935 100644 (file)
@@ -59,11 +59,11 @@ void playerdemo_open_write(string f)
        PLAYERDEMO_FIELD(func,float,frame) \
        PLAYERDEMO_FIELD(func,float,effects) \
        /* PLAYERDEMO_FIELD(func,float,switchweapon) */ \
-       PLAYERDEMO_FIELD(func,float,BUTTON_ATCK) \
-       PLAYERDEMO_FIELD(func,float,BUTTON_ATCK2) \
-       PLAYERDEMO_FIELD(func,float,BUTTON_CROUCH) \
-       PLAYERDEMO_FIELD(func,float,BUTTON_HOOK) \
-       PLAYERDEMO_FIELD(func,float,BUTTON_USE) \
+       PLAYERDEMO_FIELD(func,float,button0) /* TODO: PHYS_INPUT_BUTTON_ATCK */ \
+       PLAYERDEMO_FIELD(func,float,button3) /* TODO: PHYS_INPUT_BUTTON_ATCK2 */ \
+       PLAYERDEMO_FIELD(func,float,button5) /* TODO: PHYS_INPUT_BUTTON_CROUCH */ \
+       PLAYERDEMO_FIELD(func,float,button6) /* TODO: PHYS_INPUT_BUTTON_HOOK */ \
+       PLAYERDEMO_FIELD(func,float,buttonuse) /* TODO: PHYS_INPUT_BUTTON_USE */ \
        PLAYERDEMO_FIELD(func,float,flags) \
        // end of list
 
index 1637d867663333b6fef51d276e69ba532ef54e0d..aea975ec7b322fc22be144284c6dfc905b177bac 100644 (file)
@@ -427,7 +427,7 @@ void W_WeaponFrame(entity actor)
                if (actor.(weaponentity).state != WS_CLEAR)
                {
                        Weapon wpn = PS(actor).m_weapon;
-                       w_ready(wpn, actor, weaponentity, (actor.BUTTON_ATCK ? 1 : 0) | (actor.BUTTON_ATCK2 ? 2 : 0));
+                       w_ready(wpn, actor, weaponentity, PHYS_INPUT_BUTTON_ATCK(actor) | (PHYS_INPUT_BUTTON_ATCK2(actor) << 1));
                        return;
                }
        }
@@ -533,7 +533,7 @@ void W_WeaponFrame(entity actor)
 
                bool block_weapon = false;
                {
-                       bool key_pressed = actor.BUTTON_HOOK && !actor.vehicle;
+                       bool key_pressed = PHYS_INPUT_BUTTON_HOOK(actor) && !actor.vehicle;
                        Weapon off = actor.offhand;
                        if (off && !(actor.weapons & WEPSET(HOOK)))
                        {
@@ -545,7 +545,7 @@ void W_WeaponFrame(entity actor)
                                        W_SwitchWeapon(WEP_HOOK);
                                actor.hook_switchweapon = key_pressed;
                                Weapon h = WEP_HOOK;
-                               block_weapon = (PS(actor).m_weapon == h && (actor.BUTTON_ATCK || key_pressed));
+                               block_weapon = (PS(actor).m_weapon == h && (PHYS_INPUT_BUTTON_ATCK(actor) || key_pressed));
                                h.wr_think(h, actor, weaponentity, block_weapon ? 1 : 0);
                        }
                }
@@ -559,7 +559,7 @@ void W_WeaponFrame(entity actor)
                        if (w)
                        {
                                Weapon e = PS(actor).m_weapon;
-                               e.wr_think(e, actor, weaponentity, (actor.BUTTON_ATCK ? 1 : 0) | (actor.BUTTON_ATCK2 ? 2 : 0));
+                               e.wr_think(e, actor, weaponentity, PHYS_INPUT_BUTTON_ATCK(actor) | (PHYS_INPUT_BUTTON_ATCK2(actor) << 1));
                        }
                        else
                        {
@@ -577,7 +577,7 @@ void W_WeaponFrame(entity actor)
                                v_up = up;
                                Weapon wpn = PS(actor).m_weapon;
                                this.weapon_think(wpn, actor, weaponentity,
-                                       (actor.BUTTON_ATCK ? 1 : 0) | (actor.BUTTON_ATCK2 ? 2 : 0));
+                                       PHYS_INPUT_BUTTON_ATCK(actor) | (PHYS_INPUT_BUTTON_ATCK2(actor) << 1));
                        }
                        else
                        {
@@ -681,7 +681,7 @@ void W_ReloadedAndReady(Weapon thiswep, entity actor, .entity weaponentity, int
        // ATTACK_FINISHED(actor, slot) -= actor.reload_time - 1;
 
        Weapon wpn = Weapons_from(PS(actor).m_weapon.m_id);
-       w_ready(wpn, actor, weaponentity, (actor.BUTTON_ATCK ? 1 : 0) | (actor.BUTTON_ATCK2 ? 2 : 0));
+       w_ready(wpn, actor, weaponentity, PHYS_INPUT_BUTTON_ATCK(actor) | (PHYS_INPUT_BUTTON_ATCK2(actor) << 1));
 }
 
 void W_Reload(entity actor, float sent_ammo_min, string sent_sound)