1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-20 10:52:41 +01:00

(svn r25170) [1.3] -Backport from trunk:

- Fix: Original train and rv acceleration did no longer respect bridge speed limits [FS#5523] (r25167)
- Fix: [Win32] Do not statically link to SHGetFolderPath as it may not exist, and improve its emulation [FS#5522] (r25155, r25153)
- Fix: [Win32] Do not store invalid paths in the search path list (r25154)
- Fix: Remove stray reservation from savegames affected by FS#5510 et al. upon loading [FS#5520] (r25152)
- Fix: [Script] XXBase::Chance function did not work for large values (>65535) [FS#5517] (r25148)
This commit is contained in:
rubidium
2013-04-08 20:59:42 +00:00
parent 283ab728f2
commit 7daff778f9
8 changed files with 59 additions and 34 deletions

View File

@@ -44,7 +44,7 @@
/* static */ bool ScriptBase::Chance(uint out, uint max)
{
EnforcePrecondition(false, out <= max);
return (uint16)Rand() <= (uint16)((65535 * out) / max);
return ScriptBase::RandRange(max) < out;
}
/* static */ bool ScriptBase::ChanceItem(int unused_param, uint out, uint max)