Skip to content

Commit

Permalink
Do not use SpawnInit, b ut rather NewRound for 'new round' logic.
Browse files Browse the repository at this point in the history
- todo: check when new round is actually true and remove all duplicate
calls

- this fixes #9 and #11 because the config settings are no longer
re-initialized. Yay!
  • Loading branch information
stefanhendriks committed Sep 16, 2019
1 parent 2067425 commit 1132ac8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions bot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,13 @@ void cBot::PrepareChat(char sentence[128]) {
Function purpose: Return reaction time based upon skill
******************************************************************************/
float cBot::ReactionTime(int iSkill) {
return RANDOM_FLOAT(fpMinReactTime, fpMaxReactTime);
float time = RANDOM_FLOAT(fpMinReactTime, fpMaxReactTime);
if (Game.messageVerbosity > 1) {
char msg[255];
sprintf(msg, "minReactTime %f, maxReactTime %f, skill %d, results into %f", fpMinReactTime, fpMaxReactTime, iSkill, time);
rprint_trace("ReactionTime()", msg);
}
return time;
}

/******************************************************************************
Expand Down Expand Up @@ -3112,7 +3118,8 @@ void cBot::Think() {
}

if (console_nr == 0) {
SpawnInit();
rprint("NewRound - because console_nr ?!");
NewRound();
bInitialize = false;
}

Expand Down

0 comments on commit 1132ac8

Please sign in to comment.