2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-23 02:15:55 +01:00

Fix NPE in GetExternalFilesDir. Correct return value in gamepad code

This commit is contained in:
Alibek Omarov 2018-04-01 18:29:57 +03:00
parent 27b2fb55c2
commit 9c086c503a
2 changed files with 8 additions and 1 deletions

View File

@ -691,13 +691,15 @@ public class XashActivity extends Activity {
if( action == KeyEvent.ACTION_DOWN ) if( action == KeyEvent.ACTION_DOWN )
{ {
nativeHat( id, hat, val, true ); nativeHat( id, hat, val, true );
return true;
} }
else if( action == KeyEvent.ACTION_UP ) else if( action == KeyEvent.ACTION_UP )
{ {
nativeHat( id, hat, val, false ); nativeHat( id, hat, val, false );
return true;
} }
return true; return false;
} }
// Engine will bind these to AUX${val} virtual keys // Engine will bind these to AUX${val} virtual keys

View File

@ -115,6 +115,11 @@ public class FWGSLib
{ {
File f = ctx.getExternalFilesDir( null ); File f = ctx.getExternalFilesDir( null );
if( f == null )
{
f = new File( getDefaultXashPath() );
}
f.mkdirs(); f.mkdirs();
return f.getAbsolutePath(); return f.getAbsolutePath();