Merge branch 'master' into scripting

Conflicts:
	src/m_cheat.cpp
	src/p_acs.cpp
	src/thingdef/thingdef_codeptr.cpp
	src/thingdef/thingdef_properties.cpp
This commit is contained in:
Christoph Oelckers 2015-04-28 23:04:10 +02:00
commit 646c135eff
12 changed files with 106 additions and 126 deletions

View file

@ -1996,34 +1996,8 @@ int DoTakeInventory(AActor *receiver, bool orresult, VM_ARGS)
return numret;
}
bool res = false;
AInventory *inv = receiver->FindInventory(itemtype);
if (inv && !inv->IsKindOf(RUNTIME_CLASS(AHexenArmor)))
{
if (inv->Amount > 0)
{
res = true;
}
// Do not take ammo if the "no take infinite/take as ammo depletion" flag is set
// and infinite ammo is on
if (flags & TIF_NOTAKEINFINITE &&
((dmflags & DF_INFINITE_AMMO) || (receiver->player->cheats & CF_INFINITEAMMO)) &&
inv->IsKindOf(RUNTIME_CLASS(AAmmo)))
{
// Nothing to do here, except maybe res = false;? Would it make sense?
}
else if (!amount || amount>=inv->Amount)
{
if (inv->ItemFlags&IF_KEEPDEPLETED) inv->Amount=0;
else inv->Destroy();
}
else
{
inv->Amount -= amount;
}
}
bool res = receiver->TakeInventory(itemtype, amount, true, (flags & TIF_NOTAKEINFINITE) != 0);
if (!orresult)
{
ACTION_SET_RESULT(res);