From: TimePath Date: Wed, 9 Mar 2016 09:49:56 +0000 (+1100) Subject: Use PHYS_INPUT_BUTTON_* X-Git-Tag: xonotic-v0.8.2~1142 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0ce2bdf81013a9a30117a5e3083d536ced038bb3;p=xonotic%2Fxonotic-data.pk3dir.git Use PHYS_INPUT_BUTTON_* --- diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 346062d64..8f1d80276 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -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) diff --git a/qcsrc/common/mutators/mutator/bloodloss/bloodloss.qc b/qcsrc/common/mutators/mutator/bloodloss/bloodloss.qc index 4543ae10e..de3d19038 100644 --- a/qcsrc/common/mutators/mutator/bloodloss/bloodloss.qc +++ b/qcsrc/common/mutators/mutator/bloodloss/bloodloss.qc @@ -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) { diff --git a/qcsrc/common/mutators/mutator/buffs/buffs.qc b/qcsrc/common/mutators/mutator/buffs/buffs.qc index 903237f92..a9c56737e 100644 --- a/qcsrc/common/mutators/mutator/buffs/buffs.qc +++ b/qcsrc/common/mutators/mutator/buffs/buffs.qc @@ -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); diff --git a/qcsrc/common/mutators/mutator/campcheck/campcheck.qc b/qcsrc/common/mutators/mutator/campcheck/campcheck.qc index 4916464a1..06ce98b94 100644 --- a/qcsrc/common/mutators/mutator/campcheck/campcheck.qc +++ b/qcsrc/common/mutators/mutator/campcheck/campcheck.qc @@ -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; diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index b54ee9176..e80141822 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -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; diff --git a/qcsrc/common/mutators/mutator/overkill/hmg.qc b/qcsrc/common/mutators/mutator/overkill/hmg.qc index c08c3690e..fb1a49633 100644 --- a/qcsrc/common/mutators/mutator/overkill/hmg.qc +++ b/qcsrc/common/mutators/mutator/overkill/hmg.qc @@ -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)) { diff --git a/qcsrc/common/mutators/mutator/overkill/overkill.qc b/qcsrc/common/mutators/mutator/overkill/overkill.qc index f0db0836a..972220e75 100644 --- a/qcsrc/common/mutators/mutator/overkill/overkill.qc +++ b/qcsrc/common/mutators/mutator/overkill/overkill.qc @@ -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; } diff --git a/qcsrc/common/mutators/mutator/overkill/rpc.qc b/qcsrc/common/mutators/mutator/overkill/rpc.qc index 96e54d5a0..5b108c792 100644 --- a/qcsrc/common/mutators/mutator/overkill/rpc.qc +++ b/qcsrc/common/mutators/mutator/overkill/rpc.qc @@ -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)) { diff --git a/qcsrc/common/physics/player.qc b/qcsrc/common/physics/player.qc index 208b16c3b..af3f87c15 100644 --- a/qcsrc/common/physics/player.qc +++ b/qcsrc/common/physics/player.qc @@ -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... diff --git a/qcsrc/common/triggers/teleporters.qc b/qcsrc/common/triggers/teleporters.qc index eae31ead0..801776857 100644 --- a/qcsrc/common/triggers/teleporters.qc +++ b/qcsrc/common/triggers/teleporters.qc @@ -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 { diff --git a/qcsrc/common/vehicles/vehicle/bumblebee.qc b/qcsrc/common/vehicles/vehicle/bumblebee.qc index f65bb0cd5..194ff1365 100644 --- a/qcsrc/common/vehicles/vehicle/bumblebee.qc +++ b/qcsrc/common/vehicles/vehicle/bumblebee.qc @@ -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; diff --git a/qcsrc/common/vehicles/vehicle/racer.qc b/qcsrc/common/vehicles/vehicle/racer.qc index 7e9632d96..74ed19e69 100644 --- a/qcsrc/common/vehicles/vehicle/racer.qc +++ b/qcsrc/common/vehicles/vehicle/racer.qc @@ -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'); diff --git a/qcsrc/common/vehicles/vehicle/raptor.qc b/qcsrc/common/vehicles/vehicle/raptor.qc index 67c67d948..caf253aee 100644 --- a/qcsrc/common/vehicles/vehicle/raptor.qc +++ b/qcsrc/common/vehicles/vehicle/raptor.qc @@ -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; } diff --git a/qcsrc/common/vehicles/vehicle/spiderbot.qc b/qcsrc/common/vehicles/vehicle/spiderbot.qc index 5bb26070d..41d67a78f 100644 --- a/qcsrc/common/vehicles/vehicle/spiderbot.qc +++ b/qcsrc/common/vehicles/vehicle/spiderbot.qc @@ -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 diff --git a/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc b/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc index 257eac801..9dfc72c13 100644 --- a/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc +++ b/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qc @@ -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: diff --git a/qcsrc/common/viewloc.qc b/qcsrc/common/viewloc.qc index f67bbc887..fb510f856 100644 --- a/qcsrc/common/viewloc.qc +++ b/qcsrc/common/viewloc.qc @@ -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) { diff --git a/qcsrc/common/weapons/weapon/arc.qc b/qcsrc/common/weapons/weapon/arc.qc index 1d3ea78a5..c35ab3ede 100644 --- a/qcsrc/common/weapons/weapon/arc.qc +++ b/qcsrc/common/weapons/weapon/arc.qc @@ -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, diff --git a/qcsrc/common/weapons/weapon/blaster.qc b/qcsrc/common/weapons/weapon/blaster.qc index 1d76279f3..69d9298b8 100644 --- a/qcsrc/common/weapons/weapon/blaster.qc +++ b/qcsrc/common/weapons/weapon/blaster.qc @@ -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)) diff --git a/qcsrc/common/weapons/weapon/crylink.qc b/qcsrc/common/weapons/weapon/crylink.qc index 455567a2f..2348a33b9 100644 --- a/qcsrc/common/weapons/weapon/crylink.qc +++ b/qcsrc/common/weapons/weapon/crylink.qc @@ -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)) { diff --git a/qcsrc/common/weapons/weapon/devastator.qc b/qcsrc/common/weapons/weapon/devastator.qc index 0272e424c..3d89299e1 100644 --- a/qcsrc/common/weapons/weapon/devastator.qc +++ b/qcsrc/common/weapons/weapon/devastator.qc @@ -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 diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index 3e93644fb..55266f842 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -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; } } diff --git a/qcsrc/common/weapons/weapon/fireball.qc b/qcsrc/common/weapons/weapon/fireball.qc index 50119a687..ce17e8f39 100644 --- a/qcsrc/common/weapons/weapon/fireball.qc +++ b/qcsrc/common/weapons/weapon/fireball.qc @@ -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; } } diff --git a/qcsrc/common/weapons/weapon/hagar.qc b/qcsrc/common/weapons/weapon/hagar.qc index ff6088f8f..9b4bbd418 100644 --- a/qcsrc/common/weapons/weapon/hagar.qc +++ b/qcsrc/common/weapons/weapon/hagar.qc @@ -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)) { diff --git a/qcsrc/common/weapons/weapon/hlac.qc b/qcsrc/common/weapons/weapon/hlac.qc index 3c158f608..deae8b11c 100644 --- a/qcsrc/common/weapons/weapon/hlac.qc +++ b/qcsrc/common/weapons/weapon/hlac.qc @@ -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)) { diff --git a/qcsrc/common/weapons/weapon/hook.qc b/qcsrc/common/weapons/weapon/hook.qc index 96743b75e..0b679e098 100644 --- a/qcsrc/common/weapons/weapon/hook.qc +++ b/qcsrc/common/weapons/weapon/hook.qc @@ -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) { diff --git a/qcsrc/common/weapons/weapon/machinegun.qc b/qcsrc/common/weapons/weapon/machinegun.qc index f220752b3..daace7312 100644 --- a/qcsrc/common/weapons/weapon/machinegun.qc +++ b/qcsrc/common/weapons/weapon/machinegun.qc @@ -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)) { diff --git a/qcsrc/common/weapons/weapon/minelayer.qc b/qcsrc/common/weapons/weapon/minelayer.qc index e5c43f3a4..e08b51d20 100644 --- a/qcsrc/common/weapons/weapon/minelayer.qc +++ b/qcsrc/common/weapons/weapon/minelayer.qc @@ -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)) diff --git a/qcsrc/common/weapons/weapon/mortar.qc b/qcsrc/common/weapons/weapon/mortar.qc index b361a5050..e7c00bb04 100644 --- a/qcsrc/common/weapons/weapon/mortar.qc +++ b/qcsrc/common/weapons/weapon/mortar.qc @@ -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; } } diff --git a/qcsrc/common/weapons/weapon/porto.qc b/qcsrc/common/weapons/weapon/porto.qc index 56b2759ec..97f993f9e 100644 --- a/qcsrc/common/weapons/weapon/porto.qc +++ b/qcsrc/common/weapons/weapon/porto.qc @@ -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)) { diff --git a/qcsrc/common/weapons/weapon/rifle.qc b/qcsrc/common/weapons/weapon/rifle.qc index 526ba0e20..f3291dfe1 100644 --- a/qcsrc/common/weapons/weapon/rifle.qc +++ b/qcsrc/common/weapons/weapon/rifle.qc @@ -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; } } diff --git a/qcsrc/common/weapons/weapon/seeker.qc b/qcsrc/common/weapons/weapon/seeker.qc index a25e928cb..7642b3b7b 100644 --- a/qcsrc/common/weapons/weapon/seeker.qc +++ b/qcsrc/common/weapons/weapon/seeker.qc @@ -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)) { diff --git a/qcsrc/common/weapons/weapon/shockwave.qc b/qcsrc/common/weapons/weapon/shockwave.qc index 46cb78e0a..887419896 100644 --- a/qcsrc/common/weapons/weapon/shockwave.qc +++ b/qcsrc/common/weapons/weapon/shockwave.qc @@ -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)) { diff --git a/qcsrc/common/weapons/weapon/shotgun.qc b/qcsrc/common/weapons/weapon/shotgun.qc index 7da7dfd04..9ca6cf588 100644 --- a/qcsrc/common/weapons/weapon/shotgun.qc +++ b/qcsrc/common/weapons/weapon/shotgun.qc @@ -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)) { diff --git a/qcsrc/common/weapons/weapon/tuba.qc b/qcsrc/common/weapons/weapon/tuba.qc index 0e429acb2..5461d68d9 100644 --- a/qcsrc/common/weapons/weapon/tuba.qc +++ b/qcsrc/common/weapons/weapon/tuba.qc @@ -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; } } diff --git a/qcsrc/common/weapons/weapon/vaporizer.qc b/qcsrc/common/weapons/weapon/vaporizer.qc index 2ece54932..f7b2c1026 100644 --- a/qcsrc/common/weapons/weapon/vaporizer.qc +++ b/qcsrc/common/weapons/weapon/vaporizer.qc @@ -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)) { diff --git a/qcsrc/common/weapons/weapon/vortex.qc b/qcsrc/common/weapons/weapon/vortex.qc index 83ea7e597..e44c51ee4 100644 --- a/qcsrc/common/weapons/weapon/vortex.qc +++ b/qcsrc/common/weapons/weapon/vortex.qc @@ -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)) { diff --git a/qcsrc/server/bot/aim.qc b/qcsrc/server/bot/aim.qc index 79f0a2758..67057181b 100644 --- a/qcsrc/server/bot/aim.qc +++ b/qcsrc/server/bot/aim.qc @@ -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; diff --git a/qcsrc/server/bot/bot.qc b/qcsrc/server/bot/bot.qc index 468b32c4a..72ebfcb2e 100644 --- a/qcsrc/server/bot/bot.qc +++ b/qcsrc/server/bot/bot.qc @@ -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; } } diff --git a/qcsrc/server/bot/havocbot/havocbot.qc b/qcsrc/server/bot/havocbot/havocbot.qc index 134e78401..260e8e661 100644 --- a/qcsrc/server/bot/havocbot/havocbot.qc +++ b/qcsrc/server/bot/havocbot/havocbot.qc @@ -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) 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); } diff --git a/qcsrc/server/bot/scripting.qc b/qcsrc/server/bot/scripting.qc index f42adceef..f15c9a6fb 100644 --- a/qcsrc/server/bot/scripting.qc +++ b/qcsrc/server/bot/scripting.qc @@ -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; diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index c30e3d45a..b6ed06d67 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -12,6 +12,8 @@ #include "../common/deathtypes/all.qh" #include "../common/util.qh" +#include + #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; diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index de2603437..67b1dbe99 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -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; diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 69505bcdd..46743ce2e 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -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) { diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index 050cccb99..27755db96 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -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; diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 23897720e..614dd8a57 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -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; diff --git a/qcsrc/server/g_hook.qc b/qcsrc/server/g_hook.qc index 4a3277928..c0509a3f6 100644 --- a/qcsrc/server/g_hook.qc +++ b/qcsrc/server/g_hook.qc @@ -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); } diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index b168efbdf..e92d0e252 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -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(); diff --git a/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc b/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc index 6f8ec9551..9ef4f79a1 100644 --- a/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc +++ b/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc @@ -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) diff --git a/qcsrc/server/playerdemo.qc b/qcsrc/server/playerdemo.qc index 6f263ae44..69ad7d0c6 100644 --- a/qcsrc/server/playerdemo.qc +++ b/qcsrc/server/playerdemo.qc @@ -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 diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index 1637d8676..aea975ec7 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -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)