From 73cceea99413ce805a73609266ef38d8794ac40f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 23 Feb 2017 20:55:12 +0100 Subject: [PATCH] - also added the 'amount' parameter to DropInventroy and A_DropInventory script functions. --- src/p_actionfunctions.cpp | 3 ++- src/p_mobj.cpp | 2 +- wadsrc/static/zscript/actor.txt | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/p_actionfunctions.cpp b/src/p_actionfunctions.cpp index 8a062cd18..8f916614b 100644 --- a/src/p_actionfunctions.cpp +++ b/src/p_actionfunctions.cpp @@ -3663,13 +3663,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_DropInventory) { PARAM_SELF_PROLOGUE(AActor); PARAM_CLASS(drop, AInventory); + PARAM_INT_DEF(amount); if (drop) { AInventory *inv = self->FindInventory(drop); if (inv) { - self->DropInventory(inv); + self->DropInventory(inv, amount); } } return 0; diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index e2f7b18c3..ef5908fda 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -1059,7 +1059,7 @@ DEFINE_ACTION_FUNCTION(AActor, DropInventory) { PARAM_SELF_PROLOGUE(AActor); PARAM_OBJECT_NOT_NULL(item, AInventory); - PARAM_INT(amt); + PARAM_INT_DEF(amt); ACTION_RETURN_OBJECT(self->DropInventory(item, amt)); } diff --git a/wadsrc/static/zscript/actor.txt b/wadsrc/static/zscript/actor.txt index 0666fce8b..fc31b75d9 100644 --- a/wadsrc/static/zscript/actor.txt +++ b/wadsrc/static/zscript/actor.txt @@ -496,7 +496,7 @@ class Actor : Thinker native native bool TakeInventory(class itemclass, int amount, bool fromdecorate = false, bool notakeinfinite = false); native Inventory FindInventory(class itemtype, bool subclass = false); native Inventory GiveInventoryType(class itemtype); - native Inventory DropInventory (Inventory item); + native Inventory DropInventory (Inventory item, int amt = -1); native bool UseInventory(Inventory item); native void ObtainInventory(Actor other); native bool GiveAmmo (Class type, int amount); @@ -787,7 +787,7 @@ class Actor : Thinker native native void A_SpawnDebris(class spawntype, bool transfer_translation = false, double mult_h = 1, double mult_v = 1); native void A_SpawnParticle(color color1, int flags = 0, int lifetime = 35, double size = 1, double angle = 0, double xoff = 0, double yoff = 0, double zoff = 0, double velx = 0, double vely = 0, double velz = 0, double accelx = 0, double accely = 0, double accelz = 0, double startalphaf = 1, double fadestepf = -1, double sizestep = 0); native void A_ExtChase(bool usemelee, bool usemissile, bool playactive = true, bool nightmarefast = false); - native void A_DropInventory(class itemtype); + native void A_DropInventory(class itemtype, int amount); native void A_SetBlend(color color1, double alpha, int tics, color color2 = 0); deprecated native void A_ChangeFlag(string flagname, bool value); native void A_ChangeCountFlags(int kill = FLAG_NO_CHANGE, int item = FLAG_NO_CHANGE, int secret = FLAG_NO_CHANGE);