From f1d78ae790882589ad348911842dee1ec699ce45 Mon Sep 17 00:00:00 2001 From: verysecrethero Date: Tue, 23 Feb 2016 11:52:30 +0100 Subject: [PATCH] Fixed CapturePointSystem --- src/Game/Systems/CapturePointSystem.cpp | 8 ++++---- src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Game/Systems/CapturePointSystem.cpp b/src/Game/Systems/CapturePointSystem.cpp index 598a1a8e..73e6ac54 100644 --- a/src/Game/Systems/CapturePointSystem.cpp +++ b/src/Game/Systems/CapturePointSystem.cpp @@ -147,12 +147,12 @@ void CapturePointSystem::UpdateComponent(EntityWrapper& capturePointEntity, Comp int currentTeam = 0; bool canCapture = false; if (redTeamPlayersStandingInside > 0 && blueTeamPlayersStandingInside == 0) { - timerDeltaChange = redTeamPlayersStandingInside*dt; + timerDeltaChange = 3*redTeamPlayersStandingInside*dt; currentTeam = redTeam; canCapture = nextPossibleCapturePoint["Red"] == capturePointNumber; } if (redTeamPlayersStandingInside == 0 && blueTeamPlayersStandingInside > 0) { - timerDeltaChange = -blueTeamPlayersStandingInside*dt; + timerDeltaChange = -3*blueTeamPlayersStandingInside*dt; currentTeam = blueTeam; canCapture = nextPossibleCapturePoint["Blue"] == capturePointNumber; } @@ -170,8 +170,8 @@ void CapturePointSystem::UpdateComponent(EntityWrapper& capturePointEntity, Comp cCapturePoint["CaptureTimer"] = (double)cCapturePoint["CaptureTimer"] + timerDeltaChange; } //if capturePoint is owned by the team, and the other team has been trying to take it, then increase/decrease the timer towards 0.0 - if ((ownedBy == currentTeam && currentTeam == redTeam && (double)cCapturePoint["CaptureTimer"] < 0.0) || - (ownedBy == currentTeam && currentTeam == blueTeam && (double)cCapturePoint["CaptureTimer"] > 0.0)) { + if ((ownedBy == currentTeam && currentTeam == redTeam && (double)cCapturePoint["CaptureTimer"] < captureTimeToTakeOver) || + (ownedBy == currentTeam && currentTeam == blueTeam && (double)cCapturePoint["CaptureTimer"] > -captureTimeToTakeOver)) { cCapturePoint["CaptureTimer"] = (double)cCapturePoint["CaptureTimer"] + timerDeltaChange; } //check if captureTimer > captureTimeToTakeOver and if so change owner and publish the eCaptured event diff --git a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp index 84d3ccd4..0744af76 100644 --- a/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp +++ b/src/Game/Systems/Weapon/AssaultWeaponBehaviour.cpp @@ -386,7 +386,7 @@ bool AssaultWeaponBehaviour::shoot(double damage) // Check for friendly fire if ((ComponentInfo::EnumType)victim["Team"]["Team"] == (ComponentInfo::EnumType)m_Player["Team"]["Team"]) { - return false; + damage = 1; } // Deal damage!