From 64bcb731bf0b28d9bf1391ac265ea47ba0a2f374 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 17 May 2011 12:31:21 +0200 Subject: LURE: Rename method random() -> getRandom() Also get rid of a slight bias for 0 in the random numbers (it was selected twice as often as any other number). --- engines/lure/res.h | 2 +- engines/lure/scripts.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/lure') diff --git a/engines/lure/res.h b/engines/lure/res.h index f5c8711c2b..a0a908f53d 100644 --- a/engines/lure/res.h +++ b/engines/lure/res.h @@ -114,7 +114,7 @@ public: MemoryBlock *messagesData() { return _messagesData; } uint16 getHotspotScript(uint16 index); HotspotList &activeHotspots() { return _activeHotspots; } - uint16 random() { return _rnd.getRandomNumber(65536) & 0xffff; } + uint16 getRandom() { return _rnd.getRandomNumber(0xffff); } HotspotData *getHotspot(uint16 hotspotId); Hotspot *getActiveHotspot(uint16 hotspotId); HotspotOverrideData *getHotspotOverride(uint16 hotspotId); diff --git a/engines/lure/scripts.cpp b/engines/lure/scripts.cpp index 7cd8be43d2..22656dd3fe 100644 --- a/engines/lure/scripts.cpp +++ b/engines/lure/scripts.cpp @@ -1127,7 +1127,7 @@ uint16 Script::execute(uint16 startOffset) { break; case S_OPCODE_RANDOM: - param = r.random() >> 8; // make number between 0 to 255 + param = r.getRandom() >> 8; // make number between 0 to 255 break; case S_OPCODE_END: -- cgit v1.2.3