aboutsummaryrefslogtreecommitdiff
path: root/Northstar.Custom
diff options
context:
space:
mode:
authorDinorush <62536724+Dinorush@users.noreply.github.com>2022-06-20 22:06:56 -0400
committerGitHub <noreply@github.com>2022-06-21 03:06:56 +0100
commit2b46d225b3d2610233410425e254bc30a3a8988f (patch)
treef98136e4e5f020b6fa0a88afcac675d0a02a9240 /Northstar.Custom
parentd70aaafc0ac745113cc4cb9767a3d1f847571d57 (diff)
downloadNorthstarMods-2b46d225b3d2610233410425e254bc30a3a8988f.tar.gz
NorthstarMods-2b46d225b3d2610233410425e254bc30a3a8988f.zip
Fix battery >1 drop logic and crash (#366)
looks great, merging
Diffstat (limited to 'Northstar.Custom')
-rw-r--r--Northstar.Custom/mod/scripts/vscripts/rodeo/_rodeo_titan.gnut26
1 files changed, 13 insertions, 13 deletions
diff --git a/Northstar.Custom/mod/scripts/vscripts/rodeo/_rodeo_titan.gnut b/Northstar.Custom/mod/scripts/vscripts/rodeo/_rodeo_titan.gnut
index 788b6dbed..ad433ae2e 100644
--- a/Northstar.Custom/mod/scripts/vscripts/rodeo/_rodeo_titan.gnut
+++ b/Northstar.Custom/mod/scripts/vscripts/rodeo/_rodeo_titan.gnut
@@ -835,7 +835,7 @@ void function TryBatteryStyleRodeo( entity rodeoPilot, entity rodeoTitan, entity
#endif
bool classicRodeo = MP && GetCurrentPlaylistVarInt( "classic_rodeo", 0 ) == 1
-
+
if ( ShouldThrowGrenadeInHatch( rodeoPilot ) )
{
if ( !classicRodeo )
@@ -845,12 +845,12 @@ void function TryBatteryStyleRodeo( entity rodeoPilot, entity rodeoTitan, entity
{
waitthread PlayerRemovesBatteryPack( rodeoPilot, rodeoTitan, titanSoul, rodeoPackage ) //This ends rodeo at the end of the sequence
}
-
+
#if MP
if ( classicRodeo )
- {
+ {
RodeoBatteryRemoval_ShowBattery( rodeoPilot ) // hide battery, will be shown at the end of a battery removal rodeo
-
+
//This is default R1 style rodeo, with the panel ripped and ready to be shot at
FirstPersonSequenceStruct sequence
sequence.attachment = "hijack"
@@ -861,19 +861,19 @@ void function TryBatteryStyleRodeo( entity rodeoPilot, entity rodeoTitan, entity
RodeoPilotPullsOutWeapon( rodeoPilot, rodeoTitan, rodeoTitanType )
entity weakpointHitbox = CreateClassicRodeoWeakpoint( rodeoPilot, rodeoTitan )
-
+
OnThreadEnd( function() : ( weakpointHitbox )
{
if ( IsValid( weakpointHitbox ) )
weakpointHitbox.Destroy()
})
-
- while ( true )
+
+ while ( true )
{
// the point of no return stuff breaks jumping if you pulled a battery, so do this manually, sucks but whatever
if ( rodeoPilot.IsInputCommandHeld( IN_JUMP ) )
ThrowRiderOff( rodeoPilot, rodeoTitan, CalculateDirectionToThrowOffBatteryThief( rodeoPilot, rodeoTitan ) ) //This signals RodeoOver
-
+
WaitFrame()
}
}
@@ -1691,17 +1691,17 @@ void function Rodeo_DropAllBatteries( entity player )
if ( !PlayerHasBattery( player ) )
return
- while ( GetPlayerBatteryCount( player ) > 1 )
+ float batteryCount = float( GetPlayerBatteryCount( player ) - 1 ) // Floats instead of ints since we need decimal values for the math
+ for ( float i = 1.0; GetPlayerBatteryCount( player ) > 1; i += 1.0 )
{
entity newBattery = Rodeo_CreateBatteryPack()
newBattery.s.touchEnabledTime = Time() + 0.3
- //look into using the players bounds for placement, instead of hardcoded numbers
- array<vector> offsets = [<0,0,0>, <30,0,0>, <0,30,0>, <0,-30,0> ]
- newBattery.SetOrigin( player.GetWorldSpaceCenter() + offsets[ GetPlayerBatteryCount( player ) ] ) //Temp fix, should change the origin
+ vector direction = AnglesToForward( <0, i/batteryCount * 360.0, 0> )
+ newBattery.SetOrigin( player.GetWorldSpaceCenter() + direction * 30 )
newBattery.SetAngles( <0, 0, 0 > )
vector baseVelocity = player.GetVelocity()
baseVelocity.z = 0
- newBattery.SetVelocity( baseVelocity + AnglesToForward( <0, RandomInt( 360.0 ), 0 > ) * 100 + <0,0,1> )
+ newBattery.SetVelocity( baseVelocity + direction * 100 + <0, 0, 1> )
Rodeo_TakeBatteryAwayFromPilot( player )
}