mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-06 18:11:57 +00:00
Add test for load while teleporting
To reproduce #8311. Load game while landracer is scheduled to teleport from different cell.
This commit is contained in:
parent
536325e0ba
commit
2ebdc43bbe
@ -326,6 +326,24 @@ testing.registerGlobalTest('player weapon attack', function()
|
||||
testing.runLocalTest(player, 'player weapon attack')
|
||||
end)
|
||||
|
||||
testing.registerGlobalTest('load while teleporting - init player', function()
|
||||
local player = world.players[1]
|
||||
player:teleport('Museum of Wonders', util.vector3(0, -1500, 111), util.transform.rotateZ(math.rad(180)))
|
||||
end)
|
||||
|
||||
testing.registerGlobalTest('load while teleporting - teleport', function()
|
||||
local player = world.players[1]
|
||||
local landracer = world.createObject('landracer')
|
||||
landracer:teleport(player.cell, player.position + util.vector3(0, 500, 0))
|
||||
coroutine.yield()
|
||||
|
||||
local door = world.getObjectByFormId(core.getFormId('the_hub.omwaddon', 26))
|
||||
door:activateBy(player)
|
||||
coroutine.yield()
|
||||
|
||||
landracer:teleport(player.cell, player.position)
|
||||
end)
|
||||
|
||||
return {
|
||||
engineHandlers = {
|
||||
onUpdate = testing.updateGlobal,
|
||||
|
@ -35,6 +35,23 @@ testing.registerMenuTest('save and load', function()
|
||||
testing.expectThat(menu.getAllSaves(), matchers.equalTo({}))
|
||||
end)
|
||||
|
||||
testing.registerMenuTest('load while teleporting', function()
|
||||
menu.newGame()
|
||||
coroutine.yield()
|
||||
|
||||
testing.runGlobalTest('load while teleporting - init player')
|
||||
|
||||
menu.saveGame('load while teleporting')
|
||||
coroutine.yield()
|
||||
|
||||
testing.runGlobalTest('load while teleporting - teleport')
|
||||
|
||||
menu.loadGame(' - 1', 'load_while_teleporting.omwsave')
|
||||
coroutine.yield()
|
||||
|
||||
menu.deleteGame(' - 1', 'load_while_teleporting.omwsave')
|
||||
end)
|
||||
|
||||
local function registerGlobalTest(name, description)
|
||||
testing.registerMenuTest(description or name, function()
|
||||
menu.newGame()
|
||||
|
Loading…
x
Reference in New Issue
Block a user