X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FGameTick.cpp;h=c994c0f196496894fbeeb95da157e904f333456d;hb=3f27343fe706bb582974ca77dffb39ae1791d76f;hp=e1561147e3fd65a1a3b78709889681044d8190ed;hpb=65748e01b54fd8c4e1b5dd8de7d99f430d10870c;p=lugaru.git diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index e156114..c994c0f 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -2055,7 +2055,7 @@ void doDebugKeys() } if (Input::isKeyPressed(SDL_SCANCODE_C)) { - cameramode = 1 - cameramode; + cameramode = !cameramode; } if (Input::isKeyPressed(SDL_SCANCODE_X) && !Input::isKeyDown(SDL_SCANCODE_LSHIFT)) { @@ -2386,7 +2386,7 @@ void doDebugKeys() } if (Input::isKeyPressed(SDL_SCANCODE_M) && Input::isKeyDown(SDL_SCANCODE_LSHIFT)) { - editorenabled = 1 - editorenabled; + editorenabled = !editorenabled; if (editorenabled) { Person::players[0]->damagetolerance = 100000; } else { @@ -3197,7 +3197,6 @@ void doAerialAcrobatics() void doAttacks() { - static XYZ relative; static int randattack; static bool playerrealattackkeydown = 0; @@ -5525,7 +5524,7 @@ void MenuTick() displayblinkdelay -= multiplier; if (displayblinkdelay <= 0) { displayblinkdelay = .3; - displayblink = 1 - displayblink; + displayblink = !displayblink; } } @@ -5684,7 +5683,7 @@ void Game::Tick() //keys if (Input::isKeyPressed(SDL_SCANCODE_V) && debugmode) { - freeze = 1 - freeze; + freeze = !freeze; if (freeze) { OPENAL_SetFrequency(OPENAL_ALL, 0.001); } @@ -5718,7 +5717,7 @@ void Game::Tick() consoleblinkdelay -= multiplier; if (consoleblinkdelay <= 0) { consoleblinkdelay = .3; - consoleblink = 1 - consoleblink; + consoleblink = !consoleblink; } } @@ -6370,12 +6369,7 @@ void Game::Tick() if (weapons[j].getType() != staff) emit_sound_at(knifedrawsound, Person::players[i]->coords, 128.); - Person::players[i]->weaponactive = 0; - weapons[j].owner = Person::players[i]->id; - if (Person::players[i]->num_weapons > 0) - Person::players[i]->weaponids[Person::players[i]->num_weapons] = Person::players[i]->weaponids[0]; - Person::players[i]->num_weapons++; - Person::players[i]->weaponids[0] = j; + Person::players[i]->takeWeapon(j); } } } else if ((Person::players[i]->isIdle() || @@ -6404,12 +6398,7 @@ void Game::Tick() if (weapons[k].getType() != staff) emit_sound_at(knifedrawsound, Person::players[i]->coords, 128.); - Person::players[i]->weaponactive = 0; - weapons[k].owner = Person::players[i]->id; - if (Person::players[i]->num_weapons > 0) - Person::players[i]->weaponids[Person::players[i]->num_weapons] = Person::players[i]->weaponids[0]; - Person::players[i]->num_weapons++; - Person::players[i]->weaponids[0] = k; + Person::players[i]->takeWeapon(k); } } } @@ -6461,7 +6450,6 @@ void Game::Tick() if (fleshstuck) emit_sound_at(fleshstabremovesound, Person::players[i]->coords, 128.); - Person::players[i]->weaponactive = 0; if (weapons[k].owner != -1) { if (Person::players[i]->victim->num_weapons == 1) Person::players[i]->victim->num_weapons = 0; @@ -6509,12 +6497,7 @@ void Game::Tick() Person::players[i]->victim->jointVel(rightshoulder) += relative * 6; Person::players[i]->victim->jointVel(leftshoulder) += relative * 6; } - weapons[k].owner = i; - if (Person::players[i]->num_weapons > 0) { - Person::players[i]->weaponids[Person::players[i]->num_weapons] = Person::players[i]->weaponids[0]; - } - Person::players[i]->num_weapons++; - Person::players[i]->weaponids[0] = k; + Person::players[i]->takeWeapon(k); } } }