these functions must be used instead of pointer arithmetic, because the game allocates gentities with private information after the server shared part int SV_NumForGentity( gentity_t *ent ) { int num; num = ( (byte *)ent - (byte *)ge->gentities ) / ge->gentitySize; return num; } */
| 64 | } |
| 65 | */ |
| 66 | gentity_t *SV_GentityNum( int num ) { |
| 67 | gentity_t *ent; |
| 68 | |
| 69 | assert (num >=0); |
| 70 | ent = (gentity_t *)((byte *)ge->gentities + ge->gentitySize*(num)); |
| 71 | |
| 72 | return ent; |
| 73 | } |
| 74 | |
| 75 | svEntity_t *SV_SvEntityForGentity( gentity_t *gEnt ) { |
| 76 | if ( !gEnt || gEnt->s.number < 0 || gEnt->s.number >= MAX_GENTITIES ) { |
no outgoing calls
no test coverage detected