| falcor (8) | |||
In my text game when the character has the same x and y co-ordinate as the enemy I am trying to delete them however this does not seem to be working as they will just move again even though they both landed on the same co-ordinates on that turn.
Thanks for your time. Any suggestions? | |||
|
Last edited on
|
|||
| James2250 (245) | |
|
It looks like you mean && not &. && = logical AND & = bitwise ADD (which you aren't trying to do here). | |
|
|
|
| falcor (8) | |
|
I did originally have &&, I just decided to try out & with no luck :( sorry, i should have mentioned in the first post | |
|
Last edited on
|
|
| pogrady (410) | |
| I'm guessing that cList is a list of character pointers. If you assign the value of cList at position d = to NULL, you won't be able to delete the thing at that point. You'll want to delete it first, then assign it to NULL. | |
|
|
|
| falcor (8) | |
| Hi pogrady thanks for your post, I just tried it and your suggestion did not work it just provided the same results as having the delete after assigning null | |
|
|
|
| maeriden (244) | |
| What pogrady said is the problem in this function. If it still doesnt work the problem is elsewhere | |
|
|
|
| Jackson Marie (462) | |||
Debug function :
| |||
|
Last edited on
|
|||
| pogrady (410) | |
|
This is a good idea. Otherwise you'll spend LOTS AND LOTS OF TIME DEBUGGING A SIMPLE @%^!@ ERROR THAT COULD HAVE BEEN CAUGHT. Sorry, just ranting. lol. Had a similar situation occur. | |
|
Last edited on
|
|