Translations:Object respawning/11/en

Revision as of 23:14, 28 May 2020 by FuzzyBot (talk | contribs) (Importing a new version from external source)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
int col = std::clamp(((signed int)x + 5000) / 1000, 0, 9);
int row = std::clamp(((signed int)z + 4000) / 1000, 0, 7);
if ( (col + 0.5) * 1000.0 + -5000.0 >= x ) {
  *col1 = col - 1;
  *col2 = col;
} else {
  *col1 = col;
  *col2 = col + 1;
}
if ( (row + 0.5) * 1000.0 + -4000.0 >= z ) {
  *row1 = row - 1;
  *row2 = row;
} else {
  *row1 = row;
  *row2 = row + 1;
}