File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -81,9 +81,9 @@ func (e *Engine) Enqueue(change *statemachine.Change) {
81
81
e .queue <- change
82
82
}
83
83
84
- func isUiOrigin (origins []string ) bool {
84
+ func isNonMajorityOrigin (origins []string ) bool {
85
85
for _ , origin := range origins {
86
- if origin == "UI" {
86
+ if origin == "UI" || origin == "Engine" || origin == "StateMachine" {
87
87
return true
88
88
}
89
89
}
@@ -93,7 +93,7 @@ func isUiOrigin(origins []string) bool {
93
93
func (e * Engine ) filterGameEvent (change * statemachine.Change ) * statemachine.Change {
94
94
gameEvent := change .GetAddGameEvent ().GameEvent
95
95
behavior := e .config .GameEventBehavior [gameEvent .Type .String ()]
96
- if isUiOrigin (gameEvent .Origin ) {
96
+ if isNonMajorityOrigin (gameEvent .Origin ) {
97
97
behavior = Config_BEHAVIOR_ACCEPT
98
98
}
99
99
switch behavior {
@@ -392,7 +392,8 @@ func (e *Engine) UpdateConfig(delta *Config) {
392
392
}
393
393
}
394
394
395
- // IsGameEventEnabled returns true, if the game event type is always accepted
395
+ // IsGameEventEnabled returns true, if the game event type is accept
396
396
func (e * Engine ) IsGameEventEnabled (evenType state.GameEvent_Type ) bool {
397
- return e .config .GameEventBehavior [evenType .String ()] == Config_BEHAVIOR_ACCEPT
397
+ return e .config .GameEventBehavior [evenType .String ()] == Config_BEHAVIOR_ACCEPT ||
398
+ e .config .GameEventBehavior [evenType .String ()] == Config_BEHAVIOR_ACCEPT_MAJORITY
398
399
}
You can’t perform that action at this time.
0 commit comments