Add "on-demand" option to only spawn ammo for available weapons.

Add dedicated "Ammo Spawner" class to simplify code.
Small code duplication cleanup.
This commit is contained in:
Mari the Deer 2021-06-23 01:00:53 +02:00
commit fb0e8c45f3
14 changed files with 349 additions and 276 deletions

View file

@ -380,3 +380,25 @@ Mixin Class SWWMShellAmmo
Amount = Random[ShellDrop](1,clamp(dropamount,1,4));
}
}
// Ref class for ammo spawners, used by both on-demand replacers and bundles
Class SWWMAmmoSpawner : Actor abstract
{
virtual void SpawnAmmo() {}
override void PostBeginPlay()
{
SpawnAmmo();
ClearCounters();
Destroy();
}
default
{
+NOGRAVITY;
+NOBLOCKMAP;
+NOINTERACTION;
+NOTELEPORT;
+DONTSPLASH;
}
}