| 64 | } |
| 65 | |
| 66 | int CheckBaseHandle(CBaseHandle &hndl) |
| 67 | { |
| 68 | if (!hndl.IsValid()) |
| 69 | { |
| 70 | return -1; |
| 71 | } |
| 72 | |
| 73 | int index = hndl.GetEntryIndex(); |
| 74 | |
| 75 | edict_t *pStoredEdict; |
| 76 | CBaseEntity *pStoredEntity; |
| 77 | |
| 78 | pStoredEdict = GetEntity(index, &pStoredEntity); |
| 79 | |
| 80 | if (pStoredEdict == NULL || pStoredEntity == NULL) |
| 81 | { |
| 82 | return -1; |
| 83 | } |
| 84 | |
| 85 | IServerEntity *pSE = pStoredEdict->GetIServerEntity(); |
| 86 | |
| 87 | if (pSE == NULL) |
| 88 | { |
| 89 | return -1; |
| 90 | } |
| 91 | |
| 92 | if (pSE->GetRefEHandle() != hndl) |
| 93 | { |
| 94 | return -1; |
| 95 | } |
| 96 | |
| 97 | return index; |
| 98 | } |
| 99 | |
| 100 | //native GetStructInt(Handle:struct, const String:member[]); |
| 101 | static cell_t GetStructInt(IPluginContext *pContext, const cell_t *params) |
no test coverage detected