fix arche panic, by initializing colquery only when needed
This commit is contained in:
parent
a0b40139c7
commit
a86f6c816f
@ -64,7 +64,6 @@ func NewLevel(game *Game, cellsize int, plan *assets.RawLevel) *Level {
|
||||
|
||||
func (level *Level) Update() {
|
||||
query := level.World.Query(level.Selector["player"])
|
||||
colquery := level.World.Query(level.Selector["collectible"])
|
||||
|
||||
for query.Next() {
|
||||
playerposition := (*components.Position)(query.Get(level.Component["position"]))
|
||||
@ -105,6 +104,7 @@ func (level *Level) Update() {
|
||||
}
|
||||
}
|
||||
|
||||
colquery := level.World.Query(level.Selector["collectible"])
|
||||
for colquery.Next() {
|
||||
collectible := (*components.Collectible)(colquery.Get(level.Component["collectible"]))
|
||||
colposition := (*components.Position)(colquery.Get(level.Component["position"]))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user