- int numliveplayers = 0;
- center = 0;
- for (unsigned i = 0; i < Person::players.size(); i++) {
- if (!Person::players[i]->dead)
- numliveplayers++;
- }
-
- int numadd = 0;
-
- for (int i = 0; i < objects.numobjects; i++) {
- if (objects.type[i] == treetrunktype || objects.type[i] == boxtype) {
- center += objects.position[i];
- numadd++;
- }
- }
- for (unsigned i = 0; i < Person::players.size(); i++) {
- if (!Person::players[i]->dead)
- center += Person::players[i]->coords;
- }
- center /= numadd + numliveplayers;