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

Commit aff1339

Browse files
committed
Snuck in proper handling for scripted function OnCollideWithMO. This actually belongs to CF104, oh well.
1 parent 739a140 commit aff1339

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Entities/MovableObject.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -786,8 +786,8 @@ bool MovableObject::IsAtRest()
786786

787787
bool MovableObject::OnMOHit(HitData &hd)
788788
{
789-
if (hd.pBody[HITOR] == this || hd.pBody[HITEE] == this) {
790-
RunScriptedFunctionInAppropriateScripts("OnCollideWithMO", false, false, {hd.pBody[hd.pBody[HITOR] == this ? HITEE : HITOR]});
789+
if (hd.pRootBody[HITOR] != hd.pRootBody[HITEE] && (hd.pBody[HITOR] == this || hd.pBody[HITEE] == this)) {
790+
RunScriptedFunctionInAppropriateScripts("OnCollideWithMO", false, false, {hd.pRootBody[hd.pBody[HITOR] == this ? HITEE : HITOR]});
791791
}
792792
return hd.terminate[hd.pRootBody[HITOR] == this ? HITOR : HITEE] = OnMOHit(hd.pRootBody[hd.pRootBody[HITOR] == this ? HITEE : HITOR]);
793793
}

0 commit comments

Comments
 (0)