File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -873,8 +873,6 @@ func (e *Engine) processGameEvent(event *GameEvent) error {
873
873
return nil
874
874
}
875
875
876
- e .applyQueuedGameEvents ()
877
-
878
876
e .AddGameEvent (event )
879
877
880
878
var additionalEvents []* GameEvent
@@ -978,6 +976,8 @@ func (e *Engine) processGameEvent(event *GameEvent) error {
978
976
979
977
log .Printf ("Processed game event %v" , event )
980
978
979
+ e .applyQueuedGameEvents ()
980
+
981
981
for _ , aEvent := range additionalEvents {
982
982
if err := e .processGameEvent (aEvent ); err != nil {
983
983
log .Print ("Could not process new additional game event: " , err )
@@ -989,6 +989,7 @@ func (e *Engine) processGameEvent(event *GameEvent) error {
989
989
990
990
func (e * Engine ) applyQueuedGameEvents () {
991
991
queuedGameEvents := e .State .GameEventsQueued
992
+ // clear the queue
992
993
e .State .GameEventsQueued = []* GameEvent {}
993
994
for _ , queuedEvent := range queuedGameEvents {
994
995
if err := e .processGameEvent (queuedEvent ); err != nil {
You can’t perform that action at this time.
0 commit comments