Skip to content

Commit

Permalink
Add: [NewGRF] Global var 3F (with parameter), check mapping of a rail…
Browse files Browse the repository at this point in the history
…type by making a reverse lookup
  • Loading branch information
Eddi-z committed Feb 28, 2019
1 parent b972eeb commit 1dd97e7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/newgrf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "newgrf_airporttiles.h"
#include "newgrf_airport.h"
#include "newgrf_object.h"
#include "newgrf_railtype.h"
#include "rev.h"
#include "fios.h"
#include "strings_func.h"
Expand Down Expand Up @@ -6046,6 +6047,12 @@ bool GetGlobalVariable(byte param, uint32 *value, const GRFFile *grffile, uint32
*value = _cur_year;
return true;

case 0x3F: { // Check translation of arbitrary railtype
*value = GetReverseRailTypeTranslation(_cur.grffile->railtype_map[parameter], _cur.grffile);
return true;
}


default: return false;
}
}
Expand Down

0 comments on commit 1dd97e7

Please sign in to comment.