MantisBT - Zandronum
View Issue Details
0000691Zandronum[All Projects] Bugpublic2012-02-26 18:312015-09-10 09:42
Twister1134 
 
highcrashalways
closedno change required 
 
 
0000691: Bad team
Removing player from teams will crash the game.
This involves ACS coding. Set the player to NO_TEAM, simple, but crashes the game.
Console says "Tried to set player to bad team #"
No tags attached.
Issue History
2012-02-26 18:31Twister1134New Issue
2012-02-26 22:45Torr SamahoNote Added: 0002693
2012-02-26 22:46Torr SamahoStatusnew => feedback
2012-03-02 15:36DuskNote Added: 0002739
2012-03-02 15:36DuskNote Edited: 0002739bug_revision_view_page.php?bugnote_id=2739#r1400
2012-03-02 15:37DuskNote Edited: 0002739bug_revision_view_page.php?bugnote_id=2739#r1401
2012-03-02 15:38DuskNote Edited: 0002739bug_revision_view_page.php?bugnote_id=2739#r1402
2012-03-02 15:48DuskNote Edited: 0002739bug_revision_view_page.php?bugnote_id=2739#r1403
2012-03-02 15:48DuskNote Edited: 0002739bug_revision_view_page.php?bugnote_id=2739#r1404
2012-03-02 15:50DuskNote Edited: 0002739bug_revision_view_page.php?bugnote_id=2739#r1405
2012-03-03 16:50GezNote Added: 0002741
2012-03-03 16:58DuskNote Added: 0002742
2012-03-03 16:58DuskNote Edited: 0002742bug_revision_view_page.php?bugnote_id=2742#r1411
2012-03-25 15:04Torr SamahoNote Added: 0002892
2012-03-25 15:16Torr SamahoNote Edited: 0002892
2012-03-25 16:06Torr SamahoNote Revision Dropped: 2892: 0001471
2012-03-25 16:07Torr SamahoNote Edited: 0002892bug_revision_view_page.php?bugnote_id=2892#r1473
2012-03-25 16:07Torr SamahoNote Revision Dropped: 2892: 0001472
2012-03-27 22:11unknownnaNote Added: 0002933
2012-06-09 13:22Torr SamahoCategoryGeneral => Bug
2015-09-10 09:42DuskNote Added: 0013468
2015-09-10 09:42DuskStatusfeedback => closed
2015-09-10 09:42DuskResolutionopen => no change required

Notes
(0002693)
Torr Samaho   
2012-02-26 22:45   
You didn't specify which Skulltag version is affected. Does it happen in the latest 98e beta build? If so, please post a minimal example wad.
(0002739)
Dusk   
2012-03-02 15:36   
(edited on: 2012-03-02 15:50)
This does remain to happen, and has some weird behavior going on regarding unknown teams. o_O

Thing is, the ZDoom Wiki claims on Player_SetTeam's page'http://zdoom.org/wiki/Player_SetTeam [^]' that if you want to remove a player from a team, you need to use the value of sv_maxteams. Meanwhile, PLAYER_SetTeam (the source code function) checks the argument value against teams.Size(), which seems to be 4 even if sv_maxteams is 2. Or 3, or 4, for that matter. What should be regarded as NO_TEAM, sv_maxteams or 4? zdefs.acs claims that NO_TEAM is 2 - and also lacks definitions of TEAM_GREEN and TEAM_GOLD.

LS_Player_SetTeam, the line special, also does no check against no team. Thus neither 2 nor 4 do not work without doing some source edits first. I myself added an (arg0 != teams.Size( )) clause to the team validity check.

I'm not sure how extensive changes would have to be done if we'd go with sv_maxteams as NO_TEAM. If 4 would be defined as the solid, constant NO_TEAM, zdefs.acs would have to be updated, but I doubt it'd be that big a deal.

I'd myself say NO_TEAM should be fixed at 4 and zdefs.acs and ZDoom Wiki need updating. That is, if more than 4 teams is considered to be a technical impossibility. :)

I also have some changes to p_interaction.cpp to have a proper message when player leaves a team, as well as singleplayer handling to said messages.

(0002741)
Gez   
2012-03-03 16:50   
Really, this is a mess.

I'd suggest implementing it like this:

0 = no team
1+ = team number, 1-indexed. So, by default, 1=blue, 2=red, 3=green, 4=gold.

This way, the function becomes compatible with TEAMINFO. If you have twelve teams defined, they can all be used.

It might require a compatibility mode to keep the fundamentally broken design for older mods that used this function.
(0002742)
Dusk   
2012-03-03 16:58   
Maybe set NO_TEAM to 255 and have teams remain to start from 0? Would cause less compatibility issues...

(0002892)
Torr Samaho   
2012-03-25 15:04   
(edited on: 2012-03-25 16:07)
> Removing player from teams will crash the game.

I checked the code and this is actually not true. The current implementation of Player_SetTeam simply doesn't allow a player to be set to no team and calls I_Error (which is very different from crashing) in case the function is used to set the player to an invalid team.

I noticed that we talked about this two and a half years ago:'http://www.skulltag.com/forum/viewtopic.php?f=33&t=21533 [^]'

What I said there is still valid. Skulltag assumes that player in a team game are on a team. Why do you want to remove people from the teams?

(0002933)
unknownna   
2012-03-27 22:11   
> If Skulltag supports switching teams via hallway, it would be nice to be able to teleport back to the start hallway and not be on any team at all while in it, per my example wad.

> The main problem here is that players in teamgames in Skulltag are always supposed to be on a team. Currently the only exemption is when a player is spawned in a team selection hallway. How does it sound, if I would allow Player_SetTeam to change a player's team to NO_TEAM on lobby maps (and only on lobby maps)?
(0013468)
Dusk   
2015-09-10 09:42   
The engine assumes that players are on a team so the error is justified.