diff options
| author | Quietust | 2012-02-13 19:17:38 -0600 |
|---|---|---|
| committer | Quietust | 2012-02-13 19:17:38 -0600 |
| commit | d15d38d536178b7501b05227d66dbe62e28e498c (patch) | |
| tree | 162be5d11ab39c7417972a413be5dd0c247fb832 /plugins/regrass.cpp | |
| parent | d0a8c2edd8922673d72a18bfd2214ce45126507b (diff) | |
| download | dfhack-d15d38d536178b7501b05227d66dbe62e28e498c.tar.gz dfhack-d15d38d536178b7501b05227d66dbe62e28e498c.tar.bz2 dfhack-d15d38d536178b7501b05227d66dbe62e28e498c.tar.xz | |
Finish conversion, fix compile errors
Diffstat (limited to 'plugins/regrass.cpp')
| -rw-r--r-- | plugins/regrass.cpp | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/plugins/regrass.cpp b/plugins/regrass.cpp index c4b3f600..8236a977 100644 --- a/plugins/regrass.cpp +++ b/plugins/regrass.cpp @@ -32,28 +32,16 @@ DFhackCExport command_result df_regrass (Core * c, vector <string> & parameters) { for (int y = 0; y < 16; y++) { - if (DFHack::tileShape(cur->tiletype[x][y]) != DFHack::FLOOR) + if (tileShape(cur->tiletype[x][y]) != tiletype_shape::FLOOR) continue; - if (DFHack::tileMaterial(cur->tiletype[x][y]) != DFHack::SOIL) + if (tileMaterial(cur->tiletype[x][y]) != tiletype_material::SOIL) continue; if (cur->designation[x][y].bits.subterranean) continue; if (cur->occupancy[x][y].bits.building) continue; - switch (rand() % 8) - { - // light grass - case 0: cur->tiletype[x][y] = 0x015C; break; - case 1: cur->tiletype[x][y] = 0x015D; break; - case 2: cur->tiletype[x][y] = 0x015E; break; - case 3: cur->tiletype[x][y] = 0x015F; break; - // dark grass - case 4: cur->tiletype[x][y] = 0x018E; break; - case 5: cur->tiletype[x][y] = 0x018F; break; - case 6: cur->tiletype[x][y] = 0x0190; break; - case 7: cur->tiletype[x][y] = 0x0191; break; - } + cur->tiletype[x][y] = findRandomVariant((rand() & 1) ? tiletype::GrassLightFloor1 : tiletype::GrassDarkFloor1); count++; } } |
