--- a/src/proto2/Physics.cc Mon Nov 24 21:38:04 2008 +0000
+++ b/src/proto2/Physics.cc Mon Nov 24 21:48:21 2008 +0000
@@ -175,10 +175,10 @@
float minVelocity = 10;
// Check if any of the four corners of the worm collide
for(int sh = 0; sh < 4; sh++) {
- if(world.getType(tmpVector+shape[2]) != EMPTY) {
+ if(world.getType(tmpVector+shape[sh]) != EMPTY) {
reached = position + unitVector*(i-1);
collided = true;
- this->bounce(world.getNormal(tmpVector+shape[2], tmpVector-unitVector+shape[2]));
+ this->bounce(world.getNormal(tmpVector+shape[sh], tmpVector-unitVector+shape[sh]));
this->velocity *= 0.6;
if(abs(this->velocity.x) < minVelocity && (abs(this->velocity.y) < minVelocity)) {
this->inAir = false;
@@ -329,7 +329,7 @@
frees.push_back(DIRECTIONS[dirIdx]);
Vector normal(0,0);
- for(int i = 0; i < frees.size(); i++) {
+ for(unsigned int i = 0; i < frees.size(); i++) {
normal += frees[i];
}
return normal;