- added an amount parameter to the 'drop' CCMD.

This commit is contained in:
Christoph Oelckers 2017-02-23 20:18:02 +01:00
parent fc101049c6
commit e2d5a708f8
12 changed files with 45 additions and 27 deletions

View file

@ -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));
}
//============================================================================