mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 12:58:00 +03: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
2 changed files with 35 additions and 0 deletions
|
@ -326,6 +326,24 @@ testing.registerGlobalTest('player weapon attack', function()
|
||||||
testing.runLocalTest(player, 'player weapon attack')
|
testing.runLocalTest(player, 'player weapon attack')
|
||||||
end)
|
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 {
|
return {
|
||||||
engineHandlers = {
|
engineHandlers = {
|
||||||
onUpdate = testing.updateGlobal,
|
onUpdate = testing.updateGlobal,
|
||||||
|
|
|
@ -35,6 +35,23 @@ testing.registerMenuTest('save and load', function()
|
||||||
testing.expectThat(menu.getAllSaves(), matchers.equalTo({}))
|
testing.expectThat(menu.getAllSaves(), matchers.equalTo({}))
|
||||||
end)
|
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)
|
local function registerGlobalTest(name, description)
|
||||||
testing.registerMenuTest(description or name, function()
|
testing.registerMenuTest(description or name, function()
|
||||||
menu.newGame()
|
menu.newGame()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue