Skip to content

Commit

Permalink
Fix: ComponentOrDefaultAccessor incorrectly reading query.row instead…
Browse files Browse the repository at this point in the history
… of queriedEntity.row
  • Loading branch information
0ffz committed Mar 15, 2024
1 parent 604933b commit 0f88990
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.mineinabyss.geary.systems.accessors.type

import com.mineinabyss.geary.datatypes.ComponentId
import com.mineinabyss.geary.annotations.optin.UnsafeAccessors
import com.mineinabyss.geary.datatypes.ComponentId
import com.mineinabyss.geary.engine.archetypes.Archetype
import com.mineinabyss.geary.systems.accessors.Accessor
import com.mineinabyss.geary.systems.accessors.AccessorOperations
import com.mineinabyss.geary.systems.accessors.ReadOnlyAccessor
import com.mineinabyss.geary.systems.query.QueriedEntity
import com.mineinabyss.geary.systems.query.Query
Expand All @@ -27,6 +26,6 @@ class ComponentOrDefaultAccessor<T>(
cachedIndex = archetype.indexOf(id)
}
if (cachedIndex == -1) return default()
return archetype.componentData[cachedIndex][thisRef.row] as T
return archetype.componentData[cachedIndex][queriedEntity.row] as T
}
}

0 comments on commit 0f88990

Please sign in to comment.