aboutsummaryrefslogtreecommitdiff
path: root/Northstar.Custom/mod/scripts/vscripts/sh_custom_air_accel.gnut
blob: faa9248048529dbe9c695d3004c9bc1fd018c293 (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
global function CustomAirAccelVars_Init

void function CustomAirAccelVars_Init()
{	
	#if MP
		AddPrivateMatchModeSettingArbitrary( "#MODE_SETTING_CATEGORY_PILOT", "custom_air_accel_pilot", "500" ) // 500 is the default airaccel
	#endif
	
	#if SERVER
		AddCallback_OnPlayerRespawned( ApplyCustomPlayerAirAccel )
		AddCallback_OnPilotBecomesTitan( ApplyCustomPlayerAirAccelFromTitan ) // not sure if necessary but assuming it is
	#endif
}

#if SERVER
void function ApplyCustomPlayerAirAccel( entity player )
{
	player.kv.airAcceleration = GetCurrentPlaylistVarInt( "custom_air_accel_pilot", int( player.GetPlayerSettingsField( "airAcceleration" ) ) )
}

void function ApplyCustomPlayerAirAccelFromTitan( entity player, entity titan )
{
	player.kv.airAcceleration = GetCurrentPlaylistVarInt( "custom_air_accel_pilot", int( player.GetPlayerSettingsField( "airAcceleration" ) ) )
}
#endif