Skip to content

Commit ff7b894

Browse files
committed
In tests, eoc_selector cancels or selects 1st item
1 parent 945ec0e commit ff7b894

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"
@@ -6467,11 +6468,21 @@ talk_effect_fun_t::func f_run_eoc_selector( const JsonObject &jo, std::string_vi
64676468
return;
64686469
}
64696470

6470-
eoc_list.query();
6471+
if( test_mode ) {
6472+
if( eoc_list.allow_cancel ) {
6473+
eoc_list.ret = -1;
6474+
} else {
6475+
eoc_list.ret = 0;
6476+
}
6477+
} else {
6478+
eoc_list.query();
6479+
}
6480+
64716481
if( eoc_list.ret < 0 ) {
64726482
return;
64736483
}
64746484

6485+
64756486
// add context variables
64766487
dialogue newDialog( d );
64776488
int contextIndex = 0;

0 commit comments

Comments
 (0)