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

Function _getRandomisedStr

crawl-ref/source/database.cc:669–688  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

667 int recursion_depth = 0);
668
669static string _getRandomisedStr(TextDB &db, const string &key,
670 const string &suffix,
671 int &num_replacements,
672 int recursion_depth = 0)
673{
674 recursion_depth++;
675 if (recursion_depth > MAX_RECURSION_DEPTH)
676 {
677 mprf(MSGCH_DIAGNOSTICS, "Too many nested replacements, bailing.");
678
679 return "TOO MUCH RECURSION";
680 }
681
682 string str = _getWeightedString(db, key, suffix);
683
684 _call_recursive_replacement(str, db, suffix, num_replacements,
685 recursion_depth);
686
687 return str;
688}
689
690// Replace any "@foo@" markers that can be found in this database.
691// Those that can't be found are left alone for the caller to deal with.

Callers 6

getShoutStringFunction · 0.85
getSpeakStringFunction · 0.85
getRandMonNameStringFunction · 0.85
getRandNameStringFunction · 0.85
getMiscStringFunction · 0.85

Calls 3

mprfFunction · 0.85
_getWeightedStringFunction · 0.85

Tested by

no test coverage detected