| 126 | extern gentity_t *WP_DropThermal( gentity_t *ent ); |
| 127 | extern qboolean WP_SaberLose( gentity_t *self, vec3_t throwDir ); |
| 128 | gentity_t *TossClientItems( gentity_t *self ) |
| 129 | { |
| 130 | //FIXME: drop left-hand weapon, too? |
| 131 | gentity_t *dropped = NULL; |
| 132 | gitem_t *item = NULL; |
| 133 | int weapon; |
| 134 | |
| 135 | if ( self->client->NPC_class == CLASS_SEEKER |
| 136 | || self->client->NPC_class == CLASS_REMOTE |
| 137 | || self->client->NPC_class == CLASS_SABER_DROID |
| 138 | || self->client->NPC_class == CLASS_VEHICLE |
| 139 | || self->client->NPC_class == CLASS_ATST) |
| 140 | { |
| 141 | // these things are so small that they shouldn't bother throwing anything |
| 142 | return NULL; |
| 143 | } |
| 144 | |
| 145 | // drop the weapon if not a saber or enemy-only weapon |
| 146 | weapon = self->s.weapon; |
| 147 | if ( weapon == WP_SABER ) |
| 148 | { |
| 149 | if ( self->weaponModel[0] < 0 ) |
| 150 | {//don't have one in right hand |
| 151 | self->s.weapon = WP_NONE; |
| 152 | } |
| 153 | else if ( !(self->client->ps.saber[0].saberFlags&SFL_NOT_DISARMABLE) |
| 154 | || g_saberPickuppableDroppedSabers->integer ) |
| 155 | {//okay to drop it |
| 156 | if ( WP_SaberLose( self, NULL ) ) |
| 157 | { |
| 158 | self->s.weapon = WP_NONE; |
| 159 | } |
| 160 | } |
| 161 | if ( g_saberPickuppableDroppedSabers->integer ) |
| 162 | {//drop your left one, too |
| 163 | if ( self->weaponModel[1] >= 0 ) |
| 164 | {//have one in left |
| 165 | if ( !(self->client->ps.saber[0].saberFlags&SFL_NOT_DISARMABLE) |
| 166 | || g_saberPickuppableDroppedSabers->integer ) |
| 167 | {//okay to drop it |
| 168 | //just drop an item |
| 169 | if ( self->client->ps.saber[1].name |
| 170 | && self->client->ps.saber[1].name[0] ) |
| 171 | {//have a valid string to use for saberType |
| 172 | //turn it into a pick-uppable item! |
| 173 | if ( G_DropSaberItem( self->client->ps.saber[1].name, self->client->ps.saber[1].blade[0].color, self->client->renderInfo.handLPoint, self->client->ps.velocity, self->currentAngles ) != NULL ) |
| 174 | {//dropped it |
| 175 | WP_RemoveSaber( self, 1 ); |
| 176 | } |
| 177 | } |
| 178 | } |
| 179 | } |
| 180 | } |
| 181 | } |
| 182 | else if ( weapon == WP_BLASTER_PISTOL ) |
| 183 | {//FIXME: either drop the pistol and make the pickup only give ammo or drop ammo |
| 184 | } |
| 185 | else if ( weapon == WP_STUN_BATON |
no test coverage detected