mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-29 15:22:08 +00:00
Fixed local items not copying properties properly
Revert "Fixed local items not copying properties properly" This reverts commit 5f352df587c629545fafc09e80428e645f5e8df3. ...
This commit is contained in:
parent
0328eca7f0
commit
70a165b566
1 changed files with 18 additions and 1 deletions
|
@ -12,6 +12,7 @@ class Inventory : Actor
|
||||||
|
|
||||||
private bool bSharingItem; // Currently being shared (avoid infinite recursions).
|
private bool bSharingItem; // Currently being shared (avoid infinite recursions).
|
||||||
private bool pickedUp[MAXPLAYERS]; // If items are set to local, track who already picked it up.
|
private bool pickedUp[MAXPLAYERS]; // If items are set to local, track who already picked it up.
|
||||||
|
private bool bCreatingCopy; // Tells GoAway that it needs to return true so a new copy of the item is spawned.
|
||||||
|
|
||||||
deprecated("3.7") private int ItemFlags;
|
deprecated("3.7") private int ItemFlags;
|
||||||
Actor Owner; // Who owns this item? NULL if it's still a pickup.
|
Actor Owner; // Who owns this item? NULL if it's still a pickup.
|
||||||
|
@ -835,9 +836,11 @@ class Inventory : Actor
|
||||||
Inventory give = self;
|
Inventory give = self;
|
||||||
if (localPickUp)
|
if (localPickUp)
|
||||||
{
|
{
|
||||||
give = Inventory(Spawn(GetClass()));
|
give = CreateLocalCopy(toucher);
|
||||||
if (!give)
|
if (!give)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
localPickUp = give != self;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool res;
|
bool res;
|
||||||
|
@ -1043,6 +1046,9 @@ class Inventory : Actor
|
||||||
|
|
||||||
protected bool GoAway ()
|
protected bool GoAway ()
|
||||||
{
|
{
|
||||||
|
if (bCreatingCopy)
|
||||||
|
return true;
|
||||||
|
|
||||||
// Dropped items never stick around
|
// Dropped items never stick around
|
||||||
if (bDropped)
|
if (bDropped)
|
||||||
{
|
{
|
||||||
|
@ -1114,6 +1120,17 @@ class Inventory : Actor
|
||||||
DisableLocalRendering(pNum, true);
|
DisableLocalRendering(pNum, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Force spawn a new version of the item. This needs to use CreateCopy so that
|
||||||
|
// any transferrable properties on the item get correctly set.
|
||||||
|
Inventory CreateLocalCopy(Actor client)
|
||||||
|
{
|
||||||
|
bCreatingCopy = true;
|
||||||
|
let item = CreateCopy(client);
|
||||||
|
bCreatingCopy = false;
|
||||||
|
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
//
|
//
|
||||||
// Inventory :: ModifyDamage
|
// Inventory :: ModifyDamage
|
||||||
|
|
Loading…
Reference in a new issue