} 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));
types[wolftype].defaultScale = .23;
types[wolftype].hasClaws = true;
types[wolftype].clothes = false;
+ types[wolftype].maxRunSpeed = 75;
/* Rabbit */
types[rabbittype].proportions[0] = 1.2;
types[rabbittype].defaultScale = .2;
types[rabbittype].hasClaws = false;
types[rabbittype].clothes = true;
+ types[rabbittype].maxRunSpeed = 55;
}