(svn r11523) -Codechange: Move the CHANCE macros to core/random_func.cpp cause they depend on Random()

-Codechange: Convert the CHANCE macros to functions and rename them fitting to the naming style
This commit is contained in:
skidd13
2007-11-25 15:35:25 +00:00
parent 2bf2be987d
commit bdc7fd2d76
13 changed files with 100 additions and 90 deletions

View File

@@ -1264,7 +1264,7 @@ static void BubbleTick(Vehicle *v)
}
if (b->y == 4 && b->x == 1) {
if (v->z_pos > 180 || CHANCE16I(1, 96, InteractiveRandom())) {
if (v->z_pos > 180 || Chance16I(1, 96, InteractiveRandom())) {
v->spritenum = 5;
SndPlayVehicleFx(SND_2F_POP, v);
}
@@ -1443,7 +1443,7 @@ void CheckVehicleBreakdown(Vehicle *v)
/* increase chance of failure */
chance = v->breakdown_chance + 1;
if (CHANCE16I(1,25,r)) chance += 25;
if (Chance16I(1,25,r)) chance += 25;
v->breakdown_chance = min(255, chance);
/* calculate reliability value to use in comparison */