Closed jsm174 closed 2 years ago
This was discovered while working on https://github.com/freezy/VisualPinball.Engine/pull/344.
We are seeing that the switch manager is not showing the correct status for multi-matched switch devices.
Using Rock as our example, switch 41 is currently used in 8 places:
41
A
B
C
D
E
F
G
H
If the user hits A, all 41 entries in the Switch Manager close. Totally fine.
However, if the user hits B, C , D, E, F, G, H, the entries in the switch manager will not close.
The Game Logic Engine will work fine and PinMame registers the switch for A - H.
The SwitchPlayer statuses are a dictionary by ID 41 https://github.com/freezy/VisualPinball.Engine/blob/67aca1d72b51a92e66389a46fe1ae09282d4bde3/VisualPinball.Unity/VisualPinball.Unity/Game/SwitchPlayer.cs#L87-L90
SwitchPlayer
So when the player is populating the dictionary, each ID 41 switch device overwrites the last one.
So that's why the manager looks like its only monitoring one device.
This was fixed in https://github.com/freezy/VisualPinball.Engine/pull/347.
This was discovered while working on https://github.com/freezy/VisualPinball.Engine/pull/344.
We are seeing that the switch manager is not showing the correct status for multi-matched switch devices.
Using Rock as our example, switch
41
is currently used in 8 places:A
(Behind upper drop target bank)B
(Behind lower drop target bank)C
(Upper left side rubber)D
(Upper right side rubber)E
(Middle left side rubber)F
(Middle right side rubber)G
(Left slingshot - FUTURE)H
(Right slingshot - FUTURE)If the user hits
A
, all41
entries in the Switch Manager close. Totally fine.However, if the user hits
B
,C
,D
,E
,F
,G
,H
, the entries in the switch manager will not close.The Game Logic Engine will work fine and PinMame registers the switch for
A
-H
.The
SwitchPlayer
statuses are a dictionary by ID41
https://github.com/freezy/VisualPinball.Engine/blob/67aca1d72b51a92e66389a46fe1ae09282d4bde3/VisualPinball.Unity/VisualPinball.Unity/Game/SwitchPlayer.cs#L87-L90So when the player is populating the dictionary, each ID
41
switch device overwrites the last one.So that's why the manager looks like its only monitoring one device.