Skip to content

Commit

Permalink
Probably a fix for issue #87
Browse files Browse the repository at this point in the history
  • Loading branch information
mwydmuch committed Jun 14, 2016
1 parent f7917ef commit dbcb2b2
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/vizdoom/src/vizdoom_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ bool ViZDoom_CommmandFilter(const char *cmd){
delete[] ckeckCmd;
}

//printf("%d %s\n",gametic, cmd);
//Printf("%d %s\n", gametic, cmd);

return true;
}
Expand Down Expand Up @@ -220,13 +220,18 @@ void ViZDoom_ResetDiscontinuousBT(){
}

char* ViZDoom_AddStateToBTCommmand(char *& cmd, int state){
char *stateCmd = new char[strlen(cmd)+1];
if (state) stateCmd[0] = '+';
size_t cmdLen = strlen(cmd);
char *stateCmd = new char[cmdLen + 2];
if (state != 0) stateCmd[0] = '+';
else stateCmd[0] = '-';
strcpy(stateCmd + 1, cmd);
delete[] cmd;
strncpy(stateCmd + 1, cmd, cmdLen);
stateCmd[cmdLen + 1] = '\0';

delete[] cmd;
cmd = stateCmd;

//Printf("%d %s\n", gametic, cmd);

return stateCmd;
}

Expand Down

0 comments on commit dbcb2b2

Please sign in to comment.