mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-12-23 08:40:18 +01:00
Increased readability of block content extraction a tiny bit.
This commit is contained in:
parent
7fca02e45f
commit
08d32826dc
@ -290,10 +290,10 @@ func (db *DecodedBlock) Content(x, y, z int) (content int32, found bool) {
|
||||
pos <<= 1
|
||||
content = int32(db.MapContent[pos])<<8 | int32(db.MapContent[pos+1])
|
||||
case db.Version >= 20:
|
||||
if db.MapContent[pos] <= 0x80 {
|
||||
content = int32(db.MapContent[pos])
|
||||
if c := db.MapContent[pos]; c <= 0x80 {
|
||||
content = int32(c)
|
||||
} else {
|
||||
content = int32(db.MapContent[pos])<<4 | int32(db.MapContent[pos+0x2000])>>4
|
||||
content = int32(c)<<4 | int32(db.MapContent[pos+0x2000])>>4
|
||||
}
|
||||
default:
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user