Fix half-broken Replays (slippi bug?)
This commit is contained in:
parent
26282fef91
commit
041ebbf1b5
4
input.c
4
input.c
|
@ -27,9 +27,9 @@ Eina_Bool
|
||||||
_scroll_loop_cb(void* data)
|
_scroll_loop_cb(void* data)
|
||||||
{
|
{
|
||||||
int x, y, w, h;
|
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;
|
y += y_mod;
|
||||||
elm_scroller_region_show(mainer, x, y, w, h);
|
//elm_scroller_region_show(mainer, x, y, w, h);
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
10
replay.c
10
replay.c
|
@ -58,6 +58,7 @@ ubjson_search(unsigned char* buf, long length, char const* key, long* offset)
|
||||||
{
|
{
|
||||||
size_t key_len = strlen(key);
|
size_t key_len = strlen(key);
|
||||||
char* start = sstrstr(buf, key, length);
|
char* start = sstrstr(buf, key, length);
|
||||||
|
if (!start) return NULL;
|
||||||
start += key_len;
|
start += key_len;
|
||||||
// Just 8 bits for now...
|
// Just 8 bits for now...
|
||||||
uint8_t value_len = start[0];
|
uint8_t value_len = start[0];
|
||||||
|
@ -167,14 +168,19 @@ replays_strings(void* data, Evas_Object* obj, const char* part)
|
||||||
{
|
{
|
||||||
long idx = data;
|
long idx = data;
|
||||||
// Check this is text for the part we're expecting
|
// 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;
|
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].p1, replays[idx].p1code,
|
||||||
replays[idx].p2, replays[idx].p2code);
|
replays[idx].p2, replays[idx].p2code);
|
||||||
return c;
|
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
|
else
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue