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

Function dfGetPlayer

scripts/DallasFuncs.cpp:1049–1072  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1047}
1048
1049int dfGetPlayer(int objhandle) {
1050 msafe_struct mstruct;
1051 mstruct.objhandle = objhandle;
1052 MSafe_GetValue(MSAFE_OBJECT_TYPE, &mstruct);
1053
1054 if (mstruct.type == OBJ_WEAPON) {
1055 MSafe_GetValue(MSAFE_OBJECT_PARENT, &mstruct);
1056 MSafe_GetValue(MSAFE_OBJECT_TYPE, &mstruct);
1057
1058 if (mstruct.type == OBJ_PLAYER || mstruct.type == OBJ_OBSERVER || mstruct.type == OBJ_GHOST) {
1059 return mstruct.objhandle;
1060 } else {
1061 mprintf(0, "---------------------NOT A PLAYER OR PLAYER WEAPON!!!!!!!!!-------------\n");
1062 return objhandle;
1063 }
1064
1065 } else if (mstruct.type == OBJ_PLAYER || mstruct.type == OBJ_OBSERVER || mstruct.type == OBJ_GHOST) {
1066 return objhandle;
1067 } else {
1068 mprintf(0, "---------------------NOT A PLAYER OR PLAYER WEAPON!!!!!!!!!-------------\n");
1069 }
1070
1071 return objhandle;
1072}
1073
1074//
1075// D3 actions

Callers 3

aShowHUDMessageObjFunction · 0.85
aSoundPlay2DObjFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected