Jump to content

Little Fix Autoattack


Recommended Posts

  • VIP

 

Hey M2DEV!
Today I will show you how to fix one unpleasant error related to the auto attack.
When you attack a monster automatically and for example want to move away from the monster, what do you do?
Probably you will turn off the auto attack and try to move away from the monster using the WASD keys?
Yes, but it won't work because the target doesn't reset when you try to disable the auto-attack.

Before fix:
https://imgur.com/iipNEpg

After fix:

https://imgur.com/MmTd6GH


Open file: UserInterface\PythonPlayer.h
Make
"__ClearAutoAttackTargetActorID();" public!
UWWtCn2.png


Open file: UserInterface\PythonPlayerModulec.cpp
We need to create a new method

 

PyObject * playerClearAutoAttackTargetActorID(PyObject* poSelf, PyObject* poArgs)
{
	CPythonPlayer::Instance().__ClearAutoAttackTargetActorID();
	return Py_BuildNone();
}

 

add method to s_methods[]
 

{ "ClearAutoAttackTargetActorID", playerClearAutoAttackTargetActorID, METH_VARARGS },

 

 

PU73MuY.png

 


Compile bin!

Open file: root/uitaskbar.py
search

 

elif self.EVENT_MOVE_AND_ATTACK == event:

 

replace this part:

elif self.EVENT_MOVE_AND_ATTACK == event:
	btn = self.mouseModeButtonList[dir].GetChild("button_move_and_attack")
	func = player.MBF_SMART
	player.ClearAutoAttackTargetActorID()
	tooltip_text = localeInfo.TASKBAR_ATTACK


pack root file!


P.S Please forgive me for my English, I use a GoogleTranslate

  • Love 14
Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



Shoutbox

Shoutbox

Chatroom Rules

 

Join our Discord

A request for help = Shoutbox Ban

Be respectful & Respect the rules

 

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.