forked from carstene1ns/solarus-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix timer:set_suspended_with_map() not working for entity timers
Closes solarus-games#1158.
- Loading branch information
1 parent
bf6115b
commit e7735f3
Showing
9 changed files
with
108 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
tests/testing_quest/data/maps/bugs/1158_entity_timer_suspended.dat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
properties{ | ||
x = 0, | ||
y = 0, | ||
width = 320, | ||
height = 240, | ||
min_layer = 0, | ||
max_layer = 2, | ||
tileset = "castle", | ||
} | ||
|
||
tile{ | ||
layer = 0, | ||
x = 0, | ||
y = 0, | ||
width = 320, | ||
height = 240, | ||
pattern = "3", | ||
} | ||
|
||
destination{ | ||
name = "destination", | ||
layer = 0, | ||
x = 24, | ||
y = 29, | ||
direction = 3, | ||
} | ||
|
||
npc{ | ||
name = "robyne", | ||
layer = 0, | ||
x = 88, | ||
y = 29, | ||
direction = 3, | ||
subtype = 1, | ||
sprite = "main_heroes/robyne", | ||
} | ||
|
36 changes: 36 additions & 0 deletions
36
tests/testing_quest/data/maps/bugs/1158_entity_timer_suspended.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
local map = ... | ||
local game = map:get_game() | ||
|
||
function map:on_opening_transition_finished() | ||
|
||
assert(not game:is_suspended()) | ||
|
||
local robyne_timer_suspend = sol.timer.start(robyne, 1000, function() | ||
assert(not game:is_suspended()) | ||
sol.main.exit() | ||
end) | ||
robyne_timer_suspend:set_suspended_with_map(true) | ||
assert(robyne_timer_suspend:is_suspended_with_map()) | ||
|
||
local robyne_timer_no_suspend = sol.timer.start(robyne, 1000, function() | ||
end) | ||
robyne_timer_no_suspend:set_suspended_with_map(false) | ||
assert(not robyne_timer_no_suspend:is_suspended_with_map()) | ||
|
||
local map_timer_1 = sol.timer.start(map, 500, function() | ||
assert(game:is_suspended()) | ||
assert(robyne_timer_suspend:is_suspended()) | ||
assert(not robyne_timer_no_suspend:is_suspended()) | ||
end) | ||
map_timer_1:set_suspended_with_map(false) | ||
assert(not map_timer_1:is_suspended_with_map()) | ||
|
||
local map_timer_2 = sol.timer.start(map, 2000, function() | ||
assert(game:is_suspended()) | ||
game:set_paused(false) | ||
end) | ||
map_timer_2:set_suspended_with_map(false) | ||
assert(not map_timer_1:is_suspended_with_map()) | ||
|
||
game:set_paused(true) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters