Required skill level: Begginer
Estimated time of work: 1 minute
Hi everyone,
Because many people from this community have helped me solve lots of issues in the past, today I’m sharing a fix for others. It addresses a frustrating problem caused by many client sources. Let’s get it resolved!
Problem:
After rotating the camera with the middle mouse button:
A special cursor (sell or buy in a shop) goes back to the normal cursor, so the sell or buy mode is lost.
The monster, NPC or player under the cursor when you release the button becomes your target (a player's menu opens), although you only rotated the camera.
[Hidden Content]
Warning! Be careful not to copy & paste the code directly, as your syntax might slightly differ.
Success! You're all set. Good luck!
Notice:
No source changes are needed. Only the return in OnMouseMiddleButtonUp is required. The one in OnMouseMiddleButtonDown has no effect and is there for consistency.
A plain middle mouse button click without moving the mouse still selects the target.
If you used the previous version of this tutorial ENABLE_MOUSE_CURSOR_RESET_FIX, remove it completely - it saved the cursor after it had already been switched to CAMERA_ROTATE and only worked because of the double call.
Sincerely,
ReFresh