1
0

Added check if datatype is present in block area (#3811)

This commit is contained in:
Lukas Pioch 2017-06-26 08:49:52 +02:00 committed by Mattes D
parent bd025e2bdb
commit beda050341

View File

@ -590,6 +590,12 @@ static int tolua_cBlockArea_RelLine(lua_State * a_LuaState)
{ {
return cManualBindings::ApiParamError(a_LuaState, "Invalid baDataTypes combination (%d).", dataTypes); return cManualBindings::ApiParamError(a_LuaState, "Invalid baDataTypes combination (%d).", dataTypes);
} }
if ((self->GetDataTypes() & dataTypes) != dataTypes)
{
return cManualBindings::ApiParamError(a_LuaState, "Requested datatypes not present in the cBlockArea. Got only 0x%02x, requested 0x%02x",
self->GetDataTypes(), dataTypes
);
}
// Draw the line: // Draw the line:
self->RelLine(p1, p2, dataTypes, blockType, blockMeta, blockLight, blockSkyLight); self->RelLine(p1, p2, dataTypes, blockType, blockMeta, blockLight, blockSkyLight);