big error going to 10

This commit is contained in:
2024-07-28 00:07:24 -04:00
parent 38fc7b1254
commit 0aa2edaccd
2 changed files with 5 additions and 5 deletions

View File

@@ -194,6 +194,7 @@ local function ProceedToNextLevel(self: ClassConstructor, Level: number, Directi
local VEC3_Y_WRAP = self:GetLevel(Level, Direction) local VEC3_Y_WRAP = self:GetLevel(Level, Direction)
if VEC3_Y_WRAP then if VEC3_Y_WRAP then
self:__TravelToFloor(Level, VEC3_Y_WRAP, Direction) self:__TravelToFloor(Level, VEC3_Y_WRAP, Direction)
self.eprintStudio(`Traveling to Level={Level} VEC3_Y_WRAP={VEC3_Y_WRAP} Direct={Direction}`)
else else
self.ewarn(`Failed to get the requested level's Y position. VEC3_Y_WRAP={VEC3_Y_WRAP} Level={Level} Direction={Direction}`) self.ewarn(`Failed to get the requested level's Y position. VEC3_Y_WRAP={VEC3_Y_WRAP} Level={Level} Direction={Direction}`)
end end
@@ -223,18 +224,20 @@ local function CheckFloorQueue(self: ClassConstructor, Direction: Enums.Elevator
self.eprintStudio(`No more floors in the direction "{Direction}" checking the opposite direction floors`) self.eprintStudio(`No more floors in the direction "{Direction}" checking the opposite direction floors`)
if Direction == Enums.ElevatorCallDirection.Up then if Direction == Enums.ElevatorCallDirection.Up then
if #self.RelayAlgorithm.FloorQueue.Down ~= 0 then if #self.RelayAlgorithm.FloorQueue.Down ~= 0 then
self.RelayAlgorithm:Sort(Enums.ElevatorCallDirection.Down)
local NextLevelDown = self.RelayAlgorithm.FloorQueue.Down[1] local NextLevelDown = self.RelayAlgorithm.FloorQueue.Down[1]
if NextLevelDown then if NextLevelDown then
local NewDirection = ElevatorGoingUpDirection(self.Attributes.CurrentFloor.Value, NextLevelDown) and Enums.ElevatorCallDirection.Up or Enums.ElevatorCallDirection.Down
self.RelayAlgorithm:Sort(NewDirection :: Enums.ElevatorCallDirectionValues)
self.eprint("Floors found in the opposite direction. Direction=", Enums.ElevatorCallDirection.Down, "NextLevel=", NextLevelDown) self.eprint("Floors found in the opposite direction. Direction=", Enums.ElevatorCallDirection.Down, "NextLevel=", NextLevelDown)
ProceedToNextLevel(self, NextLevelDown, Enums.ElevatorCallDirection.Down) ProceedToNextLevel(self, NextLevelDown, Enums.ElevatorCallDirection.Down)
end end
end end
else else
if #self.RelayAlgorithm.FloorQueue.Up ~= 0 then if #self.RelayAlgorithm.FloorQueue.Up ~= 0 then
self.RelayAlgorithm:Sort(Enums.ElevatorCallDirection.Up)
local NextLevelUp = self.RelayAlgorithm.FloorQueue.Up[1] local NextLevelUp = self.RelayAlgorithm.FloorQueue.Up[1]
if NextLevelUp then if NextLevelUp then
local NewDirection = ElevatorGoingUpDirection(self.Attributes.CurrentFloor.Value, NextLevelUp) and Enums.ElevatorCallDirection.Up or Enums.ElevatorCallDirection.Down
self.RelayAlgorithm:Sort(NewDirection :: Enums.ElevatorCallDirectionValues)
self.eprint("Floors found in the opposite direction. Direction=", Enums.ElevatorCallDirection.Up, "NextLevel=", NextLevelUp) self.eprint("Floors found in the opposite direction. Direction=", Enums.ElevatorCallDirection.Up, "NextLevel=", NextLevelUp)
ProceedToNextLevel(self, NextLevelUp, Enums.ElevatorCallDirection.Up) ProceedToNextLevel(self, NextLevelUp, Enums.ElevatorCallDirection.Up)
end end

View File

@@ -51,9 +51,6 @@ return function(TagsConstructor: TagsModule.TagsConstructor, ButtonTags: TagsMod
end) end)
task.wait(1) task.wait(1)
Elevator:RequestLevel(2, Enums.ElevatorCallDirection.Up)
Elevator:RequestLevel(8, Enums.ElevatorCallDirection.Up)
Elevator:RequestLevel(10, Enums.ElevatorCallDirection.Down) Elevator:RequestLevel(10, Enums.ElevatorCallDirection.Down)
Elevator:RequestLevel(6, Enums.ElevatorCallDirection.Down) Elevator:RequestLevel(6, Enums.ElevatorCallDirection.Down)
end end