mirror of
https://github.com/glest/glest-source.git
synced 2025-08-20 07:01:21 +02:00
added null checks
This commit is contained in:
@@ -1188,6 +1188,13 @@ const Unit * Map::findClosestUnitToPos(const Selection *selection, Vec2i origina
|
|||||||
}
|
}
|
||||||
|
|
||||||
Vec2i Map::findBestBuildApproach(const Unit *unit, Vec2i originalBuildPos,const UnitType *ut) const {
|
Vec2i Map::findBestBuildApproach(const Unit *unit, Vec2i originalBuildPos,const UnitType *ut) const {
|
||||||
|
if(unit == NULL) {
|
||||||
|
throw megaglest_runtime_error("unit == NULL");
|
||||||
|
}
|
||||||
|
if(ut == NULL) {
|
||||||
|
throw megaglest_runtime_error("ut == NULL");
|
||||||
|
}
|
||||||
|
|
||||||
Vec2i unitBuilderPos = unit->getPosNotThreadSafe();
|
Vec2i unitBuilderPos = unit->getPosNotThreadSafe();
|
||||||
Vec2i pos = originalBuildPos;
|
Vec2i pos = originalBuildPos;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user