diff options
Diffstat (limited to 'Northstar.Custom/mod')
-rw-r--r-- | Northstar.Custom/mod/scripts/vscripts/sh_custom_pilot_collision.gnut | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Northstar.Custom/mod/scripts/vscripts/sh_custom_pilot_collision.gnut b/Northstar.Custom/mod/scripts/vscripts/sh_custom_pilot_collision.gnut new file mode 100644 index 00000000..b33a4c02 --- /dev/null +++ b/Northstar.Custom/mod/scripts/vscripts/sh_custom_pilot_collision.gnut @@ -0,0 +1,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
\ No newline at end of file |