Intermitant client crash, in the engine apparently

Grab your favourite IDE and tinker with the innards of game engines

Intermitant client crash, in the engine apparently

Postby ChromeAngel on Thu Nov 17, 2011 9:51 pm

i'm using a game message to communicate between one of my custom weapons and an indicator on the HUD. Occasionally this appears to cause the client to crash, somewhere in engine.dll .

In the weapon:
Code: Select all
void CEX_Bolter::BroadcastMode(bool IsRapid)
{
#ifdef CLIENT_DLL
   IGameEvent * pEvt = gameeventmanager->CreateEvent( "ex_bolter_mode" );
   
   if ( pEvt )
   {
      pEvt->SetBool( "IsRapid", IsRapid );
      gameeventmanager->FireEvent( pEvt );
   }
#endif
};


In the HUD element:
Code: Select all
void C_EX_HumanHUD::FireGameEvent( IGameEvent *event )
{
   if ( FStrEq( event->GetName(), "ex_bolter_mode" ))
   {
      if( event->GetBool( "IsRapid" ) )
      {
         pModeIndicatorImage->SetImage( "ex/imp_rapid_mode.vmt" );
      } else {
         pModeIndicatorImage->SetImage( "ex/imp_basic_mode.vmt" );
      }
   }
};


90% of the time it work, just occasionally it crashed the client back to the desktop. Can anyone see what i'm doing wrong here?
User avatar
ChromeAngel
Member
Member
 
Joined: Fri Oct 21, 2011 7:28 am
Location: England

Re: Intermitant client crash, in the engine apparently

Postby zombie@computer on Thu Nov 17, 2011 10:17 pm

begin with 'if (event)' in FireGameEvent? I'm guessing it's possible to get there with a nulled event, but its just guessing. Can't you debug the crash?
When you are up to your neck in shit, keep your head up high
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

Re: Intermitant client crash, in the engine apparently

Postby ChromeAngel on Fri Nov 18, 2011 7:40 am

It's really intermittent, so i'm having to work from the MDMP. According to the call stack it gets as far as the line
Code: Select all
gameeventmanager->FireEvent( pEvt );

in BroadcastMode then delves into engine.DLL where it crashes.
User avatar
ChromeAngel
Member
Member
 
Joined: Fri Oct 21, 2011 7:28 am
Location: England

Re: Intermitant client crash, in the engine apparently

Postby ChromeAngel on Sat May 05, 2012 5:26 am

Fixed. In the end I got rid of the event and had the weapon find the HUD element in BroadcastMode and tell it directly. It's less flexible, but it works.
User avatar
ChromeAngel
Member
Member
 
Joined: Fri Oct 21, 2011 7:28 am
Location: England

Re: Intermitant client crash, in the engine apparently

Postby zombie@computer on Sat May 05, 2012 5:42 pm

Took you a while :)
When you are up to your neck in shit, keep your head up high
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

Return to Programming

Who is online

Users browsing this forum: No registered users