1
0

Fixed bindings for cBlockArea:Read and Write. (#3568)

The original bindings accepted nil as the World param, causing a crash.
This commit is contained in:
Mattes D
2017-02-05 16:00:38 +01:00
committed by GitHub
parent 77f456fc98
commit cbff1378fd
10 changed files with 23 additions and 23 deletions

View File

@@ -1576,7 +1576,7 @@ void cSlotAreaEnchanting::UpdateResult(cPlayer & a_Player)
if (cItem::IsEnchantable(Item.m_ItemType) && Item.m_Enchantments.IsEmpty())
{
int Bookshelves = std::min(GetBookshelvesCount(a_Player.GetWorld()), 15);
int Bookshelves = std::min(GetBookshelvesCount(*a_Player.GetWorld()), 15);
cFastRandom Random;
int Base = (Random.GenerateRandomInteger(1, 8) + static_cast<int>(floor(static_cast<float>(Bookshelves / 2)) + Random.GenerateRandomInteger(0, Bookshelves)));
@@ -1600,7 +1600,7 @@ void cSlotAreaEnchanting::UpdateResult(cPlayer & a_Player)
int cSlotAreaEnchanting::GetBookshelvesCount(cWorld * a_World)
int cSlotAreaEnchanting::GetBookshelvesCount(cWorld & a_World)
{
int Bookshelves = 0;
cBlockArea Area;