Fixed bug at17021.

This commit is contained in:
David Anderson 2005-08-17 16:41:38 +00:00
parent 572ad38366
commit 4e8eff3e04
4 changed files with 12 additions and 14 deletions

View File

@ -244,18 +244,12 @@ void CPluginMngr::CPlugin::Finalize()
}
}
void CPluginMngr::CPlugin::pauseFunction( int id ) {
if (isValid()){
paused_fun |= (1<<id);
g_commands.clearBufforedInfo();
}
void CPluginMngr::CPlugin::pauseFunction( int id )
{
}
void CPluginMngr::CPlugin::unpauseFunction( int id ) {
if (isValid()) {
paused_fun &= ~(1<<id);
g_commands.clearBufforedInfo();
}
void CPluginMngr::CPlugin::unpauseFunction( int id )
{
}
void CPluginMngr::CPlugin::setStatus( int a ) {

View File

@ -89,7 +89,7 @@ public:
inline void setAuthor( const char* n ) { author.assign(n); }
inline void setVersion( const char* n ) { version.assign(n); }
inline void setError( const char* n ) { errorMsg.assign(n); }
inline bool isValid() const { return ((status == ps_running) && (status != ps_locked)); }
inline bool isValid() const { return ((status == ps_running || status == ps_paused)); }
inline bool isPaused() const { return ( (status == ps_paused) ); }
//inline bool isFunctionPaused( int id ) const { return (paused_fun & (1<<id)) ? true : false; }
inline bool isExecutable(int id) const { return (isValid() && !isPaused()); }

View File

@ -1914,7 +1914,8 @@ static cell AMX_NATIVE_CALL unpause(AMX *amx, cell *params) /* 3 param */
}
else
plugin = g_plugins.findPluginFast( amx);
if (plugin && plugin->isValid()) {
if (plugin && plugin->isValid() && plugin->isPaused() )
{
plugin->unpausePlugin();
return 1;
}

View File

@ -97,12 +97,15 @@ void amx_command(){
CPluginMngr::CPlugin *plugin = g_plugins.findPlugin(sPlugin);
if ( plugin && plugin->isValid() )
if ( plugin && plugin->isValid() && plugin->isPaused() )
{
plugin->unpausePlugin();
print_srvconsole("Unpaused plugin \"%s\"\n",plugin->getName() );
} else if (!plugin) {
print_srvconsole("Couldn't find plugin matching \"%s\"\n",sPlugin);
} else {
print_srvconsole("Plugin %s can't be unpaused right now.", sPlugin);
}
else print_srvconsole("Couldn't find plugin matching \"%s\"\n",sPlugin);
}
else if (!strcmp(cmd,"cvars"))