@@ -66,7 +66,7 @@ AMX *suspendedAMX = NULL;
66
66
67
67
// amxLoadPlugin(pluginName)
68
68
int CFunctions::amxLoadPlugin (lua_State *luaVM) {
69
- static const char *requiredExports[] = { " Load" , " Unload " , " Supports" , 0 };
69
+ static const char *requiredExports[] = { " Load" , " Supports" , 0 };
70
70
71
71
const char *pluginName = luaL_checkstring (luaVM, 1 );
72
72
if (!pluginName || loadedPlugins.find (pluginName) != loadedPlugins.end () || !isSafePath (pluginName)) {
@@ -218,7 +218,7 @@ int CFunctions::amxLoad(lua_State *luaVM) {
218
218
lua_getfield (luaVM, LUA_REGISTRYINDEX, " amx" );
219
219
lua_getfield (luaVM, -1 , resName);
220
220
if (lua_isnil (luaVM, -1 )) {
221
- lua_newtable (luaVM);
221
+ lua_newtable (luaVM);
222
222
lua_setfield (luaVM, -3 , resName);
223
223
}
224
224
@@ -403,7 +403,10 @@ int CFunctions::amxUnload(lua_State *luaVM) {
403
403
// amxUnloadAllPlugins()
404
404
int CFunctions::amxUnloadAllPlugins (lua_State *luaVM) {
405
405
for (map< string, SampPlugin* >::iterator it = loadedPlugins.begin (); it != loadedPlugins.end (); it++) {
406
- it->second ->Unload ();
406
+ Unload_t* Unload = it->second ->Unload ;
407
+ if (Unload) {
408
+ Unload ();
409
+ }
407
410
freeLib (it->second ->pPluginPointer );
408
411
delete it->second ;
409
412
}
0 commit comments