diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-12-11 17:12:25 +0000 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-12-11 17:12:25 +0000 |
commit | 8cd6924c1112213442b755866a5b6811efae236c (patch) | |
tree | 6c04cf94d86e5f7977105f4e8e5a1d64282a44b0 /Northstar.CustomServers/mod/scripts/vscripts/_powerup.gnut | |
parent | b3f0e4598c5c573b0e79a8a9307966d2c07f5e4a (diff) | |
download | NorthstarMods-8cd6924c1112213442b755866a5b6811efae236c.tar.gz NorthstarMods-8cd6924c1112213442b755866a5b6811efae236c.zip |
fixes from playtests
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/_powerup.gnut')
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/_powerup.gnut | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_powerup.gnut b/Northstar.CustomServers/mod/scripts/vscripts/_powerup.gnut index 03b9fcfc..60c4560f 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/_powerup.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/_powerup.gnut @@ -33,9 +33,13 @@ void function PowerupSpawnerThink( entity spawnpoint, PowerUp powerupDef ) svGlobal.levelEnt.EndSignal( "CleanUpEntitiesForRoundEnd" ) entity base = CreatePropDynamic( powerupDef.baseModel, spawnpoint.GetOrigin(), spawnpoint.GetAngles(), 2 ) - OnThreadEnd( function() : ( base ) + + entity powerup + OnThreadEnd( function() : ( base, powerup ) { base.Destroy() + if ( IsValid( powerup ) ) + powerup.Destroy() }) while ( true ) @@ -43,7 +47,7 @@ void function PowerupSpawnerThink( entity spawnpoint, PowerUp powerupDef ) if ( !powerupDef.spawnFunc() ) return - entity powerup = CreateEntity( "item_powerup" ) + powerup = CreateEntity( "item_powerup" ) powerup.SetOrigin( base.GetOrigin() + powerupDef.modelOffset ) powerup.SetAngles( base.GetAngles() + powerupDef.modelAngles ) @@ -62,12 +66,6 @@ void function PowerupSpawnerThink( entity spawnpoint, PowerUp powerupDef ) PickupGlow glow = CreatePickupGlow( powerup, powerupDef.glowColor.x.tointeger(), powerupDef.glowColor.y.tointeger(), powerupDef.glowColor.z.tointeger() ) glow.glowFX.SetOrigin( spawnpoint.GetOrigin() ) // want the glow to be parented to the powerup, but have the position of the spawnpoint - OnThreadEnd( function() : ( powerup ) - { - if ( IsValid( powerup ) ) - powerup.Destroy() - }) - powerup.WaitSignal( "OnDestroy" ) wait powerupDef.respawnDelay } |