-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: random_switch with triggers has side-effects, and thus must not …
…be optimised away.
- Loading branch information
Showing
4 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
grf { | ||
grfid: "NML\37"; | ||
name: string(STR_REGRESSION_NAME); | ||
desc: string(STR_REGRESSION_DESC); | ||
version: 0; | ||
min_compatible_version: 0; | ||
} | ||
|
||
random_switch(FEAT_TRAINS, SELF, unconditional_switch) { | ||
8: return 5; | ||
} | ||
|
||
random_switch(FEAT_TRAINS, SELF, trigger_only, bitmask(TRIGGER_VEHICLE_NEW_LOAD)) { | ||
8: return 7; | ||
} | ||
|
||
item(FEAT_TRAINS, colored_train, 100) { | ||
graphics { | ||
colour_mapping: unconditional_switch; | ||
default: trigger_only; | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Automatically generated by GRFCODEC. Do not modify! | ||
// (Info version 32) | ||
// Escapes: 2+ 2- 2< 2> 2u< 2u> 2/ 2% 2u/ 2u% 2* 2& 2| 2^ 2sto = 2s 2rst = 2r 2psto 2ror = 2rot 2cmp 2ucmp 2<< 2u>> 2>> | ||
// Escapes: 71 70 7= 7! 7< 7> 7G 7g 7gG 7GG 7gg 7c 7C | ||
// Escapes: D= = DR D+ = DF D- = DC Du* = DM D* = DnF Du<< = DnC D<< = DO D& D| Du/ D/ Du% D% | ||
// Format: spritenum imagefile depth xpos ypos xsize ysize xrel yrel zoom flags | ||
|
||
0 * 4 \d6 | ||
|
||
1 * 54 14 "C" "INFO" | ||
"B" "VRSN" \w4 \dx00000000 | ||
"B" "MINV" \w4 \dx00000000 | ||
"B" "NPAR" \w1 00 | ||
"B" "PALS" \w1 "A" | ||
"B" "BLTR" \w1 "8" | ||
00 | ||
00 | ||
2 * 52 08 08 "NML\37" "NML regression test" 00 "A test newgrf testing NML" 00 | ||
// Name: trigger_only | ||
3 * 23 02 00 FF 80 01 \b0 08 | ||
\wx8007 \wx8007 \wx8007 \wx8007 \wx8007 \wx8007 \wx8007 \wx8007 // (8/8) -> (8/8): return 7; | ||
|
||
4 * 9 00 00 \b1 01 FF \wx0064 | ||
1E 40 | ||
|
||
// Name: @action3_0 | ||
5 * 23 02 00 FF 89 | ||
0C 00 \dx0000FFFF | ||
\b1 | ||
\wx8005 \dx0000002D \dx0000002D // return 5; | ||
\wx00FF // trigger_only; | ||
|
||
6 * 9 03 00 01 FF \wx0064 \b0 | ||
\wx00FF // @action3_0; | ||
|