… | |
… | |
3310 | // now handle slot exclusions |
3310 | // now handle slot exclusions |
3311 | if (slot) |
3311 | if (slot) |
3312 | { |
3312 | { |
3313 | // only one slot can be active |
3313 | // only one slot can be active |
3314 | if (want_apply) |
3314 | if (want_apply) |
|
|
3315 | { |
|
|
3316 | // clear slot unless we are in it already |
|
|
3317 | if (*slot != ob) |
|
|
3318 | apply (*slot, AP_UNAPPLY); |
|
|
3319 | |
|
|
3320 | // unapply other slot, because we want to become active |
3315 | apply (oslot, AP_UNAPPLY); |
3321 | apply (oslot, AP_UNAPPLY); |
|
|
3322 | } |
3316 | |
3323 | |
3317 | // clear item from slot if applied |
3324 | // clear item from slot if applied |
3318 | if (!want_apply && *slot == ob) |
3325 | if (!want_apply && current_weapon == ob) |
3319 | { |
|
|
3320 | *slot = 0; |
|
|
3321 | |
|
|
3322 | if (current_weapon == ob) |
|
|
3323 | current_weapon = 0; |
3326 | current_weapon = 0; |
3324 | } |
|
|
3325 | } |
3327 | } |
3326 | } |
3328 | } |
3327 | |
3329 | |
3328 | if (ob->flag [FLAG_APPLIED] != want_apply) |
3330 | if (ob->flag [FLAG_APPLIED] != want_apply) |
3329 | manual_apply (this, ob, aflags); |
3331 | manual_apply (this, ob, aflags); |
3330 | |
3332 | |
3331 | if (ob->flag [FLAG_APPLIED] != want_apply) |
3333 | if (ob->flag [FLAG_APPLIED] != want_apply) |
3332 | return false; |
3334 | return false; |
3333 | |
3335 | |
3334 | if (slot) |
3336 | if (slot && want_apply) |
3335 | current_weapon = *slot = ob; |
3337 | current_weapon = *slot = ob; |
3336 | |
3338 | |
3337 | return true; |
3339 | return true; |
3338 | } |
3340 | } |
3339 | |
3341 | |