Skip to content

Commit

Permalink
Merge pull request #89 from Marqt/1.0
Browse files Browse the repository at this point in the history
Probably a fix for issue #87
  • Loading branch information
mwydmuch authored Jun 14, 2016
2 parents fc1761e + dbcb2b2 commit c969e3b
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 c969e3b

Please sign in to comment.