Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit a80a5e5

Browse files
committed
Fix regression of MovableMan:ValidMO so it's no longer broken in various edge cases
1 parent a22503a commit a80a5e5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Managers/MovableMan.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,9 +1110,12 @@ bool MovableMan::ValidateMOIDs() {
11101110
// Description: Indicates whether the passed in MovableObject pointer points to an
11111111
// MO that's currently active in the simulation, and kept by this MovableMan.
11121112

1113-
bool MovableMan::ValidMO(const MovableObject *pMOToCheck)
1114-
{
1115-
return pMOToCheck && pMOToCheck->GetID() != g_NoMOID;
1113+
bool MovableMan::ValidMO(const MovableObject *pMOToCheck) {
1114+
if (pMOToCheck && pMOToCheck->GetID() != g_NoMOID && pMOToCheck->GetParent() == nullptr) {
1115+
return true;
1116+
} else {
1117+
return IsActor(pMOToCheck) || IsDevice(pMOToCheck) || IsParticle(pMOToCheck);
1118+
}
11161119
}
11171120

11181121

0 commit comments

Comments
 (0)