@@ -391,7 +391,7 @@ BEGIN_ENT_SCRIPTDESC( CASW_Marine, CASW_Inhabitable_NPC, "Marine" )
391391 DEFINE_SCRIPTFUNC_NAMED( ScriptBecomeInfested, " BecomeInfested" , " Infests the marine." )
392392 DEFINE_SCRIPTFUNC_NAMED( ScriptCureInfestation, " CureInfestation" , " Cures an infestation." )
393393 DEFINE_SCRIPTFUNC_NAMED( ScriptGiveAmmo, " GiveAmmo" , " Gives the marine ammo for the specified ammo index." )
394- DEFINE_SCRIPTFUNC_NAMED( ScriptGiveWeapon, " GiveWeapon" , " Gives the marine a weapon." )
394+ DEFINE_SCRIPTFUNC_NAMED( ScriptGiveWeapon, " GiveWeapon" , " Gives the marine a weapon. Returns the weapon's handle. " )
395395 DEFINE_SCRIPTFUNC_NAMED( ScriptDropWeapon, " DropWeapon" , " Makes the marine drop a weapon." )
396396 DEFINE_SCRIPTFUNC_NAMED( ScriptRemoveWeapon, " RemoveWeapon" , " Removes a weapon from the marine." )
397397 DEFINE_SCRIPTFUNC_NAMED( ScriptSwitchWeapon, " SwitchWeapon" , " Make the marine switch to a weapon" )
@@ -3476,13 +3476,13 @@ void CASW_Marine::ScriptGiveAmmo( int iCount, int iAmmoIndex )
34763476 GiveAmmo ( iCount, iAmmoIndex, false );
34773477}
34783478
3479- void CASW_Marine::ScriptGiveWeapon ( const char *pszName, int slot )
3479+ HSCRIPT CASW_Marine::ScriptGiveWeapon ( const char *pszName, int slot )
34803480{
34813481 CASW_Weapon* pWeapon = dynamic_cast <CASW_Weapon*>(Weapon_Create (pszName));
34823482 if ( !pWeapon )
34833483 {
34843484 Msg ( " NULL Ent in GiveWeapon!\n " );
3485- return ;
3485+ return NULL ;
34863486 }
34873487
34883488 int weaponIndex = GetWeaponPositionForPickup ( pWeapon->GetClassname (), pWeapon->m_bIsTemporaryPickup );
@@ -3505,6 +3505,8 @@ void CASW_Marine::ScriptGiveWeapon( const char *pszName, int slot )
35053505 int iClips = GetAmmoDef ()->MaxCarry ( pWeapon->GetPrimaryAmmoType (), this );
35063506 GiveAmmo ( iClips, pWeapon->GetPrimaryAmmoType (), true );
35073507 }
3508+
3509+ return ToHScript ( pWeapon );
35083510}
35093511
35103512bool CASW_Marine::ScriptDropWeapon ( int iWeaponIndex )
0 commit comments