GreatEmerald
04-05-2009, 02:21 PM
I'm trying to create a weapon with several fire modes that could be switched with the alt fire. Here's the code I created:
simulated function SwitchAmmo()
{
iGrenade++;
if (iGrenade >= 6)
iGrenade = 0;
FireModeClass[0] = GrenadeTypes[iGrenade];
FireMode[0] = new(self) FireModeClass[0];
if ( FireMode[0] != None )
AmmoClass[0] = FireMode[0].AmmoClass;
InitWeaponFires();
if (FireMode[0] != None)
{
FireMode[0].ThisModeNum = 0;
FireMode[0].Weapon = self;
FireMode[0].Instigator = Instigator;
FireMode[0].Level = Level;
FireMode[0].Owner = self;
FireMode[0].PreBeginPlay();
FireMode[0].BeginPlay();
FireMode[0].PostBeginPlay();
FireMode[0].SetInitialState();
FireMode[0].PostNetBeginPlay();
}
}
Hmm, possibly I could use a cycle... But anyway, this code works fine for the most part, but whenever I exit the game or change the map, I get this error:
Log: appRequestExit(0)
Exit: Preparing to exit.
Log: Purging garbage
Log: Unbound to Window.dll
Log: Unbound to Core.dll
Log: Unbound to Engine.dll
Exit: Game engine shut down
Log: Unbound to WinDrv.dll
Exit: Windows client shut down
Log: Unbound to D3DDrv.dll
Log: Unbound to XGame.dll
Log: Unbound to IpDrv.dll
Log: Unbound to Editor.dll
Log: Unbound to Fire.dll
Log: Unbound to XInterface.dll
Log: Unbound to UWeb.dll
Log: Unbound to Onslaught.dll
Log: Unbound to ALAudio.dll
Log: Waiting for file streaming thread to finish...
Exit: OpenAL Audio subsystem shut down.
Log: (Karma): Level Karma Terminated.
Critical: UObject::GetPathName
Critical: UObject::GetPathName
Critical: UObject::GetFullName
Critical: DispatchDestroy
Critical: UObject::GetPathName
Critical: UObject::GetPathName
Critical: UObject::GetFullName
Critical: DispatchDestroys
Critical: UObject::PurgeGarbage
Critical: UObject::StaticExit
Critical: appPreExit
Critical: FMallocWindows::Free
Exit: Executing UObject::StaticShutdownAfterError
Exit: Executing UWindowsClient::ShutdownAfterError
Exit: Double fault in object ShutdownAfterError
Exit: Exiting.
What am I doing wrong?
simulated function SwitchAmmo()
{
iGrenade++;
if (iGrenade >= 6)
iGrenade = 0;
FireModeClass[0] = GrenadeTypes[iGrenade];
FireMode[0] = new(self) FireModeClass[0];
if ( FireMode[0] != None )
AmmoClass[0] = FireMode[0].AmmoClass;
InitWeaponFires();
if (FireMode[0] != None)
{
FireMode[0].ThisModeNum = 0;
FireMode[0].Weapon = self;
FireMode[0].Instigator = Instigator;
FireMode[0].Level = Level;
FireMode[0].Owner = self;
FireMode[0].PreBeginPlay();
FireMode[0].BeginPlay();
FireMode[0].PostBeginPlay();
FireMode[0].SetInitialState();
FireMode[0].PostNetBeginPlay();
}
}
Hmm, possibly I could use a cycle... But anyway, this code works fine for the most part, but whenever I exit the game or change the map, I get this error:
Log: appRequestExit(0)
Exit: Preparing to exit.
Log: Purging garbage
Log: Unbound to Window.dll
Log: Unbound to Core.dll
Log: Unbound to Engine.dll
Exit: Game engine shut down
Log: Unbound to WinDrv.dll
Exit: Windows client shut down
Log: Unbound to D3DDrv.dll
Log: Unbound to XGame.dll
Log: Unbound to IpDrv.dll
Log: Unbound to Editor.dll
Log: Unbound to Fire.dll
Log: Unbound to XInterface.dll
Log: Unbound to UWeb.dll
Log: Unbound to Onslaught.dll
Log: Unbound to ALAudio.dll
Log: Waiting for file streaming thread to finish...
Exit: OpenAL Audio subsystem shut down.
Log: (Karma): Level Karma Terminated.
Critical: UObject::GetPathName
Critical: UObject::GetPathName
Critical: UObject::GetFullName
Critical: DispatchDestroy
Critical: UObject::GetPathName
Critical: UObject::GetPathName
Critical: UObject::GetFullName
Critical: DispatchDestroys
Critical: UObject::PurgeGarbage
Critical: UObject::StaticExit
Critical: appPreExit
Critical: FMallocWindows::Free
Exit: Executing UObject::StaticShutdownAfterError
Exit: Executing UWindowsClient::ShutdownAfterError
Exit: Double fault in object ShutdownAfterError
Exit: Exiting.
What am I doing wrong?