Skip to content

Commit

Permalink
hack
Browse files Browse the repository at this point in the history
* quickfix for items without extra data. for example plain swords dual
  wield
  • Loading branch information
mlthelama committed Dec 28, 2023
1 parent 8cae9b4 commit ccc58d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/equip/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ namespace equip {
extra_data->GetCount(),
worn_right,
worn_left);
if (!worn_right && !worn_left) {
if (!worn_right || !worn_left) {
extra_vector.push_back(extra_data);
}
}
Expand All @@ -75,6 +75,7 @@ namespace equip {
return;
}

logger::debug("extra vector is {}"sv, extra_vector.size());
auto* extra_handler = handle::extra_data_holder::get_singleton();
if (extra_handler->is_form_set(a_form)) {
auto extra_list = extra_handler->get_extra_list_for_form(a_form);
Expand All @@ -87,6 +88,13 @@ namespace equip {
if (!extra_vector.empty()) {
extra = extra_vector.back();
extra_vector.pop_back(); //remove last item, because we already use that
if (extra_vector.empty() && ((left && extra->HasType(RE::ExtraDataType::kWorn) ||
(!left && extra->HasType(RE::ExtraDataType::kWornLeft))))) {
extra = nullptr;
} else if (!extra_vector.empty()) {
extra = extra_vector.back();
extra_vector.pop_back(); //remove last item, because we already use that
}
extra_handler->init_extra_data(a_form, extra_vector);
logger::trace("set {} extra data for form {}"sv, extra_vector.size(), a_form->GetName());
}
Expand Down
3 changes: 2 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ void init_logger() {
log->flush_on(spdlog::level::info);

spdlog::set_default_logger(std::move(log));
spdlog::set_pattern("[%H:%M:%S.%f][%s(%#)][%!][%l] %v"s);
//spdlog::set_pattern("[%H:%M:%S.%f][%s(%#)][%!][%l] %v"s);
spdlog::set_pattern("[%H:%M:%S.%f] %s(%#) [%^%l%$] %v"s);

logger::info("{} v{}"sv, Version::PROJECT, Version::NAME);

Expand Down

0 comments on commit ccc58d6

Please sign in to comment.