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

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

View file

@ -241,6 +241,7 @@ FString BackupSaveName;
bool SendLand;
const AInventory *SendItemUse, *SendItemDrop;
int SendItemDropAmount;
EXTERN_CVAR (Int, team)
@ -457,12 +458,14 @@ CCMD (invdrop)
if (players[consoleplayer].mo)
{
SendItemDrop = players[consoleplayer].mo->InvSel;
SendItemDropAmount = -1;
}
}
CCMD (weapdrop)
{
SendItemDrop = players[consoleplayer].ReadyWeapon;
SendItemDropAmount = -1;
}
CCMD (drop)
@ -470,6 +473,7 @@ CCMD (drop)
if (argv.argc() > 1 && who != NULL)
{
SendItemDrop = who->FindInventory(argv[1]);
SendItemDropAmount = argv.argc() > 2 ? atoi(argv[2]) : -1;
}
}
@ -762,6 +766,7 @@ void G_BuildTiccmd (ticcmd_t *cmd)
{
Net_WriteByte (DEM_INVDROP);
Net_WriteLong (SendItemDrop->InventoryID);
Net_WriteLong(SendItemDropAmount);
SendItemDrop = NULL;
}