Gets the player slot from the specified object, if the object is a player or player weapon Returns -1 if can't find player
| 1260 | // Gets the player slot from the specified object, if the object is a player or player weapon |
| 1261 | // Returns -1 if can't find player |
| 1262 | int GetPlayerSlot(int objhandle) { |
| 1263 | object *objp = ObjGet(objhandle); |
| 1264 | if (!objp) |
| 1265 | return -1; |
| 1266 | if (objp->type == OBJ_WEAPON) |
| 1267 | objp = ObjGetUltimateParent(objp); |
| 1268 | if (objp->type == OBJ_PLAYER) |
| 1269 | return objp->id; |
| 1270 | else |
| 1271 | return -1; |
| 1272 | } |
| 1273 | #define GB_TOKEN "GUIDEBOT:" |
| 1274 | // If the src message is from the guidebot, xlates it into the proper format. If not a GB |
| 1275 | // message, just copies the string over. |
no test coverage detected