[retro-gtk] core: Replace the previous controller if it already existed



commit 68596474b9936874a94bd38d03f1679374935dcd
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Sun Mar 8 17:37:34 2020 +0500

    core: Replace the previous controller if it already existed
    
    Currently, retro_core_set_controller() on runner side only replaces the
    controller in the hash table if it wasn't there before. This is wrong,
    it should be replaced in that case.

 retro-runner/retro-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/retro-runner/retro-core.c b/retro-runner/retro-core.c
index f9f2133..80f5d6a 100644
--- a/retro-runner/retro-core.c
+++ b/retro-runner/retro-core.c
@@ -1432,7 +1432,7 @@ retro_core_set_controller (RetroCore           *self,
 
   if (controller_type == RETRO_CONTROLLER_TYPE_NONE)
     g_hash_table_remove (self->controllers, GUINT_TO_POINTER (port));
-  else if (!g_hash_table_lookup (self->controllers, GUINT_TO_POINTER (port)))
+  else
     g_hash_table_insert (self->controllers, GUINT_TO_POINTER (port),
                          retro_controller_state_new (fd));
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]