From 92ac106b5da4ba32817713084898f741280e80eb Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Sun, 13 Mar 2022 16:58:38 -0700 Subject: [PATCH] Update copyright information Remove pmodel attributes from the player class. Fix shotgun and DML menu. Add fix for the gauss-pistol triggering a client-side fire upon closing the menu. --- src/client/decore.qc | 2 +- src/client/entities.qc | 2 +- src/client/hud.qc | 2 +- src/client/hud_weaponselect.qc | 2 +- src/client/init.qc | 2 +- src/server/gamerules.qc | 2 +- src/server/gamerules_multiplayer.qc | 2 +- src/server/gunman_cycler.qc | 2 +- src/server/hologram_damage.qc | 2 +- src/server/monster_human_bandit.qc | 2 +- src/server/monster_human_chopper.qc | 2 +- src/server/monster_human_demoman.qc | 2 +- src/server/monster_human_gunman.qc | 2 +- src/server/monster_human_unarmed.qc | 2 +- src/server/monster_trainingbot.qc | 2 +- src/server/progs.src | 1 + src/shared/fx_gaussbeam.qc | 2 +- src/shared/input.qc | 2 +- src/shared/items.h | 2 +- src/shared/player.qc | 8 +------- src/shared/w_aicore.qc | 8 ++++++-- src/shared/w_beamgun.qc | 8 ++++++-- src/shared/w_chemicalgun.qc | 8 ++++++-- src/shared/w_dml.qc | 16 +++++++++------ src/shared/w_fists.qc | 12 +++++++---- src/shared/w_gausspistol.qc | 27 ++++++++++++++++-------- src/shared/w_grenade.qc | 8 ++++++-- src/shared/w_minigun.qc | 5 ++++- src/shared/w_shotgun.qc | 9 +++++--- src/shared/weapons.h | 32 ++++++++++++++++++++++++++++- src/shared/weapons.qc | 2 +- 31 files changed, 123 insertions(+), 57 deletions(-) diff --git a/src/client/decore.qc b/src/client/decore.qc index cf0f73b..aba3191 100644 --- a/src/client/decore.qc +++ b/src/client/decore.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/client/entities.qc b/src/client/entities.qc index 1b647c6..6fdc5e4 100644 --- a/src/client/entities.qc +++ b/src/client/entities.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/client/hud.qc b/src/client/hud.qc index 9d4042b..0449aff 100644 --- a/src/client/hud.qc +++ b/src/client/hud.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/client/hud_weaponselect.qc b/src/client/hud_weaponselect.qc index 27f276f..18efd43 100644 --- a/src/client/hud_weaponselect.qc +++ b/src/client/hud_weaponselect.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/client/init.qc b/src/client/init.qc index aec714d..0392de2 100644 --- a/src/client/init.qc +++ b/src/client/init.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/server/gamerules.qc b/src/server/gamerules.qc index 8b1cd57..f2acd03 100644 --- a/src/server/gamerules.qc +++ b/src/server/gamerules.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/server/gamerules_multiplayer.qc b/src/server/gamerules_multiplayer.qc index 9a8eeb9..ab698e9 100644 --- a/src/server/gamerules_multiplayer.qc +++ b/src/server/gamerules_multiplayer.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/server/gunman_cycler.qc b/src/server/gunman_cycler.qc index ee79039..7eb4b2b 100644 --- a/src/server/gunman_cycler.qc +++ b/src/server/gunman_cycler.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/server/hologram_damage.qc b/src/server/hologram_damage.qc index 75be84a..35f6b9e 100644 --- a/src/server/hologram_damage.qc +++ b/src/server/hologram_damage.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/server/monster_human_bandit.qc b/src/server/monster_human_bandit.qc index 97d05f4..a990397 100644 --- a/src/server/monster_human_bandit.qc +++ b/src/server/monster_human_bandit.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/server/monster_human_chopper.qc b/src/server/monster_human_chopper.qc index aaa563e..64e5135 100644 --- a/src/server/monster_human_chopper.qc +++ b/src/server/monster_human_chopper.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/server/monster_human_demoman.qc b/src/server/monster_human_demoman.qc index 3eb1152..2f81c89 100644 --- a/src/server/monster_human_demoman.qc +++ b/src/server/monster_human_demoman.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/server/monster_human_gunman.qc b/src/server/monster_human_gunman.qc index f734d81..11f63da 100644 --- a/src/server/monster_human_gunman.qc +++ b/src/server/monster_human_gunman.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/server/monster_human_unarmed.qc b/src/server/monster_human_unarmed.qc index 6638eba..0ddc1e8 100644 --- a/src/server/monster_human_unarmed.qc +++ b/src/server/monster_human_unarmed.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/server/monster_trainingbot.qc b/src/server/monster_trainingbot.qc index b3cc460..74f1ab1 100644 --- a/src/server/monster_trainingbot.qc +++ b/src/server/monster_trainingbot.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/server/progs.src b/src/server/progs.src index 3e27a85..9542962 100755 --- a/src/server/progs.src +++ b/src/server/progs.src @@ -10,6 +10,7 @@ ../../../src/shared/fteextensions.qc ../../../src/shared/defs.h ../../../src/server/defs.h +../../../src/botlib/botinfo.h ../../../src/gs-entbase/server.src ../../../src/gs-entbase/shared.src diff --git a/src/shared/fx_gaussbeam.qc b/src/shared/fx_gaussbeam.qc index 25373ef..1a98d58 100644 --- a/src/shared/fx_gaussbeam.qc +++ b/src/shared/fx_gaussbeam.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/shared/input.qc b/src/shared/input.qc index d62f930..631dc12 100644 --- a/src/shared/input.qc +++ b/src/shared/input.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/shared/items.h b/src/shared/items.h index 0f738c7..16f919e 100644 --- a/src/shared/items.h +++ b/src/shared/items.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/src/shared/player.qc b/src/shared/player.qc index 70ea631..f99fd5b 100644 --- a/src/shared/player.qc +++ b/src/shared/player.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2021 Marco Hladik + * Copyright (c) 2016-2021 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -80,12 +80,6 @@ class player:base_player PREDICTED_INT(dml_state); #ifdef CLIENT - /* External model */ - entity p_model; - int p_hand_bone; - int p_model_bone; - float lastweapon; - virtual void(void) draw; virtual float() predraw; virtual void(void) postdraw; diff --git a/src/shared/w_aicore.qc b/src/shared/w_aicore.qc index 9130b24..21249da 100644 --- a/src/shared/w_aicore.qc +++ b/src/shared/w_aicore.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -24,6 +24,8 @@ enum void w_aicore_draw(void) { + player pl = (player)self; + pl.menu_active = 0; Weapons_SetModel("models/v_aicore.mdl"); Weapons_SetGeomset("geomset 1 1\n"); Weapons_ViewAnimation(AIC_DRAW); @@ -122,7 +124,8 @@ w_aicore_precache(void) weapon_t w_aicore = { .name = "aicore", - .id = ITEM_AICORE, + .id = ITEM_AICORE, + .weight = WEIGHT_AICORE, .slot = 0, .slot_pos = 1, .draw = w_aicore_draw, @@ -139,6 +142,7 @@ weapon_t w_aicore = .pmodel = w_aicore_pmodel, .deathmsg = w_aicore_deathmsg, .aimanim = w_aicore_aimanim, + .type = gunman_wpntype_close, .hudpic = w_aicore_hudpic }; diff --git a/src/shared/w_beamgun.qc b/src/shared/w_beamgun.qc index e4942ec..4f509b2 100644 --- a/src/shared/w_beamgun.qc +++ b/src/shared/w_beamgun.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -29,6 +29,8 @@ enum void w_beamgun_draw(void) { + player pl = (player)self; + pl.menu_active = 0; Weapons_SetModel("models/v_beam.mdl"); Weapons_SetGeomset("geomset 1 1\n"); Weapons_ViewAnimation(BEAMGUN_DRAW); @@ -255,7 +257,8 @@ w_beamgun_precache(void) weapon_t w_beamgun = { .name = "beamgun", - .id = ITEM_BEAMGUN, + .id = ITEM_BEAMGUN, + .weight = WEIGHT_BEAMGUN, .slot = 3, .slot_pos = 0, .draw = w_beamgun_draw, @@ -272,6 +275,7 @@ weapon_t w_beamgun = .pmodel = w_beamgun_pmodel, .deathmsg = w_beamgun_deathmsg, .aimanim = w_beamgun_aimanim, + .type = gunman_wpntype_ranged, .hudpic = w_beamgun_hudpic }; diff --git a/src/shared/w_chemicalgun.qc b/src/shared/w_chemicalgun.qc index 417aff7..05def4d 100644 --- a/src/shared/w_chemicalgun.qc +++ b/src/shared/w_chemicalgun.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -27,6 +27,8 @@ enum void w_chemicalgun_draw(void) { + player pl = (player)self; + pl.menu_active = 0; Weapons_SetModel("models/v_chemgun.mdl"); Weapons_SetGeomset("geomset 1 1\n"); Weapons_ViewAnimation(CHEMGUN_DRAW); @@ -357,7 +359,8 @@ w_chemicalgun_precache(void) weapon_t w_chemicalgun = { .name = "chemicalgun", - .id = ITEM_CHEMICALGUN, + .id = ITEM_CHEMICALGUN, + .weight = WEIGHT_CHEMICALGUN, .slot = 4, .slot_pos = 1, .draw = w_chemicalgun_draw, @@ -374,6 +377,7 @@ weapon_t w_chemicalgun = .pmodel = w_chemicalgun_pmodel, .deathmsg = w_chemicalgun_deathmsg, .aimanim = w_chemicalgun_aimanim, + .type = gunman_wpntype_ranged, .hudpic = w_chemicalgun_hudpic }; diff --git a/src/shared/w_dml.qc b/src/shared/w_dml.qc index 20c58a9..d9eb4a5 100644 --- a/src/shared/w_dml.qc +++ b/src/shared/w_dml.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -75,6 +75,8 @@ enum void w_dml_draw(void) { + player pl = (player)self; + pl.menu_active = 0; Weapons_SetModel("models/v_dml.mdl"); Weapons_SetGeomset("geomset 1 1\n"); Weapons_ViewAnimation(DML_DRAW); @@ -304,10 +306,10 @@ w_dml_hud(void) break; } - txt1 = sprintf("LAUNCH: %s", lmodes[getstati(42)]); - txt2 = sprintf("FLIGHTPATH: %s", fmodes[getstati(43)]); - txt3 = sprintf("DETONATE: %s", dmodes[getstati(44)]); - txt4 = sprintf("PAYLOAD: %s", pmodes[getstati(45)]); + txt1 = sprintf("LAUNCH: %s", lmodes[pl.dml_launch]); + txt2 = sprintf("FLIGHTPATH: %s", fmodes[pl.dml_flightpath]); + txt3 = sprintf("DETONATE: %s", dmodes[pl.dml_detonate]); + txt4 = sprintf("PAYLOAD: %s", pmodes[pl.dml_payload]); pos = g_hudmins + (g_hudres / 2) + [-80,-48]; drawfont = Font_GetID(FONT_20); @@ -377,7 +379,8 @@ w_dml_precache(void) weapon_t w_dml = { .name = "dml", - .id = ITEM_DML, + .id = ITEM_DML, + .weight = WEIGHT_DML, .slot = 3, .slot_pos = 1, .draw = w_dml_draw, @@ -394,6 +397,7 @@ weapon_t w_dml = .pmodel = w_dml_pmodel, .deathmsg = w_dml_deathmsg, .aimanim = w_dml_aimanim, + .type = gunman_wpntype_ranged, .hudpic = w_dml_hudpic }; diff --git a/src/shared/w_fists.qc b/src/shared/w_fists.qc index 4067633..90aaa4a 100644 --- a/src/shared/w_fists.qc +++ b/src/shared/w_fists.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -52,6 +52,8 @@ w_fists_updateammo(player pl) void w_fists_draw(void) { + player pl = (player)self; + pl.menu_active = 0; player pl = (player)self; Weapons_SetModel("models/v_hands.mdl"); Weapons_SetGeomset("geomset 1 2\n"); @@ -153,7 +155,7 @@ w_fists_primary(void) #ifdef SERVER traceline(Weapons_GetCameraPos(), Weapons_GetCameraPos() + (v_forward * 96),\ FALSE, pl); - if (trace_fraction <= 1.0) { + if (trace_ent && trace_fraction <= 1.0) { if (trace_ent.takedamage = DAMAGE_YES) { Damage_Apply(trace_ent, pl, Skill_GetValue("sk_knife1_d", 25), WEAPON_GAUSSPISTOL, DMG_GENERIC); } @@ -178,7 +180,7 @@ w_fists_primary(void) #ifdef SERVER traceline(Weapons_GetCameraPos(), Weapons_GetCameraPos() + (v_forward * 96),\ FALSE, pl); - if (trace_fraction <= 1.0) { + if (trace_ent && trace_fraction <= 1.0) { if (trace_ent.takedamage = DAMAGE_YES) { Damage_Apply(trace_ent, pl, Skill_GetValue("sk_twohandpunch_d", 10), WEAPON_GAUSSPISTOL, DMG_GENERIC); } @@ -288,7 +290,8 @@ w_fists_precache(void) weapon_t w_fists = { .name = "fists", - .id = ITEM_FISTS, + .id = ITEM_FISTS, + .weight = WEIGHT_FISTS, .slot = 0, .slot_pos = 0, .draw = w_fists_draw, @@ -305,5 +308,6 @@ weapon_t w_fists = .pmodel = __NULL__, .deathmsg = w_fists_deathmsg, .aimanim = w_fists_aimanim, + .type = gunman_wpntype_close, .hudpic = w_fists_hudpic }; diff --git a/src/shared/w_gausspistol.qc b/src/shared/w_gausspistol.qc index 151573e..0fb8f16 100644 --- a/src/shared/w_gausspistol.qc +++ b/src/shared/w_gausspistol.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -42,6 +42,8 @@ enum void w_gausspistol_draw(void) { + player pl = (player)self; + pl.menu_active = 0; Weapons_SetModel("models/v_guasspistol.mdl"); Weapons_SetGeomset("geomset 1 1\n"); Weapons_ViewAnimation(GP_DRAW); @@ -122,13 +124,20 @@ w_gausspistol_primary(void) vector src; int take = 1; player pl = (player)self; - + + if (pl.menu_active > 0) { + pl.menu_active = 0; + pl.gflags |= GF_SEMI_TOGGLED; + pl.w_attack_next = 0.25f; + return; + } + if (pl.gflags & GF_SEMI_TOGGLED) { return; } - if (pl.a_ammo1 > 0) { - pl.a_ammo1 = 0; + if (pl.menu_active > 0) { + pl.menu_active = 0; pl.gflags |= GF_SEMI_TOGGLED; return; } @@ -210,7 +219,7 @@ w_gausspistol_secondary(void) pl.gflags |= GF_SEMI_TOGGLED; /* activate menu */ - pl.a_ammo1 = 1; + pl.menu_active = 1; w_gausspistol_release(); } @@ -282,7 +291,7 @@ w_gausspistol_hud(void) HUD_DrawAmmo2(); /* menu */ - if (pl.a_ammo1 > 0) { + if (pl.menu_active > 0) { pos = g_hudmins + (g_hudres / 2) + [-96,-72]; /* far left */ @@ -415,6 +424,7 @@ weapon_t w_gausspistol = { .name = "gausspistol", .id = ITEM_GAUSSPISTOL, + .weight = WEIGHT_GAUSSPISTOL, .slot = 1, .slot_pos = 0, .draw = w_gausspistol_draw, @@ -431,6 +441,7 @@ weapon_t w_gausspistol = .pmodel = w_gausspistol_pmodel, .deathmsg = w_gausspistol_deathmsg, .aimanim = w_gausspistol_aimanim, + .type = gunman_wpntype_ranged, .hudpic = w_gausspistol_hudpic }; @@ -447,7 +458,7 @@ weapon_gausspistol(void) int w_gausspistol_hudforward(player pl) { - if (pl.a_ammo1 <= 0) { + if (pl.menu_active <= 0) { return (1); } @@ -459,7 +470,7 @@ w_gausspistol_hudforward(player pl) int w_gausspistol_hudback(player pl) { - if (pl.a_ammo1 <= 0) { + if (pl.menu_active <= 0) { return (1); } diff --git a/src/shared/w_grenade.qc b/src/shared/w_grenade.qc index fa372a8..68b7577 100644 --- a/src/shared/w_grenade.qc +++ b/src/shared/w_grenade.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -29,6 +29,8 @@ enum void w_grenade_draw(void) { + player pl = (player)self; + pl.menu_active = 0; Weapons_SetModel("models/v_grenade.mdl"); Weapons_SetGeomset("geomset 1 1\n"); Weapons_ViewAnimation(GREN_DRAW); @@ -219,7 +221,8 @@ w_grenade_precache(void) weapon_t w_grenade = { .name = "grenade", - .id = ITEM_GRENADE, + .id = ITEM_GRENADE, + .weight = WEIGHT_GRENADE, .slot = 4, .slot_pos = 0, .draw = w_grenade_draw, @@ -236,6 +239,7 @@ weapon_t w_grenade = .pmodel = w_grenade_pmodel, .deathmsg = w_grenade_deathmsg, .aimanim = w_grenade_aimanim, + .type = gunman_wpntype_throw, .hudpic = w_grenade_hudpic }; diff --git a/src/shared/w_minigun.qc b/src/shared/w_minigun.qc index 29862db..3e25d55 100644 --- a/src/shared/w_minigun.qc +++ b/src/shared/w_minigun.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -30,6 +30,8 @@ enum void w_minigun_draw(void) { + player pl = (player)self; + pl.menu_active = 0; Weapons_SetModel("models/v_mechagun.mdl"); Weapons_SetGeomset("geomset 1 1\n"); Weapons_ViewAnimation(MG_DRAW); @@ -268,6 +270,7 @@ weapon_t w_minigun = .pmodel = w_minigun_pmodel, .deathmsg = w_minigun_deathmsg, .aimanim = w_minigun_aimanim, + .type = gunman_wpntype_ranged, .hudpic = w_minigun_hudpic }; diff --git a/src/shared/w_shotgun.qc b/src/shared/w_shotgun.qc index 20aab0b..0114559 100644 --- a/src/shared/w_shotgun.qc +++ b/src/shared/w_shotgun.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -51,6 +51,8 @@ string gsmodes[] = { void w_shotgun_draw(void) { + player pl = (player)self; + pl.menu_active = 0; Weapons_SetModel("models/v_shotgun.mdl"); Weapons_SetGeomset("geomset 1 1\n"); Weapons_ViewAnimation(SHOTGUN_DRAW); @@ -271,8 +273,8 @@ w_shotgun_hud(void) break; } - shellstr = sprintf("SHELLS: %i", getstati(40)); - spreadstr = sprintf("SPREAD: %s", gsmodes[getstati(41)]); + shellstr = sprintf("SHELLS: %i", pl.shotgun_shells); + spreadstr = sprintf("SPREAD: %s", gsmodes[pl.shotgun_spread]); pos = g_hudmins + (g_hudres / 2) + [-48,-16]; drawfont = Font_GetID(FONT_20); @@ -345,6 +347,7 @@ weapon_t w_shotgun = .pmodel = w_shotgun_pmodel, .deathmsg = w_shotgun_deathmsg, .aimanim = w_shotgun_aimanim, + .type = gunman_wpntype_ranged, .hudpic = w_shotgun_hudpic }; diff --git a/src/shared/weapons.h b/src/shared/weapons.h index 35c0eb7..9e0cca2 100644 --- a/src/shared/weapons.h +++ b/src/shared/weapons.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -28,3 +28,33 @@ enum WEAPON_GRENADE, WEAPON_CHEMICALGUN }; + +/* weight table... I just guessed this was a good compromise */ +enum +{ + WEIGHT_AICORE, + WEIGHT_NONE, + WEIGHT_FISTS, + WEIGHT_GRENADE, + WEIGHT_GAUSSPISTOL, + WEIGHT_DML, + WEIGHT_SHOTGUN, + WEIGHT_MINIGUN, + WEIGHT_BEAMGUN, + WEIGHT_CHEMICALGUN +}; + +weapontype_t gunman_wpntype_ranged(void) +{ + return WPNTYPE_RANGED; +} + +weapontype_t gunman_wpntype_close(void) +{ + return WPNTYPE_CLOSE; +} + +weapontype_t gunman_wpntype_throw(void) +{ + return WPNTYPE_THROW; +} diff --git a/src/shared/weapons.qc b/src/shared/weapons.qc index 457743a..976757c 100644 --- a/src/shared/weapons.qc +++ b/src/shared/weapons.qc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Marco Hladik + * Copyright (c) 2016-2020 Marco Cawthorne * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above