Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verbs only bound to the cursor cause a rather rude crash #22

Closed
DragoniteSpam opened this issue Aug 15, 2020 · 2 comments
Closed

Verbs only bound to the cursor cause a rather rude crash #22

DragoniteSpam opened this issue Aug 15, 2020 · 2 comments
Labels
bug 😅 We did a bad thing

Comments

@DragoniteSpam
Copy link

DragoniteSpam commented Aug 15, 2020

Ordinarily unbound verbs are just ignored, but if verbs are bound to the cursor but no keyboard keys or gamepad buttons it'll crash:

Variable <unknown_object>.consumed(100976, -2147483648) cannot be resolved.
 at gml_Script_anon___input_class_cursor_gml_GlobalScript_input_tick_17524___input_class_cursor_gml_GlobalScript_input_tick (line 487) -                 var _dx = (_struct_d.consumed? 0.0 : clamp(_struct_d.raw, 0.0, 1.0)) - (_struct_u.consumed? 0.0 : clamp(_struct_u.raw, 0.0, 1.0));
############################################################################################
gml_Script_anon___input_class_cursor_gml_GlobalScript_input_tick_17524___input_class_cursor_gml_GlobalScript_input_tick (line 487)
gml_Script_anon___input_class_player_gml_GlobalScript_input_tick_6438___input_class_player_gml_GlobalScript_input_tick (line 255) -             tick();
gml_Script_input_tick (line 20) -         global.__input_players[_p].tick();
gml_Object_World_Step_0 (line 8) - input_tick();

Either commenting out the input_cursor_verbs function or uncommenting the block at the bottom will make the crash go away.

enum InputVerbs {
    LEFT, RIGHT, UP, DOWN,
    LOOK_LEFT, LOOK_RIGHT, LOOK_UP, LOOK_DOWN,
    ...
}

input_cursor_verbs(InputVerbs.LOOK_LEFT, InputVerbs.LOOK_RIGHT, InputVerbs.LOOK_UP, InputVerbs.LOOK_DOWN, 5);

input_default_key(ord("A"), InputVerbs.LEFT);
input_default_key(ord("D"), InputVerbs.RIGHT);
input_default_key(ord("W"), InputVerbs.UP);
input_default_key(ord("S"), InputVerbs.DOWN);
/*
input_default_key(vk_left, InputVerbs.LOOK_LEFT);
input_default_key(vk_right, InputVerbs.LOOK_RIGHT);
input_default_key(vk_up, InputVerbs.LOOK_UP);
input_default_key(vk_down, InputVerbs.LOOK_DOWN);
*/
@JujuAdams JujuAdams added the bug 😅 We did a bad thing label Aug 15, 2020
@JujuAdams
Copy link
Collaborator

Thanks for reporting this bug. I'll take a look shortly.

@JujuAdams
Copy link
Collaborator

Fixed v3.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 😅 We did a bad thing
Projects
None yet
Development

No branches or pull requests

2 participants