diff options
Diffstat (limited to 'src/resources/item')
-rw-r--r-- | src/resources/item/cardslist.cpp | 6 | ||||
-rw-r--r-- | src/resources/item/cardslist.h | 6 | ||||
-rw-r--r-- | src/resources/item/complexitem.cpp | 6 | ||||
-rw-r--r-- | src/resources/item/complexitem.h | 6 | ||||
-rw-r--r-- | src/resources/item/item.cpp | 6 | ||||
-rw-r--r-- | src/resources/item/item.h | 6 | ||||
-rw-r--r-- | src/resources/item/itemfieldtype.h | 6 | ||||
-rw-r--r-- | src/resources/item/itemoption.h | 6 | ||||
-rw-r--r-- | src/resources/item/itemoptionslist.h | 6 | ||||
-rw-r--r-- | src/resources/item/shopitem.cpp | 22 | ||||
-rw-r--r-- | src/resources/item/shopitem.h | 6 |
11 files changed, 42 insertions, 40 deletions
diff --git a/src/resources/item/cardslist.cpp b/src/resources/item/cardslist.cpp index e36d5f643..441dff6dd 100644 --- a/src/resources/item/cardslist.cpp +++ b/src/resources/item/cardslist.cpp @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2016-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/resources/item/cardslist.h b/src/resources/item/cardslist.h index 91b095586..616cfe702 100644 --- a/src/resources/item/cardslist.h +++ b/src/resources/item/cardslist.h @@ -1,11 +1,11 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/resources/item/complexitem.cpp b/src/resources/item/complexitem.cpp index de699e0a3..0b64d81b5 100644 --- a/src/resources/item/complexitem.cpp +++ b/src/resources/item/complexitem.cpp @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/resources/item/complexitem.h b/src/resources/item/complexitem.h index 590888cd3..667c4fe42 100644 --- a/src/resources/item/complexitem.h +++ b/src/resources/item/complexitem.h @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/resources/item/item.cpp b/src/resources/item/item.cpp index c8575bc76..eb092bc1b 100644 --- a/src/resources/item/item.cpp +++ b/src/resources/item/item.cpp @@ -1,11 +1,11 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/resources/item/item.h b/src/resources/item/item.h index 17baabe4f..a5b1fe3b6 100644 --- a/src/resources/item/item.h +++ b/src/resources/item/item.h @@ -1,11 +1,11 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/resources/item/itemfieldtype.h b/src/resources/item/itemfieldtype.h index ec0102502..dd5cf135c 100644 --- a/src/resources/item/itemfieldtype.h +++ b/src/resources/item/itemfieldtype.h @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/resources/item/itemoption.h b/src/resources/item/itemoption.h index a298c0dd3..60a55da1e 100644 --- a/src/resources/item/itemoption.h +++ b/src/resources/item/itemoption.h @@ -1,9 +1,9 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/resources/item/itemoptionslist.h b/src/resources/item/itemoptionslist.h index 7c55c7cc6..662942f7a 100644 --- a/src/resources/item/itemoptionslist.h +++ b/src/resources/item/itemoptionslist.h @@ -1,11 +1,11 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/resources/item/shopitem.cpp b/src/resources/item/shopitem.cpp index c724be7ca..e55cbcd67 100644 --- a/src/resources/item/shopitem.cpp +++ b/src/resources/item/shopitem.cpp @@ -1,11 +1,11 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -105,13 +105,16 @@ void ShopItem::updateDisplayName(const int quantity) else #endif // TMWA_SUPPORT mDisplayName = std::string(getInfo().getName(mColor)); + if (mPrice != 0) { mDisplayName.append(" (").append( UnitsDb::formatCurrency(mCurrency, mPrice)).append(") "); } - if (mShowQuantity && quantity > 1) + + if (mShowQuantity && quantity > 0) mDisplayName.append("[").append(toString(quantity)).append("]"); + if (mUsedQuantity > 0) mDisplayName.append(" +").append(toString(mUsedQuantity)); } @@ -144,8 +147,7 @@ int ShopItem::sellCurrentDuplicate(const int quantity) if (dupl == nullptr) return 0; - const int sellCount = quantity <= dupl->quantity - ? quantity : dupl->quantity; + const int sellCount = std::min(quantity, dupl->quantity); dupl->quantity -= sellCount; mQuantity -= sellCount; if (dupl->quantity == 0) @@ -158,18 +160,18 @@ int ShopItem::sellCurrentDuplicate(const int quantity) void ShopItem::increaseUsedQuantity(const int amount) { + const int newUsedQuantity = mUsedQuantity + amount; if (mShowQuantity && (mQuantity != 0)) { - if (mQuantity < mUsedQuantity + amount || - mUsedQuantity + amount < 0) + if (newUsedQuantity < 0 || mQuantity < newUsedQuantity) { return; } } - else if (mUsedQuantity + amount < 0) + else if (newUsedQuantity < 0) { return; } - mUsedQuantity += amount; + mUsedQuantity = newUsedQuantity; } diff --git a/src/resources/item/shopitem.h b/src/resources/item/shopitem.h index a69e6ac59..e66fdada3 100644 --- a/src/resources/item/shopitem.h +++ b/src/resources/item/shopitem.h @@ -1,11 +1,11 @@ /* - * The ManaPlus Client + * The ManaVerse Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2011-2020 The ManaPlus Developers - * Copyright (C) 2020-2023 The ManaVerse Developers + * Copyright (C) 2020-2025 The ManaVerse Developers * - * This file is part of The ManaPlus Client. + * This file is part of The ManaVerse Client. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by |