From eb8c06743e32aded042a0905614d6715bfd49a3f Mon Sep 17 00:00:00 2001 From: Atemo Date: Sat, 21 Aug 2021 01:56:04 +0200 Subject: [PATCH] Resolves some mistakes for getAttribute (#6207) Follow-up https://github.com/rathena/rathena/commit/4d2c5b02d38bfb99e3afc4b6dfebeea2c85dbc5f Fixed #6205 Thanks to @sonniez --- src/map/clif.cpp | 2 +- src/map/status.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/map/clif.cpp b/src/map/clif.cpp index 9e6435cc44..8cbc61abac 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -6001,7 +6001,7 @@ void clif_skill_estimation(struct map_session_data *sd,struct block_list *dst) WBUFW(buf,18)= status->def_ele; for(i=0;i<9;i++) // The following caps negative attributes to 0 since the client displays them as 255-fix. [Skotlex] - WBUFB(buf,20+i)= (unsigned char)((fix=elemental_attribute_db.getAttribute(i+1,status->def_ele, status->ele_lv))<0?0:fix); + WBUFB(buf,20+i)= (unsigned char)((fix=elemental_attribute_db.getAttribute(status->ele_lv, i+1, status->def_ele))<0?0:fix); clif_send(buf,packet_len(0x18c),&sd->bl,sd->status.party_id>0?PARTY_SAMEMAP:SELF); } diff --git a/src/map/status.cpp b/src/map/status.cpp index ba7ad6122d..8353af52c8 100644 --- a/src/map/status.cpp +++ b/src/map/status.cpp @@ -16003,7 +16003,7 @@ AttributeDatabase elemental_attribute_db; * @param level Element level 1 ~ MAX_ELE_LEVEL */ int16 AttributeDatabase::getAttribute(uint16 level, uint16 atk_ele, uint16 def_ele) { - if (!CHK_ELEMENT(atk_ele) || !CHK_ELEMENT(def_ele) || !CHK_ELEMENT_LEVEL(level)) + if (!CHK_ELEMENT(atk_ele) || !CHK_ELEMENT(def_ele) || !CHK_ELEMENT_LEVEL(level+1)) return 100; return this->attr_fix_table[level][atk_ele][def_ele];