From cbff1378fd78b6eaa59bad21759c8b89f1dab341 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Sun, 5 Feb 2017 16:00:38 +0100 Subject: Fixed bindings for cBlockArea:Read and Write. (#3568) The original bindings accepted nil as the World param, causing a crash. --- src/UI/SlotArea.cpp | 4 ++-- src/UI/SlotArea.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/UI') diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp index 52b849784..3a01d78ef 100644 --- a/src/UI/SlotArea.cpp +++ b/src/UI/SlotArea.cpp @@ -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(floor(static_cast(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; diff --git a/src/UI/SlotArea.h b/src/UI/SlotArea.h index b5809b872..f613df9af 100644 --- a/src/UI/SlotArea.h +++ b/src/UI/SlotArea.h @@ -362,7 +362,7 @@ public: virtual void OnPlayerRemoved(cPlayer & a_Player) override; /* Get the count of bookshelves who stand in the near of the enchanting table */ - int GetBookshelvesCount(cWorld * a_World); + int GetBookshelvesCount(cWorld & a_World); protected: /** Handles a click in the item slot. */ -- cgit v1.2.3