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:
@@ -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);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user