Fixed tile offset.

This commit is contained in:
Sascha L. Teichmann
2014-09-20 21:57:01 +02:00
parent ba301372f1
commit 8c29975d27
2 changed files with 7 additions and 7 deletions

View File

@ -30,7 +30,7 @@ type xz struct {
}
func (c xz) quantize() xz {
return xz{X: (c.X - -1936) / 16, Z: (c.Z - -1936) / 16}
return xz{X: (c.X - -1933) / 16, Z: (c.Z - -1933) / 16}
}
func newTileUpdater(mapDir, redisAddress string, colors *common.Colors, workers int) *tileUpdater {
@ -106,8 +106,8 @@ func (tu *tileUpdater) doUpdates() {
func updateBaseTiles(jobs chan xz, btc *common.BaseTileCreator, done *sync.WaitGroup) {
for job := range jobs {
x := job.X*16 + -1936 - 1
z := job.Z*16 + -1936 - 1
x := job.X*16 + -1933 - 1
z := job.Z*16 + -1933 - 1
log.Printf("%d/%d %d/%d", x, z, job.X, job.Z)
if err := btc.CreateTile(x, z, int(job.X), int(job.Z)); err != nil {
log.Printf("WARN: create tile failed: %s", err)