Posted By: darkinferno
tell if physics is enabled on an ent - 01/05/10 18:15
just seeking a quick answer, you guys have any idea on how to check if physics is enabled on a certain entity?
Posted By: Quad
Re: tell if physics is enabled on an ent - 01/05/10 18:24
idk if there is a function or property to check this but you could set a skill of every physical entity to 1 when you enable physics on them.
Posted By: darkinferno
Re: tell if physics is enabled on an ent - 01/05/10 18:46
yes i figured and thats what i currently do, just wondering if theres another way
Posted By: EvilSOB
Re: tell if physics is enabled on an ent - 01/05/10 20:50
Maybe you could use "phent_getvelocity" ?
This function returns a 1 or a 0 on sucess or fail, and the only reason
I can think of for a fail is a NON-physics object.
So, in theory, you could use
if(phent_getvelocity(my_entity, vector(0,0,0), nullvector)) { ... IS physics entity ... }
to test if it is a physics-enabled entity.
(BTW, the "vector(0,0,0)" just dumps the returned velocity into limbo if the function succeeds)