1
0
forked from mirrors/0ad

Fix createObjectGroup (singular) and SimpleGroup.prototype.place not returning an array of entities but an array of undefined following the SimpleGroup change in 78ce731fc5.

The bug was never noticeable because the return result was never read
from yet.

This was SVN commit r21405.
This commit is contained in:
elexis
2018-03-01 17:48:13 +00:00
parent 38aee6698d
commit c6af8b4e76
@@ -275,6 +275,7 @@ RandomMap.prototype.placeEntityAnywhere = function(templateName, playerID, posit
{
let entity = new Entity(this.getEntityID(), templateName, playerID, position, orientation);
this.entities.push(entity);
return entity;
};
/**
@@ -282,8 +283,10 @@ RandomMap.prototype.placeEntityAnywhere = function(templateName, playerID, posit
*/
RandomMap.prototype.placeEntityPassable = function(templateName, playerID, position, orientation)
{
if (this.validTilePassable(position))
this.placeEntityAnywhere(templateName, playerID, position, orientation);
if (!this.validTilePassable(position))
return undefined;
return this.placeEntityAnywhere(templateName, playerID, position, orientation);
};
/**