MCPcopy Create free account
hub / github.com/crawl/crawl / load_messages

Function load_messages

crawl-ref/source/message.cc:2227–2257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2225}
2226
2227void load_messages(reader& inf)
2228{
2229 unwind_bool save_more(crawl_state.show_more_prompt, false);
2230
2231 // assumes that the store was cleared at the beginning of _restore_game!
2232 flush_prev_message();
2233 store_t load_msgs = buffer.get_store(); // copy of messages during loading
2234 clear_message_store();
2235
2236 int num = unmarshallInt(inf);
2237 for (int i = 0; i < num; ++i)
2238 {
2239 string text;
2240 unmarshallString4(inf, text);
2241
2242 msg_channel_type channel = (msg_channel_type) unmarshallInt(inf);
2243 int param = unmarshallInt(inf);
2244#if TAG_MAJOR_VERSION == 34
2245 if (inf.getMinorVersion() < TAG_MINOR_MESSAGE_REPEATS)
2246 unmarshallInt(inf); // was 'repeats'
2247#endif
2248 int turn = unmarshallInt(inf);
2249
2250 message_line msg(message_line(text, channel, param, turn));
2251 if (msg)
2252 buffer.store_msg(msg);
2253 }
2254 flush_prev_message();
2255 buffer.append_store(load_msgs);
2256 clear_messages(); // check for Options.message_clear
2257}
2258
2259static void _replay_messages_core(formatted_scroller &hist)
2260{

Callers 1

_restore_gameFunction · 0.85

Calls 10

flush_prev_messageFunction · 0.85
clear_message_storeFunction · 0.85
unmarshallIntFunction · 0.85
unmarshallString4Function · 0.85
message_lineClass · 0.85
clear_messagesFunction · 0.85
get_storeMethod · 0.80
getMinorVersionMethod · 0.80
store_msgMethod · 0.80
append_storeMethod · 0.80

Tested by

no test coverage detected