MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / GetSelectedTerrainCell

Function GetSelectedTerrainCell

editor/HObject.cpp:262–274  ·  view source on GitHub ↗

Finds the seleced terrain cell. Returns cell number, or -1 if none or -2 if more than one

Source from the content-addressed store, hash-verified

260
261// Finds the seleced terrain cell. Returns cell number, or -1 if none or -2 if more than one
262int 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

Callers 1

HObjectPlaceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected