mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 13:01:47 +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 "g_levellocals.h"
|
||||||
#include "events.h"
|
#include "events.h"
|
||||||
#include "i_time.h"
|
#include "i_time.h"
|
||||||
|
#include "vm.h"
|
||||||
|
|
||||||
EXTERN_CVAR (Int, disableautosave)
|
EXTERN_CVAR (Int, disableautosave)
|
||||||
EXTERN_CVAR (Int, autosavecount)
|
EXTERN_CVAR (Int, autosavecount)
|
||||||
|
@ -2253,9 +2254,10 @@ void Net_DoCommand (int type, uint8_t **stream, int player)
|
||||||
while (item != NULL)
|
while (item != NULL)
|
||||||
{
|
{
|
||||||
AInventory *next = item->Inventory;
|
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;
|
item = next;
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,6 +132,9 @@ class PuzzleItem : Inventory
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override void UseAll(Actor user)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
override bool ShouldStay ()
|
override bool ShouldStay ()
|
||||||
{
|
{
|
||||||
|
|
|
@ -934,6 +934,11 @@ class Inventory : Actor native
|
||||||
virtual version("2.4") ui void AlterWeaponSprite(VisStyle vis, in out int changed) {}
|
virtual version("2.4") ui void AlterWeaponSprite(VisStyle vis, in out int changed) {}
|
||||||
virtual void OwnerDied() {}
|
virtual void OwnerDied() {}
|
||||||
virtual Color GetBlend () { return 0; }
|
virtual Color GetBlend () { return 0; }
|
||||||
|
|
||||||
|
virtual void UseAll(Actor user)
|
||||||
|
{
|
||||||
|
if (bInvBar) user.UseInventory(self);
|
||||||
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in a new issue