| 1900 | } |
| 1901 | |
| 1902 | DFCoord GetMapCenter() |
| 1903 | { |
| 1904 | DFCoord output; |
| 1905 | //FIXME: Does this even still exist? |
| 1906 | //#if DF_VERSION_INT > 34011 |
| 1907 | // auto embark = Gui::getViewscreenByType<df::viewscreen_choose_start_sitest>(0); |
| 1908 | // if (embark) |
| 1909 | // { |
| 1910 | // df::embark_location location = embark->location; |
| 1911 | // output.x = (location.region_pos.x * 16) + 8; |
| 1912 | // output.y = (location.region_pos.y * 16) + 8; |
| 1913 | // output.z = 100; |
| 1914 | // df::world_data * data = df::global::world->world_data; |
| 1915 | // if (data && data->region_map) |
| 1916 | // { |
| 1917 | // output.z = data->region_map[location.region_pos.x][location.region_pos.y].elevation; |
| 1918 | // } |
| 1919 | // } |
| 1920 | // else |
| 1921 | //#endif |
| 1922 | if (Maps::IsValid()) |
| 1923 | { |
| 1924 | int x, y, z; |
| 1925 | Maps::getPosition(x, y, z); |
| 1926 | output = DFCoord(x, y, z); |
| 1927 | } |
| 1928 | #if DF_VERSION_INT > 34011 |
| 1929 | else |
| 1930 | for (size_t i = 0; i < df::global::world->armies.all.size(); i++) |
| 1931 | { |
| 1932 | df::army * thisArmy = df::global::world->armies.all[i]; |
| 1933 | if (thisArmy->flags.is_set(df::enums::army_flags::player)) |
| 1934 | { |
| 1935 | output.x = (thisArmy->pos.x / 3) - 1; |
| 1936 | output.y = (thisArmy->pos.y / 3) - 1; |
| 1937 | output.z = thisArmy->pos.z; |
| 1938 | } |
| 1939 | } |
| 1940 | #endif |
| 1941 | return output; |
| 1942 | } |
| 1943 | |
| 1944 | static command_result GetWorldMapCenter(color_ostream &stream, const EmptyMessage *in, WorldMap *out) |
| 1945 | { |
no test coverage detected