ClementSparrow / Pattern-Script

Open Source HTML5 Game Engine based on PuzzleScript
20 stars 2 forks source link

Directionless rules are expanded unnecessarily #72

Open david-pfx opened 1 year ago

david-pfx commented 1 year ago

Multiple rules are generated incorrectly for directionless rules. From tubetransport: [ wasMoved:dirs ] -> [ ] generates the following:

  (1115) UP [ wasmoved:dirs ] -> [ ]
+ (1115) DOWN [ wasmoved:dirs ] -> [ ]
+ (1115) LEFT [ wasmoved:dirs ] -> [ ]
+ (1115) RIGHT [ wasmoved:dirs ] -> [ ]

Only one rule is required for a directionless rule. There is code in vanilla PS to detect and implement this.

ClementSparrow commented 1 year ago

I think it's a duplicate of #43, assuming that dirs is a shortcut for directions.

david-pfx commented 1 year ago

It's not a duplicate, but it is obviously related. The point is that there is a category of non-directional rules, and they never need to be expanded across the multiple rule directions. See the PS code for details.