hermet pushed a commit to branch master.

http://git.enlightenment.org/games/etypers.git/commit/?id=eb2b7b7caed0d2dc6f4407134836431ed7b6edfd

commit eb2b7b7caed0d2dc6f4407134836431ed7b6edfd
Author: Hermet Park <her...@hermet.pe.kr>
Date:   Thu Feb 11 23:07:14 2016 +0900

    fix a score decreasing bug.
    
    This bug was caused by double time return key events.
---
 src/bin/etypers.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/bin/etypers.c b/src/bin/etypers.c
index 821adca..92472de 100644
--- a/src/bin/etypers.c
+++ b/src/bin/etypers.c
@@ -210,8 +210,7 @@ _update_gui(AppData *appdata)
    elm_object_part_text_set(appdata->ly, "level_value", buf);
 
    //Score
-   snprintf(buf, sizeof(buf), "%ld",
-            ((unsigned long) ((appdata->level - 1) * 1000)) + appdata->score);
+   snprintf(buf, sizeof(buf), "%ld", appdata->score);
    elm_object_part_text_set(appdata->ly, "score_value", buf);
 }
 
@@ -717,6 +716,8 @@ _key_down_cb(void *data, int type, void *event_info)
              const char *input_text = elm_object_text_get(appdata->entry);
              if (input_text)
                _enemies_kill(appdata, appdata->entry, input_text, EINA_FALSE);
+
+             return ECORE_CALLBACK_DONE;
           }
      }
    //Pause/Resume
@@ -871,15 +872,16 @@ _app_init(AppData *appdata)
 EAPI_MAIN
 int elm_main(int argc, char **argv)
 {
+   srand((unsigned int) time(NULL));
+
    AppData *appdata = calloc(1, sizeof(AppData));
    if (!appdata) return 0;
 
    elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
    elm_app_compile_bin_dir_set(PACKAGE_BIN_DIR);
    elm_app_compile_bin_dir_set(PACKAGE_DATA_DIR);
-   snprintf(EDJE_PATH, sizeof(EDJE_PATH), "%s/theme/etypers.edj", 
PACKAGE_DATA_DIR);
-   elm_theme_extension_add(NULL, EDJE_PATH);
-   srand((unsigned int) time(NULL));
+   snprintf(EDJE_PATH, sizeof(EDJE_PATH), "%s/theme/etypers.edj",
+            PACKAGE_DATA_DIR);
    ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _key_down_cb, appdata);
 
    _app_init(appdata);

-- 


Reply via email to