fix iterating on dead entities after player dies
This commit is contained in:
parent
b0a8060d5b
commit
2e3acf4ec4
@ -4,11 +4,11 @@ Background: background-lila
|
||||
|
||||
|
||||
#############
|
||||
# #
|
||||
# t #
|
||||
#> S # #
|
||||
# ># >#
|
||||
#< # #
|
||||
# v# <#
|
||||
# ># ^#
|
||||
#< #W#####
|
||||
# o v# o#
|
||||
#############
|
||||
|
||||
|
||||
|
||||
@ -60,6 +60,10 @@ func (system *DestroyableSystem) Update() error {
|
||||
doorposition, renderable, door := query.Get()
|
||||
|
||||
for player := range playerobserver.Entities {
|
||||
if !system.World.Alive(player) {
|
||||
continue
|
||||
}
|
||||
|
||||
playerposition := (*Position)(system.World.Get(player, posID))
|
||||
playervelocity := (*Velocity)(system.World.Get(player, veloID))
|
||||
|
||||
|
||||
@ -60,6 +60,10 @@ func (system *TransientSystem) Update() error {
|
||||
transientposition, _, transient := query.Get()
|
||||
|
||||
for player := range playerobserver.Entities {
|
||||
if !system.World.Alive(player) {
|
||||
continue
|
||||
}
|
||||
|
||||
playerposition := (*Position)(system.World.Get(player, posID))
|
||||
playervelocity := (*Velocity)(system.World.Get(player, veloID))
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user