From be91ef701b96453388cdcfb40f561281076ef52d Mon Sep 17 00:00:00 2001 From: TimePath Date: Thu, 1 Oct 2015 20:37:41 +1000 Subject: [PATCH] Weapons: remove useless weapon return values and implementations --- qcsrc/common/monsters/monster/mage.qc | 3 +- qcsrc/common/monsters/monster/spider.qc | 11 +++-- qcsrc/common/monsters/monster/wyvern.qc | 4 +- qcsrc/common/turrets/turret/ewheel_weapon.qc | 3 +- qcsrc/common/turrets/turret/flac_weapon.qc | 3 +- qcsrc/common/turrets/turret/hellion_weapon.qc | 3 +- qcsrc/common/turrets/turret/hk_weapon.qc | 3 +- .../turrets/turret/machinegun_weapon.qc | 3 +- qcsrc/common/turrets/turret/mlrs_weapon.qc | 3 +- qcsrc/common/turrets/turret/phaser_weapon.qc | 3 +- qcsrc/common/turrets/turret/plasma_weapon.qc | 3 +- qcsrc/common/turrets/turret/tesla_weapon.qc | 5 +- qcsrc/common/turrets/turret/walker_weapon.qc | 3 +- qcsrc/common/vehicles/vehicle/racer_weapon.qc | 3 +- .../common/vehicles/vehicle/raptor_weapons.qc | 9 ++-- qcsrc/common/weapons/weapon.qh | 33 +++++++------ qcsrc/common/weapons/weapon/arc.qc | 37 +++----------- qcsrc/common/weapons/weapon/blaster.qc | 34 +++---------- qcsrc/common/weapons/weapon/crylink.qc | 34 +++---------- qcsrc/common/weapons/weapon/devastator.qc | 44 +++++------------ qcsrc/common/weapons/weapon/electro.qc | 41 ++++------------ qcsrc/common/weapons/weapon/fireball.qc | 37 ++++---------- qcsrc/common/weapons/weapon/hagar.qc | 49 +++++-------------- qcsrc/common/weapons/weapon/hlac.qc | 33 +++---------- qcsrc/common/weapons/weapon/hmg.qc | 34 +++---------- qcsrc/common/weapons/weapon/hook.qc | 38 +++----------- qcsrc/common/weapons/weapon/machinegun.qc | 36 ++++---------- qcsrc/common/weapons/weapon/minelayer.qc | 37 ++++---------- qcsrc/common/weapons/weapon/mortar.qc | 34 +++---------- qcsrc/common/weapons/weapon/porto.qc | 31 +++--------- qcsrc/common/weapons/weapon/rifle.qc | 31 ++++-------- qcsrc/common/weapons/weapon/rpc.qc | 33 +++---------- qcsrc/common/weapons/weapon/seeker.qc | 32 +++--------- qcsrc/common/weapons/weapon/shockwave.qc | 30 +++--------- qcsrc/common/weapons/weapon/shotgun.qc | 40 ++++----------- qcsrc/common/weapons/weapon/tuba.qc | 34 +++---------- qcsrc/common/weapons/weapon/vaporizer.qc | 33 +++++-------- qcsrc/common/weapons/weapon/vortex.qc | 36 +++++--------- qcsrc/server/mutators/gamemode_nexball.qc | 14 +----- qcsrc/server/weapons/weaponsystem.qc | 6 +-- qcsrc/server/weapons/weaponsystem.qh | 2 +- 41 files changed, 244 insertions(+), 661 deletions(-) diff --git a/qcsrc/common/monsters/monster/mage.qc b/qcsrc/common/monsters/monster/mage.qc index e2521fb0b..f7ec01408 100644 --- a/qcsrc/common/monsters/monster/mage.qc +++ b/qcsrc/common/monsters/monster/mage.qc @@ -40,7 +40,7 @@ REGISTER_WEAPON(MAGE_SPIKE, NEW(MageSpike)); void M_Mage_Attack_Spike(vector dir); void M_Mage_Attack_Push(); -METHOD(MageSpike, wr_think, bool(MageSpike thiswep, bool fire1, bool fire2)) { +METHOD(MageSpike, wr_think, void(MageSpike thiswep, bool fire1, bool fire2)) { SELFPARAM(); if (fire1) if (!IS_PLAYER(self) || weapon_prepareattack(false, 0.2)) { @@ -56,7 +56,6 @@ METHOD(MageSpike, wr_think, bool(MageSpike thiswep, bool fire1, bool fire2)) { M_Mage_Attack_Push(); weapon_thinkf(WFRAME_FIRE2, 0, w_ready); } - return true; } void M_Mage_Attack_Teleport(); diff --git a/qcsrc/common/monsters/monster/spider.qc b/qcsrc/common/monsters/monster/spider.qc index 78f8aff09..c305ec668 100644 --- a/qcsrc/common/monsters/monster/spider.qc +++ b/qcsrc/common/monsters/monster/spider.qc @@ -50,7 +50,7 @@ float autocvar_g_monster_spider_attack_bite_delay; void M_Spider_Attack_Web(); -METHOD(SpiderAttack, wr_think, bool(SpiderAttack thiswep, bool fire1, bool fire2)) { +METHOD(SpiderAttack, wr_think, void(SpiderAttack thiswep, bool fire1, bool fire2)) { SELFPARAM(); bool isPlayer = IS_PLAYER(self); if (fire1) @@ -66,7 +66,7 @@ METHOD(SpiderAttack, wr_think, bool(SpiderAttack thiswep, bool fire1, bool fire2 if (!isPlayer) w_shotdir = normalize((self.enemy.origin + '0 0 10') - self.origin); M_Spider_Attack_Web(); weapon_thinkf(WFRAME_FIRE1, 0, w_ready); - return true; + return; } if (fire2) if (!isPlayer || weapon_prepareattack(true, 0.5)) { @@ -77,7 +77,6 @@ METHOD(SpiderAttack, wr_think, bool(SpiderAttack thiswep, bool fire1, bool fire2 Monster_Attack_Melee(self.enemy, (autocvar_g_monster_spider_attack_bite_damage), ((random() > 0.5) ? self.anim_melee : self.anim_shoot), self.attack_range, (autocvar_g_monster_spider_attack_bite_delay), DEATH_MONSTER_SPIDER, true); weapon_thinkf(WFRAME_FIRE2, 0, w_ready); } - return true; } float autocvar_g_monster_spider_health; @@ -160,11 +159,13 @@ bool M_Spider_Attack(int attack_type, entity targ) Weapon wep = WEP_SPIDER_ATTACK; case MONSTER_ATTACK_MELEE: { - return wep.wr_think(wep, false, true); + wep.wr_think(wep, false, true); + return true; } case MONSTER_ATTACK_RANGED: { - return wep.wr_think(wep, true, false); + wep.wr_think(wep, true, false); + return true; } } diff --git a/qcsrc/common/monsters/monster/wyvern.qc b/qcsrc/common/monsters/monster/wyvern.qc index 7474150cc..c74067a4e 100644 --- a/qcsrc/common/monsters/monster/wyvern.qc +++ b/qcsrc/common/monsters/monster/wyvern.qc @@ -48,7 +48,7 @@ float autocvar_g_monster_wyvern_attack_fireball_speed; void M_Wyvern_Attack_Fireball_Explode(); void M_Wyvern_Attack_Fireball_Touch(); -METHOD(WyvernAttack, wr_think, bool(WyvernAttack thiswep, bool fire1, bool fire2)) { +METHOD(WyvernAttack, wr_think, void(WyvernAttack thiswep, bool fire1, bool fire2)) { SELFPARAM(); if (fire1) @@ -76,9 +76,7 @@ METHOD(WyvernAttack, wr_think, bool(WyvernAttack thiswep, bool fire1, bool fire2 CSQCProjectile(missile, true, PROJECTILE_FIREMINE, true); weapon_thinkf(WFRAME_FIRE1, 0, w_ready); - return true; } - return true; } METHOD(WyvernAttack, wr_checkammo1, bool(WyvernAttack thiswep)) { diff --git a/qcsrc/common/turrets/turret/ewheel_weapon.qc b/qcsrc/common/turrets/turret/ewheel_weapon.qc index ca7949f36..377c8a4f4 100644 --- a/qcsrc/common/turrets/turret/ewheel_weapon.qc +++ b/qcsrc/common/turrets/turret/ewheel_weapon.qc @@ -16,7 +16,7 @@ REGISTER_WEAPON(EWHEEL, NEW(EWheelAttack)); #ifdef SVQC void turret_initparams(entity); -METHOD(EWheelAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2)) { +METHOD(EWheelAttack, wr_think, void(entity thiswep, bool fire1, bool fire2)) { SELFPARAM(); bool isPlayer = IS_PLAYER(self); if (fire1) @@ -44,7 +44,6 @@ METHOD(EWheelAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2)) { self.tur_head.frame = 0; } } - return true; } #endif diff --git a/qcsrc/common/turrets/turret/flac_weapon.qc b/qcsrc/common/turrets/turret/flac_weapon.qc index de9c6d0c2..277df6e45 100644 --- a/qcsrc/common/turrets/turret/flac_weapon.qc +++ b/qcsrc/common/turrets/turret/flac_weapon.qc @@ -16,7 +16,7 @@ REGISTER_WEAPON(FLAC, NEW(FlacAttack)); #ifdef SVQC void turret_flac_projectile_think_explode(); -METHOD(FlacAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2)) { +METHOD(FlacAttack, wr_think, void(entity thiswep, bool fire1, bool fire2)) { SELFPARAM(); bool isPlayer = IS_PLAYER(self); if (fire1) @@ -45,7 +45,6 @@ METHOD(FlacAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2)) { self.tur_head.frame = 0; } } - return true; } void turret_flac_projectile_think_explode() diff --git a/qcsrc/common/turrets/turret/hellion_weapon.qc b/qcsrc/common/turrets/turret/hellion_weapon.qc index 10299798b..0556c6600 100644 --- a/qcsrc/common/turrets/turret/hellion_weapon.qc +++ b/qcsrc/common/turrets/turret/hellion_weapon.qc @@ -19,7 +19,7 @@ float autocvar_g_turrets_unit_hellion_shot_speed_gain; float autocvar_g_turrets_unit_hellion_shot_speed_max; void turret_hellion_missile_think(); -METHOD(HellionAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2)) { +METHOD(HellionAttack, wr_think, void(entity thiswep, bool fire1, bool fire2)) { SELFPARAM(); bool isPlayer = IS_PLAYER(self); if (fire1) @@ -50,7 +50,6 @@ METHOD(HellionAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2)) { missile.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_GUIDED_HEAT; if (!isPlayer) self.tur_head.frame += 1; } - return true; } void turret_hellion_missile_think() diff --git a/qcsrc/common/turrets/turret/hk_weapon.qc b/qcsrc/common/turrets/turret/hk_weapon.qc index a33e9af9e..3678c9628 100644 --- a/qcsrc/common/turrets/turret/hk_weapon.qc +++ b/qcsrc/common/turrets/turret/hk_weapon.qc @@ -23,7 +23,7 @@ float autocvar_g_turrets_unit_hk_shot_speed_max; float autocvar_g_turrets_unit_hk_shot_speed_turnrate; void turret_hk_missile_think(); -METHOD(HunterKillerAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2)) +METHOD(HunterKillerAttack, wr_think, void(entity thiswep, bool fire1, bool fire2)) { SELFPARAM(); bool isPlayer = IS_PLAYER(self); @@ -53,7 +53,6 @@ METHOD(HunterKillerAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2 if (self.tur_head.frame == 0) self.tur_head.frame = self.tur_head.frame + 1; } - return true; } bool hk_is_valid_target(entity e_target); diff --git a/qcsrc/common/turrets/turret/machinegun_weapon.qc b/qcsrc/common/turrets/turret/machinegun_weapon.qc index 1dce92cad..b467187ba 100644 --- a/qcsrc/common/turrets/turret/machinegun_weapon.qc +++ b/qcsrc/common/turrets/turret/machinegun_weapon.qc @@ -17,7 +17,7 @@ REGISTER_WEAPON(TUR_MACHINEGUN, NEW(MachineGunTurretAttack)); void W_MachineGun_MuzzleFlash(); -METHOD(MachineGunTurretAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2)) +METHOD(MachineGunTurretAttack, wr_think, void(entity thiswep, bool fire1, bool fire2)) { SELFPARAM(); bool isPlayer = IS_PLAYER(self); @@ -35,7 +35,6 @@ METHOD(MachineGunTurretAttack, wr_think, bool(entity thiswep, bool fire1, bool f W_MachineGun_MuzzleFlash(); setattachment(self.muzzle_flash, self.tur_head, "tag_fire"); } - return true; } #endif diff --git a/qcsrc/common/turrets/turret/mlrs_weapon.qc b/qcsrc/common/turrets/turret/mlrs_weapon.qc index 39436b809..4e17d7531 100644 --- a/qcsrc/common/turrets/turret/mlrs_weapon.qc +++ b/qcsrc/common/turrets/turret/mlrs_weapon.qc @@ -15,7 +15,7 @@ REGISTER_WEAPON(TUR_MLRS, NEW(MLRSTurretAttack)); #ifdef SVQC -METHOD(MLRSTurretAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2)) +METHOD(MLRSTurretAttack, wr_think, void(entity thiswep, bool fire1, bool fire2)) { SELFPARAM(); bool isPlayer = IS_PLAYER(self); @@ -36,7 +36,6 @@ METHOD(MLRSTurretAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2)) missile.missile_flags = MIF_SPLASH; te_explosion (missile.origin); } - return true; } #endif diff --git a/qcsrc/common/turrets/turret/phaser_weapon.qc b/qcsrc/common/turrets/turret/phaser_weapon.qc index 1a337d85a..5db0bbb27 100644 --- a/qcsrc/common/turrets/turret/phaser_weapon.qc +++ b/qcsrc/common/turrets/turret/phaser_weapon.qc @@ -18,7 +18,7 @@ void beam_think(); .int fireflag; -METHOD(PhaserTurretAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2)) +METHOD(PhaserTurretAttack, wr_think, void(entity thiswep, bool fire1, bool fire2)) { SELFPARAM(); bool isPlayer = IS_PLAYER(self); @@ -62,7 +62,6 @@ METHOD(PhaserTurretAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2 if (self.tur_head.frame == 0) self.tur_head.frame = 1; } - return true; } void beam_think() diff --git a/qcsrc/common/turrets/turret/plasma_weapon.qc b/qcsrc/common/turrets/turret/plasma_weapon.qc index 1e1a01c6d..a7a23f452 100644 --- a/qcsrc/common/turrets/turret/plasma_weapon.qc +++ b/qcsrc/common/turrets/turret/plasma_weapon.qc @@ -15,7 +15,7 @@ REGISTER_WEAPON(PLASMA, NEW(PlasmaAttack)); #ifdef SVQC -METHOD(PlasmaAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2)) { +METHOD(PlasmaAttack, wr_think, void(entity thiswep, bool fire1, bool fire2)) { SELFPARAM(); bool isPlayer = IS_PLAYER(self); if (fire1) @@ -32,7 +32,6 @@ METHOD(PlasmaAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2)) { missile.missile_flags = MIF_SPLASH; Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); } - return true; } #endif diff --git a/qcsrc/common/turrets/turret/tesla_weapon.qc b/qcsrc/common/turrets/turret/tesla_weapon.qc index 1e8d6b2a9..130bac0f3 100644 --- a/qcsrc/common/turrets/turret/tesla_weapon.qc +++ b/qcsrc/common/turrets/turret/tesla_weapon.qc @@ -16,7 +16,7 @@ REGISTER_WEAPON(TESLA, NEW(TeslaCoilTurretAttack)); #ifdef SVQC entity toast(entity from, float range, float damage); -METHOD(TeslaCoilTurretAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2)) { +METHOD(TeslaCoilTurretAttack, wr_think, void(entity thiswep, bool fire1, bool fire2)) { SELFPARAM(); bool isPlayer = IS_PLAYER(self); if (fire1) @@ -40,7 +40,7 @@ METHOD(TeslaCoilTurretAttack, wr_think, bool(entity thiswep, bool fire1, bool fi entity t = toast(e,r,d); remove(e); - if (t == NULL) return true; + if (t == NULL) return; self.target_validate_flags = TFL_TARGETSELECT_PLAYERS | TFL_TARGETSELECT_MISSILES | TFL_TARGETSELECT_TEAMCHECK; @@ -60,7 +60,6 @@ METHOD(TeslaCoilTurretAttack, wr_think, bool(entity thiswep, bool fire1, bool fi } } - return true; } entity toast(entity from, float range, float damage) diff --git a/qcsrc/common/turrets/turret/walker_weapon.qc b/qcsrc/common/turrets/turret/walker_weapon.qc index eb2da58f2..a557d7ff0 100644 --- a/qcsrc/common/turrets/turret/walker_weapon.qc +++ b/qcsrc/common/turrets/turret/walker_weapon.qc @@ -15,7 +15,7 @@ REGISTER_WEAPON(WALKER, NEW(WalkerTurretAttack)); #ifdef SVQC -METHOD(WalkerTurretAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2)) { +METHOD(WalkerTurretAttack, wr_think, void(entity thiswep, bool fire1, bool fire2)) { SELFPARAM(); bool isPlayer = IS_PLAYER(self); if (fire1) @@ -32,7 +32,6 @@ METHOD(WalkerTurretAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2 fireBullet (self.tur_shotorg, self.tur_shotdir_updated, self.shot_spread, 0, self.shot_dmg, self.shot_force, DEATH_TURRET_WALK_GUN, 0); Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1); } - return true; } #endif diff --git a/qcsrc/common/vehicles/vehicle/racer_weapon.qc b/qcsrc/common/vehicles/vehicle/racer_weapon.qc index c5059a004..e201260f0 100644 --- a/qcsrc/common/vehicles/vehicle/racer_weapon.qc +++ b/qcsrc/common/vehicles/vehicle/racer_weapon.qc @@ -42,7 +42,7 @@ float autocvar_g_vehicle_racer_rocket_climbspeed; float autocvar_g_vehicle_racer_rocket_locked_maxangle; void racer_fire_rocket(vector org, vector dir, entity trg); -METHOD(RacerAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2)) +METHOD(RacerAttack, wr_think, void(entity thiswep, bool fire1, bool fire2)) { SELFPARAM(); bool isPlayer = IS_PLAYER(self); @@ -72,7 +72,6 @@ METHOD(RacerAttack, wr_think, bool(entity thiswep, bool fire1, bool fire2)) weapon_thinkf(WFRAME_FIRE2, 0, w_ready); } setself(this); - return true; } METHOD(RacerAttack, wr_checkammo1, bool(RacerAttack thiswep)) diff --git a/qcsrc/common/vehicles/vehicle/raptor_weapons.qc b/qcsrc/common/vehicles/vehicle/raptor_weapons.qc index c884e5a28..47c480c46 100644 --- a/qcsrc/common/vehicles/vehicle/raptor_weapons.qc +++ b/qcsrc/common/vehicles/vehicle/raptor_weapons.qc @@ -51,7 +51,7 @@ float autocvar_g_vehicle_raptor_bomblet_radius; float autocvar_g_vehicle_raptor_bomblet_force; float autocvar_g_vehicle_raptor_bomblet_explode_delay; -METHOD(RaptorCannon, wr_think, bool(entity thiswep, bool fire1, bool fire2)) { +METHOD(RaptorCannon, wr_think, void(entity thiswep, bool fire1, bool fire2)) { SELFPARAM(); bool isPlayer = IS_PLAYER(self); entity player = isPlayer ? self : self.owner; @@ -79,7 +79,6 @@ METHOD(RaptorCannon, wr_think, bool(entity thiswep, bool fire1, bool fire2)) { weapon_thinkf(WFRAME_FIRE1, 0, w_ready); } setself(this); - return true; } METHOD(RaptorCannon, wr_checkammo1, bool(RacerAttack thiswep)) { SELFPARAM(); @@ -92,7 +91,7 @@ METHOD(RaptorCannon, wr_checkammo1, bool(RacerAttack thiswep)) { float autocvar_g_vehicle_raptor_bombs_refire; void raptor_bombdrop(); -METHOD(RaptorBomb, wr_think, bool(entity thiswep, bool fire1, bool fire2)) { +METHOD(RaptorBomb, wr_think, void(entity thiswep, bool fire1, bool fire2)) { SELFPARAM(); bool isPlayer = IS_PLAYER(self); entity player = isPlayer ? self : self.owner; @@ -105,7 +104,6 @@ METHOD(RaptorBomb, wr_think, bool(entity thiswep, bool fire1, bool fire2)) { weapon_thinkf(WFRAME_FIRE1, 0, w_ready); } setself(this); - return true; } float autocvar_g_vehicle_raptor_flare_refire; @@ -117,7 +115,7 @@ void raptor_flare_think(); void raptor_flare_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force); void raptor_flare_touch(); -METHOD(RaptorFlare, wr_think, bool(entity thiswep, bool fire1, bool fire2)) { +METHOD(RaptorFlare, wr_think, void(entity thiswep, bool fire1, bool fire2)) { SELFPARAM(); bool isPlayer = IS_PLAYER(self); entity player = isPlayer ? self : self.owner; @@ -147,7 +145,6 @@ METHOD(RaptorFlare, wr_think, bool(entity thiswep, bool fire1, bool fire2)) { weapon_thinkf(WFRAME_FIRE2, 0, w_ready); } setself(this); - return true; } diff --git a/qcsrc/common/weapons/weapon.qh b/qcsrc/common/weapons/weapon.qh index 71c42065c..718272adf 100644 --- a/qcsrc/common/weapons/weapon.qh +++ b/qcsrc/common/weapons/weapon.qh @@ -47,39 +47,42 @@ CLASS(Weapon, Object) ATTRIB(Weapon, message, string, "AOL CD Thrower"); /** (SERVER) setup weapon data */ - METHOD(Weapon, wr_setup, bool(Weapon this)) {return false;} + METHOD(Weapon, wr_setup, void(Weapon this)) {} /** (SERVER) logic to run every frame */ - METHOD(Weapon, wr_think, bool(Weapon this, bool fire1, bool fire2)) {return false;} + METHOD(Weapon, wr_think, void(Weapon this, bool fire1, bool fire2)) {} /** (SERVER) checks ammo for weapon primary */ METHOD(Weapon, wr_checkammo1, bool(Weapon this)) {return false;} /** (SERVER) checks ammo for weapon second */ METHOD(Weapon, wr_checkammo2, bool(Weapon this)) {return false;} /** (SERVER) runs bot aiming code for this weapon */ - METHOD(Weapon, wr_aim, bool(Weapon this)) {return false;} + METHOD(Weapon, wr_aim, void(Weapon this)) {} /** (BOTH) precaches models/sounds used by this weapon, also sets up weapon properties */ - METHOD(Weapon, wr_init, bool(Weapon this)) {return false;} + METHOD(Weapon, wr_init, void(Weapon this)) {} /** (SERVER) notification number for suicide message (may inspect w_deathtype for details) */ - METHOD(Weapon, wr_suicidemessage, bool(Weapon this)) {return false;} + METHOD(Weapon, wr_suicidemessage, int(Weapon this)) {return 0;} /** (SERVER) notification number for kill message (may inspect w_deathtype for details) */ - METHOD(Weapon, wr_killmessage, bool(Weapon this)) {return false;} + METHOD(Weapon, wr_killmessage, int(Weapon this)) {return 0;} /** (SERVER) handles reloading for weapon */ - METHOD(Weapon, wr_reload, bool(Weapon this)) {return false;} + METHOD(Weapon, wr_reload, void(Weapon this)) {} /** (SERVER) clears fields that the weapon may use */ - METHOD(Weapon, wr_resetplayer, bool(Weapon this)) {return false;} + METHOD(Weapon, wr_resetplayer, void(Weapon this)) {} /** (CLIENT) impact effect for weapon explosion */ - METHOD(Weapon, wr_impacteffect, bool(Weapon this)) {return false;} + METHOD(Weapon, wr_impacteffect, void(Weapon this)) {} /** (SERVER) called whenever a player dies */ - METHOD(Weapon, wr_playerdeath, bool(Weapon this)) {return false;} + METHOD(Weapon, wr_playerdeath, void(Weapon this)) {} /** (SERVER) logic to run when weapon is lost */ - METHOD(Weapon, wr_gonethink, bool(Weapon this)) {return false;} + METHOD(Weapon, wr_gonethink, void(Weapon this)) {} /** (ALL) dump weapon cvars to config in data directory (see: sv_cmd dumpweapons) */ - METHOD(Weapon, wr_config, bool(Weapon this)) {return false;} + METHOD(Weapon, wr_config, void(Weapon this)) {} /** (CLIENT) weapon specific zoom reticle */ - METHOD(Weapon, wr_zoomreticle, bool(Weapon this)) {return false;} + METHOD(Weapon, wr_zoomreticle, bool(Weapon this)) { + // no weapon specific image for this weapon + return false; + } /** (SERVER) the weapon is dropped */ - METHOD(Weapon, wr_drop, bool(Weapon this)) {return false;} + METHOD(Weapon, wr_drop, void(Weapon this)) {} /** (SERVER) a weapon is picked up */ - METHOD(Weapon, wr_pickup, bool(Weapon this)) {return false;} + METHOD(Weapon, wr_pickup, void(Weapon this)) {} METHOD(Weapon, display, void(entity this, void(string name, string icon) returns)) { returns(this.message, this.model2 ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.model2) : string_null); diff --git a/qcsrc/common/weapons/weapon/arc.qc b/qcsrc/common/weapons/weapon/arc.qc index 4714c03f1..36ba74e2c 100644 --- a/qcsrc/common/weapons/weapon/arc.qc +++ b/qcsrc/common/weapons/weapon/arc.qc @@ -634,7 +634,7 @@ void Arc_Smoke() } } - METHOD(Arc, wr_aim, bool(entity thiswep)) + METHOD(Arc, wr_aim, void(entity thiswep)) { SELFPARAM(); if(WEP_CVAR(arc, beam_botaimspeed)) @@ -655,9 +655,8 @@ void Arc_Smoke() false ); } - return true; } - METHOD(Arc, wr_think, bool(entity thiswep, bool fire1, bool fire2)) + METHOD(Arc, wr_think, void(entity thiswep, bool fire1, bool fire2)) { SELFPARAM(); Arc_Player_SetHeat(self); @@ -691,7 +690,7 @@ void Arc_Smoke() } } - return true; + return; } if(self.arc_BUTTON_ATCK_prev) @@ -712,10 +711,8 @@ void Arc_Smoke() self.arc_secondarytime = time + autocvar_g_balance_arc_secondary_refire2 * W_WeaponRateFactor(); } #endif - - return true; } - METHOD(Arc, wr_init, bool(entity thiswep)) + METHOD(Arc, wr_init, void(entity thiswep)) { if(!arc_shotorigin[0]) { @@ -725,7 +722,6 @@ void Arc_Smoke() arc_shotorigin[3] = shotorg_adjust_values(CL_Weapon_GetShotOrg(WEP_ARC.m_id), false, false, 4); } ARC_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP); - return true; } METHOD(Arc, wr_checkammo1, bool(entity thiswep)) { @@ -738,24 +734,22 @@ void Arc_Smoke() return WEP_CVAR(arc, overheat_max) > 0 && ((!WEP_CVAR(arc, burst_ammo)) || (self.WEP_AMMO(ARC) > 0)); } - METHOD(Arc, wr_config, bool(entity thiswep)) + METHOD(Arc, wr_config, void(entity thiswep)) { ARC_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS); - return true; } - METHOD(Arc, wr_killmessage, bool(entity thiswep)) + METHOD(Arc, wr_killmessage, int(entity thiswep)) { return WEAPON_ARC_MURDER; } - METHOD(Arc, wr_drop, bool(entity thiswep)) + METHOD(Arc, wr_drop, void(entity thiswep)) { weapon_dropevent_item.arc_overheat = self.arc_overheat; weapon_dropevent_item.arc_cooldown = self.arc_cooldown; self.arc_overheat = 0; self.arc_cooldown = 0; - return true; } - METHOD(Arc, wr_pickup, bool(entity thiswep)) + METHOD(Arc, wr_pickup, void(entity thiswep)) { if ( !client_hasweapon(self, WEP_ARC.m_id, false, false) && weapon_dropevent_item.arc_overheat > time ) @@ -763,7 +757,6 @@ void Arc_Smoke() self.arc_overheat = weapon_dropevent_item.arc_overheat; self.arc_cooldown = weapon_dropevent_item.arc_cooldown; } - return true; } #endif #ifdef CSQC @@ -1509,19 +1502,5 @@ void Ent_ReadArcBeam(float isnew) } } - METHOD(Arc, wr_impacteffect, bool(entity thiswep)) - { - // todo - return true; - } - METHOD(Arc, wr_init, bool(entity thiswep)) - { - return true; - } - METHOD(Arc, wr_zoomreticle, bool(entity thiswep)) - { - // no weapon specific image for this weapon - return false; - } #endif #endif diff --git a/qcsrc/common/weapons/weapon/blaster.qc b/qcsrc/common/weapons/weapon/blaster.qc index df54c6b92..699f8f1d9 100644 --- a/qcsrc/common/weapons/weapon/blaster.qc +++ b/qcsrc/common/weapons/weapon/blaster.qc @@ -147,7 +147,7 @@ void W_Blaster_Attack( } } - METHOD(Blaster, wr_aim, bool(entity thiswep)) + METHOD(Blaster, wr_aim, void(entity thiswep)) { if(WEP_CVAR(blaster, secondary)) { @@ -158,11 +158,9 @@ void W_Blaster_Attack( } else { self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(blaster, speed), 0, WEP_CVAR_PRI(blaster, lifetime), false); } - - return true; } - METHOD(Blaster, wr_think, bool(entity thiswep, bool fire1, bool fire2)) + METHOD(Blaster, wr_think, void(entity thiswep, bool fire1, bool fire2)) { if(fire1) { @@ -217,19 +215,16 @@ void W_Blaster_Attack( } } } - return true; } - METHOD(Blaster, wr_init, bool(entity thiswep)) + METHOD(Blaster, wr_init, void(entity thiswep)) { BLASTER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP); - return true; } - METHOD(Blaster, wr_setup, bool(entity thiswep)) + METHOD(Blaster, wr_setup, void(entity thiswep)) { self.ammo_field = ammo_none; - return true; } METHOD(Blaster, wr_checkammo1, bool(entity thiswep)) @@ -242,18 +237,17 @@ void W_Blaster_Attack( return true; // blaster has infinite ammo } - METHOD(Blaster, wr_config, bool(entity thiswep)) + METHOD(Blaster, wr_config, void(entity thiswep)) { BLASTER_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS); - return true; } - METHOD(Blaster, wr_suicidemessage, bool(entity thiswep)) + METHOD(Blaster, wr_suicidemessage, int(entity thiswep)) { return WEAPON_BLASTER_SUICIDE; } - METHOD(Blaster, wr_killmessage, bool(entity thiswep)) + METHOD(Blaster, wr_killmessage, int(entity thiswep)) { return WEAPON_BLASTER_MURDER; } @@ -261,24 +255,12 @@ void W_Blaster_Attack( #endif #ifdef CSQC - METHOD(Blaster, wr_impacteffect, bool(entity thiswep)) + METHOD(Blaster, wr_impacteffect, void(entity thiswep)) { vector org2; org2 = w_org + w_backoff * 6; pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), org2, w_backoff * 1000, 1); if(!w_issilent) { sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM); } - return true; - } - - METHOD(Blaster, wr_init, bool(entity thiswep)) - { - return true; - } - - METHOD(Blaster, wr_zoomreticle, bool(entity thiswep)) - { - // no weapon specific image for this weapon - return false; } #endif diff --git a/qcsrc/common/weapons/weapon/crylink.qc b/qcsrc/common/weapons/weapon/crylink.qc index efa538764..229580562 100644 --- a/qcsrc/common/weapons/weapon/crylink.qc +++ b/qcsrc/common/weapons/weapon/crylink.qc @@ -566,17 +566,15 @@ void W_Crylink_Attack2(Weapon thiswep) } } - METHOD(Crylink, wr_aim, bool(entity thiswep)) + METHOD(Crylink, wr_aim, void(entity thiswep)) { SELFPARAM(); if(random() < 0.10) self.BUTTON_ATCK = 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); - - return true; } - METHOD(Crylink, wr_think, bool(entity thiswep, bool fire1, bool fire2)) + METHOD(Crylink, wr_think, void(entity thiswep, bool fire1, bool fire2)) { SELFPARAM(); if(autocvar_g_balance_crylink_reload_ammo && self.clip_load < min(WEP_CVAR_PRI(crylink, ammo), WEP_CVAR_SEC(crylink, ammo))) { // forced reload @@ -634,13 +632,10 @@ void W_Crylink_Attack2(Weapon thiswep) } } } - - return true; } - METHOD(Crylink, wr_init, bool(entity thiswep)) + METHOD(Crylink, wr_init, void(entity thiswep)) { CRYLINK_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP); - return true; } METHOD(Crylink, wr_checkammo1, bool(entity thiswep)) { @@ -664,27 +659,25 @@ void W_Crylink_Attack2(Weapon thiswep) ammo_amount += self.(weapon_load[WEP_CRYLINK.m_id]) >= WEP_CVAR_SEC(crylink, ammo); return ammo_amount; } - METHOD(Crylink, wr_config, bool(entity thiswep)) + METHOD(Crylink, wr_config, void(entity thiswep)) { CRYLINK_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS); - return true; } - METHOD(Crylink, wr_reload, bool(entity thiswep)) + METHOD(Crylink, wr_reload, void(entity thiswep)) { W_Reload(min(WEP_CVAR_PRI(crylink, ammo), WEP_CVAR_SEC(crylink, ammo)), SND(RELOAD)); - return true; } - METHOD(Crylink, wr_suicidemessage, bool(entity thiswep)) + METHOD(Crylink, wr_suicidemessage, int(entity thiswep)) { return WEAPON_CRYLINK_SUICIDE; } - METHOD(Crylink, wr_killmessage, bool(entity thiswep)) + METHOD(Crylink, wr_killmessage, int(entity thiswep)) { return WEAPON_CRYLINK_MURDER; } #endif #ifdef CSQC - METHOD(Crylink, wr_impacteffect, bool(entity thiswep)) + METHOD(Crylink, wr_impacteffect, void(entity thiswep)) { SELFPARAM(); vector org2; @@ -701,17 +694,6 @@ void W_Crylink_Attack2(Weapon thiswep) if(!w_issilent) sound(self, CH_SHOTS, SND_CRYLINK_IMPACT, VOL_BASE, ATTN_NORM); } - - return true; - } - METHOD(Crylink, wr_init, bool(entity thiswep)) - { - return true; - } - METHOD(Crylink, wr_zoomreticle, bool(entity thiswep)) - { - // no weapon specific image for this weapon - return false; } #endif #endif diff --git a/qcsrc/common/weapons/weapon/devastator.qc b/qcsrc/common/weapons/weapon/devastator.qc index 2204548b2..130eb88b0 100644 --- a/qcsrc/common/weapons/weapon/devastator.qc +++ b/qcsrc/common/weapons/weapon/devastator.qc @@ -395,7 +395,7 @@ void W_Devastator_Attack(Weapon thiswep) } #if 0 - METHOD(Devastator, wr_aim, bool(entity 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); @@ -420,11 +420,9 @@ void W_Devastator_Attack(Weapon thiswep) if(self.BUTTON_ATCK2) self.BUTTON_ATCK = false; } - - return true; } #else - METHOD(Devastator, wr_aim, bool(entity 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); @@ -518,11 +516,9 @@ void W_Devastator_Attack(Weapon thiswep) // dprint(ftos(desirabledamage),"\n"); if(self.BUTTON_ATCK2 == true) self.BUTTON_ATCK = false; } - - return true; } #endif - METHOD(Devastator, wr_think, bool(entity thiswep, bool fire1, bool fire2)) + METHOD(Devastator, wr_think, void(entity thiswep, bool fire1, bool fire2)) { if(WEP_CVAR(devastator, reload_ammo) && self.clip_load < WEP_CVAR(devastator, ammo)) { // forced reload Weapon w = get_weaponinfo(self.weapon); @@ -559,18 +555,14 @@ void W_Devastator_Attack(Weapon thiswep) sound(self, CH_WEAPON_B, SND_ROCKET_DET, VOL_BASE, ATTN_NORM); } } - - return true; } - METHOD(Devastator, wr_init, bool(entity thiswep)) + METHOD(Devastator, wr_init, void(entity thiswep)) { DEVASTATOR_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP); - return true; } - METHOD(Devastator, wr_setup, bool(entity thiswep)) + METHOD(Devastator, wr_setup, void(entity thiswep)) { self.rl_release = 1; - return true; } METHOD(Devastator, wr_checkammo1, bool(entity thiswep)) { @@ -612,26 +604,23 @@ void W_Devastator_Attack(Weapon thiswep) { return false; } - METHOD(Devastator, wr_config, bool(entity thiswep)) + METHOD(Devastator, wr_config, void(entity thiswep)) { DEVASTATOR_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS); - return true; } - METHOD(Devastator, wr_resetplayer, bool(entity thiswep)) + METHOD(Devastator, wr_resetplayer, void(entity thiswep)) { self.rl_release = 0; - return true; } - METHOD(Devastator, wr_reload, bool(entity thiswep)) + METHOD(Devastator, wr_reload, void(entity thiswep)) { W_Reload(WEP_CVAR(devastator, ammo), SND(RELOAD)); - return true; } - METHOD(Devastator, wr_suicidemessage, bool(entity thiswep)) + METHOD(Devastator, wr_suicidemessage, int(entity thiswep)) { return WEAPON_DEVASTATOR_SUICIDE; } - METHOD(Devastator, wr_killmessage, bool(entity thiswep)) + METHOD(Devastator, wr_killmessage, int(entity thiswep)) { if((w_deathtype & HITTYPE_BOUNCE) || (w_deathtype & HITTYPE_SPLASH)) return WEAPON_DEVASTATOR_MURDER_SPLASH; @@ -642,24 +631,13 @@ void W_Devastator_Attack(Weapon thiswep) #endif #ifdef CSQC - METHOD(Devastator, wr_impacteffect, bool(entity thiswep)) + METHOD(Devastator, wr_impacteffect, void(entity thiswep)) { vector org2; org2 = w_org + w_backoff * 12; pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTN_NORM); - - return true; - } - METHOD(Devastator, wr_init, bool(entity thiswep)) - { - return true; - } - METHOD(Devastator, wr_zoomreticle, bool(entity thiswep)) - { - // no weapon specific image for this weapon - return false; } #endif diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index b23072c34..14f24e876 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -423,7 +423,7 @@ void W_Electro_CheckAttack(Weapon thiswep, bool fire1, bool fire2) .float bot_secondary_electromooth; - METHOD(Electro, wr_aim, bool(entity thiswep)) + METHOD(Electro, wr_aim, void(entity thiswep)) { self.BUTTON_ATCK = self.BUTTON_ATCK2 = false; if(vlen(self.origin-self.enemy.origin) > 1000) { self.bot_secondary_electromooth = 0; } @@ -450,10 +450,8 @@ void W_Electro_CheckAttack(Weapon thiswep, bool fire1, bool fire2) if(random() < 0.03) self.bot_secondary_electromooth = 0; } } - - return true; } - METHOD(Electro, wr_think, bool(entity thiswep, bool fire1, bool fire2)) + METHOD(Electro, wr_think, void(entity thiswep, bool fire1, bool fire2)) { if(autocvar_g_balance_electro_reload_ammo) // forced reload // WEAPONTODO { @@ -467,10 +465,8 @@ void W_Electro_CheckAttack(Weapon thiswep, bool fire1, bool fire2) { Weapon w = get_weaponinfo(self.weapon); w.wr_reload(w); - return false; + return; } - - return true; } if(fire1) @@ -492,13 +488,10 @@ void W_Electro_CheckAttack(Weapon thiswep, bool fire1, bool fire2) self.electro_secondarytime = time + WEP_CVAR_SEC(electro, refire2) * W_WeaponRateFactor(); } } - - return true; } - METHOD(Electro, wr_init, bool(entity thiswep)) + METHOD(Electro, wr_init, void(entity thiswep)) { ELECTRO_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP); - return true; } METHOD(Electro, wr_checkammo1, bool(entity thiswep)) { @@ -521,29 +514,26 @@ void W_Electro_CheckAttack(Weapon thiswep, bool fire1, bool fire2) } return ammo_amount; } - METHOD(Electro, wr_config, bool(entity thiswep)) + METHOD(Electro, wr_config, void(entity thiswep)) { ELECTRO_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS); - return true; } - METHOD(Electro, wr_resetplayer, bool(entity thiswep)) + METHOD(Electro, wr_resetplayer, void(entity thiswep)) { self.electro_secondarytime = time; - return true; } - METHOD(Electro, wr_reload, bool(entity thiswep)) + METHOD(Electro, wr_reload, void(entity thiswep)) { W_Reload(min(WEP_CVAR_PRI(electro, ammo), WEP_CVAR_SEC(electro, ammo)), SND(RELOAD)); - return true; } - METHOD(Electro, wr_suicidemessage, bool(entity thiswep)) + METHOD(Electro, wr_suicidemessage, int(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) return WEAPON_ELECTRO_SUICIDE_ORBS; else return WEAPON_ELECTRO_SUICIDE_BOLT; } - METHOD(Electro, wr_killmessage, bool(entity thiswep)) + METHOD(Electro, wr_killmessage, int(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) { @@ -561,7 +551,7 @@ void W_Electro_CheckAttack(Weapon thiswep, bool fire1, bool fire2) #endif #ifdef CSQC - METHOD(Electro, wr_impacteffect, bool(entity thiswep)) + METHOD(Electro, wr_impacteffect, void(entity thiswep)) { vector org2; org2 = w_org + w_backoff * 6; @@ -587,17 +577,6 @@ void W_Electro_CheckAttack(Weapon thiswep, bool fire1, bool fire2) sound(self, CH_SHOTS, SND_ELECTRO_IMPACT, VOL_BASE, ATTEN_NORM); } } - - return true; - } - METHOD(Electro, wr_init, bool(entity thiswep)) - { - return true; - } - METHOD(Electro, wr_zoomreticle, bool(entity thiswep)) - { - // no weapon specific image for this weapon - return false; } #endif diff --git a/qcsrc/common/weapons/weapon/fireball.qc b/qcsrc/common/weapons/weapon/fireball.qc index 6eb4a976e..9a292c5dd 100644 --- a/qcsrc/common/weapons/weapon/fireball.qc +++ b/qcsrc/common/weapons/weapon/fireball.qc @@ -350,7 +350,7 @@ void W_Fireball_Attack2(void) MUTATOR_CALLHOOK(EditProjectile, self, proj); } - METHOD(Fireball, wr_aim, bool(entity thiswep)) + METHOD(Fireball, wr_aim, void(entity thiswep)) { self.BUTTON_ATCK = false; self.BUTTON_ATCK2 = false; @@ -370,10 +370,8 @@ void W_Fireball_Attack2(void) if(random() < 0.01) self.bot_primary_fireballmooth = 1; } } - - return true; } - METHOD(Fireball, wr_think, bool(entity thiswep, bool fire1, bool fire2)) + METHOD(Fireball, wr_think, void(entity thiswep, bool fire1, bool fire2)) { if(fire1) { @@ -392,18 +390,14 @@ void W_Fireball_Attack2(void) weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(fireball, animtime), w_ready); } } - - return true; } - METHOD(Fireball, wr_init, bool(entity thiswep)) + METHOD(Fireball, wr_init, void(entity thiswep)) { FIREBALL_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP); - return true; } - METHOD(Fireball, wr_setup, bool(entity thiswep)) + METHOD(Fireball, wr_setup, void(entity thiswep)) { self.ammo_field = ammo_none; - return true; } METHOD(Fireball, wr_checkammo1, bool(entity thiswep)) { @@ -413,24 +407,22 @@ void W_Fireball_Attack2(void) { return true; // fireball has infinite ammo } - METHOD(Fireball, wr_config, bool(entity thiswep)) + METHOD(Fireball, wr_config, void(entity thiswep)) { FIREBALL_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS); - return true; } - METHOD(Fireball, wr_resetplayer, bool(entity thiswep)) + METHOD(Fireball, wr_resetplayer, void(entity thiswep)) { self.fireball_primarytime = time; - return true; } - METHOD(Fireball, wr_suicidemessage, bool(entity thiswep)) + METHOD(Fireball, wr_suicidemessage, int(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) return WEAPON_FIREBALL_SUICIDE_FIREMINE; else return WEAPON_FIREBALL_SUICIDE_BLAST; } - METHOD(Fireball, wr_killmessage, bool(entity thiswep)) + METHOD(Fireball, wr_killmessage, int(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) return WEAPON_FIREBALL_MURDER_FIREMINE; @@ -441,7 +433,7 @@ void W_Fireball_Attack2(void) #endif #ifdef CSQC - METHOD(Fireball, wr_impacteffect, bool(entity thiswep)) + METHOD(Fireball, wr_impacteffect, void(entity thiswep)) { vector org2; if(w_deathtype & HITTYPE_SECONDARY) @@ -455,17 +447,6 @@ void W_Fireball_Attack2(void) if(!w_issilent) sound(self, CH_SHOTS, SND_FIREBALL_IMPACT2, VOL_BASE, ATTEN_NORM * 0.25); // long range boom } - - return true; - } - METHOD(Fireball, wr_init, bool(entity thiswep)) - { - return true; - } - METHOD(Fireball, wr_zoomreticle, bool(entity thiswep)) - { - // no weapon specific image for this weapon - return false; } #endif diff --git a/qcsrc/common/weapons/weapon/hagar.qc b/qcsrc/common/weapons/weapon/hagar.qc index 00d822605..3feeb0b32 100644 --- a/qcsrc/common/weapons/weapon/hagar.qc +++ b/qcsrc/common/weapons/weapon/hagar.qc @@ -400,16 +400,14 @@ void W_Hagar_Attack2_Load(Weapon thiswep) } } - METHOD(Hagar, wr_aim, bool(entity thiswep)) + 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); 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); - - return true; } - METHOD(Hagar, wr_think, bool(entity thiswep, bool fire1, bool fire2)) + METHOD(Hagar, wr_think, void(entity thiswep, bool fire1, bool fire2)) { float loadable_secondary; loadable_secondary = (WEP_CVAR_SEC(hagar, load) && WEP_CVAR(hagar, secondary)); @@ -435,9 +433,8 @@ void W_Hagar_Attack2_Load(Weapon thiswep) weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(hagar, refire), w_ready); } } - return true; } - METHOD(Hagar, wr_gonethink, bool(entity thiswep)) + METHOD(Hagar, wr_gonethink, void(entity thiswep)) { // we lost the weapon and want to prepare switching away if(self.hagar_load) @@ -445,15 +442,12 @@ void W_Hagar_Attack2_Load(Weapon thiswep) self.weaponentity.state = WS_READY; W_Hagar_Attack2_Load_Release(); } - - return true; } - METHOD(Hagar, wr_init, bool(entity thiswep)) + METHOD(Hagar, wr_init, void(entity thiswep)) { HAGAR_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP); - return true; } - METHOD(Hagar, wr_setup, bool(entity thiswep)) + METHOD(Hagar, wr_setup, void(entity thiswep)) { self.hagar_loadblock = false; @@ -462,8 +456,6 @@ void W_Hagar_Attack2_Load(Weapon thiswep) W_DecreaseAmmo(thiswep, WEP_CVAR_SEC(hagar, ammo) * self.hagar_load * -1); // give back ammo if necessary self.hagar_load = 0; } - - return true; } METHOD(Hagar, wr_checkammo1, bool(entity thiswep)) { @@ -477,36 +469,30 @@ void W_Hagar_Attack2_Load(Weapon thiswep) ammo_amount += self.(weapon_load[WEP_HAGAR.m_id]) >= WEP_CVAR_SEC(hagar, ammo); return ammo_amount; } - METHOD(Hagar, wr_config, bool(entity thiswep)) + METHOD(Hagar, wr_config, void(entity thiswep)) { HAGAR_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS); - return true; } - METHOD(Hagar, wr_resetplayer, bool(entity thiswep)) + METHOD(Hagar, wr_resetplayer, void(entity thiswep)) { self.hagar_load = 0; - return true; } - METHOD(Hagar, wr_playerdeath, bool(entity thiswep)) + METHOD(Hagar, wr_playerdeath, void(entity thiswep)) { // if we have any rockets loaded when we die, release them if(self.hagar_load && WEP_CVAR_SEC(hagar, load_releasedeath)) W_Hagar_Attack2_Load_Release(); - - return true; } - METHOD(Hagar, wr_reload, bool(entity thiswep)) + METHOD(Hagar, wr_reload, void(entity thiswep)) { if(!self.hagar_load) // require releasing loaded rockets first W_Reload(min(WEP_CVAR_PRI(hagar, ammo), WEP_CVAR_SEC(hagar, ammo)), SND(RELOAD)); - - return true; } - METHOD(Hagar, wr_suicidemessage, bool(entity thiswep)) + METHOD(Hagar, wr_suicidemessage, int(entity thiswep)) { return WEAPON_HAGAR_SUICIDE; } - METHOD(Hagar, wr_killmessage, bool(entity thiswep)) + METHOD(Hagar, wr_killmessage, int(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) return WEAPON_HAGAR_MURDER_BURST; @@ -517,7 +503,7 @@ void W_Hagar_Attack2_Load(Weapon thiswep) #endif #ifdef CSQC - METHOD(Hagar, wr_impacteffect, bool(entity thiswep)) + METHOD(Hagar, wr_impacteffect, void(entity thiswep)) { vector org2; org2 = w_org + w_backoff * 6; @@ -531,17 +517,6 @@ void W_Hagar_Attack2_Load(Weapon thiswep) else sound(self, CH_SHOTS, SND_HAGEXP3, VOL_BASE, ATTN_NORM); } - - return true; - } - METHOD(Hagar, wr_init, bool(entity thiswep)) - { - return true; - } - METHOD(Hagar, wr_zoomreticle, bool(entity thiswep)) - { - // no weapon specific image for this weapon - return false; } #endif diff --git a/qcsrc/common/weapons/weapon/hlac.qc b/qcsrc/common/weapons/weapon/hlac.qc index c7cab6d98..fe1a04f26 100644 --- a/qcsrc/common/weapons/weapon/hlac.qc +++ b/qcsrc/common/weapons/weapon/hlac.qc @@ -207,12 +207,11 @@ void W_HLAC_Attack2_Frame(Weapon thiswep) } } - METHOD(HLAC, wr_aim, bool(entity 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); - return true; } - METHOD(HLAC, wr_think, bool(entity thiswep, bool fire1, bool fire2)) + METHOD(HLAC, wr_think, void(entity thiswep, bool fire1, bool fire2)) { if(autocvar_g_balance_hlac_reload_ammo && self.clip_load < min(WEP_CVAR_PRI(hlac, ammo), WEP_CVAR_SEC(hlac, ammo))) { // forced reload Weapon w = get_weaponinfo(self.weapon); @@ -235,13 +234,10 @@ void W_HLAC_Attack2_Frame(Weapon thiswep) weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(hlac, animtime), w_ready); } } - - return true; } - METHOD(HLAC, wr_init, bool(entity thiswep)) + METHOD(HLAC, wr_init, void(entity thiswep)) { HLAC_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP); - return true; } METHOD(HLAC, wr_checkammo1, bool(entity thiswep)) { @@ -255,21 +251,19 @@ void W_HLAC_Attack2_Frame(Weapon thiswep) ammo_amount += self.(weapon_load[WEP_HLAC.m_id]) >= WEP_CVAR_SEC(hlac, ammo); return ammo_amount; } - METHOD(HLAC, wr_config, bool(entity thiswep)) + METHOD(HLAC, wr_config, void(entity thiswep)) { HLAC_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS); - return true; } - METHOD(HLAC, wr_reload, bool(entity thiswep)) + METHOD(HLAC, wr_reload, void(entity thiswep)) { W_Reload(min(WEP_CVAR_PRI(hlac, ammo), WEP_CVAR_SEC(hlac, ammo)), SND(RELOAD)); - return true; } - METHOD(HLAC, wr_suicidemessage, bool(entity thiswep)) + METHOD(HLAC, wr_suicidemessage, int(entity thiswep)) { return WEAPON_HLAC_SUICIDE; } - METHOD(HLAC, wr_killmessage, bool(entity thiswep)) + METHOD(HLAC, wr_killmessage, int(entity thiswep)) { return WEAPON_HLAC_MURDER; } @@ -277,24 +271,13 @@ void W_HLAC_Attack2_Frame(Weapon thiswep) #endif #ifdef CSQC - METHOD(HLAC, wr_impacteffect, bool(entity thiswep)) + METHOD(HLAC, wr_impacteffect, void(entity thiswep)) { vector org2; org2 = w_org + w_backoff * 6; pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), org2, w_backoff * 1000, 1); if(!w_issilent) sound(self, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM); - - return true; - } - METHOD(HLAC, wr_init, bool(entity thiswep)) - { - return true; - } - METHOD(HLAC, wr_zoomreticle, bool(entity thiswep)) - { - // no weapon specific image for this weapon - return false; } #endif diff --git a/qcsrc/common/weapons/weapon/hmg.qc b/qcsrc/common/weapons/weapon/hmg.qc index aae7d7792..1ed33f8b1 100644 --- a/qcsrc/common/weapons/weapon/hmg.qc +++ b/qcsrc/common/weapons/weapon/hmg.qc @@ -89,16 +89,14 @@ void W_HeavyMachineGun_Attack_Auto(Weapon thiswep, bool fire1, bool fire2) weapon_thinkf(WFRAME_FIRE1, WEP_CVAR(hmg, refire), W_HeavyMachineGun_Attack_Auto); } - METHOD(HeavyMachineGun, wr_aim, bool(entity thiswep)) + METHOD(HeavyMachineGun, wr_aim, void(entity thiswep)) { if(vlen(self.origin-self.enemy.origin) < 3000 - bound(0, skill, 10) * 200) self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false); else self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, false); - - return true; } - METHOD(HeavyMachineGun, wr_think, bool(entity thiswep, bool fire1, bool fire2)) + METHOD(HeavyMachineGun, wr_think, void(entity thiswep, bool fire1, bool fire2)) { if(WEP_CVAR(hmg, reload_ammo) && self.clip_load < WEP_CVAR(hmg, ammo)) { // forced reload Weapon w = get_weaponinfo(self.weapon); @@ -112,13 +110,10 @@ void W_HeavyMachineGun_Attack_Auto(Weapon thiswep, bool fire1, bool fire2) W_HeavyMachineGun_Attack_Auto(thiswep, fire1, fire2); } } - - return true; } - METHOD(HeavyMachineGun, wr_init, bool(entity thiswep)) + METHOD(HeavyMachineGun, wr_init, void(entity thiswep)) { HMG_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP); - return true; } METHOD(HeavyMachineGun, wr_checkammo1, bool(entity thiswep)) { @@ -138,21 +133,19 @@ void W_HeavyMachineGun_Attack_Auto(Weapon thiswep, bool fire1, bool fire2) return ammo_amount; } - METHOD(HeavyMachineGun, wr_config, bool(entity thiswep)) + METHOD(HeavyMachineGun, wr_config, void(entity thiswep)) { HMG_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS); - return true; } - METHOD(HeavyMachineGun, wr_reload, bool(entity thiswep)) + METHOD(HeavyMachineGun, wr_reload, void(entity thiswep)) { W_Reload(WEP_CVAR(hmg, ammo), SND(RELOAD)); - return true; } - METHOD(HeavyMachineGun, wr_suicidemessage, bool(entity thiswep)) + METHOD(HeavyMachineGun, wr_suicidemessage, int(entity thiswep)) { return WEAPON_THINKING_WITH_PORTALS; } - METHOD(HeavyMachineGun, wr_killmessage, bool(entity thiswep)) + METHOD(HeavyMachineGun, wr_killmessage, int(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) return WEAPON_HMG_MURDER_SNIPE; @@ -163,7 +156,7 @@ void W_HeavyMachineGun_Attack_Auto(Weapon thiswep, bool fire1, bool fire2) #endif #ifdef CSQC - METHOD(HeavyMachineGun, wr_impacteffect, bool(entity thiswep)) + METHOD(HeavyMachineGun, wr_impacteffect, void(entity thiswep)) { vector org2; org2 = w_org + w_backoff * 2; @@ -175,17 +168,6 @@ void W_HeavyMachineGun_Attack_Auto(Weapon thiswep, bool fire1, bool fire2) sound(self, CH_SHOTS, SND_RIC2, VOL_BASE, ATTEN_NORM); else if(w_random < 0.2) sound(self, CH_SHOTS, SND_RIC3, VOL_BASE, ATTEN_NORM); - - return true; - } - METHOD(HeavyMachineGun, wr_init, bool(entity thiswep)) - { - return true; - } - METHOD(HeavyMachineGun, wr_zoomreticle, bool(entity thiswep)) - { - // no weapon specific image for this weapon - return false; } #endif diff --git a/qcsrc/common/weapons/weapon/hook.qc b/qcsrc/common/weapons/weapon/hook.qc index fc52287dd..fdb98a0cc 100644 --- a/qcsrc/common/weapons/weapon/hook.qc +++ b/qcsrc/common/weapons/weapon/hook.qc @@ -176,12 +176,7 @@ void W_Hook_Attack2(Weapon thiswep) MUTATOR_CALLHOOK(EditProjectile, self, gren); } - METHOD(Hook, wr_aim, bool(entity thiswep)) - { - // no bot AI for hook (yet?) - return true; - } - METHOD(Hook, wr_think, bool(entity thiswep, bool fire1, bool fire2)) + METHOD(Hook, wr_think, void(entity thiswep, bool fire1, bool fire2)) { if(fire1 || self.BUTTON_HOOK) { @@ -281,18 +276,14 @@ void W_Hook_Attack2(Weapon thiswep) } _GrapplingHookFrame(); - - return true; } - METHOD(Hook, wr_init, bool(entity thiswep)) + METHOD(Hook, wr_init, void(entity thiswep)) { HOOK_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP); - return true; } - METHOD(Hook, wr_setup, bool(entity thiswep)) + METHOD(Hook, wr_setup, void(entity thiswep)) { self.hook_state &= ~HOOK_WAITING_FOR_RELEASE; - return true; } METHOD(Hook, wr_checkammo1, bool(entity thiswep)) { @@ -306,21 +297,19 @@ void W_Hook_Attack2(Weapon thiswep) // infinite ammo for now return true; // self.ammo_cells >= WEP_CVAR_SEC(hook, ammo); // WEAPONTODO: see above } - METHOD(Hook, wr_config, bool(entity thiswep)) + METHOD(Hook, wr_config, void(entity thiswep)) { HOOK_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS); - return true; } - METHOD(Hook, wr_resetplayer, bool(entity thiswep)) + METHOD(Hook, wr_resetplayer, void(entity thiswep)) { self.hook_refire = time; - return true; } - METHOD(Hook, wr_suicidemessage, bool(entity thiswep)) + METHOD(Hook, wr_suicidemessage, int(entity thiswep)) { return false; } - METHOD(Hook, wr_killmessage, bool(entity thiswep)) + METHOD(Hook, wr_killmessage, int(entity thiswep)) { return WEAPON_HOOK_MURDER; } @@ -328,24 +317,13 @@ void W_Hook_Attack2(Weapon thiswep) #endif #ifdef CSQC - METHOD(Hook, wr_impacteffect, bool(entity thiswep)) + METHOD(Hook, wr_impacteffect, void(entity thiswep)) { vector org2; org2 = w_org + w_backoff * 2; pointparticles(particleeffectnum(EFFECT_HOOK_EXPLODE), org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, SND_HOOKBOMB_IMPACT, VOL_BASE, ATTN_NORM); - - return true; - } - METHOD(Hook, wr_init, bool(entity thiswep)) - { - return true; - } - METHOD(Hook, wr_zoomreticle, bool(entity thiswep)) - { - // no weapon specific image for this weapon - return false; } #endif diff --git a/qcsrc/common/weapons/weapon/machinegun.qc b/qcsrc/common/weapons/weapon/machinegun.qc index cc2d893c9..59c0f15b0 100644 --- a/qcsrc/common/weapons/weapon/machinegun.qc +++ b/qcsrc/common/weapons/weapon/machinegun.qc @@ -240,16 +240,14 @@ void W_MachineGun_Attack_Burst(Weapon thiswep, bool fire1, bool fire2) } - METHOD(MachineGun, wr_aim, bool(entity thiswep)) + METHOD(MachineGun, wr_aim, void(entity thiswep)) { if(vlen(self.origin-self.enemy.origin) < 3000 - bound(0, skill, 10) * 200) self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false); else self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, false); - - return true; } - METHOD(MachineGun, wr_think, bool(entity thiswep, bool fire1, bool fire2)) + METHOD(MachineGun, wr_think, void(entity thiswep, bool fire1, bool fire2)) { if(WEP_CVAR(machinegun, reload_ammo) && self.clip_load < min(max(WEP_CVAR(machinegun, sustained_ammo), WEP_CVAR(machinegun, first_ammo)), WEP_CVAR(machinegun, burst_ammo))) { // forced reload Weapon w = get_weaponinfo(self.weapon); @@ -273,7 +271,7 @@ void W_MachineGun_Attack_Burst(Weapon thiswep, bool fire1, bool fire2) { W_SwitchWeapon_Force(self, w_getbestweapon(self)); w_ready(thiswep, fire1, fire2); - return false; + return; } W_DecreaseAmmo(thiswep, WEP_CVAR(machinegun, burst_ammo)); @@ -301,13 +299,10 @@ void W_MachineGun_Attack_Burst(Weapon thiswep, bool fire1, bool fire2) weapon_thinkf(WFRAME_FIRE2, WEP_CVAR(machinegun, first_refire), w_ready); } } - - return true; } - METHOD(MachineGun, wr_init, bool(entity thiswep)) + METHOD(MachineGun, wr_init, void(entity thiswep)) { MACHINEGUN_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP); - return true; } METHOD(MachineGun, wr_checkammo1, bool(entity thiswep)) { @@ -343,21 +338,19 @@ void W_MachineGun_Attack_Burst(Weapon thiswep, bool fire1, bool fire2) } return ammo_amount; } - METHOD(MachineGun, wr_config, bool(entity thiswep)) + METHOD(MachineGun, wr_config, void(entity thiswep)) { MACHINEGUN_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS); - return true; } - METHOD(MachineGun, wr_reload, bool(entity thiswep)) + METHOD(MachineGun, wr_reload, void(entity thiswep)) { W_Reload(min(max(WEP_CVAR(machinegun, sustained_ammo), WEP_CVAR(machinegun, first_ammo)), WEP_CVAR(machinegun, burst_ammo)), SND(RELOAD)); - return true; } - METHOD(MachineGun, wr_suicidemessage, bool(entity thiswep)) + METHOD(MachineGun, wr_suicidemessage, int(entity thiswep)) { return WEAPON_THINKING_WITH_PORTALS; } - METHOD(MachineGun, wr_killmessage, bool(entity thiswep)) + METHOD(MachineGun, wr_killmessage, int(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) return WEAPON_MACHINEGUN_MURDER_SNIPE; @@ -368,7 +361,7 @@ void W_MachineGun_Attack_Burst(Weapon thiswep, bool fire1, bool fire2) #endif #ifdef CSQC - METHOD(MachineGun, wr_impacteffect, bool(entity thiswep)) + METHOD(MachineGun, wr_impacteffect, void(entity thiswep)) { vector org2; org2 = w_org + w_backoff * 2; @@ -380,17 +373,6 @@ void W_MachineGun_Attack_Burst(Weapon thiswep, bool fire1, bool fire2) sound(self, CH_SHOTS, SND_RIC2, VOL_BASE, ATTN_NORM); else if(w_random < 0.2) sound(self, CH_SHOTS, SND_RIC3, VOL_BASE, ATTN_NORM); - - return true; - } - METHOD(MachineGun, wr_init, bool(entity thiswep)) - { - return true; - } - METHOD(MachineGun, wr_zoomreticle, bool(entity thiswep)) - { - // no weapon specific image for this weapon - return false; } #endif diff --git a/qcsrc/common/weapons/weapon/minelayer.qc b/qcsrc/common/weapons/weapon/minelayer.qc index 0ecc4b73f..0ca67ab9a 100644 --- a/qcsrc/common/weapons/weapon/minelayer.qc +++ b/qcsrc/common/weapons/weapon/minelayer.qc @@ -401,7 +401,7 @@ float W_MineLayer_PlacedMines(float detonate) return minfound; } - METHOD(MineLayer, wr_aim, bool(entity thiswep)) + METHOD(MineLayer, wr_aim, void(entity thiswep)) { // aim and decide to fire if appropriate if(self.minelayer_mines >= WEP_CVAR(minelayer, limit)) @@ -498,10 +498,8 @@ float W_MineLayer_PlacedMines(float detonate) // dprint(ftos(desirabledamage),"\n"); if(self.BUTTON_ATCK2 == true) self.BUTTON_ATCK = false; } - - return true; } - METHOD(MineLayer, wr_think, bool(entity thiswep, bool fire1, bool fire2)) + METHOD(MineLayer, wr_think, void(entity thiswep, bool fire1, bool fire2)) { if(autocvar_g_balance_minelayer_reload_ammo && self.clip_load < WEP_CVAR(minelayer, ammo)) // forced reload { @@ -525,13 +523,10 @@ float W_MineLayer_PlacedMines(float detonate) if(W_MineLayer_PlacedMines(true)) sound(self, CH_WEAPON_B, SND_MINE_DET, VOL_BASE, ATTN_NORM); } - - return true; } - METHOD(MineLayer, wr_init, bool(entity thiswep)) + METHOD(MineLayer, wr_init, void(entity thiswep)) { MINELAYER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP); - return true; } METHOD(MineLayer, wr_checkammo1, bool(entity thiswep)) { @@ -551,26 +546,23 @@ float W_MineLayer_PlacedMines(float detonate) else return false; } - METHOD(MineLayer, wr_config, bool(entity thiswep)) + METHOD(MineLayer, wr_config, void(entity thiswep)) { MINELAYER_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS); - return true; } - METHOD(MineLayer, wr_resetplayers, bool(entity thiswep)) + METHOD(MineLayer, wr_resetplayers, void(entity thiswep)) { self.minelayer_mines = 0; - return true; } - METHOD(MineLayer, wr_reload, bool(entity thiswep)) + METHOD(MineLayer, wr_reload, void(entity thiswep)) { W_Reload(WEP_CVAR(minelayer, ammo), SND(RELOAD)); - return true; } - METHOD(MineLayer, wr_suicidemessage, bool(entity thiswep)) + METHOD(MineLayer, wr_suicidemessage, int(entity thiswep)) { return WEAPON_MINELAYER_SUICIDE; } - METHOD(MineLayer, wr_killmessage, bool(entity thiswep)) + METHOD(MineLayer, wr_killmessage, int(entity thiswep)) { return WEAPON_MINELAYER_MURDER; } @@ -578,24 +570,13 @@ float W_MineLayer_PlacedMines(float detonate) #endif #ifdef CSQC - METHOD(MineLayer, wr_impacteffect, bool(entity thiswep)) + METHOD(MineLayer, wr_impacteffect, void(entity thiswep)) { vector org2; org2 = w_org + w_backoff * 12; pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, SND_MINE_EXP, VOL_BASE, ATTN_NORM); - - return true; - } - METHOD(MineLayer, wr_init, bool(entity thiswep)) - { - return true; - } - METHOD(MineLayer, wr_zoomreticle, bool(entity thiswep)) - { - // no weapon specific image for this weapon - return false; } #endif diff --git a/qcsrc/common/weapons/weapon/mortar.qc b/qcsrc/common/weapons/weapon/mortar.qc index 91533f790..e4fef1b27 100644 --- a/qcsrc/common/weapons/weapon/mortar.qc +++ b/qcsrc/common/weapons/weapon/mortar.qc @@ -297,7 +297,7 @@ void W_Mortar_Attack2(Weapon thiswep) .float bot_secondary_grenademooth; - METHOD(Mortar, wr_aim, bool(entity thiswep)) + METHOD(Mortar, wr_aim, void(entity thiswep)) { self.BUTTON_ATCK = false; self.BUTTON_ATCK2 = false; @@ -317,8 +317,6 @@ void W_Mortar_Attack2(Weapon thiswep) if(random() < 0.02) self.bot_secondary_grenademooth = 0; } } - - return true; } /*case WR_CALCINFO: { @@ -336,7 +334,7 @@ void W_Mortar_Attack2(Weapon thiswep) wepinfo_sec_dps = (WEP_CVAR_SEC(mortar, damage) * (1 / max3(sys_frametime, WEP_CVAR_SEC(mortar, refire), WEP_CVAR_SEC(mortar, animtime)))); wepinfo_ter_dps = 0; */ - METHOD(Mortar, wr_think, bool(entity thiswep, bool fire1, bool fire2)) + METHOD(Mortar, wr_think, void(entity thiswep, bool fire1, bool fire2)) { if(autocvar_g_balance_mortar_reload_ammo && self.clip_load < min(WEP_CVAR_PRI(mortar, ammo), WEP_CVAR_SEC(mortar, ammo))) { // forced reload Weapon w = get_weaponinfo(self.weapon); @@ -372,13 +370,10 @@ void W_Mortar_Attack2(Weapon thiswep) weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(mortar, animtime), w_ready); } } - - return true; } - METHOD(Mortar, wr_init, bool(entity thiswep)) + METHOD(Mortar, wr_init, void(entity thiswep)) { MORTAR_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP); - return true; } METHOD(Mortar, wr_checkammo1, bool(entity thiswep)) { @@ -392,24 +387,22 @@ void W_Mortar_Attack2(Weapon thiswep) ammo_amount += self.(weapon_load[WEP_MORTAR.m_id]) >= WEP_CVAR_SEC(mortar, ammo); return ammo_amount; } - METHOD(Mortar, wr_config, bool(entity thiswep)) + METHOD(Mortar, wr_config, void(entity thiswep)) { MORTAR_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS); - return true; } - METHOD(Mortar, wr_reload, bool(entity thiswep)) + METHOD(Mortar, wr_reload, void(entity thiswep)) { W_Reload(min(WEP_CVAR_PRI(mortar, ammo), WEP_CVAR_SEC(mortar, ammo)), SND(RELOAD)); // WEAPONTODO - return true; } - METHOD(Mortar, wr_suicidemessage, bool(entity thiswep)) + METHOD(Mortar, wr_suicidemessage, int(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) return WEAPON_MORTAR_SUICIDE_BOUNCE; else return WEAPON_MORTAR_SUICIDE_EXPLODE; } - METHOD(Mortar, wr_killmessage, bool(entity thiswep)) + METHOD(Mortar, wr_killmessage, int(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) return WEAPON_MORTAR_MURDER_BOUNCE; @@ -420,24 +413,13 @@ void W_Mortar_Attack2(Weapon thiswep) #endif #ifdef CSQC - METHOD(Mortar, wr_impacteffect, bool(entity thiswep)) + METHOD(Mortar, wr_impacteffect, void(entity thiswep)) { vector org2; org2 = w_org + w_backoff * 12; pointparticles(particleeffectnum(EFFECT_GRENADE_EXPLODE), org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, SND_GRENADE_IMPACT, VOL_BASE, ATTN_NORM); - - return true; - } - METHOD(Mortar, wr_init, bool(entity thiswep)) - { - return true; - } - METHOD(Mortar, wr_zoomreticle, bool(entity thiswep)) - { - // no weapon specific image for this weapon - return false; } #endif diff --git a/qcsrc/common/weapons/weapon/porto.qc b/qcsrc/common/weapons/weapon/porto.qc index 26edade48..cfc146944 100644 --- a/qcsrc/common/weapons/weapon/porto.qc +++ b/qcsrc/common/weapons/weapon/porto.qc @@ -285,7 +285,7 @@ void W_Porto_Attack(float type) MUTATOR_CALLHOOK(EditProjectile, self, gren); } - METHOD(PortoLaunch, wr_aim, bool(entity thiswep)) + METHOD(PortoLaunch, wr_aim, void(entity thiswep)) { SELFPARAM(); self.BUTTON_ATCK = false; @@ -293,15 +293,12 @@ void W_Porto_Attack(float type) if(!WEP_CVAR(porto, secondary)) if(bot_aim(WEP_CVAR_PRI(porto, speed), 0, WEP_CVAR_PRI(porto, lifetime), false)) self.BUTTON_ATCK = true; - - return true; } - METHOD(PortoLaunch, wr_config, bool(entity this)) + METHOD(PortoLaunch, wr_config, void(entity this)) { PORTO_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS); - return true; } - METHOD(PortoLaunch, wr_think, bool(entity thiswep, bool fire1, bool fire2)) + METHOD(PortoLaunch, wr_think, void(entity thiswep, bool fire1, bool fire2)) { SELFPARAM(); if(WEP_CVAR(porto, secondary)) @@ -357,8 +354,6 @@ void W_Porto_Attack(float type) weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(porto, animtime), w_ready); } } - - return true; } METHOD(PortoLaunch, wr_checkammo1, bool(entity this)) { @@ -370,36 +365,24 @@ void W_Porto_Attack(float type) // always allow infinite ammo return true; } - METHOD(PortoLaunch, wr_init, bool(entity this)) + METHOD(PortoLaunch, wr_init, void(entity this)) { PORTO_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP); - return true; } - METHOD(PortoLaunch, wr_setup, bool(entity thiswep)) + METHOD(PortoLaunch, wr_setup, void(entity thiswep)) { SELFPARAM(); self.ammo_field = ammo_none; - return true; } - METHOD(PortoLaunch, wr_resetplayer, bool(entity thiswep)) + METHOD(PortoLaunch, wr_resetplayer, void(entity thiswep)) { SELFPARAM(); self.porto_current = world; - return true; } #endif #ifdef CSQC - METHOD(PortoLaunch, wr_impacteffect, bool(entity this)) { + METHOD(PortoLaunch, wr_impacteffect, void(entity this)) { LOG_WARNING("Since when does Porto send DamageInfo?\n"); - return true; - } - METHOD(PortoLaunch, wr_init, bool(entity this)) { - // nothing to do - return true; - } - METHOD(PortoLaunch, wr_zoomreticle, bool(entity this)) { - // no weapon specific image for this weapon - return false; } #endif #endif diff --git a/qcsrc/common/weapons/weapon/rifle.qc b/qcsrc/common/weapons/weapon/rifle.qc index 5a438e0b8..8d57cd339 100644 --- a/qcsrc/common/weapons/weapon/rifle.qc +++ b/qcsrc/common/weapons/weapon/rifle.qc @@ -137,7 +137,7 @@ void W_Rifle_BulletHail(float mode, void(void) AttackFunc, float fr, float animt .float bot_secondary_riflemooth; - METHOD(Rifle, wr_aim, bool(entity thiswep)) + METHOD(Rifle, wr_aim, void(entity thiswep)) { self.BUTTON_ATCK=false; self.BUTTON_ATCK2=false; @@ -159,10 +159,8 @@ void W_Rifle_BulletHail(float mode, void(void) AttackFunc, float fr, float animt if(random() < 0.03) self.bot_secondary_riflemooth = 0; } } - - return true; } - METHOD(Rifle, wr_think, bool(entity thiswep, bool fire1, bool fire2)) + METHOD(Rifle, wr_think, void(entity thiswep, bool fire1, bool fire2)) { if(autocvar_g_balance_rifle_reload_ammo && self.clip_load < min(WEP_CVAR_PRI(rifle, ammo), WEP_CVAR_SEC(rifle, ammo))) { // forced reload Weapon w = get_weaponinfo(self.weapon); @@ -198,13 +196,10 @@ void W_Rifle_BulletHail(float mode, void(void) AttackFunc, float fr, float animt } } } - - return true; } - METHOD(Rifle, wr_init, bool(entity thiswep)) + METHOD(Rifle, wr_init, void(entity thiswep)) { RIFLE_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP); - return true; } METHOD(Rifle, wr_checkammo1, bool(entity thiswep)) { @@ -218,26 +213,23 @@ void W_Rifle_BulletHail(float mode, void(void) AttackFunc, float fr, float animt ammo_amount += self.(weapon_load[WEP_RIFLE.m_id]) >= WEP_CVAR_SEC(rifle, ammo); return ammo_amount; } - METHOD(Rifle, wr_config, bool(entity thiswep)) + METHOD(Rifle, wr_config, void(entity thiswep)) { RIFLE_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS); - return true; } - METHOD(Rifle, wr_resetplayer, bool(entity thiswep)) + METHOD(Rifle, wr_resetplayer, void(entity thiswep)) { self.rifle_accumulator = time - WEP_CVAR(rifle, bursttime); - return true; } - METHOD(Rifle, wr_reload, bool(entity thiswep)) + METHOD(Rifle, wr_reload, void(entity thiswep)) { W_Reload(min(WEP_CVAR_PRI(rifle, ammo), WEP_CVAR_SEC(rifle, ammo)), SND(RELOAD)); - return true; } - METHOD(Rifle, wr_suicidemessage, bool(entity thiswep)) + METHOD(Rifle, wr_suicidemessage, int(entity thiswep)) { return WEAPON_THINKING_WITH_PORTALS; } - METHOD(Rifle, wr_killmessage, bool(entity thiswep)) + METHOD(Rifle, wr_killmessage, int(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) { @@ -258,7 +250,7 @@ void W_Rifle_BulletHail(float mode, void(void) AttackFunc, float fr, float animt #endif #ifdef CSQC - METHOD(Rifle, wr_impacteffect, bool(entity thiswep)) + METHOD(Rifle, wr_impacteffect, void(entity thiswep)) { vector org2; org2 = w_org + w_backoff * 2; @@ -272,16 +264,13 @@ void W_Rifle_BulletHail(float mode, void(void) AttackFunc, float fr, float animt else if(w_random < 0.5) sound(self, CH_SHOTS, SND_RIC3, VOL_BASE, ATTN_NORM); } - - return true; } - METHOD(Rifle, wr_init, bool(entity thiswep)) + METHOD(Rifle, wr_init, void(entity thiswep)) { if(autocvar_cl_reticle && autocvar_cl_reticle_weapon) { precache_pic("gfx/reticle_nex"); } - return true; } METHOD(Rifle, wr_zoomreticle, bool(entity thiswep)) { diff --git a/qcsrc/common/weapons/weapon/rpc.qc b/qcsrc/common/weapons/weapon/rpc.qc index d18b26887..cce7cebaa 100644 --- a/qcsrc/common/weapons/weapon/rpc.qc +++ b/qcsrc/common/weapons/weapon/rpc.qc @@ -149,12 +149,11 @@ void W_RocketPropelledChainsaw_Attack (Weapon thiswep) MUTATOR_CALLHOOK(EditProjectile, self, missile); } - METHOD(RocketPropelledChainsaw, wr_aim, bool(entity thiswep)) + METHOD(RocketPropelledChainsaw, wr_aim, void(entity thiswep)) { self.BUTTON_ATCK = bot_aim(WEP_CVAR(rpc, speed), 0, WEP_CVAR(rpc, lifetime), false); - return true; } - METHOD(RocketPropelledChainsaw, wr_think, bool(entity thiswep, bool fire1, bool fire2)) + METHOD(RocketPropelledChainsaw, wr_think, void(entity thiswep, bool fire1, bool fire2)) { if(WEP_CVAR(rpc, reload_ammo) && self.clip_load < WEP_CVAR(rpc, ammo)) { Weapon w = get_weaponinfo(self.weapon); @@ -175,13 +174,10 @@ void W_RocketPropelledChainsaw_Attack (Weapon thiswep) // to-do } } - - return true; } - METHOD(RocketPropelledChainsaw, wr_init, bool(entity thiswep)) + METHOD(RocketPropelledChainsaw, wr_init, void(entity thiswep)) { RPC_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP); - return true; } METHOD(RocketPropelledChainsaw, wr_checkammo1, bool(entity thiswep)) { @@ -193,24 +189,22 @@ void W_RocketPropelledChainsaw_Attack (Weapon thiswep) { return false; } - METHOD(RocketPropelledChainsaw, wr_config, bool(entity thiswep)) + METHOD(RocketPropelledChainsaw, wr_config, void(entity thiswep)) { RPC_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS); - return true; } - METHOD(RocketPropelledChainsaw, wr_reload, bool(entity thiswep)) + METHOD(RocketPropelledChainsaw, wr_reload, void(entity thiswep)) { W_Reload(WEP_CVAR(rpc, ammo), SND(RELOAD)); - return true; } - METHOD(RocketPropelledChainsaw, wr_suicidemessage, bool(entity thiswep)) + METHOD(RocketPropelledChainsaw, wr_suicidemessage, int(entity thiswep)) { if((w_deathtype & HITTYPE_BOUNCE) || (w_deathtype & HITTYPE_SPLASH)) return WEAPON_RPC_SUICIDE_SPLASH; else return WEAPON_RPC_SUICIDE_DIRECT; } - METHOD(RocketPropelledChainsaw, wr_killmessage, bool(entity thiswep)) + METHOD(RocketPropelledChainsaw, wr_killmessage, int(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) return WEAPON_BLASTER_MURDER; @@ -224,24 +218,13 @@ void W_RocketPropelledChainsaw_Attack (Weapon thiswep) #ifdef CSQC - METHOD(RocketPropelledChainsaw, wr_impacteffect, bool(entity thiswep)) + METHOD(RocketPropelledChainsaw, wr_impacteffect, void(entity thiswep)) { vector org2; org2 = w_org + w_backoff * 12; pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM); - - return true; - } - METHOD(RocketPropelledChainsaw, wr_init, bool(entity thiswep)) - { - return true; - } - METHOD(RocketPropelledChainsaw, wr_zoomreticle, bool(entity thiswep)) - { - // no weapon specific image for this weapon - return false; } #endif diff --git a/qcsrc/common/weapons/weapon/seeker.qc b/qcsrc/common/weapons/weapon/seeker.qc index e551485dc..24cb325d6 100644 --- a/qcsrc/common/weapons/weapon/seeker.qc +++ b/qcsrc/common/weapons/weapon/seeker.qc @@ -598,7 +598,7 @@ void W_Seeker_Fire_Tag(Weapon thiswep) // Begin: Genereal weapon functions // ============================ - METHOD(Seeker, wr_aim, bool(entity thiswep)) + METHOD(Seeker, wr_aim, void(entity thiswep)) { if(WEP_CVAR(seeker, type) == 1) if(W_Seeker_Tagged_Info(self, self.enemy) != world) @@ -607,9 +607,8 @@ void W_Seeker_Fire_Tag(Weapon thiswep) self.BUTTON_ATCK2 = 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); - return true; } - METHOD(Seeker, wr_think, bool(entity thiswep, bool fire1, bool fire2)) + METHOD(Seeker, wr_think, void(entity thiswep, bool fire1, bool fire2)) { if(autocvar_g_balance_seeker_reload_ammo && self.clip_load < min(WEP_CVAR(seeker, missile_ammo), WEP_CVAR(seeker, tag_ammo))) { // forced reload Weapon w = get_weaponinfo(self.weapon); @@ -653,13 +652,10 @@ void W_Seeker_Fire_Tag(Weapon thiswep) } } } - - return true; } - METHOD(Seeker, wr_init, bool(entity thiswep)) + METHOD(Seeker, wr_init, void(entity thiswep)) { SEEKER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP); - return true; } METHOD(Seeker, wr_checkammo1, bool(entity thiswep)) { @@ -691,21 +687,19 @@ void W_Seeker_Fire_Tag(Weapon thiswep) } return ammo_amount; } - METHOD(Seeker, wr_config, bool(entity thiswep)) + METHOD(Seeker, wr_config, void(entity thiswep)) { SEEKER_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS); - return true; } - METHOD(Seeker, wr_reload, bool(entity thiswep)) + METHOD(Seeker, wr_reload, void(entity thiswep)) { W_Reload(min(WEP_CVAR(seeker, missile_ammo), WEP_CVAR(seeker, tag_ammo)), SND(RELOAD)); - return true; } - METHOD(Seeker, wr_suicidemessage, bool(entity thiswep)) + METHOD(Seeker, wr_suicidemessage, int(entity thiswep)) { return WEAPON_SEEKER_SUICIDE; } - METHOD(Seeker, wr_killmessage, bool(entity thiswep)) + METHOD(Seeker, wr_killmessage, int(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) return WEAPON_SEEKER_MURDER_TAG; @@ -716,7 +710,7 @@ void W_Seeker_Fire_Tag(Weapon thiswep) #endif #ifdef CSQC - METHOD(Seeker, wr_impacteffect, bool(entity thiswep)) + METHOD(Seeker, wr_impacteffect, void(entity thiswep)) { vector org2; org2 = w_org + w_backoff * 6; @@ -754,16 +748,6 @@ void W_Seeker_Fire_Tag(Weapon thiswep) sound(self, CH_SHOTS, SND_SEEKEREXP3, 1, ATTEN_NORM); } } - return true; - } - METHOD(Seeker, wr_init, bool(entity thiswep)) - { - return true; - } - METHOD(Seeker, wr_zoomreticle, bool(entity thiswep)) - { - // no weapon specific image for this weapon - return false; } #endif diff --git a/qcsrc/common/weapons/weapon/shockwave.qc b/qcsrc/common/weapons/weapon/shockwave.qc index bbe579bd5..0755adcf6 100644 --- a/qcsrc/common/weapons/weapon/shockwave.qc +++ b/qcsrc/common/weapons/weapon/shockwave.qc @@ -668,16 +668,14 @@ void W_Shockwave_Attack(void) } } - METHOD(Shockwave, wr_aim, bool(entity thiswep)) + 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); } else { self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false); } - - return true; } - METHOD(Shockwave, wr_think, bool(entity thiswep, bool fire1, bool fire2)) + METHOD(Shockwave, wr_think, void(entity thiswep, bool fire1, bool fire2)) { if(fire1) { @@ -701,13 +699,10 @@ void W_Shockwave_Attack(void) weapon_thinkf(WFRAME_FIRE1, 0, W_Shockwave_Melee); } } - - return true; } - METHOD(Shockwave, wr_init, bool(entity thiswep)) + METHOD(Shockwave, wr_init, void(entity thiswep)) { SHOCKWAVE_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP); - return true; } METHOD(Shockwave, wr_checkammo1, bool(entity thiswep)) { @@ -718,16 +713,15 @@ void W_Shockwave_Attack(void) // shockwave has infinite ammo return true; } - METHOD(Shockwave, wr_config, bool(entity thiswep)) + METHOD(Shockwave, wr_config, void(entity thiswep)) { SHOCKWAVE_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS); - return true; } - METHOD(Shockwave, wr_suicidemessage, bool(entity thiswep)) + METHOD(Shockwave, wr_suicidemessage, int(entity thiswep)) { return WEAPON_THINKING_WITH_PORTALS; } - METHOD(Shockwave, wr_killmessage, bool(entity thiswep)) + METHOD(Shockwave, wr_killmessage, int(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) return WEAPON_SHOCKWAVE_MURDER_SLAP; @@ -857,22 +851,12 @@ void Net_ReadShockwaveParticle(void) shockwave.sw_time = time; } - METHOD(Shockwave, wr_impacteffect, bool(entity thiswep)) + METHOD(Shockwave, wr_impacteffect, void(entity thiswep)) { // handled by Net_ReadShockwaveParticle //vector org2; //org2 = w_org + w_backoff * 2; //pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), org2, w_backoff * 1000, 1); - return false; - } - METHOD(Shockwave, wr_init, bool(entity thiswep)) - { - return false; - } - METHOD(Shockwave, wr_zoomreticle, bool(entity thiswep)) - { - // no weapon specific image for this weapon - return false; } #endif diff --git a/qcsrc/common/weapons/weapon/shotgun.qc b/qcsrc/common/weapons/weapon/shotgun.qc index c634fe663..7f5ef5728 100644 --- a/qcsrc/common/weapons/weapon/shotgun.qc +++ b/qcsrc/common/weapons/weapon/shotgun.qc @@ -227,16 +227,14 @@ void W_Shotgun_Attack3_Frame1(Weapon thiswep, bool fire1, bool fire2) .float shotgun_primarytime; - METHOD(Shotgun, wr_aim, bool(entity thiswep)) + METHOD(Shotgun, wr_aim, void(entity thiswep)) { if(vlen(self.origin-self.enemy.origin) <= WEP_CVAR_SEC(shotgun, melee_range)) self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, false); else self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false); - - return true; } - METHOD(Shotgun, wr_think, bool(entity thiswep, bool fire1, bool fire2)) + METHOD(Shotgun, wr_think, void(entity thiswep, bool fire1, bool fire2)) { if(WEP_CVAR(shotgun, reload_ammo) && self.clip_load < WEP_CVAR_PRI(shotgun, ammo)) // forced reload { @@ -282,18 +280,14 @@ void W_Shotgun_Attack3_Frame1(Weapon thiswep, bool fire1, bool fire2) // attempt forcing playback of the anim by switching to another anim (that we never play) here... weapon_thinkf(WFRAME_FIRE1, 0, W_Shotgun_Attack2); } - - return true; } - METHOD(Shotgun, wr_init, bool(entity thiswep)) + METHOD(Shotgun, wr_init, void(entity thiswep)) { SHOTGUN_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP); - return true; } - METHOD(Shotgun, wr_setup, bool(entity thiswep)) + METHOD(Shotgun, wr_setup, void(entity thiswep)) { self.ammo_field = ammo_none; - return true; } METHOD(Shotgun, wr_checkammo1, bool(entity thiswep)) { @@ -318,21 +312,19 @@ void W_Shotgun_Attack3_Frame1(Weapon thiswep, bool fire1, bool fire2) default: return false; // secondary unavailable } } - METHOD(Shotgun, wr_config, bool(entity thiswep)) + METHOD(Shotgun, wr_config, void(entity thiswep)) { SHOTGUN_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS); - return true; } - METHOD(Shotgun, wr_reload, bool(entity thiswep)) + METHOD(Shotgun, wr_reload, void(entity thiswep)) { W_Reload(WEP_CVAR_PRI(shotgun, ammo), SND(RELOAD)); // WEAPONTODO - return true; } - METHOD(Shotgun, wr_suicidemessage, bool(entity thiswep)) + METHOD(Shotgun, wr_suicidemessage, int(entity thiswep)) { return WEAPON_THINKING_WITH_PORTALS; } - METHOD(Shotgun, wr_killmessage, bool(entity thiswep)) + METHOD(Shotgun, wr_killmessage, int(entity thiswep)) { if(w_deathtype & HITTYPE_SECONDARY) return WEAPON_SHOTGUN_MURDER_SLAP; @@ -344,10 +336,9 @@ void W_Shotgun_Attack3_Frame1(Weapon thiswep, bool fire1, bool fire2) #ifdef CSQC .float prevric; - METHOD(Shotgun, wr_impacteffect, bool(entity thiswep)) + METHOD(Shotgun, wr_impacteffect, void(entity thiswep)) { - vector org2; - org2 = w_org + w_backoff * 2; + vector org2 = w_org + w_backoff * 2; pointparticles(particleeffectnum(EFFECT_SHOTGUN_IMPACT), org2, w_backoff * 1000, 1); if(!w_issilent && time - self.prevric > 0.25) { @@ -359,17 +350,6 @@ void W_Shotgun_Attack3_Frame1(Weapon thiswep, bool fire1, bool fire2) sound(self, CH_SHOTS, SND_RIC3, VOL_BASE, ATTEN_NORM); self.prevric = time; } - - return true; - } - METHOD(Shotgun, wr_init, bool(entity thiswep)) - { - return true; - } - METHOD(Shotgun, wr_zoomreticle, bool(entity thiswep)) - { - // no weapon specific image for this weapon - return false; } #endif diff --git a/qcsrc/common/weapons/weapon/tuba.qc b/qcsrc/common/weapons/weapon/tuba.qc index 21fa7a6f5..60b9ec6ac 100644 --- a/qcsrc/common/weapons/weapon/tuba.qc +++ b/qcsrc/common/weapons/weapon/tuba.qc @@ -367,7 +367,7 @@ void W_Tuba_NoteOn(float hittype) } } - METHOD(Tuba, wr_aim, bool(entity thiswep)) + METHOD(Tuba, wr_aim, void(entity thiswep)) { // bots cannot play the Tuba well yet // I think they should start with the recorder first @@ -378,10 +378,8 @@ void W_Tuba_NoteOn(float hittype) else self.BUTTON_ATCK2 = 1; } - - return true; } - METHOD(Tuba, wr_think, bool(entity thiswep, bool fire1, bool fire2)) + METHOD(Tuba, wr_think, void(entity thiswep, bool fire1, bool fire2)) { if(fire1) if(weapon_prepareattack(false, WEP_CVAR(tuba, refire))) @@ -404,21 +402,17 @@ void W_Tuba_NoteOn(float hittype) WITH(entity, self, self.tuba_note, W_Tuba_NoteOff()); } } - - return true; } - METHOD(Tuba, wr_init, bool(entity thiswep)) + METHOD(Tuba, wr_init, void(entity thiswep)) { TUBA_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP); - return true; } - METHOD(Tuba, wr_setup, bool(entity thiswep)) + METHOD(Tuba, wr_setup, void(entity thiswep)) { self.ammo_field = ammo_none; self.tuba_instrument = 0; - return true; } - METHOD(Tuba, wr_reload, bool(entity thiswep)) + METHOD(Tuba, wr_reload, void(entity thiswep)) { // switch to alternate instruments :) if(self.weaponentity.state == WS_READY) @@ -443,8 +437,6 @@ void W_Tuba_NoteOn(float hittype) self.weaponentity.state = WS_INUSE; weapon_thinkf(WFRAME_RELOAD, 0.5, w_ready); } - - return true; } METHOD(Tuba, wr_checkammo1, bool(entity thiswep)) { @@ -454,12 +446,11 @@ void W_Tuba_NoteOn(float hittype) { return true; // tuba has infinite ammo } - METHOD(Tuba, wr_config, bool(entity thiswep)) + METHOD(Tuba, wr_config, void(entity thiswep)) { TUBA_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS); - return true; } - METHOD(Tuba, wr_suicidemessage, bool(entity thiswep)) + METHOD(Tuba, wr_suicidemessage, int(entity thiswep)) { if(w_deathtype & HITTYPE_BOUNCE) return WEAPON_KLEINBOTTLE_SUICIDE; @@ -468,7 +459,7 @@ void W_Tuba_NoteOn(float hittype) else return WEAPON_TUBA_SUICIDE; } - METHOD(Tuba, wr_killmessage, bool(entity thiswep)) + METHOD(Tuba, wr_killmessage, int(entity thiswep)) { if(w_deathtype & HITTYPE_BOUNCE) return WEAPON_KLEINBOTTLE_MURDER; @@ -478,14 +469,5 @@ void W_Tuba_NoteOn(float hittype) return WEAPON_TUBA_MURDER; } -#endif -#ifdef CSQC - - METHOD(Tuba, wr_zoomreticle, bool(entity thiswep)) - { - // no weapon specific image for this weapon - return false; - } - #endif #endif diff --git a/qcsrc/common/weapons/weapon/vaporizer.qc b/qcsrc/common/weapons/weapon/vaporizer.qc index aeb912510..bb0283c66 100644 --- a/qcsrc/common/weapons/weapon/vaporizer.qc +++ b/qcsrc/common/weapons/weapon/vaporizer.qc @@ -237,16 +237,14 @@ void W_RocketMinsta_Attack3 (void) } } - METHOD(Vaporizer, wr_aim, bool(entity thiswep)) + METHOD(Vaporizer, wr_aim, void(entity thiswep)) { if(self.WEP_AMMO(VAPORIZER) > 0) self.BUTTON_ATCK = 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 - - return true; } - METHOD(Vaporizer, wr_think, bool(entity thiswep, bool fire1, bool fire2)) + METHOD(Vaporizer, wr_think, void(entity thiswep, bool fire1, bool fire2)) { float vaporizer_ammo = ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo)); // if the laser uses load, we also consider its ammo for reloading @@ -320,20 +318,16 @@ void W_RocketMinsta_Attack3 (void) } else self.held_down = false; - - return true; } - METHOD(Vaporizer, wr_init, bool(entity thiswep)) + METHOD(Vaporizer, wr_init, void(entity thiswep)) { //W_Blaster(WR_INIT); // Samual: Is this really the proper thing to do? Didn't we already run this previously? VAPORIZER_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP); - return true; } - METHOD(Vaporizer, wr_setup, bool(entity thiswep)) + METHOD(Vaporizer, wr_setup, void(entity thiswep)) { self.ammo_field = WEP_AMMO(VAPORIZER); self.vaporizer_lasthit = 0; - return true; } METHOD(Vaporizer, wr_checkammo1, bool(entity thiswep)) { @@ -350,17 +344,15 @@ void W_RocketMinsta_Attack3 (void) ammo_amount += self.(weapon_load[WEP_VAPORIZER.m_id]) >= WEP_CVAR_SEC(vaporizer, ammo); return ammo_amount; } - METHOD(Vaporizer, wr_config, bool(entity thiswep)) + METHOD(Vaporizer, wr_config, void(entity thiswep)) { VAPORIZER_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS); - return true; } - METHOD(Vaporizer, wr_resetplayer, bool(entity thiswep)) + METHOD(Vaporizer, wr_resetplayer, void(entity thiswep)) { self.vaporizer_lasthit = 0; - return true; } - METHOD(Vaporizer, wr_reload, bool(entity thiswep)) + METHOD(Vaporizer, wr_reload, void(entity thiswep)) { float vaporizer_ammo = ((g_instagib) ? 1 : WEP_CVAR_PRI(vaporizer, ammo)); float used_ammo; @@ -370,13 +362,12 @@ void W_RocketMinsta_Attack3 (void) used_ammo = vaporizer_ammo; W_Reload(used_ammo, SND(RELOAD)); - return true; } - METHOD(Vaporizer, wr_suicidemessage, bool(entity thiswep)) + METHOD(Vaporizer, wr_suicidemessage, int(entity thiswep)) { return WEAPON_THINKING_WITH_PORTALS; } - METHOD(Vaporizer, wr_killmessage, bool(entity thiswep)) + METHOD(Vaporizer, wr_killmessage, int(entity thiswep)) { return WEAPON_VAPORIZER_MURDER; } @@ -384,7 +375,7 @@ void W_RocketMinsta_Attack3 (void) #endif #ifdef CSQC - METHOD(Vaporizer, wr_impacteffect, bool(entity thiswep)) + METHOD(Vaporizer, wr_impacteffect, void(entity thiswep)) { vector org2 = w_org + w_backoff * 6; if(w_deathtype & HITTYPE_SECONDARY) @@ -397,15 +388,13 @@ void W_RocketMinsta_Attack3 (void) pointparticles(particleeffectnum(EFFECT_VORTEX_IMPACT), org2, '0 0 0', 1); if(!w_issilent) { sound(self, CH_SHOTS, SND_NEXIMPACT, VOL_BASE, ATTN_NORM); } } - return true; } - METHOD(Vaporizer, wr_init, bool(entity thiswep)) + METHOD(Vaporizer, wr_init, void(entity thiswep)) { if(autocvar_cl_reticle && autocvar_cl_reticle_weapon) { precache_pic("gfx/reticle_nex"); } - return true; } METHOD(Vaporizer, wr_zoomreticle, bool(entity thiswep)) { diff --git a/qcsrc/common/weapons/weapon/vortex.qc b/qcsrc/common/weapons/weapon/vortex.qc index 0ed6aa85c..15c10caee 100644 --- a/qcsrc/common/weapons/weapon/vortex.qc +++ b/qcsrc/common/weapons/weapon/vortex.qc @@ -133,7 +133,7 @@ void W_Vortex_Attack(Weapon thiswep, float issecondary) .float vortex_chargepool_pauseregen_finished; - METHOD(Vortex, wr_aim, bool(entity thiswep)) + METHOD(Vortex, wr_aim, void(entity thiswep)) { if(bot_aim(1000000, 0, 1, false)) self.BUTTON_ATCK = true; @@ -142,9 +142,8 @@ void W_Vortex_Attack(Weapon thiswep, float issecondary) if(WEP_CVAR(vortex, charge)) self.BUTTON_ATCK2 = true; } - return true; } - METHOD(Vortex, wr_think, bool(entity thiswep, bool fire1, bool fire2)) + METHOD(Vortex, wr_think, void(entity thiswep, bool fire1, bool fire2)) { if(WEP_CVAR(vortex, charge) && self.vortex_charge < WEP_CVAR(vortex, charge_limit)) self.vortex_charge = min(1, self.vortex_charge + WEP_CVAR(vortex, charge_rate) * frametime / W_TICSPERFRAME); @@ -244,18 +243,14 @@ void W_Vortex_Attack(Weapon thiswep, float issecondary) } } } - - return true; } - METHOD(Vortex, wr_init, bool(entity thiswep)) + METHOD(Vortex, wr_init, void(entity thiswep)) { VORTEX_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP); - return true; } - METHOD(Vortex, wr_setup, bool(entity thiswep)) + METHOD(Vortex, wr_setup, void(entity thiswep)) { self.vortex_lasthit = 0; - return true; } METHOD(Vortex, wr_checkammo1, bool(entity thiswep)) { @@ -277,26 +272,23 @@ void W_Vortex_Attack(Weapon thiswep, float issecondary) return false; // zoom is not a fire mode } } - METHOD(Vortex, wr_config, bool(entity thiswep)) + METHOD(Vortex, wr_config, void(entity thiswep)) { VORTEX_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS); - return true; } - METHOD(Vortex, wr_resetplayer, bool(entity thiswep)) + METHOD(Vortex, wr_resetplayer, void(entity thiswep)) { self.vortex_lasthit = 0; - return true; } - METHOD(Vortex, wr_reload, bool(entity thiswep)) + METHOD(Vortex, wr_reload, void(entity thiswep)) { W_Reload(min(WEP_CVAR_PRI(vortex, ammo), WEP_CVAR_SEC(vortex, ammo)), SND(RELOAD)); - return true; } - METHOD(Vortex, wr_suicidemessage, bool(entity thiswep)) + METHOD(Vortex, wr_suicidemessage, int(entity thiswep)) { return WEAPON_THINKING_WITH_PORTALS; } - METHOD(Vortex, wr_killmessage, bool(entity thiswep)) + METHOD(Vortex, wr_killmessage, int(entity thiswep)) { return WEAPON_VORTEX_MURDER; } @@ -305,23 +297,19 @@ void W_Vortex_Attack(Weapon thiswep, float issecondary) #ifdef CSQC float autocvar_g_balance_vortex_secondary = 0; // WEAPONTODO - METHOD(Vortex, wr_impacteffect, bool(entity thiswep)) + METHOD(Vortex, wr_impacteffect, void(entity thiswep)) { - vector org2; - org2 = w_org + w_backoff * 6; + vector org2 = w_org + w_backoff * 6; pointparticles(particleeffectnum(EFFECT_VORTEX_IMPACT), org2, '0 0 0', 1); if(!w_issilent) sound(self, CH_SHOTS, SND_NEXIMPACT, VOL_BASE, ATTN_NORM); - - return true; } - METHOD(Vortex, wr_init, bool(entity thiswep)) + METHOD(Vortex, wr_init, void(entity thiswep)) { if(autocvar_cl_reticle && autocvar_cl_reticle_weapon) { precache_pic("gfx/reticle_nex"); } - return true; } METHOD(Vortex, wr_zoomreticle, bool(entity thiswep)) { diff --git a/qcsrc/server/mutators/gamemode_nexball.qc b/qcsrc/server/mutators/gamemode_nexball.qc index 590968290..5d034870e 100644 --- a/qcsrc/server/mutators/gamemode_nexball.qc +++ b/qcsrc/server/mutators/gamemode_nexball.qc @@ -842,7 +842,7 @@ float ball_customize() return true; } - METHOD(BallStealer, wr_think, bool(BallStealer thiswep, bool fire1, bool fire2)) + METHOD(BallStealer, wr_think, void(BallStealer thiswep, bool fire1, bool fire2)) { if(fire1) if(weapon_prepareattack(false, autocvar_g_balance_nexball_primary_refire)) @@ -871,20 +871,10 @@ float ball_customize() // DropBall or stealing will set metertime back to 0 weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_nexball_primary_animtime, w_ready); } - return true; - } - METHOD(BallStealer, wr_init, bool(BallStealer thiswep)) - { - return true; } - METHOD(BallStealer, wr_setup, bool(BallStealer thiswep)) + METHOD(BallStealer, wr_setup, void(BallStealer thiswep)) { //weapon_setup(WEP_PORTO.m_id); - return true; - } - METHOD(BallStealer, wr_aim, bool(BallStealer thiswep)) - { - return true; } METHOD(BallStealer, wr_checkammo1, bool(BallStealer thiswep)) { diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index 951128f2d..de9512859 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -777,8 +777,8 @@ void W_WeaponFrame() } if (w) { - entity e = get_weaponinfo(self.weapon); - if (e.wr_think) e.wr_think(e, self.BUTTON_ATCK, self.BUTTON_ATCK2); + Weapon e = get_weaponinfo(self.weapon); + e.wr_think(e, self.BUTTON_ATCK, self.BUTTON_ATCK2); } else { Weapon w = get_weaponinfo(self.weapon); w.wr_gonethink(w); @@ -981,7 +981,7 @@ void W_Reload(float sent_ammo_min, string sent_sound) self.clip_load = self.(weapon_load[self.weapon]) = -1; } -void W_DropEvent(.bool(Weapon) event, entity player, float weapon_type, entity weapon_item) +void W_DropEvent(.void(Weapon) event, entity player, float weapon_type, entity weapon_item) {SELFPARAM(); setself(player); weapon_dropevent_item = weapon_item; diff --git a/qcsrc/server/weapons/weaponsystem.qh b/qcsrc/server/weapons/weaponsystem.qh index 196cac857..9849f9bd4 100644 --- a/qcsrc/server/weapons/weaponsystem.qh +++ b/qcsrc/server/weapons/weaponsystem.qh @@ -24,7 +24,7 @@ void W_AttachToShotorg(entity flash, vector offset); void W_DecreaseAmmo(Weapon wep, float ammo_use); -void W_DropEvent(.bool(Weapon) event, entity player, float weapon_type, entity weapon_item); +void W_DropEvent(.void(Weapon) event, entity player, float weapon_type, entity weapon_item); void W_Reload(float sent_ammo_min, string sent_sound); -- 2.39.2