Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Hardpoint UI Fixes (#416)" #618

Merged
merged 1 commit into from
Apr 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -471,10 +471,8 @@ void function HardpointThink( HardpointStruct hardpoint )
}
else if(cappingTeam==TEAM_UNASSIGNED) // nobody on point
{
if((GetHardpointState(hardpoint)>=CAPTURE_POINT_STATE_AMPED) || (GetHardpointState(hardpoint)==CAPTURE_POINT_STATE_SELF_UNAMPING))
if((GetHardpointState(hardpoint)==CAPTURE_POINT_STATE_AMPED)||(GetHardpointState(hardpoint)==CAPTURE_POINT_STATE_AMPING))
{
if (GetHardpointState(hardpoint) == CAPTURE_POINT_STATE_AMPED)
SetHardpointState(hardpoint,CAPTURE_POINT_STATE_SELF_UNAMPING) // plays a pulsating effect on the UI only when the hardpoint is amped
SetHardpointCappingTeam(hardpoint,hardpointEnt.GetTeam())
SetHardpointCaptureProgress(hardpoint,max(1.0,GetHardpointCaptureProgress(hardpoint)-(deltaTime/HARDPOINT_AMPED_DELAY)))
if(GetHardpointCaptureProgress(hardpoint)<=1.001) // unamp
Expand Down Expand Up @@ -548,10 +546,8 @@ void function HardpointThink( HardpointStruct hardpoint )
}
else if(file.ampingEnabled)//amping or reamping
{
// i have no idea why but putting it CAPTURE_POINT_STATE_AMPING will say 'CONTESTED' on the UI
// since whether the point is contested is checked above, putting the hardpoint state to a value of 8 fixes it somehow
if(GetHardpointState(hardpoint)<=CAPTURE_POINT_STATE_AMPING)
SetHardpointState( hardpoint, 8 )
if(GetHardpointState(hardpoint)<CAPTURE_POINT_STATE_AMPING)
SetHardpointState(hardpoint,CAPTURE_POINT_STATE_AMPING)
SetHardpointCaptureProgress( hardpoint, min( 2.0, GetHardpointCaptureProgress( hardpoint ) + ( deltaTime / HARDPOINT_AMPED_DELAY * capperAmount ) ) )
if(GetHardpointCaptureProgress(hardpoint)==2.0&&!(GetHardpointState(hardpoint)==CAPTURE_POINT_STATE_AMPED))
{
Expand Down Expand Up @@ -650,8 +646,6 @@ void function OnHardpointEntered( entity trigger, entity player )
foreach(CP_PlayerStruct playerStruct in file.players)
if(playerStruct.player == player)
playerStruct.isOnHardpoint = true

player.SetPlayerNetInt( "playerHardpointID", hardpoint.hardpoint.GetHardpointID() )
}

void function OnHardpointLeft( entity trigger, entity player )
Expand All @@ -668,8 +662,6 @@ void function OnHardpointLeft( entity trigger, entity player )
foreach(CP_PlayerStruct playerStruct in file.players)
if(playerStruct.player == player)
playerStruct.isOnHardpoint = false

player.SetPlayerNetInt( "playerHardpointID", 69 ) // an arbitary number to remove the hud from the player
}

string function CaptureStateToString( int state )
Expand All @@ -683,7 +675,6 @@ string function CaptureStateToString( int state )
case CAPTURE_POINT_STATE_CAPTURED:
return "CAPTURED"
case CAPTURE_POINT_STATE_AMPING:
case 8:
return "AMPING"
case CAPTURE_POINT_STATE_AMPED:
return "AMPED"
Expand Down