From 491fb73c2d3fe6e606be4653172219ea985298c8 Mon Sep 17 00:00:00 2001 From: Cristian Vlasceanu Date: Fri, 22 Feb 2013 20:30:26 +0000 Subject: [PATCH] fix for crosshair not showing when spectating; fix for setfollowplayer 0 crashing the game in bot mode git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7251 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/clientgame.cpp | 2 +- source/src/renderhud.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 718b6826..ee465f3f 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -1669,7 +1669,7 @@ void spectate() void setfollowplayer(int cn) { // silently ignores invalid player-cn value passed - if(players.inrange(cn)) + if(players.inrange(cn) && players[cn]) { if(!(m_teammode && !watchingdemo && team_base(players[cn]->team) != team_base(player1->team))) { diff --git a/source/src/renderhud.cpp b/source/src/renderhud.cpp index eb35a04e..6efb5af6 100644 --- a/source/src/renderhud.cpp +++ b/source/src/renderhud.cpp @@ -864,7 +864,8 @@ void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwat if (targetplayer) strcpy(lastseen, targetplayer->name); bool menu = menuvisible(); bool command = getcurcommand() ? true : false; - if((p->state==CS_ALIVE || p->state==CS_EDITING) && !p->weaponsel->reloading) + bool reloading = lastmillis < p->weaponsel->reloading + p->weaponsel->info.reloadtime; + if((p->state==CS_ALIVE || p->state==CS_EDITING) && !reloading) { bool drawteamwarning = crosshairteamsign && targetplayer && isteam(targetplayer->team, p->team) && targetplayer->state==CS_ALIVE; p->weaponsel->renderaimhelp(drawteamwarning);