DREAMWEB: Fix : getexpos has a return value AND a side-effect

This commit is contained in:
Bertrand Augereau 2011-09-02 01:05:32 +02:00
parent fa91f3abf1
commit 35d88d498c

View File

@ -1255,10 +1255,12 @@ void DreamGenContext::getexpos() {
const DynObject *objects = (const DynObject *)segRef(data.word(kExtras)).ptr(kExdata, sizeof(DynObject));
for (size_t i = 0; i < kNumexobjects; ++i) {
if (objects[i].mapad[0] == 0xff) {
data.byte(kExpos) = i;
di = kExdata + i * sizeof(DynObject);
return;
}
}
data.byte(kExpos) = kNumexobjects;
di = kExdata + kNumexobjects * sizeof(DynObject);
}