Open SomeTroglodyte opened 9 months ago
I think require was the older way of doing it and not everything was changed
For the missions that want to take a Jump Drive from you we still need to keep that old form, but for other missions that check for being stuck we can indeed change it to the new method.
want to take a Jump Drive from you
Exactly. My patched Emerald Sword mission got a little complicated to ensure it's only OK when you can still jump after losing one "Jump Drive" outfit. One needs to be the exact outfit, the other can have whatever source.
Problem Description
Several missions test for the "Jump Drive" outfit when story-wise they should be testing for jump capability independent of source (Only relevant with plugins at the moment methinks).
Now, the
"flagship attribute: jump drive"
condition works perfectly fine, but some missions, e.g. "lost in coalition" or "Coalition: Expeditions Past 1", do not useto
conditions buton
..require
.Related Issue Links
9308
I'm sure there's others...
Desired Solution
Why not make the "require" node accept conditions?
Testbed data:
``` mission "lost in coalition" landing invisible source government "Coalition" "Heliarch" to offer has "license: Coalition" on offer require not "flagship attribute: jump drive" event "lost in coalition" 1 fail event "lost in coalition" ... mission "Coalition: Expeditions Past 1" minor name "Scouting Permit" description "Transport Sedlitaris, a Heliarch Tribune, to thePatch:
```patch Index: source/MissionAction.cpp IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/source/MissionAction.cpp b/source/MissionAction.cpp --- a/source/MissionAction.cpp (revision 460e3c426dd39767526992aae387083bbb947df6) +++ b/source/MissionAction.cpp (date 1706128598179) @@ -82,17 +82,18 @@ { const string &key = child.Token(0); bool hasValue = (child.Size() >= 2); + bool hasChildren = child.HasChildren(); if(key == "dialog") { if(hasValue && child.Token(1) == "phrase") { - if(!child.HasChildren() && child.Size() == 3) + if(!hasChildren && child.Size() == 3) dialogPhrase = ExclusiveItemThis tests just fine for me.
Alternative Approaches
Put the conditions in a
to
node - but I do not know enough about the project to guess why theon
..require
mechanism is used instead of, say,to offer
.Additional Context
I can compile and run, but not debug so far - so my testing might be a little on the short side.