From 05d69148615ec0fabda6bdd5ab4a285ec7204d34 Mon Sep 17 00:00:00 2001 From: Miguel Angel Astor Romero Date: Sat, 8 Mar 2014 23:23:18 -0430 Subject: [PATCH] Fixed a bug when showing messages in game. --- src/in_game.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/in_game.c b/src/in_game.c index 5c2680e..cc7d2b6 100644 --- a/src/in_game.c +++ b/src/in_game.c @@ -159,6 +159,9 @@ gsname_t update(){ if(objs[i].x == iY && objs[i].y == iX){ keys[freeKey] = objs[i].id; objs[i].type = NONE; + for(j = 0; j < 128; j++){ + msg[j] = '\0'; + } for(j = 0; keyMsg[j] && j < 128; j++){ msg[j] = keyMsg[j]; } @@ -175,6 +178,10 @@ gsname_t update(){ for(k = 0; k < nO; k++) if(objs[k].type == DIALOG && objs[k].id == objs[i].dId) break; + for(j = 0; j < 128; j++){ + msg[j] = '\0'; + } + for(j = 0; objs[i].name[j] && j < 128; j++) msg[j] = objs[i].name[j]; @@ -202,6 +209,10 @@ gsname_t update(){ } } + for(j = 0; j < 128; j++){ + msg[j] = '\0'; + } + if(objs[i].unlocked){ for(j = 0; openDoor[j] && j < 128; j++){ msg[j] = openDoor[j];