MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / AreObjectsAttached

Function AreObjectsAttached

Descent3/WeaponFire.cpp:947–963  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

945#include <algorithm>
946
947static bool AreObjectsAttached(const object *obj1, const object *obj2) {
948 const bool f_o1_a = (obj1->flags & OF_ATTACHED) != 0;
949 const bool f_o2_a = (obj2->flags & OF_ATTACHED) != 0;
950
951 if (f_o1_a || f_o2_a) {
952 const int o1_uh = obj1->attach_ultimate_handle;
953 const int o2_uh = obj2->attach_ultimate_handle;
954
955 if ((f_o1_a) && ((o1_uh == obj2->handle) || (f_o2_a && (o1_uh == o2_uh))))
956 return true;
957
958 if ((f_o2_a) && (o2_uh == obj1->handle))
959 return true;
960 }
961
962 return false;
963}
964
965bool ObjectsAreRelated(int o1, int o2) {
966 if ((o1 < 0) || (o2 < 0))

Callers 1

ObjectsAreRelatedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected