Jump to content

Fix Camera when Minimize Client


Recommended Posts

  • Bronze

An annoying bug which need a fix.

Gif with the problem (from ѕeмa™) :

125944db1258c3801207dc8f1ff5b15d25d1c0.g

// PythonApplicationProcedure.cpp
// After:
					if (m_isWindowFullScreenEnable)
					{
						__MinimizeFullScreenWindow(hWnd, m_dwWidth, m_dwHeight);
					}
// Just add:
					OnMouseMiddleButtonUp(0, 0);

 

  • Metin2 Dev 21
  • Good 5
  • Love 1
  • Love 32
Link to comment
Share on other sites

  • Bronze
5 minutes ago, ѕeмa™ said:

db1258c3801207dc8f1ff5b15d25d1c0.gifIs this what u mean?

right click, alt+tab change window and try to move the mouse  .

I know , but not all players know alt+tab.

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • 7 months later...
  • 4 weeks later...
  • 4 months later...
On 8/27/2017 at 8:41 PM, lordsas61 said:

this guy is right ,  this fix creates an error which execute when you exit the game . and it only happens if you're still on the game .

 

the ??????????????? ???? error thing pops up . 

 

its not a big deal but yeah its not also a proper fix . 

Link to comment
Share on other sites

  • 2 months later...
  • 8 months later...
  • 2 years later...
  • Premium

I am reviving this discussion to say, yeah this just causes a crash during the closing of the client. I was trying to finally tackle all the .dmp files generated and everytime they pointed to "SetCursorNum".

a2qby8l.png

 

As I fix, I did something a little bit dirty but effective.

in PythonApplicationCursor.cpp, in the function bool CPythonApplication::CreateCursors(), under:

m_bLiarCursorOn = false;

add:

m_bCursorsDestroyed = false;

 

at the end of the function void CPythonApplication::DestroyCursors(), add:

m_bCursorsDestroyed = true;

 

then modify the void CPythonApplication::__ResetCameraWhenMinimize() like this:

void CPythonApplication::__ResetCameraWhenMinimize()
{
	CCameraManager& rkCmrMgr = CCameraManager::Instance();
	CCamera* pkCmrCur = rkCmrMgr.GetCurrentCamera();
	if (pkCmrCur)
	{
		pkCmrCur->EndDrag();
	}
	if(!m_bCursorsDestroyed)
	{
		SetCursorNum(NORMAL);
		if (CURSOR_MODE_HARDWARE == GetCursorMode())
			SetCursorVisible(TRUE);
	}
}

and finally declare m_bCursorsDestroyed in PythonApplication.h under m_bCursorVisible:

NcvwlLF.png

 

 

Result:

 

daCRM8f.png

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Premium
Just now, ReFresh said:

You mean under DestroyCursor((HCURSOR) itor->second);?

Yeah, outside the for loop of course:

void CPythonApplication::DestroyCursors()
{
	TCursorHandleMap::iterator itor;
	for (itor = m_CursorHandleMap.begin(); itor != m_CursorHandleMap.end(); ++itor)
	{
		DestroyCursor((HCURSOR) itor->second);
	}
	m_bCursorsDestroyed = true;
}

 

Link to comment
Share on other sites

  • Bronze

The tutorial is very old 😅

New tutorial:

// PythonApplicationProcedure.cpp
// After:
					if (m_isWindowFullScreenEnable)
					{
						__MinimizeFullScreenWindow(hWnd, m_dwWidth, m_dwHeight);
					}
// Just add:
					OnMouseMiddleButtonUp(0, 0);

That's all! 😬

  • Metin2 Dev 1
  • Good 1
  • Love 3
Link to comment
Share on other sites

Announcements



×
×
  • 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.