Skip to content

Commit

Permalink
LAB: Make readAction consistent with the other read functions
Browse files Browse the repository at this point in the history
  • Loading branch information
wjp committed Dec 24, 2015
1 parent 0d97d1a commit ad182f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions engines/lab/resource.cpp
Expand Up @@ -242,18 +242,19 @@ Common::Array<int16> Resource::readConditions(Common::File *file) {
void Resource::readRule(Common::File *file, RuleList &rules) {
rules.clear();
while (file->readByte() == 1) {
Rule rule;
rules.push_back(Rule());
Rule &rule = rules.back();

rule._ruleType = (RuleType)file->readSint16LE();
rule._param1 = file->readSint16LE();
rule._param2 = file->readSint16LE();
rule._condition = readConditions(file);
rule._actionList = readAction(file);
rules.push_back(rule);
readAction(file, rule._actionList);
}
}

Common::List<Action> Resource::readAction(Common::File *file) {
Common::List<Action> list;
void Resource::readAction(Common::File *file, Common::List<Action>& list) {
list.clear();

while (file->readByte() == 1) {
list.push_back(Action());
Expand All @@ -272,8 +273,6 @@ Common::List<Action> Resource::readAction(Common::File *file) {
action._messages.push_back(readString(file));
}
}

return list;
}

void Resource::readCloseUps(uint16 depth, Common::File *file, Common::List<CloseData> &list) {
Expand Down
2 changes: 1 addition & 1 deletion engines/lab/resource.h
Expand Up @@ -110,7 +110,7 @@ class Resource {
Common::String readString(Common::File *file);
Common::Array<int16> readConditions(Common::File *file);
void readRule(Common::File *file, RuleList &rules);
Common::List<Action> readAction(Common::File *file);
void readAction(Common::File *file, Common::List<Action> &action);
void readCloseUps(uint16 depth, Common::File *file, Common::List<CloseData> &close);
void readView(Common::File *file, Common::List<ViewData> &view);
void readStaticText();
Expand Down

0 comments on commit ad182f1

Please sign in to comment.