From 8db32a4b8be19c62ef6d7c3056240a6d608171f6 Mon Sep 17 00:00:00 2001 From: xalduin Date: Thu, 3 Jun 2010 09:56:57 -0400 Subject: Issue #88 flag pickup distance reduced --- src/game/server/gamemodes/ctf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/game/server') diff --git a/src/game/server/gamemodes/ctf.cpp b/src/game/server/gamemodes/ctf.cpp index 05eb973e..705d21ac 100644 --- a/src/game/server/gamemodes/ctf.cpp +++ b/src/game/server/gamemodes/ctf.cpp @@ -136,7 +136,7 @@ void CGameControllerCTF::Tick() else { CCharacter *apCloseCCharacters[MAX_CLIENTS]; - int Num = GameServer()->m_World.FindEntities(F->m_Pos, 32.0f, (CEntity**)apCloseCCharacters, MAX_CLIENTS, NETOBJTYPE_CHARACTER); + int Num = GameServer()->m_World.FindEntities(F->m_Pos, 32.0f-(float)g_CharPhysSize, (CEntity**)apCloseCCharacters, MAX_CLIENTS, NETOBJTYPE_CHARACTER); for(int i = 0; i < Num; i++) { if(!apCloseCCharacters[i]->IsAlive() || apCloseCCharacters[i]->GetPlayer()->GetTeam() == -1 || GameServer()->Collision()->IntersectLine(F->m_Pos, apCloseCCharacters[i]->m_Pos, NULL, NULL)) -- cgit 1.4.1 From 3fff61d24aebd77dc6feb289595620e114730c86 Mon Sep 17 00:00:00 2001 From: xalduin Date: Thu, 3 Jun 2010 10:35:18 -0400 Subject: Issue #86, don't reset score on team switch --- src/game/server/player.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/game/server') diff --git a/src/game/server/player.cpp b/src/game/server/player.cpp index 8e58b7c1..354b8118 100644 --- a/src/game/server/player.cpp +++ b/src/game/server/player.cpp @@ -156,9 +156,11 @@ void CPlayer::SetTeam(int Team) GameServer()->SendChat(-1, CGameContext::CHAT_ALL, Buf); KillCharacter(); + if( m_Team != -1 ) // Give a point to make up for killing character, but not if they're a spectator + m_Score += 1; + m_Team = Team; - m_Score = 0; - m_ScoreStartTick = Server()->Tick(); + //m_ScoreStartTick = Server()->Tick(); // we got to wait 0.5 secs before respawning m_RespawnTick = Server()->Tick()+Server()->TickSpeed()/2; dbg_msg("game", "team_join player='%d:%s' m_Team=%d", m_ClientID, Server()->ClientName(m_ClientID), m_Team); -- cgit 1.4.1 From 9603d676c67af12294e9598cb8be68fbfafc78e7 Mon Sep 17 00:00:00 2001 From: xalduin Date: Thu, 3 Jun 2010 17:08:05 -0400 Subject: Score no longer decreased when switching teams --- src/game/server/gamecontroller.cpp | 2 +- src/game/server/player.cpp | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'src/game/server') diff --git a/src/game/server/gamecontroller.cpp b/src/game/server/gamecontroller.cpp index 519a28ae..66d84519 100644 --- a/src/game/server/gamecontroller.cpp +++ b/src/game/server/gamecontroller.cpp @@ -308,7 +308,7 @@ void IGameController::OnPlayerInfoChange(class CPlayer *pP) int IGameController::OnCharacterDeath(class CCharacter *pVictim, class CPlayer *pKiller, int Weapon) { // do scoreing - if(!pKiller) + if(!pKiller || Weapon == WEAPON_GAME) return 0; if(pKiller == pVictim->GetPlayer()) pVictim->GetPlayer()->m_Score--; // suicide diff --git a/src/game/server/player.cpp b/src/game/server/player.cpp index 354b8118..c295b5d5 100644 --- a/src/game/server/player.cpp +++ b/src/game/server/player.cpp @@ -156,8 +156,6 @@ void CPlayer::SetTeam(int Team) GameServer()->SendChat(-1, CGameContext::CHAT_ALL, Buf); KillCharacter(); - if( m_Team != -1 ) // Give a point to make up for killing character, but not if they're a spectator - m_Score += 1; m_Team = Team; //m_ScoreStartTick = Server()->Tick(); -- cgit 1.4.1 From a41d930a85f31064965d89115d851518d568f175 Mon Sep 17 00:00:00 2001 From: oy Date: Sat, 5 Jun 2010 13:38:08 +0200 Subject: fixed some compiler warnings. Closes #76 --- src/engine/external/pnglite/pnglite.h | 2 +- src/game/client/components/console.cpp | 14 +++++++++++--- src/game/client/components/console.h | 3 ++- src/game/server/entities/character.h | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) (limited to 'src/game/server') diff --git a/src/engine/external/pnglite/pnglite.h b/src/engine/external/pnglite/pnglite.h index 72ff1c52..eae3d4ce 100644 --- a/src/engine/external/pnglite/pnglite.h +++ b/src/engine/external/pnglite/pnglite.h @@ -73,7 +73,7 @@ enum typedef unsigned (*png_write_callback_t)(void* input, unsigned long size, unsigned long numel, void* user_pointer); typedef unsigned (*png_read_callback_t)(void* output, unsigned long size, unsigned long numel, void* user_pointer); typedef void (*png_free_t)(void* p); -typedef void * (*png_alloc_t)(unsigned long s); +typedef void * (*png_alloc_t)(size_t s); typedef struct { diff --git a/src/game/client/components/console.cpp b/src/game/client/components/console.cpp index 742b6b2d..b323ab48 100644 --- a/src/game/client/components/console.cpp +++ b/src/game/client/components/console.cpp @@ -34,9 +34,8 @@ enum CONSOLE_CLOSING, }; -CGameConsole::CInstance::CInstance(CGameConsole *pGameConsole, int Type) +CGameConsole::CInstance::CInstance(int Type) { - m_pGameConsole = pGameConsole; // init ringbuffers //history = ringbuf_init(history_data, sizeof(history_data), RINGBUF_FLAG_RECYCLE); //backlog = ringbuf_init(backlog_data, sizeof(backlog_data), RINGBUF_FLAG_RECYCLE); @@ -56,6 +55,11 @@ CGameConsole::CInstance::CInstance(CGameConsole *pGameConsole, int Type) m_pCommand = 0x0; } +void CGameConsole::CInstance::Init(CGameConsole *pGameConsole) +{ + m_pGameConsole = pGameConsole; +}; + void CGameConsole::CInstance::ExecuteLine(const char *pLine) { if(m_Type == 0) @@ -198,7 +202,7 @@ void CGameConsole::CInstance::PrintLine(const char *pLine) } CGameConsole::CGameConsole() -: m_LocalConsole(this, 0), m_RemoteConsole(this, 1) +: m_LocalConsole(0), m_RemoteConsole(1) { m_ConsoleType = 0; m_ConsoleState = CONSOLE_CLOSED; @@ -573,6 +577,10 @@ void CGameConsole::PrintLine(int Type, const char *pLine) void CGameConsole::OnConsoleInit() { + // init console instances + m_LocalConsole.Init(this); + m_RemoteConsole.Init(this); + m_pConsole = Kernel()->RequestInterface(); // diff --git a/src/game/client/components/console.h b/src/game/client/components/console.h index b88c6349..d146307f 100644 --- a/src/game/client/components/console.h +++ b/src/game/client/components/console.h @@ -27,7 +27,8 @@ class CGameConsole : public CComponent IConsole::CCommandInfo *m_pCommand; - CInstance(CGameConsole *pGameConsole, int t); + CInstance(int t); + void Init(CGameConsole *pGameConsole); void ExecuteLine(const char *pLine); diff --git a/src/game/server/entities/character.h b/src/game/server/entities/character.h index a1add982..bea0c002 100644 --- a/src/game/server/entities/character.h +++ b/src/game/server/entities/character.h @@ -57,7 +57,7 @@ public: void SetEmote(int Emote, int Tick); - const bool IsAlive() { return m_Alive; } + bool IsAlive() const { return m_Alive; } class CPlayer *GetPlayer() { return m_pPlayer; } private: -- cgit 1.4.1