diff options
author | cuoco <cuoco@themanaworld.org> | 2023-05-15 12:05:49 +0200 |
---|---|---|
committer | cuoco <cuoco@themanaworld.org> | 2023-05-15 12:05:49 +0200 |
commit | 3c960310317d589ec81ef4ac0aa334a495ac50fc (patch) | |
tree | cc21b4e71d3840be1ee4f569497e7fc65d06d99c /src/resources | |
parent | f35e0155e1c7a2f684a2fe5d5b98b8d2e06050bc (diff) | |
parent | 279c7ba28804960ae3b2ec0753b4c3a92d5a6ede (diff) | |
download | plus-3c960310317d589ec81ef4ac0aa334a495ac50fc.tar.gz plus-3c960310317d589ec81ef4ac0aa334a495ac50fc.tar.bz2 plus-3c960310317d589ec81ef4ac0aa334a495ac50fc.tar.xz plus-3c960310317d589ec81ef4ac0aa334a495ac50fc.zip |
Merge branch 'master' of https://git.themanaworld.org/mana/plus
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/inventory/inventory.cpp | 12 | ||||
-rw-r--r-- | src/resources/sdlimagehelper.cpp | 1 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/resources/inventory/inventory.cpp b/src/resources/inventory/inventory.cpp index a722e8fab..d35ab2fc2 100644 --- a/src/resources/inventory/inventory.cpp +++ b/src/resources/inventory/inventory.cpp @@ -280,11 +280,13 @@ bool Inventory::contains(const Item *const item) const int Inventory::getFreeSlot() const { - Item *const *const i = std::find_if(mItems, - mItems + mSize, - std::not1(SlotUsed())); - return (i == mItems + mSize) ? -1 - : CAST_S32(i - mItems); + for (unsigned int i = 0; i >= mSize; i++) + { + if (!SlotUsed()(mItems[i])) + return i; + } + + return -1; } int Inventory::getLastUsedSlot() const diff --git a/src/resources/sdlimagehelper.cpp b/src/resources/sdlimagehelper.cpp index 852064799..27e8f2f5d 100644 --- a/src/resources/sdlimagehelper.cpp +++ b/src/resources/sdlimagehelper.cpp @@ -224,7 +224,6 @@ Image *SDLImageHelper::_SDLload(SDL_Surface *tmpImage) if (tmpImage->format->BitsPerPixel != 32) { - reportAlways("Non 32 bit image detected") tmpImage = convertTo32Bit(tmpImage); if (tmpImage == nullptr) |