MantisBT - Zandronum
View Issue Details
0002341Zandronum[All Projects] Suggestionpublic2015-07-11 19:422018-09-30 21:40
Visual Vincent 
Edward-san 
normaltweakhave not tried
closedfixed 
MicrosoftWindowsXP/Vista/7
2.1 
2.12.2 
0002341: ACS function to restart the current map.
I would like to have a function to restart the current map, but still keeping all your items and stats etc. I am currently working on a Cooperative based mod where I want to include the option to play at the same map for a specified amount of rounds. When each round is over the map would restart. ResetMap() won't do it since it's not compatible with Cooperative and also because it won't respawn dead players or spectators if used in another gamemode.

I have tried to use the ChangeLevel function but it crashes in multiplayer. It does only appear to work in singleplayer.
No tags attached.
log zandronum-crash-07_12_2015-14_46_56.3750.log (28,019) 2015-07-12 12:50
/tracker/file_download.php?file_id=1578&type=bug
Issue History
2015-07-11 19:42Visual VincentNew Issue
2015-07-11 20:05Edward-sanNote Added: 0012855
2015-07-11 20:21Edward-sanNote Edited: 0012855bug_revision_view_page.php?bugnote_id=12855#r7581
2015-07-11 20:28Edward-sanNote Edited: 0012855bug_revision_view_page.php?bugnote_id=12855#r7582
2015-07-11 20:28Edward-sanNote Edited: 0012855bug_revision_view_page.php?bugnote_id=12855#r7583
2015-07-11 20:29Edward-sanNote Edited: 0012855bug_revision_view_page.php?bugnote_id=12855#r7584
2015-07-11 20:41Visual VincentNote Added: 0012856
2015-07-11 20:42Visual VincentNote Edited: 0012856bug_revision_view_page.php?bugnote_id=12856#r7586
2015-07-11 20:42Visual VincentNote Edited: 0012856bug_revision_view_page.php?bugnote_id=12856#r7587
2015-07-12 08:10Edward-sanNote Added: 0012866
2015-07-12 10:48Visual VincentNote Added: 0012875
2015-07-12 11:32Edward-sanNote Added: 0012878
2015-07-12 11:41Visual VincentNote Added: 0012879
2015-07-12 12:49Edward-sanFile Added: zandronum-crash-07_12_2015-14_46_56.3750.log
2015-07-12 12:49Edward-sanFile Deleted: zandronum-crash-07_12_2015-14_46_56.3750.log
2015-07-12 12:50Edward-sanFile Added: zandronum-crash-07_12_2015-14_46_56.3750.log
2015-07-12 17:16Edward-sanNote Added: 0012903
2015-07-12 17:39Edward-sanNote Edited: 0012903bug_revision_view_page.php?bugnote_id=12903#r7618
2015-07-12 17:40Edward-sanNote Edited: 0012903bug_revision_view_page.php?bugnote_id=12903#r7619
2015-07-12 17:40Edward-sanAssigned To => Edward-san
2015-07-12 17:40Edward-sanStatusnew => feedback
2015-07-13 12:36Visual VincentNote Added: 0012914
2015-07-13 12:36Visual VincentStatusfeedback => assigned
2015-07-13 12:38Visual VincentNote Edited: 0012914bug_revision_view_page.php?bugnote_id=12914#r7637
2015-07-13 12:38Visual VincentNote Edited: 0012914bug_revision_view_page.php?bugnote_id=12914#r7638
2015-07-13 18:14Edward-sanNote Added: 0012919
2015-07-13 18:14Edward-sanStatusassigned => needs review
2015-08-09 13:09Torr SamahoNote Added: 0013151
2015-08-09 13:09Torr SamahoStatusneeds review => feedback
2015-08-22 16:26cobaltStatusfeedback => needs testing
2015-08-22 16:26cobaltTarget Version => 2.1
2015-08-22 16:26cobaltDescription Updatedbug_revision_view_page.php?rev_id=7930#r7930
2015-08-22 16:26cobaltNote Added: 0013245
2015-08-25 10:35DuskNote Added: 0013266
2015-08-25 10:35DuskStatusneeds testing => resolved
2015-08-25 10:35DuskFixed in Version => 2.2
2015-08-25 10:35DuskResolutionopen => fixed
2018-09-30 21:40Blzut3Statusresolved => closed

Notes
(0012855)
Edward-san   
2015-07-11 20:05   
(edited on: 2015-07-11 20:29)
Quote from "Visual Vincent"
I have tried to use the ChangeLevel function but it crashes in multiplayer. It does only appear to work in singleplayer.


Can you elaborate on this and why it's not reported as a bug?

Anyways, is the crash easy to reproduce with a simple example wad?

[edit]I and WaTaKiD tried with this acs script:


#include "zcommon.acs"

script 1 open
{
    delay(100);
    // The level would be automatically changed only in case we're at map01.
    if (GetLevelInfo(LEVELINFO_LEVELNUM) == 1)
        ChangeLevel("map02",0,CHANGELEVEL_NOINTERMISSION);
}


And could not reproduce it:
Quote

<WaTaKiD> local server, coop, 2.1: no crashes from it switches from map01 to map02, either as a spectator or player


(0012856)
Visual Vincent   
2015-07-11 20:41   
(edited on: 2015-07-11 20:42)
I tested ChangeLevel with bots in my mod... I see now after testing it standalone, and not in my mod, it works great. Then there's something about my scripts that do not want to work properly when attempting to switch map.

Using StrParam and ChangeLevel it is possible to change to the same level, so please remove my statement about ChangeLevel not working (I can't seem to edit the ticket myself?).
Or if you'd like, you can close/remove the ticket completely as I now got ChangeLevel working. :)

(0012866)
Edward-san   
2015-07-12 08:10   
Can you post your mod here with the bad ChangeLevel?
(0012875)
Visual Vincent   
2015-07-12 10:48   
I'd rather not since it's a very new, WIP mod... I can PM it via the forum to those devs who want it though.
But I do know the problem. I test the mod with bots. And when you die in the mod, you are morphed into a custom class that's made to work pretty much the same way as a spectator. (Flying, noclip, being invisible etc.)
When the bots are morphed into this class and the round is over, the game crashes when either calling Exit_Normal or ChangeLevel. However, If I (as a player) is morphed to this class it seems to work perfectly with atleast Exit_Normal.

I'll PM you the mod vi the forum, Edward. If any other dev want to have a look just tell me. :)
(0012878)
Edward-san   
2015-07-12 11:32   
Just to clarify: this happens in 2.0 and 2.1, right?
(0012879)
Visual Vincent   
2015-07-12 11:41   
I've only tried it in 2.1, but yes.
(0012903)
Edward-san   
2015-07-12 17:16   
(edited on: 2015-07-12 17:40)
'https://bitbucket.org/crimsondusk/zandronum-sandbox-stable/commits/3fe2399cb54b689cdfc8485ac332c954f55851ad [^]' should fix the crash.


Visual Vincent, can you check this build (based on above commit) and see if you get problems with morphed bots?

(0012914)
Visual Vincent   
2015-07-13 12:36   
(edited on: 2015-07-13 12:38)
Wow! Works perfectly! Thanks!
Should I create a new ticket about this so that we can mark it as resolved?

By the way (whoever hosts this tracker): You should make the creator of a ticket be able to edit or delete the ticket that he or she created.

(0012919)
Edward-san   
2015-07-13 18:14   
Then it seems to be ready for review.
(0013151)
Torr Samaho   
2015-08-09 13:09   
I added your patch to the stable repo.
(0013245)
cobalt   
2015-08-22 16:26   
Issue addressed by commit 9b556d0: - Fixed a NULL pointer dereference in the bot code, related to morphing, shown in a crash log.
Committed by Edoardo Prezioso [edward-san] on Sunday 12 July 2015 18:54:48

Changes in files:

 src/botcommands.cpp | 3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

(0013266)
Dusk   
2015-08-25 10:35   
Closing as patch was tested prior to inclusion.