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

Function qObjIsPlayerWeapon

scripts/DallasFuncs.cpp:5229–5245  ·  view source on GitHub ↗

$$QUERY Objects b:[o:Object=IT] is a player weapon qObjIsPlayerWeapon Is this object a player weapon? Determines if the specified object is a player weapon Parameters: Object: The object to check $$END */

Source from the content-addressed store, hash-verified

5227$$END
5228*/
5229bool qObjIsPlayerWeapon(int handle) {
5230 msafe_struct mstruct;
5231
5232 mstruct.objhandle = handle;
5233
5234 MSafe_GetValue(MSAFE_OBJECT_TYPE, &mstruct);
5235
5236 if (mstruct.type == OBJ_WEAPON) {
5237 MSafe_GetValue(MSAFE_OBJECT_PARENT, &mstruct);
5238 MSafe_GetValue(MSAFE_OBJECT_TYPE, &mstruct);
5239
5240 if (mstruct.type == OBJ_PLAYER)
5241 return 1;
5242 }
5243
5244 return 0;
5245}
5246
5247/*
5248$$QUERY

Callers 15

CallEventMethod · 0.85
CallEventMethod · 0.85
CallEventMethod · 0.85
CallEventMethod · 0.85
CallEventMethod · 0.85
CallEventMethod · 0.85
CallEventMethod · 0.85
CallEventMethod · 0.85
CallEventMethod · 0.85
CallEventMethod · 0.85
CallEventMethod · 0.85
CallEventMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected