Make entity storage lookup range positive (#9735)

This commit is contained in:
Leon Friedrich
2022-07-15 09:55:36 +12:00
committed by GitHub
parent a49121f681
commit f7d02968a4
7 changed files with 17 additions and 17 deletions

View File

@@ -28,11 +28,11 @@ public sealed class EntityStorageComponent : Component
public int RemovedMasks;
[ViewVariables]
[DataField("Capacity")]
public int StorageCapacityMax = 30;
[DataField("capacity")]
public int Capacity = 30;
[ViewVariables]
[DataField("IsCollidableWhenOpen")]
[DataField("isCollidableWhenOpen")]
public bool IsCollidableWhenOpen;
//The offset for where items are emptied/vacuumed for the EntityStorage.
@@ -44,8 +44,8 @@ public sealed class EntityStorageComponent : Component
public readonly CollisionGroup EnteringOffsetCollisionFlags = CollisionGroup.Impassable | CollisionGroup.MidImpassable;
[ViewVariables]
[DataField("EnteringRange")]
public float EnteringRange = -0.18f;
[DataField("enteringRange")]
public float EnteringRange = 0.18f;
[DataField("showContents")]
public bool ShowContents;

View File

@@ -162,7 +162,7 @@ public sealed class EntityStorageSystem : EntitySystem
continue;
count++;
if (count >= component.StorageCapacityMax)
if (count >= component.Capacity)
break;
}
@@ -202,7 +202,7 @@ public sealed class EntityStorageSystem : EntitySystem
if (component.Open)
return true;
if (component.Contents.ContainedEntities.Count >= component.StorageCapacityMax)
if (component.Contents.ContainedEntities.Count >= component.Capacity)
return false;
return true;

View File

@@ -38,8 +38,8 @@
mask:
- Impassable
- type: EntityStorage
Capacity: 1
IsCollidableWhenOpen: true
capacity: 1
isCollidableWhenOpen: true
closeSound:
path: /Audio/Misc/zip.ogg
openSound:

View File

@@ -39,7 +39,7 @@
sprite: Structures/Storage/Crates/artifact.rsi
state: artifact_container_icon
- type: EntityStorage
Capacity: 1
capacity: 1
whitelist:
components:
- Artifact

View File

@@ -31,7 +31,7 @@
layer:
- MachineLayer
- type: EntityStorage
Capacity: 500
capacity: 500
- type: Weldable
- type: PlaceableSurface
- type: Damageable
@@ -94,7 +94,7 @@
layer:
- MachineLayer
- type: EntityStorage
Capacity: 500
capacity: 500
- type: Weldable
- type: PlaceableSurface
- type: Damageable

View File

@@ -580,7 +580,7 @@
parent: CrateGeneric
components:
- type: EntityStorage
Capacity: 500
capacity: 500
- type: Sprite
sprite: Structures/Storage/Crates/livestock.rsi
layers:

View File

@@ -32,9 +32,9 @@
layer:
- WallLayer
- type: EntityStorage
IsCollidableWhenOpen: true
isCollidableWhenOpen: true
showContents: false
Capacity: 1
capacity: 1
enteringOffset: 0, -1
closeSound:
path: /Audio/Items/deconstruct.ogg
@@ -124,9 +124,9 @@
layer:
- MachineLayer
- type: EntityStorage
IsCollidableWhenOpen: true
isCollidableWhenOpen: true
showContents: false
Capacity: 1
capacity: 1
enteringOffset: 0, -1
closeSound:
path: /Audio/Items/deconstruct.ogg