Skip to content

Commit

Permalink
gothic1 skill values (#423)
Browse files Browse the repository at this point in the history
  • Loading branch information
thokkat authored Mar 9, 2023
1 parent 1347153 commit 7f5ce7a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions game/ui/gamemenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1182,14 +1182,15 @@ void GameMenu::setPlayer(const Npc &pl) {
set("MENU_ITEM_ARMOR_3", pl.protection(PROT_FIRE));
set("MENU_ITEM_ARMOR_4", pl.protection(PROT_MAGIC));

const int talentMax = Gothic::inst().version().game==2 ? TALENT_MAX_G2 : TALENT_MAX_G1;
for(int i=0; i<talentMax; ++i){
const bool g2 = Gothic::inst().version().game==2;
const int talentMax = g2 ? TALENT_MAX_G2 : TALENT_MAX_G1;
for(int i=0; i<talentMax; ++i) {
auto& str = tal->get_string(size_t(i));
if(str.empty())
continue;

const int sk = pl.talentSkill(Talent(i));
const int val = pl.hitChanse(Talent(i));
const int val = g2 ? pl.hitChanse(Talent(i)) : pl.talentValue(Talent(i));

set(string_frm("MENU_ITEM_TALENT_",i,"_TITLE"), str);
set(string_frm("MENU_ITEM_TALENT_",i,"_SKILL"), strEnum(talV->get_string(size_t(i)),sk,textBuf));
Expand Down

0 comments on commit 7f5ce7a

Please sign in to comment.