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

Greeting npc on left click #1150

Closed
wants to merge 2 commits into from
Closed

Conversation

alfuveam
Copy link

@alfuveam alfuveam commented May 17, 2021

@@ -502,6 +502,10 @@ function onBattleButtonMouseRelease(self, mousePosition, mouseButton)
if self.isTarget then
g_game.cancelAttack()
else
if self.creature:isNpc() then
Copy link
Contributor

Choose a reason for hiding this comment

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

IMHO this behaviour should also be configurable through a checkbox in options. There might be servers that allows attacking an NPC.

if creatureThing:getPosition().z == localPosition.z then
if g_game.getAttackingCreature() ~= creatureThing then
menu:addOption(tr('Attack'), function() g_game.attack(creatureThing) end, shortcut)
if creatureThing:getPosition().z == localPosition.z then
Copy link
Contributor

Choose a reason for hiding this comment

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

Spacing seems to be off.

checkMaxDistanceToGreetingNpc(player, creatureThing)
return true
end
end
Copy link
Contributor

Choose a reason for hiding this comment

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

This does not seem to be right. Won't this trigger greeting by clicking any mouse button on any NPC (different floor level [pos.z])?

This should probably be implemented at those branches in the above checks (classic/non-classic controls):

 elseif creatureThing and creatureThing:getPosition().z == autoWalkPos.z

@@ -896,3 +911,11 @@ end
function limitZoom()
limitedZoom = true
end

function checkMaxDistanceToGreetingNpc(creaturePlayer, creatureNpc)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not really a check when it triggers an action, is it? :)

@diath
Copy link
Collaborator

diath commented Aug 25, 2021

Closing due to inactivity.

@diath diath closed this Aug 25, 2021
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.

None yet

3 participants