Skip to content

Commit

Permalink
Merge pull request #831 from omf2097/adt/simplify-netplay
Browse files Browse the repository at this point in the history
Simplify netplay and remove bugs
  • Loading branch information
Vagabond authored Feb 5, 2025
2 parents fdc0c33 + 2de3152 commit 0225fcc
Show file tree
Hide file tree
Showing 21 changed files with 396 additions and 215 deletions.
2 changes: 1 addition & 1 deletion src/console/console_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ int console_cmd_stun(game_state *gs, int argc, char **argv) {

int console_cmd_rein(game_state *gs, int argc, char **argv) {
scene *sc = game_state_get_scene(gs);
if(is_arena(sc->id)) {
if(scene_is_arena(sc)) {
arena_toggle_rein(sc);
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/controller/ai_controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -2598,7 +2598,7 @@ int ai_controller_poll(controller *ctrl, ctrl_event **ev) {
// Do not run AI while match is starting or ending
// XXX this prevents the AI from doing scrap/destruction moves
// XXX this could be fixed by providing a "scene changed" event
if(is_arena(game_state_get_scene(o->gs)->id) &&
if(scene_is_arena(game_state_get_scene(o->gs)) &&
arena_get_state(game_state_get_scene(o->gs)) != ARENA_STATE_FIGHTING) {

// null out selected move to fix the "AI not moving problem"
Expand Down
4 changes: 2 additions & 2 deletions src/controller/controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ enum
ACT_UP = 0x08,
ACT_DOWN = 0x10,
ACT_LEFT = 0x20,
ACT_ESC = 0x40,
ACT_RIGHT = 0x80,
ACT_RIGHT = 0x40,
ACT_ESC = 0x80,

ACT_Mask_Dirs = (ACT_UP | ACT_DOWN | ACT_LEFT | ACT_RIGHT),
};
Expand Down
2 changes: 2 additions & 0 deletions src/controller/keyboard.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "controller/keyboard.h"
#include "utils/allocator.h"
#include "utils/log.h"
#include <stdlib.h>

void keyboard_free(controller *ctrl) {
Expand All @@ -13,6 +14,7 @@ static inline void keyboard_cmd(controller *ctrl, int action, ctrl_event **ev) {
}

int keyboard_poll(controller *ctrl, ctrl_event **ev) {
DEBUG("keyboard poll");
keyboard *k = ctrl->data;
ctrl->current = 0;
const unsigned char *state = SDL_GetKeyboardState(NULL);
Expand Down
Loading

0 comments on commit 0225fcc

Please sign in to comment.