aboutsummaryrefslogtreecommitdiff
path: root/Northstar.Custom/mod/scripts/vscripts/sh_custom_pilot_collision.gnut
blob: b33a4c024a6d8128d6317a22680d15728ec0f300 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
global function CustomPilotCollision_InitPlaylistVars

void function CustomPilotCollision_InitPlaylistVars()
{
	AddPrivateMatchModeSettingEnum( "#MODE_SETTING_CATEGORY_PILOT", "no_pilot_collision", [ "#SETTING_DISABLED", "#SETTING_ENABLED" ], "0" )

#if SERVER
	AddCallback_OnPlayerRespawned( SetPilotCollisionFlagsForRespawn )
	AddCallback_OnPilotBecomesTitan( PilotCollisionOnPilotBecomesTitan )
	AddCallback_OnTitanBecomesPilot( PilotCollisionOnTitanBecomesPilot )
#endif
}

#if SERVER
void function SetPilotCollisionFlagsForRespawn( entity player )
{
	if ( GetCurrentPlaylistVarInt( "no_pilot_collision", 0 ) == 1 )
		player.kv.CollisionGroup = TRACE_COLLISION_GROUP_BLOCK_WEAPONS
}

void function PilotCollisionOnPilotBecomesTitan( entity player, entity titan )
{
	if ( GetCurrentPlaylistVarInt( "no_pilot_collision", 0 ) == 1 )
		player.kv.CollisionGroup = TRACE_COLLISION_GROUP_PLAYER
}

void function PilotCollisionOnTitanBecomesPilot( entity player, entity titan )
{
	if ( GetCurrentPlaylistVarInt( "no_pilot_collision", 0 ) == 1 )
		player.kv.CollisionGroup = TRACE_COLLISION_GROUP_BLOCK_WEAPONS
}
#endif