File tree Expand file tree Collapse file tree 7 files changed +22
-21
lines changed
wadsrc/static/zscript/actors Expand file tree Collapse file tree 7 files changed +22
-21
lines changed Original file line number Diff line number Diff line change @@ -246,12 +246,12 @@ class ArtiPoisonBag : Inventory
246
246
//
247
247
//============================================================================
248
248
249
- override Inventory CreateCopy (Actor other)
249
+ override Inventory CreateCopy (Actor other, bool force )
250
250
{
251
251
// Only the base class gets special handling
252
252
if (GetClass() != " ArtiPoisonBag" )
253
253
{
254
- return Super . CreateCopy (other);
254
+ return Super . CreateCopy (other, force );
255
255
}
256
256
257
257
class < Actor> spawntype = GetFlechetteType(other);
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ class Ammo : Inventory
132
132
//
133
133
//===========================================================================
134
134
135
- override Inventory CreateCopy (Actor other)
135
+ override Inventory CreateCopy (Actor other, bool force )
136
136
{
137
137
Inventory copy;
138
138
int amount = Amount;
@@ -157,7 +157,7 @@ class Ammo : Inventory
157
157
}
158
158
else
159
159
{
160
- copy = Super . CreateCopy (other);
160
+ copy = Super . CreateCopy (other, force );
161
161
copy . Amount = amount;
162
162
}
163
163
if (copy . Amount > copy . MaxAmount)
@@ -242,7 +242,7 @@ class BackpackItem : Inventory
242
242
//
243
243
//===========================================================================
244
244
245
- override Inventory CreateCopy (Actor other)
245
+ override Inventory CreateCopy (Actor other, bool force )
246
246
{
247
247
// Find every unique type of ammoitem. Give it to the player if
248
248
// he doesn't have it already, and double its maximum capacity.
@@ -292,7 +292,7 @@ class BackpackItem : Inventory
292
292
}
293
293
}
294
294
}
295
- return Super . CreateCopy (other);
295
+ return Super . CreateCopy (other, force );
296
296
}
297
297
298
298
//===========================================================================
Original file line number Diff line number Diff line change @@ -247,9 +247,9 @@ class BasicArmorBonus : Armor
247
247
//
248
248
//===========================================================================
249
249
250
- override Inventory CreateCopy (Actor other)
250
+ override Inventory CreateCopy (Actor other, bool force )
251
251
{
252
- let copy = BasicArmorBonus(Super . CreateCopy (other));
252
+ let copy = BasicArmorBonus(Super . CreateCopy (other, force ));
253
253
copy . SavePercent = SavePercent;
254
254
copy . SaveAmount = SaveAmount;
255
255
copy . MaxSaveAmount = MaxSaveAmount;
@@ -366,9 +366,9 @@ class BasicArmorPickup : Armor
366
366
//
367
367
//===========================================================================
368
368
369
- override Inventory CreateCopy (Actor other)
369
+ override Inventory CreateCopy (Actor other, bool force )
370
370
{
371
- let copy = BasicArmorPickup(Super . CreateCopy (other));
371
+ let copy = BasicArmorPickup(Super . CreateCopy (other, force ));
372
372
copy . SavePercent = SavePercent;
373
373
copy . SaveAmount = SaveAmount;
374
374
copy . MaxAbsorb = MaxAbsorb;
Original file line number Diff line number Diff line change @@ -133,9 +133,9 @@ class HealthPickup : Inventory
133
133
//
134
134
//===========================================================================
135
135
136
- override Inventory CreateCopy (Actor other)
136
+ override Inventory CreateCopy (Actor other, bool force )
137
137
{
138
- Inventory copy = Super . CreateCopy (other);
138
+ Inventory copy = Super . CreateCopy (other, force );
139
139
copy . health = health;
140
140
return copy;
141
141
}
Original file line number Diff line number Diff line change @@ -409,12 +409,13 @@ class Inventory : Actor
409
409
//
410
410
//===========================================================================
411
411
412
- virtual Inventory CreateCopy (Actor other)
412
+ virtual Inventory CreateCopy (Actor other, bool force = false )
413
413
{
414
414
Inventory copy;
415
-
416
- Amount = MIN(Amount, MaxAmount);
417
- if (GoAway ())
415
+ if (!force)
416
+ Amount = MIN(Amount, MaxAmount);
417
+
418
+ if (force || GoAway ())
418
419
{
419
420
copy = Inventory(Spawn (GetClass()));
420
421
copy . Amount = Amount;
@@ -835,7 +836,7 @@ class Inventory : Actor
835
836
Inventory give = self;
836
837
if (localPickUp)
837
838
{
838
- give = Inventory(Spawn(GetClass()) );
839
+ give = CreateCopy(toucher, true );
839
840
if (!give)
840
841
return ;
841
842
}
Original file line number Diff line number Diff line change @@ -660,9 +660,9 @@ class Weapon : StateProvider
660
660
//
661
661
//===========================================================================
662
662
663
- override Inventory CreateCopy (Actor other)
663
+ override Inventory CreateCopy (Actor other, bool force )
664
664
{
665
- let copy = Weapon(Super . CreateCopy (other));
665
+ let copy = Weapon(Super . CreateCopy (other, force ));
666
666
if (copy != self && copy != null )
667
667
{
668
668
copy . AmmoGive1 = AmmoGive1;
Original file line number Diff line number Diff line change @@ -58,11 +58,11 @@ class Coin : Inventory
58
58
return false ;
59
59
}
60
60
61
- override Inventory CreateCopy (Actor other)
61
+ override Inventory CreateCopy (Actor other, bool force )
62
62
{
63
63
if (GetClass() == " Coin" )
64
64
{
65
- return Super . CreateCopy (other);
65
+ return Super . CreateCopy (other, force );
66
66
}
67
67
Inventory copy = Inventory(Spawn(" Coin" ));
68
68
copy . Amount = Amount;
You can’t perform that action at this time.
0 commit comments