About CommitSuicide
Hello, I have a question with very strange behaviour of code. So, I have a function that causes a crash:
Code:
void CPlugin::FireGameEvent( IGameEvent *event ) Code:
std::string msg = event->GetString( "text" ); Code:
CommitSuicide( pBase ); PS. Code of CommitSuicide Code:
CommitSuicide( CBaseEntity* pEntity ) |
Re: About CommitSuicide
My first thought is this:
event->GetString returns a const char* not a std::string. To my knowledge, the STL isn't supported in SRCDS at all. |
Re: About CommitSuicide
Quote:
Quote:
One major issue is that you're not checking if event is not NULL. |
Re: About CommitSuicide
Quote:
Code:
if( !event ) PS. Now I have this code: http://pastebin.com/6PtmPTjB and it doesn't work. But it works ok http://pastebin.com/H5v9QXPt. This code also dont crash server http://pastebin.com/0bTpTSYE. take note of the commented line :) |
All times are GMT -4. The time now is 10:19. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.