]> git.jsancho.org Git - lugaru.git/blobdiff - Source/GameTick.cpp
Added .at usage to have clearer crash when dialogue contains invalid participant
[lugaru.git] / Source / GameTick.cpp
index 58fb64aac4fd7a467e01cbb9cf14ce390c7a4ee5..9b98e78c9e90a3817ddb209cb871adb538efaf6f 100644 (file)
@@ -214,7 +214,7 @@ inline float stepTowardf(float from, float to, float by)
 void Game::playdialoguescenesound()
 {
     XYZ temppos;
-    temppos = Person::players[Dialog::currentScene().participantfocus]->coords;
+    temppos = Person::players.at(Dialog::currentScene().participantfocus)->coords;
     temppos = temppos - viewer;
     Normalise(&temppos);
     temppos += viewer;
@@ -3229,7 +3229,7 @@ void Game::Tick()
                                         hostile = 1;
                                     }
 
-                                    if (Person::players[Dialog::currentScene().participantfocus]->dead) {
+                                    if (Person::players.at(Dialog::currentScene().participantfocus)->dead) {
                                         Dialog::indialogue = -1;
                                         Dialog::directing = false;
                                         cameramode = 0;