int weapon_cnt_fired = pl.accuracy_cnt_fired[i - WEP_FIRST];
int weapon_cnt_hit = pl.accuracy_cnt_hit[i - WEP_FIRST];
- int weapon_acc = floor((weapon_cnt_hit / weapon_cnt_fired) * 100);
+ int weapon_acc = 0;
+ if(weapon_cnt_fired)
+ weapon_acc = floor((weapon_cnt_hit / weapon_cnt_fired) * 100);
average_acc += weapon_acc;
string draw_str;
if(weapon_cnt_fired)
total_weapons++;
});
- average_acc = floor((average_acc / total_weapons) + 0.5);
+ if(total_weapons)
+ average_acc = floor((average_acc / total_weapons) + 0.5);
// draw total accuracy now
tmp_str = sprintf("%d%%", average_acc);
float entnum = ReadByte();
inventoryslots[entnum-1] = this;
+ LOG_INFO("Got inventory");
const int majorBits = Readbits(Inventory_groups_major);
for (int i = 0; i < Inventory_groups_major; ++i) {
int maj = G_MAJOR(it.m_id);
majorBits = BITSET(majorBits, BIT(maj), true);
minorBitsArr[maj] = BITSET(minorBitsArr[maj], BIT(G_MINOR(it.m_id)), true);
+ data.inventory.(fld) = data.(fld); // z411 fix
}
});
}
void Inventory_delete(entity e) { delete(e.inventory.inventory); delete(e.inventory); }
void Inventory_update(entity e) { e.inventory.SendFlags = 0xFFFFFF; }
+
+void Inventory_ClearAll() {
+ LOG_INFO("Clearing inventory");
+
+ FOREACH_CLIENT(IS_PLAYER(it), {
+ entity store = PS(it);
+ FOREACH(Items, true, {
+ store.inventory.inv_items[it.m_id] = 0;
+ });
+ Inventory_update(store);
+ });
+}
+
#endif
restart_mapalreadyrestarted = true;
reset_map(true);
Score_ClearAll();
+ Inventory_ClearAll();
delete(this);
}
// Reset ALL scores, but only do that at the beginning of the countdown if sv_ready_restart_after_countdown is off!
// Otherwise scores could be manipulated during the countdown.
- if (!sv_ready_restart_after_countdown) Score_ClearAll();
+ if (!sv_ready_restart_after_countdown) {
+ Score_ClearAll();
+ Inventory_ClearAll();
+ }
ReadyRestart_force();
}