aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/scripts/vscripts/_powerup.gnut
diff options
context:
space:
mode:
Diffstat (limited to 'Northstar.CustomServers/scripts/vscripts/_powerup.gnut')
-rw-r--r--Northstar.CustomServers/scripts/vscripts/_powerup.gnut15
1 files changed, 7 insertions, 8 deletions
diff --git a/Northstar.CustomServers/scripts/vscripts/_powerup.gnut b/Northstar.CustomServers/scripts/vscripts/_powerup.gnut
index 3a0ce2733..a6a117afb 100644
--- a/Northstar.CustomServers/scripts/vscripts/_powerup.gnut
+++ b/Northstar.CustomServers/scripts/vscripts/_powerup.gnut
@@ -45,16 +45,16 @@ void function PowerupSpawnerThink( entity spawnpoint, PowerUp powerupDef )
entity powerup = CreateEntity( "item_powerup" )
- // need to do this otherwise the position seems to mess up occasionally
- powerup.SetOrigin( base.GetOrigin() )
- powerup.SetAngles( base.GetAngles() )
- powerup.SetParent( base ) // parenting ensures that gravity isn't an issue
+ powerup.SetOrigin( base.GetOrigin() + powerupDef.modelOffset )
+ powerup.SetAngles( base.GetAngles() + powerupDef.modelAngles )
powerup.SetValueForModelKey( powerupDef.model )
DispatchSpawn( powerup )
- powerup.SetLocalOrigin( powerupDef.modelOffset )
- powerup.SetLocalAngles( powerupDef.modelAngles )
+ // unless i'm doing something really dumb, this all has to be done after dispatchspawn to get the powerup to not have gravity
+ powerup.StopPhysics()
+ powerup.SetOrigin( base.GetOrigin() + powerupDef.modelOffset )
+ powerup.SetAngles( base.GetAngles() + powerupDef.modelAngles )
powerup.SetModel( powerupDef.model )
powerup.s.powerupRef <- powerupDef.itemRef
@@ -65,9 +65,7 @@ void function PowerupSpawnerThink( entity spawnpoint, PowerUp powerupDef )
OnThreadEnd( function() : ( powerup )
{
if ( IsValid( powerup ) )
- {
powerup.Destroy()
- }
})
powerup.WaitSignal( "OnDestroy" )
@@ -86,6 +84,7 @@ bool function OnPowerupCollected( entity player, entity healthpack )
if ( ( powerup.index == ePowerUps.titanTimeReduction || powerup.index == ePowerUps.LTS_TitanTimeReduction ) && PlayerHasBattery( player ) )
return false
+ // idk why the powerup.destroyFunc doesn't just return a bool? would mean they could just handle stuff like this in powerup code
powerup.destroyFunc( player )
return true // destroys the powerup
}