| 134 | } |
| 135 | |
| 136 | void xParCmdDamagePlayer_Update(xParCmd* c, xParGroup* ps, float dt) |
| 137 | { |
| 138 | xPar* p; |
| 139 | xParCmdDamagePlayer* cmd = (xParCmdDamagePlayer*)c->tasset; |
| 140 | xBound* pbound = &globals.player.ent.bound; |
| 141 | S32 last_idx = 10 - (xrand() & 1); |
| 142 | |
| 143 | p = ps->m_root; |
| 144 | while (p != NULL && last_idx-- > 0) |
| 145 | { |
| 146 | p = p->m_next; |
| 147 | } |
| 148 | |
| 149 | static xCollis collis; |
| 150 | static xBound bnd_fake; |
| 151 | |
| 152 | memset(&collis, 0, sizeof(xCollis)); |
| 153 | memset(&bnd_fake, 0, sizeof(xBound)); |
| 154 | bnd_fake.type = XBOUND_TYPE_SPHERE; |
| 155 | |
| 156 | while (p != NULL) |
| 157 | { |
| 158 | if (p->m_lifetime > 0.1f) |
| 159 | { |
| 160 | collis.flags = 0; |
| 161 | if (p->m_size > 1.0f) |
| 162 | { |
| 163 | bnd_fake.sph.r = 0.5f * p->m_size; |
| 164 | xVec3Copy(&bnd_fake.sph.center, &p->m_pos); |
| 165 | xQuickCullForBound(&bnd_fake.qcd, &bnd_fake); |
| 166 | xBoundHitsBound(&bnd_fake, pbound, &collis); |
| 167 | } |
| 168 | else |
| 169 | { |
| 170 | xVecHitsBound(&p->m_pos, pbound, &collis); |
| 171 | } |
| 172 | |
| 173 | if (collis.flags & 1) |
| 174 | { |
| 175 | zEntPlayer_Damage(NULL, 1, NULL); |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | for (S32 i = 0; i < cmd->granular; i++) |
| 180 | { |
| 181 | if (p == NULL) |
| 182 | { |
| 183 | break; |
| 184 | } |
| 185 | p = p->m_next; |
| 186 | } |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | void xParCmdJet_Update(xParCmd* c, xParGroup* ps, float dt) |
| 191 | { |
nothing calls this directly
no test coverage detected