Merge pull request #36 from NordonOscillius/patch-1

OmniLightShadow.removeCaster() method fix
This commit is contained in:
Andrey Kopysov
2012-10-29 04:08:21 -07:00

View File

@@ -901,7 +901,12 @@ package alternativa.engine3d.shadows {
public function removeCaster(object:Object3D):void { public function removeCaster(object:Object3D):void {
var index:int = _casters.indexOf(object); var index:int = _casters.indexOf(object);
if (index < 0) throw new Error("Caster not found"); if (index < 0) throw new Error("Caster not found");
_casters[index] = _casters.pop(); if (index == _casters.length - 1) {
_casters.pop();
}
else {
_casters[index] = _casters.pop();
}
} }
/** /**