mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-15 17:25:32 +00:00
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
@ -392,6 +392,12 @@ void gamemap::set_terrain(const gamemap::location& loc, gamemap::TERRAIN ter)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
tiles_[loc.x][loc.y] = ter;
|
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)
|
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) {
|
for(size_t i = 0; i <= str.size(); ++i) {
|
||||||
const size_t start = i > length ? i - length : 0;
|
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 wide_string key(str.begin() + start, str.begin() + i);
|
||||||
const wchar_t c = i != str.size() ? str[i] : 0;
|
const wchar_t c = i != str.size() ? str[i] : 0;
|
||||||
res[key].push_back(c);
|
res[key].push_back(c);
|
||||||
@ -67,7 +66,6 @@ wide_string markov_generate_name(const markov_prefix_map& prefixes, size_t chain
|
|||||||
int prefixLen;
|
int prefixLen;
|
||||||
while (res.size() > 0) {
|
while (res.size() > 0) {
|
||||||
prefixLen = chain_size < res.size() ? chain_size : res.size();
|
prefixLen = chain_size < res.size() ? chain_size : res.size();
|
||||||
//prefix = res.substr(res.size() - prefixLen, prefixLen);
|
|
||||||
prefix = wide_string(res.end() - prefixLen, res.end());
|
prefix = wide_string(res.end() - prefixLen, res.end());
|
||||||
|
|
||||||
const markov_prefix_map::const_iterator i = prefixes.find(prefix);
|
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
|
// The current ending is invalid, remove the last character
|
||||||
// and retry.
|
// and retry.
|
||||||
//res.erase(res.size() - 1);
|
|
||||||
res.pop_back();
|
res.pop_back();
|
||||||
}
|
}
|
||||||
// No valid ending at all could be found. This generally should
|
// No valid ending at all could be found. This generally should
|
||||||
|
Loading…
x
Reference in New Issue
Block a user