mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 03:09:13 +00:00
Fix plMouseDevice crash
plMouseDevice::HideCursor can crash if it is called before the cursor is created. This happens if the client pops up a disconnected dialog before initialization is complete. I've seen it happen!
This commit is contained in:
@ -352,7 +352,7 @@ void plMouseDevice::SetCursorY(float y)
|
|||||||
|
|
||||||
void plMouseDevice::HideCursor(bool override)
|
void plMouseDevice::HideCursor(bool override)
|
||||||
{
|
{
|
||||||
if( fInstance->fCursor != nil )
|
if ( fInstance && fInstance->fCursor )
|
||||||
fInstance->fCursor->SetVisible( false );
|
fInstance->fCursor->SetVisible( false );
|
||||||
|
|
||||||
plMouseDevice::bCursorOverride = (override != 0);
|
plMouseDevice::bCursorOverride = (override != 0);
|
||||||
@ -369,10 +369,12 @@ void plMouseDevice::ShowCursor(bool override)
|
|||||||
|
|
||||||
plMouseDevice::bCursorHidden = false;
|
plMouseDevice::bCursorHidden = false;
|
||||||
plMouseDevice::bCursorOverride = false;
|
plMouseDevice::bCursorOverride = false;
|
||||||
|
|
||||||
if( fInstance->fCursor == nil )
|
if (fInstance) {
|
||||||
fInstance->CreateCursor( fInstance->fCursorID );
|
if (!fInstance->fCursor)
|
||||||
fInstance->fCursor->SetVisible( true );
|
fInstance->CreateCursor(fInstance->fCursorID);
|
||||||
|
fInstance->fCursor->SetVisible(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void plMouseDevice::NewCursor(char* cursor)
|
void plMouseDevice::NewCursor(char* cursor)
|
||||||
|
Reference in New Issue
Block a user