Fix InventoryHelper.canPlaceItemInContainer being backwards (!367)
For whatever reason, `InventoryHelper.canPlaceItemInContainer()` currently returns: `true` if the item CANNOT be placed in the container `undefined` if the item CAN be placed `false` if the function thought it could but then failed when trying to (never happens?) This didn't cause problems because the only two places that call it also treat the return value backwards - both of which are also fixed in this PR. Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/367 Co-authored-by: Tyfon <tyfon7@outlook.com> Co-committed-by: Tyfon <tyfon7@outlook.com>
This commit is contained in:
parent
32fc93592a
commit
e58ddac0cc
@ -232,7 +232,7 @@ export class InventoryHelper
|
||||
const stashFS2D = this.cloner.clone(this.getStashSlotMap(pmcData, sessionId));
|
||||
for (const itemWithChildren of itemsWithChildren)
|
||||
{
|
||||
if (this.canPlaceItemInContainer(stashFS2D, itemWithChildren))
|
||||
if (!this.canPlaceItemInContainer(stashFS2D, itemWithChildren))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -251,7 +251,7 @@ export class InventoryHelper
|
||||
{
|
||||
for (const itemWithChildren of itemsWithChildren)
|
||||
{
|
||||
if (this.canPlaceItemInContainer(containerFS2D, itemWithChildren))
|
||||
if (!this.canPlaceItemInContainer(containerFS2D, itemWithChildren))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -296,10 +296,10 @@ export class InventoryHelper
|
||||
}
|
||||
|
||||
// Success! exit
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user