Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/models/FGBuoyantForces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,12 @@ bool FGBuoyantForces::Load(Element *document)

PostLoad(document, FDMExec);

if (!NoneDefined) {
// Load() is public and appends to the cell list, so it may be called more than
// once to add further gas cells. The properties must only be tied the first
// time: tying them again fails and logs an error for each one.
if (!NoneDefined && !isBound) {
bind();
isBound = true;
}

return true;
Expand Down
1 change: 1 addition & 0 deletions src/models/FGBuoyantForces.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ class FGBuoyantForces : public FGModel
FGColumnVector3 vXYZgasCell_arm; // [lbs in]

bool NoneDefined;
bool isBound = false;

void bind(void);

Expand Down
8 changes: 7 additions & 1 deletion src/models/FGExternalReactions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,13 @@ bool FGExternalReactions::Load(Element* el)

PostLoad(el, FDMExec);

if (!Forces.empty()) bind();
// Load() is public and may be called more than once to add further forces, so
// the properties must only be tied the first time. Tying them again fails and
// logs an error for each one.
if (!Forces.empty() && !isBound) {
bind();
isBound = true;
}

return true;
}
Expand Down
1 change: 1 addition & 0 deletions src/models/FGExternalReactions.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ class FGExternalReactions : public FGModel
//unsigned int numForces;
FGColumnVector3 vTotalForces;
FGColumnVector3 vTotalMoments;
bool isBound = false;

void bind(void);
void Debug(int from) override;
Expand Down
Loading