mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 07:12:16 +00:00
- scriptified the decision making of the invuseall CCMD.
Custom items had no way to adjust to this - and it also was the last native access to ItemFlags.
This commit is contained in:
parent
93f91d1039
commit
3182569fb8
3 changed files with 12 additions and 2 deletions
|
@ -63,6 +63,7 @@
|
|||
#include "g_levellocals.h"
|
||||
#include "events.h"
|
||||
#include "i_time.h"
|
||||
#include "vm.h"
|
||||
|
||||
EXTERN_CVAR (Int, disableautosave)
|
||||
EXTERN_CVAR (Int, autosavecount)
|
||||
|
@ -2253,9 +2254,10 @@ void Net_DoCommand (int type, uint8_t **stream, int player)
|
|||
while (item != NULL)
|
||||
{
|
||||
AInventory *next = item->Inventory;
|
||||
if (item->ItemFlags & IF_INVBAR && !(item->IsKindOf(pitype)))
|
||||
IFVIRTUALPTR(item, AInventory, UseAll)
|
||||
{
|
||||
players[player].mo->UseInventory (item);
|
||||
VMValue param[] = { item, players[player].mo };
|
||||
VMCall(func, param, 2, nullptr, 0);
|
||||
}
|
||||
item = next;
|
||||
}
|
||||
|
|
|
@ -132,6 +132,9 @@ class PuzzleItem : Inventory
|
|||
return false;
|
||||
}
|
||||
|
||||
override void UseAll(Actor user)
|
||||
{
|
||||
}
|
||||
|
||||
override bool ShouldStay ()
|
||||
{
|
||||
|
|
|
@ -935,6 +935,11 @@ class Inventory : Actor native
|
|||
virtual void OwnerDied() {}
|
||||
virtual Color GetBlend () { return 0; }
|
||||
|
||||
virtual void UseAll(Actor user)
|
||||
{
|
||||
if (bInvBar) user.UseInventory(self);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// AInventory :: DoPickupSpecial
|
||||
|
|
Loading…
Reference in a new issue