@@ -329,7 +329,7 @@ namespace vizdoom {
329
329
}
330
330
331
331
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 );
333
333
}
334
334
else if (this ->demoPath .length ()){
335
335
this ->sendCommand (std::string (" recordmap " ) + this ->demoPath + " " + this ->map );
@@ -345,7 +345,6 @@ namespace vizdoom {
345
345
this ->mapRestarting = true ;
346
346
347
347
this ->resetButtons ();
348
-
349
348
int restartTics = 0 ;
350
349
351
350
bool useAvailable;
@@ -360,13 +359,19 @@ namespace vizdoom {
360
359
++restartTics;
361
360
362
361
if (this ->gameVariables ->NET_GAME ){
363
- if (restartTics % 2 ) this ->sendCommand (std::string (" +use" ));
362
+ if (restartTics % 2 ) this ->sendCommand (std::string (" +use" ));
364
363
else this ->sendCommand (std::string (" -use" ));
365
364
}
366
365
367
366
this ->MQDoomSend (MSG_CODE_TIC);
368
367
this ->waitForDoomWork ();
369
368
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
+
370
375
} while (this ->gameVariables ->MAP_END
371
376
|| this ->gameVariables ->PLAYER_DEAD
372
377
|| this ->gameVariables ->MAP_TIC > this ->mapLastTic );
@@ -406,6 +411,11 @@ namespace vizdoom {
406
411
this ->MQDoomSend (MSG_CODE_TIC);
407
412
this ->waitForDoomWork ();
408
413
414
+ if (restartTics > 3 ){
415
+ this ->sendCommand (std::string (" playdemo " ) + demoPath);
416
+ restartTics = 0 ;
417
+ }
418
+
409
419
} while (this ->gameVariables ->MAP_END
410
420
|| this ->gameVariables ->PLAYER_DEAD
411
421
|| this ->gameVariables ->MAP_TIC > this ->mapLastTic );
0 commit comments