I have a mod that defines several weapons; some are new, some replace the stock weapons with functional equivalents based on a flexible base class (so they are not derived from the originals). However, IDKFA gives the stock weapons as well. I have found a way to prevent them being given at all or otherwise spawned:
Code: Select all
// --- DISABLE STOCK WEAPONS ---------------------------------------------------
gameinfo
{
AddEventHandlers = "DisableStockWeapons"
}
// -----------------------------------------------------------------------------
// --- DISABLE STOCK WEAPONS ---------------------------------------------------
version "4.5"
// --- DEFAULT -----------------------------------------------------------------
Class DisableStockWeapons : EventHandler
{
// =========================================================================
override void WorldThingSpawned(WorldEvent e)
{
actor thing = e.Thing;
name cn = thing.GetClassName();
switch (cn)
{
case 'Chainsaw':
case 'Pistol':
case 'Shotgun':
case 'SuperShotgun':
case 'Chaingun':
case 'RocketLauncher':
case 'PlasmaRifle':
case 'BFG9000':
thing.Destroy();
break;
}
}
// =========================================================================
}
// -----------------------------------------------------------------------------