Removing Grenade Entity Before Explosion
Is there any known bug with removing a grenade entity multiple times before it explodes, like making the game crash or something?
I'm working on this plugin where you can throw a camera like a grenade for recon. I take a smokegrenade and right before it detonates I remove it and place an entity there that acts as the camera and I see what it sees. About several minutes into the game it sometimes crashes for no apparent reason. I was either shooting a bot or just walking around minutes away from the last cam I threw. I'm not sure which part is the problem since it doesn't create a log, only a minidump that I can't read. And my best bet is the removal of grenade entities. Anyone have relevant information would be much appreciated... |
Re: Removing Grenade Entity Before Explosion
1. Don't you have log errors?
2. Search in my thread "help with okapi" ive maded something similar . |
Re: Removing Grenade Entity Before Explosion
Quote:
I see how the thread can be related. But I only asked if anyone had an idea if removing grenades would cause the game to crash. The thing is 90% complete and I'm not too keen in converting the whole of it to Okapi. But you gave me an idea. I found the approved Teleport Nade plugin here and will try to emulate that instead, thank you... |
Re: Removing Grenade Entity Before Explosion
Show the code.
|
Re: Removing Grenade Entity Before Explosion
Quote:
I know, it seems dumb, asking for help without posting code. But I only asked if anyone had any idea if this would make the game crash. Nevertheless, Craxor gave me an idea for a possible solution so I think we're all good. PS: If you're wondering about my code, the gist is it's hooked on FM_SetModel. Inside there's a timed task that removes the grenade entity with remove_entity(). And the timer is set a few milliseconds before detonation. I've also made liberal use of pev_valid... |
Re: Removing Grenade Entity Before Explosion
Alright, a solution don't use remove_entity, use instead the other method which is by setting an entity flags to FL_KILLME then call entity think, its more reliable safer way !
|
Re: Removing Grenade Entity Before Explosion
Quote:
I made this stock. Did I do it properly?... PHP Code:
|
Re: Removing Grenade Entity Before Explosion
Yes, but you don't need to set up next think
So basically remove this... Code:
set_pev(ent, pev_nextthink, get_gametime() + 0.01); |
Re: Removing Grenade Entity Before Explosion
Quote:
|
All times are GMT -4. The time now is 12:05. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.