Skip to content

Commit

Permalink
Merge branch 'main' into initial-doc-comment-test
Browse files Browse the repository at this point in the history
  • Loading branch information
GeckoEidechse authored Oct 30, 2023
2 parents c3eba08 + 82f8712 commit bdf607a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/add-to-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
issues:
types:
- opened
pull_request_target:
types:
- opened

jobs:
add-to-project:
Expand Down
2 changes: 0 additions & 2 deletions Northstar.Custom/keyvalues/playlists_v2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ playlists
max_teams 12
classic_mp 1

scorelimit 21 // temp until we have a way of dynamically setting non-default scorelimit in code

gamemode_score_hint #GAMEMODE_SCORE_HINT_FFA
gamemode_bullet_001 #GAMEMODE_BULLET_FFA_001
gamemode_bullet_002 #GAMEMODE_BULLET_FFA_002
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ void function GamemodeGG_Init()
AddCallback_GameStateEnter( eGameState.WinnerDetermined, OnWinnerDetermined )

AddCallback_GGEarnMeterFull( OnGGEarnMeterFilled )

// set scorelimit if it's wrong, sort of a jank way to do it but best i've got rn
try
{
if ( GetCurrentPlaylistVarInt( "scorelimit", GetGunGameWeapons().len() ) != GetGunGameWeapons().len() )
SetPlaylistVarOverride( "scorelimit", GetGunGameWeapons().len().tostring() )
}
catch ( ex ) {}
}

void function OnPlayerDisconnected(entity player)
Expand Down
25 changes: 15 additions & 10 deletions Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut
Original file line number Diff line number Diff line change
Expand Up @@ -202,18 +202,23 @@ void function ScoreEvent_TitanKilled( entity victim, entity attacker, var damage
AddPlayerScore( attacker, "KillTitan" )
}

table<int, bool> alreadyAssisted
foreach( DamageHistoryStruct attackerInfo in victim.e.recentDamageHistory )
entity soul = victim.GetTitanSoul()
if ( IsValid( soul ) )
{
if ( !IsValid( attackerInfo.attacker ) || !attackerInfo.attacker.IsPlayer() || attackerInfo.attacker == victim )
continue

bool exists = attackerInfo.attacker.GetEncodedEHandle() in alreadyAssisted ? true : false
if( attackerInfo.attacker != attacker && !exists )
table<int, bool> alreadyAssisted

foreach( DamageHistoryStruct attackerInfo in soul.e.recentDamageHistory )
{
alreadyAssisted[attackerInfo.attacker.GetEncodedEHandle()] <- true
AddPlayerScore(attackerInfo.attacker, "TitanAssist" )
Remote_CallFunction_NonReplay( attackerInfo.attacker, "ServerCallback_SetAssistInformation", attackerInfo.damageSourceId, attacker.GetEncodedEHandle(), victim.GetEncodedEHandle(), attackerInfo.time )
if ( !IsValid( attackerInfo.attacker ) || !attackerInfo.attacker.IsPlayer() || attackerInfo.attacker == soul )
continue

bool exists = attackerInfo.attacker.GetEncodedEHandle() in alreadyAssisted ? true : false
if( attackerInfo.attacker != attacker && !exists )
{
alreadyAssisted[attackerInfo.attacker.GetEncodedEHandle()] <- true
AddPlayerScore(attackerInfo.attacker, "TitanAssist" )
Remote_CallFunction_NonReplay( attackerInfo.attacker, "ServerCallback_SetAssistInformation", attackerInfo.damageSourceId, attacker.GetEncodedEHandle(), soul.GetEncodedEHandle(), attackerInfo.time )
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion Northstar.CustomServers/mod/scripts/vscripts/mp/_stats.nut
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ void function Stats_IncrementStat( entity player, string statCategory, string st
// persistence string, we can't save the persistence so we have to just return
if ( str != saveVar )
{
printt( ex )
//printt( ex, str, GetMapName(), mode ) // Commented out due to spamming logs on invalid modes (e.g. Gun Game, Infection, ...)
return
}
}
Expand Down

0 comments on commit bdf607a

Please sign in to comment.