turn player into primary if only one left
This commit is contained in:
@@ -3,6 +3,8 @@ package observers
|
||||
import (
|
||||
"openquell/components"
|
||||
|
||||
"log/slog"
|
||||
|
||||
"github.com/mlange-42/arche/ecs"
|
||||
"github.com/mlange-42/arche/ecs/event"
|
||||
"github.com/mlange-42/arche/generic"
|
||||
@@ -27,6 +29,7 @@ func (observer *GameObserver) GetListenerCallback(comp ecs.ID) listener.Callback
|
||||
return listener.NewCallback(
|
||||
func(world *ecs.World, event ecs.EntityEvent) {
|
||||
observer.RemoveEntity(event.Entity, comp)
|
||||
slog.Debug("player removed")
|
||||
},
|
||||
event.EntityRemoved,
|
||||
comp,
|
||||
|
||||
Reference in New Issue
Block a user