diff options
author | skidd13 <skidd13@openttd.org> | 2007-11-25 15:35:25 +0000 |
---|---|---|
committer | skidd13 <skidd13@openttd.org> | 2007-11-25 15:35:25 +0000 |
commit | e36dba227b3ef5414757282661a8108d3a2bc9f6 (patch) | |
tree | 169a43d7faea93613e95fcd0c3221376b8fbfc11 /src/train_cmd.cpp | |
parent | e3092f679177eda2ecfe5dcf05cd565cbe62c3fa (diff) | |
download | openttd-e36dba227b3ef5414757282661a8108d3a2bc9f6.tar.xz |
(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
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r-- | src/train_cmd.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 75a431bc1..05d95613e 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -2015,7 +2015,7 @@ static void HandleLocomotiveSmokeCloud(const Vehicle* v) case 1: /* diesel smoke */ - if (u->cur_speed <= 40 && CHANCE16(15, 128)) { + if (u->cur_speed <= 40 && Chance16(15, 128)) { CreateEffectVehicleRel(v, 0, 0, 10, EV_DIESEL_SMOKE); sound = true; } @@ -2023,7 +2023,7 @@ static void HandleLocomotiveSmokeCloud(const Vehicle* v) case 2: /* blue spark */ - if (GB(v->tick_counter, 0, 2) == 0 && CHANCE16(1, 45)) { + if (GB(v->tick_counter, 0, 2) == 0 && Chance16(1, 45)) { CreateEffectVehicleRel(v, 0, 0, 10, EV_ELECTRIC_SPARK); sound = true; } @@ -3114,7 +3114,7 @@ static void HandleCrashedTrain(Vehicle *v) } uint32 r; - if (state <= 200 && CHANCE16R(1, 7, r)) { + if (state <= 200 && Chance16R(1, 7, r)) { int index = (r * 10 >> 16); Vehicle *u = v; @@ -3392,7 +3392,7 @@ static void CheckIfTrainNeedsService(Vehicle *v) if (v->current_order.type == OT_GOTO_DEPOT && v->current_order.dest != depot->index && - !CHANCE16(3, 16)) { + !Chance16(3, 16)) { return; } |