Skip to content

Commit

Permalink
[kernel] fix: add missing save effect limits
Browse files Browse the repository at this point in the history
  • Loading branch information
jd28 committed Nov 30, 2024
1 parent d287bea commit a698c28
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/nw/kernel/EffectSystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ struct EffectLimits {
std::pair<int, int> ability{-12, 12};
std::pair<int, int> armor_class{-20, 20};
std::pair<int, int> attack{-20, 20};
std::pair<int, int> saves{-20, 20};
std::pair<int, int> skill{-50, 50};
};

Expand Down
3 changes: 2 additions & 1 deletion lib/nw/profiles/nwn1/functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1455,7 +1455,8 @@ int saving_throw(const nw::ObjectBase* obj, nw::Save type, nw::SaveVersus type_v
++it;
}

return result + std::clamp(inc - dec, -20, 20);
auto [smin, smax] = nw::kernel::effects().limits.saves;
return result + std::clamp(inc - dec, smin, smax);
}

bool resolve_saving_throw(const nw::ObjectBase* obj, nw::Save type, int dc,
Expand Down

0 comments on commit a698c28

Please sign in to comment.