DakaSenpai99 2 Posted September 28, 2024 Share Posted September 28, 2024 (edited) Hello, 2-3 days ago I encountered a small bug, and it took me a while to figure out what the problem was. Q: What does this bug consist of? When you mount/unmount with an active affect, it decreases your HP/MP." Like : https://metin2.download/video/lyZ8QAZR6iDE0uA8zaFoul4ch0s7VtYx/.mp4 Let's fix it. Open char.cpp and search : void CHARACTER::ComputePoints() then search on that functions : SetMaxStamina(iMaxStamina); add under like : SetMaxStamina(iMaxStamina); int iCurHP = this->GetHP(); int iCurSP = this->GetSP(); then on that function too search : CPetSystem* pPetSystem = GetPetSystem(); if (NULL != pPetSystem) / u will have like this ComputeSkillPoints(); RefreshAffect(); CPetSystem* pPetSystem = GetPetSystem(); if (NULL != pPetSystem) { pPetSystem->RefreshBuff(); } for (TMapBuffOnAttrs::iterator it = m_map_buff_on_attrs.begin(); it != m_map_buff_on_attrs.end(); it++) { it->second->GiveAllAttributes(); } UpdatePacket(); } just make it like this ComputeSkillPoints(); RefreshAffect(); if (IsPC()) { CPetSystem * pPetSystem = GetPetSystem(); if (pPetSystem) pPetSystem->RefreshBuff(); // @Fixed Hp/Mp mount/unmount if (this->GetHP() != iCurHP) this->PointChange(POINT_HP, iCurHP-this->GetHP()); if (this->GetSP() != iCurSP) this->PointChange(POINT_SP, iCurSP-this->GetSP()); } UpdatePacket(); } like u copy just this if (IsPC()) { CPetSystem * pPetSystem = GetPetSystem(); if (pPetSystem) pPetSystem->RefreshBuff(); // @Fixed Hp/Mp mount/unmount if (this->GetHP() != iCurHP) this->PointChange(POINT_HP, iCurHP-this->GetHP()); if (this->GetSP() != iCurSP) this->PointChange(POINT_SP, iCurSP-this->GetSP()); } UpdatePacket(); } I know that it mentions the pet system there, but this solution resolved the mount/unmount HP/MP decrease issue AFTER: https://metin2.download/video/hSGH8YjPmSZ7R4dGrdBpovaluRK47GC1/.mp4 Edited September 28, 2024 by Metin2 Dev International Core X - External 2 Internal 2 Link to comment https://metin2.dev/topic/33038-fix-mount-hpmp-unmount-mount-affects/ Share on other sites More sharing options...
Premium TAUMP 994 Posted September 29, 2024 Premium Share Posted September 29, 2024 Yep, copy paste from Martysama source, kek Link to comment https://metin2.dev/topic/33038-fix-mount-hpmp-unmount-mount-affects/#findComment-167252 Share on other sites More sharing options...
DakaSenpai99 2 Posted September 29, 2024 Author Share Posted September 29, 2024 12 minutes ago, TAUMP said: Yep, copy paste from Martysama source, kek It doesn’t matter where the fix comes from, as long as it works and solves the problem. Not everyone is a "PRO" dev, and that's perfectly fine. What matters is that you found a solution, even if it wasn’t online but in the source code. Everyone has their own learning path, and it’s normal not to find every answer on the internet. The important thing is that you adapted and figured it out. You don’t have to be a pro to make progress or solve problems—every achievement counts. Link to comment https://metin2.dev/topic/33038-fix-mount-hpmp-unmount-mount-affects/#findComment-167254 Share on other sites More sharing options...
Mafuyu 55 Posted September 29, 2024 Share Posted September 29, 2024 and what happens with for (TMapBuffOnAttrs::iterator it = m_map_buff_on_attrs.begin(); it != m_map_buff_on_attrs.end(); it++) { it->second->GiveAllAttributes(); } ?? Link to comment https://metin2.dev/topic/33038-fix-mount-hpmp-unmount-mount-affects/#findComment-167260 Share on other sites More sharing options...
DakaSenpai99 2 Posted September 29, 2024 Author Share Posted September 29, 2024 4 minutes ago, Mafuyu said: and what happens with for (TMapBuffOnAttrs::iterator it = m_map_buff_on_attrs.begin(); it != m_map_buff_on_attrs.end(); it++) { it->second->GiveAllAttributes(); } ?? Nothing will happen, it's from the Ymir source, so it won't cause any issues because most likely a pointer this . This is the default function. Link to comment https://metin2.dev/topic/33038-fix-mount-hpmp-unmount-mount-affects/#findComment-167262 Share on other sites More sharing options...
Mafuyu 55 Posted September 29, 2024 Share Posted September 29, 2024 so delete it? move it above your new block? what should we do with it? you removed it in your code Link to comment https://metin2.dev/topic/33038-fix-mount-hpmp-unmount-mount-affects/#findComment-167264 Share on other sites More sharing options...
Active+ Member Thorek 344 Posted September 29, 2024 Active+ Member Share Posted September 29, 2024 4 minutes ago, Mafuyu said: so delete it? move it above your new block? what should we do with it? you removed it in your code He took this code from a leaked source, so he probably doesn't even know. 1 Link to comment https://metin2.dev/topic/33038-fix-mount-hpmp-unmount-mount-affects/#findComment-167265 Share on other sites More sharing options...
Evo 6 Posted September 30, 2024 Share Posted September 30, 2024 Quote It's from the Ymir source, so it won't cause any issues Link to comment https://metin2.dev/topic/33038-fix-mount-hpmp-unmount-mount-affects/#findComment-167282 Share on other sites More sharing options...
DakaSenpai99 2 Posted September 30, 2024 Author Share Posted September 30, 2024 (edited) I posted this just to help others, yes, it's from Marty Fix, but I don't think we need to be so mean and mock it. If it doesn't help you at all, I ask for this post to be deleted, and that's all. I posted this because I couldn't find a solution on the internet, and not all of us are PROs in C++. I was hoping it would help others as well. Edited September 30, 2024 by DakaSenpai99 1 Link to comment https://metin2.dev/topic/33038-fix-mount-hpmp-unmount-mount-affects/#findComment-167283 Share on other sites More sharing options...
Evo 6 Posted September 30, 2024 Share Posted September 30, 2024 24 minutes ago, DakaSenpai99 said: I posted this just to help others, yes, it's from Marty Fix, but I don't think we need to be so mean and mock it. If it doesn't help you at all, I ask for this post to be deleted, and that's all. I posted this because I couldn't find a solution on the internet, and not all of us are PROs in C++. I was hoping it would help others as well. Sure, but first you need to analyze why marty get rid of that part and find this solution if you want to contribute instead of copy paste his edit. My laugh is not about that but becouse of this part: "It's from the Ymir source, so it won't cause any issues" Probably become my new motto. Link to comment https://metin2.dev/topic/33038-fix-mount-hpmp-unmount-mount-affects/#findComment-167284 Share on other sites More sharing options...
Mafuyu 55 Posted September 30, 2024 Share Posted September 30, 2024 so still people dont know what to make with the missing part. Link to comment https://metin2.dev/topic/33038-fix-mount-hpmp-unmount-mount-affects/#findComment-167289 Share on other sites More sharing options...
DakaSenpai99 2 Posted October 1, 2024 Author Share Posted October 1, 2024 20 hours ago, Mafuyu said: so still people dont know what to make with the missing part. it->second is the value the object associated with the key in the map, meaning the object containing the buff. GiveAllAttributes() is a method called on that object likely an active buff that applies all attributes (stats or effects) to a character or entity. Thus, the function ensures that all buffs in m_map_buff_on_attrs apply their attributes to the associated character or entity. Link to comment https://metin2.dev/topic/33038-fix-mount-hpmp-unmount-mount-affects/#findComment-167301 Share on other sites More sharing options...
Recommended Posts
Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now