diff --git a/src/game/boe.infodlg.cpp b/src/game/boe.infodlg.cpp index 7fe539d5..08480c8c 100644 --- a/src/game/boe.infodlg.cpp +++ b/src/game/boe.infodlg.cpp @@ -691,22 +691,11 @@ void put_spec_item_info (short which_i) { void cStringRecorder::operator()(cDialog& me) { play_sound(0); std::string str1, str2; - switch(type) { - case NOTE_SCEN: - str1 = univ.scenario.spec_strs[label1]; - str2 = univ.scenario.spec_strs[label2]; - break; - case NOTE_TOWN: - str1 = univ.town->spec_strs[label1]; - str2 = univ.town->spec_strs[label2]; - break; - case NOTE_OUT: - str1 = univ.scenario.outdoors[label1b][label2b]->spec_strs[label1]; - str2 = univ.scenario.outdoors[label1b][label2b]->spec_strs[label2]; - break; - } - if(univ.party.record(type, str1, location)) + univ.get_strs(str1, str2, spec_type, label1, label2); + if(univ.party.record(note_type, str1, location)) give_help(58,0,me); - univ.party.record(type, str2, location); + + if(!str2.empty()) + univ.party.record(note_type, str2, location); } diff --git a/src/game/boe.infodlg.hpp b/src/game/boe.infodlg.hpp index 67d8b8e3..cb15d9a6 100644 --- a/src/game/boe.infodlg.hpp +++ b/src/game/boe.infodlg.hpp @@ -31,24 +31,20 @@ void display_alchemy(bool allowEdit,cDialog* parent); // Callback for recording encounter strings class cStringRecorder { private: - eEncNoteType type; - unsigned short label1, label2, label1b, label2b; + eSpecCtxType spec_type; + eEncNoteType note_type; + short label1, label2; std::string location; public: - cStringRecorder(eEncNoteType type) : type(type) {} - cStringRecorder& string1(unsigned short which) { + cStringRecorder(eSpecCtxType spec_type, eEncNoteType note_type) : spec_type(spec_type), note_type(note_type) {} + cStringRecorder& string1(short which) { label1 = which; return *this; } - cStringRecorder& string2(unsigned short which) { + cStringRecorder& string2(short which) { label2 = which; return *this; } - cStringRecorder& from(unsigned short where1, unsigned short where2) { - label1b = where1; - label2b = where2; - return *this; - } cStringRecorder& at(std::string where) { location = where; return *this; diff --git a/src/game/boe.specials.cpp b/src/game/boe.specials.cpp index 07be94f4..5be733d9 100644 --- a/src/game/boe.specials.cpp +++ b/src/game/boe.specials.cpp @@ -4584,13 +4584,10 @@ void handle_message(const runtime_state& ctx, const std::string& title, pic_num_ univ.get_strs(str1, str2, ctx.cur_spec_type, ctx.cur_spec.m1, ctx.cur_spec.m2); if(str1.empty() && str2.empty()) return; - short where1 = -1,where2 = -1; - where1 = is_out() ? univ.party.outdoor_corner.x + univ.party.i_w_c.x : univ.party.town_num; - where2 = is_out() ? univ.party.outdoor_corner.y + univ.party.i_w_c.y : univ.party.town_num; std::string placename = is_out() ? univ.out->name : univ.town->name; cStrDlog display_strings(str1, str2, title, pic, pt, 0); display_strings.setSound(57); - display_strings.setRecordHandler(cStringRecorder(note_type).string1(ctx.cur_spec.m1).string2(ctx.cur_spec.m2).from(where1,where2).at(placename)); + display_strings.setRecordHandler(cStringRecorder(ctx.cur_spec_type, note_type).string1(ctx.cur_spec.m1).string2(ctx.cur_spec.m2).at(placename)); display_strings.show(); }