diff --git a/src/p_user.cpp b/src/p_user.cpp index 29efe9001..e910eac97 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -1195,6 +1195,12 @@ AWeapon *APlayerPawn::PickNewWeapon(PClassActor *ammotype) return best; } +DEFINE_ACTION_FUNCTION(APlayerPawn, PickNewWeapon) +{ + PARAM_SELF_PROLOGUE(APlayerPawn); + PARAM_CLASS(ammo, AActor); + ACTION_RETURN_POINTER(self->PickNewWeapon(ammo)); +} //=========================================================================== // // APlayerPawn :: GiveDeathmatchInventory diff --git a/wadsrc/static/zscript/shared/player.txt b/wadsrc/static/zscript/shared/player.txt index 7b7682e4c..ac7d85f88 100644 --- a/wadsrc/static/zscript/shared/player.txt +++ b/wadsrc/static/zscript/shared/player.txt @@ -1277,6 +1277,7 @@ class PlayerPawn : Actor native native void CheckUse(); native void CheckWeaponButtons(); native Weapon BestWeapon(class ammotype); + native Weapon PickNewWeapon(class ammotype); }