diff options
author | Filippos Karapetis | 2011-12-15 00:30:31 +0200 |
---|---|---|
committer | Filippos Karapetis | 2011-12-15 00:30:31 +0200 |
commit | 509755a010967cc685001762b11996cc73891015 (patch) | |
tree | 8d8939975e3b3d2da93a941f1fdd5905d71643ff | |
parent | f0b0f25bd6165becd995aedd09cf46de6db3bbba (diff) | |
download | scummvm-rg350-509755a010967cc685001762b11996cc73891015.tar.gz scummvm-rg350-509755a010967cc685001762b11996cc73891015.tar.bz2 scummvm-rg350-509755a010967cc685001762b11996cc73891015.zip |
DREAMWEB: Further simplification of findSetObject() and findExObject() (thanks wjp)
-rw-r--r-- | engines/dreamweb/stubs.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index a3acfe8e37..01169a81df 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -1785,14 +1785,12 @@ void DreamGenContext::findSetObject() { } uint16 DreamGenContext::findSetObject(const char *id) { - uint16 index = 0; - - do { + for (uint16 index = 0; index < 128; index++) { if (objectMatches(getSetAd(index), id)) return index; - } while (index++ < 128); + } - return index; // 128, not found + return 128; } void DreamGenContext::findExObject() { @@ -1807,14 +1805,12 @@ void DreamGenContext::findExObject() { } uint16 DreamGenContext::findExObject(const char *id) { - uint16 index = 0; - - do { + for (uint16 index = 0; index < kNumexobjects; index++) { if (objectMatches(getExAd(index), id)) return index; - } while (index++ < 114); + } - return index; // 114, not found + return kNumexobjects; } bool DreamGenContext::isItDescribed(const ObjPos *pos) { |