| 1134 | for (int i = 0; i < mh->magazines.Size(); i++) |
| 1135 | { |
| 1136 | Ref<MagazineType> type = MagazineTypes.New(mh->magazines[i].name); |
| 1137 | if (!type) |
| 1138 | { |
| 1139 | continue; |
| 1140 | } |
| 1141 | int count = mh->magazines[i].count; |
| 1142 | for (int j = 0; j < count; j++) |
| 1143 | { |
| 1144 | Ref<Magazine> magazine = new Magazine(type); |
| 1145 | magazine->_ammo = type->_maxAmmo; |
| 1146 | magazine->_reloadMagazine = 0; |
| 1147 | magazine->_reload = 0; |
| 1148 | if (type->_modes.Size() > 0) |
| 1149 | { |
| 1150 | float reload = 0.8 + 0.2 * GRandGen.RandomValue(); |
| 1151 | magazine->_reload = reload * type->_modes[0]->_reloadTime; |
| 1152 | } |
| 1153 | pool._magazinesPool.Add(magazine); |
| 1154 | } |
| 1155 | } |
| 1156 | } |
| 1157 | |
| 1158 | void MissionHistory::AddWeapons(RString name, int count) |
| 1159 | { |
| 1160 | for (int j = 0; j < weapons.Size(); j++) |
no test coverage detected