From b704afa14405e84e6861262d9a70e2e5ced2ffad Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 30 Dec 2021 13:25:19 -0300 Subject: [Jesusalva] Add a lot of meaningless comments --- src/map/homunculus.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/map/homunculus.c b/src/map/homunculus.c index 1a7e1d77a..054d1ec1b 100644 --- a/src/map/homunculus.c +++ b/src/map/homunculus.c @@ -311,6 +311,7 @@ static void homunculus_skillup(struct homun_data *hd, uint16 skill_id) if (hd->homunculus.vaporize != HOM_ST_ACTIVE) return; + //ShowDebug("HC Level up requested (skill %d)\n", skill_id); i = skill_id - HM_SKILLBASE; Assert_retv(i >= 0 && i < MAX_HOMUNSKILL); if (hd->homunculus.skillpts > 0 && @@ -323,20 +324,33 @@ static void homunculus_skillup(struct homun_data *hd, uint16 skill_id) // Check if pre-requisites were met if (!battle_config.skillfree) { int c = hd->homunculus.class_ - HM_CLASS_BASE; - if (hd->homunculus.intimacy < homun->dbs->skill_tree[c][i].intimacylv) + //ShowDebug("Check for homun %d tree\n", c); + //ShowDebug("Class %d Base %d Skill %d (%d - %d)\n", hd->homunculus.class_, HM_CLASS_BASE, i, skill_id, HM_SKILLBASE); + if (hd->homunculus.intimacy < homun->dbs->skill_tree[c][i].intimacylv) { stop = true; + //ShowDebug("Insufficient Intimacy: %u < %d\n", hd->homunculus.intimacy, homun->dbs->skill_tree[c][i].intimacylv); + } if (!stop) { + //ShowDebug("Don't stop, continue\n"); for (int j = 0; j < MAX_HOM_SKILL_REQUIRE; j++) { + //ShowDebug("Cycle though\n"); if (homun->dbs->skill_tree[c][i].need[j].id && homun->checkskill(hd, homun->dbs->skill_tree[c][i].need[j].id) < homun->dbs->skill_tree[c][i].need[j].lv) { + /*ShowDebug("Skill not match: %d (Lv %d / %d)\n", + homun->dbs->skill_tree[c][i].need[j].id, + homun->checkskill(hd, homun->dbs->skill_tree[c][i].need[j].id), + homun->dbs->skill_tree[c][i].need[j].lv);*/ stop = true; break; } } + //ShowDebug("Cycle finished\n"); } + //ShowDebug("Checks ended, stop is %d\n", (int)(stop)); } // Level up skill if requisites were met if (!stop) { + //ShowDebug("Homun skill LvUp OK\n"); hd->homunculus.hskill[i].lv++; hd->homunculus.skillpts-- ; status_calc_homunculus(hd, SCO_NONE); @@ -345,6 +359,8 @@ static void homunculus_skillup(struct homun_data *hd, uint16 skill_id) clif->hominfo(hd->master, hd, 0); clif->homskillinfoblock(hd->master); } + } else { + ShowDebug("Homun skill LvUp \033[1mFAIL\033[0m for master %d (Illegal request)\n", hd->homunculus.char_id); } } } -- cgit v1.2.3-60-g2f50