diff --git a/src/main.c b/src/main.c index a7ae77a..952ddc6 100644 --- a/src/main.c +++ b/src/main.c @@ -122,7 +122,7 @@ int main(int argc, char** argv) { // Grab the keybindings if there are any. char* str; int type, key, reverse; - for(i = 0; keybindNames[i]; i++) { + for(i = 0; strcmp(keybindNames[i],"end"); i++) { lua_getglobal(L, keybindNames[i]); str = NULL; key = -1; diff --git a/src/opengl.c b/src/opengl.c index 003e378..5d7d162 100644 --- a/src/opengl.c +++ b/src/opengl.c @@ -591,7 +591,7 @@ int gl_init(void) { DEBUG("Available fullscreen modes:"); for(i = 0; modes[i]; ++i) { DEBUG("\t%dx%d", modes[i]->w, modes[i]->h); - if(flags & SDL_FULLSCREEN && modes[i]->w == gl_screen.w && modes[i]->h == gl_screen.h) + if((flags & SDL_FULLSCREEN) && (modes[i]->w == gl_screen.w) && (modes[i]->h == gl_screen.h)) supported = 1; } } diff --git a/src/player.c b/src/player.c index 655db0f..79834c7 100644 --- a/src/player.c +++ b/src/player.c @@ -24,7 +24,7 @@ typedef struct { static Keybind** player_input; // Contains the players keybindings. // Name of each keybinding. const char* keybindNames[] = { "accel", "left", "right", "primary", "target", - "target_nearest", "mapzoomin", "mapzoomout" }; + "target_nearest", "mapzoomin", "mapzoomout", "end" }; // Need to terminate in "end". // Player stuff. Pilot* player = NULL; // extern in pilot.h @@ -394,7 +394,7 @@ void input_init(void) { player_input = malloc(i*sizeof(Keybind*)); // Create a null keybinding for each. - for(i = 0; keybindNames[i]; i++) { + for(i = 0; strcmp(keybindNames[i], "end"); i++) { tmp = MALLOC_L(Keybind); tmp->name = (char*)keybindNames[i]; tmp->type = KEYBIND_NULL;