From 4715e7bf00edea2d855f5fe91966868b1e20c11a Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Tue, 15 Mar 2022 19:35:18 -0700 Subject: [PATCH] Rebased against the latest Nuclide commit. --- src/client/hud.qc | 4 +-- src/client/player.qc | 2 +- src/client/view.h | 2 +- src/client/view.qc | 6 ++-- src/server/player.qc | 2 +- src/shared/animations.qc | 2 +- src/shared/defs.h | 4 +-- src/shared/event_custom.qc | 4 +-- src/shared/input.qc | 34 ++++++++----------- src/shared/player.qc | 2 +- src/shared/weapons.qc | 2 +- src/shared/weapons/weapon_ak47.qc | 24 +++++-------- src/shared/weapons/weapon_akimbocolts.qc | 24 ++++++------- src/shared/weapons/weapon_barrettm82.qc | 26 ++++++-------- src/shared/weapons/weapon_benellim3.qc | 26 ++++++-------- src/shared/weapons/weapon_beretta.qc | 25 ++++++-------- src/shared/weapons/weapon_beretta_akimbo.qc | 24 ++++++------- src/shared/weapons/weapon_combatknife.qc | 24 ++++++------- src/shared/weapons/weapon_contenderg2.qc | 26 ++++++-------- src/shared/weapons/weapon_deserteagle.qc | 26 ++++++-------- src/shared/weapons/weapon_fiveseven.qc | 25 ++++++-------- src/shared/weapons/weapon_fiveseven_akimbo.qc | 24 ++++++------- src/shared/weapons/weapon_glock18.qc | 22 +++++------- src/shared/weapons/weapon_glock20.qc | 25 ++++++-------- src/shared/weapons/weapon_hkpdw.qc | 26 ++++++-------- src/shared/weapons/weapon_karate.qc | 30 +++++++--------- src/shared/weapons/weapon_katana.qc | 23 ++++++------- src/shared/weapons/weapon_m16a4.qc | 26 ++++++-------- src/shared/weapons/weapon_m4a1.qc | 26 ++++++-------- src/shared/weapons/weapon_m60.qc | 25 ++++++-------- src/shared/weapons/weapon_m61grenade.qc | 24 ++++++------- src/shared/weapons/weapon_mac10.qc | 26 ++++++-------- src/shared/weapons/weapon_miniuzi.qc | 26 ++++++-------- src/shared/weapons/weapon_miniuzi_akimbo.qc | 24 ++++++------- src/shared/weapons/weapon_mossberg500.qc | 26 ++++++-------- src/shared/weapons/weapon_mp5k.qc | 26 ++++++-------- src/shared/weapons/weapon_mp5sd.qc | 26 ++++++-------- src/shared/weapons/weapon_ragingbull.qc | 26 ++++++-------- src/shared/weapons/weapon_rugermk1.qc | 25 ++++++-------- src/shared/weapons/weapon_sawedoff.qc | 26 ++++++-------- src/shared/weapons/weapon_sealknife.qc | 24 ++++++------- src/shared/weapons/weapon_skorpion.qc | 25 ++++++-------- src/shared/weapons/weapon_skorpion_akimbo.qc | 26 ++++++-------- src/shared/weapons/weapon_socommk23.qc | 26 ++++++-------- src/shared/weapons/weapon_socommk23_akimbo.qc | 24 ++++++------- src/shared/weapons/weapon_spas12.qc | 25 ++++++-------- src/shared/weapons/weapon_steyraug.qc | 26 ++++++-------- src/shared/weapons/weapon_steyrtmp.qc | 26 ++++++-------- src/shared/weapons/weapon_ump.qc | 26 ++++++-------- src/shared/weapons/weapon_usas12.qc | 25 ++++++-------- 50 files changed, 420 insertions(+), 629 deletions(-) diff --git a/src/client/hud.qc b/src/client/hud.qc index 5038b55..35b852c 100644 --- a/src/client/hud.qc +++ b/src/client/hud.qc @@ -52,7 +52,7 @@ HUD_DrawNotify(void) } pos = g_hudmins + [g_hudres[0] - 192, g_hudres[1] - 128]; - Weapons_HUDPic(pSeatLocal->m_iPickupWeapon, 1, pos, pSeatLocal->m_flPickupAlpha); + Weapons_HUDPic(pl, pSeatLocal->m_iPickupWeapon, 1, pos, pSeatLocal->m_flPickupAlpha); pSeatLocal->m_flPickupAlpha -= clframetime; */ } @@ -111,7 +111,7 @@ HUD_Draw(void) // Assuming that drawing these on top of the scope is a good idea. // "Weapons_DrawCrosshair" is for tapping into the weapon's drawHUD methods, // Nuclide methods in its weapons struct - Weapons_DrawCrosshair(); + Weapons_DrawCrosshair(pl); TS_HUD_DrawWeaponSelect(); diff --git a/src/client/player.qc b/src/client/player.qc index 001848e..f90ffc5 100644 --- a/src/client/player.qc +++ b/src/client/player.qc @@ -107,7 +107,7 @@ Player_HandleWeaponModel(base_player pp, float thirdperson) return; /* what's the current weapon model supposed to be anyway? */ - string wmodel = Weapons_GetPlayermodel(pl.activeweapon); + string wmodel = Weapons_GetPlayermodel(pl, pl.activeweapon); /* we changed weapons, update skeletonindex */ if (pl.p_model.model != wmodel) { diff --git a/src/client/view.h b/src/client/view.h index 2f61057..88fdedb 100644 --- a/src/client/view.h +++ b/src/client/view.h @@ -1,5 +1,5 @@ -void View_UpdateWeapon(entity vm, entity mflash); +void View_UpdateWeapon(player pl, entity vm, entity mflash); void TS_View_SetViewModelFromStats(void); diff --git a/src/client/view.qc b/src/client/view.qc index 5379d8a..b545149 100644 --- a/src/client/view.qc +++ b/src/client/view.qc @@ -23,10 +23,8 @@ // vm is pSeat->m_eViewModel passed along from Nuclide's View_DrawViewModel void -View_UpdateWeapon(entity vm, entity mflash) +View_UpdateWeapon(player pl, entity vm, entity mflash) { - player pl = (player)pSeat->m_ePlayer; - if(autocvar_cl_printoutspam == 1){ printfline("STATUS: %i==%d - %i", pSeat->m_iLastWeapon, pl.activeweapon, pl.inventoryEquippedIndex); } @@ -67,7 +65,7 @@ View_UpdateWeapon(entity vm, entity mflash) // hack, we changed the wep, move this into Game_Input/PMove // ... And yes, it seems this bound check is indeed needed, zany sync issues. if(pl.inventoryEquippedIndex != -1){ - Weapons_Draw(); + Weapons_Draw(pl); } TS_View_ChangeViewModelPost(); diff --git a/src/server/player.qc b/src/server/player.qc index 2a3ae73..351b309 100644 --- a/src/server/player.qc +++ b/src/server/player.qc @@ -169,7 +169,7 @@ void CSEv_PlayerSwitchWeapon_i(int w) //pl.activeweapon = w; pl.setInventoryEquippedIndex(w); - Weapons_Draw(); + Weapons_Draw(pl); } */ diff --git a/src/shared/animations.qc b/src/shared/animations.qc index 8a1b954..6c344de 100644 --- a/src/shared/animations.qc +++ b/src/shared/animations.qc @@ -61,7 +61,7 @@ Animation_PlayerUpdate(player pl) pl.basebone = gettagindex(pl, "Bip01 Spine1"); if (pl.anim_top_delay <= 0.0f) { - pl.anim_top = Weapons_GetAim(pl.activeweapon); + pl.anim_top = Weapons_GetAim(pl, pl.activeweapon); } if (vlen(pl.velocity) == 0) { diff --git a/src/shared/defs.h b/src/shared/defs.h index f018b43..009e41d 100644 --- a/src/shared/defs.h +++ b/src/shared/defs.h @@ -90,8 +90,8 @@ var float autocvar_movemodmulti = 1; // Prototype for weapons_common.qc method(s)! // For things here to be aware of these earlier -void Weapons_Draw(void); -void Weapons_Holster(void); +void Weapons_Draw(player); +void Weapons_Holster(player); diff --git a/src/shared/event_custom.qc b/src/shared/event_custom.qc index e785c4c..6b1591b 100644 --- a/src/shared/event_custom.qc +++ b/src/shared/event_custom.qc @@ -56,7 +56,7 @@ TS_Weapon_Draw(player pl, int weaponEquipped, BOOL useAkimbo ) { // Anything equipped already? if(pl.inventoryEquippedIndex != -1){ // How about Nuclide's 'Holster' instead? - Weapons_Holster(); + Weapons_Holster(pl); pl.equippedWeaponDeleteCheck(); } @@ -85,7 +85,7 @@ TS_Weapon_Draw(player pl, int weaponEquipped, BOOL useAkimbo ) { // TEST! Force the call now anyway clientside too. //#ifdef SERVER TS_Weapon_Draw_extra(); - Weapons_Draw(); + Weapons_Draw(pl); //#else // // so that any choice of weapon, same as before or even nothing, will still // // let client/view.qc do the whole viewmodel routine again diff --git a/src/shared/input.qc b/src/shared/input.qc index c17e82a..8307cdf 100644 --- a/src/shared/input.qc +++ b/src/shared/input.qc @@ -36,7 +36,7 @@ float custom_input_buttons; float ary_custom_input_buttons[512]; BOOL ary_custom_input_sentYet[512]; -void Custom_Game_Input(void); +void Custom_Game_Input(player pl); #endif @@ -46,15 +46,14 @@ void Custom_Game_Input(void); // so if script to check for clicking while in spectator with no menu // to spawn is here, prepare to be disappointed. -// Also, this is called by pmove.qc (Nuclide), and it trusts "self" regardless +// Also, this is called by pmove.qc (Nuclide), and it trusts "pl" regardless // of being client or serverside, so going to here too. // ALSO, no need for "is spectator" checks here. Only being a player allows // pmove to be called to begin with. void -Game_Input(void) +Game_Input(player pl) { - player pl = (player)self; // // TODO: in the CSQC_Input_Frame event might be better when supported @@ -123,7 +122,7 @@ Game_Input(void) else Player_UseUp(); - self.impulse = 0; + pl.impulse = 0; #endif @@ -132,13 +131,13 @@ Game_Input(void) // FreeHL's way if (input_buttons & INPUT_BUTTON0) - Weapons_Primary(); + Weapons_Primary(pl); else if (input_buttons & INPUT_BUTTON4) - Weapons_Reload(); + Weapons_Reload(pl); else if (input_buttons & INPUT_BUTTON3) - Weapons_Secondary(); + Weapons_Secondary(pl); //else - pl.callWeaponThink(); //Weapons_Release(); + pl.callWeaponThink(); //Weapons_Release(pl); // Added portion to that. if(input_buttons & INPUT_BUTTON0){ @@ -348,10 +347,9 @@ Game_Input(void) void processInputs(void){ player pl = (player)self; - if (input_buttons & INPUT_BUTTON0){ //printfline("!!! PRIMA !!! (%d %d)", ((input_buttons & INPUT_BUTTON0)!=0), ((input_buttons & INPUT_BUTTON3)!=0)); - Weapons_Primary(); + Weapons_Primary(pl); pl.gflags |= GF_SEMI_TOGGLED; return; @@ -360,7 +358,7 @@ void processInputs(void){ if (input_buttons & INPUT_BUTTON3){ //printfline("!!! SECO !!! (%d %d)", ((input_buttons & INPUT_BUTTON0)!=0), ((input_buttons & INPUT_BUTTON3)!=0)); - Weapons_Secondary(); + Weapons_Secondary(pl); // TEST! //if(!(pl.gflags & GF_SEMI_SECONDARY_TOGGLED)){ @@ -375,7 +373,7 @@ void processInputs(void){ // why did the reload check come before Secondary-fire checks before?? if (input_buttons & INPUT_BUTTON4){ - Weapons_Reload(); + Weapons_Reload(pl); // Picked reload? Turn the flags for both fire types off //pl.gflags &= ~(GF_SEMI_TOGGLED | GF_SEMI_SECONDARY_TOGGLED); @@ -387,7 +385,7 @@ void processInputs(void){ // might be a little redundant at this point, but that is ok. // reached here? - Weapons_Release(); + Weapons_Release(pl); // No need for this now @@ -571,10 +569,10 @@ void ClientGame_Input_Frame(void){ if (pSeatLocal->m_iInputSpeed == TRUE) { input_buttons |= INPUT_BUTTON7; - //self.flags |= FL_SNEAK; + //pl.flags |= FL_SNEAK; }else{ - //self.flags &= ~FL_SNEAK; + //pl.flags &= ~FL_SNEAK; } //printfline("input_buttons: %d", (INPUT_BUTTON7 & input_buttons) ); @@ -624,8 +622,7 @@ void ClientGame_Input_Frame(void){ #if OTHER_PREDICTION_TEST == 1 // Shared -void Custom_Game_Input(void){ - player pl = (player)self; +void Custom_Game_Input(player pl){ if(custom_input_buttons == TRUE){ if( !(pl.gflags & GF_UNUSED3)){ @@ -760,7 +757,6 @@ CSEv_GSVRCC_ff(float arg_scf, float arg_ibc){ Custom_Game_Input(); // send a message back! - player pl = (player)self; WriteByte( MSG_MULTICAST, SVC_CGAMEPACKET ); WriteByte( MSG_MULTICAST, EVENT_TS::CUSTOM_PREDICTION_CALLBACK ); WriteFloat( MSG_MULTICAST, custom_servercommandframe ); diff --git a/src/shared/player.qc b/src/shared/player.qc index 2168331..aca53bd 100644 --- a/src/shared/player.qc +++ b/src/shared/player.qc @@ -2031,7 +2031,7 @@ player::dropWeapon(int arg_weaponID, BOOL completeDrop){ if(arg_weaponID == inventoryEquippedIndex){ // only if this is the currently equipped weapon. - Weapons_Holster(); + Weapons_Holster(this); if(!completeDrop){ deletedCurrentWeapon = equippedWeaponDeleteCheck(); }else{ diff --git a/src/shared/weapons.qc b/src/shared/weapons.qc index c07c757..d691428 100644 --- a/src/shared/weapons.qc +++ b/src/shared/weapons.qc @@ -1645,7 +1645,7 @@ weapon_gun_fireBurstBullet( // for it to be effective, it's not magic arg_thisWeapon.iFireMode = BITS_FIREMODE_NONE; - Weapons_Primary(); + Weapons_Primary(pl); arg_thisWeapon.iFireMode = BITS_FIREMODE_BURST; diff --git a/src/shared/weapons/weapon_ak47.qc b/src/shared/weapons/weapon_ak47.qc index dda18cc..ebeff9f 100644 --- a/src/shared/weapons/weapon_ak47.qc +++ b/src/shared/weapons/weapon_ak47.qc @@ -111,9 +111,8 @@ w_ak47_wmodel(void) } string -w_ak47_pmodel(void) +w_ak47_pmodel(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; return (*ary_weaponData[WEAPON_ID::AK47]).sPlayerModelPath; } @@ -125,23 +124,21 @@ w_ak47_deathmsg(void) } void -w_ak47_draw(void) +w_ak47_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::AK47], arg_thisWeapon); } void -w_ak47_holster(void) +w_ak47_holster(player pl) { } void -w_ak47_primary(void) +w_ak47_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -181,9 +178,8 @@ w_ak47_primary(void) void -w_ak47_secondary(void) +w_ak47_secondary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; INPUT_SECONDARY_TAP_GATE @@ -213,24 +209,22 @@ w_ak47_secondary(void) } void -w_ak47_reload(void) +w_ak47_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_ironsight_Reload(pl, (weapondata_ironsight_t*)ary_weaponData[WEAPON_ID::AK47], arg_thisWeapon); } float -w_ak47_aimanim(void) +w_ak47_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_ak47_hud(void) +w_ak47_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::AK47], arg_thisWeapon); @@ -252,7 +246,7 @@ weapon_t w_ak47 = .secondary = w_ak47_secondary, .reload = w_ak47_reload, .release = NULL, - .crosshair = w_ak47_hud, + .postdraw = w_ak47_hud, .precache = w_ak47_precache, .pickup = NULL, .updateammo = w_ak47_updateammo, diff --git a/src/shared/weapons/weapon_akimbocolts.qc b/src/shared/weapons/weapon_akimbocolts.qc index da038df..fb26515 100644 --- a/src/shared/weapons/weapon_akimbocolts.qc +++ b/src/shared/weapons/weapon_akimbocolts.qc @@ -99,9 +99,8 @@ w_akimbocolts_wmodel(void) } string -w_akimbocolts_pmodel(void) +w_akimbocolts_pmodel(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; return (*ary_weaponData[WEAPON_ID::AKIMBOCOLTS]).sPlayerModelPath; } @@ -113,15 +112,14 @@ w_akimbocolts_deathmsg(void) } void -w_akimbocolts_draw(void) +w_akimbocolts_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::AKIMBOCOLTS], arg_thisWeapon); } void -w_akimbocolts_holster(void) +w_akimbocolts_holster(player pl) { } @@ -263,14 +261,14 @@ void weapon_akimbocolts_akimbo_attack(player pl, weapondynamic_t arg_thisWeapon, void -w_akimbocolts_primary(void) +w_akimbocolts_primary(player pl) { weapon_gun_akimbo_semi_primaryAttack(weapon_akimbocolts_akimbo_attack); } void -w_akimbocolts_secondary(void) +w_akimbocolts_secondary(player pl) { weapon_gun_akimbo_semi_secondaryAttack(weapon_akimbocolts_akimbo_attack); @@ -278,30 +276,28 @@ w_akimbocolts_secondary(void) void -w_akimbocolts_reload(void) +w_akimbocolts_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_Reload(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::AKIMBOCOLTS], arg_thisWeapon); } float -w_akimbocolts_aimanim(void) +w_akimbocolts_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_akimbocolts_hud(void) +w_akimbocolts_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::AKIMBOCOLTS], arg_thisWeapon); } void -w_akimbocolts_hudpic(int selected, vector pos, float a) +w_akimbocolts_hudpic(player pl, int selected, vector pos, float a) { // } @@ -320,7 +316,7 @@ weapon_t w_akimbocolts = .secondary = w_akimbocolts_secondary, .reload = w_akimbocolts_reload, .release = NULL, - .crosshair = w_akimbocolts_hud, + .postdraw = w_akimbocolts_hud, .precache = w_akimbocolts_precache, .pickup = NULL, .updateammo = w_akimbocolts_updateammo, diff --git a/src/shared/weapons/weapon_barrettm82.qc b/src/shared/weapons/weapon_barrettm82.qc index 42e0244..7e0d290 100644 --- a/src/shared/weapons/weapon_barrettm82.qc +++ b/src/shared/weapons/weapon_barrettm82.qc @@ -98,9 +98,8 @@ w_barrettm82_wmodel(void) } string -w_barrettm82_pmodel(void) +w_barrettm82_pmodel(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; return (*ary_weaponData[WEAPON_ID::BARRETTM82]).sPlayerModelPath; } @@ -112,9 +111,8 @@ w_barrettm82_deathmsg(void) } void -w_barrettm82_draw(void) +w_barrettm82_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapondata_basic_t* basicP = ary_weaponData[WEAPON_ID::BARRETTM82]; @@ -123,15 +121,14 @@ w_barrettm82_draw(void) void -w_barrettm82_holster(void) +w_barrettm82_holster(player pl) { } void -w_barrettm82_primary(void) +w_barrettm82_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -173,9 +170,8 @@ w_barrettm82_primary(void) void -w_barrettm82_secondary(void) +w_barrettm82_secondary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; INPUT_SECONDARY_TAP_GATE @@ -189,30 +185,28 @@ w_barrettm82_secondary(void) } void -w_barrettm82_reload(void) +w_barrettm82_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_Reload(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::BARRETTM82], arg_thisWeapon); } float -w_barrettm82_aimanim(void) +w_barrettm82_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_barrettm82_hud(void) +w_barrettm82_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::BARRETTM82], arg_thisWeapon); } void -w_barrettm82_hudpic(int selected, vector pos, float a) +w_barrettm82_hudpic(player pl, int selected, vector pos, float a) { // } @@ -231,7 +225,7 @@ weapon_t w_barrettm82 = .secondary = w_barrettm82_secondary, .reload = w_barrettm82_reload, .release = NULL, - .crosshair = w_barrettm82_hud, + .postdraw = w_barrettm82_hud, .precache = w_barrettm82_precache, .pickup = NULL, .updateammo = w_barrettm82_updateammo, diff --git a/src/shared/weapons/weapon_benellim3.qc b/src/shared/weapons/weapon_benellim3.qc index 5cb49a0..37a6f0e 100644 --- a/src/shared/weapons/weapon_benellim3.qc +++ b/src/shared/weapons/weapon_benellim3.qc @@ -110,9 +110,8 @@ w_benellim3_wmodel(void) } string -w_benellim3_pmodel(void) +w_benellim3_pmodel(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; return (*ary_weaponData[WEAPON_ID::BENELLIM3]).sPlayerModelPath; } @@ -124,9 +123,8 @@ w_benellim3_deathmsg(void) } void -w_benellim3_draw(void) +w_benellim3_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; pl.iShotgunExtraDataID = SHOTGUN_EXTRA_ID::BENELLIM3; @@ -137,15 +135,14 @@ w_benellim3_draw(void) void -w_benellim3_holster(void) +w_benellim3_holster(player pl) { } void -w_benellim3_primary(void) +w_benellim3_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if(!weapon_shotgun_onInterrupt(pl, ary_weaponData[WEAPON_ID::BENELLIM3], arg_thisWeapon)){ @@ -233,9 +230,8 @@ w_benellim3_primary(void) void -w_benellim3_secondary(void) +w_benellim3_secondary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; INPUT_SECONDARY_TAP_GATE @@ -255,30 +251,28 @@ w_benellim3_secondary(void) } void -w_benellim3_reload(void) +w_benellim3_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_shotgun_reload(pl, ary_weaponData[WEAPON_ID::BENELLIM3], arg_thisWeapon); } float -w_benellim3_aimanim(void) +w_benellim3_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_benellim3_hud(void) +w_benellim3_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::BENELLIM3], arg_thisWeapon); } void -w_benellim3_hudpic(int selected, vector pos, float a) +w_benellim3_hudpic(player pl, int selected, vector pos, float a) { // } @@ -298,7 +292,7 @@ weapon_t w_benellim3 = .secondary = w_benellim3_secondary, .reload = w_benellim3_reload, .release = NULL, - .crosshair = w_benellim3_hud, + .postdraw = w_benellim3_hud, .precache = w_benellim3_precache, .pickup = NULL, .updateammo = w_benellim3_updateammo, diff --git a/src/shared/weapons/weapon_beretta.qc b/src/shared/weapons/weapon_beretta.qc index 9ff61b3..1d1b245 100644 --- a/src/shared/weapons/weapon_beretta.qc +++ b/src/shared/weapons/weapon_beretta.qc @@ -92,10 +92,9 @@ w_beretta_wmodel(void) } string -w_beretta_pmodel(void) +w_beretta_pmodel(player pl) { // Do we have the silencer? - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ return (*ary_weaponData[WEAPON_ID::BERETTA]).sPlayerModelPath; @@ -111,9 +110,8 @@ w_beretta_deathmsg(void) } void -w_beretta_draw(void) +w_beretta_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapondata_basic_t* basicP = ary_weaponData[WEAPON_ID::BERETTA]; @@ -122,15 +120,14 @@ w_beretta_draw(void) void -w_beretta_holster(void) +w_beretta_holster(player pl) { } void -w_beretta_primary(void) +w_beretta_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -188,35 +185,33 @@ w_beretta_primary(void) void -w_beretta_secondary(void) +w_beretta_secondary(player pl) { } void -w_beretta_reload(void) +w_beretta_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_Reload(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::BERETTA], arg_thisWeapon); } float -w_beretta_aimanim(void) +w_beretta_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_beretta_hud(void) +w_beretta_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::BERETTA], arg_thisWeapon); } void -w_beretta_hudpic(int selected, vector pos, float a) +w_beretta_hudpic(player pl, int selected, vector pos, float a) { // } @@ -237,7 +232,7 @@ weapon_t w_beretta = .secondary = w_beretta_secondary, .reload = w_beretta_reload, .release = NULL, - .crosshair = w_beretta_hud, + .postdraw = w_beretta_hud, .precache = w_beretta_precache, .pickup = NULL, .updateammo = w_beretta_updateammo, diff --git a/src/shared/weapons/weapon_beretta_akimbo.qc b/src/shared/weapons/weapon_beretta_akimbo.qc index 5f97583..f3a6d47 100644 --- a/src/shared/weapons/weapon_beretta_akimbo.qc +++ b/src/shared/weapons/weapon_beretta_akimbo.qc @@ -116,10 +116,9 @@ w_beretta_akimbo_wmodel(void) } string -w_beretta_akimbo_pmodel(void) +w_beretta_akimbo_pmodel(player pl) { // Do we have the silencer? - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ return (*ary_weaponData[WEAPON_ID::BERETTA_AKIMBO]).sPlayerModelPath; @@ -135,15 +134,14 @@ w_beretta_akimbo_deathmsg(void) } void -w_beretta_akimbo_draw(void) +w_beretta_akimbo_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::BERETTA_AKIMBO], arg_thisWeapon); } void -w_beretta_akimbo_holster(void) +w_beretta_akimbo_holster(player pl) { } @@ -320,43 +318,41 @@ void weapon_beretta_akimbo_attack(player pl, weapondynamic_t arg_thisWeapon, int void -w_beretta_akimbo_primary(void) +w_beretta_akimbo_primary(player pl) { weapon_gun_akimbo_semi_primaryAttack(weapon_beretta_akimbo_attack); } void -w_beretta_akimbo_secondary(void) +w_beretta_akimbo_secondary(player pl) { weapon_gun_akimbo_semi_secondaryAttack(weapon_beretta_akimbo_attack); } void -w_beretta_akimbo_reload(void) +w_beretta_akimbo_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_Reload(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::BERETTA_AKIMBO], arg_thisWeapon); } float -w_beretta_akimbo_aimanim(void) +w_beretta_akimbo_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_beretta_akimbo_hud(void) +w_beretta_akimbo_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::BERETTA_AKIMBO], arg_thisWeapon); } void -w_beretta_akimbo_hudpic(int selected, vector pos, float a) +w_beretta_akimbo_hudpic(player pl, int selected, vector pos, float a) { // } @@ -375,7 +371,7 @@ weapon_t w_beretta_akimbo = .secondary = w_beretta_akimbo_secondary, .reload = w_beretta_akimbo_reload, .release = NULL, - .crosshair = w_beretta_akimbo_hud, + .postdraw = w_beretta_akimbo_hud, .precache = w_beretta_akimbo_precache, .pickup = NULL, .updateammo = w_beretta_akimbo_updateammo, diff --git a/src/shared/weapons/weapon_combatknife.qc b/src/shared/weapons/weapon_combatknife.qc index b7568ef..8c48466 100644 --- a/src/shared/weapons/weapon_combatknife.qc +++ b/src/shared/weapons/weapon_combatknife.qc @@ -90,7 +90,7 @@ w_combatknife_wmodel(void) } string -w_combatknife_pmodel(void) +w_combatknife_pmodel(player pl) { return (*ary_weaponData[WEAPON_ID::COMBATKNIFE]).sPlayerModelPath; } @@ -102,23 +102,21 @@ w_combatknife_deathmsg(void) } void -w_combatknife_draw(void) +w_combatknife_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::COMBATKNIFE], arg_thisWeapon); } void -w_combatknife_holster(void) +w_combatknife_holster(player pl) { } void -w_combatknife_primary(void) +w_combatknife_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -164,9 +162,8 @@ w_combatknife_primary(void) void -w_combatknife_secondary(void) +w_combatknife_secondary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -212,28 +209,27 @@ w_combatknife_secondary(void) } void -w_combatknife_reload(void) +w_combatknife_reload(player pl) { // how do you reload a sword } float -w_combatknife_aimanim(void) +w_combatknife_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_combatknife_hud(void) +w_combatknife_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_throwable_onDrawHUD(pl, (weapondata_throwable_t*)ary_weaponData[WEAPON_ID::COMBATKNIFE], arg_thisWeapon); } void -w_combatknife_hudpic(int selected, vector pos, float a) +w_combatknife_hudpic(player pl, int selected, vector pos, float a) { // } @@ -252,7 +248,7 @@ weapon_t w_combatknife = .secondary = w_combatknife_secondary, .reload = w_combatknife_reload, .release = NULL, - .crosshair = w_combatknife_hud, + .postdraw = w_combatknife_hud, .precache = w_combatknife_precache, .pickup = NULL, .updateammo = w_combatknife_updateammo, diff --git a/src/shared/weapons/weapon_contenderg2.qc b/src/shared/weapons/weapon_contenderg2.qc index 24794d8..a3970c2 100644 --- a/src/shared/weapons/weapon_contenderg2.qc +++ b/src/shared/weapons/weapon_contenderg2.qc @@ -103,9 +103,8 @@ w_contenderg2_wmodel(void) } string -w_contenderg2_pmodel(void) +w_contenderg2_pmodel(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; return (*ary_weaponData[WEAPON_ID::CONTENDERG2]).sPlayerModelPath; } @@ -117,22 +116,20 @@ w_contenderg2_deathmsg(void) } void -w_contenderg2_draw(void) +w_contenderg2_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::CONTENDERG2], arg_thisWeapon); } void -w_contenderg2_holster(void) +w_contenderg2_holster(player pl) { } void -w_contenderg2_primary(void) +w_contenderg2_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -174,9 +171,8 @@ w_contenderg2_primary(void) } void -w_contenderg2_secondary(void) +w_contenderg2_secondary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; INPUT_SECONDARY_TAP_GATE @@ -190,31 +186,29 @@ w_contenderg2_secondary(void) } void -w_contenderg2_reload(void) +w_contenderg2_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_Reload(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::CONTENDERG2], arg_thisWeapon); } float -w_contenderg2_aimanim(void) +w_contenderg2_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_contenderg2_hud(void) +w_contenderg2_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::CONTENDERG2], arg_thisWeapon); } void -w_contenderg2_hudpic(int selected, vector pos, float a) +w_contenderg2_hudpic(player pl, int selected, vector pos, float a) { // } @@ -233,7 +227,7 @@ weapon_t w_contenderg2 = .secondary = w_contenderg2_secondary, .reload = w_contenderg2_reload, .release = NULL, - .crosshair = w_contenderg2_hud, + .postdraw = w_contenderg2_hud, .precache = w_contenderg2_precache, .pickup = NULL, .updateammo = w_contenderg2_updateammo, diff --git a/src/shared/weapons/weapon_deserteagle.qc b/src/shared/weapons/weapon_deserteagle.qc index 9788f73..ba2fac3 100644 --- a/src/shared/weapons/weapon_deserteagle.qc +++ b/src/shared/weapons/weapon_deserteagle.qc @@ -116,10 +116,9 @@ w_deserteagle_wmodel(void) } string -w_deserteagle_pmodel(void) +w_deserteagle_pmodel(player pl) { // Do we have the silencer? - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ return (*ary_weaponData[WEAPON_ID::DESERTEAGLE]).sPlayerModelPath; @@ -135,9 +134,8 @@ w_deserteagle_deathmsg(void) } void -w_deserteagle_draw(void) +w_deserteagle_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapondata_basic_t* basicP = ary_weaponData[WEAPON_ID::DESERTEAGLE]; @@ -146,15 +144,14 @@ w_deserteagle_draw(void) void -w_deserteagle_holster(void) +w_deserteagle_holster(player pl) { } void -w_deserteagle_primary(void) +w_deserteagle_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -221,9 +218,8 @@ w_deserteagle_primary(void) void -w_deserteagle_secondary(void) +w_deserteagle_secondary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; INPUT_SECONDARY_TAP_GATE @@ -242,30 +238,28 @@ w_deserteagle_secondary(void) } void -w_deserteagle_reload(void) +w_deserteagle_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_ironsight_Reload(pl, (weapondata_ironsight_t*)ary_weaponData[WEAPON_ID::DESERTEAGLE], arg_thisWeapon); } float -w_deserteagle_aimanim(void) +w_deserteagle_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_deserteagle_hud(void) +w_deserteagle_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::DESERTEAGLE], arg_thisWeapon); } void -w_deserteagle_hudpic(int selected, vector pos, float a) +w_deserteagle_hudpic(player pl, int selected, vector pos, float a) { // } @@ -284,7 +278,7 @@ weapon_t w_deserteagle = .secondary = w_deserteagle_secondary, .reload = w_deserteagle_reload, .release = NULL, - .crosshair = w_deserteagle_hud, + .postdraw = w_deserteagle_hud, .precache = w_deserteagle_precache, .pickup = NULL, .updateammo = w_deserteagle_updateammo, diff --git a/src/shared/weapons/weapon_fiveseven.qc b/src/shared/weapons/weapon_fiveseven.qc index 78dc54b..1c9c4aa 100644 --- a/src/shared/weapons/weapon_fiveseven.qc +++ b/src/shared/weapons/weapon_fiveseven.qc @@ -91,10 +91,9 @@ w_fiveseven_wmodel(void) } string -w_fiveseven_pmodel(void) +w_fiveseven_pmodel(player pl) { // Do we have the silencer? - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ return (*ary_weaponData[WEAPON_ID::FIVESEVEN]).sPlayerModelPath; @@ -110,9 +109,8 @@ w_fiveseven_deathmsg(void) } void -w_fiveseven_draw(void) +w_fiveseven_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapondata_basic_t* basicP = ary_weaponData[WEAPON_ID::FIVESEVEN]; @@ -121,15 +119,14 @@ w_fiveseven_draw(void) void -w_fiveseven_holster(void) +w_fiveseven_holster(player pl) { } void -w_fiveseven_primary(void) +w_fiveseven_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -177,35 +174,33 @@ w_fiveseven_primary(void) } void -w_fiveseven_secondary(void) +w_fiveseven_secondary(player pl) { } void -w_fiveseven_reload(void) +w_fiveseven_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_Reload(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::FIVESEVEN], arg_thisWeapon); } float -w_fiveseven_aimanim(void) +w_fiveseven_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_fiveseven_hud(void) +w_fiveseven_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::FIVESEVEN], arg_thisWeapon); } void -w_fiveseven_hudpic(int selected, vector pos, float a) +w_fiveseven_hudpic(player pl, int selected, vector pos, float a) { // } @@ -224,7 +219,7 @@ weapon_t w_fiveseven = .secondary = w_fiveseven_secondary, .reload = w_fiveseven_reload, .release = NULL, - .crosshair = w_fiveseven_hud, + .postdraw = w_fiveseven_hud, .precache = w_fiveseven_precache, .pickup = NULL, .updateammo = w_fiveseven_updateammo, diff --git a/src/shared/weapons/weapon_fiveseven_akimbo.qc b/src/shared/weapons/weapon_fiveseven_akimbo.qc index 69811a4..7f58b65 100644 --- a/src/shared/weapons/weapon_fiveseven_akimbo.qc +++ b/src/shared/weapons/weapon_fiveseven_akimbo.qc @@ -87,10 +87,9 @@ w_fiveseven_akimbo_wmodel(void) } string -w_fiveseven_akimbo_pmodel(void) +w_fiveseven_akimbo_pmodel(player pl) { // Do we have the silencer? - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ return (*ary_weaponData[WEAPON_ID::FIVESEVEN_AKIMBO]).sPlayerModelPath; @@ -106,15 +105,14 @@ w_fiveseven_akimbo_deathmsg(void) } void -w_fiveseven_akimbo_draw(void) +w_fiveseven_akimbo_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::FIVESEVEN_AKIMBO], arg_thisWeapon); } void -w_fiveseven_akimbo_holster(void) +w_fiveseven_akimbo_holster(player pl) { } @@ -263,43 +261,41 @@ void weapon_fiveseven_akimbo_attack(player pl, weapondynamic_t arg_thisWeapon, i void -w_fiveseven_akimbo_primary(void) +w_fiveseven_akimbo_primary(player pl) { weapon_gun_akimbo_semi_primaryAttack(weapon_fiveseven_akimbo_attack); } void -w_fiveseven_akimbo_secondary(void) +w_fiveseven_akimbo_secondary(player pl) { weapon_gun_akimbo_semi_secondaryAttack(weapon_fiveseven_akimbo_attack); } void -w_fiveseven_akimbo_reload(void) +w_fiveseven_akimbo_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_Reload(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::FIVESEVEN_AKIMBO], arg_thisWeapon); } float -w_fiveseven_akimbo_aimanim(void) +w_fiveseven_akimbo_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_fiveseven_akimbo_hud(void) +w_fiveseven_akimbo_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::FIVESEVEN_AKIMBO], arg_thisWeapon); } void -w_fiveseven_akimbo_hudpic(int selected, vector pos, float a) +w_fiveseven_akimbo_hudpic(player pl, int selected, vector pos, float a) { // } @@ -318,7 +314,7 @@ weapon_t w_fiveseven_akimbo = .secondary = w_fiveseven_akimbo_secondary, .reload = w_fiveseven_akimbo_reload, .release = NULL, - .crosshair = w_fiveseven_akimbo_hud, + .postdraw = w_fiveseven_akimbo_hud, .precache = w_fiveseven_akimbo_precache, .pickup = NULL, .updateammo = w_fiveseven_akimbo_updateammo, diff --git a/src/shared/weapons/weapon_glock18.qc b/src/shared/weapons/weapon_glock18.qc index 18761ef..58b1e08 100644 --- a/src/shared/weapons/weapon_glock18.qc +++ b/src/shared/weapons/weapon_glock18.qc @@ -101,7 +101,7 @@ w_glock18_wmodel(void) } string -w_glock18_pmodel(void) +w_glock18_pmodel(player pl) { // Do we have the silencer? player pl = (player)self; @@ -121,25 +121,23 @@ w_glock18_deathmsg(void) void -w_glock18_draw(void) +w_glock18_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::GLOCK18], arg_thisWeapon); } void -w_glock18_holster(void) +w_glock18_holster(player pl) { } void -w_glock18_primary(void) +w_glock18_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -212,9 +210,8 @@ w_glock18_primary(void) void -w_glock18_reload(void) +w_glock18_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_Reload(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::GLOCK18], arg_thisWeapon); @@ -225,16 +222,15 @@ w_glock18_reload(void) // ??? float -w_glock18_aimanim(void) +w_glock18_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_glock18_hud(void) +w_glock18_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::GLOCK18], arg_thisWeapon); @@ -243,7 +239,7 @@ w_glock18_hud(void) // NOPE! Handled by the BuyMenu, could make this give the instructions for drawing the // button with the icon if really wanted void -w_glock18_hudpic(int selected, vector pos, float a) +w_glock18_hudpic(player pl, int selected, vector pos, float a) { // } @@ -263,7 +259,7 @@ weapon_t w_glock18 = .secondary = NULL, .reload = w_glock18_reload, .release = NULL, - .crosshair = w_glock18_hud, + .postdraw = w_glock18_hud, .precache = w_glock18_precache, .pickup = NULL, .updateammo = w_glock18_updateammo, diff --git a/src/shared/weapons/weapon_glock20.qc b/src/shared/weapons/weapon_glock20.qc index b41b568..fc2ec01 100644 --- a/src/shared/weapons/weapon_glock20.qc +++ b/src/shared/weapons/weapon_glock20.qc @@ -87,10 +87,9 @@ w_glock20_wmodel(void) } string -w_glock20_pmodel(void) +w_glock20_pmodel(player pl) { // Do we have the silencer? - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ return (*ary_weaponData[WEAPON_ID::GLOCK20]).sPlayerModelPath; @@ -106,23 +105,21 @@ w_glock20_deathmsg(void) } void -w_glock20_draw(void) +w_glock20_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::GLOCK20], arg_thisWeapon); } void -w_glock20_holster(void) +w_glock20_holster(player pl) { } void -w_glock20_primary(void) +w_glock20_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -175,29 +172,27 @@ w_glock20_primary(void) } void -w_glock20_secondary(void) +w_glock20_secondary(player pl) { } void -w_glock20_reload(void) +w_glock20_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_Reload(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::GLOCK20], arg_thisWeapon); } float -w_glock20_aimanim(void) +w_glock20_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_glock20_hud(void) +w_glock20_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::GLOCK20], arg_thisWeapon); @@ -205,7 +200,7 @@ w_glock20_hud(void) } void -w_glock20_hudpic(int selected, vector pos, float a) +w_glock20_hudpic(player pl, int selected, vector pos, float a) { // } @@ -224,7 +219,7 @@ weapon_t w_glock20 = .secondary = w_glock20_secondary, .reload = w_glock20_reload, .release = NULL, - .crosshair = w_glock20_hud, + .postdraw = w_glock20_hud, .precache = w_glock20_precache, .pickup = NULL, .updateammo = w_glock20_updateammo, diff --git a/src/shared/weapons/weapon_hkpdw.qc b/src/shared/weapons/weapon_hkpdw.qc index ae62d26..0c01952 100644 --- a/src/shared/weapons/weapon_hkpdw.qc +++ b/src/shared/weapons/weapon_hkpdw.qc @@ -97,10 +97,9 @@ w_hkpdw_wmodel(void) } string -w_hkpdw_pmodel(void) +w_hkpdw_pmodel(player pl) { // Do we have the silencer? - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ return (*ary_weaponData[WEAPON_ID::HKPDW]).sPlayerModelPath; @@ -116,23 +115,21 @@ w_hkpdw_deathmsg(void) } void -w_hkpdw_draw(void) +w_hkpdw_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::HKPDW], arg_thisWeapon); } void -w_hkpdw_holster(void) +w_hkpdw_holster(player pl) { } void -w_hkpdw_primary(void) +w_hkpdw_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -182,9 +179,8 @@ w_hkpdw_primary(void) } void -w_hkpdw_secondary(void) +w_hkpdw_secondary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; INPUT_SECONDARY_TAP_GATE @@ -198,24 +194,22 @@ w_hkpdw_secondary(void) } void -w_hkpdw_reload(void) +w_hkpdw_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_Reload(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::HKPDW], arg_thisWeapon); } float -w_hkpdw_aimanim(void) +w_hkpdw_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_hkpdw_hud(void) +w_hkpdw_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::HKPDW], arg_thisWeapon); @@ -223,7 +217,7 @@ w_hkpdw_hud(void) } void -w_hkpdw_hudpic(int selected, vector pos, float a) +w_hkpdw_hudpic(player pl, int selected, vector pos, float a) { // } @@ -242,7 +236,7 @@ weapon_t w_hkpdw = .secondary = w_hkpdw_secondary, .reload = w_hkpdw_reload, .release = NULL, - .crosshair = w_hkpdw_hud, + .postdraw = w_hkpdw_hud, .precache = w_hkpdw_precache, .pickup = NULL, .updateammo = w_hkpdw_updateammo, diff --git a/src/shared/weapons/weapon_karate.qc b/src/shared/weapons/weapon_karate.qc index a928895..692ab63 100644 --- a/src/shared/weapons/weapon_karate.qc +++ b/src/shared/weapons/weapon_karate.qc @@ -89,7 +89,7 @@ w_karate_wmodel(void) } string -w_karate_pmodel(void) +w_karate_pmodel(player pl) { return (*ary_weaponData[WEAPON_ID::KARATE]).sPlayerModelPath; } @@ -101,9 +101,8 @@ w_karate_deathmsg(void) } void -w_karate_draw(void) +w_karate_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapondata_basic_t* basicP = ary_weaponData[WEAPON_ID::KARATE]; @@ -111,15 +110,14 @@ w_karate_draw(void) } void -w_karate_holster(void) +w_karate_holster(player pl) { } void -w_karate_primary(void) +w_karate_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -181,8 +179,7 @@ w_karate_primary(void) // moved to a method so that early termination does not stop too much. -void w_karate_determineSecondaryAttack(MELEE_HIT_RESPONSE& hitRep, int& meleeAnimToPlay){ - player pl = (player)self; +void w_karate_determineSecondaryAttack(player pl, MELEE_HIT_RESPONSE& hitRep, int& meleeAnimToPlay){ weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; float curSpeed; @@ -260,9 +257,8 @@ void w_karate_determineSecondaryAttack(MELEE_HIT_RESPONSE& hitRep, int& meleeAni void -w_karate_secondary(void) +w_karate_secondary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; // a warning if this isn't defaulted, really? // The whole point of being sent as a reference in determineSecondaryAttack is @@ -280,7 +276,7 @@ w_karate_secondary(void) // TODO - base karate melee damage? I forget. - w_karate_determineSecondaryAttack(hitRep, meleeAnimToPlay); + w_karate_determineSecondaryAttack(pl, hitRep, meleeAnimToPlay); pl.fUncrouchBlockDelay = 1.0f; @@ -326,9 +322,8 @@ w_karate_secondary(void) } void -w_karate_reload(void) +w_karate_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; // make a "HUAH" sound with a little cooldown? @@ -348,17 +343,16 @@ w_karate_reload(void) } float -w_karate_aimanim(void) +w_karate_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_karate_hud(void) +w_karate_hud(player pl) { #ifdef CLIENT vector clrDraw; - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapondata_basic_t baseRef = *ary_weaponData[WEAPON_ID::KARATE]; @@ -385,7 +379,7 @@ w_karate_hud(void) } void -w_karate_hudpic(int selected, vector pos, float a) +w_karate_hudpic(player pl, int selected, vector pos, float a) { // } @@ -404,7 +398,7 @@ weapon_t w_karate = .secondary = w_karate_secondary, .reload = w_karate_reload, .release = NULL, - .crosshair = w_karate_hud, + .postdraw = w_karate_hud, .precache = w_karate_precache, .pickup = NULL, .updateammo = w_karate_updateammo, diff --git a/src/shared/weapons/weapon_katana.qc b/src/shared/weapons/weapon_katana.qc index d2c4613..44769cd 100644 --- a/src/shared/weapons/weapon_katana.qc +++ b/src/shared/weapons/weapon_katana.qc @@ -82,7 +82,7 @@ w_katana_wmodel(void) } string -w_katana_pmodel(void) +w_katana_pmodel(player pl) { return (*ary_weaponData[WEAPON_ID::KATANA]).sPlayerModelPath; } @@ -95,23 +95,21 @@ w_katana_deathmsg(void) void -w_katana_draw(void) +w_katana_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::KATANA], arg_thisWeapon); } void -w_katana_holster(void) +w_katana_holster(player pl) { } void -w_katana_primary(void) +w_katana_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; MELEE_HIT_RESPONSE hitRep; int meleeAnimToPlay = 0; @@ -210,27 +208,26 @@ w_katana_primary(void) } void -w_katana_secondary(void) +w_katana_secondary(player pl) { // nope. } void -w_katana_reload(void) +w_katana_reload(player pl) { // how do you reload a sword } float -w_katana_aimanim(void) +w_katana_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_katana_hud(void) +w_katana_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_melee_onDrawHUD(pl, (weapondata_melee_t*)ary_weaponData[WEAPON_ID::KATANA], arg_thisWeapon); @@ -238,7 +235,7 @@ w_katana_hud(void) } void -w_katana_hudpic(int selected, vector pos, float a) +w_katana_hudpic(player pl, int selected, vector pos, float a) { // } @@ -257,7 +254,7 @@ weapon_t w_katana = .secondary = w_katana_secondary, .reload = w_katana_reload, .release = NULL, - .crosshair = w_katana_hud, + .postdraw = w_katana_hud, .precache = w_katana_precache, .pickup = NULL, .updateammo = w_katana_updateammo, diff --git a/src/shared/weapons/weapon_m16a4.qc b/src/shared/weapons/weapon_m16a4.qc index 5791142..dc6f0f2 100644 --- a/src/shared/weapons/weapon_m16a4.qc +++ b/src/shared/weapons/weapon_m16a4.qc @@ -114,9 +114,8 @@ w_m16a4_wmodel(void) } string -w_m16a4_pmodel(void) +w_m16a4_pmodel(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; return (*ary_weaponData[WEAPON_ID::M16A4]).sPlayerModelPath; } @@ -128,24 +127,22 @@ w_m16a4_deathmsg(void) } void -w_m16a4_draw(void) +w_m16a4_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::M16A4], arg_thisWeapon); } void -w_m16a4_holster(void) +w_m16a4_holster(player pl) { } void -w_m16a4_primary(void) +w_m16a4_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; @@ -230,9 +227,8 @@ w_m16a4_primary(void) void -w_m16a4_secondary(void) +w_m16a4_secondary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; INPUT_SECONDARY_TAP_GATE @@ -252,24 +248,22 @@ w_m16a4_secondary(void) } void -w_m16a4_reload(void) +w_m16a4_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_ironsight_Reload(pl, (weapondata_ironsight_t*)ary_weaponData[WEAPON_ID::M16A4], arg_thisWeapon); } float -w_m16a4_aimanim(void) +w_m16a4_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_m16a4_hud(void) +w_m16a4_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::M16A4], arg_thisWeapon); @@ -277,7 +271,7 @@ w_m16a4_hud(void) } void -w_m16a4_hudpic(int selected, vector pos, float a) +w_m16a4_hudpic(player pl, int selected, vector pos, float a) { // } @@ -296,7 +290,7 @@ weapon_t w_m16a4 = .secondary = w_m16a4_secondary, .reload = w_m16a4_reload, .release = NULL, - .crosshair = w_m16a4_hud, + .postdraw = w_m16a4_hud, .precache = w_m16a4_precache, .pickup = NULL, .updateammo = w_m16a4_updateammo, diff --git a/src/shared/weapons/weapon_m4a1.qc b/src/shared/weapons/weapon_m4a1.qc index ed66e9d..d6983dc 100644 --- a/src/shared/weapons/weapon_m4a1.qc +++ b/src/shared/weapons/weapon_m4a1.qc @@ -139,10 +139,9 @@ w_m4a1_wmodel(void) } string -w_m4a1_pmodel(void) +w_m4a1_pmodel(player pl) { // Do we have the silencer? - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ return (*ary_weaponData[WEAPON_ID::M4A1]).sPlayerModelPath; @@ -158,23 +157,21 @@ w_m4a1_deathmsg(void) } void -w_m4a1_draw(void) +w_m4a1_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::M4A1], arg_thisWeapon); } void -w_m4a1_holster(void) +w_m4a1_holster(player pl) { } void -w_m4a1_primary(void) +w_m4a1_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -240,9 +237,8 @@ w_m4a1_primary(void) } void -w_m4a1_secondary(void) +w_m4a1_secondary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; INPUT_SECONDARY_TAP_GATE @@ -264,24 +260,22 @@ w_m4a1_secondary(void) void -w_m4a1_reload(void) +w_m4a1_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_ironsight_Reload(pl, (weapondata_ironsight_t*)ary_weaponData[WEAPON_ID::M4A1], arg_thisWeapon); } float -w_m4a1_aimanim(void) +w_m4a1_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_m4a1_hud(void) +w_m4a1_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::M4A1], arg_thisWeapon); @@ -289,7 +283,7 @@ w_m4a1_hud(void) } void -w_m4a1_hudpic(int selected, vector pos, float a) +w_m4a1_hudpic(player pl, int selected, vector pos, float a) { // } @@ -308,7 +302,7 @@ weapon_t w_m4a1 = .secondary = w_m4a1_secondary, .reload = w_m4a1_reload, .release = NULL, - .crosshair = w_m4a1_hud, + .postdraw = w_m4a1_hud, .precache = w_m4a1_precache, .pickup = NULL, .updateammo = w_m4a1_updateammo, diff --git a/src/shared/weapons/weapon_m60.qc b/src/shared/weapons/weapon_m60.qc index 0b9b8b2..850c3b2 100644 --- a/src/shared/weapons/weapon_m60.qc +++ b/src/shared/weapons/weapon_m60.qc @@ -88,9 +88,8 @@ w_m60_wmodel(void) } string -w_m60_pmodel(void) +w_m60_pmodel(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; return (*ary_weaponData[WEAPON_ID::M60]).sPlayerModelPath; } @@ -102,23 +101,21 @@ w_m60_deathmsg(void) } void -w_m60_draw(void) +w_m60_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::M60], arg_thisWeapon); } void -w_m60_holster(void) +w_m60_holster(player pl) { } void -w_m60_primary(void) +w_m60_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -154,15 +151,14 @@ w_m60_primary(void) } void -w_m60_secondary(void) +w_m60_secondary(player pl) { } void -w_m60_reload(void) +w_m60_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_Reload(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::M60], arg_thisWeapon); @@ -170,15 +166,14 @@ w_m60_reload(void) float -w_m60_aimanim(void) +w_m60_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_m60_hud(void) +w_m60_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::M60], arg_thisWeapon); @@ -186,7 +181,7 @@ w_m60_hud(void) } void -w_m60_hudpic(int selected, vector pos, float a) +w_m60_hudpic(player pl, int selected, vector pos, float a) { // } @@ -205,7 +200,7 @@ weapon_t w_m60 = .secondary = w_m60_secondary, .reload = w_m60_reload, .release = NULL, - .crosshair = w_m60_hud, + .postdraw = w_m60_hud, .precache = w_m60_precache, .pickup = NULL, .updateammo = w_m60_updateammo, diff --git a/src/shared/weapons/weapon_m61grenade.qc b/src/shared/weapons/weapon_m61grenade.qc index 0a891b9..5f38936 100644 --- a/src/shared/weapons/weapon_m61grenade.qc +++ b/src/shared/weapons/weapon_m61grenade.qc @@ -259,7 +259,7 @@ w_m61grenade_wmodel(void) } string -w_m61grenade_pmodel(void) +w_m61grenade_pmodel(player pl) { return (*ary_weaponData[WEAPON_ID::M61GRENADE]).sPlayerModelPath; } @@ -271,9 +271,8 @@ w_m61grenade_deathmsg(void) } void -w_m61grenade_draw(void) +w_m61grenade_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; printfline("I set grenadeFireIndex to 0, A!"); @@ -285,49 +284,46 @@ w_m61grenade_draw(void) } void -w_m61grenade_holster(void) +w_m61grenade_holster(player pl) { } void -w_m61grenade_primary(void) +w_m61grenade_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_grenade_onInputPress(pl, arg_thisWeapon, BITS_AKIMBOCHOICE_LEFT); } void -w_m61grenade_secondary(void) +w_m61grenade_secondary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_grenade_onInputPress(pl, arg_thisWeapon, BITS_AKIMBOCHOICE_RIGHT); } void -w_m61grenade_reload(void) +w_m61grenade_reload(player pl) { } float -w_m61grenade_aimanim(void) +w_m61grenade_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_m61grenade_hud(void) +w_m61grenade_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_throwable_onDrawHUD(pl, (weapondata_throwable_t*)ary_weaponData[WEAPON_ID::M61GRENADE], arg_thisWeapon); } void -w_m61grenade_hudpic(int selected, vector pos, float a) +w_m61grenade_hudpic(player pl, int selected, vector pos, float a) { // } @@ -347,7 +343,7 @@ weapon_t w_m61grenade = .secondary = w_m61grenade_secondary, .reload = w_m61grenade_reload, .release = NULL, - .crosshair = w_m61grenade_hud, + .postdraw = w_m61grenade_hud, .precache = w_m61grenade_precache, .pickup = NULL, .updateammo = w_m61grenade_updateammo, diff --git a/src/shared/weapons/weapon_mac10.qc b/src/shared/weapons/weapon_mac10.qc index dd7d462..12857d4 100644 --- a/src/shared/weapons/weapon_mac10.qc +++ b/src/shared/weapons/weapon_mac10.qc @@ -114,10 +114,9 @@ w_mac10_wmodel(void) } string -w_mac10_pmodel(void) +w_mac10_pmodel(player pl) { // Do we have the silencer? - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ return (*ary_weaponData[WEAPON_ID::MAC10]).sPlayerModelPath; @@ -133,23 +132,21 @@ w_mac10_deathmsg(void) } void -w_mac10_draw(void) +w_mac10_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::MAC10], arg_thisWeapon); } void -w_mac10_holster(void) +w_mac10_holster(player pl) { } void -w_mac10_primary(void) +w_mac10_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -222,9 +219,8 @@ w_mac10_primary(void) } void -w_mac10_secondary(void) +w_mac10_secondary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if(pl.w_attack_next > 0){ @@ -239,24 +235,22 @@ w_mac10_secondary(void) void -w_mac10_reload(void) +w_mac10_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_ironsight_Reload(pl, (weapondata_ironsight_t*)ary_weaponData[WEAPON_ID::MAC10], arg_thisWeapon); } float -w_mac10_aimanim(void) +w_mac10_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_mac10_hud(void) +w_mac10_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::MAC10], arg_thisWeapon); @@ -264,7 +258,7 @@ w_mac10_hud(void) } void -w_mac10_hudpic(int selected, vector pos, float a) +w_mac10_hudpic(player pl, int selected, vector pos, float a) { // } @@ -283,7 +277,7 @@ weapon_t w_mac10 = .secondary = w_mac10_secondary, .reload = w_mac10_reload, .release = NULL, - .crosshair = w_mac10_hud, + .postdraw = w_mac10_hud, .precache = w_mac10_precache, .pickup = NULL, .updateammo = w_mac10_updateammo, diff --git a/src/shared/weapons/weapon_miniuzi.qc b/src/shared/weapons/weapon_miniuzi.qc index 1460d19..468efc4 100644 --- a/src/shared/weapons/weapon_miniuzi.qc +++ b/src/shared/weapons/weapon_miniuzi.qc @@ -113,10 +113,9 @@ w_miniuzi_wmodel(void) } string -w_miniuzi_pmodel(void) +w_miniuzi_pmodel(player pl) { // Do we have the silencer? - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ return (*ary_weaponData[WEAPON_ID::MINIUZI]).sPlayerModelPath; @@ -132,24 +131,22 @@ w_miniuzi_deathmsg(void) } void -w_miniuzi_draw(void) +w_miniuzi_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::MINIUZI], arg_thisWeapon); } void -w_miniuzi_holster(void) +w_miniuzi_holster(player pl) { } void -w_miniuzi_primary(void) +w_miniuzi_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -215,9 +212,8 @@ w_miniuzi_primary(void) void -w_miniuzi_secondary(void) +w_miniuzi_secondary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if(pl.w_attack_next > 0){ @@ -231,9 +227,8 @@ w_miniuzi_secondary(void) void -w_miniuzi_reload(void) +w_miniuzi_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_ironsight_Reload(pl, (weapondata_ironsight_t*)ary_weaponData[WEAPON_ID::MINIUZI], arg_thisWeapon); @@ -241,22 +236,21 @@ w_miniuzi_reload(void) } float -w_miniuzi_aimanim(void) +w_miniuzi_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_miniuzi_hud(void) +w_miniuzi_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::MINIUZI], arg_thisWeapon); } void -w_miniuzi_hudpic(int selected, vector pos, float a) +w_miniuzi_hudpic(player pl, int selected, vector pos, float a) { // } @@ -276,7 +270,7 @@ weapon_t w_miniuzi = .secondary = w_miniuzi_secondary, .reload = w_miniuzi_reload, .release = NULL, - .crosshair = w_miniuzi_hud, + .postdraw = w_miniuzi_hud, .precache = w_miniuzi_precache, .pickup = NULL, .updateammo = w_miniuzi_updateammo, diff --git a/src/shared/weapons/weapon_miniuzi_akimbo.qc b/src/shared/weapons/weapon_miniuzi_akimbo.qc index f451a5e..e226c8c 100644 --- a/src/shared/weapons/weapon_miniuzi_akimbo.qc +++ b/src/shared/weapons/weapon_miniuzi_akimbo.qc @@ -107,10 +107,9 @@ w_miniuzi_akimbo_wmodel(void) } string -w_miniuzi_akimbo_pmodel(void) +w_miniuzi_akimbo_pmodel(player pl) { // Do we have the silencer? - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ return (*ary_weaponData[WEAPON_ID::MINIUZI_AKIMBO]).sPlayerModelPath; @@ -126,15 +125,14 @@ w_miniuzi_akimbo_deathmsg(void) } void -w_miniuzi_akimbo_draw(void) +w_miniuzi_akimbo_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::MINIUZI_AKIMBO], arg_thisWeapon); } void -w_miniuzi_akimbo_holster(void) +w_miniuzi_akimbo_holster(player pl) { } @@ -273,7 +271,7 @@ void weapon_miniuzi_akimbo_attack(player pl, weapondynamic_t arg_thisWeapon, int void -w_miniuzi_akimbo_primary(void) +w_miniuzi_akimbo_primary(player pl) { weapon_gun_akimbo_full_primaryAttack(weapon_miniuzi_akimbo_attack); } @@ -281,16 +279,15 @@ w_miniuzi_akimbo_primary(void) void -w_miniuzi_akimbo_secondary(void) +w_miniuzi_akimbo_secondary(player pl) { weapon_gun_akimbo_full_secondaryAttack(weapon_miniuzi_akimbo_attack); } void -w_miniuzi_akimbo_reload(void) +w_miniuzi_akimbo_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_Reload(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::MINIUZI_AKIMBO], arg_thisWeapon); @@ -299,23 +296,22 @@ w_miniuzi_akimbo_reload(void) float -w_miniuzi_akimbo_aimanim(void) +w_miniuzi_akimbo_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_miniuzi_akimbo_hud(void) +w_miniuzi_akimbo_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::MINIUZI_AKIMBO], arg_thisWeapon); } void -w_miniuzi_akimbo_hudpic(int selected, vector pos, float a) +w_miniuzi_akimbo_hudpic(player pl, int selected, vector pos, float a) { // } @@ -335,7 +331,7 @@ weapon_t w_miniuzi_akimbo = .secondary = w_miniuzi_akimbo_secondary, .reload = w_miniuzi_akimbo_reload, .release = NULL, - .crosshair = w_miniuzi_akimbo_hud, + .postdraw = w_miniuzi_akimbo_hud, .precache = w_miniuzi_akimbo_precache, .pickup = NULL, .updateammo = w_miniuzi_akimbo_updateammo, diff --git a/src/shared/weapons/weapon_mossberg500.qc b/src/shared/weapons/weapon_mossberg500.qc index 0c993cc..50c0db3 100644 --- a/src/shared/weapons/weapon_mossberg500.qc +++ b/src/shared/weapons/weapon_mossberg500.qc @@ -133,9 +133,8 @@ w_mossberg500_wmodel(void) } string -w_mossberg500_pmodel(void) +w_mossberg500_pmodel(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; return (*ary_weaponData[WEAPON_ID::MOSSBERG500]).sPlayerModelPath; } @@ -147,9 +146,8 @@ w_mossberg500_deathmsg(void) } void -w_mossberg500_draw(void) +w_mossberg500_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; // not setting shotgun extra data here, done right before reload anims are called @@ -161,15 +159,14 @@ w_mossberg500_draw(void) void -w_mossberg500_holster(void) +w_mossberg500_holster(player pl) { } void -w_mossberg500_primary(void) +w_mossberg500_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if(!weapon_shotgun_onInterrupt(pl, ary_weaponData[WEAPON_ID::MOSSBERG500], arg_thisWeapon)){ @@ -253,9 +250,8 @@ w_mossberg500_primary(void) void -w_mossberg500_secondary(void) +w_mossberg500_secondary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if(pl.w_attack_next > 0){ @@ -276,9 +272,8 @@ w_mossberg500_secondary(void) void -w_mossberg500_reload(void) +w_mossberg500_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if(!arg_thisWeapon.iIronSight){ @@ -291,22 +286,21 @@ w_mossberg500_reload(void) } float -w_mossberg500_aimanim(void) +w_mossberg500_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_mossberg500_hud(void) +w_mossberg500_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::MOSSBERG500], arg_thisWeapon); } void -w_mossberg500_hudpic(int selected, vector pos, float a) +w_mossberg500_hudpic(player pl, int selected, vector pos, float a) { // } @@ -326,7 +320,7 @@ weapon_t w_mossberg500 = .secondary = w_mossberg500_secondary, .reload = w_mossberg500_reload, .release = NULL, - .crosshair = w_mossberg500_hud, + .postdraw = w_mossberg500_hud, .precache = w_mossberg500_precache, .pickup = NULL, .updateammo = w_mossberg500_updateammo, diff --git a/src/shared/weapons/weapon_mp5k.qc b/src/shared/weapons/weapon_mp5k.qc index 36683cc..09b0b29 100644 --- a/src/shared/weapons/weapon_mp5k.qc +++ b/src/shared/weapons/weapon_mp5k.qc @@ -111,10 +111,9 @@ w_mp5k_wmodel(void) } string -w_mp5k_pmodel(void) +w_mp5k_pmodel(player pl) { // Do we have the silencer? - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ return (*ary_weaponData[WEAPON_ID::MP5K]).sPlayerModelPath; @@ -130,23 +129,21 @@ w_mp5k_deathmsg(void) } void -w_mp5k_draw(void) +w_mp5k_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::MP5K], arg_thisWeapon); } void -w_mp5k_holster(void) +w_mp5k_holster(player pl) { } void -w_mp5k_primary(void) +w_mp5k_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -225,9 +222,8 @@ w_mp5k_primary(void) } void -w_mp5k_secondary(void) +w_mp5k_secondary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; INPUT_SECONDARY_TAP_GATE @@ -248,24 +244,22 @@ w_mp5k_secondary(void) void -w_mp5k_reload(void) +w_mp5k_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_ironsight_Reload(pl, (weapondata_ironsight_t*)ary_weaponData[WEAPON_ID::MP5K], arg_thisWeapon); } float -w_mp5k_aimanim(void) +w_mp5k_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_mp5k_hud(void) +w_mp5k_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::MP5K], arg_thisWeapon); @@ -273,7 +267,7 @@ w_mp5k_hud(void) } void -w_mp5k_hudpic(int selected, vector pos, float a) +w_mp5k_hudpic(player pl, int selected, vector pos, float a) { // } @@ -292,7 +286,7 @@ weapon_t w_mp5k = .secondary = w_mp5k_secondary, .reload = w_mp5k_reload, .release = NULL, - .crosshair = w_mp5k_hud, + .postdraw = w_mp5k_hud, .precache = w_mp5k_precache, .pickup = NULL, .updateammo = w_mp5k_updateammo, diff --git a/src/shared/weapons/weapon_mp5sd.qc b/src/shared/weapons/weapon_mp5sd.qc index c07e55c..7efd10f 100644 --- a/src/shared/weapons/weapon_mp5sd.qc +++ b/src/shared/weapons/weapon_mp5sd.qc @@ -94,11 +94,10 @@ w_mp5sd_wmodel(void) } string -w_mp5sd_pmodel(void) +w_mp5sd_pmodel(player pl) { // Do we have the silencer? // Oh. Guaranteed for the mp5. Oh well. - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; //if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ // return (*ary_weaponData[WEAPON_ID::MP5SD]).sPlayerModelPath; @@ -114,23 +113,21 @@ w_mp5sd_deathmsg(void) } void -w_mp5sd_draw(void) +w_mp5sd_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::MP5SD], arg_thisWeapon); } void -w_mp5sd_holster(void) +w_mp5sd_holster(player pl) { } void -w_mp5sd_primary(void) +w_mp5sd_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -195,9 +192,8 @@ w_mp5sd_primary(void) } void -w_mp5sd_secondary(void) +w_mp5sd_secondary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; INPUT_SECONDARY_TAP_GATE @@ -212,24 +208,22 @@ w_mp5sd_secondary(void) void -w_mp5sd_reload(void) +w_mp5sd_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_Reload(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::MP5SD], arg_thisWeapon); } float -w_mp5sd_aimanim(void) +w_mp5sd_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_mp5sd_hud(void) +w_mp5sd_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::MP5SD], arg_thisWeapon); @@ -237,7 +231,7 @@ w_mp5sd_hud(void) } void -w_mp5sd_hudpic(int selected, vector pos, float a) +w_mp5sd_hudpic(player pl, int selected, vector pos, float a) { // } @@ -256,7 +250,7 @@ weapon_t w_mp5sd = .secondary = w_mp5sd_secondary, .reload = w_mp5sd_reload, .release = NULL, - .crosshair = w_mp5sd_hud, + .postdraw = w_mp5sd_hud, .precache = w_mp5sd_precache, .pickup = NULL, .updateammo = w_mp5sd_updateammo, diff --git a/src/shared/weapons/weapon_ragingbull.qc b/src/shared/weapons/weapon_ragingbull.qc index 4310b25..8afbd84 100644 --- a/src/shared/weapons/weapon_ragingbull.qc +++ b/src/shared/weapons/weapon_ragingbull.qc @@ -98,9 +98,8 @@ w_ragingbull_wmodel(void) } string -w_ragingbull_pmodel(void) +w_ragingbull_pmodel(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; return (*ary_weaponData[WEAPON_ID::RAGINGBULL]).sPlayerModelPath; } @@ -112,23 +111,21 @@ w_ragingbull_deathmsg(void) } void -w_ragingbull_draw(void) +w_ragingbull_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::RAGINGBULL], arg_thisWeapon); } void -w_ragingbull_holster(void) +w_ragingbull_holster(player pl) { } void -w_ragingbull_primary(void) +w_ragingbull_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -169,9 +166,8 @@ w_ragingbull_primary(void) } void -w_ragingbull_secondary(void) +w_ragingbull_secondary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; INPUT_SECONDARY_TAP_GATE @@ -186,24 +182,22 @@ w_ragingbull_secondary(void) void -w_ragingbull_reload(void) +w_ragingbull_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_Reload(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::RAGINGBULL], arg_thisWeapon); } float -w_ragingbull_aimanim(void) +w_ragingbull_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_ragingbull_hud(void) +w_ragingbull_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::RAGINGBULL], arg_thisWeapon); @@ -211,7 +205,7 @@ w_ragingbull_hud(void) } void -w_ragingbull_hudpic(int selected, vector pos, float a) +w_ragingbull_hudpic(player pl, int selected, vector pos, float a) { // } @@ -230,7 +224,7 @@ weapon_t w_ragingbull = .secondary = w_ragingbull_secondary, .reload = w_ragingbull_reload, .release = NULL, - .crosshair = w_ragingbull_hud, + .postdraw = w_ragingbull_hud, .precache = w_ragingbull_precache, .pickup = NULL, .updateammo = w_ragingbull_updateammo, diff --git a/src/shared/weapons/weapon_rugermk1.qc b/src/shared/weapons/weapon_rugermk1.qc index 4a3720f..037a46f 100644 --- a/src/shared/weapons/weapon_rugermk1.qc +++ b/src/shared/weapons/weapon_rugermk1.qc @@ -89,10 +89,9 @@ w_rugermk1_wmodel(void) } string -w_rugermk1_pmodel(void) +w_rugermk1_pmodel(player pl) { // Do we have the silencer? Yes, forced in fact - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; //if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ return (*ary_weaponData[WEAPON_ID::RUGERMK1]).sPlayerModelPath; @@ -108,23 +107,21 @@ w_rugermk1_deathmsg(void) } void -w_rugermk1_draw(void) +w_rugermk1_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::RUGERMK1], arg_thisWeapon); } void -w_rugermk1_holster(void) +w_rugermk1_holster(player pl) { } void -w_rugermk1_primary(void) +w_rugermk1_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -165,30 +162,28 @@ w_rugermk1_primary(void) } void -w_rugermk1_secondary(void) +w_rugermk1_secondary(player pl) { } void -w_rugermk1_reload(void) +w_rugermk1_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_Reload(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::RUGERMK1], arg_thisWeapon); } float -w_rugermk1_aimanim(void) +w_rugermk1_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_rugermk1_hud(void) +w_rugermk1_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::RUGERMK1], arg_thisWeapon); @@ -196,7 +191,7 @@ w_rugermk1_hud(void) } void -w_rugermk1_hudpic(int selected, vector pos, float a) +w_rugermk1_hudpic(player pl, int selected, vector pos, float a) { // } @@ -215,7 +210,7 @@ weapon_t w_rugermk1 = .secondary = w_rugermk1_secondary, .reload = w_rugermk1_reload, .release = NULL, - .crosshair = w_rugermk1_hud, + .postdraw = w_rugermk1_hud, .precache = w_rugermk1_precache, .pickup = NULL, .updateammo = w_rugermk1_updateammo, diff --git a/src/shared/weapons/weapon_sawedoff.qc b/src/shared/weapons/weapon_sawedoff.qc index 9033e38..d6eb31b 100644 --- a/src/shared/weapons/weapon_sawedoff.qc +++ b/src/shared/weapons/weapon_sawedoff.qc @@ -136,9 +136,8 @@ w_sawedoff_wmodel(void) } string -w_sawedoff_pmodel(void) +w_sawedoff_pmodel(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; return (*ary_weaponData[WEAPON_ID::SAWEDOFF]).sPlayerModelPath; } @@ -151,23 +150,21 @@ w_sawedoff_deathmsg(void) void -w_sawedoff_draw(void) +w_sawedoff_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::SAWEDOFF], arg_thisWeapon); } void -w_sawedoff_holster(void) +w_sawedoff_holster(player pl) { } void -w_sawedoff_primary(void) +w_sawedoff_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -219,20 +216,18 @@ w_sawedoff_primary(void) void -w_sawedoff_secondary(void) +w_sawedoff_secondary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_ironsight_ToggleIronsight(pl, (weapondata_ironsight_t*)ary_weaponData[WEAPON_ID::SAWEDOFF], arg_thisWeapon); } // need custom reload logic, works more like a typical weapon void -w_sawedoff_reload(void) +w_sawedoff_reload(player pl) { int reloadSeq; float reloadDur; - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; //weapon_ironsight_Reload(pl, (weapondata_ironsight_t*)ary_weaponData[WEAPON_ID::SAWEDOFF], arg_thisWeapon); @@ -261,22 +256,21 @@ w_sawedoff_reload(void) } float -w_sawedoff_aimanim(void) +w_sawedoff_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_sawedoff_hud(void) +w_sawedoff_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::SAWEDOFF], arg_thisWeapon); } void -w_sawedoff_hudpic(int selected, vector pos, float a) +w_sawedoff_hudpic(player pl, int selected, vector pos, float a) { // } @@ -296,7 +290,7 @@ weapon_t w_sawedoff = .secondary = w_sawedoff_secondary, .reload = w_sawedoff_reload, .release = NULL, - .crosshair = w_sawedoff_hud, + .postdraw = w_sawedoff_hud, .precache = w_sawedoff_precache, .pickup = NULL, .updateammo = w_sawedoff_updateammo, diff --git a/src/shared/weapons/weapon_sealknife.qc b/src/shared/weapons/weapon_sealknife.qc index df761a5..0ad5ed9 100644 --- a/src/shared/weapons/weapon_sealknife.qc +++ b/src/shared/weapons/weapon_sealknife.qc @@ -81,7 +81,7 @@ w_sealknife_wmodel(void) } string -w_sealknife_pmodel(void) +w_sealknife_pmodel(player pl) { return (*ary_weaponData[WEAPON_ID::SEALKNIFE]).sPlayerModelPath; } @@ -93,24 +93,22 @@ w_sealknife_deathmsg(void) } void -w_sealknife_draw(void) +w_sealknife_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::SEALKNIFE], arg_thisWeapon); } void -w_sealknife_holster(void) +w_sealknife_holster(player pl) { } void -w_sealknife_primary(void) +w_sealknife_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -154,9 +152,8 @@ w_sealknife_primary(void) void -w_sealknife_secondary(void) +w_sealknife_secondary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -196,28 +193,27 @@ w_sealknife_secondary(void) void -w_sealknife_reload(void) +w_sealknife_reload(player pl) { // how do you reload a sword } float -w_sealknife_aimanim(void) +w_sealknife_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_sealknife_hud(void) +w_sealknife_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_throwable_onDrawHUD(pl, (weapondata_throwable_t*)ary_weaponData[WEAPON_ID::SEALKNIFE], arg_thisWeapon); } void -w_sealknife_hudpic(int selected, vector pos, float a) +w_sealknife_hudpic(player pl, int selected, vector pos, float a) { // } @@ -237,7 +233,7 @@ weapon_t w_sealknife = .secondary = w_sealknife_secondary, .reload = w_sealknife_reload, .release = NULL, - .crosshair = w_sealknife_hud, + .postdraw = w_sealknife_hud, .precache = w_sealknife_precache, .pickup = NULL, .updateammo = w_sealknife_updateammo, diff --git a/src/shared/weapons/weapon_skorpion.qc b/src/shared/weapons/weapon_skorpion.qc index d039498..96c8682 100644 --- a/src/shared/weapons/weapon_skorpion.qc +++ b/src/shared/weapons/weapon_skorpion.qc @@ -89,9 +89,8 @@ w_skorpion_wmodel(void) } string -w_skorpion_pmodel(void) +w_skorpion_pmodel(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; return (*ary_weaponData[WEAPON_ID::SKORPION]).sPlayerModelPath; } @@ -103,23 +102,21 @@ w_skorpion_deathmsg(void) } void -w_skorpion_draw(void) +w_skorpion_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::SKORPION], arg_thisWeapon); } void -w_skorpion_holster(void) +w_skorpion_holster(player pl) { } void -w_skorpion_primary(void) +w_skorpion_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -162,36 +159,34 @@ w_skorpion_primary(void) void -w_skorpion_secondary(void) +w_skorpion_secondary(player pl) { } void -w_skorpion_reload(void) +w_skorpion_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_Reload(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::SKORPION], arg_thisWeapon); } float -w_skorpion_aimanim(void) +w_skorpion_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_skorpion_hud(void) +w_skorpion_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::SKORPION], arg_thisWeapon); } void -w_skorpion_hudpic(int selected, vector pos, float a) +w_skorpion_hudpic(player pl, int selected, vector pos, float a) { // } @@ -211,7 +206,7 @@ weapon_t w_skorpion = .secondary = w_skorpion_secondary, .reload = w_skorpion_reload, .release = NULL, - .crosshair = w_skorpion_hud, + .postdraw = w_skorpion_hud, .precache = w_skorpion_precache, .pickup = NULL, .updateammo = w_skorpion_updateammo, diff --git a/src/shared/weapons/weapon_skorpion_akimbo.qc b/src/shared/weapons/weapon_skorpion_akimbo.qc index 43cb976..acf730c 100644 --- a/src/shared/weapons/weapon_skorpion_akimbo.qc +++ b/src/shared/weapons/weapon_skorpion_akimbo.qc @@ -87,9 +87,8 @@ w_skorpion_akimbo_wmodel(void) } string -w_skorpion_akimbo_pmodel(void) +w_skorpion_akimbo_pmodel(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; return (*ary_weaponData[WEAPON_ID::SKORPION_AKIMBO]).sPlayerModelPath; } @@ -101,15 +100,14 @@ w_skorpion_akimbo_deathmsg(void) } void -w_skorpion_akimbo_draw(void) +w_skorpion_akimbo_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::SKORPION_AKIMBO], arg_thisWeapon); } void -w_skorpion_akimbo_holster(void) +w_skorpion_akimbo_holster(player pl) { } @@ -232,7 +230,7 @@ void weapon_skorpion_akimbo_attack(player pl, weapondynamic_t arg_thisWeapon, in void -w_skorpion_akimbo_primary(void) +w_skorpion_akimbo_primary(player pl) { weapon_gun_akimbo_full_primaryAttack(weapon_skorpion_akimbo_attack); } @@ -240,37 +238,35 @@ w_skorpion_akimbo_primary(void) void -w_skorpion_akimbo_secondary(void) +w_skorpion_akimbo_secondary(player pl) { weapon_gun_akimbo_full_secondaryAttack(weapon_skorpion_akimbo_attack); } void -w_skorpion_akimbo_reload(void) +w_skorpion_akimbo_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_Reload(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::SKORPION_AKIMBO], arg_thisWeapon); } float -w_skorpion_akimbo_aimanim(void) +w_skorpion_akimbo_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_skorpion_akimbo_hud(void) +w_skorpion_akimbo_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::SKORPION_AKIMBO], arg_thisWeapon); } void -w_skorpion_akimbo_hudpic(int selected, vector pos, float a) +w_skorpion_akimbo_hudpic(player pl, int selected, vector pos, float a) { // } @@ -290,7 +286,7 @@ weapon_t w_skorpion_akimbo = .secondary = w_skorpion_akimbo_secondary, .reload = w_skorpion_akimbo_reload, .release = NULL, - .crosshair = w_skorpion_akimbo_hud, + .postdraw = w_skorpion_akimbo_hud, .precache = w_skorpion_akimbo_precache, .pickup = NULL, .updateammo = w_skorpion_akimbo_updateammo, @@ -300,4 +296,4 @@ weapon_t w_skorpion_akimbo = .aimanim = w_skorpion_akimbo_aimanim, .hudpic = NULL -}; \ No newline at end of file +}; diff --git a/src/shared/weapons/weapon_socommk23.qc b/src/shared/weapons/weapon_socommk23.qc index c508fbc..d1afad7 100644 --- a/src/shared/weapons/weapon_socommk23.qc +++ b/src/shared/weapons/weapon_socommk23.qc @@ -108,10 +108,9 @@ w_socommk23_wmodel(void) } string -w_socommk23_pmodel(void) +w_socommk23_pmodel(player pl) { // Do we have the silencer? - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ return (*ary_weaponData[WEAPON_ID::SOCOMMK23]).sPlayerModelPath; @@ -127,9 +126,8 @@ w_socommk23_deathmsg(void) } void -w_socommk23_draw(void) +w_socommk23_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapondata_basic_t* basicP = ary_weaponData[WEAPON_ID::SOCOMMK23]; @@ -138,15 +136,14 @@ w_socommk23_draw(void) void -w_socommk23_holster(void) +w_socommk23_holster(player pl) { } void -w_socommk23_primary(void) +w_socommk23_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -207,9 +204,8 @@ w_socommk23_primary(void) void -w_socommk23_secondary(void) +w_socommk23_secondary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if(pl.w_attack_next > 0){ @@ -224,30 +220,28 @@ w_socommk23_secondary(void) void -w_socommk23_reload(void) +w_socommk23_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_ironsight_Reload(pl, (weapondata_ironsight_t*)ary_weaponData[WEAPON_ID::SOCOMMK23], arg_thisWeapon); } float -w_socommk23_aimanim(void) +w_socommk23_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_socommk23_hud(void) +w_socommk23_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::SOCOMMK23], arg_thisWeapon); } void -w_socommk23_hudpic(int selected, vector pos, float a) +w_socommk23_hudpic(player pl, int selected, vector pos, float a) { // } @@ -266,7 +260,7 @@ weapon_t w_socommk23 = .secondary = w_socommk23_secondary, .reload = w_socommk23_reload, .release = NULL, - .crosshair = w_socommk23_hud, + .postdraw = w_socommk23_hud, .precache = w_socommk23_precache, .pickup = NULL, .updateammo = w_socommk23_updateammo, diff --git a/src/shared/weapons/weapon_socommk23_akimbo.qc b/src/shared/weapons/weapon_socommk23_akimbo.qc index 80ad630..6f66898 100644 --- a/src/shared/weapons/weapon_socommk23_akimbo.qc +++ b/src/shared/weapons/weapon_socommk23_akimbo.qc @@ -115,10 +115,9 @@ w_socommk23_akimbo_wmodel(void) } string -w_socommk23_akimbo_pmodel(void) +w_socommk23_akimbo_pmodel(player pl) { // Do we have the silencer? - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ return (*ary_weaponData[WEAPON_ID::SOCOMMK23_AKIMBO]).sPlayerModelPath; @@ -134,15 +133,14 @@ w_socommk23_akimbo_deathmsg(void) } void -w_socommk23_akimbo_draw(void) +w_socommk23_akimbo_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::SOCOMMK23_AKIMBO], arg_thisWeapon); } void -w_socommk23_akimbo_holster(void) +w_socommk23_akimbo_holster(player pl) { } @@ -330,23 +328,22 @@ void weapon_socommk23_akimbo_attack(player pl, weapondynamic_t arg_thisWeapon, i void -w_socommk23_akimbo_primary(void) +w_socommk23_akimbo_primary(player pl) { weapon_gun_akimbo_semi_primaryAttack(weapon_socommk23_akimbo_attack); } void -w_socommk23_akimbo_secondary(void) +w_socommk23_akimbo_secondary(player pl) { weapon_ironsight_akimbo_semi_secondaryAttack(weapon_socommk23_akimbo_attack, WEAPON_ID::SOCOMMK23_AKIMBO); } void -w_socommk23_akimbo_reload(void) +w_socommk23_akimbo_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_ironsight_Reload(pl, (weapondata_ironsight_t*)ary_weaponData[WEAPON_ID::SOCOMMK23_AKIMBO], arg_thisWeapon); @@ -355,21 +352,20 @@ w_socommk23_akimbo_reload(void) } float -w_socommk23_akimbo_aimanim(void) +w_socommk23_akimbo_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_socommk23_akimbo_hud(void) +w_socommk23_akimbo_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::SOCOMMK23_AKIMBO], arg_thisWeapon); } void -w_socommk23_akimbo_hudpic(int selected, vector pos, float a) +w_socommk23_akimbo_hudpic(player pl, int selected, vector pos, float a) { // } @@ -389,7 +385,7 @@ weapon_t w_socommk23_akimbo = .secondary = w_socommk23_akimbo_secondary, .reload = w_socommk23_akimbo_reload, .release = NULL, - .crosshair = w_socommk23_akimbo_hud, + .postdraw = w_socommk23_akimbo_hud, .precache = w_socommk23_akimbo_precache, .pickup = NULL, .updateammo = w_socommk23_akimbo_updateammo, diff --git a/src/shared/weapons/weapon_spas12.qc b/src/shared/weapons/weapon_spas12.qc index 017cbaa..e7d26de 100644 --- a/src/shared/weapons/weapon_spas12.qc +++ b/src/shared/weapons/weapon_spas12.qc @@ -107,9 +107,8 @@ w_spas12_wmodel(void) } string -w_spas12_pmodel(void) +w_spas12_pmodel(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; return (*ary_weaponData[WEAPON_ID::SPAS12]).sPlayerModelPath; } @@ -121,9 +120,8 @@ w_spas12_deathmsg(void) } void -w_spas12_draw(void) +w_spas12_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; pl.iShotgunExtraDataID = SHOTGUN_EXTRA_ID::SPAS12; @@ -132,15 +130,14 @@ w_spas12_draw(void) } void -w_spas12_holster(void) +w_spas12_holster(player pl) { } void -w_spas12_primary(void) +w_spas12_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if(!weapon_shotgun_onInterrupt(pl, ary_weaponData[WEAPON_ID::SPAS12], arg_thisWeapon)){ @@ -223,37 +220,35 @@ w_spas12_primary(void) void -w_spas12_secondary(void) +w_spas12_secondary(player pl) { } void -w_spas12_reload(void) +w_spas12_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_shotgun_reload(pl, ary_weaponData[WEAPON_ID::SPAS12], arg_thisWeapon); } float -w_spas12_aimanim(void) +w_spas12_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_spas12_hud(void) +w_spas12_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::SPAS12], arg_thisWeapon); } void -w_spas12_hudpic(int selected, vector pos, float a) +w_spas12_hudpic(player pl, int selected, vector pos, float a) { // } @@ -273,7 +268,7 @@ weapon_t w_spas12 = .secondary = w_spas12_secondary, .reload = w_spas12_reload, .release = NULL, - .crosshair = w_spas12_hud, + .postdraw = w_spas12_hud, .precache = w_spas12_precache, .pickup = NULL, .updateammo = w_spas12_updateammo, diff --git a/src/shared/weapons/weapon_steyraug.qc b/src/shared/weapons/weapon_steyraug.qc index 5fa7891..92b574f 100644 --- a/src/shared/weapons/weapon_steyraug.qc +++ b/src/shared/weapons/weapon_steyraug.qc @@ -96,10 +96,9 @@ w_steyraug_wmodel(void) } string -w_steyraug_pmodel(void) +w_steyraug_pmodel(player pl) { // Do we have the silencer? - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ return (*ary_weaponData[WEAPON_ID::STEYRAUG]).sPlayerModelPath; @@ -115,23 +114,21 @@ w_steyraug_deathmsg(void) } void -w_steyraug_draw(void) +w_steyraug_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::STEYRAUG], arg_thisWeapon); } void -w_steyraug_holster(void) +w_steyraug_holster(player pl) { } void -w_steyraug_primary(void) +w_steyraug_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -174,9 +171,8 @@ w_steyraug_primary(void) } void -w_steyraug_secondary(void) +w_steyraug_secondary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; INPUT_SECONDARY_TAP_GATE @@ -191,24 +187,22 @@ w_steyraug_secondary(void) void -w_steyraug_reload(void) +w_steyraug_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_Reload(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::STEYRAUG], arg_thisWeapon); } float -w_steyraug_aimanim(void) +w_steyraug_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_steyraug_hud(void) +w_steyraug_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::STEYRAUG], arg_thisWeapon); @@ -216,7 +210,7 @@ w_steyraug_hud(void) } void -w_steyraug_hudpic(int selected, vector pos, float a) +w_steyraug_hudpic(player pl, int selected, vector pos, float a) { // } @@ -235,7 +229,7 @@ weapon_t w_steyraug = .secondary = w_steyraug_secondary, .reload = w_steyraug_reload, .release = NULL, - .crosshair = w_steyraug_hud, + .postdraw = w_steyraug_hud, .precache = w_steyraug_precache, .pickup = NULL, .updateammo = w_steyraug_updateammo, diff --git a/src/shared/weapons/weapon_steyrtmp.qc b/src/shared/weapons/weapon_steyrtmp.qc index c8c1060..11ed1f4 100644 --- a/src/shared/weapons/weapon_steyrtmp.qc +++ b/src/shared/weapons/weapon_steyrtmp.qc @@ -106,10 +106,9 @@ w_steyrtmp_wmodel(void) } string -w_steyrtmp_pmodel(void) +w_steyrtmp_pmodel(player pl) { // Do we have the silencer? - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ return (*ary_weaponData[WEAPON_ID::STEYRTMP]).sPlayerModelPath; @@ -125,23 +124,21 @@ w_steyrtmp_deathmsg(void) } void -w_steyrtmp_draw(void) +w_steyrtmp_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::STEYRTMP], arg_thisWeapon); } void -w_steyrtmp_holster(void) +w_steyrtmp_holster(player pl) { } void -w_steyrtmp_primary(void) +w_steyrtmp_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -200,9 +197,8 @@ w_steyrtmp_primary(void) } void -w_steyrtmp_secondary(void) +w_steyrtmp_secondary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if(pl.w_attack_next > 0){ @@ -217,24 +213,22 @@ w_steyrtmp_secondary(void) void -w_steyrtmp_reload(void) +w_steyrtmp_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_ironsight_Reload(pl, (weapondata_ironsight_t*)ary_weaponData[WEAPON_ID::STEYRTMP], arg_thisWeapon); } float -w_steyrtmp_aimanim(void) +w_steyrtmp_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_steyrtmp_hud(void) +w_steyrtmp_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::STEYRTMP], arg_thisWeapon); @@ -242,7 +236,7 @@ w_steyrtmp_hud(void) } void -w_steyrtmp_hudpic(int selected, vector pos, float a) +w_steyrtmp_hudpic(player pl, int selected, vector pos, float a) { // } @@ -261,7 +255,7 @@ weapon_t w_steyrtmp = .secondary = w_steyrtmp_secondary, .reload = w_steyrtmp_reload, .release = NULL, - .crosshair = w_steyrtmp_hud, + .postdraw = w_steyrtmp_hud, .precache = w_steyrtmp_precache, .pickup = NULL, .updateammo = w_steyrtmp_updateammo, diff --git a/src/shared/weapons/weapon_ump.qc b/src/shared/weapons/weapon_ump.qc index 8fb25c7..1135879 100644 --- a/src/shared/weapons/weapon_ump.qc +++ b/src/shared/weapons/weapon_ump.qc @@ -100,10 +100,9 @@ w_ump_wmodel(void) } string -w_ump_pmodel(void) +w_ump_pmodel(player pl) { // Do we have the silencer? - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if(!(arg_thisWeapon.iBitsUpgrade & BITS_WEAPONOPT_SILENCER) ){ return (*ary_weaponData[WEAPON_ID::UMP]).sPlayerModelPath; @@ -119,23 +118,21 @@ w_ump_deathmsg(void) } void -w_ump_draw(void) +w_ump_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_base_onEquip(pl, ary_weaponData[WEAPON_ID::UMP], arg_thisWeapon); } void -w_ump_holster(void) +w_ump_holster(player pl) { } void -w_ump_primary(void) +w_ump_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -185,9 +182,8 @@ w_ump_primary(void) } void -w_ump_secondary(void) +w_ump_secondary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; INPUT_SECONDARY_TAP_GATE @@ -202,24 +198,22 @@ w_ump_secondary(void) void -w_ump_reload(void) +w_ump_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_Reload(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::UMP], arg_thisWeapon); } float -w_ump_aimanim(void) +w_ump_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_ump_hud(void) +w_ump_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::UMP], arg_thisWeapon); @@ -227,7 +221,7 @@ w_ump_hud(void) } void -w_ump_hudpic(int selected, vector pos, float a) +w_ump_hudpic(player pl, int selected, vector pos, float a) { // } @@ -246,7 +240,7 @@ weapon_t w_ump = .secondary = w_ump_secondary, .reload = w_ump_reload, .release = NULL, - .crosshair = w_ump_hud, + .postdraw = w_ump_hud, .precache = w_ump_precache, .pickup = NULL, .updateammo = w_ump_updateammo, diff --git a/src/shared/weapons/weapon_usas12.qc b/src/shared/weapons/weapon_usas12.qc index 489d372..cb98378 100644 --- a/src/shared/weapons/weapon_usas12.qc +++ b/src/shared/weapons/weapon_usas12.qc @@ -87,9 +87,8 @@ w_usas12_wmodel(void) } string -w_usas12_pmodel(void) +w_usas12_pmodel(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; return (*ary_weaponData[WEAPON_ID::USAS12]).sPlayerModelPath; } @@ -101,9 +100,8 @@ w_usas12_deathmsg(void) } void -w_usas12_draw(void) +w_usas12_draw(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapondata_basic_t* basicP = ary_weaponData[WEAPON_ID::USAS12]; @@ -112,15 +110,14 @@ w_usas12_draw(void) void -w_usas12_holster(void) +w_usas12_holster(player pl) { } void -w_usas12_primary(void) +w_usas12_primary(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; if (pl.w_attack_next > 0.0) { @@ -151,35 +148,33 @@ w_usas12_primary(void) } void -w_usas12_secondary(void) +w_usas12_secondary(player pl) { } void -w_usas12_reload(void) +w_usas12_reload(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_Reload(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::USAS12], arg_thisWeapon); } float -w_usas12_aimanim(void) +w_usas12_aimanim(player pl) { return self.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND; } void -w_usas12_hud(void) +w_usas12_hud(player pl) { - player pl = (player)self; weapondynamic_t arg_thisWeapon = pl.ary_myWeapons[pl.inventoryEquippedIndex]; weapon_gun_onDrawHUD(pl, (weapondata_gun_t*)ary_weaponData[WEAPON_ID::USAS12], arg_thisWeapon); } void -w_usas12_hudpic(int selected, vector pos, float a) +w_usas12_hudpic(player pl, int selected, vector pos, float a) { // } @@ -198,7 +193,7 @@ weapon_t w_usas12 = .secondary = w_usas12_secondary, .reload = w_usas12_reload, .release = NULL, - .crosshair = w_usas12_hud, + .postdraw = w_usas12_hud, .precache = w_usas12_precache, .pickup = NULL, .updateammo = w_usas12_updateammo,