int closest = -1;
float closestdist = std::numeric_limits<float>::max();
- for (int i = 0; i < Object::objects.size(); i++) {
- float distance = distsq(&Object::objects[i]->position, &Person::players[0]->coords);
+ for (unsigned int i = 0; i < Object::objects.size(); i++) {
+ float distance = distsq(&Object::objects[i]->position,
+ &Person::players[0]->coords);
if (distance < closestdist) {
closestdist = distance;
- closest = i;
+ closest = (int) i;
}
}
return closest;
"Textures/Skybox(snow)/Down.jpg");
-
-
texdetail = temptexdetail;
} else if (environment == desertenvironment) {
windvector = 0;
"Textures/Skybox(sand)/Down.jpg");
-
-
texdetail = temptexdetail;
} else if (environment == grassyenvironment) {
windvector = 0;
"Textures/Skybox(grass)/Down.jpg");
-
texdetail = temptexdetail;
}
temptexdetail = texdetail;
freeze = 0;
winfreeze = 0;
- for (int i = 0; i < 100; i++)
+ for (unsigned char i = 0; i < 100; i++)
bonusnum[i] = 0;
numfalls = 0;
/* Grow tree leaves?? */
if (Input::isKeyPressed(SDL_SCANCODE_Y)) {
- for (int i = 0; i < Object::objects.size(); i++) {
- if (Object::objects[i]->type == treeleavestype) {
- Object::objects[i]->scale *= .9;
+ for (auto& an_object : Object::objects) {
+ if (an_object->type == treeleavestype) {
+ an_object->scale *= .9;
}
}
}
terrain.decalalivetime[j] < 2)
terrain.DeleteDecal(j);
}
- for (int l = 0; l < Object::objects.size(); l++) {
+ for (unsigned int l = 0; l < Object::objects.size(); l++) {
if (Object::objects[l]->model.type == decalstype)
for (int j = 0; j < Object::objects[l]->model.numdecals; j++) {
if ((Object::objects[l]->model.decaltype[j] == blooddecal ||
terrain.DeleteDecal(j);
}
}
- for (int l = 0; l < Object::objects.size(); l++) {
+ for (unsigned int l = 0; l < Object::objects.size(); l++) {
if (Object::objects[l]->model.type == decalstype)
for (int j = 0; j < Object::objects[l]->model.numdecals; j++) {
if ((Object::objects[l]->model.decaltype[j] == blooddecal ||
Person::players[i]->avoidsomething = 0;
//avoid flaming things
- for (int j = 0; j < Object::objects.size(); j++)
+ for (unsigned int j = 0; j < Object::objects.size(); j++)
if (Object::objects[j]->onfire)
if (distsq(&Person::players[i]->coords, &Object::objects[j]->position) < sq(Object::objects[j]->scale) * 200)
if ( distsq(&Person::players[i]->coords, &Object::objects[j]->position) <