AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Module Coding (https://forums.alliedmods.net/forumdisplay.php?f=9)
-   -   MDLL_Touch = HLDS has stopped responding (just sometimes?) (https://forums.alliedmods.net/showthread.php?t=256409)

Rirre 01-26-2015 05:21

MDLL_Touch = HLDS has stopped responding (just sometimes?)
 
I'm out of ideas why this occur.
MDLL_Spawn is working all the time, but when it comes to MDLL_Touch, then it crash whenever it feels to/randomly (with "HLDS has stopped responding"). It can be the 1st time, it can be the 5th time and so on..
Code:
void GiveEntity( char* name, edict_t* player, int count ) {     string_t str = ALLOC_STRING( name );     for( int i = 0; i < count; ++i )     {         edict_t *ent;         ent = CREATE_NAMED_ENTITY( str );         if( !FNullEnt( ent ) )         {             UTIL_SetOrigin( &ent->v, player->v.origin );             ent->v.spawnflags |= SF_NORESPAWN;             (*g_engfuncs.pfnServerPrint)("Spawn\n");             MDLL_Spawn( ent );             (*g_engfuncs.pfnServerPrint)("Done, moving on to Touch\n");
            MDLL_Touch( ent, player );
            (*g_engfuncs.pfnServerPrint)("Touch done\n");         }     } }

joropito 01-27-2015 08:47

Re: MDLL_Touch = HLDS has stopped responding (just sometimes?)
 
Check give_item at fun.cpp

Are you sure it crash at _Touch?

You should copy origin values, I don't recommend to call UTIL_SetOrigin.

Also you have to delete the touched entity after touch.

Rirre 01-27-2015 12:40

Re: MDLL_Touch = HLDS has stopped responding (just sometimes?)
 
Quote:

Originally Posted by joropito (Post 2254920)
Check give_item at fun.cpp

Are you sure it crash at _Touch?

You should copy origin values, I don't recommend to call UTIL_SetOrigin.

Also you have to delete the touched entity after touch.

I have, not that much of a difference.

Yes, since it stops there and doesn't continue to "Touch done" msg.

Is:
Code:

ent->v.origin = player->v.origin;
better? Same way as in give_item()

Adding REMOVE_ENTITY(ent); after MDLL_Touch crash the server when it comes to that line (REMOVE_ENTITY).

claudiuhks 02-19-2015 01:38

Re: MDLL_Touch = HLDS has stopped responding (just sometimes?)
 
Have you fixed it?

Have you even checked FUN module's give_item?

You might check edict's Solid State before. And Touch(Entity, Player) not Touch(Player, Entity).
Don't try to invent your own methods while methods already exist. My recommendation.


All times are GMT -4. The time now is 05:39.

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