diff options
author | x3Karma <juliuslimck@gmail.com> | 2023-04-22 08:59:07 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-22 02:59:07 +0200 |
commit | 64b666d19698380760f7c8381c6abef98e55ef11 (patch) | |
tree | 02e49c5363c4a993bbe1b0d3314e418eed74c71c | |
parent | f6716069a26dde85866741cc066f380ddf442f7d (diff) | |
download | NorthstarMods-64b666d19698380760f7c8381c6abef98e55ef11.tar.gz NorthstarMods-64b666d19698380760f7c8381c6abef98e55ef11.zip |
Revert "Revert 'Hardpoint UI Fixes (#416)' (#618)" (#619)v1.13.1-rc1v1.13.1v1.13.0-rc2v1.13.0-rc1v1.13.0
* fixed not showing Auto-Titans death in killfeed
* revert indents
* revert indents again
* bug fix
* Hardpoint Fixes
* "fixed" spacing
for like one line the rest of the file is kinda oof tho but not related to my pr
* 69 spacing
* SetPlayerNetInt is placed inside a player entity check
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_cp.nut | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_cp.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_cp.nut index 705b7836..c5765300 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_cp.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_cp.nut @@ -471,8 +471,10 @@ 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_AMPING)) + if((GetHardpointState(hardpoint)>=CAPTURE_POINT_STATE_AMPED) || (GetHardpointState(hardpoint)==CAPTURE_POINT_STATE_SELF_UNAMPING)) { + 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 @@ -546,8 +548,10 @@ void function HardpointThink( HardpointStruct hardpoint ) } else if(file.ampingEnabled)//amping or reamping { - if(GetHardpointState(hardpoint)<CAPTURE_POINT_STATE_AMPING) - SetHardpointState(hardpoint,CAPTURE_POINT_STATE_AMPING) + // 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 ) SetHardpointCaptureProgress( hardpoint, min( 2.0, GetHardpointCaptureProgress( hardpoint ) + ( deltaTime / HARDPOINT_AMPED_DELAY * capperAmount ) ) ) if(GetHardpointCaptureProgress(hardpoint)==2.0&&!(GetHardpointState(hardpoint)==CAPTURE_POINT_STATE_AMPED)) { @@ -645,7 +649,10 @@ void function OnHardpointEntered( entity trigger, entity player ) hardpoint.militiaCappers.append( 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 ) @@ -661,7 +668,10 @@ void function OnHardpointLeft( entity trigger, entity player ) FindAndRemove( hardpoint.militiaCappers, 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 ) @@ -675,6 +685,7 @@ 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" |