Skip to content

Commit

Permalink
Add arg to give for dual wield weaps
Browse files Browse the repository at this point in the history
  • Loading branch information
alicealys committed Aug 13, 2024
1 parent 580dc6e commit 559d022
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/client/component/command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,12 @@ namespace command
const auto wp = game::G_GetWeaponForName(arg.data());
if (wp)
{
if (game::G_GivePlayerWeapon(ps, wp, 0, 0, 0, 0))
const auto def = game::weapon_defs[wp];

const auto want_dual_wield = std::atoi(params.get(2));
const auto dual_wield = !def->noDualWield && want_dual_wield;

if (game::G_GivePlayerWeapon(ps, wp, dual_wield, 0, 0, 0))
{
game::G_InitializeAmmo(ps, wp, 0);
game::G_SelectWeapon(0, wp);
Expand Down
2 changes: 2 additions & 0 deletions src/client/game/symbols.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,8 @@ namespace game
WEAK symbol<int> volmod_index{0x151BADFD8};
WEAK symbol<int> music_dsp_bus_index{0x151B9AA40};

WEAK symbol<WeaponDef*> weapon_defs{0x14CE01580};

namespace hks
{
WEAK symbol<lua_State*> lua_state{0x1419D83E8};
Expand Down

0 comments on commit 559d022

Please sign in to comment.