diff --git a/DragonECS.csproj b/DragonECS.csproj
index 802eccf..169856f 100644
--- a/DragonECS.csproj
+++ b/DragonECS.csproj
@@ -10,7 +10,7 @@
DCFApixels.DragonECS
DragonECS
- 0.8.63
+ 0.8.64
DCFApixels
ECS Framework for Game Engines with C# and .Net Platform
DCFApixels
diff --git a/package.json b/package.json
index 4b521eb..75c6171 100644
--- a/package.json
+++ b/package.json
@@ -8,7 +8,7 @@
"displayName": "DragonECS",
"description": "C# Entity Component System Framework",
"unity": "2020.3",
- "version": "0.8.63",
+ "version": "0.8.64",
"repository": {
"type": "git",
"url": "https://github.com/DCFApixels/DragonECS.git"
diff --git a/src/EcsWorld.cs b/src/EcsWorld.cs
index 8563944..e2d6bd1 100644
--- a/src/EcsWorld.cs
+++ b/src/EcsWorld.cs
@@ -952,6 +952,8 @@ namespace DCFApixels.DragonECS
if (itemsCount <= 0) { return 0; }
+ const int LO_CHANK_HALF = 65535;
+ const int HI_CHANK_HALF = -65536;
const int COMPONENT_MASK_CHUNK_SIZE_HALF = COMPONENT_MASK_CHUNK_SIZE / 2;
// проверка на itemsCount <= 0 не обяательна, алгоритм не ломается,
// только впустую отрабатыват по всем чанкам,
@@ -971,7 +973,7 @@ namespace DCFApixels.DragonECS
}
else
{
- if ((chunk & 0x0000FFFF) != 0)
+ if ((chunk & LO_CHANK_HALF) != 0)
{
bit = 0x0000_0001;
while (bit < 0x0001_0000)
@@ -991,7 +993,7 @@ namespace DCFApixels.DragonECS
{
poolIndex += COMPONENT_MASK_CHUNK_SIZE_HALF;
}
- if ((chunk & -0x7FFF0000) != 0)
+ if ((chunk & HI_CHANK_HALF) != 0)
{
bit = 0x0001_0000;
while (bit != 0x0000_0000)
@@ -1018,6 +1020,8 @@ namespace DCFApixels.DragonECS
}
private unsafe void GetComponentTypeIDsFor_Internal(int entityID, int* componentIDs, int itemsCount)
{
+ const int LO_CHANK_HALF = 65535;
+ const int HI_CHANK_HALF = -65536;
const int COMPONENT_MASK_CHUNK_SIZE_HALF = COMPONENT_MASK_CHUNK_SIZE / 2;
// проверка на itemsCount <= 0 не обяательна, алгоритм не ломается,
// только впустую отрабатыват по всем чанкам,
@@ -1036,7 +1040,7 @@ namespace DCFApixels.DragonECS
}
else
{
- if ((chunk & 0x0000FFFF) != 0)
+ if ((chunk & LO_CHANK_HALF) != 0)
{
bit = 0x0000_0001;
while (bit < 0x0001_0000)
@@ -1057,7 +1061,7 @@ namespace DCFApixels.DragonECS
{
poolIndex += COMPONENT_MASK_CHUNK_SIZE_HALF;
}
- if ((chunk & -0x7FFF0000) != 0)
+ if ((chunk & HI_CHANK_HALF) != 0)
{
bit = 0x0001_0000;
while (bit != 0x0000_0000)