MCPcopy Create free account
hub / github.com/DFHack/dfhack / GetWorldMapCenter

Function GetWorldMapCenter

plugins/remotefortressreader/remotefortressreader.cpp:1944–1966  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1942}
1943
1944static command_result GetWorldMapCenter(color_ostream &stream, const EmptyMessage *in, WorldMap *out)
1945{
1946 if (!df::global::world->world_data)
1947 {
1948 out->set_world_width(0);
1949 out->set_world_height(0);
1950 return CR_FAILURE;
1951 }
1952 df::world_data * data = df::global::world->world_data;
1953 int width = data->world_width;
1954 int height = data->world_height;
1955 out->set_world_width(width);
1956 out->set_world_height(height);
1957 DFCoord pos = GetMapCenter();
1958 out->set_center_x(pos.x);
1959 out->set_center_y(pos.y);
1960 out->set_center_z(pos.z);
1961 out->set_name(DF2UTF(Translation::translateName(&(data->name), false)));
1962 out->set_name_english(DF2UTF(Translation::translateName(&(data->name), true)));
1963 out->set_cur_year(World::ReadCurrentYear());
1964 out->set_cur_year_tick(World::ReadCurrentTick());
1965 return CR_OK;
1966}
1967
1968static command_result GetWorldMap(color_ostream &stream, const EmptyMessage *in, WorldMap *out)
1969{

Callers

nothing calls this directly

Calls 3

GetMapCenterFunction · 0.85
DF2UTFFunction · 0.85
set_nameMethod · 0.45

Tested by

no test coverage detected