get_tile_fid correct for backwards compatibility and flexibility

- Allow to pass elevation using the free bits of the tileNum value to access elevations 1 and 2 (instead of defaulting to dude_elevation, which is not how it worked before)
- Access roof FID and raw data using mode flags in the top 4 bits
This commit is contained in:
phobos2077
2023-06-12 18:26:28 +02:00
parent 0d960ca326
commit 4b9008d53c
4 changed files with 33 additions and 6 deletions
+3
View File
@@ -321,6 +321,9 @@
#define get_npc_stat_max(stat) sfall_func2("get_stat_max", stat, 1)
#define get_npc_stat_min(stat) sfall_func2("get_stat_min", stat, 1)
#define get_sfall_arg_at(argNum) sfall_func1("get_sfall_arg_at", argNum)
#define get_tile_fid_ext(tile, elev, mode) get_tile_fid(((mode bwand 0xF) * 0x10000000) bwor ((elev bwand 0xF) * 0x1000000) bwor (tile bwand 0xFFFFFF))
#define get_tile_ground_fid(tile, elev) get_tile_fid_ext(tile, elev, 0)
#define get_tile_roof_fid(tile, elev) get_tile_fid_ext(tile, elev, 1)
#define get_terrain_name(x, y) sfall_func2("get_terrain_name", x, y)
#define get_text_width(text) sfall_func1("get_text_width", text)
#define has_fake_perk_npc(npc, perk) sfall_func2("has_fake_perk_npc", npc, perk)