Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for hotkeyAimbotEnabled and mitigateDamage #2592

Closed
wants to merge 14 commits into from
Closed

Fix for hotkeyAimbotEnabled and mitigateDamage #2592

wants to merge 14 commits into from

Conversation

Isaakk
Copy link

@Isaakk Isaakk commented Apr 30, 2024

Description

When having hotkeyAimbotEnabled set to false you cannot manually use runes on players.
MitigateDamage function was changing the block type to armor.

Behaviour

Actual

With hotkeyAimbotEnabled set to off when trying to manually use an Ultimate Healing Rune to a player you will get the message "You cannot shot directly on players".
Any damage that is pass through the mitigateDamage function will get it's block type to armor.

Expected

With hotkeyAimbotEnabled set to off when trying to manually use an Ultimate Healing Rune to a player will work correctly.
Any damage that is pass through the mitigateDamage function do not get it's block type changed..

Fixes #2542

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested

-Download everything fresh and test it, said bugs happen.
-Do small changes to the c++ source, it work as expected.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I checked the PR checks reports
  • My changes generate no new warnings

Isaakk added 2 commits April 30, 2024 17:43
Mitigate damage function no longer change the block type to armor
Fixed not being able to manually use runes on players with hotkeyAimbotEnabled option set on false.
@pennaor
Copy link
Contributor

pennaor commented May 1, 2024

Nice!
It is really not possible to use a rune if the hotkeyAimbotEnabled is false. And your modification solves this.

But I'm not sure about the mitigation change. The block type is defined as BLOCK ARMOR only when damage <= 0. And the block type has meaning for other functions, such as the return of Game::combatBlockHit.

@Isaakk
Copy link
Author

Isaakk commented May 3, 2024

Nice! It is really not possible to use a rune if the hotkeyAimbotEnabled is false. And your modification solves this.

But I'm not sure about the mitigation change. The block type is defined as BLOCK ARMOR only when damage <= 0. And the block type has meaning for other functions, such as the return of Game::combatBlockHit.

When you block with a shield you always recieve 0 or less damage then is converted to block armor but it should not because you did not mitigated any damage. As you said the block type is important enough to not be randomly changed. Without this change is like you cannot block with a shield because you will always block with your armor. Imo the block type should never be changed.

@pennaor
Copy link
Contributor

pennaor commented May 4, 2024

Good observation. Studying more here I agree.
I also think that the DISABLE_MONSTER_ARMOR config check in Monster::getMitigation may be inverted. What do you think?

uint16_t itemId = msg.get<uint16_t>();
uint8_t tier = msg.get<uint8_t>();
g_game().playerEquipItem(player->getID(), itemId, Item::items[itemId].upgradeClassification > 0, tier);
player->sendCancelMessage("You cannot equip items by using a hotkey.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like this? These modifications don't seem to make sense. Won't this make the functionality stop working?

Copy link
Author

@Isaakk Isaakk May 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am sorry but I didn't wanted to pull this to your repository. Totally my bad, delete this. Only the initial pull is what I wanted.

@Isaakk Isaakk closed this May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hotkeyAimbotEnabled do not let you use Ultimate Healing rune manually to a party member
3 participants