OSDN Git Service

Added GotoFloor teleport command
authorryan <>
Fri, 6 Jan 2017 05:07:41 +0000 (05:07 +0000)
committerryan <>
Fri, 6 Jan 2017 05:07:41 +0000 (05:07 +0000)
designguide.html
src/sbs/action.cpp

index 9640d6d..35075a5 100644 (file)
@@ -3325,6 +3325,7 @@ parameters:</p>
 <em>PlaySound</em>: name, loop true/false<br>
 <em>StopSound</em>: name<br>
 <em>Teleport</em>: X, Y, Z (destination coordinates to teleport camera to)<br>
+<em>GotoFloor</em>: floor_number (teleport to specified floor number<br>
 <em>OpenShaftDoor</em>: door number (0 for all), floor number (parent needs to
 be the elevator object)<br>
 <em>CloseShaftDoor</em>: door number (0 for all), floor number (parent needs to
index 704b74d..5580340 100644 (file)
@@ -797,12 +797,21 @@ bool Action::Run(Object *caller, Object *parent, bool &hold)
                        destination.y = ToFloat(command_parameters[1]);
                        destination.z = ToFloat(command_parameters[2]);
 
+                       sbs->camera->GotoFloor(sbs->GetFloorNumber(destination.y));
                        sbs->camera->SetPosition(destination);
                        return true;
                }
                return false;
        }
 
+       if (command_name == "gotofloor")
+       {
+               if ((int)command_parameters.size() == 1)
+               {
+                       sbs->camera->GotoFloor(ToInt(command_parameters[0]));
+               }
+       }
+
        return false;
 }