summaryrefslogtreecommitdiffstats
path: root/src/Bindings
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-12-05 16:59:11 +0100
committerMattes D <github@xoft.cz>2014-12-05 16:59:11 +0100
commite2a04f580a0813206f527a61244cb3382248fd12 (patch)
tree39f0a5026d619e89ce353cf8addf18e4a696b067 /src/Bindings
parentCheckBasicStyle: Added a check for parentheses around comparisons. (diff)
downloadcuberite-e2a04f580a0813206f527a61244cb3382248fd12.tar
cuberite-e2a04f580a0813206f527a61244cb3382248fd12.tar.gz
cuberite-e2a04f580a0813206f527a61244cb3382248fd12.tar.bz2
cuberite-e2a04f580a0813206f527a61244cb3382248fd12.tar.lz
cuberite-e2a04f580a0813206f527a61244cb3382248fd12.tar.xz
cuberite-e2a04f580a0813206f527a61244cb3382248fd12.tar.zst
cuberite-e2a04f580a0813206f527a61244cb3382248fd12.zip
Diffstat (limited to 'src/Bindings')
-rw-r--r--src/Bindings/DeprecatedBindings.cpp14
-rw-r--r--src/Bindings/PluginManager.cpp9
2 files changed, 21 insertions, 2 deletions
diff --git a/src/Bindings/DeprecatedBindings.cpp b/src/Bindings/DeprecatedBindings.cpp
index 95cd9c4f7..6dd6a4e59 100644
--- a/src/Bindings/DeprecatedBindings.cpp
+++ b/src/Bindings/DeprecatedBindings.cpp
@@ -52,7 +52,9 @@ static int tolua_get_AllToLua_g_BlockSpreadLightFalloff(lua_State* tolua_S)
{
tolua_Error tolua_err;
if (!tolua_isnumber(tolua_S, 2, 0, &tolua_err))
+ {
tolua_error(tolua_S, "#vinvalid type in array indexing.", &tolua_err);
+ }
}
#endif
BlockType = (int)tolua_tonumber(tolua_S, 2, 0);
@@ -78,7 +80,9 @@ static int tolua_get_AllToLua_g_BlockTransparent(lua_State* tolua_S)
{
tolua_Error tolua_err;
if (!tolua_isnumber(tolua_S, 2, 0, &tolua_err))
+ {
tolua_error(tolua_S, "#vinvalid type in array indexing.", &tolua_err);
+ }
}
#endif
BlockType = (int)tolua_tonumber(tolua_S, 2, 0);
@@ -104,7 +108,9 @@ static int tolua_get_AllToLua_g_BlockOneHitDig(lua_State* tolua_S)
{
tolua_Error tolua_err;
if (!tolua_isnumber(tolua_S, 2, 0, &tolua_err))
+ {
tolua_error(tolua_S, "#vinvalid type in array indexing.", &tolua_err);
+ }
}
#endif
BlockType = (int)tolua_tonumber(tolua_S, 2, 0);
@@ -130,7 +136,9 @@ static int tolua_get_AllToLua_g_BlockPistonBreakable(lua_State* tolua_S)
{
tolua_Error tolua_err;
if (!tolua_isnumber(tolua_S, 2, 0, &tolua_err))
+ {
tolua_error(tolua_S, "#vinvalid type in array indexing.", &tolua_err);
+ }
}
#endif
BlockType = (int)tolua_tonumber(tolua_S, 2, 0);
@@ -156,7 +164,9 @@ static int tolua_get_AllToLua_g_BlockIsSnowable(lua_State* tolua_S)
{
tolua_Error tolua_err;
if (!tolua_isnumber(tolua_S, 2, 0, &tolua_err))
+ {
tolua_error(tolua_S, "#vinvalid type in array indexing.", &tolua_err);
+ }
}
#endif
BlockType = (int)tolua_tonumber(tolua_S, 2, 0);
@@ -182,7 +192,9 @@ static int tolua_get_AllToLua_g_BlockIsSolid(lua_State* tolua_S)
{
tolua_Error tolua_err;
if (!tolua_isnumber(tolua_S, 2, 0, &tolua_err))
+ {
tolua_error(tolua_S, "#vinvalid type in array indexing.", &tolua_err);
+ }
}
#endif
BlockType = (int)tolua_tonumber(tolua_S, 2, 0);
@@ -208,7 +220,9 @@ static int tolua_get_AllToLua_g_BlockFullyOccupiesVoxel(lua_State* tolua_S)
{
tolua_Error tolua_err;
if (!tolua_isnumber(tolua_S, 2, 0, &tolua_err))
+ {
tolua_error(tolua_S, "#vinvalid type in array indexing.", &tolua_err);
+ }
}
#endif
BlockType = (int)tolua_tonumber(tolua_S, 2, 0);
diff --git a/src/Bindings/PluginManager.cpp b/src/Bindings/PluginManager.cpp
index f951f6221..406a540f4 100644
--- a/src/Bindings/PluginManager.cpp
+++ b/src/Bindings/PluginManager.cpp
@@ -1459,11 +1459,16 @@ cPluginManager::CommandResult cPluginManager::HandleCommand(cPlayer & a_Player,
-cPlugin * cPluginManager::GetPlugin( const AString & a_Plugin) const
+cPlugin * cPluginManager::GetPlugin(const AString & a_Plugin) const
{
for (PluginMap::const_iterator itr = m_Plugins.begin(); itr != m_Plugins.end(); ++itr)
{
- if (itr->second == nullptr) continue;
+ if (itr->second == nullptr)
+ {
+ // The plugin is currently unloaded
+ continue;
+ }
+
if (itr->second->GetName().compare(a_Plugin) == 0)
{
return itr->second;