like they say "follow the money trail" , so you follow the program flow and trace the problem. .
yeah I am no programming god , I am sure I wil require your help one day.
but..
to legitimately answer your question , and I am sure you went about it the same manner as I , since it happens when pressing space ,we simply jump to where space is handled , if the problem is not easy to spot and you do not understand the problem then , you can resort to trial and error like : start commenting code out piece by piece and publish everytime until you figure out which code area holds the mistake , then you simply can trace whatever is used in that area (variables/functions/pointers) to find the cause , if things get really hairy you can always use printf or DEBUG_VAR to help out , the point being to always check any values / pointers / functions / variables in the area you have traced .
if however you understand the language and engine better , you can approach the problem more methodical , I basically just jumped to the space handled code and looked at everything used there , then I quickly spotted that the sound handle was an uninitialised variable , since it needed to be assigned to something I traced to where the sound was to be used and connected the dots ..
other than that , all I can really advice you on is ,that every mistake is an opportunity to learn , mistakes wil teach you more than anyone can ever teach you , why ? Because one's you have gone through hell to find out what went wrong , you won't forget it because you actually learned to understand the mistake .
there wil come a time when bug hunting becomes fun , but all of us go through this mistakes even after years of coding , the simplest of mistakes have at times given me headaches like adding 2 ";;" at the end of a line ,almost impossible to spot at times .
with SED my advice is to do as my signature states , compile often (publish often) after code additions / changes , and as always check values/pointers before using them with "if clauses" or functions/macros you have written to do it for you.
Last edited by Wjbender; 06/06/15 10:29.