Fixed bug / feature request #9480:
changing a terrain using the [terrain] event also changes the map border.
This commit is contained in:
parent
c9cae23009
commit
1f249a3dc6
2 changed files with 6 additions and 3 deletions
|
@ -392,6 +392,12 @@ void gamemap::set_terrain(const gamemap::location& loc, gamemap::TERRAIN ter)
|
|||
return;
|
||||
|
||||
tiles_[loc.x][loc.y] = ter;
|
||||
|
||||
location adj[6];
|
||||
get_adjacent_tiles(loc,adj);
|
||||
|
||||
for(int i = 0; i < 6; ++i)
|
||||
remove_from_border_cache(adj[i]);
|
||||
}
|
||||
|
||||
std::vector<gamemap::location> parse_location_range(const std::string& x, const std::string& y)
|
||||
|
|
|
@ -9,7 +9,6 @@ void add_prefixes(const wide_string& str, size_t length, markov_prefix_map& res)
|
|||
{
|
||||
for(size_t i = 0; i <= str.size(); ++i) {
|
||||
const size_t start = i > length ? i - length : 0;
|
||||
//const wide_string key = str.substr(start, i-start);
|
||||
const wide_string key(str.begin() + start, str.begin() + i);
|
||||
const wchar_t c = i != str.size() ? str[i] : 0;
|
||||
res[key].push_back(c);
|
||||
|
@ -67,7 +66,6 @@ wide_string markov_generate_name(const markov_prefix_map& prefixes, size_t chain
|
|||
int prefixLen;
|
||||
while (res.size() > 0) {
|
||||
prefixLen = chain_size < res.size() ? chain_size : res.size();
|
||||
//prefix = res.substr(res.size() - prefixLen, prefixLen);
|
||||
prefix = wide_string(res.end() - prefixLen, res.end());
|
||||
|
||||
const markov_prefix_map::const_iterator i = prefixes.find(prefix);
|
||||
|
@ -81,7 +79,6 @@ wide_string markov_generate_name(const markov_prefix_map& prefixes, size_t chain
|
|||
}
|
||||
// The current ending is invalid, remove the last character
|
||||
// and retry.
|
||||
//res.erase(res.size() - 1);
|
||||
res.pop_back();
|
||||
}
|
||||
// No valid ending at all could be found. This generally should
|
||||
|
|
Loading…
Add table
Reference in a new issue