The player pointer is a global pointer and global pointers can not be NULL for one function and non NULL for another, because they are either NULL for all functions, or non NULL for all functions.

As a programmer I know the problem with the goblins and this sounds like one. Such problems always turn out to be a missing semicolon or setting something at the wrong moment or a = instead of == or the like. I think you can easily find out whats happening when you put a breakpoint in the function that does not get the player pointer correctly, and debug it single step wise.