Zandronum Chat on our Discord Server Get the latest version: 3.2
Source Code

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000691Zandronum[All Projects] Bugpublic2012-02-26 18:312015-09-10 09:42
ReporterTwister1134 
Assigned To 
PriorityhighSeveritycrashReproducibilityalways
StatusclosedResolutionno change required 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000691: Bad team
DescriptionRemoving player from teams will crash the game.
Steps To ReproduceThis involves ACS coding. Set the player to NO_TEAM, simple, but crashes the game.
Additional InformationConsole says "Tried to set player to bad team #"
Attached Files

- Relationships

-  Notes
User avatar (0002693)
Torr Samaho (administrator)
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.
User avatar (0002739)
Dusk (developer)
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.

User avatar (0002741)
Gez (reporter)
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.
User avatar (0002742)
Dusk (developer)
2012-03-03 16:58
edited on: 2012-03-03 16:58

Maybe set NO_TEAM to 255 and have teams remain to start from 0? Would cause less compatibility issues...

User avatar (0002892)
Torr Samaho (administrator)
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?

User avatar (0002933)
unknownna (updater)
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)?
User avatar (0013468)
Dusk (developer)
2015-09-10 09:42

The engine assumes that players are on a team so the error is justified.

Issue Community Support
This issue is already marked as resolved.
If you feel that is not the case, please reopen it and explain why.
Supporters: No one explicitly supports this issue yet.
Opponents: No one explicitly opposes this issue yet.

- Issue History
Date Modified Username Field Change
2012-02-26 18:31 Twister1134 New Issue
2012-02-26 22:45 Torr Samaho Note Added: 0002693
2012-02-26 22:46 Torr Samaho Status new => feedback
2012-03-02 15:36 Dusk Note Added: 0002739
2012-03-02 15:36 Dusk Note Edited: 0002739 View Revisions
2012-03-02 15:37 Dusk Note Edited: 0002739 View Revisions
2012-03-02 15:38 Dusk Note Edited: 0002739 View Revisions
2012-03-02 15:48 Dusk Note Edited: 0002739 View Revisions
2012-03-02 15:48 Dusk Note Edited: 0002739 View Revisions
2012-03-02 15:50 Dusk Note Edited: 0002739 View Revisions
2012-03-03 16:50 Gez Note Added: 0002741
2012-03-03 16:58 Dusk Note Added: 0002742
2012-03-03 16:58 Dusk Note Edited: 0002742 View Revisions
2012-03-25 15:04 Torr Samaho Note Added: 0002892
2012-03-25 15:16 Torr Samaho Note Edited: 0002892
2012-03-25 16:06 Torr Samaho Note Revision Dropped: 2892: 0001471
2012-03-25 16:07 Torr Samaho Note Edited: 0002892 View Revisions
2012-03-25 16:07 Torr Samaho Note Revision Dropped: 2892: 0001472
2012-03-27 22:11 unknownna Note Added: 0002933
2012-06-09 13:22 Torr Samaho Category General => Bug
2015-09-10 09:42 Dusk Note Added: 0013468
2015-09-10 09:42 Dusk Status feedback => closed
2015-09-10 09:42 Dusk Resolution open => no change required






Questions or other issues? Contact Us.

Links


Copyright © 2000 - 2025 MantisBT Team
Powered by Mantis Bugtracker