MantisBT - Zandronum
View Issue Details
0003171Zandronum[All Projects] Bugpublic2017-06-26 17:072017-06-26 20:42
Cutman 
 
highmajoralways
closedno change required 
MicrosoftWindowsXP/Vista/7
2.1 
 
0003171: GAMEVENT_ROUND_ENDS EVENT trigger type functioning incorrectly
This EVENT script type appears to get fired off at the wrong times, almost as if it's triggering for multiple event types rather than just the round ending.

This bug happens in 2.1.2 too.
1. Grab the WAD. Jump into a LMS match on MAP01 with a bot.
2. Start the game and fight the bot. You'll notice the script gets triggered multiple times, when you get medals etc.

Not just a bot thing either, you can test it with a second player or yourself on a second client.
Here's the script:

int count;

script "lol" (int GAMEVENT_ROUND_ENDS, int a, int b) EVENT
{
    count++;
    PrintBold(s:"event triggered! ", i:count, s:" times!");
}
No tags attached.
? eventtest.pk3 (672) 2017-06-26 17:07
/tracker/file_download.php?file_id=2136&type=bug
Issue History
2017-06-26 17:07CutmanNew Issue
2017-06-26 17:07CutmanFile Added: eventtest.pk3
2017-06-26 17:43WaTaKiDProduct Version3.0-beta => 2.1
2017-06-26 19:28CatastropheNote Added: 0017937
2017-06-26 19:57CutmanNote Added: 0017939
2017-06-26 20:42WaTaKiDStatusnew => closed
2017-06-26 20:42WaTaKiDResolutionopen => no change required

Notes
(0017937)
Catastrophe   
2017-06-26 19:28   
Pretty sure you're using it wrong. Event scripts work like this: script 123 (int type, int arg1, int arg2) EVENT

so you have to do, if(type == GAMEVENT_ROUND_ENDS) { count++; printbold(s:"hi");}

What you're doing currently is just renaming a variable.
(0017939)
Cutman   
2017-06-26 19:57   
Oh that explains it. So my code has been firing for every single event type. My bad, please close!