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; public int RemovedMasks;
[ViewVariables] [ViewVariables]
[DataField("Capacity")] [DataField("capacity")]
public int StorageCapacityMax = 30; public int Capacity = 30;
[ViewVariables] [ViewVariables]
[DataField("IsCollidableWhenOpen")] [DataField("isCollidableWhenOpen")]
public bool IsCollidableWhenOpen; public bool IsCollidableWhenOpen;
//The offset for where items are emptied/vacuumed for the EntityStorage. //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; public readonly CollisionGroup EnteringOffsetCollisionFlags = CollisionGroup.Impassable | CollisionGroup.MidImpassable;
[ViewVariables] [ViewVariables]
[DataField("EnteringRange")] [DataField("enteringRange")]
public float EnteringRange = -0.18f; public float EnteringRange = 0.18f;
[DataField("showContents")] [DataField("showContents")]
public bool ShowContents; public bool ShowContents;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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