aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-02-16 20:50:56 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-02-16 20:50:56 +0000
commit695a7e279235d13590afef1531d6cd53736d947b (patch)
treee49a206928c660701f87cd401c1a0d8792df88fd /Northstar.CustomServers/mod/scripts/vscripts
parent4bba08f72314824df075387b3f8fb4450d192e5a (diff)
parent031d351db8900f5f7dc8aed0ea59e9f902667b84 (diff)
downloadNorthstarMods-695a7e279235d13590afef1531d6cd53736d947b.tar.gz
NorthstarMods-695a7e279235d13590afef1531d6cd53736d947b.zip
Merge branch 'main' of https://github.com/R2Northstar/NorthstarMods
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut3
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut22
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut6
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut3
4 files changed, 22 insertions, 12 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut
index a3ea5172..962549b4 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut
@@ -16,6 +16,9 @@ void function GiveScoreForPlayerKill( entity victim, entity attacker, var damage
table<int, bool> alreadyAssisted
foreach( DamageHistoryStruct attackerInfo in victim.e.recentDamageHistory )
{
+ 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 )
{
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut
index feca3bd5..d7514b29 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut
@@ -132,7 +132,7 @@ void function CodeCallback_OnClientConnectionStarted( entity player )
callbackFunc( player )
}
- printl( "Player connect started: " + player )
+ printl( "Player connect started: " + player + "---UID:" + player.GetUID() )
InitPassives( player )
}
@@ -282,17 +282,21 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga
int methodOfDeath = DamageInfo_GetDamageSourceIdentifier( damageInfo )
table<int, bool> alreadyAssisted
- foreach( DamageHistoryStruct attackerInfo in player.e.recentDamageHistory )
+ if ( IsValid( attacker ) )
{
- bool exists = attackerInfo.attacker.GetEncodedEHandle() in alreadyAssisted ? true : false
- if( attackerInfo.attacker != attacker && !exists )
+ foreach( DamageHistoryStruct attackerInfo in player.e.recentDamageHistory )
{
- alreadyAssisted[attackerInfo.attacker.GetEncodedEHandle()] <- true
- Remote_CallFunction_NonReplay( attackerInfo.attacker, "ServerCallback_SetAssistInformation", attackerInfo.damageSourceId, attacker.GetEncodedEHandle(), player.GetEncodedEHandle(), attackerInfo.time )
- AddPlayerScore(attackerInfo.attacker, "PilotAssist" )
- }
-
+ if ( !IsValid( attackerInfo.attacker ) || !attackerInfo.attacker.IsPlayer() || attackerInfo.attacker == player )
+ continue
+ bool exists = attackerInfo.attacker.GetEncodedEHandle() in alreadyAssisted ? true : false
+ if( attackerInfo.attacker != attacker && !exists )
+ {
+ alreadyAssisted[attackerInfo.attacker.GetEncodedEHandle()] <- true
+ Remote_CallFunction_NonReplay( attackerInfo.attacker, "ServerCallback_SetAssistInformation", attackerInfo.damageSourceId, attacker.GetEncodedEHandle(), player.GetEncodedEHandle(), attackerInfo.time )
+ AddPlayerScore(attackerInfo.attacker, "PilotAssist" )
+ }
+ }
}
player.p.rematchOrigin = player.p.deathOrigin
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
index 5d27a17e..aa14477a 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
@@ -666,7 +666,8 @@ void function CleanUpEntitiesForRoundEnd()
foreach ( entity player in GetPlayerArray() )
{
ClearTitanAvailable( player )
-
+ PROTO_CleanupTrackedProjectiles( player )
+ player.SetPlayerNetInt( "batteryCount", 0 )
if ( IsAlive( player ) )
player.Die( svGlobal.worldspawn, svGlobal.worldspawn, { damageSourceId = eDamageSourceId.round_end } )
}
@@ -675,7 +676,6 @@ void function CleanUpEntitiesForRoundEnd()
{
if ( !IsValid( npc ) )
continue
-
// kill rather than destroy, as destroying will cause issues with children which is an issue especially for dropships and titans
npc.Die( svGlobal.worldspawn, svGlobal.worldspawn, { damageSourceId = eDamageSourceId.round_end } )
}
@@ -854,4 +854,4 @@ float function GetTimeLimit_ForGameMode()
// default to 10 mins, because that seems reasonable
return GetCurrentPlaylistVarFloat( playlistString, 10 )
-} \ No newline at end of file
+}
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut
index b7fd4d52..36862d8a 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut
@@ -194,6 +194,9 @@ void function ScoreEvent_TitanKilled( entity victim, entity attacker, var damage
table<int, bool> alreadyAssisted
foreach( DamageHistoryStruct attackerInfo in victim.e.recentDamageHistory )
{
+ 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 )
{