]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Objects/Person.cpp
Moved max run speed to PersonType
[lugaru.git] / Source / Objects / Person.cpp
index 01b9f903e98631d2f568c20b96b98ce20003d47c..0ca911a0114ae16dc010426f0ca72150036966bd 100644 (file)
@@ -6009,19 +6009,10 @@ void Person::DoStuff()
         } else if (isRun()) {
             velocity += facing * multiplier * speed * 700 * scale;
             velspeed = findLength(&velocity);
-            if (creature == rabbittype) {
-                if (velspeed > speed * 55 * scale) {
-                    velocity /= velspeed;
-                    velspeed = speed * 55 * scale;
-                    velocity *= velspeed;
-                }
-            }
-            if (creature == wolftype) {
-                if (velspeed > speed * 75 * scale) {
-                    velocity /= velspeed;
-                    velspeed = speed * 75 * scale;
-                    velocity *= velspeed;
-                }
+            if (velspeed > speed * PersonType::types[creature].maxRunSpeed * scale) {
+                velocity /= velspeed;
+                velspeed = speed * PersonType::types[creature].maxRunSpeed * scale;
+                velocity *= velspeed;
             }
             velocity.y += gravity * multiplier * 20;
             ReflectVector(&velocity, terrain.getNormal(coords.x, coords.z));