DDRace / teeworlds

DEPRECATED - Go to https://github.com/ddnet/ddnet instead!
Other
37 stars 15 forks source link

Team join/closed bug #192

Closed Tsin closed 11 years ago

Tsin commented 12 years ago

very urgent bug

version 1.14a

you join a team example 11

you cross the start line and now you just quit the server (no kill) you join back you try /team 11 and team is closed you cant join team at a time

bug found by GUMM

heinrich5991 commented 12 years ago

Ugly workaround, not tested. Not for upstream as it's a workaround.

diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp
index 03c4a5a..4efd4a5 100644
--- a/src/game/server/entities/character.cpp
+++ b/src/game/server/entities/character.cpp
@@ -91,6 +91,7 @@ bool CCharacter::Spawn(CPlayer *pPlayer, vec2 Pos)

 void CCharacter::Destroy()
 {
+   Teams()->SetForceCharacterTeam(m_pPlayer->GetCID(), 0);
    GameServer()->m_World.m_Core.m_apCharacters[m_pPlayer->GetCID()] = 0;
    m_Alive = false;
 }
Tsin commented 12 years ago

heinrich the workaround didnt work, good news is that we find the blame

last commit https://github.com/DDRace/teeworlds/commit/b68840b30b3ffeaed8bdf2042f91105e266a5aac

a fix that "cat" made for us, its good that i remmebered that he said that he changed something in teams ^^

so ddmax reverted one commit it means we still need someone to make a fix for the https://github.com/DDRace/teeworlds/issues/181

Tsin commented 12 years ago

ok i spoke with cat ^^ and he made a fast fix

https://github.com/aelio/teeworlds/commit/143f3eb6450872b886eaee16d955d871fd24bfa3 so now if you wont delete his last comit and just add this then everything should work fine but still he said that we must test it :D

Tsin commented 12 years ago

ok everything works fine (red hook lasers/draggers are fixed and teams dont have a bug) so please add cat's code to the main branch

Learath2 commented 12 years ago

I would add it but first lets ask @GreYFoX

Shereef commented 12 years ago

Tried to add it but cats repo was outdated when he did this, go ahead @Learath2

Learath2 commented 12 years ago

That was fast @GreYFoX come by irc sometime :smile:

Shereef commented 12 years ago

Emails are more reliable

Learath2 commented 11 years ago

@Tsin so can I say this is closed as we merged in cat's repository.

Tsin commented 11 years ago

yes everythig is now fixed ^^