From: Mario Date: Sat, 17 Feb 2018 05:49:08 +0000 (+1000) Subject: Fix misuse of WEP_TYPE_OTHER and hide weapons with its flag from the scoreboard ... X-Git-Tag: xonotic-v0.8.5~2305 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5817dda68b9901d17b3d567d3eccec2e040b98cf;p=xonotic%2Fxonotic-data.pk3dir.git Fix misuse of WEP_TYPE_OTHER and hide weapons with its flag from the scoreboard (they're weapons that don't hurt) --- diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index 0360eb07e..200f5b2c5 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -1140,6 +1140,11 @@ vector Scoreboard_AccuracyStats_Draw(vector pos, vector rgb, vector bg_size) int weapon_stats = weapon_accuracy[i - WEP_FIRST]; WepSet set = it.m_wepset; + if(it.spawnflags & WEP_TYPE_OTHER) + { + ++nHidden; + continue; + } if (weapon_stats < 0 && !((weapons_stat & set) || (weapons_inmap & set))) { if (((it.spawnflags & WEP_FLAG_HIDDEN) || (it.spawnflags & WEP_FLAG_MUTATORBLOCKED))) @@ -1220,6 +1225,8 @@ vector Scoreboard_AccuracyStats_Draw(vector pos, vector rgb, vector bg_size) WepSet set = it.m_wepset; if (weapon_stats < 0 && !((weapons_stat & set) || (weapons_inmap & set))) continue; + if (it.spawnflags & WEP_TYPE_OTHER) + continue; float weapon_alpha; if (weapon_stats >= 0) diff --git a/qcsrc/common/monsters/monster/mage.qh b/qcsrc/common/monsters/monster/mage.qh index 98fb76673..18f8f5963 100644 --- a/qcsrc/common/monsters/monster/mage.qh +++ b/qcsrc/common/monsters/monster/mage.qh @@ -23,7 +23,7 @@ REGISTER_MONSTER(MAGE, NEW(Mage)); #include CLASS(MageSpike, PortoLaunch) -/* flags */ ATTRIB(MageSpike, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(MageSpike, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); /* impulse */ ATTRIB(MageSpike, impulse, int, 9); /* refname */ ATTRIB(MageSpike, netname, string, "magespike"); /* wepname */ ATTRIB(MageSpike, m_name, string, _("Mage spike")); diff --git a/qcsrc/common/monsters/monster/spider.qh b/qcsrc/common/monsters/monster/spider.qh index 3a688de32..908f0f942 100644 --- a/qcsrc/common/monsters/monster/spider.qh +++ b/qcsrc/common/monsters/monster/spider.qh @@ -22,7 +22,7 @@ REGISTER_MONSTER(SPIDER, NEW(Spider)); #include CLASS(SpiderAttack, PortoLaunch) -/* flags */ ATTRIB(SpiderAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(SpiderAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); /* impulse */ ATTRIB(SpiderAttack, impulse, int, 9); /* refname */ ATTRIB(SpiderAttack, netname, string, "spider"); /* wepname */ ATTRIB(SpiderAttack, m_name, string, _("Spider attack")); diff --git a/qcsrc/common/monsters/monster/wyvern.qh b/qcsrc/common/monsters/monster/wyvern.qh index 2326b0dd1..2c5df0564 100644 --- a/qcsrc/common/monsters/monster/wyvern.qh +++ b/qcsrc/common/monsters/monster/wyvern.qh @@ -22,7 +22,7 @@ REGISTER_MONSTER(WYVERN, NEW(Wyvern)); #include CLASS(WyvernAttack, PortoLaunch) -/* flags */ ATTRIB(WyvernAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(WyvernAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); /* impulse */ ATTRIB(WyvernAttack, impulse, int, 9); /* refname */ ATTRIB(WyvernAttack, netname, string, "wyvern"); /* wepname */ ATTRIB(WyvernAttack, m_name, string, _("Wyvern attack")); diff --git a/qcsrc/common/turrets/turret/ewheel_weapon.qh b/qcsrc/common/turrets/turret/ewheel_weapon.qh index 974a32ca1..cbf7cb30f 100644 --- a/qcsrc/common/turrets/turret/ewheel_weapon.qh +++ b/qcsrc/common/turrets/turret/ewheel_weapon.qh @@ -1,7 +1,7 @@ #pragma once CLASS(EWheelAttack, PortoLaunch) -/* flags */ ATTRIB(EWheelAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(EWheelAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); /* impulse */ ATTRIB(EWheelAttack, impulse, int, 5); /* refname */ ATTRIB(EWheelAttack, netname, string, "turret_ewheel"); /* wepname */ ATTRIB(EWheelAttack, m_name, string, _("eWheel")); diff --git a/qcsrc/common/turrets/turret/flac_weapon.qh b/qcsrc/common/turrets/turret/flac_weapon.qh index 7857f2f38..13965bf51 100644 --- a/qcsrc/common/turrets/turret/flac_weapon.qh +++ b/qcsrc/common/turrets/turret/flac_weapon.qh @@ -1,5 +1,7 @@ #pragma once +// TODO: WEP_TYPE_OTHER? + CLASS(FlacAttack, PortoLaunch) /* flags */ ATTRIB(FlacAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); /* impulse */ ATTRIB(FlacAttack, impulse, int, 5); diff --git a/qcsrc/common/turrets/turret/hellion_weapon.qh b/qcsrc/common/turrets/turret/hellion_weapon.qh index 88ac33672..69c67b800 100644 --- a/qcsrc/common/turrets/turret/hellion_weapon.qh +++ b/qcsrc/common/turrets/turret/hellion_weapon.qh @@ -1,7 +1,7 @@ #pragma once CLASS(HellionAttack, PortoLaunch) -/* flags */ ATTRIB(HellionAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(HellionAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); /* impulse */ ATTRIB(HellionAttack, impulse, int, 9); /* refname */ ATTRIB(HellionAttack, netname, string, "turret_hellion"); /* wepname */ ATTRIB(HellionAttack, m_name, string, _("Hellion")); diff --git a/qcsrc/common/turrets/turret/hk_weapon.qh b/qcsrc/common/turrets/turret/hk_weapon.qh index 87e0c88c2..7d44cfff9 100644 --- a/qcsrc/common/turrets/turret/hk_weapon.qh +++ b/qcsrc/common/turrets/turret/hk_weapon.qh @@ -1,7 +1,7 @@ #pragma once CLASS(HunterKillerAttack, PortoLaunch) -/* flags */ ATTRIB(HunterKillerAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(HunterKillerAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); /* impulse */ ATTRIB(HunterKillerAttack, impulse, int, 9); /* refname */ ATTRIB(HunterKillerAttack, netname, string, "turret_hk"); /* wepname */ ATTRIB(HunterKillerAttack, m_name, string, _("Hunter-Killer")); diff --git a/qcsrc/common/turrets/turret/machinegun_weapon.qh b/qcsrc/common/turrets/turret/machinegun_weapon.qh index 30163bc93..ab8169e6c 100644 --- a/qcsrc/common/turrets/turret/machinegun_weapon.qh +++ b/qcsrc/common/turrets/turret/machinegun_weapon.qh @@ -1,7 +1,7 @@ #pragma once CLASS(MachineGunTurretAttack, PortoLaunch) -/* flags */ ATTRIB(MachineGunTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(MachineGunTurretAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); /* impulse */ ATTRIB(MachineGunTurretAttack, impulse, int, 9); /* refname */ ATTRIB(MachineGunTurretAttack, netname, string, "turret_machinegun"); /* wepname */ ATTRIB(MachineGunTurretAttack, m_name, string, _("Machinegun")); diff --git a/qcsrc/common/turrets/turret/mlrs_weapon.qh b/qcsrc/common/turrets/turret/mlrs_weapon.qh index c583842cd..ccb74771a 100644 --- a/qcsrc/common/turrets/turret/mlrs_weapon.qh +++ b/qcsrc/common/turrets/turret/mlrs_weapon.qh @@ -1,7 +1,7 @@ #pragma once CLASS(MLRSTurretAttack, PortoLaunch) -/* flags */ ATTRIB(MLRSTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(MLRSTurretAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); /* impulse */ ATTRIB(MLRSTurretAttack, impulse, int, 9); /* refname */ ATTRIB(MLRSTurretAttack, netname, string, "turret_mlrs"); /* wepname */ ATTRIB(MLRSTurretAttack, m_name, string, _("MLRS")); diff --git a/qcsrc/common/turrets/turret/phaser_weapon.qh b/qcsrc/common/turrets/turret/phaser_weapon.qh index 326a90e97..ea45977d5 100644 --- a/qcsrc/common/turrets/turret/phaser_weapon.qh +++ b/qcsrc/common/turrets/turret/phaser_weapon.qh @@ -1,7 +1,7 @@ #pragma once CLASS(PhaserTurretAttack, PortoLaunch) -/* flags */ ATTRIB(PhaserTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(PhaserTurretAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); /* impulse */ ATTRIB(PhaserTurretAttack, impulse, int, 9); /* refname */ ATTRIB(PhaserTurretAttack, netname, string, "turret_phaser"); /* wepname */ ATTRIB(PhaserTurretAttack, m_name, string, _("Phaser")); diff --git a/qcsrc/common/turrets/turret/plasma_weapon.qh b/qcsrc/common/turrets/turret/plasma_weapon.qh index 5c733846f..3c11fdc00 100644 --- a/qcsrc/common/turrets/turret/plasma_weapon.qh +++ b/qcsrc/common/turrets/turret/plasma_weapon.qh @@ -1,7 +1,7 @@ #pragma once CLASS(PlasmaAttack, PortoLaunch) -/* flags */ ATTRIB(PlasmaAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(PlasmaAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); /* impulse */ ATTRIB(PlasmaAttack, impulse, int, 5); /* refname */ ATTRIB(PlasmaAttack, netname, string, "turret_plasma"); /* wepname */ ATTRIB(PlasmaAttack, m_name, string, _("Plasma")); diff --git a/qcsrc/common/turrets/turret/tesla_weapon.qh b/qcsrc/common/turrets/turret/tesla_weapon.qh index 7e3879bc0..a73985266 100644 --- a/qcsrc/common/turrets/turret/tesla_weapon.qh +++ b/qcsrc/common/turrets/turret/tesla_weapon.qh @@ -1,7 +1,7 @@ #pragma once CLASS(TeslaCoilTurretAttack, PortoLaunch) -/* flags */ ATTRIB(TeslaCoilTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(TeslaCoilTurretAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); /* impulse */ ATTRIB(TeslaCoilTurretAttack, impulse, int, 9); /* refname */ ATTRIB(TeslaCoilTurretAttack, netname, string, "turret_tesla"); /* wepname */ ATTRIB(TeslaCoilTurretAttack, m_name, string, _("Tesla Coil")); diff --git a/qcsrc/common/turrets/turret/walker_weapon.qh b/qcsrc/common/turrets/turret/walker_weapon.qh index 4e2078514..7c4fc0bed 100644 --- a/qcsrc/common/turrets/turret/walker_weapon.qh +++ b/qcsrc/common/turrets/turret/walker_weapon.qh @@ -1,7 +1,7 @@ #pragma once CLASS(WalkerTurretAttack, PortoLaunch) -/* flags */ ATTRIB(WalkerTurretAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(WalkerTurretAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); /* impulse */ ATTRIB(WalkerTurretAttack, impulse, int, 5); /* refname */ ATTRIB(WalkerTurretAttack, netname, string, "turret_walker"); /* wepname */ ATTRIB(WalkerTurretAttack, m_name, string, _("Walker")); diff --git a/qcsrc/common/vehicles/vehicle/racer_weapon.qh b/qcsrc/common/vehicles/vehicle/racer_weapon.qh index 3bd712011..7e4505ca3 100644 --- a/qcsrc/common/vehicles/vehicle/racer_weapon.qh +++ b/qcsrc/common/vehicles/vehicle/racer_weapon.qh @@ -3,7 +3,7 @@ #include CLASS(RacerAttack, PortoLaunch) -/* flags */ ATTRIB(RacerAttack, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(RacerAttack, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); /* impulse */ ATTRIB(RacerAttack, impulse, int, 3); /* refname */ ATTRIB(RacerAttack, netname, string, "racercannon"); /* wepname */ ATTRIB(RacerAttack, m_name, string, _("Racer cannon")); diff --git a/qcsrc/common/vehicles/vehicle/raptor_weapons.qh b/qcsrc/common/vehicles/vehicle/raptor_weapons.qh index a7908d50d..c7ffff797 100644 --- a/qcsrc/common/vehicles/vehicle/raptor_weapons.qh +++ b/qcsrc/common/vehicles/vehicle/raptor_weapons.qh @@ -3,7 +3,7 @@ #include CLASS(RaptorCannon, PortoLaunch) -/* flags */ ATTRIB(RaptorCannon, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(RaptorCannon, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); /* impulse */ ATTRIB(RaptorCannon, impulse, int, 3); /* refname */ ATTRIB(RaptorCannon, netname, string, "raptorcannon"); /* wepname */ ATTRIB(RaptorCannon, m_name, string, _("Raptor cannon")); @@ -11,7 +11,7 @@ ENDCLASS(RaptorCannon) REGISTER_WEAPON(RAPTOR, NEW(RaptorCannon)); CLASS(RaptorBomb, PortoLaunch) -/* flags */ ATTRIB(RaptorBomb, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); +/* flags */ ATTRIB(RaptorBomb, spawnflags, int, WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED); /* impulse */ ATTRIB(RaptorBomb, impulse, int, 3); /* refname */ ATTRIB(RaptorBomb, netname, string, "raptorbomb"); /* wepname */ ATTRIB(RaptorBomb, m_name, string, _("Raptor bomb")); diff --git a/qcsrc/common/weapons/weapon.qh b/qcsrc/common/weapons/weapon.qh index 0ed34006c..87cb11429 100644 --- a/qcsrc/common/weapons/weapon.qh +++ b/qcsrc/common/weapons/weapon.qh @@ -185,21 +185,20 @@ int max_shot_distance = 32768; // determined by world mins/maxs when map loads #endif // weapon flags -const int WEP_TYPE_OTHER = 0x00; // not for damaging people -const int WEP_TYPE_SPLASH = 0x01; // splash damage -const int WEP_TYPE_HITSCAN = 0x02; // hitscan -const int WEP_TYPEMASK = 0x0F; -const int WEP_FLAG_CANCLIMB = 0x10; // can be used for movement -const int WEP_FLAG_NORMAL = 0x20; // in "most weapons" set -const int WEP_FLAG_HIDDEN = 0x40; // hides from menu -const int WEP_FLAG_RELOADABLE = 0x80; // can has reload -const int WEP_FLAG_SUPERWEAPON = 0x100; // powerup timer -const int WEP_FLAG_MUTATORBLOCKED = 0x200; // hides from impulse 99 etc. (mutators are allowed to clear this flag) -const int WEP_TYPE_MELEE_PRI = 0x400; // primary attack is melee swing (for animation) -const int WEP_TYPE_MELEE_SEC = 0x800; // secondary attack is melee swing (for animation) -const int WEP_FLAG_DUALWIELD = 0x1000; // weapon can be dual wielded -const int WEP_FLAG_NODUAL = 0x2000; // weapon doesn't work well with dual wielding (fireball etc just explode on fire), doesn't currently prevent anything -const int WEP_FLAG_PENETRATEWALLS = 0x4000; // weapon has high calibur bullets that can penetrate thick walls (WEAPONTODO) +const int WEP_TYPE_OTHER = BIT(0); // not for damaging people +const int WEP_TYPE_SPLASH = BIT(1); // splash damage +const int WEP_TYPE_HITSCAN = BIT(2); // hitscan +const int WEP_FLAG_CANCLIMB = BIT(3); // can be used for movement +const int WEP_FLAG_NORMAL = BIT(4); // in "most weapons" set +const int WEP_FLAG_HIDDEN = BIT(5); // hides from menu +const int WEP_FLAG_RELOADABLE = BIT(6); // can has reload +const int WEP_FLAG_SUPERWEAPON = BIT(7); // powerup timer +const int WEP_FLAG_MUTATORBLOCKED = BIT(8); // hides from impulse 99 etc. (mutators are allowed to clear this flag) +const int WEP_TYPE_MELEE_PRI = BIT(9); // primary attack is melee swing (for animation) +const int WEP_TYPE_MELEE_SEC = BIT(12); // secondary attack is melee swing (for animation) +const int WEP_FLAG_DUALWIELD = BIT(13); // weapon can be dual wielded +const int WEP_FLAG_NODUAL = BIT(14); // weapon doesn't work well with dual wielding (fireball etc just explode on fire), doesn't currently prevent anything +const int WEP_FLAG_PENETRATEWALLS = BIT(15); // weapon has high calibur bullets that can penetrate thick walls (WEAPONTODO) // variables: string weaponorder_byid;