Moves a weapon from a given index into a new one (above MAX_STATIC_WEAPONS) returns new index
| 701 | // Moves a weapon from a given index into a new one (above MAX_STATIC_WEAPONS) |
| 702 | // returns new index |
| 703 | int MoveWeaponFromIndex(int index) { |
| 704 | ASSERT(index >= 0 && index < MAX_STATIC_WEAPONS); |
| 705 | ASSERT(Weapons[index].used); |
| 706 | |
| 707 | int new_index = AllocWeapon(); |
| 708 | memcpy(&Weapons[new_index], &Weapons[index], sizeof(weapon)); |
| 709 | FreeWeapon(index); |
| 710 | |
| 711 | return new_index; |
| 712 | } |
| 713 | |
| 714 | // This is a very confusing function. It takes all the weapons that we have loaded |
| 715 | // and remaps then into their proper places (if they are static). |
no test coverage detected