Skip to content

Commit b50ffe9

Browse files
committed
Probably a fix for issue #88
Former-commit-id: 916f1b0
1 parent fd9221e commit b50ffe9

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/lib/ViZDoomController.cpp

+13-3
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ namespace vizdoom {
329329
}
330330

331331
if(this->gameVariables->NET_GAME){
332-
if(this->gameVariables->GAME_SETTINGS_CONTROLLER) this->sendCommand(std::string("changemap ") + this->map);
332+
if(this->gameVariables->GAME_SETTING_CONTROLLER) this->sendCommand(std::string("changemap ") + this->map);
333333
}
334334
else if(this->demoPath.length()){
335335
this->sendCommand(std::string("recordmap ") + this->demoPath + " " + this->map);
@@ -345,7 +345,6 @@ namespace vizdoom {
345345
this->mapRestarting = true;
346346

347347
this->resetButtons();
348-
349348
int restartTics = 0;
350349

351350
bool useAvailable;
@@ -360,13 +359,19 @@ namespace vizdoom {
360359
++restartTics;
361360

362361
if(this->gameVariables->NET_GAME){
363-
if(restartTics % 2) this->sendCommand(std::string("+use"));
362+
if (restartTics % 2) this->sendCommand(std::string("+use"));
364363
else this->sendCommand(std::string("-use"));
365364
}
366365

367366
this->MQDoomSend(MSG_CODE_TIC);
368367
this->waitForDoomWork();
369368

369+
if(restartTics > 3 && !this->gameVariables->NET_GAME){
370+
if (this->demoPath.length()) this->sendCommand(std::string("recordmap ") + this->demoPath + " " + this->map);
371+
else this->sendCommand(std::string("map ") + this->map);
372+
restartTics = 0;
373+
}
374+
370375
} while (this->gameVariables->MAP_END
371376
|| this->gameVariables->PLAYER_DEAD
372377
|| this->gameVariables->MAP_TIC > this->mapLastTic);
@@ -406,6 +411,11 @@ namespace vizdoom {
406411
this->MQDoomSend(MSG_CODE_TIC);
407412
this->waitForDoomWork();
408413

414+
if(restartTics > 3){
415+
this->sendCommand(std::string("playdemo ") + demoPath);
416+
restartTics = 0;
417+
}
418+
409419
} while (this->gameVariables->MAP_END
410420
|| this->gameVariables->PLAYER_DEAD
411421
|| this->gameVariables->MAP_TIC > this->mapLastTic);

src/lib/ViZDoomController.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ namespace vizdoom{
103103
int GAME_STATE;
104104
int GAME_ACTION;
105105
unsigned int GAME_STATIC_SEED;
106-
bool GAME_SETTINGS_CONTROLLER;
106+
bool GAME_SETTING_CONTROLLER;
107107
bool NET_GAME;
108108

109109
unsigned int SCREEN_WIDTH;

0 commit comments

Comments
 (0)