OSDN Git Service

Centered escalator object
authorryan <>
Tue, 27 Dec 2016 03:44:13 +0000 (03:44 +0000)
committerryan <>
Tue, 27 Dec 2016 03:44:13 +0000 (03:44 +0000)
buildings/Simple - Escalator.bld
src/sbs/escalator.cpp

index 4310155..f8b66ce 100644 (file)
@@ -470,7 +470,7 @@ AddAction FireServiceBypass, Elevator1, Fire1Bypass
 <EndFloor>
 
 <Floors 0 to 1>
-    CutAll -6.5, 12, -12, 8.5, -1, -8, false, true
+    CutAll -7.5, 12, -12, 7.5, -1, -8, false, true
     Group = 0, 1
 <EndFloor>
 
index b233577..02ea775 100644 (file)
@@ -193,7 +193,7 @@ void Escalator::CreateSteps(const std::string &texture, const std::string &direc
 
                if (Direction == "right")
                {
-                       pos = ((treadsize * (num_steps - 1)) / 2) - (treadsize * i);
+                       pos = ((treadsize * num_steps + 1) / 2) - (treadsize * i);
                        sbs->DrawWalls(true, true, true, true, false, true);
                        sbs->AddWallMain(wall, base + "-riser", texture, thickness, treadsize, -(width / 2), treadsize, width / 2, risersize, risersize, 0, 0, tw, th, true);
 
@@ -214,7 +214,7 @@ void Escalator::CreateSteps(const std::string &texture, const std::string &direc
                }
                if (Direction == "left")
                {
-                       pos = -((treadsize * (num_steps - 1)) / 2) + (treadsize * i);
+                       pos = -((treadsize * num_steps + 1) / 2) + (treadsize * i);
                        sbs->DrawWalls(true, true, true, true, false, true);
                        sbs->AddWallMain(wall, base + "-riser", texture, thickness, -treadsize, width / 2, -treadsize, -(width / 2), risersize, risersize, 0, 0, tw, th, true);
 
@@ -235,7 +235,7 @@ void Escalator::CreateSteps(const std::string &texture, const std::string &direc
                }
                if (Direction == "back")
                {
-                       pos = ((treadsize * (num_steps - 1)) / 2) - (treadsize * i);
+                       pos = ((treadsize * num_steps + 1) / 2) - (treadsize * i);
                        sbs->DrawWalls(true, true, true, true, false, true);
                        sbs->AddWallMain(wall, base + "-riser", texture, thickness, width / 2, treadsize, -(width / 2), treadsize, risersize, risersize, 0, 0, tw, th, true);
 
@@ -256,7 +256,7 @@ void Escalator::CreateSteps(const std::string &texture, const std::string &direc
                }
                if (Direction == "front")
                {
-                       pos = -((treadsize * (num_steps - 1)) / 2) + (treadsize * i);
+                       pos = -((treadsize * num_steps + 1) / 2) + (treadsize * i);
                        sbs->DrawWalls(true, true, true, true, false, true);
                        sbs->AddWallMain(wall, base + "riser", texture, thickness, -(width / 2), -treadsize, width / 2, -treadsize, risersize, risersize, 0, 0, tw, th, true);