Skip to content

Commit 6744a18

Browse files
committed
In tests, eoc_selector cancels or selects 1st item
1 parent 30600f1 commit 6744a18

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/npctalk.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "avatar.h"
2929
#include "bionics.h"
3030
#include "bodypart.h"
31+
#include "cached_options.h"
3132
#include "calendar.h"
3233
#include "cata_lazy.h"
3334
#include "cata_path.h"
@@ -6445,11 +6446,21 @@ talk_effect_fun_t::func f_run_eoc_selector( const JsonObject &jo, std::string_vi
64456446
return;
64466447
}
64476448

6448-
eoc_list.query();
6449+
if( test_mode ) {
6450+
if( eoc_list.allow_cancel ) {
6451+
eoc_list.ret = -1;
6452+
} else {
6453+
eoc_list.ret = 0;
6454+
}
6455+
} else {
6456+
eoc_list.query();
6457+
}
6458+
64496459
if( eoc_list.ret < 0 ) {
64506460
return;
64516461
}
64526462

6463+
64536464
// add context variables
64546465
dialogue newDialog( d );
64556466
int contextIndex = 0;

0 commit comments

Comments
 (0)