[Suggestion, PRPL] Make GetParticleMotion return (0, 0) on invalid ID

Started by kajacx, March 27, 2017, 08:04:41 PM

Previous topic - Next topic

kajacx

Currently, GetParticleMotion only pushes the motion data onto stack when the provided PID is valid. When the PID doesn't exists or it isn't a particle, no data is pushed onto the stack!

That can seriously mess up the stack calculations, especially for someone who likes to leave lot of arguments on stack instead of using variables (for efficiency reasons for example). In such screario, the "Taking item from an empty stack" warning can be delayed significantly, making debugging unnecessarily hard.

So, can GetParticleMotion push (0,0) onto the stack instead of nothing when it doesn't have a valid particle id? (And preferably a warning as well - maybe only visible when in editor mode?)
Why do work yourself, when you can write a program that will do the work for you.