@@ -106,7 +106,7 @@ class BasicArmor : Armor
106
106
{
107
107
// BasicArmor that is in use is stored in the inventory as BasicArmor.
108
108
// BasicArmor that is in reserve is not.
109
- let copy = BasicArmor(Spawn(" BasicArmor " ));
109
+ let copy = BasicArmor(Spawn(GetBasicArmorClass() ));
110
110
copy . SavePercent = SavePercent != 0 ? SavePercent : 0.33335 ; // slightly more than 1/3 to avoid roundoff errors.
111
111
copy . Amount = Amount;
112
112
copy . MaxAmount = MaxAmount;
@@ -127,7 +127,7 @@ class BasicArmor : Armor
127
127
128
128
override bool HandlePickup (Inventory item)
129
129
{
130
- if (item . GetClass() == " BasicArmor" )
130
+ if (item is " BasicArmor" )
131
131
{
132
132
// You shouldn't be picking up BasicArmor anyway.
133
133
return true ;
@@ -271,13 +271,13 @@ class BasicArmorBonus : Armor
271
271
272
272
override bool Use (bool pickup)
273
273
{
274
- let armor = BasicArmor(Owner . FindInventory(" BasicArmor" ));
274
+ let armor = BasicArmor(Owner . FindInventory(" BasicArmor" , true ));
275
275
bool result = false ;
276
276
277
277
// This should really never happen but let's be prepared for a broken inventory.
278
278
if (armor == null )
279
279
{
280
- armor = BasicArmor(Spawn(" BasicArmor " ));
280
+ armor = BasicArmor(Spawn(GetBasicArmorClass() ));
281
281
armor . BecomeItem ();
282
282
armor . Amount = 0 ;
283
283
armor . MaxAmount = MaxSaveAmount;
@@ -391,12 +391,12 @@ class BasicArmorPickup : Armor
391
391
override bool Use (bool pickup)
392
392
{
393
393
int SaveAmount = GetSaveAmount();
394
- let armor = BasicArmor(Owner . FindInventory(" BasicArmor" ));
394
+ let armor = BasicArmor(Owner . FindInventory(" BasicArmor" , true ));
395
395
396
396
// This should really never happen but let's be prepared for a broken inventory.
397
397
if (armor == null )
398
398
{
399
- armor = BasicArmor(Spawn(" BasicArmor " ));
399
+ armor = BasicArmor(Spawn(GetBasicArmorClass() ));
400
400
armor . BecomeItem ();
401
401
Owner . AddInventory (armor);
402
402
}
@@ -471,7 +471,7 @@ class HexenArmor : Armor
471
471
// Like BasicArmor, HexenArmor is used in the inventory but not the map.
472
472
// health is the slot this armor occupies.
473
473
// Amount is the quantity to give (0 = normal max).
474
- let copy = HexenArmor(Spawn(" HexenArmor " ));
474
+ let copy = HexenArmor(Spawn(GetHexenArmorClass() ));
475
475
copy . AddArmorToSlot (health, Amount);
476
476
GoAwayAndDie ();
477
477
return copy;
0 commit comments