This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository minilauncher-for-slippi.

View the commit online.

commit 041ebbf1b59fd33b758cbdef8d221985c38518bc
Author: Nekobit <m...@ow.nekobit.net>
AuthorDate: Tue Sep 12 12:58:18 2023 -0400

    Fix half-broken Replays (slippi bug?)
---
 input.c  |  4 ++--
 replay.c | 10 ++++++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/input.c b/input.c
index c99de91..e7bb3ed 100644
--- a/input.c
+++ b/input.c
@@ -27,9 +27,9 @@ Eina_Bool
 _scroll_loop_cb(void* data)
 {
 	int x, y, w, h;
-	elm_scroller_region_get(mainer, &x, &y, &w, &h);
+	//elm_scroller_region_get(mainer, &x, &y, &w, &h);
 	y += y_mod;
-	elm_scroller_region_show(mainer, x, y, w, h);
+	//elm_scroller_region_show(mainer, x, y, w, h);
 	return EINA_TRUE;
 }
 
diff --git a/replay.c b/replay.c
index bf5806d..7636b44 100644
--- a/replay.c
+++ b/replay.c
@@ -58,6 +58,7 @@ ubjson_search(unsigned char* buf, long length, char const* key, long* offset)
 {
 	size_t key_len = strlen(key);
 	char* start = sstrstr(buf, key, length);
+	if (!start) return NULL;
 	start += key_len;
 	// Just 8 bits for now...
 	uint8_t value_len = start[0];
@@ -167,14 +168,19 @@ replays_strings(void* data, Evas_Object* obj, const char* part)
 {
 	long idx = data;
 	// Check this is text for the part we're expecting
-	if (strcmp(part, "elm.text") == 0)
+	if (strcmp(part, "elm.text") == 0 &&
+	    /* DQ after join */
+	    (replays[idx].p1 != NULL && replays[idx].p2 != NULL))
 	{
 		char* c;
-		asprintf(&c, "%s | %s [%s] Vs. %s [%s]", gameend2str(replays[idx].game_state),
+		asprintf(&c, "[[%s]] %s [%s] Vs. %s [%s]", gameend2str(replays[idx].game_state),
 		         replays[idx].p1, replays[idx].p1code,
 		         replays[idx].p2, replays[idx].p2code);
 		return c;
 	}
+	else if (replays[idx].p1 == NULL || replays[idx].p2 == NULL)
+		printf("[Replay Warning] %s is a incomplete replay. Good idea to delete it.\n",
+		       replays[idx].filename);
 	else
 		return NULL;
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to