HerculesWS / Hercules

Hercules is a collaborative software development project revolving around the creation of a robust massively multiplayer online role playing game (MMORPG) server package. Written in C, the program is very versatile and provides NPCs, warps and modifications. The project is jointly managed by a group of volunteers located around the world as well as a tremendous community providing QA and support. Hercules is a continuation of the original Athena project.
http://herc.ws
GNU General Public License v3.0
901 stars 759 forks source link

Incorrect value comparison with damage flag which is purposed for BF_* value types. #3320

Open sagunkho opened 2 months ago

sagunkho commented 2 months ago

Describe the bug In a particular part of the skill code, in function skill_attack, dmg.flag is being compared with ATK_BLOCK which is a damage_lv type enum. dmg.flag is intended for use with the BF_* type enumerator.

To Reproduce There's no need to reproduce behavior, the code is quite evident.

Expected behavior Find out the real reason for that check and recorrect it to compare with BF_* type if intended or compare dmg.dmg_lv with the damage_lv type enumator. The change of checking dmg.dmg_lv instead of dmg.flag is also intended because skill->additional_effect checks for the dmg.dmg_lv in the previous line of code. therefore leading to skill->counter_additional_effect when the function returns.

Screenshots Screenshot 2024-09-14 142521

System specs (please complete the following information):

Plugins used or source modifications none

Additional context the version i'm using is from 2019 so its pretty old but I doubt someone has checked the code.

skyleo commented 1 month ago

https://github.com/HerculesWS/Hercules/blob/84da0df5ea655c8339430d2065dbe3b0b1a40577/src/map/skill.c#L3835

same still