From 6dc026895ca4c0df32ebf14f57db9b33c010c03e Mon Sep 17 00:00:00 2001 From: player701 Date: Sat, 13 Oct 2018 20:34:12 +0300 Subject: [PATCH] - Exported PickNewWeapon function from PlayerPawn to ZScript. --- src/p_user.cpp | 6 ++++++ wadsrc/static/zscript/shared/player.txt | 1 + 2 files changed, 7 insertions(+) diff --git a/src/p_user.cpp b/src/p_user.cpp index 29efe9001a..e910eac97d 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 7b7682e4cd..ac7d85f886 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); }