||(MouseY>=PANEL_TOP&&MouseX>=PANEL_LEFT&&MouseX<=RIGHT_PANEL)// allows casting spells through the sides of the main panel if it doesn't cover the whole screen
||((chrflag||questlog)&&MouseX<320&&MouseY<SPANEL_HEIGHT)||(invflag&&MouseX>RIGHT_PANEL&&MouseY<SPANEL_HEIGHT)// allows casting spells below the side panels