MantisBT - Zandronum
View Issue Details
0004211Zandronum[All Projects] Bugpublic2024-03-19 12:372024-04-09 03:05
Fused 
Kaminsky 
normalminoralways
resolvedfixed 
3.1 
3.23.2 
0004211: GAMEEVENT_ACTOR_SPAWNED event does not trigger with ResetMap()
It seems like this event does not trigger if a map implements the ResetMap() function, which causes maps to not be able to use a combination of these two things.

'https://wiki.zandronum.com/ResetMap [^]'
'https://wiki.zandronum.com/EVENT_scripts [^]'
No tags attached.
zip Project.zip (3,342) 2024-03-22 14:20
https://zandronum.com/tracker/file_download.php?file_id=2941&type=bug
Issue History
2024-03-19 12:37FusedNew Issue
2024-03-19 14:56KaminskyNote Added: 0023428
2024-03-19 14:56KaminskyAssigned To => Kaminsky
2024-03-19 14:56KaminskyStatusnew => needs review
2024-03-19 14:56KaminskyProduct Version => 3.1
2024-03-19 14:56KaminskyTarget Version => 3.2
2024-03-19 14:57KaminskyNote Edited: 0023428bug_revision_view_page.php?bugnote_id=23428#r14147
2024-03-19 14:57KaminskyNote Edited: 0023428bug_revision_view_page.php?bugnote_id=23428#r14148
2024-03-20 09:45FusedNote Added: 0023438
2024-03-22 14:20FusedFile Added: Project.zip
2024-03-22 14:22FusedNote Added: 0023460
2024-03-22 14:22FusedNote Edited: 0023460bug_revision_view_page.php?bugnote_id=23460#r14150
2024-03-22 14:23FusedNote Edited: 0023460bug_revision_view_page.php?bugnote_id=23460#r14151
2024-03-22 15:02KaminskyNote Added: 0023462
2024-03-22 15:12FusedNote Added: 0023463
2024-03-22 15:14KaminskyNote Added: 0023464
2024-03-24 21:23Ru5tK1ngNote Added: 0023489
2024-03-24 21:23Ru5tK1ngStatusneeds review => needs testing
2024-04-09 03:05Ru5tK1ngNote Added: 0023568
2024-04-09 03:05Ru5tK1ngStatusneeds testing => resolved
2024-04-09 03:05Ru5tK1ngResolutionopen => fixed
2024-04-09 03:05Ru5tK1ngFixed in Version => 3.2

Notes
(0023428)
Kaminsky   
2024-03-19 14:56   
(edited on: 2024-03-19 14:57)
I created a merge request to fix this:'https://foss.heptapod.net/zandronum/zandronum-stable/-/merge_requests/71 [^]'

It seems that actors that didn't need to be respawned during a reset didn't trigger GAMEEVENT_ACTOR_SPAWNED normally, so I needed to separate the code that triggers the event into its own function and also call it in GAME_ResetMap when this is the case.

(0023438)
Fused   
2024-03-20 09:45   
This did not fix it on my end, but I will be sure to supply a minimal example wad soon so this can be tested more easily
(0023460)
Fused   
2024-03-22 14:22   
(edited on: 2024-03-22 14:23)
I have uploaded an example wad that reproduces the issue. By pressing fire you will use `ResetMap()`, and by pressing altfire you will use `ChangeLevel()`. Notice the string that is drawn starts with "True" if the event was triggered to change the boolean. This is not the case with `ResetMap` which suggests the event is never triggered.

I tested the minimal example wad with this build:'https://foss.heptapod.net/zandronum/zandronum-stable/-/pipelines/79150 [^]'

EDIT: The map included has the actor placed to call the event so please test using the map

(0023462)
Kaminsky   
2024-03-22 15:02   
Thanks for the feedback and the minimal example WAD! I overlooked one important detail in the original commit: GAME_ResetMap resets all ACS scripts at the end of the function, after the call to GAMEMODE_HandleSpawnEvent that I added. Thus, the GAMEEVENT_ACTOR_SPAWNED event scripts that were just triggered also got reset.

I amended the commit to trigger the event after all ACS scripts are reset. Please test the build(s) in this pipeline to confirm that it fixes the issue:'https://foss.heptapod.net/zandronum/zandronum-stable/-/pipelines/79280 [^]'
(0023463)
Fused   
2024-03-22 15:12   
I tested this with the pk3 using the new build and the boolean is now `true`, which means the issue is fixed. Thank you :)
(0023464)
Kaminsky   
2024-03-22 15:14   
Thanks for checking!
(0023489)
Ru5tK1ng   
2024-03-24 21:23   
This was merged in:'https://foss.heptapod.net/zandronum/zandronum-stable/-/commit/6c7ecf69b8926207e56ddd4386707a9871a04bca [^]'
(0023568)
Ru5tK1ng   
2024-04-09 03:05   
Tested with latest beta and the results were consistent.