From dc3feaf42cd8bcb22b04fdba17dc10caacc94fef Mon Sep 17 00:00:00 2001 From: xalduin Date: Thu, 10 Jun 2010 00:24:38 +0800 Subject: Fixed remaining compiler warnings for gcc on Linux --- src/game/server/entities/character.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/game/server') diff --git a/src/game/server/entities/character.cpp b/src/game/server/entities/character.cpp index 77d8f462..81d1f85b 100644 --- a/src/game/server/entities/character.cpp +++ b/src/game/server/entities/character.cpp @@ -585,14 +585,26 @@ void CCharacter::TickDefered() if(!StuckBefore && (StuckAfterMove || StuckAfterQuant)) { + // Hackish solution to get rid of strict-aliasing warning + union + { + float f; + unsigned u; + }StartPosX, StartPosY, StartVelX, StartVelY; + + StartPosX.f = StartPos.x; + StartPosY.f = StartPos.y; + StartVelX.f = StartVel.x; + StartVelY.f = StartVel.y; + dbg_msg("char_core", "STUCK!!! %d %d %d %f %f %f %f %x %x %x %x", StuckBefore, StuckAfterMove, StuckAfterQuant, StartPos.x, StartPos.y, StartVel.x, StartVel.y, - *((unsigned *)&StartPos.x), *((unsigned *)&StartPos.y), - *((unsigned *)&StartVel.x), *((unsigned *)&StartVel.y)); + StartPosX.u, StartPosY.u, + StartVelX.u, StartVelY.u); } int Events = m_Core.m_TriggeredEvents; -- cgit 1.4.1 From 73bdf657c4417bcb76e52b80e63c75024d799751 Mon Sep 17 00:00:00 2001 From: oy Date: Sun, 20 Jun 2010 14:35:50 +0200 Subject: fixed suicide penalty after a restart. Closes #131 --- src/game/server/gamecontroller.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/game/server') diff --git a/src/game/server/gamecontroller.cpp b/src/game/server/gamecontroller.cpp index 5b7051d3..20ae867a 100644 --- a/src/game/server/gamecontroller.cpp +++ b/src/game/server/gamecontroller.cpp @@ -286,6 +286,7 @@ void IGameController::PostReset() GameServer()->m_apPlayers[i]->Respawn(); GameServer()->m_apPlayers[i]->m_Score = 0; GameServer()->m_apPlayers[i]->m_ScoreStartTick = Server()->Tick(); + GameServer()->m_apPlayers[i]->m_RespawnTick = Server()->Tick()+Server()->TickSpeed()/2; } } } -- cgit 1.4.1 From 7325bdac42db7a19e6eeb3e4b2ede7dfe9d3a5a9 Mon Sep 17 00:00:00 2001 From: oy Date: Sun, 27 Jun 2010 13:24:47 +0200 Subject: don't consider sv_spectator_slots for team change when already in a team(red, blue). Closes #141 --- src/game/server/gamecontroller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/game/server') diff --git a/src/game/server/gamecontroller.cpp b/src/game/server/gamecontroller.cpp index 20ae867a..07f8bf86 100644 --- a/src/game/server/gamecontroller.cpp +++ b/src/game/server/gamecontroller.cpp @@ -541,7 +541,7 @@ int IGameController::GetAutoTeam(int Notthisid) bool IGameController::CanJoinTeam(int Team, int Notthisid) { - if(Team == -1) + if(Team == -1 || (GameServer()->m_apPlayers[Notthisid] && GameServer()->m_apPlayers[Notthisid]->GetTeam() != -1)) return true; int aNumplayers[2] = {0,0}; -- cgit 1.4.1