Introduce RANDOMFRAC() macro

This commit is contained in:
Ryan Dwyer
2022-04-02 12:21:25 +10:00
parent 3e93b586a2
commit 40c778872e
23 changed files with 152 additions and 154 deletions
+1
View File
@@ -34,6 +34,7 @@
#define MPCHR(index) ((index) < 4 ? &g_PlayerConfigsArray[index].base : &g_BotConfigsArray[(index) - 4].base)
#define PLAYERCOUNT() ((g_Vars.players[0] ? 1 : 0) + (g_Vars.players[1] ? 1 : 0) + (g_Vars.players[2] ? 1 : 0) + (g_Vars.players[3] ? 1 : 0))
#define PLAYERCOUNT3012() ((g_Vars.players[3] ? 1 : 0) + (g_Vars.players[0] ? 1 : 0) + (g_Vars.players[1] ? 1 : 0) + (g_Vars.players[2] ? 1 : 0))
#define RANDOMFRAC() (random() * (1.0f / U32_MAX))
#define SECSTOTIME240(secs) (secs * 240)
#define SECSTOTIME60(secs) (secs * 60)
#define PFS(device) (device == SAVEDEVICE_GAMEPAK ? NULL : &g_Pfses[device])