Raised This Month: $51 Target: $400
 12% 

[RAGE MODULE] Crash with FNullEnt( ) ???


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 07-07-2012 , 19:00   [RAGE MODULE] Crash with FNullEnt( ) ???
Reply With Quote #1

Hello !

I have these functions :

PHP Code:
RageHookReturn Rocket__Touchvoid* &ref_rocketCBaseEntity* &pev_toucher )
{
    static 
entvars_t *pev;
    
pev Rage->index_to_entvarRage->private_to_indexref_rocket ));

    
Rage->write_to_file_ln"debug.log""A" );
    
    if(( 
FNullEntpev ) == false ) && ( pev->classname == gIndexClassRocket ))
    {
           
Rage->write_to_file_ln"debug.log""B" );
           
// ..
    
}

    
Rage->write_to_file_ln"debug.log""C" );

    
// ...
}

// ...

void OnPluginsLoadedvoid )
{
    
Rage->get_virtual_function"Touch" )->create_with_class"info_target" )->add_module_hook(( void* ) &Rocket__TouchRageHookPre );

The problem is : sometimes, when my rocket touches a wall, the server crashes and it's in the function FNullEnt( ) ( I see it with debug.log "ABC" ... ).
To create my rocket, I use CREATE_NAMED_ENTITY( ), with the index of InfoTarget.

If someone has a idea why it crashes ...
__________________
micapat is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 07-08-2012 , 07:40   Re: [RAGE MODULE] Crash with FNullEnt( ) ???
Reply With Quote #2

PHP Code:
edict_t *eEntity INDEXENT256 );

// EITHER
if( !FNullEnteEntity ) ) { }

// OR
if( !FNullEnt( ( &( eEntity -> ) ) ) ) { } 
About Touch forward, I think it's like:

PHP Code:
void DispatchTouchedict_t *eToucheredict_t *eTouched )
{
  
// A sanity check with FNullEnt is NOT required!

  
signed long long classname = ( &( eToucher -> ) ) -> classname;
  const 
char *ccClassName STRINGclassname );

  if( !
strcmpccClassName"my_class" ) )
  {

  }

  
RETURN_METAMRES_IGNORED );

__________________

Last edited by claudiuhks; 07-08-2012 at 07:46.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 07-08-2012 , 09:40   Re: [RAGE MODULE] Crash with FNullEnt( ) ???
Reply With Quote #3

Thank you for your reply.

For FNullEnt, in my code pev is a entvars_t, so it's the same type than &( eEntity -> v ).

About Touch, it's not the metamod forward that I use but a hook of CInfoTarget::Touch( CBaseEntity *pOther ) with Rage.
__________________
micapat is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:27.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode