]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Tutorial.cpp
Added methods for hasWeapon and isPlayerControlled
[lugaru.git] / Source / Tutorial.cpp
index 4a034373b83ed5b1f0a52366ddf4af21f0dc1da2..c60ad9b1b79c9c2746df62d5eff9120199b299e3 100644 (file)
@@ -1,6 +1,6 @@
 /*
 Copyright (C) 2003, 2010 - Wolfire Games
-Copyright (C) 2010-2016 - Lugaru contributors (see AUTHORS file)
+Copyright (C) 2010-2017 - Lugaru contributors (see AUTHORS file)
 
 This file is part of Lugaru.
 
@@ -302,7 +302,7 @@ void Tutorial::Do(float multiplier)
                 Person::players[1]->num_weapons = 1;
                 Person::players[1]->weaponids[0] = 0;
 
-                if (Person::players[0]->weaponactive != -1) {
+                if (Person::players[0]->hasWeapon()) {
                     weapons[Person::players[0]->weaponids[Person::players[0]->weaponactive]].setType(staff);
                 } else {
                     weapons[0].setType(staff);
@@ -508,7 +508,7 @@ void Tutorial::Do(float multiplier)
                 }
                 break;
             case 41:
-                if (Person::players[0]->weaponactive == -1 && Person::players[0]->num_weapons > 0) {
+                if (!Person::players[0]->hasWeapon() && Person::players[0]->num_weapons > 0) {
                     success = 1;
                 }
                 break;
@@ -566,11 +566,10 @@ void Tutorial::DrawTextInfo()
             string = "You can move the mouse to rotate the camera.";
             break;
         case 4:
-            string = std::string("Try using the ") +
-                     Input::keyToChar(Game::forwardkey) + ", " +
-                     Input::keyToChar(Game::leftkey) + ", " +
-                     Input::keyToChar(Game::backkey) + " and " +
-                     Input::keyToChar(Game::rightkey) + " keys to move around.";
+            string = std::string("Try using the ") + Input::keyToChar(Game::forwardkey);
+            string += std::string(", ") + Input::keyToChar(Game::leftkey);
+            string += std::string(", ") + Input::keyToChar(Game::backkey);
+            string += std::string(" and ") + Input::keyToChar(Game::rightkey) + " keys to move around.";
             string2 = "All movement is relative to the camera.";
             break;
         case 5: