mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +00:00
- added a RESETITEMS MAPINFO flag.
This commit is contained in:
parent
e6b31dde27
commit
d80dc098bd
3 changed files with 14 additions and 0 deletions
|
@ -1343,12 +1343,24 @@ void G_PlayerFinishLevel (int player, EFinishLevelType mode, int flags)
|
||||||
|
|
||||||
if (mode == FINISH_NoHub && !(level.flags2 & LEVEL2_KEEPFULLINVENTORY))
|
if (mode == FINISH_NoHub && !(level.flags2 & LEVEL2_KEEPFULLINVENTORY))
|
||||||
{ // Reduce all owned (visible) inventory to defined maximum interhub amount
|
{ // Reduce all owned (visible) inventory to defined maximum interhub amount
|
||||||
|
TArray<AInventory*> todelete;
|
||||||
for (item = p->mo->Inventory; item != NULL; item = item->Inventory)
|
for (item = p->mo->Inventory; item != NULL; item = item->Inventory)
|
||||||
{
|
{
|
||||||
// If the player is carrying more samples of an item than allowed, reduce amount accordingly
|
// If the player is carrying more samples of an item than allowed, reduce amount accordingly
|
||||||
if (item->ItemFlags & IF_INVBAR && item->Amount > item->InterHubAmount)
|
if (item->ItemFlags & IF_INVBAR && item->Amount > item->InterHubAmount)
|
||||||
{
|
{
|
||||||
item->Amount = item->InterHubAmount;
|
item->Amount = item->InterHubAmount;
|
||||||
|
if ((level.flags3 & LEVEL3_RESETINVENTORY) && !(item->ItemFlags & IF_UNDROPPABLE))
|
||||||
|
{
|
||||||
|
todelete.Push(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (auto it : todelete)
|
||||||
|
{
|
||||||
|
if (!(it->ObjectFlags & OF_EuthanizeMe))
|
||||||
|
{
|
||||||
|
it->DepleteOrDestroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -223,6 +223,7 @@ enum ELevelFlags : unsigned int
|
||||||
|
|
||||||
// More flags!
|
// More flags!
|
||||||
LEVEL3_FORCEFAKECONTRAST = 0x00000001, // forces fake contrast even with fog enabled
|
LEVEL3_FORCEFAKECONTRAST = 0x00000001, // forces fake contrast even with fog enabled
|
||||||
|
LEVEL3_RESETINVENTORY = 0x00000002, // kills all INVBAR items on map change.
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1277,6 +1277,7 @@ MapFlagHandlers[] =
|
||||||
{ "laxmonsteractivation", MITYPE_SETFLAG2, LEVEL2_LAXMONSTERACTIVATION, LEVEL2_LAXACTIVATIONMAPINFO },
|
{ "laxmonsteractivation", MITYPE_SETFLAG2, LEVEL2_LAXMONSTERACTIVATION, LEVEL2_LAXACTIVATIONMAPINFO },
|
||||||
{ "additive_scrollers", MITYPE_COMPATFLAG, COMPATF_BOOMSCROLL, 0 },
|
{ "additive_scrollers", MITYPE_COMPATFLAG, COMPATF_BOOMSCROLL, 0 },
|
||||||
{ "keepfullinventory", MITYPE_SETFLAG2, LEVEL2_KEEPFULLINVENTORY, 0 },
|
{ "keepfullinventory", MITYPE_SETFLAG2, LEVEL2_KEEPFULLINVENTORY, 0 },
|
||||||
|
{ "resetitems", MITYPE_SETFLAG3, LEVEL2_RESETINVENTORY, 0 },
|
||||||
{ "monsterfallingdamage", MITYPE_SETFLAG2, LEVEL2_MONSTERFALLINGDAMAGE, 0 },
|
{ "monsterfallingdamage", MITYPE_SETFLAG2, LEVEL2_MONSTERFALLINGDAMAGE, 0 },
|
||||||
{ "nomonsterfallingdamage", MITYPE_CLRFLAG2, LEVEL2_MONSTERFALLINGDAMAGE, 0 },
|
{ "nomonsterfallingdamage", MITYPE_CLRFLAG2, LEVEL2_MONSTERFALLINGDAMAGE, 0 },
|
||||||
{ "clipmidtextures", MITYPE_SETFLAG2, LEVEL2_CLIPMIDTEX, 0 },
|
{ "clipmidtextures", MITYPE_SETFLAG2, LEVEL2_CLIPMIDTEX, 0 },
|
||||||
|
|
Loading…
Reference in a new issue