|
@@ -146,14 +146,14 @@ Class JoystickDevice
|
|
|
|
|
|
#rem monkeydoc Gets an attached joystick.
|
|
#rem monkeydoc Gets an attached joystick.
|
|
|
|
|
|
- `index` must be in the range [0,NumJoysticks)
|
|
|
|
|
|
+ if `index` is not in the range [0,NumJoysticks) a null value is returned.
|
|
|
|
|
|
@param index Joystick index.
|
|
@param index Joystick index.
|
|
|
|
|
|
#end
|
|
#end
|
|
Function Open:JoystickDevice( index:Int )
|
|
Function Open:JoystickDevice( index:Int )
|
|
|
|
|
|
- Assert( index>=0 And index<NumJoysticks(),"Joystick index out of range" )
|
|
|
|
|
|
+ If index<0 Or index>=NumJoysticks() Return Null
|
|
|
|
|
|
Local joystick:=_joysticks[index]
|
|
Local joystick:=_joysticks[index]
|
|
|
|
|
|
@@ -174,7 +174,6 @@ Class JoystickDevice
|
|
Endif
|
|
Endif
|
|
|
|
|
|
_joysticks[index]=joystick
|
|
_joysticks[index]=joystick
|
|
-
|
|
|
|
Endif
|
|
Endif
|
|
|
|
|
|
Return joystick
|
|
Return joystick
|