]> git.jsancho.org Git - lugaru.git/blobdiff - Source/GameTick.cpp
New non-atacking player
[lugaru.git] / Source / GameTick.cpp
index c1b038671b454c23beb94698377197e455d84ca6..ed1aed93a4c4ed8ff8a0652efbf8234c5120a20d 100644 (file)
@@ -840,13 +840,11 @@ bool Game::LoadLevel(const std::string& name, bool tutorial)
             } else {
                 Person::players[i]->damagetolerance = 200;
             }
-        }
 
-        Game::LoadingScreen();
+            Game::LoadingScreen();
 
-        Person::players[i]->tempanimation = Animation("Tempanim", lowheight, neutral);
+            Person::players[i]->tempanimation = Animation("Tempanim", lowheight, neutral);
 
-        if (i == 0) {
             Person::players[i]->headmorphness = 0;
             Person::players[i]->targetheadmorphness = 1;
             Person::players[i]->headmorphstart = 0;
@@ -1024,50 +1022,56 @@ void Game::ProcessInput()
 
     /* Devtools */
     if (devtools && !mainmenu) {
-        ProcessDevInput();
+        /* Console */
+        if (Input::isKeyPressed(consolekey)) {
+            console = !console;
+            if (console) {
+                OPENAL_SetFrequency(OPENAL_ALL);
+            } else {
+                freeze = 0;
+                waiting = false;
+            }
+        }
+
+        /* Other devtools, disabled when the console is shown */
+        if (!console) {
+            ProcessDevInput();
+        }
     }
 }
 
 void Game::ProcessDevInput()
 {
-    if (!devtools || mainmenu) {
+    if (!devtools || mainmenu || console) {
         return;
     }
 
-    /* Console */
-    if (Input::isKeyPressed(consolekey)) {
-        console = !console;
-        if (console) {
-            OPENAL_SetFrequency(OPENAL_ALL);
-        } else {
-            freeze = 0;
-            waiting = false;
-        }
-    }
-
     if (Input::isKeyDown(SDL_SCANCODE_LALT)) {
         /* Enable editor */
         if (Input::isKeyPressed(SDL_SCANCODE_M) && !Input::isKeyDown(SDL_SCANCODE_LSHIFT)) {
             editorenabled = !editorenabled;
             if (editorenabled) {
                 Person::players[0]->damagetolerance = 100000;
+                Person::players[0]->damage = 0;
+                Person::players[0]->permanentdamage = 0;
+                Person::players[0]->superpermanentdamage = 0;
+                Person::players[0]->burnt = 0;
+                Person::players[0]->bloodloss = 0;
+                Person::players[0]->deathbleeding = 0;
             } else {
                 Person::players[0]->damagetolerance = 200;
             }
-            Person::players[0]->damage = 0; // these lines were in both if and else, but I think they would better fit in the if
-            Person::players[0]->permanentdamage = 0;
-            Person::players[0]->superpermanentdamage = 0;
-            Person::players[0]->bloodloss = 0;
-            Person::players[0]->deathbleeding = 0;
         }
 
         /* Nullify damage and give 200000 health */
         if (Input::isKeyPressed(SDL_SCANCODE_H)) {
             Person::players[0]->damagetolerance = 200000;
             Person::players[0]->damage = 0;
-            Person::players[0]->burnt = 0;
             Person::players[0]->permanentdamage = 0;
             Person::players[0]->superpermanentdamage = 0;
+            Person::players[0]->burnt = 0;
+            Person::players[0]->bloodloss = 0;
+            Person::players[0]->deathbleeding = 0;
         }
 
         /* Change environment */
@@ -1207,22 +1211,8 @@ void Game::ProcessDevInput()
             }
 
             if (closest >= 0) {
-                if (Person::players[closest]->creature == rabbittype) {
-                    Person::players[closest]->creature = wolftype;
-                    Person::players[closest]->whichskin = 0;
-                    Person::players[closest]->skeletonLoad();
-                    Person::players[closest]->scale *= 1.15;
-
-                    Person::players[closest]->damagetolerance = 300;
-                } else { // wolftype
-                    Person::players[closest]->creature = rabbittype;
-                    Person::players[closest]->whichskin = 0;
-                    Person::players[closest]->skeletonLoad(true);
-
-                    Person::players[closest]->scale /= 1.15;
-
-                    Person::players[closest]->damagetolerance = 200;
-                }
+                person_type nextType = static_cast<person_type>((Person::players[closest]->creature + 1) % PersonType::types.size());
+                Person::players[closest]->changeCreatureType(nextType);
             }
         }
 
@@ -1442,7 +1432,7 @@ void Game::ProcessDevInput()
             Person::players.back()->howactive = editoractive;
             Person::players.back()->whichskin = (int)(abs(Random() % 3));
 
-            Person::players.back()->skeletonLoad(true);
+            Person::players.back()->skeletonLoad();
 
             Person::players.back()->skeleton.drawmodelclothes.textureptr.load("Textures/Belt.png", 1);
             Person::players.back()->speed = 1 + (float)(Random() % 100) / 1000;
@@ -1456,8 +1446,6 @@ void Game::ProcessDevInput()
 
             Person::players.back()->setProportions(1, 1, 1, 1);
 
-            Person::players.back()->tempanimation = Animation("Tempanim", lowheight, neutral);
-
             Person::players.back()->damagetolerance = 200;
 
             Person::players.back()->protectionhead = Person::players[0]->protectionhead;
@@ -1484,6 +1472,9 @@ void Game::ProcessDevInput()
             Person::players.back()->power = Person::players[0]->power;
             Person::players.back()->speedmult = Person::players[0]->speedmult;
 
+            if (Input::isKeyDown(SDL_SCANCODE_RSHIFT))
+                Person::players.back()->isplayerfriend = true;
+
             Person::players.back()->loaded = true;
         }
 
@@ -1597,7 +1588,7 @@ void Game::ProcessDevInput()
         }
 
         /* Decrease size for next object */
-        if (Input::isKeyDown(SDL_SCANCODE_DOWN) && !Input::isKeyDown(SDL_SCANCODE_LCTRL)) {
+        if (Input::isKeyDown(SDL_SCANCODE_DOWN) && Input::isKeyDown(SDL_SCANCODE_LSHIFT)) {
             editorsize -= multiplier;
             if (editorsize < .1) {
                 editorsize = .1;
@@ -1605,7 +1596,7 @@ void Game::ProcessDevInput()
         }
 
         /* Increase size for next object */
-        if (Input::isKeyDown(SDL_SCANCODE_UP) && !Input::isKeyDown(SDL_SCANCODE_LCTRL)) {
+        if (Input::isKeyDown(SDL_SCANCODE_UP) && Input::isKeyDown(SDL_SCANCODE_LSHIFT)) {
             editorsize += multiplier;
         }
 
@@ -1655,8 +1646,8 @@ void doJumpReversals()
                 Person::players[i]->skeleton.oldfree == 0 &&
                 (Person::players[i]->animTarget == jumpupanim ||
                  Person::players[k]->animTarget == jumpupanim) &&
-                (Person::players[i]->aitype == playercontrolled ||
-                 Person::players[k]->aitype == playercontrolled) &&
+                (Person::players[i]->isPlayerControlled() ||
+                 Person::players[k]->isPlayerControlled()) &&
                 ((Person::players[i]->aitype == attacktypecutoff && Person::players[i]->stunned <= 0) ||
                  (Person::players[k]->aitype == attacktypecutoff && Person::players[k]->stunned <= 0))) {
                 if (distsq(&Person::players[i]->coords, &Person::players[k]->coords) < 10 * sq((Person::players[i]->scale + Person::players[k]->scale) * 2.5) &&
@@ -1667,8 +1658,8 @@ void doJumpReversals()
                         Person::players[k]->animTarget != getupfromfrontanim &&
                         Animation::animations[Person::players[k]->animTarget].height == middleheight &&
                         normaldotproduct(Person::players[i]->velocity, Person::players[k]->coords - Person::players[i]->coords) < 0 &&
-                        ((Person::players[k]->aitype == playercontrolled && Person::players[k]->attackkeydown) ||
-                         Person::players[k]->aitype != playercontrolled)) {
+                        ((Person::players[k]->isPlayerControlled() && Person::players[k]->attackkeydown) ||
+                         !Person::players[k]->isPlayerControlled())) {
                         Person::players[i]->victim = Person::players[k];
                         Person::players[i]->velocity = 0;
                         Person::players[i]->animCurrent = jumpreversedanim;
@@ -1707,8 +1698,8 @@ void doJumpReversals()
                         Person::players[i]->animTarget != getupfromfrontanim &&
                         Animation::animations[Person::players[i]->animTarget].height == middleheight &&
                         normaldotproduct(Person::players[k]->velocity, Person::players[i]->coords - Person::players[k]->coords) < 0 &&
-                        ((Person::players[i]->aitype == playercontrolled && Person::players[i]->attackkeydown) ||
-                         Person::players[i]->aitype != playercontrolled)) {
+                        ((Person::players[i]->isPlayerControlled() && Person::players[i]->attackkeydown) ||
+                         !Person::players[i]->isPlayerControlled())) {
                         Person::players[k]->victim = Person::players[i];
                         Person::players[k]->velocity = 0;
                         Person::players[k]->animCurrent = jumpreversedanim;
@@ -1813,7 +1804,7 @@ void doAerialAcrobatics()
             for (unsigned int l = 0; l < terrain.patchobjects[Person::players[k]->whichpatchx][Person::players[k]->whichpatchz].size(); l++) {
                 unsigned int i = terrain.patchobjects[Person::players[k]->whichpatchx][Person::players[k]->whichpatchz][l];
                 if (Object::objects[i]->type != rocktype ||
-                    Object::objects[i]->scale > .5 && Person::players[k]->aitype == playercontrolled ||
+                    Object::objects[i]->scale > .5 && Person::players[k]->isPlayerControlled() ||
                     Object::objects[i]->position.y > Person::players[k]->coords.y) {
                     lowpoint = Person::players[k]->coords;
                     if (Person::players[k]->animTarget != jumpupanim &&
@@ -1835,7 +1826,7 @@ void doAerialAcrobatics()
                         tempcollide = 1;
                         //wall jumps
                         //TODO: refactor four similar blocks
-                        if (Person::players[k]->aitype == playercontrolled &&
+                        if (Person::players[k]->isPlayerControlled() &&
                             (Person::players[k]->animTarget == jumpupanim ||
                              Person::players[k]->animTarget == jumpdownanim ||
                              Person::players[k]->isFlip()) &&
@@ -1991,7 +1982,7 @@ void doAerialAcrobatics()
                             Person::players[k]->coords.y -= 1.35;
                             Person::players[k]->collide = 1;
 
-                            if ((Person::players[k]->grabdelay <= 0 || Person::players[k]->aitype != playercontrolled) &&
+                            if ((Person::players[k]->grabdelay <= 0 || !Person::players[k]->isPlayerControlled()) &&
                                 (Person::players[k]->animCurrent != climbanim &&
                                      Person::players[k]->animCurrent != hanganim &&
                                      !Person::players[k]->isWallJump() ||
@@ -2169,7 +2160,7 @@ void doAttacks()
         playerrealattackkeydown = Input::isKeyDown(attackkey);
     }
     if ((Person::players[0]->parriedrecently <= 0 ||
-         Person::players[0]->weaponactive == -1) &&
+         !Person::players[0]->hasWeapon()) &&
         (!oldattackkey ||
          (realthreat &&
           Person::players[0]->lastattack != swordslashanim &&
@@ -2201,7 +2192,7 @@ void doAttacks()
             Person::players[k]->attackkeydown = 0;
         }
         if (Person::players[k]->animTarget != rabbitrunninganim && Person::players[k]->animTarget != wolfrunninganim) {
-            if (Person::players[k]->aitype != playercontrolled) {
+            if (!Person::players[k]->isPlayerControlled()) {
                 Person::players[k]->victim = Person::players[0];
             }
             //attack key pressed
@@ -2256,7 +2247,7 @@ void doAttacks()
                      Person::players[k]->animTarget == walkanim ||
                      Person::players[k]->animTarget == sneakanim ||
                      Person::players[k]->isCrouch())) {
-                    const int attackweapon = Person::players[k]->weaponactive == -1 ? 0 : weapons[Person::players[k]->weaponids[Person::players[k]->weaponactive]].getType();
+                    const int attackweapon = (Person::players[k]->hasWeapon() ? weapons[Person::players[k]->weaponids[Person::players[k]->weaponactive]].getType() : 0);
                     //normal attacks (?)
                     Person::players[k]->hasvictim = 0;
                     if (Person::players.size() > 1) {
@@ -2283,7 +2274,7 @@ void doAttacks()
                                         Person::players[i]->animTarget != getupfromfrontanim) {
                                         Person::players[k]->victim = Person::players[i];
                                         Person::players[k]->hasvictim = 1;
-                                        if (Person::players[k]->aitype == playercontrolled) { //human player
+                                        if (Person::players[k]->isPlayerControlled()) { //human player
                                             //sweep
                                             if (distance < 2.5 * sq(Person::players[k]->scale * 5) &&
                                                 Person::players[k]->crouchkeydown &&
@@ -2669,7 +2660,7 @@ void doAttacks()
                             }
                         }
                     }
-                    if (Person::players[k]->aitype == playercontrolled) {
+                    if (Person::players[k]->isPlayerControlled()) {
                         //rabbit kick
                         if (Person::players[k]->attackkeydown &&
                             Person::players[k]->isRun() &&
@@ -2681,7 +2672,7 @@ void doAttacks()
                               Person::players[k]->victim->animTarget != getupfrombackanim &&
                               Person::players[k]->victim->animTarget != getupfromfrontanim &&
                               Animation::animations[Person::players[k]->victim->animTarget].height != lowheight &&
-                              Person::players[k]->aitype != playercontrolled && //wat???
+                              !Person::players[k]->isPlayerControlled() && //wat???
                               normaldotproduct(Person::players[k]->facing, Person::players[k]->victim->coords - Person::players[k]->coords) > 0 &&
                               Person::players[k]->rabbitkickenabled) ||
                              Person::players[k]->jumpkeydown)) {
@@ -3474,7 +3465,7 @@ void Game::Tick()
                         Person::players[i]->targetheadyaw = yaw;
                         Person::players[i]->targetheadpitch = pitch;
                     }
-                    if (i != 0 && Person::players[i]->aitype == playercontrolled && !Dialog::inDialog()) {
+                    if (i != 0 && Person::players[i]->isPlayerControlled() && !Dialog::inDialog()) {
                         if (!Animation::animations[Person::players[i]->animTarget].attack &&
                             Person::players[i]->animTarget != staggerbackhighanim &&
                             Person::players[i]->animTarget != staggerbackhardanim &&
@@ -3611,7 +3602,7 @@ void Game::Tick()
 
                     //pick up weapon
                     if (Person::players[i]->throwkeydown && !Person::players[i]->throwtogglekeydown) {
-                        if (Person::players[i]->weaponactive == -1 &&
+                        if (!Person::players[i]->hasWeapon() &&
                             Person::players[i]->num_weapons < 2 &&
                             (Person::players[i]->isIdle() ||
                              Person::players[i]->isCrouch() ||
@@ -3619,19 +3610,19 @@ void Game::Tick()
                              Person::players[i]->animTarget == rollanim ||
                              Person::players[i]->animTarget == backhandspringanim ||
                              Person::players[i]->isFlip() ||
-                             Person::players[i]->aitype != playercontrolled)) {
+                             !Person::players[i]->isPlayerControlled())) {
                             for (unsigned j = 0; j < weapons.size(); j++) {
                                 if ((weapons[j].velocity.x == 0 && weapons[j].velocity.y == 0 && weapons[j].velocity.z == 0 ||
-                                     Person::players[i]->aitype == playercontrolled) &&
+                                     Person::players[i]->isPlayerControlled()) &&
                                     weapons[j].owner == -1 &&
-                                    Person::players[i]->weaponactive == -1) {
+                                    !Person::players[i]->hasWeapon()) {
                                     if (distsqflat(&Person::players[i]->coords, &weapons[j].position) < 2) {
                                         if (distsq(&Person::players[i]->coords, &weapons[j].position) < 2) {
                                             if (Person::players[i]->isCrouch() ||
                                                 Person::players[i]->animTarget == sneakanim ||
                                                 Person::players[i]->isRun() ||
                                                 Person::players[i]->isIdle() ||
-                                                Person::players[i]->aitype != playercontrolled) {
+                                                !Person::players[i]->isPlayerControlled()) {
                                                 Person::players[i]->throwtogglekeydown = 1;
                                                 Person::players[i]->setTargetAnimation(crouchremoveknifeanim);
                                                 Person::players[i]->targetyaw = roughDirectionTo(Person::players[i]->coords, weapons[j].position);
@@ -3642,11 +3633,11 @@ void Game::Tick()
                                                 Person::players[i]->hasvictim = 0;
 
                                                 if ((weapons[j].velocity.x == 0 && weapons[j].velocity.y == 0 && weapons[j].velocity.z == 0 ||
-                                                     Person::players[i]->aitype == playercontrolled) &&
+                                                     Person::players[i]->isPlayerControlled()) &&
                                                         weapons[j].owner == -1 ||
                                                     Person::players[i]->victim &&
                                                         weapons[j].owner == int(Person::players[i]->victim->id)) {
-                                                    if (distsqflat(&Person::players[i]->coords, &weapons[j].position) < 2 && Person::players[i]->weaponactive == -1) {
+                                                    if (distsqflat(&Person::players[i]->coords, &weapons[j].position) < 2 && !Person::players[i]->hasWeapon()) {
                                                         if (distsq(&Person::players[i]->coords, &weapons[j].position) < 1 || Person::players[i]->victim) {
                                                             if (weapons[j].getType() != staff) {
                                                                 emit_sound_at(knifedrawsound, Person::players[i]->coords, 128.);
@@ -3659,7 +3650,7 @@ void Game::Tick()
                                             }
                                         } else if ((Person::players[i]->isIdle() ||
                                                     Person::players[i]->isFlip() ||
-                                                    Person::players[i]->aitype != playercontrolled) &&
+                                                    !Person::players[i]->isPlayerControlled()) &&
                                                    distsq(&Person::players[i]->coords, &weapons[j].position) < 5 &&
                                                    Person::players[i]->coords.y < weapons[j].position.y) {
                                             if (!Person::players[i]->isFlip()) {
@@ -3672,14 +3663,14 @@ void Game::Tick()
                                                 Person::players[i]->hasvictim = 0;
 
                                                 for (unsigned k = 0; k < weapons.size(); k++) {
-                                                    if (Person::players[i]->weaponactive == -1) {
+                                                    if (!Person::players[i]->hasWeapon()) {
                                                         if ((weapons[k].velocity.x == 0 && weapons[k].velocity.y == 0 && weapons[k].velocity.z == 0 ||
-                                                             Person::players[i]->aitype == playercontrolled) &&
+                                                             Person::players[i]->isPlayerControlled()) &&
                                                                 weapons[k].owner == -1 ||
                                                             Person::players[i]->victim &&
                                                                 weapons[k].owner == int(Person::players[i]->victim->id)) {
                                                             if (distsqflat(&Person::players[i]->coords, &weapons[k].position) < 3 &&
-                                                                Person::players[i]->weaponactive == -1) {
+                                                                !Person::players[i]->hasWeapon()) {
                                                                 if (weapons[k].getType() != staff) {
                                                                     emit_sound_at(knifedrawsound, Person::players[i]->coords, 128.);
                                                                 }
@@ -3701,7 +3692,7 @@ void Game::Tick()
                                 Person::players[i]->animTarget == backhandspringanim) {
                                 if (Person::players.size() > 1) {
                                     for (unsigned j = 0; j < Person::players.size(); j++) {
-                                        if (Person::players[i]->weaponactive == -1) {
+                                        if (!Person::players[i]->hasWeapon()) {
                                             if (j != i) {
                                                 if (Person::players[j]->num_weapons &&
                                                     Person::players[j]->skeleton.free &&
@@ -3802,7 +3793,7 @@ void Game::Tick()
                                 }
                             }
                         }
-                        if (Person::players[i]->weaponactive != -1 && Person::players[i]->aitype == playercontrolled) {
+                        if (Person::players[i]->hasWeapon() && Person::players[i]->isPlayerControlled()) {
                             if (weapons[Person::players[i]->weaponids[0]].getType() == knife) {
                                 if (Person::players[i]->isIdle() ||
                                     Person::players[i]->isRun() ||
@@ -3827,7 +3818,7 @@ void Game::Tick()
                                                                 Person::players[i]->targettilt2 = pitchTo(Person::players[i]->coords, Person::players[j]->coords);
                                                             }
                                                             if (Person::players[i]->isFlip()) {
-                                                                if (Person::players[i]->weaponactive != -1) {
+                                                                if (Person::players[i]->hasWeapon()) {
                                                                     Person::players[i]->throwtogglekeydown = 1;
                                                                     Person::players[i]->victim = Person::players[j];
                                                                     XYZ aim;
@@ -3853,7 +3844,7 @@ void Game::Tick()
                                 }
                             }
                         }
-                        if (Person::players[i]->weaponactive != -1 && Person::players[i]->aitype == playercontrolled) {
+                        if (Person::players[i]->hasWeapon() && Person::players[i]->isPlayerControlled()) {
                             if (Person::players[i]->isCrouch() || Person::players[i]->animTarget == sneakanim) {
                                 Person::players[i]->throwtogglekeydown = 1;
                                 XYZ tempVelocity = Person::players[i]->velocity * .2;
@@ -3878,16 +3869,16 @@ void Game::Tick()
                     }
 
                     //draw weapon
-                    if (i == 0 || !Person::players[0]->dead || (Person::players[i]->weaponactive != -1)) {
+                    if (i == 0 || !Person::players[0]->dead || (Person::players[i]->hasWeapon())) {
                         if (Person::players[i]->drawkeydown && !Person::players[i]->drawtogglekeydown ||
                             (Person::players[i]->num_weapons == 2) &&
-                                (Person::players[i]->weaponactive == -1) &&
+                                (!Person::players[i]->hasWeapon()) &&
                                 Person::players[i]->isIdle() ||
                             Person::players[0]->dead &&
-                                (Person::players[i]->weaponactive != -1) &&
+                                (Person::players[i]->hasWeapon()) &&
                                 i != 0) {
                             bool isgood = true;
-                            if (Person::players[i]->weaponactive != -1) {
+                            if (Person::players[i]->hasWeapon()) {
                                 if (weapons[Person::players[i]->weaponids[Person::players[i]->weaponactive]].getType() == staff) {
                                     isgood = false;
                                 }
@@ -3898,8 +3889,8 @@ void Game::Tick()
                                     Person::players[i]->drawtogglekeydown = 1;
                                 }
                                 if ((Person::players[i]->isIdle() ||
-                                     (Person::players[i]->aitype != playercontrolled &&
-                                      Person::players[0]->weaponactive != -1 &&
+                                     (!Person::players[i]->isPlayerControlled() &&
+                                      Person::players[0]->hasWeapon() &&
                                       Person::players[i]->isRun())) &&
                                     Person::players[i]->num_weapons &&
                                     weapons[Person::players[i]->weaponids[0]].getType() == sword) {
@@ -3915,7 +3906,7 @@ void Game::Tick()
                     }
 
                     //clean weapon
-                    if (Person::players[i]->weaponactive != -1) {
+                    if (Person::players[i]->hasWeapon()) {
                         if (Person::players[i]->isCrouch() &&
                             weapons[Person::players[i]->weaponids[Person::players[i]->weaponactive]].bloody &&
                             bloodtoggle &&
@@ -4093,7 +4084,7 @@ void Game::Tick()
                                 }
                                 Person::players[i]->frameTarget = 0;
                             }
-                            if (Person::players[i]->animTarget == hanganim /*&&(!Person::players[i]->forwardstogglekeydown||Person::players[i]->aitype!=playercontrolled)*/) {
+                            if (Person::players[i]->animTarget == hanganim /*&&(!Person::players[i]->forwardstogglekeydown||!Person::players[i]->isPlayerControlled())*/) {
                                 Person::players[i]->setTargetAnimation(climbanim);
                                 Person::players[i]->frameTarget = 1;
                                 Person::players[i]->jumpclimb = 1;
@@ -4254,7 +4245,7 @@ void Game::Tick()
                                 }
                                 if (target >= 0) {
                                     Person::players[i]->velocity.y = 1;
-                                } else if (Person::players[i]->crouchkeydown || Person::players[i]->aitype != playercontrolled) {
+                                } else if (Person::players[i]->crouchkeydown || !Person::players[i]->isPlayerControlled()) {
                                     Person::players[i]->velocity.y = 7;
                                     Person::players[i]->crouchtogglekeydown = 1;
                                 } else {
@@ -4290,7 +4281,7 @@ void Game::Tick()
                                 (((!floatjump &&
                                    !editorenabled) ||
                                   !devtools) ||
-                                 Person::players[i]->aitype != playercontrolled)) {
+                                 !Person::players[i]->isPlayerControlled())) {
                                 if (Person::players[i]->jumppower > multiplier * 6) {
                                     Person::players[i]->velocity.y += multiplier * 6;
                                     Person::players[i]->jumppower -= multiplier * 6;