mirror of
https://github.com/photonstorm/phaser
synced 2024-11-11 07:34:43 +00:00
Limit fix
This commit is contained in:
parent
223c94a783
commit
68d2526d69
2 changed files with 4 additions and 4 deletions
|
@ -31,7 +31,7 @@ var Add = function (array, item, limit, callback, context)
|
|||
{
|
||||
if (context === undefined) { context = array; }
|
||||
|
||||
if (limit)
|
||||
if (limit > 0)
|
||||
{
|
||||
var remaining = limit - array.length;
|
||||
|
||||
|
@ -86,7 +86,7 @@ var Add = function (array, item, limit, callback, context)
|
|||
return null;
|
||||
}
|
||||
|
||||
if (limit && itemLength > remaining)
|
||||
if (limit > 0 && itemLength > remaining)
|
||||
{
|
||||
item.splice(remaining);
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ var AddAt = function (array, item, index, limit, callback, context)
|
|||
if (index === undefined) { index = 0; }
|
||||
if (context === undefined) { context = array; }
|
||||
|
||||
if (limit)
|
||||
if (limit > 0)
|
||||
{
|
||||
var remaining = limit - array.length;
|
||||
|
||||
|
@ -91,7 +91,7 @@ var AddAt = function (array, item, index, limit, callback, context)
|
|||
}
|
||||
|
||||
// Truncate to the limit
|
||||
if (limit && itemLength > remaining)
|
||||
if (limit > 0 && itemLength > remaining)
|
||||
{
|
||||
item.splice(remaining);
|
||||
|
||||
|
|
Loading…
Reference in a new issue