Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd71ea91

Browse files
committed
ItemManager: Fix missing blank item type/quality cause by last commit
As it turns out, the answer to "do we need this?" is "yes".
1 parent4603877 commitd71ea91

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

‎src/ItemManager.cpp‎

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,9 @@ void ItemManager::loadTypes(const std::string& filename) {
570570
ItemType temp;
571571
ItemType* current = &temp;
572572

573+
// blank item type at index 0
574+
item_types.resize(1);
575+
573576
// @CLASS ItemManager: Types|Definition of a item types, items/types.txt...
574577
if (infile.open(filename, FileParser::MOD_FILE, FileParser::ERROR_NORMAL)) {
575578
while (infile.next()) {
@@ -615,11 +618,6 @@ void ItemManager::loadTypes(const std::string& filename) {
615618
}
616619
infile.close();
617620
}
618-
619-
// blank item type at index 0
620-
// TODO do we need this?
621-
if (item_types.empty())
622-
item_types.resize(1);
623621
}
624622

625623
/**
@@ -633,6 +631,9 @@ void ItemManager::loadQualities(const std::string& filename) {
633631
ItemQuality temp;
634632
ItemQuality* current = &temp;
635633

634+
// blank item quality at index 0
635+
item_qualities.resize(1);
636+
636637
// @CLASS ItemManager: Qualities|Definition of a item qualities, items/types.txt...
637638
if (infile.open(filename, FileParser::MOD_FILE, FileParser::ERROR_NORMAL)) {
638639
while (infile.next()) {
@@ -681,12 +682,6 @@ void ItemManager::loadQualities(const std::string& filename) {
681682
}
682683
infile.close();
683684
}
684-
685-
// blank item quality at index 0
686-
// TODO do we need this?
687-
if (item_qualities.empty())
688-
item_qualities.resize(1);
689-
690685
}
691686

692687
std::stringItemManager::getItemName(ItemID id) {

‎src/Version.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ FLARE. If not, see http://www.gnu.org/licenses/
3030

3131
#include<SDL.h>
3232

33-
VersionVersionInfo::ENGINE(1,14,197);
33+
VersionVersionInfo::ENGINE(1,14,198);
3434
VersionVersionInfo::MIN(0,0,0);
3535
VersionVersionInfo::MAX(USHRT_MAX, USHRT_MAX, USHRT_MAX);
3636

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp