Skip to content

Commit 2aaf362

Browse files
committed
Add SetSlot/SetPosition with vscript bindings
1 parent f7e4e7a commit 2aaf362

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/game/server/basecombatweapon.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ BEGIN_ENT_SCRIPTDESC( CBaseCombatWeapon, BASECOMBATWEAPON_DERIVED_FROM, "Base Co
7373
DEFINE_SCRIPTFUNC( GetWeight, "Get the weapon weighting/importance" )
7474
DEFINE_SCRIPTFUNC( GetWeaponFlags, "Get the weapon flags" )
7575
DEFINE_SCRIPTFUNC( GetSlot, "Gets the weapon's current slot" )
76+
DEFINE_SCRIPTFUNC( SetSlot, "Sets the weapon's current slot" )
7677
DEFINE_SCRIPTFUNC( GetPosition, "Gets the weapon's current position" )
78+
DEFINE_SCRIPTFUNC( SetPosition, "Sets the weapon's current position" )
7779
DEFINE_SCRIPTFUNC( GetName, "Gets the weapon's name" )
7880
DEFINE_SCRIPTFUNC( GetPrintName, "Gets the weapon's print name" )
7981
DEFINE_SCRIPTFUNC( IsMeleeWeapon, "Returns whether this is a melee weapon" )

src/game/shared/basecombatweapon_shared.h

+2
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,9 @@ class CBaseCombatWeapon : public BASECOMBATWEAPON_DERIVED_FROM
355355
virtual bool ForceWeaponSwitch( void ) const { return false; }
356356
virtual int GetWeaponFlags( void ) const;
357357
virtual int GetSlot( void ) const { return m_iSlot; };
358+
virtual void SetSlot( int iSlot ) { m_iSlot = iSlot; };
358359
virtual int GetPosition( void ) const { return m_iPosition; };
360+
virtual void SetPosition( int iPosition ) { m_iPosition = iPosition; };
359361
virtual char const *GetName( void ) const;
360362
virtual char const *GetPrintName( void ) const;
361363
virtual char const *GetShootSound( int iIndex ) const;

0 commit comments

Comments
 (0)