mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-17 18:59:09 +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)
|
||||
{
|
||||
if( fInstance->fCursor != nil )
|
||||
if ( fInstance && fInstance->fCursor )
|
||||
fInstance->fCursor->SetVisible( false );
|
||||
|
||||
plMouseDevice::bCursorOverride = (override != 0);
|
||||
@ -369,10 +369,12 @@ void plMouseDevice::ShowCursor(bool override)
|
||||
|
||||
plMouseDevice::bCursorHidden = false;
|
||||
plMouseDevice::bCursorOverride = false;
|
||||
|
||||
if( fInstance->fCursor == nil )
|
||||
fInstance->CreateCursor( fInstance->fCursorID );
|
||||
fInstance->fCursor->SetVisible( true );
|
||||
|
||||
if (fInstance) {
|
||||
if (!fInstance->fCursor)
|
||||
fInstance->CreateCursor(fInstance->fCursorID);
|
||||
fInstance->fCursor->SetVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
void plMouseDevice::NewCursor(char* cursor)
|
||||
|
Reference in New Issue
Block a user