Skip to content

Commit

Permalink
Fix issue #4999: Problem with satisfying readable objective "when clo…
Browse files Browse the repository at this point in the history
…sed". Superfluous arguments were kept in the Component when switching types.
  • Loading branch information
codereader committed Mar 10, 2019
1 parent 047682d commit 06e6d35
Show file tree
Hide file tree
Showing 16 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugins/dm.objectives/ce/AIFindBodyComponentEditor.cpp
Expand Up @@ -57,6 +57,7 @@ void AIFindBodyComponentEditor::writeToComponent() const
Specifier::FIRST_SPECIFIER, _bodyCombo->getSpecifier()
);

_component->clearArguments();
_component->setArgument(0, string::to_string(_amount->GetValue()));
}

Expand Down
2 changes: 2 additions & 0 deletions plugins/dm.objectives/ce/AIFindItemComponentEditor.cpp
Expand Up @@ -34,6 +34,8 @@ void AIFindItemComponentEditor::writeToComponent() const
if (!_active) return; // still under construction

assert(_component);

_component->clearArguments();
// TODO
}

Expand Down
1 change: 1 addition & 0 deletions plugins/dm.objectives/ce/AlertComponentEditor.cpp
Expand Up @@ -66,6 +66,7 @@ void AlertComponentEditor::writeToComponent() const
Specifier::FIRST_SPECIFIER, _targetCombo->getSpecifier()
);

_component->clearArguments();
_component->setArgument(0, string::to_string(_amount->GetValue()));
_component->setArgument(1, string::to_string(_alertLevel->GetValue()));
}
Expand Down
1 change: 1 addition & 0 deletions plugins/dm.objectives/ce/CustomClockedComponentEditor.cpp
Expand Up @@ -63,6 +63,7 @@ void CustomClockedComponentEditor::writeToComponent() const

assert(_component);

_component->clearArguments();
_component->setArgument(0, _scriptFunction->GetValue().ToStdString());
_component->setClockInterval(static_cast<float>(_interval->GetValue()));
}
Expand Down
2 changes: 2 additions & 0 deletions plugins/dm.objectives/ce/CustomComponentEditor.cpp
Expand Up @@ -35,6 +35,8 @@ void CustomComponentEditor::writeToComponent() const
{
if (!_active) return; // still under construction

_component->clearArguments();

// nothing to save here
}

Expand Down
1 change: 1 addition & 0 deletions plugins/dm.objectives/ce/DestroyComponentEditor.cpp
Expand Up @@ -56,6 +56,7 @@ void DestroyComponentEditor::writeToComponent() const
Specifier::FIRST_SPECIFIER, _itemSpec->getSpecifier()
);

_component->clearArguments();
_component->setArgument(0,
string::to_string(_amount->GetValue()));
}
Expand Down
1 change: 1 addition & 0 deletions plugins/dm.objectives/ce/DistanceComponentEditor.cpp
Expand Up @@ -85,6 +85,7 @@ void DistanceComponentEditor::writeToComponent() const

assert(_component);

_component->clearArguments();
_component->setArgument(0, _entity->GetValue().ToStdString());
_component->setArgument(1, _location->GetValue().ToStdString());
_component->setArgument(2, string::to_string(_distance->GetValue()));
Expand Down
2 changes: 2 additions & 0 deletions plugins/dm.objectives/ce/InfoLocationComponentEditor.cpp
Expand Up @@ -56,6 +56,8 @@ void InfoLocationComponentEditor::writeToComponent() const
_component->setSpecifier(
Specifier::SECOND_SPECIFIER, _locationSpec->getSpecifier()
);

_component->clearArguments();
}

} // namespace ce
Expand Down
1 change: 1 addition & 0 deletions plugins/dm.objectives/ce/ItemComponentEditor.cpp
Expand Up @@ -56,6 +56,7 @@ void ItemComponentEditor::writeToComponent() const
Specifier::FIRST_SPECIFIER, _itemSpec->getSpecifier()
);

_component->clearArguments();
_component->setArgument(0, string::to_string(_amount->GetValue()));
}

Expand Down
1 change: 1 addition & 0 deletions plugins/dm.objectives/ce/KillComponentEditor.cpp
Expand Up @@ -57,6 +57,7 @@ void KillComponentEditor::writeToComponent() const
Specifier::FIRST_SPECIFIER, _targetCombo->getSpecifier()
);

_component->clearArguments();
_component->setArgument(0, string::to_string(_amount->GetValue()));
}

Expand Down
1 change: 1 addition & 0 deletions plugins/dm.objectives/ce/KnockoutComponentEditor.cpp
Expand Up @@ -57,6 +57,7 @@ void KnockoutComponentEditor::writeToComponent() const
Specifier::FIRST_SPECIFIER, _targetCombo->getSpecifier()
);

_component->clearArguments();
_component->setArgument(0, string::to_string(_amount->GetValue()));
}

Expand Down
2 changes: 2 additions & 0 deletions plugins/dm.objectives/ce/LocationComponentEditor.cpp
Expand Up @@ -56,6 +56,8 @@ void LocationComponentEditor::writeToComponent() const
_component->setSpecifier(
Specifier::SECOND_SPECIFIER, _locationSpec->getSpecifier()
);

_component->clearArguments();
}

} // namespace ce
Expand Down
1 change: 1 addition & 0 deletions plugins/dm.objectives/ce/PickpocketComponentEditor.cpp
Expand Up @@ -56,6 +56,7 @@ void PickpocketComponentEditor::writeToComponent() const
Specifier::FIRST_SPECIFIER, _itemSpec->getSpecifier()
);

_component->clearArguments();
_component->setArgument(0,
string::to_string(_amount->GetValue()));
}
Expand Down
2 changes: 2 additions & 0 deletions plugins/dm.objectives/ce/ReadableClosedComponentEditor.cpp
Expand Up @@ -41,6 +41,8 @@ void ReadableClosedComponentEditor::writeToComponent() const
_component->setSpecifier(
Specifier::FIRST_SPECIFIER, _readableSpec->getSpecifier()
);

_component->clearArguments();
}

} // namespace ce
Expand Down
2 changes: 2 additions & 0 deletions plugins/dm.objectives/ce/ReadableOpenedComponentEditor.cpp
Expand Up @@ -41,6 +41,8 @@ void ReadableOpenedComponentEditor::writeToComponent() const
_component->setSpecifier(
Specifier::FIRST_SPECIFIER, _readableSpec->getSpecifier()
);

_component->clearArguments();
}

} // namespace ce
Expand Down
Expand Up @@ -57,6 +57,7 @@ void ReadablePageReachedComponentEditor::writeToComponent() const
Specifier::FIRST_SPECIFIER, _readableSpec->getSpecifier()
);

_component->clearArguments();
_component->setArgument(0, string::to_string(_pageNum->GetValue()));
}

Expand Down

0 comments on commit 06e6d35

Please sign in to comment.