mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-06-04 19:10:59 +00:00
- added an amount parameter to the 'drop' CCMD.
This commit is contained in:
parent
fc101049c6
commit
e2d5a708f8
12 changed files with 45 additions and 27 deletions
|
@ -1035,14 +1035,14 @@ DEFINE_ACTION_FUNCTION(AActor, UseInventory)
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
AInventory *AActor::DropInventory (AInventory *item)
|
||||
AInventory *AActor::DropInventory (AInventory *item, int amt)
|
||||
{
|
||||
AInventory *drop = nullptr;
|
||||
IFVIRTUALPTR(item, AInventory, CreateTossable)
|
||||
{
|
||||
VMValue params[1] = { (DObject*)item };
|
||||
VMValue params[] = { (DObject*)item, amt };
|
||||
VMReturn ret((void**)&drop);
|
||||
GlobalVMStack.Call(func, params, 1, &ret, 1, nullptr);
|
||||
GlobalVMStack.Call(func, params, countof(params), &ret, 1, nullptr);
|
||||
}
|
||||
if (drop == nullptr) return NULL;
|
||||
drop->SetOrigin(PosPlusZ(10.), false);
|
||||
|
@ -1059,7 +1059,8 @@ DEFINE_ACTION_FUNCTION(AActor, DropInventory)
|
|||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_OBJECT_NOT_NULL(item, AInventory);
|
||||
ACTION_RETURN_OBJECT(self->DropInventory(item));
|
||||
PARAM_INT(amt);
|
||||
ACTION_RETURN_OBJECT(self->DropInventory(item, amt));
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue