mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-16 04:24:45 -07:00
fixed weird NULL pointer at main menu
This commit is contained in:
60
applications/external/tanksgame/tanks_game.c
vendored
60
applications/external/tanksgame/tanks_game.c
vendored
@@ -1286,39 +1286,43 @@ int32_t tanks_game_app(void* p) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case InputKeyRight:
|
case InputKeyRight:
|
||||||
if(tanks_state->state == GameStateCooperativeClient) {
|
if(!(tanks_state->state == GameStateMenu)) {
|
||||||
FuriString* goesRight = furi_string_alloc();
|
if(tanks_state->state == GameStateCooperativeClient) {
|
||||||
char arr[2];
|
FuriString* goesRight = furi_string_alloc();
|
||||||
arr[0] = GoesRight;
|
char arr[2];
|
||||||
arr[1] = 0;
|
arr[0] = GoesRight;
|
||||||
furi_string_set(goesRight, (char*)&arr);
|
arr[1] = 0;
|
||||||
|
furi_string_set(goesRight, (char*)&arr);
|
||||||
|
|
||||||
subghz_tx_rx_worker_write(
|
subghz_tx_rx_worker_write(
|
||||||
subghz_txrx,
|
subghz_txrx,
|
||||||
(uint8_t*)furi_string_get_cstr(goesRight),
|
(uint8_t*)furi_string_get_cstr(goesRight),
|
||||||
strlen(furi_string_get_cstr(goesRight)));
|
strlen(furi_string_get_cstr(goesRight)));
|
||||||
furi_string_free(goesRight);
|
furi_string_free(goesRight);
|
||||||
} else {
|
} else {
|
||||||
tanks_state->p1->moving = true;
|
tanks_state->p1->moving = true;
|
||||||
tanks_state->p1->direction = DirectionRight;
|
tanks_state->p1->direction = DirectionRight;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case InputKeyLeft:
|
case InputKeyLeft:
|
||||||
if(tanks_state->state == GameStateCooperativeClient) {
|
if(!(tanks_state->state == GameStateMenu)) {
|
||||||
FuriString* goesLeft = furi_string_alloc();
|
if(tanks_state->state == GameStateCooperativeClient) {
|
||||||
char arr[2];
|
FuriString* goesLeft = furi_string_alloc();
|
||||||
arr[0] = GoesLeft;
|
char arr[2];
|
||||||
arr[1] = 0;
|
arr[0] = GoesLeft;
|
||||||
furi_string_set(goesLeft, (char*)&arr);
|
arr[1] = 0;
|
||||||
|
furi_string_set(goesLeft, (char*)&arr);
|
||||||
|
|
||||||
subghz_tx_rx_worker_write(
|
subghz_tx_rx_worker_write(
|
||||||
subghz_txrx,
|
subghz_txrx,
|
||||||
(uint8_t*)furi_string_get_cstr(goesLeft),
|
(uint8_t*)furi_string_get_cstr(goesLeft),
|
||||||
strlen(furi_string_get_cstr(goesLeft)));
|
strlen(furi_string_get_cstr(goesLeft)));
|
||||||
furi_string_free(goesLeft);
|
furi_string_free(goesLeft);
|
||||||
} else {
|
} else {
|
||||||
tanks_state->p1->moving = true;
|
tanks_state->p1->moving = true;
|
||||||
tanks_state->p1->direction = DirectionLeft;
|
tanks_state->p1->direction = DirectionLeft;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case InputKeyOk:
|
case InputKeyOk:
|
||||||
|
|||||||
Reference in New Issue
Block a user