Finds the seleced terrain cell. Returns cell number, or -1 if none or -2 if more than one
| 260 | |
| 261 | // Finds the seleced terrain cell. Returns cell number, or -1 if none or -2 if more than one |
| 262 | int GetSelectedTerrainCell() { |
| 263 | int i, found_cellnum = -1; |
| 264 | |
| 265 | for (i = 0; i < TERRAIN_DEPTH * TERRAIN_WIDTH; i++) { |
| 266 | if (TerrainSelected[i]) |
| 267 | if (found_cellnum == -1) |
| 268 | found_cellnum = i; |
| 269 | else |
| 270 | return -2; |
| 271 | } |
| 272 | |
| 273 | return found_cellnum; |
| 274 | } |
| 275 | |
| 276 | // Places an object in the world |
| 277 | // Parameters: obj_type,obj_id - specify the object to be placed |