sysCreateWeaonFire premature expolosions
Posted: Thu May 28, 2009 2:51 am
I have code designed to launch a missile from the cargo hold at the current target, unfortunately, when a fragmenting missile is used, they detonate immediately. I have set the condition to ignore failsafes to both "true" and "false", but they explode immediately.
also, missiles don't fragment on direct hits, but that's a different topic completely.
here's the important bit, the rest is devoted to deciding what to do.
where the data in "sweapon" is the unid for a fragmentation missile and intVectorAngle finds the direction to the target.
also, missiles don't fragment on direct hits, but that's a different topic completely.
here's the important bit, the rest is devoted to deciding what to do.
Code: Select all
(block Nil
(sysCreateWeaponFire (objGetData gSource "sweapon") gSource (objGetPos gSource) (intVectorAngle gSource (objGetTarget gSource)) 40 (objGetTarget gSource) False)
(objRemoveItem gSource (itmCreate (objGetData gSource "sweapon") 1) 1)
)